blob: 791df76300030b6c1127faf2005a8ef4409c4c2d [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// -=- WMHooks.h
20
21#ifndef __RFB_WIN32_WM_HOOKS_H__
22#define __RFB_WIN32_WM_HOOKS_H__
23
24#define WIN32_LEAN_AND_MEAN
25#include <windows.h>
26#include <rfb/UpdateTracker.h>
27#include <rdr/Exception.h>
28#include <rfb_win32/MsgWindow.h>
29
30namespace rfb {
31
32 namespace win32 {
33
34 class WMHooks : public MsgWindow {
35 public:
36 WMHooks();
37 ~WMHooks();
38
39 bool setClipRect(const Rect& cr);
40 bool setUpdateTracker(UpdateTracker* ut);
41
42 virtual LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam);
43
44#ifdef _DEBUG
45 // Get notifications of any messages in the given range, to any hooked window
46 void setDiagnosticRange(UINT min, UINT max);
47#endif
48
49 protected:
50 ClippedUpdateTracker* clipper;
51 Region clip_region;
52
53 void* fg_window;
54 Rect fg_window_rect;
55
56 public:
57 SimpleUpdateTracker new_changes;
58 bool notified;
59 };
60
61 class WMBlockInput {
62 public:
63 WMBlockInput();
64 ~WMBlockInput();
65 bool blockInputs(bool block);
66 protected:
67 bool active;
68 };
69
70 // - Legacy cursor handling support
71 class WMCursorHooks {
72 public:
73 WMCursorHooks();
74 ~WMCursorHooks();
75
76 bool start();
77
78 HCURSOR getCursor() const;
79 };
80
81 };
82
83};
84
85#endif // __RFB_WIN32_WM_HOOKS_H__