blob: d4046b1b3e3d5d51c415ff5aa881d261c09e6bb2 [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 */
19#include <rfb/Exception.h>
20#include <rfb/SMsgHandler.h>
Pierre Ossman34bb0612009-03-21 21:16:14 +000021#include <rfb/ScreenSet.h>
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000022
23using namespace rfb;
24
25SMsgHandler::SMsgHandler()
26{
27}
28
29SMsgHandler::~SMsgHandler()
30{
31}
32
33void SMsgHandler::clientInit(bool shared)
34{
35}
36
37void SMsgHandler::setPixelFormat(const PixelFormat& pf)
38{
39 cp.setPF(pf);
40}
41
Peter Åstrand98fe98c2010-02-10 07:43:02 +000042void SMsgHandler::setEncodings(int nEncodings, rdr::S32* encodings)
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000043{
Pierre Ossmanc898d9a2011-11-14 16:22:23 +000044 bool firstFence, firstContinuousUpdates;
Pierre Ossmanc754cce2011-11-14 15:44:11 +000045
46 firstFence = !cp.supportsFence;
Pierre Ossmanc898d9a2011-11-14 16:22:23 +000047 firstContinuousUpdates = !cp.supportsContinuousUpdates;
Pierre Ossmanc754cce2011-11-14 15:44:11 +000048
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000049 cp.setEncodings(nEncodings, encodings);
Pierre Ossmanc754cce2011-11-14 15:44:11 +000050
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000051 supportsLocalCursor();
Pierre Ossmanc754cce2011-11-14 15:44:11 +000052
53 if (cp.supportsFence && firstFence)
54 supportsFence();
Pierre Ossmanc898d9a2011-11-14 16:22:23 +000055 if (cp.supportsContinuousUpdates && firstContinuousUpdates)
56 supportsContinuousUpdates();
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000057}
58
Pierre Ossmanc5e25602009-03-20 12:59:05 +000059void SMsgHandler::supportsLocalCursor()
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000060{
61}
62
Pierre Ossmanc754cce2011-11-14 15:44:11 +000063void SMsgHandler::supportsFence()
64{
65}
66
Pierre Ossmanc898d9a2011-11-14 16:22:23 +000067void SMsgHandler::supportsContinuousUpdates()
68{
69}
70
Pierre Ossman34bb0612009-03-21 21:16:14 +000071void SMsgHandler::setDesktopSize(int fb_width, int fb_height,
72 const ScreenSet& layout)
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000073{
Pierre Ossmanc5e25602009-03-20 12:59:05 +000074 cp.width = fb_width;
75 cp.height = fb_height;
Pierre Ossman34bb0612009-03-21 21:16:14 +000076 cp.screenLayout = layout;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000077}
Constantin Kaplinsky9d1fc6c2008-06-14 05:23:10 +000078