source: mainline/uspace/lib/ui/src/window.c@ d70dc1c4

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

Resize application GC when resizing window (and app GC is being used)

  • Property mode set to 100644
File size: 17.2 KB
RevLine 
[f7a90df]1/*
2 * Copyright (c) 2020 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 libui
30 * @{
31 */
32/**
33 * @file Window
34 */
35
36#include <display.h>
37#include <errno.h>
[66a2becf]38#include <gfx/bitmap.h>
[f7a90df]39#include <gfx/context.h>
[fa01c05]40#include <gfx/render.h>
[f03d1308]41#include <io/kbd_event.h>
[d284ce9]42#include <io/pos_event.h>
[f7a90df]43#include <mem.h>
[66a2becf]44#include <memgfx/memgc.h>
[f7a90df]45#include <stdlib.h>
[b71c0fc]46#include <ui/control.h>
[f7a90df]47#include <ui/resource.h>
48#include <ui/wdecor.h>
49#include <ui/window.h>
[b71c0fc]50#include "../private/control.h"
[f7a90df]51#include "../private/dummygc.h"
[fa01c05]52#include "../private/resource.h"
[f7a90df]53#include "../private/ui.h"
[d284ce9]54#include "../private/wdecor.h"
[f7a90df]55#include "../private/window.h"
56
[d284ce9]57static void dwnd_close_event(void *);
58static void dwnd_focus_event(void *);
59static void dwnd_kbd_event(void *, kbd_event_t *);
60static void dwnd_pos_event(void *, pos_event_t *);
[2d879f7]61static void dwnd_resize_event(void *, gfx_rect_t *);
[d284ce9]62static void dwnd_unfocus_event(void *);
63
64static display_wnd_cb_t dwnd_cb = {
65 .close_event = dwnd_close_event,
66 .focus_event = dwnd_focus_event,
67 .kbd_event = dwnd_kbd_event,
68 .pos_event = dwnd_pos_event,
[2d879f7]69 .resize_event = dwnd_resize_event,
[d284ce9]70 .unfocus_event = dwnd_unfocus_event
71};
72
73static void wd_close(ui_wdecor_t *, void *);
74static void wd_move(ui_wdecor_t *, void *, gfx_coord2_t *);
[2d879f7]75static void wd_resize(ui_wdecor_t *, void *, ui_wdecor_rsztype_t,
76 gfx_coord2_t *);
77static void wd_set_cursor(ui_wdecor_t *, void *, ui_stock_cursor_t);
[d284ce9]78
79static ui_wdecor_cb_t wdecor_cb = {
80 .close = wd_close,
[2d879f7]81 .move = wd_move,
82 .resize = wd_resize,
83 .set_cursor = wd_set_cursor
[d284ce9]84};
85
[66a2becf]86static void ui_window_app_update(void *, gfx_rect_t *);
87
[f7a90df]88/** Initialize window parameters structure.
89 *
90 * Window parameters structure must always be initialized using this function
[266ec54]91 * first. By default, the window will be decorated. To get a non-decorated
92 * window, one needs to clear ui_wds_decorated
93 * (e.g. params->style &= ~ui_wds_decorated).
[f7a90df]94 *
95 * @param params Window parameters structure
96 */
[d284ce9]97void ui_wnd_params_init(ui_wnd_params_t *params)
[f7a90df]98{
[d284ce9]99 memset(params, 0, sizeof(ui_wnd_params_t));
[266ec54]100
101 /* Make window decorated by default. */
102 params->style = ui_wds_decorated;
[f7a90df]103}
104
105/** Create new window.
106 *
107 * @param ui User interface
108 * @param params Window parameters
109 * @param rwindow Place to store pointer to new window
110 * @return EOK on success or an error code
111 */
[d284ce9]112errno_t ui_window_create(ui_t *ui, ui_wnd_params_t *params,
[f7a90df]113 ui_window_t **rwindow)
114{
115 ui_window_t *window;
[06d0c81]116 display_info_t info;
117 gfx_coord2_t pos;
[266ec54]118 gfx_coord2_t scr_dims;
[f7a90df]119 display_wnd_params_t dparams;
120 display_window_t *dwindow = NULL;
121 gfx_context_t *gc = NULL;
122 ui_resource_t *res = NULL;
123 ui_wdecor_t *wdecor = NULL;
124 dummy_gc_t *dgc = NULL;
125 errno_t rc;
126
127 window = calloc(1, sizeof(ui_window_t));
128 if (window == NULL)
129 return ENOMEM;
130
131 display_wnd_params_init(&dparams);
[d284ce9]132 dparams.rect = params->rect;
[2d879f7]133 /* Only allow making the window larger */
134 gfx_rect_dims(&params->rect, &dparams.min_size);
[f7a90df]135
136 if (ui->display != NULL) {
[266ec54]137 if (params->placement != ui_wnd_place_default) {
138 rc = display_get_info(ui->display, &info);
139 if (rc != EOK)
140 goto error;
141 }
142
143 if (params->placement == ui_wnd_place_full_screen) {
144 /* Make window the size of the screen */
145 gfx_rect_dims(&info.rect, &scr_dims);
146 gfx_coord2_add(&dparams.rect.p0, &scr_dims,
147 &dparams.rect.p1);
148 }
149
[d284ce9]150 rc = display_window_create(ui->display, &dparams, &dwnd_cb,
151 (void *) window, &dwindow);
[f7a90df]152 if (rc != EOK)
153 goto error;
154
[06d0c81]155 if (params->placement != ui_wnd_place_default) {
156 pos.x = 0;
157 pos.y = 0;
158
159 switch (params->placement) {
160 case ui_wnd_place_default:
161 assert(false);
162 case ui_wnd_place_top_left:
[266ec54]163 case ui_wnd_place_full_screen:
[06d0c81]164 pos.x = info.rect.p0.x - params->rect.p0.x;
165 pos.y = info.rect.p0.y - params->rect.p0.y;
166 break;
167 case ui_wnd_place_top_right:
168 pos.x = info.rect.p1.x - params->rect.p1.x;
169 pos.y = info.rect.p0.y - params->rect.p0.y;
170 break;
171 case ui_wnd_place_bottom_left:
172 pos.x = info.rect.p0.x - params->rect.p0.x;
173 pos.y = info.rect.p1.y - params->rect.p1.y;
174 break;
175 case ui_wnd_place_bottom_right:
176 pos.x = info.rect.p1.x - params->rect.p1.x;
177 pos.y = info.rect.p1.y - params->rect.p1.y;
178 break;
179 }
180
181 rc = display_window_move(dwindow, &pos);
182 if (rc != EOK)
183 goto error;
184 }
185
[f7a90df]186 rc = display_window_get_gc(dwindow, &gc);
187 if (rc != EOK)
188 goto error;
189 } else {
190 /* Needed for unit tests */
191 rc = dummygc_create(&dgc);
192 if (rc != EOK)
193 goto error;
194
195 gc = dummygc_get_ctx(dgc);
196 }
197
198 rc = ui_resource_create(gc, &res);
199 if (rc != EOK)
200 goto error;
201
[2d879f7]202 rc = ui_wdecor_create(res, params->caption, params->style, &wdecor);
[f7a90df]203 if (rc != EOK)
204 goto error;
205
[266ec54]206 ui_wdecor_set_rect(wdecor, &dparams.rect);
[d284ce9]207 ui_wdecor_set_cb(wdecor, &wdecor_cb, (void *) window);
208 ui_wdecor_paint(wdecor);
209
[f7a90df]210 window->ui = ui;
211 window->dwindow = dwindow;
[266ec54]212 window->rect = dparams.rect;
[f7a90df]213 window->gc = gc;
214 window->res = res;
215 window->wdecor = wdecor;
[2d879f7]216 window->cursor = ui_curs_arrow;
[f7a90df]217 *rwindow = window;
218 return EOK;
219error:
220 if (wdecor != NULL)
221 ui_wdecor_destroy(wdecor);
222 if (res != NULL)
223 ui_resource_destroy(res);
224 if (dgc != NULL)
225 dummygc_destroy(dgc);
226 if (dwindow != NULL)
227 display_window_destroy(dwindow);
228 free(window);
229 return rc;
230}
231
232/** Destroy window.
233 *
234 * @param window Window or @c NULL
235 */
236void ui_window_destroy(ui_window_t *window)
237{
238 if (window == NULL)
239 return;
240
[b71c0fc]241 ui_control_destroy(window->control);
[f7a90df]242 ui_wdecor_destroy(window->wdecor);
243 ui_resource_destroy(window->res);
244 gfx_context_delete(window->gc);
245 display_window_destroy(window->dwindow);
246 free(window);
247}
248
[b71c0fc]249/** Add control to window.
250 *
251 * Only one control can be added to a window. If more than one control
252 * is added, the results are undefined.
253 *
254 * @param fixed Fixed layout
255 * @param control Control
256 * @return EOK on success, ENOMEM if out of memory
257 */
258void ui_window_add(ui_window_t *window, ui_control_t *control)
259{
260 assert(window->control == NULL);
261
262 window->control = control;
263 control->elemp = (void *) window;
264}
265
266/** Remove control from window.
267 *
268 * @param window Window
269 * @param control Control
270 */
271void ui_window_remove(ui_window_t *window, ui_control_t *control)
272{
273 assert(window->control == control);
274 assert((ui_window_t *) control->elemp == window);
275
276 window->control = NULL;
277 control->elemp = NULL;
278}
279
[0576df9]280/** Resize/move window.
281 *
282 * Resize window to the dimensions of @a rect. If @a rect.p0 is not 0,0,
283 * the top-left corner of the window will move on the screen accordingly.
284 *
285 * @param window Window
286 * @param rect Rectangle
287 *
288 * @return EOK on success or an error code
289 */
290errno_t ui_window_resize(ui_window_t *window, gfx_rect_t *rect)
291{
292 gfx_coord2_t offs;
293 gfx_rect_t nrect;
[25f26600]294 gfx_rect_t arect;
295 gfx_bitmap_t *app_bmp = NULL;
296 gfx_bitmap_params_t params;
297 gfx_bitmap_alloc_t alloc;
[0576df9]298 errno_t rc;
299
300 /*
301 * Move rect so that p0=0,0 - keep window's coordinate system origin
302 * locked to top-left corner of the window.
303 */
304 offs = rect->p0;
305 gfx_rect_rtranslate(&offs, rect, &nrect);
306
[25f26600]307 if (window->app_gc != NULL) {
308 assert(window->app_bmp != NULL);
309
310 gfx_bitmap_params_init(&params);
311
312 /*
313 * The bitmap will have the same dimensions as the
314 * application rectangle, but start at 0,0.
315 */
316 ui_wdecor_app_from_rect(window->wdecor->style, &nrect, &arect);
317 gfx_rect_rtranslate(&arect.p0, &arect, &params.rect);
318
319 rc = gfx_bitmap_create(window->gc, &params, NULL,
320 &app_bmp);
321 if (rc != EOK)
322 goto error;
323
324 rc = gfx_bitmap_get_alloc(app_bmp, &alloc);
325 if (rc != EOK)
326 goto error;
327 }
328
[0576df9]329 /* dwindow can be NULL in case of unit tests */
330 if (window->dwindow != NULL) {
331 rc = display_window_resize(window->dwindow, &offs, &nrect);
332 if (rc != EOK)
[25f26600]333 goto error;
[0576df9]334 }
335
336 ui_wdecor_set_rect(window->wdecor, &nrect);
337 ui_wdecor_paint(window->wdecor);
[25f26600]338
339 if (window->app_gc != NULL) {
340 mem_gc_retarget(window->app_mgc, &params.rect, &alloc);
341
342 gfx_bitmap_destroy(window->app_bmp);
343 window->app_bmp = app_bmp;
344 }
345
[0576df9]346 return EOK;
[25f26600]347error:
348 if (app_bmp != NULL)
349 gfx_bitmap_destroy(app_bmp);
350 return rc;
[0576df9]351}
352
[d284ce9]353/** Set window callbacks.
354 *
355 * @param window Window
356 * @param cb Window decoration callbacks
357 * @param arg Callback argument
358 */
359void ui_window_set_cb(ui_window_t *window, ui_window_cb_t *cb, void *arg)
360{
361 window->cb = cb;
362 window->arg = arg;
363}
364
[66a2becf]365/** Get UI resource from window.
366 *
367 * @param window Window
368 * @return UI resource
369 */
[3583ffb]370ui_resource_t *ui_window_get_res(ui_window_t *window)
371{
372 return window->res;
373}
374
[66a2becf]375/** Get window GC.
376 *
377 * @param window Window
378 * @return GC (relative to window)
379 */
[d284ce9]380gfx_context_t *ui_window_get_gc(ui_window_t *window)
381{
382 return window->gc;
383}
384
[66a2becf]385/** Get window application area GC
386 *
387 * @param window Window
388 * @param rgc Place to store GC (relative to application area)
389 * @return EOK on success or an error code
390 */
391errno_t ui_window_get_app_gc(ui_window_t *window, gfx_context_t **rgc)
392{
393 gfx_bitmap_params_t params;
394 gfx_bitmap_alloc_t alloc;
395 gfx_rect_t rect;
396 mem_gc_t *memgc;
397 errno_t rc;
398
399 if (window->app_gc == NULL) {
400 assert(window->app_bmp == NULL);
401
402 gfx_bitmap_params_init(&params);
403
404 /*
405 * The bitmap will have the same dimensions as the
406 * application rectangle, but start at 0,0.
407 */
408 ui_window_get_app_rect(window, &rect);
409 gfx_rect_rtranslate(&rect.p0, &rect, &params.rect);
410
411 rc = gfx_bitmap_create(window->gc, &params, NULL,
412 &window->app_bmp);
413 if (rc != EOK)
414 return rc;
415
416 rc = gfx_bitmap_get_alloc(window->app_bmp, &alloc);
417 if (rc != EOK) {
418 gfx_bitmap_destroy(window->app_bmp);
419 return rc;
420 }
421
422 rc = mem_gc_create(&params.rect, &alloc, ui_window_app_update,
423 (void *) window, &memgc);
424 if (rc != EOK) {
425 gfx_bitmap_destroy(window->app_bmp);
426 return rc;
427 }
428
[25f26600]429 window->app_mgc = memgc;
[66a2becf]430 window->app_gc = mem_gc_get_ctx(memgc);
431 }
432
433 *rgc = window->app_gc;
434 return EOK;
435}
436
437/** Get window application rectangle
438 *
439 * @param window Window
440 * @param rect Place to store application rectangle
441 */
[d284ce9]442void ui_window_get_app_rect(ui_window_t *window, gfx_rect_t *rect)
443{
444 ui_wdecor_geom_t geom;
445
446 ui_wdecor_get_geom(window->wdecor, &geom);
447 *rect = geom.app_area_rect;
448}
449
[66a2becf]450/** Paint window
451 *
452 * @param window Window
453 * @return EOK on success or an error code
454 */
[fa01c05]455errno_t ui_window_paint(ui_window_t *window)
456{
457 return ui_window_send_paint(window);
458}
459
[d284ce9]460/** Handle window close event. */
461static void dwnd_close_event(void *arg)
462{
463 ui_window_t *window = (ui_window_t *) arg;
464
[fa01c05]465 ui_window_send_close(window);
[d284ce9]466}
467
468/** Handle window focus event. */
469static void dwnd_focus_event(void *arg)
470{
471 ui_window_t *window = (ui_window_t *) arg;
472
473 if (window->wdecor != NULL) {
474 ui_wdecor_set_active(window->wdecor, true);
475 ui_wdecor_paint(window->wdecor);
476 }
[f03d1308]477
[fa01c05]478 ui_window_send_focus(window);
[d284ce9]479}
480
481/** Handle window keyboard event */
482static void dwnd_kbd_event(void *arg, kbd_event_t *kbd_event)
483{
484 ui_window_t *window = (ui_window_t *) arg;
485
486 (void) window;
[fa01c05]487 ui_window_send_kbd(window, kbd_event);
[d284ce9]488}
489
490/** Handle window position event */
491static void dwnd_pos_event(void *arg, pos_event_t *event)
492{
493 ui_window_t *window = (ui_window_t *) arg;
494
495 /* Make sure we don't process events until fully initialized */
496 if (window->wdecor == NULL)
497 return;
498
499 ui_wdecor_pos_event(window->wdecor, event);
[fa01c05]500 ui_window_send_pos(window, event);
[d284ce9]501}
502
[2d879f7]503/** Handle window resize event */
504static void dwnd_resize_event(void *arg, gfx_rect_t *rect)
505{
506 ui_window_t *window = (ui_window_t *) arg;
507
508 /* Make sure we don't process events until fully initialized */
509 if (window->wdecor == NULL)
510 return;
511
512 if ((window->wdecor->style & ui_wds_resizable) == 0)
513 return;
514
515 (void) ui_window_resize(window, rect);
516 (void) ui_window_paint(window);
517}
518
[d284ce9]519/** Handle window unfocus event. */
520static void dwnd_unfocus_event(void *arg)
521{
522 ui_window_t *window = (ui_window_t *) arg;
523
524 if (window->wdecor != NULL) {
525 ui_wdecor_set_active(window->wdecor, false);
526 ui_wdecor_paint(window->wdecor);
527 }
[f03d1308]528
[fa01c05]529 ui_window_send_unfocus(window);
[d284ce9]530}
531
532/** Window decoration requested window closure.
533 *
534 * @param wdecor Window decoration
[2d879f7]535 * @param arg Argument (window)
[d284ce9]536 */
537static void wd_close(ui_wdecor_t *wdecor, void *arg)
538{
539 ui_window_t *window = (ui_window_t *) arg;
540
[fa01c05]541 ui_window_send_close(window);
[d284ce9]542}
543
544/** Window decoration requested window move.
545 *
546 * @param wdecor Window decoration
[2d879f7]547 * @param arg Argument (window)
[d284ce9]548 * @param pos Position where the title bar was pressed
549 */
550static void wd_move(ui_wdecor_t *wdecor, void *arg, gfx_coord2_t *pos)
551{
552 ui_window_t *window = (ui_window_t *) arg;
553
554 (void) display_window_move_req(window->dwindow, pos);
555}
556
[2d879f7]557/** Window decoration requested window resize.
558 *
559 * @param wdecor Window decoration
560 * @param arg Argument (window)
561 * @param rsztype Resize type
562 * @param pos Position where the button was pressed
563 */
564static void wd_resize(ui_wdecor_t *wdecor, void *arg,
565 ui_wdecor_rsztype_t rsztype, gfx_coord2_t *pos)
566{
567 ui_window_t *window = (ui_window_t *) arg;
568
569 (void) display_window_resize_req(window->dwindow, rsztype, pos);
570}
571
572/** Window decoration requested changing cursor.
573 *
574 * @param wdecor Window decoration
575 * @param arg Argument (window)
576 * @param cursor Cursor to set
577 */
578static void wd_set_cursor(ui_wdecor_t *wdecor, void *arg,
579 ui_stock_cursor_t cursor)
580{
581 ui_window_t *window = (ui_window_t *) arg;
582 display_stock_cursor_t dcursor;
583
584 if (cursor == window->cursor)
585 return;
586
587 dcursor = dcurs_arrow;
588
589 switch (cursor) {
590 case ui_curs_arrow:
591 dcursor = dcurs_arrow;
592 break;
593 case ui_curs_size_ud:
594 dcursor = dcurs_size_ud;
595 break;
596 case ui_curs_size_lr:
597 dcursor = dcurs_size_lr;
598 break;
599 case ui_curs_size_uldr:
600 dcursor = dcurs_size_uldr;
601 break;
602 case ui_curs_size_urdl:
603 dcursor = dcurs_size_urdl;
604 break;
605 }
606
607 (void) display_window_set_cursor(window->dwindow, dcursor);
608 window->cursor = cursor;
609}
610
[d284ce9]611/** Send window close event.
612 *
613 * @param window Window
614 */
[fa01c05]615void ui_window_send_close(ui_window_t *window)
[d284ce9]616{
617 if (window->cb != NULL && window->cb->close != NULL)
618 window->cb->close(window, window->arg);
619}
620
[f03d1308]621/** Send window focus event.
622 *
623 * @param window Window
624 */
[fa01c05]625void ui_window_send_focus(ui_window_t *window)
[f03d1308]626{
627 if (window->cb != NULL && window->cb->focus != NULL)
628 window->cb->focus(window, window->arg);
629}
630
631/** Send window keyboard event.
632 *
633 * @param window Window
634 */
[fa01c05]635void ui_window_send_kbd(ui_window_t *window, kbd_event_t *kbd)
[f03d1308]636{
637 if (window->cb != NULL && window->cb->kbd != NULL)
638 window->cb->kbd(window, window->arg, kbd);
639}
640
[fa01c05]641/** Send window paint event.
642 *
643 * @param window Window
644 */
645errno_t ui_window_send_paint(ui_window_t *window)
646{
647 if (window->cb != NULL && window->cb->paint != NULL)
648 return window->cb->paint(window, window->arg);
649 else
650 return ui_window_def_paint(window);
651}
652
[d284ce9]653/** Send window position event.
654 *
655 * @param window Window
656 */
[fa01c05]657void ui_window_send_pos(ui_window_t *window, pos_event_t *pos)
[d284ce9]658{
659 if (window->cb != NULL && window->cb->pos != NULL)
660 window->cb->pos(window, window->arg, pos);
[b71c0fc]661 else
662 ui_window_def_pos(window, pos);
[d284ce9]663}
664
[f03d1308]665/** Send window unfocus event.
666 *
667 * @param window Window
668 */
[fa01c05]669void ui_window_send_unfocus(ui_window_t *window)
[f03d1308]670{
671 if (window->cb != NULL && window->cb->unfocus != NULL)
672 window->cb->unfocus(window, window->arg);
673}
674
[fa01c05]675/** Default window paint routine.
676 *
677 * @param window Window
678 * @return EOK on success or an error code
679 */
680errno_t ui_window_def_paint(ui_window_t *window)
681{
682 gfx_rect_t app_rect;
683 errno_t rc;
684
685 rc = gfx_set_color(window->gc, window->res->wnd_face_color);
686 if (rc != EOK)
687 return rc;
688
689 ui_window_get_app_rect(window, &app_rect);
690
691 rc = gfx_fill_rect(window->gc, &app_rect);
692 if (rc != EOK)
693 return rc;
694
[b71c0fc]695 if (window->control != NULL)
696 return ui_control_paint(window->control);
697
[fa01c05]698 return EOK;
699}
700
[b71c0fc]701/** Default window position event routine.
702 *
703 * @param window Window
704 * @return EOK on success or an error code
705 */
706void ui_window_def_pos(ui_window_t *window, pos_event_t *pos)
707{
708 if (window->control != NULL)
709 ui_control_pos_event(window->control, pos);
710}
711
[66a2becf]712/** Application area update callback
713 *
714 * @param arg Argument (ui_window_t *)
715 * @param rect Rectangle to update
716 */
717static void ui_window_app_update(void *arg, gfx_rect_t *rect)
718{
719 ui_window_t *window = (ui_window_t *) arg;
720 gfx_rect_t arect;
721
722 ui_window_get_app_rect(window, &arect);
723
724 /* Render bitmap rectangle inside the application area */
725 (void) gfx_bitmap_render(window->app_bmp, rect, &arect.p0);
726}
727
[f7a90df]728/** @}
729 */
Note: See TracBrowser for help on using the repository browser.