mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
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:
parent
6b8eef962f
commit
c44090908d
5 changed files with 120 additions and 25 deletions
|
|
@ -241,8 +241,12 @@ wl_display_remove_global(struct wl_display *display,
|
|||
*/
|
||||
void wl_resource_post_event(struct wl_resource *resource,
|
||||
uint32_t opcode, ...);
|
||||
void wl_resource_post_event_array(struct wl_resource *resource,
|
||||
uint32_t opcode, union wl_argument *args);
|
||||
void wl_resource_queue_event(struct wl_resource *resource,
|
||||
uint32_t opcode, ...);
|
||||
void wl_resource_queue_event_array(struct wl_resource *resource,
|
||||
uint32_t opcode, union wl_argument *args);
|
||||
|
||||
/* msg is a printf format string, variable args are its args. */
|
||||
void wl_resource_post_error(struct wl_resource *resource,
|
||||
|
|
@ -264,6 +268,12 @@ wl_resource_set_implementation(struct wl_resource *resource,
|
|||
const void *implementation,
|
||||
void *data,
|
||||
wl_resource_destroy_func_t destroy);
|
||||
void
|
||||
wl_resource_set_dispatcher(struct wl_resource *resource,
|
||||
wl_dispatcher_func_t dispatcher,
|
||||
const void *implementation,
|
||||
void *data,
|
||||
wl_resource_destroy_func_t destroy);
|
||||
|
||||
void
|
||||
wl_resource_destroy(struct wl_resource *resource);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue