diff options
author | Pierre Ossman <ossman@cendio.se> | 2009-03-23 16:48:35 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2009-03-23 16:48:35 +0000 |
commit | e7a41d5862440d8729a1ef142baf04af713e96b2 (patch) | |
tree | e9ef7c3ba526cb327060f52651979599782e9f9f /common/rfb | |
parent | c4661e7eecaf889f4975218a7c1c1b308e898cb8 (diff) | |
download | tigervnc-e7a41d5862440d8729a1ef142baf04af713e96b2.tar.gz tigervnc-e7a41d5862440d8729a1ef142baf04af713e96b2.zip |
Add client method to send SetDesktopSize.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3711 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb')
-rw-r--r-- | common/rfb/CMsgWriter.h | 4 | ||||
-rw-r--r-- | common/rfb/CMsgWriterV3.cxx | 28 | ||||
-rw-r--r-- | common/rfb/CMsgWriterV3.h | 2 |
3 files changed, 34 insertions, 0 deletions
diff --git a/common/rfb/CMsgWriter.h b/common/rfb/CMsgWriter.h index 5794f91d..37755e77 100644 --- a/common/rfb/CMsgWriter.h +++ b/common/rfb/CMsgWriter.h @@ -23,6 +23,7 @@ #define __RFB_CMSGWRITER_H__ #include <rfb/InputHandler.h> +#include <rfb/ScreenSet.h> namespace rdr { class OutStream; } @@ -41,6 +42,9 @@ namespace rfb { virtual void startMsg(int type)=0; virtual void endMsg()=0; + virtual void writeSetDesktopSize(int width, int height, + const ScreenSet& layout)=0; + // CMsgWriter implemented methods virtual void writeSetPixelFormat(const PixelFormat& pf); virtual void writeSetEncodings(int nEncodings, rdr::U32* encodings); diff --git a/common/rfb/CMsgWriterV3.cxx b/common/rfb/CMsgWriterV3.cxx index a9807952..0a44fc65 100644 --- a/common/rfb/CMsgWriterV3.cxx +++ b/common/rfb/CMsgWriterV3.cxx @@ -47,3 +47,31 @@ void CMsgWriterV3::endMsg() { os->flush(); } + +void CMsgWriterV3::writeSetDesktopSize(int width, int height, + const ScreenSet& layout) +{ + if (!cp->supportsSetDesktopSize) + throw Exception("Server does not support SetDesktopSize"); + + startMsg(msgTypeSetDesktopSize); + os->pad(1); + + os->writeU16(width); + os->writeU16(height); + + os->writeU8(layout.num_screens()); + os->pad(1); + + ScreenSet::const_iterator iter; + for (iter = layout.begin();iter != layout.end();++iter) { + os->writeU32(iter->id); + os->writeU16(iter->dimensions.tl.x); + os->writeU16(iter->dimensions.tl.y); + os->writeU16(iter->dimensions.width()); + os->writeU16(iter->dimensions.height()); + os->writeU32(iter->flags); + } + + endMsg(); +} diff --git a/common/rfb/CMsgWriterV3.h b/common/rfb/CMsgWriterV3.h index 0b2f9afe..15c6d6df 100644 --- a/common/rfb/CMsgWriterV3.h +++ b/common/rfb/CMsgWriterV3.h @@ -30,6 +30,8 @@ namespace rfb { virtual void startMsg(int type); virtual void endMsg(); + virtual void writeSetDesktopSize(int width, int height, + const ScreenSet& layout); }; } #endif |