Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 1 | /* 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 | // CMsgWriter - class for writing RFB messages on the server side. |
| 20 | // |
| 21 | |
| 22 | #ifndef __RFB_CMSGWRITER_H__ |
| 23 | #define __RFB_CMSGWRITER_H__ |
| 24 | |
| 25 | #include <rfb/InputHandler.h> |
| 26 | |
| 27 | namespace rdr { class OutStream; } |
| 28 | |
| 29 | namespace rfb { |
| 30 | |
| 31 | class PixelFormat; |
| 32 | class ConnParams; |
| 33 | struct Rect; |
| 34 | |
| 35 | class CMsgWriter : public InputHandler { |
| 36 | public: |
| 37 | virtual ~CMsgWriter(); |
| 38 | |
| 39 | // CMsgWriter abstract interface methods |
| 40 | virtual void writeClientInit(bool shared)=0; |
| 41 | virtual void startMsg(int type)=0; |
| 42 | virtual void endMsg()=0; |
| 43 | |
| 44 | // CMsgWriter implemented methods |
| 45 | virtual void writeSetPixelFormat(const PixelFormat& pf); |
| 46 | virtual void writeSetEncodings(int nEncodings, rdr::U32* encodings); |
| 47 | virtual void writeSetEncodings(int preferredEncoding, bool useCopyRect); |
| 48 | virtual void writeFramebufferUpdateRequest(const Rect& r,bool incremental); |
| 49 | |
| 50 | // InputHandler implementation |
| 51 | virtual void keyEvent(rdr::U32 key, bool down); |
| 52 | virtual void pointerEvent(const Point& pos, int buttonMask); |
Adam Tkac | acf6c6b | 2009-02-13 12:42:05 +0000 | [diff] [blame^] | 53 | virtual void clientCutText(const char* str, rdr::U32 len); |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 54 | |
| 55 | ConnParams* getConnParams() { return cp; } |
| 56 | rdr::OutStream* getOutStream() { return os; } |
| 57 | |
| 58 | protected: |
| 59 | CMsgWriter(ConnParams* cp, rdr::OutStream* os); |
| 60 | |
| 61 | ConnParams* cp; |
| 62 | rdr::OutStream* os; |
| 63 | }; |
| 64 | } |
| 65 | #endif |