summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-08-12protocol: Capitalize ID for consistencyYong Bakos1-1/+1
Signed-off-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-08-12protocol: Hyphenate subsurfaceYong Bakos1-1/+1
Signed-off-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-08-12protocol: Add summary attributes to request params and enum entriesYong Bakos1-168/+179
Signed-off-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-08-12server: Add doxygen comment for wl_client_for_eachYong Bakos1-0/+1
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>
2016-08-12Add API to install protocol loggers on the server wl_displayGiulio Camuffo4-7/+272
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-12Add API to retrieve and iterate over the resources list of a clientGiulio Camuffo5-7/+85
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-12Add a resource creation signalGiulio Camuffo3-9/+109
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-11Add API to get the list of connected clientsGiulio Camuffo3-0/+90
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-11Add API to retrieve the interface name of a wl_resourceGiulio Camuffo2-0/+14
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-11server: add listener API for new clientsSungjae Park4-1/+120
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-11scanner: Generate all SINCE_VERSION macros for everyoneQuentin Glidic1-0/+2
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-08protocol: Add release (destructor) request to wl_outputQuentin Glidic1-1/+12
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-07-25display-test: Remove redundant stdbool includeYong Bakos1-1/+0
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(multiple): Include stdint.hYong Bakos17-0/+18
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-18scanner: Use uint32_t instead of uintKhem Raj1-1/+1
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-11scanner: Improve documentation for strtouint()Bryce Harrington1-2/+11
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
2016-07-11tests: Require base 10 for the string specifying the number of open fd'sBryce Harrington1-1/+1
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-06-07scanner: Move PROGRAM_NAME defineYong Bakos1-2/+2
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-07server-core, event-loop: Fix parameter alignment.Yong Bakos2-7/+7
Signed-off-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-06-07scanner: Replace #define tab with spaceYong Bakos1-2/+2
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-07server, server-core: Minimize fwd decs, use macro, and formatYong Bakos2-23/+30
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-07client-core: Add missing line breaksYong Bakos1-0/+2
Signed-off-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-06-07event-loop: Include wayland-util.hYong Bakos1-0/+1
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-07wayland-shm: Include wayland-util.hYong Bakos1-0/+1
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-07scanner: Fix reported executable name to 'wayland-scanner'Bryce Harrington1-6/+8
'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-01wayland-server: Clarify included header dependenciesYong Bakos1-1/+1
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-01event-loop: Make transitive include explicitYong Bakos1-1/+1
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-01doc: Unpublish global_zombie_object and wl_interface_equalYong Bakos1-15/+15
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-01doc: Unpublish wl_log* and wl_abortYong Bakos1-2/+2
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-01doc: Unpublish wl_display_get_additional_shm_formatsYong Bakos2-1/+3
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-01configure.ac: bump version to 1.11.90 for open developmentPekka Paalanen1-1/+1
As announced in 1.11.0 release notes, master is open again. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-05-31configure.ac: bump to version 1.11.0 for the official releaseBryce Harrington1-2/+2
2016-05-24configure.ac: bump to version 1.10.93 for the RC1 releaseBryce Harrington1-1/+1
2016-05-20scanner: Remove unused forward decs from client protocolYong Bakos1-4/+4
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-19display-test: move a misplaced commentMarek Chalupa1-2/+2
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-19tests: Check for client/server-core.h inclusionYong Bakos1-0/+7
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-17configure.ac: bump to version 1.10.92 for the beta releaseBryce Harrington1-1/+1
2016-05-11private: Remove unnecessary forward declarationsYong Bakos1-4/+0
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-11connection: Move wl_interface_equal to utilYong Bakos3-17/+17
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-11doc: Formalize file comment in wayland-client.h, wayland-server.hYong Bakos2-5/+11
Publican was generating a subtle error during a build: Error: no ID for constraint linkend: Server-wayland-server-core_8h. This was caused by doxygen applying the doc comment at the top of wayland-server.h as the documentation for struct wl_object. As such, the generated documentation for wl_object was also very incorrect. Make the file doc comments in wayland-client.h and wayland-server.h real doxygen file doc comments with the \file command, add a \brief, make the inclusion warning a \warning, correct the language of the comment in wayland-server.h, and remove one unnecessary line break. This squelches the publican error, removes the bad wl_object documentation, and makes the comment appear in the generated html documentation. References: d74a9c079b1aeb44f69b4132dc2c38362e21f281 Signed-off-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-05-10protocol: Remove double line breakYong Bakos1-1/+0
All vertical whitespace should manifest as a single blank line, never two. Signed-off-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2016-05-06scanner: Add version argument to wayland-scannerArmin Krezović1-2/+24
This adds a command line argument to print wayland-scanner version. It also makes wayland-scanner emit a comment with wayland library version to every file it generates. v2: separate variable definitions into their own lines and remove old style "version" argument Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Yong Bakos <ybakos@humanoriented.com> Tested-by: Yong Bakos <ybakos@humanoriented.com> Signed-off-by: Armin Krezović <krezovic.armin@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-05-03configure.ac: bump to version 1.10.91 for the alpha releaseBryce Harrington1-1/+1
2016-05-03protocol: add support for cross-interface enum attributesAuke Booij3-21/+71
The enum attribute, for which scanner support was introduced in 1771299, can be used to link message arguments to <enum>s. However, some arguments refer to <enum>s in a different <interface>. This adds scanner support for referring to an <enum> in a different <interface> using dot notation. It also sets the attributes in this style in the wayland XML protocol (wl_shm_pool::create_buffer::format to wl_shm::format, and wl_surface::set_buffer_transform::transform to wl_output::transform), and updates the documentation XSL so that this new style is supported. Changes since v2: - add object:: prefix for all enumerations in the documentation - fix whitespace in scanner.c - minor code fixup to return early and avoid casts in scanner.c Changes since v1: - several implementation bugs fixed Signed-off-by: Auke Booij <auke@tulcod.com> Reviewed-by: Nils Christopher Brause <nilschrbrause@googlemail.com> Reviewed-by: Bill Spitzak <spitzak@gmail.com> [Pekka: rebased across cde251a124d41977b447098cc530fcad2834a45f] [Pekka: wrap lines and space fixes in scanner.c] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-05-02protocol: Add summaries to event parametersYong Bakos1-63/+65
All event arg elements now have an appropriate summary attribute. This was conducted mostly in response to the undocumented parameter warnings generated during 'make check'. Signed-off-by: Yong Bakos <ybakos@humanoriented.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-05-02tests: fix typoEric Engestrom1-1/+1
Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Armin Krezović <krezovic.armin@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-05-02doc: fix typosEric Engestrom2-6/+6
Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Armin Krezović <krezovic.armin@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-05-02util: fix typoEric Engestrom1-1/+1
Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Armin Krezović <krezovic.armin@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-05-02server: fix typoEric Engestrom1-1/+1
Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Armin Krezović <krezovic.armin@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-05-02client: fix typoEric Engestrom1-4/+4
Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Armin Krezović <krezovic.armin@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>