blob: 78cff2f76d3c321462080c631f7ed558674e48f7 [file] [log] [blame]
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00001/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 */
18//
19// SMsgHandler - class to handle incoming messages on the server side.
20//
21
22#ifndef __RFB_SMSGHANDLER_H__
23#define __RFB_SMSGHANDLER_H__
24
25#include <rdr/types.h>
26#include <rfb/PixelFormat.h>
27#include <rfb/ConnParams.h>
28#include <rfb/InputHandler.h>
29
30namespace rdr { class InStream; }
31
32namespace rfb {
33
34 class SMsgHandler : public InputHandler {
35 public:
36 SMsgHandler();
37 virtual ~SMsgHandler();
38
39 // The following methods are called as corresponding messages are read. A
40 // derived class should override these methods as desired. Note that for
Pierre Ossmanc5e25602009-03-20 12:59:05 +000041 // the setPixelFormat(), setEncodings() and setDesktopSize() methods, a
42 // derived class must call on to SMsgHandler's methods.
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000043
44 virtual void clientInit(bool shared);
45
46 virtual void setPixelFormat(const PixelFormat& pf);
47 virtual void setEncodings(int nEncodings, rdr::U32* encodings);
Pierre Ossmanc5e25602009-03-20 12:59:05 +000048 virtual void framebufferUpdateRequest(const Rect& r, bool incremental) = 0;
49 virtual void setDesktopSize(int fb_width, int fb_height) = 0;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000050
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000051 // InputHandler interface
52 // The InputHandler methods will be called for the corresponding messages.
53
54 // supportsLocalCursor() is called whenever the status of
55 // cp.supportsLocalCursor has changed. At the moment this happens on a
56 // setEncodings message, but in the future this may be due to a message
57 // specially for this purpose.
58 virtual void supportsLocalCursor();
59
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000060 ConnParams cp;
61 };
62}
63#endif