00001 #ifndef __FBBASE_H__
00002 #define __FBBASE_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00047 #include <kaydaradef.h>
00048
00049
00050
00051 #include <fbsdk/fblibrary.h>
00052
00053 #ifndef FBSDK_DLL
00054
00057 #define FBSDK_DLL K_DLLIMPORT
00058 #endif
00059
00060
00061 #include <fbsdk/fbplug.h>
00062 #include <fbsdk/fbarray.h>
00063 #include <fbsdk/fbstring.h>
00064 #include <fbsdk/fbproperties.h>
00065
00066 #ifdef _MSC_VER
00067 #pragma warning (disable: 4275) // 'int' : forcing value to bool 'true' or 'false' (performance warning)
00068 #pragma warning (disable: 4661) // no suitable definition provided for explicit template instantiation request
00069 #endif
00070
00071 K_FORWARD( IRegister );
00072 K_FORWARD( IError );
00073 K_FORWARD( IStore );
00074 K_FORWARD( IKtView );
00075 K_FORWARD( KEventBase );
00076 K_FORWARD( KGlobalNamedEvent );
00077
00078 #ifdef FBSDKUseNamespace
00079 namespace FBSDKNamespace {
00080 #endif
00081
00082 #ifndef FBINCLUDE
00083
00084 #else
00085 #endif
00086
00089 #define FB_DEFAULT_SDK_ICON "openreality_noicon.png"
00090
00091
00095 #define __FBClassInit mLocalPtr = NULL;
00096
00097
00101 #define __FBClassDeInit if (mLocalPtr) {delete mLocalPtr; mLocalPtr = NULL;}
00102
00103
00107 #define __FBClassInitSDKComponent( pObjectToWrappedIsAllocated ) \
00108 __FBClassInit; \
00109 mSDKComponent = pObjectToWrappedIsAllocated;
00110
00111
00115 #define __FBClassImplementation( ThisComponent,pInternalClassId ) \
00116 int ThisComponent::TypeInfo=__FBRegisterTypeInfo(pInternalClassId);\
00117 int ThisComponent::GetInternalClassId() { return pInternalClassId; }
00118
00119 #define __FBClassImplementationGroup( ThisComponent, pInternalClass ) \
00120 __FBClassImplementation( ThisComponent,pInternalClass::ClassId )\
00121 const char* ThisComponent::ClassGroupName = pInternalClass::ClassGroupName;
00122
00123
00128 FBSDK_DLL int __FBRegisterTypeInfo(int pInternalClassId);
00129
00134 FBSDK_DLL int __FBGetInternalClassId(int pTypeInfo);
00135
00140 FBSDK_DLL FBPlug* __FBObjectCreatorSub(HIObject pObject);
00141
00145 #define __FBClassDeclare( Name,Parent ) \
00146 friend FBSDK_DLL FBPlug* __FBObjectCreatorSub(HIObject pObject);\
00147 public: \
00148 \
00151 typedef Parent __FBParentClass;\
00152 \
00155 typedef Name __FBClassType;\
00156 \
00159 virtual const char* ClassName() override { return #Name; } \
00160 \
00164 virtual bool Is( int pTypeId ) override { return (pTypeId==TypeInfo) ? true : Parent::Is( pTypeId ); } \
00165 virtual int GetTypeId() override { return TypeInfo; } \
00166 \
00169 static int GetInternalClassId(); \
00170 \
00173 Data##Name* mLocalPtr; \
00174 virtual ~Name(); \
00175 static int TypeInfo; \
00176 \
00177 private:
00178
00182 #define __FBClassDeclareGroup( Name,Parent ) \
00183 __FBClassDeclare( Name,Parent )\
00184 public:\
00185 static const char* ClassGroupName; \
00186 \
00187 private:
00188
00189 FBSDK_DLL void __FBAddModelToScene( HIObject pObject );
00190 FBSDK_DLL void __FBRemoveModelFromScene( HIObject pObject );
00191
00195 #define FBStorableClassImplementation(ClassName, Type)\
00196 const char* ClassName::FbxGetObjectSubType(){ return #ClassName; }\
00197 HIObject RegisterStorable##ClassName##Create(HIObject , const char* pName, void* ){\
00198 ClassName* Class = new ClassName(pName);\
00199 Class->mAllocated = true;\
00200 if( Class->FBCreate() ){\
00201 __FBRemoveModelFromScene( Class->GetHIObject() ); \
00202 return Class->GetHIObject();\
00203 } else {\
00204 delete Class;\
00205 return NULL;}}\
00206 FBLibraryModule(ClassName##Storable){\
00207 FBString lGroup = "FbxStorable/";\
00208 lGroup += #Type;\
00209 FBRegisterObject(ClassName##R2, lGroup, #ClassName, "", RegisterStorable##ClassName##Create, true, NULL);}
00210
00214 #define FBElementClassImplementation(ClassName,IconFileName)\
00215 HIObject RegisterElement##ClassName##Create(HIObject , const char* pName, void* ){\
00216 ClassName* Class = new ClassName(pName);\
00217 Class->mAllocated = true;\
00218 if( Class->FBCreate() ){\
00219 __FBRemoveModelFromScene( Class->GetHIObject() ); \
00220 return Class->GetHIObject();\
00221 } else {\
00222 delete Class;\
00223 return NULL;}}\
00224 FBLibraryModule(ClassName##Element){\
00225 FBRegisterObject(ClassName##R2, "Browsing/Templates/Elements", #ClassName, "", RegisterElement##ClassName##Create, true, IconFileName);}
00226
00230 #define FBShadingElementClassImplementation(ClassName,IconFileName)\
00231 HIObject RegisterShadingElement##ClassName##Create(HIObject , const char* pName, void* ){\
00232 ClassName* Class = new ClassName(pName);\
00233 Class->mAllocated = true;\
00234 if( Class->FBCreate() ){\
00235 return Class->GetHIObject();\
00236 } else {\
00237 delete Class;\
00238 return NULL;}}\
00239 FBLibraryModule(ClassName##ShadingElement){\
00240 FBRegisterObject(ClassName##R2, "Browsing/Templates/Shading Elements", #ClassName, "", RegisterShadingElement##ClassName##Create, true, IconFileName);}
00241
00248 #define FBStorableClassDeclare(Name, Parent)\
00249 FBClassDeclare(Name, Parent);\
00250 public:\
00251 virtual const char* FbxGetObjectSubType() override; \
00252 \
00253 private: \
00254
00255
00263 #define FBPropertyInitComponent( Param,Type,PropName,Get,Set ) \
00264 { \
00265 PropertyAdd(PropName.Init( (void *)Param,#PropName,(Type* (*)(void *))Get,(void (*)(void *,Type*))Set )); \
00266 PropName.TypeInfo = &Type::TypeInfo; \
00267 }
00268
00276 #define FBIS( Component,ComponentType ) \
00277 ((Component) && (Component)->Is( ComponentType::TypeInfo ))
00278
00280
00282
00283 __FB_FORWARD( FBComponent );
00284 __FB_FORWARD( FBVisualComponent );
00285
00292 FBSDK_DLL FBComponent* GetFBComponent( const HIObject Object );
00293
00294 #if !defined(K_NO_UI)
00295
00300 FBSDK_DLL FBVisualComponent* FBGetFBVisualComponent( HIKtView pObject,bool pAutoCreate=true );
00301 #endif
00302
00308 FBSDK_DLL FBComponent* FBGetFBComponent( HIObject pObject, bool pAutoCreate=true );
00309
00315 FBSDK_DLL FBPlug* FBGetFBPlug( HIObject pObject, bool pAutoCreate=true );
00316
00318 typedef FBArrayTemplate<FBComponent*> FBComponentList;
00321 FBSDK_DLL FBArrayTemplate<FBComponent*>& FBGetComponentArray();
00322
00324
00326
00331 #define FBRegisterEvent ( Object, EventId, EventProc ) IQ( Object,IRegister)->Register ( EventId,(HICallback)this,(kICallbackHandler)EventProc );
00332
00336 #define FBUnregisterEvent ( Object, EventId, EventProc ) IQ( Object,IRegister)->Unregister ( EventId,(HICallback)this,(kICallbackHandler)EventProc );
00337
00342 FBSDK_DLL void FBSetStoreableCustomModelRegistered();
00343 FBSDK_DLL bool FBGetStoreableCustomModelRegistered();
00344
00349 FBSDK_DLL void FBSetStoreableCustomMaterialRegistered();
00350 FBSDK_DLL bool FBGetStoreableCustomMaterialRegistered();
00351
00356 FBSDK_DLL void FBSetStoreableCustomTextureRegistered();
00357 FBSDK_DLL bool FBGetStoreableCustomTextureRegistered();
00358
00359 FBSDK_DLL bool FBObject_Register ( const char * pGroupName,const char * pEntryName,const char * pDescription, kObjectCreatorFnc pCreatorFnc, bool pIsMultipleAllowed,const char * pIconFilename);
00360 FBSDK_DLL bool FBObject_Unregister( const char * pGroupName,const char * pEntryName, int nth=0 );
00361
00369 FBSDK_DLL FBComponent* FBCreateObject( const char* pGroupName, const char* pEntryName, const char* pName, void* pData = NULL, int nth = 0 );
00370
00376 inline bool FBUnregisterObject( const char * pGroupName, const char * pEntryName, int nth=0 ) { return FBObject_Unregister( pGroupName,pEntryName,nth ); }
00381 #define FBRegisterObject( LocalId,Path,Name,Description,Constructor,IsMultipleAllowed,IconFilename ) \
00382 static int __R##LocalId = FBObject_Register( Path,Name,Description,Constructor,IsMultipleAllowed,IconFilename )
00383
00384 typedef HIRegister HISender;
00386 typedef HKEventBase HKEvent;
00391 typedef void (ICallback::*FBCallback)(HISender pSender,HKEvent pEvent);
00392
00393 FBSDK_DLL int FBRegister_ClassId(const char* pClassName);
00398 #define FBDeclareUserObject(ClassName)\
00399 public:\
00400 static int ClassId;\
00401 virtual int GetUserClassId();\
00402 virtual const char* FbxGetObjectSubType() override;\
00403 \
00404 private:
00405
00407
00409 #ifdef new
00410
00413 #define RENEW new
00414 #undef new
00415 #endif
00416
00418
00420 FB_FORWARD( FBPropertyListComponent );
00421 __FB_FORWARD( FBComponent );
00422 FB_DEFINE_LIST( FBSDK_DLL, Component );
00423
00424 FB_FORWARD( FBFolder );
00425 FB_DEFINE_COMPONENT( FBSDK_DLL, Folder );
00426
00428 enum FBObjectFlag
00429 {
00430 kFBFlagSelectable = (1 << 0),
00431 kFBFlagDeletable = (1 << 1),
00432 kFBFlagSavable = (1 << 2),
00433 kFBFlagVisible = (1 << 3),
00434 kFBFlagClonable = (1 << 4),
00435 kFBFlagSystem = (1 << 5),
00436 kFBFlagNewable = (1 << 6),
00437 kFBFlagRenamable = (1 << 7),
00438 kFBFlagMergeable = (1 << 8),
00439 kFBFlagBrowsable = (1 << 9),
00440 kFBFlagParentable = (1 << 10),
00441 kFBFlagDetachable = (1 << 11),
00442 kFBFlagUndoable = (1 << 12),
00443 kFBFlagUndoableSeparately = (1 << 13),
00444 kFBFlagKeyable = (1 << 14),
00445 kFBFlagAllocated = (1 << 15),
00446 kFBFlagStory = (1 << 16),
00447 kFBFlagStorable6 = (1 << 17),
00448 kFBFlagStorableData6 = (1 << 18),
00449 kFBFlagStorableBlindData = (1 << 19),
00450 kFBFlagStorableBlindDataForceBinary = (1 << 20),
00451 kFBFlagUniqueName = (1 << 21),
00452 kFBFlagNotSelectableNameSpace = (1 << 22),
00453 kFBFlagNamespaceEditable = (1 << 23),
00454 };
00455
00456 K_DEPRECATED_2014 const int kFBFlagCustomObject = (1 << 24);
00457
00459 enum FBObjectStatus {
00460 kFBStatusCreating = (1 << 0),
00461 kFBStatusStoring = (1 << 1),
00462 kFBStatusRetrieving = (1 << 2),
00463 kFBStatusMerging = (1 << 3),
00464 kFBStatusDestroying = (1 << 4),
00465 };
00466
00468 K_DEPRECATED_2014 const int kFBStatusOwnedByUndo = (1 << 5);
00469
00471 enum FBNamespaceAction
00472 {
00473 kFBConcatNamespace,
00474 kFBReplaceNamespace,
00475 kFBRemoveAllNamespace
00476 };
00477
00478 FB_DEFINE_ENUM(FBSDK_DLL, ConnectionType);
00479 FB_DEFINE_ENUM(FBSDK_DLL, ConnectionAction);
00480 FB_DEFINE_ENUM(FBSDK_DLL, ObjectFlag);
00481
00484 class FBSDK_DLL FBPropertyListComponentBase : public FBPropertyBasicList
00485 {
00486 protected:
00488 int mClassId;
00490 bool mParents;
00491 public:
00493 FBPropertyListComponentBase();
00498 virtual int Add( FBComponent* pItem );
00502 virtual void RemoveAt( int pIndex );
00507 virtual FBComponent* GetAt(int pIndex)=0;
00512 FBComponent* operator[](int pIndex);
00516 virtual int GetCount();
00517
00522 virtual int Find( FBComponent* pItem );
00523
00528 virtual int Remove( FBComponent* pItem );
00529
00530
00531 void SetClassId( int pClassId );
00532 int GetClassId( );
00533 void SetListOfParents( bool pListOfParents );
00534 bool GetIsListOfParents();
00535
00539 virtual FBPropertyType GetPropertyType( ) override { return kFBPT_object; }
00540 };
00543 class FBSDK_DLL FBPropertyListComponent : public FBPropertyListComponentBase
00544 {
00545 public:
00550 virtual FBComponent* GetAt(int pIndex);
00551 };
00552
00554
00556
00557 FB_FORWARD( FBPropertyListObject );
00558
00563 class FBSDK_DLL FBPropertyListObject : public FBPropertyListComponent
00564 {
00565 public:
00567 FBPropertyListObject();
00568
00572 virtual int GetCount();
00573
00575
00579 virtual FBComponent* operator[]( int pIndex );
00580 virtual FBComponent* GetAt( int pIndex );
00582
00587 virtual int Add( FBComponent* pObject );
00588
00594 virtual int SetAt(int pIndex, FBComponent* pObject);
00595
00599 virtual void RemoveAt( int pIndex );
00600
00606 virtual int InsertAt(int pIndex, FBComponent* pObject);
00607
00610 virtual void Clear();
00611
00615 virtual void SetSingleConnect(bool pSingleConnect);
00616
00620 virtual int GetSingleConnect();
00621
00625 void SetFilter(int pInternalClassId);
00626
00630 int GetFilter();
00631
00632 private:
00634
00638 FBPropertyListObject( const FBPropertyListObject& );
00639 const FBPropertyListObject& operator =( const FBPropertyListObject& );
00641 };
00642
00643 __FB_FORWARD( FBNamespace );
00644 __FB_FORWARD( FBFileReference );
00645
00658 class FBSDK_DLL FBComponent : public FBPlug
00659 {
00660 public:
00661 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00662
00663 DataFBComponent* mLocalPtr;
00664 protected:
00666 FBString mName;
00667 #endif
00668
00669 public:
00671 static int TypeInfo;
00672
00676 static int GetInternalClassId();
00677
00681 FBComponent( HIObject pObject );
00682
00684 virtual ~FBComponent();
00685
00689 virtual bool FBCreate();
00690
00692 virtual void FBDestroy();
00693
00695 virtual void FBDelete() override;
00696
00698 virtual bool SetHIObject(HIObject pObject, bool pSDKComponent) override;
00699
00704 virtual int PropertyAdd( FBProperty* pProperty );
00705
00710 bool PropertyAddReferenceProperty( FBProperty* pReferenceProperty );
00711
00716 void PropertyRemove( FBProperty* pProperty );
00717
00722 void PropertyGetModifiedList(FBArrayTemplate<FBProperty*>& pPropList, FBPlugModificationFlag pModificationFlags);
00723
00732 FBProperty* PropertyCreate( const char* pName, FBPropertyType pType, const char * pDataType, bool pAnimatable, bool pIsUser = false, FBProperty* pReferenceSource = NULL );
00733
00737 FBObjectFlag GetObjectFlags();
00738
00742 void SetObjectFlags(FBObjectFlag pFlags);
00743
00748 bool HasObjectFlags(FBObjectFlag pFlags);
00749
00753 void EnableObjectFlags(FBObjectFlag pFlags);
00754
00758 void DisableObjectFlags(FBObjectFlag pFlags);
00759
00764 void SetObjectStatus(FBObjectStatus pStatus, bool pValue);
00765
00769 bool GetObjectStatus(FBObjectStatus pStatus);
00770
00781 bool ProcessNamespaceHierarchy( FBNamespaceAction pNamespaceAction, const char* pNamespaceName, const char* pReplaceTo=NULL, bool pAddRight=true );
00782
00793 bool ProcessObjectNamespace ( FBNamespaceAction pNamespaceAction, const char* pNamespaceName, const char* pReplaceTo=NULL, bool pAddRight=true );
00794
00798 virtual const char* ClassName() override;
00799
00804 virtual bool UseCustomPropertyViewSet() const { return true; }
00805
00809 const char* GetFullName( void );
00810
00813 void SetOwnerNamespace(FBNamespace* pOwnerNSObj);
00814
00818 FBNamespace* GetOwnerNamespace( void );
00819
00820
00824 FBFileReference* GetOwnerFileReference( void );
00825
00829 void HardSelect();
00830
00831 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00832
00833
00834 void *operator new( size_t stAllocateBlock );
00835 void operator delete( void *pvMem );
00836
00837 void *operator new( size_t stAllocateBlock, int blockType, const char *filename, int linenumber );
00838 #if _MSC_VER >= 1200
00839 void operator delete( void *pvMem, int blockType, const char *filename, int linenumber );
00840 #endif
00841
00842
00844
00845 void RegisterPropertyEvent(FBPropertyEvent* pPropertyEvent);
00846 void UnregisterPropertyEvent(FBPropertyEvent* pPropertyEvent);
00847 void InvalidatePropertyEventsParents();
00849 #endif
00850
00851 FBPropertyManager PropertyList;
00852 FBPropertyListComponent Components;
00853 FBPropertyListComponent Parents;
00854 FBPropertyBool Selected;
00855 FBPropertyString Name;
00856 FBPropertyString LongName;
00857
00858 #if !defined(K_NO_FOLDER)
00859 FBPropertyFolder Folder;
00860 #endif
00861
00862 public:
00863 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00864 IObject_Declare(K_IMPLEMENTATION);
00865 ICallback_Declare(K_IMPLEMENTATION);
00866 #endif
00867
00872 virtual bool Is( int pTypeId );
00873 virtual int GetTypeId();
00874
00875 static void FBComponentSetName( FBComponent* pObject, const char *pName );
00876 static const char* FBComponentGetName( FBComponent* pObject );
00877
00878 static void FBComponentSetLongName( FBComponent* pObject, const char *pName );
00879 static const char* FBComponentGetLongName( FBComponent* pObject );
00880
00881 public:
00882 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00883
00884 KObject* mDummyObject;
00885 void KObjectEvent(HIRegister pView, HKEventBase pEvent);
00886 #endif
00887 };
00888
00890 typedef FBComponent FBObject;
00891
00892 #ifdef RENEW
00893 #define new new( _NORMAL_BLOCK, __FILE__, __LINE__)
00894 #undef RENEW
00895 #endif
00896
00898
00900 __FB_FORWARD( FBEvent );
00901
00903 class FBSDK_DLL FBEvent
00904 {
00905 public:
00911 FBEvent( HKEvent pEvent );
00912
00913 FBPropertyInt Type;
00914 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00915 protected:
00917 HKEventBase mEvent;
00918 public:
00920 void PropertyAdd( FBProperty* ) {};
00921 #endif
00922 };
00923
00925
00927 __FB_FORWARD( FBEventConnectionNotify );
00928
00930 class FBSDK_DLL FBEventConnectionNotify : public FBEvent
00931 {
00932 public:
00936 FBEventConnectionNotify(HKEventBase pEvent);
00937
00938 FBPropertyConnectionAction Action;
00939 FBPropertyInt SrcIndex;
00940 FBPropertyConnectionType ConnectionType;
00941 FBPropertyPlug SrcPlug;
00942 FBPropertyPlug DstPlug;
00943 FBPropertyPlug NewPlug;
00944 };
00945
00947
00949 __FB_FORWARD( FBEventConnectionDataNotify );
00950
00952 class FBSDK_DLL FBEventConnectionDataNotify : public FBEvent
00953 {
00954 public:
00958 FBEventConnectionDataNotify(HKEventBase pEvent);
00959
00960 FBPropertyConnectionAction Action;
00961 FBPropertyPlug Plug;
00962 void* GetData();
00963 void* GetOldData();
00964 };
00965
00967
00969 __FB_FORWARD( FBEventConnectionStateNotify );
00970
00972 class FBSDK_DLL FBEventConnectionStateNotify : public FBEvent
00973 {
00974 public:
00978 FBEventConnectionStateNotify(HKEventBase pEvent);
00979
00980 FBPropertyConnectionAction Action;
00981 FBPropertyPlug Plug;
00982 void* GetData();
00983 void* GetOldData();
00984 };
00985
00987
00989 __FB_FORWARD( FBEventConnectionKeyingNotify );
00990
00991 class FBSDK_DLL FBEventConnectionKeyingNotify : public FBEvent
00992 {
00993 public:
00997 FBEventConnectionKeyingNotify(HKEventBase pEvent);
00998
01004 FBConnectionAction GetAction( void );
01005
01011 FBPlug* GetPlug( void );
01017 FBPlug* GetProperty( void );
01023 void* GetData( void );
01024 };
01025
01026
01028
01030
01034 class FBSDK_DLL FBLibraryBase : public ICallback
01035 {
01036 public:
01037 FBLibraryBase();
01038 virtual ~FBLibraryBase();
01039 IObject_Declare(K_IMPLEMENTATION);
01040 ICallback_Declare(K_IMPLEMENTATION);
01041
01046 virtual bool LibInit();
01047
01052 virtual bool LibOpen();
01053
01059 virtual bool LibReady();
01060
01064 virtual bool LibClose();
01065
01069 virtual bool LibRelease();
01071 KGlobalNamedEvent *mLibrary_Open,
01072 *mLibrary_Ready,
01073 *mLibrary_Close,
01074 *mLibrary_Release;
01075
01076 void Library_OpenHandler(HIRegister pCaller,HKEventBase pEvent);
01077 void Library_ReadyHandler(HIRegister pCaller,HKEventBase pEvent);
01078 void Library_CloseHandler(HIRegister pCaller,HKEventBase pEvent);
01079 void Library_ReleaseHandler(HIRegister pCaller,HKEventBase pEvent);
01080 };
01081
01083
01085
01089 class FBLibrary : public FBLibraryBase
01090 {
01091 public:
01096 virtual bool LibInit();
01097
01102 virtual bool LibOpen();
01103
01109 virtual bool LibReady();
01110
01114 virtual bool LibClose();
01115
01119 virtual bool LibRelease();
01120 };
01121
01125 #if defined(K_NODLL)
01126 #define FBLibraryDeclare( LibName ) \
01127 FB_DLL_INIT( LibName, Operation ) \
01128 { \
01129 switch( Operation ) \
01130 { \
01131 case kFBDllLoad: \
01132 { \
01133
01134 #else
01135 #define FBLibraryDeclare( LibName ) \
01136 static FBLibrary LibName##GlobalFBLibrary; \
01137 extern "C" { \
01138 K_DLLEXPORT bool LIBRARY_INIT(HIError ) \
01139 { \
01140 FB_EXT_INIT( LibName ); if (LibName##GlobalFBLibrary.LibInit()) return true; return false; \
01141 } \
01142 } \
01143 FB_DLL_INIT( LibName, Operation ) \
01144 { \
01145 switch( Operation ) \
01146 { \
01147 case kFBDllLoad: \
01148 {
01149 #endif
01150
01155 #define FBLibraryModule(Name) \
01156 void FBModule##Name()
01157
01162 #define FBLibraryRegister( ClassName ) \
01163 extern void FBModule##ClassName( ); \
01164 FBModule##ClassName( );
01165
01170 #define FBLibraryRegisterStorable( ClassName ) \
01171 extern void FBModule##ClassName##Storable( ); \
01172 FBModule##ClassName##Storable( );
01173
01178 #define FBLibraryRegisterElement( ClassName ) \
01179 extern void FBModule##ClassName##Element( ); \
01180 FBModule##ClassName##Element( );
01181
01186 #define FBLibraryRegisterShadingElement( ClassName ) \
01187 extern void FBModule##ClassName##ShadingElement( ); \
01188 FBModule##ClassName##ShadingElement( );
01189
01191 #define FBLibraryDeclareEnd \
01192 } \
01193 break; \
01194 default: \
01195 break; \
01196 } \
01197 }
01198
01199
01200
01204 #define FBCustomManagerImplementation( ThisComponent ) \
01205 FBClassImplementation( ThisComponent ) \
01206
01207
01210 #define FBRegisterCustomManager( ClassName ) \
01211 FBLibraryModule( ClassName ) \
01212 { \
01213 static ClassName g##ClassName; \
01214 g##ClassName.FBCreate(); \
01215 g##ClassName.RegisterManager(); \
01216 } \
01217
01218
01221 #define FBCustomManagerDeclare( ClassName ) \
01222 FBClassDeclare( ClassName, FBCustomManager ); \
01223 public: \
01224 ClassName() : FBCustomManager() { FBClassInit; } \
01225 \
01226 private:
01227
01228
01230
01232
01233 __FB_FORWARD( FBCustomManager );
01234
01247 class FBSDK_DLL FBCustomManager : public FBComponent {
01248 __FBClassDeclare( FBCustomManager, FBComponent );
01249 public:
01252 FBCustomManager();
01253
01258 void RegisterManager();
01259
01263 virtual bool FBCreate();
01264
01271 virtual bool Init() ;
01272
01278 virtual bool Open() ;
01279
01284 virtual bool Clear() ;
01285
01289 virtual bool Close() ;
01290
01291 };
01292
01293
01294 #ifdef FBSDKUseNamespace
01295 }
01296 #endif
01297
01298 #endif