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> |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 22 | |
| 23 | using namespace rfb; |
| 24 | |
| 25 | SMsgHandler::SMsgHandler() |
| 26 | { |
| 27 | } |
| 28 | |
| 29 | SMsgHandler::~SMsgHandler() |
| 30 | { |
| 31 | } |
| 32 | |
| 33 | void SMsgHandler::clientInit(bool shared) |
| 34 | { |
| 35 | } |
| 36 | |
| 37 | void SMsgHandler::setPixelFormat(const PixelFormat& pf) |
| 38 | { |
| 39 | cp.setPF(pf); |
| 40 | } |
| 41 | |
Peter Åstrand | 98fe98c | 2010-02-10 07:43:02 +0000 | [diff] [blame] | 42 | void SMsgHandler::setEncodings(int nEncodings, rdr::S32* encodings) |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 43 | { |
Pierre Ossman | c898d9a | 2011-11-14 16:22:23 +0000 | [diff] [blame^] | 44 | bool firstFence, firstContinuousUpdates; |
Pierre Ossman | c754cce | 2011-11-14 15:44:11 +0000 | [diff] [blame] | 45 | |
| 46 | firstFence = !cp.supportsFence; |
Pierre Ossman | c898d9a | 2011-11-14 16:22:23 +0000 | [diff] [blame^] | 47 | firstContinuousUpdates = !cp.supportsContinuousUpdates; |
Pierre Ossman | c754cce | 2011-11-14 15:44:11 +0000 | [diff] [blame] | 48 | |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 49 | cp.setEncodings(nEncodings, encodings); |
Pierre Ossman | c754cce | 2011-11-14 15:44:11 +0000 | [diff] [blame] | 50 | |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 51 | supportsLocalCursor(); |
Pierre Ossman | c754cce | 2011-11-14 15:44:11 +0000 | [diff] [blame] | 52 | |
| 53 | if (cp.supportsFence && firstFence) |
| 54 | supportsFence(); |
Pierre Ossman | c898d9a | 2011-11-14 16:22:23 +0000 | [diff] [blame^] | 55 | if (cp.supportsContinuousUpdates && firstContinuousUpdates) |
| 56 | supportsContinuousUpdates(); |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 57 | } |
| 58 | |
Pierre Ossman | c5e2560 | 2009-03-20 12:59:05 +0000 | [diff] [blame] | 59 | void SMsgHandler::supportsLocalCursor() |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 60 | { |
| 61 | } |
| 62 | |
Pierre Ossman | c754cce | 2011-11-14 15:44:11 +0000 | [diff] [blame] | 63 | void SMsgHandler::supportsFence() |
| 64 | { |
| 65 | } |
| 66 | |
Pierre Ossman | c898d9a | 2011-11-14 16:22:23 +0000 | [diff] [blame^] | 67 | void SMsgHandler::supportsContinuousUpdates() |
| 68 | { |
| 69 | } |
| 70 | |
Pierre Ossman | 34bb061 | 2009-03-21 21:16:14 +0000 | [diff] [blame] | 71 | void SMsgHandler::setDesktopSize(int fb_width, int fb_height, |
| 72 | const ScreenSet& layout) |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 73 | { |
Pierre Ossman | c5e2560 | 2009-03-20 12:59:05 +0000 | [diff] [blame] | 74 | cp.width = fb_width; |
| 75 | cp.height = fb_height; |
Pierre Ossman | 34bb061 | 2009-03-21 21:16:14 +0000 | [diff] [blame] | 76 | cp.screenLayout = layout; |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 77 | } |
Constantin Kaplinsky | 9d1fc6c | 2008-06-14 05:23:10 +0000 | [diff] [blame] | 78 | |