"Fossies" - the Fresh Open Source Software Archive

Member "xterm-368/xterm.h" (6 Jun 2021, 70188 Bytes) of package /linux/misc/xterm-368.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "xterm.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 367_vs_368.

    1 /* $XTermId: xterm.h,v 1.893 2021/06/06 23:14:40 Stelios.Bounanos Exp $ */
    2 
    3 /*
    4  * Copyright 1999-2020,2021 by Thomas E. Dickey
    5  *
    6  *                         All Rights Reserved
    7  *
    8  * Permission is hereby granted, free of charge, to any person obtaining a
    9  * copy of this software and associated documentation files (the
   10  * "Software"), to deal in the Software without restriction, including
   11  * without limitation the rights to use, copy, modify, merge, publish,
   12  * distribute, sublicense, and/or sell copies of the Software, and to
   13  * permit persons to whom the Software is furnished to do so, subject to
   14  * the following conditions:
   15  *
   16  * The above copyright notice and this permission notice shall be included
   17  * in all copies or substantial portions of the Software.
   18  *
   19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   20  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
   22  * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
   23  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
   24  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
   25  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   26  *
   27  * Except as contained in this notice, the name(s) of the above copyright
   28  * holders shall not be used in advertising or otherwise to promote the
   29  * sale, use or other dealings in this Software without prior written
   30  * authorization.
   31  */
   32 
   33 /*
   34  * Common/useful definitions for XTERM application.
   35  *
   36  * This is also where we put the fallback definitions if we do not build using
   37  * the configure script.
   38  */
   39 #ifndef included_xterm_h
   40 #define included_xterm_h
   41 /* *INDENT-OFF* */
   42 
   43 #ifdef HAVE_CONFIG_H
   44 #include <xtermcfg.h>
   45 #endif
   46 
   47 #undef bcopy
   48 #include <X11/Xos.h>
   49 
   50 #ifndef HAVE_CONFIG_H
   51 
   52 #define HAVE_LIB_XAW 1
   53 
   54 #ifdef CSRG_BASED
   55 /* Get definition of BSD */
   56 #include <sys/param.h>
   57 #endif
   58 
   59 #ifndef DFT_TERMTYPE
   60 #define DFT_TERMTYPE "xterm"
   61 #endif
   62 
   63 #ifndef X_NOT_POSIX
   64 #define HAVE_WAITPID 1
   65 #define HAVE_SYS_WAIT_H 1
   66 #define HAVE_UNISTD_H 1
   67 #endif
   68 
   69 #define HAVE_STDLIB_H 1
   70 
   71 #if defined(sun)
   72 /* errno is declared in <errno.h> */
   73 #else
   74 #define DECL_ERRNO 1
   75 #endif
   76 
   77 #undef DECL_PTSNAME     /* ptsname() is normally in stdlib.h */
   78 
   79 #ifndef NOPUTENV
   80 #define HAVE_PUTENV 1
   81 #endif
   82 
   83 #if defined(CSRG_BASED) || defined(__GNU__) || defined(__minix)
   84 #define USE_POSIX_TERMIOS 1
   85 #endif
   86 
   87 #ifdef __FreeBSD__
   88 #if __FreeBSD_version >= 900000
   89 #define USE_SYSV_UTMP 1
   90 #define UTMPX_FOR_UTMP 1
   91 #define HAVE_UTMP_UT_HOST 1
   92 #define HAVE_UTMP_UT_XTIME 1
   93 #define ut_name ut_user
   94 #define ut_xtime ut_tv.tv_sec
   95 #endif
   96 #endif
   97 
   98 #ifdef __NetBSD__
   99 #if __NetBSD_Version__ >= 106030000 /* 1.6C */
  100 #define BSD_UTMPX 1
  101 #define ut_xtime ut_tv.tv_sec
  102 #endif
  103 #endif
  104 
  105 #if defined(hpux) && !defined(__hpux)
  106 #define __hpux 1        /* HPUX 11.0 does not define this */
  107 #endif
  108 
  109 #if !defined(__SCO__) && (defined(SCO) || defined(sco) || defined(SCO325))
  110 #define __SCO__ 1
  111 #endif
  112 
  113 #ifdef USE_POSIX_TERMIOS
  114 #define HAVE_TERMIOS_H 1
  115 #define HAVE_TCGETATTR 1
  116 #endif
  117 
  118 #if defined(__SCO__) || defined(__UNIXWARE__) || defined(__minix)
  119 #define USE_TERMCAP 1
  120 #endif
  121 
  122 #if defined(UTMP)
  123 #define HAVE_UTMP 1
  124 #endif
  125 
  126 #if (defined(__MVS__) || defined(SVR4) || defined(__SCO__) || defined(BSD_UTMPX)) && !defined(__CYGWIN__)
  127 #define UTMPX_FOR_UTMP 1
  128 #endif
  129 
  130 #if !defined(ISC) && !defined(__QNX__)
  131 #define HAVE_UTMP_UT_HOST 1
  132 #endif
  133 
  134 #if defined(UTMPX_FOR_UTMP) && !(defined(__MVS__) || defined(__hpux) || defined(__FreeBSD__))
  135 #define HAVE_UTMP_UT_SESSION 1
  136 #endif
  137 
  138 #if !(defined(linux) && (!defined(__GLIBC__) || (__GLIBC__ < 2))) && !defined(SVR4) && !defined(__FreeBSD__)
  139 #define ut_xstatus ut_exit.e_exit
  140 #endif
  141 
  142 #if defined(SVR4) || defined(__SCO__) || defined(BSD_UTMPX) || (defined(linux) && defined(__GLIBC__) && (__GLIBC__ >= 2) && !(defined(__powerpc__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0)))
  143 #define HAVE_UTMP_UT_XTIME 1
  144 #endif
  145 
  146 #if defined(linux) || defined(__CYGWIN__)
  147 #define USE_LASTLOG
  148 #define HAVE_LASTLOG_H
  149 #define USE_STRUCT_LASTLOG
  150 #elif defined(BSD) && (BSD >= 199103)
  151 #ifdef BSD_UTMPX
  152 #define USE_LASTLOGX
  153 #elif defined(USE_SYSV_UTMP)
  154 #else
  155 #define USE_LASTLOG
  156 #define USE_STRUCT_LASTLOG
  157 #endif
  158 #endif
  159 
  160 #if defined(__OpenBSD__)
  161 #define DEFDELETE_DEL True
  162 #define DEF_BACKARO_ERASE True
  163 #define DEF_INITIAL_ERASE True
  164 #endif
  165 
  166 #if defined(__SCO__) || defined(__UNIXWARE__)
  167 #define DEFDELETE_DEL True
  168 #define OPT_SCO_FUNC_KEYS 1
  169 #endif
  170 
  171 #if defined(__SCO__) || defined(SVR4) || defined(_POSIX_SOURCE) || defined(__QNX__) || defined(__hpux) || (defined(BSD) && (BSD >= 199103)) || defined(__CYGWIN__)
  172 #define USE_POSIX_WAIT
  173 #endif
  174 
  175 #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)
  176 #define USE_SYSV_UTMP
  177 #endif
  178 
  179 #if defined(__GNU__) || defined(__MVS__) || defined(__osf__)
  180 #define USE_TTY_GROUP
  181 #endif
  182 
  183 #if defined(__CYGWIN__)
  184 #define HAVE_NCURSES_TERM_H 1
  185 #endif
  186 
  187 #ifdef __osf__
  188 #define TTY_GROUP_NAME "terminal"
  189 #endif
  190 
  191 #if defined(__MVS__)
  192 #undef ut_xstatus
  193 #define ut_name ut_user
  194 #define ut_xstatus ut_exit.ut_e_exit
  195 #define ut_xtime ut_tv.tv_sec
  196 #endif
  197 
  198 #if defined(ut_xstatus)
  199 #define HAVE_UTMP_UT_XSTATUS 1
  200 #endif
  201 
  202 #if defined(XKB)
  203 #define HAVE_XKB_BELL_EXT 1
  204 #endif
  205 
  206 #if (defined(SVR4) && !defined(__CYGWIN__)) || defined(linux) || (defined(BSD) && (BSD >= 199103))
  207 #define HAVE_POSIX_SAVED_IDS
  208 #endif
  209 
  210 #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))
  211 #define HAVE_INITGROUPS
  212 #endif
  213 
  214 #endif /* HAVE_CONFIG_H */
  215 
  216 #ifndef HAVE_X11_DECKEYSYM_H
  217 #define HAVE_X11_DECKEYSYM_H 1
  218 #endif
  219 
  220 #ifndef HAVE_X11_SUNKEYSYM_H
  221 #define HAVE_X11_SUNKEYSYM_H 1
  222 #endif
  223 
  224 #ifndef HAVE_X11_XF86KEYSYM_H
  225 #define HAVE_X11_XF86KEYSYM_H 0
  226 #endif
  227 
  228 #if defined(HAVE_X11_EXTENSIONS_XDBE_H) && defined(HAVE_XDBESWAPBUFFERS)
  229 #define USE_DOUBLE_BUFFER 1
  230 #else
  231 #define USE_DOUBLE_BUFFER 0
  232 #endif
  233 
  234 /***====================================================================***/
  235 
  236 /* if compiling with gcc -ansi -pedantic, we must fix POSIX definitions */
  237 #if defined(SVR4) && defined(sun)
  238 #ifndef __EXTENSIONS__
  239 #define __EXTENSIONS__ 1
  240 #endif
  241 #ifndef _POSIX_C_SOURCE
  242 #define _POSIX_C_SOURCE 1
  243 #endif
  244 #endif
  245 
  246 /***====================================================================***/
  247 
  248 #ifdef HAVE_STDLIB_H
  249 #include <stdlib.h>
  250 #else
  251 extern char *calloc();
  252 extern char *getenv();
  253 extern char *malloc();
  254 extern char *realloc();
  255 extern void exit();
  256 extern void free();
  257 #endif
  258 
  259 #ifdef HAVE_UNISTD_H
  260 #include <unistd.h>
  261 #endif
  262 
  263 #ifdef HAVE_SYS_WAIT_H
  264 #include <sys/wait.h>
  265 #endif
  266 
  267 #include <errno.h>
  268 #if defined(DECL_ERRNO) && !defined(errno)
  269 extern int errno;
  270 #endif
  271 
  272 #include <X11/Xlocale.h>
  273 
  274 #ifdef HAVE_STDNORETURN_H
  275 #include <stdnoreturn.h>
  276 #undef GCC_NORETURN
  277 #define GCC_NORETURN STDC_NORETURN
  278 #endif
  279 
  280 /*
  281  * FIXME:  Toggling logging from xterm hangs under Linux 2.0.29 with libc5 if
  282  * we use 'waitpid()', while 'wait()' seems to work properly.
  283  */
  284 #ifdef linux
  285 #undef HAVE_WAITPID
  286 #endif
  287 
  288 #ifndef OPT_WIDE_CHARS
  289 #define OPT_WIDE_CHARS 0
  290 #endif
  291 
  292 #if OPT_WIDE_CHARS
  293 #define HIDDEN_CHAR 0xffff
  294 #endif
  295 
  296 /***====================================================================***/
  297 
  298 #define PROTO_XT_ACTIONS_ARGS \
  299     (Widget w, XEvent *event, String *params, Cardinal *num_params)
  300 
  301 #define PROTO_XT_CALLBACK_ARGS \
  302     (Widget gw, XtPointer closure, XtPointer data)
  303 
  304 #define PROTO_XT_CVT_SELECT_ARGS \
  305     (Widget w, Atom *selection, Atom *target, Atom *type, XtPointer *value, unsigned long *length, int *format)
  306 
  307 #define PROTO_XT_EV_HANDLER_ARGS \
  308     (Widget w, XtPointer closure, XEvent *event, Boolean *cont)
  309 
  310 #define PROTO_XT_SEL_CB_ARGS \
  311     (Widget w, XtPointer client_data, Atom *selection, Atom *type, XtPointer value, unsigned long *length, int *format)
  312 
  313 #include <ptyx.h>
  314 
  315 /***====================================================================***/
  316 
  317 #ifndef GCC_PRINTFLIKE
  318 #ifdef _X_ATTRIBUTE_PRINTF
  319 #define GCC_PRINTFLIKE(f,n) _X_ATTRIBUTE_PRINTF(f,n)
  320 #else
  321 #define GCC_PRINTFLIKE(f,n) /* nothing */
  322 #endif
  323 #endif
  324 
  325 #ifndef GCC_UNUSED
  326 #ifdef _X_UNUSED
  327 #define GCC_UNUSED      _X_UNUSED
  328 #else
  329 #define GCC_UNUSED      /* nothing */
  330 #endif
  331 #endif
  332 
  333 #ifndef GCC_NORETURN
  334 #ifdef _X_NORETURN
  335 #define GCC_NORETURN        _X_NORETURN
  336 #else
  337 #define GCC_NORETURN        /* nothing */
  338 #endif
  339 #endif
  340 
  341 /***====================================================================***/
  342 
  343 #if defined(__GNUC__) && defined(_FORTIFY_SOURCE)
  344 #define USE_IGNORE_RC
  345 #define IGNORE_RC(func) ignore_unused = (int) func
  346 #else
  347 #define IGNORE_RC(func) (void) func
  348 #endif /* gcc workarounds */
  349 #if (XtSpecificationRelease >= 6) && !defined(NO_XPOLL_H) && !defined(sun)
  350 #include <X11/Xpoll.h>
  351 #define USE_XPOLL_H 1
  352 #else
  353 #define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval *)t)
  354 #define XFD_COPYSET(src,dst) memcpy((dst)->fds_bits, (src)->fds_bits, sizeof(fd_set))
  355 #if defined(__MVS__) && !defined(TIME_WITH_SYS_TIME)
  356 #define TIME_WITH_SYS_TIME
  357 #endif
  358 #endif
  359 
  360 #ifdef TIME_WITH_SYS_TIME
  361 # include <sys/time.h>
  362 # include <time.h>
  363 #else
  364 # ifdef HAVE_SYS_TIME_H
  365 #  include <sys/time.h>
  366 # else
  367 #  include <time.h>
  368 # endif
  369 #endif
  370 
  371 /* these may be needed for sig_atomic_t */
  372 #include <sys/types.h>
  373 #include <signal.h>
  374 
  375 #ifdef USE_SYS_SELECT_H
  376 
  377 #if defined(USE_XPOLL_H) && defined(AIXV3) && defined(NFDBITS)
  378 #undef NFDBITS          /* conflict between X11/Xpoll.h and sys/select.h */
  379 #endif
  380 
  381 #include <sys/select.h>
  382 
  383 #endif /* USE_SYS_SELECT_H */
  384 
  385 #include <setjmp.h>
  386 
  387 #if !defined(VMS) && !(defined(linux) && defined(__USE_GNU)) && !defined(__hpux) && !defined(_ALL_SOURCE) && !defined(__osf__)
  388 extern char **environ;
  389 #endif
  390 
  391 #ifndef _Xconst
  392 #define _Xconst const       /* Solaris 7 workaround */
  393 #endif /* _Xconst */
  394 
  395 #define XK_Fn(n)    (XK_F1 + (n) - 1)
  396 
  397 #define Maybe       2
  398 
  399 #define ALLOC_STRING(name) \
  400     if (name != 0) \
  401         name = x_strdup(name)
  402 #define FREE_STRING(name) \
  403         free_string(name)
  404 
  405 /* strftime format and length of the result */
  406 #define FMT_TIMESTAMP ".%Y.%m.%d.%H.%M.%S"
  407 #define LEN_TIMESTAMP sizeof(".YYYY.MM.DD.hh.mm.ss")
  408 
  409 /***====================================================================***/
  410 
  411 #if OPT_TRACE
  412 #undef NDEBUG           /* turn on assert's */
  413 #else
  414 #ifndef NDEBUG
  415 #define NDEBUG          /* not debugging, don't do assert's */
  416 #endif
  417 #endif
  418 
  419 #include <trace.h>
  420 
  421 #if OPT_TRACE && !defined(DEBUG)
  422 #define DEBUG 1
  423 #endif
  424 
  425 #ifdef DEBUG
  426 #define if_DEBUG(code) if(debug) code
  427 #else
  428 #define if_DEBUG(code) /*nothing*/
  429 #endif
  430 
  431 #define DEBUG_MSG(text) if_DEBUG({ IGNORE_RC(write(2, text, sizeof(text) - 1)); })
  432 
  433 /***====================================================================***/
  434 
  435 #define XtNallowBoldFonts   "allowBoldFonts"
  436 #define XtNallowC1Printable "allowC1Printable"
  437 #define XtNallowColorOps    "allowColorOps"
  438 #define XtNallowFontOps     "allowFontOps"
  439 #define XtNallowMouseOps    "allowMouseOps"
  440 #define XtNallowPasteControls   "allowPasteControls"
  441 #define XtNallowScrollLock  "allowScrollLock"
  442 #define XtNallowSendEvents  "allowSendEvents"
  443 #define XtNallowTcapOps     "allowTcapOps"
  444 #define XtNallowTitleOps    "allowTitleOps"
  445 #define XtNallowWindowOps   "allowWindowOps"
  446 #define XtNaltIsNotMeta     "altIsNotMeta"
  447 #define XtNaltSendsEscape   "altSendsEscape"
  448 #define XtNalternateScroll  "alternateScroll"
  449 #define XtNalwaysBoldMode   "alwaysBoldMode"
  450 #define XtNalwaysHighlight  "alwaysHighlight"
  451 #define XtNalwaysUseMods    "alwaysUseMods"
  452 #define XtNanswerbackString "answerbackString"
  453 #define XtNappcursorDefault "appcursorDefault"
  454 #define XtNappkeypadDefault "appkeypadDefault"
  455 #define XtNassumeAllChars   "assumeAllChars"
  456 #define XtNautoWrap     "autoWrap"
  457 #define XtNautoScrollLock   "autoScrollLock"
  458 #define XtNawaitInput       "awaitInput"
  459 #define XtNbackarrowKey     "backarrowKey"
  460 #define XtNbellIsUrgent     "bellIsUrgent"
  461 #define XtNbellOnReset      "bellOnReset"
  462 #define XtNbellSuppressTime "bellSuppressTime"
  463 #define XtNboldColors       "boldColors"
  464 #define XtNboldFont     "boldFont"
  465 #define XtNboldMode     "boldMode"
  466 #define XtNbrokenLinuxOSC   "brokenLinuxOSC"
  467 #define XtNbrokenSelections "brokenSelections"
  468 #define XtNbrokenStringTerm "brokenStringTerm"
  469 #define XtNbuffered     "buffered"
  470 #define XtNbufferedFPS      "bufferedFPS"
  471 #define XtNc132         "c132"
  472 #define XtNcacheDoublesize  "cacheDoublesize"
  473 #define XtNcdXtraScroll     "cdXtraScroll"
  474 #define XtNcharClass        "charClass"
  475 #define XtNchecksumExtension    "checksumExtension"
  476 #define XtNcjkWidth     "cjkWidth"
  477 #define XtNcolorAttrMode    "colorAttrMode"
  478 #define XtNcolorBDMode      "colorBDMode"
  479 #define XtNcolorBLMode      "colorBLMode"
  480 #define XtNcolorITMode      "colorITMode"
  481 #define XtNcolorInnerBorder "colorInnerBorder"
  482 #define XtNcolorMode        "colorMode"
  483 #define XtNcolorRVMode      "colorRVMode"
  484 #define XtNcolorULMode      "colorULMode"
  485 #define XtNcombiningChars   "combiningChars"
  486 #define XtNctrlFKeys        "ctrlFKeys"
  487 #define XtNcurses       "curses"
  488 #define XtNcursorBlink      "cursorBlink"
  489 #define XtNcursorBlinkXOR   "cursorBlinkXOR"
  490 #define XtNcursorColor      "cursorColor"
  491 #define XtNcursorOffTime    "cursorOffTime"
  492 #define XtNcursorOnTime     "cursorOnTime"
  493 #define XtNcursorUnderLine  "cursorUnderLine"
  494 #define XtNcutNewline       "cutNewline"
  495 #define XtNcutToBeginningOfLine "cutToBeginningOfLine"
  496 #define XtNdecGraphicsID    "decGraphicsID"
  497 #define XtNdecTerminalID    "decTerminalID"
  498 #define XtNdefaultString    "defaultString"
  499 #define XtNdeleteIsDEL      "deleteIsDEL"
  500 #define XtNdirectColor      "directColor"
  501 #define XtNdisallowedColorOps   "disallowedColorOps"
  502 #define XtNdisallowedFontOps    "disallowedFontOps"
  503 #define XtNdisallowedMouseOps   "disallowedMouseOps"
  504 #define XtNdisallowedPasteControls "disallowedPasteControls"
  505 #define XtNdisallowedTcapOps    "disallowedTcapOps"
  506 #define XtNdisallowedWindowOps  "disallowedWindowOps"
  507 #define XtNdynamicColors    "dynamicColors"
  508 #define XtNeightBitControl  "eightBitControl"
  509 #define XtNeightBitInput    "eightBitInput"
  510 #define XtNeightBitMeta     "eightBitMeta"
  511 #define XtNeightBitOutput   "eightBitOutput"
  512 #define XtNeightBitSelectTypes  "eightBitSelectTypes"
  513 #define XtNeraseSavedLines  "eraseSavedLines"
  514 #define XtNfaceName     "faceName"
  515 #define XtNfaceNameDoublesize   "faceNameDoublesize"
  516 #define XtNfaceSize     "faceSize"
  517 #define XtNfastScroll       "fastScroll"
  518 #define XtNfont1        "font1"
  519 #define XtNfont2        "font2"
  520 #define XtNfont3        "font3"
  521 #define XtNfont4        "font4"
  522 #define XtNfont5        "font5"
  523 #define XtNfont6        "font6"
  524 #define XtNfont7        "font7"
  525 #define XtNfontDoublesize   "fontDoublesize"
  526 #define XtNfontWarnings     "fontWarnings"
  527 #define XtNforceBoxChars    "forceBoxChars"
  528 #define XtNforcePackedFont  "forcePackedFont"
  529 #define XtNforceXftHeight   "forceXftHeight"
  530 #define XtNformatOtherKeys  "formatOtherKeys"
  531 #define XtNfreeBoldBox      "freeBoldBox"
  532 #define XtNfullscreen       "fullscreen"
  533 #define XtNhighlightColor   "highlightColor"
  534 #define XtNhighlightColorMode   "highlightColorMode"
  535 #define XtNhighlightReverse "highlightReverse"
  536 #define XtNhighlightSelection   "highlightSelection"
  537 #define XtNhighlightTextColor   "highlightTextColor"
  538 #define XtNhpLowerleftBugCompat "hpLowerleftBugCompat"
  539 #define XtNi18nSelections   "i18nSelections"
  540 #define XtNiconHint     "iconHint"
  541 #define XtNinitialFont      "initialFont"
  542 #define XtNinternalBorder   "internalBorder"
  543 #define XtNitalicULMode     "italicULMode"
  544 #define XtNjumpScroll       "jumpScroll"
  545 #define XtNkeepClipboard    "keepClipboard"
  546 #define XtNkeepSelection    "keepSelection"
  547 #define XtNkeyboardDialect  "keyboardDialect"
  548 #define XtNlimitFontsets    "limitFontsets"
  549 #define XtNlimitResize      "limitResize"
  550 #define XtNlimitResponse    "limitResponse"
  551 #define XtNlocale       "locale"
  552 #define XtNlocaleFilter     "localeFilter"
  553 #define XtNlogFile      "logFile"
  554 #define XtNlogInhibit       "logInhibit"
  555 #define XtNlogging      "logging"
  556 #define XtNloginShell       "loginShell"
  557 #define XtNmarginBell       "marginBell"
  558 #define XtNmaxGraphicSize   "maxGraphicSize"
  559 #define XtNmaximized        "maximized"
  560 #define XtNmenuBar      "menuBar"   /* internal */
  561 #define XtNmenuHeight       "menuHeight"
  562 #define XtNmetaSendsEscape  "metaSendsEscape"
  563 #define XtNmkSamplePass     "mkSamplePass"
  564 #define XtNmkSampleSize     "mkSampleSize"
  565 #define XtNmkWidth      "mkWidth"
  566 #define XtNmodifyCursorKeys "modifyCursorKeys"
  567 #define XtNmodifyFunctionKeys   "modifyFunctionKeys"
  568 #define XtNmodifyKeyboard   "modifyKeyboard"
  569 #define XtNmodifyKeypadKeys "modifyKeypadKeys"
  570 #define XtNmodifyOtherKeys  "modifyOtherKeys"
  571 #define XtNmodifyStringKeys "modifyStringKeys"
  572 #define XtNmultiClickTime   "multiClickTime"
  573 #define XtNmultiScroll      "multiScroll"
  574 #define XtNnMarginBell      "nMarginBell"
  575 #define XtNnextEventDelay   "nextEventDelay"
  576 #define XtNnumColorRegisters    "numColorRegisters"
  577 #define XtNnumLock      "numLock"
  578 #define XtNoldXtermFKeys    "oldXtermFKeys"
  579 #define XtNpointerColor     "pointerColor"
  580 #define XtNpointerColorBackground "pointerColorBackground"
  581 #define XtNpointerFont      "pointerFont"
  582 #define XtNpointerMode      "pointerMode"
  583 #define XtNpointerShape     "pointerShape"
  584 #define XtNpopOnBell        "popOnBell"
  585 #define XtNprecompose       "precompose"
  586 #define XtNprintAttributes  "printAttributes"
  587 #define XtNprinterAutoClose "printerAutoClose"
  588 #define XtNprinterCommand   "printerCommand"
  589 #define XtNprinterControlMode   "printerControlMode"
  590 #define XtNprinterExtent    "printerExtent"
  591 #define XtNprinterFormFeed  "printerFormFeed"
  592 #define XtNprinterNewLine   "printerNewLine"
  593 #define XtNprivateColorRegisters "privateColorRegisters"
  594 #define XtNquietGrab        "quietGrab"
  595 #define XtNregisDefaultFont "regisDefaultFont"
  596 #define XtNregisScreenSize  "regisScreenSize"
  597 #define XtNrenderFont       "renderFont"
  598 #define XtNresizeByPixel    "resizeByPixel"
  599 #define XtNresizeGravity    "resizeGravity"
  600 #define XtNretryInputMethod "retryInputMethod"
  601 #define XtNreverseWrap      "reverseWrap"
  602 #define XtNrightScrollBar   "rightScrollBar"
  603 #define XtNsaveLines        "saveLines"
  604 #define XtNscaleHeight      "scaleHeight"
  605 #define XtNscrollBar        "scrollBar"
  606 #define XtNscrollBarBorder  "scrollBarBorder"
  607 #define XtNscrollKey        "scrollKey"
  608 #define XtNscrollLines      "scrollLines"
  609 #define XtNscrollTtyOutput  "scrollTtyOutput"
  610 #define XtNselectToClipboard    "selectToClipboard"
  611 #define XtNshiftEscape      "shiftEscape"
  612 #define XtNshiftFonts       "shiftFonts"
  613 #define XtNshowBlinkAsBold  "showBlinkAsBold"
  614 #define XtNshowMissingGlyphs    "showMissingGlyphs"
  615 #define XtNshowWrapMarks    "showWrapMarks"
  616 #define XtNsignalInhibit    "signalInhibit"
  617 #define XtNsixelScrolling   "sixelScrolling"
  618 #define XtNsixelScrollsRight    "sixelScrollsRight"
  619 #define XtNtekGeometry      "tekGeometry"
  620 #define XtNtekInhibit       "tekInhibit"
  621 #define XtNtekSmall     "tekSmall"
  622 #define XtNtekStartup       "tekStartup"
  623 #define XtNtiXtraScroll     "tiXtraScroll"
  624 #define XtNtiteInhibit      "titeInhibit"
  625 #define XtNtitleModes       "titleModes"
  626 #define XtNtoolBar      "toolBar"
  627 #define XtNtrimSelection    "trimSelection"
  628 #define XtNunderLine        "underLine"
  629 #define XtNuseBorderClipping    "useBorderClipping"
  630 #define XtNuseClipping      "useClipping"
  631 #define XtNutf8         "utf8"
  632 #define XtNutf8Fonts        "utf8Fonts"
  633 #define XtNutf8Latin1       "utf8Latin1"
  634 #define XtNutf8SelectTypes  "utf8SelectTypes"
  635 #define XtNutf8Title        "utf8Title"
  636 #define XtNutf8Weblike      "utf8Weblike"
  637 #define XtNveryBoldColors   "veryBoldColors"
  638 #define XtNvisualBell       "visualBell"
  639 #define XtNvisualBellDelay  "visualBellDelay"
  640 #define XtNvisualBellLine   "visualBellLine"
  641 #define XtNvt100Graphics    "vt100Graphics"
  642 #define XtNwideBoldFont     "wideBoldFont"
  643 #define XtNwideChars        "wideChars"
  644 #define XtNwideFont     "wideFont"
  645 #define XtNximFont      "ximFont"
  646 #define XtNxmcAttributes    "xmcAttributes" /* ncurses-testing */
  647 #define XtNxmcGlitch        "xmcGlitch" /* ncurses-testing */
  648 #define XtNxmcInline        "xmcInline" /* ncurses-testing */
  649 #define XtNxmcMoveSGR       "xmcMoveSGR"    /* ncurses-testing */
  650 
  651 #define XtCAllowBoldFonts   "AllowBoldFonts"
  652 #define XtCAllowC1Printable "AllowC1Printable"
  653 #define XtCAllowColorOps    "AllowColorOps"
  654 #define XtCAllowFontOps     "AllowFontOps"
  655 #define XtCAllowMouseOps    "AllowMouseOps"
  656 #define XtCAllowPasteControls   "AllowPasteControls"
  657 #define XtCAllowScrollLock  "AllowScrollLock"
  658 #define XtCAllowSendEvents  "AllowSendEvents"
  659 #define XtCAllowTcapOps     "AllowTcapOps"
  660 #define XtCAllowTitleOps    "AllowTitleOps"
  661 #define XtCAllowWindowOps   "AllowWindowOps"
  662 #define XtCAltIsNotMeta     "AltIsNotMeta"
  663 #define XtCAltSendsEscape   "AltSendsEscape"
  664 #define XtCAlwaysBoldMode   "AlwaysBoldMode"
  665 #define XtCAlwaysHighlight  "AlwaysHighlight"
  666 #define XtCAlwaysUseMods    "AlwaysUseMods"
  667 #define XtCAnswerbackString "AnswerbackString"
  668 #define XtCAppcursorDefault "AppcursorDefault"
  669 #define XtCAppkeypadDefault "AppkeypadDefault"
  670 #define XtCAssumeAllChars   "AssumeAllChars"
  671 #define XtCAutoWrap     "AutoWrap"
  672 #define XtCAutoScrollLock   "AutoScrollLock"
  673 #define XtCAwaitInput       "AwaitInput"
  674 #define XtCBackarrowKey     "BackarrowKey"
  675 #define XtCBellIsUrgent     "BellIsUrgent"
  676 #define XtCBellOnReset      "BellOnReset"
  677 #define XtCBellSuppressTime "BellSuppressTime"
  678 #define XtCBoldFont     "BoldFont"
  679 #define XtCBoldMode     "BoldMode"
  680 #define XtCBrokenLinuxOSC   "BrokenLinuxOSC"
  681 #define XtCBrokenSelections "BrokenSelections"
  682 #define XtCBrokenStringTerm "BrokenStringTerm"
  683 #define XtCBuffered     "Buffered"
  684 #define XtCBufferedFPS      "BufferedFPS"
  685 #define XtCC132         "C132"
  686 #define XtCCacheDoublesize  "CacheDoublesize"
  687 #define XtCCdXtraScroll     "CdXtraScroll"
  688 #define XtCCharClass        "CharClass"
  689 #define XtCChecksumExtension    "ChecksumExtension"
  690 #define XtCCjkWidth     "CjkWidth"
  691 #define XtCColorAttrMode    "ColorAttrMode"
  692 #define XtCColorInnerBorder "ColorInnerBorder"
  693 #define XtCColorMode        "ColorMode"
  694 #define XtCColumn       "Column"
  695 #define XtCCombiningChars   "CombiningChars"
  696 #define XtCCtrlFKeys        "CtrlFKeys"
  697 #define XtCCurses       "Curses"
  698 #define XtCCursorBlink      "CursorBlink"
  699 #define XtCCursorBlinkXOR   "CursorBlinkXOR"
  700 #define XtCCursorOffTime    "CursorOffTime"
  701 #define XtCCursorOnTime     "CursorOnTime"
  702 #define XtCCursorUnderLine  "CursorUnderLine"
  703 #define XtCCutNewline       "CutNewline"
  704 #define XtCCutToBeginningOfLine "CutToBeginningOfLine"
  705 #define XtCDecGraphicsID    "DecGraphicsID"
  706 #define XtCDecTerminalID    "DecTerminalID"
  707 #define XtCDefaultString    "DefaultString"
  708 #define XtCDeleteIsDEL      "DeleteIsDEL"
  709 #define XtCDirectColor      "DirectColor"
  710 #define XtCDisallowedColorOps   "DisallowedColorOps"
  711 #define XtCDisallowedFontOps    "DisallowedFontOps"
  712 #define XtCDisallowedMouseOps   "DisallowedMouseOps"
  713 #define XtCDisallowedPasteControls "DisallowedPasteControls"
  714 #define XtCDisallowedTcapOps    "DisallowedTcapOps"
  715 #define XtCDisallowedWindowOps  "DisallowedWindowOps"
  716 #define XtCDynamicColors    "DynamicColors"
  717 #define XtCEightBitControl  "EightBitControl"
  718 #define XtCEightBitInput    "EightBitInput"
  719 #define XtCEightBitMeta     "EightBitMeta"
  720 #define XtCEightBitOutput   "EightBitOutput"
  721 #define XtCEightBitSelectTypes  "EightBitSelectTypes"
  722 #define XtCEraseSavedLines  "EraseSavedLines"
  723 #define XtCFaceName     "FaceName"
  724 #define XtCFaceNameDoublesize   "FaceNameDoublesize"
  725 #define XtCFaceSize     "FaceSize"
  726 #define XtCFastScroll       "FastScroll"
  727 #define XtCFont1        "Font1"
  728 #define XtCFont2        "Font2"
  729 #define XtCFont3        "Font3"
  730 #define XtCFont4        "Font4"
  731 #define XtCFont5        "Font5"
  732 #define XtCFont6        "Font6"
  733 #define XtCFont7        "Font7"
  734 #define XtCFontDoublesize   "FontDoublesize"
  735 #define XtCFontWarnings     "FontWarnings"
  736 #define XtCForceBoxChars    "ForceBoxChars"
  737 #define XtCForcePackedFont  "ForcePackedFont"
  738 #define XtCForceXftHeight   "ForceXftHeight"
  739 #define XtCFormatOtherKeys  "FormatOtherKeys"
  740 #define XtCFreeBoldBox      "FreeBoldBox"
  741 #define XtCFullscreen       "Fullscreen"
  742 #define XtCHighlightColorMode   "HighlightColorMode"
  743 #define XtCHighlightReverse "HighlightReverse"
  744 #define XtCHighlightSelection   "HighlightSelection"
  745 #define XtCHpLowerleftBugCompat "HpLowerleftBugCompat"
  746 #define XtCI18nSelections   "I18nSelections"
  747 #define XtCIconHint     "IconHint"
  748 #define XtCInitialFont      "InitialFont"
  749 #define XtCJumpScroll       "JumpScroll"
  750 #define XtCKeepClipboard    "KeepClipboard"
  751 #define XtCKeepSelection    "KeepSelection"
  752 #define XtCKeyboardDialect  "KeyboardDialect"
  753 #define XtCLimitFontsets    "LimitFontsets"
  754 #define XtCLimitResize      "LimitResize"
  755 #define XtCLimitResponse    "LimitResponse"
  756 #define XtCLocale       "Locale"
  757 #define XtCLocaleFilter     "LocaleFilter"
  758 #define XtCLogInhibit       "LogInhibit"
  759 #define XtCLogfile      "Logfile"
  760 #define XtCLogging      "Logging"
  761 #define XtCLoginShell       "LoginShell"
  762 #define XtCMarginBell       "MarginBell"
  763 #define XtCMaxGraphicSize   "MaxGraphicSize"
  764 #define XtCMaximized        "Maximized"
  765 #define XtCMenuBar      "MenuBar"   /* internal */
  766 #define XtCMenuHeight       "MenuHeight"
  767 #define XtCMetaSendsEscape  "MetaSendsEscape"
  768 #define XtCMkSamplePass     "MkSamplePass"
  769 #define XtCMkSampleSize     "MkSampleSize"
  770 #define XtCMkWidth      "MkWidth"
  771 #define XtCModifyCursorKeys "ModifyCursorKeys"
  772 #define XtCModifyFunctionKeys   "ModifyFunctionKeys"
  773 #define XtCModifyKeyboard   "ModifyKeyboard"
  774 #define XtCModifyKeypadKeys "ModifyKeypadKeys"
  775 #define XtCModifyOtherKeys  "ModifyOtherKeys"
  776 #define XtCModifyStringKeys "ModifyStringKeys"
  777 #define XtCMultiClickTime   "MultiClickTime"
  778 #define XtCMultiScroll      "MultiScroll"
  779 #define XtCNextEventDelay   "NextEventDelay"
  780 #define XtCNumColorRegisters    "NumColorRegisters"
  781 #define XtCNumLock      "NumLock"
  782 #define XtCOldXtermFKeys    "OldXtermFKeys"
  783 #define XtCPointerFont      "PointerFont"
  784 #define XtCPointerMode      "PointerMode"
  785 #define XtCPopOnBell        "PopOnBell"
  786 #define XtCPrecompose       "Precompose"
  787 #define XtCPrintAttributes  "PrintAttributes"
  788 #define XtCPrinterAutoClose "PrinterAutoClose"
  789 #define XtCPrinterCommand   "PrinterCommand"
  790 #define XtCPrinterControlMode   "PrinterControlMode"
  791 #define XtCPrinterExtent    "PrinterExtent"
  792 #define XtCPrinterFormFeed  "PrinterFormFeed"
  793 #define XtCPrinterNewLine   "PrinterNewLine"
  794 #define XtCPrivateColorRegisters "PrivateColorRegisters"
  795 #define XtCQuietGrab        "QuietGrab"
  796 #define XtCRegisDefaultFont "RegisDefaultFont"
  797 #define XtCRegisScreenSize  "RegisScreenSize"
  798 #define XtCRenderFont       "RenderFont"
  799 #define XtCResizeByPixel    "ResizeByPixel"
  800 #define XtCResizeGravity    "ResizeGravity"
  801 #define XtCRetryInputMethod "RetryInputMethod"
  802 #define XtCReverseWrap      "ReverseWrap"
  803 #define XtCRightScrollBar   "RightScrollBar"
  804 #define XtCSaveLines        "SaveLines"
  805 #define XtCScaleHeight      "ScaleHeight"
  806 #define XtCScrollBar        "ScrollBar"
  807 #define XtCScrollBarBorder  "ScrollBarBorder"
  808 #define XtCScrollCond       "ScrollCond"
  809 #define XtCScrollLines      "ScrollLines"
  810 #define XtCSelectToClipboard    "SelectToClipboard"
  811 #define XtCShiftEscape      "ShiftEscape"
  812 #define XtCShiftFonts       "ShiftFonts"
  813 #define XtCShowBlinkAsBold  "ShowBlinkAsBold"
  814 #define XtCShowMissingGlyphs    "ShowMissingGlyphs"
  815 #define XtCShowWrapMarks    "ShowWrapMarks"
  816 #define XtCSignalInhibit    "SignalInhibit"
  817 #define XtCSixelScrolling   "SixelScrolling"
  818 #define XtCSixelScrollsRight    "SixelScrollsRight"
  819 #define XtCTekInhibit       "TekInhibit"
  820 #define XtCTekSmall     "TekSmall"
  821 #define XtCTekStartup       "TekStartup"
  822 #define XtCTiXtraScroll     "TiXtraScroll"
  823 #define XtCTiteInhibit      "TiteInhibit"
  824 #define XtCTitleModes       "TitleModes"
  825 #define XtCToolBar      "ToolBar"
  826 #define XtCTrimSelection    "TrimSelection"
  827 #define XtCUnderLine        "UnderLine"
  828 #define XtCUseBorderClipping    "UseBorderClipping"
  829 #define XtCUseClipping      "UseClipping"
  830 #define XtCUtf8         "Utf8"
  831 #define XtCUtf8Fonts        "Utf8Fonts"
  832 #define XtCUtf8Latin1       "Utf8Latin1"
  833 #define XtCUtf8SelectTypes  "Utf8SelectTypes"
  834 #define XtCUtf8Title        "Utf8Title"
  835 #define XtCUtf8Weblike      "Utf8Weblike"
  836 #define XtCVT100Graphics    "VT100Graphics"
  837 #define XtCVeryBoldColors   "VeryBoldColors"
  838 #define XtCVisualBell       "VisualBell"
  839 #define XtCVisualBellDelay  "VisualBellDelay"
  840 #define XtCVisualBellLine   "VisualBellLine"
  841 #define XtCWideBoldFont     "WideBoldFont"
  842 #define XtCWideChars        "WideChars"
  843 #define XtCWideFont     "WideFont"
  844 #define XtCXimFont      "XimFont"
  845 #define XtCXmcAttributes    "XmcAttributes" /* ncurses-testing */
  846 #define XtCXmcGlitch        "XmcGlitch" /* ncurses-testing */
  847 #define XtCXmcInline        "XmcInline" /* ncurses-testing */
  848 #define XtCXmcMoveSGR       "XmcMoveSGR"    /* ncurses-testing */
  849 
  850 #if defined(NO_ACTIVE_ICON) && !defined(XtNgeometry)
  851 #define XtNgeometry     "geometry"
  852 #define XtCGeometry     "Geometry"
  853 #endif
  854 
  855 #if OPT_COLOR_CLASS
  856 #define XtCCursorColor      "CursorColor"
  857 #define XtCPointerColor     "PointerColor"
  858 #define XtCHighlightColor   "HighlightColor"
  859 #define XtCHighlightTextColor   "HighlightTextColor"
  860 #else
  861 #define XtCCursorColor      XtCForeground
  862 #define XtCPointerColor     XtCForeground
  863 #define XtCHighlightColor   XtCForeground
  864 #define XtCHighlightTextColor   XtCBackground
  865 #endif
  866 
  867 /***====================================================================***/
  868 
  869 #ifdef __cplusplus
  870 extern "C" {
  871 #endif
  872 
  873 struct XTERM_RESOURCE;
  874 
  875 /* Tekproc.c */
  876 #if OPT_TEK4014
  877 extern TekWidget getTekWidget(Widget /* w */);
  878 extern int TekGetFontSize (const char * /* param */);
  879 extern int TekInit (void);
  880 extern void ChangeTekColors (TekWidget /* tw */, TScreen * /* screen */, ScrnColors * /* pNew */);
  881 extern void HandleGINInput             PROTO_XT_ACTIONS_ARGS;
  882 extern void TCursorToggle (TekWidget /* tw */, int /* toggle */);
  883 extern void TekCopy (TekWidget /* tw */);
  884 extern void TekEnqMouse (TekWidget /* tw */, int /* c */);
  885 extern void TekExpose (Widget  /* w */, XEvent * /* event */, Region  /* region */);
  886 extern void TekGINoff (TekWidget /* tw */);
  887 extern void TekRefresh (TekWidget /* tw */);
  888 extern void TekRepaint (TekWidget /* xw */);
  889 extern void TekReverseVideo (XtermWidget /* xw */, TekWidget /* tw */);
  890 extern void TekRun (void);
  891 extern void TekSetFontSize (TekWidget /* tw */, Bool /* fromMenu */, int  /* newitem */);
  892 extern void TekSetWinSize (TekWidget /* tw */);
  893 extern void TekSimulatePageButton (TekWidget /* tw */, Bool /* reset */);
  894 #endif
  895 
  896 /* button.c */
  897 #define MotionOff( s, t ) if (!(screen->hide_pointer)) {        \
  898         (s)->event_mask |= ButtonMotionMask;            \
  899         (s)->event_mask &= ~PointerMotionMask;          \
  900         XSelectInput(XtDisplay((t)), XtWindow((t)), (long) (s)->event_mask); }
  901 
  902 #define MotionOn( s, t ) {                      \
  903         (s)->event_mask &= ~ButtonMotionMask;           \
  904         (s)->event_mask |= PointerMotionMask;           \
  905         XSelectInput(XtDisplay((t)), XtWindow((t)), (long) (s)->event_mask); }
  906 
  907 extern Bool SendMousePosition (XtermWidget  /* w */, XEvent*  /* event */);
  908 extern XtermMouseModes okSendMousePos(XtermWidget /* xw */);
  909 extern void DiredButton                PROTO_XT_ACTIONS_ARGS;
  910 extern void DisownSelection (XtermWidget  /* xw */);
  911 extern void UnhiliteSelection (XtermWidget  /* xw */);
  912 extern void HandleCopySelection        PROTO_XT_ACTIONS_ARGS;
  913 extern void HandleInsertSelection      PROTO_XT_ACTIONS_ARGS;
  914 extern void HandleKeyboardSelectEnd    PROTO_XT_ACTIONS_ARGS;
  915 extern void HandleKeyboardSelectExtend PROTO_XT_ACTIONS_ARGS;
  916 extern void HandleKeyboardSelectStart  PROTO_XT_ACTIONS_ARGS;
  917 extern void HandleKeyboardStartExtend  PROTO_XT_ACTIONS_ARGS;
  918 extern void HandlePointerMotion        PROTO_XT_ACTIONS_ARGS;
  919 extern void HandlePointerButton        PROTO_XT_ACTIONS_ARGS;
  920 extern void HandleSelectEnd            PROTO_XT_ACTIONS_ARGS;
  921 extern void HandleSelectExtend         PROTO_XT_ACTIONS_ARGS;
  922 extern void HandleSelectSet            PROTO_XT_ACTIONS_ARGS;
  923 extern void HandleSelectStart          PROTO_XT_ACTIONS_ARGS;
  924 extern void HandleStartExtend          PROTO_XT_ACTIONS_ARGS;
  925 extern void ResizeSelection (TScreen * /* screen */, int  /* rows */, int  /* cols */);
  926 extern void ScrollSelection (TScreen * /* screen */, int  /* amount */,  Bool /* always */);
  927 extern void TrackMouse (XtermWidget /* xw */, int /* func */, CELL * /* start */, int /* firstrow */, int /* lastrow */);
  928 extern void ViButton                   PROTO_XT_ACTIONS_ARGS;
  929 
  930 extern void UnmapSelections (XtermWidget /* xw */);
  931 extern int xtermUtf8ToTextList (XtermWidget /* xw */, XTextProperty * /* text_prop */, char *** /* text_list */, int * /* text_list_count */);
  932 extern void xtermButtonInit (XtermWidget /* xw */);
  933 
  934 #if OPT_DEC_LOCATOR
  935 extern void GetLocatorPosition (XtermWidget  /* w */);
  936 extern void InitLocatorFilter (XtermWidget  /* w */);
  937 #endif  /* OPT_DEC_LOCATOR */
  938 
  939 #if OPT_FOCUS_EVENT
  940 extern void SendFocusButton(XtermWidget /* xw */, XFocusChangeEvent * /* event */);
  941 #else
  942 #define SendFocusBotton(xw, event) /* nothing */
  943 #endif
  944 
  945 #if OPT_PASTE64
  946 extern void AppendToSelectionBuffer (TScreen * /* screen */, unsigned  /* c */, String /* selection */);
  947 extern void ClearSelectionBuffer (TScreen * /* screen */, String /* selection */);
  948 extern void CompleteSelection (XtermWidget  /* xw */, String * /* args */, Cardinal  /* len */);
  949 extern void xtermGetSelection (Widget  /* w */, Time  /* ev_time */, String * /* params */, Cardinal  /* num_params */, Atom * /* targets */);
  950 #endif
  951 
  952 #if OPT_READLINE
  953 extern void ReadLineButton             PROTO_XT_ACTIONS_ARGS;
  954 #endif
  955 
  956 #if OPT_REPORT_CCLASS
  957 extern void report_char_class(XtermWidget);
  958 #endif
  959 
  960 #define IsLatin1(n)  (((n) >= 32 && (n) <= 126) || ((n) >= 160 && (n) <= 255))
  961 
  962 #if OPT_WIDE_CHARS
  963 #define WideCells(n) (((IChar)(n) >= first_widechar) ? my_wcwidth((wchar_t) (n)) : 1)
  964 #define isWideFrg(n) (((n) == HIDDEN_CHAR) || (WideCells((n)) == 2))
  965 #define isWide(n)    (((IChar)(n) >= first_widechar) && isWideFrg(n))
  966 #define CharWidth(n) (((n) < 256) ? (IsLatin1(n) ? 1 : 0) : my_wcwidth((wchar_t) (n)))
  967 #else
  968 #define WideCells(n) 1
  969 #define CharWidth(n) (IsLatin1(n) ? 1 : 0)
  970 #endif
  971 
  972 /* cachedCgs.c */
  973 extern CgsEnum getCgsId(XtermWidget /*xw*/, VTwin * /*cgsWin*/, GC /*gc*/);
  974 extern GC freeCgs(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/);
  975 extern GC getCgsGC(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/);
  976 extern Pixel getCgsBack(XtermWidget /*xw*/, VTwin * /*cgsWin*/, GC /*gc*/);
  977 extern Pixel getCgsFore(XtermWidget /*xw*/, VTwin * /*cgsWin*/, GC /*gc*/);
  978 extern XTermFonts * getCgsFont(XtermWidget /*xw*/, VTwin * /*cgsWin*/, GC /*gc*/);
  979 extern void clrCgsFonts(XtermWidget /*xw*/, VTwin * /*cgsWin*/, XTermFonts * /*font*/);
  980 extern void copyCgs(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*dstCgsId*/, CgsEnum /*srcCgsId*/);
  981 extern void redoCgs(XtermWidget /*xw*/, Pixel /*fg*/, Pixel /*bg*/, CgsEnum /*cgsId*/);
  982 extern void setCgsBack(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, Pixel /*bg*/);
  983 extern void setCgsCSet(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, unsigned /*cset*/);
  984 extern void setCgsFont(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, XTermFonts * /*font*/);
  985 extern void setCgsFont2(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, XTermFonts * /*font*/, unsigned /*which*/);
  986 extern void setCgsFore(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, Pixel /*fg*/);
  987 extern void swapCgs(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*dstCgsId*/, CgsEnum /*srcCgsId*/);
  988 
  989 #ifdef NO_LEAKS
  990 extern void noleaks_cachedCgs (XtermWidget /* xw */);
  991 #endif
  992 
  993 /* charproc.c */
  994 extern Bool CheckBufPtrs (TScreen * /* screen */);
  995 extern Bool set_cursor_gcs (XtermWidget /* xw */);
  996 extern char * vt100ResourceToString (XtermWidget /* xw */, const char * /* name */);
  997 extern int VTInit (XtermWidget /* xw */);
  998 extern void FindFontSelection (XtermWidget /* xw */, const char * /* atom_name */, Bool  /* justprobe */);
  999 extern void HideCursor (XtermWidget /* xw */);
 1000 extern void RestartBlinking(XtermWidget /* xw */);
 1001 extern void ShowCursor (XtermWidget /* xw */);
 1002 extern void SwitchBufPtrs (TScreen * /* screen */, int /* toBuf */);
 1003 extern void ToggleAlternate (XtermWidget /* xw */);
 1004 extern void VTInitTranslations (void);
 1005 extern GCC_NORETURN void VTReset (XtermWidget /* xw */, int /* full */, int /* saved */);
 1006 extern void VTRun (XtermWidget /* xw */);
 1007 extern void dotext (XtermWidget /* xw */, DECNRCM_codes /* charset */, IChar * /* buf */, Cardinal  /* len */);
 1008 extern void getKeymapResources(Widget /* w */, const char * /*mapName */, const char * /* mapClass */, const char * /* type */, void * /* result */, size_t /* size */);
 1009 extern void initBorderGC (XtermWidget /* xw */, VTwin * /* win */);
 1010 extern void lookupSelectUnit(XtermWidget /* xw */, Cardinal /* item */, String /* value */);
 1011 extern void releaseCursorGCs(XtermWidget /*xw*/);
 1012 extern void releaseWindowGCs(XtermWidget /*xw*/, VTwin * /*win*/);
 1013 extern void resetCharsets (TScreen * /* screen */);
 1014 extern void resetMargins (XtermWidget /* xw */);
 1015 extern void restoreCharsets (TScreen * /* screen */, DECNRCM_codes * /* source */);
 1016 extern void saveCharsets (TScreen * /* screen */, DECNRCM_codes * /* target */);
 1017 extern void set_max_col(TScreen *  /* screen */, int  /* cols */);
 1018 extern void set_max_row(TScreen *  /* screen */, int  /* rows */);
 1019 extern void unparse_end (XtermWidget /* xw */);
 1020 extern void unparseputc (XtermWidget /* xw */, int  /* c */);
 1021 extern void unparseputc1 (XtermWidget /* xw */, int  /* c */);
 1022 extern void unparseputn (XtermWidget /* xw */, unsigned /* n */);
 1023 extern void unparseputs (XtermWidget /* xw */, const char * /* s */);
 1024 extern void unparseseq (XtermWidget /* xw */, ANSI * /* ap */);
 1025 extern void v_write (int  /* f */, const Char * /* d */, unsigned  /* len */);
 1026 extern void xtermAddInput (Widget  /* w */);
 1027 extern void xtermDecodeSCS (XtermWidget /* xw */, int /* which */, int /* sgroup */, int /* prefix */, int /* suffix */);
 1028 
 1029 #if OPT_BLINK_CURS
 1030 extern void ToggleCursorBlink(XtermWidget /* xw */);
 1031 #endif
 1032 
 1033 #if OPT_BLINK_TEXT
 1034 extern Bool LineHasBlinking(TScreen * /* screen */, CLineData * /* ld */);
 1035 #endif
 1036 
 1037 #if OPT_INPUT_METHOD
 1038 extern TInput *lookupTInput (XtermWidget /* xw */, Widget /* w */);
 1039 #endif
 1040 
 1041 #if OPT_ISO_COLORS
 1042 extern void SGR_Background (XtermWidget /* xw */, int  /* color */);
 1043 extern void SGR_Foreground (XtermWidget /* xw */, int  /* color */);
 1044 extern void setExtendedColors (XtermWidget /* xw */);
 1045 #endif
 1046 
 1047 #ifdef NO_LEAKS
 1048 extern void noleaks_charproc (void);
 1049 #endif
 1050 
 1051 /* charsets.c */
 1052 extern unsigned xtermCharSetIn (XtermWidget /* xw */, unsigned  /* code */, DECNRCM_codes /* charset */);
 1053 extern int xtermCharSetOut (XtermWidget /* xw */, IChar * /* buf */, IChar * /* ptr */, DECNRCM_codes /* charset */);
 1054 
 1055 /* cursor.c */
 1056 extern int CursorCol (XtermWidget /* xw */);
 1057 extern int CursorRow (XtermWidget /* xw */);
 1058 extern void AdjustSavedCursor (XtermWidget /* xw */, int /* adjust */);
 1059 extern void CarriageReturn (XtermWidget /* xw */);
 1060 extern void CursorBack (XtermWidget /* xw */, int /* n */);
 1061 extern void CursorDown (TScreen * /* screen */, int /* n */);
 1062 extern void CursorForward (XtermWidget /* xw */, int /* n */);
 1063 extern void CursorNextLine (XtermWidget /* xw */, int /* count */);
 1064 extern void CursorPrevLine (XtermWidget /* xw */, int /* count */);
 1065 extern void CursorRestore (XtermWidget  /* xw */);
 1066 extern void CursorSave (XtermWidget  /* xw */);
 1067 extern void CursorSet (TScreen * /* screen */, int  /* row */, int  /* col */, unsigned  /* flags */);
 1068 extern void CursorUp (TScreen * /* screen */, int   /* n */);
 1069 extern void RevIndex (XtermWidget /* xw */, int  /* amount */);
 1070 extern void xtermIndex (XtermWidget /* xw */, int  /* amount */);
 1071 
 1072 #if OPT_TRACE
 1073 extern int set_cur_col(TScreen * /* screen */, int  /* value */);
 1074 extern int set_cur_row(TScreen * /* screen */, int  /* value */);
 1075 #else
 1076 #define set_cur_col(screen, value) screen->cur_col = value
 1077 #define set_cur_row(screen, value) screen->cur_row = value
 1078 #endif
 1079 
 1080 /* cursorfont.c */
 1081 extern Cursor CreateAlternateCursorFontCursor(Display * /* dpy */, char const * /* cursorfont */, unsigned int  /* which */);
 1082 extern int CursorFontIndexFromShapeName(char const * /* shapename */);
 1083 
 1084 /* doublechr.c */
 1085 extern void xterm_DECDHL (XtermWidget /* xw */, Bool  /* top */);
 1086 extern void xterm_DECSWL (XtermWidget /* xw */);
 1087 extern void xterm_DECDWL (XtermWidget /* xw */);
 1088 extern void xterm_ResetDouble(XtermWidget /* xw */);
 1089 #if OPT_DEC_CHRSET
 1090 extern GC xterm_DoubleGC(XTermDraw * /* params */, GC /* old_gc */, int * /* inxp */);
 1091 #if OPT_RENDERFONT
 1092 extern XftFont * xterm_DoubleFT(XTermDraw * /* params */, unsigned /* chrset */, unsigned /* attr_flags */);
 1093 extern void freeall_DoubleFT(XtermWidget /* xw */);
 1094 #endif
 1095 #endif
 1096 
 1097 /* input.c */
 1098 extern unsigned xtermParamToState (XtermWidget /* xw */, unsigned /* param */);
 1099 extern unsigned xtermStateToParam (XtermWidget /* xw */, unsigned /* state */);
 1100 extern Bool xtermDeleteIsDEL (XtermWidget /* xw */);
 1101 extern void Input (XtermWidget /* xw */, XKeyEvent */* event */, Bool /* eightbit */);
 1102 extern void StringInput (XtermWidget /* xw */, const Char * /* string */, size_t  /* nbytes */);
 1103 
 1104 #if OPT_NUM_LOCK
 1105 extern void VTInitModifiers(XtermWidget /* xw */);
 1106 #else
 1107 #define VTInitModifiers(xw) /* nothing */
 1108 #endif
 1109 
 1110 /* linedata.c */
 1111 extern LineData *getLineData(TScreen * /* screen */, int /* row */);
 1112 extern void copyLineData(LineData * /* dst */, CLineData * /* src */);
 1113 extern void initLineData(XtermWidget /* xw */);
 1114 
 1115 extern CellData *newCellData(XtermWidget /* xw */, Cardinal /* count */);
 1116 extern void saveCellData(TScreen * /* screen */, CellData * /* data */, Cardinal /* cell */, CLineData * /* ld */, XTermRect * /* limits */, int /* column */);
 1117 extern void restoreCellData(TScreen * /* screen */, const CellData * /* data */, Cardinal /* cell */, LineData * /* ld */, XTermRect * /* limits */, int /* column */);
 1118 
 1119 /* main.c */
 1120 #define ENVP_ARG /**/
 1121 
 1122 extern int main (int  /* argc */, char ** /* argv */ ENVP_ARG);
 1123 extern int GetBytesAvailable (int  /* fd */);
 1124 extern int kill_process_group (int  /* pid */, int  /* sig */);
 1125 extern int nonblocking_wait (void);
 1126 
 1127 #if OPT_PTY_HANDSHAKE
 1128 extern void first_map_occurred (void);
 1129 #else
 1130 #define first_map_occurred() /* nothing */
 1131 #endif
 1132 
 1133 extern GCC_NORETURN void Exit (int /* n */);
 1134 
 1135 #ifndef SIG_ATOMIC_T
 1136 #define SIG_ATOMIC_T int
 1137 #endif
 1138 
 1139 #if OPT_WIDE_CHARS
 1140 extern unsigned first_widechar;
 1141 extern int (*my_wcwidth)(wchar_t);
 1142 #endif
 1143 
 1144 /* menu.c */
 1145 extern void do_hangup          PROTO_XT_CALLBACK_ARGS;
 1146 extern void repairSizeHints    (void);
 1147 extern void show_8bit_control  (Bool /* value */);
 1148 
 1149 /* misc.c */
 1150 
 1151 #define TIMESTAMP_LEN 20    /* length of TIMESTAMP_FMT */
 1152 
 1153 extern Bool AllocateTermColor(XtermWidget, ScrnColors *, int, const char *, Bool);
 1154 extern Boolean allocateBestRGB(XtermWidget /* xw */, XColor * /* def */);
 1155 extern Boolean validProgram(const char * /* pathname */);
 1156 extern Boolean xtermGetWinAttrs(Display * /* dpy */, Window /* win */, XWindowAttributes * /* attrs */);
 1157 extern 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 */);
 1158 extern Boolean xtermIsIconified (XtermWidget /* xw */);
 1159 extern Cursor make_colored_cursor (unsigned /* cursorindex */, unsigned long /* fg */, unsigned long /* bg */);
 1160 extern FILE * create_printfile(XtermWidget /* xw */, const char * /* suffix */);
 1161 extern OptionHelp * sortedOpts(OptionHelp *, XrmOptionDescRec *, Cardinal);
 1162 extern String xtermEnvLocale (void);
 1163 extern 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 */);
 1164 extern Window WMFrameWindow (XtermWidget /* xw */);
 1165 extern XtInputMask xtermAppPending (void);
 1166 extern XrmOptionDescRec * sortedOptDescs (XrmOptionDescRec *, Cardinal);
 1167 extern XtermWidget getXtermWidget (Widget /* w */);
 1168 extern char *udk_lookup (XtermWidget /* xw */, int /* keycode */, int * /* len */);
 1169 extern char *xtermEnvEncoding (void);
 1170 extern char *xtermFindShell (char * /* leaf */, Bool /* warning */);
 1171 extern char *xtermFormatSGR (XtermWidget /* xw */, char * /* target */, unsigned /* attrs */, int /* fg */, int /* bg */);
 1172 extern const char *SysErrorMsg (int /* n */);
 1173 extern const char *SysReasonMsg (int /* n */);
 1174 extern int ResetAnsiColorRequest (XtermWidget, char *, int);
 1175 extern int XStrCmp (char * /* s1 */, char * /* s2 */);
 1176 extern int creat_as (uid_t /* uid */, gid_t /* gid */, Bool /* append */, char * /* pathname */, unsigned /* mode */);
 1177 extern int getVisualDepth (XtermWidget /* xw */);
 1178 extern int getVisualInfo (XtermWidget /* xw */);
 1179 extern int ignore_x11_error(Display * /* dpy */, XErrorEvent * /* event */);
 1180 extern int open_userfile (uid_t /* uid */, gid_t /* gid */, char * /* path */, Bool /* append */);
 1181 extern int update_winsize(int /* fd */, int /* rows */, int /* cols */, int /* height */, int /* width */);
 1182 extern int xerror (Display * /* d */, XErrorEvent * /* ev */);
 1183 extern int xioerror (Display * /* dpy */);
 1184 extern int xtermClosestColor (XtermWidget /* xw */, int /* red */, int /* green */, int /* blue */);
 1185 extern int xtermResetIds (TScreen * /* screen */);
 1186 extern void Bell (XtermWidget /* xw */, int /* which */, int /* percent */);
 1187 extern void ChangeGroup(XtermWidget /* xw */, const char * /* attribute */, char * /* value */);
 1188 extern void ChangeIconName (XtermWidget /* xw */, char * /* name */);
 1189 extern void ChangeTitle (XtermWidget /* xw */, char * /* name */);
 1190 extern void ChangeXprop (char * /* name */);
 1191 extern GCC_NORETURN void Cleanup (int /* code */);
 1192 extern void HandleBellPropertyChange   PROTO_XT_EV_HANDLER_ARGS;
 1193 extern void HandleEightBitKeyPressed   PROTO_XT_ACTIONS_ARGS;
 1194 extern void HandleEnterWindow          PROTO_XT_EV_HANDLER_ARGS;
 1195 extern void HandleFocusChange          PROTO_XT_EV_HANDLER_ARGS;
 1196 extern void HandleInterpret            PROTO_XT_ACTIONS_ARGS;
 1197 extern void HandleKeyPressed           PROTO_XT_ACTIONS_ARGS;
 1198 extern void HandleLeaveWindow          PROTO_XT_EV_HANDLER_ARGS;
 1199 extern void HandleSpawnTerminal        PROTO_XT_ACTIONS_ARGS;
 1200 extern void HandleStringEvent          PROTO_XT_ACTIONS_ARGS;
 1201 extern void NormalExit (void);
 1202 extern void Panic (const char * /* s */, int /* a */);
 1203 extern void Redraw (void);
 1204 extern void ReverseOldColors (XtermWidget /* xw */);
 1205 extern GCC_NORETURN void SysError (int /* i */);
 1206 extern void VisualBell (void);
 1207 extern void cleanup_colored_cursor (void);
 1208 extern void do_ansi_rqm (XtermWidget /* xw */, int /* nparam */, int * /* params */);
 1209 extern void do_dcs (XtermWidget /* xw */, Char * /* buf */, size_t /* len */);
 1210 extern void do_dec_rqm (XtermWidget /* xw */, int /* nparam */, int * /* params */);
 1211 extern void do_osc (XtermWidget /* xw */, Char * /* buf */, size_t /* len */, int /* final */);
 1212 extern void do_xevents (XtermWidget /* xw */);
 1213 extern void end_tek_mode (void);
 1214 extern void end_vt_mode (void);
 1215 extern void free_string(String value);
 1216 extern void hide_tek_window (void);
 1217 extern void hide_vt_window (void);
 1218 extern GCC_NORETURN void ice_error (IceConn /* iceConn */);
 1219 extern void init_colored_cursor (Display * /* dpy */);
 1220 extern void reset_decudk (XtermWidget /* xw */);
 1221 extern void set_tek_visibility (Bool /* on */);
 1222 extern void set_vt_visibility (Bool /* on */);
 1223 extern void switch_modes (Bool /* tovt */);
 1224 extern void timestamp_filename(char * /* dst */, const char * /* src */);
 1225 extern void xevents (XtermWidget /* xw */);
 1226 extern GCC_NORETURN void xt_error (String /* message */);
 1227 extern void xtermBell(XtermWidget /* xw */, int /* which */, int /* percent */);
 1228 extern void xtermCopyEnv (char ** /* oldenv */);
 1229 extern void xtermDisplayPointer (XtermWidget /* xw */);
 1230 extern void xtermDeiconify (XtermWidget /* xw */);
 1231 extern void xtermEmbedWindow (Window /* winToEmbedInfo */);
 1232 extern void xtermIconify (XtermWidget /* xw */);
 1233 extern void xtermLoadIcon (XtermWidget /* xw */, const char * /* icon_hint */);
 1234 extern void xtermPerror (const char * /*fmt*/,...) GCC_PRINTFLIKE(1,2);
 1235 extern void xtermSetenv (const char * /* var */, const char * /* value */);
 1236 extern void xtermSetupPointer (XtermWidget /* xw */, const char * /* theShape */);
 1237 extern void xtermSetWinSize (XtermWidget /* xw */);
 1238 extern void xtermShowPointer (XtermWidget /* xw */, Bool /* enable */);
 1239 extern void xtermUnsetenv (const char * /* var */);
 1240 extern void xtermWarning (const char * /*fmt*/,...) GCC_PRINTFLIKE(1,2);
 1241 
 1242 #if OPT_DABBREV
 1243 extern void HandleDabbrevExpand        PROTO_XT_ACTIONS_ARGS;
 1244 #endif
 1245 
 1246 #if OPT_DIRECT_COLOR
 1247 extern int getDirectColor(XtermWidget /* xw */, int /* red */, int /* green */, int /* blue */);
 1248 #endif /* OPT_DIRECT_COLOR */
 1249 
 1250 #if USE_DOUBLE_BUFFER
 1251 extern void xtermFlushDbe(XtermWidget /* xw */);
 1252 extern void xtermTimedDbe(XtermWidget /* xw */);
 1253 #define xtermNeedSwap(xw,why)   TScreenOf(xw)->needSwap |= (why)
 1254 #else
 1255 #define xtermFlushDbe(xw)   /* nothing */
 1256 #define xtermTimedDbe(xw)   /* nothing */
 1257 #define xtermNeedSwap(xw,why)   /* nothing */
 1258 #endif /* USE_DOUBLE_BUFFER */
 1259 
 1260 #if OPT_EXEC_XTERM
 1261 extern char *ProcGetCWD(pid_t /* pid */);
 1262 #else
 1263 #define ProcGetCWD(pid) NULL
 1264 #endif
 1265 
 1266 #if OPT_MAXIMIZE
 1267 extern int QueryMaximize (XtermWidget  /* xw */, unsigned * /* width */, unsigned * /* height */);
 1268 extern void HandleDeIconify            PROTO_XT_ACTIONS_ARGS;
 1269 extern void HandleIconify              PROTO_XT_ACTIONS_ARGS;
 1270 extern void HandleMaximize             PROTO_XT_ACTIONS_ARGS;
 1271 extern void HandleRestoreSize          PROTO_XT_ACTIONS_ARGS;
 1272 extern void RequestMaximize (XtermWidget  /* xw */, int  /* maximize */);
 1273 #endif
 1274 
 1275 #if OPT_REPORT_ICONS
 1276 extern void report_icons(const char *fmt,...) GCC_PRINTFLIKE(1,2);
 1277 #define ReportIcons(params) report_icons params
 1278 #else
 1279 #define ReportIcons(params) TRACE(params)
 1280 #endif
 1281 
 1282 #if OPT_SCROLL_LOCK
 1283 extern void GetScrollLock (TScreen * /* screen */);
 1284 extern void HandleScrollLock           PROTO_XT_ACTIONS_ARGS;
 1285 extern void ShowScrollLock (TScreen * /* screen */, Bool /* enable */);
 1286 extern void SetScrollLock (TScreen * /* screen */, Bool /* enable */);
 1287 extern void xtermShowLED (TScreen * /* screen */, Cardinal /* led_number */, Bool /* enable */);
 1288 extern void xtermClearLEDs (TScreen * /* screen */);
 1289 #else
 1290 #define ShowScrollLock(screen, enable) /* nothing */
 1291 #define SetScrollLock(screen, enable) /* nothing */
 1292 #define GetScrollLock(screen) /* nothing */
 1293 #endif
 1294 
 1295 #if OPT_SELECTION_OPS
 1296 extern void HandleExecFormatted        PROTO_XT_ACTIONS_ARGS;
 1297 extern void HandleExecSelectable       PROTO_XT_ACTIONS_ARGS;
 1298 extern void HandleInsertFormatted      PROTO_XT_ACTIONS_ARGS;
 1299 extern void HandleInsertSelectable     PROTO_XT_ACTIONS_ARGS;
 1300 #endif
 1301 
 1302 #if OPT_SESSION_MGT
 1303 extern void xtermCloseSession (void);
 1304 extern void xtermOpenSession (void);
 1305 extern void xtermUpdateRestartCommand(XtermWidget /* xw */);
 1306 #else
 1307 #define xtermCloseSession() /* nothing */
 1308 #define xtermOpenSession() /* nothing */
 1309 #define xtermUpdateRestartCommand(xw) /* nothing */
 1310 #endif
 1311 
 1312 #if OPT_WIDE_CHARS
 1313 extern Bool xtermEnvUTF8(void);
 1314 #else
 1315 #define xtermEnvUTF8() False
 1316 #endif
 1317 
 1318 #if OPT_XTERM_SGR
 1319 extern void xtermPushSGR (XtermWidget /* xw */, int /* value */);
 1320 extern void xtermPopSGR (XtermWidget /* xw */);
 1321 extern void xtermReportSGR (XtermWidget /* xw */, XTermRect * /* value */);
 1322 extern void xtermPushColors (XtermWidget /* xw */, int /* value */);
 1323 extern void xtermPopColors (XtermWidget /* xw */, int /* value */);
 1324 extern void xtermReportColors (XtermWidget /* xw */);
 1325 #endif
 1326 
 1327 #ifdef ALLOWLOGGING
 1328 extern void StartLog (XtermWidget /* xw */);
 1329 extern void CloseLog (XtermWidget /* xw */);
 1330 extern void FlushLog (XtermWidget /* xw */);
 1331 #else
 1332 #define FlushLog(xw) /*nothing*/
 1333 #endif
 1334 
 1335 /* print.c */
 1336 extern Bool xtermHasPrinter (XtermWidget /* xw */);
 1337 extern PrinterFlags *getPrinterFlags (XtermWidget /* xw */, String * /* params */, Cardinal * /* param_count */);
 1338 extern int xtermPrinterControl (XtermWidget /* xw */, int /* chr */);
 1339 extern void setPrinterControlMode (XtermWidget /* xw */, int /* mode */);
 1340 extern void xtermAutoPrint (XtermWidget /* xw */, unsigned /* chr */);
 1341 extern void xtermMediaControl (XtermWidget /* xw */, int  /* param */, int  /* private_seq */);
 1342 extern void xtermPrintScreen (XtermWidget /* xw */, Bool  /* use_DECPEX */, PrinterFlags * /* p */);
 1343 extern void xtermPrintEverything (XtermWidget /* xw */, PrinterFlags * /* p */);
 1344 extern void xtermPrintImmediately (XtermWidget /* xw */, String /* filename */, int /* opts */, int /* attributes */);
 1345 extern void xtermPrintOnXError (XtermWidget /* xw */, int /* n */);
 1346 
 1347 #if OPT_SCREEN_DUMPS
 1348 /* html.c */
 1349 extern void xtermDumpHtml (XtermWidget /* xw */);
 1350 extern char *PixelToCSSColor(XtermWidget /* xw */, Pixel /* p */);
 1351 /* svg.c */
 1352 extern void xtermDumpSvg (XtermWidget /* xw */);
 1353 #endif
 1354 
 1355 /* ptydata.c */
 1356 #ifdef VMS
 1357 #define PtySelect int
 1358 #else
 1359 #define PtySelect fd_set
 1360 #endif
 1361 
 1362 extern Bool decodeUtf8 (TScreen * /* screen */, PtyData * /* data */);
 1363 extern int readPtyData (XtermWidget /* xw */, PtySelect * /* select_mask */, PtyData * /* data */);
 1364 extern void fillPtyData (XtermWidget /* xw */, PtyData * /* data */, const char * /* value */, int  /* length */);
 1365 extern void initPtyData (PtyData ** /* data */);
 1366 extern void trimPtyData (XtermWidget /* xw */, PtyData * /* data */);
 1367 
 1368 #ifdef NO_LEAKS
 1369 extern void noleaks_ptydata ( void );
 1370 #endif
 1371 
 1372 #if OPT_WIDE_CHARS
 1373 extern Boolean isValidUTF8 (Char * /* lp */);
 1374 extern Char *convertToUTF8 (Char * /* lp */, unsigned  /* c */);
 1375 extern Char *convertFromUTF8 (Char * /* lp */, unsigned * /* cp */);
 1376 extern IChar nextPtyData (TScreen * /* screen */, PtyData * /* data */);
 1377 extern PtyData * fakePtyData (PtyData * /* result */, Char * /* next */, Char * /* last */);
 1378 extern void switchPtyData (TScreen * /* screen */, int  /* f */);
 1379 extern void writePtyData (int  /* f */, IChar * /* d */, unsigned  /* len */);
 1380 
 1381 #define morePtyData(screen, data) \
 1382     (((data)->last > (data)->next) \
 1383      ? (((screen)->utf8_inparse && !(data)->utf_size) \
 1384         ? decodeUtf8(screen, data) \
 1385         : True) \
 1386      : False)
 1387 
 1388 #define skipPtyData(data, result) \
 1389     do { \
 1390         result = (data)->utf_data; \
 1391         (data)->next += (data)->utf_size; \
 1392         (data)->utf_size = 0; \
 1393     } while (0)
 1394 #else
 1395 #define morePtyData(screen, data) ((data)->last > (data)->next)
 1396 #define nextPtyData(screen, data) (IChar) (*((data)->next++) & \
 1397                        (screen->output_eight_bits \
 1398                         ? 0xff \
 1399                         : 0x7f))
 1400 #define writePtyData(f,d,len) v_write(f,d,len)
 1401 #endif
 1402 
 1403 /* screen.c */
 1404 
 1405 /*
 1406  * See http://standards.freedesktop.org/wm-spec/wm-spec-latest.html
 1407  */
 1408 #define _NET_WM_STATE_REMOVE    0   /* remove/unset property */
 1409 #define _NET_WM_STATE_ADD   1   /* add/set property */
 1410 #define _NET_WM_STATE_TOGGLE    2   /* toggle property */
 1411 
 1412 extern Bool non_blank_line (TScreen */* screen */, int  /* row */, int  /* col */, int  /* len */);
 1413 extern Char * allocScrnData (TScreen * /* screen */, unsigned /* nrow */, unsigned /* ncol */);
 1414 extern ScrnBuf allocScrnBuf (XtermWidget /* xw */, unsigned  /* nrow */, unsigned  /* ncol */, ScrnPtr * /* addr */);
 1415 extern ScrnBuf scrnHeadAddr (TScreen * /* screen */, ScrnBuf /* base */, unsigned /* offset */);
 1416 extern int ScreenResize (XtermWidget /* xw */, int  /* width */, int  /* height */, unsigned * /* flags */);
 1417 extern size_t ScrnPointers (TScreen * /* screen */, size_t  /* len */);
 1418 extern void ClearBufRows (XtermWidget /* xw */, int  /* first */, int  /* last */);
 1419 extern void ClearCells (XtermWidget /* xw */, int /* flags */, unsigned /* len */, int /* row */, int /* col */);
 1420 extern void CopyCells (TScreen * /* screen */, LineData * /* src */, LineData * /* dst */, int /* col */, int /* len */, Bool /* down */);
 1421 extern void FullScreen (XtermWidget /* xw */, int /* mode */);
 1422 extern void FreeMarkGCs (XtermWidget /* xw */);
 1423 extern void ScrnAllocBuf (XtermWidget /* xw */);
 1424 extern void ScrnClearCells (XtermWidget /* xw */, int /* row */, int /* col */, unsigned /* len */);
 1425 extern void ScrnDeleteChar (XtermWidget /* xw */, unsigned  /* n */);
 1426 extern void ScrnDeleteCol (XtermWidget /* xw */, unsigned  /* n */);
 1427 extern void ScrnDeleteLine (XtermWidget /* xw */, ScrnBuf  /* sb */, int  /* n */, int  /* last */, unsigned /* where */);
 1428 extern void ScrnDisownSelection (XtermWidget /* xw */);
 1429 extern void ScrnFillRectangle (XtermWidget /* xw */, XTermRect *,  int ,  unsigned /* flags */, Bool /* keepColors */);
 1430 extern void ScrnInsertChar (XtermWidget /* xw */, unsigned  /* n */);
 1431 extern void ScrnInsertCol (XtermWidget /* xw */, unsigned  /* n */);
 1432 extern void ScrnInsertLine (XtermWidget /* xw */, ScrnBuf /* sb */, int  /* last */, int  /* where */, unsigned  /* n */);
 1433 extern void ScrnRefresh (XtermWidget /* xw */, int  /* toprow */, int  /* leftcol */, int  /* nrows */, int  /* ncols */, Bool  /* force */);
 1434 extern void ScrnUpdate (XtermWidget /* xw */, int  /* toprow */, int  /* leftcol */, int  /* nrows */, int  /* ncols */, Bool  /* force */);
 1435 extern void ScrnWriteText (XtermWidget /* xw */, IChar * /* str */, unsigned  /* flags */, CellColor /* cur_fg_bg */, unsigned  /* length */);
 1436 extern void ShowWrapMarks (XtermWidget /* xw */, int /* row */, CLineData * /* ld */);
 1437 extern void setupLineData (TScreen * /* screen */, ScrnBuf /* base */, Char * /* data */, unsigned /* nrow */, unsigned /* ncol */);
 1438 extern void xtermParseRect (XtermWidget /* xw */, int, int *, XTermRect *);
 1439 
 1440 #if OPT_TRACE && OPT_TRACE_FLAGS
 1441 extern int  LineTstFlag(LineData /* ld */, int /* flag */);
 1442 extern void LineClrFlag(LineData /* ld */, int /* flag */);
 1443 extern void LineSetFlag(LineData /* ld */, int /* flag */);
 1444 #else
 1445 
 1446 #define LineFlags(ld)         GetLineFlags(ld)
 1447 
 1448 #define LineClrFlag(ld, flag) SetLineFlags(ld, (GetLineFlags(ld) & ~ (flag)))
 1449 #define LineSetFlag(ld, flag) SetLineFlags(ld, (GetLineFlags(ld) | (flag)))
 1450 #define LineTstFlag(ld, flag) ((GetLineFlags(ld) & flag) != 0)
 1451 
 1452 #endif /* OPT_TRACE && OPT_TRACE_FLAGS */
 1453 
 1454 #define LineClrBlinked(ld) LineClrFlag(ld, LINEBLINKED)
 1455 #define LineSetBlinked(ld) LineSetFlag(ld, LINEBLINKED)
 1456 #define LineTstBlinked(ld) LineTstFlag(ld, LINEBLINKED)
 1457 
 1458 #define LineClrWrapped(ld) LineClrFlag(ld, LINEWRAPPED)
 1459 #define LineSetWrapped(ld) LineSetFlag(ld, LINEWRAPPED)
 1460 #define LineTstWrapped(ld) LineTstFlag(ld, LINEWRAPPED)
 1461 
 1462 #define ScrnHaveSelection(screen) \
 1463             ((screen)->startH.row != (screen)->endH.row \
 1464             || (screen)->startH.col != (screen)->endH.col)
 1465 
 1466 #define ScrnAreRowsInSelection(screen, first, last) \
 1467     ((last) >= (screen)->startH.row && (first) <= (screen)->endH.row)
 1468 
 1469 #define ScrnIsRowInSelection(screen, line) \
 1470     ((line) >= (screen)->startH.row && (line) <= (screen)->endH.row)
 1471 
 1472 #define ScrnHaveRowMargins(screen) \
 1473             ((screen)->top_marg != 0 \
 1474             || ((screen)->bot_marg != screen->max_row))
 1475 
 1476 #define ScrnIsRowInMargins(screen, line) \
 1477     ((line) >= (screen)->top_marg && (line) <= (screen)->bot_marg)
 1478 
 1479 #define ScrnHaveColMargins(screen) \
 1480             ((screen)->rgt_marg > (screen)->max_col)
 1481 
 1482 #define ScrnIsColInMargins(screen, col) \
 1483     ((col) >= (screen)->lft_marg && (col) <= (screen)->rgt_marg)
 1484 
 1485 /*
 1486  * If the vertical scrolling margins are active, they will be something other
 1487  * than the first/last row of the visible screen, as well as being distinct.
 1488  */
 1489 #define IsTopBottomMode(xw) (ScrnTopMargin(xw) < ScrnBottomMargin(xw))
 1490 #define ScrnTopMargin(xw)   TScreenOf(xw)->top_marg
 1491 #define ScrnBottomMargin(xw)    TScreenOf(xw)->bot_marg
 1492 
 1493 /*
 1494  * Left/right horizontal scrolling margins are only active when DECLRMM is.
 1495  */
 1496 #define IsLeftRightMode(xw) ((xw)->flags & LEFT_RIGHT)
 1497 #define ScrnLeftMargin(xw)  (IsLeftRightMode(xw) \
 1498                  ? TScreenOf(xw)->lft_marg \
 1499                  : 0)
 1500 #define ScrnRightMargin(xw) (IsLeftRightMode(xw) \
 1501                  ? TScreenOf(xw)->rgt_marg \
 1502                  : MaxCols(TScreenOf(xw)) - 1)
 1503 
 1504 #if OPT_DEC_RECTOPS
 1505 extern void ScrnCopyRectangle (XtermWidget /* xw */, XTermRect *, int, int *);
 1506 extern void ScrnMarkRectangle (XtermWidget /* xw */, XTermRect *, Bool, int, int *);
 1507 extern void ScrnWipeRectangle (XtermWidget /* xw */, XTermRect *);
 1508 extern void xtermCheckRect(XtermWidget /* xw */, int /* nparam */, int */* params */, int * /* result */);
 1509 #endif
 1510 
 1511 #if OPT_WIDE_CHARS
 1512 extern void ChangeToWide(XtermWidget /* xw */);
 1513 #endif
 1514 
 1515 /* scrollback.c */
 1516 extern LineData *getScrollback (TScreen * /* screen */, int /* row */);
 1517 extern LineData *addScrollback (TScreen * /* screen */);
 1518 extern void deleteScrollback (TScreen * /* screen */);
 1519 
 1520 /* scrollbar.c */
 1521 extern void DoResizeScreen (XtermWidget /* xw */);
 1522 extern void HandleScrollBack           PROTO_XT_ACTIONS_ARGS;
 1523 extern void HandleScrollForward        PROTO_XT_ACTIONS_ARGS;
 1524 extern void HandleScrollTo             PROTO_XT_ACTIONS_ARGS;
 1525 extern void ResizeScrollBar (XtermWidget  /* xw */);
 1526 extern void ScrollBarDrawThumb (XtermWidget  /* xw */, int /* mode */);
 1527 extern void ScrollBarOff (XtermWidget  /* xw */);
 1528 extern void ScrollBarOn (XtermWidget  /* xw */, Bool /* init */);
 1529 extern void ScrollBarReverseVideo (Widget  /* scrollWidget */);
 1530 extern void ToggleScrollBar (XtermWidget  /* xw */);
 1531 extern void WindowScroll (XtermWidget /* xw */, int  /* top */, Bool /* always */);
 1532 
 1533 #ifdef SCROLLBAR_RIGHT
 1534 extern void updateRightScrollbar(XtermWidget  /* xw */);
 1535 #else
 1536 #define updateRightScrollbar(xw) /* nothing */
 1537 #endif
 1538 
 1539 /* tabs.c */
 1540 extern Bool TabToNextStop (XtermWidget /* xw */);
 1541 extern Bool TabToPrevStop (XtermWidget /* xw */);
 1542 extern void TabClear (Tabs /* tabs */, int /* col */);
 1543 extern void TabReset (Tabs /* tabs */);
 1544 extern void TabSet (Tabs /* tabs */, int /* col */);
 1545 extern void TabZonk (Tabs /* tabs */);
 1546 extern Bool TabIsSet (Tabs /* tabs */, int /* col */);
 1547 
 1548 /* util.c */
 1549 extern Boolean isDefaultBackground (const char * /* name */);
 1550 extern Boolean isDefaultForeground (const char * /* name */);
 1551 extern CgsEnum whichXtermCgs (XtermWidget /* xw */, unsigned /* attr_flags */, Bool /* hilite */);
 1552 extern GC updatedXtermGC (XtermWidget /* xw */, unsigned  /* flags */, CellColor /* fg_bg */, Bool  /* hilite */);  
 1553 extern Pixel getXtermBackground (XtermWidget /* xw */, unsigned /* flags */, int /* color */);
 1554 extern Pixel getXtermForeground (XtermWidget /* xw */, unsigned /* flags */, int /* color */);
 1555 extern char * xtermSetLocale (int /* category */, String /* after */);
 1556 extern int ClearInLine (XtermWidget /* xw */, int /* row */, int /* col */, unsigned /* len */);
 1557 extern int HandleExposure (XtermWidget /* xw */, XEvent * /* event */);
 1558 extern int dimRound (double /* value */);
 1559 extern int drawXtermText (XTermDraw * /* param */, GC /* gc */, int /* x */, int /* y */, const IChar * /* text */, Cardinal /* len */);
 1560 extern int extendedBoolean (const char * /* value */, const FlagList * /* table */, Cardinal /* limit */);
 1561 extern void ChangeColors (XtermWidget  /* xw */, ScrnColors * /* pNew */);
 1562 extern void ClearRight (XtermWidget /* xw */, int /* n */);
 1563 extern void ClearScreen (XtermWidget /* xw */);
 1564 extern void DeleteChar (XtermWidget /* xw */, unsigned /* n */);
 1565 extern void DeleteLine (XtermWidget /* xw */, int /* n */);
 1566 extern void FlushScroll (XtermWidget /* xw */);
 1567 extern void GetColors (XtermWidget  /* xw */, ScrnColors * /* pColors */);
 1568 extern void InsertChar (XtermWidget /* xw */, unsigned /* n */);
 1569 extern void InsertLine (XtermWidget /* xw */, int  /* n */);
 1570 extern void RevScroll (XtermWidget /* xw */, int  /* amount */);
 1571 extern void ReverseVideo (XtermWidget /* xw */);
 1572 extern void WriteText (XtermWidget /* xw */, IChar * /* str */, Cardinal /* len */);
 1573 extern void decode_keyboard_type (XtermWidget /* xw */, struct XTERM_RESOURCE * /* rp */);
 1574 extern void decode_wcwidth (XtermWidget  /* xw */);
 1575 extern void do_cd_xtra_scroll (XtermWidget /* xw */);
 1576 extern void do_erase_display (XtermWidget /* xw */, int  /* param */, int  /* mode */);
 1577 extern void do_erase_char (XtermWidget /* xw */, int  /* param */, int  /* mode */);
 1578 extern void do_erase_line (XtermWidget /* xw */, int  /* param */, int  /* mode */);
 1579 extern void do_ti_xtra_scroll (XtermWidget /* xw */);
 1580 extern void getXtermSizeHints (XtermWidget /* xw */);
 1581 extern void recolor_cursor (TScreen * /* screen */, Cursor  /* cursor */, unsigned long  /* fg */, unsigned long  /* bg */);
 1582 extern void resetXtermGC (XtermWidget /* xw */, unsigned  /* flags */, Bool  /* hilite */);
 1583 extern void scrolling_copy_area (XtermWidget /* xw */, int  /* firstline */, int  /* nlines */, int  /* amount */);
 1584 extern void set_keyboard_type (XtermWidget /* xw */, xtermKeyboardType  /* type */, Bool  /* set */);
 1585 extern void toggle_keyboard_type (XtermWidget /* xw */, xtermKeyboardType  /* type */);
 1586 extern void update_keyboard_type (void);
 1587 extern void xtermClear (XtermWidget /* xw */);
 1588 extern void xtermClear2 (XtermWidget /* xw */, int /* x */, int /* y */, unsigned /* width */, unsigned /* height */);
 1589 extern void xtermColIndex (XtermWidget /* xw */, Bool /* toLeft */);
 1590 extern void xtermColScroll (XtermWidget /* xw */, int /* amount */, Bool /* toLeft */, int /* at_col */);
 1591 extern void xtermRepaint (XtermWidget /* xw */);
 1592 extern void xtermResetLocale (int /* category */, char * /* before */);
 1593 extern void xtermScroll (XtermWidget /* xw */, int /* amount */);
 1594 extern void xtermScrollLR (XtermWidget /* xw */, int /* amount */, Bool /* toLeft */);
 1595 extern void xtermSizeHints (XtermWidget  /* xw */, int /* scrollbarWidth */);
 1596 
 1597 struct Xinerama_geometry {
 1598     int x;
 1599     int y;
 1600     unsigned w;
 1601     unsigned h;
 1602     int scr_x;
 1603     int scr_y;
 1604     int scr_w;
 1605     int scr_h;
 1606 };
 1607 extern int XParseXineramaGeometry(Display * /* display */, char * /* parsestring */, struct Xinerama_geometry * /* ret */);
 1608 
 1609 #if OPT_ISO_COLORS
 1610 
 1611 extern Pixel extract_fg (XtermWidget /* xw */, CellColor /* color */, unsigned  /* flags */);
 1612 extern Pixel extract_bg (XtermWidget /* xw */, CellColor /* color */, unsigned  /* flags */);
 1613 extern CellColor makeColorPair (XtermWidget /* xw */);
 1614 extern void ClearCurBackground (XtermWidget /* xw */, int  /* top */, int  /* left */, unsigned  /* height */, unsigned  /* width */, unsigned /* fw */);
 1615 
 1616 #define xtermColorPair(xw) makeColorPair(xw)
 1617 
 1618 #if OPT_COLOR_RES
 1619 #define GET_COLOR_RES(xw, res) xtermGetColorRes(xw, &(res))
 1620 #define SET_COLOR_RES(res,color) (res)->value = color
 1621 #define EQL_COLOR_RES(res,color) (res)->value == color
 1622 #define T_COLOR(v,n) (v)->Tcolors[n].value
 1623 extern Pixel xtermGetColorRes(XtermWidget /* xw */, ColorRes * /* res */);
 1624 #else
 1625 #define GET_COLOR_RES(xw, res) res
 1626 #define SET_COLOR_RES(res,color) *res = color
 1627 #define EQL_COLOR_RES(res,color) *res == color
 1628 #define T_COLOR(v,n) (v)->Tcolors[n]
 1629 #endif
 1630 
 1631 #define ExtractForeground(color) (unsigned) GetCellColorFG(color)
 1632 #define ExtractBackground(color) (unsigned) GetCellColorBG(color)
 1633 
 1634 #if OPT_RENDERFONT
 1635 extern void discardRenderDraw(TScreen * /* screen */);
 1636 #else
 1637 #define discardRenderDraw(screen) /* nothing */
 1638 #endif
 1639 
 1640 #if OPT_WIDE_ATTRS
 1641 #define MapToWideColorMode(fg, screen, flags) \
 1642     (((screen)->colorITMode && ((flags) & ATR_ITALIC)) \
 1643      ? COLOR_IT \
 1644      : fg)
 1645 #else
 1646 #define MapToWideColorMode(fg, screen, flags) fg
 1647 #endif
 1648 
 1649 #define MapToColorMode(fg, screen, flags) \
 1650     (((screen)->colorBLMode && ((flags) & BLINK)) \
 1651      ? COLOR_BL \
 1652      : (((screen)->colorBDMode && ((flags) & BOLD)) \
 1653         ? COLOR_BD \
 1654         : (((screen)->colorULMode && ((flags) & UNDERLINE)) \
 1655            ? COLOR_UL \
 1656            : MapToWideColorMode(fg, screen, flags))))
 1657 
 1658 #define checkVeryBoldAttr(flags, fg, code, attr) \
 1659     if ((flags & FG_COLOR) != 0 \
 1660      && (screen->veryBoldColors & attr) == 0 \
 1661      && (flags & attr) != 0 \
 1662      && (fg == code)) \
 1663          UIntClr(flags, attr)
 1664 
 1665 #if OPT_WIDE_ATTRS
 1666 #define checkVeryBoldWideAttr(flags, fg, it, atr) \
 1667         checkVeryBoldAttr(flags, fg, it, atr)
 1668 #else
 1669 #define checkVeryBoldWideAttr(flags, fg, it, atr) (void) flags
 1670 #endif
 1671 
 1672 #define checkVeryBoldColors(flags, fg) \
 1673     checkVeryBoldAttr(flags, fg, COLOR_RV, INVERSE); \
 1674     checkVeryBoldAttr(flags, fg, COLOR_UL, UNDERLINE); \
 1675     checkVeryBoldAttr(flags, fg, COLOR_BD, BOLD); \
 1676     checkVeryBoldAttr(flags, fg, COLOR_BL, BLINK); \
 1677     checkVeryBoldWideAttr(flags, fg, COLOR_IT, ATR_ITALIC)
 1678 
 1679 #else /* !OPT_ISO_COLORS */
 1680 
 1681 #define MapToColorMode(fg, screen, flags) fg
 1682 
 1683 #define ClearCurBackground(xw, top, left, height, width, fw) \
 1684     XClearArea (TScreenOf(xw)->display, \
 1685             VDrawable(TScreenOf(xw)), \
 1686             CursorX2(TScreenOf(xw), left, fw), \
 1687             CursorY2(TScreenOf(xw), top), \
 1688             ((width) * (unsigned) fw), \
 1689             ((height) * (unsigned) FontHeight(TScreenOf(xw))), \
 1690             False)
 1691 
 1692 #define extract_fg(xw, color, flags) (unsigned) (xw)->cur_foreground
 1693 #define extract_bg(xw, color, flags) (unsigned) (xw)->cur_background
 1694 
 1695         /* FIXME: Reverse-Video? */
 1696 #define T_COLOR(v,n) (v)->Tcolors[n]
 1697 #define xtermColorPair(xw) 0
 1698 
 1699 #define checkVeryBoldColors(flags, fg) /* nothing */
 1700 #define discardRenderDraw(screen) /* nothing */
 1701 
 1702 #endif  /* OPT_ISO_COLORS */
 1703 
 1704 #define getXtermFG(xw, flags, color) getXtermForeground(xw, flags, color)
 1705 #define getXtermBG(xw, flags, color) getXtermBackground(xw, flags, color)
 1706 
 1707 #if OPT_ZICONBEEP
 1708 extern void initZIconBeep(void);
 1709 extern void resetZIconBeep(XtermWidget /* xw */);
 1710 extern Boolean showZIconBeep(XtermWidget /* xw */, char * /* name */);
 1711 #else
 1712 #define initZIconBeep() /* nothing */
 1713 #define resetZIconBeep(xw) /* nothing */
 1714 #define showZIconBeep(xw, name) False
 1715 #endif
 1716 
 1717 #define XTERM_CELL(row,col)    getXtermCell(screen,     ROW2INX(screen, row), col)
 1718 
 1719 extern unsigned getXtermCell (TScreen * /* screen */, int  /* row */, int  /* col */);
 1720 extern unsigned getXtermCombining(TScreen * /* screen */, int /* row */, int /* col */, int /* off */);
 1721 extern void putXtermCell (TScreen * /* screen */, int  /* row */, int  /* col */, int  /* ch */);
 1722 
 1723 #define IsCellCombined(screen, row, col) (getXtermCombining(screen, row, col, 0) != 0)
 1724 
 1725 #if OPT_HIGHLIGHT_COLOR
 1726 #define isNotForeground(xw, fg, bg, sel) \
 1727         (Boolean) ((sel) != T_COLOR(TScreenOf(xw), TEXT_FG) \
 1728                && (sel) != (fg) \
 1729                && (sel) != (bg) \
 1730                && (sel) != (xw)->dft_foreground)
 1731 #define isNotBackground(xw, fg, bg, sel) \
 1732         (Boolean) ((sel) != T_COLOR(TScreenOf(xw), TEXT_BG) \
 1733                && (sel) != (fg) \
 1734                && (sel) != (bg) \
 1735                && (sel) != (xw)->dft_background)
 1736 #endif
 1737 
 1738 #if OPT_WIDE_CHARS
 1739 extern Boolean isWideControl(unsigned /* ch */);
 1740 extern int DamagedCells(TScreen * /* screen */, unsigned /* n */, int * /* klp */, int * /* krp */, int /* row */, int /* col */);
 1741 extern int DamagedCurCells(TScreen * /* screen */, unsigned /* n */, int * /* klp */, int * /* krp */);
 1742 extern unsigned AsciiEquivs(unsigned /* ch */);
 1743 extern void addXtermCombining (TScreen * /* screen */, int  /* row */, int  /* col */, unsigned  /* ch */);
 1744 extern void allocXtermChars(ScrnPtr * /* buffer */, Cardinal /* length */);
 1745 #endif
 1746 
 1747 #if OPT_XMC_GLITCH
 1748 extern void Mark_XMC (XtermWidget /* xw */, int  /* param */);
 1749 extern void Jump_XMC (XtermWidget /* xw */);
 1750 extern void Resolve_XMC (XtermWidget /* xw */);
 1751 #endif
 1752 
 1753 #if OPT_WIDE_CHARS
 1754 unsigned visual_width(const IChar * /* str */, Cardinal  /* len */);
 1755 #else
 1756 #define visual_width(a, b) (b)
 1757 #endif
 1758 
 1759 #define BtoS(b)    ((b) ? "on" : "off")
 1760 #define MtoS(b)    (((b) == Maybe) ? "maybe" : BtoS(b))
 1761 #define NonNull(s) ((s) ? (s) : "<null>")
 1762 
 1763 #define UIntSet(dst,bits) dst = dst | (unsigned) (bits)
 1764 #define UIntClr(dst,bits) dst = dst & (unsigned) ~(bits)
 1765 
 1766 #ifdef __cplusplus
 1767     }
 1768 #endif
 1769 /* *INDENT-ON* */
 1770 
 1771 #endif /* included_xterm_h */