]> source.dussan.org Git - tigervnc.git/commitdiff
Add client method to send SetDesktopSize.
authorPierre Ossman <ossman@cendio.se>
Mon, 23 Mar 2009 16:48:35 +0000 (16:48 +0000)
committerPierre Ossman <ossman@cendio.se>
Mon, 23 Mar 2009 16:48:35 +0000 (16:48 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3711 3789f03b-4d11-0410-bbf8-ca57d06f2519

common/rfb/CMsgWriter.h
common/rfb/CMsgWriterV3.cxx
common/rfb/CMsgWriterV3.h

index 5794f91db46263eced8f6fc9cb3d286b2dae3a42..37755e77843ecb2b2417193eda3f544ca7d74af2 100644 (file)
@@ -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);
index a9807952784d608dd6d60c8c753c352422dcbfa4..0a44fc655bfab974a5300dd1a5df106df432cb5e 100644 (file)
@@ -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();
+}
index 0b2f9afedf74b5c396dc067886eadb6572545c9e..15c6d6df6f3a67e28743d1c9a62e3e3b170ae8b5 100644 (file)
@@ -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