libwayland and Java

Andreas Ericsson ae at op5.se
Mon Dec 17 00:50:26 PST 2012


On 12/17/2012 03:11 AM, Jason Ekstrand wrote:
> Hello All,
> My name is Jason Ekstrand and I'm currently working on writing a Wayland
> server for Android. This is not to be confused with what Pekka Paalanen is
> working on; rather, my objective is to make a Wayland server that runs as
> an actual Android app. I have a basic proof-of-concept working without any
> input capabilities.
> 
> In order to tie into the Android services and events systems, a lot of
> things have to be implemented in Java. It will be simpler if I can write
> the entire server in Java. To that end, I'm writing Java bindings to
> libwayland and have come across a few snags. Specifically, I really wish I
> could do my own marshaling. Right now, I'm having to generate native
> methods for every even just so that I can call the variadic
> wl_resource_post_event. It would be much easier if there were a version
> that could take an array of arguments so I could do everything at runtime.
> I also have a function that translates c arguments to java for requests.
> Again, I have to generate a native function for every request so that I can
> pass in valid function pointers. It would be great if libwayland could call
> my marshaling function directly and let me handle calling the request
> callback. Would it be practical to build this kind of support into
> libwayland?
> 
> Also, I would appreciate any feedback on wayland app project in general.
> 

This is really a tangent, but wouldn't it be easier for long-term maintenance,
speed-of-development and app performance if you used native code with some
language-to-language shim in between that lets you do what you want?

Wayland 2 might be very different, after all, but if you have a shim you will
only have to update very, very little code to get it to work for all eternity,
and it's generally a bad idea to reimplement protocols and data structures in
a separate language.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.


More information about the wayland-devel mailing list