2001-10-08 19:24:46 +00:00
|
|
|
#ifndef CXWINDOWSSECONDARYSCREEN_H
|
|
|
|
#define CXWINDOWSSECONDARYSCREEN_H
|
|
|
|
|
2001-10-24 22:33:24 +00:00
|
|
|
#include "CMutex.h"
|
2001-10-08 19:24:46 +00:00
|
|
|
#include "ISecondaryScreen.h"
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
|
|
|
|
class CThread;
|
|
|
|
|
|
|
|
class CXWindowsSecondaryScreen : public ISecondaryScreen {
|
|
|
|
public:
|
|
|
|
CXWindowsSecondaryScreen();
|
|
|
|
virtual ~CXWindowsSecondaryScreen();
|
|
|
|
|
|
|
|
// ISecondaryScreen overrides
|
|
|
|
virtual void open(CClient*);
|
|
|
|
virtual void close();
|
|
|
|
virtual void enter(SInt32 xAbsolute, SInt32 yAbsolute);
|
|
|
|
virtual void leave();
|
2001-10-25 21:40:29 +00:00
|
|
|
virtual void keyDown(KeyID, KeyModifierMask);
|
|
|
|
virtual void keyRepeat(KeyID, KeyModifierMask, SInt32 count);
|
|
|
|
virtual void keyUp(KeyID, KeyModifierMask);
|
|
|
|
virtual void mouseDown(ButtonID);
|
|
|
|
virtual void mouseUp(ButtonID);
|
|
|
|
virtual void mouseMove(SInt32 xAbsolute, SInt32 yAbsolute);
|
|
|
|
virtual void mouseWheel(SInt32 delta);
|
2001-10-08 19:24:46 +00:00
|
|
|
virtual void getSize(SInt32* width, SInt32* height) const;
|
|
|
|
virtual SInt32 getJumpZoneSize() const;
|
|
|
|
|
|
|
|
private:
|
2001-10-23 22:41:46 +00:00
|
|
|
Cursor createBlankCursor();
|
2001-10-08 19:24:46 +00:00
|
|
|
void eventThread(void*);
|
|
|
|
KeyCode mapKey(KeyID, KeyModifierMask) const;
|
|
|
|
unsigned int mapButton(ButtonID button) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
CClient* m_client;
|
|
|
|
CThread* m_eventThread;
|
|
|
|
Display* m_display;
|
|
|
|
int m_screen;
|
2001-10-23 22:41:46 +00:00
|
|
|
Window m_root;
|
2001-10-08 19:24:46 +00:00
|
|
|
Window m_window;
|
|
|
|
SInt32 m_w, m_h;
|
2001-10-24 22:33:24 +00:00
|
|
|
|
|
|
|
// X is not thread safe
|
|
|
|
CMutex m_mutex;
|
2001-10-08 19:24:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|