dia r4100 - in trunk: . doc/en



Author: hans
Date: Sun Jul 27 17:58:45 2008
New Revision: 4100
URL: http://svn.gnome.org/viewvc/dia?rev=4100&view=rev

Log:
2008-07-27  Hans Breuer  <hans breuer org>

	[Patch from Thomas Harding updating documentation, bug #544222]
	* doc/en/dia.xml: docbook version => 4.5 (use of docbook elements not 
	disponible in 1.2. book valids now against db dtd 4.5) 
	* doc/en/custom-shapes.xml: updated to reflect changes in 
	doc/custom-shapes file


Modified:
   trunk/ChangeLog
   trunk/doc/en/custom-shapes.xml
   trunk/doc/en/dia.xml

Modified: trunk/doc/en/custom-shapes.xml
==============================================================================
--- trunk/doc/en/custom-shapes.xml	(original)
+++ trunk/doc/en/custom-shapes.xml	Sun Jul 27 17:58:45 2008
@@ -14,7 +14,7 @@
 The actual shape is described using a subset of the SVG
 specification.  The line, polyline, polygon, rect, circle, ellipse,
 path and g elements are supported.  Note that the path element only
-supports the M,m,L,l,H,h,V,v,C,c,S,s,Z and z commands.
+supports the M,m,L,l,H,h,V,v,C,c,S,s,A,a,Z and z commands.
 Transformations and CSS units are not supported (only `user' units
 are), and only a limited set of the CSS attributes are supported.
 </para>
@@ -49,31 +49,33 @@
 
 <literallayout>
 <literal>
-&lt;?xml version="1.0"?&gt;
-  &lt;shape xmlns="http://www.daa.com.au/~james/dia-shape-ns";
-         xmlns:svg="http://www.w3.org/2000/svg"&gt;
-    &lt;name&gt;Circuit with identifiers - NPN Transistor&lt;/name&gt;
-    &lt;icon&gt;npn.xpm&lt;/icon&gt;
-    &lt;connections&gt;
-      &lt;point x="0" y="0"/&gt;
-      &lt;point x="6" y="-4"/&gt;
-      &lt;point x="6" y="4"/&gt;
-    &lt;/connections&gt;
-
-    &lt;aspectratio type="fixed"/&gt;
-
-    &lt;textbox x1="4" y1="-3" x2="12" y2="3" /&gt;
-
-    &lt;svg:svg&gt;
-      &lt;svg:line x1="0" y1="0" x2="3" y2="0" /&gt;
-      &lt;svg:line x1="3" y1="-3" x2="3" y2="3" /&gt;
-      &lt;svg:line x1="3" y1="-2" x2="6" y2="-4" /&gt;
-      &lt;svg:line x1="3" y1="2" x2="6" y2="4" /&gt;
+<![CDATA[
+<?xml version="1.0"?>
+  <shape xmlns="http://www.daa.com.au/~james/dia-shape-ns";
+         xmlns:svg="http://www.w3.org/2000/svg";>
+    <name>Circuit with identifiers - NPN Transistor</name>
+    <icon>npn.xpm</icon>
+    <connections>
+      <point x="0" y="0"/>
+      <point x="6" y="-4"/>
+      <point x="6" y="4"/>
+    </connections>
+
+    <aspectratio type="fixed"/>
+
+    <textbox x1="4" y1="-3" x2="12" y2="3" />
+
+    <svg:svg>
+      <svg:line x1="0" y1="0" x2="3" y2="0" />
+      <svg:line x1="3" y1="-3" x2="3" y2="3" />
+      <svg:line x1="3" y1="-2" x2="6" y2="-4" />
+      <svg:line x1="3" y1="2" x2="6" y2="4" />
 
-      &lt;svg:polyline points="5,4 6,4 5.6154,3.0769" /&gt;
-    &lt;/svg:svg&gt;
+      <svg:polyline points="5,4 6,4 5.6154,3.0769" />
+    </svg:svg>
 
-  &lt;/shape&gt;
+  </shape>
+]]>
 </literal>
 </literallayout>
 </para>
@@ -149,6 +151,27 @@
 the text box in the same coordinate system as the SVG shape description.
 </para>
 <para>
+There are some optional attributes on &lt;textbox/&gt; namely
+<variablelist>
+<varlistentry>
+  <term>resize="no" :</term>
+  <listitem><simpara>by default the textbox is resized with the text</simpara></listitem>
+</varlistentry>
+<varlistentry>
+  <term>align="center" :</term>
+  <listitem><simpara>"center" is default, also "left" and "right" can be used</simpara></listitem>
+  </varlistentry>
+  </variablelist>
+</para>
+<para>
+
+Shapes are given a default size on creation. If that default size does
+not fit your needs you can overwrite it by (one or both):
+  &lt;default-width&gt;1cm&lt;/default-width&gt;
+  &lt;default-height&gt;3cm&lt;/default-height&gt;
+The default unit "cm" can be omitted.
+</para>
+<para>
 The <literal>svg</literal> element describes the shape.
 The width and height attributes
 are ignored, and only given to comply with the SVG specification.  For
@@ -344,7 +367,7 @@
   "<literal>file:///home/user/image.png</literal>" or a relative one
   without the "<literal>file://</literal>" prefix
   like in "<literal>image.png</literal>". The latter form is
-  preferred cause it is installation
+  preferred because it is installation
   independent. The filename is relative to the shape file placement. In the
   above example PNG and shape need to be in the same directory.
 </para>
@@ -415,14 +438,20 @@
 <listitem>
 <simpara>
 <literal>C x1,y1 x2,y2, x3,y3</literal> - Draw a bezier curve to 
-(x3,y3) with (x1,y1) and (x2,y2) as control points.
+(x3,y3) with (x1,y1) and (x2,y2) as control points. C (uppercase) indicates that absolute coordinates will follow; c (lowercase) indicates that relative coordinates will follow.
 </simpara>
 </listitem>
 <listitem>
 <simpara>
 <literal>S x1,y1 x2,y2</literal> -  Same as above, but draw a `smooth'
     bezier. That is, infer the first control point from
-                          the previous bezier.
+                          the previous bezier. S (uppercase) indicates that absolute coordinates will follow; s (lowercase) indicates that relative coordinates will follow. 
+</simpara>
+</listitem>
+<listitem>
+<simpara>
+<literal>A (rx ry x-axis-rotation large-arc-flag sweep-flag x y)+</literal> -  
+ Draw an elliptical arc from the current point to (x, y). The size and orientation of the ellipse are defined by two radii (rx, ry) and an x-axis-rotation. The center is automatically calculated. large-arc-flag and sweep-flag contribute to the automatic calculations and help determine how the arc is drawn. A (uppercase) indicates that absolute coordinates will follow; a (lowercase) indicates that relative coordinates will follow.
 </simpara>
 </listitem>
 <listitem>
@@ -475,6 +504,69 @@
 </itemizedlist>
 </sect2>
 </sect1>
+<sect1>
+<title>Shapes in Shapes aka. Subshapes</title>
+<para>
+Adding indepentently resizable symbols into your custom shapes is possible by
+creating subshapes. This is done by some extra attributes on the group element.
+</para>
+<literallayout><literal>
+<![CDATA[
+<svg:g
+ dia:subshape="true"
+ dia:v_anchor="fixed.bottom"
+ dia:h_anchor="fixed.left"
+ dia:default_scale="1.0">
+ ]]>
+</literal></literallayout>
+<variablelist>
+<varlistentry>
+<term>dia:v_anchor<termdef>Supported values:
+<parameter>"fixed.top"</parameter>
+<parameter>"fixed.bottom"</parameter>
+<parameter>"proportional"</parameter></termdef>
+</term> 
+<listitem><simpara>The vertical anchoring of the subshape.
+</simpara></listitem>
+</varlistentry>
+<varlistentry>
+<term>dia:h_anchor
+<termdef>Supported values are:
+<parameter>"fixed.left"</parameter>
+<parameter>"fixed.right"</parameter>
+<parameter>"proportional"</parameter>
+</termdef>
+</term>
+<listitem><simpara>The horizontal anchoring of the subshape.</simpara></listitem> 
+</varlistentry>
+<varlistentry>
+<term>dia:default_scale</term>
+<listitem><simpara>currently unused</simpara></listitem>
+</varlistentry>
+</variablelist>
+</sect1>
+<sect1>
+<title>Extented Attributes</title>
+<para>
+To extend your custom shape with custom attributes you can put something like:
+</para>
+<literallayout><literal>
+<![CDATA[
+  <ext_attributes>
+    <ext_attribute name="Integer" type="int" />
+    <ext_attribute name="String" type="string" />
+    <ext_attribute name="Float" type="real" />
+  </ext_attributes>
+]]>
+</literal></literallayout>
+<para>
+between the <literal>&lt;shape&gt;&lt;/shape&gt;</literal> tags. The effect will be some custom properties
+in your object. They are editable by the properties dialog and will be loaded 
+and saved with your diagram. To programatically access them use 
+<literal>"custom:&lt;name&gt;"</literal>
+</para>
+
+</sect1>
 <sect1 id='custom-shapes-sheets'>
 <title>The Sheet description</title>
 <para>
@@ -488,23 +580,25 @@
 
 <literallayout>
 <literal>
-&lt;?xml version="1.0" encoding="utf-8"?&gt; 
-&lt;sheet xmlns="http://www.lysator.liu.se/~alla/dia/dia-sheet-ns"&gt;
-  &lt;name&gt;Circuit with identifiers&lt;/name&gt;
-  &lt;name xml:lang="es"&gt;Circuito con identificadores&lt;/name&gt;
-  &lt;description&gt;Components for circuit diagrams&lt;/description&gt;
-  &lt;description xml:lang="es"&gt;Componentes para diagramas de circuitos&lt;/description&gt;
-  &lt;contents&gt;
-    &lt;object name="Circuit with identifiers - NPN Transistor"&gt;
-     &lt;description&gt;A bipolar npn transistor&lt;/description&gt;
-     &lt;description xml:lang="es"&gt;Un transistor bipolar npn identificable&lt;/description&gt;
-    &lt;/object&gt;
-    &lt;object name="UML - Objet"&gt;
-     &lt;description&gt;An UML object&lt;/description&gt;
-     &lt;description xml:lang="es"&gt;Un objeto UML&lt;/description&gt;
-    &lt;/object&gt;
-   &lt;/contents&gt;
-&lt;/sheet&gt;
+<![CDATA[
+<?xml version="1.0" encoding="utf-8"?> 
+<sheet xmlns="http://www.lysator.liu.se/~alla/dia/dia-sheet-ns";>
+  <name>Circuit with identifiers</name>
+  <name xml:lang="es">Circuito con identificadores</name>
+  <description>Components for circuit diagrams</description>
+  <description xml:lang="es">Componentes para diagramas de circuitos</description>
+  <contents>
+    <object name="Circuit with identifiers - NPN Transistor">
+     <description>A bipolar npn transistor</description>
+     <description xml:lang="es">Un transistor bipolar npn identificable</description>
+    </object>
+    <object name="UML - Objet">
+     <description>An UML object</description>
+     <description xml:lang="es">Un objeto UML</description>
+    </object>
+   </contents>
+</sheet>
+]]>
 </literal>
 </literallayout>
 </para>
@@ -514,10 +608,7 @@
 <para>
 You can use Dia with its available elements to draw a shape and then 
 export it to a shape file, by using  
-<menuchoice><guimenu>File (of  diagram)</guimenu><guimenuitem>Export</guimenuitem></menuchoice>
-        then, in export dialog box options
-<menuchoice><guimenu>File type</guimenu><guimenuitem>Dia shape
-        (*.shape)</guimenuitem></menuchoice>
+<menuchoice><guimenu>File (of  diagram)</guimenu><guimenuitem>Export</guimenuitem><guimenuitem>By extension</guimenuitem><guimenuitem>Shape</guimenuitem></menuchoice>.
 </para>
 <para>
 But until now, this shapes  don't have any text box. (They are expected 

Modified: trunk/doc/en/dia.xml
==============================================================================
--- trunk/doc/en/dia.xml	(original)
+++ trunk/doc/en/dia.xml	Sun Jul 27 17:58:45 2008
@@ -4,7 +4,7 @@
 
 <!DOCTYPE book
 
-  PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "../../dtd/docbookx.dtd"
+  PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "../../dtd/docbookx.dtd"
 
   [
 
@@ -171,3 +171,4 @@
 </book>
 
 
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]