12 #ifndef __PI_ClassManager_H__
13 #define __PI_ClassManager_H__
24 void addPI(
const char *
name,
void *cs);
25 void addSelector(
const char *
name,
void *
data,
void *cs);
28 {
return myPINames.entries(); }
30 {
return myPINames(i); }
32 {
return myPIConstructors(i); }
35 {
return mySelectorNames.entries(); }
37 {
return mySelectorNames(i); }
39 {
return mySelectorData(i); }
41 {
return mySelectorConstructors(i); }
54 class init { public: init(); int dummy; }; \
55 static init initializer;
57 #define PI_REGISTER(name, classname) \
58 classname::init classname::initializer; \
59 classname::init::init() \
60 { PIgetClassManager()->addPI(name, (void *)classname::ourConstructor); }
66 : myName(name), myData(data), myConstructor(constructor) { }
72 #define SELECTOR_SETUP() \
73 class init { public: init(); int dummy; }; \
74 static init initializer;
76 #define SELECTOR_REGISTER(name, data, classname)\
77 classname::init classname::initializer; \
78 classname::init::init() \
79 { PIgetClassManager()->addSelector(name, data, \
80 (void *)classname::ourConstructor); }
82 #define SELECTOR_SETUP_TABLE() \
83 class init { public: init(); int dummy; }; \
84 static init initializer;
86 #define SELECTOR_REGISTER_TABLE_BEGIN(classname) \
87 classname::init classname::initializer; \
88 classname::init::init() \
89 { PI_SelectorTable table[] = {
91 #define SELECTOR_REGISTER_TABLE_ENTRY(name, data, constructor) \
92 PI_SelectorTable(name, (void *)data, (void *)constructor),
94 #define SELECTOR_REGISTER_TABLE_END() \
95 PI_SelectorTable(0, 0, 0) }; \
96 for( int i = 0; table[i].myName; i++ ) \
97 PIgetClassManager()->addSelector(table[i].myName, \
99 table[i].myConstructor); }
122 myListTerminatorFlag(1) {}
124 int menu_entry_index = -1)
125 : myGeometryType(geo_type),
126 myMenuEntryIndex(menu_entry_index),
127 myListTerminatorFlag(0) {}
void * getPIConstructor(int i) const
const char * getPIName(int i) const
PI_API PI_ClassManager * PIgetClassManager()
UT_Array< PI_GeometryType > PI_GeometryTypeArray
UT_ValArray< void * > mySelectorData
UT_ValArray< const char * > myPINames
GLuint const GLchar * name
PI_SelectorTable(const char *name, void *data, void *constructor)
PI_GeometryType myGeometryType
const char * getSelectorName(int i) const
UT_ValArray< const char * > mySelectorNames
UT_ValArray< void * > myPIConstructors
PI_SelectionEntry(PI_GeometryType geo_type, int menu_entry_index=-1)
void * getSelectorConstructor(int i) const
void * getSelectorData(int i) const
int getNumSelectors() const
UT_ValArray< void * > mySelectorConstructors