blob: ce8b271f59a63d2bbf4610b27094039c8c6416ba [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{
37 cp.width = width;
38 cp.height = height;
39}
40
Pierre Ossmancbd1b2c2009-03-20 16:05:04 +000041void CMsgHandler::setExtendedDesktopSize(int reason, int result,
42 int width, int height,
43 const ScreenSet& layout)
Pierre Ossman49f88222009-03-20 13:02:50 +000044{
Pierre Ossmancbd1b2c2009-03-20 16:05:04 +000045 cp.supportsSetDesktopSize = true;
46
Peter Åstrand618c1702010-02-10 07:28:25 +000047 if ((reason == (signed)reasonClient) && (result != (signed)resultSuccess))
Pierre Ossman49f88222009-03-20 13:02:50 +000048 return;
49
Pierre Ossmancbd1b2c2009-03-20 16:05:04 +000050 if (!layout.validate(width, height))
51 fprintf(stderr, "Server sent us an invalid screen layout\n");
52
Pierre Ossman49f88222009-03-20 13:02:50 +000053 cp.width = width;
54 cp.height = height;
Pierre Ossmancbd1b2c2009-03-20 16:05:04 +000055 cp.screenLayout = layout;
Pierre Ossman49f88222009-03-20 13:02:50 +000056}
57
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000058void CMsgHandler::setPixelFormat(const PixelFormat& pf)
59{
60 cp.setPF(pf);
61}
62
63void CMsgHandler::setName(const char* name)
64{
65 cp.setName(name);
66}
67
Pierre Ossmanc754cce2011-11-14 15:44:11 +000068void CMsgHandler::fence(rdr::U32 flags, unsigned len, const char data[])
69{
70 cp.supportsFence = true;
71}
Pierre Ossmanc898d9a2011-11-14 16:22:23 +000072
73void CMsgHandler::endOfContinuousUpdates()
74{
75 cp.supportsContinuousUpdates = true;
76}
Pierre Ossmanf3b0ade2015-02-04 14:11:11 +010077
78void CMsgHandler::framebufferUpdateStart()
79{
80}
81
82void CMsgHandler::framebufferUpdateEnd()
83{
84}