#define __RFB_CMSGWRITER_H__
#include <rfb/InputHandler.h>
+#include <rfb/ScreenSet.h>
namespace rdr { class OutStream; }
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);
{
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();
+}
virtual void startMsg(int type);
virtual void endMsg();
+ virtual void writeSetDesktopSize(int width, int height,
+ const ScreenSet& layout);
};
}
#endif