00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __BM_ResourceManager_H__
00024 #define __BM_ResourceManager_H__
00025
00026 #include "BM_API.h"
00027 #include <UT/UT_PtrArray.h>
00028 #include <UT/UT_String.h>
00029 #include <UT/UT_SymbolTable.h>
00030 #include <PI/PI_ResourceManager.h>
00031
00032 class BM_View;
00033 class BM_State;
00034 class BM_Handle;
00035 class BM_OpHandleLink;
00036 class BM_SceneManager;
00037 class BM_InputSelector;
00038
00039 typedef BM_State *(*BM_StateConstructor)(BM_View &, PI_StateTemplate &,
00040 BM_SceneManager *);
00041 typedef BM_Handle *(*BM_HandleConstructor)(BM_SceneManager &,
00042 PI_HandleTemplate &);
00043 typedef BM_OpHandleLink *(*BM_PIConstructor)(BM_SceneManager &,
00044 PI_PITemplate &);
00045 typedef BM_InputSelector*(*BM_SelectorConstructor)(BM_View &,
00046 PI_SelectorTemplate &);
00047
00048 class BM_API BM_ResourceManager : public PI_ResourceManager
00049 {
00050 public:
00051 BM_State *newState(BM_View &view,
00052 PI_StateTemplate &templ,
00053 BM_SceneManager *scene = 0) const;
00054 BM_State *newState(BM_View &view,
00055 const char *name, const char *type,
00056 BM_SceneManager *scene = 0) const;
00057 BM_State *newState(BM_View &view,
00058 PI_NetworkType nettype, int state_idx,
00059 BM_SceneManager *scene = 0) const;
00060
00061 BM_Handle *newHandle(BM_SceneManager &sm,
00062 const char *name) const;
00063 BM_OpHandleLink *newOpHandleLink(BM_SceneManager &sm,
00064 const char *name,
00065 const char *description) const;
00066 BM_InputSelector *newSelector(BM_View &view,
00067 const char *name) const;
00068
00069 void deleteState(BM_State *state);
00070 void deleteHandle(BM_Handle *handle);
00071 void deleteOpHandleLink(BM_OpHandleLink *link);
00072 void deleteSelector(BM_InputSelector *selector);
00073
00074 virtual void findVolatileKey(const char *volatile_hotkey_name,
00075 int &volatile_key,
00076 int &key_modifiers) const;
00077 virtual void updateViewports(int id, const char *opname,
00078 bool open_only = false) const;
00079 virtual void removePISettingsFromTables(OP_Operator &op_type);
00080
00081 static void startParmsCache();
00082 static void stopParmsCache();
00083
00084 static void lookupVolatileKey(const char *volatile_hotkey_name,
00085 int &volatile_key,
00086 int &key_modifiers);
00087
00088 protected:
00089 BM_ResourceManager();
00090 virtual ~BM_ResourceManager();
00091 };
00092
00093 BM_API extern BM_ResourceManager *BMgetResourceManager();
00094
00095 extern "C" {
00096 DLLEXPORT extern void newModelState(BM_ResourceManager *m);
00097 DLLEXPORT extern void newHandle(BM_ResourceManager *m);
00098 DLLEXPORT extern void newOpHandleLink(BM_ResourceManager *m);
00099 DLLEXPORT extern void newOpHandleBinding(BM_ResourceManager *m);
00100 DLLEXPORT extern void newSelector(BM_ResourceManager *m);
00101 };
00102
00103 #endif