2001-10-06 14:13:28 +00:00
|
|
|
#ifndef CXWINDOWSPRIMARYSCREEN_H
|
|
|
|
#define CXWINDOWSPRIMARYSCREEN_H
|
|
|
|
|
2001-11-11 21:15:30 +00:00
|
|
|
#include "CXWindowsScreen.h"
|
2001-10-06 14:13:28 +00:00
|
|
|
#include "IPrimaryScreen.h"
|
2002-06-10 22:06:45 +00:00
|
|
|
#include "MouseTypes.h"
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-07-10 14:15:17 +00:00
|
|
|
class IServer;
|
2002-07-09 21:22:31 +00:00
|
|
|
|
2001-11-11 21:15:30 +00:00
|
|
|
class CXWindowsPrimaryScreen : public CXWindowsScreen, public IPrimaryScreen {
|
2002-04-29 14:40:01 +00:00
|
|
|
public:
|
2002-07-10 14:15:17 +00:00
|
|
|
CXWindowsPrimaryScreen(IServer*);
|
2001-10-06 14:13:28 +00:00
|
|
|
virtual ~CXWindowsPrimaryScreen();
|
|
|
|
|
|
|
|
// IPrimaryScreen overrides
|
2001-11-19 00:33:36 +00:00
|
|
|
virtual void run();
|
|
|
|
virtual void stop();
|
2002-07-09 21:22:31 +00:00
|
|
|
virtual void open();
|
2001-10-06 14:13:28 +00:00
|
|
|
virtual void close();
|
2002-06-23 23:24:22 +00:00
|
|
|
virtual void enter(SInt32 xAbsolute, SInt32 yAbsolute, bool);
|
2002-06-03 18:53:18 +00:00
|
|
|
virtual bool leave();
|
2002-07-09 21:22:31 +00:00
|
|
|
virtual void reconfigure();
|
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);
|
|
|
|
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*,
|
2002-06-10 22:06:45 +00:00
|
|
|
SInt32 xAbsolute, SInt32 yAbsolute);
|
2002-07-03 16:25:36 +00:00
|
|
|
void warpCursorNoLockNoFlush(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:
|
2002-07-10 14:15:17 +00:00
|
|
|
IServer* m_server;
|
2001-10-06 14:13:28 +00:00
|
|
|
bool m_active;
|
2001-11-11 21:15:30 +00:00
|
|
|
Window m_window;
|
2002-04-26 20:12:55 +00:00
|
|
|
|
2002-06-22 19:20:21 +00:00
|
|
|
// atom for screen saver messages
|
|
|
|
Atom m_atomScreenSaver;
|
|
|
|
|
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;
|
2002-06-19 20:24:35 +00:00
|
|
|
|
|
|
|
// last mouse position
|
|
|
|
SInt32 m_x, m_y;
|
|
|
|
|
|
|
|
// position of center pixel of screen
|
|
|
|
SInt32 m_xCenter, m_yCenter;
|
2001-10-06 14:13:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|