Changeset a0d4afe in mainline
- Timestamp:
- 2023-01-18T16:51:44Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3e7e226
- Parents:
- b0ae23f
- Location:
- uspace/srv/hid/display
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/display.c
rb0ae23f ra0d4afe 796 796 { 797 797 assert(idevcfg->display == NULL); 798 assert(!link_used(&idevcfg->l idevcfgs));798 assert(!link_used(&idevcfg->ldispidcfgs)); 799 799 800 800 idevcfg->display = disp; 801 list_append(&idevcfg->l idevcfgs, &disp->idevcfgs);801 list_append(&idevcfg->ldispidcfgs, &disp->idevcfgs); 802 802 } 803 803 … … 808 808 void ds_display_remove_idevcfg(ds_idevcfg_t *idevcfg) 809 809 { 810 list_remove(&idevcfg->l idevcfgs);810 list_remove(&idevcfg->ldispidcfgs); 811 811 idevcfg->display = NULL; 812 812 } … … 824 824 return NULL; 825 825 826 return list_get_instance(link, ds_idevcfg_t, l idevcfgs);826 return list_get_instance(link, ds_idevcfg_t, ldispidcfgs); 827 827 } 828 828 … … 834 834 ds_idevcfg_t *ds_display_next_idevcfg(ds_idevcfg_t *idevcfg) 835 835 { 836 link_t *link = list_next(&idevcfg->l idevcfgs, &idevcfg->display->idevcfgs);837 838 if (link == NULL) 839 return NULL; 840 841 return list_get_instance(link, ds_idevcfg_t, l idevcfgs);836 link_t *link = list_next(&idevcfg->ldispidcfgs, &idevcfg->display->idevcfgs); 837 838 if (link == NULL) 839 return NULL; 840 841 return list_get_instance(link, ds_idevcfg_t, ldispidcfgs); 842 842 } 843 843 -
uspace/srv/hid/display/idevcfg.c
rb0ae23f ra0d4afe 41 41 #include "display.h" 42 42 #include "idevcfg.h" 43 #include "seat.h" 43 44 44 45 /** Create input device configuration entry. … … 61 62 62 63 idevcfg->svc_id = svc_id; 63 idevcfg->seat = seat;64 ds_seat_add_idevcfg(seat, idevcfg); 64 65 65 66 ds_display_add_idevcfg(display, idevcfg); … … 75 76 { 76 77 ds_display_remove_idevcfg(idevcfg); 78 ds_seat_remove_idevcfg(idevcfg); 77 79 free(idevcfg); 78 80 } -
uspace/srv/hid/display/seat.c
rb0ae23f ra0d4afe 43 43 #include "cursor.h" 44 44 #include "display.h" 45 #include "idevcfg.h" 45 46 #include "seat.h" 46 47 #include "window.h" … … 79 80 } 80 81 82 list_initialize(&seat->idevcfgs); 83 81 84 ds_display_add_seat(display, seat); 82 85 seat->pntpos.x = 0; … … 96 99 void ds_seat_destroy(ds_seat_t *seat) 97 100 { 101 ds_idevcfg_t *idevcfg; 102 103 /* Remove all input device configuration entries pointing to this seat */ 104 idevcfg = ds_seat_first_idevcfg(seat); 105 while (idevcfg != NULL) { 106 ds_idevcfg_destroy(idevcfg); 107 idevcfg = ds_seat_first_idevcfg(seat); 108 } 109 98 110 ds_display_remove_seat(seat); 111 99 112 free(seat->name); 100 113 free(seat); … … 549 562 } 550 563 564 /** Add input device configuration entry to seat. 565 * 566 * @param seat Seat 567 * @param idevcfg Input device configuration 568 */ 569 void ds_seat_add_idevcfg(ds_seat_t *seat, ds_idevcfg_t *idevcfg) 570 { 571 assert(idevcfg->seat == NULL); 572 assert(!link_used(&idevcfg->lseatidcfgs)); 573 574 idevcfg->seat = seat; 575 list_append(&idevcfg->lseatidcfgs, &seat->idevcfgs); 576 } 577 578 /** Remove input device configuration entry from seat. 579 * 580 * @param idevcfg Input device configuration entry 581 */ 582 void ds_seat_remove_idevcfg(ds_idevcfg_t *idevcfg) 583 { 584 list_remove(&idevcfg->lseatidcfgs); 585 idevcfg->seat = NULL; 586 } 587 588 /** Get first input device configuration entry in seat. 589 * 590 * @param disp Display 591 * @return First input device configuration entry or @c NULL if there is none 592 */ 593 ds_idevcfg_t *ds_seat_first_idevcfg(ds_seat_t *seat) 594 { 595 link_t *link = list_first(&seat->idevcfgs); 596 597 if (link == NULL) 598 return NULL; 599 600 return list_get_instance(link, ds_idevcfg_t, lseatidcfgs); 601 } 602 603 /** Get next input device configuration entry in seat. 604 * 605 * @param idevcfg Current input device configuration entry 606 * @return Next input device configuration entry or @c NULL if there is none 607 */ 608 ds_idevcfg_t *ds_seat_next_idevcfg(ds_idevcfg_t *idevcfg) 609 { 610 link_t *link = list_next(&idevcfg->lseatidcfgs, &idevcfg->seat->idevcfgs); 611 612 if (link == NULL) 613 return NULL; 614 615 return list_get_instance(link, ds_idevcfg_t, lseatidcfgs); 616 } 617 551 618 /** @} 552 619 */ -
uspace/srv/hid/display/seat.h
rb0ae23f ra0d4afe 58 58 extern void ds_seat_set_wm_cursor(ds_seat_t *, ds_cursor_t *); 59 59 extern errno_t ds_seat_paint_pointer(ds_seat_t *, gfx_rect_t *); 60 extern void ds_seat_add_idevcfg(ds_seat_t *, ds_idevcfg_t *); 61 extern void ds_seat_remove_idevcfg(ds_idevcfg_t *); 62 extern ds_idevcfg_t *ds_seat_first_idevcfg(ds_seat_t *); 63 extern ds_idevcfg_t *ds_seat_next_idevcfg(ds_idevcfg_t *); 60 64 61 65 #endif -
uspace/srv/hid/display/types/display/idevcfg.h
rb0ae23f ra0d4afe 45 45 struct ds_display *display; 46 46 /** Link to display->idevcfgs */ 47 link_t lidevcfgs; 47 link_t ldispidcfgs; 48 /** Link to seat->idevcfgs */ 49 link_t lseatidcfgs; 48 50 /** Service ID */ 49 51 service_id_t svc_id; -
uspace/srv/hid/display/types/display/seat.h
rb0ae23f ra0d4afe 52 52 /** Seat name */ 53 53 char *name; 54 /** Input device configurations mapping to this seat */ 55 list_t idevcfgs; 54 56 /** Window this seat is focused on */ 55 57 struct ds_window *focus;
Note:
See TracChangeset
for help on using the changeset viewer.