Changeset a0d4afe in mainline for uspace/srv/hid/display/seat.c
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 */
Note:
See TracChangeset
for help on using the changeset viewer.