summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-04-18 12:35:01 -0400
committerKristian Høgsberg <krh@bitplanet.net>2011-04-20 17:19:56 -0400
commit13ca93794405965cac8d3e3173f3f4eda2ff28c6 (patch)
tree15208439404057a4e43e16c7607f8c69e425860b
parentc5ec478d46a8fc8590002fe156df875da2b5b143 (diff)
Pass version number to global bind functionsubscribe
-rw-r--r--wayland/wayland-server.c8
-rw-r--r--wayland/wayland-server.h11
2 files changed, 12 insertions, 7 deletions
diff --git a/wayland/wayland-server.c b/wayland/wayland-server.c
index 082a6a1..ed16300 100644
--- a/wayland/wayland-server.c
+++ b/wayland/wayland-server.c
@@ -84,7 +84,7 @@ struct wl_frame_listener {
struct wl_global {
struct wl_object *object;
- wl_client_connect_func_t func;
+ wl_global_bind_func_t func;
struct wl_list link;
};
@@ -476,7 +476,7 @@ display_bind(struct wl_client *client,
wl_list_for_each(global, &display->global_list, link)
if (global->object->id == id && global->func)
- global->func(client, global->object);
+ global->func(client, global->object, version);
}
static void
@@ -603,7 +603,7 @@ wl_display_add_object(struct wl_display *display, struct wl_object *object)
WL_EXPORT int
wl_display_add_global(struct wl_display *display,
- struct wl_object *object, wl_client_connect_func_t func)
+ struct wl_object *object, wl_global_bind_func_t func)
{
struct wl_global *global;
@@ -615,7 +615,7 @@ wl_display_add_global(struct wl_display *display,
global->func = func;
wl_list_insert(display->global_list.prev, &global->link);
- return 0;
+ return 0;
}
WL_EXPORT void
diff --git a/wayland/wayland-server.h b/wayland/wayland-server.h
index 8032866..d80ca32 100644
--- a/wayland/wayland-server.h
+++ b/wayland/wayland-server.h
@@ -81,11 +81,16 @@ int wl_display_add_socket(struct wl_display *display, const char *name);
void wl_display_terminate(struct wl_display *display);
void wl_display_run(struct wl_display *display);
-void wl_display_add_object(struct wl_display *display, struct wl_object *object);
+void wl_display_add_object(struct wl_display *display,
+ struct wl_object *object);
-typedef void (*wl_client_connect_func_t)(struct wl_client *client, struct wl_object *global);
+typedef void (*wl_global_bind_func_t)(struct wl_client *client,
+ struct wl_object *global,
+ uint32_t version);
-int wl_display_add_global(struct wl_display *display, struct wl_object *object, wl_client_connect_func_t func);
+int wl_display_add_global(struct wl_display *display,
+ struct wl_object *object,
+ wl_global_bind_func_t func);
struct wl_client *wl_client_create(struct wl_display *display, int fd);
void wl_client_destroy(struct wl_client *client);