Unverified Commit 03b65211 authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'fcarvajaldev-3.6.x-remove-old-proto-compat' into 3.6.x

parents 2ffe52c5 5c495241
......@@ -923,7 +923,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nx-X11/programs/Xserver/hw/nxagent/Windows.h
nxcomp/ActionCache.cpp
nxcomp/ActionCache.h
nxcomp/ActionCacheCompat.h
nxcomp/Agent.cpp
nxcomp/Agent.h
nxcomp/Alpha.cpp
......@@ -938,8 +937,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/BlockCacheSet.h
nxcomp/ChangeGC.cpp
nxcomp/ChangeGC.h
nxcomp/ChangeGCCompat.cpp
nxcomp/ChangeGCCompat.h
nxcomp/ChangeProperty.cpp
nxcomp/ChangeProperty.h
nxcomp/Channel.cpp
......@@ -974,8 +971,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/CreateGC.h
nxcomp/CreatePixmap.cpp
nxcomp/CreatePixmap.h
nxcomp/CreatePixmapCompat.cpp
nxcomp/CreatePixmapCompat.h
nxcomp/DecodeBuffer.cpp
nxcomp/DecodeBuffer.h
nxcomp/EncodeBuffer.cpp
......@@ -1053,8 +1048,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/PolyText16.h
nxcomp/PolyText8.cpp
nxcomp/PolyText8.h
nxcomp/PositionCacheCompat.cpp
nxcomp/PositionCacheCompat.h
nxcomp/Proxy.cpp
nxcomp/Proxy.h
nxcomp/ProxyReadBuffer.cpp
......@@ -1073,20 +1066,12 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/RenderChangePicture.h
nxcomp/RenderComposite.cpp
nxcomp/RenderComposite.h
nxcomp/RenderCompositeCompat.cpp
nxcomp/RenderCompositeCompat.h
nxcomp/RenderCompositeGlyphs.cpp
nxcomp/RenderCompositeGlyphs.h
nxcomp/RenderCompositeGlyphsCompat.cpp
nxcomp/RenderCompositeGlyphsCompat.h
nxcomp/RenderCreateGlyphSet.cpp
nxcomp/RenderCreateGlyphSet.h
nxcomp/RenderCreateGlyphSetCompat.cpp
nxcomp/RenderCreateGlyphSetCompat.h
nxcomp/RenderCreatePicture.cpp
nxcomp/RenderCreatePicture.h
nxcomp/RenderCreatePictureCompat.cpp
nxcomp/RenderCreatePictureCompat.h
nxcomp/RenderExtension.cpp
nxcomp/RenderExtension.h
nxcomp/RenderFillRectangles.cpp
......@@ -1095,8 +1080,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/RenderFreeGlyphSet.h
nxcomp/RenderFreePicture.cpp
nxcomp/RenderFreePicture.h
nxcomp/RenderFreePictureCompat.cpp
nxcomp/RenderFreePictureCompat.h
nxcomp/RenderGenericRequest.cpp
nxcomp/RenderGenericRequest.h
nxcomp/RenderMinorExtensionHeaders.h
......@@ -1104,8 +1087,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/RenderMinorExtensionTags.h
nxcomp/RenderPictureClip.cpp
nxcomp/RenderPictureClip.h
nxcomp/RenderPictureClipCompat.cpp
nxcomp/RenderPictureClipCompat.h
nxcomp/RenderPictureFilter.cpp
nxcomp/RenderPictureFilter.h
nxcomp/RenderPictureTransform.cpp
......@@ -1136,12 +1117,8 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/SetClipRectangles.h
nxcomp/SetUnpackAlpha.cpp
nxcomp/SetUnpackAlpha.h
nxcomp/SetUnpackAlphaCompat.cpp
nxcomp/SetUnpackAlphaCompat.h
nxcomp/SetUnpackColormap.cpp
nxcomp/SetUnpackColormap.h
nxcomp/SetUnpackColormapCompat.cpp
nxcomp/SetUnpackColormapCompat.h
nxcomp/SetUnpackGeometry.cpp
nxcomp/SetUnpackGeometry.h
nxcomp/ShapeExtension.cpp
......@@ -1154,8 +1131,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/StaticCompressor.h
nxcomp/Statistics.cpp
nxcomp/Statistics.h
nxcomp/TextCompressor.cpp
nxcomp/TextCompressor.h
nxcomp/Timestamp.cpp
nxcomp/Timestamp.h
nxcomp/TranslateCoords.cpp
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef ActionCacheCompat_H
#define ActionCacheCompat_H
#include "CharCache.h"
class ActionCacheCompat
{
friend class EncodeBuffer;
friend class DecodeBuffer;
public:
ActionCacheCompat()
{
slot_ = 0;
}
~ActionCacheCompat()
{
}
private:
CharCache base_[4];
unsigned char slot_;
};
#endif /* ActionCacheCompat_H */
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#include "ChangeGCCompat.h"
#include "ClientCache.h"
#include "EncodeBuffer.h"
#include "DecodeBuffer.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#undef DUMP
//
// Here are the methods to handle messages' content.
//
int ChangeGCCompatStore::parseIdentity(Message *message, const unsigned char *buffer,
unsigned int size, int bigEndian) const
{
ChangeGCCompatMessage *changeGC = (ChangeGCCompatMessage *) message;
//
// Here is the fingerprint.
//
changeGC -> gcontext = GetULONG(buffer + 4, bigEndian);
changeGC -> value_mask = GetULONG(buffer + 8, bigEndian);
//
// Clear the unused bytes carried in the
// payload to increase the effectiveness
// of the caching algorithm.
//
if ((int) size > dataOffset)
{
#ifdef DEBUG
*logofs << name() << ": Removing unused bytes from the "
<< "data payload.\n" << logofs_flush;
#endif
changeGC -> value_mask &= (1 << 23) - 1;
unsigned int mask = 0x1;
unsigned char *source = (unsigned char *) buffer + CHANGEGC_DATA_OFFSET;
unsigned long value = 0;
for (unsigned int i = 0; i < 23; i++)
{
if (changeGC -> value_mask & mask)
{
value = GetULONG(source, bigEndian);
value &= (0xffffffff >> (32 - CREATEGC_FIELD_WIDTH[i]));
PutULONG(value, source, bigEndian);
source += 4;
}
mask <<= 1;
}
}
#ifdef DEBUG
*logofs << name() << ": Parsed Identity for message at "
<< this << ".\n" << logofs_flush;
#endif
return 1;
}
int ChangeGCCompatStore::unparseIdentity(const Message *message, unsigned char *buffer,
unsigned int size, int bigEndian) const
{
ChangeGCCompatMessage *changeGC = (ChangeGCCompatMessage *) message;
//
// Fill all the message's fields.
//
PutULONG(changeGC -> gcontext, buffer + 4, bigEndian);
PutULONG(changeGC -> value_mask, buffer + 8, bigEndian);
#ifdef DEBUG
*logofs << name() << ": Unparsed identity for message at "
<< this << ".\n" << logofs_flush;
#endif
return 1;
}
void ChangeGCCompatStore::dumpIdentity(const Message *message) const
{
#ifdef DUMP
ChangeGCCompatMessage *changeGC = (ChangeGCCompatMessage *) message;
*logofs << name() << ": Identity gcontext " << changeGC -> gcontext
<< ", mask " << changeGC -> value_mask << ", size "
<< changeGC -> size_ << ".\n" << logofs_flush;
#endif
}
void ChangeGCCompatStore::identityChecksum(const Message *message, const unsigned char *buffer,
unsigned int size, int bigEndian) const
{
md5_append(md5_state_, buffer + 4, 8);
}
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef ChangeGCCompat_H
#define ChangeGCCompat_H
#include "Message.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#undef DUMP
//
// Set default values.
//
#define CHANGEGC_ENABLE_CACHE 1
#define CHANGEGC_ENABLE_DATA 0
#define CHANGEGC_ENABLE_SPLIT 0
#define CHANGEGC_ENABLE_COMPRESS 0
#define CHANGEGC_DATA_LIMIT 144
#define CHANGEGC_DATA_OFFSET 12
#define CHANGEGC_CACHE_SLOTS 3000
#define CHANGEGC_CACHE_THRESHOLD 3
#define CHANGEGC_CACHE_LOWER_THRESHOLD 1
//
// The message class.
//
class ChangeGCCompatMessage : public Message
{
friend class ChangeGCCompatStore;
public:
ChangeGCCompatMessage()
{
}
~ChangeGCCompatMessage()
{
}
//
// Put here the fields which constitute
// the 'identity' part of the message.
//
private:
unsigned int gcontext;
unsigned int value_mask;
};
class ChangeGCCompatStore : public MessageStore
{
//
// Constructors and destructors.
//
public:
ChangeGCCompatStore() : MessageStore()
{
enableCache = CHANGEGC_ENABLE_CACHE;
enableData = CHANGEGC_ENABLE_DATA;
enableSplit = CHANGEGC_ENABLE_SPLIT;
enableCompress = CHANGEGC_ENABLE_COMPRESS;
dataLimit = CHANGEGC_DATA_LIMIT;
dataOffset = CHANGEGC_DATA_OFFSET;
cacheSlots = CHANGEGC_CACHE_SLOTS;
cacheThreshold = CHANGEGC_CACHE_THRESHOLD;
cacheLowerThreshold = CHANGEGC_CACHE_LOWER_THRESHOLD;
messages_ -> resize(cacheSlots);
for (T_messages::iterator i = messages_ -> begin();
i < messages_ -> end(); i++)
{
*i = NULL;
}
temporary_ = NULL;
}
virtual ~ChangeGCCompatStore()
{
for (T_messages::iterator i = messages_ -> begin();
i < messages_ -> end(); i++)
{
destroy(*i);
}
destroy(temporary_);
}
virtual const char *name() const
{
return "ChangeGCCompat";
}
virtual unsigned char opcode() const
{
return X_ChangeGC;
}
virtual unsigned int storage() const
{
return sizeof(ChangeGCCompatMessage);
}
//
// Message handling methods.
//
public:
virtual Message *create() const
{
return new ChangeGCCompatMessage();
}
virtual Message *create(const Message &message) const
{
return new ChangeGCCompatMessage((const ChangeGCCompatMessage &) message);
}
virtual void destroy(Message *message) const
{
delete (ChangeGCCompatMessage *) message;
}
virtual int parseIdentity(Message *message, const unsigned char *buffer,
unsigned int size, int bigEndian) const;
virtual int unparseIdentity(const Message *message, unsigned char *buffer,
unsigned int size, int bigEndian) const;
virtual void identityChecksum(const Message *message, const unsigned char *buffer,
unsigned int size, int bigEndian) const;
virtual void dumpIdentity(const Message *message) const;
};
#endif /* ChangeGCCompat_H */
......@@ -386,16 +386,14 @@ int Channel::handleDecode(DecodeBuffer &decodeBuffer, ChannelCache *channelCache
if (store -> enableSplit == 1)
{
if (control -> isProtoStep7() == 1)
{
#ifdef DEBUG
*logofs << "handleDecode: " << store -> name()
<< ": Checking if the message was split.\n"
<< logofs_flush;
#endif
// Since ProtoStep7 (#issue 108)
#ifdef DEBUG
*logofs << "handleDecode: " << store -> name()
<< ": Checking if the message was split.\n"
<< logofs_flush;
#endif
decodeBuffer.decodeBoolValue(split);
}
decodeBuffer.decodeBoolValue(split);
if (split == 1)
{
......@@ -537,16 +535,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
if (control -> LocalDeltaCompression == 0 ||
enableCache_ == 0 || store -> enableCache == 0)
{
if (control -> isProtoStep7() == 1)
{
encodeBuffer.encodeActionValue(is_discarded,
store -> lastActionCache);
}
else
{
encodeBuffer.encodeActionValueCompat(is_discarded,
store -> lastActionCacheCompat);
}
// Since ProtoStep7 (#issue 108)
encodeBuffer.encodeActionValue(is_discarded,
store -> lastActionCache);
store -> lastAction = is_discarded;
......@@ -601,19 +592,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
store -> lastRemoved = position;
if (control -> isProtoStep7() == 1)
{
encodeBuffer.encodeActionValue(is_removed, store -> lastRemoved,
store -> lastActionCache);
}
else
{
encodeBuffer.encodeActionValueCompat(is_removed,
store -> lastActionCacheCompat);
encodeBuffer.encodePositionValueCompat(store -> lastRemoved,
store -> lastRemovedCacheCompat);
}
// Since ProtoStep7 (#issue 108)
encodeBuffer.encodeActionValue(is_removed, store -> lastRemoved,
store -> lastActionCache);
#ifdef DEBUG
*logofs << "handleEncodeCached: " << store -> name() << ": Going to "
......@@ -679,16 +660,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
<< logofs_flush;
#endif
if (control -> isProtoStep7() == 1)
{
encodeBuffer.encodeActionValue(is_discarded,
store -> lastActionCache);
}
else
{
encodeBuffer.encodeActionValueCompat(is_discarded,
store -> lastActionCacheCompat);
}
// Since ProtoStep7 (#issue 108)
encodeBuffer.encodeActionValue(is_discarded,
store -> lastActionCache);
store -> lastAction = is_discarded;
......@@ -759,16 +733,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
<< logofs_flush;
#endif
if (control -> isProtoStep7() == 1)
{
encodeBuffer.encodeActionValue(is_discarded,
store -> lastActionCache);
}
else
{
encodeBuffer.encodeActionValueCompat(is_discarded,
store -> lastActionCacheCompat);
}
// Since ProtoStep7 (#issue 108)
encodeBuffer.encodeActionValue(is_discarded,
store -> lastActionCache);
store -> lastAction = is_discarded;
......@@ -793,16 +760,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
cerr << "Warning" << ": Message of size " << store -> plainSize(position)
<< " at position " << position << " is locked.\n";
if (control -> isProtoStep7() == 1)
{
encodeBuffer.encodeActionValue(is_discarded,
store -> lastActionCache);
}
else
{
encodeBuffer.encodeActionValueCompat(is_discarded,
store -> lastActionCacheCompat);
}
// Since ProtoStep7 (#issue 108)
encodeBuffer.encodeActionValue(is_discarded,
store -> lastActionCache);
store -> lastAction = is_discarded;
......@@ -843,20 +803,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
store -> lastAdded = position;
if (control -> isProtoStep7() == 1)
{
encodeBuffer.encodeActionValue(IS_ADDED, store -> lastAdded,
store -> lastActionCache);
}
else
{
encodeBuffer.encodeActionValueCompat(IS_ADDED,
store -> lastActionCacheCompat);
encodeBuffer.encodePositionValueCompat(store -> lastAdded,
store -> lastAddedCacheCompat);
}
// Since ProtoStep7 (#issue 108)
encodeBuffer.encodeActionValue(IS_ADDED, store -> lastAdded,
store -> lastActionCache);
return 0;
}
......@@ -898,19 +847,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
store -> lastHit = position;
if (control -> isProtoStep7() == 1)
{
encodeBuffer.encodeActionValue(IS_HIT, store -> lastHit,
store -> lastActionCache);
}
else
{
encodeBuffer.encodeActionValueCompat(IS_HIT,
store -> lastActionCacheCompat);
encodeBuffer.encodePositionValueCompat(store -> lastHit,
store -> lastHitCacheCompat);
}
// Since ProtoStep7 (#issue 108)
encodeBuffer.encodeActionValue(IS_HIT, store -> lastHit,
store -> lastActionCache);
//
// Send the field by field differences in
......@@ -997,16 +936,9 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe
unsigned char action;
unsigned short int position;
if (control -> isProtoStep7() == 1)
{
decodeBuffer.decodeActionValue(action, position,
store -> lastActionCache);
}
else
{
decodeBuffer.decodeActionValueCompat(action,
store -> lastActionCacheCompat);
}
// Since ProtoStep7 (#issue 108)
decodeBuffer.decodeActionValue(action, position,
store -> lastActionCache);
//
// Clean operations must always come
......@@ -1015,15 +947,8 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe
while (action == is_removed)
{
if (control -> isProtoStep7() == 1)
{
store -> lastRemoved = position;
}
else
{
decodeBuffer.decodePositionValueCompat(store -> lastRemoved,
store -> lastRemovedCacheCompat);
}
// Since ProtoStep7 (#issue 108)
store -> lastRemoved = position;
#ifdef DEBUG
......@@ -1046,16 +971,9 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe
store -> remove(store -> lastRemoved, discard_checksum, use_data);
if (control -> isProtoStep7() == 1)
{
decodeBuffer.decodeActionValue(action, position,
store -> lastActionCache);
}
else
{
decodeBuffer.decodeActionValueCompat(action,
store -> lastActionCacheCompat);
}
// Since ProtoStep7 (#issue 108)
decodeBuffer.decodeActionValue(action, position,
store -> lastActionCache);
}
//
......@@ -1065,15 +983,8 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe
if ((T_store_action) action == IS_HIT)
{
if (control -> isProtoStep7() == 1)
{
store -> lastHit = position;
}
else
{
decodeBuffer.decodePositionValueCompat(store -> lastHit,
store -> lastHitCacheCompat);
}
// Since ProtoStep7 (#issue 108)
store -> lastHit = position;
//
// Get data from the cache at given position.
......@@ -1139,15 +1050,8 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe
}
else if ((T_store_action) action == IS_ADDED)
{
if (control -> isProtoStep7() == 1)
{
store -> lastAdded = position;
}
else
{
decodeBuffer.decodePositionValueCompat(store -> lastAdded,
store -> lastAddedCacheCompat);
}
// Since ProtoStep7 (#issue 108)
store -> lastAdded = position;
#ifdef DEBUG
*logofs << "handleDecodeCached: " << store -> name()
......@@ -2037,12 +1941,10 @@ Split *Channel::handleSplitCommitRemove(int request, int resource, int position)
<< ".\n" << logofs_flush;
#endif
if ((control -> isProtoStep7() == 1 &&
(resource != split -> getResource() ||
request != split -> getRequest() ||
position != split -> getPosition())) ||
(request != split -> getRequest() ||
position != split -> getPosition()))
// Since ProtoStep7 (#issue 108)
if (resource != split -> getResource() ||
request != split -> getRequest() ||
position != split -> getPosition())
{
#ifdef PANIC
*logofs << "handleSplitCommitRemove: PANIC! The data in "
......
......@@ -19,13 +19,6 @@
#define ChannelCache_H
//
// Elements in array of caches used in TextCompressor.
//
const unsigned int CLIENT_TEXT_CACHE_SIZE = 9999;
const unsigned int SERVER_TEXT_CACHE_SIZE = 9999;
//
// Sizes of optional fields for ConfigureWindow
// request.
//
......
......@@ -25,7 +25,6 @@ ClientCache::ClientCache() :
changePropertyPropertyCache(16), changePropertyTypeCache(16),
changePropertyData32Cache(16),
changePropertyTextCompressor(textCache, CLIENT_TEXT_CACHE_SIZE),
configureWindowBitmaskCache(4),
......@@ -53,17 +52,11 @@ ClientCache::ClientCache() :
imageTextLengthCache(8),
imageTextLastX(0), imageTextLastY(0),
imageTextCacheX(8), imageTextCacheY(8),
imageTextTextCompressor(textCache, CLIENT_TEXT_CACHE_SIZE),
internAtomTextCompressor(textCache, CLIENT_TEXT_CACHE_SIZE),
openFontTextCompressor(textCache, CLIENT_TEXT_CACHE_SIZE),
polySegmentCacheX(8), polySegmentCacheY(8), polySegmentCacheIndex(0),
polyTextLastX(0), polyTextLastY(0), polyTextCacheX(8),
polyTextCacheY(8), polyTextFontCache(8),
polyTextTextCompressor(textCache, CLIENT_TEXT_CACHE_SIZE),
putImageWidthCache(8), putImageHeightCache(8), putImageLastX(0),
putImageLastY(0), putImageXCache(8), putImageYCache(8),
......@@ -107,8 +100,6 @@ ClientCache::ClientCache() :
renderLastId(0),
renderTextCompressor(textCache, CLIENT_TEXT_CACHE_SIZE),
renderGlyphXCache(16), renderGlyphYCache(16),
renderGlyphX(0), renderGlyphY(0),
......
......@@ -26,8 +26,6 @@
#include "XidCache.h"
#include "FreeCache.h"
#include "TextCompressor.h"
#include "ChannelCache.h"
class ClientCache : public ChannelCache
......@@ -61,7 +59,6 @@ class ClientCache : public ChannelCache
// General-purpose caches.
//
CharCache textCache[CLIENT_TEXT_CACHE_SIZE];
IntCache cursorCache;
IntCache colormapCache;
IntCache visualCache;
......@@ -85,7 +82,6 @@ class ClientCache : public ChannelCache
IntCache changePropertyPropertyCache;
IntCache changePropertyTypeCache;
IntCache changePropertyData32Cache;
TextCompressor changePropertyTextCompressor;
//
// ClearArea request.
......@@ -188,19 +184,6 @@ class ClientCache : public ChannelCache
unsigned int imageTextLastY;
IntCache imageTextCacheX;
IntCache imageTextCacheY;
TextCompressor imageTextTextCompressor;
//
// InternAtom request.
//
TextCompressor internAtomTextCompressor;
//
// OpenFont request.
//
TextCompressor openFontTextCompressor;
//
// PolyFillRectangle request.
......@@ -251,7 +234,6 @@ class ClientCache : public ChannelCache
IntCache polyTextCacheY;
IntCache polyTextFontCache;
CharCache polyTextDeltaCache;
TextCompressor polyTextTextCompressor;
//
// PutImage request.
......@@ -398,8 +380,6 @@ class ClientCache : public ChannelCache
IntCache *renderDataCache[16];
TextCompressor renderTextCompressor;
IntCache renderGlyphXCache;
IntCache renderGlyphYCache;
......
......@@ -158,23 +158,6 @@ class ClientChannel : public Channel
int handleTaintRequest(unsigned char &opcode, const unsigned char *&buffer,
unsigned int &size)
{
if (control -> isProtoStep7() == 0)
{
if (opcode == X_NXFreeSplit || opcode == X_NXAbortSplit ||
opcode == X_NXFinishSplit)
{
return handleTaintSplitRequest(opcode, buffer, size);
}
else if (opcode == X_NXSetCacheParameters)
{
return handleTaintCacheRequest(opcode, buffer, size);
}
else if (opcode == X_NXGetFontParameters)
{
return handleTaintFontRequest(opcode, buffer, size);
}
}
if (control -> TaintReplies > 0 &&
opcode == X_GetInputFocus)
{
......@@ -190,15 +173,6 @@ class ClientChannel : public Channel
return 0;
}
int handleTaintCacheRequest(unsigned char &opcode, const unsigned char *&buffer,
unsigned int &size);
int handleTaintFontRequest(unsigned char &opcode, const unsigned char *&buffer,
unsigned int &size);
int handleTaintSplitRequest(unsigned char &opcode, const unsigned char *&buffer,
unsigned int &size);
int handleTaintLameRequest(unsigned char &opcode, const unsigned char *&buffer,
unsigned int &size);
......@@ -261,20 +235,6 @@ class ClientChannel : public Channel
int handleSplitChecksum(EncodeBuffer &encodeBuffer, T_checksum checksum);
void handleSplitEnable()
{
if (control -> isProtoStep7() == 0)
{
#if defined(TEST) || defined(SPLIT)
*logofs << "handleSplitEnable: WARNING! Disabling split "
<< "with an old proxy version.\n"
<< logofs_flush;
#endif
enableSplit_ = 0;
}
}
void handleSplitPending(int resource)
{
if (splitState_.pending == 0)
......
......@@ -84,14 +84,8 @@ class ClientProxy : public Proxy
virtual int checkLocalChannelMap(int channelId)
{
if (control -> isProtoStep7() == 1)
{
return ((channelId & control -> ChannelMask) != 0);
}
else
{
return 1;
}
// Since ProtoStep7 (#issue 108)
return ((channelId & control -> ChannelMask) != 0);
}
//
......
......@@ -54,11 +54,6 @@
#include "PutPackedImage.h"
#include "GenericRequest.h"
#include "ChangeGCCompat.h"
#include "CreatePixmapCompat.h"
#include "SetUnpackColormapCompat.h"
#include "SetUnpackAlphaCompat.h"
//
// Set the verbosity level.
//
......@@ -111,20 +106,11 @@ ClientStore::ClientStore(StaticCompressor *compressor)
requests_[X_NXSetUnpackGeometry] = new SetUnpackGeometryStore(compressor);
requests_[X_NXPutPackedImage] = new PutPackedImageStore(compressor);
if (control -> isProtoStep7() == 1)
{
requests_[X_ChangeGC] = new ChangeGCStore();
requests_[X_CreatePixmap] = new CreatePixmapStore();
requests_[X_NXSetUnpackColormap] = new SetUnpackColormapStore(compressor);
requests_[X_NXSetUnpackAlpha] = new SetUnpackAlphaStore(compressor);
}
else
{
requests_[X_ChangeGC] = new ChangeGCCompatStore();
requests_[X_CreatePixmap] = new CreatePixmapCompatStore();
requests_[X_NXSetUnpackColormap] = new SetUnpackColormapCompatStore(compressor);
requests_[X_NXSetUnpackAlpha] = new SetUnpackAlphaCompatStore(compressor);
}
// Since ProtoStep7 (#issue 108)
requests_[X_ChangeGC] = new ChangeGCStore();
requests_[X_CreatePixmap] = new CreatePixmapStore();
requests_[X_NXSetUnpackColormap] = new SetUnpackColormapStore(compressor);
requests_[X_NXSetUnpackAlpha] = new SetUnpackAlphaStore(compressor);
for (int i = 0; i < CHANNEL_STORE_RESOURCE_LIMIT; i++)
{
......
......@@ -349,6 +349,14 @@
#define FILE_SIZE_CHECK_TIMEOUT 60000
//
// Protocol version compatibility values
//
const int Control::NX_MIN_PROTO_STEP = 10;
const int Control::NX_MAX_PROTO_STEP = 10;
const char* const Control::NXPROXY_COMPATIBILITY_VERSION = "3.5.0";
//
// Set defaults for control. They should be what
// you get in case of 'local' connection.
//
......@@ -633,11 +641,7 @@ Control::Control()
// time the session is negotiated.
//
protoStep6_ = 0;
protoStep7_ = 0;
protoStep8_ = 0;
protoStep9_ = 0;
protoStep10_ = 0;
protoStep_ = 0;
}
Control::~Control()
......@@ -705,92 +709,27 @@ Control::~Control()
void Control::setProtoStep(int step)
{
switch (step)
if (isValidProtoStep(step))
{
case 6:
{
protoStep6_ = 1;
protoStep7_ = 0;
protoStep8_ = 0;
protoStep9_ = 0;
protoStep10_ = 0;
break;
}
case 7:
{
protoStep6_ = 1;
protoStep7_ = 1;
protoStep8_ = 0;
protoStep9_ = 0;
protoStep10_ = 0;
break;
}
case 8:
{
protoStep6_ = 1;
protoStep7_ = 1;
protoStep8_ = 1;
protoStep9_ = 0;
protoStep10_ = 0;
break;
}
case 9:
{
protoStep6_ = 1;
protoStep7_ = 1;
protoStep8_ = 1;
protoStep9_ = 1;
protoStep10_ = 0;
break;
}
case 10:
{
protoStep6_ = 1;
protoStep7_ = 1;
protoStep8_ = 1;
protoStep9_ = 1;
protoStep10_ = 1;
break;
}
default:
{
#ifdef PANIC
*logofs << "Control: PANIC! Invalid protocol step "
<< "with value " << step << ".\n"
<< logofs_flush;
#endif
HandleCleanup();
}
protoStep_ = step;
}
else
{
#ifdef PANIC
*logofs << "Control: PANIC! Invalid protocol step "
<< "with value " << step << ".\n"
<< logofs_flush;
#endif
HandleCleanup();
}
}
int Control::getProtoStep()
{
if (protoStep10_ == 1)
{
return 10;
}
else if (protoStep9_ == 1)
{
return 9;
}
else if (protoStep8_ == 1)
{
return 8;
}
else if (protoStep7_ == 1)
{
return 7;
}
else if (protoStep6_ == 1)
if (isValidProtoStep(protoStep_))
{
return 6;
return protoStep_;
}
else
{
......
......@@ -321,6 +321,12 @@ class Control
int CompatVersionMaintenancePatch;
//
// Compatibility version for the proxy
//
static const char* const NXPROXY_COMPATIBILITY_VERSION;
//
// Which unpack methods are implemented in proxy?
//
......@@ -713,26 +719,6 @@ class Control
int getProtoStep();
int isProtoStep7()
{
return protoStep7_;
}
int isProtoStep8()
{
return protoStep8_;
}
int isProtoStep9()
{
return protoStep9_;
}
int isProtoStep10()
{
return protoStep10_;
}
private:
//
......@@ -746,11 +732,25 @@ class Control
// to the protocol version.
//
int protoStep6_;
int protoStep7_;
int protoStep8_;
int protoStep9_;
int protoStep10_;
int protoStep_;
//
// Min and max values allowed for protocol step
// depending on protocol version compatibility
//
static const int NX_MIN_PROTO_STEP;
static const int NX_MAX_PROTO_STEP;
//
// Check the validity of protocol step
//
bool isValidProtoStep(int step)
{
return ((step >= NX_MIN_PROTO_STEP) && (step <= NX_MAX_PROTO_STEP));
}
};
#endif /* Control_H */
......@@ -146,39 +146,17 @@ void CreateGCStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *me
ClientCache *clientCache = (ClientCache *) channelCache;
if (control -> isProtoStep7() == 1)
{
#ifdef TEST
*logofs << name() << ": Encoding value " << createGC -> gcontext
<< " as gcontext field.\n" << logofs_flush;
#endif
encodeBuffer.encodeNewXidValue(createGC -> gcontext, clientCache -> lastId,
clientCache -> lastIdCache, clientCache -> gcCache,
clientCache -> freeGCCache);
cachedCreateGC -> gcontext = createGC -> gcontext;
}
else
{
#ifdef TEST
*logofs << name() << ": Encoding value " << createGC -> drawable
<< " as drawable field.\n" << logofs_flush;
#endif
encodeBuffer.encodeXidValue(createGC -> drawable, clientCache -> drawableCache);
cachedCreateGC -> drawable = createGC -> drawable;
#ifdef TEST
*logofs << name() << ": Encoding value " << createGC -> gcontext
<< " as gcontext field.\n" << logofs_flush;
#endif
// Since ProtoStep7 (#issue 108)
#ifdef TEST
*logofs << name() << ": Encoding value " << createGC -> gcontext
<< " as gcontext field.\n" << logofs_flush;
#endif
encodeBuffer.encodeXidValue(createGC -> gcontext, clientCache -> gcCache);
encodeBuffer.encodeNewXidValue(createGC -> gcontext, clientCache -> lastId,
clientCache -> lastIdCache, clientCache -> gcCache,
clientCache -> freeGCCache);
cachedCreateGC -> gcontext = createGC -> gcontext;
}
cachedCreateGC -> gcontext = createGC -> gcontext;
}
void CreateGCStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *message,
......@@ -190,37 +168,15 @@ void CreateGCStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *me
unsigned int value;
if (control -> isProtoStep7() == 1)
{
decodeBuffer.decodeNewXidValue(value, clientCache -> lastId,
clientCache -> lastIdCache, clientCache -> gcCache,
clientCache -> freeGCCache);
// Since ProtoStep7 (#issue 108)
decodeBuffer.decodeNewXidValue(value, clientCache -> lastId,
clientCache -> lastIdCache, clientCache -> gcCache,
clientCache -> freeGCCache);
createGC -> gcontext = value;
createGC -> gcontext = value;
#ifdef TEST
*logofs << name() << ": Decoded value " << createGC -> gcontext
<< " as gcontext field.\n" << logofs_flush;
#endif
}
else
{
decodeBuffer.decodeXidValue(value, clientCache -> drawableCache);
createGC -> drawable = value;
#ifdef TEST
*logofs << name() << ": Decoded value " << createGC -> drawable
<< " as drawable field.\n" << logofs_flush;
#endif
decodeBuffer.decodeXidValue(value, clientCache -> gcCache);
createGC -> gcontext = value;
#ifdef TEST
*logofs << name() << ": Decoded value " << createGC -> gcontext
<< " as gcontext field.\n" << logofs_flush;
#endif
}
#ifdef TEST
*logofs << name() << ": Decoded value " << createGC -> gcontext
<< " as gcontext field.\n" << logofs_flush;
#endif
}
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#include "CreatePixmapCompat.h"
#include "ClientCache.h"
#include "EncodeBuffer.h"
#include "DecodeBuffer.h"
#include "WriteBuffer.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
//
// Constructors and destructors.
//
CreatePixmapCompatStore::CreatePixmapCompatStore()
: MessageStore()
{
enableCache = CREATEPIXMAP_ENABLE_CACHE;
enableData = CREATEPIXMAP_ENABLE_DATA;
enableSplit = CREATEPIXMAP_ENABLE_SPLIT;
enableCompress = CREATEPIXMAP_ENABLE_COMPRESS;
dataLimit = CREATEPIXMAP_DATA_LIMIT;
dataOffset = CREATEPIXMAP_DATA_OFFSET;
cacheSlots = CREATEPIXMAP_CACHE_SLOTS;
cacheThreshold = CREATEPIXMAP_CACHE_THRESHOLD;
cacheLowerThreshold = CREATEPIXMAP_CACHE_LOWER_THRESHOLD;
messages_ -> resize(cacheSlots);
for (T_messages::iterator i = messages_ -> begin();
i < messages_ -> end(); i++)
{
*i = NULL;
}
temporary_ = NULL;
}
CreatePixmapCompatStore::~CreatePixmapCompatStore()
{
for (T_messages::iterator i = messages_ -> begin();
i < messages_ -> end(); i++)
{
destroy(*i);
}
destroy(temporary_);
}
//
// Here are the methods to handle messages' content.
//
int CreatePixmapCompatStore::encodeIdentity(EncodeBuffer &encodeBuffer, const unsigned char *buffer,
const unsigned int size, int bigEndian,
ChannelCache *channelCache) const
{
ClientCache *clientCache = (ClientCache *) channelCache;
encodeBuffer.encodeCachedValue(*(buffer + 1), 8,
clientCache -> depthCache);
encodeBuffer.encodeDiffCachedValue(GetULONG(buffer + 4, bigEndian),
clientCache -> createPixmapLastId, 29,
clientCache -> createPixmapIdCache, 4);
encodeBuffer.encodeXidValue(GetULONG(buffer + 8, bigEndian),
clientCache -> drawableCache);
encodeBuffer.encodeCachedValue(GetUINT(buffer + 12, bigEndian), 16,
clientCache -> createPixmapXCache, 8);
encodeBuffer.encodeCachedValue(GetUINT(buffer + 14, bigEndian), 16,
clientCache -> createPixmapYCache, 8);
#ifdef TEST
*logofs << name() << ": Encoded message. Size is "
<< size << ".\n" << logofs_flush;
#endif
return 1;
}
int CreatePixmapCompatStore::decodeIdentity(DecodeBuffer &decodeBuffer, unsigned char *&buffer,
unsigned int &size, int bigEndian, WriteBuffer *writeBuffer,
ChannelCache *channelCache) const
{
ClientCache *clientCache = (ClientCache *) channelCache;
unsigned char cValue;
unsigned int value;
size = 16;
buffer = writeBuffer -> addMessage(size);
decodeBuffer.decodeCachedValue(cValue, 8,
clientCache -> depthCache);
*(buffer + 1) = cValue;
decodeBuffer.decodeDiffCachedValue(value,
clientCache -> createPixmapLastId, 29,
clientCache -> createPixmapIdCache, 4);
PutULONG(value, buffer + 4, bigEndian);
decodeBuffer.decodeXidValue(value,
clientCache -> drawableCache);
PutULONG(value, buffer + 8, bigEndian);
decodeBuffer.decodeCachedValue(value, 16,
clientCache -> createPixmapXCache, 8);
PutUINT(value, buffer + 12, bigEndian);
decodeBuffer.decodeCachedValue(value, 16,
clientCache -> createPixmapYCache, 8);
PutUINT(value, buffer + 14, bigEndian);
#ifdef TEST
*logofs << name() << ": Decoded message. Size is "
<< size << ".\n" << logofs_flush;
#endif
return 1;
}
int CreatePixmapCompatStore::parseIdentity(Message *message, const unsigned char *buffer,
unsigned int size, int bigEndian) const
{
CreatePixmapCompatMessage *createPixmap = (CreatePixmapCompatMessage *) message;
createPixmap -> depth = *(buffer + 1);
createPixmap -> id = GetULONG(buffer + 4, bigEndian);
createPixmap -> drawable = GetULONG(buffer + 8, bigEndian);
createPixmap -> width = GetUINT(buffer + 12, bigEndian);
createPixmap -> height = GetUINT(buffer + 14, bigEndian);
#ifdef TEST
*logofs << name() << ": Parsed identity. Size is "
<< createPixmap -> size_ << " identity is "
<< createPixmap -> i_size_ << ".\n"
<< logofs_flush;
#endif
return 1;
}
int CreatePixmapCompatStore::unparseIdentity(const Message *message, unsigned char *buffer,
unsigned int size, int bigEndian) const
{
CreatePixmapCompatMessage *createPixmap = (CreatePixmapCompatMessage *) message;
*(buffer + 1) = createPixmap -> depth;
PutULONG(createPixmap -> id, buffer + 4, bigEndian);
PutULONG(createPixmap -> drawable, buffer + 8, bigEndian);
PutUINT(createPixmap -> width, buffer + 12, bigEndian);
PutUINT(createPixmap -> height, buffer + 14, bigEndian);
#ifdef TEST
*logofs << name() << ": Unparsed identity. Size is "
<< createPixmap -> size_ << " identity is "
<< createPixmap -> i_size_ << ".\n"
<< logofs_flush;
#endif
return 1;
}
void CreatePixmapCompatStore::dumpIdentity(const Message *message) const
{
#ifdef DUMP
#ifdef WARNING
*logofs << name() << ": WARNING! Dump of identity not implemented.\n"
<< logofs_flush;
#endif
#endif
}
void CreatePixmapCompatStore::identityChecksum(const Message *message, const unsigned char *buffer,
unsigned int size, int bigEndian) const
{
md5_append(md5_state_, buffer + 1, 1);
md5_append(md5_state_, buffer + 8, 8);
}
void CreatePixmapCompatStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *message,
const Message *cachedMessage,
ChannelCache *channelCache) const
{
CreatePixmapCompatMessage *createPixmap = (CreatePixmapCompatMessage *) message;
CreatePixmapCompatMessage *cachedCreatePixmap = (CreatePixmapCompatMessage *) cachedMessage;
ClientCache *clientCache = (ClientCache *) channelCache;
encodeBuffer.encodeDiffCachedValue(createPixmap -> id,
clientCache -> createPixmapLastId, 29,
clientCache -> createPixmapIdCache, 4);
cachedCreatePixmap -> id = createPixmap -> id;
encodeBuffer.encodeXidValue(createPixmap -> drawable,
clientCache -> drawableCache);
cachedCreatePixmap -> drawable = createPixmap -> drawable;
#ifdef TEST
*logofs << name() << ": Encoded update. Size is "
<< createPixmap -> size_ << " identity is "
<< createPixmap -> i_size_ << ".\n"
<< logofs_flush;
#endif
}
void CreatePixmapCompatStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *message,
ChannelCache *channelCache) const
{
CreatePixmapCompatMessage *createPixmap = (CreatePixmapCompatMessage *) message;
ClientCache *clientCache = (ClientCache *) channelCache;
decodeBuffer.decodeDiffCachedValue(createPixmap -> id,
clientCache -> createPixmapLastId, 29,
clientCache -> createPixmapIdCache, 4);
decodeBuffer.decodeXidValue(createPixmap -> drawable,
clientCache -> drawableCache);
#ifdef TEST
*logofs << name() << ": Decoded update. Size is "
<< createPixmap -> size_ << " identity is "
<< createPixmap -> i_size_ << ".\n"
<< logofs_flush;
#endif
}
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef CreatePixmapCompat_H
#define CreatePixmapCompat_H
#include "Message.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#undef DUMP
//
// Set default values.
//
#define CREATEPIXMAP_ENABLE_CACHE 1
#define CREATEPIXMAP_ENABLE_DATA 0
#define CREATEPIXMAP_ENABLE_SPLIT 0
#define CREATEPIXMAP_ENABLE_COMPRESS 0
#define CREATEPIXMAP_DATA_LIMIT 16
#define CREATEPIXMAP_DATA_OFFSET 16
#define CREATEPIXMAP_CACHE_SLOTS 1000
#define CREATEPIXMAP_CACHE_THRESHOLD 2
#define CREATEPIXMAP_CACHE_LOWER_THRESHOLD 1
//
// The message class.
//
class CreatePixmapCompatMessage : public Message
{
friend class CreatePixmapCompatStore;
public:
CreatePixmapCompatMessage()
{
}
~CreatePixmapCompatMessage()
{
}
//
// Put here the fields which constitute
// the 'identity' part of the message.
//
private:
unsigned char depth;
unsigned int id;
unsigned int drawable;
unsigned short width;
unsigned short height;
};
class CreatePixmapCompatStore : public MessageStore
{
public:
CreatePixmapCompatStore();
virtual ~CreatePixmapCompatStore();
virtual const char *name() const
{
return "CreatePixmapCompat";
}
virtual unsigned char opcode() const
{
return X_CreatePixmap;
}
virtual unsigned int storage() const
{
return sizeof(CreatePixmapCompatMessage);
}
//
// Message handling methods.
//
protected:
virtual Message *create() const
{
return new CreatePixmapCompatMessage();
}
virtual Message *create(const Message &message) const
{
return new CreatePixmapCompatMessage((const CreatePixmapCompatMessage &) message);
}
virtual void destroy(Message *message) const
{
delete (CreatePixmapCompatMessage *) message;
}
virtual int encodeIdentity(EncodeBuffer &encodeBuffer, const unsigned char *buffer,
const unsigned int size, int bigEndian,
ChannelCache *channelCache) const;
virtual int decodeIdentity(DecodeBuffer &decodeBuffer, unsigned char *&buffer,
unsigned int &size, int bigEndian, WriteBuffer *writeBuffer,
ChannelCache *channelCache) const;
virtual int parseIdentity(Message *message, const unsigned char *buffer,
unsigned int size, int bigEndian) const;
virtual int unparseIdentity(const Message *message, unsigned char *buffer,
unsigned int size, int bigEndian) const;
virtual void updateIdentity(EncodeBuffer &encodeBuffer, const Message *message,
const Message *cachedMessage,
ChannelCache *channelCache) const;
virtual void updateIdentity(DecodeBuffer &decodeBuffer, const Message *message,
ChannelCache *channelCache) const;
virtual void identityChecksum(const Message *message, const unsigned char *buffer,
unsigned int size, int bigEndian) const;
virtual void dumpIdentity(const Message *message) const;
};
#endif /* CreatePixmapCompat_H */
......@@ -34,10 +34,8 @@ DecodeBuffer::DecodeBuffer(const unsigned char *data, unsigned int length)
: buffer_(data), end_(buffer_ + length), nextSrc_(buffer_), srcMask_(0x80)
{
if (control -> isProtoStep7() == 1)
{
end_ = buffer_ + length - DECODE_BUFFER_POSTFIX_SIZE;
}
// Since ProtoStep7 (#issue 108)
end_ = buffer_ + length - DECODE_BUFFER_POSTFIX_SIZE;
}
int DecodeBuffer::decodeValue(unsigned int &value, unsigned int numBits,
......@@ -277,63 +275,25 @@ int DecodeBuffer::decodeCachedValue(unsigned int &value, unsigned int numBits,
if (index == 2)
{
if (control -> isProtoStep8() == 1)
{
blockSize = cache.getBlockSize(blockSize);
if (decodeValue(value, numBits, blockSize, endOkay))
{
cache.insert(value, IntMask[numBits]);
return 1;
}
// Since ProtoStep8 (#issue 108)
blockSize = cache.getBlockSize(blockSize);
#ifdef PANIC
*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] "
<< "in decodeCacheValue() with no value found.\n"
<< logofs_flush;
#endif
cerr << "Error" << ": Failure decoding data in context [H].\n";
HandleAbort();
}
else
if (decodeValue(value, numBits, blockSize, endOkay))
{
unsigned int sameDiff;
decodeBoolValue(sameDiff);
if (sameDiff)
{
value = cache.getLastDiff(IntMask[numBits]);
cache.insert(value, IntMask[numBits]);
cache.insert(value, IntMask[numBits]);
return 1;
}
else
{
blockSize = cache.getBlockSize(blockSize);
if (decodeValue(value, numBits, blockSize, endOkay))
{
cache.insert(value, IntMask[numBits]);
return 1;
}
return 1;
}
#ifdef PANIC
*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] "
<< "in decodeCacheValue() with no value found.\n"
<< logofs_flush;
#endif
#ifdef PANIC
*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] "
<< "in decodeCacheValue() with no value found.\n"
<< logofs_flush;
#endif
cerr << "Error" << ": Failure decoding data in context [H].\n";
cerr << "Error" << ": Failure decoding data in context [H].\n";
HandleAbort();
}
}
HandleAbort();
}
else
{
......@@ -665,28 +625,3 @@ void DecodeBuffer::decodeFreeXidValue(unsigned int &value, FreeCache &cache)
decodeCachedValue(value, 29, cache);
}
void DecodeBuffer::decodePositionValueCompat(short int &value, PositionCacheCompat &cache)
{
unsigned int t;
decodeCachedValue(t, 13, *(cache.base_[cache.slot_]));
cache.last_ += t;
cache.last_ &= 0x1fff;
value = cache.last_;
#ifdef DEBUG
*logofs << "DecodeBuffer: Decoded position "
<< value << " with base " << cache.slot_
<< ".\n" << logofs_flush;
#endif
#ifdef DEBUG
*logofs << "DecodeBuffer: Position block prediction is "
<< (*(cache.base_[cache.slot_])).getBlockSize(13)
<< ".\n" << logofs_flush;
#endif
cache.slot_ = (value & 0x1f);
}
......@@ -27,9 +27,6 @@
#include "OpcodeCache.h"
#include "ActionCache.h"
#include "ActionCacheCompat.h"
#include "PositionCacheCompat.h"
#define DECODE_BUFFER_OVERFLOW_SIZE 4194304
#define DECODE_BUFFER_POSTFIX_SIZE 1
......@@ -99,15 +96,6 @@ class DecodeBuffer
void decodeFreeXidValue(unsigned int &value, FreeCache &cache);
void decodeActionValueCompat(unsigned char &value, ActionCacheCompat &cache)
{
decodeCachedValue(value, 2, cache.base_[cache.slot_]);
cache.slot_ = value;
}
void decodePositionValueCompat(short int &value, PositionCacheCompat &cache);
void decodeTextData(unsigned char *buffer, unsigned int numBytes)
{
decodeMemory(buffer, numBytes);
......
......@@ -261,47 +261,14 @@ void EncodeBuffer::encodeCachedValue(unsigned int value, unsigned int numBits,
// Avoid to encode the additional bool.
//
if (control -> isProtoStep8() == 1)
{
#ifdef DUMP
*logofs << "EncodeBuffer: Encoded missed int using "
<< diffBits() << " bits out of " << numBits
<< ".\n" << logofs_flush;
#endif
encodeValue(value, numBits, blockSize);
}
else
{
if (sameDiff)
{
#ifdef DUMP
*logofs << "EncodeBuffer: Matched difference with block size "
<< cache.getBlockSize(blockSize) << ".\n"
<< logofs_flush;
#endif
encodeBoolValue(1);
}
else
{
#ifdef DUMP
*logofs << "EncodeBuffer: Missed difference with block size "
<< cache.getBlockSize(blockSize) << ".\n"
<< logofs_flush;
#endif
encodeBoolValue(0);
encodeValue(value, numBits, blockSize);
}
// Since ProtoStep8 (#issue 108)
#ifdef DUMP
*logofs << "EncodeBuffer: Encoded missed int using "
<< diffBits() << " bits out of " << numBits
<< ".\n" << logofs_flush;
#endif
#ifdef DUMP
*logofs << "EncodeBuffer: Encoded missed int using "
<< diffBits() << " bits out of " << numBits
<< ".\n" << logofs_flush;
#endif
}
encodeValue(value, numBits, blockSize);
}
}
......@@ -454,7 +421,8 @@ unsigned int EncodeBuffer::getLength() const
length++;
}
if (length > 0 && control -> isProtoStep7() == 1)
// Since ProtoStep7 (#issue 108)
if (length > 0)
{
return length + ENCODE_BUFFER_POSTFIX_SIZE;
}
......@@ -641,20 +609,3 @@ void EncodeBuffer::encodeFreeXidValue(unsigned int value, FreeCache &cache)
{
encodeCachedValue(value, 29, cache);
}
void EncodeBuffer::encodePositionValueCompat(short int value, PositionCacheCompat &cache)
{
unsigned int t = (value - cache.last_);
encodeCachedValue(t, 13, *(cache.base_[cache.slot_]));
cache.last_ = value;
#ifdef DEBUG
*logofs << "EncodeBuffer: Encoded position "
<< value << " with base " << cache.slot_
<< ".\n" << logofs_flush;
#endif
cache.slot_ = (value & 0x1f);
}
......@@ -25,9 +25,6 @@
#include "OpcodeCache.h"
#include "ActionCache.h"
#include "ActionCacheCompat.h"
#include "PositionCacheCompat.h"
#define ENCODE_BUFFER_DEFAULT_SIZE 16384
//
......@@ -117,15 +114,6 @@ class EncodeBuffer
void encodeFreeXidValue(unsigned int value, FreeCache &cache);
void encodeActionValueCompat(unsigned char value, ActionCacheCompat &cache)
{
encodeCachedValue(value, 2, cache.base_[cache.slot_]);
cache.slot_ = value;
}
void encodePositionValueCompat(short int value, PositionCacheCompat &cache);
void encodeTextData(const unsigned char *buffer, unsigned int numBytes)
{
encodeMemory(buffer, numBytes);
......
......@@ -51,8 +51,8 @@ int FillPolyStore::parseIdentity(Message *message, const unsigned char *buffer,
fillPoly -> shape = *(buffer + 12);
fillPoly -> mode = *(buffer + 13);
if (control -> isProtoStep8() == 1 &&
size >= (unsigned int) dataOffset)
// Since ProtoStep8 (#issue 108)
if (size >= (unsigned int) dataOffset)
{
fillPoly -> x_origin = GetUINT(buffer + 16, bigEndian);
fillPoly -> y_origin = GetUINT(buffer + 18, bigEndian);
......@@ -85,8 +85,8 @@ int FillPolyStore::unparseIdentity(const Message *message, unsigned char *buffer
*(buffer + 12) = fillPoly -> shape;
*(buffer + 13) = fillPoly -> mode;
if (control -> isProtoStep8() == 1 &&
size >= (unsigned int) dataOffset)
// Since ProtoStep8 (#issue 108)
if (size >= (unsigned int) dataOffset)
{
PutUINT(fillPoly -> x_origin, buffer + 16, bigEndian);
PutUINT(fillPoly -> y_origin, buffer + 18, bigEndian);
......@@ -151,8 +151,8 @@ void FillPolyStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *me
cachedFillPoly -> gcontext = fillPoly -> gcontext;
if (control -> isProtoStep8() == 1 &&
fillPoly -> size_ >= dataOffset)
// Since ProtoStep8 (#issue 108)
if (fillPoly -> size_ >= dataOffset)
{
#ifdef TEST
*logofs << name() << ": Encoding value " << fillPoly -> x_origin
......@@ -197,8 +197,8 @@ void FillPolyStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *me
<< " as gcontext field.\n" << logofs_flush;
#endif
if (control -> isProtoStep8() == 1 &&
fillPoly -> size_ >= dataOffset)
// Since ProtoStep8 (#issue 108)
if (fillPoly -> size_ >= dataOffset)
{
unsigned int value;
......
......@@ -40,7 +40,6 @@
#define FILLPOLY_ENABLE_COMPRESS 0
#define FILLPOLY_DATA_LIMIT 512
#define FILLPOLY_DATA_OFFSET 16
#define FILLPOLY_CACHE_SLOTS 2000
#define FILLPOLY_CACHE_THRESHOLD 3
......@@ -98,12 +97,9 @@ class FillPolyStore : public MessageStore
enableCompress = FILLPOLY_ENABLE_COMPRESS;
dataLimit = FILLPOLY_DATA_LIMIT;
dataOffset = FILLPOLY_DATA_OFFSET;
if (control -> isProtoStep8() == 1)
{
dataOffset = FILLPOLY_DATA_OFFSET_IF_PROTO_STEP_8;
}
// Since ProtoStep8 (#issue 108)
dataOffset = FILLPOLY_DATA_OFFSET_IF_PROTO_STEP_8;
cacheSlots = FILLPOLY_CACHE_SLOTS;
cacheThreshold = FILLPOLY_CACHE_THRESHOLD;
......@@ -169,11 +165,9 @@ class FillPolyStore : public MessageStore
virtual int identitySize(const unsigned char *buffer, unsigned int size)
{
unsigned int offset = (control -> isProtoStep8() == 1 ?
FILLPOLY_DATA_OFFSET_IF_PROTO_STEP_8 :
FILLPOLY_DATA_OFFSET);
return (size >= offset ? offset : size);
// Since ProtoStep8 (#issue 108)
return (size >= FILLPOLY_DATA_OFFSET_IF_PROTO_STEP_8 ?
FILLPOLY_DATA_OFFSET_IF_PROTO_STEP_8 : size);
}
virtual int parseIdentity(Message *message, const unsigned char *buffer,
......
......@@ -209,11 +209,7 @@ class CupsChannel : public GenericChannel
virtual int isCompressed()
{
if (control -> isProtoStep8() == 0)
{
return 1;
}
// Since ProtoStep8 (#issue 108)
return 0;
}
......@@ -252,11 +248,7 @@ class SmbChannel : public GenericChannel
virtual int isCompressed()
{
if (control -> isProtoStep8() == 0)
{
return 1;
}
// Since ProtoStep8 (#issue 108)
return 0;
}
......@@ -344,11 +336,7 @@ class HttpChannel : public GenericChannel
virtual int isCompressed()
{
if (control -> isProtoStep8() == 0)
{
return 1;
}
// Since ProtoStep8 (#issue 108)
return 0;
}
......@@ -387,11 +375,7 @@ class FontChannel : public GenericChannel
virtual int isCompressed()
{
if (control -> isProtoStep8() == 0)
{
return 1;
}
// Since ProtoStep8 (#issue 108)
return 0;
}
......
......@@ -45,12 +45,9 @@ GenericReplyStore::GenericReplyStore(StaticCompressor *compressor)
enableCache = GENERICREPLY_ENABLE_CACHE;
enableData = GENERICREPLY_ENABLE_DATA;
enableSplit = GENERICREPLY_ENABLE_SPLIT;
enableCompress = GENERICREPLY_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1)
{
enableCompress = GENERICREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
}
// Since ProtoStep7 (#issue 108)
enableCompress = GENERICREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
dataLimit = GENERICREPLY_DATA_LIMIT;
dataOffset = GENERICREPLY_DATA_OFFSET;
......
......@@ -37,7 +37,6 @@
#define GENERICREPLY_ENABLE_CACHE 1
#define GENERICREPLY_ENABLE_DATA 1
#define GENERICREPLY_ENABLE_SPLIT 0
#define GENERICREPLY_ENABLE_COMPRESS 1
#define GENERICREPLY_DATA_LIMIT 1048576 - 32
#define GENERICREPLY_DATA_OFFSET 32
......
......@@ -45,14 +45,9 @@ GenericRequestStore::GenericRequestStore(StaticCompressor *compressor)
enableCache = GENERICREQUEST_ENABLE_CACHE;
enableData = GENERICREQUEST_ENABLE_DATA;
enableSplit = GENERICREQUEST_ENABLE_SPLIT;
enableCompress = GENERICREQUEST_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1)
{
enableCompress = GENERICREQUEST_ENABLE_COMPRESS_IF_PROTO_STEP_7;
enableCompress = 0;
}
// Since ProtoStep7 (#issue 108)
enableCompress = GENERICREQUEST_ENABLE_COMPRESS_IF_PROTO_STEP_7;
dataLimit = GENERICREQUEST_DATA_LIMIT;
dataOffset = GENERICREQUEST_DATA_OFFSET;
......
......@@ -37,7 +37,6 @@
#define GENERICREQUEST_ENABLE_CACHE 1
#define GENERICREQUEST_ENABLE_DATA 1
#define GENERICREQUEST_ENABLE_SPLIT 0
#define GENERICREQUEST_ENABLE_COMPRESS 1
#define GENERICREQUEST_DATA_LIMIT 262144 - 20
#define GENERICREQUEST_DATA_OFFSET 20
......
......@@ -43,12 +43,9 @@ GetImageReplyStore::GetImageReplyStore(StaticCompressor *compressor)
enableCache = GETIMAGEREPLY_ENABLE_CACHE;
enableData = GETIMAGEREPLY_ENABLE_DATA;
enableSplit = GETIMAGEREPLY_ENABLE_SPLIT;
enableCompress = GETIMAGEREPLY_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1)
{
enableCompress = GETIMAGEREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
}
// Since ProtoStep7 (#issue 108)
enableCompress = GETIMAGEREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
dataLimit = GETIMAGEREPLY_DATA_LIMIT;
dataOffset = GETIMAGEREPLY_DATA_OFFSET;
......
......@@ -37,7 +37,6 @@
#define GETIMAGEREPLY_ENABLE_CACHE 1
#define GETIMAGEREPLY_ENABLE_DATA 1
#define GETIMAGEREPLY_ENABLE_SPLIT 0
#define GETIMAGEREPLY_ENABLE_COMPRESS 1
#define GETIMAGEREPLY_DATA_LIMIT 1048576 - 32
#define GETIMAGEREPLY_DATA_OFFSET 32
......
......@@ -45,12 +45,9 @@ GetPropertyReplyStore::GetPropertyReplyStore(StaticCompressor *compressor)
enableCache = GETPROPERTYREPLY_ENABLE_CACHE;
enableData = GETPROPERTYREPLY_ENABLE_DATA;
enableSplit = GETPROPERTYREPLY_ENABLE_SPLIT;
enableCompress = GETPROPERTYREPLY_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1)
{
enableCompress = GETPROPERTYREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
}
// Since ProtoStep7 (#issue 108)
enableCompress = GETPROPERTYREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
dataLimit = GETPROPERTYREPLY_DATA_LIMIT;
dataOffset = GETPROPERTYREPLY_DATA_OFFSET;
......
......@@ -37,7 +37,6 @@
#define GETPROPERTYREPLY_ENABLE_CACHE 1
#define GETPROPERTYREPLY_ENABLE_DATA 1
#define GETPROPERTYREPLY_ENABLE_SPLIT 0
#define GETPROPERTYREPLY_ENABLE_COMPRESS 1
#define GETPROPERTYREPLY_DATA_LIMIT 1048576 - 32
#define GETPROPERTYREPLY_DATA_OFFSET 32
......
......@@ -39,12 +39,9 @@ ListFontsReplyStore::ListFontsReplyStore(StaticCompressor *compressor)
enableCache = LISTFONTSREPLY_ENABLE_CACHE;
enableData = LISTFONTSREPLY_ENABLE_DATA;
enableSplit = LISTFONTSREPLY_ENABLE_SPLIT;
enableCompress = LISTFONTSREPLY_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1)
{
enableCompress = LISTFONTSREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
}
// Since ProtoStep7 (#issue 108)
enableCompress = LISTFONTSREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
dataLimit = LISTFONTSREPLY_DATA_LIMIT;
dataOffset = LISTFONTSREPLY_DATA_OFFSET;
......
......@@ -37,7 +37,6 @@
#define LISTFONTSREPLY_ENABLE_CACHE 1
#define LISTFONTSREPLY_ENABLE_DATA 1
#define LISTFONTSREPLY_ENABLE_SPLIT 0
#define LISTFONTSREPLY_ENABLE_COMPRESS 1
#define LISTFONTSREPLY_DATA_LIMIT 1048576 - 32
#define LISTFONTSREPLY_DATA_OFFSET 32
......
......@@ -165,7 +165,6 @@ CXXSRC = Loop.cpp \
BlockCache.cpp \
BlockCacheSet.cpp \
StaticCompressor.cpp \
TextCompressor.cpp \
Unpack.cpp \
Alpha.cpp \
Colormap.cpp \
......@@ -226,18 +225,7 @@ CXXSRC = Loop.cpp \
RenderCompositeGlyphs.cpp \
RenderFillRectangles.cpp \
RenderTrapezoids.cpp \
RenderTriangles.cpp \
PositionCacheCompat.cpp \
ChangeGCCompat.cpp \
CreatePixmapCompat.cpp \
SetUnpackColormapCompat.cpp \
SetUnpackAlphaCompat.cpp \
RenderCreatePictureCompat.cpp \
RenderFreePictureCompat.cpp \
RenderPictureClipCompat.cpp \
RenderCreateGlyphSetCompat.cpp \
RenderCompositeCompat.cpp \
RenderCompositeGlyphsCompat.cpp
RenderTriangles.cpp
MOBJ = $(MSRC:.c=.o)
COBJ = $(CSRC:.c=.o)
......
......@@ -113,20 +113,6 @@ MessageStore::MessageStore(StaticCompressor *compressor)
lastAction = is_discarded;
//
// This is used only for compatibility
// with older proxies.
//
if (control -> isProtoStep7() == 1)
{
lastResize = -1;
}
else
{
lastResize = 0;
}
//
// Private members.
//
......
......@@ -30,9 +30,6 @@
#include "ActionCache.h"
#include "ActionCacheCompat.h"
#include "PositionCacheCompat.h"
#include "StaticCompressor.h"
//
......@@ -346,16 +343,6 @@ class MessageStore
ActionCache lastActionCache;
//
// Used in old protocol versions.
//
ActionCacheCompat lastActionCacheCompat;
PositionCacheCompat lastAddedCacheCompat;
PositionCacheCompat lastHitCacheCompat;
PositionCacheCompat lastRemovedCacheCompat;
//
// Position in cache where next insertion
// is going to take place.
//
......@@ -363,14 +350,6 @@ class MessageStore
short int lastRated;
//
// Size of data part of last split message
// once compressed. This is used only for
// compatibility with older proxies.
//
int lastResize;
//
// Constructors and destructors.
//
......
......@@ -93,10 +93,8 @@ void PolyLineStore::dumpIdentity(const Message *message) const
void PolyLineStore::identityChecksum(const Message *message, const unsigned char *buffer,
unsigned int size, int bigEndian) const
{
if (control -> isProtoStep8() == 1)
{
md5_append(md5_state_, buffer + 1, 1);
}
// Since ProtoStep8 (#issue 108)
md5_append(md5_state_, buffer + 1, 1);
}
void PolyLineStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *message,
......@@ -108,11 +106,6 @@ void PolyLineStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *me
ClientCache *clientCache = (ClientCache *) channelCache;
if (control -> isProtoStep8() == 0)
{
encodeBuffer.encodeBoolValue((unsigned int) polyLine -> mode);
}
#ifdef TEST
*logofs << name() << ": Encoding value " << polyLine -> drawable
<< " as drawable field.\n" << logofs_flush;
......@@ -141,13 +134,6 @@ void PolyLineStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *me
unsigned int value;
if (control -> isProtoStep8() == 0)
{
decodeBuffer.decodeBoolValue(value);
polyLine -> mode = value;
}
decodeBuffer.decodeXidValue(value, clientCache -> drawableCache);
polyLine -> drawable = value;
......
......@@ -93,10 +93,8 @@ void PolyPointStore::dumpIdentity(const Message *message) const
void PolyPointStore::identityChecksum(const Message *message, const unsigned char *buffer,
unsigned int size, int bigEndian) const
{
if (control -> isProtoStep8() == 1)
{
md5_append(md5_state_, buffer + 1, 1);
}
// Since ProtoStep8 (#issue 108)
md5_append(md5_state_, buffer + 1, 1);
}
void PolyPointStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *message,
......@@ -108,11 +106,6 @@ void PolyPointStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *m
ClientCache *clientCache = (ClientCache *) channelCache;
if (control -> isProtoStep8() == 0)
{
encodeBuffer.encodeBoolValue((unsigned int) polyPoint -> mode);
}
#ifdef TEST
*logofs << name() << ": Encoding value " << polyPoint -> drawable
<< " as drawable field.\n" << logofs_flush;
......@@ -141,13 +134,6 @@ void PolyPointStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *m
unsigned int value;
if (control -> isProtoStep8() == 0)
{
decodeBuffer.decodeBoolValue(value);
polyPoint -> mode = value;
}
decodeBuffer.decodeXidValue(value, clientCache -> drawableCache);
polyPoint -> drawable = value;
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#include "Control.h"
#include "PositionCacheCompat.h"
PositionCacheCompat::PositionCacheCompat()
{
if (control -> isProtoStep7() == 0)
{
for (int i = 0; i < 32; i++)
{
base_[i] = new IntCache(8);
}
slot_ = 0;
last_ = 0;
}
}
PositionCacheCompat::~PositionCacheCompat()
{
if (control -> isProtoStep7() == 0)
{
for (int i = 0; i < 32; i++)
{
delete base_[i];
}
}
}
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef PositionCacheCompat_H
#define PositionCacheCompat_H
#include "IntCache.h"
class PositionCacheCompat
{
friend class EncodeBuffer;
friend class DecodeBuffer;
public:
PositionCacheCompat();
~PositionCacheCompat();
private:
IntCache *base_[32];
unsigned int slot_;
short int last_;
};
#endif /* PositionCacheCompat_H */
......@@ -767,11 +767,6 @@ class Proxy
handleSplitEvent(encodeBuffer_, split);
}
int handleAsyncInit()
{
return handleFlush();
}
int handleAsyncPriority()
{
if (control -> FlushPriority == 1)
......
......@@ -44,13 +44,9 @@ PutImageStore::PutImageStore(StaticCompressor *compressor)
{
enableCache = PUTIMAGE_ENABLE_CACHE;
enableData = PUTIMAGE_ENABLE_DATA;
enableSplit = PUTIMAGE_ENABLE_SPLIT;
enableCompress = PUTIMAGE_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1)
{
enableCompress = PUTIMAGE_ENABLE_COMPRESS_IF_PROTO_STEP_7;
}
// Since ProtoStep7 (#issue 108)
enableCompress = PUTIMAGE_ENABLE_COMPRESS_IF_PROTO_STEP_7;
dataLimit = PUTIMAGE_DATA_LIMIT;
dataOffset = PUTIMAGE_DATA_OFFSET;
......@@ -59,10 +55,8 @@ PutImageStore::PutImageStore(StaticCompressor *compressor)
cacheThreshold = PUTIMAGE_CACHE_THRESHOLD;
cacheLowerThreshold = PUTIMAGE_CACHE_LOWER_THRESHOLD;
if (control -> isProtoStep8() == 1)
{
enableSplit = PUTIMAGE_ENABLE_SPLIT_IF_PROTO_STEP_8;
}
// Since ProtoStep8 (#issue 108)
enableSplit = PUTIMAGE_ENABLE_SPLIT_IF_PROTO_STEP_8;
messages_ -> resize(cacheSlots);
......
......@@ -36,8 +36,6 @@
#define PUTIMAGE_ENABLE_CACHE 1
#define PUTIMAGE_ENABLE_DATA 1
#define PUTIMAGE_ENABLE_SPLIT 1
#define PUTIMAGE_ENABLE_COMPRESS 1
#define PUTIMAGE_DATA_LIMIT 262144 - 24
#define PUTIMAGE_DATA_OFFSET 24
......
......@@ -44,7 +44,6 @@ PutPackedImageStore::PutPackedImageStore(StaticCompressor *compressor)
{
enableCache = PUTPACKEDIMAGE_ENABLE_CACHE;
enableData = PUTPACKEDIMAGE_ENABLE_DATA;
enableSplit = PUTPACKEDIMAGE_ENABLE_SPLIT;
enableCompress = PUTPACKEDIMAGE_ENABLE_COMPRESS;
dataLimit = PUTPACKEDIMAGE_DATA_LIMIT;
......@@ -54,10 +53,8 @@ PutPackedImageStore::PutPackedImageStore(StaticCompressor *compressor)
cacheThreshold = PUTPACKEDIMAGE_CACHE_THRESHOLD;
cacheLowerThreshold = PUTPACKEDIMAGE_CACHE_LOWER_THRESHOLD;
if (control -> isProtoStep8() == 1)
{
enableSplit = PUTPACKEDIMAGE_ENABLE_SPLIT_IF_PROTO_STEP_8;
}
// Since ProtoStep8 (#issue 108)
enableSplit = PUTPACKEDIMAGE_ENABLE_SPLIT_IF_PROTO_STEP_8;
messages_ -> resize(cacheSlots);
......
......@@ -36,7 +36,6 @@
#define PUTPACKEDIMAGE_ENABLE_CACHE 1
#define PUTPACKEDIMAGE_ENABLE_DATA 1
#define PUTPACKEDIMAGE_ENABLE_SPLIT 1
#define PUTPACKEDIMAGE_ENABLE_COMPRESS 0
//
......
......@@ -39,12 +39,9 @@ QueryFontReplyStore::QueryFontReplyStore(StaticCompressor *compressor)
enableCache = QUERYFONTREPLY_ENABLE_CACHE;
enableData = QUERYFONTREPLY_ENABLE_DATA;
enableSplit = QUERYFONTREPLY_ENABLE_SPLIT;
enableCompress = QUERYFONTREPLY_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1)
{
enableCompress = QUERYFONTREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
}
// Since ProtoStep7 (#issue 108)
enableCompress = QUERYFONTREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
dataLimit = QUERYFONTREPLY_DATA_LIMIT;
dataOffset = QUERYFONTREPLY_DATA_OFFSET;
......
......@@ -36,7 +36,6 @@
#define QUERYFONTREPLY_ENABLE_CACHE 1
#define QUERYFONTREPLY_ENABLE_DATA 1
#define QUERYFONTREPLY_ENABLE_SPLIT 0
#define QUERYFONTREPLY_ENABLE_COMPRESS 1
#define QUERYFONTREPLY_DATA_LIMIT 1048576 - 32
#define QUERYFONTREPLY_DATA_OFFSET 8
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef RenderCompositeCompat_H
#define RenderCompositeCompat_H
//
// Define the characteristics
// of this message class here.
//
#undef MESSAGE_NAME
#define MESSAGE_NAME "RenderCompositeCompat"
#undef MESSAGE_STORE
#define MESSAGE_STORE RenderCompositeCompatStore
#undef MESSAGE_CLASS
#define MESSAGE_CLASS RenderMinorExtensionStore
#undef MESSAGE_METHODS
#define MESSAGE_METHODS "RenderMinorExtensionMethods.h"
#undef MESSAGE_HEADERS
#define MESSAGE_HEADERS "RenderMinorExtensionHeaders.h"
#undef MESSAGE_TAGS
#define MESSAGE_TAGS "RenderMinorExtensionTags.h"
#undef MESSAGE_OFFSET
#define MESSAGE_OFFSET 24
#undef MESSAGE_HAS_SIZE
#define MESSAGE_HAS_SIZE 1
#undef MESSAGE_HAS_DATA
#define MESSAGE_HAS_DATA 1
#undef MESSAGE_HAS_FILTER
#define MESSAGE_HAS_FILTER 0
//
// Declare the message class.
//
#include MESSAGE_HEADERS
class MESSAGE_STORE : public MESSAGE_CLASS
{
public:
virtual const char *name() const
{
return MESSAGE_NAME;
}
virtual int identitySize(const unsigned char *buffer,
unsigned int size)
{
return MESSAGE_OFFSET;
}
#include MESSAGE_METHODS
};
#endif /* RenderCompositeCompat_H */
......@@ -102,26 +102,14 @@ MESSAGE_BEGIN_ENCODE_MESSAGE
unsigned int src_x = GetUINT(buffer + 24, bigEndian);
unsigned int src_y = GetUINT(buffer + 26, bigEndian);
if (control -> isProtoStep8() == 1)
{
encodeBuffer.encodeDiffCachedValue(src_x,
clientCache -> renderGlyphX, 16,
clientCache -> renderGlyphXCache, 11);
encodeBuffer.encodeDiffCachedValue(src_y,
clientCache -> renderGlyphY, 16,
clientCache -> renderGlyphYCache, 11);
}
else
{
encodeBuffer.encodeDiffCachedValue(src_x,
clientCache -> renderLastX, 16,
clientCache -> renderXCache, 11);
// Since ProtoStep8 (#issue 108)
encodeBuffer.encodeDiffCachedValue(src_x,
clientCache -> renderGlyphX, 16,
clientCache -> renderGlyphXCache, 11);
encodeBuffer.encodeDiffCachedValue(src_y,
clientCache -> renderLastY, 16,
clientCache -> renderYCache, 11);
}
encodeBuffer.encodeDiffCachedValue(src_y,
clientCache -> renderGlyphY, 16,
clientCache -> renderGlyphYCache, 11);
#ifdef TEST
*logofs << name() << ": Encoded source X "
......@@ -147,8 +135,8 @@ MESSAGE_BEGIN_ENCODE_MESSAGE
// tive to the first offset coordinates.
//
if (control -> isProtoStep8() == 1 &&
size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
// Since ProtoStep8 (#issue 108)
if (size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{
unsigned int numGlyphs = *(buffer + 28);
......@@ -232,32 +220,20 @@ MESSAGE_BEGIN_DECODE_MESSAGE
unsigned int src_x;
unsigned int src_y;
if (control -> isProtoStep8() == 1)
{
decodeBuffer.decodeDiffCachedValue(src_x,
clientCache -> renderGlyphX, 16,
clientCache -> renderGlyphXCache, 11);
decodeBuffer.decodeDiffCachedValue(src_y,
clientCache -> renderGlyphY, 16,
clientCache -> renderGlyphYCache, 11);
}
else
{
decodeBuffer.decodeDiffCachedValue(src_x,
clientCache -> renderLastX, 16,
clientCache -> renderXCache, 11);
// Since ProtoStep8 (#issue 108)
decodeBuffer.decodeDiffCachedValue(src_x,
clientCache -> renderGlyphX, 16,
clientCache -> renderGlyphXCache, 11);
decodeBuffer.decodeDiffCachedValue(src_y,
clientCache -> renderLastY, 16,
clientCache -> renderYCache, 11);
}
decodeBuffer.decodeDiffCachedValue(src_y,
clientCache -> renderGlyphY, 16,
clientCache -> renderGlyphYCache, 11);
PutUINT(src_x, buffer + 24, bigEndian);
PutUINT(src_y, buffer + 26, bigEndian);
if (control -> isProtoStep8() == 1 &&
size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
// Since ProtoStep8 (#issue 108)
if (size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{
decodeBuffer.decodeCachedValue(value, 8,
clientCache -> renderNumGlyphsCache);
......@@ -297,8 +273,8 @@ MESSAGE_END_DECODE_MESSAGE
MESSAGE_BEGIN_ENCODE_DATA
{
if (control -> isProtoStep8() == 1 &&
size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
// Since ProtoStep8 (#issue 108)
if (size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{
encodeCharData(encodeBuffer, buffer, MESSAGE_OFFSET_IF_PROTO_STEP_8,
size, bigEndian, channelCache);
......@@ -318,8 +294,8 @@ MESSAGE_END_ENCODE_DATA
MESSAGE_BEGIN_DECODE_DATA
{
if (control -> isProtoStep8() == 1 &&
size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
// Since ProtoStep8 (#issue 108)
if (size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{
decodeCharData(decodeBuffer, buffer, MESSAGE_OFFSET_IF_PROTO_STEP_8,
size, bigEndian, channelCache);
......@@ -353,8 +329,8 @@ MESSAGE_BEGIN_PARSE_IDENTITY
renderExtension -> data.composite_glyphs.src_x = GetUINT(buffer + 24, bigEndian);
renderExtension -> data.composite_glyphs.src_y = GetUINT(buffer + 26, bigEndian);
if (control -> isProtoStep8() == 1 &&
size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
// Since ProtoStep8 (#issue 108)
if (size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{
renderExtension -> data.composite_glyphs.num_elm = *(buffer + 28);
......@@ -387,8 +363,8 @@ MESSAGE_BEGIN_UNPARSE_IDENTITY
PutUINT(renderExtension -> data.composite_glyphs.src_x, buffer + 24, bigEndian);
PutUINT(renderExtension -> data.composite_glyphs.src_y, buffer + 26, bigEndian);
if (control -> isProtoStep8() == 1 &&
size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
// Since ProtoStep8 (#issue 108)
if (size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{
*(buffer + 28) = renderExtension -> data.composite_glyphs.num_elm;
......@@ -426,8 +402,8 @@ MESSAGE_BEGIN_IDENTITY_CHECKSUM
// first string.
//
if (control -> isProtoStep8() == 1 &&
size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
// Since ProtoStep8 (#issue 108)
if (size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{
md5_append(md5_state, buffer + 28, 1);
}
......@@ -470,42 +446,22 @@ MESSAGE_BEGIN_ENCODE_UPDATE
unsigned int value;
unsigned int previous;
if (control -> isProtoStep8() == 1)
{
value = renderExtension -> data.composite_glyphs.src_x;
previous = cachedRenderExtension -> data.composite_glyphs.src_x;
encodeBuffer.encodeDiffCachedValue(value, previous, 16,
clientCache -> renderGlyphXCache, 11);
// Since ProtoStep8 (#issue 108)
value = renderExtension -> data.composite_glyphs.src_x;
previous = cachedRenderExtension -> data.composite_glyphs.src_x;
cachedRenderExtension -> data.composite_glyphs.src_x = value;
encodeBuffer.encodeDiffCachedValue(value, previous, 16,
clientCache -> renderGlyphXCache, 11);
value = renderExtension -> data.composite_glyphs.src_y;
previous = cachedRenderExtension -> data.composite_glyphs.src_y;
cachedRenderExtension -> data.composite_glyphs.src_x = value;
encodeBuffer.encodeDiffCachedValue(value, previous, 16,
clientCache -> renderGlyphYCache, 11);
value = renderExtension -> data.composite_glyphs.src_y;
previous = cachedRenderExtension -> data.composite_glyphs.src_y;
cachedRenderExtension -> data.composite_glyphs.src_y = value;
}
else
{
value = renderExtension -> data.composite_glyphs.src_x;
previous = cachedRenderExtension -> data.composite_glyphs.src_x;
encodeBuffer.encodeDiffCachedValue(value, previous, 16,
clientCache -> renderXCache, 11);
cachedRenderExtension -> data.composite_glyphs.src_x = value;
encodeBuffer.encodeDiffCachedValue(value, previous, 16,
clientCache -> renderGlyphYCache, 11);
value = renderExtension -> data.composite_glyphs.src_y;
previous = cachedRenderExtension -> data.composite_glyphs.src_y;
encodeBuffer.encodeDiffCachedValue(value, previous, 16,
clientCache -> renderYCache, 11);
cachedRenderExtension -> data.composite_glyphs.src_y = value;
}
cachedRenderExtension -> data.composite_glyphs.src_y = value;
#ifdef TEST
*logofs << name() << ": Encoded source X "
......@@ -514,8 +470,8 @@ MESSAGE_BEGIN_ENCODE_UPDATE
<< logofs_flush;
#endif
if (control -> isProtoStep8() == 1 &&
renderExtension -> size_ >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
// Since ProtoStep8 (#issue 108)
if (renderExtension -> size_ >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{
//
// Offset X and Y.
......@@ -601,41 +557,23 @@ MESSAGE_BEGIN_DECODE_UPDATE
unsigned int value;
unsigned int previous;
if (control -> isProtoStep8() == 1)
{
previous = renderExtension -> data.composite_glyphs.src_x;
decodeBuffer.decodeDiffCachedValue(value, previous, 16,
clientCache -> renderGlyphXCache, 11);
renderExtension -> data.composite_glyphs.src_x = value;
previous = renderExtension -> data.composite_glyphs.src_y;
decodeBuffer.decodeDiffCachedValue(value, previous, 16,
clientCache -> renderGlyphYCache, 11);
// Since ProtoStep8 (#issue 108)
previous = renderExtension -> data.composite_glyphs.src_x;
renderExtension -> data.composite_glyphs.src_y = value;
}
else
{
previous = renderExtension -> data.composite_glyphs.src_x;
decodeBuffer.decodeDiffCachedValue(value, previous, 16,
clientCache -> renderGlyphXCache, 11);
decodeBuffer.decodeDiffCachedValue(value, previous, 16,
clientCache -> renderXCache, 11);
renderExtension -> data.composite_glyphs.src_x = value;
renderExtension -> data.composite_glyphs.src_x = value;
previous = renderExtension -> data.composite_glyphs.src_y;
previous = renderExtension -> data.composite_glyphs.src_y;
decodeBuffer.decodeDiffCachedValue(value, previous, 16,
clientCache -> renderGlyphYCache, 11);
decodeBuffer.decodeDiffCachedValue(value, previous, 16,
clientCache -> renderYCache, 11);
renderExtension -> data.composite_glyphs.src_y = value;
}
renderExtension -> data.composite_glyphs.src_y = value;
if (control -> isProtoStep8() == 1 &&
renderExtension -> size_ >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
// Since ProtoStep8 (#issue 108)
if (renderExtension -> size_ >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{
//
// Offset X and Y.
......
......@@ -80,9 +80,8 @@ class MESSAGE_STORE : public MESSAGE_CLASS
virtual int identitySize(const unsigned char *buffer,
unsigned int size)
{
unsigned int offset = (control -> isProtoStep8() == 1 ?
MESSAGE_OFFSET_IF_PROTO_STEP_8 :
MESSAGE_OFFSET);
// Since ProtoStep8 (#issue 108)
unsigned int offset = MESSAGE_OFFSET_IF_PROTO_STEP_8;
return (size >= offset ? offset : size);
}
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef RenderCompositeGlyphsCompat_H
#define RenderCompositeGlyphsCompat_H
//
// Define the characteristics
// of this message class here.
//
#undef MESSAGE_NAME
#define MESSAGE_NAME "RenderCompositeGlyphsCompat"
#undef MESSAGE_STORE
#define MESSAGE_STORE RenderCompositeGlyphsCompatStore
#undef MESSAGE_CLASS
#define MESSAGE_CLASS RenderMinorExtensionStore
#undef MESSAGE_METHODS
#define MESSAGE_METHODS "RenderMinorExtensionMethods.h"
#undef MESSAGE_HEADERS
#define MESSAGE_HEADERS "RenderMinorExtensionHeaders.h"
#undef MESSAGE_TAGS
#define MESSAGE_TAGS "RenderMinorExtensionTags.h"
#undef MESSAGE_OFFSET
#define MESSAGE_OFFSET 36
#undef MESSAGE_HAS_SIZE
#define MESSAGE_HAS_SIZE 1
#undef MESSAGE_HAS_DATA
#define MESSAGE_HAS_DATA 1
#undef MESSAGE_HAS_FILTER
#define MESSAGE_HAS_FILTER 0
//
// Declare the message class.
//
#include MESSAGE_HEADERS
class MESSAGE_STORE : public MESSAGE_CLASS
{
public:
virtual const char *name() const
{
return MESSAGE_NAME;
}
virtual int identitySize(const unsigned char *buffer,
unsigned int size)
{
return (size >= MESSAGE_OFFSET ? MESSAGE_OFFSET : size);
}
#include MESSAGE_METHODS
};
#endif /* RenderCompositeGlyphsCompat_H */
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
//
// Include the template for
// this message class.
//
#include "RenderCreateGlyphSetCompat.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#include MESSAGE_TAGS
//
// Message handling methods.
//
MESSAGE_BEGIN_ENCODE_SIZE
{
//
// Strictly speaking this request doesn't have
// a data part. We encode the fields past the
// offset as they were data. An improvement
// would be to encode the format field using
// the cache.
//
#ifdef TEST
*logofs << name() << ": Encoded size with value "
<< size << ".\n" << logofs_flush;
#endif
}
MESSAGE_END_ENCODE_SIZE
MESSAGE_BEGIN_DECODE_SIZE
{
size = MESSAGE_OFFSET + 4;
buffer = writeBuffer -> addMessage(size);
#ifdef TEST
*logofs << name() << ": Decoded size with value "
<< size << ".\n" << logofs_flush;
#endif
}
MESSAGE_END_DECODE_SIZE
MESSAGE_BEGIN_ENCODE_MESSAGE
{
ClientCache *clientCache = (ClientCache *) channelCache;
encodeBuffer.encodeDiffCachedValue(GetULONG(buffer + 4, bigEndian),
clientCache -> renderLastId, 29,
clientCache -> renderIdCache);
#ifdef TEST
*logofs << name() << ": Encoded message. Type is "
<< (unsigned int) *(buffer + 1) << " size is "
<< size << ".\n" << logofs_flush;
#endif
}
MESSAGE_END_ENCODE_MESSAGE
MESSAGE_BEGIN_DECODE_MESSAGE
{
ClientCache *clientCache = (ClientCache *) channelCache;
unsigned int value;
*(buffer + 1) = type;
decodeBuffer.decodeDiffCachedValue(value,
clientCache -> renderLastId, 29,
clientCache -> renderIdCache);
PutULONG(value, buffer + 4, bigEndian);
#ifdef TEST
*logofs << name() << ": Decoded message. Type is "
<< (unsigned int) type << " size is " << size
<< ".\n" << logofs_flush;
#endif
}
MESSAGE_END_DECODE_MESSAGE
MESSAGE_BEGIN_ENCODE_DATA
{
#ifdef DEBUG
*logofs << name() << ": Glyphset is " << GetULONG(buffer + 4, bigEndian)
<< ".\n" << logofs_flush;
if (size > MESSAGE_OFFSET)
{
*logofs << name() << ": Format is " << GetULONG(buffer + 8, bigEndian)
<< ".\n" << logofs_flush;
}
if (size > MESSAGE_OFFSET + 4)
{
*logofs << name() << ": WARNING! Unexpected size " << size
<< ".\n" << logofs_flush;
}
#endif
encodeLongData(encodeBuffer, buffer, MESSAGE_OFFSET,
size, bigEndian, channelCache);
#ifdef TEST
*logofs << name() << ": Encoded " << size - MESSAGE_OFFSET
<< " bytes of data.\n" << logofs_flush;
#endif
}
MESSAGE_END_ENCODE_DATA
MESSAGE_BEGIN_DECODE_DATA
{
decodeLongData(decodeBuffer, buffer, MESSAGE_OFFSET,
size, bigEndian, channelCache);
#ifdef TEST
*logofs << name() << ": Decoded " << size - MESSAGE_OFFSET
<< " bytes of data.\n" << logofs_flush;
#endif
}
MESSAGE_END_DECODE_DATA
MESSAGE_BEGIN_PARSE_IDENTITY
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
renderExtension -> data.create_set.type = *(buffer + 1);
renderExtension -> data.create_set.set_id = GetULONG(buffer + 4, bigEndian);
#ifdef TEST
*logofs << name() << ": Parsed identity. Type is "
<< (unsigned int) renderExtension -> data.create_set.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_PARSE_IDENTITY
MESSAGE_BEGIN_UNPARSE_IDENTITY
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
*(buffer + 1) = renderExtension -> data.create_set.type;
PutULONG(renderExtension -> data.create_set.set_id, buffer + 4, bigEndian);
#ifdef TEST
*logofs << name() << ": Unparsed identity. Type is "
<< (unsigned int) renderExtension -> data.create_set.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_UNPARSE_IDENTITY
MESSAGE_BEGIN_IDENTITY_CHECKSUM
{
md5_append(md5_state, buffer + 1, 3);
}
MESSAGE_END_IDENTITY_CHECKSUM
MESSAGE_BEGIN_ENCODE_UPDATE
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
RenderExtensionMessage *cachedRenderExtension = (RenderExtensionMessage *) cachedMessage;
ClientCache *clientCache = (ClientCache *) channelCache;
encodeBuffer.encodeDiffCachedValue(renderExtension -> data.create_set.set_id,
clientCache -> renderLastId, 29,
clientCache -> renderIdCache);
cachedRenderExtension -> data.create_set.set_id =
renderExtension -> data.create_set.set_id;
#ifdef TEST
*logofs << name() << ": Encoded update. Type is "
<< (unsigned int) renderExtension -> data.create_set.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_ENCODE_UPDATE
MESSAGE_BEGIN_DECODE_UPDATE
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
ClientCache *clientCache = (ClientCache *) channelCache;
decodeBuffer.decodeDiffCachedValue(renderExtension -> data.create_set.set_id,
clientCache -> renderLastId, 29,
clientCache -> renderIdCache);
#ifdef TEST
*logofs << name() << ": Decoded update. Type is "
<< (unsigned int) renderExtension -> data.create_set.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_DECODE_UPDATE
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef RenderCreateGlyphSetCompat_H
#define RenderCreateGlyphSetCompat_H
//
// Define the characteristics
// of this message class here.
//
#undef MESSAGE_NAME
#define MESSAGE_NAME "RenderCreateGlyphSetCompat"
#undef MESSAGE_STORE
#define MESSAGE_STORE RenderCreateGlyphSetCompatStore
#undef MESSAGE_CLASS
#define MESSAGE_CLASS RenderMinorExtensionStore
#undef MESSAGE_METHODS
#define MESSAGE_METHODS "RenderMinorExtensionMethods.h"
#undef MESSAGE_HEADERS
#define MESSAGE_HEADERS "RenderMinorExtensionHeaders.h"
#undef MESSAGE_TAGS
#define MESSAGE_TAGS "RenderMinorExtensionTags.h"
#undef MESSAGE_OFFSET
#define MESSAGE_OFFSET 8
#undef MESSAGE_HAS_SIZE
#define MESSAGE_HAS_SIZE 1
#undef MESSAGE_HAS_DATA
#define MESSAGE_HAS_DATA 1
#undef MESSAGE_HAS_FILTER
#define MESSAGE_HAS_FILTER 0
//
// Declare the message class.
//
#include MESSAGE_HEADERS
class MESSAGE_STORE : public MESSAGE_CLASS
{
public:
virtual const char *name() const
{
return MESSAGE_NAME;
}
virtual int identitySize(const unsigned char *buffer,
unsigned int size)
{
return MESSAGE_OFFSET;
}
#include MESSAGE_METHODS
};
#endif /* RenderCreateGlyphSetCompat_H */
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
//
// Include the template for
// this message class.
//
#include "RenderCreatePictureCompat.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#include MESSAGE_TAGS
//
// Message handling methods.
//
MESSAGE_BEGIN_ENCODE_SIZE
{
ClientCache *clientCache = (ClientCache *) channelCache;
encodeBuffer.encodeCachedValue((size - MESSAGE_OFFSET) >> 2, 16,
clientCache -> renderLengthCache, 5);
#ifdef TEST
*logofs << name() << ": Encoded size with value "
<< size << ".\n" << logofs_flush;
#endif
}
MESSAGE_END_ENCODE_SIZE
MESSAGE_BEGIN_DECODE_SIZE
{
ClientCache *clientCache = (ClientCache *) channelCache;
decodeBuffer.decodeCachedValue(size, 16,
clientCache -> renderLengthCache, 5);
size = MESSAGE_OFFSET + (size << 2);
buffer = writeBuffer -> addMessage(size);
#ifdef TEST
*logofs << name() << ": Decoded size with value "
<< size << ".\n" << logofs_flush;
#endif
}
MESSAGE_END_DECODE_SIZE
MESSAGE_BEGIN_ENCODE_MESSAGE
{
ClientCache *clientCache = (ClientCache *) channelCache;
encodeBuffer.encodeDiffCachedValue(GetULONG(buffer + 4, bigEndian),
clientCache -> renderLastId, 29,
clientCache -> renderIdCache);
encodeBuffer.encodeXidValue(GetULONG(buffer + 8, bigEndian),
clientCache -> drawableCache);
encodeBuffer.encodeCachedValue(GetULONG(buffer + 12, bigEndian), 32,
clientCache -> renderFormatCache);
encodeBuffer.encodeCachedValue(GetULONG(buffer + 16, bigEndian), 32,
clientCache -> renderValueMaskCache);
#ifdef TEST
*logofs << name() << ": Encoded message. Type is "
<< (unsigned int) *(buffer + 1) << " size is "
<< size << ".\n" << logofs_flush;
#endif
}
MESSAGE_END_ENCODE_MESSAGE
MESSAGE_BEGIN_DECODE_MESSAGE
{
ClientCache *clientCache = (ClientCache *) channelCache;
unsigned int value;
*(buffer + 1) = type;
decodeBuffer.decodeDiffCachedValue(value,
clientCache -> renderLastId, 29,
clientCache -> renderIdCache);
PutULONG(value, buffer + 4, bigEndian);
decodeBuffer.decodeXidValue(value,
clientCache -> drawableCache);
PutULONG(value, buffer + 8, bigEndian);
decodeBuffer.decodeCachedValue(value, 32,
clientCache -> renderFormatCache);
PutULONG(value, buffer + 12, bigEndian);
decodeBuffer.decodeCachedValue(value, 32,
clientCache -> renderValueMaskCache);
PutULONG(value, buffer + 16, bigEndian);
#ifdef TEST
*logofs << name() << ": Decoded message. Type is "
<< (unsigned int) type << " size is " << size
<< ".\n" << logofs_flush;
#endif
}
MESSAGE_END_DECODE_MESSAGE
MESSAGE_BEGIN_ENCODE_DATA
{
encodeLongData(encodeBuffer, buffer, MESSAGE_OFFSET,
size, bigEndian, channelCache);
#ifdef TEST
*logofs << name() << ": Encoded " << size - MESSAGE_OFFSET
<< " bytes of data.\n" << logofs_flush;
#endif
}
MESSAGE_END_ENCODE_DATA
MESSAGE_BEGIN_DECODE_DATA
{
decodeLongData(decodeBuffer, buffer, MESSAGE_OFFSET,
size, bigEndian, channelCache);
#ifdef TEST
*logofs << name() << ": Decoded " << size - MESSAGE_OFFSET
<< " bytes of data.\n" << logofs_flush;
#endif
}
MESSAGE_END_DECODE_DATA
MESSAGE_BEGIN_PARSE_IDENTITY
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
renderExtension -> data.create_picture.type = *(buffer + 1);
renderExtension -> data.create_picture.src_id = GetULONG(buffer + 4, bigEndian);
renderExtension -> data.create_picture.dst_id = GetULONG(buffer + 8, bigEndian);
renderExtension -> data.create_picture.format = GetULONG(buffer + 12, bigEndian);
renderExtension -> data.create_picture.mask = GetULONG(buffer + 16, bigEndian);
#ifdef TEST
*logofs << name() << ": Parsed identity. Type is "
<< (unsigned int) renderExtension -> data.create_picture.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_PARSE_IDENTITY
MESSAGE_BEGIN_UNPARSE_IDENTITY
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
*(buffer + 1) = renderExtension -> data.create_picture.type;
PutULONG(renderExtension -> data.create_picture.src_id, buffer + 4, bigEndian);
PutULONG(renderExtension -> data.create_picture.dst_id, buffer + 8, bigEndian);
PutULONG(renderExtension -> data.create_picture.format, buffer + 12, bigEndian);
PutULONG(renderExtension -> data.create_picture.mask, buffer + 16, bigEndian);
#ifdef TEST
*logofs << name() << ": Unparsed identity. Type is "
<< (unsigned int) renderExtension -> data.create_picture.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_UNPARSE_IDENTITY
MESSAGE_BEGIN_IDENTITY_CHECKSUM
{
md5_append(md5_state, buffer + 1, 3);
md5_append(md5_state, buffer + 12, 8);
}
MESSAGE_END_IDENTITY_CHECKSUM
MESSAGE_BEGIN_ENCODE_UPDATE
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
RenderExtensionMessage *cachedRenderExtension = (RenderExtensionMessage *) cachedMessage;
ClientCache *clientCache = (ClientCache *) channelCache;
#ifdef DEBUG
*logofs << name() << ": Encoding new id value "
<< renderExtension -> data.create_picture.src_id -
clientCache -> renderLastId << ".\n";
#endif
encodeBuffer.encodeDiffCachedValue(renderExtension -> data.create_picture.src_id,
clientCache -> renderLastId, 29,
clientCache -> renderIdCache);
cachedRenderExtension -> data.create_picture.src_id =
renderExtension -> data.create_picture.src_id;
encodeBuffer.encodeXidValue(renderExtension -> data.create_picture.dst_id,
clientCache -> drawableCache);
cachedRenderExtension -> data.create_picture.dst_id =
renderExtension -> data.create_picture.dst_id;
#ifdef TEST
*logofs << name() << ": Encoded update. Type is "
<< (unsigned int) renderExtension -> data.create_picture.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_ENCODE_UPDATE
MESSAGE_BEGIN_DECODE_UPDATE
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
ClientCache *clientCache = (ClientCache *) channelCache;
decodeBuffer.decodeDiffCachedValue(renderExtension -> data.create_picture.src_id,
clientCache -> renderLastId, 29,
clientCache -> renderIdCache);
decodeBuffer.decodeXidValue(renderExtension -> data.create_picture.dst_id,
clientCache -> drawableCache);
#ifdef TEST
*logofs << name() << ": Decoded update. Type is "
<< (unsigned int) renderExtension -> data.create_picture.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_DECODE_UPDATE
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef RenderCreatePictureCompat_H
#define RenderCreatePictureCompat_H
//
// Define the characteristics
// of this message class here.
//
#undef MESSAGE_NAME
#define MESSAGE_NAME "RenderCreatePictureCompat"
#undef MESSAGE_STORE
#define MESSAGE_STORE RenderCreatePictureCompatStore
#undef MESSAGE_CLASS
#define MESSAGE_CLASS RenderMinorExtensionStore
#undef MESSAGE_METHODS
#define MESSAGE_METHODS "RenderMinorExtensionMethods.h"
#undef MESSAGE_HEADERS
#define MESSAGE_HEADERS "RenderMinorExtensionHeaders.h"
#undef MESSAGE_TAGS
#define MESSAGE_TAGS "RenderMinorExtensionTags.h"
#undef MESSAGE_OFFSET
#define MESSAGE_OFFSET 20
#undef MESSAGE_HAS_SIZE
#define MESSAGE_HAS_SIZE 1
#undef MESSAGE_HAS_DATA
#define MESSAGE_HAS_DATA 1
#undef MESSAGE_HAS_FILTER
#define MESSAGE_HAS_FILTER 0
//
// Declare the message class.
//
#include MESSAGE_HEADERS
class MESSAGE_STORE : public MESSAGE_CLASS
{
public:
virtual const char *name() const
{
return MESSAGE_NAME;
}
virtual int identitySize(const unsigned char *buffer,
unsigned int size)
{
return MESSAGE_OFFSET;
}
#include MESSAGE_METHODS
};
#endif /* RenderCreatePictureCompat_H */
......@@ -44,7 +44,6 @@
#define RENDEREXTENSION_DATA_LIMIT 6144
#define RENDEREXTENSION_DATA_OFFSET 36
#define RENDEREXTENSION_CACHE_SLOTS 6000
#define RENDEREXTENSION_CACHE_THRESHOLD 20
#define RENDEREXTENSION_CACHE_LOWER_THRESHOLD 10
......@@ -83,13 +82,6 @@ class RenderExtensionMessage : public Message
friend class RenderTrapezoidsStore;
friend class RenderTrianglesStore;
friend class RenderCreatePictureCompatStore;
friend class RenderFreePictureCompatStore;
friend class RenderPictureClipCompatStore;
friend class RenderCreateGlyphSetCompatStore;
friend class RenderCompositeCompatStore;
friend class RenderCompositeGlyphsCompatStore;
public:
RenderExtensionMessage()
......
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
//
// Include the template for
// this message class.
//
#include "RenderFreePictureCompat.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#include MESSAGE_TAGS
//
// Message handling methods.
//
MESSAGE_BEGIN_ENCODE_MESSAGE
{
ClientCache *clientCache = (ClientCache *) channelCache;
encodeBuffer.encodeDiffCachedValue(GetULONG(buffer + 4, bigEndian),
clientCache -> renderLastId, 29,
clientCache -> renderIdCache);
#ifdef TEST
*logofs << name() << ": Encoded message. Type is "
<< (unsigned int) *(buffer + 1) << " size is "
<< size << ".\n" << logofs_flush;
#endif
}
MESSAGE_END_ENCODE_MESSAGE
MESSAGE_BEGIN_DECODE_MESSAGE
{
unsigned int value;
ClientCache *clientCache = (ClientCache *) channelCache;
*(buffer + 1) = type;
decodeBuffer.decodeDiffCachedValue(value,
clientCache -> renderLastId, 29,
clientCache -> renderIdCache);
PutULONG(value, buffer + 4, bigEndian);
#ifdef TEST
*logofs << name() << ": Decoded message. Type is "
<< (unsigned int) type << " size is " << size
<< ".\n" << logofs_flush;
#endif
}
MESSAGE_END_DECODE_MESSAGE
MESSAGE_BEGIN_PARSE_IDENTITY
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
renderExtension -> data.free_picture.type = *(buffer + 1);
renderExtension -> data.free_picture.src_id = GetULONG(buffer + 4, bigEndian);
#ifdef TEST
*logofs << name() << ": Parsed identity. Type is "
<< (unsigned int) renderExtension -> data.free_picture.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_PARSE_IDENTITY
MESSAGE_BEGIN_UNPARSE_IDENTITY
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
*(buffer + 1) = renderExtension -> data.free_picture.type;
PutULONG(renderExtension -> data.free_picture.src_id, buffer + 4, bigEndian);
#ifdef TEST
*logofs << name() << ": Unparsed identity. Type is "
<< (unsigned int) renderExtension -> data.free_picture.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_UNPARSE_IDENTITY
MESSAGE_BEGIN_IDENTITY_CHECKSUM
{
md5_append(md5_state, buffer + 1, 3);
}
MESSAGE_END_IDENTITY_CHECKSUM
MESSAGE_BEGIN_ENCODE_UPDATE
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
RenderExtensionMessage *cachedRenderExtension = (RenderExtensionMessage *) cachedMessage;
ClientCache *clientCache = (ClientCache *) channelCache;
encodeBuffer.encodeDiffCachedValue(renderExtension -> data.free_picture.src_id,
clientCache -> renderLastId, 29,
clientCache -> renderIdCache);
cachedRenderExtension -> data.free_picture.src_id =
renderExtension -> data.free_picture.src_id;
#ifdef TEST
*logofs << name() << ": Encoded update. Type is "
<< (unsigned int) renderExtension -> data.free_picture.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_ENCODE_UPDATE
MESSAGE_BEGIN_DECODE_UPDATE
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
ClientCache *clientCache = (ClientCache *) channelCache;
decodeBuffer.decodeDiffCachedValue(renderExtension -> data.free_picture.src_id,
clientCache -> renderLastId, 29,
clientCache -> renderIdCache);
#ifdef TEST
*logofs << name() << ": Decoded update. Type is "
<< (unsigned int) renderExtension -> data.free_picture.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_DECODE_UPDATE
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef RenderFreePictureCompat_H
#define RenderFreePictureCompat_H
//
// Define the characteristics
// of this message class here.
//
#undef MESSAGE_NAME
#define MESSAGE_NAME "RenderFreePictureCompat"
#undef MESSAGE_STORE
#define MESSAGE_STORE RenderFreePictureCompatStore
#undef MESSAGE_CLASS
#define MESSAGE_CLASS RenderMinorExtensionStore
#undef MESSAGE_METHODS
#define MESSAGE_METHODS "RenderMinorExtensionMethods.h"
#undef MESSAGE_HEADERS
#define MESSAGE_HEADERS "RenderMinorExtensionHeaders.h"
#undef MESSAGE_TAGS
#define MESSAGE_TAGS "RenderMinorExtensionTags.h"
#undef MESSAGE_OFFSET
#define MESSAGE_OFFSET 8
#undef MESSAGE_HAS_SIZE
#define MESSAGE_HAS_SIZE 0
#undef MESSAGE_HAS_DATA
#define MESSAGE_HAS_DATA 0
#undef MESSAGE_HAS_FILTER
#define MESSAGE_HAS_FILTER 0
//
// Declare the message class.
//
#include MESSAGE_HEADERS
class MESSAGE_STORE : public MESSAGE_CLASS
{
public:
virtual const char *name() const
{
return MESSAGE_NAME;
}
virtual int identitySize(const unsigned char *buffer,
unsigned int size)
{
return MESSAGE_OFFSET;
}
#include MESSAGE_METHODS
};
#endif /* RenderFreePictureCompat_H */
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
//
// Include the template for
// this message class.
//
#include "RenderPictureClipCompat.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#include MESSAGE_TAGS
//
// Message handling methods.
//
MESSAGE_BEGIN_ENCODE_SIZE
{
ClientCache *clientCache = (ClientCache *) channelCache;
encodeBuffer.encodeCachedValue((size - MESSAGE_OFFSET) >> 2, 16,
clientCache -> renderLengthCache, 5);
#ifdef TEST
*logofs << name() << ": Encoded size with value "
<< size << ".\n" << logofs_flush;
#endif
}
MESSAGE_END_ENCODE_SIZE
MESSAGE_BEGIN_DECODE_SIZE
{
ClientCache *clientCache = (ClientCache *) channelCache;
decodeBuffer.decodeCachedValue(size, 16,
clientCache -> renderLengthCache, 5);
size = MESSAGE_OFFSET + (size << 2);
buffer = writeBuffer -> addMessage(size);
#ifdef TEST
*logofs << name() << ": Decoded size with value "
<< size << ".\n" << logofs_flush;
#endif
}
MESSAGE_END_DECODE_SIZE
MESSAGE_BEGIN_ENCODE_MESSAGE
{
ClientCache *clientCache = (ClientCache *) channelCache;
encodeBuffer.encodeXidValue(GetULONG(buffer + 4, bigEndian),
clientCache -> renderSrcPictureCache);
encodeBuffer.encodeDiffCachedValue(GetUINT(buffer + 8, bigEndian),
clientCache -> renderLastX, 16,
clientCache -> renderXCache, 11);
encodeBuffer.encodeDiffCachedValue(GetUINT(buffer + 10, bigEndian),
clientCache -> renderLastY, 16,
clientCache -> renderYCache, 11);
#ifdef TEST
*logofs << name() << ": Encoded message. Type is "
<< (unsigned int) *(buffer + 1) << " size is "
<< size << ".\n" << logofs_flush;
#endif
}
MESSAGE_END_ENCODE_MESSAGE
MESSAGE_BEGIN_DECODE_MESSAGE
{
ClientCache *clientCache = (ClientCache *) channelCache;
unsigned int value;
*(buffer + 1) = type;
decodeBuffer.decodeXidValue(value,
clientCache -> renderSrcPictureCache);
PutULONG(value, buffer + 4, bigEndian);
decodeBuffer.decodeDiffCachedValue(value,
clientCache -> renderLastX, 16,
clientCache -> renderXCache, 11);
PutUINT(clientCache -> renderLastX, buffer + 8, bigEndian);
decodeBuffer.decodeDiffCachedValue(value,
clientCache -> renderLastY, 16,
clientCache -> renderYCache, 11);
PutUINT(clientCache -> renderLastY, buffer + 10, bigEndian);
#ifdef TEST
*logofs << name() << ": Decoded message. Type is "
<< (unsigned int) type << " size is " << size
<< ".\n" << logofs_flush;
#endif
}
MESSAGE_END_DECODE_MESSAGE
MESSAGE_BEGIN_ENCODE_DATA
{
encodeIntData(encodeBuffer, buffer, MESSAGE_OFFSET,
size, bigEndian, channelCache);
#ifdef TEST
*logofs << name() << ": Encoded " << size - MESSAGE_OFFSET
<< " bytes of data.\n" << logofs_flush;
#endif
}
MESSAGE_END_ENCODE_DATA
MESSAGE_BEGIN_DECODE_DATA
{
decodeIntData(decodeBuffer, buffer, MESSAGE_OFFSET,
size, bigEndian, channelCache);
#ifdef TEST
*logofs << name() << ": Decoded " << size - MESSAGE_OFFSET
<< " bytes of data.\n" << logofs_flush;
#endif
}
MESSAGE_END_DECODE_DATA
MESSAGE_BEGIN_PARSE_IDENTITY
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
renderExtension -> data.picture_clip.type = *(buffer + 1);
renderExtension -> data.picture_clip.src_id = GetULONG(buffer + 4, bigEndian);
renderExtension -> data.picture_clip.src_x = GetUINT(buffer + 8, bigEndian);
renderExtension -> data.picture_clip.src_y = GetUINT(buffer + 10, bigEndian);
#ifdef TEST
*logofs << name() << ": Parsed identity. Type is "
<< (unsigned int) renderExtension -> data.picture_clip.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_PARSE_IDENTITY
MESSAGE_BEGIN_UNPARSE_IDENTITY
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
*(buffer + 1) = renderExtension -> data.picture_clip.type;
PutULONG(renderExtension -> data.picture_clip.src_id, buffer + 4, bigEndian);
PutUINT(renderExtension -> data.picture_clip.src_x, buffer + 8, bigEndian);
PutUINT(renderExtension -> data.picture_clip.src_y, buffer + 10, bigEndian);
#ifdef TEST
*logofs << name() << ": Unparsed identity. Type is "
<< (unsigned int) renderExtension -> data.picture_clip.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_UNPARSE_IDENTITY
MESSAGE_BEGIN_IDENTITY_CHECKSUM
{
md5_append(md5_state, buffer + 1, 3);
md5_append(md5_state, buffer + 8, 4);
}
MESSAGE_END_IDENTITY_CHECKSUM
MESSAGE_BEGIN_ENCODE_UPDATE
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
RenderExtensionMessage *cachedRenderExtension = (RenderExtensionMessage *) cachedMessage;
ClientCache *clientCache = (ClientCache *) channelCache;
encodeBuffer.encodeXidValue(renderExtension -> data.picture_clip.src_id,
clientCache -> renderSrcPictureCache);
cachedRenderExtension -> data.picture_clip.src_id =
renderExtension -> data.picture_clip.src_id;
#ifdef TEST
*logofs << name() << ": Encoded update. Type is "
<< (unsigned int) renderExtension -> data.picture_clip.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_ENCODE_UPDATE
MESSAGE_BEGIN_DECODE_UPDATE
{
RenderExtensionMessage *renderExtension = (RenderExtensionMessage *) message;
ClientCache *clientCache = (ClientCache *) channelCache;
decodeBuffer.decodeXidValue(renderExtension -> data.picture_clip.src_id,
clientCache -> renderSrcPictureCache);
#ifdef TEST
*logofs << name() << ": Decoded update. Type is "
<< (unsigned int) renderExtension -> data.picture_clip.type
<< " size is " << renderExtension -> size_ << ".\n"
<< logofs_flush;
#endif
}
MESSAGE_END_DECODE_UPDATE
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment