blob: 509bfdcb6ad8c271a27253c4c21c0f27a0893bac [file] [log] [blame]
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00001/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
Pierre Ossmanc5e25602009-03-20 12:59:05 +00002 * Copyright 2009 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#ifndef __RFB_SMSGWRITERV3_H__
20#define __RFB_SMSGWRITERV3_H__
21
Pierre Ossmanc5e25602009-03-20 12:59:05 +000022#include <list>
23
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000024#include <rfb/SMsgWriter.h>
25
26namespace rdr { class MemOutStream; }
27
28namespace rfb {
29 class SMsgWriterV3 : public SMsgWriter {
30 public:
31 SMsgWriterV3(ConnParams* cp, rdr::OutStream* os);
32 virtual ~SMsgWriterV3();
33
34 virtual void writeServerInit();
35 virtual void startMsg(int type);
36 virtual void endMsg();
37 virtual bool writeSetDesktopSize();
Pierre Ossmanc5e25602009-03-20 12:59:05 +000038 virtual bool writeExtendedDesktopSize(rdr::U16 error);
Peter Åstrandc39e0782009-01-15 12:21:42 +000039 virtual bool writeSetDesktopName();
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000040 virtual void cursorChange(WriteSetCursorCallback* cb);
41 virtual void writeSetCursor(int width, int height, const Point& hotspot,
42 void* data, void* mask);
43 virtual void writeSetXCursor(int width, int height, int hotspotX,
44 int hotspotY, void* data, void* mask);
45 virtual void writeFramebufferUpdateStart(int nRects);
46 virtual void writeFramebufferUpdateStart();
47 virtual void writeFramebufferUpdateEnd();
48 virtual bool needFakeUpdate();
49 virtual void startRect(const Rect& r, unsigned int encoding);
50 virtual void endRect();
51
52 private:
53 rdr::MemOutStream* updateOS;
54 rdr::OutStream* realOS;
55 int nRectsInUpdate;
56 int nRectsInHeader;
57 WriteSetCursorCallback* wsccb;
58 bool needSetDesktopSize;
Pierre Ossmanc5e25602009-03-20 12:59:05 +000059 bool needExtendedDesktopSize;
60 std::list<rdr::U16> edsErrors;
Peter Åstrandc39e0782009-01-15 12:21:42 +000061 bool needSetDesktopName;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000062 bool needLastRect;
63 };
64}
65#endif