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
/**************************************************************************/
18
#ifndef SetClipRectangles_H
19
#define SetClipRectangles_H
24
// Set the verbosity level.
34
// Set default values.
37
#define SETCLIPRECTANGLES_ENABLE_CACHE 1
38
#define SETCLIPRECTANGLES_ENABLE_DATA 0
39
#define SETCLIPRECTANGLES_ENABLE_SPLIT 0
40
#define SETCLIPRECTANGLES_ENABLE_COMPRESS 0
42
#define SETCLIPRECTANGLES_DATA_LIMIT 2048
43
#define SETCLIPRECTANGLES_DATA_OFFSET 12
45
#define SETCLIPRECTANGLES_CACHE_SLOTS 3000
46
#define SETCLIPRECTANGLES_CACHE_THRESHOLD 3
47
#define SETCLIPRECTANGLES_CACHE_LOWER_THRESHOLD 1
53
class SetClipRectanglesMessage : public Message
55
friend class SetClipRectanglesStore;
59
SetClipRectanglesMessage()
63
~SetClipRectanglesMessage()
68
// Put here the fields which constitute
69
// the 'identity' part of the message.
74
unsigned char ordering;
75
unsigned int gcontext;
76
unsigned short x_origin;
77
unsigned short y_origin;
80
class SetClipRectanglesStore : public MessageStore
83
// Constructors and destructors.
88
SetClipRectanglesStore() : MessageStore()
90
enableCache = SETCLIPRECTANGLES_ENABLE_CACHE;
91
enableData = SETCLIPRECTANGLES_ENABLE_DATA;
92
enableSplit = SETCLIPRECTANGLES_ENABLE_SPLIT;
93
enableCompress = SETCLIPRECTANGLES_ENABLE_COMPRESS;
95
dataLimit = SETCLIPRECTANGLES_DATA_LIMIT;
96
dataOffset = SETCLIPRECTANGLES_DATA_OFFSET;
98
cacheSlots = SETCLIPRECTANGLES_CACHE_SLOTS;
99
cacheThreshold = SETCLIPRECTANGLES_CACHE_THRESHOLD;
100
cacheLowerThreshold = SETCLIPRECTANGLES_CACHE_LOWER_THRESHOLD;
102
messages_ -> resize(cacheSlots);
104
for (T_messages::iterator i = messages_ -> begin();
105
i < messages_ -> end(); i++)
113
virtual ~SetClipRectanglesStore()
115
for (T_messages::iterator i = messages_ -> begin();
116
i < messages_ -> end(); i++)
124
virtual const char *name() const
126
return "SetClipRectangles";
129
virtual unsigned char opcode() const
131
return X_SetClipRectangles;
134
virtual unsigned int storage() const
136
return sizeof(SetClipRectanglesMessage);
140
// Message handling methods.
145
virtual Message *create() const
147
return new SetClipRectanglesMessage();
150
virtual Message *create(const Message &message) const
152
return new SetClipRectanglesMessage((const SetClipRectanglesMessage &) message);
155
virtual void destroy(Message *message) const
157
delete (SetClipRectanglesMessage *) message;
160
virtual int parseIdentity(Message *message, const unsigned char *buffer,
161
unsigned int size, int bigEndian) const;
163
virtual int unparseIdentity(const Message *message, unsigned char *buffer,
164
unsigned int size, int bigEndian) const;
166
virtual void updateIdentity(EncodeBuffer &encodeBuffer, const Message *message,
167
const Message *cachedMessage,
168
ChannelCache *channelCache) const;
170
virtual void updateIdentity(DecodeBuffer &decodeBuffer, const Message *message,
171
ChannelCache *channelCache) const;
173
virtual void identityChecksum(const Message *message, const unsigned char *buffer,
174
unsigned int size, int bigEndian) const;
176
virtual void dumpIdentity(const Message *message) const;
179
#endif /* SetClipRectangles_H */