cvs: php-gtk-doc /manual demo_manual.xml /stylesheets/common en.xml /stylesheets/html autotoc.xsl class.xsl index.xsl name_to_id.xsl phpweb.xsl
phpweb.xsl.in

From: Date: Thu, 02 Mar 2006 21:45:47 +0000
Subject: cvs: php-gtk-doc /manual demo_manual.xml /stylesheets/common en.xml /stylesheets/html autotoc.xsl class.xsl index.xsl name_to_id.xsl phpweb.xsl
phpweb.xsl.in
Groups: php.gtk.doc 
Request: Send a blank email to php-gtk-doc+get-1883@lists.php.net to get a copy of this message
cweiske Thu Mar 2 21:45:47 2006 UTC Modified files: /php-gtk-doc/manual demo_manual.xml /php-gtk-doc/stylesheets/common en.xml /php-gtk-doc/stylesheets/html autotoc.xsl class.xsl index.xsl name_to_id.xsl phpweb.xsl phpweb.xsl.in Log: Added supports for "fields" as requested by Scott. "Normal" properties that can be accessed via $obj->name are "fields" now, and "properties" can be read/set with get_property/set_property. To distinguish between them, the class has a new subtag: <fields> It behaves exactly like <properties>, except that properties has a small note now (telling that get_property and set_property need to be used). Further, field links are created with the <fieldname>, as known from <propname> formerly. The <property> tag inside of <properties> is the same, and is also used as only subtag of <fields>.

http://cvs.php.net/viewcvs.cgi/php-gtk-doc/manual/demo_manual.xml?r1=1.6&r2=1.7&diff_format=u Index: php-gtk-doc/manual/demo_manual.xml diff -u php-gtk-doc/manual/demo_manual.xml:1.6 php-gtk-doc/manual/demo_manual.xml:1.7 --- php-gtk-doc/manual/demo_manual.xml:1.6 Wed Dec 28 14:10:57 2005 +++ php-gtk-doc/manual/demo_manual.xml Thu Mar 2 21:45:46 2006 @@ -43,6 +43,24 @@ to link to the MyClass overview page. </para> </listitem> + <listitem> + <para> + <emphasis>Field links</emphasis> link to a certain field. + <fieldname>name</fieldname>. Use + <programlisting role="xml"><![CDATA[ +<fieldname>fieldname</fieldname> +]]></programlisting> + </para> + </listitem> + <listitem> + <para> + <emphasis>Property links</emphasis> link to a certain property. + <propname>version</propname>. Use + <programlisting role="xml"><![CDATA[ +<propname>propname</propname> +]]></programlisting> + </para> + </listitem> </itemizedlist> <example> @@ -187,6 +205,24 @@ </signals> + <fields> + + <property id="bro.broopera.field.name" type="ro"> + <propname>name</propname> + <proptype>string</proptype> + <shortdesc> + A normal field. Get it with $obj->name. + </shortdesc> + <desc> + <simpara> + Just a "normal" property: + </simpara> + <programlisting><![CDATA[echo $obj->name]]></programlisting> + </desc> + </property> + + </fields> + <!-- class properties --> <properties> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/stylesheets/common/en.xml?r1=1.15&r2=1.16&diff_format=u Index: php-gtk-doc/stylesheets/common/en.xml diff -u php-gtk-doc/stylesheets/common/en.xml:1.15 php-gtk-doc/stylesheets/common/en.xml:1.16 --- php-gtk-doc/stylesheets/common/en.xml:1.15 Wed Dec 28 12:42:58 2005 +++ php-gtk-doc/stylesheets/common/en.xml Thu Mar 2 21:45:47 2006 @@ -8,6 +8,7 @@ <gentext key="description" text="Description"/> <gentext key="directsubclasses" text="Direct subclasses"/> <gentext key="editedby" text="Edited by"/> + <gentext key="fields" text="Fields"/> <gentext key="implementedby" text="Implemented by"/> <gentext key="implementedinterfaces" text="Implemented interfaces"/> <gentext key="interfacewarning" text="This is an interface and cannot be instantiated directly."/> @@ -27,6 +28,7 @@ <gentext key="PHPGTKmanauths" text="PHP-GTK Manual Authors"/> <gentext key="PHPGTKmancons" text="PHP-GTK Manual Contributors"/> <gentext key="properties" text="Properties"/> + <gentext key="propertiesDisclaimer" text="Use get_property and set_property methods to access them."/> <gentext key="seealso" text="See also"/> <gentext key="signals" text="Signals"/> <gentext key="symbolicname" text="Symbolic name"/> @@ -47,6 +49,7 @@ <template name="enums" text="%t"/> <template name="enumset" text="%t"/> <template name="example" text="Example %n. %t"/> + <template name="fields" text=""/> <template name="figure" text="Figure %n. %t"/> <template name="legalnotice" text="%t"/> <template name="index" text="%t"/> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/stylesheets/html/autotoc.xsl?r1=1.10&r2=1.11&diff_format=u Index: php-gtk-doc/stylesheets/html/autotoc.xsl diff -u php-gtk-doc/stylesheets/html/autotoc.xsl:1.10 php-gtk-doc/stylesheets/html/autotoc.xsl:1.11 --- php-gtk-doc/stylesheets/html/autotoc.xsl:1.10 Mon Oct 24 05:50:16 2005 +++ php-gtk-doc/stylesheets/html/autotoc.xsl Thu Mar 2 21:45:47 2006 @@ -6,7 +6,7 @@ version='1.0'> <!-- ******************************************************************** - $Id: autotoc.xsl,v 1.10 2005/10/24 05:50:16 cweiske Exp $ + $Id: autotoc.xsl,v 1.11 2006/03/02 21:45:47 cweiske Exp $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. @@ -312,7 +312,7 @@ <xsl:template name="tocentry"> <xsl:param name="indent"/> - <xsl:for-each select="*[@id!='']|constructors|methods|properties|signals|enums/enum"> + <xsl:for-each select="*[@id!='']|constructors|methods|properties|fields|signals|enums/enum"> <xsl:variable name="title"> <xsl:choose> <xsl:when test="name(.)='classentry'"> @@ -322,7 +322,7 @@ <xsl:text>Constructor</xsl:text> </xsl:when> - <xsl:when test="(name(.)='constructors' or name(.)='methods') or (name(.)='properties') or (name(.)='signals')"> + <xsl:when test="(name(.)='constructors' or name(.)='methods') or (name(.)='properties') or (name(.)='fields') or (name(.)='signals')"> <xsl:value-of select="name(.)"/> </xsl:when> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/stylesheets/html/class.xsl?r1=1.24&r2=1.25&diff_format=u Index: php-gtk-doc/stylesheets/html/class.xsl diff -u php-gtk-doc/stylesheets/html/class.xsl:1.24 php-gtk-doc/stylesheets/html/class.xsl:1.25 --- php-gtk-doc/stylesheets/html/class.xsl:1.24 Tue Jan 31 07:04:50 2006 +++ php-gtk-doc/stylesheets/html/class.xsl Thu Mar 2 21:45:47 2006 @@ -156,6 +156,27 @@ </xsl:choose> </xsl:template> + + <xsl:template match="fieldname"> + <xsl:variable name="class" select="@class"/> + + <xsl:choose> + <xsl:when test="not($class) or $class=''"> + <!-- empty class... try to find it --> + <xsl:apply-templates select="." mode="synoptic.mode"/> + </xsl:when> + + <xsl:otherwise> + <!-- class given, all ok --> + <xsl:call-template name="field.link"> + <xsl:with-param name="prop" select="."/> + <xsl:with-param name="class" select="$class"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="propname" mode="synoptic.mode"> <xsl:variable name="classentry" select="ancestor::classentry[1]"/> <xsl:variable name="classtitle" select="$classentry/classmeta/classtitle"/> @@ -166,15 +187,37 @@ </xsl:call-template> </xsl:template> + + <xsl:template match="fieldname" mode="synoptic.mode"> + <xsl:variable name="classentry" select="ancestor::classentry[1]"/> + <xsl:variable name="classtitle" select="$classentry/classmeta/classtitle"/> + + <xsl:call-template name="prop.link"> + <xsl:with-param name="prop" select="."/> + <xsl:with-param name="class" select="$classtitle"/> + </xsl:call-template> + </xsl:template> + + <xsl:template name="prop.link"> <xsl:param name="prop" select="."/> <xsl:param name="class" select="@class"/> <xsl:variable name="id"> - <xsl:call-template name="get_prop_id_from_name"> - <xsl:with-param name="propname" select="$prop"/> - <xsl:with-param name="class" select="$class"/> - </xsl:call-template> + <xsl:choose> + <xsl:when test="name(../..)='fields' or name(.)='fieldname'"> + <xsl:call-template name="get_field_id_from_name"> + <xsl:with-param name="propname" select="$prop"/> + <xsl:with-param name="class" select="$class"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="get_prop_id_from_name"> + <xsl:with-param name="propname" select="$prop"/> + <xsl:with-param name="class" select="$class"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> </xsl:variable> <xsl:choose> @@ -436,10 +479,11 @@ <xsl:apply-templates select="./constructors" mode="synoptic.mode"/> <xsl:apply-templates select="./methods" mode="synoptic.mode"/> <xsl:apply-templates select="./signals" mode="synoptic.mode"/> + <xsl:apply-templates select="./fields" mode="synoptic.mode"/> <xsl:apply-templates select="./properties" mode="synoptic.mode"/> </p> </div> - <xsl:apply-templates select="./constructors|./methods|./signals|./properties"/> + <xsl:apply-templates select="./constructors|./methods|./signals|./fields|./properties"/> </xsl:template> <xsl:template match="classentry[@rtl='1']"> @@ -514,10 +558,11 @@ <xsl:apply-templates select="./constructors" mode="synoptic.mode"/> <xsl:apply-templates select="./methods" mode="synoptic.mode"/> <xsl:apply-templates select="./signals" mode="synoptic.mode"/> + <xsl:apply-templates select="./fields" mode="synoptic.mode"/> <xsl:apply-templates select="./properties" mode="synoptic.mode"/> </p> </div> - <xsl:apply-templates select="./constructors|./methods|./signals|./properties"/> + <xsl:apply-templates select="./constructors|./methods|./signals|./fields|./properties"/> </xsl:template> <xsl:template match="refentry"> @@ -620,6 +665,22 @@ <xsl:with-param name="key">properties</xsl:with-param> </xsl:call-template> </h3> + <p> + <xsl:call-template name="gentext"> + <xsl:with-param name="key">propertiesDisclaimer</xsl:with-param> + </xsl:call-template> + </p> + <blockquote> + <xsl:apply-templates select="./property" mode="synoptic.mode"/> + </blockquote> + </xsl:template> + + <xsl:template match="fields" mode="synoptic.mode"> + <h3> + <xsl:call-template name="gentext"> + <xsl:with-param name="key">fields</xsl:with-param> + </xsl:call-template> + </h3> <blockquote> <xsl:apply-templates select="./property" mode="synoptic.mode"/> </blockquote> @@ -644,7 +705,7 @@ <xsl:apply-templates mode="synoptic.mode"/> </xsl:template> - <xsl:template match="constructors|methods|signals|properties"> + <xsl:template match="constructors|methods|signals|fields|properties"> <xsl:choose> <xsl:when test="ancestor::classentry[@rtl='1']"> <div dir="rtl"> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/stylesheets/html/index.xsl?r1=1.2&r2=1.3&diff_format=u Index: php-gtk-doc/stylesheets/html/index.xsl diff -u php-gtk-doc/stylesheets/html/index.xsl:1.2 php-gtk-doc/stylesheets/html/index.xsl:1.3 --- php-gtk-doc/stylesheets/html/index.xsl:1.2 Mon Oct 24 05:55:25 2005 +++ php-gtk-doc/stylesheets/html/index.xsl Thu Mar 2 21:45:47 2006 @@ -17,6 +17,7 @@ <xsl:when test="$type='classes'"> <xsl:call-template name="index.classes"/> </xsl:when> <xsl:when test="$type='methods'"> <xsl:call-template name="index.methods"/> </xsl:when> <xsl:when test="$type='properties'"><xsl:call-template name="index.properties"/></xsl:when> + <xsl:when test="$type='fields'"> <xsl:call-template name="index.fields"/> </xsl:when> <xsl:when test="$type='signals'"> <xsl:call-template name="index.signals"/> </xsl:when> <xsl:otherwise> <xsl:message>Index type <xsl:value-of select="$type"/> not implemented.</xsl:message> @@ -73,9 +74,20 @@ </xsl:for-each> </xsl:template> + <!-- field index --> + <xsl:template name="index.fields"> + <xsl:for-each select="/set/book/classset/classentry/properties/fields"> + <xsl:sort select="propname"/> + <xsl:call-template name="index_link"> + <xsl:with-param name="title"><xsl:value-of select="propname"/> - <xsl:value-of select="../../classmeta/classtitle"/></xsl:with-param> + <xsl:with-param name="id"><xsl:value-of select="@id"/></xsl:with-param> + </xsl:call-template> + </xsl:for-each> + </xsl:template> + <!-- The syntax index is a huge list with links to - classes, interfaces, functions, signals and properties + classes, interfaces, functions, signals, fields and properties in alphabetical order --> <xsl:template name="index.syntax"> @@ -83,6 +95,7 @@ |/set/book/classset/classentry/constructors/constructor |/set/book/classset/classentry/methods/method |/set/book/classset/classentry/properties/property + |/set/book/classset/classentry/fields/property |/set/book/classset/classentry/signals/signal"> <!-- Sort by the title thingies --> <!-- FIXME: Functions with the same name but different classes aren't sorted correctly --> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/stylesheets/html/name_to_id.xsl?r1=1.6&r2=1.7&diff_format=u Index: php-gtk-doc/stylesheets/html/name_to_id.xsl diff -u php-gtk-doc/stylesheets/html/name_to_id.xsl:1.6 php-gtk-doc/stylesheets/html/name_to_id.xsl:1.7 --- php-gtk-doc/stylesheets/html/name_to_id.xsl:1.6 Fri Aug 5 08:34:43 2005 +++ php-gtk-doc/stylesheets/html/name_to_id.xsl Thu Mar 2 21:45:47 2006 @@ -23,17 +23,17 @@ </xsl:otherwise> </xsl:choose> </xsl:template> - - + + <!-- returns the id for a given classname e.g. gtk.gtkbutton for GtkButton - + puts out "no" if none is found --> <xsl:template name="get_id_from_name"> <xsl:param name="classname" /> - + <xsl:variable name="classname_lowercase" select="translate($classname,&uppercase;,&lowercase;)"/> <xsl:choose> @@ -77,34 +77,34 @@ <xsl:param name="class" select="'no'" /> <xsl:variable name="class_lowercase" select="translate($class,&uppercase;,&lowercase;)"/> - + <xsl:variable name="classid"><xsl:call-template name="get_id_from_name"> <xsl:with-param name="classname"><xsl:value-of select="$class"/></xsl:with-param> </xsl:call-template></xsl:variable> <!-- static class factory method --> <xsl:choose> - + <xsl:when test="contains($funcname,'::')"> <!-- seems to be a static one: factory method (constructor) --> <xsl:variable name="realclassid"><xsl:call-template name="get_id_from_name"> <xsl:with-param name="classname"><xsl:value-of select="substring-before($funcname,'::')"/></xsl:with-param> </xsl:call-template></xsl:variable> <xsl:choose> - + <xsl:when test="$realclassid='no'"> <!-- static "gdk::funcname" or "atk::funcname" or such --> <xsl:value-of select="substring-before($funcname,'::')"/>.method.<xsl:value-of select="$funcname"/> </xsl:when> - + <xsl:otherwise> <!-- constructor of class like "GtkButton::new_from_stock" --> <xsl:value-of select="$realclassid"/><xsl:text>.constructor.</xsl:text><xsl:value-of select="substring-after($funcname,'::')"/> </xsl:otherwise> - + </xsl:choose> </xsl:when> - + <xsl:otherwise> <!-- object function OR static gtk/gdk/atk/pango function --> <xsl:variable name="staticmethodid" select="/descendant::refentry/method[funcsynopsis/funcprototype/funcdef/function=$funcname]/@id"/> @@ -129,20 +129,20 @@ </xsl:otherwise> </xsl:choose> </xsl:otherwise> - + </xsl:choose> </xsl:otherwise> - + </xsl:choose> - + </xsl:template><!--xsl:template name="get_func_id_from_name"--> - - + + <!-- returns the id for a given property of a given class e.g. "gtk.gtkadjustment.property.value" for property "value" of class "GtkAdjustment" - + returns "no" if none is found --> <xsl:template name="get_prop_id_from_name"> @@ -152,7 +152,7 @@ <xsl:variable name="classid"><xsl:call-template name="get_id_from_name"> <xsl:with-param name="classname"><xsl:value-of select="$class"/></xsl:with-param> </xsl:call-template></xsl:variable> - + <xsl:choose> <xsl:when test="$classid='no'"> <!-- class couldn't be found... strange --> @@ -167,7 +167,35 @@ - <!-- + <!-- + returns the id for a given field of a given class + e.g. "gtk.gtkadjustment.field.value" for field "value" of class "GtkAdjustment" + + returns "no" if none is found + --> + <xsl:template name="get_field_id_from_name"> + <xsl:param name="propname" /> + <xsl:param name="class" select="no" /> + + <xsl:variable name="classid"><xsl:call-template name="get_id_from_name"> + <xsl:with-param name="classname"><xsl:value-of select="$class"/></xsl:with-param> + </xsl:call-template></xsl:variable> + + <xsl:choose> + <xsl:when test="$classid='no'"> + <!-- class couldn't be found... strange --> + <xsl:message>ERROR: classid for field <xsl:value-of select="$propname"/> not found</xsl:message> + <xsl:text>no</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$classid"/><xsl:text>.field.</xsl:text><xsl:value-of select="$propname"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template><!--xsl:template name="get_field_id_from_name"--> + + + + <!-- returns the id for a given signal name --> <xsl:template name="get_sig_id_from_name"> @@ -191,4 +219,4 @@ </xsl:template><!--xsl:template name="get_sig_id_from_name"--> -</xsl:stylesheet> \ No newline at end of file +</xsl:stylesheet> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/stylesheets/html/phpweb.xsl?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/stylesheets/html/phpweb.xsl diff -u php-gtk-doc/stylesheets/html/phpweb.xsl:1.1 php-gtk-doc/stylesheets/html/phpweb.xsl:1.2 --- php-gtk-doc/stylesheets/html/phpweb.xsl:1.1 Mon Apr 11 21:54:45 2005 +++ php-gtk-doc/stylesheets/html/phpweb.xsl Thu Mar 2 21:45:47 2006 @@ -82,7 +82,7 @@ <xsl:choose> <xsl:when test="name($node)='constructor' or name($node)='method' or name($node)='signal' or name($node)='prop'"> <xsl:variable name="classentry" select="(ancestor::classentry|ancestor::refentry)[1]"/> - <xsl:for-each select="$classentry/constructors|$classentry/methods/*|$classentry/signals/*|$classentry/properties/*|$classentry/method"> + <xsl:for-each select="$classentry/constructors|$classentry/methods/*|$classentry/signals/*|$classentry/properties/*|$classentry/fields/*|$classentry/method"> <xsl:call-template name="gen.text.toc.array"> <xsl:with-param name="node" select="." /> </xsl:call-template> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/stylesheets/html/phpweb.xsl.in?r1=1.9&r2=1.10&diff_format=u Index: php-gtk-doc/stylesheets/html/phpweb.xsl.in diff -u php-gtk-doc/stylesheets/html/phpweb.xsl.in:1.9 php-gtk-doc/stylesheets/html/phpweb.xsl.in:1.10 --- php-gtk-doc/stylesheets/html/phpweb.xsl.in:1.9 Mon Apr 11 21:54:45 2005 +++ php-gtk-doc/stylesheets/html/phpweb.xsl.in Thu Mar 2 21:45:47 2006 @@ -77,12 +77,12 @@ <xsl:template name="gen.toc.array"> <xsl:param name="node" select="." /> - <!-- we need a few special cases here so that we can handle constructor, methods, signals and properties.. --> + <!-- we need a few special cases here so that we can handle constructor, methods, signals, fields and properties.. --> <xsl:choose> <xsl:when test="name($node)='constructor' or name($node)='method' or name($node)='signal' or name($node)='property'"> <xsl:variable name="classentry" select="(ancestor::classentry|ancestor::refentry)[1]"/> - <xsl:for-each select="$classentry/constructor|$classentry/methods/*|$classentry/signals/*|$classentry/properties/*|$classentry/method"> + <xsl:for-each select="$classentry/constructor|$classentry/methods/*|$classentry/signals/*|$classentry/fields/*|$classentry/properties/*|$classentry/method"> <xsl:call-template name="gen.text.toc.array"> <xsl:with-param name="node" select="." /> </xsl:call-template>
« previous php.gtk.doc (#1883) next »