blob: f00b1d6e75a0f774bd08083110ccb982e85ed603 [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>
27
28namespace rdr { class InStream; }
29
30namespace rfb {
31
32 class ConnParams {
33 public:
34 ConnParams();
35 ~ConnParams();
36
37 bool readVersion(rdr::InStream* is, bool* done);
38 void writeVersion(rdr::OutStream* os);
39
40 int majorVersion;
41 int minorVersion;
Constantin Kaplinskyce0907d2006-09-08 12:55:37 +000042 bool tightExtensionsEnabled;
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;
60
61 const PixelFormat& pf() { return pf_; }
62 void setPF(const PixelFormat& pf);
63
64 const char* name() { return name_; }
65 void setName(const char* name);
66
67 rdr::U32 currentEncoding() { return currentEncoding_; }
68 int nEncodings() { return nEncodings_; }
69 const rdr::U32* encodings() { return encodings_; }
70 void setEncodings(int nEncodings, const rdr::U32* encodings);
71 bool useCopyRect;
72
73 bool supportsLocalCursor;
74 bool supportsLocalXCursor;
75 bool supportsDesktopResize;
Peter Åstrandc39e0782009-01-15 12:21:42 +000076 bool supportsDesktopRename;
Constantin Kaplinskya2adc8d2006-05-25 05:01:55 +000077 bool supportsLastRect;
78
79 bool customCompressLevel;
80 int compressLevel;
81 bool noJpeg;
82 int qualityLevel;
83
84 private:
85
86 PixelFormat pf_;
87 char* name_;
88 int nEncodings_;
89 rdr::U32* encodings_;
90 int currentEncoding_;
91 char verStr[13];
92 int verStrPos;
93 };
94}
95#endif