diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-06-18 15:44:26 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2018-11-01 16:11:42 +0100 |
commit | b14a6bc1aacc3238a1e318d9f165d25674f34d45 (patch) | |
tree | 2ba37543fa3941d738ef73a080ae24750ac125a8 /common/rfb/CMsgWriter.cxx | |
parent | 9312b0e3e16a0eee66945a1220d914067132de9a (diff) | |
download | tigervnc-b14a6bc1aacc3238a1e318d9f165d25674f34d45.tar.gz tigervnc-b14a6bc1aacc3238a1e318d9f165d25674f34d45.zip |
Split out ServerParams from ConnParams
We need to track different things in the server and client, so
separate things to two independent structures to keep things more
clear.
Diffstat (limited to 'common/rfb/CMsgWriter.cxx')
-rw-r--r-- | common/rfb/CMsgWriter.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/common/rfb/CMsgWriter.cxx b/common/rfb/CMsgWriter.cxx index 97c33363..5585652d 100644 --- a/common/rfb/CMsgWriter.cxx +++ b/common/rfb/CMsgWriter.cxx @@ -25,14 +25,14 @@ #include <rfb/Exception.h> #include <rfb/PixelFormat.h> #include <rfb/Rect.h> -#include <rfb/ConnParams.h> +#include <rfb/ServerParams.h> #include <rfb/Decoder.h> #include <rfb/CMsgWriter.h> using namespace rfb; -CMsgWriter::CMsgWriter(ConnParams* cp_, rdr::OutStream* os_) - : cp(cp_), os(os_) +CMsgWriter::CMsgWriter(ServerParams* server_, rdr::OutStream* os_) + : server(server_), os(os_) { } @@ -72,18 +72,18 @@ void CMsgWriter::writeSetEncodings(int preferredEncoding, bool useCopyRect) int nEncodings = 0; rdr::U32 encodings[encodingMax+3]; - if (cp->supportsLocalCursor) { + if (server->supportsLocalCursor) { encodings[nEncodings++] = pseudoEncodingCursorWithAlpha; encodings[nEncodings++] = pseudoEncodingCursor; encodings[nEncodings++] = pseudoEncodingXCursor; } - if (cp->supportsDesktopResize) + if (server->supportsDesktopResize) encodings[nEncodings++] = pseudoEncodingDesktopSize; - if (cp->supportsExtendedDesktopSize) + if (server->supportsExtendedDesktopSize) encodings[nEncodings++] = pseudoEncodingExtendedDesktopSize; - if (cp->supportsDesktopRename) + if (server->supportsDesktopRename) encodings[nEncodings++] = pseudoEncodingDesktopName; - if (cp->supportsLEDState) + if (server->supportsLEDState) encodings[nEncodings++] = pseudoEncodingLEDState; encodings[nEncodings++] = pseudoEncodingLastRect; @@ -132,10 +132,10 @@ void CMsgWriter::writeSetEncodings(int preferredEncoding, bool useCopyRect) } } - if (cp->compressLevel >= 0 && cp->compressLevel <= 9) - encodings[nEncodings++] = pseudoEncodingCompressLevel0 + cp->compressLevel; - if (cp->qualityLevel >= 0 && cp->qualityLevel <= 9) - encodings[nEncodings++] = pseudoEncodingQualityLevel0 + cp->qualityLevel; + if (server->compressLevel >= 0 && server->compressLevel <= 9) + encodings[nEncodings++] = pseudoEncodingCompressLevel0 + server->compressLevel; + if (server->qualityLevel >= 0 && server->qualityLevel <= 9) + encodings[nEncodings++] = pseudoEncodingQualityLevel0 + server->qualityLevel; writeSetEncodings(nEncodings, encodings); } @@ -143,7 +143,7 @@ void CMsgWriter::writeSetEncodings(int preferredEncoding, bool useCopyRect) void CMsgWriter::writeSetDesktopSize(int width, int height, const ScreenSet& layout) { - if (!cp->supportsSetDesktopSize) + if (!server->supportsSetDesktopSize) throw Exception("Server does not support SetDesktopSize"); startMsg(msgTypeSetDesktopSize); @@ -182,7 +182,7 @@ void CMsgWriter::writeFramebufferUpdateRequest(const Rect& r, bool incremental) void CMsgWriter::writeEnableContinuousUpdates(bool enable, int x, int y, int w, int h) { - if (!cp->supportsContinuousUpdates) + if (!server->supportsContinuousUpdates) throw Exception("Server does not support continuous updates"); startMsg(msgTypeEnableContinuousUpdates); @@ -199,7 +199,7 @@ void CMsgWriter::writeEnableContinuousUpdates(bool enable, void CMsgWriter::writeFence(rdr::U32 flags, unsigned len, const char data[]) { - if (!cp->supportsFence) + if (!server->supportsFence) throw Exception("Server does not support fences"); if (len > 64) throw Exception("Too large fence payload"); @@ -219,7 +219,7 @@ void CMsgWriter::writeFence(rdr::U32 flags, unsigned len, const char data[]) void CMsgWriter::writeKeyEvent(rdr::U32 keysym, rdr::U32 keycode, bool down) { - if (!cp->supportsQEMUKeyEvent || !keycode) { + if (!server->supportsQEMUKeyEvent || !keycode) { /* This event isn't meaningful without a valid keysym */ if (!keysym) return; @@ -245,8 +245,8 @@ void CMsgWriter::writePointerEvent(const Point& pos, int buttonMask) Point p(pos); if (p.x < 0) p.x = 0; if (p.y < 0) p.y = 0; - if (p.x >= cp->width()) p.x = cp->width() - 1; - if (p.y >= cp->height()) p.y = cp->height() - 1; + if (p.x >= server->width()) p.x = server->width() - 1; + if (p.y >= server->height()) p.y = server->height() - 1; startMsg(msgTypePointerEvent); os->writeU8(buttonMask); |