2001-10-06 18:13:28 +04:00
|
|
|
#ifndef CXWINDOWSPRIMARYSCREEN_H
|
|
|
|
#define CXWINDOWSPRIMARYSCREEN_H
|
|
|
|
|
2001-11-12 00:15:30 +03:00
|
|
|
#include "CXWindowsScreen.h"
|
2001-10-06 18:13:28 +04:00
|
|
|
#include "IPrimaryScreen.h"
|
2002-06-11 02:06:45 +04:00
|
|
|
#include "MouseTypes.h"
|
2001-10-06 18:13:28 +04:00
|
|
|
|
2002-07-11 01:22:28 +04:00
|
|
|
class IScreenReceiver;
|
|
|
|
class IPrimaryScreenReceiver;
|
2002-07-10 01:22:31 +04:00
|
|
|
|
2001-11-12 00:15:30 +03:00
|
|
|
class CXWindowsPrimaryScreen : public CXWindowsScreen, public IPrimaryScreen {
|
2002-04-29 18:40:01 +04:00
|
|
|
public:
|
2002-07-11 01:22:28 +04:00
|
|
|
CXWindowsPrimaryScreen(IScreenReceiver*, IPrimaryScreenReceiver*);
|
2001-10-06 18:13:28 +04:00
|
|
|
virtual ~CXWindowsPrimaryScreen();
|
|
|
|
|
|
|
|
// IPrimaryScreen overrides
|
2001-11-19 03:33:36 +03:00
|
|
|
virtual void run();
|
|
|
|
virtual void stop();
|
2002-07-10 01:22:31 +04:00
|
|
|
virtual void open();
|
2001-10-06 18:13:28 +04:00
|
|
|
virtual void close();
|
2002-06-24 03:24:22 +04:00
|
|
|
virtual void enter(SInt32 xAbsolute, SInt32 yAbsolute, bool);
|
2002-06-03 22:53:18 +04:00
|
|
|
virtual bool leave();
|
2002-07-11 17:13:37 +04:00
|
|
|
virtual void reconfigure(UInt32 activeSides);
|
2001-10-06 18:13:28 +04:00
|
|
|
virtual void warpCursor(SInt32 xAbsolute, SInt32 yAbsolute);
|
2002-04-27 18:19:53 +04:00
|
|
|
virtual void setClipboard(ClipboardID, const IClipboard*);
|
|
|
|
virtual void grabClipboard(ClipboardID);
|
|
|
|
virtual void getClipboard(ClipboardID, IClipboard*) const;
|
2002-04-30 21:48:11 +04:00
|
|
|
virtual KeyModifierMask getToggleMask() const;
|
2002-05-24 18:37:12 +04:00
|
|
|
virtual bool isLockedToScreen() const;
|
2001-10-06 18:13:28 +04:00
|
|
|
|
2002-04-29 18:40:01 +04:00
|
|
|
protected:
|
2001-11-12 00:15:30 +03:00
|
|
|
// CXWindowsScreen overrides
|
2002-06-03 17:45:30 +04:00
|
|
|
virtual void onUnexpectedClose();
|
2002-05-27 20:22:59 +04:00
|
|
|
virtual void onLostClipboard(ClipboardID);
|
2001-11-12 00:15:30 +03:00
|
|
|
|
2002-04-29 18:40:01 +04:00
|
|
|
private:
|
2001-11-12 00:15:30 +03:00
|
|
|
void selectEvents(Display*, Window) const;
|
2002-05-27 22:30:13 +04:00
|
|
|
void doSelectEvents(Display*, Window) const;
|
2002-07-11 22:58:49 +04:00
|
|
|
|
|
|
|
void enterNoWarp();
|
|
|
|
bool showWindow();
|
|
|
|
void hideWindow();
|
|
|
|
|
|
|
|
SInt32 getJumpZoneSize() const;
|
|
|
|
|
|
|
|
void warpCursorToCenter();
|
|
|
|
void warpCursorNoFlush(Display*,
|
2002-07-03 20:25:36 +04:00
|
|
|
SInt32 xAbsolute, SInt32 yAbsolute);
|
2001-10-06 18:13:28 +04:00
|
|
|
|
2002-07-11 22:58:49 +04:00
|
|
|
// check clipboard ownership and, if necessary, tell the receiver
|
|
|
|
// of a grab.
|
|
|
|
void checkClipboard();
|
|
|
|
|
|
|
|
// create/destroy window
|
|
|
|
void createWindow();
|
|
|
|
void destroyWindow();
|
|
|
|
|
|
|
|
// start/stop watch for screen saver changes
|
|
|
|
void installScreenSaver();
|
|
|
|
void uninstallScreenSaver();
|
|
|
|
|
2001-10-06 18:13:28 +04:00
|
|
|
KeyModifierMask mapModifier(unsigned int state) const;
|
2002-04-26 21:38:01 +04:00
|
|
|
KeyID mapKey(XKeyEvent*) const;
|
2001-10-06 18:13:28 +04:00
|
|
|
ButtonID mapButton(unsigned int button) const;
|
|
|
|
|
2002-04-30 21:48:11 +04:00
|
|
|
void updateModifierMap(Display* display);
|
|
|
|
|
2002-05-03 15:26:44 +04: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 18:40:01 +04:00
|
|
|
private:
|
2002-07-11 01:22:28 +04:00
|
|
|
IScreenReceiver* m_receiver;
|
|
|
|
IPrimaryScreenReceiver* m_primaryReceiver;
|
|
|
|
|
2001-10-06 18:13:28 +04:00
|
|
|
bool m_active;
|
2001-11-12 00:15:30 +03:00
|
|
|
Window m_window;
|
2002-04-27 00:12:55 +04:00
|
|
|
|
2002-06-22 23:20:21 +04:00
|
|
|
// atom for screen saver messages
|
|
|
|
Atom m_atomScreenSaver;
|
|
|
|
|
2002-05-04 22:33:48 +04:00
|
|
|
// note toggle keys that toggle on up/down (false) or on
|
2002-04-30 21:48:11 +04:00
|
|
|
// transition (true)
|
2002-05-04 22:33:48 +04:00
|
|
|
bool m_numLockHalfDuplex;
|
2002-04-27 00:12:55 +04:00
|
|
|
bool m_capsLockHalfDuplex;
|
2002-04-30 21:48:11 +04: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-20 00:24:35 +04:00
|
|
|
|
|
|
|
// last mouse position
|
|
|
|
SInt32 m_x, m_y;
|
|
|
|
|
|
|
|
// position of center pixel of screen
|
|
|
|
SInt32 m_xCenter, m_yCenter;
|
2001-10-06 18:13:28 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|