Blender V2.61 - r43446
|
00001 00028 #ifndef NAN_INCLUDED_GlutKeyboardManager 00029 #define NAN_INCLUDED_GlutKeyboardManager 00030 00031 #include "MEM_NonCopyable.h" 00032 #include "MEM_SmartPtr.h" 00033 #include "GHOST_Types.h" 00034 00035 // inherit from GlutKeyboardHandler and installl the drawer in the singleton 00036 // class GlutKeyboardManager. 00037 00038 class GlutKeyboardHandler : public MEM_NonCopyable { 00039 public : 00040 00041 virtual 00042 void 00043 HandleKeyboard( 00044 GHOST_TKey key, 00045 int x, 00046 int y 00047 )= 0; 00048 00049 virtual 00050 ~GlutKeyboardHandler( 00051 ){}; 00052 }; 00053 00054 class GlutKeyboardManager : public MEM_NonCopyable{ 00055 00056 public : 00057 00058 static 00059 GlutKeyboardManager * 00060 Instance( 00061 ); 00062 00063 static 00064 void 00065 HandleKeyboard( 00066 GHOST_TKey key, 00067 int x, 00068 int y 00069 ); 00070 00071 void 00072 InstallHandler( 00073 GlutKeyboardHandler * 00074 ); 00075 00076 void 00077 ReleaseHandler( 00078 ); 00079 00080 ~GlutKeyboardManager( 00081 ); 00082 00083 private : 00084 00085 GlutKeyboardManager ( 00086 ) : 00087 m_handler (0) 00088 { 00089 }; 00090 00091 GlutKeyboardHandler * m_handler; 00092 00093 static MEM_SmartPtr<GlutKeyboardManager> m_s_instance; 00094 }; 00095 00096 00097 #endif 00098