2001-11-19 03:33:36 +03: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 18:40:01 +04:00
|
|
|
public:
|
2001-11-19 03:33:36 +03: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 20:23:03 +04:00
|
|
|
virtual void setClipboard(ClipboardID, const IClipboard*);
|
|
|
|
virtual void grabClipboard(ClipboardID);
|
2001-11-19 03:33:36 +03:00
|
|
|
virtual void getSize(SInt32* width, SInt32* height) const;
|
|
|
|
virtual SInt32 getJumpZoneSize() const;
|
2002-04-30 20:23:03 +04:00
|
|
|
virtual void getClipboard(ClipboardID, IClipboard*) const;
|
2002-04-30 21:48:11 +04:00
|
|
|
virtual KeyModifierMask getToggleMask() const;
|
2001-11-19 03:33:36 +03:00
|
|
|
|
2002-04-29 18:40:01 +04:00
|
|
|
protected:
|
2001-11-19 03:33:36 +03:00
|
|
|
// CMSWindowsScreen overrides
|
2001-11-25 21:32:41 +03:00
|
|
|
virtual bool onPreTranslate(MSG*);
|
|
|
|
virtual LRESULT onEvent(HWND, UINT, WPARAM, LPARAM);
|
2001-11-19 03:33:36 +03:00
|
|
|
virtual void onOpenDisplay();
|
|
|
|
virtual void onCloseDisplay();
|
|
|
|
|
2002-04-29 18:40:01 +04:00
|
|
|
private:
|
2001-11-19 03:33:36 +03:00
|
|
|
void doEnter();
|
|
|
|
|
|
|
|
void nextMark();
|
|
|
|
|
2001-11-25 21:32:41 +03:00
|
|
|
KeyID mapKey(WPARAM keycode, LPARAM info,
|
2002-04-30 20:23:03 +04:00
|
|
|
KeyModifierMask* maskOut);
|
2001-11-19 03:33:36 +03:00
|
|
|
ButtonID mapButton(WPARAM button) const;
|
2002-04-30 20:23:03 +04:00
|
|
|
void updateKeys();
|
|
|
|
void updateKey(UINT vkCode, bool press);
|
2001-11-19 03:33:36 +03:00
|
|
|
|
2002-04-29 18:40:01 +04:00
|
|
|
private:
|
2001-11-19 03:33:36 +03:00
|
|
|
CServer* m_server;
|
|
|
|
bool m_active;
|
|
|
|
HWND m_window;
|
2001-11-25 21:32:41 +03:00
|
|
|
HWND m_nextClipboardWindow;
|
|
|
|
HWND m_clipboardOwner;
|
2002-05-22 21:01:17 +04:00
|
|
|
HWND m_lastForegroundWindow;
|
|
|
|
HWND m_lastActiveWindow;
|
|
|
|
DWORD m_lastActiveThread;
|
2001-11-19 03:33:36 +03:00
|
|
|
HINSTANCE m_hookLibrary;
|
|
|
|
UInt32 m_mark;
|
|
|
|
UInt32 m_markReceived;
|
2002-04-30 20:23:03 +04:00
|
|
|
BYTE m_keys[256];
|
2002-05-22 21:01:17 +04:00
|
|
|
SInt32 m_xCenter, m_yCenter;
|
2001-11-19 03:33:36 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|