Let CMsgHandler::serverInit() handle initial set up
Avoid using the callbacks used for runtime changes for the initial
setup. They weren't really useful anyway as you could not allocate
a framebuffer without also knowing the pixel format. So make things
more clear by letting serverInit() get the initial settings.
diff --git a/common/rfb/CMsgHandler.h b/common/rfb/CMsgHandler.h
index 55241da..effdaab 100644
--- a/common/rfb/CMsgHandler.h
+++ b/common/rfb/CMsgHandler.h
@@ -41,9 +41,9 @@
// The following methods are called as corresponding messages are read. A
// derived class should override these methods as desired. Note that for
- // the setDesktopSize(), setExtendedDesktopSize(), setPixelFormat() and
- // setName() methods, a derived class should call on to CMsgHandler's
- // methods to set the members of "server" appropriately.
+ // the setDesktopSize(), setExtendedDesktopSize(), setPixelFormat(),
+ // setName() and serverInit() methods, a derived class should call on to
+ // CMsgHandler's methods to set the members of "server" appropriately.
virtual void setDesktopSize(int w, int h);
virtual void setExtendedDesktopSize(unsigned reason, unsigned result,
@@ -56,7 +56,9 @@
virtual void fence(rdr::U32 flags, unsigned len, const char data[]);
virtual void endOfContinuousUpdates();
virtual void supportsQEMUKeyEvent();
- virtual void serverInit() = 0;
+ virtual void serverInit(int width, int height,
+ const PixelFormat& pf,
+ const char* name) = 0;
virtual void readAndDecodeRect(const Rect& r, int encoding,
ModifiablePixelBuffer* pb) = 0;