From 570cd5c478da3a8dfd2d7f728671f0171fd3893a Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 12 Nov 2015 13:07:42 +0100 Subject: [PATCH] Add flags member to decoders Allows us to add attributes later that affect of the decoder manager deals with the decoders. --- common/rfb/CopyRectDecoder.cxx | 2 +- common/rfb/Decoder.cxx | 2 +- common/rfb/Decoder.h | 11 ++++++++++- common/rfb/HextileDecoder.cxx | 2 +- common/rfb/RREDecoder.cxx | 2 +- common/rfb/RawDecoder.cxx | 2 +- common/rfb/TightDecoder.cxx | 2 +- common/rfb/ZRLEDecoder.cxx | 2 +- 8 files changed, 17 insertions(+), 8 deletions(-) diff --git a/common/rfb/CopyRectDecoder.cxx b/common/rfb/CopyRectDecoder.cxx index 52de8790..32ed1b3b 100644 --- a/common/rfb/CopyRectDecoder.cxx +++ b/common/rfb/CopyRectDecoder.cxx @@ -22,7 +22,7 @@ using namespace rfb; -CopyRectDecoder::CopyRectDecoder() +CopyRectDecoder::CopyRectDecoder() : Decoder(DecoderPlain) { } diff --git a/common/rfb/Decoder.cxx b/common/rfb/Decoder.cxx index a1f44389..f9bbffca 100644 --- a/common/rfb/Decoder.cxx +++ b/common/rfb/Decoder.cxx @@ -28,7 +28,7 @@ using namespace rfb; -Decoder::Decoder() +Decoder::Decoder(enum DecoderFlags flags) : flags(flags) { } diff --git a/common/rfb/Decoder.h b/common/rfb/Decoder.h index 7286b41d..95c14668 100644 --- a/common/rfb/Decoder.h +++ b/common/rfb/Decoder.h @@ -28,10 +28,16 @@ namespace rfb { class ConnParams; class ModifiablePixelBuffer; class Rect; + class Region; + + enum DecoderFlags { + // A constant for decoders that don't need anything special + DecoderPlain = 0, + }; class Decoder { public: - Decoder(); + Decoder(enum DecoderFlags flags); virtual ~Decoder(); // These functions are the main interface to an individual decoder @@ -58,6 +64,9 @@ namespace rfb { public: static bool supported(int encoding); static Decoder* createDecoder(int encoding); + + public: + const enum DecoderFlags flags; }; } diff --git a/common/rfb/HextileDecoder.cxx b/common/rfb/HextileDecoder.cxx index d1412d4a..eae00408 100644 --- a/common/rfb/HextileDecoder.cxx +++ b/common/rfb/HextileDecoder.cxx @@ -36,7 +36,7 @@ using namespace rfb; #include #undef BPP -HextileDecoder::HextileDecoder() +HextileDecoder::HextileDecoder() : Decoder(DecoderPlain) { } diff --git a/common/rfb/RREDecoder.cxx b/common/rfb/RREDecoder.cxx index 2dd47cc0..218c9b0b 100644 --- a/common/rfb/RREDecoder.cxx +++ b/common/rfb/RREDecoder.cxx @@ -36,7 +36,7 @@ using namespace rfb; #include #undef BPP -RREDecoder::RREDecoder() +RREDecoder::RREDecoder() : Decoder(DecoderPlain) { } diff --git a/common/rfb/RawDecoder.cxx b/common/rfb/RawDecoder.cxx index e349bda8..786f1545 100644 --- a/common/rfb/RawDecoder.cxx +++ b/common/rfb/RawDecoder.cxx @@ -25,7 +25,7 @@ using namespace rfb; -RawDecoder::RawDecoder() +RawDecoder::RawDecoder() : Decoder(DecoderPlain) { } diff --git a/common/rfb/TightDecoder.cxx b/common/rfb/TightDecoder.cxx index 1bfa7a9f..24236dba 100644 --- a/common/rfb/TightDecoder.cxx +++ b/common/rfb/TightDecoder.cxx @@ -46,7 +46,7 @@ static const int TIGHT_MIN_TO_COMPRESS = 12; #include #undef BPP -TightDecoder::TightDecoder() +TightDecoder::TightDecoder() : Decoder(DecoderPlain) { } diff --git a/common/rfb/ZRLEDecoder.cxx b/common/rfb/ZRLEDecoder.cxx index 498152cf..c9245c06 100644 --- a/common/rfb/ZRLEDecoder.cxx +++ b/common/rfb/ZRLEDecoder.cxx @@ -62,7 +62,7 @@ static inline rdr::U32 readOpaque24B(rdr::InStream* is) #undef CPIXEL #undef BPP -ZRLEDecoder::ZRLEDecoder() +ZRLEDecoder::ZRLEDecoder() : Decoder(DecoderPlain) { } -- 2.39.5