1
/**************************************************************************/
3
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */
5
/* NXCOMP, NX protocol compression and NX extensions to this software */
6
/* are copyright of NoMachine. Redistribution and use of the present */
7
/* software is allowed according to terms specified in the file LICENSE */
8
/* which comes in the source distribution. */
10
/* Check http://www.nomachine.com/licensing.html for applicability. */
12
/* NX and NoMachine are trademarks of NoMachine S.r.l. */
14
/* All rights reserved. */
16
/**************************************************************************/
24
// Set the verbosity level.
34
// Set default values.
37
#define POLYTEXT16_ENABLE_CACHE 1
38
#define POLYTEXT16_ENABLE_DATA 0
39
#define POLYTEXT16_ENABLE_SPLIT 0
40
#define POLYTEXT16_ENABLE_COMPRESS 0
42
#define POLYTEXT16_DATA_LIMIT 420
43
#define POLYTEXT16_DATA_OFFSET 16
45
#define POLYTEXT16_CACHE_SLOTS 3000
46
#define POLYTEXT16_CACHE_THRESHOLD 4
47
#define POLYTEXT16_CACHE_LOWER_THRESHOLD 1
53
class PolyText16Message : public Message
55
friend class PolyText16Store;
68
// Put here the fields which constitute
69
// the 'identity' part of the message.
74
unsigned int drawable;
75
unsigned int gcontext;
81
class PolyText16Store : public MessageStore
84
// Constructors and destructors.
89
PolyText16Store() : MessageStore()
91
enableCache = POLYTEXT16_ENABLE_CACHE;
92
enableData = POLYTEXT16_ENABLE_DATA;
93
enableSplit = POLYTEXT16_ENABLE_SPLIT;
94
enableCompress = POLYTEXT16_ENABLE_COMPRESS;
96
dataLimit = POLYTEXT16_DATA_LIMIT;
97
dataOffset = POLYTEXT16_DATA_OFFSET;
99
cacheSlots = POLYTEXT16_CACHE_SLOTS;
100
cacheThreshold = POLYTEXT16_CACHE_THRESHOLD;
101
cacheLowerThreshold = POLYTEXT16_CACHE_LOWER_THRESHOLD;
103
messages_ -> resize(cacheSlots);
105
for (T_messages::iterator i = messages_ -> begin();
106
i < messages_ -> end(); i++)
114
virtual ~PolyText16Store()
116
for (T_messages::iterator i = messages_ -> begin();
117
i < messages_ -> end(); i++)
125
virtual const char *name() const
130
virtual unsigned char opcode() const
135
virtual unsigned int storage() const
137
return sizeof(PolyText16Message);
141
// Message handling methods.
146
virtual Message *create() const
148
return new PolyText16Message();
151
virtual Message *create(const Message &message) const
153
return new PolyText16Message((const PolyText16Message &) message);
156
virtual void destroy(Message *message) const
158
delete (PolyText16Message *) message;
161
virtual int parseIdentity(Message *message, const unsigned char *buffer,
162
unsigned int size, int bigEndian) const;
164
virtual int unparseIdentity(const Message *message, unsigned char *buffer,
165
unsigned int size, int bigEndian) const;
167
virtual void updateIdentity(EncodeBuffer &encodeBuffer, const Message *message,
168
const Message *cachedMessage,
169
ChannelCache *channelCache) const;
171
virtual void updateIdentity(DecodeBuffer &decodeBuffer, const Message *message,
172
ChannelCache *channelCache) const;
174
virtual void identityChecksum(const Message *message, const unsigned char *buffer,
175
unsigned int size, int bigEndian) const;
177
virtual void dumpIdentity(const Message *message) const;
180
#endif /* PolyText16_H */