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>
This commit is contained in:
Jason Ekstrand 2013-07-17 21:58:46 -05:00 committed by Kristian Høgsberg
parent 6b8eef962f
commit c44090908d
5 changed files with 120 additions and 25 deletions

View file

@ -97,17 +97,6 @@ int wl_connection_write(struct wl_connection *connection, const void *data, size
int wl_connection_queue(struct wl_connection *connection,
const void *data, size_t count);
union wl_argument {
int32_t i;
uint32_t u;
wl_fixed_t f;
const char *s;
struct wl_object *o;
uint32_t n;
struct wl_array *a;
int32_t h;
};
struct wl_closure {
int count;
const struct wl_message *message;
@ -163,6 +152,9 @@ enum wl_closure_invoke_flag {
void
wl_closure_invoke(struct wl_closure *closure, uint32_t flags,
struct wl_object *target, uint32_t opcode, void *data);
void
wl_closure_dispatch(struct wl_closure *closure, wl_dispatcher_func_t dispatcher,
struct wl_object *target, uint32_t opcode);
int
wl_closure_send(struct wl_closure *closure, struct wl_connection *connection);
int