Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 1 | /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. |
Pierre Ossman | 7638e9c | 2014-01-16 13:12:40 +0100 | [diff] [blame] | 2 | * Copyright 2009-2014 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 | // |
| 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 | |
| 27 | namespace rdr { class InStream; } |
| 28 | |
| 29 | namespace rfb { |
| 30 | class SMsgHandler; |
| 31 | |
| 32 | class SMsgReader { |
| 33 | public: |
Pierre Ossman | 7638e9c | 2014-01-16 13:12:40 +0100 | [diff] [blame] | 34 | SMsgReader(SMsgHandler* handler, rdr::InStream* is); |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 35 | virtual ~SMsgReader(); |
| 36 | |
Pierre Ossman | 7638e9c | 2014-01-16 13:12:40 +0100 | [diff] [blame] | 37 | void readClientInit(); |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 38 | |
| 39 | // readMsg() reads a message, calling the handler as appropriate. |
Pierre Ossman | 7638e9c | 2014-01-16 13:12:40 +0100 | [diff] [blame] | 40 | void readMsg(); |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 41 | |
| 42 | rdr::InStream* getInStream() { return is; } |
| 43 | |
| 44 | protected: |
Pierre Ossman | 7638e9c | 2014-01-16 13:12:40 +0100 | [diff] [blame] | 45 | void readSetPixelFormat(); |
| 46 | void readSetEncodings(); |
| 47 | void readSetDesktopSize(); |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 48 | |
Pierre Ossman | 7638e9c | 2014-01-16 13:12:40 +0100 | [diff] [blame] | 49 | void readFramebufferUpdateRequest(); |
| 50 | void readEnableContinuousUpdates(); |
| 51 | |
| 52 | void readFence(); |
| 53 | |
| 54 | void readKeyEvent(); |
| 55 | void readPointerEvent(); |
| 56 | void readClientCutText(); |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 57 | |
Pierre Ossman | 5ae2821 | 2017-05-16 14:30:38 +0200 | [diff] [blame] | 58 | void readQEMUMessage(); |
| 59 | void readQEMUKeyEvent(); |
| 60 | |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 61 | SMsgHandler* handler; |
| 62 | rdr::InStream* is; |
| 63 | }; |
| 64 | } |
| 65 | #endif |