Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 1 | /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. |
Pierre Ossman | 0ff2655 | 2016-02-05 10:26:56 +0100 | [diff] [blame] | 2 | * Copyright 2009-2019 Pierre Ossman for Cendio AB |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 3 | * |
| 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 Ossman | 34bb061 | 2009-03-21 21:16:14 +0000 | [diff] [blame] | 21 | #include <rfb/ScreenSet.h> |
Pierre Ossman | b114f5c | 2018-06-18 16:34:16 +0200 | [diff] [blame] | 22 | #include <rfb/encodings.h> |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 23 | |
| 24 | using namespace rfb; |
| 25 | |
| 26 | SMsgHandler::SMsgHandler() |
| 27 | { |
| 28 | } |
| 29 | |
| 30 | SMsgHandler::~SMsgHandler() |
| 31 | { |
| 32 | } |
| 33 | |
| 34 | void SMsgHandler::clientInit(bool shared) |
| 35 | { |
| 36 | } |
| 37 | |
| 38 | void SMsgHandler::setPixelFormat(const PixelFormat& pf) |
| 39 | { |
Pierre Ossman | 0d3ce87 | 2018-06-18 15:59:00 +0200 | [diff] [blame] | 40 | client.setPF(pf); |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 41 | } |
| 42 | |
Pierre Ossman | f38e243 | 2015-02-11 13:47:58 +0100 | [diff] [blame] | 43 | void SMsgHandler::setEncodings(int nEncodings, const rdr::S32* encodings) |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 44 | { |
Pierre Ossman | 5ae2821 | 2017-05-16 14:30:38 +0200 | [diff] [blame] | 45 | bool firstFence, firstContinuousUpdates, firstLEDState, |
| 46 | firstQEMUKeyEvent; |
Pierre Ossman | c754cce | 2011-11-14 15:44:11 +0000 | [diff] [blame] | 47 | |
Pierre Ossman | b114f5c | 2018-06-18 16:34:16 +0200 | [diff] [blame] | 48 | firstFence = !client.supportsFence(); |
| 49 | firstContinuousUpdates = !client.supportsContinuousUpdates(); |
| 50 | firstLEDState = !client.supportsLEDState(); |
| 51 | firstQEMUKeyEvent = !client.supportsEncoding(pseudoEncodingQEMUKeyEvent); |
Pierre Ossman | c754cce | 2011-11-14 15:44:11 +0000 | [diff] [blame] | 52 | |
Pierre Ossman | 0d3ce87 | 2018-06-18 15:59:00 +0200 | [diff] [blame] | 53 | client.setEncodings(nEncodings, encodings); |
Pierre Ossman | c754cce | 2011-11-14 15:44:11 +0000 | [diff] [blame] | 54 | |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 55 | supportsLocalCursor(); |
Pierre Ossman | c754cce | 2011-11-14 15:44:11 +0000 | [diff] [blame] | 56 | |
Pierre Ossman | b114f5c | 2018-06-18 16:34:16 +0200 | [diff] [blame] | 57 | if (client.supportsFence() && firstFence) |
Pierre Ossman | c754cce | 2011-11-14 15:44:11 +0000 | [diff] [blame] | 58 | supportsFence(); |
Pierre Ossman | b114f5c | 2018-06-18 16:34:16 +0200 | [diff] [blame] | 59 | if (client.supportsContinuousUpdates() && firstContinuousUpdates) |
Pierre Ossman | c898d9a | 2011-11-14 16:22:23 +0000 | [diff] [blame] | 60 | supportsContinuousUpdates(); |
Pierre Ossman | b114f5c | 2018-06-18 16:34:16 +0200 | [diff] [blame] | 61 | if (client.supportsLEDState() && firstLEDState) |
Pierre Ossman | b45a84f | 2016-12-12 16:59:15 +0100 | [diff] [blame] | 62 | supportsLEDState(); |
Pierre Ossman | b114f5c | 2018-06-18 16:34:16 +0200 | [diff] [blame] | 63 | if (client.supportsEncoding(pseudoEncodingQEMUKeyEvent) && firstQEMUKeyEvent) |
Pierre Ossman | 5ae2821 | 2017-05-16 14:30:38 +0200 | [diff] [blame] | 64 | supportsQEMUKeyEvent(); |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 65 | } |
| 66 | |
Pierre Ossman | 0ff2655 | 2016-02-05 10:26:56 +0100 | [diff] [blame] | 67 | void SMsgHandler::handleClipboardCaps(rdr::U32 flags, const rdr::U32* lengths) |
| 68 | { |
| 69 | client.setClipboardCaps(flags, lengths); |
| 70 | } |
| 71 | |
| 72 | void SMsgHandler::handleClipboardRequest(rdr::U32 flags) |
| 73 | { |
| 74 | } |
| 75 | |
| 76 | void SMsgHandler::handleClipboardPeek(rdr::U32 flags) |
| 77 | { |
| 78 | } |
| 79 | |
| 80 | void SMsgHandler::handleClipboardNotify(rdr::U32 flags) |
| 81 | { |
| 82 | } |
| 83 | |
| 84 | void SMsgHandler::handleClipboardProvide(rdr::U32 flags, |
| 85 | const size_t* lengths, |
| 86 | const rdr::U8* const* data) |
| 87 | { |
| 88 | } |
| 89 | |
Pierre Ossman | c5e2560 | 2009-03-20 12:59:05 +0000 | [diff] [blame] | 90 | void SMsgHandler::supportsLocalCursor() |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 91 | { |
| 92 | } |
| 93 | |
Pierre Ossman | c754cce | 2011-11-14 15:44:11 +0000 | [diff] [blame] | 94 | void SMsgHandler::supportsFence() |
| 95 | { |
| 96 | } |
| 97 | |
Pierre Ossman | c898d9a | 2011-11-14 16:22:23 +0000 | [diff] [blame] | 98 | void SMsgHandler::supportsContinuousUpdates() |
| 99 | { |
| 100 | } |
| 101 | |
Pierre Ossman | b45a84f | 2016-12-12 16:59:15 +0100 | [diff] [blame] | 102 | void SMsgHandler::supportsLEDState() |
| 103 | { |
| 104 | } |
| 105 | |
Pierre Ossman | 5ae2821 | 2017-05-16 14:30:38 +0200 | [diff] [blame] | 106 | void SMsgHandler::supportsQEMUKeyEvent() |
| 107 | { |
| 108 | } |