- indentation fixes

Original commit message from CVS:
- indentation fixes
- dynamic properties fixes
- object hierarchy fixes
- float ranges and property fixes
This commit is contained in:
Wim Taymans 2003-02-21 19:41:02 +00:00
parent 2923f6f8c8
commit f5ef4dec93
2 changed files with 104 additions and 37 deletions

View file

@ -363,7 +363,7 @@ print_element_properties (GstElement *element, gint pfx)
case G_TYPE_FLOAT: case G_TYPE_FLOAT:
{ {
GParamSpecFloat *pfloat = G_PARAM_SPEC_FLOAT (param); GParamSpecFloat *pfloat = G_PARAM_SPEC_FLOAT (param);
PUT_STRING (pfx + 2, "<range min=\"%g\" max=\"%g\"/>", PUT_STRING (pfx + 2, "<range min=\"%f\" max=\"%f\"/>",
pfloat->minimum, pfloat->maximum); pfloat->minimum, pfloat->maximum);
PUT_ESCAPED (pfx + 2, "default", g_strdup_value_contents (&value)); PUT_ESCAPED (pfx + 2, "default", g_strdup_value_contents (&value));
break; break;
@ -448,39 +448,48 @@ print_element_dynparamaters (GstElement *element, gint pfx)
GParamSpec** specs; GParamSpec** specs;
gint x; gint x;
PUT_START_TAG (pfx, "dyn-params");
if((dpman = gst_dpman_get_manager (element))) { if((dpman = gst_dpman_get_manager (element))) {
PUT_START_TAG (pfx, "dyn-params");
specs = gst_dpman_list_dparam_specs (dpman); specs = gst_dpman_list_dparam_specs (dpman);
for (x = 0; specs[x] != NULL; x++) { for (x = 0; specs[x] != NULL; x++) {
g_print (" %-20.20s: ", g_param_spec_get_name (specs[x])); PUT_START_TAG (pfx + 1, "dyn-param");
PUT_ESCAPED (pfx + 2, "name", g_param_spec_get_name (specs[x]));
PUT_ESCAPED (pfx + 2, "type", g_type_name (specs[x]->value_type));
PUT_ESCAPED (pfx + 2, "nick", g_param_spec_get_nick (specs[x]));
PUT_ESCAPED (pfx + 2, "blurb", g_param_spec_get_blurb (specs[x]));
switch (G_PARAM_SPEC_VALUE_TYPE (specs[x])) { switch (G_PARAM_SPEC_VALUE_TYPE (specs[x])) {
case G_TYPE_INT64: case G_TYPE_INT64:
g_print ("64 Bit Integer (Default %" G_GINT64_FORMAT ", Range %" G_GINT64_FORMAT " -> %" G_GINT64_FORMAT ")", PUT_STRING (pfx + 2, "<range min=\"%"G_GINT64_FORMAT"\" max=\"%"G_GINT64_FORMAT"\"/>",
((GParamSpecInt64 *) specs[x])->default_value, ((GParamSpecInt64 *) specs[x])->minimum,
((GParamSpecInt64 *) specs[x])->minimum, ((GParamSpecInt64 *) specs[x])->maximum);
((GParamSpecInt64 *) specs[x])->maximum); PUT_STRING (pfx + 2, "<default>%"G_GINT64_FORMAT"</default>",
((GParamSpecInt64 *) specs[x])->default_value);
break; break;
case G_TYPE_INT: case G_TYPE_INT:
g_print ("Integer (Default %d, Range %d -> %d)", PUT_STRING (pfx + 2, "<range min=\"%d\" max=\"%d\"/>",
((GParamSpecInt *) specs[x])->default_value, ((GParamSpecInt *) specs[x])->minimum,
((GParamSpecInt *) specs[x])->minimum, ((GParamSpecInt *) specs[x])->maximum);
((GParamSpecInt *) specs[x])->maximum); PUT_STRING (pfx + 2, "<default>%d</default>",
((GParamSpecInt *) specs[x])->default_value);
break; break;
case G_TYPE_FLOAT: case G_TYPE_FLOAT:
g_print ("Float. Default: %-8.8s %15.7g\n", "", PUT_STRING (pfx + 2, "<range min=\"%f\" max=\"%f\"/>",
((GParamSpecFloat *) specs[x])->default_value);
g_print ("%-23.23s Range: %15.7g - %15.7g", "",
((GParamSpecFloat *) specs[x])->minimum, ((GParamSpecFloat *) specs[x])->minimum,
((GParamSpecFloat *) specs[x])->maximum); ((GParamSpecFloat *) specs[x])->maximum);
PUT_STRING (pfx + 2, "<default>%f</default>",
((GParamSpecFloat *) specs[x])->default_value);
break; break;
default: default:
g_print ("unknown %ld", G_PARAM_SPEC_VALUE_TYPE (specs[x])); break;
} }
PUT_END_TAG (pfx, "dyn-params"); PUT_END_TAG (pfx + 1, "dyn-param");
} }
g_free (specs); g_free (specs);
} }
PUT_END_TAG (pfx, "dyn-params");
} }
static void static void
@ -524,8 +533,6 @@ print_element_signals (GstElement *element, gint pfx)
for (j = 0; j < n_params; j++) { for (j = 0; j < n_params; j++) {
PUT_ESCAPED (pfx + 3, "type", g_type_name (param_types[j])); PUT_ESCAPED (pfx + 3, "type", g_type_name (param_types[j]));
} }
if (k == 0)
PUT_ESCAPED (pfx + 3, "type", "gpointer");
PUT_END_TAG (pfx + 2, "params"); PUT_END_TAG (pfx + 2, "params");
@ -754,8 +761,7 @@ print_element_info (GstElementFactory *factory)
PUT_END_TAG (3, "implementation"); PUT_END_TAG (3, "implementation");
if (realpad->caps) { if (realpad->caps) {
g_print (" Capabilities:\n"); print_caps (realpad->caps, 3);
print_caps (realpad->caps, 8);
} }
PUT_END_TAG (2, "pad"); PUT_END_TAG (2, "pad");
} }

View file

@ -1,6 +1,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" encoding="us-ascii" omit-xml-declaration="yes" indent="no"/> <xsl:output method="text" encoding="us-ascii" omit-xml-declaration="yes" indent="no"/>
<xsl:variable name="padding" select="string(' ')"/>
<xsl:template match="/element"> <xsl:template match="/element">
<xsl:apply-templates select="name"/> <xsl:apply-templates select="name"/>
@ -11,9 +12,9 @@
<xsl:apply-templates select="element-implementation"/> <xsl:apply-templates select="element-implementation"/>
<xsl:apply-templates select="clocking-interaction"/> <xsl:apply-templates select="clocking-interaction"/>
<xsl:apply-templates select="indexing-capabilities"/> <xsl:apply-templates select="indexing-capabilities"/>
<xsl:apply-templates select="dyn-params"/>
<xsl:apply-templates select="pads"/> <xsl:apply-templates select="pads"/>
<xsl:apply-templates select="element-properties"/> <xsl:apply-templates select="element-properties"/>
<xsl:apply-templates select="dyn-params"/>
<xsl:apply-templates select="element-signals"/> <xsl:apply-templates select="element-signals"/>
<xsl:apply-templates select="element-actions"/> <xsl:apply-templates select="element-actions"/>
</xsl:template> </xsl:template>
@ -35,7 +36,27 @@
<xsl:text>&#10;</xsl:text> <xsl:text>&#10;</xsl:text>
</xsl:template> </xsl:template>
<xsl:template name="object">
<xsl:param name="i"/>
<xsl:param name="j"/>
<xsl:if test="count($i/*) &gt; 0">
<xsl:call-template name="object">
<xsl:with-param name="i" select="$i/object"/>
<xsl:with-param name="j" select="$j - 1"/>
</xsl:call-template>
<xsl:value-of select="substring ($padding, 1, $j * 6)"/>
<xsl:text> +----</xsl:text>
</xsl:if>
<xsl:value-of select="$i/@name"/>
<xsl:text>&#10;</xsl:text>
</xsl:template>
<xsl:template match="object"> <xsl:template match="object">
<xsl:call-template name="object">
<xsl:with-param name="i" select="."/>
<xsl:with-param name="j" select="count(.//object[(*)])"/>
</xsl:call-template>
<xsl:text>&#10;</xsl:text>
</xsl:template> </xsl:template>
<xsl:template match="pad-templates"> <xsl:template match="pad-templates">
@ -105,10 +126,22 @@
<xsl:text>&#10;</xsl:text> <xsl:text>&#10;</xsl:text>
</xsl:template> </xsl:template>
<xsl:template match="float" mode="list">
<xsl:text> Float: </xsl:text>
<xsl:value-of select="@value"/>
<xsl:text>&#10;</xsl:text>
</xsl:template>
<xsl:template match="floatrange" mode="list">
<xsl:text> Float range: </xsl:text>
<xsl:value-of select="concat(@min, ' - ', @max)"/>
<xsl:text>&#10;</xsl:text>
</xsl:template>
<!-- propety entries in normal mode --> <!-- propety entries in normal mode -->
<xsl:template match="string"> <xsl:template match="string">
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:value-of select="@name"/> <xsl:value-of select="substring (concat (@name, $padding), 1, 15)"/>
<xsl:text> : String: '</xsl:text> <xsl:text> : String: '</xsl:text>
<xsl:value-of select="@value"/> <xsl:value-of select="@value"/>
<xsl:text>'&#10;</xsl:text> <xsl:text>'&#10;</xsl:text>
@ -116,7 +149,7 @@
<xsl:template match="fourcc"> <xsl:template match="fourcc">
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:value-of select="@name"/> <xsl:value-of select="substring (concat (@name, $padding), 1, 15)"/>
<xsl:text> : FourCC: '</xsl:text> <xsl:text> : FourCC: '</xsl:text>
<xsl:value-of select="@hexvalue"/> <xsl:value-of select="@hexvalue"/>
<xsl:text>'&#10;</xsl:text> <xsl:text>'&#10;</xsl:text>
@ -124,7 +157,7 @@
<xsl:template match="int"> <xsl:template match="int">
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:value-of select="@name"/> <xsl:value-of select="substring (concat (@name, $padding), 1, 15)"/>
<xsl:text> : Integer: </xsl:text> <xsl:text> : Integer: </xsl:text>
<xsl:value-of select="@value"/> <xsl:value-of select="@value"/>
<xsl:text>&#10;</xsl:text> <xsl:text>&#10;</xsl:text>
@ -132,12 +165,28 @@
<xsl:template match="range"> <xsl:template match="range">
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:value-of select="@name"/> <xsl:value-of select="substring (concat (@name, $padding), 1, 15)"/>
<xsl:text> : Integer range: </xsl:text> <xsl:text> : Integer range: </xsl:text>
<xsl:value-of select="concat(@min, ' - ', @max)"/> <xsl:value-of select="concat(@min, ' - ', @max)"/>
<xsl:text>&#10;</xsl:text> <xsl:text>&#10;</xsl:text>
</xsl:template> </xsl:template>
<xsl:template match="float">
<xsl:text> </xsl:text>
<xsl:value-of select="substring (concat (@name, $padding), 1, 15)"/>
<xsl:text> : Float: </xsl:text>
<xsl:value-of select="@value"/>
<xsl:text>&#10;</xsl:text>
</xsl:template>
<xsl:template match="floatrange">
<xsl:text> </xsl:text>
<xsl:value-of select="substring (concat (@name, $padding), 1, 15)"/>
<xsl:text> : Float range: </xsl:text>
<xsl:value-of select="concat(@min, ' - ', @max)"/>
<xsl:text>&#10;</xsl:text>
</xsl:template>
<xsl:template match="flag"> <xsl:template match="flag">
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:value-of select="."/> <xsl:value-of select="."/>
@ -202,12 +251,13 @@
</xsl:template> </xsl:template>
<xsl:template match="dyn-params"> <xsl:template match="dyn-params">
<xsl:text> Dynamic Parameters:&#10;</xsl:text> <xsl:text>Dynamic Parameters:&#10;</xsl:text>
<xsl:choose> <xsl:choose>
<xsl:when test="count(*) = 0"> <xsl:when test="count(*) = 0">
<xsl:text> none&#10;</xsl:text> <xsl:text> none&#10;</xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:apply-templates select="dyn-param"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
<xsl:text>&#10;</xsl:text> <xsl:text>&#10;</xsl:text>
@ -327,23 +377,33 @@
<xsl:text>. (Default </xsl:text> <xsl:text>. (Default </xsl:text>
<xsl:value-of select="."/> <xsl:value-of select="."/>
<xsl:text>)</xsl:text> <xsl:text>)</xsl:text>
<xsl:text>&#10;</xsl:text>
</xsl:template> </xsl:template>
<xsl:template match="element-property"> <xsl:template match="range" mode="params">
<xsl:value-of select="substring ($padding, 1, 25)"/>
<xsl:text>Range : </xsl:text>
<xsl:value-of select="concat(@min, ' - ', @max)"/>
<xsl:text>&#10;</xsl:text>
</xsl:template>
<xsl:template match="element-property|dyn-param">
<xsl:text> </xsl:text> <xsl:text> </xsl:text>
<xsl:value-of select="name"/> <xsl:value-of select="substring (concat(name, $padding), 1, 20)"/>
<xsl:text>:&#9; </xsl:text> <xsl:text> : </xsl:text>
<xsl:value-of select="blurb"/> <xsl:value-of select="blurb"/>
<xsl:text>&#10;</xsl:text> <xsl:text>&#10;</xsl:text>
<xsl:text> </xsl:text> <xsl:value-of select="substring ($padding, 1, 25)"/>
<xsl:value-of select="type"/> <xsl:value-of select="type"/>
<xsl:apply-templates select="default"/> <xsl:apply-templates select="default"/>
<xsl:text>&#10;</xsl:text> <xsl:apply-templates select="range" mode="params"/>
</xsl:template> </xsl:template>
<xsl:template match="params"> <xsl:template match="params">
<xsl:for-each select="type"> <xsl:for-each select="type">
<xsl:text>,&#10; </xsl:text> <xsl:text>,&#10;</xsl:text>
<xsl:value-of select="substring ($padding, 1, 25)"/>
<xsl:value-of select="substring ($padding, 1, 20)"/>
<xsl:value-of select="."/> <xsl:value-of select="."/>
<xsl:text> arg</xsl:text> <xsl:text> arg</xsl:text>
<xsl:value-of select="position()"/> <xsl:value-of select="position()"/>
@ -351,9 +411,7 @@
</xsl:template> </xsl:template>
<xsl:template match="signal"> <xsl:template match="signal">
<xsl:text> &quot;</xsl:text> <xsl:value-of select="substring (concat('&quot;', name, '&quot;', $padding), 1, 25)"/>
<xsl:value-of select="name"/>
<xsl:text>&quot; :</xsl:text>
<xsl:value-of select="return-type"/> <xsl:value-of select="return-type"/>
<xsl:text> user_function </xsl:text> <xsl:text> user_function </xsl:text>
<xsl:value-of select="concat ('(', object-type, '* object')"/> <xsl:value-of select="concat ('(', object-type, '* object')"/>
@ -369,7 +427,10 @@
<xsl:otherwise> <xsl:otherwise>
<xsl:for-each select="signal"> <xsl:for-each select="signal">
<xsl:apply-templates select="."/> <xsl:apply-templates select="."/>
<xsl:text>,&#10; gpointer user_data);&#10;</xsl:text> <xsl:text>,&#10;</xsl:text>
<xsl:value-of select="substring ($padding, 1, 25)"/>
<xsl:value-of select="substring ($padding, 1, 20)"/>
<xsl:text>gpointer user_data);&#10;</xsl:text>
</xsl:for-each> </xsl:for-each>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>