Files
barrier/server/CXWindowsPrimaryScreen.h
crs 1377882a9f fixed handling of jumping to primary when screen saver starts
and back to secondary when it stops.  also now redirecting
keyboard input to root window when screen saver starts;  this
allows the user to type in the lock dialog and also effectively
discards any input used to deactivate the screen saver.
2002-06-23 23:24:22 +00:00

87 lines
2.4 KiB
C++

#ifndef CXWINDOWSPRIMARYSCREEN_H
#define CXWINDOWSPRIMARYSCREEN_H
#include "CXWindowsScreen.h"
#include "IPrimaryScreen.h"
#include "MouseTypes.h"
class CXWindowsPrimaryScreen : public CXWindowsScreen, public IPrimaryScreen {
public:
CXWindowsPrimaryScreen();
virtual ~CXWindowsPrimaryScreen();
// IPrimaryScreen overrides
virtual void run();
virtual void stop();
virtual void open(CServer*);
virtual void close();
virtual void enter(SInt32 xAbsolute, SInt32 yAbsolute, bool);
virtual bool leave();
virtual void onConfigure();
virtual void warpCursor(SInt32 xAbsolute, SInt32 yAbsolute);
virtual void setClipboard(ClipboardID, const IClipboard*);
virtual void grabClipboard(ClipboardID);
virtual void getShape(SInt32&, SInt32&, SInt32&, SInt32&) const;
virtual SInt32 getJumpZoneSize() const;
virtual void getClipboard(ClipboardID, IClipboard*) const;
virtual KeyModifierMask getToggleMask() const;
virtual bool isLockedToScreen() const;
virtual bool isScreenSaverActive() const;
protected:
// CXWindowsScreen overrides
virtual void onOpenDisplay(Display*);
virtual CXWindowsClipboard*
createClipboard(ClipboardID);
virtual void onCloseDisplay(Display*);
virtual void onUnexpectedClose();
virtual void onLostClipboard(ClipboardID);
private:
void selectEvents(Display*, Window) const;
void doSelectEvents(Display*, Window) const;
void warpCursorNoLock(Display*,
SInt32 xAbsolute, SInt32 yAbsolute);
KeyModifierMask mapModifier(unsigned int state) const;
KeyID mapKey(XKeyEvent*) const;
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);
private:
CServer* m_server;
bool m_active;
Window m_window;
// atom for screen saver messages
Atom m_atomScreenSaver;
// 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;
// last mouse position
SInt32 m_x, m_y;
// position of center pixel of screen
SInt32 m_xCenter, m_yCenter;
};
#endif