grim/purple-objects-docbook

96f4c487e144
Parents 3d85aaf3ca93
Children 98abf6734d6a
moved plugin-state.fdp to plugin-state.enum
added enum.xsl which translates a .enum to the dot format
updated Makefile as apporiate
--- a/Makefile Fri Apr 17 21:03:11 2009 -0500
+++ b/Makefile Fri Apr 17 21:32:36 2009 -0500
@@ -15,7 +15,6 @@
plugin-class.png \
plugin-objects.png \
plugin-loader-objects.png \
- plugin-state.png \
relationship-key.png
all: book.stamp images.stamp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/enum.xsl Fri Apr 17 21:32:36 2009 -0500
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="text"/>
+
+ <xsl:strip-space elements="*"/>
+
+ <!-- variables -->
+ <xsl:variable name="newline" select="'&#10;'"/>
+ <xsl:variable name="tab" select="'&#9;'"/>
+
+ <xsl:variable name="newline-tab">
+ <xsl:value-of select="$newline"/>
+ <xsl:value-of select="$tab"/>
+ </xsl:variable>
+
+ <xsl:template match="enumeration">
+ <!-- start the diagram -->
+ <xsl:text>digraph {</xsl:text>
+ <xsl:value-of select="$newline-tab"/>
+
+ <!-- set our node settings -->
+ <xsl:text>node[fontname="sans", fontsize="9", shape="record", style="filled", fillcolor="lightyellow"];</xsl:text>
+ <xsl:value-of select="$newline-tab"/>
+
+ <!-- handle the beginning of the enum node -->
+ <xsl:text>enum[label="{</xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>\n\&lt;\&lt; enumeration \&gt;\&gt;</xsl:text>
+
+ <!-- run through all the items -->
+ <xsl:for-each select="item">
+ <xsl:text>|</xsl:text>
+ <xsl:value-of select="@name"/>
+
+ <!-- check if we have a value and output it -->
+ <xsl:if test="@value">
+ <xsl:text> : </xsl:text>
+ <xsl:value-of select="@value"/>
+ </xsl:if>
+
+ <!-- left align the item -->
+ <xsl:text>\l</xsl:text>
+ </xsl:for-each>
+
+ <!-- finish off the enum node -->
+ <xsl:text>}"];</xsl:text>
+
+ <!-- finish up -->
+ <xsl:value-of select="$newline"/>
+ <xsl:text>}</xsl:text>
+ <xsl:value-of select="$newline"/>
+ </xsl:template>
+</xsl:stylesheet>
--- a/plugin-state.dot Fri Apr 17 21:03:11 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-/*
- vi: syntax=dot:wrap
-*/
-digraph {
- node[fontname="sans", fontsize="9", shape="record", style="filled", fillcolor="lightyellow"];
- class[label="{PurplePluginState\n\<\<\ enumeration\ \>\>|PURPLE_PLUGIN_STATE_UNKNOWN\ :\ -1\l|PURPLE_PLUGIN_STATE_ERROR\ :\ 0\l|PURPLE_PLUGIN_STATE_LOADED\l|PURPLE_PLUGIN_STATE_LOAD_FAILED\l|PURPLE_PLUGIN_STATE_NOT_LOADED\l|PURPLE_PLUGIN_STATES\l}"];
-}
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plugin-state.enum Fri Apr 17 21:32:36 2009 -0500
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<enumeration name="PurplePluginState">
+ <item name="PURPLE_PLUGIN_STATE_UNKNOWN" value="-1"/>
+ <item name="PURPLE_PLUGIN_STATE_ERROR" value="0"/>
+ <item name="PURPLE_PLUGIN_STATE_LOADED"/>
+ <item name="PURPLE_PLUGIN_STATE_LOAD_FAILED"/>
+ <item name="PURPLE_PLUGIN_STATE_NOT_LOADED"/>
+ <item name="PURPLE_PLUGIN_STATES"/>
+</enumeration>