[PATCH wayland v2 1/3] introduce new headers wayland-client/server-core.h

Giulio Camuffo giuliocamuffo at gmail.com
Wed Apr 29 02:50:48 PDT 2015


2015-04-29 12:13 GMT+03:00 Pekka Paalanen <ppaalanen at gmail.com>:
> On Tue, 28 Apr 2015 22:57:16 +0300
> Giulio Camuffo <giuliocamuffo at gmail.com> wrote:
>
>> wayland-client.h and wayland-server.h include the protocol headers generated
>> at build time. This means that a libwayland user cannot generate and use
>> protocol code created from a wayland.xml newer than the installed libwayand,
>> because it is not possible to only include the API header.
>> This commit adds wayland-client-core.h and wayland-server-core.h which do not
>> include the protocol headers and any deprecated code.
>> ---
>>
>> v2: move the deprecated api back to wayland-server.h
>>
>>  Makefile.am               |   2 +
>>  src/wayland-client-core.h | 180 +++++++++++++++++++++
>>  src/wayland-client.h      | 155 +-----------------
>>  src/wayland-server-core.h | 405 ++++++++++++++++++++++++++++++++++++++++++++++
>>  src/wayland-server.h      | 377 +-----------------------------------------
>>  5 files changed, 592 insertions(+), 527 deletions(-)
>>  create mode 100644 src/wayland-client-core.h
>>  create mode 100644 src/wayland-server-core.h
>>
>> diff --git a/Makefile.am b/Makefile.am
>> index 0fccf86..a8a0a56 100644
>> --- a/Makefile.am
>> +++ b/Makefile.am
>> @@ -21,7 +21,9 @@ noinst_LTLIBRARIES = libwayland-util.la
>>  include_HEADERS =                            \
>>       src/wayland-util.h                      \
>>       src/wayland-server.h                    \
>> +     src/wayland-server-core.h               \
>>       src/wayland-client.h                    \
>> +     src/wayland-client-core.h               \
>>       src/wayland-egl.h                       \
>>       src/wayland-version.h
>
> Hi,
>
> you also have to fix doc/doxygen/Makefile.am, otherwise we miss all the
> documentation that has been moved into the -core.h files.
>
> That fixed, this is
> Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
>
> I do find the "wayland-client/server-core.h" in the title a bit
> confusing, to me it reads as server-core.h in directory
> wayland-client. "introduce wayland-client-core.h and
> wayland-server-core.h"?
>
> Would be also nice to mention the language bindings use case in the
> commit message, I think that is a more important case than updating
> wayland.xml. After all, wayland.xml is installed with libwayland, so
> they should always be in sync.

Well, my use case is exactly to use a wayland.xml different than the
one installed ;). I'll mention that, though.

>
> Do we have any project already using the new headers and the new
> --include-core-only option? We should have that before 1.8 final is
> released, so we have also tested the new way.

No, I hacked up some tests but nothing upstreamable. I'll see to make
weston use them.

>
> It also occurred to me that it would be nice to install Wayland headers
> into a wayland/ sub-directory, but that's another story.
>
> And I suppose we don't want to actually push people away from the old
> headers if they work fine, right?

Maybe not push people but i don't think saying that using the new ones
is preferred would be a bad idea actually. In exchange for having to
include one more header you get a nice logical separation between
library and protocol api and you do not ned to change a lot of code if
in the future you need to separate them.


Thanks,
Giulio

>
>
> Thanks,
> pq


More information about the wayland-devel mailing list