Notes on Dia shapes & importing them:

* Dia shapes
    'dia' in Gnome CVS
	+ dia/shapes/*

    + Simple XML format:

<?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 - Horizontal Capacitor</name>
  <description>A horizontally aligned capacitor</description>
  <icon>hcapacitor.png</icon>
  <connections>
    <point x="0" y="0"/>
    <point x="5" y="0"/>
  </connections>
  <svg:svg width="3.0" height="3.0">
    <svg:line x1="0" y1="0" x2="2" y2="0" />
    <svg:line x1="2" y1="-1" x2="2" y2="1" />
    <svg:line x1="3" y1="-1" x2="3" y2="1" />
    <svg:line x1="3" y1="0" x2="5" y2="0" />
  </svg:svg>
</shape>

    + Name
    + Description
	[ icon - not needed for OO.o - has a rendered preview ]
    + <connections>
    + simple/cut-down svg.
	+ including width/height.

svx/inc/tbxcustomshapes.hxx
svx/source/customshapes/tbxcustomshapes.cxx
    + EnhancedCustomShape2d.hxx (eg.)
sd/source/ui/app/sddll2.cxx


"glue points"
      + the OO.o name for 'connections'
      + "Insert Glue Points"
	    + allows you to define your own (nice)

Look at the svg import proto-'filter' at:
     http://www.openoffice.org/issues/show_bug.cgi?id=2497
or:
http://framework.openoffice.org/source/browse/framework/filter/source/xslt/import/svg/Attic/svg2draw.xsl


Example styles from dia shapes:

svg:polygon:
    <svg:polygon points="0,2 -1,3.75 1,3.75" style="fill: default" />
    <svg:polygon points="-1.50,2.62 -1.50,2.30 -1.30,2.30" style="fill:inverse" />
svg:line:
    <svg:line x1="4.5" y1="-0.5" x2="4.5" y2="-1.5" />
svg:rect:
    <svg:rect x="1.5" y="-0.5" width="3" height="1" style="fill: default" /> 
svg:polyline:
    <svg:polyline points="6,-4 6,-3 5,-3 5,3 6,3 6,4 " />
svg:path:
    <svg:path d="M530.63 -1951.28 l0 44.92 l29.42 -18.15 l0 -44.92 l-57.39
                -112.32l0 -44.92 l-31.1 18.15 l0 44.92"
     style="stroke: background; stroke-width: 0.8;
     stroke-miterlimit: 4"/>
    <svg:path d="M646.15 -7055.21l49.7 -101.86l-344.11 0l-77.36 101.86l371.78 0z" style="fill: foreground; stroke-width: 0"/>
svg:ellipse:
    <svg:ellipse style="stroke-width: 0.1; stroke: #000000" cx="19.495" cy="8.625" rx="0.25" ry="0.275"/>
    <svg:ellipse style="fill: #ffffff" cx="20.195" cy="9.225" rx="0.25" ry="0.275"/>
svg:circle:
    <svg:circle cx="0" r="1.5" />
    <svg:circle color="#ff0000" style="stroke: #ff000; fill: #ff0000" cx="0" r="0.1" /> 

Line Width: 0.1 (?)

Example XML from OO.o document:

  <office:drawing>
   <draw:page draw:name="page1" draw:style-name="dp1" draw:master-page-name="Default">
    <draw:line draw:style-name="gr1" draw:text-style-name="P1" draw:layer="layout"
    svg:x1="7.135cm" svg:y1="8.135cm" svg:x2="7.135cm" svg:y2="14.635cm">
     <text:p/>
    </draw:line>
    <draw:line draw:style-name="gr1" draw:text-style-name="P1" draw:layer="layout"
    svg:x1="6.635cm" svg:y1="12.635cm" svg:x2="12.135cm" svg:y2="13.135cm">
     <text:p/>
    </draw:line>
    <draw:rect draw:style-name="gr1" draw:text-style-name="P1" draw:layer="layout"
    svg:width="5cm" svg:height="2.5cm" svg:x="6.635cm" svg:y="17.635cm">
     <text:p/>
    </draw:rect>
    <draw:ellipse draw:style-name="gr1" draw:text-style-name="P1" draw:layer="layout"
    svg:width="5cm" svg:height="3.5cm" svg:x="7.135cm" svg:y="3.635cm">
     <text:p/>
    </draw:ellipse>
    <draw:polygon draw:style-name="gr1" draw:text-style-name="P1" draw:layer="layout"
    svg:width="8.5cm" svg:height="6.5cm" svg:x="3.635cm" svg:y="22.135cm"
    svg:viewBox="0 0 8501 6501" draw:points="0,3500 7000,0 8500,4500 3500,6500 3000,500">
     <text:p/>
    </draw:polygon>
   </draw:page>
  </office:drawing>

Example XML from OO.o document - with glue-points ...

  <office:body>
    <draw:page draw:name="page1" draw:style-name="dp1" draw:master-page-name="Default">
      <draw:g draw:name="Capacitor">
        <draw:glue-point draw:id="5" svg:x="0.772cm" svg:y="-4.677cm"/>
        <draw:glue-point draw:id="6" svg:x="4.594cm" svg:y="-0.805cm"/>
        <draw:ellipse draw:style-name="gr1" draw:text-style-name="P1" draw:layer="layout" svg:width="5.334cm" svg:height="2.862cm" svg:x="3.901cm" svg:y="14.479cm"/>
        <draw:rect draw:style-name="gr1" draw:text-style-name="P1" draw:layer="layout" svg:width="1.041cm" svg:height="5.376cm" svg:x="6.026cm" svg:y="13.222cm"/>
      </draw:g>
    </draw:page>
  </office:body>

Example XML from OO.o document with fill/non-fill

  <office:automatic-styles>
    <style:style style:name="dp1" style:family="drawing-page"/>
    <style:style style:name="gr1" style:family="graphics" style:parent-style-name="objectwithoutfill">
      <style:properties draw:fill="none" draw:textarea-horizontal-align="center" draw:textarea-vertical-align="middle"/>
    </style:style>
    <style:style style:name="gr2" style:family="graphics" style:parent-style-name="standard">
      <style:properties draw:textarea-horizontal-align="center" draw:textarea-vertical-align="middle"/>
    </style:style>
    <style:style style:name="P1" style:family="paragraph">
      <style:properties fo:text-align="center"/>
    </style:style>
  </office:automatic-styles>
  <office:body>
    <draw:page draw:name="page1" draw:style-name="dp1" draw:master-page-name="Default">
      <draw:polygon draw:name="empty poly" draw:style-name="gr1"
      draw:text-style-name="P1" draw:layer="layout"
      svg:width="6.678cm" svg:height="7.371cm"
      svg:x="6.763cm" svg:y="6.112cm"
      svg:viewBox="0 0 6678 7371"
      draw:points="477,781 6677,1994 6416,7370 0,6633 3815,0 434,650 347,650"/>


      <draw:polygon draw:name="fill poly" draw:style-name="gr2" draw:text-style-name="P1" draw:layer="layout"
      svg:width="9.149cm" svg:height="7.241cm" svg:x="2.341cm" svg:y="17.34cm"
      svg:viewBox="0 0 9149 7241" draw:points="0,1908 7414,7240 9148,0 1908,6243 217,1995"/>
      <draw:circle draw:name="circle" draw:style-name="gr1" draw:text-style-name="P1" draw:layer="layout"
      svg:width="3.166cm" svg:height="3.166cm"
      svg:x="8.237cm" svg:y="3.858cm"/>
      <draw:path draw:name="path" draw:style-name="gr1" draw:text-style-name="P1" draw:layer="layout"
      svg:width="8.899cm" svg:height="11.998cm" svg:x="3.42cm" svg:y="10.014cm"
      svg:viewBox="0 0 8899 11998"
      svg:d="m222 0c9884 3035 8627 10014 8627 10014 0 0-9061-2774-8844 1214 217 3988 7847-8800 7847-8800"/>
      <draw:polyline draw:name="open poly" draw:style-name="gr1" draw:text-style-name="P1" draw:layer="layout"
      svg:width="5.507cm" svg:height="10.666cm" svg:x="13.873cm"
      svg:y="2.774cm" svg:viewBox="0 0 5507 10666"
      draw:points="4812,4595 910,0 0,7283 4119,10665 5506,7283"/>

  </draw:page>
  </office:body>
