1 /* $XTermId: data.c,v 1.100 2021/05/27 22:29:26 tom Exp $ */
2 
3 /*
4  * Copyright 2002-2017,2021 by Thomas E. Dickey
5  *
6  *                         All Rights Reserved
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining a
9  * copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included
17  * in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
23  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26  *
27  * Except as contained in this notice, the name(s) of the above copyright
28  * holders shall not be used in advertising or otherwise to promote the
29  * sale, use or other dealings in this Software without prior written
30  * authorization.
31  *
32  * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
33  *
34  *                         All Rights Reserved
35  *
36  * Permission to use, copy, modify, and distribute this software and its
37  * documentation for any purpose and without fee is hereby granted,
38  * provided that the above copyright notice appear in all copies and that
39  * both that copyright notice and this permission notice appear in
40  * supporting documentation, and that the name of Digital Equipment
41  * Corporation not be used in advertising or publicity pertaining to
42  * distribution of the software without specific, written prior permission.
43  *
44  *
45  * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
46  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
47  * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
48  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
49  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
50  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
51  * SOFTWARE.
52  */
53 
54 #include <data.h>
55 
56 Widget toplevel;		/* top-most widget in xterm */
57 
58 #if OPT_TEK4014
59 Char *Tpushb;
60 Char *Tpushback;
61 TekLink *tekRefreshList;
62 TekWidget tekWidget;
63 Widget tekshellwidget;
64 int T_lastx = -1;
65 int T_lasty = -1;
66 int Ttoggled = 0;
67 jmp_buf Tekend;
68 #endif
69 
70 char *ProgramName;
71 char *ProgramPath;
72 
73 Arg ourTopLevelShellArgs[] =
74 {
75     {XtNallowShellResize, (XtArgVal) True},
76     {XtNinput, (XtArgVal) True},
77 };
78 Cardinal number_ourTopLevelShellArgs = 2;
79 
80 Atom wm_delete_window;		/* for ICCCM delete window */
81 
82 Boolean guard_keyboard_type = False;
83 XTERM_RESOURCE resource;
84 
85 PtyData *VTbuffer;
86 
87 jmp_buf VTend;
88 
89 #ifdef DEBUG
90 int debug = 0;			/* true causes error messages to be displayed */
91 #endif /* DEBUG */
92 
93 XtAppContext app_con;
94 XtermWidget term;		/* master data structure for client */
95 
96 int hold_screen;
97 SIG_ATOMIC_T need_cleanup = False;
98 SIG_ATOMIC_T caught_intr = False;
99 
100 int am_slave = -1;		/* set to file-descriptor if we're a slave process */
101 int max_plus1;
102 PtySelect Select_mask;
103 PtySelect X_mask;
104 PtySelect pty_mask;
105 char *ptydev;
106 char *ttydev;
107 
108 #if HANDLE_STRUCT_NOTIFY
109 int mapstate = -1;
110 #endif /* HANDLE_STRUCT_NOTIFY */
111 
112 #ifdef HAVE_LIB_XCURSOR
113 char *xterm_cursor_theme;
114 #endif
115 
116 #if OPT_SESSION_MGT
117 int ice_fd = -1;
118 char **restart_command;
119 #endif
120 
121 int restart_params = 0;
122 
123 #ifdef USE_IGNORE_RC
124 int ignore_unused;
125 #endif
126 
127 #if OPT_DIRECT_COLOR
128 CellColor initCColor =
129 {0, 0};
130 #else
131 CellColor initCColor = 0;
132 #endif
133