mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-04-02 07:15:53 -04:00
Use a callback object instead of ad-hoc lists for sync and frame events
So obvious in retrospect. The object system can do all the work for us and keep track of pending calls as regular objects and we don't need to abuse the resource system to get them cleaned up on client exit. We don't need the custom key management or (broken) lookup, we just sue object IDs. And last but not least, anybody can receive the callback, not just display listeners.
This commit is contained in:
parent
1648109c84
commit
0af17ed98c
4 changed files with 42 additions and 175 deletions
|
|
@ -50,9 +50,7 @@ void *wl_proxy_get_user_data(struct wl_proxy *proxy);
|
|||
#define WL_DISPLAY_WRITABLE 0x02
|
||||
|
||||
typedef int (*wl_display_update_func_t)(uint32_t mask, void *data);
|
||||
typedef void (*wl_display_sync_func_t)(void *data);
|
||||
typedef void (*wl_display_frame_func_t)(struct wl_surface *surface,
|
||||
void *data, uint32_t time);
|
||||
typedef void (*wl_callback_func_t)(void *data, uint32_t time);
|
||||
|
||||
struct wl_display *wl_display_connect(const char *name);
|
||||
void wl_display_destroy(struct wl_display *display);
|
||||
|
|
@ -61,11 +59,7 @@ int wl_display_get_fd(struct wl_display *display,
|
|||
uint32_t wl_display_allocate_id(struct wl_display *display);
|
||||
void wl_display_iterate(struct wl_display *display, uint32_t mask);
|
||||
void wl_display_flush(struct wl_display *display);
|
||||
int wl_display_sync_callback(struct wl_display *display,
|
||||
wl_display_sync_func_t func, void *data);
|
||||
int wl_display_frame_callback(struct wl_display *display,
|
||||
struct wl_surface *surface,
|
||||
wl_display_frame_func_t func, void *data);
|
||||
void wl_display_roundtrip(struct wl_display *display);
|
||||
|
||||
struct wl_global_listener;
|
||||
typedef void (*wl_display_global_func_t)(struct wl_display *display,
|
||||
|
|
@ -79,7 +73,7 @@ wl_display_remove_global_listener(struct wl_display *display,
|
|||
struct wl_global_listener *
|
||||
wl_display_add_global_listener(struct wl_display *display,
|
||||
wl_display_global_func_t handler, void *data);
|
||||
WL_EXPORT uint32_t
|
||||
uint32_t
|
||||
wl_display_get_global(struct wl_display *display,
|
||||
const char *interface, uint32_t version);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue