blob: 4991fd38ca966f0d2075f94d6c25a6b2c733d649 [file] [log] [blame]
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00001/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
Pierre Ossman0ff26552016-02-05 10:26:56 +01002 * Copyright 2009-2019 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// SMsgReader - class for reading RFB messages on the server side
21// (i.e. messages from client to server).
22//
23
24#ifndef __RFB_SMSGREADER_H__
25#define __RFB_SMSGREADER_H__
26
27namespace rdr { class InStream; }
28
29namespace rfb {
30 class SMsgHandler;
31
32 class SMsgReader {
33 public:
Pierre Ossman7638e9c2014-01-16 13:12:40 +010034 SMsgReader(SMsgHandler* handler, rdr::InStream* is);
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000035 virtual ~SMsgReader();
36
Pierre Ossman7638e9c2014-01-16 13:12:40 +010037 void readClientInit();
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000038
39 // readMsg() reads a message, calling the handler as appropriate.
Pierre Ossman7638e9c2014-01-16 13:12:40 +010040 void readMsg();
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000041
42 rdr::InStream* getInStream() { return is; }
43
44 protected:
Pierre Ossman7638e9c2014-01-16 13:12:40 +010045 void readSetPixelFormat();
46 void readSetEncodings();
47 void readSetDesktopSize();
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000048
Pierre Ossman7638e9c2014-01-16 13:12:40 +010049 void readFramebufferUpdateRequest();
50 void readEnableContinuousUpdates();
51
52 void readFence();
53
54 void readKeyEvent();
55 void readPointerEvent();
56 void readClientCutText();
Pierre Ossman0ff26552016-02-05 10:26:56 +010057 void readExtendedClipboard(rdr::S32 len);
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000058
Pierre Ossman5ae28212017-05-16 14:30:38 +020059 void readQEMUMessage();
60 void readQEMUKeyEvent();
61
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000062 SMsgHandler* handler;
63 rdr::InStream* is;
64 };
65}
66#endif