platform/upstream/wayland.git
6 years agoscanner: remove unused scanner.mk
Emil Velikov [Wed, 26 Jul 2017 13:56:17 +0000 (14:56 +0100)]
scanner: remove unused scanner.mk

Nothing in the existing codebase references the file.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agoReopen master for regular development
Bryce Harrington [Tue, 8 Aug 2017 19:03:27 +0000 (12:03 -0700)]
Reopen master for regular development

A 1.14 branch has been established for stable release work.

6 years agoconfigure.ac: bump to version 1.14.0 for the official release 1.14.0 upstream/1.14.0
Bryce Harrington [Tue, 8 Aug 2017 18:20:35 +0000 (11:20 -0700)]
configure.ac: bump to version 1.14.0 for the official release

6 years agoconfigure.ac: bump to version 1.13.93 for the RC1 release 1.13.93
Bryce Harrington [Tue, 1 Aug 2017 18:12:43 +0000 (11:12 -0700)]
configure.ac: bump to version 1.13.93 for the RC1 release

7 years agoSwitch graphviz files to use HTML-style labels
Owen W. Taylor [Fri, 2 Jun 2017 02:48:29 +0000 (22:48 -0400)]
Switch graphviz files to use HTML-style labels

With recent versions of graphviz, generation of the diagrams in the documentation
fails with:

 /usr/bin/dot -Tpng -oxml/x-architecture.png dot/x-architecture.gv
 Warning: flat edge between adjacent nodes one of which has a record shape - replace records with HTML-like labels
   Edge xserver -> comp
 Error: getsplinepoints: no spline points available for edge (xserver,comp)
 Error: lost xserver comp edge
 Error: lost xserver comp edge
 Error: lost comp xserver edge
 Error: lost comp xserver edge

http://www.graphviz.org/content/i-havent-been-able-render-these-files-graphviz-226 indicates
that the error message basically means that the authors of graphviz consider record-style
labels to be deprecated and are no longer fixing errors with them. This patch changes
the labels to be in the HTML style, which seems to require duplicating style between all
the nodes, but it's not like these files are often edited.

The result is not exactly the same but is quite similar.

Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
Tested-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agoconfigure.ac: bump to version 1.13.92 for the beta release 1.13.92
Bryce Harrington [Tue, 25 Jul 2017 23:25:01 +0000 (16:25 -0700)]
configure.ac: bump to version 1.13.92 for the beta release

7 years agoconfigure.ac: bump to version 1.13.91 for the alpha release 1.13.91
Bryce Harrington [Wed, 12 Jul 2017 02:07:55 +0000 (19:07 -0700)]
configure.ac: bump to version 1.13.91 for the alpha release

7 years agodocs: Reference Contributor Covenant
Daniel Stone [Thu, 6 Apr 2017 14:09:37 +0000 (15:09 +0100)]
docs: Reference Contributor Covenant

All fd.o projects are now covered by the Contributor Covenant. Include a
reference to this in the Contributing doc, making it clear that we are
all expected to behave like human beings.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Jonas Ådahl <jadahl@gmail.com>
7 years agoscanner: Reword fallthrough comment to quiet GCC
Daniel Stone [Fri, 17 Mar 2017 17:35:38 +0000 (17:35 +0000)]
scanner: Reword fallthrough comment to quiet GCC

GCC 7 now requires an explicit comment noting that case statements
without a break fall through. We already had one of those in the
scanner, but GCC wasn't smart enough to pick it up.

Quiet the warning by making the comment less elaborate.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
7 years agoconnection-test: fix assert
Eric Engestrom [Thu, 16 Mar 2017 11:46:06 +0000 (11:46 +0000)]
connection-test: fix assert

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agowayland-util: do not export the wl_map_* API
Emil Velikov [Tue, 21 Feb 2017 16:14:26 +0000 (16:14 +0000)]
wayland-util: do not export the wl_map_* API

Used only internally and explicitly marked as such with commit
cf04b0a18f2 ("Move private definitions and prototypes to new
zwayland-private.h")

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agowayland-server: Remove unused members from struct wl_client
Sergi Granell [Sun, 26 Feb 2017 21:55:53 +0000 (22:55 +0100)]
wayland-server: Remove unused members from struct wl_client

Those struct members are no longer used so we can remove them.

Signed-off-by: Sergi Granell <xerpi.g.12@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agotests: Fix "new ID" type handling in argument_from_va_list test
Carlos Garnacho [Thu, 23 Feb 2017 12:47:41 +0000 (13:47 +0100)]
tests: Fix "new ID" type handling in argument_from_va_list test

New IDs are internally dealt with as objects, however this test
expected to deal with 'n' as the uint32_t type that's just seen
through the wire. We should give it an object instead, and
expect an object from it.

https://bugs.freedesktop.org/show_bug.cgi?id=99899

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Kalev Lember <kalevlember@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
7 years agoconfigure.ac: bump version to 1.13.90 for open development
Bryce Harrington [Tue, 21 Feb 2017 22:25:03 +0000 (14:25 -0800)]
configure.ac: bump version to 1.13.90 for open development

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agoconfigure.ac: bump to version 1.13.0 for the official release 1.13.0 upstream/1.13.0
Bryce Harrington [Tue, 21 Feb 2017 21:27:16 +0000 (13:27 -0800)]
configure.ac: bump to version 1.13.0 for the official release

7 years agoconfigure.ac: bump to version 1.12.93 for the RC1 release 1.12.93
Bryce Harrington [Tue, 14 Feb 2017 20:56:55 +0000 (12:56 -0800)]
configure.ac: bump to version 1.12.93 for the RC1 release

7 years agoconfigure.ac: bump to version 1.12.92 for the beta release 1.12.92
Bryce Harrington [Tue, 7 Feb 2017 23:14:56 +0000 (15:14 -0800)]
configure.ac: bump to version 1.12.92 for the beta release

7 years agowayland-server: hide wl_priv_signal from doxygen
Pekka Paalanen [Wed, 25 Jan 2017 12:24:44 +0000 (14:24 +0200)]
wayland-server: hide wl_priv_signal from doxygen

Fix this set of warnings appearing three times during a build:

/home/pq/git/wayland/src/wayland-server.c:1868: warning: class
`wl_priv_signal' for related function `wl_priv_signal_init' is not
documented.
/home/pq/git/wayland/src/wayland-server.c:1884: warning: class
`wl_priv_signal' for related function `wl_priv_signal_add' is not
documented.
/home/pq/git/wayland/src/wayland-server.c:1899: warning: class
`wl_priv_signal' for related function `wl_priv_signal_get' is not
documented.

Our Wayland docbook don't include private things, so make sure these do
not end up there. This removes the mention of wl_priv_signal_emit from
the Server API docbook. I have no idea why the other functions did not
appear there.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
7 years agotests: Test wl_argument_from_va_list
Yong Bakos [Wed, 23 Nov 2016 15:38:01 +0000 (07:38 -0800)]
tests: Test wl_argument_from_va_list

connection-test.c did not cover wl_argument_from_va_list, so add one
test that specifically tests this method.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agodtddata: Use standard permission notice
Yong Bakos [Mon, 23 Jan 2017 14:16:30 +0000 (06:16 -0800)]
dtddata: Use standard permission notice

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agowayland-server: log an error for events with wrong client objects
Derek Foreman [Tue, 24 Jan 2017 18:07:21 +0000 (12:07 -0600)]
wayland-server: log an error for events with wrong client objects

Check that all the objects in an event belong to the same client as
the resource posting it.  This prevents a compositor from accidentally
mixing client objects and posting an event that causes a client to
abort with a cryptic message.

Instead the client will now be disconnected as it is when the compositor
tries to send a null for a non-nullable object, and a log message
will be printed by the compositor.

Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoserver: Disallow sending events to clients after posting an error
Derek Foreman [Tue, 24 Jan 2017 18:07:20 +0000 (12:07 -0600)]
server: Disallow sending events to clients after posting an error

Until now, we haven't done anything to prevent sending additional
events to clients after posting an error.

Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoserver: Refactor array send functions
Derek Foreman [Tue, 24 Jan 2017 18:07:19 +0000 (12:07 -0600)]
server: Refactor array send functions

These have grown a little in size but are almost identical, factor
out the common code.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoserver: use the new wl_priv_signal for wl_resource
Giulio Camuffo [Tue, 24 Jan 2017 14:34:30 +0000 (16:34 +0200)]
server: use the new wl_priv_signal for wl_resource

The old wl_signal is kept for backwards compatibility, as that is also
present in the deprecated public wl_resource struct, and that must be
kept working.

Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoserver: use the new wl_priv_signal in wl_client
Giulio Camuffo [Tue, 24 Jan 2017 14:34:29 +0000 (16:34 +0200)]
server: use the new wl_priv_signal in wl_client

Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoserver: add a safer signal type and port wl_display to it
Giulio Camuffo [Tue, 24 Jan 2017 14:34:28 +0000 (16:34 +0200)]
server: add a safer signal type and port wl_display to it

wl_list_for_each_safe, which is used by wl_signal_emit is not really
safe. If a signal has two listeners, and the first one removes and
re-inits the second one, it would enter an infinite loop, which was hit
in weston on resource destruction, which emits a signal.
This commit adds a new version of wl_signal, called wl_priv_signal,
which is private in wayland-server.c and which does not have this problem.
The old wl_signal cannot be improved without breaking backwards compatibility.

Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agotests: Add a test for global filter
Olivier Fourdan [Tue, 24 Jan 2017 15:54:04 +0000 (16:54 +0100)]
tests: Add a test for global filter

Test if the global filter is effectively filtering out the global when
the filter returns false.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
7 years agoconfigure.ac: bump to version 1.12.91 for the alpha release 1.12.91
Bryce Harrington [Wed, 25 Jan 2017 02:13:26 +0000 (18:13 -0800)]
configure.ac: bump to version 1.12.91 for the alpha release

7 years agowayland-server: Add functions to wl_global
Olivier Fourdan [Tue, 18 Oct 2016 14:23:40 +0000 (16:23 +0200)]
wayland-server: Add functions to wl_global

When using a wl_global, a server may need to retrieve the associated
wl_interface and user data.

Add a couple of convenient functions wl_global_get_interface() and
wl_global_get_user_data() for this purpose.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agowayland-server: Add API to control globals visibility
Olivier Fourdan [Tue, 18 Oct 2016 14:23:39 +0000 (16:23 +0200)]
wayland-server: Add API to control globals visibility

Add a new API to let compositor decide whether or not a wl_global
should be advertised to the clients via wl_registry_bind() or
display_get_registry()

By using its own filter, the compositor can decide which wl_global would
be listed to clients.

Compositors can use this mechanism to hide their own private interfaces
that regular clients should not use.

- Hiding interfaces that expose compositor implementation details
  makes it harder for clients to identify the compositor. Therefore
  clients are a little less likely to develop compositor-specific
  workarounds instead of reporting problems upstream.

- Hiding can be used to diminish the problems from missing namespacing:
  if two compositors happen to use the same named global with
  different interfaces for their special-purpose clients, the client
  expecting the different interface would probably never see it
  advertised.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoprotocol: add axis_source.wheel_tilt
Peter Hutterer [Mon, 23 Jan 2017 23:56:39 +0000 (09:56 +1000)]
protocol: add axis_source.wheel_tilt

Unlike a wheel rotation, a wheel tilt is a discrete-only axis. Wheel rotations
are mapped to degrees in libinput but that that does not apply to wheel tilt
axes where there is no physical equivalent.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
7 years agoscanner: support "since" attribute for enum entries
Peter Hutterer [Mon, 23 Jan 2017 23:56:38 +0000 (09:56 +1000)]
scanner: support "since" attribute for enum entries

This was already in the DTD but not supported by the scanner.

The check for ever-increasing "since" tags is not strictly required for enum
entries as we control the binary value. But it keeps the xml file in
good order, preventing things like:

      <entry name="first" value="…" />
      <entry name="second" value="…" since="3"/>
      <entry name="third" value="…" since="2"/>
      <entry name="fourth" value="…" since="3"/>

If this is undesirable in the future the check can be removed without
side-effects.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoscanner: add helper function to convert "since" to a version
Peter Hutterer [Mon, 23 Jan 2017 23:56:37 +0000 (09:56 +1000)]
scanner: add helper function to convert "since" to a version

Same code we already had, just moved into a helper function

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agotests: sync example.xml with wayland.xml
Peter Hutterer [Mon, 23 Jan 2017 23:56:36 +0000 (09:56 +1000)]
tests: sync example.xml with wayland.xml

These are the protocol.xml changes from:
66a26aeb2a: protocol: Remove inconsistent line breaks
a26ed0949e: protocol: indentation fixes
6a18a87727: protocol: Extend wl_touch with touchpoint shape and orientation

and a few other, smaller ones.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Tested-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoutil: Document wl_array and wl_list members
Yong Bakos [Tue, 6 Dec 2016 15:21:56 +0000 (07:21 -0800)]
util: Document wl_array and wl_list members

Despite their clear names, wl_array and wl_list members are undocumented,
resulting in doxygen warnings[1] when building documentation.

Document these members, suppressing the warnings.

[1] Warnings are visible when EXTRACT_ALL = NO.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agodoc: Remove wayland-util.c from file list
Yong Bakos [Fri, 25 Nov 2016 18:48:36 +0000 (10:48 -0800)]
doc: Remove wayland-util.c from file list

Documentation generation via doxygen includes wayland-util.c in its file
list. Although functions are documented in wayland-util.h, doxygen is
not automatically using the same documentation for functions in
wayland-util.c. In addition, everything listed in the doxygen page for
wayland-util.c is documented in the page for wayland-util.h and the
pages for corresponding structures. As such, the doxygen page for
wayland-util.c has no value, and is redundant.

Remove the doxygen page for wayland-util.c.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agodoc: Remove display of WL_PRINTF attribute
Yong Bakos [Tue, 22 Nov 2016 16:13:43 +0000 (08:13 -0800)]
doc: Remove display of WL_PRINTF attribute

Doxygen truncates a WL_PRINTF function attribute, and there does not
seem to be any workaround[1]. When using the attribute like this:

typedef void (*wl_log_func_t)(const char *, va_list) WL_PRINTF(1, 0);

Doxygen generates something that looks like this:

typedef void (*wl_log_func_t)(const char *, va_list) WL_PRINTF(1,

Configure doxygen to consider WL_PRINTF(x,y) as predefined, so it does
not display the attribute at all in the generated documentation.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=774741

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotests: add scanner tests
Pekka Paalanen [Fri, 30 Sep 2016 12:12:47 +0000 (15:12 +0300)]
tests: add scanner tests

Add tests that ensure that wayland-scanner output for a given input does
not change unexpectedly. This makes it very easy to review
wayland-scanner patches.

Before, when patches were proposed for wayland-scanner, I had to
build wayland without the patches, save the generated files into a
temporary directory, apply the patches, build again, and diff the old
vs. new generated file.

No more. Now whenever someone makes intentional changes to
wayland-scanner's output, he will also have to patch the example output
files to match. That means that reviewers see the diff of the generated
files straight from the patch itself. Verifying the diff is true is as
easy as 'make check'.

The tests use separate example XML files instead of wayland.xml
directly, so that wayland.xml can be updated without fixing scanner
tests, avoiding the churn.

example.xml starts as a copy of wayland.xml. If wayland.xml starts using
new wayland-scanner features, they should be copied into example.xml
again to be covered by the tests.

This patch relies on the previous patch to actually add all the data
files for input and reference output.

The scanner output is fed through sed to remove parts that are allowed
to vary: the scanner version string.

v2: no need for scanner-test.sh to depend on the test data

Task: https://phabricator.freedesktop.org/T3313
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> (v1)
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Tested-by: Yong Bakos <ybakos@humanoriented.com>
7 years agotests: add data files for future wayland-scanner test
Pekka Paalanen [Tue, 4 Oct 2016 14:26:40 +0000 (17:26 +0300)]
tests: add data files for future wayland-scanner test

This patch adds the input and reference output data files for the
wayland-scanner tests to be added by the following patch.

The data files are split into their own patch because they are extremely
uninteresting to review:
- example.xml is just a copy wayland.xml from 1.12.0
- small.xml is a tiny dummy definition used for testing scanner
  variations without causing lots of big output files
- the other files are wayland-scanner products from the xml files

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
v2: update output due to 2c6350beb92816eb9213c4944d197485e788ef6d
Acked-by: Yong Bakos <ybakos@humanoriented.com>
7 years agoutil: Clarify documentation of wl_dispatcher_func_t
Yong Bakos [Mon, 21 Nov 2016 13:44:44 +0000 (05:44 -0800)]
util: Clarify documentation of wl_dispatcher_func_t

Adjust the brief, clarify the behavior and arguments, correct a grammar
error, document the parameters, and document the return type.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoprotocol: indentation fixes
Peter Hutterer [Mon, 21 Nov 2016 11:43:22 +0000 (11:43 +0000)]
protocol: indentation fixes

8 spaces changed to one tab

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agowayland-client: Require base 10 for WAYLAND_SOCKET, explicitly
Bryce Harrington [Fri, 8 Jul 2016 23:42:30 +0000 (16:42 -0700)]
wayland-client: Require base 10 for WAYLAND_SOCKET, explicitly

The third arg to strtol() specifies the base to assume for the number.
When 0 is passed, as is currently done in wayland-client.c, hexadecimal
and octal numbers are permitted and automatically detected and
converted.

I can find no indication that we would ever expect use of hexadecimal or
octal for socket fd's.  So be explicit about what base we're assuming
here and avoid any potential surprises.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoutil: Document wl_log_func_t
Yong Bakos [Sun, 20 Nov 2016 16:59:15 +0000 (08:59 -0800)]
util: Document wl_log_func_t

Add a doxygen comment for wl_log_func_t.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agobuildsystem: adjust uninstalled -client/server pkg-config infra
Reynaldo H. Verdejo Pinochet [Fri, 26 Aug 2016 21:04:02 +0000 (16:04 -0500)]
buildsystem: adjust uninstalled -client/server pkg-config infra

Add missing protocol dir to uninstalled include path.

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Bryce Harrington <bryce@osg.samsung.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
7 years agobuild: Fix scanner path in uninstalled pkg-config file
Derek Foreman [Fri, 26 Aug 2016 21:04:03 +0000 (16:04 -0500)]
build: Fix scanner path in uninstalled pkg-config file

this was generating a pkg-config file that said wayland-scanner was
wayland/src/wayland-scanner when it's actually wayland/wayland-scanner

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoutil: Improve documentation of wl_iterator_result
Yong Bakos [Sun, 20 Nov 2016 17:26:08 +0000 (09:26 -0800)]
util: Improve documentation of wl_iterator_result

Use declarative voice, remove the unnecessary doxygen \enum tag, and add
two see-also's. This keeps the output the same but makes the comment
voice consistent, a little more readable, and refers to documented
functions that use this enum type.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agoprotocol: spell out that we're using linux/input-event-codes.h button codes
Peter Hutterer [Fri, 18 Nov 2016 02:35:27 +0000 (12:35 +1000)]
protocol: spell out that we're using linux/input-event-codes.h button codes

Because we already rely on it in the callers anyway. This is a retrofit, which
is not ideal but I'm not sure any compositor out there uses anything else.
Might as well define it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agocursor: Remove "weston" from anonymous shm filenames
Derek Foreman [Wed, 27 Jul 2016 16:06:24 +0000 (11:06 -0500)]
cursor: Remove "weston" from anonymous shm filenames

This mildly confused me during some debugging, so I guess it wouldn't
hurt to make the filename more indicative of where it was actually
created.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoutil: Improve documentation of wl_argument
Yong Bakos [Sat, 12 Nov 2016 18:11:21 +0000 (10:11 -0800)]
util: Improve documentation of wl_argument

Standardize the doxygen comment format, add clarity to the writing, decouple
the description from specifics of usage, add see-also's, and massage the union
member type comments.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agotests: Add nullable check to wl_message_count_arrays
Yong Bakos [Fri, 11 Nov 2016 15:08:09 +0000 (07:08 -0800)]
tests: Add nullable check to wl_message_count_arrays

Array argument symbols in a wl_message may be nullable, but the test for
wl_message_count_arrays did not test this. Add one more wl_message with
nullable array arguments.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agotests: Test wl_interface_equal
Yong Bakos [Tue, 8 Nov 2016 15:56:30 +0000 (07:56 -0800)]
tests: Test wl_interface_equal

The test suite did not cover wl_interface_equal, so add one test that
specifically tests this method. Add the new test to Makefile.am.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
[Pekka: add assert(&wl_registry_interface != &copy);]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoutil: Document wl_interface
Yong Bakos [Mon, 7 Nov 2016 02:25:37 +0000 (18:25 -0800)]
util: Document wl_interface

Add doxygen comments for wl_interface.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoMakefile: build also test programs during a normal build
Pekka Paalanen [Wed, 16 Nov 2016 11:42:21 +0000 (13:42 +0200)]
Makefile: build also test programs during a normal build

Put also test programs into noinst_PROGRAMS so that they get always
built. In check_PROGRAMS they are built for 'make check' but not for
'make'.

This makes it harder to accidentally break the test programs.

v2: also change check_LTLIBRARIES to noinst_LTLIBRARIES

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agodoc: Fix a typo in the client documentation
Moritz Kiefer [Sun, 6 Nov 2016 17:35:19 +0000 (18:35 +0100)]
doc: Fix a typo in the client documentation

Signed-off-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
7 years agoprotocol: Extend wl_touch with touchpoint shape and orientation
Dennis Kempin [Fri, 11 Nov 2016 19:40:55 +0000 (11:40 -0800)]
protocol: Extend wl_touch with touchpoint shape and orientation

This CL updates the wl_touch interface with a shape and
orientation event.
The shape/orientation of a touch point is not relevant for most UI
applications, but allows a better experience in some cases
such as drawing apps.

The events are used by the compositor to inform the client
about changes in the shape and orientation of a touchpoint, which is
approximated by an ellipse and it's angle to the y-axis.

The event is optional and only sent when compositor and the
touch device support this type of information. The client is
responsible for making a reasonable assumption about the
touch shape if no shape is reported.

Signed-off-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoutil: Document wl_fixed_t
Yong Bakos [Fri, 11 Nov 2016 15:55:38 +0000 (07:55 -0800)]
util: Document wl_fixed_t

Add doxygen comments for wl_fixed_t and its methods.

Although wl_fixed_t can be thought of as an opaque struct, it is a typedef. As
such, doxygen does not provide an elegant means of documenting it as both a
'class' with members and as a typedef. In other words, documenting it as a class
gives us a nice doxygen page for wl_fixed_t and its related methods, but this
leaves the typedef documentation blank in the documentation for wayland-util,
and does not provide a link to the documentation for wl_fixed_t. Hence, this
patch does not treat wl_fixed_t as a class/struct, resulting in the typedef
being documented and keeping the functions listed in wayland-util, rather than a
separate unlinked page devoted to just wl_fixed_t.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoutil: Remove stray space from function signature
Yong Bakos [Tue, 8 Nov 2016 16:02:12 +0000 (08:02 -0800)]
util: Remove stray space from function signature

wl_fixed_to_double had a stray space before the parameter list.
Remove this space.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoscanner: Fixed doxygen group name for _add_listener
Bill Spitzak [Tue, 17 May 2016 06:18:06 +0000 (23:18 -0700)]
scanner: Fixed doxygen group name for _add_listener

Signed-off-by: Bill Spitzak <spitzak@gmail.com>
Acked-by: Yong Bakos <ybakos@humanoriented.com>
7 years agoMakefile: do not put TESTS into check_PROGRAMS
Pekka Paalanen [Wed, 9 Nov 2016 15:16:51 +0000 (17:16 +0200)]
Makefile: do not put TESTS into check_PROGRAMS

If you assign TESTS into check_PROGRAMS, you cannot add a test that is
not built from source files.

Instead, use a temporary variable built_test_programs to hold the names
that are both programs built from source files and tests to execute.

This change is required by the following patch adding wayland-scanner
test script.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
7 years agotests: Test wl_message_count_arrays
Yong Bakos [Thu, 3 Nov 2016 20:42:54 +0000 (13:42 -0700)]
tests: Test wl_message_count_arrays

message-test.c did not cover wl_message_count_arrays, so add one test that
specifically tests this method. Note that this exposes wl_message_count_arrays
in a private header (wayland-private.h), and removes the `static` modifier of
the implementation.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoprotocol: Remove inconsistent line breaks
Yong Bakos [Mon, 31 Oct 2016 13:46:18 +0000 (06:46 -0700)]
protocol: Remove inconsistent line breaks

Enum entries and message arguments are sometimes preceded by a blank line, but
often aren't.

Standardize the format of the protocol specification by removing blank lines
preceding a list of message arguments and enum entries.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoutil: Document wl_message
Yong Bakos [Thu, 27 Oct 2016 15:55:01 +0000 (08:55 -0700)]
util: Document wl_message

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoscanner: Remove return doxygen annotation
Yong Bakos [Wed, 7 Sep 2016 13:25:27 +0000 (06:25 -0700)]
scanner: Remove return doxygen annotation

Replace \returns with just Returns, as this is not a doxygen comment block.
(Avoids differing with the existing convention of \return for return values.)

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agotests: Use unique XDG_RUNTIME_DIR
Daniel Stone [Thu, 10 Nov 2016 11:14:03 +0000 (11:14 +0000)]
tests: Use unique XDG_RUNTIME_DIR

Rather than using a hardcoded 'wayland-tests' directory under
the existing XDG_RUNTIME_DIR to use as the new runtime dir, use mkdtemp
to guarantee uniqueness. This fixes make -jN check, as well as just
happening to run 'make check' twice from the same session.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoprotocol: Use singleton global consistently
Yong Bakos [Sun, 2 Oct 2016 16:09:59 +0000 (09:09 -0700)]
protocol: Use singleton global consistently

The protocol describes wl_shm as a "global singleton" rather than
"singleton global," which is the order used throughout other protocol
object descriptions.

Re-order the terms for consistency.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoprotocol: Describe wl_registry as singleton
Yong Bakos [Fri, 30 Sep 2016 06:59:58 +0000 (23:59 -0700)]
protocol: Describe wl_registry as singleton

Other singleton objects in the protocol are described as such.

Add a singleton adjective to the wl_registry description, making it
similar to other descriptions.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoshm: Make shm_pool_interface static const
Yong Bakos [Fri, 12 Aug 2016 19:04:41 +0000 (12:04 -0700)]
shm: Make shm_pool_interface static const

Add static const modifiers to the shm_pool_interface definition,
making it consistent with the other wl_*_interface definitions and
mundanely safer.

Note that this does not affect the ABI, according to abi-dumper and
abi-compliance-checker[1]; and weston and its shm-backed clients still
run as expected.

[1]: http://lvc.github.io/abi-compliance-checker/

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Tested-by: Yong Bakos <ybakos@humanoriented.com>
Acked-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoutil: Document GCC attributes
Yong Bakos [Sat, 17 Sep 2016 22:04:32 +0000 (15:04 -0700)]
util: Document GCC attributes

Add doxygen comment blocks so these annotations are documented in the html
documentation.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoarray-test: Include wayland-util.h and simplify init test
Yong Bakos [Tue, 27 Sep 2016 18:03:50 +0000 (13:03 -0500)]
array-test: Include wayland-util.h and simplify init test

Include wayland-util.h in addition to wayland-private.h, to be more explicit
about where wl_array is defined.

Remove the useless repeated testing of wl_array_init, because if it fails once
out of thousands of iterations we're all doomed anyway.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
[Pekka: add the memset]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agotests: Test wl_array_release
Yong Bakos [Tue, 27 Sep 2016 18:03:49 +0000 (13:03 -0500)]
tests: Test wl_array_release

array-test.c did not cover wl_array_release, so add one test that specifically
tests this method.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
[Pekka: do not overwrite array.data]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agowl_array: Set data to invalid address after free
Yong Bakos [Tue, 27 Sep 2016 18:03:48 +0000 (13:03 -0500)]
wl_array: Set data to invalid address after free

Explicitly set the data member to an invalid memory address during
wl_array_release, such that re-using a freed wl_array without re-initializing
causes a crash. In addition, this pointer assignment makes wl_array_release
testable.

Define a constant for the invalid memory address, and add documentation about
this behavior, starting at libwayland version 1.13.

See https://lists.freedesktop.org/archives/wayland-devel/2016-September/031116.html

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
[Pekka: remove the doc about crashing]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoutil: Document wl_array
Yong Bakos [Tue, 27 Sep 2016 18:03:47 +0000 (13:03 -0500)]
util: Document wl_array

Add doxygen comments for wl_array and its methods.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoutil: Document wl_list methods
Yong Bakos [Fri, 23 Sep 2016 02:59:37 +0000 (21:59 -0500)]
util: Document wl_list methods

Add doxygen comment blocks to all wl_list methods.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
[Pekka: removed "itself" as suggested by Bryce]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoconfigure.ac: bump version to 1.12.90 for open development
Bryce Harrington [Thu, 22 Sep 2016 17:31:53 +0000 (10:31 -0700)]
configure.ac: bump version to 1.12.90 for open development

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agoconfigure.ac: bump to version 1.12.0 for the official release 1.12.0 upstream/1.12.0
Bryce Harrington [Tue, 20 Sep 2016 17:45:10 +0000 (10:45 -0700)]
configure.ac: bump to version 1.12.0 for the official release

7 years agoconfigure.ac: bump to version 1.11.94 for the RC2 release 1.11.94
Bryce Harrington [Tue, 13 Sep 2016 19:13:57 +0000 (12:13 -0700)]
configure.ac: bump to version 1.11.94 for the RC2 release

7 years agoserver: Document display parameter
Yong Bakos [Wed, 17 Aug 2016 23:08:17 +0000 (16:08 -0700)]
server: Document display parameter

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoprotocol: Replace '#defines' with 'macros'
Yong Bakos [Wed, 17 Aug 2016 23:03:31 +0000 (16:03 -0700)]
protocol: Replace '#defines' with 'macros'

The use of # within a description causes the documentation generator
to mistake C syntax with a documentation link.

Remove the # from the documentation, suppressing the warning.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoconfigure.ac: bump to version 1.11.93 for the RC1 release 1.11.93
Bryce Harrington [Tue, 6 Sep 2016 21:22:03 +0000 (14:22 -0700)]
configure.ac: bump to version 1.11.93 for the RC1 release

7 years agotests: Add test for wl_list_length
Yong Bakos [Sun, 4 Sep 2016 20:23:05 +0000 (13:23 -0700)]
tests: Add test for wl_list_length

list-test.c did not cover wl_list_length, so add one test that specifically
tests this method.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agodoc: Correct docbook title
Yong Bakos [Sun, 4 Sep 2016 17:15:49 +0000 (10:15 -0700)]
doc: Correct docbook title

The docbook title was "The Wayland display server," which is inaccurate.

Change the title to "The Wayland Protocol".

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoconfigure.ac: bump to version 1.11.92 for the beta release 1.11.92
Bryce Harrington [Tue, 30 Aug 2016 18:40:23 +0000 (11:40 -0700)]
configure.ac: bump to version 1.11.92 for the beta release

7 years agoconfigure.ac: bump to version 1.11.91 for the alpha release 1.11.91
Bryce Harrington [Tue, 16 Aug 2016 18:25:12 +0000 (11:25 -0700)]
configure.ac: bump to version 1.11.91 for the alpha release

7 years agoprotocol: Specify upper left corner of damage rectangle
Yong Bakos [Thu, 11 Aug 2016 21:33:05 +0000 (14:33 -0700)]
protocol: Specify upper left corner of damage rectangle

Specify x and y args as the upper left corner of the surface / buffer
damage rectangle.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agoprotocol: Describe serial as serial number
Yong Bakos [Thu, 11 Aug 2016 21:33:04 +0000 (14:33 -0700)]
protocol: Describe serial as serial number

Change "serial" to "serial number" in arg summaries, for consistency
and clarity.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agoprotocol: Remove wl_ prefix from summary descriptions
Yong Bakos [Thu, 11 Aug 2016 21:33:03 +0000 (14:33 -0700)]
protocol: Remove wl_ prefix from summary descriptions

Summary attributes sometime describe objects using their wl-prefixed type,
but more often don't.

Remove the wl_ prefix from summary descriptions, since they tend to describe
concepts.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agoprotocol: Correct description indentation
Yong Bakos [Thu, 11 Aug 2016 21:33:02 +0000 (14:33 -0700)]
protocol: Correct description indentation

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agoprotocol: Add missing line break
Yong Bakos [Thu, 11 Aug 2016 21:33:01 +0000 (14:33 -0700)]
protocol: Add missing line break

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agoprotocol: Capitalize ID for consistency
Yong Bakos [Thu, 11 Aug 2016 21:33:00 +0000 (14:33 -0700)]
protocol: Capitalize ID for consistency

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agoprotocol: Hyphenate subsurface
Yong Bakos [Thu, 11 Aug 2016 21:32:59 +0000 (14:32 -0700)]
protocol: Hyphenate subsurface

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agoprotocol: Add summary attributes to request params and enum entries
Yong Bakos [Thu, 11 Aug 2016 21:32:58 +0000 (14:32 -0700)]
protocol: Add summary attributes to request params and enum entries

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agoserver: Add doxygen comment for wl_client_for_each
Yong Bakos [Thu, 11 Aug 2016 19:13:37 +0000 (12:13 -0700)]
server: Add doxygen comment for wl_client_for_each

Commit 596024f728b0a1292ee69a80dd72a85167870936 includes a doc comment
with a link to the wl_client_for_each macro, causing an error when generating
documentation.

Add a doc comment to wl_client_for_each, enabling the hyperlink and removing
the error.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agoAdd API to install protocol loggers on the server wl_display
Giulio Camuffo [Fri, 12 Aug 2016 07:33:06 +0000 (09:33 +0200)]
Add API to install protocol loggers on the server wl_display

The new wl_display_add_protocol_logger allows to set a function as
a logger, which will get called when a new request is received or an
event is sent.
This is akin to setting WAYLAND_DEBUG=1, but more powerful because it
can be enabled at run time and allows to show the log e.g. in a UI view.
A test is added for the new functionality.

Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoAdd API to retrieve and iterate over the resources list of a client
Giulio Camuffo [Thu, 11 Aug 2016 15:23:10 +0000 (17:23 +0200)]
Add API to retrieve and iterate over the resources list of a client

To complement on the new resource created signal, this allows to
iterate over the existing resources of a client.

Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
[Pekka: added empty lines, init ret in for_each_helper()]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoAdd a resource creation signal
Giulio Camuffo [Thu, 11 Aug 2016 15:23:09 +0000 (17:23 +0200)]
Add a resource creation signal

This change allows to add a resource creation listener to a wl_client,
which will be notified when a new resource is created for that client.
The alternative would be to have a per wl_display listener, but i think
that resources are really client specific objects, so it makes sense
to use the wl_client as the context.

Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
[Pekka: added wl_list_remove() in TEST(new_resource).]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoAdd API to get the list of connected clients
Giulio Camuffo [Tue, 9 Aug 2016 10:46:53 +0000 (12:46 +0200)]
Add API to get the list of connected clients

This patch chooses the wl_list_for_each-style of iterating over
the clients, instead of using an iterator function, because i think
it is easier to use.

Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoAdd API to retrieve the interface name of a wl_resource
Giulio Camuffo [Tue, 9 Aug 2016 10:46:52 +0000 (12:46 +0200)]
Add API to retrieve the interface name of a wl_resource

Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
7 years agoserver: add listener API for new clients
Sungjae Park [Tue, 9 Aug 2016 10:46:51 +0000 (12:46 +0200)]
server: add listener API for new clients

Using display object, Emit a signal if a new client is created.

In the server-side, we can get the destroy event of a client,
But there is no way to get the created event of it.
Of course, we can get the client object from the global registry
binding callbacks.
But it can be called several times with same client object.
And even if A client creates display object,
(so there is a connection), The server could not know that.
There could be more use-cases not only for this.

Giulio: a test is added for the new functionality

Signed-off-by: Sung-jae Park <nicesj@nicesj.com>
Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoscanner: Generate all SINCE_VERSION macros for everyone
Quentin Glidic [Tue, 5 Jul 2016 18:41:50 +0000 (20:41 +0200)]
scanner: Generate all SINCE_VERSION macros for everyone

Practical example: a client supporting version 2 of wl_output will wait
for the wl_output.done event before starting wl_output-related
operations. However, if the server only supports version 1, no event
will ever come, and it must fallback to use the wl_output.geometry event
alone.
Without this macro, it cannot check for that in a nice way.

This patch introduces the same #defines in both server and client
headers. We rely on both being generated from the same XML file and
https://gcc.gnu.org/onlinedocs/cpp/Undefining-and-Redefining-Macros.html
to not cause compiler errors or warning due to redefinitions. We also
assume that no-one uses the same name in the same interface for both a
request and an event.

If this patch does cause grief due to identical redefinitions, the
contingency plan is to change the generator to produce
 #ifndef/#define/#endif instead of just #define.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
[Pekka: add paragraphs to commit message.]

7 years agoprotocol: Add release (destructor) request to wl_output
Quentin Glidic [Tue, 5 Jul 2016 18:41:49 +0000 (20:41 +0200)]
protocol: Add release (destructor) request to wl_output

Outputs come and go, and this is needed to clean up wl_resources on the
server side. All protocol objects need a way to be destroyed.

Cc: Neil Roberts <neil@linux.intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
[Pekka: added commit message]