libwayland and Java

Pekka Paalanen ppaalanen at gmail.com
Mon Dec 17 02:15:40 PST 2012


On Sun, 16 Dec 2012 20:11:51 -0600
Jason Ekstrand <jason at jlekstrand.net> 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.

Hi Jason,

nice! What is your use case? Allowing a chroot on an Android device to
use the display and input?

> 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?

Wayland bindings for different languages have come up several times in
the past, and we don't have really good answers, I think. Could you
write a sketch (as in code) on what kind of alternate API you would like
to have in libwayland, and how does it interact with the current API?

Even though you might not have the requirement on Android as an app, we
also need to support sharing libwayland-{client,server}.so between the
app and any libraries. It will break, if there are several instances or
implementations of the .so in one process, because we e.g. compare
pointers to static data.

I cannot decide whether any new libwayland API is acceptable or not, but
it would be interesting to see, and maybe we could get comments from
other languages' developers, too.

Kristian said he is on vacation for two weeks now, and I will be on
vacation after this week, too. I don't know about others, but it might
be fairly quiet for the rest of the year.


Thanks,
pq


More information about the wayland-devel mailing list