blob: 49d407ad14719b5277fa416b648afd34570de990 [file] [log] [blame]
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00001/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
Pierre Ossman49f88222009-03-20 13:02:50 +00002 * Copyright 2009 Pierre Ossman for Cendio AB
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00003 *
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//
20// CMsgHandler - class to handle incoming messages on the client side.
21//
22
23#ifndef __RFB_CMSGHANDLER_H__
24#define __RFB_CMSGHANDLER_H__
25
26#include <rdr/types.h>
27#include <rfb/Pixel.h>
28#include <rfb/ConnParams.h>
29#include <rfb/Rect.h>
30
31namespace rdr { class InStream; }
32
33namespace rfb {
34
35 class CMsgHandler {
36 public:
37 CMsgHandler();
38 virtual ~CMsgHandler();
39
40 // The following methods are called as corresponding messages are read. A
41 // derived class should override these methods as desired. Note that for
Pierre Ossman49f88222009-03-20 13:02:50 +000042 // the setDesktopSize(), setExtendedDesktopSize(), setPixelFormat() and
43 // setName() methods, a derived class should call on to CMsgHandler's
44 // methods to set the members of cp appropriately.
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000045
46 virtual void setDesktopSize(int w, int h);
Pierre Ossman49f88222009-03-20 13:02:50 +000047 virtual void setExtendedDesktopSize(int reason, int result, int w, int h);
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000048 virtual void setCursor(int width, int height, const Point& hotspot,
49 void* data, void* mask);
50 virtual void setPixelFormat(const PixelFormat& pf);
51 virtual void setName(const char* name);
52 virtual void serverInit();
53
54 virtual void framebufferUpdateStart();
55 virtual void framebufferUpdateEnd();
56 virtual void beginRect(const Rect& r, unsigned int encoding);
57 virtual void endRect(const Rect& r, unsigned int encoding);
58
59 virtual void setColourMapEntries(int firstColour, int nColours,
60 rdr::U16* rgbs);
61 virtual void bell();
Adam Tkacacf6c6b2009-02-13 12:42:05 +000062 virtual void serverCutText(const char* str, rdr::U32 len);
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000063
64 virtual void fillRect(const Rect& r, Pixel pix);
65 virtual void imageRect(const Rect& r, void* pixels);
66 virtual void copyRect(const Rect& r, int srcX, int srcY);
67
68 virtual bool processFTMsg(int type);
69
70 ConnParams cp;
71 };
72}
73#endif