|
@@ -28,25 +28,8 @@
|
|
|
</xsl:choose>
|
|
|
</xsl:function>
|
|
|
|
|
|
- <!-- Map xml parameter element names (types) to C++ types. -->
|
|
|
- <xsl:function name="ctk:mapTypeToCpp">
|
|
|
- <xsl:param name="cliType"/>
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$cliType=('integer', 'integer-enumeration')">int</xsl:when>
|
|
|
- <xsl:when test="$cliType='boolean'">bool</xsl:when>
|
|
|
- <xsl:when test="$cliType=('string', 'string-enumeration', 'image', 'file', 'directory', 'geometry')">std::string</xsl:when>
|
|
|
- <xsl:when test="$cliType='integer-vector'">std::vector<int></xsl:when>
|
|
|
- <xsl:when test="$cliType=('double-vector', 'point', 'region')">std::vector<double></xsl:when>
|
|
|
- <xsl:when test="$cliType='float-vector'">std::vector<float></xsl:when>
|
|
|
- <xsl:when test="$cliType='string-vector'">std::vector<std::string></xsl:when>
|
|
|
- <xsl:when test="$cliType='float-enumeration'">float</xsl:when>
|
|
|
- <xsl:when test="$cliType='double-enumeration'">double</xsl:when>
|
|
|
- <xsl:otherwise><xsl:value-of select="$cliType"/></xsl:otherwise>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:function>
|
|
|
-
|
|
|
<!-- Map xml parameter element names (types) to the Qt widget property containing
|
|
|
- the current value. The property type should match the Qt C++ type above
|
|
|
+ the current value. The property value type should match the (Qt) C++ type
|
|
|
(or be convertible to it). -->
|
|
|
<xsl:function name="ctk:mapTypeToQtValueProperty">
|
|
|
<xsl:param name="cliType"/>
|
|
@@ -75,9 +58,6 @@
|
|
|
<!-- suppress elements not covered in "signals" mode -->
|
|
|
<xsl:template match="*" mode="signals"/>
|
|
|
|
|
|
- <!-- This guarantees that elements that don't match the dynamicProperties mode don't get output -->
|
|
|
- <xsl:template match="*" mode="dynamicProperties"/>
|
|
|
-
|
|
|
<!--
|
|
|
===================================================================
|
|
|
Templates for generating connections between generated widgets
|
|
@@ -154,18 +134,6 @@
|
|
|
</item>
|
|
|
</xsl:template>
|
|
|
|
|
|
- <!-- General template for adding dynamic Qt properties to widgets -->
|
|
|
- <xsl:template match="*" mode="dynamicProperty">
|
|
|
- <property name="parameter:{name()}">
|
|
|
- <string><xsl:value-of select="text()"/></string>
|
|
|
- </property>
|
|
|
- </xsl:template>
|
|
|
-
|
|
|
- <!-- Exclude certain elements from the set of dynamic properties -->
|
|
|
- <xsl:template match="*[not(name()=('name', 'constraints'))]" mode="dynamicProperties">
|
|
|
- <xsl:apply-templates select="." mode="dynamicProperty"/>
|
|
|
- </xsl:template>
|
|
|
-
|
|
|
<!-- A named template for adding properties common to all Qt widgets -->
|
|
|
<xsl:template name="commonWidgetProperties">
|
|
|
<xsl:apply-templates select="description"/> <!-- tooltip -->
|
|
@@ -174,17 +142,12 @@
|
|
|
<bool>false</bool>
|
|
|
</property>
|
|
|
</xsl:if>
|
|
|
- <property name="parameter:cppType">
|
|
|
- <string><xsl:value-of select="ctk:mapTypeToCpp(name())"/></string>
|
|
|
- </property>
|
|
|
- <property name="parameter:valueProperty">
|
|
|
+ <property name="parameter:valueProperty"> <!-- property name containing current value -->
|
|
|
<string><xsl:value-of select="ctk:mapTypeToQtValueProperty(name())"/></string>
|
|
|
</property>
|
|
|
|
|
|
<!-- add additional (optional) information as properties -->
|
|
|
<xsl:apply-templates select="default"/>
|
|
|
- <xsl:apply-templates select="constraints"/>
|
|
|
- <xsl:apply-templates select="./child::*" mode="dynamicProperties"/>
|
|
|
</xsl:template>
|
|
|
|
|
|
<!-- A named template for creating a QtDesigner stringlist property -->
|