blob: 54b5ada139e6d8a982141a277861705fad049858 [file] [log] [blame]
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +00001/* 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// ConnParams - structure containing the connection parameters.
20//
21
22#ifndef __RFB_CONNPARAMS_H__
23#define __RFB_CONNPARAMS_H__
24
25#include <rdr/types.h>
26#include <rfb/PixelFormat.h>
Pierre Ossmancbd1b2c2009-03-20 16:05:04 +000027#include <rfb/ScreenSet.h>
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000028
29namespace rdr { class InStream; }
30
31namespace rfb {
32
33 class ConnParams {
34 public:
35 ConnParams();
36 ~ConnParams();
37
38 bool readVersion(rdr::InStream* is, bool* done);
39 void writeVersion(rdr::OutStream* os);
40
41 int majorVersion;
42 int minorVersion;
Constantin Kaplinskyce0907d2006-09-08 12:55:37 +000043 bool tightExtensionsEnabled;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000044
45 void setVersion(int major, int minor) {
46 majorVersion = major; minorVersion = minor;
47 }
48 bool isVersion(int major, int minor) {
49 return majorVersion == major && minorVersion == minor;
50 }
51 bool beforeVersion(int major, int minor) {
52 return (majorVersion < major ||
53 (majorVersion == major && minorVersion < minor));
54 }
55 bool afterVersion(int major, int minor) {
56 return !beforeVersion(major,minor+1);
57 }
58
59 int width;
60 int height;
Pierre Ossmancbd1b2c2009-03-20 16:05:04 +000061 ScreenSet screenLayout;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000062
63 const PixelFormat& pf() { return pf_; }
64 void setPF(const PixelFormat& pf);
65
66 const char* name() { return name_; }
67 void setName(const char* name);
68
Peter Åstrand98fe98c2010-02-10 07:43:02 +000069 rdr::S32 currentEncoding() { return currentEncoding_; }
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000070 int nEncodings() { return nEncodings_; }
Peter Åstrand98fe98c2010-02-10 07:43:02 +000071 const rdr::S32* encodings() { return encodings_; }
72 void setEncodings(int nEncodings, const rdr::S32* encodings);
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000073 bool useCopyRect;
74
75 bool supportsLocalCursor;
76 bool supportsLocalXCursor;
77 bool supportsDesktopResize;
Pierre Ossmanc5e25602009-03-20 12:59:05 +000078 bool supportsExtendedDesktopSize;
Peter Åstrandc39e0782009-01-15 12:21:42 +000079 bool supportsDesktopRename;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000080 bool supportsLastRect;
81
Pierre Ossmancbd1b2c2009-03-20 16:05:04 +000082 bool supportsSetDesktopSize;
83
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000084 bool customCompressLevel;
85 int compressLevel;
86 bool noJpeg;
87 int qualityLevel;
88
89 private:
90
91 PixelFormat pf_;
92 char* name_;
93 int nEncodings_;
Peter Åstrand98fe98c2010-02-10 07:43:02 +000094 rdr::S32* encodings_;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000095 int currentEncoding_;
96 char verStr[13];
97 int verStrPos;
98 };
99}
100#endif