grim/gir2glade

5e3324edbe82
Parents 75707a87177b
Children 2ef7e38f4086
move the library cleanup stuff into the namespace template.
  • +13 -21
    gir2glade.xsl
  • --- a/gir2glade.xsl Tue May 08 21:59:04 2018 -0500
    +++ b/gir2glade.xsl Tue May 08 22:05:09 2018 -0500
    @@ -1,6 +1,6 @@
    <?xml version="1.0" encoding="utf-8"?>
    <!--
    -gir2glade.xsl
    +gir2glade
    Copyright 2018 Gary Kramlich <grim@reaperworld.com>
    This program is free software: you can redistribute it and/or modify
    @@ -28,23 +28,6 @@
    <xsl:strip-space elements="*"/>
    - <xsl:template name="library-name">
    - <xsl:param name="lib"></xsl:param>
    -
    - <xsl:variable name="split">
    - <xsl:value-of select="substring-after($lib, 'lib')"/>
    - </xsl:variable>
    -
    - <xsl:choose>
    - <xsl:when test="contains($split, '.so')">
    - <xsl:value-of select="substring-before($split, '.so')"/>
    - </xsl:when>
    - <xsl:otherwise>
    - <xsl:text>unsupported</xsl:text>
    - </xsl:otherwise>
    - </xsl:choose>
    - </xsl:template>
    -
    <xsl:template match="gir:repository">
    <xsl:element name="glade-catalog">
    <xsl:apply-templates/>
    @@ -57,9 +40,18 @@
    <!-- clean up the library name -->
    <xsl:attribute name="library">
    - <xsl:call-template name="library-name">
    - <xsl:with-param name="lib"><xsl:value-of select="@shared-library"/></xsl:with-param>
    - </xsl:call-template>
    + <xsl:variable name="split">
    + <xsl:value-of select="substring-after(@shared-library, 'lib')"/>
    + </xsl:variable>
    +
    + <xsl:choose>
    + <xsl:when test="contains($split, '.so')">
    + <xsl:value-of select="substring-before($split, '.so')"/>
    + </xsl:when>
    + <xsl:otherwise>
    + <xsl:text>unsupported</xsl:text>
    + </xsl:otherwise>
    + </xsl:choose>
    </xsl:attribute>
    <!-- add each widget class if it's implements Gtk.Buildable -->