home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / MMDATA.HPP < prev    next >
C/C++ Source or Header  |  1997-01-27  |  14KB  |  428 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. // If you modify MMData layout or MDReader output, up this version #!
  13. //
  14.  
  15. #define CURRENT_COMPDLL_VERSION (0xfeed0004)
  16.  
  17. struct MMSize {
  18.     int w;      // width
  19.     int h;      // height
  20. };
  21.  
  22. /************************
  23.  *** Type definitions ***
  24.  ************************/
  25.  
  26. #pragma enum int;
  27.  
  28. //
  29. // Talk to Ivan before adding to this enum.  I mean it.
  30. //
  31.  
  32. enum MMDataFlags {
  33.     MTF_None =                  0x00000000,
  34.  
  35.     MTF_TypeEnum =              0x00000001, // enumeration type
  36.     MTF_TypeDesignTime =        0x00000002, // type is available at DT
  37.  
  38.         // MMComponent flags
  39.     MTF_ComponentNonVisual =    0x00000001, // component is not a WWindow
  40.     MTF_ComponentNeedClass =    0x00000002, // need GetRegisteredClass call
  41.     MTF_ComponentIsComponent =  0x00000004, // is a "Component"
  42.     MTF_ComponentInvisible =    0x00000008, // not a visible class
  43.     MTF_ComponentRequireForm =  0x00000010, // don't put it on a visual class
  44.     MTF_ComponentEventOverride= 0x00000020, // event data structure overrides
  45.  
  46.  
  47.         // MMParameter flags
  48.     MTF_ParmOptional =          0x00000001, // parameter not required
  49.  
  50.         // MMProperty flags
  51.     MTF_PropRunTimeCode =       0x00000001, // code required to set
  52.     MTF_PropRunTimeOnly =       0x00000002, // not available at design time
  53.     MTF_PropStyle =             0x00000004, // a style property
  54.     MTF_PropRedrawRequired =    0x00000008, // changing property needs redraw
  55.     MTF_PropReadOnly =          0x00000010, // property is read-only
  56.     MTF_PropWriteOnly =         0x00000020, // property is write-only
  57.     MTF_PropSaved =             0x00000040, // property is saved to file?
  58.     MTF_PropMapped =            0x00000080, // not live at design time
  59.     MTF_PropExtended =          0x00000100, // extended style
  60.     MTF_PropClone =             0x00000200, // clone on set
  61.     MTF_PropFDXEnabled =        0x00000400, // property can be FDX enabled
  62.  
  63.         // MMMethod flags
  64.     MTF_MethodDefaultRet =      0x00000001,
  65.  
  66.         // MMEvent flags
  67.     MTF_EventOverride =         0x00000001, // event data structure overrides
  68.     MTF_EventOLE =              0x00000002, // event is an OLE event
  69.  
  70.         // MMPropertyControl flags
  71.     MTF_PropCtrlStyle =         0x00000001, // property control for a style
  72.     MTF_PropCtrlHasPush =       0x00000002, // has associated command button
  73.     MTF_PropCtrlFirstOption =   0x00000004, // first option button in a group
  74.     MTF_PropCtrlLastOption =    0x00000008, // last option button in a group
  75.     MTF_PropCtrlCustom =        0x00000010, // custom control
  76.     MTF_PropCtrlHalfWidth =     0x00000020, // takes full dialog width
  77.     MTF_PropCtrlCheck =         0x00100000, // checkbox
  78.     MTF_PropCtrlRadio =         0x00200000, // radio button
  79.     MTF_PropCtrlCombo =         0x00300000, // combo box
  80.     MTF_PropCtrlEdit =          0x00400000, // edit box
  81.     MTF_PropCtrlTypeMask =      0x00700000, // mask bits for type
  82.  
  83.         // MMPropertyGroup flags
  84.     MTF_PropGroupHasGroupbox =  0x00000001, // group displays a groupbox
  85.     MTF_PropGroupHalfWidth =    0x00000002, // group occupies full width
  86.  
  87.         // MMPropertySheet flags
  88.     MTF_PropSheetCustom =       0x00000001, // page is custom
  89.  
  90.         // MMPropertySheetThunk flags
  91.     MTF_PropSheetThunkSnapped = 0x00000001, // reference resolved
  92.  
  93.         // MMReferenceItem flags
  94.     MTF_RefItemComponent =      0x10000000, // MMComponent *
  95.     MTF_RefItemMethod =         0x20000000, // MMMethod *
  96.     MTF_RefItemStyle =          0x30000000, // MMStyle *
  97.     MTF_RefItemProperty =       0x40000000, // MMProperty *
  98.     MTF_RefItemTypeMask =       0x70000000,
  99.  
  100.         // MMFunction flags
  101.     MTF_FunctionSnapped =       0x00000001, // string was snapped into pointer
  102.  
  103.         // MMLibrary tags
  104.     MTF_LibraryOLE =            0x00000001, // library is an OLE library
  105.     MTF_HasNoRuntime =          0x00000002, // has a runtime
  106. };
  107.  
  108. #pragma enum pop;
  109.  
  110. /********************
  111.  *** MMCommonData ***
  112.  ********************/
  113.  
  114. struct MMCommonData {
  115.     MMIndex                 index;      // index of this object
  116.     MMString                name;       // NULL is invalid
  117.     MMDataFlags             flags;      // bit-field of flags
  118. };
  119.  
  120.  
  121. /**********************
  122.  *** MMFunctionData ***
  123.  **********************/
  124.  
  125. typedef void (*MMFnPtr)();
  126. struct MMFunctionData {
  127.     MMFnPtr                 function;
  128.     MMString                name;       // NULL is invalid
  129.     MMDataFlags             flags;      // bit-field of flags
  130.     MMString                libraryName;// may not be valid if already snapped
  131. };
  132.  
  133. /**********************
  134.  *** MMBaseTypeData ***
  135.  **********************/
  136.  
  137. struct MMBaseTypeData : public MMCommonData {           // 12
  138. };
  139.  
  140. /************************
  141.  *** MMEnumeratorData ***
  142.  ************************/
  143.  
  144. struct MMEnumeratorData : public MMCommonData {         // 16
  145.     WDWord                  value;
  146. };
  147.  
  148. /******************
  149.  *** MMTypeData ***
  150.  ******************/
  151.  
  152. struct MMTypeData : public MMBaseTypeData {             // 28
  153.     unsigned                numValues;      // number of enumerators
  154.     MMIndex                 firstValue;     // index of the first one
  155.     MMString                browseName;     // name for browse button
  156.     MMDTTypeFnIndex         makeFn;         // function to make type
  157.     MMString                typeName;       // the friendly name of the DT-Type class
  158. };
  159.  
  160. /*******************
  161.  *** MMEventData ***
  162.  *******************/
  163.  
  164. struct MMEventData : public MMCommonData {
  165.     MMString                eventIdentifier;
  166.     MMString                eventStruct;
  167.     MMString                description;
  168.     MMIndex                 firstEventOverride;
  169.     MMIndex                 parameterSets; // (MMParameterSetData *)
  170. };
  171.  
  172. /***************************
  173.  *** MMOverrideEventData ***
  174.  ***************************/
  175.  
  176. struct MMEventOverrideData : public MMCommonData {
  177.     MMIndex                 event;
  178.     MMIndex                 metaObject;
  179. };
  180.  
  181.  
  182. /***********************
  183.  *** MMParameterData ***
  184.  ***********************/
  185.  
  186. struct MMParameterData : public MMCommonData {
  187.     MMIndex                 type;       // (MMTypeData *)required -- not NULL
  188.     MMString                defVal;     // default value as text
  189. };
  190.  
  191. /**************************
  192.  *** MMParameterSetData ***
  193.  **************************/
  194.  
  195. struct MMParameterSetData : public MMCommonData {
  196.     MMIndex     returnType;             // (MMTypeData *)
  197.     unsigned    numParameters;
  198.     MMIndex     parameters;             // (MMParameterData *)
  199. };
  200.  
  201. /****************
  202.  *** MMHelpID ***
  203.  ****************/
  204.  
  205. struct MMHelpID {
  206.     MMString    file;
  207.     WHelpType   command;
  208.     WDWord      data;
  209. };
  210.  
  211. /**************************
  212.  *** MMBasePropertyData ***
  213.  **************************/
  214.  
  215. struct MMBasePropertyData : public MMCommonData {
  216.     MMIndex             type;   // (MMTypeData *) pointer to type resolved later
  217.     MMSetFnIndex        setFn;  // (MMSetPropFn)
  218.     MMGetFnIndex        getFn;  // (MMGetPropFn)
  219.     MMPropDefFnIndex    defFn;  // (MMPropDefault)
  220.     WLong               defCookie;  // default cookie
  221.     WLong               priority;
  222.     WLong               contextHelpID;
  223. };
  224.  
  225. /*******************
  226.  *** MMStyleData ***
  227.  *******************/
  228.  
  229. struct MMStyleData : public MMBasePropertyData {
  230.     WStyle          style;
  231.     WStyle          mask;
  232.     MMString        resString;
  233. };
  234.  
  235.  
  236. /**********************
  237.  *** MMPropertyData ***
  238.  **********************/
  239.  
  240. struct MMPropertyData : public MMBasePropertyData {
  241.     unsigned                    numParameterSets;
  242.     MMIndex                     parameterSets;  //(MMParameterSetData *)
  243.     MMHelpID                    helpID;
  244.     MMString                    defaultMapped;  // initial value if deferred
  245.     MMPropMakeEditorFnIndex     makeEditorFn;   // (MMPropMakeEditor)
  246. };
  247.  
  248. /********************
  249.  *** MMMethodData ***
  250.  ********************/
  251.  
  252. struct MMMethodData : public MMCommonData {
  253.     unsigned        numParameterSets;
  254.     MMIndex         parameterSets; // (MMParameterSetData *)
  255.     MMHelpID        helpID;
  256. };
  257.  
  258. /*****************************
  259.  *** MMPropertyControlData ***
  260.  *****************************/
  261.  
  262. struct MMPropertyControlData : public MMCommonData {
  263.     WDWord                      resourceID;
  264.     MMIndex                     property;       // (const MMBasePropertyData *)
  265.     MMString                    label;
  266.     MMPropCtrlFnIndex           makeControl;    // (MMMakePropControl)
  267.     WLong                       priority;
  268. };
  269.  
  270. /***************************
  271.  *** MMPropertyGroupData ***
  272.  ***************************/
  273.  
  274. struct MMPropertyGroupData : public MMCommonData {
  275.     MMString                    description;
  276.     MMIndex                     firstControl;
  277.     WUInt                       numControl;
  278. };
  279.  
  280. /****************************
  281.  *** MMPropertySheetThunk ***
  282.  ****************************/
  283.  
  284. struct MMPropertySheetThunk : public MMCommonData {
  285.     MMString                component;
  286.     MMString                sheet;
  287.     MMIndex                 snapped;
  288. };
  289.  
  290. /***************************
  291.  *** MMPropertySheetData ***
  292.  ***************************/
  293.  
  294. struct MMPropertySheetData : public MMCommonData {
  295.     MMPropSheetFnIndex      makeSheet;  // (MMMakePropSheet)
  296.     MMString                desc;
  297.     WDWord                  resourceID;
  298.     WUInt                   numCtrls;
  299.     MMIndex                 ctrls;      // (const MMPropertyControlData *)
  300.     WUInt                   numGroups;
  301.     MMIndex                 firstGroup;
  302. };
  303.  
  304. /***************************
  305.  *** MMReferenceNodeData ***
  306.  ***************************/
  307.  
  308. struct MMReferenceNodeData : public MMCommonData {
  309.     MMIndex                 item;       // (const MMCommonData *)
  310.     MMIndex                 sibling;    // (const MMReferenceNodeData *)
  311.     MMIndex                 child;      // (const MMReferenceNodeData *)
  312. };
  313.  
  314.  
  315. /***********************
  316.  *** MMComponentData ***
  317.  ***********************/
  318.  
  319. enum MMComponentDataSets {
  320.     MMCDS_Events,               //(const MMEventData *)
  321.     MMCDS_HotEvents,            //(const MMEventData *)
  322.     MMCDS_Styles,               //(const MMStyleData *)
  323.     MMCDS_Properties,           //(const MMPropertyData *)
  324.     MMCDS_Methods,              //(const MMMethodData *)
  325.     MMCDS_PropertySheets,       //(const MMPropertySheetData *)
  326.     MMCDS_Includes,             // MMIndex *
  327.     MMCDS_DDXTypes,             // MMIndex *
  328.     MMCDS_Last
  329. };
  330.  
  331. struct MMComponentDataSet {
  332.     WUInt       numElements;
  333.     MMIndex     elements;
  334. };
  335.  
  336. struct MMComponentData : public MMCommonData {
  337.     MMString                    desc;
  338.     MMString                    varname;
  339.     MMString                    toolPage;
  340.     MMString                    toolPalette;
  341.     WInt                        toolPriority;
  342.     MMString                    refTag;
  343.     MMString                    baseObject;
  344.     WDWord                      toolBitmaps[ 3 ];
  345.  
  346.     MMComponentDataSet          dataSets[ MMCDS_Last ];
  347.  
  348.     MMIndex                     ddxProperty;//(const MMPropertyData *)
  349.     MMIndex                     refNodes;   // full hierarchy
  350.  
  351.     MMHelpID                    helpID;
  352.     WDWord                      nonVisualResID;
  353.  
  354.     MMSize                      defSize;    // default component size
  355.     MMDTInstFnIndex             makeDT;     // function index to make DTObj
  356.  
  357.     MMString                    reserved;
  358. };
  359.  
  360. /*********************
  361.  *** MMLibraryData ***
  362.  *********************/
  363.  
  364. enum MMLibraryDataSets {
  365.     MMDS_Enumerators,
  366.     MMDS_Types,
  367.     MMDS_Events,
  368.     MMDS_EventOverrides,
  369.     MMDS_Styles,
  370.     MMDS_Properties,
  371.     MMDS_Methods,
  372.     MMDS_Parameters,
  373.     MMDS_ParameterSets,
  374.     MMDS_PropertyControls,
  375.     MMDS_PropertyGroups,
  376.     MMDS_PropertySheetThunks,
  377.     MMDS_PropertySheets,
  378.     MMDS_Components,
  379.     MMDS_ReferenceNodes,
  380.     MMDS_StringTables,
  381.     MMDS_Indices,
  382.     MMDS_Library,
  383.     MMDS_Last,
  384. };
  385.  
  386. struct MMLibraryDataSet {
  387.     WUInt       numElements;
  388.     MMOffset    elements;
  389. };
  390.  
  391. struct MMLibraryData : public MMCommonData {
  392.     WULong                      compdllVersion;
  393.     WULong                      libVersion;
  394.     MMLibraryDataSet            dataSets[ MMDS_Last ];
  395.  
  396. //
  397.     WUInt                       numGblMethods;
  398.     MMIndex                     gblMethods;
  399.  
  400.     MMIndex                     refRoot;        // root of hierarchy
  401.     MMString                    refTag;
  402.     MMString                    description;    // describe the library
  403.  
  404.     WUInt                       numIncludes;
  405.     MMIndex                     includes;       // (MMString *)
  406.  
  407.     MMLanguage                  language;       // Cpp or Java or ...
  408. };
  409.  
  410.  
  411. /***************************
  412.  *** Function Prototypes ***
  413.  ***************************/
  414.  
  415. extern DTType *  METAEXPORTDEF MMStyleGet( const DTObject *, const MMBaseProperty * );
  416. extern WBool     METAEXPORTDEF MMStyleSet( DTObject *, const DTType *,
  417.                                    const MMBaseProperty * );
  418. extern MTPropertySheetBase * METAEXPORTDEF MakePropertySheet( const MMPropertySheet * );
  419. extern MTPropertyControl *   METAEXPORTDEF MakePropertyControl( const MMPropertyControl * );
  420.  
  421. #ifndef _WNO_PRAGMA_PUSH
  422. #pragma enum pop;
  423. #pragma pack(pop);
  424. #endif
  425.  
  426.  
  427. #endif // _MMDATA_HPP
  428.