00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CXWINDOWSEVENTQUEUEBUFFER_H
00016 #define CXWINDOWSEVENTQUEUEBUFFER_H
00017
00018 #include "IEventQueueBuffer.h"
00019 #include "CMutex.h"
00020 #include "stdvector.h"
00021 #if X_DISPLAY_MISSING
00022 # error X11 is required to build synergy
00023 #else
00024 # include <X11/Xlib.h>
00025 #endif
00026
00028 class CXWindowsEventQueueBuffer : public IEventQueueBuffer {
00029 public:
00030 CXWindowsEventQueueBuffer(Display*, Window);
00031 virtual ~CXWindowsEventQueueBuffer();
00032
00033
00034 virtual void waitForEvent(double timeout);
00035 virtual Type getEvent(CEvent& event, UInt32& dataID);
00036 virtual bool addEvent(UInt32 dataID);
00037 virtual bool isEmpty() const;
00038 virtual CEventQueueTimer*
00039 newTimer(double duration, bool oneShot) const;
00040 virtual void deleteTimer(CEventQueueTimer*) const;
00041
00042 private:
00043 void flush();
00044
00045 private:
00046 typedef std::vector<XEvent> CEventList;
00047
00048 CMutex m_mutex;
00049 Display* m_display;
00050 Window m_window;
00051 Atom m_userEvent;
00052 XEvent m_event;
00053 CEventList m_postedEvents;
00054 bool m_waiting;
00055 int m_pipefd[2];
00056 };
00057
00058 #endif