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 | */ |
Pierre Ossman | cbd1b2c | 2009-03-20 16:05:04 +0000 | [diff] [blame] | 19 | #include <stdio.h> |
| 20 | |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 21 | #include <rfb/Exception.h> |
| 22 | #include <rfb/CMsgHandler.h> |
Pierre Ossman | 49f8822 | 2009-03-20 13:02:50 +0000 | [diff] [blame] | 23 | #include <rfb/screenTypes.h> |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 24 | |
| 25 | using namespace rfb; |
| 26 | |
| 27 | CMsgHandler::CMsgHandler() |
| 28 | { |
| 29 | } |
| 30 | |
| 31 | CMsgHandler::~CMsgHandler() |
| 32 | { |
| 33 | } |
| 34 | |
| 35 | void CMsgHandler::setDesktopSize(int width, int height) |
| 36 | { |
Pierre Ossman | 9312b0e | 2018-06-20 12:25:14 +0200 | [diff] [blame^] | 37 | cp.setDimensions(width, height); |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 38 | } |
| 39 | |
Pierre Ossman | 28c1d54 | 2015-03-03 16:27:44 +0100 | [diff] [blame] | 40 | void CMsgHandler::setExtendedDesktopSize(unsigned reason, unsigned result, |
Pierre Ossman | cbd1b2c | 2009-03-20 16:05:04 +0000 | [diff] [blame] | 41 | int width, int height, |
| 42 | const ScreenSet& layout) |
Pierre Ossman | 49f8822 | 2009-03-20 13:02:50 +0000 | [diff] [blame] | 43 | { |
Pierre Ossman | cbd1b2c | 2009-03-20 16:05:04 +0000 | [diff] [blame] | 44 | cp.supportsSetDesktopSize = true; |
| 45 | |
Pierre Ossman | 28c1d54 | 2015-03-03 16:27:44 +0100 | [diff] [blame] | 46 | if ((reason == reasonClient) && (result != resultSuccess)) |
Pierre Ossman | 49f8822 | 2009-03-20 13:02:50 +0000 | [diff] [blame] | 47 | return; |
| 48 | |
Pierre Ossman | 9312b0e | 2018-06-20 12:25:14 +0200 | [diff] [blame^] | 49 | cp.setDimensions(width, height, layout); |
Pierre Ossman | 49f8822 | 2009-03-20 13:02:50 +0000 | [diff] [blame] | 50 | } |
| 51 | |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 52 | void CMsgHandler::setPixelFormat(const PixelFormat& pf) |
| 53 | { |
| 54 | cp.setPF(pf); |
| 55 | } |
| 56 | |
| 57 | void CMsgHandler::setName(const char* name) |
| 58 | { |
| 59 | cp.setName(name); |
| 60 | } |
| 61 | |
Pierre Ossman | c754cce | 2011-11-14 15:44:11 +0000 | [diff] [blame] | 62 | void CMsgHandler::fence(rdr::U32 flags, unsigned len, const char data[]) |
| 63 | { |
| 64 | cp.supportsFence = true; |
| 65 | } |
Pierre Ossman | c898d9a | 2011-11-14 16:22:23 +0000 | [diff] [blame] | 66 | |
| 67 | void CMsgHandler::endOfContinuousUpdates() |
| 68 | { |
| 69 | cp.supportsContinuousUpdates = true; |
| 70 | } |
Pierre Ossman | f3b0ade | 2015-02-04 14:11:11 +0100 | [diff] [blame] | 71 | |
Pierre Ossman | 5ae2821 | 2017-05-16 14:30:38 +0200 | [diff] [blame] | 72 | void CMsgHandler::supportsQEMUKeyEvent() |
| 73 | { |
| 74 | cp.supportsQEMUKeyEvent = true; |
| 75 | } |
| 76 | |
Pierre Ossman | f3b0ade | 2015-02-04 14:11:11 +0100 | [diff] [blame] | 77 | void CMsgHandler::framebufferUpdateStart() |
| 78 | { |
| 79 | } |
| 80 | |
| 81 | void CMsgHandler::framebufferUpdateEnd() |
| 82 | { |
| 83 | } |
Pierre Ossman | 2fa63f8 | 2016-12-05 15:26:21 +0100 | [diff] [blame] | 84 | |
| 85 | void CMsgHandler::setLEDState(unsigned int state) |
| 86 | { |
| 87 | cp.setLEDState(state); |
| 88 | } |