Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

CXWindowsEventQueueBuffer.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2004 Chris Schoeneman
00004  * 
00005  * This package is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * found in the file COPYING that should have accompanied this file.
00008  * 
00009  * This package is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
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     // IEventQueueBuffer overrides
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

Generated on Fri Nov 6 00:21:14 2009 for synergy-plus by  doxygen 1.3.9.1