glXEventHandler.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef EQ_GLXEVENTHANDLER_H
00019 #define EQ_GLXEVENTHANDLER_H
00020
00021 #include <eq/client/eventHandler.h>
00022 #include <eq/client/types.h>
00023 #include <eq/client/windowSystem.h>
00024
00025 #include <eq/net/connectionSet.h>
00026
00027 namespace eq
00028 {
00029 class GLXPipe;
00030 class Window;
00031 class GLXWindowEvent;
00032
00036 class GLXEventHandler : public EventHandler
00037 {
00038 public:
00039 class EventSet : public net::ConnectionSet, public base::Referenced
00040 {
00041 public:
00042 void notifyPerThreadDelete() { unref(); }
00043
00044 protected:
00045 virtual ~EventSet(){}
00046 };
00047
00049 static void dispatchOne();
00050
00052 static void dispatchAll();
00053
00055 static base::RefPtr< EventSet > getEventSet();
00056
00058 static void clearEventSet();
00059
00061 GLXEventHandler( GLXPipe* pipe );
00062
00064 virtual ~GLXEventHandler();
00065
00066 private:
00068 GLXPipe* const _pipe;
00069
00070 static void _handleEvents( X11ConnectionPtr connection );
00071
00073 static bool _dispatch( const int timeout );
00074
00075 void _processEvent( GLXWindowEvent& event, Pipe* pipe );
00076 uint32_t _getButtonState( XEvent& event );
00077 uint32_t _getButtonAction( XEvent& event );
00078 uint32_t _getKey( XEvent& event );
00079 };
00080
00082 typedef base::RefPtr< GLXEventHandler::EventSet > GLXEventSetPtr;
00084 }
00085
00086 #endif // EQ_GLXEVENTHANDLER_H
00087