blob: f0e277ce666493145a026be79aaf95b07ae29dd6 [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{
Pierre Ossman0d3ce872018-06-18 15:59:00 +020039 client.setPF(pf);
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000040}
41
Pierre Ossmanf38e2432015-02-11 13:47:58 +010042void SMsgHandler::setEncodings(int nEncodings, const rdr::S32* encodings)
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000043{
Pierre Ossman5ae28212017-05-16 14:30:38 +020044 bool firstFence, firstContinuousUpdates, firstLEDState,
45 firstQEMUKeyEvent;
Pierre Ossmanc754cce2011-11-14 15:44:11 +000046
Pierre Ossman0d3ce872018-06-18 15:59:00 +020047 firstFence = !client.supportsFence;
48 firstContinuousUpdates = !client.supportsContinuousUpdates;
49 firstLEDState = !client.supportsLEDState;
50 firstQEMUKeyEvent = !client.supportsQEMUKeyEvent;
Pierre Ossmanc754cce2011-11-14 15:44:11 +000051
Pierre Ossman0d3ce872018-06-18 15:59:00 +020052 client.setEncodings(nEncodings, encodings);
Pierre Ossmanc754cce2011-11-14 15:44:11 +000053
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000054 supportsLocalCursor();
Pierre Ossmanc754cce2011-11-14 15:44:11 +000055
Pierre Ossman0d3ce872018-06-18 15:59:00 +020056 if (client.supportsFence && firstFence)
Pierre Ossmanc754cce2011-11-14 15:44:11 +000057 supportsFence();
Pierre Ossman0d3ce872018-06-18 15:59:00 +020058 if (client.supportsContinuousUpdates && firstContinuousUpdates)
Pierre Ossmanc898d9a2011-11-14 16:22:23 +000059 supportsContinuousUpdates();
Pierre Ossman0d3ce872018-06-18 15:59:00 +020060 if (client.supportsLEDState && firstLEDState)
Pierre Ossmanb45a84f2016-12-12 16:59:15 +010061 supportsLEDState();
Pierre Ossman0d3ce872018-06-18 15:59:00 +020062 if (client.supportsQEMUKeyEvent && firstQEMUKeyEvent)
Pierre Ossman5ae28212017-05-16 14:30:38 +020063 supportsQEMUKeyEvent();
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000064}
65
Pierre Ossmanc5e25602009-03-20 12:59:05 +000066void SMsgHandler::supportsLocalCursor()
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000067{
68}
69
Pierre Ossmanc754cce2011-11-14 15:44:11 +000070void SMsgHandler::supportsFence()
71{
72}
73
Pierre Ossmanc898d9a2011-11-14 16:22:23 +000074void SMsgHandler::supportsContinuousUpdates()
75{
76}
77
Pierre Ossmanb45a84f2016-12-12 16:59:15 +010078void SMsgHandler::supportsLEDState()
79{
80}
81
Pierre Ossman5ae28212017-05-16 14:30:38 +020082void SMsgHandler::supportsQEMUKeyEvent()
83{
84}
85
Pierre Ossman34bb0612009-03-21 21:16:14 +000086void SMsgHandler::setDesktopSize(int fb_width, int fb_height,
87 const ScreenSet& layout)
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000088{
Pierre Ossman0d3ce872018-06-18 15:59:00 +020089 client.setDimensions(fb_width, fb_height, layout);
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000090}
Constantin Kaplinsky9d1fc6c2008-06-14 05:23:10 +000091