blob: 3855430b1e4830536335040e74b49e9efef271ec [file] [log] [blame]
Constantin Kaplinsky729598c2006-05-25 05:12:25 +00001/* 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>
Constantin Kaplinsky729598c2006-05-25 05:12:25 +000031#include <rfb_win32/MsgWindow.h>
32#include <rfb_win32/DeviceFrameBuffer.h>
33#include <rfb_win32/SInput.h>
34
35namespace rfb {
36
37 namespace win32 {
38
39 // -=- Window Message Monitor implementation
40
41 class WMMonitor : MsgWindow {
42 public:
43
44 class Notifier {
45 public:
Pierre Ossmanb6b4dc62014-01-20 15:05:21 +010046 typedef enum {DisplaySizeChanged,
Constantin Kaplinsky729598c2006-05-25 05:12:25 +000047 DisplayPixelFormatChanged} DisplayEventType;
48 virtual void notifyDisplayEvent(DisplayEventType evt) = 0;
49 };
50
51 WMMonitor();
52 virtual ~WMMonitor();
53
54 void setNotifier(Notifier* wmn) {notifier=wmn;}
55
56 protected:
57 // - Internal MsgWindow callback
58 virtual LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam);
59
60 Notifier* notifier;
61 };
62
63 };
64
65};
66
67#endif // __RFB_WIN32_WMNOTIFIER_H__