On Fri, 5 Nov 1999, James Henstridge wrote:

> I don't know if it is worth getting rid of the SheetObject structures all
> together.  Maybe just have it so that instead of registering a SheetObject
> with a particular sheet, you just register it.  Some other code could
> construct the actual sheets from XML files.  The current code in
> objects/custom could be extended to take something like:
>   <sheetobj>Standard - Box</sheetobj>

Hmmm. Up to now, we had two structures (three for shapes) :
ObjectType and SheetObject. The former describes the object type ; the
second describes some decoration and that user_data field only two object
use, in integer form.
Now, we would have to have three structures (four) : ObjectType,
SheetObject, and the <object> (or <sheetobj>, whatever) node.
Hmmm. What I've begun coding is to have a ${pkgdatadir}/sheets (with
perhaps a way to specify the order of sheets in diarc), and sheet files a
bit more featureful : 

<?xml version="1.0"?> <!-- -*- xml-mode -*- -->

<sheet xmlns="http://www.crans.ens-cachan.fr/~chepelov/dia-sheet-ns">
  <name>Test</name>
  <description xml:lang="fr">Une feuille de test</description>
  <description>A test sheet</description>
  <contents>
    <object name="UML - Class" intdata="1">
      <description>a template uml class</description>
      <icon>foo.xpm</icon>
    </object>
    <object name="Network - Antenna">
      <description>Antenna</description>
    </object>    
    <shape name="Circuit - NPN Transistor" />
  </contents>
</sheet>

The object and shape objects are to be identically processed, save the
optional intdata and chardata properties (for objects).
Each object or shape node is converted into a SheetObj structure and
registered in the relevant sheet. 
The description and icon elements override whatever could have previously
be given (in ObjectType or in ShapeInfo). 

index.sheet files are deprecated ; All shapes available are loaded, their
ObjectType registered ; I'll just need a routine to retrieve information
from the name_to_info hash (not really an issue, is it ?).

I have something working right now, but limited to binary objects. I think
I'll have shapes as well later this evening.

        --Cyrille

------------------------------------------------------------------------------
Grumpf.

Reply via email to