Makefile.am                           |    5 
 configure.ac                          |   18 +
 doc/Contributing                      |   19 +
 doc/doxygen/.gitignore                |    1 
 doc/doxygen/Makefile.am               |   28 ++
 doc/doxygen/mainpage.dox              |   22 ++
 doc/doxygen/wayland.doxygen.in        |    6 
 doc/publican/protocol-to-docbook.xsl  |   39 +++
 doc/publican/sources/Architecture.xml |    4 
 doc/publican/sources/Protocol.xml     |    4 
 protocol/wayland.xml                  |  344 ++++++++++++++++------------------
 src/.gitignore                        |    1 
 src/connection.c                      |   14 -
 src/dtddata.S                         |    8 
 src/scanner.c                         |  329 ++++++++++++++++++++++----------
 src/wayland-client-core.h             |    6 
 src/wayland-client.c                  |  172 ++++++++++++++---
 src/wayland-client.h                  |    7 
 src/wayland-private.h                 |   12 -
 src/wayland-server-core.h             |    8 
 src/wayland-server.c                  |    2 
 src/wayland-server.h                  |    9 
 src/wayland-shm.c                     |   99 ++++++---
 src/wayland-util.c                    |   13 +
 src/wayland-util.h                    |   10 
 tests/display-test.c                  |   54 +++++
 tests/headers-protocol-core-test.c    |    7 
 tests/queue-test.c                    |  122 ++++++++++++
 tests/resources-test.c                |   10 
 tests/test-runner.c                   |    2 
 30 files changed, 980 insertions(+), 395 deletions(-)

New commits:
commit 47163797f810373c81b6e13b7a8a245eb9877785
Author: Bryce Harrington <br...@osg.samsung.com>
Date:   Tue May 31 17:11:20 2016 -0700

    configure.ac: bump to version 1.11.0 for the official release

diff --git a/configure.ac b/configure.ac
index 7dba928..cf96529 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,8 @@
 AC_PREREQ([2.64])
 
 m4_define([wayland_major_version],  [1])
-m4_define([wayland_minor_version], [10])
-m4_define([wayland_micro_version], [93])
+m4_define([wayland_minor_version], [11])
+m4_define([wayland_micro_version],  [0])
 m4_define([wayland_version],
           [wayland_major_version.wayland_minor_version.wayland_micro_version])
 

commit 62d67fe8fa217994f1d82dcb3203bb651e1c011f
Author: Bryce Harrington <br...@osg.samsung.com>
Date:   Tue May 24 12:29:59 2016 -0700

    configure.ac: bump to version 1.10.93 for the RC1 release

diff --git a/configure.ac b/configure.ac
index ca6e8c5..7dba928 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ([2.64])
 
 m4_define([wayland_major_version],  [1])
 m4_define([wayland_minor_version], [10])
-m4_define([wayland_micro_version], [92])
+m4_define([wayland_micro_version], [93])
 m4_define([wayland_version],
           [wayland_major_version.wayland_minor_version.wayland_micro_version])
 

commit 97fef4821327b5daecbee9c6cb0fc1de93181cff
Author: Yong Bakos <yba...@humanoriented.com>
Date:   Thu May 19 20:31:16 2016 -0600

    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 <yba...@humanoriented.com>
    Reviewed-by: <pekka.paala...@collabora.co.uk>
    Reviewed-by: Bryce Harrington <br...@osg.samsung.com>

diff --git a/src/scanner.c b/src/scanner.c
index 037ebdb..5f06e8e 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -1477,13 +1477,13 @@ emit_header(struct protocol *protocol, enum side side)
               "#include \"%s\"\n\n"
               "#ifdef  __cplusplus\n"
               "extern \"C\" {\n"
-              "#endif\n"
-              "\n"
-              "struct wl_client;\n"
-              "struct wl_resource;\n\n",
+              "#endif\n\n",
               protocol->uppercase_name, s,
               protocol->uppercase_name, s,
               get_include_name(protocol->core_headers, side));
+       if (side == SERVER)
+               printf("struct wl_client;\n"
+                      "struct wl_resource;\n\n");
 
        emit_mainpage_blurb(protocol, side);
 

commit cc11b493426c46e86aee0bcd7c92ca9e9e23030d
Author: Marek Chalupa <mchqwe...@gmail.com>
Date:   Fri May 13 15:01:18 2016 +0200

    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 <mchqwe...@gmail.com>
    Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk>

diff --git a/tests/display-test.c b/tests/display-test.c
index f9f8160..17956db 100644
--- a/tests/display-test.c
+++ b/tests/display-test.c
@@ -211,8 +211,6 @@ find_client_info(struct display *d, struct wl_client 
*client)
 {
        struct client_info *ci;
 
-       /* find the right client_info struct and save the
-        * resource as its data, so that we can use it later */
        wl_list_for_each(ci, &d->clients, link) {
                if (ci->wl_client == client)
                        return ci;
@@ -235,6 +233,8 @@ bind_seat(struct wl_client *client, void *data,
        res = wl_resource_create(client, &wl_seat_interface, vers, id);
        assert(res);
 
+       /* save the resource as client's info data,
+        * so that we can use it later */
        ci->data = res;
 }
 

commit 9ca9f8e4b27f51a4d8b1b0823a93f15cf76540aa
Author: Yong Bakos <yba...@humanoriented.com>
Date:   Thu May 19 10:27:29 2016 -0600

    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 <yba...@humanoriented.com>
    Reviewed-by: Bryce Harrington <br...@osg.samsung.com>

diff --git a/tests/headers-protocol-core-test.c 
b/tests/headers-protocol-core-test.c
index aabcb0b..5c2baf3 100644
--- a/tests/headers-protocol-core-test.c
+++ b/tests/headers-protocol-core-test.c
@@ -26,6 +26,13 @@
 #include "wayland-client-protocol-core.h"
 #include "wayland-server-protocol-core.h"
 
+#ifndef WAYLAND_CLIENT_CORE_H
+#error including wayland-client-protocol-core.h did not include 
wayland-client-core.h!
+#endif
+#ifndef WAYLAND_SERVER_CORE_H
+#error including wayland-server-protocol-core.h did not include 
wayland-server-core.h!
+#endif
+
 #ifdef WAYLAND_CLIENT_H
 #error including wayland-client-protocol-core.h included wayland-client.h!
 #endif

commit f19b569ec2cf2f8dbaf00d62e2f6b131f29aeec4
Author: Bryce Harrington <br...@osg.samsung.com>
Date:   Tue May 17 22:07:48 2016 -0700

    configure.ac: bump to version 1.10.92 for the beta release

diff --git a/configure.ac b/configure.ac
index a42dfc0..ca6e8c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ([2.64])
 
 m4_define([wayland_major_version],  [1])
 m4_define([wayland_minor_version], [10])
-m4_define([wayland_micro_version], [91])
+m4_define([wayland_micro_version], [92])
 m4_define([wayland_version],
           [wayland_major_version.wayland_minor_version.wayland_micro_version])
 

commit f86fbe1a115fe2bf0da066e66ed73349cc2c378c
Author: Yong Bakos <yba...@humanoriented.com>
Date:   Sat May 7 09:11:30 2016 -0500

    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 <yba...@humanoriented.com>
    Reviewed-by: Derek Foreman <der...@osg.samsung.com>
    [Updated to apply to trunk]
    Reviewed-by: Bryce Harrington <br...@osg.samsung.com>

diff --git a/src/wayland-private.h b/src/wayland-private.h
index a9a07a8..045109b 100644
--- a/src/wayland-private.h
+++ b/src/wayland-private.h
@@ -103,10 +103,6 @@ wl_map_lookup_flags(struct wl_map *map, uint32_t i);
 void
 wl_map_for_each(struct wl_map *map, wl_iterator_func_t func, void *data);
 
-struct wl_connection;
-struct wl_closure;
-struct wl_proxy;
-
 struct wl_connection *
 wl_connection_create(int fd);
 

commit 385906beae3a7605629fd3a582f1be9254d7345b
Author: Yong Bakos <yba...@humanoriented.com>
Date:   Sun May 8 08:44:08 2016 -0500

    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 <yba...@humanoriented.com>
    Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk>
    Reviewed-by: Bryce Harrington <br...@osg.samsung.com>

diff --git a/src/connection.c b/src/connection.c
index 747229e..c3293a9 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -798,19 +798,6 @@ wl_connection_demarshal(struct wl_connection *connection,
 }
 
 int
-wl_interface_equal(const struct wl_interface *a, const struct wl_interface *b)
-{
-       /* In most cases the pointer equality test is sufficient.
-        * However, in some cases, depending on how things are split
-        * across shared objects, we can end up with multiple
-        * instances of the interface metadata constants.  So if the
-        * pointers match, the interfaces are equal, if they don't
-        * match we have to compare the interface names. */
-
-       return a == b || strcmp(a->name, b->name) == 0;
-}
-
-int
 wl_closure_lookup_objects(struct wl_closure *closure, struct wl_map *objects)
 {
        struct wl_object *object;
diff --git a/src/wayland-private.h b/src/wayland-private.h
index 994bc45..a9a07a8 100644
--- a/src/wayland-private.h
+++ b/src/wayland-private.h
@@ -55,6 +55,10 @@ struct wl_object {
 extern struct wl_object global_zombie_object;
 #define WL_ZOMBIE_OBJECT ((void*)&global_zombie_object)
 
+int
+wl_interface_equal(const struct wl_interface *iface1,
+                  const struct wl_interface *iface2);
+
 /* Flags for wl_map_insert_new and wl_map_insert_at.  Flags can be queried with
  * wl_map_lookup_flags.  The current implementation has room for 1 bit worth of
  * flags.  If more flags are ever added, the implementation of wl_map will have
@@ -103,10 +107,6 @@ struct wl_connection;
 struct wl_closure;
 struct wl_proxy;
 
-int
-wl_interface_equal(const struct wl_interface *iface1,
-                  const struct wl_interface *iface2);
-
 struct wl_connection *
 wl_connection_create(int fd);
 
diff --git a/src/wayland-util.c b/src/wayland-util.c
index 748476a..5bfb7e1 100644
--- a/src/wayland-util.c
+++ b/src/wayland-util.c
@@ -35,6 +35,19 @@
 
 struct wl_object global_zombie_object;
 
+int
+wl_interface_equal(const struct wl_interface *a, const struct wl_interface *b)
+{
+       /* In most cases the pointer equality test is sufficient.
+        * However, in some cases, depending on how things are split
+        * across shared objects, we can end up with multiple
+        * instances of the interface metadata constants.  So if the
+        * pointers match, the interfaces are equal, if they don't
+        * match we have to compare the interface names.
+        */
+       return a == b || strcmp(a->name, b->name) == 0;
+}
+
 WL_EXPORT void
 wl_list_init(struct wl_list *list)
 {

commit e5b12aa827a777dc6455b9a87909a222157c256f
Author: Yong Bakos <yba...@humanoriented.com>
Date:   Sun May 8 14:42:28 2016 -0500

    doc: Formalize file comment in wayland-client.h, wayland-server.h
    
    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 <yba...@humanoriented.com>
    Reviewed-by: Bryce Harrington <br...@osg.samsung.com>

diff --git a/src/wayland-client.h b/src/wayland-client.h
index 3856535..9f70fa3 100644
--- a/src/wayland-client.h
+++ b/src/wayland-client.h
@@ -23,8 +23,11 @@
  * SOFTWARE.
  */
 
-
-/** Use of this header file is discouraged. Prefer including
+/** \file
+ *
+ *  \brief Include the client API and protocol C API.
+ *
+ *  \warning Use of this header file is discouraged. Prefer including
  *  wayland-client-core.h instead, which does not include the
  *  client protocol header and as such only defines the library
  *  API.
diff --git a/src/wayland-server.h b/src/wayland-server.h
index b6d0e2b..3124703 100644
--- a/src/wayland-server.h
+++ b/src/wayland-server.h
@@ -23,10 +23,13 @@
  * SOFTWARE.
  */
 
-
-/** Use of this header file is discouraged. Prefer including
+/** \file
+ *
+ *  \brief Include the server API, deprecations and protocol C API.
+ *
+ *  \warning Use of this header file is discouraged. Prefer including
  *  wayland-server-core.h instead, which does not include the
- *  client protocol header and as such only defines the library
+ *  server protocol header and as such only defines the library
  *  API, excluding the deprecated API below.
  */
 

commit c6d204fdbcffec742416d3971ef1efd3b6eb575a
Author: Yong Bakos <yba...@humanoriented.com>
Date:   Sat May 7 18:14:11 2016 -0500

    protocol: Remove double line break
    
    All vertical whitespace should manifest as a single blank line, never two.
    
    Signed-off-by: Yong Bakos <yba...@humanoriented.com>
    Reviewed-by: Jonas Ådahl <jad...@gmail.com>

diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index 92e3f43..700ef03 100644
--- a/protocol/wayland.xml
+++ b/protocol/wayland.xml
@@ -407,7 +407,6 @@
     </event>
   </interface>
 
-
   <interface name="wl_data_offer" version="3">
     <description summary="offer to transfer data">
       A wl_data_offer represents a piece of data offered for transfer

commit 721c91c54a705fc3e971e94d8afe46993af953f8
Author: Armin Krezović <krezovic.ar...@gmail.com>
Date:   Thu May 5 17:27:57 2016 +0200

    scanner: Add version argument to wayland-scanner
    
    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 <br...@osg.samsung.com>
    Reviewed-by: Yong Bakos <yba...@humanoriented.com>
    Tested-by: Yong Bakos <yba...@humanoriented.com>
    Signed-off-by: Armin Krezović <krezovic.ar...@gmail.com>
    Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk>

diff --git a/src/scanner.c b/src/scanner.c
index 1317a06..037ebdb 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -26,6 +26,7 @@
  */
 
 #include "config.h"
+#include "wayland-version.h"
 
 #include <stdbool.h>
 #include <stdio.h>
@@ -64,12 +65,21 @@ usage(int ret)
                        "headers, server headers, or protocol marshalling 
code.\n\n");
        fprintf(stderr, "options:\n");
        fprintf(stderr, "    -h,  --help                  display this help and 
exit.\n"
+                       "    -v,  --version               print the wayland 
library version that\n"
+                       "                                 the scanner was built 
against.\n"
                        "    -c,  --include-core-only     include the core 
version of the headers,\n"
                        "                                 that is e.g. 
wayland-client-core.h instead\n"
                        "                                 of 
wayland-client.h.\n");
        exit(ret);
 }
 
+static int
+scanner_version(int ret)
+{
+       fprintf(stderr, "wayland-scanner %s\n", WAYLAND_VERSION);
+       exit(ret);
+}
+
 static bool
 is_dtd_valid(FILE *input, const char *filename)
 {
@@ -1457,6 +1467,8 @@ emit_header(struct protocol *protocol, enum side side)
        const char *s = (side == SERVER) ? "SERVER" : "CLIENT";
        char **p, *prev;
 
+       printf("/* Generated by wayland-scanner %s */\n\n", WAYLAND_VERSION);
+
        printf("#ifndef %s_%s_PROTOCOL_H\n"
               "#define %s_%s_PROTOCOL_H\n"
               "\n"
@@ -1658,6 +1670,8 @@ emit_code(struct protocol *protocol)
        struct wl_array types;
        char **p, *prev;
 
+       printf("/* Generated by wayland-scanner %s */\n\n", WAYLAND_VERSION);
+
        if (protocol->copyright)
                format_text_to_comment(protocol->copyright, true);
 
@@ -1735,7 +1749,9 @@ int main(int argc, char *argv[])
        char *input_filename = NULL;
        int len;
        void *buf;
-       bool help = false, core_headers = false;
+       bool help = false;
+       bool core_headers = false;
+       bool version = false;
        bool fail = false;
        int opt;
        enum {
@@ -1746,12 +1762,13 @@ int main(int argc, char *argv[])
 
        static const struct option options[] = {
                { "help",              no_argument, NULL, 'h' },
+               { "version",           no_argument, NULL, 'v' },
                { "include-core-only", no_argument, NULL, 'c' },
                { 0,                   0,           NULL, 0 }
        };
 
        while (1) {
-               opt = getopt_long(argc, argv, "hc", options, NULL);
+               opt = getopt_long(argc, argv, "hvc", options, NULL);
 
                if (opt == -1)
                        break;
@@ -1760,6 +1777,9 @@ int main(int argc, char *argv[])
                case 'h':
                        help = true;
                        break;
+               case 'v':
+                       version = true;
+                       break;
                case 'c':
                        core_headers = true;
                        break;
@@ -1774,6 +1794,8 @@ int main(int argc, char *argv[])
 
        if (help)
                usage(EXIT_SUCCESS);
+       else if (version)
+               scanner_version(EXIT_SUCCESS);
        else if ((argc != 1 && argc != 3) || fail)
                usage(EXIT_FAILURE);
        else if (strcmp(argv[0], "help") == 0)

commit 08bda63ac4aa483c046fcbf8dd62a1103ffe9683
Author: Bryce Harrington <br...@osg.samsung.com>
Date:   Tue May 3 17:56:22 2016 -0700

    configure.ac: bump to version 1.10.91 for the alpha release

diff --git a/configure.ac b/configure.ac
index bbe62f7..a42dfc0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ([2.64])
 
 m4_define([wayland_major_version],  [1])
 m4_define([wayland_minor_version], [10])
-m4_define([wayland_micro_version], [90])
+m4_define([wayland_micro_version], [91])
 m4_define([wayland_version],
           [wayland_major_version.wayland_minor_version.wayland_micro_version])
 

commit 7ccf35d43209ca4c4283cd3a3746f8126d4c64c1
Author: Auke Booij <a...@tulcod.com>
Date:   Sat Dec 5 12:39:12 2015 +0000

    protocol: add support for cross-interface enum attributes
    
    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 <a...@tulcod.com>
    Reviewed-by: Nils Christopher Brause <nilschrbra...@googlemail.com>
    Reviewed-by: Bill Spitzak <spit...@gmail.com>
    [Pekka: rebased across cde251a124d41977b447098cc530fcad2834a45f]
    [Pekka: wrap lines and space fixes in scanner.c]
    Signed-off-by: Pekka Paalanen <pekka.paala...@collabora.co.uk>

diff --git a/doc/publican/protocol-to-docbook.xsl 
b/doc/publican/protocol-to-docbook.xsl
index 5344442..210e0db 100644
--- a/doc/publican/protocol-to-docbook.xsl
+++ b/doc/publican/protocol-to-docbook.xsl
@@ -152,9 +152,22 @@
     <term><xsl:value-of select="@name"/></term>
     <listitem>
         <simpara>
-          <link linkend="protocol-spec-{../../@name}-enum-{@enum}">
-            <xsl:value-of select="../../@name"/>::<xsl:value-of 
select="@enum"/>
-          </link>
+          <xsl:choose>
+            <xsl:when test="contains(@enum, '.')">
+              <link linkend="protocol-spec-{substring-before(@enum, 
'.')}-enum-{substring-after(@enum, '.')}">
+                <xsl:value-of select="substring-before(@enum, '.')"/>
+                <xsl:text>::</xsl:text>
+                <xsl:value-of select="substring-after(@enum, '.')"/>
+              </link>
+            </xsl:when>
+            <xsl:otherwise>
+              <link linkend="protocol-spec-{../../@name}-enum-{@enum}">
+                <xsl:value-of select="../../@name"/>
+                <xsl:text>::</xsl:text>
+                <xsl:value-of select="@enum"/>
+              </link>
+            </xsl:otherwise>
+          </xsl:choose>
           (<xsl:value-of select="@type"/>)
           <xsl:if test="@summary" >
             - <xsl:value-of select="@summary"/>
diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index 1555677..92e3f43 100644
--- a/protocol/wayland.xml
+++ b/protocol/wayland.xml
@@ -229,7 +229,7 @@
       <arg name="width" type="int"/>
       <arg name="height" type="int"/>
       <arg name="stride" type="int"/>
-      <arg name="format" type="uint"/>
+      <arg name="format" type="uint" enum="wl_shm.format"/>
     </request>
 
     <request name="destroy" type="destructor">
@@ -1580,7 +1580,7 @@
        wl_output.transform enum the invalid_transform protocol error
        is raised.
       </description>
-      <arg name="transform" type="int"/>
+      <arg name="transform" type="int" enum="wl_output.transform"/>
     </request>
 
     <!-- Version 3 additions -->
diff --git a/src/scanner.c b/src/scanner.c
index 52c07a6..1317a06 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -752,8 +752,8 @@ start_element(void *data, const char *element_name, const 
char **atts)
                        enumeration->bitfield = true;
                else
                        fail(&ctx->loc,
-                             "invalid value (%s) for bitfield attribute (only 
true/false are accepted)",
-                             bitfield);
+                            "invalid value (%s) for bitfield attribute (only 
true/false are accepted)",
+                            bitfield);
 
                wl_list_insert(ctx->interface->enumeration_list.prev,
                               &enumeration->link);
@@ -790,32 +790,68 @@ start_element(void *data, const char *element_name, const 
char **atts)
        }
 }
 
+static struct enumeration *
+find_enumeration(struct protocol *protocol,
+                struct interface *interface,
+                char *enum_attribute)
+{
+       struct interface *i;
+       struct enumeration *e;
+       char *enum_name;
+       uint idx = 0, j;
+
+       for (j = 0; j + 1 < strlen(enum_attribute); j++) {
+               if (enum_attribute[j] == '.') {
+                       idx = j;
+               }
+       }
+
+       if (idx > 0) {
+               enum_name = enum_attribute + idx + 1;
+
+               wl_list_for_each(i, &protocol->interface_list, link)
+                       if (strncmp(i->name, enum_attribute, idx) == 0)
+                               wl_list_for_each(e, &i->enumeration_list, link)
+                                       if (strcmp(e->name, enum_name) == 0)
+                                               return e;
+       } else if (interface) {
+               enum_name = enum_attribute;
+
+               wl_list_for_each(e, &interface->enumeration_list, link)
+                       if (strcmp(e->name, enum_name) == 0)
+                               return e;
+       }
+
+       return NULL;
+}
+
 static void
-verify_arguments(struct parse_context *ctx, struct wl_list *messages, struct 
wl_list *enumerations)
+verify_arguments(struct parse_context *ctx,
+                struct interface *interface,
+                struct wl_list *messages,
+                struct wl_list *enumerations)
 {
        struct message *m;
        wl_list_for_each(m, messages, link) {
                struct arg *a;
                wl_list_for_each(a, &m->arg_list, link) {
-                       struct enumeration *e, *f;
+                       struct enumeration *e;
 
                        if (!a->enumeration_name)
                                continue;
 
-                       f = NULL;
-                       wl_list_for_each(e, enumerations, link) {
-                               if(strcmp(e->name, a->enumeration_name) == 0)
-                                       f = e;
-                       }
 
-                       if (f == NULL)
+                       e = find_enumeration(ctx->protocol, interface,
+                                            a->enumeration_name);
+
+                       if (e == NULL)
                                fail(&ctx->loc,
                                     "could not find enumeration %s",
                                     a->enumeration_name);
 
                        switch (a->type) {
                        case INT:
-                               if (f->bitfield)
+                               if (e->bitfield)
                                        fail(&ctx->loc,
                                             "bitfield-style enum must only be 
referenced by uint");
                                break;
@@ -853,12 +889,13 @@ end_element(void *data, const XML_Char *name)
                             ctx->enumeration->name);
                }
                ctx->enumeration = NULL;
-       } else if (strcmp(name, "interface") == 0) {
-               struct interface *i = ctx->interface;
-
-               verify_arguments(ctx, &i->request_list, &i->enumeration_list);
-               verify_arguments(ctx, &i->event_list, &i->enumeration_list);
+       } else if (strcmp(name, "protocol") == 0) {
+               struct interface *i;
 
+               wl_list_for_each(i, &ctx->protocol->interface_list, link) {
+                       verify_arguments(ctx, i, &i->request_list, 
&i->enumeration_list);
+                       verify_arguments(ctx, i, &i->event_list, 
&i->enumeration_list);
+               }
        }
 }
 

commit e21aeb5d1290de0ab67995bbd6341ef399a1f399
Author: Yong Bakos <yba...@humanoriented.com>
Date:   Sat Apr 30 07:35:50 2016 -0500

    protocol: Add summaries to event parameters
    
    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 <yba...@humanoriented.com>
    Reviewed-by: Jonas Ådahl <jad...@gmail.com>
    Reviewed-by: Bryce Harrington <br...@osg.samsung.com>

diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index 378879e..1555677 100644
--- a/protocol/wayland.xml
+++ b/protocol/wayland.xml
@@ -70,9 +70,9 @@
        own set of error codes.  The message is a brief description
        of the error, for (debugging) convenience.
       </description>
-      <arg name="object_id" type="object"/>
-      <arg name="code" type="uint"/>
-      <arg name="message" type="string"/>
+      <arg name="object_id" type="object" summary="object where the error 
occurred"/>
+      <arg name="code" type="uint" summary="error code"/>
+      <arg name="message" type="string" summary="error description"/>
     </event>
 
     <enum name="error">
@@ -96,7 +96,7 @@
        When the client receives this event, it will know that it can
        safely reuse the object ID.
       </description>
-      <arg name="id" type="uint" />
+      <arg name="id" type="uint" summary="deleted object id"/>
     </event>
   </interface>
 
@@ -141,9 +141,9 @@
         the given name is now available, and it implements the
         given version of the given interface.
       </description>
-      <arg name="name" type="uint"/>
-      <arg name="interface" type="string"/>
-      <arg name="version" type="uint"/>
+      <arg name="name" type="uint" summary="numeric name of the global 
object"/>
+      <arg name="interface" type="string" summary="interface implemented by 
the object"/>
+      <arg name="version" type="uint" summary="interface version"/>
     </event>
 
     <event name="global_remove">
@@ -159,7 +159,7 @@
        ignored until the client destroys it, to avoid races between
        the global going away and a client sending a request to it.
       </description>
-      <arg name="name" type="uint"/>
+      <arg name="name" type="uint" summary="numeric name of the global 
object"/>
     </event>
   </interface>
 
@@ -367,7 +367,7 @@
        can be used for buffers. Known formats include
        argb8888 and xrgb8888.
       </description>
-      <arg name="format" type="uint" enum="format"/>
+      <arg name="format" type="uint" enum="format" summary="buffer pixel 
format"/>
     </event>
   </interface>
 
@@ -485,7 +485,7 @@
        event per offered mime type.
       </description>
 
-      <arg name="mime_type" type="string"/>
+      <arg name="mime_type" type="string" summary="offered mime type"/>
     </event>
 
     <!-- Version 3 additions -->
@@ -550,7 +550,7 @@
        will be sent right after wl_data_device.enter, or anytime the source
        side changes its offered actions through wl_data_source.set_actions.
       </description>
-      <arg name="source_actions" type="uint"/>
+      <arg name="source_actions" type="uint" summary="actions offered by the 
data source"/>
     </event>
 
     <event name="action" since="3">
@@ -591,7 +591,7 @@
        final wl_data_offer.set_actions and wl_data_offer.accept requests
        must happen before the call to wl_data_offer.finish.
       </description>
-      <arg name="dnd_action" type="uint"/>
+      <arg name="dnd_action" type="uint" summary="action selected by the 
compositor"/>
     </event>
   </interface>
 
@@ -633,7 +633,7 @@
        Used for feedback during drag-and-drop.
       </description>
 
-      <arg name="mime_type" type="string" allow-null="true"/>
+      <arg name="mime_type" type="string" allow-null="true" summary="mime type 
accepted by the target"/>
     </event>
 
     <event name="send">
@@ -643,8 +643,8 @@
        close it.
       </description>
 
-      <arg name="mime_type" type="string"/>
-      <arg name="fd" type="fd"/>
+      <arg name="mime_type" type="string" summary="mime type for the data"/>
+      <arg name="fd" type="fd" summary="file descriptor for the data"/>
     </event>
 
     <event name="cancelled">
@@ -746,7 +746,7 @@
        Clients can trigger cursor surface changes from this point, so
        they reflect the current action.
       </description>
-      <arg name="dnd_action" type="uint"/>
+      <arg name="dnd_action" type="uint" summary="action selected by the 
compositor"/>
     </event>
   </interface>
 
@@ -821,7 +821,7 @@
        mime types it offers.
       </description>
 
-      <arg name="id" type="new_id" interface="wl_data_offer"/>
+      <arg name="id" type="new_id" interface="wl_data_offer" summary="the new 
data_offer object"/>
     </event>
 
     <event name="enter">
@@ -832,11 +832,12 @@
        coordinates.
       </description>
 
-      <arg name="serial" type="uint"/>
-      <arg name="surface" type="object" interface="wl_surface"/>
-      <arg name="x" type="fixed"/>
-      <arg name="y" type="fixed"/>
-      <arg name="id" type="object" interface="wl_data_offer" 
allow-null="true"/>
+      <arg name="serial" type="uint" summary="serial number of the enter 
event"/>
+      <arg name="surface" type="object" interface="wl_surface" summary="client 
surface entered"/>
+      <arg name="x" type="fixed" summary="surface-local x coordinate"/>
+      <arg name="y" type="fixed" summary="surface-local y coordinate"/>
+      <arg name="id" type="object" interface="wl_data_offer" allow-null="true"
+          summary="source data_offer object"/>
     </event>
 
     <event name="leave">
@@ -855,8 +856,8 @@
        coordinates.
       </description>
       <arg name="time" type="uint" summary="timestamp with millisecond 
granularity"/>
-      <arg name="x" type="fixed"/>
-      <arg name="y" type="fixed"/>
+      <arg name="x" type="fixed" summary="surface-local x coordinate"/>
+      <arg name="y" type="fixed" summary="surface-local y coordinate"/>
     </event>
 
     <event name="drop">
@@ -891,7 +892,8 @@
        destroy the previous selection data_offer, if any, upon receiving
        this event.
       </description>
-      <arg name="id" type="object" interface="wl_data_offer" 
allow-null="true"/>
+      <arg name="id" type="object" interface="wl_data_offer" allow-null="true"
+          summary="selection data_offer object"/>
     </event>
 
     <!-- Version 2 additions -->
@@ -1230,7 +1232,7 @@
        Ping a client to check if it is receiving events and sending
        requests. A client is expected to reply with a pong request.
       </description>
-      <arg name="serial" type="uint"/>
+      <arg name="serial" type="uint" summary="serial number of the ping"/>
     </event>
 
     <event name="configure">
@@ -1254,9 +1256,9 @@
        in surface-local coordinates.
       </description>
 
-      <arg name="edges" type="uint" enum="resize"/>
-      <arg name="width" type="int"/>
-      <arg name="height" type="int"/>
+      <arg name="edges" type="uint" enum="resize" summary="how the surface was 
resized"/>
+      <arg name="width" type="int" summary="new width of the surface"/>
+      <arg name="height" type="int" summary="new height of the surface"/>
     </event>
 
     <event name="popup_done">
@@ -1532,7 +1534,7 @@
 
        Note that a surface may be overlapping with zero or more outputs.
       </description>
-      <arg name="output" type="object" interface="wl_output"/>
+      <arg name="output" type="object" interface="wl_output" summary="output 
entered by the surface"/>
     </event>
 
     <event name="leave">
@@ -1541,7 +1543,7 @@
        results in it no longer having any part of it within the scanout region
        of an output.
       </description>
-      <arg name="output" type="object" interface="wl_output"/>
+      <arg name="output" type="object" interface="wl_output" summary="output 
left by the surface"/>
     </event>
 
     <!-- Version 2 additions -->
@@ -1700,7 +1702,7 @@
        The above behavior also applies to wl_keyboard and wl_touch with the
        keyboard and touch capabilities, respectively.
       </description>
-      <arg name="capabilities" type="uint" enum="capability"/>
+      <arg name="capabilities" type="uint" enum="capability" 
summary="capabilities of the seat"/>
     </event>
 
     <request name="get_pointer">
@@ -1750,7 +1752,7 @@
        identify which physical devices the seat represents. Based on
        the seat configuration used by the compositor.
       </description>
-      <arg name="name" type="string"/>
+      <arg name="name" type="string" summary="seat identifier"/>
     </event>
 
     <!-- Version 5 additions -->
@@ -1831,8 +1833,8 @@
        an appropriate pointer image with the set_cursor request.
       </description>
 
-      <arg name="serial" type="uint"/>
-      <arg name="surface" type="object" interface="wl_surface"/>
+      <arg name="serial" type="uint" summary="serial number of the enter 
event"/>
+      <arg name="surface" type="object" interface="wl_surface" 
summary="surface entered by the pointer"/>
       <arg name="surface_x" type="fixed" summary="surface-local x coordinate"/>
       <arg name="surface_y" type="fixed" summary="surface-local y coordinate"/>
     </event>
@@ -1845,8 +1847,8 @@
        The leave notification is sent before the enter notification
        for the new focus.

Reply via email to