home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
sybase
/
starbuck
/
hpp.z
/
MMDATA.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-11-25
|
13KB
|
395 lines
#ifndef _MMDATA_HPP
#define _MMDATA_HPP
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,4);
#pragma enum int;
#endif
#include "mmdef.hpp"
struct MMSize {
int w; // width
int h; // height
};
/************************
*** Type definitions ***
************************/
#pragma enum int;
enum MMDataFlags {
MTF_None = 0x00000000,
MTF_TypeEnum = 0x00000001, // enumeration type
MTF_TypeDesignTime = 0x00000002, // type is available at DT
// component flags
MTF_ComponentNonVisual = 0x00000002, // component is not a WWindow
MTF_ComponentNeedClass = 0x00000004, // need GetRegisteredClass call
MTF_ComponentIsComponent = 0x00000008, // is a "Component"
MTF_ComponentInvisible = 0x00000010, // not a visible class
MTF_ComponentRequireForm = 0x00000020, // don't put it on a visual class
// parameter flags
MTF_ParmOptional = 0x00000020, // parameter not required
MTF_MethodCtor = 0x00000001, // method is constructor
MTF_MethodDtor = 0x00000002, // method is destructor
// property flags
MTF_PropRunTimeCode = 0x00000040, // code required to set
MTF_PropRunTimeOnly = 0x00000080, // not available at design time
MTF_PropStyle = 0x00000100, // a style property
MTF_PropRedrawRequired = 0x00000200, // changing property needs redraw
MTF_PropReadOnly = 0x00000400, // property is read-only
MTF_PropWriteOnly = 0x00000800, // property is write-only
MTF_PropSaved = 0x00001000, // property is saved to file?
MTF_PropMapped = 0x00002000, // not live at design time
MTF_PropExtended = 0x00004000, // extended style
MTF_PropClone = 0x00008000, // clone on set
// method flags
MTF_MethodDefaultRet = 0x00010000,
// object flags
MTF_ObjectPublish = 0x00020000,
// property control flags
MTF_PropCtrlStyle = 0x00040000, // property control for a style
MTF_PropCtrlHasPush = 0x00080000, // has associated command button
MTF_PropCtrlCheck = 0x00100000, // checkbox
MTF_PropCtrlRadio = 0x00200000, // radio button
MTF_PropCtrlCombo = 0x00300000, // combo box
MTF_PropCtrlEdit = 0x00400000, // edit box
MTF_PropCtrlTypeMask = 0x00700000, // mask bits for type
MTF_PropCtrlFirstOption = 0x00800000, // first option button in a group
MTF_PropCtrlLastOption = 0x01000000, // last option button in a group
// property sheet thunks
MTF_PropSheetThunkSnapped = 0x02000000, // reference resolved
MTF_HasNoRuntime = 0x04000000, // has a runtime
// reference item flags
MTF_RefItemComponent = 0x10000000, // MMComponent *
MTF_RefItemMethod = 0x20000000, // MMMethod *
MTF_RefItemStyle = 0x30000000, // MMStyle *
MTF_RefItemProperty = 0x40000000, // MMProperty *
MTF_RefItemTypeMask = 0x70000000,
// MMFunction flags
MTF_FunctionSnapped = 0x10000000, // string was snapped into pointer
MTF_EventOLE = 0x80000000, // event is an OLE event
MTF_LibraryOLE = 0x80000000, // library is an OLE library
};
#pragma enum pop;
/********************
*** MMCommonData ***
********************/
struct MMCommonData {
MMIndex index; // index of this object
MMString name; // NULL is invalid
MMDataFlags flags; // bit-field of flags
};
/**********************
*** MMFunctionData ***
**********************/
typedef void (*MMFnPtr)();
struct MMFunctionData {
MMFnPtr function;
MMString name; // NULL is invalid
MMDataFlags flags; // bit-field of flags
MMString libraryName;// may not be valid if already snapped
};
/**********************
*** MMBaseTypeData ***
**********************/
struct MMBaseTypeData : public MMCommonData { // 12
};
/************************
*** MMEnumeratorData ***
************************/
struct MMEnumeratorData : public MMCommonData { // 16
WDWord value;
};
/******************
*** MMTypeData ***
******************/
struct MMTypeData : public MMBaseTypeData { // 28
unsigned numValues; // number of enumerators
MMIndex firstValue; // index of the first one
MMString browseName; // name for browse button
MMDTTypeFnIndex makeFn; // function to make type
MMString typeName; // the friendly name of the DT-Type class
};
/*******************
*** MMEventData ***
*******************/
struct MMEventData : public MMCommonData {
MMString eventIdentifier;
MMString eventStruct;
MMString description;
unsigned numParameterSets;
MMIndex parameterSets; // (MMParameterSetData *)
};
/***********************
*** MMParameterData ***
***********************/
struct MMParameterData : public MMCommonData {
MMIndex type; // (MMTypeData *)required -- not NULL
MMString defVal; // default value as text
};
/**************************
*** MMParameterSetData ***
**************************/
struct MMParameterSetData : public MMCommonData {
MMIndex returnType; // (MMTypeData *)
unsigned numParameters;
MMIndex parameters; // (MMParameterData *)
};
/****************
*** MMHelpID ***
****************/
struct MMHelpID {
MMString file;
WHelpType command;
WDWord data;
};
/**************************
*** MMBasePropertyData ***
**************************/
struct MMBasePropertyData : public MMCommonData {
MMIndex type; // (MMTypeData *) pointer to type resolved later
MMSetFnIndex setFn; // (MMSetPropFn)
MMGetFnIndex getFn; // (MMGetPropFn)
MMPropDefFnIndex defFn; // (MMPropDefault)
WLong defCookie; // default cookie
WLong priority;
};
/*******************
*** MMStyleData ***
*******************/
struct MMStyleData : public MMBasePropertyData {
WStyle style;
WStyle mask;
MMString resString;
};
/**********************
*** MMPropertyData ***
**********************/
struct MMPropertyData : public MMBasePropertyData {
unsigned numParameterSets;
MMIndex parameterSets; //(MMParameterSetData *)
MMHelpID helpID;
MMString defaultMapped; // initial value if deferred
MMPropMakeEditorFnIndex makeEditorFn; // (MMPropMakeEditor)
};
/********************
*** MMMethodData ***
********************/
struct MMMethodData : public MMCommonData {
unsigned numParameterSets;
MMIndex parameterSets; // (MMParameterSetData *)
MMHelpID helpID;
};
/*****************************
*** MMPropertyControlData ***
*****************************/
struct MMPropertyControlData : public MMCommonData {
WDWord resourceID;
MMIndex property; // (const MMBasePropertyData *)
MMPropCtrlFnIndex makeControl; // (MMMakePropControl)
WLong priority;
};
/***************************
*** MMPropertyGroupData ***
***************************/
struct MMPropertyGroupData : public MMCommonData {
MMString description;
MMIndex firstControl;
WUInt numControl;
};
/****************************
*** MMPropertySheetThunk ***
****************************/
struct MMPropertySheetThunk : public MMCommonData {
MMString component;
MMString sheet;
MMIndex snapped;
};
/***************************
*** MMPropertySheetData ***
***************************/
struct MMPropertySheetData : public MMCommonData {
MMPropSheetFnIndex makeSheet; // (MMMakePropSheet)
MMString desc;
WDWord resourceID;
WUInt numCtrls;
MMIndex ctrls; // (const MMPropertyControlData *)
WUInt numGroups;
MMIndex firstGroup;
};
/***************************
*** MMReferenceNodeData ***
***************************/
struct MMReferenceNodeData : public MMCommonData {
MMIndex item; // (const MMCommonData *)
MMIndex sibling; // (const MMReferenceNodeData *)
MMIndex child; // (const MMReferenceNodeData *)
};
/***********************
*** MMComponentData ***
***********************/
enum MMComponentDataSets {
MMCDS_Events, //(const MMEventData *)
MMCDS_HotEvents, //(const MMEventData *)
MMCDS_Styles, //(const MMStyleData *)
MMCDS_Properties, //(const MMPropertyData *)
MMCDS_Methods, //(const MMMethodData *)
MMCDS_PropertySheets, //(const MMPropertySheetData *)
MMCDS_Includes, // MMIndex *
MMCDS_DDXTypes, // MMIndex *
MMCDS_Last
};
struct MMComponentDataSet {
WUInt numElements;
MMIndex elements;
};
struct MMComponentData : public MMCommonData {
MMString desc;
MMString varname;
MMString toolPage;
MMString toolPalette;
WInt toolPriority;
MMString refTag;
MMString baseObject;
WDWord toolBitmaps[ 3 ];
MMComponentDataSet dataSets[ MMCDS_Last ];
MMIndex ddxProperty;//(const MMPropertyData *)
MMIndex refNodes; // full hierarchy
MMHelpID helpID;
WDWord nonVisualResID;
MMSize defSize; // default component size
MMDTInstFnIndex makeDT; // function index to make DTObj
MMString reserved;
};
/*********************
*** MMLibraryData ***
*********************/
enum MMLibraryDataSets {
MMDS_Enumerators,
MMDS_Types,
MMDS_Events,
MMDS_Styles,
MMDS_Properties,
MMDS_Methods,
MMDS_Parameters,
MMDS_ParameterSets,
MMDS_PropertyControls,
MMDS_PropertyGroups,
MMDS_PropertySheetThunks,
MMDS_PropertySheets,
MMDS_Components,
MMDS_ReferenceNodes,
MMDS_StringTables,
MMDS_Indices,
MMDS_Library,
MMDS_Last,
};
struct MMLibraryDataSet {
WUInt numElements;
MMOffset elements;
};
struct MMLibraryData : public MMCommonData {
MMLibraryDataSet dataSets[ MMDS_Last ];
//
WUInt numGblMethods;
MMIndex gblMethods;
MMIndex refRoot; // root of hierarchy
MMString refTag;
MMString description; // describe the library
WUInt numIncludes;
MMIndex includes; // (MMString *)
MMLanguage language; // Cpp or Java or ...
};
/***************************
*** Function Prototypes ***
***************************/
extern DTType * METAEXPORTDEF MMStyleGet( const DTObject *, const MMBaseProperty * );
extern WBool METAEXPORTDEF MMStyleSet( DTObject *, const DTType *,
const MMBaseProperty * );
extern MTPropertySheetBase * METAEXPORTDEF MakePropertySheet( const MMPropertySheet * );
extern MTPropertyControl * METAEXPORTDEF MakePropertyControl( const MMPropertyControl * );
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _MMDATA_HPP