Can I copy-paste Wayland generated header in my own library header?

Christian Stroetmann stroetmann at
Wed Dec 6 00:44:11 UTC 2017

On 04 Dec 2017 09:45, Pekka Paalanen wrote:
> On Sat, 02 Dec 2017 09:39:33 -0500
> ferreiradaselva<ferreiradaselva at>  wrote:
>> Good morning.
>> I'm writing a cross-platform window framework, like GLFW, but
>> containing only two files (a source and a header).
>> I would like to copy and paste the content of the xdg-shell.h
>> generated with wayland-scanner into my header (swfw.h), between
>> #ifdef/#endif, so if the user compiles for Wayland, the user won't
>> need to generate the xdg-shell.h.
>> My framework is under ZLIB, and Wayland is under MIT. I would like to
>> know from the team: does it affect the license of my framework by
>> copying and pasting the header to make my lib easier to use? And, if
>> does, any recommendations about what to do?
>> This is sort of how it would look like:
>> #ifndef MY_LIB
>> #define MY_LIB
>> /* The whole xdg-shell.h header is pasted here */
>> struct window {
>>      struct wl_surface *surface;
>>      struct wl_buffer *buffer;
>>      ...
>> };
>> struct context {
>>      struct wl_display *display;
>>      struct wl_compositor *compositor;
>>      struct wl_seat *seat;
>>      struct wl_pointer *pointer;
>>      struct wl_keyboard *keyboard;
>>      ...
>> };
>> #endif /* USE_WAYLAND_BACKEND */
>> /* Other backends */
>> #endif /* MY_LIB */

Hello everybody

First of all, you raised one or more highly intersting questions, that 
could fill books and fuel scientific the field of 
jurisprudence/law/legal studies for decades. :D

> Hi,
> first, IANAL, of course.
> The copyrights header you get in the generated headers and code comes
> from the XML files. It is the license of the XML protocol
> specification. I'm not sure if it applies to the generated code or not,
> I'd like to think it does, but I don't see much difference given how
> they are meant to be used.

The question, who owns a work that has been automatically generated from 
one or more other works, has not been answered, as far as I know, and 
cannot be answered in general. It depends on the act and the situation 
or context.

A comparable case is the field of generative music, where a user 
buys/gets a programm that includes for example building blocks of music 
(e.g. sounds, voices, instrumental tones, etc.) and an algorithm that 
puts these music blocks together at runtime resulting in audible music. 
Often this generation of music is virtually not repeatable in the same 
way, because of the many possible variants.

A musician, who creates and sells such generative music works, said he 
thinks the generated music is owned by the user.
My opinion is that merely pushing the play button of the generative 
music software is not sufficient to be acknowledged as an artistic act, 
which is required for copyright protection. Indeed, it is very difficult 
to see a personal expression in such an activity that is characteristic 
for a specific user of such a software.

The same holds in this case. It is very difficult to see an artistic act 
in writing a command line and pushing the enter button to start 
scanning, compiling, and generating a software out of another software 
or text.

> Personally I would have no problem whatsoever for you to do what you
> want. Also the MIT license is very liberal, and you might want to read
> the dissection here:
> I would add annotations in your files to clearly document which parts
> are verbatim/modified copies of the generated stuff, and from where and
> how they were generated - perhaps generating and piecing together the
> files could be part of your project's build from source even if your
> distributables are just more source. I would also keep the (generated)
> license blurbs with notes on which part of the file they apply to.
> I don't know ZLIB license, or why you picked that instead of MIT, for
> instance.
> Since the whole purpose of wayland-protocols is that you take the XML
> file, run it through wayland-scanner, and include the compiled product
> of that in your program binaries, there is no intention to change or
> affect *your* license. Even totally closed source proprietary programs
> are just fine using anything generated by wayland-scanner from
> wayland-protocols.
> I also see no reason to even attempt to forbid e.g. modifications to
> the generated code or even the XML itself.

Indeed, safety first. Make clear where all the stuff comes from and how 
it is licensed, but do not impose your license or any other license on 
parts that you do not own.

> ---
> Mind, that while libwayland-client tries hard to maintain backwards
> compatiblity, it is not guaranteeing forward compatibility. Code
> generated with a newer wayland-scanner may not work with an older
> libwayland-client. This has been necessary to fix bugs.
> We encourage all projects to run wayland-scanner as part of their build
> and match the wayland-scanner with the libwayland version they require
> minimum, instead of storing the generated code in VCS. That way
> distributions can choose a more recent libwayland minimum version with
> any bug fixes in the generated code.
> Thanks,
> pq
  Best regards
Christian Stroetmann

More information about the wayland-devel mailing list