Constantin Kaplinsky | 0a1eca1 | 2006-04-16 07:28:14 +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 | // -=- SDisplayCoreWMHooks.h |
| 20 | // |
| 21 | // SDisplayCore implementation that uses WMHooks to capture changes to |
| 22 | // the display. |
| 23 | // Whenever changes are detected, the SDisplay's updateEvent is signalled, |
| 24 | // so that it can perform housekeeping tasks (like ensuring the currently |
| 25 | // active desktop is the correct one), before flushing changes from the |
| 26 | // Core to the VNC Server. The SDisplay will clip the changes before they |
| 27 | // reach the VNC Server. |
| 28 | |
| 29 | |
| 30 | #ifndef __RFB_SDISPLAY_CORE_WMHOOKS_H__ |
| 31 | #define __RFB_SDISPLAY_CORE_WMHOOKS_H__ |
| 32 | |
| 33 | #include <rfb_win32/SDisplayCorePolling.h> |
| 34 | #include <rfb_win32/WMHooks.h> |
| 35 | #include <rfb_win32/WMPoller.h> |
| 36 | |
| 37 | namespace rfb { |
| 38 | namespace win32 { |
| 39 | |
| 40 | class SDisplayCoreWMHooks : public SDisplayCorePolling { |
| 41 | public: |
| 42 | SDisplayCoreWMHooks(SDisplay* display, UpdateTracker* ut); |
| 43 | ~SDisplayCoreWMHooks(); |
| 44 | |
| 45 | // - Called by SDisplay to flush updates to the specified tracker |
| 46 | virtual void flushUpdates(); |
| 47 | |
| 48 | virtual const char* methodName() const { return "VNC Hooks"; } |
| 49 | |
| 50 | protected: |
| 51 | // - MsgWindow overrides |
| 52 | // processMessage is used to service the cursor & polling timers |
| 53 | virtual LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam); |
| 54 | |
| 55 | // - Hooking subcomponents used to track the desktop state |
| 56 | WMHooks hooks; |
| 57 | WMPoller poller; |
| 58 | IntervalTimer cursorTimer; |
| 59 | IntervalTimer consolePollTimer; |
| 60 | bool pollConsoles; |
| 61 | static const int consolePollTimerId; |
| 62 | static const int cursorTimerId; |
| 63 | }; |
| 64 | |
| 65 | }; |
| 66 | }; |
| 67 | |
| 68 | #endif |