blob: 20a5445fef178b009ed989804bf873f038ff4f6c [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.cxx
20
21#include <rfb_win32/WMNotifier.h>
22#include <rfb_win32/WMShatter.h>
23#include <rfb_win32/MsgWindow.h>
24
25#include <rfb/LogWriter.h>
26
27using namespace rfb;
28using namespace rfb::win32;
29
30static LogWriter vlog("WMMonitor");
31
32
33WMMonitor::WMMonitor() : MsgWindow(_T("WMMonitor")), notifier(0) {
34}
35
36WMMonitor::~WMMonitor() {
37}
38
39
40LRESULT
41WMMonitor::processMessage(UINT msg, WPARAM wParam, LPARAM lParam) {
42 switch (msg) {
43 case WM_DISPLAYCHANGE:
44 if (notifier) {
45 notifier->notifyDisplayEvent(Notifier::DisplaySizeChanged);
46 notifier->notifyDisplayEvent(Notifier::DisplayPixelFormatChanged);
47 }
48 break;
49 case WM_SYSCOLORCHANGE:
50 case WM_PALETTECHANGED:
51 if (notifier) {
52 notifier->notifyDisplayEvent(Notifier::DisplayColourMapChanged);
53 }
54 break;
55 };
56 return MsgWindow::processMessage(msg, wParam, lParam);
57}