Blender  V2.59
GlutMouseManager.h
Go to the documentation of this file.
00001 
00029 #ifndef NAN_INCLUDED_GlutMouseManager_h
00030 #define NAN_INCLUDED_GlutMouseManager_h
00031 
00032 #include "MEM_NonCopyable.h"
00033 #include "MEM_SmartPtr.h"
00034 #include "GHOST_Types.h"
00035 
00036 class GHOST_IWindow;
00037 
00038 class GlutMouseHandler {
00039 public :
00040 
00041         virtual         
00042                 void
00043         ButtonUp(
00044                 GHOST_IWindow * window,
00045                 GHOST_TButtonMask button_mask,
00046                 int x,
00047                 int y
00048         ) = 0;
00049 
00050         virtual         
00051                 void
00052         ButtonDown(
00053                 GHOST_IWindow * window,
00054                 GHOST_TButtonMask button_mask,
00055                 int x,
00056                 int y
00057         ) = 0;
00058 
00059 
00060         virtual
00061                 void
00062         Motion(
00063                 GHOST_IWindow * window,
00064                 int x,
00065                 int y
00066         ) = 0;
00067 
00068         virtual 
00069         ~GlutMouseHandler(
00070         ){};            
00071 };
00072 
00073 class GlutMouseManager : public MEM_NonCopyable{
00074 
00075 public :
00076 
00077         static
00078                 GlutMouseManager *
00079         Instance(
00080         );
00081 
00082         static
00083                 void
00084         ButtonUp(
00085                 GHOST_IWindow * window,
00086                 GHOST_TButtonMask button_mask,
00087                 int x,
00088                 int y
00089         );
00090 
00091         static
00092                 void
00093         ButtonDown(
00094                 GHOST_IWindow * window,
00095                 GHOST_TButtonMask button_mask,
00096                 int x,
00097                 int y
00098         );
00099 
00100         static
00101                 void
00102         Motion(
00103                 GHOST_IWindow * window,
00104                 int x,
00105                 int y
00106         );
00107 
00108                 void
00109         InstallHandler(
00110                 GlutMouseHandler *
00111         );
00112 
00113                 void
00114         ReleaseHandler(
00115         );
00116 
00117         ~GlutMouseManager(
00118         );
00119 
00120 private :
00121 
00122         GlutMouseManager (
00123         ) :
00124                 m_handler (0)
00125         {
00126         };
00127         
00128         GlutMouseHandler * m_handler;
00129 
00130         static MEM_SmartPtr<GlutMouseManager> m_s_instance;
00131 };      
00132 
00133 
00134 #endif
00135