blob: 4554f0933f0ed113ddb33f332efc66b286809864 [file] [log] [blame]
Pierre Ossmanb14a6bc2018-06-18 15:44:26 +02001/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
2 * Copyright 2014-2018 Pierre Ossman for Cendio AB
3 *
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//
20// ServerParams - structure describing the current state of the remote server
21//
22
23#ifndef __RFB_SERVERPARAMS_H__
24#define __RFB_SERVERPARAMS_H__
25
26#include <rfb/Cursor.h>
27#include <rfb/PixelFormat.h>
28#include <rfb/ScreenSet.h>
29
30namespace rfb {
31
32 class ServerParams {
33 public:
34 ServerParams();
35 ~ServerParams();
36
37 int majorVersion;
38 int minorVersion;
39
40 void setVersion(int major, int minor) {
41 majorVersion = major; minorVersion = minor;
42 }
43 bool isVersion(int major, int minor) const {
44 return majorVersion == major && minorVersion == minor;
45 }
46 bool beforeVersion(int major, int minor) const {
47 return (majorVersion < major ||
48 (majorVersion == major && minorVersion < minor));
49 }
50 bool afterVersion(int major, int minor) const {
51 return !beforeVersion(major,minor+1);
52 }
53
54 const int width() const { return width_; }
55 const int height() const { return height_; }
56 const ScreenSet& screenLayout() const { return screenLayout_; }
57 void setDimensions(int width, int height);
58 void setDimensions(int width, int height, const ScreenSet& layout);
59
60 const PixelFormat& pf() const { return pf_; }
61 void setPF(const PixelFormat& pf);
62
63 const char* name() const { return name_; }
64 void setName(const char* name);
65
66 const Cursor& cursor() const { return *cursor_; }
67 void setCursor(const Cursor& cursor);
68
69 unsigned int ledState() { return ledState_; }
70 void setLEDState(unsigned int state);
71
72 bool useCopyRect;
73
74 bool supportsLocalCursor;
75 bool supportsLocalXCursor;
76 bool supportsLocalCursorWithAlpha;
77 bool supportsDesktopResize;
78 bool supportsExtendedDesktopSize;
79 bool supportsDesktopRename;
80 bool supportsLastRect;
81 bool supportsLEDState;
82 bool supportsQEMUKeyEvent;
83
84 bool supportsSetDesktopSize;
85 bool supportsFence;
86 bool supportsContinuousUpdates;
87
88 int compressLevel;
89 int qualityLevel;
90
91 private:
92
93 int width_;
94 int height_;
95 ScreenSet screenLayout_;
96
97 PixelFormat pf_;
98 char* name_;
99 Cursor* cursor_;
100 unsigned int ledState_;
101 };
102}
103#endif