Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 1 | /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. |
Pierre Ossman | 49f8822 | 2009-03-20 13:02:50 +0000 | [diff] [blame] | 2 | * Copyright 2009 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 | { |
| 37 | cp.width = width; |
| 38 | cp.height = height; |
| 39 | } |
| 40 | |
Pierre Ossman | cbd1b2c | 2009-03-20 16:05:04 +0000 | [diff] [blame^] | 41 | void CMsgHandler::setExtendedDesktopSize(int reason, int result, |
| 42 | int width, int height, |
| 43 | const ScreenSet& layout) |
Pierre Ossman | 49f8822 | 2009-03-20 13:02:50 +0000 | [diff] [blame] | 44 | { |
Pierre Ossman | cbd1b2c | 2009-03-20 16:05:04 +0000 | [diff] [blame^] | 45 | cp.supportsSetDesktopSize = true; |
| 46 | |
Pierre Ossman | 49f8822 | 2009-03-20 13:02:50 +0000 | [diff] [blame] | 47 | if ((reason == reasonClient) && (result != resultSuccess)) |
| 48 | return; |
| 49 | |
Pierre Ossman | cbd1b2c | 2009-03-20 16:05:04 +0000 | [diff] [blame^] | 50 | if (!layout.validate(width, height)) |
| 51 | fprintf(stderr, "Server sent us an invalid screen layout\n"); |
| 52 | |
Pierre Ossman | 49f8822 | 2009-03-20 13:02:50 +0000 | [diff] [blame] | 53 | cp.width = width; |
| 54 | cp.height = height; |
Pierre Ossman | cbd1b2c | 2009-03-20 16:05:04 +0000 | [diff] [blame^] | 55 | cp.screenLayout = layout; |
Pierre Ossman | 49f8822 | 2009-03-20 13:02:50 +0000 | [diff] [blame] | 56 | } |
| 57 | |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 58 | void CMsgHandler::setCursor(int w, int h, const Point& hotspot, void* data, void* mask) |
| 59 | { |
| 60 | } |
| 61 | |
| 62 | void CMsgHandler::setPixelFormat(const PixelFormat& pf) |
| 63 | { |
| 64 | cp.setPF(pf); |
| 65 | } |
| 66 | |
| 67 | void CMsgHandler::setName(const char* name) |
| 68 | { |
| 69 | cp.setName(name); |
| 70 | } |
| 71 | |
| 72 | void CMsgHandler::serverInit() |
| 73 | { |
| 74 | throw Exception("CMsgHandler::serverInit called"); |
| 75 | } |
| 76 | |
| 77 | void CMsgHandler::framebufferUpdateStart() |
| 78 | { |
| 79 | } |
| 80 | |
| 81 | void CMsgHandler::framebufferUpdateEnd() |
| 82 | { |
| 83 | } |
| 84 | |
| 85 | void CMsgHandler::beginRect(const Rect& r, unsigned int encoding) |
| 86 | { |
| 87 | } |
| 88 | |
| 89 | void CMsgHandler::endRect(const Rect& r, unsigned int encoding) |
| 90 | { |
| 91 | } |
| 92 | |
| 93 | |
| 94 | void CMsgHandler::setColourMapEntries(int firstColour, int nColours, |
| 95 | rdr::U16* rgbs) |
| 96 | { |
| 97 | throw Exception("CMsgHandler::setColourMapEntries called"); |
| 98 | } |
| 99 | |
| 100 | void CMsgHandler::bell() |
| 101 | { |
| 102 | } |
| 103 | |
Adam Tkac | acf6c6b | 2009-02-13 12:42:05 +0000 | [diff] [blame] | 104 | void CMsgHandler::serverCutText(const char* str, rdr::U32 len) |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 105 | { |
| 106 | } |
| 107 | |
| 108 | void CMsgHandler::fillRect(const Rect& r, Pixel pix) |
| 109 | { |
| 110 | } |
| 111 | |
| 112 | void CMsgHandler::imageRect(const Rect& r, void* pixels) |
| 113 | { |
| 114 | } |
| 115 | |
| 116 | void CMsgHandler::copyRect(const Rect& r, int srcX, int srcY) |
| 117 | { |
| 118 | } |
| 119 | |
| 120 | bool CMsgHandler::processFTMsg(int type) |
| 121 | { |
| 122 | return false; |
| 123 | } |
| 124 | |