blob: e186a5f6523aa2f36807fe045fee8a6cbb992731 [file] [log] [blame]
Pierre Ossmanb14a6bc2018-06-18 15:44:26 +02001/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
Pierre Ossman0ff26552016-02-05 10:26:56 +01002 * Copyright 2014-2019 Pierre Ossman for Cendio AB
Pierre Ossmanb14a6bc2018-06-18 15:44:26 +02003 *
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
Steve Kondikc731da12019-09-06 13:27:47 -070054 int width() const { return width_; }
55 int height() const { return height_; }
Pierre Ossmanb14a6bc2018-06-18 15:44:26 +020056 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
Pierre Ossman0ff26552016-02-05 10:26:56 +010072 rdr::U32 clipboardFlags() const { return clipFlags; }
73 void setClipboardCaps(rdr::U32 flags, const rdr::U32* lengths);
74
Pierre Ossmanb14a6bc2018-06-18 15:44:26 +020075 bool supportsQEMUKeyEvent;
Pierre Ossmanb14a6bc2018-06-18 15:44:26 +020076 bool supportsSetDesktopSize;
77 bool supportsFence;
78 bool supportsContinuousUpdates;
79
Pierre Ossmanb14a6bc2018-06-18 15:44:26 +020080 private:
81
82 int width_;
83 int height_;
84 ScreenSet screenLayout_;
85
86 PixelFormat pf_;
87 char* name_;
88 Cursor* cursor_;
89 unsigned int ledState_;
Pierre Ossman0ff26552016-02-05 10:26:56 +010090 rdr::U32 clipFlags;
91 rdr::U32 clipSizes[16];
Pierre Ossmanb14a6bc2018-06-18 15:44:26 +020092 };
93}
94#endif