mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-05 13:29:50 -05:00
Drop surface iterator API, just track surfaces in the compositor.
This commit is contained in:
parent
eac149ad06
commit
201a904889
4 changed files with 40 additions and 85 deletions
51
wayland.c
51
wayland.c
|
|
@ -794,54 +794,3 @@ wl_display_add_socket(struct wl_display *display,
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
struct wl_surface_iterator {
|
||||
struct wl_list *head;
|
||||
struct wl_surface *surface;
|
||||
uint32_t mask;
|
||||
};
|
||||
|
||||
WL_EXPORT struct wl_surface_iterator *
|
||||
wl_surface_iterator_create(struct wl_display *display, uint32_t mask)
|
||||
{
|
||||
struct wl_surface_iterator *iterator;
|
||||
|
||||
iterator = malloc(sizeof *iterator);
|
||||
if (iterator == NULL)
|
||||
return NULL;
|
||||
|
||||
iterator->head = &display->surface_list;
|
||||
iterator->surface = container_of(display->surface_list.next,
|
||||
struct wl_surface, link);
|
||||
iterator->mask = mask;
|
||||
|
||||
return iterator;
|
||||
}
|
||||
|
||||
WL_EXPORT int
|
||||
wl_surface_iterator_next(struct wl_surface_iterator *iterator,
|
||||
struct wl_surface **surface)
|
||||
{
|
||||
if (&iterator->surface->link == iterator->head)
|
||||
return 0;
|
||||
|
||||
*surface = iterator->surface;
|
||||
iterator->surface = container_of(iterator->surface->link.next,
|
||||
struct wl_surface, link);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
WL_EXPORT void
|
||||
wl_surface_iterator_destroy(struct wl_surface_iterator *iterator)
|
||||
{
|
||||
free(iterator);
|
||||
}
|
||||
|
||||
WL_EXPORT void
|
||||
wl_display_raise_surface(struct wl_display *display, struct wl_surface *surface)
|
||||
{
|
||||
wl_list_remove(&surface->link);
|
||||
wl_list_insert(display->surface_list.prev, &surface->link);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue