blob: 03e66e83f95d0309cdbadf83a0915850a29c3930 [file] [log] [blame]
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00001/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
Pierre Ossmanc754cce2011-11-14 15:44:11 +00002 * Copyright 2009-2011 Pierre Ossman for Cendio AB
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00003 *
4 * This is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This software is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this software; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17 * USA.
18 */
Pierre Ossmancbd1b2c2009-03-20 16:05:04 +000019#include <stdio.h>
20
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000021#include <rfb/Exception.h>
22#include <rfb/CMsgHandler.h>
Pierre Ossman49f88222009-03-20 13:02:50 +000023#include <rfb/screenTypes.h>
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000024
25using namespace rfb;
26
27CMsgHandler::CMsgHandler()
28{
29}
30
31CMsgHandler::~CMsgHandler()
32{
33}
34
35void CMsgHandler::setDesktopSize(int width, int height)
36{
Pierre Ossman9312b0e2018-06-20 12:25:14 +020037 cp.setDimensions(width, height);
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000038}
39
Pierre Ossman28c1d542015-03-03 16:27:44 +010040void CMsgHandler::setExtendedDesktopSize(unsigned reason, unsigned result,
Pierre Ossmancbd1b2c2009-03-20 16:05:04 +000041 int width, int height,
42 const ScreenSet& layout)
Pierre Ossman49f88222009-03-20 13:02:50 +000043{
Pierre Ossmancbd1b2c2009-03-20 16:05:04 +000044 cp.supportsSetDesktopSize = true;
45
Pierre Ossman28c1d542015-03-03 16:27:44 +010046 if ((reason == reasonClient) && (result != resultSuccess))
Pierre Ossman49f88222009-03-20 13:02:50 +000047 return;
48
Pierre Ossman9312b0e2018-06-20 12:25:14 +020049 cp.setDimensions(width, height, layout);
Pierre Ossman49f88222009-03-20 13:02:50 +000050}
51
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000052void CMsgHandler::setPixelFormat(const PixelFormat& pf)
53{
54 cp.setPF(pf);
55}
56
57void CMsgHandler::setName(const char* name)
58{
59 cp.setName(name);
60}
61
Pierre Ossmanc754cce2011-11-14 15:44:11 +000062void CMsgHandler::fence(rdr::U32 flags, unsigned len, const char data[])
63{
64 cp.supportsFence = true;
65}
Pierre Ossmanc898d9a2011-11-14 16:22:23 +000066
67void CMsgHandler::endOfContinuousUpdates()
68{
69 cp.supportsContinuousUpdates = true;
70}
Pierre Ossmanf3b0ade2015-02-04 14:11:11 +010071
Pierre Ossman5ae28212017-05-16 14:30:38 +020072void CMsgHandler::supportsQEMUKeyEvent()
73{
74 cp.supportsQEMUKeyEvent = true;
75}
76
Pierre Ossmanf3b0ade2015-02-04 14:11:11 +010077void CMsgHandler::framebufferUpdateStart()
78{
79}
80
81void CMsgHandler::framebufferUpdateEnd()
82{
83}
Pierre Ossman2fa63f82016-12-05 15:26:21 +010084
85void CMsgHandler::setLEDState(unsigned int state)
86{
87 cp.setLEDState(state);
88}