blob: f111de74cee3c569cdc47a5f3ce3fd1b2c15fff6 [file] [log] [blame]
Constantin Kaplinsky47ed8d32004-10-08 09:43:57 +00001/* Copyright (C) 2002-2003 RealVNC Ltd. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 */
18
19// -=- CPointer.h
20//
21// Client-side pointer event handling for Win32
22
23#ifndef __RFB_WIN32_CPOINTER_H__
24#define __RFB_WIN32_CPOINTER_H__
25
26#include <rdr/Exception.h>
27#include <rfb/Configuration.h>
28#include <rfb/CMsgWriter.h>
29#include <rfb/Rect.h>
30#include <rfb_win32/IntervalTimer.h>
31
32namespace rfb {
33
34 class CMsgWriter;
35
36 namespace win32 {
37
38 class CPointer {
39 public:
40 CPointer();
41 ~CPointer();
42
43 void pointerEvent(CMsgWriter* writer, int x, int y, int buttonMask);
44 void handleTimer(CMsgWriter* writer, int timerId);
45
46 void setHWND(HWND w) {intervalTimer.setHWND(w); threeTimer.setHWND(w);}
47 void setIntervalTimerId(int id) {intervalTimer.setId(id);}
48 void set3ButtonTimerId(int id) {threeTimer.setId(id);}
49
50 void enableEmulate3(bool enable) {emulate3 = enable;}
51 void enableInterval(int millis) {pointerEventInterval = millis;}
52 private:
53 Point currPos;
54 int currButtonMask;
55
56 bool emulate3;
57 int pointerEventInterval;
58
59 void intervalPointerEvent(CMsgWriter* writer, int x, int y, int buttonMask);
60 IntervalTimer intervalTimer;
61 bool intervalQueued;
62 Point intervalPos;
63 int intervalMask;
64
65 void threePointerEvent(CMsgWriter* writer, int x, int y, int buttonMask);
66 IntervalTimer threeTimer;
67 Point threePos;
68 int threeMask;
69 bool threeEmulating;
70 };
71
72 }; // win32
73
74}; // rfb
75
76#endif // __RFB_WIN32_CPOINTER_H__