[PATCH wayland 0/7] Add support for custom dispatchers
Jason Ekstrand
jason at jlekstrand.net
Fri Feb 1 08:09:41 PST 2013
Ths patch group contains my additions for custom dispatcher support inside
libwayland. This would allow someone to handle event and resource function
calling at runtime rather than through a list of function pointers and libffi.
The primary use case for these modifications is to enable much more flexible
binding to non-C languages.
As far as I am concerned, these patches are ready for commit. All unit tests
pass including new ones. Also, weston successfully builds and runs against
this version.
Concerning ABI: I can't see why any programs built against earlier versions
should break with these changes. If patch 5 (for wayland-scanner) is omitted,
earlier version of weston built against 1.0.4 work in spite of complaining
about different sized structures in the shared object. With patch 5, they
segfault because the version is above 1 but the dispatcher is not null. I'm
not seeing why this happens but it may be that I don't understand ABI's well
enough.
Jason Ekstrand (7):
Make a #define for WL_CLOSURE_MAX_ARGS instead of a magic number.
Add a default dispatcher function and related test
Convert wl_closure to use wl_argument and enable dispatchers
Fill out dummy objects in tests so dispatchers will work
Make the scanner generate version 1 wl_interface structures
Add wl_arguments forms of wl_resource_post_event and
wl_resource_queue_event
Test for proper usage of custom vs. default dispatchers
src/connection.c | 421 ++++++++++++++++++++++++++++-------------------
src/scanner.c | 3 +-
src/wayland-client.c | 29 ++--
src/wayland-private.h | 20 ++-
src/wayland-server.c | 69 ++++----
src/wayland-server.h | 4 +
src/wayland-util.h | 38 ++++-
tests/.gitignore | 1 +
tests/Makefile.am | 2 +
tests/connection-test.c | 35 +++-
tests/dispatcher-test.c | 163 ++++++++++++++++++
tests/os-wrappers-test.c | 11 +-
12 files changed, 566 insertions(+), 230 deletions(-)
create mode 100644 tests/dispatcher-test.c
--
1.8.1
More information about the wayland-devel
mailing list