home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / c / clr-xtrm.zip / xterm / ptyx.h < prev    next >
C/C++ Source or Header  |  1992-10-19  |  19KB  |  584 lines

  1. /*
  2.  *    $XConsortium: ptyx.h,v 1.60 91/06/24 20:45:02 gildea Exp $
  3.  */
  4.  
  5. /*
  6.  * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  7.  *
  8.  *                         All Rights Reserved
  9.  *
  10.  * Permission to use, copy, modify, and distribute this software and its
  11.  * documentation for any purpose and without fee is hereby granted,
  12.  * provided that the above copyright notice appear in all copies and that
  13.  * both that copyright notice and this permission notice appear in
  14.  * supporting documentation, and that the name of Digital Equipment
  15.  * Corporation not be used in advertising or publicity pertaining to
  16.  * distribution of the software without specific, written prior permission.
  17.  *
  18.  *
  19.  * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  20.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  21.  * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  22.  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  23.  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  24.  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  25.  * SOFTWARE.
  26.  */
  27.  
  28. /* ptyx.h */
  29. /* @(#)ptyx.h    X10/6.6    11/10/86 */
  30.  
  31. #include <X11/IntrinsicP.h>
  32. #include <X11/Xmu/Misc.h>    /* For Max() and Min(). */
  33. #include <X11/Xfuncs.h>
  34. #include <X11/Xosdefs.h>
  35.  
  36. /* Extra Xlib definitions */
  37. #define AllButtonsUp(detail, ignore)  (\
  38.         ((ignore) == Button1) ? \
  39.                 (((detail)&(Button2Mask|Button3Mask)) == 0) \
  40.                 : \
  41.          (((ignore) == Button2) ? \
  42.                   (((detail)&(Button1Mask|Button3Mask)) == 0) \
  43.                 : \
  44.                   (((detail)&(Button1Mask|Button2Mask)) == 0)) \
  45.         )
  46.  
  47. #define MAX_COLS    200
  48. #define MAX_ROWS    128
  49.  
  50. /*
  51. ** System V definitions
  52. */
  53.  
  54. #ifdef SYSV
  55. #ifdef X_NOT_POSIX
  56. #ifndef CRAY
  57. #define    dup2(fd1,fd2)    ((fd1 == fd2) ? fd1 : \
  58.                 (close(fd2), fcntl(fd1, F_DUPFD, fd2)))
  59. #endif
  60. #endif
  61. #endif /* SYSV */
  62.  
  63. /*
  64. ** allow for mobility of the pty master/slave directories
  65. */
  66. #ifndef PTYDEV
  67. #ifdef hpux
  68. #define    PTYDEV        "/dev/ptym/ptyxx"
  69. #else    /* !hpux */
  70. #define    PTYDEV        "/dev/ptyxx"
  71. #endif    /* !hpux */
  72. #endif    /* !PTYDEV */
  73.  
  74. #ifndef TTYDEV
  75. #ifdef hpux
  76. #define TTYDEV        "/dev/pty/ttyxx"
  77. #else    /* !hpux */
  78. #define    TTYDEV        "/dev/ttyxx"
  79. #endif    /* !hpux */
  80. #endif    /* !TTYDEV */
  81.  
  82. #ifndef PTYCHAR1
  83. #ifdef hpux
  84. #define PTYCHAR1    "zyxwvutsrqp"
  85. #else    /* !hpux */
  86. #define    PTYCHAR1    "pqrstuvwxyzPQRSTUVWXYZ"
  87. #endif    /* !hpux */
  88. #endif    /* !PTYCHAR1 */
  89.  
  90. #ifndef PTYCHAR2
  91. #ifdef hpux
  92. #define    PTYCHAR2    "fedcba9876543210"
  93. #else    /* !hpux */
  94. #define    PTYCHAR2    "0123456789abcdef"
  95. #endif    /* !hpux */
  96. #endif    /* !PTYCHAR2 */
  97.  
  98. /* Until the translation manager comes along, I have to do my own translation of
  99.  * mouse events into the proper routines. */
  100.  
  101. typedef enum {NORMAL, LEFTEXTENSION, RIGHTEXTENSION} EventMode;
  102.  
  103. /*
  104.  * The origin of a screen is 0, 0.  Therefore, the number of rows
  105.  * on a screen is screen->max_row + 1, and similarly for columns.
  106.  */
  107.  
  108. typedef unsigned char Char;        /* to support 8 bit chars */
  109. typedef Char **ScrnBuf;
  110.  
  111. /*
  112.  * ANSI emulation.
  113.  */
  114. #define INQ    0x05
  115. #define    FF    0x0C            /* C0, C1 control names        */
  116. #define    LS1    0x0E
  117. #define    LS0    0x0F
  118. #define    CAN    0x18
  119. #define    SUB    0x1A
  120. #define    ESC    0x1B
  121. #define US    0x1F
  122. #define    DEL    0x7F
  123. #define HTS     ('H'+0x40)
  124. #define    SS2    0x8E
  125. #define    SS3    0x8F
  126. #define    DCS    0x90
  127. #define    OLDID    0x9A            /* ESC Z            */
  128. #define    CSI    0x9B
  129. #define    ST    0x9C
  130. #define    OSC    0x9D
  131. #define    PM    0x9E
  132. #define    APC    0x9F
  133. #define    RDEL    0xFF
  134.  
  135. #define NMENUFONTS 9            /* entries in fontMenu */
  136.  
  137. #define    NBOX    5            /* Number of Points in box    */
  138. #define    NPARAM    10            /* Max. parameters        */
  139.  
  140. #define    MINHILITE    32
  141.  
  142. typedef struct {
  143.     unsigned char    a_type;
  144.     unsigned char    a_pintro;
  145.     unsigned char    a_final;
  146.     unsigned char    a_inters;
  147.     char    a_nparam;        /* # of parameters        */
  148.     char    a_dflt[NPARAM];        /* Default value flags        */
  149.     short    a_param[NPARAM];    /* Parameters            */
  150.     char    a_nastyf;        /* Error flag            */
  151. } ANSI;
  152.  
  153. typedef struct {
  154.     int        row;
  155.     int        col;
  156.     unsigned    flags;    /* Vt100 saves graphics rendition. Ugh! */
  157.     char        curgl;
  158.     char        curgr;
  159.     char        gsets[4];
  160. } SavedCursor;
  161.  
  162. #define TEK_FONT_LARGE 0
  163. #define TEK_FONT_2 1
  164. #define TEK_FONT_3 2
  165. #define TEK_FONT_SMALL 3
  166. #define    TEKNUMFONTS 4
  167.  
  168. /* Actually there are 5 types of lines, but four are non-solid lines */
  169. #define    TEKNUMLINES    4
  170.  
  171. typedef struct {
  172.     int    x;
  173.     int    y;
  174.     int    fontsize;
  175.     int    linetype;
  176. } Tmodes;
  177.  
  178. typedef struct {
  179.     int Twidth;
  180.     int Theight;
  181. } T_fontsize;
  182.  
  183. typedef struct {
  184.     short *bits;
  185.     int x;
  186.     int y;
  187.     int width;
  188.     int height;
  189. } BitmapBits;
  190.  
  191. #define    SAVELINES        64      /* default # lines to save      */
  192. #define SCROLLLINES 1            /* default # lines to scroll    */
  193.  
  194. /***====================================================================***/
  195.  
  196. #define    TEXT_FG        0
  197. #define    TEXT_BG        1
  198. #define    TEXT_CURSOR    2
  199. #define    MOUSE_FG    3
  200. #define    MOUSE_BG    4
  201. #define    TEK_FG        5
  202. #define    TEK_BG        6
  203. #define    NCOLORS        7
  204.  
  205. #define    COLOR_DEFINED(s,w)    ((s)->which&(1<<(w)))
  206. #define    COLOR_VALUE(s,w)    ((s)->colors[w])
  207. #define    SET_COLOR_VALUE(s,w,v)    (((s)->colors[w]=(v)),((s)->which|=(1<<(w))))
  208.  
  209. #define    COLOR_NAME(s,w)        ((s)->names[w])
  210. #define    SET_COLOR_NAME(s,w,v)    (((s)->names[w]=(v)),((s)->which|=(1<<(w))))
  211.  
  212. #define    UNDEFINE_COLOR(s,w)    ((s)->which&=(~((w)<<1)))
  213. #define    OPPOSITE_COLOR(n)    (((n)==TEXT_FG?TEXT_BG:\
  214.                  ((n)==TEXT_BG?TEXT_FG:\
  215.                  ((n)==MOUSE_FG?MOUSE_BG:\
  216.                  ((n)==MOUSE_BG?MOUSE_FG:\
  217.                  ((n)==TEK_FG?TEK_BG:\
  218.                  ((n)==TEXT_BG?TEK_FG:(n))))))))
  219.  
  220. typedef struct {
  221.     unsigned    which;
  222.     Pixel        colors[NCOLORS];
  223.     char        *names[NCOLORS];
  224. } ScrnColors;
  225.  
  226. /***====================================================================***/
  227.  
  228. #define MAXCOLORS 8
  229. #define COLOR_0        0
  230. #define COLOR_1        1
  231. #define COLOR_2        2
  232. #define COLOR_3        3
  233. #define COLOR_4        4
  234. #define COLOR_5        5
  235. #define COLOR_6        6
  236. #define COLOR_7        7
  237.  
  238. typedef struct {
  239. /* These parameters apply to both windows */
  240.     Display        *display;    /* X display for screen        */
  241.     int        respond;    /* socket for responses
  242.                        (position report, etc.)    */
  243.     long        pid;        /* pid of process on far side   */
  244.     int        uid;        /* user id of actual person    */
  245.     int        gid;        /* group id of actual person    */
  246.     GC        normalGC;    /* normal painting        */
  247.     GC        reverseGC;    /* reverse painting        */
  248.     GC        normalboldGC;    /* normal painting, bold font    */
  249.     GC        reverseboldGC;    /* reverse painting, bold font    */
  250.     GC        cursorGC;    /* normal cursor painting    */
  251.     GC        reversecursorGC;/* reverse cursor painting    */
  252.     GC        cursoroutlineGC;/* for painting lines around    */
  253.     Pixel        foreground;    /* foreground color        */
  254.     Pixel        cursorcolor;    /* Cursor color            */
  255.     Pixel        mousecolor;    /* Mouse color            */
  256.     Pixel        mousecolorback;    /* Mouse color background    */
  257.     Pixel        colors[MAXCOLORS]; /* ANSI color emulation    */
  258.     int        border;        /* inner border            */
  259.     Cursor        arrow;        /* arrow cursor            */
  260.     unsigned short    send_mouse_pos;    /* user wants mouse transition  */
  261.                     /* and position information    */
  262.     int        select;        /* xterm selected        */
  263.     Boolean        visualbell;    /* visual bell mode        */
  264.     int        logging;    /* logging mode            */
  265.     Boolean        allowSendEvents;/* SendEvent mode        */
  266.     Boolean        grabbedKbd;    /* keyboard is grabbed        */
  267.     int        logfd;        /* file descriptor of log    */
  268.     char        *logfile;    /* log file name        */
  269.     unsigned char    *logstart;    /* current start of log buffer    */
  270.     int        inhibit;    /* flags for inhibiting changes    */
  271.  
  272. /* VT window parameters */
  273.     struct {
  274.         Window    window;        /* X window id            */
  275.         int    width;        /* width of columns        */
  276.         int    height;        /* height of rows        */
  277.         int    fullwidth;    /* full width of window        */
  278.         int    fullheight;    /* full height of window    */
  279.         int    f_width;    /* width of fonts in pixels    */
  280.         int    f_height;    /* height of fonts in pixels    */
  281.     } fullVwin;
  282.     Cursor pointer_cursor;        /* pointer cursor in window    */
  283.  
  284.     /* Terminal fonts must be of the same size and of fixed width */
  285.     XFontStruct    *fnt_norm;    /* normal font of terminal    */
  286.     XFontStruct    *fnt_bold;    /* bold font of terminal    */
  287.     int        enbolden;    /* overstrike for bold font    */
  288.     XPoint        *box;        /* draw unselected cursor    */
  289.  
  290.     int        cursor_state;    /* ON or OFF            */
  291.     int        cursor_set;    /* requested state        */
  292.     int        cursor_col;    /* previous cursor column    */
  293.     int        cursor_row;    /* previous cursor row        */
  294.     int        cur_col;    /* current cursor column    */
  295.     int        cur_row;    /* current cursor row        */
  296.     int        max_col;    /* rightmost column        */
  297.     int        max_row;    /* bottom row            */
  298.     int        top_marg;    /* top line of scrolling region */
  299.     int        bot_marg;    /* bottom line of  "        "    */
  300.     Widget        scrollWidget;    /* pointer to scrollbar struct    */
  301.     int        scrollbar;    /* if > 0, width of scrollbar, and
  302.                         scrollbar is showing    */
  303.     int        topline;    /* line number of top, <= 0    */
  304.     int        savedlines;     /* number of lines that've been saved */
  305.     int        savelines;    /* number of lines off top to save */
  306.     int        scrolllines;    /* number of lines to button scroll */
  307.     Boolean        scrollttyoutput; /* scroll to bottom on tty output */
  308.     Boolean        scrollkey;    /* scroll to bottom on key    */
  309.     
  310.     ScrnBuf        buf;        /* ptr to visible screen buf (main) */
  311.     ScrnBuf        allbuf;        /* screen buffer (may include
  312.                        lines scrolled off top)    */
  313.     char        *sbuf_address;    /* main screen memory address   */
  314.     ScrnBuf        altbuf;        /* alternate screen buffer    */
  315.     char        *abuf_address;    /* alternate screen memory address */
  316.     Boolean        alternate;    /* true if using alternate buf    */
  317.     unsigned short    do_wrap;    /* true if cursor in last column
  318.                         and character just output    */
  319.     int        incopy;        /* 0 idle; 1 XCopyArea issued;
  320.                         -1 first GraphicsExpose seen,
  321.                         but last not seen        */
  322.     int        copy_src_x;    /* params from last XCopyArea ... */
  323.     int        copy_src_y;
  324.     unsigned int    copy_width;
  325.     unsigned int    copy_height;
  326.     int        copy_dest_x;
  327.     int        copy_dest_y;
  328.     Boolean        c132;        /* allow change to 132 columns    */
  329.     Boolean        curses;        /* cludge-ups for more and vi    */
  330.     Boolean        marginbell;    /* true if margin bell on    */
  331.     int        nmarginbell;    /* columns from right margin    */
  332.     int        bellarmed;    /* cursor below bell margin    */
  333.     Boolean     multiscroll;    /* true if multi-scroll        */
  334.     int        scrolls;    /* outstanding scroll count,
  335.                         used only with multiscroll    */
  336.     SavedCursor    sc;        /* data for restore cursor    */
  337.     int        save_modes[19];    /* save dec private modes    */
  338.  
  339.     /* Improved VT100 emulation stuff.                */
  340.     char        gsets[4];    /* G0 through G3.        */
  341.     char        curgl;        /* Current GL setting.        */
  342.     char        curgr;        /* Current GR setting.        */
  343.     char        curss;        /* Current single shift.    */
  344.     int        scroll_amt;    /* amount to scroll        */
  345.     int        refresh_amt;    /* amount to refresh        */
  346.     Boolean        jumpscroll;    /* whether we should jumpscroll */
  347.     Boolean         always_highlight; /* whether to highlight cursor */
  348.  
  349. /* Tektronix window parameters */
  350.     GC        TnormalGC;    /* normal painting        */
  351.     GC        TcursorGC;    /* normal cursor painting    */
  352.     Pixel        Tforeground;    /* foreground color        */
  353.     Pixel        Tbackground;    /* Background color        */
  354.     Pixel        Tcursorcolor;    /* Cursor color            */
  355.     int        Tcolor;        /* colors used            */
  356.     Boolean        Vshow;        /* VT window showing        */
  357.     Boolean        Tshow;        /* Tek window showing        */
  358.     Boolean        waitrefresh;    /* postpone refresh        */
  359.     struct {
  360.         Window    window;        /* X window id            */
  361.         int    width;        /* width of columns        */
  362.         int    height;        /* height of rows        */
  363.         int    fullwidth;    /* full width of window        */
  364.         int    fullheight;    /* full height of window    */
  365.         double    tekscale;    /* scale factor Tek -> vs100    */
  366.     } fullTwin;
  367.     int        xorplane;    /* z plane for inverts        */
  368.     GC        linepat[TEKNUMLINES]; /* line patterns        */
  369.     Boolean        TekEmu;        /* true if Tektronix emulation    */
  370.     int        cur_X;        /* current x            */
  371.     int        cur_Y;        /* current y            */
  372.     Tmodes        cur;        /* current tek modes        */
  373.     Tmodes        page;        /* starting tek modes on page    */
  374.     int        margin;        /* 0 -> margin 1, 1 -> margin 2    */
  375.     int        pen;        /* current Tektronix pen 0=up, 1=dn */
  376.     char        *TekGIN;    /* nonzero if Tektronix GIN mode*/
  377.     int        gin_terminator; /* Tek strap option */
  378.  
  379.     int        multiClickTime;     /* time between multiclick selects */
  380.     int        bellSuppressTime; /* msecs after Bell before another allowed */
  381.     Boolean        bellInProgress; /* still ringing/flashing prev bell? */
  382.     char        *charClass;    /* for overriding word selection */
  383.     Boolean        cutNewline;    /* whether or not line cut has \n */
  384.     Boolean        cutToBeginningOfLine;  /* line cuts to BOL? */
  385.     char        *selection;    /* the current selection */
  386.     int        selection_size; /* size of allocated buffer */
  387.     int        selection_length; /* number of significant bytes */
  388.     int        selection_time;    /* latest event timestamp */
  389.     int        startHRow, startHCol, /* highlighted text */
  390.             endHRow, endHCol,
  391.             startHCoord, endHCoord;
  392.     Atom*        selection_atoms; /* which selections we own */
  393.     Cardinal    sel_atoms_size;    /*  how many atoms allocated */
  394.     Cardinal    selection_count; /* how many atoms in use */
  395.     Boolean        input_eight_bits;/* use 8th bit instead of ESC prefix */
  396.     Boolean        output_eight_bits; /* honor all bits or strip */
  397.     Pixmap        menu_item_bitmap;    /* mask for checking items */
  398.     Widget        mainMenu, vtMenu, tekMenu, fontMenu;
  399.     char*        menu_font_names[NMENUFONTS];
  400.     int        menu_font_number;
  401. } TScreen;
  402.  
  403. typedef struct _TekPart {
  404.     XFontStruct *Tfont[TEKNUMFONTS];
  405.     int        tobaseline[TEKNUMFONTS]; /* top to baseline for each font */
  406.     char    *initial_font;        /* large, 2, 3, small */
  407.     char    *gin_terminator_str;    /* ginTerminator resource */
  408. } TekPart;
  409.  
  410.  
  411.  
  412. /* meaning of bits in screen.select flag */
  413. #define    INWINDOW    01    /* the mouse is in one of the windows */
  414. #define    FOCUS        02    /* one of the windows is the focus window */
  415.  
  416. #define MULTICLICKTIME 250    /* milliseconds */
  417.  
  418. typedef struct
  419. {
  420.     unsigned    flags;
  421. } TKeyboard;
  422.  
  423. typedef struct _Misc {
  424.     char *geo_metry;
  425.     char *T_geometry;
  426.     char *f_n;
  427.     char *f_b;
  428.     Boolean log_on;
  429.     Boolean login_shell;
  430.     Boolean re_verse;
  431.     int resizeGravity;
  432.     Boolean reverseWrap;
  433.     Boolean autoWrap;
  434.     Boolean logInhibit;
  435.     Boolean signalInhibit;
  436.     Boolean tekInhibit;
  437.     Boolean scrollbar;
  438.     Boolean titeInhibit;
  439.     Boolean tekSmall;    /* start tek window in small size */
  440.     Boolean dynamicColors;
  441.     Boolean appcursorDefault;
  442.     Boolean appkeypadDefault;
  443. } Misc;
  444.  
  445. typedef struct {int foo;} XtermClassPart, TekClassPart;
  446.  
  447. typedef struct _XtermClassRec {
  448.     CoreClassPart  core_class;
  449.     XtermClassPart xterm_class;
  450. } XtermClassRec;
  451.  
  452. typedef struct _TekClassRec {
  453.     CoreClassPart core_class;
  454.     TekClassPart tek_class;
  455. } TekClassRec;
  456.  
  457. /* define masks for flags */
  458. #define CAPS_LOCK    0x01
  459. #define KYPD_APL    0x02
  460. #define CURSOR_APL    0x04
  461.  
  462.  
  463. #define N_MARGINBELL    10
  464. #define MAX_TABS    320
  465. #define TAB_ARRAY_SIZE    10    /* number of ints to provide MAX_TABS bits */
  466.  
  467. typedef unsigned Tabs [TAB_ARRAY_SIZE];
  468.  
  469. typedef struct _XtermWidgetRec {
  470.     CorePart    core;
  471.     TKeyboard    keyboard;    /* terminal keyboard        */
  472.     TScreen    screen;        /* terminal screen        */
  473.     unsigned    flags;        /* mode flags            */
  474.     unsigned    cur_foreground;    /* current foreground color    */
  475.     unsigned    cur_background;    /* current background color    */
  476.     unsigned    initflags;    /* initial mode flags        */
  477.     Tabs    tabs;        /* tabstops of the terminal    */
  478.     Misc    misc;        /* miscellaneous parameters    */
  479. } XtermWidgetRec, *XtermWidget;
  480.  
  481. typedef struct _TekWidgetRec {
  482.     CorePart core;
  483.     TekPart tek;
  484. } TekWidgetRec, *TekWidget;
  485.  
  486. #define BUF_SIZE 4096
  487.  
  488. /*
  489.  * terminal flags
  490.  * There are actually two namespaces mixed together here.
  491.  * One is the set of flags that can go in screen->buf attributes
  492.  * and which must fit in a char.
  493.  * The other is the global setting stored in
  494.  * term->flags and screen->save_modes.  This need only fit in an unsigned.
  495.  */
  496.  
  497. #define    ATTRIBUTES    0x67    /* mask: user-visible attributes */
  498. /* global flags and character flags (visible character attributes) */
  499. #define INVERSE        0x01    /* invert the characters to be output */
  500. #define UNDERLINE    0x02    /* true if underlining */
  501. #define BOLD        0x04
  502. /* character flags (internal attributes) */
  503. #define LINEWRAPPED    0x08    /* used on the first character in a
  504.                  * line to indicate that it wraps onto
  505.                  * the next line so we can tell the
  506.                  * difference between lines that have
  507.                  * wrapped around and lines that have
  508.                  * ended naturally with a CR at column
  509.                  * max_col.
  510.                  */
  511. #define CHARDRAWN    0x10    /* a character has been drawn here on the
  512.                    screen.  Used to distinguish blanks from
  513.                    empty parts of the screen when selecting */
  514. #define FG_COLOR        0x20    /* true if background set */
  515. #define BG_COLOR        0x40    /* true if foreground set */
  516. #define DIM             0x80     
  517. /* global flags */
  518. #define WRAPAROUND    0x400    /* true if auto wraparound mode */
  519. #define    REVERSEWRAP    0x800    /* true if reverse wraparound mode */
  520. #define REVERSE_VIDEO    0x1000    /* true if screen white on black */
  521. #define LINEFEED    0x2000    /* true if in auto linefeed mode */
  522. #define ORIGIN        0x4000    /* true if in origin mode */
  523. #define INSERT        0x8000    /* true if in insert mode */
  524. #define SMOOTHSCROLL    0x10000    /* true if in smooth scroll mode */
  525. #define IN132COLUMNS    0x20000    /* true if in 132 column mode */
  526.  
  527.  
  528. #define VWindow(screen)        (screen->fullVwin.window)
  529. #define VShellWindow        term->core.parent->core.window
  530. #define TextWindow(screen)      (screen->fullVwin.window)
  531. #define TWindow(screen)        (screen->fullTwin.window)
  532. #define TShellWindow        tekWidget->core.parent->core.window
  533. #define Width(screen)        (screen->fullVwin.width)
  534. #define Height(screen)        (screen->fullVwin.height)
  535. #define FullWidth(screen)    (screen->fullVwin.fullwidth)
  536. #define FullHeight(screen)    (screen->fullVwin.fullheight)
  537. #define FontWidth(screen)    (screen->fullVwin.f_width)
  538. #define FontHeight(screen)    (screen->fullVwin.f_height)
  539. #define TWidth(screen)        (screen->fullTwin.width)
  540. #define THeight(screen)        (screen->fullTwin.height)
  541. #define TFullWidth(screen)    (screen->fullTwin.fullwidth)
  542. #define TFullHeight(screen)    (screen->fullTwin.fullheight)
  543. #define TekScale(screen)    (screen->fullTwin.tekscale)
  544.  
  545. #define CursorX(screen,col) ((col) * FontWidth(screen) + screen->border \
  546.             + screen->scrollbar)
  547. #define CursorY(screen,row) ((((row) - screen->topline) * FontHeight(screen)) \
  548.             + screen->border)
  549.  
  550. #define    TWINDOWEVENTS    (KeyPressMask | ExposureMask | ButtonPressMask |\
  551.              ButtonReleaseMask | StructureNotifyMask |\
  552.              EnterWindowMask | LeaveWindowMask | FocusChangeMask)
  553.  
  554. #define    WINDOWEVENTS    (TWINDOWEVENTS | PointerMotionMask)
  555.  
  556.  
  557. #define TEK_LINK_BLOCK_SIZE 1024
  558.  
  559. typedef struct Tek_Link
  560. {
  561.     struct Tek_Link    *next;    /* pointer to next TekLink in list
  562.                    NULL <=> this is last TekLink */
  563.     short fontsize;        /* character size, 0-3 */
  564.     short count;        /* number of chars in data */
  565.     char *ptr;        /* current pointer into data */
  566.     char data [TEK_LINK_BLOCK_SIZE];
  567. } TekLink;
  568.  
  569. /* flags for cursors */
  570. #define    OFF        0
  571. #define    ON        1
  572. #define    CLEAR        0
  573. #define    TOGGLE        1
  574.  
  575. /* flags for inhibit */
  576. #define    I_LOG        0x01
  577. #define    I_SIGNAL    0x02
  578. #define    I_TEK        0x04
  579.  
  580. extern Cursor make_colored_cursor();
  581. extern int GetBytesAvailable();
  582. extern void first_map_occurred();
  583. extern int kill_process_group();
  584.