Changes in uspace/srv/hid/display/dsops.c [195b7b3:3be5366] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/dsops.c
r195b7b3 r3be5366 1 1 /* 2 * Copyright (c) 20 19Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 46 46 static errno_t disp_window_create(void *, display_wnd_params_t *, sysarg_t *); 47 47 static errno_t disp_window_destroy(void *, sysarg_t); 48 static errno_t disp_window_move_req(void *, sysarg_t, gfx_coord2_t *); 48 static errno_t disp_window_move_req(void *, sysarg_t, gfx_coord2_t *, 49 sysarg_t); 49 50 static errno_t disp_window_move(void *, sysarg_t, gfx_coord2_t *); 51 static errno_t disp_window_get_pos(void *, sysarg_t, gfx_coord2_t *); 52 static errno_t disp_window_get_max_rect(void *, sysarg_t, gfx_rect_t *); 50 53 static errno_t disp_window_resize_req(void *, sysarg_t, 51 display_wnd_rsztype_t, gfx_coord2_t * );54 display_wnd_rsztype_t, gfx_coord2_t *, sysarg_t); 52 55 static errno_t disp_window_resize(void *, sysarg_t, gfx_coord2_t *, 53 56 gfx_rect_t *); 57 static errno_t disp_window_minimize(void *, sysarg_t); 58 static errno_t disp_window_maximize(void *, sysarg_t); 59 static errno_t disp_window_unmaximize(void *, sysarg_t); 54 60 static errno_t disp_window_set_cursor(void *, sysarg_t, display_stock_cursor_t); 61 static errno_t disp_window_set_caption(void *, sysarg_t, const char *); 55 62 static errno_t disp_get_event(void *, sysarg_t *, display_wnd_ev_t *); 56 63 static errno_t disp_get_info(void *, display_info_t *); … … 61 68 .window_move_req = disp_window_move_req, 62 69 .window_move = disp_window_move, 70 .window_get_pos = disp_window_get_pos, 71 .window_get_max_rect = disp_window_get_max_rect, 63 72 .window_resize_req = disp_window_resize_req, 64 73 .window_resize = disp_window_resize, 74 .window_minimize = disp_window_minimize, 75 .window_maximize = disp_window_maximize, 76 .window_unmaximize = disp_window_unmaximize, 65 77 .window_set_cursor = disp_window_set_cursor, 78 .window_set_caption = disp_window_set_caption, 66 79 .get_event = disp_get_event, 67 80 .get_info = disp_get_info … … 73 86 errno_t rc; 74 87 ds_client_t *client = (ds_client_t *) arg; 75 ds_seat_t *seat;76 88 ds_window_t *wnd; 77 89 … … 90 102 wnd->id); 91 103 92 /* XXX All the below should probably be part of ds_window_create() */93 wnd->dpos.x = ((wnd->id - 1) & 1) * 400;94 wnd->dpos.y = ((wnd->id - 1) & 2) / 2 * 300;95 96 seat = ds_display_first_seat(client->display);97 ds_seat_set_focus(seat, wnd);98 (void) ds_display_paint(wnd->display, NULL);99 100 104 ds_display_unlock(client->display); 101 105 … … 118 122 119 123 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_destroy()"); 120 ds_client_remove_window(wnd);121 124 ds_window_destroy(wnd); 122 125 ds_display_unlock(client->display); … … 125 128 126 129 static errno_t disp_window_move_req(void *arg, sysarg_t wnd_id, 127 gfx_coord2_t *pos )130 gfx_coord2_t *pos, sysarg_t pos_id) 128 131 { 129 132 ds_client_t *client = (ds_client_t *) arg; … … 139 142 140 143 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_move_req()"); 141 ds_window_move_req(wnd, pos );144 ds_window_move_req(wnd, pos, pos_id); 142 145 ds_display_unlock(client->display); 143 146 return EOK; … … 163 166 } 164 167 168 static errno_t disp_window_get_pos(void *arg, sysarg_t wnd_id, 169 gfx_coord2_t *pos) 170 { 171 ds_client_t *client = (ds_client_t *) arg; 172 ds_window_t *wnd; 173 174 ds_display_lock(client->display); 175 176 wnd = ds_client_find_window(client, wnd_id); 177 if (wnd == NULL) { 178 ds_display_unlock(client->display); 179 return ENOENT; 180 } 181 182 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_get_pos()"); 183 ds_window_get_pos(wnd, pos); 184 ds_display_unlock(client->display); 185 return EOK; 186 } 187 188 static errno_t disp_window_get_max_rect(void *arg, sysarg_t wnd_id, 189 gfx_rect_t *rect) 190 { 191 ds_client_t *client = (ds_client_t *) arg; 192 ds_window_t *wnd; 193 194 ds_display_lock(client->display); 195 196 wnd = ds_client_find_window(client, wnd_id); 197 if (wnd == NULL) { 198 ds_display_unlock(client->display); 199 return ENOENT; 200 } 201 202 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_get_max_rect()"); 203 ds_window_get_max_rect(wnd, rect); 204 ds_display_unlock(client->display); 205 return EOK; 206 } 207 165 208 static errno_t disp_window_resize_req(void *arg, sysarg_t wnd_id, 166 display_wnd_rsztype_t rsztype, gfx_coord2_t *pos )209 display_wnd_rsztype_t rsztype, gfx_coord2_t *pos, sysarg_t pos_id) 167 210 { 168 211 ds_client_t *client = (ds_client_t *) arg; … … 181 224 182 225 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_resize_req()"); 183 ds_window_resize_req(wnd, rsztype, pos );226 ds_window_resize_req(wnd, rsztype, pos, pos_id); 184 227 ds_display_unlock(client->display); 185 228 return EOK; … … 207 250 } 208 251 252 static errno_t disp_window_minimize(void *arg, sysarg_t wnd_id) 253 { 254 ds_client_t *client = (ds_client_t *) arg; 255 ds_window_t *wnd; 256 errno_t rc; 257 258 ds_display_lock(client->display); 259 260 wnd = ds_client_find_window(client, wnd_id); 261 if (wnd == NULL) { 262 ds_display_unlock(client->display); 263 return ENOENT; 264 } 265 266 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_maximize()"); 267 rc = ds_window_minimize(wnd); 268 ds_display_unlock(client->display); 269 return rc; 270 } 271 272 static errno_t disp_window_maximize(void *arg, sysarg_t wnd_id) 273 { 274 ds_client_t *client = (ds_client_t *) arg; 275 ds_window_t *wnd; 276 errno_t rc; 277 278 ds_display_lock(client->display); 279 280 wnd = ds_client_find_window(client, wnd_id); 281 if (wnd == NULL) { 282 ds_display_unlock(client->display); 283 return ENOENT; 284 } 285 286 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_maximize()"); 287 rc = ds_window_maximize(wnd); 288 ds_display_unlock(client->display); 289 return rc; 290 } 291 292 static errno_t disp_window_unmaximize(void *arg, sysarg_t wnd_id) 293 { 294 ds_client_t *client = (ds_client_t *) arg; 295 ds_window_t *wnd; 296 errno_t rc; 297 298 ds_display_lock(client->display); 299 300 wnd = ds_client_find_window(client, wnd_id); 301 if (wnd == NULL) { 302 ds_display_unlock(client->display); 303 return ENOENT; 304 } 305 306 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_unmaximize()"); 307 rc = ds_window_unmaximize(wnd); 308 ds_display_unlock(client->display); 309 return rc; 310 } 311 209 312 static errno_t disp_window_set_cursor(void *arg, sysarg_t wnd_id, 210 313 display_stock_cursor_t cursor) … … 228 331 } 229 332 333 static errno_t disp_window_set_caption(void *arg, sysarg_t wnd_id, 334 const char *caption) 335 { 336 ds_client_t *client = (ds_client_t *) arg; 337 ds_window_t *wnd; 338 errno_t rc; 339 340 ds_display_lock(client->display); 341 342 wnd = ds_client_find_window(client, wnd_id); 343 if (wnd == NULL) { 344 ds_display_unlock(client->display); 345 return ENOENT; 346 } 347 348 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_set_caption()"); 349 rc = ds_window_set_caption(wnd, caption); 350 ds_display_unlock(client->display); 351 return rc; 352 } 353 230 354 static errno_t disp_get_event(void *arg, sysarg_t *wnd_id, 231 355 display_wnd_ev_t *event) … … 235 359 errno_t rc; 236 360 237 log_msg(LOG_DEFAULT, LVL_DEBUG , "disp_window_get_event()");361 log_msg(LOG_DEFAULT, LVL_DEBUG2, "disp_window_get_event()"); 238 362 239 363 ds_display_lock(client->display);
Note:
See TracChangeset
for help on using the changeset viewer.