Annotation of Amaya/amaya/templates.h, revision 1.5

1.1       francesc    1: #ifndef TEMPLATE_TEMPLATES
                      2: #define TEMPLATE_TEMPLATES
                      3: 
                      4: #define THOT_EXPORT extern
                      5: #include "amaya.h"
                      6: #include "document.h"
1.2       francesc    7: #include "mydictionary.h"
1.1       francesc    8: 
1.5     ! quint       9: #define UNION_ANY            "any"
        !            10: #define UNION_ANYCOMPONENT   "anyComponent"
        !            11: #define UNION_ANYSIMPLE      "anySimple"
        !            12: #define UNION_ANYELEMENT     "anyElement"
        !            13: #define UNION_ANY_DEFINITION "anyComponent anySimple anyElement"
1.1       francesc   14: 
1.5     ! quint      15: #define TYPE_NUMBER          "number"
        !            16: #define TYPE_STRING          "string"
        !            17: #define TYPE_BOOLEAN         "boolean"
1.4       francesc   18: 
1.5     ! quint      19: //The predefined library id
        !            20: #define PREDEFINED_LIB "-Predefined-"
        !            21: 
        !            22: //Type natures
        !            23: #define COMPONENT   0
        !            24: #define SIMPLE_TYPE 1
        !            25: #define XMLELEMENT  2
        !            26: #define UNION       3
        !            27: 
        !            28: //Simple type ids
        !            29: #define XTIGER_NUMBER  0
        !            30: #define XTIGER_STRING  1
        !            31: #define XTIGER_BOOLEAN 2
        !            32: //And for future issues
        !            33: #define XTIGER_CUSTOM  3
        !            34: 
        !            35: #define THOT_EXPORT extern
        !            36: #include "amaya.h"
        !            37: #include "document.h"
        !            38: #include "mydictionary.h"
        !            39: 
        !            40: /* Structure of a template */
        !            41: struct _XTigerTemplate;
        !            42: typedef struct _XTigerTemplate *XTigerTemplate;
        !            43: 
        !            44: /* Structure of a declaration */
        !            45: struct _Declaration;
        !            46: typedef struct _Declaration *Declaration;
        !            47: 
        !            48: typedef int SimpleTypeType;
        !            49: 
        !            50: //Private structure of a template
        !            51: struct _XTigerTemplate
        !            52: {      
        !            53:   ThotBool        isLibrary;                   //Is this a library? (otherway it's a template)
        !            54:   ThotBool        isPredefined;   //Is this the predefined library
        !            55:   DicDictionary   libraries;                   //Imported libraries
        !            56:   DicDictionary   simpleTypes;         //All simple types declared in the document
        !            57:   DicDictionary   elements;                            //All element types declared in the document
        !            58:   DicDictionary   components;                  //All component types declared in the document
        !            59:   DicDictionary   unions;                                //All union types declared in the document
        !            60:   Document        doc;            //Use to store component structures
        !            61:   int             users;          //Number of documents using this template
        !            62: };
        !            63: 
        !            64: /* Structure of a Declaration */
        !            65: 
        !            66: //Just for clarity
        !            67: typedef int TypeNature;
        !            68: 
        !            69: typedef struct _XmlElement
        !            70: {
        !            71:        char    *name;
        !            72: } XmlElement;
        !            73: 
        !            74: typedef struct _SimpleType
        !            75: {
        !            76:        SimpleTypeType type;
        !            77: } SimpleType;
        !            78: 
        !            79: typedef struct _Component
        !            80: {
        !            81:        Element        content;
        !            82: } Component;
        !            83: 
        !            84: typedef struct _Union
        !            85: {
        !            86:        DicDictionary  include; //Dictionary<Declaration>
        !            87:        DicDictionary  exclude; //Dictionary<Declaration>
        !            88: } Union;
        !            89: 
        !            90: struct _Declaration
        !            91: {
        !            92:        char          *name;
        !            93:        TypeNature     nature;
        !            94:        XTigerTemplate declaredIn;
        !            95:        union
        !            96:        {
        !            97:                SimpleType   simpleType;
        !            98:                Component    componentType;
        !            99:                Union        unionType;
        !           100:                XmlElement   elementType;
        !           101:        };
        !           102: };
        !           103: 
        !           104: struct menuType
        !           105: {
        !           106:        char *label;
        !           107:        int   type;
        !           108: };
1.2       francesc  109: 
1.1       francesc  110: #endif /* TEMPLATE_TEMPLATES */
                    111: 

Webmaster