Changeset b0ae23f in mainline for uspace/lib/display
- 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/display
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/display/include/disp_srv.h
r46a47c0 rb0ae23f 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 59 59 errno_t (*window_move_req)(void *, sysarg_t, gfx_coord2_t *); 60 60 errno_t (*window_resize_req)(void *, sysarg_t, display_wnd_rsztype_t, 61 gfx_coord2_t * );61 gfx_coord2_t *, sysarg_t); 62 62 errno_t (*window_move)(void *, sysarg_t, gfx_coord2_t *); 63 63 errno_t (*window_get_pos)(void *, sysarg_t, gfx_coord2_t *); -
uspace/lib/display/include/display.h
r46a47c0 rb0ae23f 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 56 56 extern errno_t display_window_move_req(display_window_t *, gfx_coord2_t *); 57 57 extern errno_t display_window_resize_req(display_window_t *, 58 display_wnd_rsztype_t, gfx_coord2_t * );58 display_wnd_rsztype_t, gfx_coord2_t *, sysarg_t); 59 59 extern errno_t display_window_move(display_window_t *, gfx_coord2_t *); 60 60 extern errno_t display_window_get_pos(display_window_t *, gfx_coord2_t *); -
uspace/lib/display/src/disp_srv.c
r46a47c0 rb0ae23f 320 320 display_wnd_rsztype_t rsztype; 321 321 gfx_coord2_t pos; 322 sysarg_t pos_id; 322 323 size_t size; 323 324 errno_t rc; … … 325 326 wnd_id = ipc_get_arg1(icall); 326 327 rsztype = (display_wnd_rsztype_t) ipc_get_arg2(icall); 328 pos_id = ipc_get_arg3(icall); 327 329 328 330 if (!async_data_write_receive(&call, &size)) { … … 350 352 } 351 353 352 rc = srv->ops->window_resize_req(srv->arg, wnd_id, rsztype, &pos); 354 rc = srv->ops->window_resize_req(srv->arg, wnd_id, rsztype, &pos, 355 pos_id); 353 356 async_answer_0(icall, rc); 354 357 } -
uspace/lib/display/src/display.c
r46a47c0 rb0ae23f 414 414 * @param rsztype Resize type (which part of window frame is being dragged) 415 415 * @param pos Position in the window where the button was pressed 416 * @param pos_id Positioning device ID 416 417 * @return EOK on success or an error code 417 418 */ 418 419 errno_t display_window_resize_req(display_window_t *window, 419 display_wnd_rsztype_t rsztype, gfx_coord2_t *pos )420 { 421 async_exch_t *exch; 422 aid_t req; 423 ipc_call_t answer; 424 errno_t rc; 425 426 exch = async_exchange_begin(window->display->sess); 427 req = async_send_ 2(exch, DISPLAY_WINDOW_RESIZE_REQ, window->id,428 (sysarg_t) rsztype, &answer);420 display_wnd_rsztype_t rsztype, gfx_coord2_t *pos, sysarg_t pos_id) 421 { 422 async_exch_t *exch; 423 aid_t req; 424 ipc_call_t answer; 425 errno_t rc; 426 427 exch = async_exchange_begin(window->display->sess); 428 req = async_send_3(exch, DISPLAY_WINDOW_RESIZE_REQ, window->id, 429 (sysarg_t) rsztype, pos_id, &answer); 429 430 rc = async_data_write_start(exch, (void *)pos, sizeof (gfx_coord2_t)); 430 431 async_exchange_end(exch); -
uspace/lib/display/test/display.c
r46a47c0 rb0ae23f 63 63 static errno_t test_window_get_max_rect(void *, sysarg_t, gfx_rect_t *); 64 64 static errno_t test_window_resize_req(void *, sysarg_t, display_wnd_rsztype_t, 65 gfx_coord2_t * );65 gfx_coord2_t *, sysarg_t); 66 66 static errno_t test_window_resize(void *, sysarg_t, gfx_coord2_t *, 67 67 gfx_rect_t *); … … 141 141 display_wnd_rsztype_t resize_req_rsztype; 142 142 gfx_coord2_t resize_req_pos; 143 sysarg_t resize_req_pos_id; 143 144 144 145 bool window_resize_called; … … 831 832 display_wnd_rsztype_t rsztype; 832 833 gfx_coord2_t pos; 834 sysarg_t pos_id; 833 835 834 836 async_set_fallback_port_handler(test_display_conn, &resp); … … 863 865 pos.x = 42; 864 866 pos.y = 43; 865 866 rc = display_window_resize_req(wnd, rsztype, &pos); 867 pos_id = 44; 868 869 rc = display_window_resize_req(wnd, rsztype, &pos, pos_id); 867 870 PCUT_ASSERT_TRUE(resp.window_resize_req_called); 868 871 PCUT_ASSERT_ERRNO_VAL(resp.rc, rc); … … 871 874 PCUT_ASSERT_INT_EQUALS(pos.x, resp.resize_req_pos.x); 872 875 PCUT_ASSERT_INT_EQUALS(pos.y, resp.resize_req_pos.y); 876 PCUT_ASSERT_INT_EQUALS(pos_id, resp.resize_req_pos_id); 873 877 874 878 display_window_destroy(wnd); … … 889 893 display_wnd_rsztype_t rsztype; 890 894 gfx_coord2_t pos; 895 sysarg_t pos_id; 891 896 892 897 async_set_fallback_port_handler(test_display_conn, &resp); … … 921 926 pos.x = 42; 922 927 pos.y = 43; 923 924 rc = display_window_resize_req(wnd, rsztype, &pos); 928 pos_id = 44; 929 930 rc = display_window_resize_req(wnd, rsztype, &pos, pos_id); 925 931 PCUT_ASSERT_TRUE(resp.window_resize_req_called); 926 932 PCUT_ASSERT_ERRNO_VAL(resp.rc, rc); … … 929 935 PCUT_ASSERT_INT_EQUALS(pos.x, resp.resize_req_pos.x); 930 936 PCUT_ASSERT_INT_EQUALS(pos.y, resp.resize_req_pos.y); 937 PCUT_ASSERT_INT_EQUALS(pos_id, resp.resize_req_pos_id); 931 938 932 939 display_window_destroy(wnd); … … 2188 2195 2189 2196 static errno_t test_window_resize_req(void *arg, sysarg_t wnd_id, 2190 display_wnd_rsztype_t rsztype, gfx_coord2_t *pos )2197 display_wnd_rsztype_t rsztype, gfx_coord2_t *pos, sysarg_t pos_id) 2191 2198 { 2192 2199 test_response_t *resp = (test_response_t *) arg; … … 2196 2203 resp->resize_req_wnd_id = wnd_id; 2197 2204 resp->resize_req_pos = *pos; 2205 resp->resize_req_pos_id = pos_id; 2198 2206 return resp->rc; 2199 2207 }
Note:
See TracChangeset
for help on using the changeset viewer.