Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

CScreen.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2002 Chris Schoeneman
00004  * 
00005  * This package is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * found in the file COPYING that should have accompanied this file.
00008  * 
00009  * This package is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  */
00014 
00015 #ifndef CSCREEN_H
00016 #define CSCREEN_H
00017 
00018 #include "IScreen.h"
00019 #include "ClipboardTypes.h"
00020 #include "KeyTypes.h"
00021 #include "MouseTypes.h"
00022 #include "OptionTypes.h"
00023 
00024 class IClipboard;
00025 class IPlatformScreen;
00026 
00028 
00032 class CScreen : public IScreen {
00033 public:
00034     CScreen(IPlatformScreen* platformScreen);
00035     virtual ~CScreen();
00036 
00038 
00039 
00041 
00046     void                enable();
00047 
00049 
00053     void                disable();
00054 
00056 
00060     void                enter(KeyModifierMask toggleMask);
00061 
00063 
00066     bool                leave();
00067 
00069 
00074     void                reconfigure(UInt32 activeSides);
00075 
00077 
00082     void                warpCursor(SInt32 x, SInt32 y);
00083 
00085 
00089     void                setClipboard(ClipboardID, const IClipboard*);
00090 
00092 
00095     void                grabClipboard(ClipboardID);
00096 
00098 
00102     void                screensaver(bool activate);
00103 
00105 
00113     void                keyDown(KeyID id, KeyModifierMask, KeyButton);
00114 
00116 
00120     void                keyRepeat(KeyID id, KeyModifierMask,
00121                             SInt32 count, KeyButton);
00122 
00124 
00128     void                keyUp(KeyID id, KeyModifierMask, KeyButton);
00129 
00131 
00134     void                mouseDown(ButtonID id);
00135 
00137 
00140     void                mouseUp(ButtonID id);
00141 
00143 
00147     void                mouseMove(SInt32 xAbs, SInt32 yAbs);
00148 
00150 
00154     void                mouseRelativeMove(SInt32 xRel, SInt32 yRel);
00155 
00157 
00163     void                mouseWheel(SInt32 xDelta, SInt32 yDelta);
00164 
00166 
00169     void                resetOptions();
00170 
00172 
00176     void                setOptions(const COptionsList& options);
00177 
00179 
00182     void                setSequenceNumber(UInt32);
00183 
00185 
00189     UInt32              registerHotKey(KeyID key, KeyModifierMask mask);
00190 
00192 
00195     void                unregisterHotKey(UInt32 id);
00196 
00198 
00204     void                fakeInputBegin();
00205 
00207 
00210     void                fakeInputEnd();
00211 
00213 
00214 
00215 
00217 
00220     bool                isOnScreen() const;
00221 
00223 
00229     bool                isLockedToScreen() const;
00230 
00232 
00236     SInt32              getJumpZoneSize() const;
00237 
00239 
00244     void                getCursorCenter(SInt32& x, SInt32& y) const;
00245 
00247 
00251     KeyModifierMask     getActiveModifiers() const;
00252 
00254 
00258     KeyModifierMask     pollActiveModifiers() const;
00259 
00261 
00262     // IScreen overrides
00263     virtual void*       getEventTarget() const;
00264     virtual bool        getClipboard(ClipboardID id, IClipboard*) const;
00265     virtual void        getShape(SInt32& x, SInt32& y,
00266                             SInt32& width, SInt32& height) const;
00267     virtual void        getCursorPos(SInt32& x, SInt32& y) const;
00268 
00269 protected:
00270     void                enablePrimary();
00271     void                enableSecondary();
00272     void                disablePrimary();
00273     void                disableSecondary();
00274 
00275     void                enterPrimary();
00276     void                enterSecondary(KeyModifierMask toggleMask);
00277     void                leavePrimary();
00278     void                leaveSecondary();
00279 
00280 private:
00281     // our platform dependent screen
00282     IPlatformScreen*    m_screen;
00283 
00284     // true if screen is being used as a primary screen, false otherwise
00285     bool                m_isPrimary;
00286 
00287     // true if screen is enabled
00288     bool                m_enabled;
00289 
00290     // true if the cursor is on this screen
00291     bool                m_entered;
00292 
00293     // true if screen saver should be synchronized to server
00294     bool                m_screenSaverSync;
00295 
00296     // note toggle keys that toggles on up/down (false) or on
00297     // transition (true)
00298     KeyModifierMask     m_halfDuplex;
00299 
00300     // true if we're faking input on a primary screen
00301     bool                m_fakeInput;
00302 };
00303 
00304 #endif

Generated on Fri Nov 6 00:21:14 2009 for synergy-plus by  doxygen 1.3.9.1