2004-01-24 16:09:25 +00:00
|
|
|
/*
|
|
|
|
* synergy -- mouse and keyboard sharing utility
|
|
|
|
* Copyright (C) 2004 Chris Schoeneman
|
|
|
|
*
|
|
|
|
* This package is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* found in the file COPYING that should have accompanied this file.
|
|
|
|
*
|
|
|
|
* This package is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
2004-02-14 14:04:36 +00:00
|
|
|
#ifndef CXWINDOWSEVENTQUEUEBUFFER_H
|
|
|
|
#define CXWINDOWSEVENTQUEUEBUFFER_H
|
2004-01-24 16:09:25 +00:00
|
|
|
|
2004-02-14 14:04:36 +00:00
|
|
|
#include "IEventQueueBuffer.h"
|
2004-01-24 16:09:25 +00:00
|
|
|
#if defined(X_DISPLAY_MISSING)
|
|
|
|
# error X11 is required to build synergy
|
|
|
|
#else
|
|
|
|
# include <X11/Xlib.h>
|
|
|
|
#endif
|
|
|
|
|
2004-02-14 14:04:36 +00:00
|
|
|
//! Event queue buffer for X11
|
|
|
|
class CXWindowsEventQueueBuffer : public IEventQueueBuffer {
|
2004-01-24 16:09:25 +00:00
|
|
|
public:
|
2004-02-14 14:04:36 +00:00
|
|
|
CXWindowsEventQueueBuffer(Display*, Window);
|
|
|
|
virtual ~CXWindowsEventQueueBuffer();
|
2004-01-24 16:09:25 +00:00
|
|
|
|
2004-02-14 14:04:36 +00:00
|
|
|
// IEventQueueBuffer overrides
|
2004-01-24 16:09:25 +00:00
|
|
|
virtual void waitForEvent(double timeout);
|
2004-02-14 14:04:36 +00:00
|
|
|
virtual Type getEvent(CEvent& event, UInt32& dataID);
|
|
|
|
virtual bool addEvent(UInt32 dataID);
|
|
|
|
virtual bool isEmpty() const;
|
2004-01-24 16:09:25 +00:00
|
|
|
virtual CEventQueueTimer*
|
2004-02-14 14:04:36 +00:00
|
|
|
newTimer(double duration, bool oneShot) const;
|
|
|
|
virtual void deleteTimer(CEventQueueTimer*) const;
|
2004-01-24 16:09:25 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Display* m_display;
|
|
|
|
Window m_window;
|
|
|
|
Atom m_userEvent;
|
|
|
|
XEvent m_event;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|