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 | // -=- WMNotifier.h |
| 20 | // |
| 21 | // The WMNotifier is used to get callbacks indicating changes in the state |
| 22 | // of the system, for instance in the size/format/palette of the display. |
| 23 | // The WMNotifier contains a Win32 window, which receives notifications of |
| 24 | // system events and stores them. Whenever processEvent is called, any |
| 25 | // incoming events are processed and the appropriate notifier called. |
| 26 | |
| 27 | #ifndef __RFB_WIN32_NOTIFIER_H__ |
| 28 | #define __RFB_WIN32_NOTIFIER_H__ |
| 29 | |
| 30 | #include <rfb/SDesktop.h> |
| 31 | #include <rfb/Threading.h> |
| 32 | #include <rfb_win32/MsgWindow.h> |
| 33 | #include <rfb_win32/DeviceFrameBuffer.h> |
| 34 | #include <rfb_win32/SInput.h> |
| 35 | |
| 36 | namespace rfb { |
| 37 | |
| 38 | namespace win32 { |
| 39 | |
| 40 | // -=- Window Message Monitor implementation |
| 41 | |
| 42 | class WMMonitor : MsgWindow { |
| 43 | public: |
| 44 | |
| 45 | class Notifier { |
| 46 | public: |
| 47 | typedef enum {DisplaySizeChanged, DisplayColourMapChanged, |
| 48 | DisplayPixelFormatChanged} DisplayEventType; |
| 49 | virtual void notifyDisplayEvent(DisplayEventType evt) = 0; |
| 50 | }; |
| 51 | |
| 52 | WMMonitor(); |
| 53 | virtual ~WMMonitor(); |
| 54 | |
| 55 | void setNotifier(Notifier* wmn) {notifier=wmn;} |
| 56 | |
| 57 | protected: |
| 58 | // - Internal MsgWindow callback |
| 59 | virtual LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam); |
| 60 | |
| 61 | Notifier* notifier; |
| 62 | }; |
| 63 | |
| 64 | }; |
| 65 | |
| 66 | }; |
| 67 | |
| 68 | #endif // __RFB_WIN32_WMNOTIFIER_H__ |