aboutsummaryrefslogtreecommitdiffstats
path: root/src/connection.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason@jlekstrand.net>2013-07-17 21:58:46 -0500
committerKristian Høgsberg <krh@bitplanet.net>2013-08-19 16:23:08 -0700
commitc44090908db1c4f1b0e87bda2e4fdaa6bc15c0d1 (patch)
tree0685fb9542a2693899bc04d4fdc9efefe8ca82ff /src/connection.c
parentdoc: Add a section on interface and protocol object versioning (diff)
downloadwayland-c44090908db1c4f1b0e87bda2e4fdaa6bc15c0d1.tar
wayland-c44090908db1c4f1b0e87bda2e4fdaa6bc15c0d1.tar.gz
wayland-c44090908db1c4f1b0e87bda2e4fdaa6bc15c0d1.tar.bz2
wayland-c44090908db1c4f1b0e87bda2e4fdaa6bc15c0d1.tar.lz
wayland-c44090908db1c4f1b0e87bda2e4fdaa6bc15c0d1.tar.xz
wayland-c44090908db1c4f1b0e87bda2e4fdaa6bc15c0d1.tar.zst
wayland-c44090908db1c4f1b0e87bda2e4fdaa6bc15c0d1.zip
Add support for server-side language bindings
This commit adds support for server-side languages bindings. This is done in two ways: 1. Adding a wl_resource_set_dispatcher function that corresponds to wl_resource_set_interface. The only difference between the two functions is that the new version takes a dispatcher along with the implementation, data, and destructor. This allows for runtime calling of native language functions for callbacks instead of having to generate function pointers. 2. Adding versions of wl_resource_post_event and wl_resource_queue_event that take an array of wl_argument instead of a variable argument list. This allows for easier run-time argument conversion and removes the need for libffi-based calling of variadic functions. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src/connection.c')
-rw-r--r--src/connection.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/connection.c b/src/connection.c
index 9bb850c..451b93e 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -891,7 +891,6 @@ convert_arguments_to_ffi(const char *signature, uint32_t flags,
}
}
-
void
wl_closure_invoke(struct wl_closure *closure, uint32_t flags,
struct wl_object *target, uint32_t opcode, void *data)
@@ -919,6 +918,14 @@ wl_closure_invoke(struct wl_closure *closure, uint32_t flags,
ffi_call(&cif, implementation[opcode], NULL, ffi_args);
}
+void
+wl_closure_dispatch(struct wl_closure *closure, wl_dispatcher_func_t dispatcher,
+ struct wl_object *target, uint32_t opcode)
+{
+ dispatcher(target->implementation, target, opcode, closure->message,
+ closure->args);
+}
+
static int
copy_fds_to_connection(struct wl_closure *closure,
struct wl_connection *connection)