deskflow/synergy/IScreen.h
crs f48a5fe387 checkpoint. still refactoring. merged common code from primary
screens into CPrimaryScreen and merged common code from secondary
screens into CSecondaryScreen.  changed is-a relationship to a
has-a between the primary and secondary screen classes and the
generic platform dependent screen class to avoid multiple
inheritance of implementation.  also standardized the interface
for those generic screen classes.  adding a platform now involves
implementing simpler interfaces:  IScreen for the generic screen,
IScreenEventHandler and some methods of CPrimaryScreen for the
primary screen, and IScreenEventHandler and some methods of
CSecondaryScreen for the secondary screen.  did X11 platform
but not win32 platform.
2002-07-13 22:00:38 +00:00

66 lines
1.9 KiB
C++

#ifndef ISCREEN_H
#define ISCREEN_H
#include "IInterface.h"
#include "ClipboardTypes.h"
class IClipboard;
// the interface for platform dependent screen implementations. each
// platform will derive a type from IScreen for interaction with the
// platform's screen that's common to primary and secondary screens.
class IScreen : public IInterface {
public:
// manipulators
// open the screen
virtual void open() = 0;
// runs an event loop and returns when exitMainLoop() is called.
// must be called between open() and close().
virtual void mainLoop() = 0;
// force mainLoop() to return
virtual void exitMainLoop() = 0;
// close the screen
virtual void close() = 0;
// set the contents of the clipboard
virtual bool setClipboard(ClipboardID, const IClipboard*) = 0;
// check clipboard ownership and notify IScreenReceiver (set through
// some other interface) if any changed
virtual void checkClipboards() = 0;
// open/close the screen saver. if notify is true then this object
// will call IScreenEventHandler's onScreenSaver() when the screensaver
// activates or deactivates until close. if notify is false then
// the screen saver is disabled on open and restored on close.
virtual void openScreenSaver(bool notify) = 0;
virtual void closeScreenSaver() = 0;
// activate or deactivate the screen saver
virtual void screensaver(bool activate) = 0;
// FIXME -- need explanation
virtual void syncDesktop() = 0;
// accessors
// get the contents of the clipboard
virtual bool getClipboard(ClipboardID, IClipboard*) const = 0;
// get the shape of the screen
virtual void getShape(SInt32& x, SInt32& y,
SInt32& w, SInt32& h) const = 0;
// get the current cursor coordinates
virtual void getCursorPos(SInt32& x, SInt32& y) const = 0;
// get the cursor center position
// FIXME -- need better explanation
virtual void getCursorCenter(SInt32& x, SInt32& y) const = 0;
};
#endif