barrier/server/CXWindowsPrimaryScreen.h

76 lines
2.1 KiB
C
Raw Normal View History

2001-10-06 14:13:28 +00:00
#ifndef CXWINDOWSPRIMARYSCREEN_H
#define CXWINDOWSPRIMARYSCREEN_H
#include "KeyTypes.h"
#include "MouseTypes.h"
#include "CXWindowsScreen.h"
2001-10-06 14:13:28 +00:00
#include "IPrimaryScreen.h"
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
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);
virtual void leave();
virtual void warpCursor(SInt32 xAbsolute, SInt32 yAbsolute);
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;
virtual void getClipboard(ClipboardID, IClipboard*) const;
virtual KeyModifierMask getToggleMask() const;
virtual bool isLockedToScreen() const;
2001-10-06 14:13:28 +00:00
2002-04-29 14:40:01 +00:00
protected:
// CXWindowsScreen overrides
virtual void onOpenDisplay();
virtual CXWindowsClipboard*
createClipboard(ClipboardID);
virtual void onCloseDisplay();
virtual void onLostClipboard(ClipboardID);
2002-04-29 14:40:01 +00:00
private:
void selectEvents(Display*, Window) const;
void doSelectEvents(Display*, Window) const;
void warpCursorNoLock(Display*,
SInt32 xAbsolute, SInt32 yAbsolute);
2001-10-06 14:13:28 +00:00
KeyModifierMask mapModifier(unsigned int state) const;
KeyID mapKey(XKeyEvent*) const;
2001-10-06 14:13:28 +00:00
ButtonID mapButton(unsigned int button) const;
void updateModifierMap(Display* display);
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;
Window m_window;
// note toggle keys that toggle on up/down (false) or on
// transition (true)
bool m_numLockHalfDuplex;
bool m_capsLockHalfDuplex;
// 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