Changes in uspace/srv/hid/display/window.c [2e0a2e7:1215db9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/window.c
r2e0a2e7 r1215db9 1 1 /* 2 * Copyright (c) 20 19Jiri Svoboda2 * Copyright (c) 2021 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 49 49 #include "window.h" 50 50 51 static void ds_window_update_cb(void *, gfx_rect_t *); 51 static void ds_window_invalidate_cb(void *, gfx_rect_t *); 52 static void ds_window_update_cb(void *); 52 53 static void ds_window_get_preview_rect(ds_window_t *, gfx_rect_t *); 54 55 static mem_gc_cb_t ds_window_mem_gc_cb = { 56 .invalidate = ds_window_invalidate_cb, 57 .update = ds_window_update_cb 58 }; 53 59 54 60 /** Create window. … … 66 72 { 67 73 ds_window_t *wnd = NULL; 74 ds_seat_t *seat; 68 75 gfx_context_t *dgc; 69 76 gfx_coord2_t dims; … … 106 113 } 107 114 108 rc = mem_gc_create(¶ms->rect, &alloc, ds_window_update_cb,115 rc = mem_gc_create(¶ms->rect, &alloc, &ds_window_mem_gc_cb, 109 116 (void *)wnd, &wnd->mgc); 110 117 if (rc != EOK) … … 115 122 wnd->gc = mem_gc_get_ctx(wnd->mgc); 116 123 wnd->cursor = wnd->display->cursor[dcurs_arrow]; 124 wnd->flags = params->flags; 125 126 if ((params->flags & wndf_setpos) != 0) { 127 /* Specific window position */ 128 wnd->dpos = params->pos; 129 } else { 130 /* Automatic window placement */ 131 wnd->dpos.x = ((wnd->id - 1) & 1) * 400; 132 wnd->dpos.y = ((wnd->id - 1) & 2) / 2 * 300; 133 } 134 135 seat = ds_display_first_seat(client->display); 136 137 if ((params->flags & wndf_popup) != 0) 138 ds_seat_set_popup(seat, wnd); 139 else 140 ds_seat_set_focus(seat, wnd); 141 142 (void) ds_display_paint(wnd->display, NULL); 143 117 144 *rgc = wnd; 118 145 return EOK; … … 657 684 } 658 685 686 /** Get window position. 687 * 688 * @param wnd Window 689 */ 690 void ds_window_get_pos(ds_window_t *wnd, gfx_coord2_t *dpos) 691 { 692 *dpos = wnd->dpos; 693 } 694 659 695 /** Start resizing a window, detected by client. 660 696 * … … 789 825 } 790 826 791 /** Window memory GC update callback.792 * 793 * This is called by the window's memory GC when a rectangle us updated.794 */ 795 static void ds_window_ update_cb(void *arg, gfx_rect_t *rect)827 /** Window memory GC invalidate callback. 828 * 829 * This is called by the window's memory GC when a rectangle is modified. 830 */ 831 static void ds_window_invalidate_cb(void *arg, gfx_rect_t *rect) 796 832 { 797 833 ds_window_t *wnd = (ds_window_t *)arg; … … 806 842 } 807 843 844 /** Window memory GC update callback. 845 * 846 * This is called by the window's memory GC when it is to be updated. 847 */ 848 static void ds_window_update_cb(void *arg) 849 { 850 ds_window_t *wnd = (ds_window_t *)arg; 851 852 (void) wnd; 853 } 854 808 855 /** @} 809 856 */
Note:
See TracChangeset
for help on using the changeset viewer.