Commit Graph

1944 Commits

Author SHA1 Message Date
Yong Bakos
2c8fc3eae2 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>
2016-09-13 15:31:41 +03:00
Bryce Harrington
da58173cfe configure.ac: bump to version 1.11.93 for the RC1 release 2016-09-06 14:22:03 -07:00
Yong Bakos
2bdbb741e2 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>
2016-09-05 15:10:43 +03:00
Yong Bakos
d9ef882139 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>
2016-09-05 13:55:29 +03:00
Bryce Harrington
2d7b34e2ee configure.ac: bump to version 1.11.92 for the beta release 2016-08-30 11:40:23 -07:00
Bryce Harrington
2a6b08896a configure.ac: bump to version 1.11.91 for the alpha release 2016-08-16 11:25:12 -07:00
Yong Bakos
a285fa939c 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>
2016-08-12 12:46:02 -07:00
Yong Bakos
8e7e52f335 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>
2016-08-12 12:45:55 -07:00
Yong Bakos
7aa1f6cb2f 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>
2016-08-12 12:45:48 -07:00
Yong Bakos
40feca914b protocol: Correct description indentation
Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-08-12 12:45:41 -07:00
Yong Bakos
3f1104d64c protocol: Add missing line break
Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-08-12 12:45:34 -07:00
Yong Bakos
83ec381bf8 protocol: Capitalize ID for consistency
Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-08-12 12:45:26 -07:00
Yong Bakos
aaf2c91873 protocol: Hyphenate subsurface
Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-08-12 12:45:19 -07:00
Yong Bakos
d7cb6c3570 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>
2016-08-12 12:45:09 -07:00
Yong Bakos
1c3213adf0 server: Add doxygen comment for wl_client_for_each
Commit 596024f728 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>
2016-08-12 12:43:37 -07:00
Giulio Camuffo
450f06e21a 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>
2016-08-12 11:59:46 +03:00
Giulio Camuffo
2f617250d2 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>
2016-08-12 11:53:16 +03:00
Giulio Camuffo
c55c1d787c 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>
2016-08-12 11:43:02 +03:00
Giulio Camuffo
596024f728 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>
2016-08-11 15:52:15 +03:00
Giulio Camuffo
68abfa6732 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>
2016-08-11 15:52:07 +03:00
Sungjae Park
be48da6a42 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>
2016-08-11 14:35:28 +03:00
Quentin Glidic
5636cb2f05 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.]
2016-08-11 13:49:50 +03:00
Quentin Glidic
bad9dc5186 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]
2016-08-08 16:22:52 +03:00
Yong Bakos
993df57928 display-test: Remove redundant stdbool include
display-test.c includes stdbool.h twice. Remove the redundant include.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-07-25 18:41:14 -07:00
Yong Bakos
2b1c1b2d66 (multiple): Include stdint.h
Some headers and source files have been using types such as uint32_t
without explicitly including stdint.h.

Explicitly include stdint.h where appropriate.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-07-25 18:39:32 -07:00
Khem Raj
6750b47d9e scanner: Use uint32_t instead of uint
uint32_t is C99 defined stdint type

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-07-18 11:12:56 +01:00
Bryce Harrington
c88ec7e291 scanner: Improve documentation for strtouint()
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-07-11 14:00:34 -07:00
Bryce Harrington
1cda73f3f8 tests: Require base 10 for the string specifying the number of open fd's
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.

exec-fd-leak-checker's single argument is the count of file descriptors
it should expect to be open.  We should expect this to be specified only
as a decimal number, there's no reason why one would want to use octal
or hexadecimal for that.

Suggested by Yong Bakos.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-07-11 13:32:15 -07:00
Yong Bakos
d6d7dab487 scanner: Move PROGRAM_NAME define
PROGRAM_NAME was defined within the if block of HAVE_LIBXML, causing a
compilation failure when libxml is not present.

Move the define of PROGRAM_NAME out of the if block.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2016-06-07 10:22:59 -05:00
Yong Bakos
e1f2ba2b37 server-core, event-loop: Fix parameter alignment.
Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-06-07 16:33:28 +03:00
Yong Bakos
0cc2eb9ef0 scanner: Replace #define tab with space
wayland-client-protocol.h and wayland-server-protocol.h use a tab
between the identifier and token of generated #defines for request/event
opcodes and versions. While this sometimes enables vertical alignment,
it more frequently doesn't, and leads to awkward spacing.

Replace the tab with a space, for consistency and readability.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2016-06-07 16:30:22 +03:00
Yong Bakos
826b16641a server, server-core: Minimize fwd decs, use macro, and format
wayland-server.h: Adjust line breaks between prototypes.

wayland-server-core.h:
Adjust line breaks between prototypes.
Adjust space between splats and identifiers.
Remove unconventional linebreak before first parameter.
Add line breaks after return types.
Remove unnecessary forward declarations, and:
- move 'struct wl_client' declaration close to the dependent typedef
- tastefully move 'wl_shm_buffer_get' to leverage the return type
Replace explicit __attribute__ with WL_PRINTF macro.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-06-07 16:11:05 +03:00
Yong Bakos
e5bd4122e9 client-core: Add missing line breaks
Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-06-07 16:10:35 +03:00
Yong Bakos
fe31d2f9af event-loop: Include wayland-util.h
event-loop.c uses WL_EXPORT and wl_list, which are defined in
wayland-util.h.

Include wayland-util.h explicitly, rather than transitively through
wayland-server-core.h.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Sam Spilsbury <smspillaz@gmail.com>
2016-06-07 16:07:08 +03:00
Yong Bakos
9000c0f20e wayland-shm: Include wayland-util.h
wayland-shm.c uses WL_EXPORT and wl_array, which are defined in
wayland-util.h.

Include wayland-util.h explicitly, rather than transitively through
wayland-server.h.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Sam Spilsbury <smspillaz@gmail.com>
2016-06-07 16:07:01 +03:00
Bryce Harrington
36aeaf037b scanner: Fix reported executable name to 'wayland-scanner'
'wayland-scanner -v' (correctly) reports the program as named
"wayland-scanner", but 'wayland-scanner -h' was inconsistent, referring
to it as './scanner'.

Also refactor this and other references to the program name to use a
common #define, PROGRAM_NAME.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Tested-by: Yong Bakos <ybakos@humanoriented.com>
2016-06-07 16:02:19 +03:00
Yong Bakos
d588efcbc8 wayland-server: Clarify included header dependencies
wayland-server.c directly depends on wayland-util.h, and will include
wayland-server-protocol.h via wayland-server.h.

Explicitly include wayland-util.h, making this dependency clear.
Remove the redundant inclusion of wayland-server-protocol.h.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-06-01 19:22:19 -07:00
Yong Bakos
972f1a2cf7 event-loop: Make transitive include explicit
The explicit inclusion of wayland-server.h hides the real dependency, which
is wayland-server-core.h.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-06-01 18:42:36 -07:00
Yong Bakos
a1bce0ead5 doc: Unpublish global_zombie_object and wl_interface_equal
Both global_zombie_object and wl_interface_equal are private, yet were
part of public documentation despite not being part of the public API.

Move these two definitions to the top of an existing doxygen \cond block,
which removes them from the public documentation.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-06-01 17:34:30 -07:00
Yong Bakos
d29b923305 doc: Unpublish wl_log* and wl_abort
The public documentation included descriptions of wl_log_stderr_handler,
wl_log_func_t wl_log_handler, wl_log and wl_abort. These are not accessible
via the public API.

Move the doxygen \endcond command to wrap these definitions, removing them
from publication.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-06-01 17:34:21 -07:00
Yong Bakos
3e58aa1e06 doc: Unpublish wl_display_get_additional_shm_formats
The Wayland docbook and the doxygen html docs had been presenting
wl_display_get_additional_shm_formats as part of the public API, but the
prototype for this function is in wayland-private.h.

Add a \private annotation to the doc comment, preventing doxygen from
publishing this function as public.
Add logic to the publican xsl to only transform elements with a "prot"
attribute value of "public".

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-06-01 17:34:17 -07:00
Pekka Paalanen
98d94b5c1d configure.ac: bump version to 1.11.90 for open development
As announced in 1.11.0 release notes, master is open again.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-06-01 11:08:02 +03:00
Bryce Harrington
47163797f8 configure.ac: bump to version 1.11.0 for the official release 2016-05-31 17:11:20 -07:00
Bryce Harrington
62d67fe8fa configure.ac: bump to version 1.10.93 for the RC1 release 2016-05-24 12:29:59 -07:00
Yong Bakos
97fef48213 scanner: Remove unused forward decs from client protocol
wayland-client-protocol.h had forward declarations for wl_client and
wl_resource, yet nothing on the client side references these types.

Add a 'side' condition to only generate these forward declarations in the
server protocol header.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-05-20 14:58:59 -07:00
Marek Chalupa
cc11b49342 display-test: move a misplaced comment
we split a function while refactoring in c643781 and now
the comment makes no sense

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-05-19 17:57:18 -07:00
Yong Bakos
9ca9f8e4b2 tests: Check for client/server-core.h inclusion
The purpose of wayland-*-protocol-core.h is to mimc the
wayland-*-protocol.h generated by scanner --include-core-only.
The only difference being what wayland-*-protocol.h should include.

Add an include check in the headers-protocol-core-test, to be sure that
a wayland-*-protocol.h generated with the --include-core-only option
properly includes wayland-*-core.h.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-05-19 14:31:18 -07:00
Bryce Harrington
f19b569ec2 configure.ac: bump to version 1.10.92 for the beta release 2016-05-17 22:07:48 -07:00
Yong Bakos
f86fbe1a11 private: Remove unnecessary forward declarations
Declarations for wl_connection and wl_closure are not needed here.
wl_closure already has a complete definition.
Removing these forward declarations results in a clean, warning-free compile.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
[Updated to apply to trunk]
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-05-11 11:09:20 -07:00
Yong Bakos
385906beae connection: Move wl_interface_equal to util
Move the wl_interface_equal prototype to the top of wayland-private, where
it is not buried in the middle of map, connection and closure functions.

Move the implementation out of connection and into util. This is a utility
function, not specific to connections, and has call sites within connection,
wayland-client and wayland-server.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-05-11 11:05:06 -07:00