source: mainline/uspace/srv/hid/display/window.c@ 1e4a937

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 1e4a937 was a2e104e, checked in by Jiri Svoboda <jiri@…>, 5 years ago

Move windows by dragging decoration

Or dragging anywhere with button 2. Need to add Ctrl/Alt/Shift state
to pos_event_t and change the latter to Alt-drag/Shift-drag.

  • Property mode set to 100644
File size: 15.2 KB
RevLine 
[c8cf261]1/*
2 * Copyright (c) 2019 Jiri Svoboda
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @addtogroup display
30 * @{
31 */
32/**
33 * @file GFX window backend
34 *
35 * This implements a graphics context over display server window.
36 */
37
[0008c0f]38#include <gfx/bitmap.h>
[c8cf261]39#include <gfx/color.h>
[0008c0f]40#include <gfx/coord.h>
[c8cf261]41#include <gfx/context.h>
42#include <gfx/render.h>
43#include <io/log.h>
[946a666]44#include <io/pixelmap.h>
[c8cf261]45#include <stdlib.h>
[b3c185b6]46#include "client.h"
[6af4b4f]47#include "display.h"
48#include "window.h"
[c8cf261]49
[6af4b4f]50static errno_t ds_window_set_color(void *, gfx_color_t *);
51static errno_t ds_window_fill_rect(void *, gfx_rect_t *);
[0008c0f]52static errno_t ds_window_bitmap_create(void *, gfx_bitmap_params_t *,
53 gfx_bitmap_alloc_t *, void **);
54static errno_t ds_window_bitmap_destroy(void *);
55static errno_t ds_window_bitmap_render(void *, gfx_rect_t *, gfx_coord2_t *);
56static errno_t ds_window_bitmap_get_alloc(void *, gfx_bitmap_alloc_t *);
[c8cf261]57
[6af4b4f]58gfx_context_ops_t ds_window_ops = {
59 .set_color = ds_window_set_color,
[0008c0f]60 .fill_rect = ds_window_fill_rect,
61 .bitmap_create = ds_window_bitmap_create,
62 .bitmap_destroy = ds_window_bitmap_destroy,
63 .bitmap_render = ds_window_bitmap_render,
64 .bitmap_get_alloc = ds_window_bitmap_get_alloc
[c8cf261]65};
66
67/** Set color on window GC.
68 *
69 * Set drawing color on window GC.
70 *
71 * @param arg Console GC
72 * @param color Color
73 *
74 * @return EOK on success or an error code
75 */
[6af4b4f]76static errno_t ds_window_set_color(void *arg, gfx_color_t *color)
[c8cf261]77{
[6af4b4f]78 ds_window_t *wnd = (ds_window_t *) arg;
[946a666]79 uint16_t r, g, b;
[c8cf261]80
[87a7cdb]81 log_msg(LOG_DEFAULT, LVL_NOTE, "gc_set_color gc=%p",
82 ds_display_get_gc(wnd->display));
[946a666]83
84 gfx_color_get_rgb_i16(color, &r, &g, &b);
85 wnd->color = PIXEL(0, r >> 8, g >> 8, b >> 8);
86
[87a7cdb]87 return gfx_set_color(ds_display_get_gc(wnd->display), color);
[c8cf261]88}
89
90/** Fill rectangle on window GC.
91 *
[6af4b4f]92 * @param arg Window GC
[c8cf261]93 * @param rect Rectangle
94 *
95 * @return EOK on success or an error code
96 */
[6af4b4f]97static errno_t ds_window_fill_rect(void *arg, gfx_rect_t *rect)
[c8cf261]98{
[6af4b4f]99 ds_window_t *wnd = (ds_window_t *) arg;
[65160d7]100 gfx_rect_t crect;
[22faaf2]101 gfx_rect_t drect;
[946a666]102 gfx_coord_t x, y;
[c8cf261]103
104 log_msg(LOG_DEFAULT, LVL_NOTE, "gc_fill_rect");
[946a666]105
[65160d7]106 gfx_rect_clip(rect, &wnd->rect, &crect);
107 gfx_rect_translate(&wnd->dpos, &crect, &drect);
[946a666]108
109 /* Render a copy to the backbuffer */
110 for (y = crect.p0.y; y < crect.p1.y; y++) {
111 for (x = crect.p0.x; x < crect.p1.x; x++) {
112 pixelmap_put_pixel(&wnd->pixelmap, x - wnd->rect.p0.x,
113 y - wnd->rect.p0.y, wnd->color);
114 }
115 }
116
[87a7cdb]117 return gfx_fill_rect(ds_display_get_gc(wnd->display), &drect);
[c8cf261]118}
119
[946a666]120/** Create bitmap in window GC.
[0008c0f]121 *
[946a666]122 * @param arg Window GC
[0008c0f]123 * @param params Bitmap params
124 * @param alloc Bitmap allocation info or @c NULL
125 * @param rbm Place to store pointer to new bitmap
126 * @return EOK on success or an error code
127 */
128errno_t ds_window_bitmap_create(void *arg, gfx_bitmap_params_t *params,
129 gfx_bitmap_alloc_t *alloc, void **rbm)
130{
131 ds_window_t *wnd = (ds_window_t *) arg;
132 ds_window_bitmap_t *cbm = NULL;
133 errno_t rc;
134
135 cbm = calloc(1, sizeof(ds_window_bitmap_t));
136 if (cbm == NULL)
137 return ENOMEM;
138
[87a7cdb]139 rc = gfx_bitmap_create(ds_display_get_gc(wnd->display), params, alloc,
[b3c185b6]140 &cbm->bitmap);
[0008c0f]141 if (rc != EOK)
142 goto error;
143
144 cbm->wnd = wnd;
[65160d7]145 cbm->rect = params->rect;
[0008c0f]146 *rbm = (void *)cbm;
147 return EOK;
148error:
149 if (cbm != NULL)
150 free(cbm);
151 return rc;
152}
153
[946a666]154/** Destroy bitmap in window GC.
[0008c0f]155 *
156 * @param bm Bitmap
157 * @return EOK on success or an error code
158 */
159static errno_t ds_window_bitmap_destroy(void *bm)
160{
161 ds_window_bitmap_t *cbm = (ds_window_bitmap_t *)bm;
162
163 gfx_bitmap_destroy(cbm->bitmap);
164 free(cbm);
165 return EOK;
166}
167
[946a666]168/** Render bitmap in window GC.
[0008c0f]169 *
170 * @param bm Bitmap
171 * @param srect0 Source rectangle or @c NULL
172 * @param offs0 Offset or @c NULL
173 * @return EOK on success or an error code
174 */
175static errno_t ds_window_bitmap_render(void *bm, gfx_rect_t *srect0,
176 gfx_coord2_t *offs0)
177{
178 ds_window_bitmap_t *cbm = (ds_window_bitmap_t *)bm;
[22faaf2]179 gfx_coord2_t doffs;
[65160d7]180 gfx_coord2_t offs;
181 gfx_rect_t srect;
182 gfx_rect_t swrect;
183 gfx_rect_t crect;
[946a666]184 gfx_coord_t x, y;
185 pixelmap_t pixelmap;
186 gfx_bitmap_alloc_t alloc;
187 pixel_t pixel;
188 errno_t rc;
[65160d7]189
190 if (srect0 != NULL) {
191 /* Clip source rectangle to bitmap rectangle */
192 gfx_rect_clip(srect0, &cbm->rect, &srect);
193 } else {
194 /* Source is entire bitmap rectangle */
195 srect = cbm->rect;
196 }
197
198 if (offs0 != NULL) {
199 offs = *offs0;
200 } else {
201 offs.x = 0;
202 offs.y = 0;
203 }
204
205 /* Transform window rectangle back to bitmap coordinate system */
206 gfx_rect_rtranslate(&offs, &cbm->wnd->rect, &swrect);
207
208 /* Clip so that transformed rectangle will be inside the window */
209 gfx_rect_clip(&srect, &swrect, &crect);
210
211 /* Offset for rendering on screen = window pos + offs */
212 gfx_coord2_add(&cbm->wnd->dpos, &offs, &doffs);
[22faaf2]213
[946a666]214 rc = gfx_bitmap_get_alloc(cbm->bitmap, &alloc);
215 if (rc != EOK)
216 return rc;
217
218 pixelmap.width = cbm->rect.p1.x - cbm->rect.p0.x;
219 pixelmap.height = cbm->rect.p1.y - cbm->rect.p0.y;
220 pixelmap.data = alloc.pixels;
221
222 /* Render a copy to the backbuffer */
223 for (y = crect.p0.y; y < crect.p1.y; y++) {
224 for (x = crect.p0.x; x < crect.p1.x; x++) {
225 pixel = pixelmap_get_pixel(&pixelmap,
226 x - cbm->rect.p0.x, y - cbm->rect.p0.y);
227 pixelmap_put_pixel(&cbm->wnd->pixelmap,
228 x + offs.x - cbm->rect.p0.x + cbm->wnd->rect.p0.x,
229 y + offs.y - cbm->rect.p0.y + cbm->wnd->rect.p0.y,
230 pixel);
231 }
232 }
233
234 return gfx_bitmap_render(cbm->bitmap, &crect, &doffs);
[0008c0f]235}
236
[946a666]237/** Get allocation info for bitmap in window GC.
[0008c0f]238 *
239 * @param bm Bitmap
240 * @param alloc Place to store allocation info
241 * @return EOK on success or an error code
242 */
243static errno_t ds_window_bitmap_get_alloc(void *bm, gfx_bitmap_alloc_t *alloc)
244{
245 ds_window_bitmap_t *cbm = (ds_window_bitmap_t *)bm;
246
247 return gfx_bitmap_get_alloc(cbm->bitmap, alloc);
248}
249
[6af4b4f]250/** Create window.
[c8cf261]251 *
252 * Create graphics context for rendering into a window.
253 *
[8e9781f]254 * @param client Client owning the window
[3434233]255 * @param params Window parameters
[c8cf261]256 * @param rgc Place to store pointer to new GC.
257 *
258 * @return EOK on success or an error code
259 */
[3434233]260errno_t ds_window_create(ds_client_t *client, display_wnd_params_t *params,
261 ds_window_t **rgc)
[c8cf261]262{
[6af4b4f]263 ds_window_t *wnd = NULL;
[c8cf261]264 gfx_context_t *gc = NULL;
[946a666]265 gfx_context_t *dgc;
266 gfx_coord2_t dims;
267 gfx_bitmap_params_t bparams;
268 gfx_bitmap_alloc_t alloc;
[c8cf261]269 errno_t rc;
270
[6af4b4f]271 wnd = calloc(1, sizeof(ds_window_t));
272 if (wnd == NULL) {
[c8cf261]273 rc = ENOMEM;
274 goto error;
275 }
276
[6af4b4f]277 rc = gfx_context_new(&ds_window_ops, wnd, &gc);
[c8cf261]278 if (rc != EOK)
279 goto error;
280
[b3c185b6]281 ds_client_add_window(client, wnd);
[fd777a2]282 ds_display_add_window(client->display, wnd);
[6af4b4f]283
[a8eed5f]284 gfx_bitmap_params_init(&bparams);
[946a666]285 bparams.rect = params->rect;
286
287 dgc = ds_display_get_gc(wnd->display); // XXX
288 if (dgc != NULL) {
289 rc = gfx_bitmap_create(dgc, &bparams, NULL, &wnd->bitmap);
290 if (rc != EOK)
291 goto error;
292
293 rc = gfx_bitmap_get_alloc(wnd->bitmap, &alloc);
294 if (rc != EOK)
295 goto error;
296
[0e6e77f]297 gfx_rect_dims(&params->rect, &dims);
[946a666]298 wnd->pixelmap.width = dims.x;
299 wnd->pixelmap.height = dims.y;
300 wnd->pixelmap.data = alloc.pixels;
301 }
302
[3434233]303 wnd->rect = params->rect;
[6af4b4f]304 wnd->gc = gc;
305 *rgc = wnd;
[c8cf261]306 return EOK;
307error:
[946a666]308 if (wnd != NULL) {
309 if (wnd->bitmap != NULL)
310 gfx_bitmap_destroy(wnd->bitmap);
[6af4b4f]311 free(wnd);
[946a666]312 }
313
[c8cf261]314 gfx_context_delete(gc);
315 return rc;
316}
317
[0e6e77f]318/** Destroy window.
[c8cf261]319 *
[0e6e77f]320 * @param wnd Window
[c8cf261]321 */
[da412547]322void ds_window_destroy(ds_window_t *wnd)
[c8cf261]323{
[cc90846]324 ds_display_t *disp;
325
326 disp = wnd->display;
327
[b3c185b6]328 ds_client_remove_window(wnd);
[fd777a2]329 ds_display_remove_window(wnd);
[cc90846]330
[da412547]331 (void) gfx_context_delete(wnd->gc);
[946a666]332 if (wnd->bitmap != NULL)
333 gfx_bitmap_destroy(wnd->bitmap);
[c8cf261]334
[6af4b4f]335 free(wnd);
[cc90846]336
337 (void) ds_display_paint(disp, NULL);
[c8cf261]338}
339
[0e6e77f]340/** Resize window.
341 *
342 * @param wnd Window
343 */
344errno_t ds_window_resize(ds_window_t *wnd, gfx_coord2_t *offs,
345 gfx_rect_t *nrect)
346{
347 gfx_context_t *dgc;
348 gfx_bitmap_params_t bparams;
349 gfx_bitmap_t *nbitmap;
350 pixelmap_t npixelmap;
351 gfx_coord2_t dims;
352 gfx_bitmap_alloc_t alloc;
353 gfx_coord2_t ndpos;
354 errno_t rc;
355
356 dgc = ds_display_get_gc(wnd->display); // XXX
357 if (dgc != NULL) {
[a8eed5f]358 gfx_bitmap_params_init(&bparams);
[0e6e77f]359 bparams.rect = *nrect;
360
361 rc = gfx_bitmap_create(dgc, &bparams, NULL, &nbitmap);
362 if (rc != EOK)
363 return ENOMEM;
364
365 rc = gfx_bitmap_get_alloc(nbitmap, &alloc);
366 if (rc != EOK) {
367 gfx_bitmap_destroy(nbitmap);
368 return ENOMEM;
369 }
370
371 gfx_rect_dims(nrect, &dims);
372 npixelmap.width = dims.x;
373 npixelmap.height = dims.y;
374 npixelmap.data = alloc.pixels;
375
376 /* TODO: Transfer contents within overlap */
377
378 if (wnd->bitmap != NULL)
379 gfx_bitmap_destroy(wnd->bitmap);
380
381 wnd->bitmap = nbitmap;
382 wnd->pixelmap = npixelmap;
383 }
384
385 gfx_coord2_add(&wnd->dpos, offs, &ndpos);
386
387 wnd->dpos = ndpos;
388 wnd->rect = *nrect;
389
390 (void) ds_display_paint(wnd->display, NULL);
391 return EOK;
392}
393
[6af4b4f]394/** Get generic graphic context from window.
[c8cf261]395 *
[6af4b4f]396 * @param wnd Window
[c8cf261]397 * @return Graphic context
398 */
[6af4b4f]399gfx_context_t *ds_window_get_ctx(ds_window_t *wnd)
[c8cf261]400{
[6af4b4f]401 return wnd->gc;
[c8cf261]402}
403
[2012fe0]404/** Paint a window using its backing bitmap.
[946a666]405 *
[2012fe0]406 * @param wnd Window to paint
407 * @param rect Display rectangle to paint to
[946a666]408 * @return EOK on success or an error code
409 */
[2012fe0]410errno_t ds_window_paint(ds_window_t *wnd, gfx_rect_t *rect)
[946a666]411{
[2012fe0]412 gfx_rect_t srect;
413 gfx_rect_t *brect;
414 gfx_rect_t crect;
415
416 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_paint");
417
418 if (rect != NULL) {
419 gfx_rect_rtranslate(&wnd->dpos, rect, &srect);
420
421 /* Determine if we have anything to do */
[01c2759]422 gfx_rect_clip(&srect, &wnd->rect, &crect);
[2012fe0]423 if (gfx_rect_is_empty(&crect))
424 return EOK;
425
426 brect = &srect;
427 } else {
428 brect = NULL;
429 }
430
[f5191b4]431 /* This can happen in unit tests */
432 if (wnd->bitmap == NULL)
433 return EOK;
434
[2012fe0]435 return gfx_bitmap_render(wnd->bitmap, brect, &wnd->dpos);
[946a666]436}
437
[a2e104e]438/** Start moving a window, detected by client.
439 *
440 * @param wnd Window
441 * @param pos Position where the pointer was when the move started
442 * relative to the window
443 * @param event Button press event
444 */
445void ds_window_move_req(ds_window_t *wnd, gfx_coord2_t *pos)
446{
447 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_move_req (%d, %d)",
448 (int) pos->x, (int) pos->y);
449
450 if (wnd->state != dsw_idle)
451 return;
452
453 gfx_coord2_add(&wnd->dpos, pos, &wnd->orig_pos);
454 wnd->state = dsw_moving;
455}
456
[a40ae0d]457/** Start moving a window by mouse drag.
458 *
459 * @param wnd Window
460 * @param event Button press event
461 */
462static void ds_window_start_move(ds_window_t *wnd, pos_event_t *event)
463{
464 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_start_move (%d, %d)",
465 (int) event->hpos, (int) event->vpos);
466
[a2e104e]467 if (wnd->state != dsw_idle)
468 return;
[a40ae0d]469
470 wnd->orig_pos.x = event->hpos;
471 wnd->orig_pos.y = event->vpos;
472 wnd->state = dsw_moving;
473}
474
475/** Finish moving a window by mouse drag.
476 *
477 * @param wnd Window
478 * @param event Button release event
479 */
480static void ds_window_finish_move(ds_window_t *wnd, pos_event_t *event)
481{
482 gfx_coord2_t pos;
483 gfx_coord2_t dmove;
484 gfx_coord2_t nwpos;
485
486 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_finish_move (%d, %d)",
487 (int) event->hpos, (int) event->vpos);
488
[a2e104e]489 if (wnd->state != dsw_moving)
490 return;
491
[a40ae0d]492 pos.x = event->hpos;
493 pos.y = event->vpos;
494 gfx_coord2_subtract(&pos, &wnd->orig_pos, &dmove);
495
496 gfx_coord2_add(&wnd->dpos, &dmove, &nwpos);
497 wnd->dpos = nwpos;
498 wnd->state = dsw_idle;
[946a666]499
[2012fe0]500 (void) ds_display_paint(wnd->display, NULL);
[a40ae0d]501}
502
503/** Update window position when moving by mouse drag.
504 *
505 * @param wnd Window
506 * @param event Position update event
507 */
508static void ds_window_update_move(ds_window_t *wnd, pos_event_t *event)
509{
510 gfx_coord2_t pos;
511 gfx_coord2_t dmove;
512 gfx_coord2_t nwpos;
513 gfx_rect_t drect;
514 gfx_color_t *color;
515 gfx_context_t *gc;
516 errno_t rc;
517
518 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_update_move (%d, %d)",
519 (int) event->hpos, (int) event->vpos);
520
[a2e104e]521 if (wnd->state != dsw_moving)
522 return;
523
[c79545e]524 gfx_rect_translate(&wnd->dpos, &wnd->rect, &drect);
525
526 gc = ds_display_get_gc(wnd->display); // XXX
527 if (gc != NULL) {
528 gfx_set_color(gc, wnd->display->bg_color);
529 gfx_fill_rect(gc, &drect);
530 }
531
[a40ae0d]532 pos.x = event->hpos;
533 pos.y = event->vpos;
534 gfx_coord2_subtract(&pos, &wnd->orig_pos, &dmove);
535
536 gfx_coord2_add(&wnd->dpos, &dmove, &nwpos);
537 gfx_rect_translate(&nwpos, &wnd->rect, &drect);
538
[c79545e]539 wnd->orig_pos = pos;
540 wnd->dpos = nwpos;
541
[a40ae0d]542 rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &color);
543 if (rc != EOK)
544 return;
545
546 gc = ds_display_get_gc(wnd->display); // XXX
547 if (gc != NULL) {
[946a666]548 gfx_set_color(gc, color);
549 gfx_fill_rect(gc, &drect);
[a40ae0d]550 }
551
552 gfx_color_delete(color);
553}
554
[338d0935]555/** Post keyboard event to window.
556 *
557 * @param wnd Window
558 * @param event Event
559 *
560 * @return EOK on success or an error code
561 */
562errno_t ds_window_post_kbd_event(ds_window_t *wnd, kbd_event_t *event)
563{
564 bool alt_or_shift;
565
566 alt_or_shift = event->mods & (KM_SHIFT | KM_ALT);
567
568 if (event->type == KEY_PRESS && alt_or_shift && event->key == KC_F4) {
569 /* On Alt-F4 or Shift-F4 send close event to the window */
570 ds_client_post_close_event(wnd->client, wnd);
571 return EOK;
572 }
573
574 return ds_client_post_kbd_event(wnd->client, wnd, event);
575}
576
[a40ae0d]577/** Post position event to window.
578 *
579 * @param wnd Window
580 * @param event Position event
581 */
582errno_t ds_window_post_pos_event(ds_window_t *wnd, pos_event_t *event)
583{
[f7fb2b21]584 pos_event_t tevent;
[a2e104e]585 gfx_coord2_t pos;
586 gfx_rect_t drect;
587 bool inside;
[f7fb2b21]588
[a40ae0d]589 log_msg(LOG_DEFAULT, LVL_DEBUG,
590 "ds_window_post_pos_event type=%d pos=%d,%d\n", event->type,
591 (int) event->hpos, (int) event->vpos);
592
[a2e104e]593 pos.x = event->hpos;
594 pos.y = event->vpos;
595 gfx_rect_translate(&wnd->dpos, &wnd->rect, &drect);
596 inside = gfx_pix_inside_rect(&pos, &drect);
[a40ae0d]597
[a2e104e]598 if (event->type == POS_PRESS && event->btn_num == 2 && inside)
599 ds_window_start_move(wnd, event);
[a40ae0d]600
[a2e104e]601 if (event->type == POS_RELEASE)
602 ds_window_finish_move(wnd, event);
603
604 if (event->type == POS_UPDATE)
605 ds_window_update_move(wnd, event);
[a40ae0d]606
[f7fb2b21]607 /* Transform event coordinates to window-local */
608 tevent = *event;
609 tevent.hpos -= wnd->dpos.x;
610 tevent.vpos -= wnd->dpos.y;
611
612 return ds_client_post_pos_event(wnd->client, wnd, &tevent);
[a40ae0d]613}
614
[b0a94854]615/** Post focus event to window.
616 *
617 * @param wnd Window
618 */
619errno_t ds_window_post_focus_event(ds_window_t *wnd)
620{
621 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_post_focus_event\n");
622
623 return ds_client_post_focus_event(wnd->client, wnd);
624}
625
626/** Post unfocus event to window.
627 *
628 * @param wnd Window
629 */
630errno_t ds_window_post_unfocus_event(ds_window_t *wnd)
631{
632 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_post_unfocus_event\n");
633
634 return ds_client_post_unfocus_event(wnd->client, wnd);
635}
636
[c8cf261]637/** @}
638 */
Note: See TracBrowser for help on using the repository browser.