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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */
/* */
/* NXAGENT, 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 NoMachine S.r.l. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef __Dialog_H__
#define __Dialog_H__
#include "X11/X.h"
typedef enum
{
DIALOG_FIRST_TAG,
DIALOG_KILL_SESSION = DIALOG_FIRST_TAG,
DIALOG_SUSPEND_SESSION,
DIALOG_ROOTLESS,
DIALOG_PULLDOWN,
DIALOG_FONT_REPLACEMENT,
DIALOG_ENABLE_DESKTOP_RESIZE_MODE,
DIALOG_DISABLE_DESKTOP_RESIZE_MODE,
DIALOG_FAILED_RECONNECTION,
DIALOG_ENABLE_DEFER_MODE,
DIALOG_DISABLE_DEFER_MODE,
DIALOG_DISABLE_XKB,
DIALOG_LAST_TAG
} DialogType;
extern int nxagentKillDialogPid;
extern int nxagentSuspendDialogPid;
extern int nxagentRootlessDialogPid;
extern int nxagentPulldownDialogPid;
extern int nxagentFontsReplacementDialogPid;
extern int nxagentEnableRandRModeDialogPid;
extern int nxagentDisableRandRModeDialogPid;
extern int nxagentEnableDeferModePid;
extern int nxagentDisableDeferModePid;
extern int nxagentDisableXkbPid;
extern char nxagentFailedReconnectionMessage[];
extern char nxagentPulldownWindow[];
extern void nxagentLaunchDialog(DialogType type);
extern void nxagentResetDialog(int pid);
extern void nxagentTerminateDialog(DialogType type);
extern void nxagentFailedReconnectionDialog(int alert, char *error);
extern void nxagentPulldownDialog(Window);
extern void nxagentTerminateDialogs(void);
#define nxagentNoDialogIsRunning \
(nxagentSuspendDialogPid == 0 && \
nxagentKillDialogPid == 0 && \
nxagentEnableRandRModeDialogPid == 0 && \
nxagentDisableRandRModeDialogPid == 0 && \
nxagentEnableDeferModePid == 0 && \
nxagentDisableDeferModePid == 0 && \
nxagentDisableXkbPid == 0)
#define DECODE_DIALOG_TYPE(type) \
((type) == DIALOG_KILL_SESSION ? "DIALOG_KILL_SESSION" : \
(type) == DIALOG_SUSPEND_SESSION ? "DIALOG_SUSPEND_SESSION" : \
(type) == DIALOG_ROOTLESS ? "DIALOG_ROOTLESS" : \
(type) == DIALOG_PULLDOWN ? "DIALOG_PULLDOWN" : \
(type) == DIALOG_FONT_REPLACEMENT ? "DIALOG_FONT_REPLACEMENT" : \
(type) == DIALOG_ENABLE_DESKTOP_RESIZE_MODE ? "DIALOG_ENABLE_DESKTOP_RESIZE_MODE" :\
(type) == DIALOG_DISABLE_DESKTOP_RESIZE_MODE ? "DIALOG_DISABLE_DESKTOP_RESIZE_MODE" :\
(type) == DIALOG_FAILED_RECONNECTION ? "DIALOG_FAILED_RECONNECTION" : \
(type) == DIALOG_ENABLE_DEFER_MODE ? "DIALOG_ENABLE_DEFER_MODE" : \
(type) == DIALOG_DISABLE_DEFER_MODE ? "DIALOG_DISABLE_DEFER_MODE" : \
(type) == DIALOG_DISABLE_XKB ? "DIALOG_DISABLE_XKB" : \
"UNKNOWN_DIALOG")
/*
* Message to be showed to users when the close
* button is pressed. The right message is chosen
* according if session does or does not run in
* persistent mode.
*/
#define DIALOG_KILL_SESSION_MESSAGE \
\
"\
Do you really want to close the session?\
"
#define DIALOG_KILL_SESSION_TYPE "yesno"
#define DIALOG_KILL_SESSION_LOCAL 0
#define DIALOG_SUSPEND_SESSION_MESSAGE \
\
"\
Press the disconnect button to disconnect the running session.\n\
You will be able to resume the session at later time. Press the\n\
terminate button to exit the session and close all the running\n\
programs.\
"
#define DIALOG_SUSPEND_SESSION_TYPE "yesnosuspend"
#define DIALOG_SUSPEND_SESSION_LOCAL 0
#define DIALOG_ROOTLESS_MESSAGE \
\
"\
All remote applications have been terminated.\n\
Do you want to close the session?\
"
#define DIALOG_ROOTLESS_TYPE "yesno"
#define DIALOG_ROOTLESS_LOCAL 0
#define DIALOG_PULLDOWN_MESSAGE \
\
nxagentPulldownWindow
#define DIALOG_PULLDOWN_TYPE "pulldown"
#define DIALOG_PULLDOWN_LOCAL 0
#define DIALOG_FONT_REPLACEMENT_MESSAGE \
\
"\
Unable to retrieve all the fonts currently in use. \n\
Missing fonts have been replaced.\
"
#define DIALOG_FONT_REPLACEMENT_TYPE "ok"
#define DIALOG_FONT_REPLACEMENT_LOCAL 0
#define DIALOG_FAILED_RECONNECTION_MESSAGE \
\
nxagentFailedReconnectionMessage
#define DIALOG_FAILED_RECONNECTION_TYPE "ok"
#define DIALOG_FAILED_RECONNECTION_LOCAL 0
#define DIALOG_ENABLE_DESKTOP_RESIZE_MODE_MESSAGE \
\
"\
The session is now running in desktop resize mode.\n\
You can resize the desktop by simply dragging the\n\
desktop window's border. You can press Ctrl+Alt+R\n\
again to disable this option.\
"
#define DIALOG_ENABLE_DESKTOP_RESIZE_MODE_TYPE "ok"
#define DIALOG_ENABLE_DESKTOP_RESIZE_MODE_LOCAL 0
#define DIALOG_DISABLE_DESKTOP_RESIZE_MODE_MESSAGE \
\
"\
The session is now running in viewport mode. You can\n\
navigate across different areas of the desktop window\n\
by dragging the desktop with the mouse or by using the\n\
arrows keys while pressing Ctrl+Alt. Press Ctrl+Alt+R\n\
again to return to the desktop resize mode.\
"
#define DIALOG_DISABLE_DESKTOP_RESIZE_MODE_TYPE "ok"
#define DIALOG_DISABLE_DESKTOP_RESIZE_MODE_LOCAL 0
#define DIALOG_ENABLE_DEFER_MODE_MESSAGE \
\
"\
Deferred screen updates are now enabled. You can press\n\
Ctrl+Alt+E again to disable this option.\
"
#define DIALOG_ENABLE_DEFER_MODE_TYPE "ok"
#define DIALOG_ENABLE_DEFER_MODE_LOCAL 0
#define DIALOG_DISABLE_DEFER_MODE_MESSAGE \
\
"\
Deferred screen updates are now disabled. You can press\n\
Ctrl+Alt+E to enable it again.\
"
#define DIALOG_DISABLE_DEFER_MODE_TYPE "ok"
#define DIALOG_DISABLE_DEFER_MODE_LOCAL 0
#define DIALOG_DISABLE_XKB_MESSAGE \
\
"\
Changing layout is not allowed with your current display.\
"
#define DIALOG_DISABLE_XKB_TYPE "ok"
#define DIALOG_DISABLE_XKB_LOCAL 0
#endif /* __Dialog_H__ */
|