Changeset b0ae23f in mainline for uspace/lib/ui
- Timestamp:
- 2023-01-17T15:21:13Z (3 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a0d4afe
- Parents:
- 46a47c0
- git-author:
- Jiri Svoboda <jiri@…> (2023-01-17 18:21:02)
- git-committer:
- Jiri Svoboda <jiri@…> (2023-01-17 15:21:13)
- Location:
- uspace/lib/ui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/include/types/ui/wdecor.h
r46a47c0 rb0ae23f 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 87 87 void (*move)(ui_wdecor_t *, void *, gfx_coord2_t *); 88 88 void (*resize)(ui_wdecor_t *, void *, ui_wdecor_rsztype_t, 89 gfx_coord2_t * );89 gfx_coord2_t *, sysarg_t); 90 90 void (*set_cursor)(ui_wdecor_t *, void *, ui_stock_cursor_t); 91 91 } ui_wdecor_cb_t; -
uspace/lib/ui/private/wdecor.h
r46a47c0 rb0ae23f 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 100 100 extern void ui_wdecor_move(ui_wdecor_t *, gfx_coord2_t *); 101 101 extern void ui_wdecor_resize(ui_wdecor_t *, ui_wdecor_rsztype_t, 102 gfx_coord2_t * );102 gfx_coord2_t *, sysarg_t); 103 103 extern void ui_wdecor_set_cursor(ui_wdecor_t *, ui_stock_cursor_t); 104 104 extern void ui_wdecor_get_geom(ui_wdecor_t *, ui_wdecor_geom_t *); -
uspace/lib/ui/src/wdecor.c
r46a47c0 rb0ae23f 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 477 477 * @param rsztype Resize type 478 478 * @param pos Position where the button was pressed 479 * @param pos_id Positioning device ID 479 480 */ 480 481 void ui_wdecor_resize(ui_wdecor_t *wdecor, ui_wdecor_rsztype_t rsztype, 481 gfx_coord2_t *pos )482 gfx_coord2_t *pos, sysarg_t pos_id) 482 483 { 483 484 if (wdecor->cb != NULL && wdecor->cb->resize != NULL) 484 wdecor->cb->resize(wdecor, wdecor->arg, rsztype, pos );485 wdecor->cb->resize(wdecor, wdecor->arg, rsztype, pos, pos_id); 485 486 } 486 487 … … 826 827 /* Press on window border? */ 827 828 if (rsztype != ui_wr_none && event->type == POS_PRESS) 828 ui_wdecor_resize(wdecor, rsztype, &pos );829 ui_wdecor_resize(wdecor, rsztype, &pos, event->pos_id); 829 830 } 830 831 -
uspace/lib/ui/src/window.c
r46a47c0 rb0ae23f 80 80 static void wd_move(ui_wdecor_t *, void *, gfx_coord2_t *); 81 81 static void wd_resize(ui_wdecor_t *, void *, ui_wdecor_rsztype_t, 82 gfx_coord2_t * );82 gfx_coord2_t *, sysarg_t); 83 83 static void wd_set_cursor(ui_wdecor_t *, void *, ui_stock_cursor_t); 84 84 … … 988 988 * @param rsztype Resize type 989 989 * @param pos Position where the button was pressed 990 * @param pos_id Positioning device ID 990 991 */ 991 992 static void wd_resize(ui_wdecor_t *wdecor, void *arg, 992 ui_wdecor_rsztype_t rsztype, gfx_coord2_t *pos) 993 { 994 ui_window_t *window = (ui_window_t *) arg; 995 996 if (window->dwindow != NULL) 997 (void) display_window_resize_req(window->dwindow, rsztype, pos); 993 ui_wdecor_rsztype_t rsztype, gfx_coord2_t *pos, sysarg_t pos_id) 994 { 995 ui_window_t *window = (ui_window_t *) arg; 996 997 if (window->dwindow != NULL) { 998 (void) display_window_resize_req(window->dwindow, rsztype, 999 pos, pos_id); 1000 } 998 1001 } 999 1002 -
uspace/lib/ui/test/wdecor.c
r46a47c0 rb0ae23f 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 68 68 static void test_wdecor_move(ui_wdecor_t *, void *, gfx_coord2_t *); 69 69 static void test_wdecor_resize(ui_wdecor_t *, void *, ui_wdecor_rsztype_t, 70 gfx_coord2_t * );70 gfx_coord2_t *, sysarg_t); 71 71 static void test_wdecor_set_cursor(ui_wdecor_t *, void *, ui_stock_cursor_t); 72 72 … … 108 108 bool move; 109 109 gfx_coord2_t pos; 110 sysarg_t pos_id; 110 111 bool resize; 111 112 ui_wdecor_rsztype_t rsztype; … … 373 374 ui_wdecor_rsztype_t rsztype; 374 375 gfx_coord2_t pos; 376 sysarg_t pos_id; 375 377 376 378 rc = ui_wdecor_create(NULL, "Hello", ui_wds_none, &wdecor); … … 380 382 pos.x = 3; 381 383 pos.y = 4; 384 pos_id = 5; 382 385 383 386 /* Resize callback with no callbacks set */ 384 ui_wdecor_resize(wdecor, rsztype, &pos );387 ui_wdecor_resize(wdecor, rsztype, &pos, pos_id); 385 388 386 389 /* Resize callback with move callback not implemented */ 387 390 ui_wdecor_set_cb(wdecor, &dummy_wdecor_cb, NULL); 388 ui_wdecor_resize(wdecor, rsztype, &pos );391 ui_wdecor_resize(wdecor, rsztype, &pos, pos_id); 389 392 390 393 /* Resize callback with real callback set */ … … 394 397 resp.pos.y = 0; 395 398 ui_wdecor_set_cb(wdecor, &test_wdecor_cb, &resp); 396 ui_wdecor_resize(wdecor, rsztype, &pos );399 ui_wdecor_resize(wdecor, rsztype, &pos, pos_id); 397 400 PCUT_ASSERT_TRUE(resp.resize); 398 401 PCUT_ASSERT_INT_EQUALS(rsztype, resp.rsztype); 399 402 PCUT_ASSERT_INT_EQUALS(pos.x, resp.pos.x); 400 403 PCUT_ASSERT_INT_EQUALS(pos.y, resp.pos.y); 404 PCUT_ASSERT_INT_EQUALS(pos_id, resp.pos_id); 401 405 402 406 ui_wdecor_destroy(wdecor); … … 1080 1084 1081 1085 static void test_wdecor_resize(ui_wdecor_t *wdecor, void *arg, 1082 ui_wdecor_rsztype_t rsztype, gfx_coord2_t *pos )1086 ui_wdecor_rsztype_t rsztype, gfx_coord2_t *pos, sysarg_t pos_id) 1083 1087 { 1084 1088 test_cb_resp_t *resp = (test_cb_resp_t *) arg; … … 1087 1091 resp->rsztype = rsztype; 1088 1092 resp->pos = *pos; 1093 resp->pos_id = pos_id; 1089 1094 } 1090 1095
Note:
See TracChangeset
for help on using the changeset viewer.