home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 10 / ioProg_10.iso / soft / optima / hpp.z / MMDATA.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-26  |  10.8 KB  |  354 lines

  1. #ifndef _MMDATA_HPP
  2. #define _MMDATA_HPP
  3.  
  4. #ifndef _WNO_PRAGMA_PUSH
  5. #pragma pack(push,4);
  6. #pragma enum int;
  7. #endif
  8.  
  9. #include "mmdef.hpp"
  10.  
  11.  
  12. struct MMSize {
  13.     int w;      // width
  14.     int h;      // height
  15. };
  16.  
  17. /************************
  18.  *** Type definitions ***
  19.  ************************/
  20.  
  21. enum MMDataFlags {
  22.     MTF_None =                  0x00000000,
  23.  
  24.     MTF_TypeEnum =              0x00000001, // enumeration type
  25.  
  26.         // component flags
  27.     MTF_ComponentNonVisual =    0x00000002, // component is not a WWindow
  28.     MTF_ComponentNeedClass =    0x00000004, // need GetRegisteredClass call
  29.     MTF_ComponentIsComponent =  0x00000008, // is a "Component"
  30.     MTF_ComponentInvisible =    0x00000010, // not a visible class
  31.  
  32.         // parameter flags
  33.     MTF_ParmOptional =          0x00000020, // parameter not required
  34.     MTF_MethodCtor =            0x00000001, // method is constructor
  35.     MTF_MethodDtor =            0x00000002, // method is destructor
  36.  
  37.         // property flags
  38.     MTF_PropRunTimeCode =       0x00000040, // code required to set
  39.     MTF_PropRunTimeOnly =       0x00000080, // not available at design time
  40.     MTF_PropStyle =             0x00000100, // a style property
  41.     MTF_PropRedrawRequired =    0x00000200, // changing property needs redraw
  42.     MTF_PropReadOnly =          0x00000400, // property is read-only
  43.     MTF_PropWriteOnly =         0x00000800, // property is write-only
  44.     MTF_PropSaved =             0x00001000, // property is saved to file?
  45.     MTF_PropMapped =            0x00002000, // not live at design time
  46.     MTF_PropExtended =          0x00004000, // extended style
  47.     MTF_PropClone =             0x00008000, // clone on set
  48.  
  49.         // method flags
  50.     MTF_MethodDefaultRet =      0x00010000,
  51.  
  52.         // object flags
  53.     MTF_ObjectPublish =         0x00020000,
  54.  
  55.         // property control flags
  56.     MTF_PropCtrlStyle =         0x00040000, // property control for a style
  57.     MTF_PropCtrlHasPush =       0x00080000, // has associated command button
  58.  
  59.     MTF_PropCtrlCheck =         0x00100000, // checkbox
  60.     MTF_PropCtrlRadio =         0x00200000, // radio button
  61.     MTF_PropCtrlCombo =         0x00300000, // combo box
  62.     MTF_PropCtrlEdit =          0x00400000, // edit box
  63.     MTF_PropCtrlTypeMask =      0x00700000, // mask bits for type
  64.     MTF_PropCtrlFirstOption =   0x00800000, // first option button in a group
  65.     MTF_PropCtrlLastOption =    0x01000000, // last option button in a group
  66.  
  67.         // property sheet thunks
  68.     MTF_PropSheetThunkSnapped = 0x02000000, // reference resolved
  69.  
  70.         // reference item flags
  71.     MTF_RefItemComponent =      0x10000000, // MMComponent *
  72.     MTF_RefItemMethod =         0x20000000, // MMMethod *
  73.     MTF_RefItemStyle =          0x30000000, // MMStyle *
  74.     MTF_RefItemProperty =       0x40000000, // MMProperty *
  75.     MTF_RefItemTypeMask =       0x70000000,
  76.  
  77.     MTF_EventOLE =              0x80000000, // event is an OLE event
  78.     MTF_LibraryOLE =            MTF_EventOLE, // library is an OLE library
  79. };
  80.  
  81.  
  82. /********************
  83.  *** MMCommonData ***
  84.  ********************/
  85.  
  86. struct MMCommonData {
  87.     MMIndex                 index;      // index of this object
  88.     MMString                name;       // NULL is invalid
  89.     MMDataFlags             flags;      // bit-field of flags
  90. };
  91.  
  92.  
  93.  
  94. /**********************
  95.  *** MMBaseTypeData ***
  96.  **********************/
  97.  
  98. struct MMBaseTypeData : public MMCommonData {           // 16
  99. };
  100.  
  101. /************************
  102.  *** MMEnumeratorData ***
  103.  ************************/
  104.  
  105. struct MMEnumeratorData : public MMCommonData {
  106.     WDWord                  value;
  107. };
  108.  
  109. /******************
  110.  *** MMTypeData ***
  111.  ******************/
  112.  
  113. struct MMTypeData : public MMBaseTypeData {
  114.     unsigned                numValues;      // number of enumerators
  115.     MMIndex                 firstValue;     // index of the first one
  116.     MMString                browseName;     // name for browse button
  117.     MMDTTypeFnIndex         makeFn;         // function to make type
  118. };
  119.  
  120. /*******************
  121.  *** MMEventData ***
  122.  *******************/
  123.  
  124. struct MMEventData : public MMCommonData {
  125.     MMString                eventIdentifier;
  126.     MMString                eventStruct;
  127.     MMString                description;
  128. };
  129.  
  130. /***********************
  131.  *** MMParameterData ***
  132.  ***********************/
  133.  
  134. struct MMParameterData : public MMCommonData {
  135.     MMIndex                 type;       // (MMTypeData *)required -- not NULL
  136.     MMString                defVal;     // default value as text
  137. };
  138.  
  139. /**************************
  140.  *** MMParameterSetData ***
  141.  **************************/
  142.  
  143. struct MMParameterSetData : public MMCommonData {
  144.     MMIndex     returnType;             // (MMTypeData *)
  145.     unsigned    numParameters;
  146.     MMIndex     parameters;             // (MMParameterData *)
  147. };
  148.  
  149. /**************************
  150.  *** MMBasePropertyData ***
  151.  **************************/
  152.  
  153. struct MMBasePropertyData : public MMCommonData {
  154.     MMIndex             type;   // (MMTypeData *) pointer to type resolved later
  155.     MMSetFnIndex        setFn;  // (MMSetPropFn)
  156.     MMGetFnIndex        getFn;  // (MMGetPropFn)
  157.     MMPropDefFnIndex    defFn;  // (MMPropDefault)
  158.     WLong               defCookie;  // default cookie
  159.     WLong               priority;
  160. };
  161.  
  162. /*******************
  163.  *** MMStyleData ***
  164.  *******************/
  165.  
  166. struct MMStyleData : public MMBasePropertyData {
  167.     WStyle          style;
  168.     WStyle          mask;
  169.     MMString        resString;
  170. };
  171.  
  172.  
  173. /****************
  174.  *** MMHelpID ***
  175.  ****************/
  176.  
  177. struct MMHelpID {
  178.     MMString    file;
  179.     WHelpType   command;
  180.     WDWord      data;
  181. };
  182.  
  183. /**********************
  184.  *** MMPropertyData ***
  185.  **********************/
  186.  
  187. struct MMPropertyData : public MMBasePropertyData {
  188.     unsigned        numParameterSets;
  189.     MMIndex         parameterSets;      //(MMParameterSetData *)
  190.     MMHelpID        helpID;
  191.     MMString        defaultMapped;
  192. };
  193.  
  194. /********************
  195.  *** MMMethodData ***
  196.  ********************/
  197.  
  198. struct MMMethodData : public MMCommonData {
  199.     unsigned        numParameterSets;
  200.     MMIndex         parameterSets; // (MMParameterSetData *)
  201.     MMHelpID        helpID;
  202. };
  203.  
  204. /*****************************
  205.  *** MMPropertyControlData ***
  206.  *****************************/
  207.  
  208. struct MMPropertyControlData : public MMCommonData {
  209.     WDWord                      resourceID;
  210.     MMIndex                     property;       // (const MMBasePropertyData *)
  211.     MMPropCtrlFnIndex           makeControl;    // (MMMakePropControl)
  212.     WLong                       priority;
  213. };
  214.  
  215. /****************************
  216.  *** MMPropertySheetThunk ***
  217.  ****************************/
  218.  
  219. struct MMPropertySheetThunk : public MMCommonData {
  220.     MMString                component;
  221.     MMString                sheet;
  222.     MMIndex                 snapped;
  223. };
  224.  
  225. /***************************
  226.  *** MMPropertySheetData ***
  227.  ***************************/
  228.  
  229. struct MMPropertySheetData : public MMCommonData {
  230.     MMPropSheetFnIndex      makeSheet;  // (MMMakePropSheet)
  231.     MMString                desc;
  232.     WDWord                  resourceID;
  233.     unsigned                numCtrls;
  234.     MMIndex                 ctrls;      // (const MMPropertyControlData *)
  235. };
  236.  
  237. /***************************
  238.  *** MMReferenceNodeData ***
  239.  ***************************/
  240.  
  241. struct MMReferenceNodeData : public MMCommonData {
  242.     MMIndex                 item;       // (const MMCommonData *)
  243.     MMIndex                 sibling;    // (const MMReferenceNodeData *)
  244.     MMIndex                 child;      // (const MMReferenceNodeData *)
  245. };
  246.  
  247.  
  248. /***********************
  249.  *** MMComponentData ***
  250.  ***********************/
  251.  
  252. enum MMComponentDataSets {
  253.     MMCDS_Events,               //(const MMEventData *)
  254.     MMCDS_HotEvents,            //(const MMEventData *)
  255.     MMCDS_Styles,               //(const MMStyleData *)
  256.     MMCDS_Properties,           //(const MMPropertyData *)
  257.     MMCDS_Methods,              //(const MMMethodData *)
  258.     MMCDS_PropertySheets,       //(const MMPropertySheetData *)
  259.     MMCDS_Includes,             // MMIndex *
  260.     MMCDS_DDXTypes,             // MMIndex *
  261.     MMCDS_Last
  262. };
  263.  
  264. struct MMComponentDataSet {
  265.     WUInt       numElements;
  266.     MMIndex     elements;
  267. };
  268.  
  269. struct MMComponentData : public MMCommonData {
  270.     MMString                    desc;
  271.     MMString                    varname;
  272.     MMString                    toolPage;
  273.     WInt                        toolPriority;
  274.     MMString                    refTag;
  275.     MMString                    baseObject;
  276.     WDWord                      toolBitmaps[ 3 ];
  277.  
  278.     MMComponentDataSet          dataSets[ MMCDS_Last ];
  279.  
  280.     MMIndex                     ddxProperty;//(const MMPropertyData *)
  281.     MMIndex                     refNodes;   // full hierarchy
  282.  
  283.     MMHelpID                    helpID;
  284.     WDWord                      nonVisualResID;
  285.  
  286.     MMSize                      defSize;    // default component size
  287.     MMDTInstFnIndex             makeDT;     // function index to make DTObj
  288.     MMFindPropFnIndex           findProp;   // find a property
  289.     MMFindPropFnIndex           findStyle;  // find a style
  290. };
  291.  
  292. /*********************
  293.  *** MMLibraryData ***
  294.  *********************/
  295.  
  296. enum MMLibraryDataSets {
  297.     MMDS_Enumerators,
  298.     MMDS_Types,
  299.     MMDS_Events,
  300.     MMDS_Styles,
  301.     MMDS_Properties,
  302.     MMDS_Methods,
  303.     MMDS_Parameters,
  304.     MMDS_ParameterSets,
  305.     MMDS_PropertyControls,
  306.     MMDS_PropertySheetThunks,
  307.     MMDS_PropertySheets,
  308.     MMDS_Components,
  309.     MMDS_ReferenceNodes,
  310.     MMDS_StringTables,
  311.     MMDS_Indices,
  312.     MMDS_Library,
  313.     MMDS_Last,
  314. };
  315.  
  316. struct MMLibraryDataSet {
  317.     WUInt       numElements;
  318.     MMOffset    elements;
  319. };
  320.  
  321. struct MMLibraryData : public MMCommonData {
  322.     MMLibraryDataSet            dataSets[ MMDS_Last ];
  323.  
  324. //
  325.     WUInt                       numGblMethods;
  326.     MMIndex                     gblMethods;
  327.  
  328.     MMIndex                     refRoot;        // root of hierarchy
  329.     MMString                    refTag;
  330.     MMString                    description;    // describe the library
  331.  
  332.     WUInt                       numIncludes;
  333.     MMIndex                     includes;       // (MMString *)
  334. };
  335.  
  336.  
  337. /***************************
  338.  *** Function Prototypes ***
  339.  ***************************/
  340.  
  341. extern DTType *  METADEF MMStyleGet( const DTObject *, const MMBaseProperty * );
  342. extern WBool     METADEF MMStyleSet( DTObject *, const DTType *,
  343.                                    const MMBaseProperty * );
  344. extern MTPropertySheetBase * METADEF MakePropertySheet( const MMPropertySheet * );
  345. extern MTPropertyControl *   METADEF MakePropertyControl( const MMPropertyControl * );
  346.  
  347. #ifndef _WNO_PRAGMA_PUSH
  348. #pragma enum pop;
  349. #pragma pack(pop);
  350. #endif
  351.  
  352.  
  353. #endif // _MMDATA_HPP
  354.