diff options
author | Pierre Ossman <ossman@cendio.se> | 2014-01-31 13:12:18 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2014-07-07 14:50:28 +0200 |
commit | fdba3fe884d5b43e07d7d49033c83f2f11bf524c (patch) | |
tree | dbd053e85ed44fd00dedf10b17d0cbb25f40eb5f /common/rfb/SMsgWriter.h | |
parent | b6b4dc6487690e891ec2487c6cf765d36821fe3a (diff) | |
download | tigervnc-fdba3fe884d5b43e07d7d49033c83f2f11bf524c.tar.gz tigervnc-fdba3fe884d5b43e07d7d49033c83f2f11bf524c.zip |
Push encoder and decoder handling down into the connection objects
This keeps the reader and writer objects clean and simple protocol
decoders/encoders.
Diffstat (limited to 'common/rfb/SMsgWriter.h')
-rw-r--r-- | common/rfb/SMsgWriter.h | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/common/rfb/SMsgWriter.h b/common/rfb/SMsgWriter.h index ee59eb36..ccc8f803 100644 --- a/common/rfb/SMsgWriter.h +++ b/common/rfb/SMsgWriter.h @@ -32,10 +32,6 @@ namespace rdr { class OutStream; } namespace rfb { class ConnParams; - class TransImageGetter; - class Region; - class UpdateInfo; - class Encoder; class ScreenSet; class WriteSetCursorCallback { @@ -72,14 +68,6 @@ namespace rfb { // updates mode. void writeEndOfContinuousUpdates(); - // setupCurrentEncoder() should be called before each framebuffer update, - // prior to calling getNumRects() or writeFramebufferUpdateStart(). - void setupCurrentEncoder(); - - // getNumRects() computes the number of sub-rectangles that will compose a - // given rectangle, for current encoder. - int getNumRects(const Rect &r); - // writeSetDesktopSize() won't actually write immediately, but will // write the relevant pseudo-rectangle as part of the next update. bool writeSetDesktopSize(); @@ -118,26 +106,17 @@ namespace rfb { // pseudo-rectangles. void writeNoDataUpdate(); - // writeRects() accepts an UpdateInfo (changed & copied regions) and an - // ImageGetter to fetch pixels from. It then calls writeCopyRect() and - // writeRect() as appropriate. writeFramebufferUpdateStart() must be used - // before the first writeRects() call and writeFrameBufferUpdateEnd() after - // the last one. - void writeRects(const UpdateInfo& update, TransImageGetter* ig); - - // To construct a framebuffer update you can call - // writeFramebufferUpdateStart(), followed by a number of writeCopyRect()s - // and writeRect()s, finishing with writeFramebufferUpdateEnd(). + // writeFramebufferUpdateStart() initiates an update which you can fill + // in using writeCopyRect() and encoders. Finishing the update by calling + // writeFramebufferUpdateEnd(). void writeFramebufferUpdateStart(int nRects); void writeFramebufferUpdateEnd(); - // writeRect() writers the given rectangle using either the preferred - // encoder, or the one explicitly given. - void writeRect(const Rect& r, TransImageGetter* ig); - void writeRect(const Rect& r, int encoding, TransImageGetter* ig); - + // There is no explicit encoder for CopyRect rects. void writeCopyRect(const Rect& r, int srcX, int srcY); + // Encoders should call these to mark the start and stop of individual + // rects. void startRect(const Rect& r, int enc); void endRect(); @@ -169,7 +148,6 @@ namespace rfb { ConnParams* cp; rdr::OutStream* os; - Encoder* encoders[encodingMax+1]; int currentEncoding; int nRectsInUpdate; |