aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/include/NXvars.h
blob: f514000d77bc1a14cfcc253e97aea4236f16196d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
/**************************************************************************/
/*                                                                        */
/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com)          */
/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de>  */
/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de>                 */
/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de>                */
/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/
/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com)           */
/*                                                                        */
/* NXCOMP, NX protocol compression and NX extensions to this software     */
/* are copyright of the aforementioned persons and companies.             */
/*                                                                        */
/* Redistribution and use of the present software is allowed according    */
/* to terms specified in the file LICENSE.nxcomp which comes in the       */
/* source distribution.                                                   */
/*                                                                        */
/* All rights reserved.                                                   */
/*                                                                        */
/* NOTE: This software has received contributions from various other      */
/* contributors, only the core maintainers and supporters are listed as   */
/* copyright holders. Please contact us, if you feel you should be listed */
/* as copyright holder, as well.                                          */
/*                                                                        */
/**************************************************************************/

#ifndef NXvars_H
#define NXvars_H

/*
 * This can be included by the proxy or another
 * layer that doesn't use Xlib.
 */

#if !defined(_XLIB_H_) && !defined(_XKBSRV_H_)

#define NeedFunctionPrototypes  1

#define Display  void

#endif

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Display flush policies.
 */

#define NXPolicyImmediate    1
#define NXPolicyDeferred     2

/*
 * Type of flush.
 */

#define NXFlushBuffer        0
#define NXFlushLink          1

/*
 * Type of statistics.
 */

#define NXStatisticsPartial  0
#define NXStatisticsTotal    1

/*
 * Reason why the display is blocking.
 */

#define NXBlockRead          1
#define NXBlockWrite         2

/*
 * Set if the client is interested in ignoring
 * the display error and continue with the exe-
 * cution of the program. By default the usual
 * Xlib behaviour is gotten, and the library
 * will call an exit().
 */

extern int _NXHandleDisplayError;

/*
 * The function below is called whenever Xlib is
 * going to perform an I/O operation. The funct-
 * ion can be redefined to include additional
 * checks aimed at detecting if the display needs
 * to be closed, for example because of an event
 * or a signal mandating the end of the session.
 * In this way the client program can regain the
 * control before Xlib blocks waiting for input
 * from the network.
 */

typedef int (*NXDisplayErrorPredicate)(
#if NeedFunctionPrototypes
    Display*            /* display */,
    int                 /* reason */
#endif
);

extern NXDisplayErrorPredicate _NXDisplayErrorFunction;

/*
 * This is called when Xlib is going to block
 * waiting for the display to become readable or
 * writable. The client can use the hook to run
 * any arbitrary operation that may require some
 * time to complete. The user should not try to
 * read or write to the display inside the call-
 * back routine.
 */

typedef void (*NXDisplayBlockHandler)(
#if NeedFunctionPrototypes
    Display*            /* display */,
    int                 /* reason */
#endif
);

extern NXDisplayBlockHandler _NXDisplayBlockFunction;

/*
 * Used to notify the program when more data
 * is written to the socket.
 */

typedef void (*NXDisplayWriteHandler)(
#if NeedFunctionPrototypes
    Display*            /* display */,
    int                 /* length */
#endif
);

extern NXDisplayWriteHandler _NXDisplayWriteFunction;

/*
 * This callback is used to notify the agent
 * that the proxy link has been flushed.
 */

typedef void (*NXDisplayFlushHandler)(
#if NeedFunctionPrototypes
    Display*            /* display */,
    int                 /* length */
#endif
);

extern NXDisplayFlushHandler _NXDisplayFlushFunction;

/*
 * Used by the NX transport to get an arbitrary
 * string to add to its protocol statistics.
 */

typedef void (*NXDisplayStatisticsHandler)(
#if NeedFunctionPrototypes
    Display*            /* display */,
    char*               /* buffer */,
    int                 /* size */
#endif
);

extern NXDisplayStatisticsHandler _NXDisplayStatisticsFunction;

/*
 * Let users redefine the function printing an
 * error message in the case of a out-of-order
 * sequence number.
 */

typedef void (*NXLostSequenceHandler)(
#if NeedFunctionPrototypes
    Display*            /* display */,
    unsigned long       /* newseq */,
    unsigned long       /* lastseq */,
    unsigned int        /* type */
#endif
);

extern NXLostSequenceHandler _NXLostSequenceFunction;

/*
 * Let the X server run the children processes
 * (as for example the keyboard initialization
 * utilities) by using the native system libra-
 * ries, instead of the libraries shipped with
 * the NX environment. If set, the Popen() in
 * the X server will remove the LD_LIBRARY_PATH
 * setting from the environment before calling
 * the execl() function in the child process.
 */

extern int _NXUnsetLibraryPath;

#ifdef __cplusplus
}
#endif

#endif /* NXvars_H */