Changeset 4d8002d in mainline for uspace/srv/hid/display/display.c
- Timestamp:
- 2020-05-15T16:18:51Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4912dd59
- Parents:
- 6feccae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/display.c
r6feccae r4d8002d 40 40 #include <stdlib.h> 41 41 #include "client.h" 42 #include "cursimg.h" 43 #include "cursor.h" 42 44 #include "seat.h" 43 45 #include "window.h" … … 53 55 { 54 56 ds_display_t *disp; 57 ds_cursor_t *cursor; 58 int i; 55 59 errno_t rc; 56 60 … … 63 67 free(disp); 64 68 return ENOMEM; 69 } 70 71 list_initialize(&disp->cursors); 72 73 for (i = 0; i < dcurs_limit; i++) { 74 rc = ds_cursor_create(disp, &ds_cursimg[i].rect, 75 ds_cursimg[i].image, &cursor); 76 if (rc != EOK) 77 goto error; 78 79 disp->cursor[i] = cursor; 65 80 } 66 81 … … 73 88 *rdisp = disp; 74 89 return EOK; 90 error: 91 ds_display_destroy(disp); 92 return rc; 75 93 } 76 94 … … 83 101 assert(list_empty(&disp->clients)); 84 102 assert(list_empty(&disp->seats)); 103 /* XXX destroy cursors */ 85 104 gfx_color_delete(disp->bg_color); 86 105 free(disp); … … 462 481 } 463 482 483 /** Add cursor to display. 484 * 485 * @param display Display 486 * @param cursor Cursor 487 */ 488 void ds_display_add_cursor(ds_display_t *display, ds_cursor_t *cursor) 489 { 490 assert(cursor->display == NULL); 491 assert(!link_used(&cursor->ldisplay)); 492 493 cursor->display = display; 494 list_prepend(&cursor->ldisplay, &display->cursors); 495 } 496 497 /** Remove cursor from display. 498 * 499 * @param cursor Cursor 500 */ 501 void ds_display_remove_cursor(ds_cursor_t *cursor) 502 { 503 list_remove(&cursor->ldisplay); 504 cursor->display = NULL; 505 } 506 464 507 // XXX 465 508 gfx_context_t *ds_display_get_gc(ds_display_t *display)
Note:
See TracChangeset
for help on using the changeset viewer.