Commit Graph

2021 Commits

Author SHA1 Message Date
Yong Bakos
b0cd65deac 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>
2016-11-18 16:21:19 +02:00
Yong Bakos
0cdc3229b0 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>
2016-11-18 16:08:14 +02:00
Pekka Paalanen
aa51a833eb 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>
2016-11-17 13:33:31 +02:00
Moritz Kiefer
06b7c471b7 doc: Fix a typo in the client documentation
Signed-off-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-11-16 16:39:44 +00:00
Dennis Kempin
6a18a87727 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>
2016-11-16 16:35:19 +00:00
Yong Bakos
fd75029fb9 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>
2016-11-16 16:35:18 +00:00
Yong Bakos
2281bc08b2 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>
2016-11-16 15:57:51 +00:00
Bill Spitzak
2c6350beb9 scanner: Fixed doxygen group name for _add_listener
Signed-off-by: Bill Spitzak <spitzak@gmail.com>
Acked-by: Yong Bakos <ybakos@humanoriented.com>
2016-11-16 15:29:13 +00:00
Pekka Paalanen
edd62e62b7 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>
2016-11-16 13:23:43 +02:00
Yong Bakos
9618087c6a 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>
2016-11-10 17:12:04 +02:00
Yong Bakos
66a26aeb2a 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>
2016-11-10 16:41:40 +02:00
Yong Bakos
a6cf19842c 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>
2016-11-10 13:52:59 +02:00
Yong Bakos
ed7a688025 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>
2016-11-10 13:37:30 +02:00
Daniel Stone
23d3c67c9a 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>
2016-11-10 13:30:28 +02:00
Yong Bakos
b802108f6e 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>
2016-11-10 13:11:17 +02:00
Yong Bakos
9e2e3bcaa7 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>
2016-11-10 13:10:40 +02:00
Yong Bakos
da58e07c3d 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>
2016-11-10 13:03:47 +02:00
Yong Bakos
ae139d8b6b 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>
2016-10-18 12:58:39 +03:00
Yong Bakos
a1ab2c03ae 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>
2016-10-18 12:24:53 +03:00
Yong Bakos
f04f218781 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>
2016-10-18 12:24:53 +03:00
Yong Bakos
e8ad23266f 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>
2016-10-18 12:24:53 +03:00
Yong Bakos
db61796026 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>
2016-10-18 12:24:35 +03:00
Yong Bakos
f7e1dcc20b 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>
2016-09-26 15:42:55 +03:00
Bryce Harrington
454df51dce configure.ac: bump version to 1.12.90 for open development
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2016-09-22 10:31:53 -07:00
Bryce Harrington
a0d76ffda5 configure.ac: bump to version 1.12.0 for the official release 2016-09-20 10:45:10 -07:00
Bryce Harrington
a4aba37ba1 configure.ac: bump to version 1.11.94 for the RC2 release 2016-09-13 12:13:57 -07:00
Yong Bakos
9afa4bfb7b 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>
2016-09-13 15:34:00 +03:00
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