2001-10-06 14:13:28 +00:00
|
|
|
#ifndef IPRIMARYSCREEN_H
|
|
|
|
#define IPRIMARYSCREEN_H
|
|
|
|
|
|
|
|
#include "IInterface.h"
|
2002-06-08 21:48:00 +00:00
|
|
|
#include "KeyTypes.h"
|
2002-04-27 14:19:53 +00:00
|
|
|
#include "ClipboardTypes.h"
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2001-11-13 23:34:12 +00:00
|
|
|
class IClipboard;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
|
|
|
class IPrimaryScreen : public IInterface {
|
2002-04-29 14:40:01 +00:00
|
|
|
public:
|
2001-10-06 14:13:28 +00:00
|
|
|
// manipulators
|
|
|
|
|
2001-11-19 00:33:36 +00:00
|
|
|
// enter the screen's message loop. this returns when it detects
|
|
|
|
// the application should terminate or when stop() is called.
|
|
|
|
// the screen must be open()'d before run() and must not be
|
|
|
|
// close()'d until run() returns.
|
|
|
|
virtual void run() = 0;
|
|
|
|
|
|
|
|
// cause run() to return
|
|
|
|
virtual void stop() = 0;
|
|
|
|
|
2002-07-09 21:22:31 +00:00
|
|
|
// initialize the screen and start reporting events to the receiver
|
|
|
|
// (which is set through some interface of the derived class).
|
2001-10-06 14:13:28 +00:00
|
|
|
// events should be reported no matter where on the screen they
|
|
|
|
// occur but do not interfere with normal event dispatch. the
|
|
|
|
// screen saver engaging should be reported as an event. if that
|
|
|
|
// can't be detected then this object should disable the system's
|
|
|
|
// screen saver timer and should start the screen saver after
|
|
|
|
// idling for an appropriate time.
|
2002-05-24 17:54:28 +00:00
|
|
|
//
|
2002-07-09 21:22:31 +00:00
|
|
|
// open() must call receiver->onInfoChanged() to notify of the
|
|
|
|
// primary screen's initial resolution and jump zone size. it
|
|
|
|
// must also call receiver->onClipboardChanged() for each
|
|
|
|
// clipboard that the primary screen has.
|
|
|
|
virtual void open() = 0;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
|
|
|
// close the screen. should restore the screen saver timer if it
|
|
|
|
// was disabled.
|
|
|
|
virtual void close() = 0;
|
|
|
|
|
|
|
|
// called when the user navigates back to the primary screen.
|
|
|
|
// warp the cursor to the given coordinates, unhide it, and
|
2001-11-19 00:33:36 +00:00
|
|
|
// ungrab the input devices. every call to enter has a matching
|
2002-06-23 23:24:22 +00:00
|
|
|
// call to leave() which preceeds it, however the screen should
|
2001-11-19 00:33:36 +00:00
|
|
|
// assume an implicit call to enter() in the call to open().
|
2002-06-23 23:24:22 +00:00
|
|
|
// if warpCursor is false then do not warp the mouse.
|
2002-07-09 21:22:31 +00:00
|
|
|
//
|
|
|
|
// enter() must not call any receiver methods except onError().
|
2002-06-23 23:24:22 +00:00
|
|
|
virtual void enter(SInt32 xAbsolute, SInt32 yAbsolute,
|
|
|
|
bool forScreenSaver) = 0;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-07-09 21:22:31 +00:00
|
|
|
// called when the user navigates off the primary screen. hide the
|
|
|
|
// cursor and grab exclusive access to the input devices. return
|
|
|
|
// true iff successful.
|
|
|
|
//
|
|
|
|
// leave() must not call any receiver methods except onError().
|
2002-06-03 18:53:18 +00:00
|
|
|
virtual bool leave() = 0;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-07-11 13:13:37 +00:00
|
|
|
// called when the configuration has changed. activeSides is a
|
|
|
|
// bitmask of CConfig::EDirectionMask indicating which sides of
|
|
|
|
// the primary screen are linked to clients.
|
|
|
|
virtual void reconfigure(UInt32 activeSides) = 0;
|
2002-06-01 19:26:11 +00:00
|
|
|
|
2001-10-06 14:13:28 +00:00
|
|
|
// warp the cursor to the given position
|
|
|
|
virtual void warpCursor(SInt32 xAbsolute, SInt32 yAbsolute) = 0;
|
|
|
|
|
|
|
|
// set the screen's clipboard contents. this is usually called
|
|
|
|
// soon after an enter().
|
2002-07-09 21:22:31 +00:00
|
|
|
//
|
|
|
|
// setClipboard() must not call any receiver methods except onError().
|
2002-04-27 14:19:53 +00:00
|
|
|
virtual void setClipboard(ClipboardID, const IClipboard*) = 0;
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2001-11-25 18:32:41 +00:00
|
|
|
// synergy should own the clipboard
|
2002-04-27 14:19:53 +00:00
|
|
|
virtual void grabClipboard(ClipboardID) = 0;
|
2001-11-25 18:32:41 +00:00
|
|
|
|
2001-10-06 14:13:28 +00:00
|
|
|
// accessors
|
|
|
|
|
2002-07-09 21:22:31 +00:00
|
|
|
// return the contents of the given clipboard.
|
|
|
|
//
|
|
|
|
// getClipboard() must not call any receiver methods except onError().
|
2002-04-27 14:19:53 +00:00
|
|
|
virtual void getClipboard(ClipboardID, IClipboard*) const = 0;
|
2002-04-30 17:48:11 +00:00
|
|
|
|
|
|
|
// get the primary screen's current toggle modifier key state.
|
|
|
|
// the returned mask should have the corresponding bit set for
|
|
|
|
// each toggle key that is active.
|
|
|
|
virtual KeyModifierMask getToggleMask() const = 0;
|
2002-05-24 14:37:12 +00:00
|
|
|
|
|
|
|
// return true if any key or button is being pressed or if there's
|
|
|
|
// any other reason that the user should not be allowed to switch
|
|
|
|
// screens.
|
|
|
|
virtual bool isLockedToScreen() const = 0;
|
2001-10-06 14:13:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|