seat: Add occupancy count
parent
87c034db43
commit
c01e5c6080
|
@ -26,6 +26,8 @@ struct seat {
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
uint32_t capabilities;
|
uint32_t capabilities;
|
||||||
char name[256];
|
char name[256];
|
||||||
|
|
||||||
|
uint32_t occupancy;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct seat* seat_new(struct wl_seat* wl_seat, uint32_t id);
|
struct seat* seat_new(struct wl_seat* wl_seat, uint32_t id);
|
||||||
|
@ -34,4 +36,5 @@ void seat_list_destroy(struct wl_list* list);
|
||||||
|
|
||||||
struct seat* seat_find_by_name(struct wl_list* list, const char* name);
|
struct seat* seat_find_by_name(struct wl_list* list, const char* name);
|
||||||
struct seat* seat_find_by_id(struct wl_list* list, uint32_t id);
|
struct seat* seat_find_by_id(struct wl_list* list, uint32_t id);
|
||||||
|
struct seat* seat_find_unoccupied(struct wl_list* list);
|
||||||
struct seat* seat_first(struct wl_list* list);
|
struct seat* seat_first(struct wl_list* list);
|
||||||
|
|
11
src/seat.c
11
src/seat.c
|
@ -97,6 +97,17 @@ struct seat* seat_find_by_id(struct wl_list* list, uint32_t id)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct seat* seat_find_unoccupied(struct wl_list* list)
|
||||||
|
{
|
||||||
|
struct seat* seat;
|
||||||
|
|
||||||
|
wl_list_for_each(seat, list, link)
|
||||||
|
if (seat->occupancy == 0)
|
||||||
|
return seat;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
struct seat* seat_first(struct wl_list* list)
|
struct seat* seat_first(struct wl_list* list)
|
||||||
{
|
{
|
||||||
struct seat* seat;
|
struct seat* seat;
|
||||||
|
|
Loading…
Reference in New Issue