2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: xims.h /main/6 1996/04/17 16:25:50 pascale $ */
26 * (c) Copyright 1996 Digital Equipment Corporation.
27 * (c) Copyright 1996 Hewlett-Packard Company.
28 * (c) Copyright 1996 International Business Machines Corp.
29 * (c) Copyright 1996 Sun Microsystems, Inc.
30 * (c) Copyright 1996 Novell, Inc.
31 * (c) Copyright 1996 FUJITSU LIMITED.
32 * (c) Copyright 1996 Hitachi.
40 #include <X11/Intrinsic.h>
46 #include <sys/param.h>
54 #define MODE_START 0 /* default */
55 #define MODE_MODE 1 /* -mode option */
56 #define MODE_STYLE 2 /* -style option */
57 #define MODE_LIST 3 /* -list option */ /* no window */
58 #define MODE_CURRENT 4 /* -current option */ /* no window */
59 #define MODE_REMCONF 5 /* -remoteconf */ /* no window */
60 #define MODE_LISTNAME 6 /* -listname option */
63 #define FLAG_ENV (1<<0) /* -env option */
64 #define FLAG_NOSAVE (1<<1) /* -nosave option */
65 #define FLAG_NOSTART (1<<2) /* -nostart option (DEBUG) */
66 #define FLAG_NOWAIT (1<<3) /* -nowait option */
67 #define FLAG_NOTIMEOUT (1<<4) /* -notimeout option */
68 #define FLAG_NORESOURCE (1<<5) /* -noresource option */
69 #define FLAG_NOREMOTE (1<<6) /* -noremote option */
70 #define FLAG_NOTIFY (1<<7) /* -notify option */
71 #define FLAG_CONNECT (1<<8) /* -connect option */
72 #define FLAG_REMOTERUN (1<<9) /* -remoterun option */
73 #define FLAG_WINDOW (1<<10) /* -window option */
74 #define FLAG_DT (1<<11) /* -dt option */
76 #define FLAG_VUE (1<<12) /* -vue option */
77 # endif /* old_hpux */
79 #define FLAG_DEFAULT (FLAG_DT)
81 #define USE_WINDOW_MASK (FLAG_WINDOW|FLAG_VUE|FLAG_DT)
83 #define USE_WINDOW_MASK (FLAG_WINDOW|FLAG_DT)
84 # endif /* old_hpux */
86 #define MAXIMSENT 32 /* max # of ims for each locale */
88 #define MIN_INTERVAL 100 /* msec */
89 #define DEFAULT_INTERVAL 1000 /* msec */
90 #define MIN_TIMEOUT 1 /* sec */
91 #define DEFAULT_TIMEOUT 180 /* sec */
92 #define REMOTE_TIMEOUT 60 /* sec */
94 #define TAG_END_CHAR ':'
95 #define TAG_SEP_CHAR '.'
96 #define LIST_SEP_CHAR ','
97 #define COMMENT_CHAR '!'
98 #define COMMENT_CHAR2 '#'
99 #define COMMENT_CHARS "!#"
101 #define NAME_NONE "none"
102 #define NAME_LOCAL "local"
103 #define NAME_BUILTIN "builtin"
104 #define NAME_DEFAULT "@"
105 #define NAME_DEFAULT_CHAR '@'
106 #define DUMMY_SERVER_NAME NAME_DEFAULT
108 #define STR_PREFIX_CHAR '@'
109 #define STR_DEFAULTIMS "DefaultIms"
110 #define STR_SELECTMODE "SelectMode"
111 #define STR_IMSNAME "ImsName"
112 #define STR_HOSTNAME "HostName"
113 #define STR_ICONIC "IconicMode"
114 #define STR_IMSOPTION "ImsOption"
115 #define STR_ERRORCODE "#ErrorCode"
116 #define STR_ERRORPATH "#ErrorPath"
117 #define STR_CONFDATA "#IMSSTART-CONFDATA-1.0"
118 #define STR_ICONIC_OPT "-iconic"
127 #define NUM_PROTOCOLS 5
129 #define NUM_PROTOCOLS 4
130 # endif /* old_hpux */
132 #define ProtoBit(i) (1<<(i))
135 #define WIN_ST_NONE 0
136 #define WIN_ST_INIT 1
137 #define WIN_ST_REMOTE_CONF 2
138 #define WIN_ST_REMOTE_RUN 3
139 #define WIN_ST_ACTION_DONE 4
141 /* ims server flag */
142 #define F_NO_SERVER (1<<0)
143 #define F_NO_REMOTE (1<<1)
144 #define F_NO_OPTION (1<<2)
145 #define F_HAS_WINDOW (1<<3)
146 #define F_TRY_CONNECT (1<<4)
147 #define F_BUILTIN (1<<8)
149 /* user selection flag */
150 #define F_SELECT_NONE 0
151 #define F_SELECT_FILE (1<<0)
152 #define F_SELECT_WINDOW (1<<1)
153 #define F_SELECT_CHANGED (1<<4)
156 #define NUM_SEL_MODE 2
157 #define SEL_MODE_NOAUTO 0
158 #define SEL_MODE_AUTO 1
159 #define SEL_MODE_ONCE 2
160 #define SEL_MODE_NONE -1
161 #define SEL_MODE_GIVEN -2
162 #define SEL_MODE_QUERY -3
163 #define SEL_MODE_WIN -4
167 #define HOST_REMOTE 1
168 #define HOST_UNKNOWN 2
171 /* index for XhpLocale */
176 #define XHP_LANG_NUM 4
177 # endif /* old_hpux */
179 /* message type for put_msg_win() */
180 #define MSGTYP_INFO 0
181 #define MSGTYP_WARN 1
182 #define MSGTYP_FATAL 2
183 #define MSGTYP_CONFIRM 3
185 /* help message type for ximsHelp() */
186 #define HELP_SELECTION 0
189 /* actions internally used */
190 #define ACT_GETREMCONF 0
191 #define ACT_RUNREMIMS 1
192 #define NUM_ACTIONS 2
193 #define ACTION_MASK 0xf0
198 /* operation states */
206 State_Select_Canceled,
216 State_Finish_Defered,
222 State_Action_Invoked,
223 State_Action_Waiting,
230 /* structure definitions */
259 char *confDir; /* override /etc/vue/config */
260 char *userDir; /* override .vue */
261 char *uselite; /* $HOME/.vue/sessions/usevuelite */
262 char *resPath; /* path of session resource (colon separated) */
265 # endif /* old_hpux */
268 char *confDir; /* override /usr/dt/config */
269 char *userDir; /* override .dt */
270 char *resPath; /* path of session resource (colon separated) */
274 bool disabled; /* disable remote execution */
275 bool useRemsh; /* use remsh(1) instead of action */
276 int timeout; /* timeout for remote execution */
277 char *passEnv; /* env vars passed to remote IMS */
332 char *real_fname; /* actually read */
336 int flag; /* F_SELECT_* */
337 int status; /* error code */
338 int ims_idx; /* index of selected ims to list->elist[] */
339 int host_type; /* host type: HOST_{LOCAL|REMOTE|UNKNOWN} */
340 int iconic; /* iconic mode: */
341 char *name; /* selected ims */
342 char *hostname; /* current host */
343 ImsList *list; /* current list */
344 ImsEnt *ent; /* selected ims ent */
345 FileSel *fsel; /* original selection on file */
346 RunEnv *renv; /* run env used on start.c & env.c */
355 char **locale_aliases;
364 char *DisplayName; /* override $DISPLAY */
365 char *LocaleName; /* override $LANG */
366 char *ConfPath; /* override $CONF/start.conf */
367 char *UserPath; /* override $HOME/.xims/<locale> */
368 char *LogPath; /* override $HOME/.xims/ximslog */
369 char *ResourceFile; /* resource file for IMS */
370 char *ImsName; /* IMS name */
371 char *ImsOption; /* IMS option */
372 char *HostName; /* remote host name */
373 char *ShellName; /* shell name */
374 int Timeout; /* wait timeout (sec) */
375 int Interval; /* check interval (msec) */
376 int SelectMode; /* SEL_MODE_* */
377 int Listname; /* Used only from dtstyle */
381 char *imsConfDir; /* [%I] /usr/dt/config/ims/ */
382 char *imsAppDir; /* [%R] /usr/dt/app-defaults/ */
383 char *imsLogDir; /* [%G] /var/dt/ */
384 char *imsLogFile; /* [%g] imslog */
385 char *imsDir; /* [%b] ims */
386 char *userImsDir; /* [%S] $HOME/.dt/ims/ */
387 char *userTmpDir; /* [%T] $HOME/.dt/tmp/ */
388 char *userAltDir; /* [%A] alt tmp /var/tmp/ */
389 char *xmod[NUM_PROTOCOLS]; /* format of XMODIFIERS */
390 char *atom[NUM_PROTOCOLS]; /* atom name to be examined */
391 char *action[NUM_ACTIONS]; /* actions internally used */
398 # endif /* old_hpux */
412 /* Global Variables */
414 extern char *ProgramRevision; /* on main.c */
415 extern Display *Dpy; /* display (on win.c) */
416 extern Widget TopW; /* toplevel-shell (on win.c) */
417 extern XtAppContext appC;
419 # ifdef _EXTERN_DEFINE_
422 #define Extern extern
423 # endif /* _EXTERN_DEFINE_ */
425 Extern OpStateVal OpState;
426 Extern int OpMode; /* one of MODE_* */
427 Extern int OpFlag; /* bitOR of FLAG_* */
428 Extern CmdOpt Opt; /* command line options */
430 Extern WinEnv winEnv;
431 Extern UserEnv userEnv;
432 Extern UserSelection userSel;
433 Extern ImsList *localList;
435 Extern char *ProgramName; /* invoked program name */
436 Extern int ProgramType; /* same as OpMode */
437 Extern int Verbose; /* verbose flag */
438 Extern int DebugLvl; /* debug flag */
439 Extern FILE *LogFp; /* log file */
440 Extern int Wargc; /* argc for XtAppInitialize */
441 Extern char **Wargv; /* argv for XtAppInitialize */
442 Extern bool WaitingDialogReply;
443 Extern bool WaitingActionDone;
444 Extern bool UseMsgWindow;
445 Extern bool IsRemote;
446 Extern int LastErrMsg;
451 #define isXsession() ((OpFlag & (FLAG_VUE|FLAG_DT)) ? True : False)
452 #define isVUE() ((OpFlag & FLAG_VUE) ? True : False)
454 #define isXsession() ((OpFlag & FLAG_DT) ? True : False)
455 #define isVUE() (False)
456 # endif /* old_hpux */
457 #define isDT() ((OpFlag & FLAG_DT) ? True : False)
458 #define useWINDOW() \
459 (((OpFlag & USE_WINDOW_MASK) || window_env_ok()) ? True : False)
462 (((OpFlag & FLAG_NOREMOTE) || Conf.remote->disabled) ? False : True)
464 #include "ximsfunc.h"
466 #endif /* _XIMS_H_ */