jextract wayland-client
Thiago Milczarek Sayão
thiago.sayao at gmail.com
Sun Apr 21 22:51:33 UTC 2024
Hello Jorn,
Thanks for replying.
I think it's by design - those fields of wl_registry are private and only
accessible through wl_registry functions;
The problem is that it does not generate the functions that uses it, for
example wl_display_get_registry
I did:
jextract --output src/main/java -t org.freedesktop.wayland.client \
--header-class-name WlClientProto `pkg-config --cflags-only-I
wayland-client` \
`pkg-config --libs wayland-client` \
/usr/include/wayland-client-protocol.h
The clarified message looks good.
Em dom., 21 de abr. de 2024 às 18:30, Jorn Vernee <jorn.vernee at oracle.com>
escreveu:
> Hello Thiago,
>
> It looks like the library you are using uses opaque types. Or, in other
> words, a type that is declared but not defined, such as:
>
> struct Foo;
>
> These types are not supported by jextract in the sense that the header
> file does not contain any definition for these types, so jextract also
> can't generate any code to access the fields of such a struct. This is not
> a current limitation of jextract, but a limitation imposed by the wayland
> library.
>
> This is known as the 'opaque pointer idiom' [1]. It is a way of
> encapsulating the internals of a type, while still allowing a client to use
> it. It looks like the wayland library uses types like these in a lot of
> places. It doesn't mean that the library is unusable, it just means that
> the contents of these structs is not exposed by the library (and therefore
> *cannot* be exposed by jextract). i.e. this is by design. You should
> still be able to use the library through the generated bindings.
>
> I think for clarity we could perhaps change the warning message that
> jextract prints to something like:
>
> WARNING: Skipping wl_registry (type Declared(wl_registry) is declared
> but not defined)
>
> HTH,
> Jorn
>
> [1]: https://en.wikipedia.org/wiki/Opaque_pointer
> On 21/04/2024 18:58, Thiago Milczarek Sayão wrote:
>
> Hi,
>
> I'm trying to make a java wayland client (currently as a proof of concept).
>
> I've attempted to generate the bindings like this:
>
> jextract --output src -t org.freedesktop.wayland.client
> --header-class-name WlClient -lwayland-client /usr/include/wayland-client.h
>
> But the wl_xxx types seem to not be supported as it outputs:
>
> WARNING: Skipping wl_registry (type Declared(wl_registry) is not supported)
>
> I've probably hit a current limitation. Is it expected to work in the
> future?
>
> Thanks.
> -- Thiago.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jextract-dev/attachments/20240421/67fd5b6a/attachment-0001.htm>
More information about the jextract-dev
mailing list