2
* synergy -- mouse and keyboard sharing utility
3
* Copyright (C) 2002 Chris Schoeneman
5
* This package is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* found in the file COPYING that should have accompanied this file.
9
* This package is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
15
#ifndef IPRIMARYSCREENRECEIVER_H
16
#define IPRIMARYSCREENRECEIVER_H
18
#include "IInterface.h"
20
#include "MouseTypes.h"
22
//! Primary screen event receiver interface
24
The interface for receiving notification of events on the primary
25
screen. The server implements this interface to handle user input.
26
Platform dependent primary screen implementation will need to take
27
an IPrimaryScreenReceiver* and notify it of events.
29
class IPrimaryScreenReceiver : public IInterface {
31
//! Notify of screen saver change
33
Called when the screensaver is activated or deactivated.
35
virtual void onScreensaver(bool activated) = 0;
37
//! Notify of one-shot timer expiration
39
Called when a one-shot timer expires.
41
virtual void onOneShotTimerExpired(UInt32 id) = 0;
43
// call to notify of events. onMouseMovePrimary() returns
44
// true iff the mouse enters a jump zone and jumps.
45
//! Notify of key press
46
virtual void onKeyDown(KeyID, KeyModifierMask, KeyButton) = 0;
47
//! Notify of key release
48
virtual void onKeyUp(KeyID, KeyModifierMask, KeyButton) = 0;
49
//! Notify of key repeat
50
virtual void onKeyRepeat(KeyID, KeyModifierMask,
51
SInt32 count, KeyButton) = 0;
52
//! Notify of mouse button press
53
virtual void onMouseDown(ButtonID) = 0;
54
//! Notify of mouse button release
55
virtual void onMouseUp(ButtonID) = 0;
56
//! Notify of mouse motion
58
Called when the mouse has moved while on the primary screen. \c x
59
and \c y are the absolute screen position of the mouse. Return
60
true iff the mouse enters a jump zone and jumps.
62
virtual bool onMouseMovePrimary(SInt32 x, SInt32 y) = 0;
63
//! Notify of mouse motion
65
Called when the mouse has moved while on the secondary screen.
66
\c dx and \c dy are the relative motion from the last position.
68
virtual void onMouseMoveSecondary(SInt32 dx, SInt32 dy) = 0;
69
//! Notify of mouse wheen motion
70
virtual void onMouseWheel(SInt32 delta) = 0;