[Xcb] [PATCH 2/2] libxcb: Underscore placement in extension name
Eamon Walsh
ewalsh at tycho.nsa.gov
Thu Mar 29 10:50:52 PDT 2007
Replaces special-casing in c-client stylesheet with support
for new attribute. Tested with diff and found no difference with
previous stylesheet header-file output.
--
c-client.xsl | 38 +++++++++++++-------------------------
1 file changed, 13 insertions(+), 25 deletions(-)
--
diff --git a/src/c-client.xsl b/src/c-client.xsl
index d7a0eb9..24ffe6c 100644
--- a/src/c-client.xsl
+++ b/src/c-client.xsl
@@ -97,31 +97,19 @@ authorization from the authors.
<xsl:param name="name" />
<func:result>
<xsl:text>xcb</xsl:text>
- <xsl:choose>
- <xsl:when test="/xcb/@extension-name = 'RandR'">
- <xsl:text>_randr</xsl:text>
- </xsl:when>
- <xsl:when test="/xcb/@extension-name = 'ScreenSaver'">
- <xsl:text>_screensaver</xsl:text>
- </xsl:when>
- <xsl:when test="/xcb/@extension-name = 'XF86Dri'">
- <xsl:text>_xf86dri</xsl:text>
- </xsl:when>
- <xsl:when test="/xcb/@extension-name = 'XFixes'">
- <xsl:text>_xfixes</xsl:text>
- </xsl:when>
- <xsl:when test="/xcb/@extension-name = 'XvMC'">
- <xsl:text>_xvmc</xsl:text>
- </xsl:when>
- <xsl:when test="/xcb/@extension-name">
- <xsl:text>_</xsl:text>
- <xsl:call-template name="camelcase-to-underscore">
- <xsl:with-param name="camelcase" select="/xcb/@extension-name" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:if test="/xcb/@extension-name">
+ <xsl:text>_</xsl:text>
+ <xsl:choose>
+ <xsl:when test="/xcb/@extension-oneword = 'true' or /xcb/@extension-oneword = '1'">
+ <xsl:value-of select="translate(/xcb/@extension-name, $ucase, $lcase)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="camelcase-to-underscore">
+ <xsl:with-param name="camelcase" select="/xcb/@extension-name" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
<xsl:if test="$name">
<xsl:text>_</xsl:text>
<xsl:call-template name="camelcase-to-underscore">
More information about the Xcb
mailing list