Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 1 | /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. |
Pierre Ossman | c754cce | 2011-11-14 15:44:11 +0000 | [diff] [blame] | 2 | * Copyright 2009-2011 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 | c5e2560 | 2009-03-20 12:59:05 +0000 | [diff] [blame] | 67 | void SMsgHandler::supportsLocalCursor() |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 68 | { |
| 69 | } |
| 70 | |
Pierre Ossman | c754cce | 2011-11-14 15:44:11 +0000 | [diff] [blame] | 71 | void SMsgHandler::supportsFence() |
| 72 | { |
| 73 | } |
| 74 | |
Pierre Ossman | c898d9a | 2011-11-14 16:22:23 +0000 | [diff] [blame] | 75 | void SMsgHandler::supportsContinuousUpdates() |
| 76 | { |
| 77 | } |
| 78 | |
Pierre Ossman | b45a84f | 2016-12-12 16:59:15 +0100 | [diff] [blame] | 79 | void SMsgHandler::supportsLEDState() |
| 80 | { |
| 81 | } |
| 82 | |
Pierre Ossman | 5ae2821 | 2017-05-16 14:30:38 +0200 | [diff] [blame] | 83 | void SMsgHandler::supportsQEMUKeyEvent() |
| 84 | { |
| 85 | } |