diff options
| author | Auke Booij <auke@tulcod.com> | 2015-12-05 12:39:12 +0000 |
|---|---|---|
| committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2016-05-03 14:54:11 +0300 |
| commit | 7ccf35d43209ca4c4283cd3a3746f8126d4c64c1 (patch) | |
| tree | 209918b24f6914192825b54e5620b690f3c3eb4d /doc | |
| parent | protocol: Add summaries to event parameters (diff) | |
| download | wayland-7ccf35d43209ca4c4283cd3a3746f8126d4c64c1.tar wayland-7ccf35d43209ca4c4283cd3a3746f8126d4c64c1.tar.gz wayland-7ccf35d43209ca4c4283cd3a3746f8126d4c64c1.tar.bz2 wayland-7ccf35d43209ca4c4283cd3a3746f8126d4c64c1.tar.lz wayland-7ccf35d43209ca4c4283cd3a3746f8126d4c64c1.tar.xz wayland-7ccf35d43209ca4c4283cd3a3746f8126d4c64c1.tar.zst wayland-7ccf35d43209ca4c4283cd3a3746f8126d4c64c1.zip | |
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 <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>
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/publican/protocol-to-docbook.xsl | 19 |
1 files changed, 16 insertions, 3 deletions
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"/> |
