aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Dialog.h
blob: d0295f81c1368380cd9895c7bd069fadb5c02106 (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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
/**************************************************************************/
/*                                                                        */
/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com)          */
/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de>  */
/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/
/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de>                */
/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de>                 */
/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com)           */
/*                                                                        */
/* NXAGENT, 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 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 __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_ENABLE_AUTOGRAB_MODE,
  DIALOG_DISABLE_AUTOGRAB_MODE,
  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 nxagentEnableAutograbModePid;
extern int nxagentDisableAutograbModePid;

#define NXAGENTFAILEDRECONNECTIONMESSAGELENGTH 256
extern char nxagentFailedReconnectionMessage[NXAGENTFAILEDRECONNECTIONMESSAGELENGTH];

#define NXAGENTPULLDOWNWINDOWLENGTH 16
extern char nxagentPulldownWindow[NXAGENTPULLDOWNWINDOWLENGTH];

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 && \
                             nxagentEnableAutograbModePid == 0 && \
                                 nxagentDisableAutograbModePid == 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_ENABLE_AUTOGRAB_MODE ? "DIALOG_ENABLE_AUTGRAB_MODE" : \
             (type) == DIALOG_DISABLE_AUTOGRAB_MODE ? "DIALOG_DISABLE_AUTOGRAB_MODE" : \
             "UNKNOWN_DIALOG")

/*
 * Message to be shown 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 %s\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 while pressing\n\
Ctrl+Alt or use the keystrokes listed below. Press\n\
%s again to return to the desktop resize mode.\n\
\n\
Use these keystrokes to navigate:%s"

#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\
%s 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\
%s to enable it again.\
"

#define DIALOG_DISABLE_DEFER_MODE_TYPE "ok"

#define DIALOG_DISABLE_DEFER_MODE_LOCAL 0


#define DIALOG_ENABLE_AUTOGRAB_MODE_MESSAGE \
\
"\
Keyboard auto-grabbing mode is now enabled. You can press\n\
%s again to disable auto-grabbing.\
"

#define DIALOG_ENABLE_AUTOGRAB_MODE_TYPE "ok"

#define DIALOG_ENABLE_AUTOGRAB_MODE_LOCAL 0


#define DIALOG_DISABLE_AUTOGRAB_MODE_MESSAGE \
\
"\
Keyboard auto-grabbing mode is now disabled. You can press\n\
%s again to re-enable auto-grabbing.\
"

#define DIALOG_DISABLE_AUTOGRAB_MODE_TYPE "ok"

#define DIALOG_DISABLE_AUTOGRAB_MODE_LOCAL 0

#endif /* __Dialog_H__ */