blob: e86c828c6b63f0b82929f022f64fe23227420571 [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>
Pierre Ossman04e62db2009-03-23 16:57:07 +000023#include <utility>
Pierre Ossmanc5e25602009-03-20 12:59:05 +000024
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000025#include <rfb/SMsgWriter.h>
26
27namespace rdr { class MemOutStream; }
28
29namespace 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 Ossman04e62db2009-03-23 16:57:07 +000039 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 Åstrandc39e0782009-01-15 12:21:42 +000043 virtual bool writeSetDesktopName();
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000044 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);
49 virtual void writeFramebufferUpdateStart(int nRects);
50 virtual void writeFramebufferUpdateStart();
51 virtual void writeFramebufferUpdateEnd();
52 virtual bool needFakeUpdate();
53 virtual void startRect(const Rect& r, unsigned int encoding);
54 virtual void endRect();
55
56 private:
57 rdr::MemOutStream* updateOS;
58 rdr::OutStream* realOS;
59 int nRectsInUpdate;
60 int nRectsInHeader;
61 WriteSetCursorCallback* wsccb;
62 bool needSetDesktopSize;
Pierre Ossmanc5e25602009-03-20 12:59:05 +000063 bool needExtendedDesktopSize;
Peter Åstrandc39e0782009-01-15 12:21:42 +000064 bool needSetDesktopName;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000065 bool needLastRect;
Pierre Ossman04e62db2009-03-23 16:57:07 +000066
67 typedef struct {
68 rdr::U16 reason, result;
69 int fb_width, fb_height;
70 ScreenSet layout;
71 } ExtendedDesktopSizeMsg;
72 std::list<ExtendedDesktopSizeMsg> extendedDesktopSizeMsgs;
73
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000074 };
75}
76#endif