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