Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 1 | /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. |
Pierre Ossman | c5e2560 | 2009-03-20 12:59:05 +0000 | [diff] [blame] | 2 | * Copyright 2009 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 | #ifndef __RFB_SMSGWRITERV3_H__ |
| 20 | #define __RFB_SMSGWRITERV3_H__ |
| 21 | |
Pierre Ossman | c5e2560 | 2009-03-20 12:59:05 +0000 | [diff] [blame] | 22 | #include <list> |
Pierre Ossman | 04e62db | 2009-03-23 16:57:07 +0000 | [diff] [blame] | 23 | #include <utility> |
Pierre Ossman | c5e2560 | 2009-03-20 12:59:05 +0000 | [diff] [blame] | 24 | |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 25 | #include <rfb/SMsgWriter.h> |
| 26 | |
| 27 | namespace rdr { class MemOutStream; } |
| 28 | |
| 29 | namespace rfb { |
| 30 | class SMsgWriterV3 : public SMsgWriter { |
| 31 | public: |
| 32 | SMsgWriterV3(ConnParams* cp, rdr::OutStream* os); |
| 33 | virtual ~SMsgWriterV3(); |
| 34 | |
| 35 | virtual void writeServerInit(); |
| 36 | virtual void startMsg(int type); |
| 37 | virtual void endMsg(); |
| 38 | virtual bool writeSetDesktopSize(); |
Pierre Ossman | 04e62db | 2009-03-23 16:57:07 +0000 | [diff] [blame] | 39 | virtual bool writeExtendedDesktopSize(); |
| 40 | virtual bool writeExtendedDesktopSize(rdr::U16 reason, rdr::U16 result, |
| 41 | int fb_width, int fb_height, |
| 42 | const ScreenSet& layout); |
Peter Åstrand | c39e078 | 2009-01-15 12:21:42 +0000 | [diff] [blame] | 43 | virtual bool writeSetDesktopName(); |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 44 | virtual void cursorChange(WriteSetCursorCallback* cb); |
| 45 | virtual void writeSetCursor(int width, int height, const Point& hotspot, |
| 46 | void* data, void* mask); |
| 47 | virtual void writeSetXCursor(int width, int height, int hotspotX, |
| 48 | int hotspotY, void* data, void* mask); |
Pierre Ossman | e9962f7 | 2009-04-23 12:31:42 +0000 | [diff] [blame^] | 49 | virtual bool needFakeUpdate(); |
| 50 | virtual bool needNoDataUpdate(); |
| 51 | virtual void writeNoDataUpdate(); |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 52 | virtual void writeFramebufferUpdateStart(int nRects); |
| 53 | virtual void writeFramebufferUpdateStart(); |
| 54 | virtual void writeFramebufferUpdateEnd(); |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 55 | virtual void startRect(const Rect& r, unsigned int encoding); |
| 56 | virtual void endRect(); |
| 57 | |
Pierre Ossman | e9962f7 | 2009-04-23 12:31:42 +0000 | [diff] [blame^] | 58 | protected: |
| 59 | virtual void writePseudoRects(); |
| 60 | virtual void writeNoDataRects(); |
| 61 | |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 62 | private: |
| 63 | rdr::MemOutStream* updateOS; |
| 64 | rdr::OutStream* realOS; |
| 65 | int nRectsInUpdate; |
| 66 | int nRectsInHeader; |
| 67 | WriteSetCursorCallback* wsccb; |
| 68 | bool needSetDesktopSize; |
Pierre Ossman | c5e2560 | 2009-03-20 12:59:05 +0000 | [diff] [blame] | 69 | bool needExtendedDesktopSize; |
Peter Åstrand | c39e078 | 2009-01-15 12:21:42 +0000 | [diff] [blame] | 70 | bool needSetDesktopName; |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 71 | bool needLastRect; |
Pierre Ossman | 04e62db | 2009-03-23 16:57:07 +0000 | [diff] [blame] | 72 | |
| 73 | typedef struct { |
| 74 | rdr::U16 reason, result; |
| 75 | int fb_width, fb_height; |
| 76 | ScreenSet layout; |
| 77 | } ExtendedDesktopSizeMsg; |
| 78 | std::list<ExtendedDesktopSizeMsg> extendedDesktopSizeMsgs; |
| 79 | |
Constantin Kaplinsky | a2adc8d | 2006-05-25 05:01:55 +0000 | [diff] [blame] | 80 | }; |
| 81 | } |
| 82 | #endif |