diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2011-08-01 16:21:39 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2011-08-02 11:59:26 -0400 |
commit | 66afedd90784450d98d8ad396e31dcd2903f378e (patch) | |
tree | c9bb2ecbcce320ff06eb939590d2fc458d60edc0 | |
parent | 61fbec3d17c5b9113eb6158ef44ccc3567cf2d6d (diff) |
Remove callback helpersprotocol-changes
It's a lot less code to just set it up in the clients
-rw-r--r-- | wayland/wayland-client.c | 56 | ||||
-rw-r--r-- | wayland/wayland-client.h | 8 |
2 files changed, 0 insertions, 64 deletions
diff --git a/wayland/wayland-client.c b/wayland/wayland-client.c index 0f970b1..ab21c70 100644 --- a/wayland/wayland-client.c +++ b/wayland/wayland-client.c @@ -413,62 +413,6 @@ wl_display_get_fd(struct wl_display *display, return display->fd; } -struct wl_callback_data { - wl_callback_func_t func; - void *data; -}; - -static void -callback_done(void *data, struct wl_callback *callback, uint32_t time) -{ - struct wl_callback_data *callback_data = data; - - callback_data->func(callback_data->data, time); - free(callback_data); - // wl_callback_destroy(callback); -} - -static const struct wl_callback_listener callback_listener = { - callback_done -}; - -int -wl_callback_setup(struct wl_callback *callback, - wl_callback_func_t func, void *data) -{ - struct wl_callback_data *callback_data; - - if (callback == NULL) - return -1; - - callback_data = malloc(sizeof *callback_data); - if (callback_data == NULL) { - wl_callback_destroy(callback); - return -1; - } - - callback_data->func = func; - callback_data->data = data; - wl_callback_add_listener(callback, &callback_listener, callback_data); - - return 0; -} - -WL_EXPORT int -wl_display_sync_callback(struct wl_display *display, - wl_callback_func_t func, void *data) -{ - return wl_callback_setup(wl_display_sync(display), func, data); -} - -WL_EXPORT int -wl_surface_frame_callback(struct wl_surface *surface, - wl_callback_func_t func, void *data) -{ - return wl_callback_setup(wl_surface_frame(surface), func, data); -} - - static void sync_callback(void *data, struct wl_callback *callback, uint32_t time) { diff --git a/wayland/wayland-client.h b/wayland/wayland-client.h index a7041c3..5df5f06 100644 --- a/wayland/wayland-client.h +++ b/wayland/wayland-client.h @@ -63,11 +63,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_callback_func_t func, void *data); void wl_display_roundtrip(struct wl_display *display); -int wl_callback_setup(struct wl_callback *callback, - wl_callback_func_t func, void *data); struct wl_global_listener; typedef void (*wl_display_global_func_t)(struct wl_display *display, @@ -85,10 +81,6 @@ uint32_t wl_display_get_global(struct wl_display *display, const char *interface, uint32_t version); -int -wl_surface_frame_callback(struct wl_surface *surface, - wl_callback_func_t func, void *data); - #ifdef __cplusplus } #endif |