blob: c25e5630f9ef8a10978e27c96777f3df528abf1c [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 Kaplinskya2adc8d2006-05-25 05:01:55 +000043
44 void setVersion(int major, int minor) {
45 majorVersion = major; minorVersion = minor;
46 }
47 bool isVersion(int major, int minor) {
48 return majorVersion == major && minorVersion == minor;
49 }
50 bool beforeVersion(int major, int minor) {
51 return (majorVersion < major ||
52 (majorVersion == major && minorVersion < minor));
53 }
54 bool afterVersion(int major, int minor) {
55 return !beforeVersion(major,minor+1);
56 }
57
58 int width;
59 int height;
Pierre Ossmancbd1b2c2009-03-20 16:05:04 +000060 ScreenSet screenLayout;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000061
62 const PixelFormat& pf() { return pf_; }
63 void setPF(const PixelFormat& pf);
64
65 const char* name() { return name_; }
66 void setName(const char* name);
67
Peter Åstrand98fe98c2010-02-10 07:43:02 +000068 rdr::S32 currentEncoding() { return currentEncoding_; }
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000069 int nEncodings() { return nEncodings_; }
Peter Åstrand98fe98c2010-02-10 07:43:02 +000070 const rdr::S32* encodings() { return encodings_; }
71 void setEncodings(int nEncodings, const rdr::S32* encodings);
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000072 bool useCopyRect;
73
74 bool supportsLocalCursor;
75 bool supportsLocalXCursor;
76 bool supportsDesktopResize;
Pierre Ossmanc5e25602009-03-20 12:59:05 +000077 bool supportsExtendedDesktopSize;
Peter Åstrandc39e0782009-01-15 12:21:42 +000078 bool supportsDesktopRename;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000079 bool supportsLastRect;
80
Pierre Ossmancbd1b2c2009-03-20 16:05:04 +000081 bool supportsSetDesktopSize;
82
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000083 bool customCompressLevel;
84 int compressLevel;
85 bool noJpeg;
86 int qualityLevel;
87
88 private:
89
90 PixelFormat pf_;
91 char* name_;
92 int nEncodings_;
Peter Åstrand98fe98c2010-02-10 07:43:02 +000093 rdr::S32* encodings_;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000094 int currentEncoding_;
95 char verStr[13];
96 int verStrPos;
97 };
98}
99#endif