blob: 47ec14a339c9ecfd80c5169f064dd7d0f6f8e68c [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>
DRCb4a83232011-08-19 04:57:18 +000028#include <rfb/JpegCompressor.h>
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000029
30namespace rdr { class InStream; }
31
32namespace rfb {
33
34 class ConnParams {
35 public:
36 ConnParams();
37 ~ConnParams();
38
39 bool readVersion(rdr::InStream* is, bool* done);
40 void writeVersion(rdr::OutStream* os);
41
42 int majorVersion;
43 int minorVersion;
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_; }
Pierre Ossman941d2902014-01-15 13:51:53 +010070
Peter Åstrand98fe98c2010-02-10 07:43:02 +000071 void setEncodings(int nEncodings, const rdr::S32* encodings);
Pierre Ossman941d2902014-01-15 13:51:53 +010072
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;
Pierre Ossmanc754cce2011-11-14 15:44:11 +000083 bool supportsFence;
Pierre Ossmanc898d9a2011-11-14 16:22:23 +000084 bool supportsContinuousUpdates;
Pierre Ossmancbd1b2c2009-03-20 16:05:04 +000085
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000086 bool customCompressLevel;
87 int compressLevel;
88 bool noJpeg;
89 int qualityLevel;
DRCb4a83232011-08-19 04:57:18 +000090 int fineQualityLevel;
91 JPEG_SUBSAMP subsampling;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000092
93 private:
94
95 PixelFormat pf_;
96 char* name_;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000097 int currentEncoding_;
98 char verStr[13];
99 int verStrPos;
100 };
101}
102#endif