2001-10-06 14:13:28 +00:00
|
|
|
#ifndef CXWINDOWSPRIMARYSCREEN_H
|
|
|
|
#define CXWINDOWSPRIMARYSCREEN_H
|
|
|
|
|
|
|
|
#include "KeyTypes.h"
|
|
|
|
#include "MouseTypes.h"
|
2001-11-11 21:15:30 +00:00
|
|
|
#include "CXWindowsScreen.h"
|
2001-10-06 14:13:28 +00:00
|
|
|
#include "IPrimaryScreen.h"
|
|
|
|
|
2001-11-11 21:15:30 +00:00
|
|
|
class CXWindowsPrimaryScreen : public CXWindowsScreen, public IPrimaryScreen {
|
2002-04-29 14:40:01 +00:00
|
|
|
public:
|
2001-10-06 14:13:28 +00:00
|
|
|
CXWindowsPrimaryScreen();
|
|
|
|
virtual ~CXWindowsPrimaryScreen();
|
|
|
|
|
|
|
|
// IPrimaryScreen overrides
|
2001-11-19 00:33:36 +00:00
|
|
|
virtual void run();
|
|
|
|
virtual void stop();
|
2001-10-06 14:13:28 +00:00
|
|
|
virtual void open(CServer*);
|
|
|
|
virtual void close();
|
|
|
|
virtual void enter(SInt32 xAbsolute, SInt32 yAbsolute);
|
2002-06-03 18:53:18 +00:00
|
|
|
virtual bool leave();
|
2002-06-01 19:26:11 +00:00
|
|
|
virtual void onConfigure();
|
2001-10-06 14:13:28 +00:00
|
|
|
virtual void warpCursor(SInt32 xAbsolute, SInt32 yAbsolute);
|
2002-04-27 14:19:53 +00:00
|
|
|
virtual void setClipboard(ClipboardID, const IClipboard*);
|
|
|
|
virtual void grabClipboard(ClipboardID);
|
2001-10-06 14:13:28 +00:00
|
|
|
virtual void getSize(SInt32* width, SInt32* height) const;
|
|
|
|
virtual SInt32 getJumpZoneSize() const;
|
2002-04-27 14:19:53 +00:00
|
|
|
virtual void getClipboard(ClipboardID, IClipboard*) const;
|
2002-04-30 17:48:11 +00:00
|
|
|
virtual KeyModifierMask getToggleMask() const;
|
2002-05-24 14:37:12 +00:00
|
|
|
virtual bool isLockedToScreen() const;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-04-29 14:40:01 +00:00
|
|
|
protected:
|
2001-11-11 21:15:30 +00:00
|
|
|
// CXWindowsScreen overrides
|
2002-06-03 13:45:30 +00:00
|
|
|
virtual void onOpenDisplay(Display*);
|
2002-05-27 16:22:59 +00:00
|
|
|
virtual CXWindowsClipboard*
|
|
|
|
createClipboard(ClipboardID);
|
2002-06-03 13:45:30 +00:00
|
|
|
virtual void onCloseDisplay(Display*);
|
|
|
|
virtual void onUnexpectedClose();
|
2002-05-27 16:22:59 +00:00
|
|
|
virtual void onLostClipboard(ClipboardID);
|
2001-11-11 21:15:30 +00:00
|
|
|
|
2002-04-29 14:40:01 +00:00
|
|
|
private:
|
2001-11-11 21:15:30 +00:00
|
|
|
void selectEvents(Display*, Window) const;
|
2002-05-27 18:30:13 +00:00
|
|
|
void doSelectEvents(Display*, Window) const;
|
2001-11-11 21:15:30 +00:00
|
|
|
void warpCursorNoLock(Display*,
|
|
|
|
SInt32 xAbsolute, SInt32 yAbsolute);
|
2001-10-06 14:13:28 +00:00
|
|
|
|
|
|
|
KeyModifierMask mapModifier(unsigned int state) const;
|
2002-04-26 17:38:01 +00:00
|
|
|
KeyID mapKey(XKeyEvent*) const;
|
2001-10-06 14:13:28 +00:00
|
|
|
ButtonID mapButton(unsigned int button) const;
|
|
|
|
|
2002-04-30 17:48:11 +00:00
|
|
|
void updateModifierMap(Display* display);
|
|
|
|
|
2002-05-03 11:26:44 +00:00
|
|
|
class CKeyEventInfo {
|
|
|
|
public:
|
|
|
|
int m_event;
|
|
|
|
Window m_window;
|
|
|
|
Time m_time;
|
|
|
|
KeyCode m_keycode;
|
|
|
|
};
|
|
|
|
static Bool findKeyEvent(Display*, XEvent* xevent, XPointer arg);
|
|
|
|
|
2002-04-29 14:40:01 +00:00
|
|
|
private:
|
2001-10-06 14:13:28 +00:00
|
|
|
CServer* m_server;
|
|
|
|
bool m_active;
|
2001-11-11 21:15:30 +00:00
|
|
|
Window m_window;
|
2002-04-26 20:12:55 +00:00
|
|
|
|
2002-05-04 18:33:48 +00:00
|
|
|
// note toggle keys that toggle on up/down (false) or on
|
2002-04-30 17:48:11 +00:00
|
|
|
// transition (true)
|
2002-05-04 18:33:48 +00:00
|
|
|
bool m_numLockHalfDuplex;
|
2002-04-26 20:12:55 +00:00
|
|
|
bool m_capsLockHalfDuplex;
|
2002-04-30 17:48:11 +00:00
|
|
|
|
|
|
|
// masks that indicate which modifier bits are for toggle keys
|
|
|
|
unsigned int m_numLockMask;
|
|
|
|
unsigned int m_capsLockMask;
|
|
|
|
unsigned int m_scrollLockMask;
|
2001-10-06 14:13:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|