Basic API usage

Jan Bruns code at abnuto.de
Wed Sep 9 13:18:20 UTC 2020


Hallo Pekka,

 >>  > Unfortunately there are many details that have not yet been written
 >>  > down in a specification document, which means you need to compare 
with
 >>  > how the C bindings actually work, e.g. what does wayland-scanner do
 >>  > with the XML. The common catch is that a new_id argument without an
 >>  > interface defined in the XML will expand into three arguments, 
not one.
 >>  > Event and request opcodes are assigned independently and 
implicitly in
 >>  > the order they appear inside an interface definition in the XML.
 >>
 >> I didn't get to see a wayland-scanner. Where is it?
 >
 > 
https://gitlab.freedesktop.org/wayland/wayland/-/blob/master/src/scanner.c

Haha, I could have sworn there was no *-scanner.c here.

 >>  > The wayland-*-core.h headers exist (as an afterthought, which 
explains
 >>  > all this duplicity in the APIs as well) exactly so that programs 
using
 >>  > non-C bindings would not need to pull in the C bindings.
 >>  >
 >>  > If I remember the right, the core of the alternate bindings API for
 >>  > client side is formed from:
 >>  > - wl_proxy_marshal_array
 >>  > - wl_proxy_marshal_array_constructor
 >>  > - wl_proxy_marshal_array_constructor_versioned
 >>  > - wl_proxy_add_dispatcher
 >>
 >> Ah, but this won't work for me.
 >>
 >> To me it appears extremely strange (impossible!) to have open argument
 >> list functions exported, especially as essential parts for a project
 >> that aims to replace something X some day.
 >
 > Those are not variadic functions. What do you mean?
 >
 > You should not need to use a single variadic function to be able to
 > wrap libwayland correctly.

Ah, correct, this seems to be what the "array"-part in the name should 
have made clear, and you already sorted out the variadic alternatives. I 
was mislead by the interleaved formating in the source, in combination 
with the not so common usage of struct/union-keywords within parameter 
lists, and the very minmal delta in the excessive comments talking about 
that difference on the opposite than expected versions.

I'll have to reevaluate the amount of required work now, and maybe I 
could start with simple tests. My guess is there's some parent-child 
process relationship required in order for the fd-passing mechanism to work?

Gruss

Jan Bruns



More information about the wayland-devel mailing list