~freenx-team/nx-x11/nxcomp-upstream

« back to all changes in this revision

Viewing changes to QueryFontReply.h

  • Committer: Marcelo Boveto Shima
  • Date: 2009-03-28 22:24:56 UTC
  • Revision ID: mshima@ufserv-20090328222456-rdtaq3oedfyq890c
Import nxcomp 3.3.0-3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**************************************************************************/
 
2
/*                                                                        */
 
3
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/.         */
 
4
/*                                                                        */
 
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.                                */
 
9
/*                                                                        */
 
10
/* Check http://www.nomachine.com/licensing.html for applicability.       */
 
11
/*                                                                        */
 
12
/* NX and NoMachine are trademarks of NoMachine S.r.l.                    */
 
13
/*                                                                        */
 
14
/* All rights reserved.                                                   */
 
15
/*                                                                        */
 
16
/**************************************************************************/
 
17
 
 
18
#ifndef QueryFontReply_H
 
19
#define QueryFontReply_H
 
20
 
 
21
#include "Message.h"
 
22
 
 
23
//
 
24
// Set the verbosity level.
 
25
//
 
26
 
 
27
#define PANIC
 
28
#define WARNING
 
29
#undef  TEST
 
30
#undef  DEBUG
 
31
#undef  DUMP
 
32
 
 
33
//
 
34
// Set default values.
 
35
//
 
36
#define QUERYFONTREPLY_ENABLE_CACHE                       1
 
37
#define QUERYFONTREPLY_ENABLE_DATA                        1
 
38
#define QUERYFONTREPLY_ENABLE_SPLIT                       0
 
39
#define QUERYFONTREPLY_ENABLE_COMPRESS                    1
 
40
 
 
41
#define QUERYFONTREPLY_DATA_LIMIT                         1048576 - 32
 
42
#define QUERYFONTREPLY_DATA_OFFSET                        8
 
43
 
 
44
#define QUERYFONTREPLY_CACHE_SLOTS                        200
 
45
#define QUERYFONTREPLY_CACHE_THRESHOLD                    20
 
46
#define QUERYFONTREPLY_CACHE_LOWER_THRESHOLD              5
 
47
 
 
48
#define QUERYFONTREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7    0
 
49
 
 
50
//
 
51
// The message class.
 
52
//
 
53
 
 
54
class QueryFontReplyMessage : public Message
 
55
{
 
56
  friend class QueryFontReplyStore;
 
57
 
 
58
  public:
 
59
 
 
60
  QueryFontReplyMessage()
 
61
  {
 
62
  }
 
63
 
 
64
  ~QueryFontReplyMessage()
 
65
  {
 
66
  }
 
67
};
 
68
 
 
69
class QueryFontReplyStore : public MessageStore
 
70
{
 
71
  //
 
72
  // Constructors and destructors.
 
73
  //
 
74
 
 
75
  public:
 
76
 
 
77
  QueryFontReplyStore(StaticCompressor *compressor);
 
78
 
 
79
  virtual ~QueryFontReplyStore();
 
80
 
 
81
  virtual const char *name() const
 
82
  {
 
83
    return "QueryFontReply";
 
84
  }
 
85
 
 
86
  virtual unsigned char opcode() const
 
87
  {
 
88
    return X_QueryFont;
 
89
  }
 
90
 
 
91
  virtual unsigned int storage() const
 
92
  {
 
93
    return sizeof(QueryFontReplyMessage);
 
94
  }
 
95
 
 
96
  //
 
97
  // Message handling methods.
 
98
  //
 
99
 
 
100
  protected:
 
101
 
 
102
  virtual Message *create() const
 
103
  {
 
104
    return new QueryFontReplyMessage();
 
105
  }
 
106
 
 
107
  virtual Message *create(const Message &message) const
 
108
  {
 
109
    return new QueryFontReplyMessage((const QueryFontReplyMessage &) message);
 
110
  }
 
111
 
 
112
  virtual void destroy(Message *message) const
 
113
  {
 
114
    delete (QueryFontReplyMessage *) message;
 
115
  }
 
116
 
 
117
  virtual int parseIdentity(Message *message, const unsigned char *buffer, 
 
118
                                unsigned int size, int bigEndian) const;
 
119
 
 
120
  virtual int unparseIdentity(const Message *message, unsigned char *buffer, 
 
121
                                  unsigned int size, int bigEndian) const;
 
122
 
 
123
  virtual void identityChecksum(const Message *message, const unsigned char *buffer, 
 
124
                                    unsigned int size, int bigEndian) const;
 
125
 
 
126
  virtual void dumpIdentity(const Message *message) const;
 
127
};
 
128
 
 
129
#endif /* QueryFontReply_H */