blob: 3f3f402a9c57260d45278fda36078aa81f4ca4fd [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// -=- WMPoller.h
20//
21// Polls the foreground window. If the pollOnlyConsoles flag is set,
22// then checks the window class of the foreground window first and
23// only polls it if it's a console.
24// If the pollAllWindows flag is set then iterates through visible
25// windows, and polls the visible bits. If pollOnlyConsoles is also
26// set then only visible parts of console windows will be polled.
27
28#ifndef __RFB_WIN32_WM_POLLER_H__
29#define __RFB_WIN32_WM_POLLER_H__
30
31#define WIN32_LEAN_AND_MEAN
32#include <windows.h>
33#include <rfb/UpdateTracker.h>
34#include <rfb/Configuration.h>
35
36namespace rfb {
37
38 namespace win32 {
39
40 class WMPoller {
41 public:
42 WMPoller();
43 ~WMPoller();
44
45 bool processEvent();
46 bool setClipRect(const Rect& cr);
47 bool setUpdateTracker(UpdateTracker* ut);
48
49 static BoolParameter poll_console_windows;
50 protected:
51 struct PollInfo {
52 Region poll_include;
53 Region poll_exclude;
54 };
55 static bool checkPollWindow(HWND w);
56 static void pollWindow(HWND w, PollInfo* info);
57 static BOOL CALLBACK enumWindowProc(HWND w, LPARAM lp);
58
59 ClippedUpdateTracker* clipper;
60 Region clip_region;
61 };
62
63 };
64
65};
66
67#endif // __RFB_WIN32_WM_POLLER_H__