From dd45b4490100f70e21000c5181540c224e0f3c41 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 31 Oct 2018 17:08:59 +0100 Subject: 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. --- common/rfb/CMsgHandler.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'common/rfb/CMsgHandler.h') diff --git a/common/rfb/CMsgHandler.h b/common/rfb/CMsgHandler.h index 55241dac..effdaabf 100644 --- a/common/rfb/CMsgHandler.h +++ b/common/rfb/CMsgHandler.h @@ -41,9 +41,9 @@ namespace rfb { // 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 @@ namespace rfb { 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; -- cgit v1.2.3