xterm.h revision d4fba8b9
1d4fba8b9Smrg/* $XTermId: xterm.h,v 1.884 2020/12/23 00:21:44 tom Exp $ */
2d522f475Smrg
30bd37d32Smrg/*
4d4fba8b9Smrg * Copyright 1999-2019,2020 by Thomas E. Dickey
50bd37d32Smrg *
60bd37d32Smrg *                         All Rights Reserved
70bd37d32Smrg *
80bd37d32Smrg * Permission is hereby granted, free of charge, to any person obtaining a
90bd37d32Smrg * copy of this software and associated documentation files (the
100bd37d32Smrg * "Software"), to deal in the Software without restriction, including
110bd37d32Smrg * without limitation the rights to use, copy, modify, merge, publish,
120bd37d32Smrg * distribute, sublicense, and/or sell copies of the Software, and to
130bd37d32Smrg * permit persons to whom the Software is furnished to do so, subject to
140bd37d32Smrg * the following conditions:
150bd37d32Smrg *
160bd37d32Smrg * The above copyright notice and this permission notice shall be included
170bd37d32Smrg * in all copies or substantial portions of the Software.
180bd37d32Smrg *
190bd37d32Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
200bd37d32Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
210bd37d32Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
220bd37d32Smrg * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
230bd37d32Smrg * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
240bd37d32Smrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
250bd37d32Smrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
260bd37d32Smrg *
270bd37d32Smrg * Except as contained in this notice, the name(s) of the above copyright
280bd37d32Smrg * holders shall not be used in advertising or otherwise to promote the
290bd37d32Smrg * sale, use or other dealings in this Software without prior written
300bd37d32Smrg * authorization.
310bd37d32Smrg */
32d522f475Smrg
33d522f475Smrg/*
34d522f475Smrg * Common/useful definitions for XTERM application.
35d522f475Smrg *
36d522f475Smrg * This is also where we put the fallback definitions if we do not build using
37d522f475Smrg * the configure script.
38d522f475Smrg */
39d522f475Smrg#ifndef included_xterm_h
40d522f475Smrg#define included_xterm_h
41a1f3da82Smrg/* *INDENT-OFF* */
42d522f475Smrg
43d522f475Smrg#ifdef HAVE_CONFIG_H
44d522f475Smrg#include <xtermcfg.h>
45d522f475Smrg#endif
46d522f475Smrg
470bd37d32Smrg#undef bcopy
48d522f475Smrg#include <X11/Xos.h>
49d522f475Smrg
50d522f475Smrg#ifndef HAVE_CONFIG_H
51d522f475Smrg
52d522f475Smrg#define HAVE_LIB_XAW 1
53d522f475Smrg
54d522f475Smrg#ifdef CSRG_BASED
55d522f475Smrg/* Get definition of BSD */
56d522f475Smrg#include <sys/param.h>
57d522f475Smrg#endif
58d522f475Smrg
59d522f475Smrg#ifndef DFT_TERMTYPE
60d522f475Smrg#define DFT_TERMTYPE "xterm"
61d522f475Smrg#endif
62d522f475Smrg
63d522f475Smrg#ifndef X_NOT_POSIX
64d522f475Smrg#define HAVE_WAITPID 1
65d522f475Smrg#define HAVE_SYS_WAIT_H 1
66d522f475Smrg#define HAVE_UNISTD_H 1
67d522f475Smrg#endif
68d522f475Smrg
69d522f475Smrg#define HAVE_STDLIB_H 1
70d522f475Smrg
71d522f475Smrg#if defined(sun)
72d522f475Smrg/* errno is declared in <errno.h> */
73d522f475Smrg#else
74d522f475Smrg#define DECL_ERRNO 1
75d522f475Smrg#endif
76d522f475Smrg
77d522f475Smrg#undef DECL_PTSNAME		/* ptsname() is normally in stdlib.h */
78d522f475Smrg
79d522f475Smrg#ifndef NOPUTENV
80d522f475Smrg#define HAVE_PUTENV 1
81d522f475Smrg#endif
82d522f475Smrg
8301037d57Smrg#if defined(CSRG_BASED) || defined(__GNU__) || defined(__minix)
84d522f475Smrg#define USE_POSIX_TERMIOS 1
85d522f475Smrg#endif
86d522f475Smrg
87894e0ac8Smrg#ifdef __FreeBSD__
88913cc679Smrg#if __FreeBSD_version >= 900000
89894e0ac8Smrg#define USE_SYSV_UTMP 1
90894e0ac8Smrg#define UTMPX_FOR_UTMP 1
91894e0ac8Smrg#define HAVE_UTMP_UT_HOST 1
92894e0ac8Smrg#define HAVE_UTMP_UT_XTIME 1
93894e0ac8Smrg#define ut_name ut_user
94894e0ac8Smrg#define ut_xtime ut_tv.tv_sec
95894e0ac8Smrg#endif
96894e0ac8Smrg#endif
97894e0ac8Smrg
98d522f475Smrg#ifdef __NetBSD__
99d522f475Smrg#if __NetBSD_Version__ >= 106030000	/* 1.6C */
100d522f475Smrg#define BSD_UTMPX 1
101d522f475Smrg#define ut_xtime ut_tv.tv_sec
102d522f475Smrg#endif
103d522f475Smrg#endif
104d522f475Smrg
105d522f475Smrg#if defined(hpux) && !defined(__hpux)
106d522f475Smrg#define __hpux 1		/* HPUX 11.0 does not define this */
107d522f475Smrg#endif
108d522f475Smrg
109d522f475Smrg#if !defined(__SCO__) && (defined(SCO) || defined(sco) || defined(SCO325))
110d522f475Smrg#define __SCO__ 1
111d522f475Smrg#endif
112d522f475Smrg
113d522f475Smrg#ifdef USE_POSIX_TERMIOS
114d522f475Smrg#define HAVE_TERMIOS_H 1
115d522f475Smrg#define HAVE_TCGETATTR 1
116d522f475Smrg#endif
117d522f475Smrg
11801037d57Smrg#if defined(__SCO__) || defined(__UNIXWARE__) || defined(__minix)
119d522f475Smrg#define USE_TERMCAP 1
120d522f475Smrg#endif
121d522f475Smrg
122d522f475Smrg#if defined(UTMP)
123d522f475Smrg#define HAVE_UTMP 1
124d522f475Smrg#endif
125d522f475Smrg
126d522f475Smrg#if (defined(__MVS__) || defined(SVR4) || defined(__SCO__) || defined(BSD_UTMPX)) && !defined(__CYGWIN__)
127d522f475Smrg#define UTMPX_FOR_UTMP 1
128d522f475Smrg#endif
129d522f475Smrg
130d522f475Smrg#if !defined(ISC) && !defined(__QNX__)
131d522f475Smrg#define HAVE_UTMP_UT_HOST 1
132d522f475Smrg#endif
133d522f475Smrg
134894e0ac8Smrg#if defined(UTMPX_FOR_UTMP) && !(defined(__MVS__) || defined(__hpux) || defined(__FreeBSD__))
135d522f475Smrg#define HAVE_UTMP_UT_SESSION 1
136d522f475Smrg#endif
137d522f475Smrg
138894e0ac8Smrg#if !(defined(linux) && (!defined(__GLIBC__) || (__GLIBC__ < 2))) && !defined(SVR4) && !defined(__FreeBSD__)
139d522f475Smrg#define ut_xstatus ut_exit.e_exit
140d522f475Smrg#endif
141d522f475Smrg
142d522f475Smrg#if defined(SVR4) || defined(__SCO__) || defined(BSD_UTMPX) || (defined(linux) && defined(__GLIBC__) && (__GLIBC__ >= 2) && !(defined(__powerpc__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)))
143d522f475Smrg#define HAVE_UTMP_UT_XTIME 1
144d522f475Smrg#endif
145d522f475Smrg
146d522f475Smrg#if defined(linux) || defined(__CYGWIN__)
147d522f475Smrg#define USE_LASTLOG
148d522f475Smrg#define HAVE_LASTLOG_H
149d522f475Smrg#define USE_STRUCT_LASTLOG
150d522f475Smrg#elif defined(BSD) && (BSD >= 199103)
151d522f475Smrg#ifdef BSD_UTMPX
152d522f475Smrg#define USE_LASTLOGX
153894e0ac8Smrg#elif defined(USE_SYSV_UTMP)
154d522f475Smrg#else
155d522f475Smrg#define USE_LASTLOG
156d522f475Smrg#define USE_STRUCT_LASTLOG
157d522f475Smrg#endif
158d522f475Smrg#endif
159d522f475Smrg
160d522f475Smrg#if defined(__OpenBSD__)
161d522f475Smrg#define DEFDELETE_DEL True
162d522f475Smrg#define DEF_BACKARO_ERASE True
163d522f475Smrg#define DEF_INITIAL_ERASE True
164d522f475Smrg#endif
165d522f475Smrg
166d522f475Smrg#if defined(__SCO__) || defined(__UNIXWARE__)
167d522f475Smrg#define DEFDELETE_DEL True
168d522f475Smrg#define OPT_SCO_FUNC_KEYS 1
169d522f475Smrg#endif
170d522f475Smrg
171d522f475Smrg#if defined(__SCO__) || defined(SVR4) || defined(_POSIX_SOURCE) || defined(__QNX__) || defined(__hpux) || (defined(BSD) && (BSD >= 199103)) || defined(__CYGWIN__)
172d522f475Smrg#define USE_POSIX_WAIT
173d522f475Smrg#endif
174d522f475Smrg
175d522f475Smrg#if defined(AIXV3) || defined(CRAY) || defined(__SCO__) || defined(SVR4) || (defined(SYSV) && defined(i386)) || defined(__MVS__) || defined(__hpux) || defined(__osf__) || defined(linux) || defined(macII) || defined(BSD_UTMPX)
176d522f475Smrg#define USE_SYSV_UTMP
177d522f475Smrg#endif
178d522f475Smrg
179d522f475Smrg#if defined(__GNU__) || defined(__MVS__) || defined(__osf__)
180d522f475Smrg#define USE_TTY_GROUP
181d522f475Smrg#endif
182d522f475Smrg
183d522f475Smrg#if defined(__CYGWIN__)
184d522f475Smrg#define HAVE_NCURSES_TERM_H 1
185d522f475Smrg#endif
186d522f475Smrg
187d522f475Smrg#ifdef __osf__
188d522f475Smrg#define TTY_GROUP_NAME "terminal"
189d522f475Smrg#endif
190d522f475Smrg
191d522f475Smrg#if defined(__MVS__)
192d522f475Smrg#undef ut_xstatus
193d522f475Smrg#define ut_name ut_user
194d522f475Smrg#define ut_xstatus ut_exit.ut_e_exit
195d522f475Smrg#define ut_xtime ut_tv.tv_sec
196d522f475Smrg#endif
197d522f475Smrg
198d522f475Smrg#if defined(ut_xstatus)
199d522f475Smrg#define HAVE_UTMP_UT_XSTATUS 1
200d522f475Smrg#endif
201d522f475Smrg
202d522f475Smrg#if defined(XKB)
203d522f475Smrg#define HAVE_XKB_BELL_EXT 1
204d522f475Smrg#endif
205d522f475Smrg
206d522f475Smrg#if (defined(SVR4) && !defined(__CYGWIN__)) || defined(linux) || (defined(BSD) && (BSD >= 199103))
207d522f475Smrg#define HAVE_POSIX_SAVED_IDS
208d522f475Smrg#endif
209d522f475Smrg
210e0a2b6dfSmrg#if defined(linux) || defined(__GLIBC__) || (defined(SYSV) && (defined(CRAY) || defined(macII) || defined(__hpux) || defined(__osf__) || defined(__sgi))) || !(defined(SYSV) || defined(__QNX__) || defined(VMS) || defined(__INTERIX))
211e0a2b6dfSmrg#define HAVE_INITGROUPS
212e0a2b6dfSmrg#endif
213e0a2b6dfSmrg
214d522f475Smrg#endif /* HAVE_CONFIG_H */
215d522f475Smrg
216d522f475Smrg#ifndef HAVE_X11_DECKEYSYM_H
217d522f475Smrg#define HAVE_X11_DECKEYSYM_H 1
218d522f475Smrg#endif
219d522f475Smrg
220d522f475Smrg#ifndef HAVE_X11_SUNKEYSYM_H
221d522f475Smrg#define HAVE_X11_SUNKEYSYM_H 1
222d522f475Smrg#endif
223d522f475Smrg
224d522f475Smrg#ifndef HAVE_X11_XF86KEYSYM_H
225d522f475Smrg#define HAVE_X11_XF86KEYSYM_H 0
226d522f475Smrg#endif
227d522f475Smrg
228d4fba8b9Smrg#if defined(HAVE_X11_EXTENSIONS_XDBE_H) && defined(HAVE_XDBESWAPBUFFERS)
229d4fba8b9Smrg#define USE_DOUBLE_BUFFER 1
230d4fba8b9Smrg#else
231d4fba8b9Smrg#define USE_DOUBLE_BUFFER 0
232d4fba8b9Smrg#endif
233d4fba8b9Smrg
234d522f475Smrg/***====================================================================***/
235d522f475Smrg
236d522f475Smrg/* if compiling with gcc -ansi -pedantic, we must fix POSIX definitions */
237d522f475Smrg#if defined(SVR4) && defined(sun)
238d522f475Smrg#ifndef __EXTENSIONS__
239d522f475Smrg#define __EXTENSIONS__ 1
240d522f475Smrg#endif
241d522f475Smrg#ifndef _POSIX_C_SOURCE
242d522f475Smrg#define _POSIX_C_SOURCE 1
243d522f475Smrg#endif
244d522f475Smrg#endif
245d522f475Smrg
246d522f475Smrg/***====================================================================***/
247d522f475Smrg
248d522f475Smrg#ifdef HAVE_STDLIB_H
249d522f475Smrg#include <stdlib.h>
250d522f475Smrg#else
251d522f475Smrgextern char *calloc();
252d522f475Smrgextern char *getenv();
253d522f475Smrgextern char *malloc();
254d522f475Smrgextern char *realloc();
255d522f475Smrgextern void exit();
256d522f475Smrgextern void free();
257d522f475Smrg#endif
258d522f475Smrg
259d522f475Smrg#ifdef HAVE_UNISTD_H
260d522f475Smrg#include <unistd.h>
261d522f475Smrg#endif
262d522f475Smrg
263d522f475Smrg#ifdef HAVE_SYS_WAIT_H
264d522f475Smrg#include <sys/wait.h>
265d522f475Smrg#endif
266d522f475Smrg
267d522f475Smrg#include <errno.h>
268d522f475Smrg#if defined(DECL_ERRNO) && !defined(errno)
269d522f475Smrgextern int errno;
270d522f475Smrg#endif
271d522f475Smrg
272d4fba8b9Smrg#include <X11/Xlocale.h>
273d4fba8b9Smrg
274d522f475Smrg/*
275d522f475Smrg * FIXME:  Toggling logging from xterm hangs under Linux 2.0.29 with libc5 if
276d522f475Smrg * we use 'waitpid()', while 'wait()' seems to work properly.
277d522f475Smrg */
278d522f475Smrg#ifdef linux
279d522f475Smrg#undef HAVE_WAITPID
280d522f475Smrg#endif
281d522f475Smrg
282d522f475Smrg#ifndef OPT_WIDE_CHARS
283d522f475Smrg#define OPT_WIDE_CHARS 0
284d522f475Smrg#endif
285d522f475Smrg
286d522f475Smrg#if OPT_WIDE_CHARS
287d522f475Smrg#define HIDDEN_CHAR 0xffff
288d522f475Smrg#endif
289d522f475Smrg
290d522f475Smrg/***====================================================================***/
291d522f475Smrg
2920bd37d32Smrg#define PROTO_XT_ACTIONS_ARGS \
2930bd37d32Smrg	(Widget w, XEvent *event, String *params, Cardinal *num_params)
2940bd37d32Smrg
2950bd37d32Smrg#define PROTO_XT_CALLBACK_ARGS \
2960bd37d32Smrg	(Widget gw, XtPointer closure, XtPointer data)
2970bd37d32Smrg
2980bd37d32Smrg#define PROTO_XT_CVT_SELECT_ARGS \
2990bd37d32Smrg	(Widget w, Atom *selection, Atom *target, Atom *type, XtPointer *value, unsigned long *length, int *format)
3000bd37d32Smrg
3010bd37d32Smrg#define PROTO_XT_EV_HANDLER_ARGS \
3020bd37d32Smrg	(Widget w, XtPointer closure, XEvent *event, Boolean *cont)
3030bd37d32Smrg
3040bd37d32Smrg#define PROTO_XT_SEL_CB_ARGS \
3050bd37d32Smrg	(Widget w, XtPointer client_data, Atom *selection, Atom *type, XtPointer value, unsigned long *length, int *format)
3060bd37d32Smrg
307d522f475Smrg#include <ptyx.h>
308d522f475Smrg
309d4fba8b9Smrg/***====================================================================***/
310d4fba8b9Smrg
311d4fba8b9Smrg#ifndef GCC_PRINTFLIKE
312d4fba8b9Smrg#ifdef _X_ATTRIBUTE_PRINTF
313d4fba8b9Smrg#define GCC_PRINTFLIKE(f,n)	_X_ATTRIBUTE_PRINTF(f,n)
314d4fba8b9Smrg#else
315d4fba8b9Smrg#define GCC_PRINTFLIKE(f,n)	/* nothing */
316d4fba8b9Smrg#endif
317d4fba8b9Smrg#endif
318d4fba8b9Smrg
319d4fba8b9Smrg#ifndef GCC_UNUSED
320d4fba8b9Smrg#ifdef _X_UNUSED
321d4fba8b9Smrg#define GCC_UNUSED		_X_UNUSED
322d4fba8b9Smrg#else
323d4fba8b9Smrg#define GCC_UNUSED		/* nothing */
324d4fba8b9Smrg#endif
325d4fba8b9Smrg#endif
326d4fba8b9Smrg
327d4fba8b9Smrg#ifndef GCC_NORETURN
328d4fba8b9Smrg#ifdef _X_NORETURN
329d4fba8b9Smrg#define GCC_NORETURN		_X_NORETURN
330d4fba8b9Smrg#else
331d4fba8b9Smrg#define GCC_NORETURN		/* nothing */
332d4fba8b9Smrg#endif
333d4fba8b9Smrg#endif
334d4fba8b9Smrg
335d4fba8b9Smrg/***====================================================================***/
336d4fba8b9Smrg
337d4fba8b9Smrg#if defined(__GNUC__) && defined(_FORTIFY_SOURCE)
338d4fba8b9Smrg#define USE_IGNORE_RC
339d4fba8b9Smrg#define IGNORE_RC(func) ignore_unused = (int) func
340d4fba8b9Smrg#else
341d4fba8b9Smrg#define IGNORE_RC(func) (void) func
342d4fba8b9Smrg#endif /* gcc workarounds */
343d522f475Smrg#if (XtSpecificationRelease >= 6) && !defined(NO_XPOLL_H) && !defined(sun)
344d522f475Smrg#include <X11/Xpoll.h>
345d522f475Smrg#define USE_XPOLL_H 1
346d522f475Smrg#else
347d522f475Smrg#define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval *)t)
348d522f475Smrg#define XFD_COPYSET(src,dst) memcpy((dst)->fds_bits, (src)->fds_bits, sizeof(fd_set))
349d522f475Smrg#if defined(__MVS__) && !defined(TIME_WITH_SYS_TIME)
350d522f475Smrg#define TIME_WITH_SYS_TIME
351d522f475Smrg#endif
352d522f475Smrg#endif
353d522f475Smrg
354d522f475Smrg#ifdef TIME_WITH_SYS_TIME
355d522f475Smrg# include <sys/time.h>
356d522f475Smrg# include <time.h>
357d522f475Smrg#else
358d522f475Smrg# ifdef HAVE_SYS_TIME_H
359d522f475Smrg#  include <sys/time.h>
360d522f475Smrg# else
361d522f475Smrg#  include <time.h>
362d522f475Smrg# endif
363d522f475Smrg#endif
364d522f475Smrg
365d522f475Smrg/* these may be needed for sig_atomic_t */
366d522f475Smrg#include <sys/types.h>
367d522f475Smrg#include <signal.h>
368d522f475Smrg
369d522f475Smrg#ifdef USE_SYS_SELECT_H
370d522f475Smrg
371d522f475Smrg#if defined(USE_XPOLL_H) && defined(AIXV3) && defined(NFDBITS)
372d522f475Smrg#undef NFDBITS			/* conflict between X11/Xpoll.h and sys/select.h */
373d522f475Smrg#endif
374d522f475Smrg
375d522f475Smrg#include <sys/select.h>
376d522f475Smrg
377d522f475Smrg#endif /* USE_SYS_SELECT_H */
378d522f475Smrg
379d522f475Smrg#include <setjmp.h>
380d522f475Smrg
381d522f475Smrg#if !defined(VMS) && !(defined(linux) && defined(__USE_GNU)) && !defined(__hpux) && !defined(_ALL_SOURCE) && !defined(__osf__)
382d522f475Smrgextern char **environ;
383d522f475Smrg#endif
384d522f475Smrg
385894e0ac8Smrg#ifndef _Xconst
386894e0ac8Smrg#define _Xconst const		/* Solaris 7 workaround */
387894e0ac8Smrg#endif /* _Xconst */
388894e0ac8Smrg
389d522f475Smrg#define XK_Fn(n)	(XK_F1 + (n) - 1)
390d522f475Smrg
391d522f475Smrg#define Maybe		2
392d522f475Smrg
39301037d57Smrg#define ALLOC_STRING(name) \
39401037d57Smrg	if (name != 0) \
39501037d57Smrg	    name = x_strdup(name)
39601037d57Smrg#define FREE_STRING(name) \
39701037d57Smrg	    free_string(name)
39801037d57Smrg
3992e4f8982Smrg/* strftime format and length of the result */
4002e4f8982Smrg#define FMT_TIMESTAMP ".%Y.%m.%d.%H.%M.%S"
4012e4f8982Smrg#define LEN_TIMESTAMP sizeof(".YYYY.MM.DD.hh.mm.ss")
4022e4f8982Smrg
403d522f475Smrg/***====================================================================***/
404d522f475Smrg
405d4fba8b9Smrg#if OPT_TRACE
406d4fba8b9Smrg#undef NDEBUG			/* turn on assert's */
407d4fba8b9Smrg#else
408d4fba8b9Smrg#ifndef NDEBUG
409d4fba8b9Smrg#define NDEBUG			/* not debugging, don't do assert's */
410d4fba8b9Smrg#endif
411d4fba8b9Smrg#endif
412d4fba8b9Smrg
413d4fba8b9Smrg#include <trace.h>
414d4fba8b9Smrg
415d4fba8b9Smrg#if OPT_TRACE && !defined(DEBUG)
416d4fba8b9Smrg#define DEBUG 1
417d4fba8b9Smrg#endif
418d4fba8b9Smrg
419d4fba8b9Smrg#ifdef DEBUG
420d4fba8b9Smrg#define if_DEBUG(code) if(debug) code
421d4fba8b9Smrg#else
422d4fba8b9Smrg#define if_DEBUG(code) /*nothing*/
423d4fba8b9Smrg#endif
424d4fba8b9Smrg
425d4fba8b9Smrg#define DEBUG_MSG(text) if_DEBUG({ IGNORE_RC(write(2, text, sizeof(text) - 1)); })
426d4fba8b9Smrg
427d4fba8b9Smrg/***====================================================================***/
428d4fba8b9Smrg
429e39b573cSmrg#define XtNallowBoldFonts	"allowBoldFonts"
430d522f475Smrg#define XtNallowC1Printable	"allowC1Printable"
43120d2c4d2Smrg#define XtNallowColorOps	"allowColorOps"
4322eaa94a1Schristos#define XtNallowFontOps		"allowFontOps"
433913cc679Smrg#define XtNallowMouseOps	"allowMouseOps"
4340bd37d32Smrg#define XtNallowPasteControls	"allowPasteControls"
43520d2c4d2Smrg#define XtNallowScrollLock	"allowScrollLock"
436d522f475Smrg#define XtNallowSendEvents	"allowSendEvents"
4372eaa94a1Schristos#define XtNallowTcapOps		"allowTcapOps"
438d522f475Smrg#define XtNallowTitleOps	"allowTitleOps"
439d522f475Smrg#define XtNallowWindowOps	"allowWindowOps"
440d522f475Smrg#define XtNaltIsNotMeta		"altIsNotMeta"
441d522f475Smrg#define XtNaltSendsEscape	"altSendsEscape"
4420bd37d32Smrg#define XtNalternateScroll	"alternateScroll"
443d522f475Smrg#define XtNalwaysBoldMode	"alwaysBoldMode"
444d522f475Smrg#define XtNalwaysHighlight	"alwaysHighlight"
445d522f475Smrg#define XtNalwaysUseMods	"alwaysUseMods"
446d522f475Smrg#define XtNanswerbackString	"answerbackString"
447d522f475Smrg#define XtNappcursorDefault	"appcursorDefault"
448d522f475Smrg#define XtNappkeypadDefault	"appkeypadDefault"
449e0a2b6dfSmrg#define XtNassumeAllChars	"assumeAllChars"
450d522f475Smrg#define XtNautoWrap		"autoWrap"
451d522f475Smrg#define XtNawaitInput		"awaitInput"
452d522f475Smrg#define XtNbackarrowKey		"backarrowKey"
453d522f475Smrg#define XtNbellIsUrgent		"bellIsUrgent"
454d522f475Smrg#define XtNbellOnReset		"bellOnReset"
455d522f475Smrg#define XtNbellSuppressTime	"bellSuppressTime"
456d522f475Smrg#define XtNboldColors		"boldColors"
457d522f475Smrg#define XtNboldFont		"boldFont"
458d522f475Smrg#define XtNboldMode		"boldMode"
459d522f475Smrg#define XtNbrokenLinuxOSC	"brokenLinuxOSC"
460d522f475Smrg#define XtNbrokenSelections	"brokenSelections"
461d522f475Smrg#define XtNbrokenStringTerm	"brokenStringTerm"
462d4fba8b9Smrg#define XtNbuffered		"buffered"
463d4fba8b9Smrg#define XtNbufferedFPS		"bufferedFPS"
464d522f475Smrg#define XtNc132			"c132"
465d522f475Smrg#define XtNcacheDoublesize	"cacheDoublesize"
4660bd37d32Smrg#define XtNcdXtraScroll		"cdXtraScroll"
467d522f475Smrg#define XtNcharClass		"charClass"
468d4fba8b9Smrg#define XtNchecksumExtension	"checksumExtension"
469d522f475Smrg#define XtNcjkWidth		"cjkWidth"
470d522f475Smrg#define XtNcolorAttrMode	"colorAttrMode"
471d522f475Smrg#define XtNcolorBDMode		"colorBDMode"
472d522f475Smrg#define XtNcolorBLMode		"colorBLMode"
47301037d57Smrg#define XtNcolorITMode		"colorITMode"
474d4fba8b9Smrg#define XtNcolorInnerBorder	"colorInnerBorder"
475d522f475Smrg#define XtNcolorMode		"colorMode"
476d522f475Smrg#define XtNcolorRVMode		"colorRVMode"
477d522f475Smrg#define XtNcolorULMode		"colorULMode"
478d522f475Smrg#define XtNcombiningChars	"combiningChars"
479d522f475Smrg#define XtNctrlFKeys		"ctrlFKeys"
480d522f475Smrg#define XtNcurses		"curses"
481d522f475Smrg#define XtNcursorBlink		"cursorBlink"
482d4fba8b9Smrg#define XtNcursorBlinkXOR	"cursorBlinkXOR"
483d522f475Smrg#define XtNcursorColor		"cursorColor"
484d522f475Smrg#define XtNcursorOffTime	"cursorOffTime"
485d522f475Smrg#define XtNcursorOnTime		"cursorOnTime"
48601037d57Smrg#define XtNcursorUnderLine	"cursorUnderLine"
487d522f475Smrg#define XtNcutNewline		"cutNewline"
488d522f475Smrg#define XtNcutToBeginningOfLine	"cutToBeginningOfLine"
489d4fba8b9Smrg#define XtNdecGraphicsID	"decGraphicsID"
490d522f475Smrg#define XtNdecTerminalID	"decTerminalID"
491956cc18dSsnj#define XtNdefaultString	"defaultString"
492d522f475Smrg#define XtNdeleteIsDEL		"deleteIsDEL"
493d4fba8b9Smrg#define XtNdirectColor		"directColor"
49420d2c4d2Smrg#define XtNdisallowedColorOps	"disallowedColorOps"
49520d2c4d2Smrg#define XtNdisallowedFontOps	"disallowedFontOps"
496913cc679Smrg#define XtNdisallowedMouseOps	"disallowedMouseOps"
497d4fba8b9Smrg#define XtNdisallowedPasteControls "disallowedPasteControls"
49820d2c4d2Smrg#define XtNdisallowedTcapOps	"disallowedTcapOps"
49920d2c4d2Smrg#define XtNdisallowedWindowOps	"disallowedWindowOps"
500d522f475Smrg#define XtNdynamicColors	"dynamicColors"
501d522f475Smrg#define XtNeightBitControl	"eightBitControl"
502d522f475Smrg#define XtNeightBitInput	"eightBitInput"
5030bd37d32Smrg#define XtNeightBitMeta		"eightBitMeta"
504d522f475Smrg#define XtNeightBitOutput	"eightBitOutput"
505956cc18dSsnj#define XtNeightBitSelectTypes	"eightBitSelectTypes"
506913cc679Smrg#define XtNeraseSavedLines	"eraseSavedLines"
507d522f475Smrg#define XtNfaceName		"faceName"
508d522f475Smrg#define XtNfaceNameDoublesize	"faceNameDoublesize"
509d522f475Smrg#define XtNfaceSize		"faceSize"
510956cc18dSsnj#define XtNfastScroll		"fastScroll"
511d522f475Smrg#define XtNfont1		"font1"
512d522f475Smrg#define XtNfont2		"font2"
513d522f475Smrg#define XtNfont3		"font3"
514d522f475Smrg#define XtNfont4		"font4"
515d522f475Smrg#define XtNfont5		"font5"
516d522f475Smrg#define XtNfont6		"font6"
517d4fba8b9Smrg#define XtNfont7		"font7"
518d522f475Smrg#define XtNfontDoublesize	"fontDoublesize"
519956cc18dSsnj#define XtNfontWarnings		"fontWarnings"
520d522f475Smrg#define XtNforceBoxChars	"forceBoxChars"
52120d2c4d2Smrg#define XtNforcePackedFont	"forcePackedFont"
522d4fba8b9Smrg#define XtNforceXftHeight	"forceXftHeight"
523d522f475Smrg#define XtNformatOtherKeys	"formatOtherKeys"
524d522f475Smrg#define XtNfreeBoldBox		"freeBoldBox"
525a1f3da82Smrg#define XtNfullscreen		"fullscreen"
526d522f475Smrg#define XtNhighlightColor	"highlightColor"
527d522f475Smrg#define XtNhighlightColorMode	"highlightColorMode"
528d522f475Smrg#define XtNhighlightReverse	"highlightReverse"
529d522f475Smrg#define XtNhighlightSelection	"highlightSelection"
530d522f475Smrg#define XtNhighlightTextColor	"highlightTextColor"
531d522f475Smrg#define XtNhpLowerleftBugCompat	"hpLowerleftBugCompat"
532d522f475Smrg#define XtNi18nSelections	"i18nSelections"
5330bd37d32Smrg#define XtNiconHint		"iconHint"
534d522f475Smrg#define XtNinitialFont		"initialFont"
535d522f475Smrg#define XtNinternalBorder	"internalBorder"
536956cc18dSsnj#define XtNitalicULMode		"italicULMode"
537d522f475Smrg#define XtNjumpScroll		"jumpScroll"
5382e4f8982Smrg#define XtNkeepClipboard	"keepClipboard"
539d522f475Smrg#define XtNkeepSelection	"keepSelection"
540d522f475Smrg#define XtNkeyboardDialect	"keyboardDialect"
541d4fba8b9Smrg#define XtNlimitFontsets	"limitFontsets"
542d522f475Smrg#define XtNlimitResize		"limitResize"
543d4fba8b9Smrg#define XtNlimitResponse	"limitResponse"
544d522f475Smrg#define XtNlocale		"locale"
545d522f475Smrg#define XtNlocaleFilter		"localeFilter"
546d522f475Smrg#define XtNlogFile		"logFile"
547d522f475Smrg#define XtNlogInhibit		"logInhibit"
548d522f475Smrg#define XtNlogging		"logging"
549d522f475Smrg#define XtNloginShell		"loginShell"
550d522f475Smrg#define XtNmarginBell		"marginBell"
55101037d57Smrg#define XtNmaxGraphicSize	"maxGraphicSize"
552d4fba8b9Smrg#define XtNmaximized		"maximized"
553913cc679Smrg#define XtNmenuBar		"menuBar"	/* internal */
554d522f475Smrg#define XtNmenuHeight		"menuHeight"
555d522f475Smrg#define XtNmetaSendsEscape	"metaSendsEscape"
556d522f475Smrg#define XtNmkSamplePass		"mkSamplePass"
557d522f475Smrg#define XtNmkSampleSize		"mkSampleSize"
558d522f475Smrg#define XtNmkWidth		"mkWidth"
559d522f475Smrg#define XtNmodifyCursorKeys	"modifyCursorKeys"
560d522f475Smrg#define XtNmodifyFunctionKeys	"modifyFunctionKeys"
5610bd37d32Smrg#define XtNmodifyKeyboard	"modifyKeyboard"
562d522f475Smrg#define XtNmodifyKeypadKeys	"modifyKeypadKeys"
563d522f475Smrg#define XtNmodifyOtherKeys	"modifyOtherKeys"
564d522f475Smrg#define XtNmodifyStringKeys	"modifyStringKeys"
565d522f475Smrg#define XtNmultiClickTime	"multiClickTime"
566d522f475Smrg#define XtNmultiScroll		"multiScroll"
567d522f475Smrg#define XtNnMarginBell		"nMarginBell"
568d4fba8b9Smrg#define XtNnextEventDelay	"nextEventDelay"
569894e0ac8Smrg#define XtNnumColorRegisters	"numColorRegisters"
570d522f475Smrg#define XtNnumLock		"numLock"
571d522f475Smrg#define XtNoldXtermFKeys	"oldXtermFKeys"
572d522f475Smrg#define XtNpointerColor		"pointerColor"
573d522f475Smrg#define XtNpointerColorBackground "pointerColorBackground"
574d4fba8b9Smrg#define XtNpointerFont		"pointerFont"
575d522f475Smrg#define XtNpointerMode		"pointerMode"
576d522f475Smrg#define XtNpointerShape		"pointerShape"
577d522f475Smrg#define XtNpopOnBell		"popOnBell"
5780bd37d32Smrg#define XtNprecompose		"precompose"
579d522f475Smrg#define XtNprintAttributes	"printAttributes"
580d522f475Smrg#define XtNprinterAutoClose	"printerAutoClose"
581d522f475Smrg#define XtNprinterCommand	"printerCommand"
582d522f475Smrg#define XtNprinterControlMode	"printerControlMode"
583d522f475Smrg#define XtNprinterExtent	"printerExtent"
584d522f475Smrg#define XtNprinterFormFeed	"printerFormFeed"
58520d2c4d2Smrg#define XtNprinterNewLine	"printerNewLine"
586e0a2b6dfSmrg#define XtNprivateColorRegisters "privateColorRegisters"
587d522f475Smrg#define XtNquietGrab		"quietGrab"
58801037d57Smrg#define XtNregisDefaultFont	"regisDefaultFont"
58901037d57Smrg#define XtNregisScreenSize	"regisScreenSize"
590d522f475Smrg#define XtNrenderFont		"renderFont"
591d522f475Smrg#define XtNresizeGravity	"resizeGravity"
5920bd37d32Smrg#define XtNretryInputMethod	"retryInputMethod"
593d522f475Smrg#define XtNreverseWrap		"reverseWrap"
594d522f475Smrg#define XtNrightScrollBar	"rightScrollBar"
595d522f475Smrg#define XtNsaveLines		"saveLines"
5960bd37d32Smrg#define XtNscaleHeight		"scaleHeight"
597d522f475Smrg#define XtNscrollBar		"scrollBar"
598d522f475Smrg#define XtNscrollBarBorder	"scrollBarBorder"
599d522f475Smrg#define XtNscrollKey		"scrollKey"
600d522f475Smrg#define XtNscrollLines		"scrollLines"
601d522f475Smrg#define XtNscrollTtyOutput	"scrollTtyOutput"
602d522f475Smrg#define XtNselectToClipboard	"selectToClipboard"
603d4fba8b9Smrg#define XtNshiftEscape		"shiftEscape"
604d522f475Smrg#define XtNshiftFonts		"shiftFonts"
605d522f475Smrg#define XtNshowBlinkAsBold	"showBlinkAsBold"
606d522f475Smrg#define XtNshowMissingGlyphs	"showMissingGlyphs"
607492d43a5Smrg#define XtNshowWrapMarks	"showWrapMarks"
608d522f475Smrg#define XtNsignalInhibit	"signalInhibit"
609e0a2b6dfSmrg#define XtNsixelScrolling	"sixelScrolling"
610894e0ac8Smrg#define XtNsixelScrollsRight	"sixelScrollsRight"
611d522f475Smrg#define XtNtekGeometry		"tekGeometry"
612d522f475Smrg#define XtNtekInhibit		"tekInhibit"
613d522f475Smrg#define XtNtekSmall		"tekSmall"
614d522f475Smrg#define XtNtekStartup		"tekStartup"
615d522f475Smrg#define XtNtiXtraScroll		"tiXtraScroll"
616d522f475Smrg#define XtNtiteInhibit		"titeInhibit"
61720d2c4d2Smrg#define XtNtitleModes		"titleModes"
618d522f475Smrg#define XtNtoolBar		"toolBar"
619d522f475Smrg#define XtNtrimSelection	"trimSelection"
620d522f475Smrg#define XtNunderLine		"underLine"
621d4fba8b9Smrg#define XtNuseBorderClipping	"useBorderClipping"
622d522f475Smrg#define XtNuseClipping		"useClipping"
623d522f475Smrg#define XtNutf8			"utf8"
624e39b573cSmrg#define XtNutf8Fonts		"utf8Fonts"
625d522f475Smrg#define XtNutf8Latin1		"utf8Latin1"
626956cc18dSsnj#define XtNutf8SelectTypes	"utf8SelectTypes"
627d522f475Smrg#define XtNutf8Title		"utf8Title"
628d4fba8b9Smrg#define XtNutf8Weblike		"utf8Weblike"
629d522f475Smrg#define XtNveryBoldColors	"veryBoldColors"
630d522f475Smrg#define XtNvisualBell		"visualBell"
631d522f475Smrg#define XtNvisualBellDelay	"visualBellDelay"
6320bd37d32Smrg#define XtNvisualBellLine	"visualBellLine"
633d522f475Smrg#define XtNvt100Graphics	"vt100Graphics"
634d522f475Smrg#define XtNwideBoldFont		"wideBoldFont"
635d522f475Smrg#define XtNwideChars		"wideChars"
636d522f475Smrg#define XtNwideFont		"wideFont"
637d522f475Smrg#define XtNximFont		"ximFont"
638913cc679Smrg#define XtNxmcAttributes	"xmcAttributes"	/* ncurses-testing */
639913cc679Smrg#define XtNxmcGlitch		"xmcGlitch"	/* ncurses-testing */
640913cc679Smrg#define XtNxmcInline		"xmcInline"	/* ncurses-testing */
641913cc679Smrg#define XtNxmcMoveSGR		"xmcMoveSGR"	/* ncurses-testing */
642d522f475Smrg
643e39b573cSmrg#define XtCAllowBoldFonts	"AllowBoldFonts"
644d522f475Smrg#define XtCAllowC1Printable	"AllowC1Printable"
64520d2c4d2Smrg#define XtCAllowColorOps	"AllowColorOps"
6462eaa94a1Schristos#define XtCAllowFontOps		"AllowFontOps"
647913cc679Smrg#define XtCAllowMouseOps	"AllowMouseOps"
6480bd37d32Smrg#define XtCAllowPasteControls	"AllowPasteControls"
64920d2c4d2Smrg#define XtCAllowScrollLock	"AllowScrollLock"
650d522f475Smrg#define XtCAllowSendEvents	"AllowSendEvents"
6512eaa94a1Schristos#define XtCAllowTcapOps		"AllowTcapOps"
652d522f475Smrg#define XtCAllowTitleOps	"AllowTitleOps"
653d522f475Smrg#define XtCAllowWindowOps	"AllowWindowOps"
654d522f475Smrg#define XtCAltIsNotMeta		"AltIsNotMeta"
655d522f475Smrg#define XtCAltSendsEscape	"AltSendsEscape"
656d522f475Smrg#define XtCAlwaysBoldMode	"AlwaysBoldMode"
657d522f475Smrg#define XtCAlwaysHighlight	"AlwaysHighlight"
658d522f475Smrg#define XtCAlwaysUseMods	"AlwaysUseMods"
659d522f475Smrg#define XtCAnswerbackString	"AnswerbackString"
660d522f475Smrg#define XtCAppcursorDefault	"AppcursorDefault"
661d522f475Smrg#define XtCAppkeypadDefault	"AppkeypadDefault"
662e0a2b6dfSmrg#define XtCAssumeAllChars	"AssumeAllChars"
663d522f475Smrg#define XtCAutoWrap		"AutoWrap"
664d522f475Smrg#define XtCAwaitInput		"AwaitInput"
665d522f475Smrg#define XtCBackarrowKey		"BackarrowKey"
666d522f475Smrg#define XtCBellIsUrgent		"BellIsUrgent"
667d522f475Smrg#define XtCBellOnReset		"BellOnReset"
668d522f475Smrg#define XtCBellSuppressTime	"BellSuppressTime"
669d522f475Smrg#define XtCBoldFont		"BoldFont"
670d522f475Smrg#define XtCBoldMode		"BoldMode"
671d522f475Smrg#define XtCBrokenLinuxOSC	"BrokenLinuxOSC"
672d522f475Smrg#define XtCBrokenSelections	"BrokenSelections"
673d522f475Smrg#define XtCBrokenStringTerm	"BrokenStringTerm"
674d4fba8b9Smrg#define XtCBuffered		"Buffered"
675d4fba8b9Smrg#define XtCBufferedFPS		"BufferedFPS"
676d522f475Smrg#define XtCC132			"C132"
677d522f475Smrg#define XtCCacheDoublesize	"CacheDoublesize"
6780bd37d32Smrg#define XtCCdXtraScroll		"CdXtraScroll"
679d522f475Smrg#define XtCCharClass		"CharClass"
680d4fba8b9Smrg#define XtCChecksumExtension	"ChecksumExtension"
681a1f3da82Smrg#define XtCCjkWidth		"CjkWidth"
682956cc18dSsnj#define XtCColorAttrMode	"ColorAttrMode"
683d4fba8b9Smrg#define XtCColorInnerBorder	"ColorInnerBorder"
684d522f475Smrg#define XtCColorMode		"ColorMode"
685d522f475Smrg#define XtCColumn		"Column"
686d522f475Smrg#define XtCCombiningChars	"CombiningChars"
687d522f475Smrg#define XtCCtrlFKeys		"CtrlFKeys"
688d522f475Smrg#define XtCCurses		"Curses"
689d522f475Smrg#define XtCCursorBlink		"CursorBlink"
690d4fba8b9Smrg#define XtCCursorBlinkXOR	"CursorBlinkXOR"
691d522f475Smrg#define XtCCursorOffTime	"CursorOffTime"
692d522f475Smrg#define XtCCursorOnTime		"CursorOnTime"
69301037d57Smrg#define XtCCursorUnderLine	"CursorUnderLine"
694d522f475Smrg#define XtCCutNewline		"CutNewline"
695d522f475Smrg#define XtCCutToBeginningOfLine	"CutToBeginningOfLine"
696d4fba8b9Smrg#define XtCDecGraphicsID	"DecGraphicsID"
697d522f475Smrg#define XtCDecTerminalID	"DecTerminalID"
698956cc18dSsnj#define XtCDefaultString	"DefaultString"
699d522f475Smrg#define XtCDeleteIsDEL		"DeleteIsDEL"
700d4fba8b9Smrg#define XtCDirectColor		"DirectColor"
70120d2c4d2Smrg#define XtCDisallowedColorOps	"DisallowedColorOps"
70220d2c4d2Smrg#define XtCDisallowedFontOps	"DisallowedFontOps"
703913cc679Smrg#define XtCDisallowedMouseOps	"DisallowedMouseOps"
704d4fba8b9Smrg#define XtCDisallowedPasteControls "DisallowedPasteControls"
70520d2c4d2Smrg#define XtCDisallowedTcapOps	"DisallowedTcapOps"
70620d2c4d2Smrg#define XtCDisallowedWindowOps	"DisallowedWindowOps"
707d522f475Smrg#define XtCDynamicColors	"DynamicColors"
708d522f475Smrg#define XtCEightBitControl	"EightBitControl"
709d522f475Smrg#define XtCEightBitInput	"EightBitInput"
7100bd37d32Smrg#define XtCEightBitMeta		"EightBitMeta"
711d522f475Smrg#define XtCEightBitOutput	"EightBitOutput"
712956cc18dSsnj#define XtCEightBitSelectTypes	"EightBitSelectTypes"
713913cc679Smrg#define XtCEraseSavedLines	"EraseSavedLines"
714d522f475Smrg#define XtCFaceName		"FaceName"
715d522f475Smrg#define XtCFaceNameDoublesize	"FaceNameDoublesize"
716d522f475Smrg#define XtCFaceSize		"FaceSize"
717956cc18dSsnj#define XtCFastScroll		"FastScroll"
718d522f475Smrg#define XtCFont1		"Font1"
719d522f475Smrg#define XtCFont2		"Font2"
720d522f475Smrg#define XtCFont3		"Font3"
721d522f475Smrg#define XtCFont4		"Font4"
722d522f475Smrg#define XtCFont5		"Font5"
723d522f475Smrg#define XtCFont6		"Font6"
724d4fba8b9Smrg#define XtCFont7		"Font7"
725d522f475Smrg#define XtCFontDoublesize	"FontDoublesize"
726956cc18dSsnj#define XtCFontWarnings		"FontWarnings"
727d522f475Smrg#define XtCForceBoxChars	"ForceBoxChars"
72820d2c4d2Smrg#define XtCForcePackedFont	"ForcePackedFont"
729d4fba8b9Smrg#define XtCForceXftHeight	"ForceXftHeight"
730d522f475Smrg#define XtCFormatOtherKeys	"FormatOtherKeys"
731d522f475Smrg#define XtCFreeBoldBox		"FreeBoldBox"
732a1f3da82Smrg#define XtCFullscreen		"Fullscreen"
733d522f475Smrg#define XtCHighlightColorMode	"HighlightColorMode"
734d522f475Smrg#define XtCHighlightReverse	"HighlightReverse"
735d522f475Smrg#define XtCHighlightSelection	"HighlightSelection"
736d522f475Smrg#define XtCHpLowerleftBugCompat	"HpLowerleftBugCompat"
737d522f475Smrg#define XtCI18nSelections	"I18nSelections"
7380bd37d32Smrg#define XtCIconHint		"IconHint"
739d522f475Smrg#define XtCInitialFont		"InitialFont"
740d522f475Smrg#define XtCJumpScroll		"JumpScroll"
7412e4f8982Smrg#define XtCKeepClipboard	"KeepClipboard"
742d522f475Smrg#define XtCKeepSelection	"KeepSelection"
743d522f475Smrg#define XtCKeyboardDialect	"KeyboardDialect"
744d4fba8b9Smrg#define XtCLimitFontsets	"LimitFontsets"
745d522f475Smrg#define XtCLimitResize		"LimitResize"
746d4fba8b9Smrg#define XtCLimitResponse	"LimitResponse"
747d522f475Smrg#define XtCLocale		"Locale"
748d522f475Smrg#define XtCLocaleFilter		"LocaleFilter"
749d522f475Smrg#define XtCLogInhibit		"LogInhibit"
750d522f475Smrg#define XtCLogfile		"Logfile"
751d522f475Smrg#define XtCLogging		"Logging"
752d522f475Smrg#define XtCLoginShell		"LoginShell"
753d522f475Smrg#define XtCMarginBell		"MarginBell"
75401037d57Smrg#define XtCMaxGraphicSize	"MaxGraphicSize"
755d4fba8b9Smrg#define XtCMaximized		"Maximized"
756913cc679Smrg#define XtCMenuBar		"MenuBar"	/* internal */
757d522f475Smrg#define XtCMenuHeight		"MenuHeight"
758d522f475Smrg#define XtCMetaSendsEscape	"MetaSendsEscape"
759e0a2b6dfSmrg#define XtCMkSamplePass		"MkSamplePass"
760e0a2b6dfSmrg#define XtCMkSampleSize		"MkSampleSize"
761a1f3da82Smrg#define XtCMkWidth		"MkWidth"
762d522f475Smrg#define XtCModifyCursorKeys	"ModifyCursorKeys"
763d522f475Smrg#define XtCModifyFunctionKeys	"ModifyFunctionKeys"
7640bd37d32Smrg#define XtCModifyKeyboard	"ModifyKeyboard"
765d522f475Smrg#define XtCModifyKeypadKeys	"ModifyKeypadKeys"
766d522f475Smrg#define XtCModifyOtherKeys	"ModifyOtherKeys"
767d522f475Smrg#define XtCModifyStringKeys	"ModifyStringKeys"
768d522f475Smrg#define XtCMultiClickTime	"MultiClickTime"
769d522f475Smrg#define XtCMultiScroll		"MultiScroll"
770d4fba8b9Smrg#define XtCNextEventDelay	"NextEventDelay"
771894e0ac8Smrg#define XtCNumColorRegisters	"NumColorRegisters"
772d522f475Smrg#define XtCNumLock		"NumLock"
773d522f475Smrg#define XtCOldXtermFKeys	"OldXtermFKeys"
774d4fba8b9Smrg#define XtCPointerFont		"PointerFont"
775d522f475Smrg#define XtCPointerMode		"PointerMode"
776d522f475Smrg#define XtCPopOnBell		"PopOnBell"
7770bd37d32Smrg#define XtCPrecompose		"Precompose"
778d522f475Smrg#define XtCPrintAttributes	"PrintAttributes"
779d522f475Smrg#define XtCPrinterAutoClose	"PrinterAutoClose"
780d522f475Smrg#define XtCPrinterCommand	"PrinterCommand"
781d522f475Smrg#define XtCPrinterControlMode	"PrinterControlMode"
782d522f475Smrg#define XtCPrinterExtent	"PrinterExtent"
783d522f475Smrg#define XtCPrinterFormFeed	"PrinterFormFeed"
78420d2c4d2Smrg#define XtCPrinterNewLine	"PrinterNewLine"
785e0a2b6dfSmrg#define XtCPrivateColorRegisters "PrivateColorRegisters"
786d522f475Smrg#define XtCQuietGrab		"QuietGrab"
78701037d57Smrg#define XtCRegisDefaultFont	"RegisDefaultFont"
78801037d57Smrg#define XtCRegisScreenSize	"RegisScreenSize"
789d522f475Smrg#define XtCRenderFont		"RenderFont"
790d522f475Smrg#define XtCResizeGravity	"ResizeGravity"
7910bd37d32Smrg#define XtCRetryInputMethod	"RetryInputMethod"
792d522f475Smrg#define XtCReverseWrap		"ReverseWrap"
793d522f475Smrg#define XtCRightScrollBar	"RightScrollBar"
794d522f475Smrg#define XtCSaveLines		"SaveLines"
7950bd37d32Smrg#define XtCScaleHeight		"ScaleHeight"
796d522f475Smrg#define XtCScrollBar		"ScrollBar"
797d522f475Smrg#define XtCScrollBarBorder	"ScrollBarBorder"
798d522f475Smrg#define XtCScrollCond		"ScrollCond"
799d522f475Smrg#define XtCScrollLines		"ScrollLines"
800d522f475Smrg#define XtCSelectToClipboard	"SelectToClipboard"
801d4fba8b9Smrg#define XtCShiftEscape		"ShiftEscape"
802d522f475Smrg#define XtCShiftFonts		"ShiftFonts"
803d522f475Smrg#define XtCShowBlinkAsBold	"ShowBlinkAsBold"
804d522f475Smrg#define XtCShowMissingGlyphs	"ShowMissingGlyphs"
805492d43a5Smrg#define XtCShowWrapMarks	"ShowWrapMarks"
806d522f475Smrg#define XtCSignalInhibit	"SignalInhibit"
807e0a2b6dfSmrg#define XtCSixelScrolling	"SixelScrolling"
808894e0ac8Smrg#define XtCSixelScrollsRight	"SixelScrollsRight"
809d522f475Smrg#define XtCTekInhibit		"TekInhibit"
810d522f475Smrg#define XtCTekSmall		"TekSmall"
811d522f475Smrg#define XtCTekStartup		"TekStartup"
812d522f475Smrg#define XtCTiXtraScroll		"TiXtraScroll"
813d522f475Smrg#define XtCTiteInhibit		"TiteInhibit"
81420d2c4d2Smrg#define XtCTitleModes		"TitleModes"
815d522f475Smrg#define XtCToolBar		"ToolBar"
816d522f475Smrg#define XtCTrimSelection	"TrimSelection"
817d522f475Smrg#define XtCUnderLine		"UnderLine"
818d4fba8b9Smrg#define XtCUseBorderClipping	"UseBorderClipping"
819d522f475Smrg#define XtCUseClipping		"UseClipping"
820d522f475Smrg#define XtCUtf8			"Utf8"
821e39b573cSmrg#define XtCUtf8Fonts		"Utf8Fonts"
822d522f475Smrg#define XtCUtf8Latin1		"Utf8Latin1"
823956cc18dSsnj#define XtCUtf8SelectTypes	"Utf8SelectTypes"
824d522f475Smrg#define XtCUtf8Title		"Utf8Title"
825d4fba8b9Smrg#define XtCUtf8Weblike		"Utf8Weblike"
826d522f475Smrg#define XtCVT100Graphics	"VT100Graphics"
827d522f475Smrg#define XtCVeryBoldColors	"VeryBoldColors"
828d522f475Smrg#define XtCVisualBell		"VisualBell"
829d522f475Smrg#define XtCVisualBellDelay	"VisualBellDelay"
8300bd37d32Smrg#define XtCVisualBellLine	"VisualBellLine"
831d522f475Smrg#define XtCWideBoldFont		"WideBoldFont"
832d522f475Smrg#define XtCWideChars		"WideChars"
833d522f475Smrg#define XtCWideFont		"WideFont"
834d522f475Smrg#define XtCXimFont		"XimFont"
835913cc679Smrg#define XtCXmcAttributes	"XmcAttributes"	/* ncurses-testing */
836913cc679Smrg#define XtCXmcGlitch		"XmcGlitch"	/* ncurses-testing */
837913cc679Smrg#define XtCXmcInline		"XmcInline"	/* ncurses-testing */
838913cc679Smrg#define XtCXmcMoveSGR		"XmcMoveSGR"	/* ncurses-testing */
839d522f475Smrg
840d522f475Smrg#if defined(NO_ACTIVE_ICON) && !defined(XtNgeometry)
841d522f475Smrg#define XtNgeometry		"geometry"
842d522f475Smrg#define XtCGeometry		"Geometry"
843d522f475Smrg#endif
844d522f475Smrg
845d522f475Smrg#if OPT_COLOR_CLASS
846d522f475Smrg#define XtCCursorColor		"CursorColor"
847d522f475Smrg#define XtCPointerColor		"PointerColor"
848d522f475Smrg#define XtCHighlightColor	"HighlightColor"
849d522f475Smrg#define XtCHighlightTextColor	"HighlightTextColor"
850d522f475Smrg#else
851d522f475Smrg#define XtCCursorColor		XtCForeground
852d522f475Smrg#define XtCPointerColor		XtCForeground
853d522f475Smrg#define XtCHighlightColor	XtCForeground
854d522f475Smrg#define XtCHighlightTextColor	XtCBackground
855d522f475Smrg#endif
856d522f475Smrg
857d522f475Smrg/***====================================================================***/
858d522f475Smrg
859d522f475Smrg#ifdef __cplusplus
860d522f475Smrgextern "C" {
861d522f475Smrg#endif
862d522f475Smrg
863d522f475Smrgstruct XTERM_RESOURCE;
864d522f475Smrg
865d522f475Smrg/* Tekproc.c */
866d522f475Smrg#if OPT_TEK4014
867956cc18dSsnjextern TekWidget getTekWidget(Widget /* w */);
868d522f475Smrgextern int TekGetFontSize (const char * /* param */);
869d522f475Smrgextern int TekInit (void);
870d522f475Smrgextern void ChangeTekColors (TekWidget /* tw */, TScreen * /* screen */, ScrnColors * /* pNew */);
871d522f475Smrgextern void HandleGINInput             PROTO_XT_ACTIONS_ARGS;
872d522f475Smrgextern void TCursorToggle (TekWidget /* tw */, int /* toggle */);
873d522f475Smrgextern void TekCopy (TekWidget /* tw */);
874d522f475Smrgextern void TekEnqMouse (TekWidget /* tw */, int /* c */);
875d522f475Smrgextern void TekExpose (Widget  /* w */, XEvent * /* event */, Region  /* region */);
876d522f475Smrgextern void TekGINoff (TekWidget /* tw */);
877d522f475Smrgextern void TekRefresh (TekWidget /* tw */);
878d522f475Smrgextern void TekRepaint (TekWidget /* xw */);
879913cc679Smrgextern void TekReverseVideo (XtermWidget /* xw */, TekWidget /* tw */);
880d522f475Smrgextern void TekRun (void);
881956cc18dSsnjextern void TekSetFontSize (TekWidget /* tw */, Bool /* fromMenu */, int  /* newitem */);
882913cc679Smrgextern void TekSetWinSize (TekWidget /* tw */);
883d522f475Smrgextern void TekSimulatePageButton (TekWidget /* tw */, Bool /* reset */);
884d522f475Smrg#endif
885d522f475Smrg
886d522f475Smrg/* button.c */
887492d43a5Smrg#define	MotionOff( s, t ) if (!(screen->hide_pointer)) {		\
888d522f475Smrg	    (s)->event_mask |= ButtonMotionMask;			\
889d522f475Smrg	    (s)->event_mask &= ~PointerMotionMask;			\
890d522f475Smrg	    XSelectInput(XtDisplay((t)), XtWindow((t)), (long) (s)->event_mask); }
891d522f475Smrg
892d522f475Smrg#define	MotionOn( s, t ) {						\
893d522f475Smrg	    (s)->event_mask &= ~ButtonMotionMask;			\
894d522f475Smrg	    (s)->event_mask |= PointerMotionMask;			\
895d522f475Smrg	    XSelectInput(XtDisplay((t)), XtWindow((t)), (long) (s)->event_mask); }
896d522f475Smrg
897d522f475Smrgextern Bool SendMousePosition (XtermWidget  /* w */, XEvent*  /* event */);
898913cc679Smrgextern XtermMouseModes okSendMousePos(XtermWidget /* xw */);
899d522f475Smrgextern void DiredButton                PROTO_XT_ACTIONS_ARGS;
900d4fba8b9Smrgextern void DisownSelection (XtermWidget  /* xw */);
901d4fba8b9Smrgextern void UnhiliteSelection (XtermWidget  /* xw */);
9026879286fSmrgextern void HandleCopySelection        PROTO_XT_ACTIONS_ARGS;
903d522f475Smrgextern void HandleInsertSelection      PROTO_XT_ACTIONS_ARGS;
904d522f475Smrgextern void HandleKeyboardSelectEnd    PROTO_XT_ACTIONS_ARGS;
905d522f475Smrgextern void HandleKeyboardSelectExtend PROTO_XT_ACTIONS_ARGS;
906d522f475Smrgextern void HandleKeyboardSelectStart  PROTO_XT_ACTIONS_ARGS;
907d522f475Smrgextern void HandleKeyboardStartExtend  PROTO_XT_ACTIONS_ARGS;
908d4fba8b9Smrgextern void HandlePointerMotion        PROTO_XT_ACTIONS_ARGS;
909d4fba8b9Smrgextern void HandlePointerButton        PROTO_XT_ACTIONS_ARGS;
910d522f475Smrgextern void HandleSelectEnd            PROTO_XT_ACTIONS_ARGS;
911d522f475Smrgextern void HandleSelectExtend         PROTO_XT_ACTIONS_ARGS;
912d522f475Smrgextern void HandleSelectSet            PROTO_XT_ACTIONS_ARGS;
913d522f475Smrgextern void HandleSelectStart          PROTO_XT_ACTIONS_ARGS;
914d522f475Smrgextern void HandleStartExtend          PROTO_XT_ACTIONS_ARGS;
915d522f475Smrgextern void ResizeSelection (TScreen * /* screen */, int  /* rows */, int  /* cols */);
916d522f475Smrgextern void ScrollSelection (TScreen * /* screen */, int  /* amount */,  Bool /* always */);
91720d2c4d2Smrgextern void TrackMouse (XtermWidget /* xw */, int /* func */, CELL * /* start */, int /* firstrow */, int /* lastrow */);
918d522f475Smrgextern void ViButton                   PROTO_XT_ACTIONS_ARGS;
919d522f475Smrg
920d4fba8b9Smrgextern void UnmapSelections (XtermWidget /* xw */);
921d4fba8b9Smrgextern int xtermUtf8ToTextList (XtermWidget /* xw */, XTextProperty * /* text_prop */, char *** /* text_list */, int * /* text_list_count */);
922d4fba8b9Smrgextern void xtermButtonInit (XtermWidget /* xw */);
92320d2c4d2Smrg
924d522f475Smrg#if OPT_DEC_LOCATOR
925d522f475Smrgextern void GetLocatorPosition (XtermWidget  /* w */);
926d522f475Smrgextern void InitLocatorFilter (XtermWidget  /* w */);
927d522f475Smrg#endif	/* OPT_DEC_LOCATOR */
928d522f475Smrg
929d522f475Smrg#if OPT_FOCUS_EVENT
930d522f475Smrgextern void SendFocusButton(XtermWidget /* xw */, XFocusChangeEvent * /* event */);
931d522f475Smrg#else
932d522f475Smrg#define SendFocusBotton(xw, event) /* nothing */
933d522f475Smrg#endif
934d522f475Smrg
935d522f475Smrg#if OPT_PASTE64
936d4fba8b9Smrgextern void AppendToSelectionBuffer (TScreen * /* screen */, unsigned  /* c */, String /* selection */);
937d4fba8b9Smrgextern void ClearSelectionBuffer (TScreen * /* screen */, String /* selection */);
93820d2c4d2Smrgextern void CompleteSelection (XtermWidget  /* xw */, String * /* args */, Cardinal  /* len */);
939d522f475Smrgextern void xtermGetSelection (Widget  /* w */, Time  /* ev_time */, String * /* params */, Cardinal  /* num_params */, Atom * /* targets */);
940d522f475Smrg#endif
941d522f475Smrg
942d522f475Smrg#if OPT_READLINE
943d522f475Smrgextern void ReadLineButton             PROTO_XT_ACTIONS_ARGS;
944d522f475Smrg#endif
945d522f475Smrg
946913cc679Smrg#if OPT_REPORT_CCLASS
947913cc679Smrgextern void report_char_class(XtermWidget);
948913cc679Smrg#endif
949913cc679Smrg
950d4fba8b9Smrg#define IsLatin1(n)  (((n) >= 32 && (n) <= 126) || ((n) >= 160 && (n) <= 255))
951d4fba8b9Smrg
952d522f475Smrg#if OPT_WIDE_CHARS
95320d2c4d2Smrg#define WideCells(n) (((IChar)(n) >= first_widechar) ? my_wcwidth((wchar_t) (n)) : 1)
954d4fba8b9Smrg#define isWideFrg(n) (((n) == HIDDEN_CHAR) || (WideCells((n)) == 2))
955d4fba8b9Smrg#define isWide(n)    (((IChar)(n) >= first_widechar) && isWideFrg(n))
956d4fba8b9Smrg#define CharWidth(n) (((n) < 256) ? (IsLatin1(n) ? 1 : 0) : my_wcwidth((wchar_t) (n)))
95720d2c4d2Smrg#else
95820d2c4d2Smrg#define WideCells(n) 1
959d4fba8b9Smrg#define CharWidth(n) (IsLatin1(n) ? 1 : 0)
960d522f475Smrg#endif
961d522f475Smrg
962d522f475Smrg/* cachedCgs.c */
963d522f475Smrgextern CgsEnum getCgsId(XtermWidget /*xw*/, VTwin * /*cgsWin*/, GC /*gc*/);
964d522f475Smrgextern GC freeCgs(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/);
965d522f475Smrgextern GC getCgsGC(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/);
966d522f475Smrgextern Pixel getCgsBack(XtermWidget /*xw*/, VTwin * /*cgsWin*/, GC /*gc*/);
967d522f475Smrgextern Pixel getCgsFore(XtermWidget /*xw*/, VTwin * /*cgsWin*/, GC /*gc*/);
968d522f475Smrgextern XTermFonts * getCgsFont(XtermWidget /*xw*/, VTwin * /*cgsWin*/, GC /*gc*/);
969d522f475Smrgextern void clrCgsFonts(XtermWidget /*xw*/, VTwin * /*cgsWin*/, XTermFonts * /*font*/);
970d522f475Smrgextern void copyCgs(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*dstCgsId*/, CgsEnum /*srcCgsId*/);
971d522f475Smrgextern void redoCgs(XtermWidget /*xw*/, Pixel /*fg*/, Pixel /*bg*/, CgsEnum /*cgsId*/);
972d522f475Smrgextern void setCgsBack(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, Pixel /*bg*/);
973d522f475Smrgextern void setCgsCSet(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, unsigned /*cset*/);
974d522f475Smrgextern void setCgsFont(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, XTermFonts * /*font*/);
975d4fba8b9Smrgextern void setCgsFont2(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, XTermFonts * /*font*/, unsigned /*which*/);
976d522f475Smrgextern void setCgsFore(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, Pixel /*fg*/);
977d522f475Smrgextern void swapCgs(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*dstCgsId*/, CgsEnum /*srcCgsId*/);
978d522f475Smrg
979d522f475Smrg#ifdef NO_LEAKS
980d522f475Smrgextern void noleaks_cachedCgs (XtermWidget /* xw */);
981d522f475Smrg#endif
982d522f475Smrg
983d522f475Smrg/* charproc.c */
984d522f475Smrgextern Bool CheckBufPtrs (TScreen * /* screen */);
985492d43a5Smrgextern Bool set_cursor_gcs (XtermWidget /* xw */);
986d4fba8b9Smrgextern char * vt100ResourceToString (XtermWidget /* xw */, const char * /* name */);
987956cc18dSsnjextern int VTInit (XtermWidget /* xw */);
988d522f475Smrgextern void FindFontSelection (XtermWidget /* xw */, const char * /* atom_name */, Bool  /* justprobe */);
989d4fba8b9Smrgextern void HideCursor (XtermWidget /* xw */);
990d4fba8b9Smrgextern void RestartBlinking(XtermWidget /* xw */);
991d4fba8b9Smrgextern void ShowCursor (XtermWidget /* xw */);
99220d2c4d2Smrgextern void SwitchBufPtrs (TScreen * /* screen */, int /* toBuf */);
993d522f475Smrgextern void ToggleAlternate (XtermWidget /* xw */);
994a1f3da82Smrgextern void VTInitTranslations (void);
995e39b573cSmrgextern void VTReset (XtermWidget /* xw */, int /* full */, int /* saved */) GCC_NORETURN;
996956cc18dSsnjextern void VTRun (XtermWidget /* xw */);
997d4fba8b9Smrgextern void dotext (XtermWidget /* xw */, DECNRCM_codes /* charset */, IChar * /* buf */, Cardinal  /* len */);
99801037d57Smrgextern void getKeymapResources(Widget /* w */, const char * /*mapName */, const char * /* mapClass */, const char * /* type */, void * /* result */, size_t /* size */);
999d4fba8b9Smrgextern void initBorderGC (XtermWidget /* xw */, VTwin * /* win */);
10000bd37d32Smrgextern void lookupSelectUnit(XtermWidget /* xw */, Cardinal /* item */, String /* value */);
1001d522f475Smrgextern void releaseCursorGCs(XtermWidget /*xw*/);
1002d522f475Smrgextern void releaseWindowGCs(XtermWidget /*xw*/, VTwin * /*win*/);
1003d522f475Smrgextern void resetCharsets (TScreen * /* screen */);
1004d4fba8b9Smrgextern void resetMargins (XtermWidget /* xw */);
1005d4fba8b9Smrgextern void restoreCharsets (TScreen * /* screen */, DECNRCM_codes * /* source */);
1006d4fba8b9Smrgextern void saveCharsets (TScreen * /* screen */, DECNRCM_codes * /* target */);
1007d522f475Smrgextern void set_max_col(TScreen *  /* screen */, int  /* cols */);
1008d522f475Smrgextern void set_max_row(TScreen *  /* screen */, int  /* rows */);
1009d522f475Smrgextern void unparse_end (XtermWidget /* xw */);
1010d522f475Smrgextern void unparseputc (XtermWidget /* xw */, int  /* c */);
1011d522f475Smrgextern void unparseputc1 (XtermWidget /* xw */, int  /* c */);
1012d522f475Smrgextern void unparseputn (XtermWidget /* xw */, unsigned /* n */);
101320d2c4d2Smrgextern void unparseputs (XtermWidget /* xw */, const char * /* s */);
1014d522f475Smrgextern void unparseseq (XtermWidget /* xw */, ANSI * /* ap */);
1015492d43a5Smrgextern void v_write (int  /* f */, const Char * /* d */, unsigned  /* len */);
1016d4fba8b9Smrgextern void xtermAddInput (Widget  /* w */);
1017d4fba8b9Smrgextern void xtermDecodeSCS (XtermWidget /* xw */, int /* which */, int /* sgroup */, int /* prefix */, int /* suffix */);
1018d522f475Smrg
1019d522f475Smrg#if OPT_BLINK_CURS
1020d4fba8b9Smrgextern void ToggleCursorBlink(XtermWidget /* xw */);
1021d522f475Smrg#endif
1022d522f475Smrg
10230bd37d32Smrg#if OPT_BLINK_TEXT
102401037d57Smrgextern Bool LineHasBlinking(TScreen * /* screen */, CLineData * /* ld */);
10250bd37d32Smrg#endif
10260bd37d32Smrg
10270bd37d32Smrg#if OPT_INPUT_METHOD
10280bd37d32Smrgextern TInput *lookupTInput (XtermWidget /* xw */, Widget /* w */);
10290bd37d32Smrg#endif
10300bd37d32Smrg
1031d522f475Smrg#if OPT_ISO_COLORS
1032d522f475Smrgextern void SGR_Background (XtermWidget /* xw */, int  /* color */);
1033d522f475Smrgextern void SGR_Foreground (XtermWidget /* xw */, int  /* color */);
1034d4fba8b9Smrgextern void setExtendedColors (XtermWidget /* xw */);
1035d522f475Smrg#endif
1036d522f475Smrg
1037d522f475Smrg#ifdef NO_LEAKS
1038d522f475Smrgextern void noleaks_charproc (void);
1039d522f475Smrg#endif
1040d522f475Smrg
1041d522f475Smrg/* charsets.c */
1042d4fba8b9Smrgextern unsigned xtermCharSetIn (XtermWidget /* xw */, unsigned  /* code */, DECNRCM_codes /* charset */);
1043d4fba8b9Smrgextern int xtermCharSetOut (XtermWidget /* xw */, IChar * /* buf */, IChar * /* ptr */, DECNRCM_codes /* charset */);
1044d522f475Smrg
1045d522f475Smrg/* cursor.c */
10460bd37d32Smrgextern int CursorCol (XtermWidget /* xw */);
10470bd37d32Smrgextern int CursorRow (XtermWidget /* xw */);
1048d522f475Smrgextern void AdjustSavedCursor (XtermWidget /* xw */, int /* adjust */);
10490bd37d32Smrgextern void CarriageReturn (XtermWidget /* xw */);
10500bd37d32Smrgextern void CursorBack (XtermWidget /* xw */, int /* n */);
10510bd37d32Smrgextern void CursorDown (TScreen * /* screen */, int /* n */);
10520bd37d32Smrgextern void CursorForward (XtermWidget /* xw */, int /* n */);
10530bd37d32Smrgextern void CursorNextLine (XtermWidget /* xw */, int /* count */);
10540bd37d32Smrgextern void CursorPrevLine (XtermWidget /* xw */, int /* count */);
1055d522f475Smrgextern void CursorRestore (XtermWidget  /* xw */);
1056d522f475Smrgextern void CursorSave (XtermWidget  /* xw */);
1057d522f475Smrgextern void CursorSet (TScreen * /* screen */, int  /* row */, int  /* col */, unsigned  /* flags */);
1058d522f475Smrgextern void CursorUp (TScreen * /* screen */, int   /* n */);
1059d522f475Smrgextern void RevIndex (XtermWidget /* xw */, int  /* amount */);
1060d522f475Smrgextern void xtermIndex (XtermWidget /* xw */, int  /* amount */);
1061d522f475Smrg
1062d522f475Smrg#if OPT_TRACE
1063d522f475Smrgextern int set_cur_col(TScreen * /* screen */, int  /* value */);
1064d522f475Smrgextern int set_cur_row(TScreen * /* screen */, int  /* value */);
1065d522f475Smrg#else
1066d522f475Smrg#define set_cur_col(screen, value) screen->cur_col = value
1067d522f475Smrg#define set_cur_row(screen, value) screen->cur_row = value
1068d522f475Smrg#endif
1069d522f475Smrg
1070d4fba8b9Smrg/* cursorfont.c */
1071d4fba8b9Smrgextern Cursor CreateAlternateCursorFontCursor(Display * /* dpy */, char const * /* cursorfont */, unsigned int  /* which */);
1072d4fba8b9Smrgextern int CursorFontIndexFromShapeName(char const * /* shapename */);
1073d4fba8b9Smrg
1074d522f475Smrg/* doublechr.c */
1075d522f475Smrgextern void xterm_DECDHL (XtermWidget /* xw */, Bool  /* top */);
1076d522f475Smrgextern void xterm_DECSWL (XtermWidget /* xw */);
1077d522f475Smrgextern void xterm_DECDWL (XtermWidget /* xw */);
10780bd37d32Smrgextern void xterm_ResetDouble(XtermWidget /* xw */);
1079d522f475Smrg#if OPT_DEC_CHRSET
1080d4fba8b9Smrgextern GC xterm_DoubleGC(XTermDraw * /* params */, GC /* old_gc */, int * /* inxp */);
1081d4fba8b9Smrg#if OPT_RENDERFONT
1082d4fba8b9Smrgextern XftFont * xterm_DoubleFT(XTermDraw * /* params */, unsigned /* chrset */, unsigned /* attr_flags */);
1083d4fba8b9Smrgextern void freeall_DoubleFT(XtermWidget /* xw */);
1084d4fba8b9Smrg#endif
1085d522f475Smrg#endif
1086d522f475Smrg
1087d522f475Smrg/* input.c */
1088956cc18dSsnjextern unsigned xtermParamToState (XtermWidget /* xw */, unsigned /* param */);
1089956cc18dSsnjextern unsigned xtermStateToParam (XtermWidget /* xw */, unsigned /* state */);
1090d522f475Smrgextern Bool xtermDeleteIsDEL (XtermWidget /* xw */);
1091d522f475Smrgextern void Input (XtermWidget /* xw */, XKeyEvent */* event */, Bool /* eightbit */);
109220d2c4d2Smrgextern void StringInput (XtermWidget /* xw */, const Char * /* string */, size_t  /* nbytes */);
1093d522f475Smrg
1094d522f475Smrg#if OPT_NUM_LOCK
1095d522f475Smrgextern void VTInitModifiers(XtermWidget /* xw */);
1096d4fba8b9Smrg#else
1097d4fba8b9Smrg#define VTInitModifiers(xw) /* nothing */
1098d522f475Smrg#endif
1099d522f475Smrg
1100956cc18dSsnj/* linedata.c */
1101956cc18dSsnjextern LineData *getLineData(TScreen * /* screen */, int /* row */);
110201037d57Smrgextern void copyLineData(LineData * /* dst */, CLineData * /* src */);
1103956cc18dSsnjextern void initLineData(XtermWidget /* xw */);
1104956cc18dSsnj
1105956cc18dSsnjextern CellData *newCellData(XtermWidget /* xw */, Cardinal /* count */);
1106d4fba8b9Smrgextern void saveCellData(TScreen * /* screen */, CellData * /* data */, Cardinal /* cell */, CLineData * /* ld */, XTermRect * /* limits */, int /* column */);
1107d4fba8b9Smrgextern void restoreCellData(TScreen * /* screen */, const CellData * /* data */, Cardinal /* cell */, LineData * /* ld */, XTermRect * /* limits */, int /* column */);
1108956cc18dSsnj
1109d522f475Smrg/* main.c */
1110d522f475Smrg#define ENVP_ARG /**/
1111d522f475Smrg
1112d522f475Smrgextern int main (int  /* argc */, char ** /* argv */ ENVP_ARG);
1113d522f475Smrgextern int GetBytesAvailable (int  /* fd */);
1114d522f475Smrgextern int kill_process_group (int  /* pid */, int  /* sig */);
1115d522f475Smrgextern int nonblocking_wait (void);
1116d522f475Smrg
1117d522f475Smrg#if OPT_PTY_HANDSHAKE
1118d522f475Smrgextern void first_map_occurred (void);
1119d522f475Smrg#else
1120d522f475Smrg#define first_map_occurred() /* nothing */
1121d522f475Smrg#endif
1122d522f475Smrg
1123913cc679Smrgextern void Exit (int /* n */) GCC_NORETURN;
1124d522f475Smrg
1125d522f475Smrg#ifndef SIG_ATOMIC_T
1126d522f475Smrg#define SIG_ATOMIC_T int
1127d522f475Smrg#endif
1128d522f475Smrg
1129d522f475Smrg#if OPT_WIDE_CHARS
113020d2c4d2Smrgextern unsigned first_widechar;
1131d522f475Smrgextern int (*my_wcwidth)(wchar_t);
1132d522f475Smrg#endif
1133d522f475Smrg
1134d522f475Smrg/* menu.c */
1135d522f475Smrgextern void do_hangup          PROTO_XT_CALLBACK_ARGS;
1136d522f475Smrgextern void repairSizeHints    (void);
1137913cc679Smrgextern void show_8bit_control  (Bool /* value */);
1138d522f475Smrg
1139d522f475Smrg/* misc.c */
1140e39b573cSmrg
1141e39b573cSmrg#define TIMESTAMP_LEN 20	/* length of TIMESTAMP_FMT */
1142e39b573cSmrg
114320d2c4d2Smrgextern Bool AllocateTermColor(XtermWidget, ScrnColors *, int, const char *, Bool);
1144d4fba8b9Smrgextern Boolean allocateBestRGB(XtermWidget /* xw */, XColor * /* def */);
1145d4fba8b9Smrgextern Boolean validProgram(const char * /* pathname */);
11460bd37d32Smrgextern Boolean xtermGetWinAttrs(Display * /* dpy */, Window /* win */, XWindowAttributes * /* attrs */);
11470bd37d32Smrgextern Boolean xtermGetWinProp(Display * /* dpy */, Window /* win */, Atom /* property */, long /* long_offset */, long /* long_length */, Atom /* req_type */, Atom * /* actual_type_return */, int * /* actual_format_return */, unsigned long * /* nitems_return */, unsigned long * /* bytes_after_return */, unsigned char ** /* prop_return */);
1148d4fba8b9Smrgextern Boolean xtermIsIconified (XtermWidget /* xw */);
1149913cc679Smrgextern Cursor make_colored_cursor (unsigned /* cursorindex */, unsigned long /* fg */, unsigned long /* bg */);
1150d4fba8b9Smrgextern FILE * create_printfile(XtermWidget /* xw */, const char * /* suffix */);
1151d522f475Smrgextern OptionHelp * sortedOpts(OptionHelp *, XrmOptionDescRec *, Cardinal);
11520bd37d32Smrgextern String xtermEnvLocale (void);
1153d4fba8b9Smrgextern Widget xtermOpenApplication (XtAppContext * /* app_context_return */, String /* application_class */, XrmOptionDescRec */* options */, Cardinal /* num_options */, int * /* argc_in_out */, char **/* argv_in_out */, String * /* fallback_resources */, WidgetClass /* widget_class */, ArgList /* args */, Cardinal /* num_args */);
1154d4fba8b9Smrgextern Window WMFrameWindow (XtermWidget /* xw */);
11550bd37d32Smrgextern XtInputMask xtermAppPending (void);
11560bd37d32Smrgextern XrmOptionDescRec * sortedOptDescs (XrmOptionDescRec *, Cardinal);
11570bd37d32Smrgextern XtermWidget getXtermWidget (Widget /* w */);
1158894e0ac8Smrgextern char *udk_lookup (XtermWidget /* xw */, int /* keycode */, int * /* len */);
1159d522f475Smrgextern char *xtermEnvEncoding (void);
1160913cc679Smrgextern char *xtermFindShell (char * /* leaf */, Bool /* warning */);
1161d4fba8b9Smrgextern char *xtermFormatSGR (XtermWidget /* xw */, char * /* target */, unsigned /* attrs */, int /* fg */, int /* bg */);
1162d522f475Smrgextern const char *SysErrorMsg (int /* n */);
1163d522f475Smrgextern const char *SysReasonMsg (int /* n */);
11640bd37d32Smrgextern int ResetAnsiColorRequest (XtermWidget, char *, int);
1165d522f475Smrgextern int XStrCmp (char * /* s1 */, char * /* s2 */);
1166913cc679Smrgextern int creat_as (uid_t /* uid */, gid_t /* gid */, Bool /* append */, char * /* pathname */, unsigned /* mode */);
11670bd37d32Smrgextern int getVisualDepth (XtermWidget /* xw */);
1168e0a2b6dfSmrgextern int getVisualInfo (XtermWidget /* xw */);
1169d4fba8b9Smrgextern int ignore_x11_error(Display * /* dpy */, XErrorEvent * /* event */);
1170913cc679Smrgextern int open_userfile (uid_t /* uid */, gid_t /* gid */, char * /* path */, Bool /* append */);
1171d4fba8b9Smrgextern int update_winsize(int /* fd */, int /* rows */, int /* cols */, int /* height */, int /* width */);
1172d522f475Smrgextern int xerror (Display * /* d */, XErrorEvent * /* ev */);
1173d522f475Smrgextern int xioerror (Display * /* dpy */);
11740bd37d32Smrgextern int xtermClosestColor (XtermWidget /* xw */, int /* red */, int /* green */, int /* blue */);
1175913cc679Smrgextern int xtermResetIds (TScreen * /* screen */);
1176913cc679Smrgextern void Bell (XtermWidget /* xw */, int /* which */, int /* percent */);
11770bd37d32Smrgextern void ChangeGroup(XtermWidget /* xw */, const char * /* attribute */, char * /* value */);
1178956cc18dSsnjextern void ChangeIconName (XtermWidget /* xw */, char * /* name */);
1179956cc18dSsnjextern void ChangeTitle (XtermWidget /* xw */, char * /* name */);
1180d522f475Smrgextern void ChangeXprop (char * /* name */);
11810bd37d32Smrgextern void Cleanup (int /* code */) GCC_NORETURN;
1182d522f475Smrgextern void HandleBellPropertyChange   PROTO_XT_EV_HANDLER_ARGS;
1183d522f475Smrgextern void HandleEightBitKeyPressed   PROTO_XT_ACTIONS_ARGS;
1184d522f475Smrgextern void HandleEnterWindow          PROTO_XT_EV_HANDLER_ARGS;
1185d522f475Smrgextern void HandleFocusChange          PROTO_XT_EV_HANDLER_ARGS;
1186d522f475Smrgextern void HandleInterpret            PROTO_XT_ACTIONS_ARGS;
1187d522f475Smrgextern void HandleKeyPressed           PROTO_XT_ACTIONS_ARGS;
1188d522f475Smrgextern void HandleLeaveWindow          PROTO_XT_EV_HANDLER_ARGS;
1189d522f475Smrgextern void HandleSpawnTerminal        PROTO_XT_ACTIONS_ARGS;
1190d522f475Smrgextern void HandleStringEvent          PROTO_XT_ACTIONS_ARGS;
11910bd37d32Smrgextern void NormalExit (void);
1192913cc679Smrgextern void Panic (const char * /* s */, int /* a */);
1193d522f475Smrgextern void Redraw (void);
1194894e0ac8Smrgextern void ReverseOldColors (XtermWidget /* xw */);
1195a1f3da82Smrgextern void SysError (int /* i */) GCC_NORETURN;
1196d522f475Smrgextern void VisualBell (void);
1197e0a2b6dfSmrgextern void cleanup_colored_cursor (void);
1198d4fba8b9Smrgextern void do_ansi_rqm (XtermWidget /* xw */, int /* nparam */, int * /* params */);
1199913cc679Smrgextern void do_dcs (XtermWidget /* xw */, Char * /* buf */, size_t /* len */);
1200d4fba8b9Smrgextern void do_dec_rqm (XtermWidget /* xw */, int /* nparam */, int * /* params */);
1201913cc679Smrgextern void do_osc (XtermWidget /* xw */, Char * /* buf */, size_t /* len */, int /* final */);
1202d4fba8b9Smrgextern void do_xevents (XtermWidget /* xw */);
1203d522f475Smrgextern void end_tek_mode (void);
1204d522f475Smrgextern void end_vt_mode (void);
120501037d57Smrgextern void free_string(String value);
1206d522f475Smrgextern void hide_tek_window (void);
1207d522f475Smrgextern void hide_vt_window (void);
1208d4fba8b9Smrgextern void ice_error (IceConn /* iceConn */) GCC_NORETURN;
12092e4f8982Smrgextern void init_colored_cursor (Display * /* dpy */);
1210894e0ac8Smrgextern void reset_decudk (XtermWidget /* xw */);
1211913cc679Smrgextern void set_tek_visibility (Bool /* on */);
1212913cc679Smrgextern void set_vt_visibility (Bool /* on */);
1213913cc679Smrgextern void switch_modes (Bool /* tovt */);
1214d522f475Smrgextern void timestamp_filename(char * /* dst */, const char * /* src */);
1215d4fba8b9Smrgextern void xevents (XtermWidget /* xw */);
1216e8264990Smrgextern void xt_error (String /* message */) GCC_NORETURN;
1217956cc18dSsnjextern void xtermBell(XtermWidget /* xw */, int /* which */, int /* percent */);
1218d522f475Smrgextern void xtermCopyEnv (char ** /* oldenv */);
1219d522f475Smrgextern void xtermDisplayCursor (XtermWidget /* xw */);
1220d4fba8b9Smrgextern void xtermDeiconify (XtermWidget /* xw */);
12210bd37d32Smrgextern void xtermEmbedWindow (Window /* winToEmbedInfo */);
1222d4fba8b9Smrgextern void xtermIconify (XtermWidget /* xw */);
1223d4fba8b9Smrgextern void xtermLoadIcon (XtermWidget /* xw */, const char * /* icon_hint */);
12240bd37d32Smrgextern void xtermPerror (const char * /*fmt*/,...) GCC_PRINTFLIKE(1,2);
122520d2c4d2Smrgextern void xtermSetenv (const char * /* var */, const char * /* value */);
1226913cc679Smrgextern void xtermSetWinSize (XtermWidget /* xw */);
1227d522f475Smrgextern void xtermShowPointer (XtermWidget /* xw */, Bool /* enable */);
12280bd37d32Smrgextern void xtermUnsetenv (const char * /* var */);
12290bd37d32Smrgextern void xtermWarning (const char * /*fmt*/,...) GCC_PRINTFLIKE(1,2);
1230d522f475Smrg
1231d522f475Smrg#if OPT_DABBREV
1232d522f475Smrgextern void HandleDabbrevExpand        PROTO_XT_ACTIONS_ARGS;
1233d522f475Smrg#endif
1234d522f475Smrg
1235d4fba8b9Smrg#if OPT_DIRECT_COLOR
1236d4fba8b9Smrgextern int getDirectColor(XtermWidget /* xw */, int /* red */, int /* green */, int /* blue */);
1237d4fba8b9Smrg#endif /* OPT_DIRECT_COLOR */
1238d4fba8b9Smrg
1239d4fba8b9Smrg#if USE_DOUBLE_BUFFER
1240d4fba8b9Smrgextern void xtermFlushDbe(XtermWidget /* xw */);
1241d4fba8b9Smrgextern void xtermTimedDbe(XtermWidget /* xw */);
1242d4fba8b9Smrg#define xtermNeedSwap(xw,why)	TScreenOf(xw)->needSwap |= (why)
1243d4fba8b9Smrg#else
1244d4fba8b9Smrg#define xtermFlushDbe(xw)	/* nothing */
1245d4fba8b9Smrg#define xtermTimedDbe(xw)	/* nothing */
1246d4fba8b9Smrg#define xtermNeedSwap(xw,why)	/* nothing */
1247d4fba8b9Smrg#endif /* USE_DOUBLE_BUFFER */
1248d4fba8b9Smrg
12492e4f8982Smrg#if OPT_EXEC_XTERM
12502e4f8982Smrgextern char *ProcGetCWD(pid_t /* pid */);
12512e4f8982Smrg#else
12522e4f8982Smrg#define ProcGetCWD(pid) NULL
12532e4f8982Smrg#endif
12542e4f8982Smrg
1255d522f475Smrg#if OPT_MAXIMIZE
1256d4fba8b9Smrgextern int QueryMaximize (XtermWidget  /* xw */, unsigned * /* width */, unsigned * /* height */);
1257d522f475Smrgextern void HandleDeIconify            PROTO_XT_ACTIONS_ARGS;
1258d522f475Smrgextern void HandleIconify              PROTO_XT_ACTIONS_ARGS;
1259d522f475Smrgextern void HandleMaximize             PROTO_XT_ACTIONS_ARGS;
1260d522f475Smrgextern void HandleRestoreSize          PROTO_XT_ACTIONS_ARGS;
1261d4fba8b9Smrgextern void RequestMaximize (XtermWidget  /* xw */, int  /* maximize */);
1262d4fba8b9Smrg#endif
1263d4fba8b9Smrg
1264d4fba8b9Smrg#if OPT_REPORT_ICONS
1265d4fba8b9Smrgextern void report_icons(const char *fmt,...) GCC_PRINTFLIKE(1,2);
1266d4fba8b9Smrg#define ReportIcons(params)	report_icons params
1267d4fba8b9Smrg#else
1268d4fba8b9Smrg#define ReportIcons(params)	TRACE(params)
1269d522f475Smrg#endif
1270d522f475Smrg
127120d2c4d2Smrg#if OPT_SCROLL_LOCK
127220d2c4d2Smrgextern void GetScrollLock (TScreen * /* screen */);
127320d2c4d2Smrgextern void HandleScrollLock           PROTO_XT_ACTIONS_ARGS;
127420d2c4d2Smrgextern void ShowScrollLock (TScreen * /* screen */, Bool /* enable */);
127520d2c4d2Smrgextern void SetScrollLock (TScreen * /* screen */, Bool /* enable */);
127620d2c4d2Smrgextern void xtermShowLED (TScreen * /* screen */, Cardinal /* led_number */, Bool /* enable */);
127720d2c4d2Smrgextern void xtermClearLEDs (TScreen * /* screen */);
127820d2c4d2Smrg#else
127920d2c4d2Smrg#define ShowScrollLock(screen, enable) /* nothing */
128020d2c4d2Smrg#define SetScrollLock(screen, enable) /* nothing */
128120d2c4d2Smrg#define GetScrollLock(screen) /* nothing */
128220d2c4d2Smrg#endif
128320d2c4d2Smrg
12840bd37d32Smrg#if OPT_SELECTION_OPS
12850bd37d32Smrgextern void HandleExecFormatted        PROTO_XT_ACTIONS_ARGS;
12860bd37d32Smrgextern void HandleExecSelectable       PROTO_XT_ACTIONS_ARGS;
12870bd37d32Smrgextern void HandleInsertFormatted      PROTO_XT_ACTIONS_ARGS;
12880bd37d32Smrgextern void HandleInsertSelectable     PROTO_XT_ACTIONS_ARGS;
12890bd37d32Smrg#endif
12900bd37d32Smrg
12910bd37d32Smrg#if OPT_SESSION_MGT
12920bd37d32Smrgextern void xtermCloseSession (void);
12930bd37d32Smrgextern void xtermOpenSession (void);
12940bd37d32Smrg#else
12950bd37d32Smrg#define xtermCloseSession() /* nothing */
12960bd37d32Smrg#define xtermOpenSession() /* nothing */
12970bd37d32Smrg#endif
12980bd37d32Smrg
1299d522f475Smrg#if OPT_WIDE_CHARS
1300d522f475Smrgextern Bool xtermEnvUTF8(void);
1301d522f475Smrg#else
1302d522f475Smrg#define xtermEnvUTF8() False
1303d522f475Smrg#endif
1304d522f475Smrg
1305d4fba8b9Smrg#if OPT_XTERM_SGR
1306d4fba8b9Smrgextern void xtermPushSGR (XtermWidget /* xw */, int /* value */);
1307d4fba8b9Smrgextern void xtermPopSGR (XtermWidget /* xw */);
1308d4fba8b9Smrgextern void xtermReportSGR (XtermWidget /* xw */, XTermRect * /* value */);
1309d4fba8b9Smrgextern void xtermPushColors (XtermWidget /* xw */, int /* value */);
1310d4fba8b9Smrgextern void xtermPopColors (XtermWidget /* xw */, int /* value */);
1311d4fba8b9Smrgextern void xtermReportColors (XtermWidget /* xw */);
1312d4fba8b9Smrg#endif
1313d4fba8b9Smrg
1314d522f475Smrg#ifdef ALLOWLOGGING
131520d2c4d2Smrgextern void StartLog (XtermWidget /* xw */);
131620d2c4d2Smrgextern void CloseLog (XtermWidget /* xw */);
131720d2c4d2Smrgextern void FlushLog (XtermWidget /* xw */);
1318d522f475Smrg#else
131920d2c4d2Smrg#define FlushLog(xw) /*nothing*/
1320d522f475Smrg#endif
1321d522f475Smrg
1322d522f475Smrg/* print.c */
1323956cc18dSsnjextern Bool xtermHasPrinter (XtermWidget /* xw */);
1324e39b573cSmrgextern PrinterFlags *getPrinterFlags (XtermWidget /* xw */, String * /* params */, Cardinal * /* param_count */);
1325956cc18dSsnjextern int xtermPrinterControl (XtermWidget /* xw */, int /* chr */);
1326956cc18dSsnjextern void setPrinterControlMode (XtermWidget /* xw */, int /* mode */);
1327956cc18dSsnjextern void xtermAutoPrint (XtermWidget /* xw */, unsigned /* chr */);
1328956cc18dSsnjextern void xtermMediaControl (XtermWidget /* xw */, int  /* param */, int  /* private_seq */);
132920d2c4d2Smrgextern void xtermPrintScreen (XtermWidget /* xw */, Bool  /* use_DECPEX */, PrinterFlags * /* p */);
133020d2c4d2Smrgextern void xtermPrintEverything (XtermWidget /* xw */, PrinterFlags * /* p */);
1331e39b573cSmrgextern void xtermPrintImmediately (XtermWidget /* xw */, String /* filename */, int /* opts */, int /* attributes */);
1332e39b573cSmrgextern void xtermPrintOnXError (XtermWidget /* xw */, int /* n */);
1333d522f475Smrg
13342e4f8982Smrg#if OPT_SCREEN_DUMPS
13352e4f8982Smrg/* html.c */
13362e4f8982Smrgextern void xtermDumpHtml (XtermWidget /* xw */);
1337d4fba8b9Smrgextern char *PixelToCSSColor(XtermWidget /* xw */, Pixel /* p */);
13382e4f8982Smrg/* svg.c */
13392e4f8982Smrgextern void xtermDumpSvg (XtermWidget /* xw */);
13402e4f8982Smrg#endif
13412e4f8982Smrg
1342d522f475Smrg/* ptydata.c */
1343d522f475Smrg#ifdef VMS
1344d522f475Smrg#define PtySelect int
1345d522f475Smrg#else
1346d522f475Smrg#define PtySelect fd_set
1347d522f475Smrg#endif
1348d522f475Smrg
1349894e0ac8Smrgextern Bool decodeUtf8 (TScreen * /* screen */, PtyData * /* data */);
135020d2c4d2Smrgextern int readPtyData (XtermWidget /* xw */, PtySelect * /* select_mask */, PtyData * /* data */);
135120d2c4d2Smrgextern void fillPtyData (XtermWidget /* xw */, PtyData * /* data */, const char * /* value */, int  /* length */);
1352d522f475Smrgextern void initPtyData (PtyData ** /* data */);
135320d2c4d2Smrgextern void trimPtyData (XtermWidget /* xw */, PtyData * /* data */);
1354d522f475Smrg
1355d522f475Smrg#ifdef NO_LEAKS
1356d522f475Smrgextern void noleaks_ptydata ( void );
1357d522f475Smrg#endif
1358d522f475Smrg
1359d522f475Smrg#if OPT_WIDE_CHARS
1360d4fba8b9Smrgextern Boolean isValidUTF8 (Char * /* lp */);
1361d522f475Smrgextern Char *convertToUTF8 (Char * /* lp */, unsigned  /* c */);
1362d4fba8b9Smrgextern Char *convertFromUTF8 (Char * /* lp */, unsigned * /* cp */);
1363d522f475Smrgextern IChar nextPtyData (TScreen * /* screen */, PtyData * /* data */);
1364d4fba8b9Smrgextern PtyData * fakePtyData (PtyData * /* result */, Char * /* next */, Char * /* last */);
1365d522f475Smrgextern void switchPtyData (TScreen * /* screen */, int  /* f */);
1366d522f475Smrgextern void writePtyData (int  /* f */, IChar * /* d */, unsigned  /* len */);
1367956cc18dSsnj
1368d4fba8b9Smrg#define morePtyData(screen, data) \
1369956cc18dSsnj	(((data)->last > (data)->next) \
1370956cc18dSsnj	 ? (((screen)->utf8_inparse && !(data)->utf_size) \
1371894e0ac8Smrg	    ? decodeUtf8(screen, data) \
1372956cc18dSsnj	    : True) \
1373956cc18dSsnj	 : False)
1374d4fba8b9Smrg
1375d4fba8b9Smrg#define skipPtyData(data, result) \
1376d4fba8b9Smrg	do { \
1377d4fba8b9Smrg	    result = (data)->utf_data; \
1378d4fba8b9Smrg	    (data)->next += (data)->utf_size; \
1379d4fba8b9Smrg	    (data)->utf_size = 0; \
1380d4fba8b9Smrg	} while (0)
1381d522f475Smrg#else
1382d522f475Smrg#define morePtyData(screen, data) ((data)->last > (data)->next)
1383a1f3da82Smrg#define nextPtyData(screen, data) (IChar) (*((data)->next++) & \
1384a1f3da82Smrg					   (screen->output_eight_bits \
1385a1f3da82Smrg					    ? 0xff \
1386a1f3da82Smrg					    : 0x7f))
1387d522f475Smrg#define writePtyData(f,d,len) v_write(f,d,len)
1388d522f475Smrg#endif
1389d522f475Smrg
1390d522f475Smrg/* screen.c */
13910bd37d32Smrg
13920bd37d32Smrg/*
13930bd37d32Smrg * See http://standards.freedesktop.org/wm-spec/wm-spec-latest.html
13940bd37d32Smrg */
13950bd37d32Smrg#define _NET_WM_STATE_REMOVE	0	/* remove/unset property */
13960bd37d32Smrg#define _NET_WM_STATE_ADD	1	/* add/set property */
13970bd37d32Smrg#define _NET_WM_STATE_TOGGLE	2	/* toggle property */
13980bd37d32Smrg
1399d522f475Smrgextern Bool non_blank_line (TScreen */* screen */, int  /* row */, int  /* col */, int  /* len */);
14000bd37d32Smrgextern Char * allocScrnData (TScreen * /* screen */, unsigned /* nrow */, unsigned /* ncol */);
1401956cc18dSsnjextern ScrnBuf allocScrnBuf (XtermWidget /* xw */, unsigned  /* nrow */, unsigned  /* ncol */, ScrnPtr * /* addr */);
1402956cc18dSsnjextern ScrnBuf scrnHeadAddr (TScreen * /* screen */, ScrnBuf /* base */, unsigned /* offset */);
1403d522f475Smrgextern int ScreenResize (XtermWidget /* xw */, int  /* width */, int  /* height */, unsigned * /* flags */);
1404d522f475Smrgextern size_t ScrnPointers (TScreen * /* screen */, size_t  /* len */);
1405d522f475Smrgextern void ClearBufRows (XtermWidget /* xw */, int  /* first */, int  /* last */);
1406d522f475Smrgextern void ClearCells (XtermWidget /* xw */, int /* flags */, unsigned /* len */, int /* row */, int /* col */);
1407d4fba8b9Smrgextern void CopyCells (TScreen * /* screen */, LineData * /* src */, LineData * /* dst */, int /* col */, int /* len */, Bool /* down */);
14080bd37d32Smrgextern void FullScreen (XtermWidget /* xw */, int /* mode */);
1409d4fba8b9Smrgextern void FreeMarkGCs (XtermWidget /* xw */);
1410956cc18dSsnjextern void ScrnAllocBuf (XtermWidget /* xw */);
1411d522f475Smrgextern void ScrnClearCells (XtermWidget /* xw */, int /* row */, int /* col */, unsigned /* len */);
1412d522f475Smrgextern void ScrnDeleteChar (XtermWidget /* xw */, unsigned  /* n */);
14130bd37d32Smrgextern void ScrnDeleteCol (XtermWidget /* xw */, unsigned  /* n */);
1414956cc18dSsnjextern void ScrnDeleteLine (XtermWidget /* xw */, ScrnBuf  /* sb */, int  /* n */, int  /* last */, unsigned /* where */);
1415d522f475Smrgextern void ScrnDisownSelection (XtermWidget /* xw */);
1416d522f475Smrgextern void ScrnFillRectangle (XtermWidget /* xw */, XTermRect *,  int ,  unsigned /* flags */, Bool /* keepColors */);
1417d522f475Smrgextern void ScrnInsertChar (XtermWidget /* xw */, unsigned  /* n */);
14180bd37d32Smrgextern void ScrnInsertCol (XtermWidget /* xw */, unsigned  /* n */);
1419956cc18dSsnjextern void ScrnInsertLine (XtermWidget /* xw */, ScrnBuf /* sb */, int  /* last */, int  /* where */, unsigned  /* n */);
1420d522f475Smrgextern void ScrnRefresh (XtermWidget /* xw */, int  /* toprow */, int  /* leftcol */, int  /* nrows */, int  /* ncols */, Bool  /* force */);
1421d522f475Smrgextern void ScrnUpdate (XtermWidget /* xw */, int  /* toprow */, int  /* leftcol */, int  /* nrows */, int  /* ncols */, Bool  /* force */);
1422d4fba8b9Smrgextern void ScrnWriteText (XtermWidget /* xw */, IChar * /* str */, unsigned  /* flags */, CellColor /* cur_fg_bg */, unsigned  /* length */);
142301037d57Smrgextern void ShowWrapMarks (XtermWidget /* xw */, int /* row */, CLineData * /* ld */);
1424956cc18dSsnjextern void setupLineData (TScreen * /* screen */, ScrnBuf /* base */, Char * /* data */, unsigned /* nrow */, unsigned /* ncol */);
1425d522f475Smrgextern void xtermParseRect (XtermWidget /* xw */, int, int *, XTermRect *);
1426d522f475Smrg
1427d522f475Smrg#if OPT_TRACE && OPT_TRACE_FLAGS
1428956cc18dSsnjextern int  LineTstFlag(LineData /* ld */, int /* flag */);
1429956cc18dSsnjextern void LineClrFlag(LineData /* ld */, int /* flag */);
1430956cc18dSsnjextern void LineSetFlag(LineData /* ld */, int /* flag */);
1431d522f475Smrg#else
1432d522f475Smrg
1433956cc18dSsnj#define LineFlags(ld)         GetLineFlags(ld)
1434956cc18dSsnj
1435956cc18dSsnj#define LineClrFlag(ld, flag) SetLineFlags(ld, (GetLineFlags(ld) & ~ (flag)))
1436956cc18dSsnj#define LineSetFlag(ld, flag) SetLineFlags(ld, (GetLineFlags(ld) | (flag)))
1437956cc18dSsnj#define LineTstFlag(ld, flag) ((GetLineFlags(ld) & flag) != 0)
1438d522f475Smrg
1439d522f475Smrg#endif /* OPT_TRACE && OPT_TRACE_FLAGS */
1440d522f475Smrg
1441956cc18dSsnj#define LineClrBlinked(ld) LineClrFlag(ld, LINEBLINKED)
1442956cc18dSsnj#define LineSetBlinked(ld) LineSetFlag(ld, LINEBLINKED)
1443956cc18dSsnj#define LineTstBlinked(ld) LineTstFlag(ld, LINEBLINKED)
1444d522f475Smrg
1445956cc18dSsnj#define LineClrWrapped(ld) LineClrFlag(ld, LINEWRAPPED)
1446956cc18dSsnj#define LineSetWrapped(ld) LineSetFlag(ld, LINEWRAPPED)
1447956cc18dSsnj#define LineTstWrapped(ld) LineTstFlag(ld, LINEWRAPPED)
1448d522f475Smrg
1449d522f475Smrg#define ScrnHaveSelection(screen) \
1450d522f475Smrg			((screen)->startH.row != (screen)->endH.row \
1451d522f475Smrg			|| (screen)->startH.col != (screen)->endH.col)
1452d522f475Smrg
14530bd37d32Smrg#define ScrnAreRowsInSelection(screen, first, last) \
1454d522f475Smrg	((last) >= (screen)->startH.row && (first) <= (screen)->endH.row)
1455d522f475Smrg
14560bd37d32Smrg#define ScrnIsRowInSelection(screen, line) \
1457d522f475Smrg	((line) >= (screen)->startH.row && (line) <= (screen)->endH.row)
1458d522f475Smrg
14590bd37d32Smrg#define ScrnHaveRowMargins(screen) \
1460d522f475Smrg			((screen)->top_marg != 0 \
1461d522f475Smrg			|| ((screen)->bot_marg != screen->max_row))
1462d522f475Smrg
14630bd37d32Smrg#define ScrnIsRowInMargins(screen, line) \
1464d522f475Smrg	((line) >= (screen)->top_marg && (line) <= (screen)->bot_marg)
1465d522f475Smrg
14660bd37d32Smrg#define ScrnHaveColMargins(screen) \
14670bd37d32Smrg			((screen)->rgt_marg > (screen)->max_col)
14680bd37d32Smrg
14690bd37d32Smrg#define ScrnIsColInMargins(screen, col) \
14700bd37d32Smrg	((col) >= (screen)->lft_marg && (col) <= (screen)->rgt_marg)
14710bd37d32Smrg
1472d4fba8b9Smrg/*
1473d4fba8b9Smrg * If the vertical scrolling margins are active, they will be something other
1474d4fba8b9Smrg * than the first/last row of the visible screen, as well as being distinct.
1475d4fba8b9Smrg */
1476d4fba8b9Smrg#define IsTopBottomMode(xw)	(ScrnTopMargin(xw) < ScrnBottomMargin(xw))
1477d4fba8b9Smrg#define ScrnTopMargin(xw)	TScreenOf(xw)->top_marg
1478d4fba8b9Smrg#define ScrnBottomMargin(xw)	TScreenOf(xw)->bot_marg
1479d4fba8b9Smrg
1480d4fba8b9Smrg/*
1481d4fba8b9Smrg * Left/right horizontal scrolling margins are only active when DECLRMM is.
1482d4fba8b9Smrg */
14830bd37d32Smrg#define IsLeftRightMode(xw) ((xw)->flags & LEFT_RIGHT)
14840bd37d32Smrg#define ScrnLeftMargin(xw)  (IsLeftRightMode(xw) \
14850bd37d32Smrg			     ? TScreenOf(xw)->lft_marg \
14860bd37d32Smrg			     : 0)
14870bd37d32Smrg#define ScrnRightMargin(xw) (IsLeftRightMode(xw) \
14880bd37d32Smrg			     ? TScreenOf(xw)->rgt_marg \
14890bd37d32Smrg			     : MaxCols(TScreenOf(xw)) - 1)
14900bd37d32Smrg
1491d522f475Smrg#if OPT_DEC_RECTOPS
1492d522f475Smrgextern void ScrnCopyRectangle (XtermWidget /* xw */, XTermRect *, int, int *);
1493d522f475Smrgextern void ScrnMarkRectangle (XtermWidget /* xw */, XTermRect *, Bool, int, int *);
1494d522f475Smrgextern void ScrnWipeRectangle (XtermWidget /* xw */, XTermRect *);
14950bd37d32Smrgextern void xtermCheckRect(XtermWidget /* xw */, int /* nparam */, int */* params */, int * /* result */);
1496d522f475Smrg#endif
1497d522f475Smrg
1498d522f475Smrg#if OPT_WIDE_CHARS
1499d522f475Smrgextern void ChangeToWide(XtermWidget /* xw */);
1500d522f475Smrg#endif
1501d522f475Smrg
1502956cc18dSsnj/* scrollback.c */
1503956cc18dSsnjextern LineData *getScrollback (TScreen * /* screen */, int /* row */);
1504956cc18dSsnjextern LineData *addScrollback (TScreen * /* screen */);
15050bd37d32Smrgextern void deleteScrollback (TScreen * /* screen */);
1506956cc18dSsnj
1507d522f475Smrg/* scrollbar.c */
1508d522f475Smrgextern void DoResizeScreen (XtermWidget /* xw */);
1509d522f475Smrgextern void HandleScrollBack           PROTO_XT_ACTIONS_ARGS;
1510d522f475Smrgextern void HandleScrollForward        PROTO_XT_ACTIONS_ARGS;
1511d4fba8b9Smrgextern void HandleScrollTo             PROTO_XT_ACTIONS_ARGS;
1512d522f475Smrgextern void ResizeScrollBar (XtermWidget  /* xw */);
1513d4fba8b9Smrgextern void ScrollBarDrawThumb (XtermWidget  /* xw */, int /* mode */);
1514d522f475Smrgextern void ScrollBarOff (XtermWidget  /* xw */);
1515956cc18dSsnjextern void ScrollBarOn (XtermWidget  /* xw */, Bool /* init */);
1516d522f475Smrgextern void ScrollBarReverseVideo (Widget  /* scrollWidget */);
1517d522f475Smrgextern void ToggleScrollBar (XtermWidget  /* xw */);
151820d2c4d2Smrgextern void WindowScroll (XtermWidget /* xw */, int  /* top */, Bool /* always */);
1519d522f475Smrg
1520d522f475Smrg#ifdef SCROLLBAR_RIGHT
1521d522f475Smrgextern void updateRightScrollbar(XtermWidget  /* xw */);
1522d522f475Smrg#else
1523d522f475Smrg#define updateRightScrollbar(xw) /* nothing */
1524d522f475Smrg#endif
1525d522f475Smrg
1526d522f475Smrg/* tabs.c */
1527d522f475Smrgextern Bool TabToNextStop (XtermWidget /* xw */);
1528d522f475Smrgextern Bool TabToPrevStop (XtermWidget /* xw */);
1529d4fba8b9Smrgextern void TabClear (Tabs /* tabs */, int /* col */);
1530d4fba8b9Smrgextern void TabReset (Tabs /* tabs */);
1531d4fba8b9Smrgextern void TabSet (Tabs /* tabs */, int /* col */);
1532d4fba8b9Smrgextern void TabZonk (Tabs /* tabs */);
1533d4fba8b9Smrgextern Bool TabIsSet (Tabs /* tabs */, int /* col */);
1534d522f475Smrg
1535d522f475Smrg/* util.c */
1536d4fba8b9Smrgextern Boolean isDefaultBackground (const char * /* name */);
1537d4fba8b9Smrgextern Boolean isDefaultForeground (const char * /* name */);
1538d4fba8b9Smrgextern CgsEnum whichXtermCgs (XtermWidget /* xw */, unsigned /* attr_flags */, Bool /* hilite */);
1539d4fba8b9Smrgextern GC updatedXtermGC (XtermWidget /* xw */, unsigned  /* flags */, CellColor /* fg_bg */, Bool  /* hilite */);
1540d4fba8b9Smrgextern Pixel getXtermBackground (XtermWidget /* xw */, unsigned /* flags */, int /* color */);
1541d4fba8b9Smrgextern Pixel getXtermForeground (XtermWidget /* xw */, unsigned /* flags */, int /* color */);
1542d4fba8b9Smrgextern char * xtermSetLocale (int /* category */, String /* after */);
1543d522f475Smrgextern int ClearInLine (XtermWidget /* xw */, int /* row */, int /* col */, unsigned /* len */);
1544d522f475Smrgextern int HandleExposure (XtermWidget /* xw */, XEvent * /* event */);
15450bd37d32Smrgextern int dimRound (double /* value */);
1546d4fba8b9Smrgextern int drawXtermText (XTermDraw * /* param */, GC /* gc */, int /* x */, int /* y */, const IChar * /* text */, Cardinal /* len */);
1547d4fba8b9Smrgextern int extendedBoolean (const char * /* value */, const FlagList * /* table */, Cardinal /* limit */);
1548d522f475Smrgextern void ChangeColors (XtermWidget  /* xw */, ScrnColors * /* pNew */);
1549d522f475Smrgextern void ClearRight (XtermWidget /* xw */, int /* n */);
1550d522f475Smrgextern void ClearScreen (XtermWidget /* xw */);
1551d522f475Smrgextern void DeleteChar (XtermWidget /* xw */, unsigned /* n */);
1552d522f475Smrgextern void DeleteLine (XtermWidget /* xw */, int /* n */);
1553d522f475Smrgextern void FlushScroll (XtermWidget /* xw */);
1554d522f475Smrgextern void GetColors (XtermWidget  /* xw */, ScrnColors * /* pColors */);
1555d522f475Smrgextern void InsertChar (XtermWidget /* xw */, unsigned /* n */);
1556d522f475Smrgextern void InsertLine (XtermWidget /* xw */, int  /* n */);
1557d522f475Smrgextern void RevScroll (XtermWidget /* xw */, int  /* amount */);
1558d4fba8b9Smrgextern void ReverseVideo (XtermWidget /* xw */);
1559956cc18dSsnjextern void WriteText (XtermWidget /* xw */, IChar * /* str */, Cardinal /* len */);
1560d522f475Smrgextern void decode_keyboard_type (XtermWidget /* xw */, struct XTERM_RESOURCE * /* rp */);
156120d2c4d2Smrgextern void decode_wcwidth (XtermWidget  /* xw */);
15620bd37d32Smrgextern void do_cd_xtra_scroll (XtermWidget /* xw */);
1563d522f475Smrgextern void do_erase_display (XtermWidget /* xw */, int  /* param */, int  /* mode */);
1564d4fba8b9Smrgextern void do_erase_char (XtermWidget /* xw */, int  /* param */, int  /* mode */);
1565d522f475Smrgextern void do_erase_line (XtermWidget /* xw */, int  /* param */, int  /* mode */);
15660bd37d32Smrgextern void do_ti_xtra_scroll (XtermWidget /* xw */);
1567d522f475Smrgextern void getXtermSizeHints (XtermWidget /* xw */);
1568d522f475Smrgextern void recolor_cursor (TScreen * /* screen */, Cursor  /* cursor */, unsigned long  /* fg */, unsigned long  /* bg */);
1569d522f475Smrgextern void resetXtermGC (XtermWidget /* xw */, unsigned  /* flags */, Bool  /* hilite */);
1570d522f475Smrgextern void scrolling_copy_area (XtermWidget /* xw */, int  /* firstline */, int  /* nlines */, int  /* amount */);
1571d522f475Smrgextern void set_keyboard_type (XtermWidget /* xw */, xtermKeyboardType  /* type */, Bool  /* set */);
1572d522f475Smrgextern void toggle_keyboard_type (XtermWidget /* xw */, xtermKeyboardType  /* type */);
1573d522f475Smrgextern void update_keyboard_type (void);
1574d522f475Smrgextern void xtermClear (XtermWidget /* xw */);
1575d4fba8b9Smrgextern void xtermClear2 (XtermWidget /* xw */, int /* x */, int /* y */, unsigned /* width */, unsigned /* height */);
15760bd37d32Smrgextern void xtermColIndex (XtermWidget /* xw */, Bool /* toLeft */);
15770bd37d32Smrgextern void xtermColScroll (XtermWidget /* xw */, int /* amount */, Bool /* toLeft */, int /* at_col */);
1578d522f475Smrgextern void xtermRepaint (XtermWidget /* xw */);
1579d4fba8b9Smrgextern void xtermResetLocale (int /* category */, char * /* before */);
1580d522f475Smrgextern void xtermScroll (XtermWidget /* xw */, int /* amount */);
15810bd37d32Smrgextern void xtermScrollLR (XtermWidget /* xw */, int /* amount */, Bool /* toLeft */);
1582d522f475Smrgextern void xtermSizeHints (XtermWidget  /* xw */, int /* scrollbarWidth */);
1583d522f475Smrg
158401037d57Smrgstruct Xinerama_geometry {
158501037d57Smrg    int x;
158601037d57Smrg    int y;
158701037d57Smrg    unsigned w;
158801037d57Smrg    unsigned h;
158901037d57Smrg    int scr_x;
159001037d57Smrg    int scr_y;
159101037d57Smrg    int scr_w;
159201037d57Smrg    int scr_h;
159301037d57Smrg};
159401037d57Smrgextern int XParseXineramaGeometry(Display * /* display */, char * /* parsestring */, struct Xinerama_geometry * /* ret */);
159501037d57Smrg
1596d522f475Smrg#if OPT_ISO_COLORS
1597d522f475Smrg
1598d4fba8b9Smrgextern Pixel extract_fg (XtermWidget /* xw */, CellColor /* color */, unsigned  /* flags */);
1599d4fba8b9Smrgextern Pixel extract_bg (XtermWidget /* xw */, CellColor /* color */, unsigned  /* flags */);
1600d4fba8b9Smrgextern CellColor makeColorPair (XtermWidget /* xw */);
16010bd37d32Smrgextern void ClearCurBackground (XtermWidget /* xw */, int  /* top */, int  /* left */, unsigned  /* height */, unsigned  /* width */, unsigned /* fw */);
1602d522f475Smrg
1603d4fba8b9Smrg#define xtermColorPair(xw) makeColorPair(xw)
1604d522f475Smrg
1605d522f475Smrg#if OPT_COLOR_RES
160620d2c4d2Smrg#define GET_COLOR_RES(xw, res) xtermGetColorRes(xw, &(res))
1607d522f475Smrg#define SET_COLOR_RES(res,color) (res)->value = color
1608d522f475Smrg#define EQL_COLOR_RES(res,color) (res)->value == color
1609d522f475Smrg#define T_COLOR(v,n) (v)->Tcolors[n].value
161020d2c4d2Smrgextern Pixel xtermGetColorRes(XtermWidget /* xw */, ColorRes * /* res */);
1611d522f475Smrg#else
161220d2c4d2Smrg#define GET_COLOR_RES(xw, res) res
1613d522f475Smrg#define SET_COLOR_RES(res,color) *res = color
1614d522f475Smrg#define EQL_COLOR_RES(res,color) *res == color
1615d522f475Smrg#define T_COLOR(v,n) (v)->Tcolors[n]
1616d522f475Smrg#endif
1617d522f475Smrg
1618956cc18dSsnj#define ExtractForeground(color) (unsigned) GetCellColorFG(color)
1619956cc18dSsnj#define ExtractBackground(color) (unsigned) GetCellColorBG(color)
1620d522f475Smrg
1621d4fba8b9Smrg#if OPT_RENDERFONT
1622d4fba8b9Smrgextern void discardRenderDraw(TScreen * /* screen */);
1623d4fba8b9Smrg#else
1624d4fba8b9Smrg#define discardRenderDraw(screen) /* nothing */
1625d4fba8b9Smrg#endif
1626d4fba8b9Smrg
162701037d57Smrg#if OPT_WIDE_ATTRS
162801037d57Smrg#define MapToWideColorMode(fg, screen, flags) \
162901037d57Smrg	(((screen)->colorITMode && ((flags) & ATR_ITALIC)) \
163001037d57Smrg	 ? COLOR_IT \
163101037d57Smrg	 : fg)
163201037d57Smrg#else
163301037d57Smrg#define MapToWideColorMode(fg, screen, flags) fg
163401037d57Smrg#endif
163501037d57Smrg
163620d2c4d2Smrg#define MapToColorMode(fg, screen, flags) \
163720d2c4d2Smrg	(((screen)->colorBLMode && ((flags) & BLINK)) \
163820d2c4d2Smrg	 ? COLOR_BL \
1639a1f3da82Smrg	 : (((screen)->colorBDMode && ((flags) & BOLD)) \
1640a1f3da82Smrg	    ? COLOR_BD \
1641a1f3da82Smrg	    : (((screen)->colorULMode && ((flags) & UNDERLINE)) \
1642a1f3da82Smrg	       ? COLOR_UL \
164301037d57Smrg	       : MapToWideColorMode(fg, screen, flags))))
164420d2c4d2Smrg
1645d522f475Smrg#define checkVeryBoldAttr(flags, fg, code, attr) \
1646d522f475Smrg	if ((flags & FG_COLOR) != 0 \
1647d522f475Smrg	 && (screen->veryBoldColors & attr) == 0 \
1648d522f475Smrg	 && (flags & attr) != 0 \
1649d522f475Smrg	 && (fg == code)) \
165020d2c4d2Smrg		 UIntClr(flags, attr)
1651d522f475Smrg
165201037d57Smrg#if OPT_WIDE_ATTRS
165301037d57Smrg#define checkVeryBoldWideAttr(flags, fg, it, atr) \
165401037d57Smrg	    checkVeryBoldAttr(flags, fg, it, atr)
165501037d57Smrg#else
165601037d57Smrg#define checkVeryBoldWideAttr(flags, fg, it, atr) (void) flags
165701037d57Smrg#endif
165801037d57Smrg
1659d522f475Smrg#define checkVeryBoldColors(flags, fg) \
1660d522f475Smrg	checkVeryBoldAttr(flags, fg, COLOR_RV, INVERSE); \
1661d522f475Smrg	checkVeryBoldAttr(flags, fg, COLOR_UL, UNDERLINE); \
1662d522f475Smrg	checkVeryBoldAttr(flags, fg, COLOR_BD, BOLD); \
166301037d57Smrg	checkVeryBoldAttr(flags, fg, COLOR_BL, BLINK); \
166401037d57Smrg	checkVeryBoldWideAttr(flags, fg, COLOR_IT, ATR_ITALIC)
1665d522f475Smrg
1666d522f475Smrg#else /* !OPT_ISO_COLORS */
1667d522f475Smrg
166820d2c4d2Smrg#define MapToColorMode(fg, screen, flags) fg
166920d2c4d2Smrg
16700bd37d32Smrg#define ClearCurBackground(xw, top, left, height, width, fw) \
16710bd37d32Smrg	XClearArea (TScreenOf(xw)->display, \
16720bd37d32Smrg		    VDrawable(TScreenOf(xw)), \
16730bd37d32Smrg		    CursorX2(TScreenOf(xw), left, fw), \
1674d4fba8b9Smrg		    CursorY2(TScreenOf(xw), top), \
1675894e0ac8Smrg		    ((width) * (unsigned) fw), \
1676894e0ac8Smrg		    ((height) * (unsigned) FontHeight(TScreenOf(xw))), \
16770bd37d32Smrg		    False)
1678d522f475Smrg
1679894e0ac8Smrg#define extract_fg(xw, color, flags) (unsigned) (xw)->cur_foreground
1680894e0ac8Smrg#define extract_bg(xw, color, flags) (unsigned) (xw)->cur_background
1681d522f475Smrg
1682d522f475Smrg		/* FIXME: Reverse-Video? */
1683d522f475Smrg#define T_COLOR(v,n) (v)->Tcolors[n]
1684d522f475Smrg#define xtermColorPair(xw) 0
1685d522f475Smrg
1686d522f475Smrg#define checkVeryBoldColors(flags, fg) /* nothing */
1687d4fba8b9Smrg#define discardRenderDraw(screen) /* nothing */
1688d522f475Smrg
1689d522f475Smrg#endif	/* OPT_ISO_COLORS */
1690d522f475Smrg
1691d4fba8b9Smrg#define getXtermFG(xw, flags, color) getXtermForeground(xw, flags, color)
1692d4fba8b9Smrg#define getXtermBG(xw, flags, color) getXtermBackground(xw, flags, color)
1693d4fba8b9Smrg
16940bd37d32Smrg#if OPT_ZICONBEEP
16950bd37d32Smrgextern void initZIconBeep(void);
16960bd37d32Smrgextern void resetZIconBeep(XtermWidget /* xw */);
16970bd37d32Smrgextern Boolean showZIconBeep(XtermWidget /* xw */, char * /* name */);
16980bd37d32Smrg#else
16990bd37d32Smrg#define initZIconBeep() /* nothing */
1700d4fba8b9Smrg#define resetZIconBeep(xw) /* nothing */
17010bd37d32Smrg#define showZIconBeep(xw, name) False
17020bd37d32Smrg#endif
17030bd37d32Smrg
1704d522f475Smrg#define XTERM_CELL(row,col)    getXtermCell(screen,     ROW2INX(screen, row), col)
1705d522f475Smrg
1706d522f475Smrgextern unsigned getXtermCell (TScreen * /* screen */, int  /* row */, int  /* col */);
17070bd37d32Smrgextern unsigned getXtermCombining(TScreen * /* screen */, int /* row */, int /* col */, int /* off */);
1708d522f475Smrgextern void putXtermCell (TScreen * /* screen */, int  /* row */, int  /* col */, int  /* ch */);
1709d522f475Smrg
17100bd37d32Smrg#define IsCellCombined(screen, row, col) (getXtermCombining(screen, row, col, 0) != 0)
17110bd37d32Smrg
1712d522f475Smrg#if OPT_HIGHLIGHT_COLOR
1713d522f475Smrg#define isNotForeground(xw, fg, bg, sel) \
171420d2c4d2Smrg		(Boolean) ((sel) != T_COLOR(TScreenOf(xw), TEXT_FG) \
17152eaa94a1Schristos			   && (sel) != (fg) \
17162eaa94a1Schristos			   && (sel) != (bg) \
17172eaa94a1Schristos			   && (sel) != (xw)->dft_foreground)
1718d522f475Smrg#define isNotBackground(xw, fg, bg, sel) \
171920d2c4d2Smrg		(Boolean) ((sel) != T_COLOR(TScreenOf(xw), TEXT_BG) \
17202eaa94a1Schristos			   && (sel) != (fg) \
17212eaa94a1Schristos			   && (sel) != (bg) \
17222eaa94a1Schristos			   && (sel) != (xw)->dft_background)
1723d522f475Smrg#endif
1724d522f475Smrg
1725d522f475Smrg#if OPT_WIDE_CHARS
1726d522f475Smrgextern Boolean isWideControl(unsigned /* ch */);
1727d522f475Smrgextern int DamagedCells(TScreen * /* screen */, unsigned /* n */, int * /* klp */, int * /* krp */, int /* row */, int /* col */);
1728d522f475Smrgextern int DamagedCurCells(TScreen * /* screen */, unsigned /* n */, int * /* klp */, int * /* krp */);
1729d522f475Smrgextern unsigned AsciiEquivs(unsigned /* ch */);
1730d522f475Smrgextern void addXtermCombining (TScreen * /* screen */, int  /* row */, int  /* col */, unsigned  /* ch */);
1731956cc18dSsnjextern void allocXtermChars(ScrnPtr * /* buffer */, Cardinal /* length */);
1732d522f475Smrg#endif
1733d522f475Smrg
1734d522f475Smrg#if OPT_XMC_GLITCH
1735d522f475Smrgextern void Mark_XMC (XtermWidget /* xw */, int  /* param */);
1736d522f475Smrgextern void Jump_XMC (XtermWidget /* xw */);
1737d522f475Smrgextern void Resolve_XMC (XtermWidget /* xw */);
1738d522f475Smrg#endif
1739d522f475Smrg
1740d522f475Smrg#if OPT_WIDE_CHARS
174101037d57Smrgunsigned visual_width(const IChar * /* str */, Cardinal  /* len */);
1742d522f475Smrg#else
1743d522f475Smrg#define visual_width(a, b) (b)
1744d522f475Smrg#endif
1745d522f475Smrg
174601037d57Smrg#define BtoS(b)    ((b) ? "on" : "off")
174701037d57Smrg#define MtoS(b)    (((b) == Maybe) ? "maybe" : BtoS(b))
1748d522f475Smrg#define NonNull(s) ((s) ? (s) : "<null>")
1749d522f475Smrg
175020d2c4d2Smrg#define UIntSet(dst,bits) dst = dst | (unsigned) (bits)
175120d2c4d2Smrg#define UIntClr(dst,bits) dst = dst & (unsigned) ~(bits)
175220d2c4d2Smrg
1753d522f475Smrg#ifdef __cplusplus
1754d522f475Smrg	}
1755d522f475Smrg#endif
1756a1f3da82Smrg/* *INDENT-ON* */
1757d522f475Smrg
1758a1f3da82Smrg#endif /* included_xterm_h */
1759