Constantin Kaplinsky | 729598c | 2006-05-25 05:12:25 +0000 | [diff] [blame] | 1 | /* Copyright (C) 2002-2005 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 | #include <windows.h> |
| 32 | #include <rfb/UpdateTracker.h> |
| 33 | #include <rfb/Configuration.h> |
| 34 | |
| 35 | namespace rfb { |
| 36 | |
| 37 | namespace win32 { |
| 38 | |
| 39 | class WMPoller { |
| 40 | public: |
| 41 | WMPoller() : ut(0) {} |
| 42 | |
| 43 | bool processEvent(); |
| 44 | bool setUpdateTracker(UpdateTracker* ut); |
| 45 | |
| 46 | static BoolParameter poll_console_windows; |
| 47 | protected: |
| 48 | struct PollInfo { |
| 49 | Region poll_include; |
| 50 | Region poll_exclude; |
| 51 | }; |
| 52 | static bool checkPollWindow(HWND w); |
| 53 | static void pollWindow(HWND w, PollInfo* info); |
| 54 | static BOOL CALLBACK enumWindowProc(HWND w, LPARAM lp); |
| 55 | UpdateTracker* ut; |
| 56 | }; |
| 57 | |
| 58 | }; |
| 59 | |
| 60 | }; |
| 61 | |
| 62 | #endif // __RFB_WIN32_WM_POLLER_H__ |