blob: 32b561e769394ae6303fa0e46b286a7281ac8ce4 [file] [log] [blame]
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00001/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
Pierre Ossman0ff26552016-02-05 10:26:56 +01002 * Copyright 2009-2019 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>
Pierre Ossmanb114f5c2018-06-18 16:34:16 +020022#include <rfb/encodings.h>
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000023
24using namespace rfb;
25
26SMsgHandler::SMsgHandler()
27{
28}
29
30SMsgHandler::~SMsgHandler()
31{
32}
33
34void SMsgHandler::clientInit(bool shared)
35{
36}
37
38void SMsgHandler::setPixelFormat(const PixelFormat& pf)
39{
Pierre Ossman0d3ce872018-06-18 15:59:00 +020040 client.setPF(pf);
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000041}
42
Pierre Ossmanf38e2432015-02-11 13:47:58 +010043void SMsgHandler::setEncodings(int nEncodings, const rdr::S32* encodings)
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000044{
Pierre Ossman5ae28212017-05-16 14:30:38 +020045 bool firstFence, firstContinuousUpdates, firstLEDState,
46 firstQEMUKeyEvent;
Pierre Ossmanc754cce2011-11-14 15:44:11 +000047
Pierre Ossmanb114f5c2018-06-18 16:34:16 +020048 firstFence = !client.supportsFence();
49 firstContinuousUpdates = !client.supportsContinuousUpdates();
50 firstLEDState = !client.supportsLEDState();
51 firstQEMUKeyEvent = !client.supportsEncoding(pseudoEncodingQEMUKeyEvent);
Pierre Ossmanc754cce2011-11-14 15:44:11 +000052
Pierre Ossman0d3ce872018-06-18 15:59:00 +020053 client.setEncodings(nEncodings, encodings);
Pierre Ossmanc754cce2011-11-14 15:44:11 +000054
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000055 supportsLocalCursor();
Pierre Ossmanc754cce2011-11-14 15:44:11 +000056
Pierre Ossmanb114f5c2018-06-18 16:34:16 +020057 if (client.supportsFence() && firstFence)
Pierre Ossmanc754cce2011-11-14 15:44:11 +000058 supportsFence();
Pierre Ossmanb114f5c2018-06-18 16:34:16 +020059 if (client.supportsContinuousUpdates() && firstContinuousUpdates)
Pierre Ossmanc898d9a2011-11-14 16:22:23 +000060 supportsContinuousUpdates();
Pierre Ossmanb114f5c2018-06-18 16:34:16 +020061 if (client.supportsLEDState() && firstLEDState)
Pierre Ossmanb45a84f2016-12-12 16:59:15 +010062 supportsLEDState();
Pierre Ossmanb114f5c2018-06-18 16:34:16 +020063 if (client.supportsEncoding(pseudoEncodingQEMUKeyEvent) && firstQEMUKeyEvent)
Pierre Ossman5ae28212017-05-16 14:30:38 +020064 supportsQEMUKeyEvent();
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000065}
66
Pierre Ossman0ff26552016-02-05 10:26:56 +010067void SMsgHandler::handleClipboardCaps(rdr::U32 flags, const rdr::U32* lengths)
68{
69 client.setClipboardCaps(flags, lengths);
70}
71
72void SMsgHandler::handleClipboardRequest(rdr::U32 flags)
73{
74}
75
76void SMsgHandler::handleClipboardPeek(rdr::U32 flags)
77{
78}
79
80void SMsgHandler::handleClipboardNotify(rdr::U32 flags)
81{
82}
83
84void SMsgHandler::handleClipboardProvide(rdr::U32 flags,
85 const size_t* lengths,
86 const rdr::U8* const* data)
87{
88}
89
Pierre Ossmanc5e25602009-03-20 12:59:05 +000090void SMsgHandler::supportsLocalCursor()
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000091{
92}
93
Pierre Ossmanc754cce2011-11-14 15:44:11 +000094void SMsgHandler::supportsFence()
95{
96}
97
Pierre Ossmanc898d9a2011-11-14 16:22:23 +000098void SMsgHandler::supportsContinuousUpdates()
99{
100}
101
Pierre Ossmanb45a84f2016-12-12 16:59:15 +0100102void SMsgHandler::supportsLEDState()
103{
104}
105
Pierre Ossman5ae28212017-05-16 14:30:38 +0200106void SMsgHandler::supportsQEMUKeyEvent()
107{
108}