Changeset 1215db9 in mainline for uspace/lib/ui/src/window.c
- Timestamp:
- 2021-06-26T23:30:18Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e87415e6
- Parents:
- bb14312
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/window.c
rbb14312 r1215db9 39 39 #include <gfx/bitmap.h> 40 40 #include <gfx/context.h> 41 #include <gfx/cursor.h> 41 42 #include <gfx/render.h> 42 43 #include <io/kbd_event.h> … … 88 89 static void ui_window_invalidate(void *, gfx_rect_t *); 89 90 static void ui_window_update(void *); 91 static errno_t ui_window_cursor_get_pos(void *, gfx_coord2_t *); 92 static errno_t ui_window_cursor_set_pos(void *, gfx_coord2_t *); 93 static errno_t ui_window_cursor_set_visible(void *, bool); 94 95 /** Window memory GC callbacks */ 96 static mem_gc_cb_t ui_window_mem_gc_cb = { 97 .invalidate = ui_window_invalidate, 98 .update = ui_window_update, 99 .cursor_get_pos = ui_window_cursor_get_pos, 100 .cursor_set_pos = ui_window_cursor_set_pos, 101 .cursor_set_visible = ui_window_cursor_set_visible 102 }; 103 90 104 static void ui_window_app_invalidate(void *, gfx_rect_t *); 91 105 static void ui_window_app_update(void *); 106 107 /** Application area memory GC callbacks */ 108 static mem_gc_cb_t ui_window_app_mem_gc_cb = { 109 .invalidate = ui_window_app_invalidate, 110 .update = ui_window_app_update 111 }; 112 92 113 static void ui_window_expose_cb(void *); 93 114 … … 255 276 } 256 277 257 rc = mem_gc_create(&bparams.rect, &alloc, ui_window_invalidate,258 ui_window_update,(void *) window, &memgc);278 rc = mem_gc_create(&bparams.rect, &alloc, &ui_window_mem_gc_cb, 279 (void *) window, &memgc); 259 280 if (rc != EOK) { 260 281 gfx_bitmap_destroy(window->app_bmp); … … 267 288 window->realgc = gc; 268 289 #else 269 (void) ui_window_update; 270 (void) ui_window_invalidate; 290 (void) ui_window_mem_gc_cb; 271 291 (void) alloc; 272 292 (void) bparams; … … 618 638 } 619 639 620 rc = mem_gc_create(¶ms.rect, &alloc, ui_window_app_invalidate,621 ui_window_app_update, (void *) window, &memgc);640 rc = mem_gc_create(¶ms.rect, &alloc, 641 &ui_window_app_mem_gc_cb, (void *) window, &memgc); 622 642 if (rc != EOK) { 623 643 gfx_bitmap_destroy(window->app_bmp); … … 1003 1023 } 1004 1024 1025 /** Window cursor get position callback 1026 * 1027 * @param arg Argument (ui_window_t *) 1028 * @param pos Place to store position 1029 */ 1030 static errno_t ui_window_cursor_get_pos(void *arg, gfx_coord2_t *pos) 1031 { 1032 ui_window_t *window = (ui_window_t *) arg; 1033 1034 return gfx_cursor_get_pos(window->realgc, pos); 1035 } 1036 1037 /** Window cursor set position callback 1038 * 1039 * @param arg Argument (ui_window_t *) 1040 * @param pos New position 1041 */ 1042 static errno_t ui_window_cursor_set_pos(void *arg, gfx_coord2_t *pos) 1043 { 1044 ui_window_t *window = (ui_window_t *) arg; 1045 1046 return gfx_cursor_set_pos(window->realgc, pos); 1047 } 1048 1049 /** Window cursor set visibility callback 1050 * 1051 * @param arg Argument (ui_window_t *) 1052 * @param visible @c true iff cursor is to be made visible 1053 */ 1054 static errno_t ui_window_cursor_set_visible(void *arg, bool visible) 1055 { 1056 ui_window_t *window = (ui_window_t *) arg; 1057 1058 return gfx_cursor_set_visible(window->realgc, visible); 1059 } 1060 1005 1061 /** Application area invalidate callback 1006 1062 *
Note:
See TracChangeset
for help on using the changeset viewer.