2001-11-19 00:33:36 +00:00
|
|
|
#ifndef CMSWINDOWSPRIMARYSCREEN_H
|
|
|
|
#define CMSWINDOWSPRIMARYSCREEN_H
|
|
|
|
|
|
|
|
#include "KeyTypes.h"
|
|
|
|
#include "MouseTypes.h"
|
|
|
|
#include "CMSWindowsScreen.h"
|
|
|
|
#include "IPrimaryScreen.h"
|
|
|
|
|
|
|
|
class CMSWindowsPrimaryScreen : public CMSWindowsScreen, public IPrimaryScreen {
|
2002-04-29 14:40:01 +00:00
|
|
|
public:
|
2001-11-19 00:33:36 +00:00
|
|
|
typedef bool (CMSWindowsPrimaryScreen::*HookMethod)(int, WPARAM, LPARAM);
|
|
|
|
|
|
|
|
CMSWindowsPrimaryScreen();
|
|
|
|
virtual ~CMSWindowsPrimaryScreen();
|
|
|
|
|
|
|
|
// IPrimaryScreen overrides
|
|
|
|
virtual void run();
|
|
|
|
virtual void stop();
|
|
|
|
virtual void open(CServer*);
|
|
|
|
virtual void close();
|
|
|
|
virtual void enter(SInt32 xAbsolute, SInt32 yAbsolute);
|
|
|
|
virtual void leave();
|
|
|
|
virtual void warpCursor(SInt32 xAbsolute, SInt32 yAbsolute);
|
2002-04-30 16:23:03 +00:00
|
|
|
virtual void setClipboard(ClipboardID, const IClipboard*);
|
|
|
|
virtual void grabClipboard(ClipboardID);
|
2001-11-19 00:33:36 +00:00
|
|
|
virtual void getSize(SInt32* width, SInt32* height) const;
|
|
|
|
virtual SInt32 getJumpZoneSize() const;
|
2002-04-30 16:23:03 +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-11-19 00:33:36 +00:00
|
|
|
|
2002-04-29 14:40:01 +00:00
|
|
|
protected:
|
2001-11-19 00:33:36 +00:00
|
|
|
// CMSWindowsScreen overrides
|
2001-11-25 18:32:41 +00:00
|
|
|
virtual bool onPreTranslate(MSG*);
|
|
|
|
virtual LRESULT onEvent(HWND, UINT, WPARAM, LPARAM);
|
2001-11-19 00:33:36 +00:00
|
|
|
virtual void onOpenDisplay();
|
|
|
|
virtual void onCloseDisplay();
|
|
|
|
|
2002-04-29 14:40:01 +00:00
|
|
|
private:
|
2001-11-19 00:33:36 +00:00
|
|
|
void doEnter();
|
|
|
|
|
|
|
|
void nextMark();
|
|
|
|
|
2001-11-25 18:32:41 +00:00
|
|
|
KeyID mapKey(WPARAM keycode, LPARAM info,
|
2002-04-30 16:23:03 +00:00
|
|
|
KeyModifierMask* maskOut);
|
2001-11-19 00:33:36 +00:00
|
|
|
ButtonID mapButton(WPARAM button) const;
|
2002-04-30 16:23:03 +00:00
|
|
|
void updateKeys();
|
|
|
|
void updateKey(UINT vkCode, bool press);
|
2001-11-19 00:33:36 +00:00
|
|
|
|
2002-04-29 14:40:01 +00:00
|
|
|
private:
|
2001-11-19 00:33:36 +00:00
|
|
|
CServer* m_server;
|
|
|
|
bool m_active;
|
|
|
|
HWND m_window;
|
2001-11-25 18:32:41 +00:00
|
|
|
HWND m_nextClipboardWindow;
|
|
|
|
HWND m_clipboardOwner;
|
2002-05-22 17:01:17 +00:00
|
|
|
HWND m_lastForegroundWindow;
|
|
|
|
HWND m_lastActiveWindow;
|
|
|
|
DWORD m_lastActiveThread;
|
2001-11-19 00:33:36 +00:00
|
|
|
HINSTANCE m_hookLibrary;
|
|
|
|
UInt32 m_mark;
|
|
|
|
UInt32 m_markReceived;
|
2002-04-30 16:23:03 +00:00
|
|
|
BYTE m_keys[256];
|
2002-05-22 17:01:17 +00:00
|
|
|
SInt32 m_xCenter, m_yCenter;
|
2001-11-19 00:33:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|