diff options
author | Pierre Ossman <ossman@cendio.se> | 2024-04-03 17:26:03 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2024-06-24 13:47:18 +0200 |
commit | e3132b406de025ec4ecd612977425c7e7273ecf9 (patch) | |
tree | 815ab6630f84810b0e4c9b2c65917287b4e01692 /common/rfb | |
parent | 8530a1bd034feee8bd6e3a436887af187b058f2b (diff) | |
download | tigervnc-e3132b406de025ec4ecd612977425c7e7273ecf9.tar.gz tigervnc-e3132b406de025ec4ecd612977425c7e7273ecf9.zip |
Mark overridden virtual functions
Use the new "override" keyword to properly differentiate between new
virtual methods, and existing virtual methods being overridden.
Diffstat (limited to 'common/rfb')
49 files changed, 284 insertions, 280 deletions
diff --git a/common/rfb/CConnection.h b/common/rfb/CConnection.h index df0fbb14..dca98a92 100644 --- a/common/rfb/CConnection.h +++ b/common/rfb/CConnection.h @@ -97,34 +97,32 @@ namespace rfb { // Note: These must be called by any deriving classes - virtual void setDesktopSize(int w, int h); - virtual void setExtendedDesktopSize(unsigned reason, unsigned result, - int w, int h, - const ScreenSet& layout); + void setDesktopSize(int w, int h) override; + void setExtendedDesktopSize(unsigned reason, unsigned result, + int w, int h, + const ScreenSet& layout) override; - virtual void endOfContinuousUpdates(); + void endOfContinuousUpdates() override; - virtual void serverInit(int width, int height, - const PixelFormat& pf, - const char* name); + void serverInit(int width, int height, const PixelFormat& pf, + const char* name) override; - virtual bool readAndDecodeRect(const Rect& r, int encoding, - ModifiablePixelBuffer* pb); + bool readAndDecodeRect(const Rect& r, int encoding, + ModifiablePixelBuffer* pb) override; - virtual void framebufferUpdateStart(); - virtual void framebufferUpdateEnd(); - virtual bool dataRect(const Rect& r, int encoding); + void framebufferUpdateStart() override; + void framebufferUpdateEnd() override; + bool dataRect(const Rect& r, int encoding) override; - virtual void serverCutText(const char* str); + void serverCutText(const char* str) override; - virtual void handleClipboardCaps(uint32_t flags, - const uint32_t* lengths); - virtual void handleClipboardRequest(uint32_t flags); - virtual void handleClipboardPeek(); - virtual void handleClipboardNotify(uint32_t flags); - virtual void handleClipboardProvide(uint32_t flags, - const size_t* lengths, - const uint8_t* const* data); + void handleClipboardCaps(uint32_t flags, + const uint32_t* lengths) override; + void handleClipboardRequest(uint32_t flags) override; + void handleClipboardPeek() override; + void handleClipboardNotify(uint32_t flags) override; + void handleClipboardProvide(uint32_t flags, const size_t* lengths, + const uint8_t* const* data) override; // Methods to be overridden in a derived class @@ -249,7 +247,7 @@ namespace rfb { // responds to requests, stating no support for synchronisation. // When overriding, call CMsgHandler::fence() directly in order to // state correct support for fence flags. - virtual void fence(uint32_t flags, unsigned len, const uint8_t data[]); + void fence(uint32_t flags, unsigned len, const uint8_t data[]) override; private: bool processVersionMsg(); diff --git a/common/rfb/CSecurityDH.h b/common/rfb/CSecurityDH.h index d0e5e894..df33d29b 100644 --- a/common/rfb/CSecurityDH.h +++ b/common/rfb/CSecurityDH.h @@ -33,9 +33,9 @@ namespace rfb { public: CSecurityDH(CConnection* cc); virtual ~CSecurityDH(); - virtual bool processMsg(); - virtual int getType() const { return secTypeDH; } - virtual bool isSecure() const { return false; } + bool processMsg() override; + int getType() const override { return secTypeDH; } + bool isSecure() const override { return false; } private: bool readKey(); diff --git a/common/rfb/CSecurityMSLogonII.h b/common/rfb/CSecurityMSLogonII.h index f7c83a3e..71600c85 100644 --- a/common/rfb/CSecurityMSLogonII.h +++ b/common/rfb/CSecurityMSLogonII.h @@ -33,9 +33,9 @@ namespace rfb { public: CSecurityMSLogonII(CConnection* cc); virtual ~CSecurityMSLogonII(); - virtual bool processMsg(); - virtual int getType() const { return secTypeMSLogonII; } - virtual bool isSecure() const { return false; } + bool processMsg() override; + int getType() const override { return secTypeMSLogonII; } + bool isSecure() const override { return false; } private: bool readKey(); diff --git a/common/rfb/CSecurityNone.h b/common/rfb/CSecurityNone.h index cb887914..98379c73 100644 --- a/common/rfb/CSecurityNone.h +++ b/common/rfb/CSecurityNone.h @@ -30,8 +30,8 @@ namespace rfb { class CSecurityNone : public CSecurity { public: CSecurityNone(CConnection* cc) : CSecurity(cc) {} - virtual bool processMsg() { return true; } - virtual int getType() const {return secTypeNone;} + bool processMsg() override { return true; } + int getType() const override {return secTypeNone;} }; } #endif diff --git a/common/rfb/CSecurityPlain.h b/common/rfb/CSecurityPlain.h index add7e776..0cc9e8ed 100644 --- a/common/rfb/CSecurityPlain.h +++ b/common/rfb/CSecurityPlain.h @@ -27,8 +27,8 @@ namespace rfb { class CSecurityPlain : public CSecurity { public: CSecurityPlain(CConnection* cc) : CSecurity(cc) {} - virtual bool processMsg(); - virtual int getType() const { return secTypePlain; } + bool processMsg() override; + int getType() const override { return secTypePlain; } }; } #endif diff --git a/common/rfb/CSecurityRSAAES.h b/common/rfb/CSecurityRSAAES.h index 543b0152..29bfd575 100644 --- a/common/rfb/CSecurityRSAAES.h +++ b/common/rfb/CSecurityRSAAES.h @@ -39,9 +39,9 @@ namespace rfb { CSecurityRSAAES(CConnection* cc, uint32_t secType, int keySize, bool isAllEncrypted); virtual ~CSecurityRSAAES(); - virtual bool processMsg(); - virtual int getType() const { return secType; } - virtual bool isSecure() const { return secType == secTypeRA256; } + bool processMsg() override; + int getType() const override { return secType; } + bool isSecure() const override { return secType == secTypeRA256; } static IntParameter RSAKeyLength; diff --git a/common/rfb/CSecurityStack.h b/common/rfb/CSecurityStack.h index 8eadc151..521597ec 100644 --- a/common/rfb/CSecurityStack.h +++ b/common/rfb/CSecurityStack.h @@ -30,9 +30,9 @@ namespace rfb { CSecurityStack(CConnection* cc, int Type, CSecurity* s0 = nullptr, CSecurity* s1 = nullptr); ~CSecurityStack(); - virtual bool processMsg(); - virtual int getType() const {return type;}; - virtual bool isSecure() const; + bool processMsg() override; + int getType() const override {return type;}; + bool isSecure() const override; protected: int state; CSecurity* state0; diff --git a/common/rfb/CSecurityTLS.h b/common/rfb/CSecurityTLS.h index b9c345cf..8688b742 100644 --- a/common/rfb/CSecurityTLS.h +++ b/common/rfb/CSecurityTLS.h @@ -38,9 +38,9 @@ namespace rfb { public: CSecurityTLS(CConnection* cc, bool _anon); virtual ~CSecurityTLS(); - virtual bool processMsg(); - virtual int getType() const { return anon ? secTypeTLSNone : secTypeX509None; } - virtual bool isSecure() const { return !anon; } + bool processMsg() override; + int getType() const override { return anon ? secTypeTLSNone : secTypeX509None; } + bool isSecure() const override { return !anon; } static StringParameter X509CA; static StringParameter X509CRL; diff --git a/common/rfb/CSecurityVeNCrypt.h b/common/rfb/CSecurityVeNCrypt.h index 476bf813..f73e7927 100644 --- a/common/rfb/CSecurityVeNCrypt.h +++ b/common/rfb/CSecurityVeNCrypt.h @@ -37,9 +37,9 @@ namespace rfb { CSecurityVeNCrypt(CConnection* cc, SecurityClient* sec); ~CSecurityVeNCrypt(); - virtual bool processMsg(); - int getType() const {return chosenType;} - virtual bool isSecure() const; + bool processMsg() override; + int getType() const override {return chosenType;} + bool isSecure() const override; protected: CSecurity *csecurity; diff --git a/common/rfb/CSecurityVncAuth.h b/common/rfb/CSecurityVncAuth.h index 3f1f315b..66a6c92d 100644 --- a/common/rfb/CSecurityVncAuth.h +++ b/common/rfb/CSecurityVncAuth.h @@ -27,8 +27,8 @@ namespace rfb { public: CSecurityVncAuth(CConnection* cc) : CSecurity(cc) {} virtual ~CSecurityVncAuth() {} - virtual bool processMsg(); - virtual int getType() const {return secTypeVncAuth;}; + bool processMsg() override; + int getType() const override {return secTypeVncAuth;}; }; } #endif diff --git a/common/rfb/Configuration.h b/common/rfb/Configuration.h index 0c572cfa..ec8d789a 100644 --- a/common/rfb/Configuration.h +++ b/common/rfb/Configuration.h @@ -196,12 +196,12 @@ namespace rfb { public: AliasParameter(const char* name_, const char* desc_,VoidParameter* param_, ConfigurationObject co=ConfGlobal); - virtual bool setParam(const char* value); - virtual bool setParam(); - virtual std::string getDefaultStr() const; - virtual std::string getValueStr() const; - virtual bool isBool() const; - virtual void setImmutable(); + bool setParam(const char* value) override; + bool setParam() override; + std::string getDefaultStr() const override; + std::string getValueStr() const override; + bool isBool() const override; + void setImmutable() override; private: VoidParameter* param; }; @@ -210,12 +210,12 @@ namespace rfb { public: BoolParameter(const char* name_, const char* desc_, bool v, ConfigurationObject co=ConfGlobal); - virtual bool setParam(const char* value); - virtual bool setParam(); + bool setParam(const char* value) override; + bool setParam() override; virtual void setParam(bool b); - virtual std::string getDefaultStr() const; - virtual std::string getValueStr() const; - virtual bool isBool() const; + std::string getDefaultStr() const override; + std::string getValueStr() const override; + bool isBool() const override; operator bool() const; protected: bool value; @@ -228,10 +228,10 @@ namespace rfb { int minValue=INT_MIN, int maxValue=INT_MAX, ConfigurationObject co=ConfGlobal); using VoidParameter::setParam; - virtual bool setParam(const char* value); + bool setParam(const char* value) override; virtual bool setParam(int v); - virtual std::string getDefaultStr() const; - virtual std::string getValueStr() const; + std::string getDefaultStr() const override; + std::string getValueStr() const override; operator int() const; protected: int value; @@ -245,10 +245,10 @@ namespace rfb { // be Null, and so neither can the default value! StringParameter(const char* name_, const char* desc_, const char* v, ConfigurationObject co=ConfGlobal); - virtual ~StringParameter(); - virtual bool setParam(const char* value); - virtual std::string getDefaultStr() const; - virtual std::string getValueStr() const; + ~StringParameter() override; + bool setParam(const char* value) override; + std::string getDefaultStr() const override; + std::string getValueStr() const override; operator const char*() const; protected: std::string value; @@ -261,11 +261,11 @@ namespace rfb { const uint8_t* v, size_t l, ConfigurationObject co=ConfGlobal); using VoidParameter::setParam; - virtual ~BinaryParameter(); - virtual bool setParam(const char* value); + ~BinaryParameter() override; + bool setParam(const char* value) override; virtual void setParam(const uint8_t* v, size_t l); - virtual std::string getDefaultStr() const; - virtual std::string getValueStr() const; + std::string getDefaultStr() const override; + std::string getValueStr() const override; std::vector<uint8_t> getData() const; diff --git a/common/rfb/CopyRectDecoder.h b/common/rfb/CopyRectDecoder.h index c9f9c890..51651196 100644 --- a/common/rfb/CopyRectDecoder.h +++ b/common/rfb/CopyRectDecoder.h @@ -26,14 +26,15 @@ namespace rfb { public: CopyRectDecoder(); virtual ~CopyRectDecoder(); - virtual bool readRect(const Rect& r, rdr::InStream* is, - const ServerParams& server, rdr::OutStream* os); - virtual void getAffectedRegion(const Rect& rect, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - Region* region); - virtual void decodeRect(const Rect& r, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - ModifiablePixelBuffer* pb); + bool readRect(const Rect& r, rdr::InStream* is, + const ServerParams& server, + rdr::OutStream* os) override; + void getAffectedRegion(const Rect& rect, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + Region* region) override; + void decodeRect(const Rect& r, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + ModifiablePixelBuffer* pb) override; }; } #endif diff --git a/common/rfb/Cursor.h b/common/rfb/Cursor.h index 31d6fda9..c71f5a77 100644 --- a/common/rfb/Cursor.h +++ b/common/rfb/Cursor.h @@ -62,7 +62,7 @@ namespace rfb { Rect getEffectiveRect() const { return buffer.getRect(offset); } - virtual const uint8_t* getBuffer(const Rect& r, int* stride) const; + const uint8_t* getBuffer(const Rect& r, int* stride) const override; void update(PixelBuffer* framebuffer, Cursor* cursor, const Point& pos); diff --git a/common/rfb/DecodeManager.h b/common/rfb/DecodeManager.h index a8e0cac9..5435bfc1 100644 --- a/common/rfb/DecodeManager.h +++ b/common/rfb/DecodeManager.h @@ -98,7 +98,7 @@ namespace rfb { void stop(); protected: - void worker(); + void worker() override; DecodeManager::QueueEntry* findEntry(); private: diff --git a/common/rfb/EncodeManager.h b/common/rfb/EncodeManager.h index 33484db8..a01a1614 100644 --- a/common/rfb/EncodeManager.h +++ b/common/rfb/EncodeManager.h @@ -61,7 +61,7 @@ namespace rfb { size_t maxUpdateSize); protected: - virtual void handleTimeout(Timer* t); + void handleTimeout(Timer* t) override; void doUpdate(bool allowLossy, const Region& changed, const Region& copied, const Point& copy_delta, @@ -142,7 +142,7 @@ namespace rfb { const uint8_t* data_, int stride); private: - virtual uint8_t* getBufferRW(const Rect& r, int* stride); + uint8_t* getBufferRW(const Rect& r, int* stride) override; }; OffsetPixelBuffer offsetPixelBuffer; diff --git a/common/rfb/H264Decoder.h b/common/rfb/H264Decoder.h index b4f5553e..8ba47799 100644 --- a/common/rfb/H264Decoder.h +++ b/common/rfb/H264Decoder.h @@ -33,11 +33,12 @@ namespace rfb { public: H264Decoder(); virtual ~H264Decoder(); - virtual bool readRect(const Rect& r, rdr::InStream* is, - const ServerParams& server, rdr::OutStream* os); - virtual void decodeRect(const Rect& r, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - ModifiablePixelBuffer* pb); + bool readRect(const Rect& r, rdr::InStream* is, + const ServerParams& server, + rdr::OutStream* os) override; + void decodeRect(const Rect& r, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + ModifiablePixelBuffer* pb) override; private: void resetContexts(); diff --git a/common/rfb/H264LibavDecoderContext.h b/common/rfb/H264LibavDecoderContext.h index 148ba1ad..f399b3cc 100644 --- a/common/rfb/H264LibavDecoderContext.h +++ b/common/rfb/H264LibavDecoderContext.h @@ -34,12 +34,12 @@ namespace rfb { H264LibavDecoderContext(const Rect &r) : H264DecoderContext(r) {} ~H264LibavDecoderContext() { freeCodec(); } - virtual void decode(const uint8_t* h264_buffer, uint32_t len, - ModifiablePixelBuffer* pb); + void decode(const uint8_t* h264_buffer, uint32_t len, + ModifiablePixelBuffer* pb) override; protected: - virtual bool initCodec(); - virtual void freeCodec(); + bool initCodec() override; + void freeCodec() override; private: uint8_t* makeH264WorkBuffer(const uint8_t* buffer, uint32_t len); diff --git a/common/rfb/H264WinDecoderContext.h b/common/rfb/H264WinDecoderContext.h index 702d8dd6..92041781 100644 --- a/common/rfb/H264WinDecoderContext.h +++ b/common/rfb/H264WinDecoderContext.h @@ -33,12 +33,12 @@ namespace rfb { H264WinDecoderContext(const Rect &r) : H264DecoderContext(r) {}; ~H264WinDecoderContext() { freeCodec(); } - virtual void decode(const uint8_t* h264_buffer, uint32_t len, - ModifiablePixelBuffer* pb); + void decode(const uint8_t* h264_buffer, uint32_t len, + ModifiablePixelBuffer* pb) override; protected: - virtual bool initCodec(); - virtual void freeCodec(); + bool initCodec() override; + void freeCodec() override; private: LONG stride; diff --git a/common/rfb/HextileDecoder.h b/common/rfb/HextileDecoder.h index 9163b5bb..38e8b776 100644 --- a/common/rfb/HextileDecoder.h +++ b/common/rfb/HextileDecoder.h @@ -29,11 +29,12 @@ namespace rfb { public: HextileDecoder(); virtual ~HextileDecoder(); - virtual bool readRect(const Rect& r, rdr::InStream* is, - const ServerParams& server, rdr::OutStream* os); - virtual void decodeRect(const Rect& r, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - ModifiablePixelBuffer* pb); + bool readRect(const Rect& r, rdr::InStream* is, + const ServerParams& server, + rdr::OutStream* os) override; + void decodeRect(const Rect& r, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + ModifiablePixelBuffer* pb) override; private: template<class T> inline T readPixel(rdr::InStream* is); diff --git a/common/rfb/HextileEncoder.h b/common/rfb/HextileEncoder.h index 20721b7c..55f0508d 100644 --- a/common/rfb/HextileEncoder.h +++ b/common/rfb/HextileEncoder.h @@ -27,11 +27,11 @@ namespace rfb { public: HextileEncoder(SConnection* conn); virtual ~HextileEncoder(); - virtual bool isSupported(); - virtual void writeRect(const PixelBuffer* pb, const Palette& palette); - virtual void writeSolidRect(int width, int height, - const PixelFormat& pf, - const uint8_t* colour); + bool isSupported() override; + void writeRect(const PixelBuffer* pb, + const Palette& palette) override; + void writeSolidRect(int width, int height, const PixelFormat& pf, + const uint8_t* colour) override; private: template<class T> inline void writePixel(rdr::OutStream* os, T pixel); diff --git a/common/rfb/KeyRemapper.cxx b/common/rfb/KeyRemapper.cxx index 762eb413..328955d7 100644 --- a/common/rfb/KeyRemapper.cxx +++ b/common/rfb/KeyRemapper.cxx @@ -89,7 +89,7 @@ public: : StringParameter("RemapKeys", "Comma-separated list of incoming keysyms to remap. Mappings are expressed as two hex values, prefixed by 0x, and separated by ->", "") { KeyRemapper::defInstance.setMapping(""); } - bool setParam(const char* v) { + bool setParam(const char* v) override { KeyRemapper::defInstance.setMapping(v); return StringParameter::setParam(v); } diff --git a/common/rfb/LogWriter.h b/common/rfb/LogWriter.h index 6eff6da1..d1fd4990 100644 --- a/common/rfb/LogWriter.h +++ b/common/rfb/LogWriter.h @@ -104,7 +104,7 @@ namespace rfb { class LogParameter : public StringParameter { public: LogParameter(); - virtual bool setParam(const char* v); + bool setParam(const char* v) override; }; extern LogParameter logParams; diff --git a/common/rfb/Logger_file.h b/common/rfb/Logger_file.h index 4542d23c..6f2a4ef6 100644 --- a/common/rfb/Logger_file.h +++ b/common/rfb/Logger_file.h @@ -35,7 +35,7 @@ namespace rfb { Logger_File(const char* loggerName); ~Logger_File(); - virtual void write(int level, const char *logname, const char *message); + void write(int level, const char *logname, const char *message) override; void setFilename(const char* filename); void setFile(FILE* file); diff --git a/common/rfb/Logger_syslog.h b/common/rfb/Logger_syslog.h index cf987281..20c46a5f 100644 --- a/common/rfb/Logger_syslog.h +++ b/common/rfb/Logger_syslog.h @@ -31,7 +31,7 @@ namespace rfb { Logger_Syslog(const char* loggerName); virtual ~Logger_Syslog(); - virtual void write(int level, const char *logname, const char *message); + void write(int level, const char *logname, const char *message) override; }; void initSyslogLogger(); diff --git a/common/rfb/PixelBuffer.h b/common/rfb/PixelBuffer.h index 33a9c7ae..963fbbf6 100644 --- a/common/rfb/PixelBuffer.h +++ b/common/rfb/PixelBuffer.h @@ -151,16 +151,16 @@ namespace rfb { virtual ~FullFramePixelBuffer(); public: - virtual const uint8_t* getBuffer(const Rect& r, int* stride) const; - virtual uint8_t* getBufferRW(const Rect& r, int* stride); - virtual void commitBufferRW(const Rect& r); + const uint8_t* getBuffer(const Rect& r, int* stride) const override; + uint8_t* getBufferRW(const Rect& r, int* stride) override; + void commitBufferRW(const Rect& r) override; protected: FullFramePixelBuffer(); virtual void setBuffer(int width, int height, uint8_t* data, int stride); private: - virtual void setSize(int w, int h); + void setSize(int w, int h) override; private: uint8_t* data; @@ -178,7 +178,7 @@ namespace rfb { // Manage the pixel buffer layout virtual void setPF(const PixelFormat &pf); - virtual void setSize(int w, int h); + void setSize(int w, int h) override; private: uint8_t* data_; // Mirrors FullFramePixelBuffer::data diff --git a/common/rfb/RREDecoder.h b/common/rfb/RREDecoder.h index a1d7f9b8..8490146c 100644 --- a/common/rfb/RREDecoder.h +++ b/common/rfb/RREDecoder.h @@ -29,11 +29,12 @@ namespace rfb { public: RREDecoder(); virtual ~RREDecoder(); - virtual bool readRect(const Rect& r, rdr::InStream* is, - const ServerParams& server, rdr::OutStream* os); - virtual void decodeRect(const Rect& r, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - ModifiablePixelBuffer* pb); + bool readRect(const Rect& r, rdr::InStream* is, + const ServerParams& server, + rdr::OutStream* os) override; + void decodeRect(const Rect& r, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + ModifiablePixelBuffer* pb) override; private: template<class T> inline T readPixel(rdr::InStream* is); diff --git a/common/rfb/RREEncoder.h b/common/rfb/RREEncoder.h index b13135b4..e21586ec 100644 --- a/common/rfb/RREEncoder.h +++ b/common/rfb/RREEncoder.h @@ -29,11 +29,11 @@ namespace rfb { public: RREEncoder(SConnection* conn); virtual ~RREEncoder(); - virtual bool isSupported(); - virtual void writeRect(const PixelBuffer* pb, const Palette& palette); - virtual void writeSolidRect(int width, int height, - const PixelFormat& pf, - const uint8_t* colour); + bool isSupported() override; + void writeRect(const PixelBuffer* pb, + const Palette& palette) override; + void writeSolidRect(int width, int height, const PixelFormat& pf, + const uint8_t* colour) override; private: template<class T> inline void writePixel(rdr::OutStream* os, T pixel); diff --git a/common/rfb/RawDecoder.h b/common/rfb/RawDecoder.h index 33948ced..2ac8b0bd 100644 --- a/common/rfb/RawDecoder.h +++ b/common/rfb/RawDecoder.h @@ -25,11 +25,12 @@ namespace rfb { public: RawDecoder(); virtual ~RawDecoder(); - virtual bool readRect(const Rect& r, rdr::InStream* is, - const ServerParams& server, rdr::OutStream* os); - virtual void decodeRect(const Rect& r, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - ModifiablePixelBuffer* pb); + bool readRect(const Rect& r, rdr::InStream* is, + const ServerParams& server, + rdr::OutStream* os) override; + void decodeRect(const Rect& r, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + ModifiablePixelBuffer* pb) override; }; } #endif diff --git a/common/rfb/RawEncoder.h b/common/rfb/RawEncoder.h index 76da4c5b..e191645c 100644 --- a/common/rfb/RawEncoder.h +++ b/common/rfb/RawEncoder.h @@ -27,11 +27,11 @@ namespace rfb { public: RawEncoder(SConnection* conn); virtual ~RawEncoder(); - virtual bool isSupported(); - virtual void writeRect(const PixelBuffer* pb, const Palette& palette); - virtual void writeSolidRect(int width, int height, - const PixelFormat& pf, - const uint8_t* colour); + bool isSupported() override; + void writeRect(const PixelBuffer* pb, + const Palette& palette) override; + void writeSolidRect(int width, int height, const PixelFormat& pf, + const uint8_t* colour) override; }; } #endif diff --git a/common/rfb/SConnection.h b/common/rfb/SConnection.h index fb3ae15a..2ac53269 100644 --- a/common/rfb/SConnection.h +++ b/common/rfb/SConnection.h @@ -83,18 +83,17 @@ namespace rfb { // Overridden from SMsgHandler - virtual void setEncodings(int nEncodings, const int32_t* encodings); + void setEncodings(int nEncodings, const int32_t* encodings) override; - virtual void clientCutText(const char* str); + void clientCutText(const char* str) override; - virtual void handleClipboardRequest(uint32_t flags); - virtual void handleClipboardPeek(); - virtual void handleClipboardNotify(uint32_t flags); - virtual void handleClipboardProvide(uint32_t flags, - const size_t* lengths, - const uint8_t* const* data); + void handleClipboardRequest(uint32_t flags) override; + void handleClipboardPeek() override; + void handleClipboardNotify(uint32_t flags) override; + void handleClipboardProvide(uint32_t flags, const size_t* lengths, + const uint8_t* const* data) override; - virtual void supportsQEMUKeyEvent(); + void supportsQEMUKeyEvent() override; // Methods to be overridden in a derived class @@ -118,27 +117,27 @@ namespace rfb { // clientInit() is called when the ClientInit message is received. The // derived class must call on to SConnection::clientInit(). - virtual void clientInit(bool shared); + void clientInit(bool shared) override; // setPixelFormat() is called when a SetPixelFormat message is received. // The derived class must call on to SConnection::setPixelFormat(). - virtual void setPixelFormat(const PixelFormat& pf); + void setPixelFormat(const PixelFormat& pf) override; // framebufferUpdateRequest() is called when a FramebufferUpdateRequest // message is received. The derived class must call on to // SConnection::framebufferUpdateRequest(). - virtual void framebufferUpdateRequest(const Rect& r, bool incremental); + void framebufferUpdateRequest(const Rect& r, bool incremental) override; // fence() is called when we get a fence request or response. By default // it responds directly to requests (stating it doesn't support any // synchronisation) and drops responses. Override to implement more proper // support. - virtual void fence(uint32_t flags, unsigned len, const uint8_t data[]); + void fence(uint32_t flags, unsigned len, const uint8_t data[]) override; // enableContinuousUpdates() is called when the client wants to enable // or disable continuous updates, or change the active area. - virtual void enableContinuousUpdates(bool enable, - int x, int y, int w, int h); + void enableContinuousUpdates(bool enable, + int x, int y, int w, int h) override; // handleClipboardRequest() is called whenever the client requests // the server to send over its clipboard data. It will only be diff --git a/common/rfb/SDesktop.h b/common/rfb/SDesktop.h index b660f496..94fcaa28 100644 --- a/common/rfb/SDesktop.h +++ b/common/rfb/SDesktop.h @@ -145,12 +145,12 @@ namespace rfb { if (buffer) delete buffer; } - virtual void init(VNCServer* vs) { + void init(VNCServer* vs) override { server = vs; server->setPixelBuffer(buffer); } - virtual void queryConnection(network::Socket* sock, - const char* /*userName*/) { + void queryConnection(network::Socket* sock, + const char* /*userName*/) override { server->approveConnection(sock, true, nullptr); } diff --git a/common/rfb/SSecurityNone.h b/common/rfb/SSecurityNone.h index 019fc133..944edf8c 100644 --- a/common/rfb/SSecurityNone.h +++ b/common/rfb/SSecurityNone.h @@ -29,9 +29,9 @@ namespace rfb { class SSecurityNone : public SSecurity { public: SSecurityNone(SConnection* sc) : SSecurity(sc) {} - virtual bool processMsg() { return true; } - virtual int getType() const {return secTypeNone;} - virtual const char* getUserName() const {return nullptr;} + bool processMsg() override { return true; } + int getType() const override {return secTypeNone;} + const char* getUserName() const override {return nullptr;} }; } #endif diff --git a/common/rfb/SSecurityPlain.h b/common/rfb/SSecurityPlain.h index 4ca72781..c0ac049b 100644 --- a/common/rfb/SSecurityPlain.h +++ b/common/rfb/SSecurityPlain.h @@ -43,9 +43,9 @@ namespace rfb { class SSecurityPlain : public SSecurity { public: SSecurityPlain(SConnection* sc); - virtual bool processMsg(); - virtual int getType() const { return secTypePlain; }; - virtual const char* getUserName() const { return username; } + bool processMsg() override; + int getType() const override { return secTypePlain; }; + const char* getUserName() const override { return username; } virtual ~SSecurityPlain() { } diff --git a/common/rfb/SSecurityRSAAES.h b/common/rfb/SSecurityRSAAES.h index 0c4fc852..edac35c6 100644 --- a/common/rfb/SSecurityRSAAES.h +++ b/common/rfb/SSecurityRSAAES.h @@ -36,10 +36,10 @@ namespace rfb { SSecurityRSAAES(SConnection* sc, uint32_t secType, int keySize, bool isAllEncrypted); virtual ~SSecurityRSAAES(); - virtual bool processMsg(); - virtual const char* getUserName() const; - virtual int getType() const { return secType; } - virtual AccessRights getAccessRights() const + bool processMsg() override; + const char* getUserName() const override; + int getType() const override {return secType;} + AccessRights getAccessRights() const override { return accessRights; } diff --git a/common/rfb/SSecurityStack.h b/common/rfb/SSecurityStack.h index 90a6e7c0..d2949a21 100644 --- a/common/rfb/SSecurityStack.h +++ b/common/rfb/SSecurityStack.h @@ -29,10 +29,10 @@ namespace rfb { SSecurityStack(SConnection* sc, int Type, SSecurity* s0 = nullptr, SSecurity* s1 = nullptr); ~SSecurityStack(); - virtual bool processMsg(); - virtual int getType() const { return type; }; - virtual const char* getUserName() const; - virtual AccessRights getAccessRights() const; + bool processMsg() override; + int getType() const override { return type; }; + const char* getUserName() const override; + AccessRights getAccessRights() const override; protected: short state; SSecurity* state0; diff --git a/common/rfb/SSecurityTLS.h b/common/rfb/SSecurityTLS.h index a68fd0f2..0b9ea9f3 100644 --- a/common/rfb/SSecurityTLS.h +++ b/common/rfb/SSecurityTLS.h @@ -45,9 +45,9 @@ namespace rfb { public: SSecurityTLS(SConnection* sc, bool _anon); virtual ~SSecurityTLS(); - virtual bool processMsg(); - virtual const char* getUserName() const {return nullptr;} - virtual int getType() const { return anon ? secTypeTLSNone : secTypeX509None;} + bool processMsg() override; + const char* getUserName() const override {return nullptr;} + int getType() const override { return anon ? secTypeTLSNone : secTypeX509None;} static StringParameter X509_CertFile; static StringParameter X509_KeyFile; diff --git a/common/rfb/SSecurityVeNCrypt.h b/common/rfb/SSecurityVeNCrypt.h index 91713f89..ea2bb6fb 100644 --- a/common/rfb/SSecurityVeNCrypt.h +++ b/common/rfb/SSecurityVeNCrypt.h @@ -34,10 +34,10 @@ namespace rfb { public: SSecurityVeNCrypt(SConnection* sc, SecurityServer *sec); ~SSecurityVeNCrypt(); - virtual bool processMsg(); - virtual int getType() const { return chosenType; } - virtual const char* getUserName() const; - virtual AccessRights getAccessRights() const; + bool processMsg() override; + int getType() const override { return chosenType; } + const char* getUserName() const override; + AccessRights getAccessRights() const override; protected: SSecurity *ssecurity; diff --git a/common/rfb/SSecurityVncAuth.h b/common/rfb/SSecurityVncAuth.h index 9c00aa52..532abe0a 100644 --- a/common/rfb/SSecurityVncAuth.h +++ b/common/rfb/SSecurityVncAuth.h @@ -44,7 +44,7 @@ namespace rfb { class VncAuthPasswdParameter : public VncAuthPasswdGetter, BinaryParameter { public: VncAuthPasswdParameter(const char* name, const char* desc, StringParameter* passwdFile_); - virtual void getVncAuthPasswd(std::string *password, std::string *readOnlyPassword); + void getVncAuthPasswd(std::string *password, std::string *readOnlyPassword) override; protected: StringParameter* passwdFile; }; @@ -52,10 +52,10 @@ namespace rfb { class SSecurityVncAuth : public SSecurity { public: SSecurityVncAuth(SConnection* sc); - virtual bool processMsg(); - virtual int getType() const {return secTypeVncAuth;} - virtual const char* getUserName() const {return nullptr;} - virtual AccessRights getAccessRights() const { return accessRights; } + bool processMsg() override; + int getType() const override {return secTypeVncAuth;} + const char* getUserName() const override {return nullptr;} + AccessRights getAccessRights() const override { return accessRights; } static StringParameter vncAuthPasswdFile; static VncAuthPasswdParameter vncAuthPasswd; private: diff --git a/common/rfb/TightDecoder.h b/common/rfb/TightDecoder.h index 764f138e..d569a7fd 100644 --- a/common/rfb/TightDecoder.h +++ b/common/rfb/TightDecoder.h @@ -31,18 +31,17 @@ namespace rfb { public: TightDecoder(); virtual ~TightDecoder(); - virtual bool readRect(const Rect& r, rdr::InStream* is, - const ServerParams& server, rdr::OutStream* os); - virtual bool doRectsConflict(const Rect& rectA, - const uint8_t* bufferA, - size_t buflenA, - const Rect& rectB, - const uint8_t* bufferB, - size_t buflenB, - const ServerParams& server); - virtual void decodeRect(const Rect& r, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - ModifiablePixelBuffer* pb); + bool readRect(const Rect& r, rdr::InStream* is, + const ServerParams& server, + rdr::OutStream* os) override; + bool doRectsConflict(const Rect& rectA, + const uint8_t* bufferA, size_t buflenA, + const Rect& rectB, + const uint8_t* bufferB, size_t buflenB, + const ServerParams& server) override; + void decodeRect(const Rect& r, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + ModifiablePixelBuffer* pb) override; private: uint32_t readCompact(rdr::InStream* is); diff --git a/common/rfb/TightEncoder.h b/common/rfb/TightEncoder.h index 0608eb09..3a7210c7 100644 --- a/common/rfb/TightEncoder.h +++ b/common/rfb/TightEncoder.h @@ -31,14 +31,14 @@ namespace rfb { TightEncoder(SConnection* conn); virtual ~TightEncoder(); - virtual bool isSupported(); + bool isSupported() override; - virtual void setCompressLevel(int level); + void setCompressLevel(int level) override; - virtual void writeRect(const PixelBuffer* pb, const Palette& palette); - virtual void writeSolidRect(int width, int height, - const PixelFormat& pf, - const uint8_t* colour); + void writeRect(const PixelBuffer* pb, + const Palette& palette) override; + void writeSolidRect(int width, int height, const PixelFormat& pf, + const uint8_t* colour) override; protected: void writeMonoRect(const PixelBuffer* pb, const Palette& palette); diff --git a/common/rfb/TightJPEGEncoder.h b/common/rfb/TightJPEGEncoder.h index 002deabb..81d9f40d 100644 --- a/common/rfb/TightJPEGEncoder.h +++ b/common/rfb/TightJPEGEncoder.h @@ -30,17 +30,17 @@ namespace rfb { TightJPEGEncoder(SConnection* conn); virtual ~TightJPEGEncoder(); - virtual bool isSupported(); + bool isSupported() override; - virtual void setQualityLevel(int level); - virtual void setFineQualityLevel(int quality, int subsampling); + void setQualityLevel(int level) override; + void setFineQualityLevel(int quality, int subsampling) override; - virtual int getQualityLevel(); + int getQualityLevel() override; - virtual void writeRect(const PixelBuffer* pb, const Palette& palette); - virtual void writeSolidRect(int width, int height, - const PixelFormat& pf, - const uint8_t* colour); + void writeRect(const PixelBuffer* pb, + const Palette& palette) override; + void writeSolidRect(int width, int height, const PixelFormat& pf, + const uint8_t* colour) override; protected: void writeCompact(uint32_t value, rdr::OutStream* os); diff --git a/common/rfb/Timer.h b/common/rfb/Timer.h index 36ec46c5..362cb84e 100644 --- a/common/rfb/Timer.h +++ b/common/rfb/Timer.h @@ -124,7 +124,7 @@ namespace rfb { MethodTimer(T* obj_, void (T::*cb_)(Timer*)) : Timer(this), obj(obj_), cb(cb_) {} - virtual void handleTimeout(Timer* t) { (obj->*cb)(t); } + void handleTimeout(Timer* t) override { return (obj->*cb)(t); } private: T* obj; diff --git a/common/rfb/UnixPasswordValidator.h b/common/rfb/UnixPasswordValidator.h index 28d083a1..4d623d6c 100644 --- a/common/rfb/UnixPasswordValidator.h +++ b/common/rfb/UnixPasswordValidator.h @@ -28,7 +28,7 @@ namespace rfb class UnixPasswordValidator: public PasswordValidator { protected: bool validateInternal(SConnection * sc, const char *username, - const char *password); + const char *password) override; }; } diff --git a/common/rfb/UpdateTracker.h b/common/rfb/UpdateTracker.h index 1c31a168..e91b9621 100644 --- a/common/rfb/UpdateTracker.h +++ b/common/rfb/UpdateTracker.h @@ -59,8 +59,8 @@ namespace rfb { void setUpdateTracker(UpdateTracker* ut_) {ut = ut_;} void setClipRect(const Rect& cr) {clipRect = cr;} - virtual void add_changed(const Region ®ion); - virtual void add_copied(const Region &dest, const Point &delta); + void add_changed(const Region ®ion) override; + void add_copied(const Region &dest, const Point &delta) override; protected: UpdateTracker* ut; Rect clipRect; @@ -71,8 +71,8 @@ namespace rfb { SimpleUpdateTracker(); virtual ~SimpleUpdateTracker(); - virtual void add_changed(const Region ®ion); - virtual void add_copied(const Region &dest, const Point &delta); + void add_changed(const Region ®ion) override; + void add_copied(const Region &dest, const Point &delta) override; virtual void subtract(const Region& region); // Fill the supplied UpdateInfo structure with update information diff --git a/common/rfb/VNCSConnectionST.h b/common/rfb/VNCSConnectionST.h index 3a9ec242..e9badd72 100644 --- a/common/rfb/VNCSConnectionST.h +++ b/common/rfb/VNCSConnectionST.h @@ -46,8 +46,8 @@ namespace rfb { // SConnection methods - virtual bool accessCheck(AccessRights ar) const; - virtual void close(const char* reason); + bool accessCheck(AccessRights ar) const override; + void close(const char* reason) override; using SConnection::authenticated; @@ -118,30 +118,32 @@ namespace rfb { private: // SConnection callbacks - // These methods are invoked as callbacks from processMsg() - - virtual void authSuccess(); - virtual void queryConnection(const char* userName); - virtual void clientInit(bool shared); - virtual void setPixelFormat(const PixelFormat& pf); - virtual void pointerEvent(const Point& pos, int buttonMask); - virtual void keyEvent(uint32_t keysym, uint32_t keycode, bool down); - virtual void framebufferUpdateRequest(const Rect& r, bool incremental); - virtual void setDesktopSize(int fb_width, int fb_height, - const ScreenSet& layout); - virtual void fence(uint32_t flags, unsigned len, const uint8_t data[]); - virtual void enableContinuousUpdates(bool enable, - int x, int y, int w, int h); - virtual void handleClipboardRequest(); - virtual void handleClipboardAnnounce(bool available); - virtual void handleClipboardData(const char* data); - virtual void supportsLocalCursor(); - virtual void supportsFence(); - virtual void supportsContinuousUpdates(); - virtual void supportsLEDState(); + // These methods are invoked as callbacks from processMsg( + void authSuccess() override; + void queryConnection(const char* userName) override; + void clientInit(bool shared) override; + void setPixelFormat(const PixelFormat& pf) override; + void pointerEvent(const Point& pos, int buttonMask) override; + void keyEvent(uint32_t keysym, uint32_t keycode, + bool down) override; + void framebufferUpdateRequest(const Rect& r, + bool incremental) override; + void setDesktopSize(int fb_width, int fb_height, + const ScreenSet& layout) override; + void fence(uint32_t flags, unsigned len, + const uint8_t data[]) override; + void enableContinuousUpdates(bool enable, + int x, int y, int w, int h) override; + void handleClipboardRequest() override; + void handleClipboardAnnounce(bool available) override; + void handleClipboardData(const char* data) override; + void supportsLocalCursor() override; + void supportsFence() override; + void supportsContinuousUpdates() override; + void supportsLEDState() override; // Timer callbacks - virtual void handleTimeout(Timer* t); + void handleTimeout(Timer* t) override; // Internal methods diff --git a/common/rfb/VNCServerST.h b/common/rfb/VNCServerST.h index 8fbbf971..501882aa 100644 --- a/common/rfb/VNCServerST.h +++ b/common/rfb/VNCServerST.h @@ -56,54 +56,54 @@ namespace rfb { // addSocket // Causes the server to allocate an RFB-protocol management // structure for the socket & initialise it. - virtual void addSocket(network::Socket* sock, bool outgoing=false, - AccessRights ar=AccessDefault); + void addSocket(network::Socket* sock, bool outgoing=false, + AccessRights ar=AccessDefault) override; // removeSocket // Clean up any resources associated with the Socket - virtual void removeSocket(network::Socket* sock); + void removeSocket(network::Socket* sock) override; // getSockets() gets a list of sockets. This can be used to generate an // fd_set for calling select(). - virtual void getSockets(std::list<network::Socket*>* sockets); + void getSockets(std::list<network::Socket*>* sockets) override; // processSocketReadEvent // Read more RFB data from the Socket. If an error occurs during // processing then shutdown() is called on the Socket, causing // removeSocket() to be called by the caller at a later time. - virtual void processSocketReadEvent(network::Socket* sock); + void processSocketReadEvent(network::Socket* sock) override; // processSocketWriteEvent // Flush pending data from the Socket on to the network. - virtual void processSocketWriteEvent(network::Socket* sock); - - virtual void blockUpdates(); - virtual void unblockUpdates(); - virtual uint64_t getMsc(); - virtual void queueMsc(uint64_t target); - virtual void setPixelBuffer(PixelBuffer* pb, const ScreenSet& layout); - virtual void setPixelBuffer(PixelBuffer* pb); - virtual void setScreenLayout(const ScreenSet& layout); - virtual const PixelBuffer* getPixelBuffer() const { return pb; } - - virtual void requestClipboard(); - virtual void announceClipboard(bool available); - virtual void sendClipboardData(const char* data); - - virtual void approveConnection(network::Socket* sock, bool accept, - const char* reason); - virtual void closeClients(const char* reason) {closeClients(reason, nullptr);} - virtual SConnection* getConnection(network::Socket* sock); - - virtual void add_changed(const Region ®ion); - virtual void add_copied(const Region &dest, const Point &delta); - virtual void setCursor(int width, int height, const Point& hotspot, - const uint8_t* data); - virtual void setCursorPos(const Point& p, bool warped); - virtual void setName(const char* name_); - virtual void setLEDState(unsigned state); - - virtual void bell(); + void processSocketWriteEvent(network::Socket* sock) override; + + void blockUpdates() override; + void unblockUpdates() override; + uint64_t getMsc() override; + void queueMsc(uint64_t target) override; + void setPixelBuffer(PixelBuffer* pb, const ScreenSet& layout) override; + void setPixelBuffer(PixelBuffer* pb) override; + void setScreenLayout(const ScreenSet& layout) override; + const PixelBuffer* getPixelBuffer() const override { return pb; } + + void requestClipboard() override; + void announceClipboard(bool available) override; + void sendClipboardData(const char* data) override; + + void approveConnection(network::Socket* sock, bool accept, + const char* reason) override; + void closeClients(const char* reason) override {closeClients(reason, nullptr);} + SConnection* getConnection(network::Socket* sock) override; + + void add_changed(const Region ®ion) override; + void add_copied(const Region &dest, const Point &delta) override; + void setCursor(int width, int height, const Point& hotspot, + const uint8_t* data) override; + void setCursorPos(const Point& p, bool warped) override; + void setName(const char* name_) override; + void setLEDState(unsigned state) override; + + void bell() override; // VNCServerST-only methods @@ -155,7 +155,7 @@ namespace rfb { protected: // Timer callbacks - virtual void handleTimeout(Timer* t); + void handleTimeout(Timer* t) override; // - Internal methods diff --git a/common/rfb/WinPasswdValidator.h b/common/rfb/WinPasswdValidator.h index ef2310a9..340a6234 100644 --- a/common/rfb/WinPasswdValidator.h +++ b/common/rfb/WinPasswdValidator.h @@ -30,7 +30,7 @@ namespace rfb WinPasswdValidator() {}; virtual ~WinPasswdValidator() {}; protected: - bool validateInternal(SConnection *sc, const char* username, const char* password); + bool validateInternal(SConnection *sc, const char* username, const char* password) override; }; } diff --git a/common/rfb/ZRLEDecoder.h b/common/rfb/ZRLEDecoder.h index e72bf1b6..9ed2c2c8 100644 --- a/common/rfb/ZRLEDecoder.h +++ b/common/rfb/ZRLEDecoder.h @@ -30,11 +30,12 @@ namespace rfb { public: ZRLEDecoder(); virtual ~ZRLEDecoder(); - virtual bool readRect(const Rect& r, rdr::InStream* is, - const ServerParams& server, rdr::OutStream* os); - virtual void decodeRect(const Rect& r, const uint8_t* buffer, - size_t buflen, const ServerParams& server, - ModifiablePixelBuffer* pb); + bool readRect(const Rect& r, rdr::InStream* is, + const ServerParams& server, + rdr::OutStream* os) override; + void decodeRect(const Rect& r, const uint8_t* buffer, + size_t buflen, const ServerParams& server, + ModifiablePixelBuffer* pb) override; private: template<class T> diff --git a/common/rfb/ZRLEEncoder.h b/common/rfb/ZRLEEncoder.h index fa89f10f..87d87e94 100644 --- a/common/rfb/ZRLEEncoder.h +++ b/common/rfb/ZRLEEncoder.h @@ -30,14 +30,14 @@ namespace rfb { ZRLEEncoder(SConnection* conn); virtual ~ZRLEEncoder(); - virtual bool isSupported(); + bool isSupported() override; - virtual void setCompressLevel(int level); + void setCompressLevel(int level) override; - virtual void writeRect(const PixelBuffer* pb, const Palette& palette); - virtual void writeSolidRect(int width, int height, - const PixelFormat& pf, - const uint8_t* colour); + void writeRect(const PixelBuffer* pb, + const Palette& palette) override; + void writeSolidRect(int width, int height, const PixelFormat& pf, + const uint8_t* colour) override; protected: void writePaletteTile(const Rect& tile, const PixelBuffer* pb, |