Changeset 3be5366 in mainline for uspace/lib/ui
- Timestamp:
- 2023-01-19T12:09:34Z (3 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6828a56
- Parents:
- aaa3b855
- git-author:
- Jiri Svoboda <jiri@…> (2023-01-19 18:09:23)
- git-committer:
- Jiri Svoboda <jiri@…> (2023-01-19 12:09:34)
- Location:
- uspace/lib/ui
- Files:
-
- 5 edited
-
include/types/ui/wdecor.h (modified) (1 diff)
-
private/wdecor.h (modified) (1 diff)
-
src/wdecor.c (modified) (7 diffs)
-
src/window.c (modified) (2 diffs)
-
test/wdecor.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/include/types/ui/wdecor.h
raaa3b855 r3be5366 85 85 void (*unmaximize)(ui_wdecor_t *, void *); 86 86 void (*close)(ui_wdecor_t *, void *); 87 void (*move)(ui_wdecor_t *, void *, gfx_coord2_t * );87 void (*move)(ui_wdecor_t *, void *, gfx_coord2_t *, sysarg_t); 88 88 void (*resize)(ui_wdecor_t *, void *, ui_wdecor_rsztype_t, 89 89 gfx_coord2_t *, sysarg_t); -
uspace/lib/ui/private/wdecor.h
raaa3b855 r3be5366 98 98 extern void ui_wdecor_unmaximize(ui_wdecor_t *); 99 99 extern void ui_wdecor_close(ui_wdecor_t *); 100 extern void ui_wdecor_move(ui_wdecor_t *, gfx_coord2_t * );100 extern void ui_wdecor_move(ui_wdecor_t *, gfx_coord2_t *, sysarg_t); 101 101 extern void ui_wdecor_resize(ui_wdecor_t *, ui_wdecor_rsztype_t, 102 102 gfx_coord2_t *, sysarg_t); -
uspace/lib/ui/src/wdecor.c
raaa3b855 r3be5366 465 465 * @param wdecor Window decoration 466 466 * @param pos Position where the title bar was pressed 467 */ 468 void ui_wdecor_move(ui_wdecor_t *wdecor, gfx_coord2_t *pos) 467 * @param pos_id Positioning device ID 468 */ 469 void ui_wdecor_move(ui_wdecor_t *wdecor, gfx_coord2_t *pos, sysarg_t pos_id) 469 470 { 470 471 if (wdecor->cb != NULL && wdecor->cb->move != NULL) 471 wdecor->cb->move(wdecor, wdecor->arg, pos );472 wdecor->cb->move(wdecor, wdecor->arg, pos, pos_id); 472 473 } 473 474 … … 812 813 { 813 814 gfx_coord2_t pos; 815 sysarg_t pos_id; 814 816 ui_wdecor_rsztype_t rsztype; 815 817 ui_stock_cursor_t cursor; … … 817 819 pos.x = event->hpos; 818 820 pos.y = event->vpos; 821 pos_id = event->pos_id; 819 822 820 823 /* Set appropriate resizing cursor, or set arrow cursor */ … … 827 830 /* Press on window border? */ 828 831 if (rsztype != ui_wr_none && event->type == POS_PRESS) 829 ui_wdecor_resize(wdecor, rsztype, &pos, event->pos_id);832 ui_wdecor_resize(wdecor, rsztype, &pos, pos_id); 830 833 } 831 834 … … 839 842 { 840 843 gfx_coord2_t pos; 844 sysarg_t pos_id; 841 845 ui_wdecor_geom_t geom; 842 846 ui_evclaim_t claim; … … 844 848 pos.x = event->hpos; 845 849 pos.y = event->vpos; 850 pos_id = event->pos_id; 846 851 847 852 ui_wdecor_get_geom(wdecor, &geom); … … 870 875 if (event->type == POS_PRESS && 871 876 gfx_pix_inside_rect(&pos, &geom.title_bar_rect)) { 872 ui_wdecor_move(wdecor, &pos );877 ui_wdecor_move(wdecor, &pos, pos_id); 873 878 return ui_claimed; 874 879 } -
uspace/lib/ui/src/window.c
raaa3b855 r3be5366 78 78 static void wd_unmaximize(ui_wdecor_t *, void *); 79 79 static void wd_close(ui_wdecor_t *, void *); 80 static void wd_move(ui_wdecor_t *, void *, gfx_coord2_t * );80 static void wd_move(ui_wdecor_t *, void *, gfx_coord2_t *, sysarg_t); 81 81 static void wd_resize(ui_wdecor_t *, void *, ui_wdecor_rsztype_t, 82 82 gfx_coord2_t *, sysarg_t); … … 973 973 * @param arg Argument (window) 974 974 * @param pos Position where the title bar was pressed 975 */ 976 static void wd_move(ui_wdecor_t *wdecor, void *arg, gfx_coord2_t *pos) 975 * @param pos_id Positioning device ID 976 */ 977 static void wd_move(ui_wdecor_t *wdecor, void *arg, gfx_coord2_t *pos, 978 sysarg_t pos_id) 977 979 { 978 980 ui_window_t *window = (ui_window_t *) arg; 979 981 980 982 if (window->dwindow != NULL) 981 (void) display_window_move_req(window->dwindow, pos );983 (void) display_window_move_req(window->dwindow, pos, pos_id); 982 984 } 983 985 -
uspace/lib/ui/test/wdecor.c
raaa3b855 r3be5366 66 66 static void test_wdecor_unmaximize(ui_wdecor_t *, void *); 67 67 static void test_wdecor_close(ui_wdecor_t *, void *); 68 static void test_wdecor_move(ui_wdecor_t *, void *, gfx_coord2_t * );68 static void test_wdecor_move(ui_wdecor_t *, void *, gfx_coord2_t *, sysarg_t); 69 69 static void test_wdecor_resize(ui_wdecor_t *, void *, ui_wdecor_rsztype_t, 70 70 gfx_coord2_t *, sysarg_t); … … 339 339 test_cb_resp_t resp; 340 340 gfx_coord2_t pos; 341 sysarg_t pos_id; 341 342 342 343 rc = ui_wdecor_create(NULL, "Hello", ui_wds_none, &wdecor); … … 345 346 pos.x = 3; 346 347 pos.y = 4; 348 pos_id = 5; 347 349 348 350 /* Move callback with no callbacks set */ 349 ui_wdecor_move(wdecor, &pos );351 ui_wdecor_move(wdecor, &pos, pos_id); 350 352 351 353 /* Move callback with move callback not implemented */ 352 354 ui_wdecor_set_cb(wdecor, &dummy_wdecor_cb, NULL); 353 ui_wdecor_move(wdecor, &pos );355 ui_wdecor_move(wdecor, &pos, pos_id); 354 356 355 357 /* Move callback with real callback set */ … … 357 359 resp.pos.x = 0; 358 360 resp.pos.y = 0; 361 resp.pos_id = 0; 359 362 ui_wdecor_set_cb(wdecor, &test_wdecor_cb, &resp); 360 ui_wdecor_move(wdecor, &pos );363 ui_wdecor_move(wdecor, &pos, pos_id); 361 364 PCUT_ASSERT_TRUE(resp.move); 362 365 PCUT_ASSERT_INT_EQUALS(pos.x, resp.pos.x); 363 366 PCUT_ASSERT_INT_EQUALS(pos.y, resp.pos.y); 367 PCUT_ASSERT_INT_EQUALS(pos_id, resp.pos_id); 364 368 365 369 ui_wdecor_destroy(wdecor); … … 1075 1079 } 1076 1080 1077 static void test_wdecor_move(ui_wdecor_t *wdecor, void *arg, gfx_coord2_t *pos) 1081 static void test_wdecor_move(ui_wdecor_t *wdecor, void *arg, gfx_coord2_t *pos, 1082 sysarg_t pos_id) 1078 1083 { 1079 1084 test_cb_resp_t *resp = (test_cb_resp_t *) arg; … … 1081 1086 resp->move = true; 1082 1087 resp->pos = *pos; 1088 resp->pos_id = pos_id; 1083 1089 } 1084 1090
Note:
See TracChangeset
for help on using the changeset viewer.
