|
|
1.1 ! root 1: /* ! 2: * $Source: /u1/X/xterm/RCS/ptyx.h,v $ ! 3: * $Header: ptyx.h,v 10.101 86/12/01 16:57:15 swick Rel $ ! 4: */ ! 5: ! 6: #include <X/mit-copyright.h> ! 7: ! 8: /* Copyright Massachusetts Institute of Technology 1984, 1985 */ ! 9: ! 10: /* ptyx.h */ ! 11: /* @(#)ptyx.h 1.4 (Berkeley/CSRG) 9/17/87 */ ! 12: /* @(#)ptyx.h X10/6.6B 12/26/86 */ ! 13: ! 14: #define FALSE 0 ! 15: #define TRUE 1 ! 16: ! 17: #define MAX_COLS 200 ! 18: #define MAX_ROWS 128 ! 19: ! 20: /* ! 21: * The origin of a screen is 0, 0. Therefore, the number of rows ! 22: * on a screen is screen->max_row + 1, and similarly for columns. ! 23: */ ! 24: ! 25: typedef char **ScrnBuf; ! 26: ! 27: /* ! 28: * ANSI emulation. ! 29: */ ! 30: #define INQ 0x05 ! 31: #define FF 0x0C /* C0, C1 control names */ ! 32: #define LS1 0x0E ! 33: #define LS0 0x0F ! 34: #define CAN 0x18 ! 35: #define SUB 0x1A ! 36: #define ESC 0x1B ! 37: #define US 0x1F ! 38: #define DEL 0x7F ! 39: #define HTS ('H'+0x40) ! 40: #define SS2 0x8E ! 41: #define SS3 0x8F ! 42: #define DCS 0x90 ! 43: #define OLDID 0x9A /* ESC Z */ ! 44: #define CSI 0x9B ! 45: #define ST 0x9C ! 46: #define OSC 0x9D ! 47: #define PM 0x9E ! 48: #define APC 0x9F ! 49: #define RDEL 0xFF ! 50: ! 51: #define NBOX 5 /* Number of Vertices in box */ ! 52: #define NPARAM 10 /* Max. parameters */ ! 53: ! 54: #define MINHILITE 32 ! 55: #define TITLEPAD 4 ! 56: ! 57: typedef struct { ! 58: unsigned char a_type; ! 59: unsigned char a_pintro; ! 60: unsigned char a_final; ! 61: unsigned char a_inters; ! 62: char a_nparam; /* # of parameters */ ! 63: char a_dflt[NPARAM]; /* Default value flags */ ! 64: short a_param[NPARAM]; /* Parameters */ ! 65: char a_nastyf; /* Error flag */ ! 66: } ANSI; ! 67: ! 68: typedef struct { ! 69: int row; ! 70: int col; ! 71: unsigned flags; /* Vt100 saves graphics rendition. Ugh! */ ! 72: char curgl; ! 73: char curgr; ! 74: char gsets[4]; ! 75: } SavedCursor; ! 76: ! 77: #define TEKNUMFONTS 5 ! 78: /* Actually there are 5 types of lines, but four are non-solid lines */ ! 79: #define TEKNUMLINES 4 ! 80: ! 81: typedef struct { ! 82: int x; ! 83: int y; ! 84: int fontsize; ! 85: int linetype; ! 86: } Tmodes; ! 87: ! 88: typedef struct { ! 89: int Twidth; ! 90: int Theight; ! 91: } T_fontsize; ! 92: ! 93: typedef struct { ! 94: Window tbar; /* major window */ ! 95: Window left; /* left hilited window */ ! 96: Window right; /* right hilited window */ ! 97: int hilited; /* in hilite state */ ! 98: int x; /* x position of title */ ! 99: int y; /* y position of title */ ! 100: int fullwidth; /* full width of title */ ! 101: int width; /* width of visible part of title */ ! 102: } TitleBar; ! 103: ! 104: typedef struct { ! 105: short *bits; ! 106: int x; ! 107: int y; ! 108: int width; ! 109: int height; ! 110: } BitmapBits; ! 111: ! 112: typedef struct { ! 113: /* These parameters apply to both windows */ ! 114: Display *display; /* X display for screen */ ! 115: int respond; /* socket for responses ! 116: (position report, etc.) */ ! 117: long pid; /* pid of process on far side */ ! 118: int uid; /* user id of actual person */ ! 119: int gid; /* group id of actual person */ ! 120: int color; /* colors used */ ! 121: int foreground; /* foreground color */ ! 122: int background; /* Background color */ ! 123: int cursorcolor; /* Cursor color */ ! 124: int mousecolor; /* Mouse color */ ! 125: Pixmap bgndtile; /* background tile pixmap */ ! 126: int border; /* inner border */ ! 127: int borderwidth; /* outer border */ ! 128: Pixmap bordertile; /* tile pixmap for border */ ! 129: Pixmap graybordertile; /* tile pixmap for border when ! 130: window is unselected */ ! 131: Cursor arrow; /* arrow cursor */ ! 132: int send_mouse_pos; /* user wants mouse transition */ ! 133: /* and position information */ ! 134: int select; /* xterm selected */ ! 135: struct timeval *timeout; /* timeout value for select */ ! 136: FontInfo *titlefont; /* font info for title font */ ! 137: int titleheight; /* height of title */ ! 138: int title_n_size; /* width on 'n' in title font */ ! 139: Pixmap hilitetile; /* tile pixmap for title hilite */ ! 140: int autoraise; /* auto raise window mode */ ! 141: Window autowindow; /* the window to autoraise */ ! 142: int timer; /* timer function */ ! 143: int holdoff; /* delay select and unselects */ ! 144: int audiblebell; /* audible bell mode */ ! 145: int visualbell; /* visual bell mode */ ! 146: int visbelldelay; /* visual bell delay */ ! 147: int icon_show; /* icon currently showing */ ! 148: int textundericon; /* text under icon */ ! 149: int bitmapwidth; /* width of icon bitmap */ ! 150: int bitmapheight; /* height of icon bitmap */ ! 151: int icon_text_x; /* x position of text */ ! 152: int icon_text_y; /* y position of text */ ! 153: BitmapBits iconbitmap; /* bitmap for icon */ ! 154: int iconinput; /* got input while iconified */ ! 155: int active_icon; /* icon is miniature copy */ ! 156: int deiconwarp; /* warp mouse on deiconify */ ! 157: int logging; /* logging mode */ ! 158: int logfd; /* file descriptor of log */ ! 159: char *logfile; /* log file name */ ! 160: char *logstart; /* current start of log buffer */ ! 161: int inhibit; /* flags for inhibiting changes */ ! 162: ! 163: /* VT window parameters */ ! 164: int show; /* window showing */ ! 165: int iconunmap; /* unmapped because of icon */ ! 166: struct { ! 167: Window window; /* X window id */ ! 168: int width; /* width of columns */ ! 169: int height; /* height of rows */ ! 170: int fullwidth; /* full width of window */ ! 171: int fullheight; /* full height of window */ ! 172: int f_width; /* width of fonts in pixels */ ! 173: int f_height; /* height of fonts in pixels */ ! 174: int titlebar; /* title bar(s) showing */ ! 175: } fullVwin, iconVwin, *mappedVwin; ! 176: Font fnt_icon; /* icon font */ ! 177: int minrows; /* minimun number of rows to ! 178: accommodate scrollbar */ ! 179: Cursor curs; /* cursor resource from X */ ! 180: /* Terminal fonts must be of the same size and of fixed width */ ! 181: Font fnt_norm; /* normal font of terminal */ ! 182: Font fnt_bold; /* bold font of terminal */ ! 183: int enbolden; /* overstrike for bold font */ ! 184: Vertex *box; /* draw unselected cursor */ ! 185: ! 186: int cursor_state; /* ON or OFF */ ! 187: int cursor_set; /* requested state */ ! 188: int cursor_col; /* previous cursor column */ ! 189: int cursor_row; /* previous cursor row */ ! 190: int cur_col; /* current cursor column */ ! 191: int cur_row; /* current cursor row */ ! 192: int max_col; /* rightmost column */ ! 193: int max_row; /* bottom row */ ! 194: int top_marg; /* top line of scrolling region */ ! 195: int bot_marg; /* bottom line of " " */ ! 196: int scrollbar; /* if > 0, width of scrollbar, and ! 197: scrollbar showing */ ! 198: int topline; /* line number of top, <= 0 */ ! 199: int savelines; /* number of lines off top to save */ ! 200: int scrollinput; /* scroll to bottom on input */ ! 201: int scrollkey; /* scroll to bottom on key */ ! 202: ! 203: ScrnBuf buf; /* screen buffer (main) */ ! 204: ScrnBuf allbuf; /* screen buffer (may include ! 205: lines scrolled off top */ ! 206: ScrnBuf altbuf; /* alternate screen buffer */ ! 207: int alternate; /* true if using alternate buf */ ! 208: ScrollBar *sb; /* pointer to scrollbar struct */ ! 209: int do_wrap; /* true if cursor in last column ! 210: and character just output */ ! 211: int incopy; /* 0 if no RasterCopy exposure ! 212: event processed since last ! 213: RasterCopy */ ! 214: int c132; /* allow change to 132 columns */ ! 215: int curses; /* cludge-ups for more and vi */ ! 216: int marginbell; /* true if margin bell on */ ! 217: int nmarginbell; /* columns from right margin */ ! 218: int bellarmed; /* cursor below bell margin */ ! 219: #ifdef CROCKSCROLL ! 220: int scrollincr; /* scroll increment */ ! 221: #endif ! 222: int multiscroll; /* true if multi-scroll */ ! 223: int scrolls; /* outstanding scroll count */ ! 224: SavedCursor sc; /* data for restore cursor */ ! 225: TitleBar title; /* title bar */ ! 226: int statusline; /* status line showing */ ! 227: int statusheight; /* status line height */ ! 228: int instatus; /* cursor in status line */ ! 229: SavedCursor statussc; /* status line restore cursor */ ! 230: int reversestatus; /* status line reversed */ ! 231: char *winname; /* name of window (and icons) */ ! 232: int winnamelen; /* length of window name */ ! 233: int save_modes[19]; /* save dec private modes */ ! 234: int pagemode; /* true if page mode */ ! 235: int pagecnt; /* count of lines in page mode */ ! 236: int pageoverlap; /* lines to overlap (less one) */ ! 237: ! 238: /* Improved VT100 emulation stuff. */ ! 239: char gsets[4]; /* G0 through G3. */ ! 240: char curgl; /* Current GL setting. */ ! 241: char curgr; /* Current GR setting. */ ! 242: char curss; /* Current single shift. */ ! 243: int scroll_amt; /* amount to scroll */ ! 244: int refresh_amt; /* amount to refresh */ ! 245: int jumpscroll; /* whether we should jumpscroll */ ! 246: ! 247: /* Tektronix window parameters */ ! 248: int Tforeground; /* foreground color */ ! 249: int Tbackground; /* Background color */ ! 250: int Tcursorcolor; /* Cursor color */ ! 251: Pixmap Tbgndtile; /* background tile pixmap */ ! 252: int Tcolor; /* colors used */ ! 253: int planeused; /* is xorplane being used */ ! 254: int cellsused; /* are color cells being used */ ! 255: Color colorcells[3]; /* color cells for Tek */ ! 256: int Tshow; /* Tek window showing */ ! 257: int Ticonunmap; /* unmapped because of icon */ ! 258: int waitrefresh; /* postpone refresh */ ! 259: struct { ! 260: Window window; /* X window id */ ! 261: int width; /* width of columns */ ! 262: int height; /* height of rows */ ! 263: int fullwidth; /* full width of window */ ! 264: int fullheight; /* full height of window */ ! 265: int titlebar; /* title bar(s) showing */ ! 266: double tekscale; /* scale factor Tek -> vs100 */ ! 267: } fullTwin, iconTwin, *mappedTwin; ! 268: BitmapBits Ticonbitmap; /* bitmap for icon */ ! 269: Vertex **Tbox; /* draw unselected cursor */ ! 270: int xorplane; /* z plane for inverts */ ! 271: Pattern linepat[TEKNUMLINES]; /* line patterns */ ! 272: Font Tfont[TEKNUMFONTS]; /* Tek fonts */ ! 273: int tobaseline[TEKNUMFONTS]; /* top to baseline for ! 274: each font */ ! 275: int TekEmu; /* true if Tektronix emulation */ ! 276: int cur_X; /* current x */ ! 277: int cur_Y; /* current y */ ! 278: Tmodes cur; /* current tek modes */ ! 279: Tmodes page; /* starting tek modes on page */ ! 280: int margin; /* 0 -> margin 1, 1 -> margin 2 */ ! 281: int pen; /* current Tektronix pen 0=up, 1=dn */ ! 282: char *TekGIN; /* nonzero if Tektronix GIN mode*/ ! 283: TitleBar Ttitle; /* title bar */ ! 284: char *Twinname; /* name of window */ ! 285: int Twinnamelen; /* length of window name */ ! 286: } Screen; ! 287: ! 288: /* meaning of bits in screen.select flag */ ! 289: #define INWINDOW 01 /* the mouse is in one of the windows */ ! 290: #define FOCUS 02 /* one of the windows is the focus window */ ! 291: ! 292: typedef struct ! 293: { ! 294: unsigned offset; /* status of shift, control, meta */ ! 295: #define SHIFT 0x0001 ! 296: #define META 0x0002 ! 297: #define CONTROL 0x0004 ! 298: ! 299: unsigned flags; ! 300: } Keyboard; ! 301: ! 302: /* define masks for flags */ ! 303: #define CAPS_LOCK 0x01 ! 304: #define KYPD_APL 0x02 ! 305: #define CURSOR_APL 0x04 ! 306: ! 307: ! 308: #define N_MARGINBELL 10 ! 309: #define MAX_TABS 320 ! 310: #define TAB_ARRAY_SIZE 10 /* number of ints to provide MAX_TABS bits */ ! 311: ! 312: typedef unsigned Tabs [TAB_ARRAY_SIZE]; ! 313: ! 314: ! 315: #define BUF_SIZE 4096 ! 316: ! 317: typedef struct ! 318: { ! 319: Keyboard keyboard; /* terminal keyboard */ ! 320: Screen screen; /* terminal screeen */ ! 321: unsigned flags; /* mode flags */ ! 322: unsigned initflags; /* initial mode flags */ ! 323: Tabs tabs; /* tabstops of the terminal */ ! 324: } Terminal; ! 325: ! 326: ! 327: /* masks for terminal flags */ ! 328: ! 329: #define INVERSE 0x01 /* invert the characters to be output */ ! 330: #define UNDERLINE 0x02 /* true if underlining */ ! 331: #define BOLD 0x04 ! 332: #define WRAPAROUND 0x08 ! 333: #define REVERSE_VIDEO 0x10 /* true if screen white on black */ ! 334: #define ORIGIN 0x20 /* true if in origin mode */ ! 335: #define INSERT 0x40 /* true if in insert mode */ ! 336: #define SMOOTHSCROLL 0x80 /* true if in smooth scroll mode */ ! 337: #define AUTOREPEAT 0x100 /* true if in autorepeat mode */ ! 338: #define IN132COLUMNS 0x200 /* true if in 132 column mode */ ! 339: #define LINEFEED 0x400 ! 340: #define REVERSEWRAP 0x800 /* true if reverse wraparound mode */ ! 341: #define ICONINPUT 0x1000 /* true if mini icon accepts kbd input */ ! 342: ! 343: #define ATTRIBUTES 0x07 /* attributes mask */ ! 344: #define CHAR 0177 ! 345: ! 346: #define VWindow(screen) (screen->mappedVwin->window) ! 347: #define TWindow(screen) (screen->mappedTwin->window) ! 348: #define Width(screen) (screen->mappedVwin->width) ! 349: #define Height(screen) (screen->mappedVwin->height) ! 350: #define FullWidth(screen) (screen->mappedVwin->fullwidth) ! 351: #define FullHeight(screen) (screen->mappedVwin->fullheight) ! 352: #define FontWidth(screen) (screen->mappedVwin->f_width) ! 353: #define FontHeight(screen) (screen->mappedVwin->f_height) ! 354: #define TWidth(screen) (screen->mappedTwin->width) ! 355: #define THeight(screen) (screen->mappedTwin->height) ! 356: #define TFullWidth(screen) (screen->mappedTwin->fullwidth) ! 357: #define TFullHeight(screen) (screen->mappedTwin->fullheight) ! 358: #define TekScale(screen) (screen->mappedTwin->tekscale) ! 359: #define Titlebar(screen) (screen->mappedVwin->titlebar) ! 360: #define TTitlebar(screen) (screen->mappedTwin->titlebar) ! 361: #define ActiveIcon(screen) (screen->active_icon && \ ! 362: (screen->mappedVwin == &screen->iconVwin)) ! 363: #define TActiveIcon(screen) (screen->active_icon && \ ! 364: (screen->mappedTwin == &screen->iconTwin)) ! 365: ! 366: #define CursorX(screen,col) ((col) * FontWidth(screen) + screen->border) ! 367: #define CursorY(screen,row) ((screen->instatus ? \ ! 368: ((row) * FontHeight(screen) + 1)\ ! 369: : (((row) - screen->topline) * FontHeight(screen))) +\ ! 370: screen->border + Titlebar(screen)) ! 371: ! 372: #define TICONWINDOWEVENTS (ExposeWindow | ButtonPressed) ! 373: ! 374: #define ICONWINDOWEVENTS (TICONWINDOWEVENTS | ExposeRegion | ExposeCopy) ! 375: ! 376: #define ICONINPUTEVENTS (KeyPressed | EnterWindow | LeaveWindow | FocusChange) ! 377: ! 378: #define TWINDOWEVENTS (KeyPressed | ExposeWindow | ButtonPressed |\ ! 379: ButtonReleased | UnmapWindow | EnterWindow |\ ! 380: LeaveWindow | FocusChange) ! 381: ! 382: #define WINDOWEVENTS (TWINDOWEVENTS | ExposeRegion | ExposeCopy) ! 383: ! 384: #define TEK_LINK_BLOCK_SIZE 1024 ! 385: ! 386: typedef struct Tek_Link ! 387: { ! 388: struct Tek_Link *next; /* pointer to next TekLink in list ! 389: NULL <=> this is last TekLink */ ! 390: short count; ! 391: char *ptr; ! 392: char data [TEK_LINK_BLOCK_SIZE]; ! 393: } TekLink; ! 394: ! 395: /* flags for cursors */ ! 396: #define OFF 0 ! 397: #define ON 1 ! 398: #define CLEAR 0 ! 399: #define TOGGLE 1 ! 400: ! 401: /* flags for color */ ! 402: #define C_FOREGROUND 0x01 ! 403: #define C_BACKGROUND 0x02 ! 404: #define C_FBMASK 0x03 ! 405: #define C_CURSOR 0x04 ! 406: #define C_MOUSE 0x08 ! 407: #define C_BORDER 0x10 ! 408: ! 409: /* flags for inhibit */ ! 410: #define I_LOG 0x01 ! 411: #define I_SIGNAL 0x02 ! 412: #define I_TEK 0x04 ! 413: ! 414: extern Bitmap make_icon(); ! 415: extern Cursor make_tcross(); ! 416: extern Cursor make_xterm(); ! 417: extern Cursor make_wait(); ! 418: extern Cursor make_arrow();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.