/* $Id: ckmcon.h,v 1.5 91/12/15 23:16:53 rick Exp $ * $Source: /uw/mackermit/RCS/ckmcon.h,v $ *------------------------------------------------------------------ * $Log: ckmcon.h,v $ * Revision 1.5 91/12/15 23:16:53 rick * ut9 * * Revision 1.4 91/10/13 13:44:26 rick * UT(7) * * Revision 1.3 91/10/03 12:43:01 rick * UT(5) * * Revision 1.2 91/09/25 12:16:49 rick * Command window in TE. Multiple vt100 windows for command window. * *------------------------------------------------------------------ * $Endlog$ */ /* $Id: ckmcon.h,v 1.5 91/12/15 23:16:53 rick Exp $ * $Source: /uw/mackermit/RCS/ckmcon.h,v $ *------------------------------------------------------------------ * $Log: ckmcon.h,v $ * Revision 1.5 91/12/15 23:16:53 rick * ut9 * * Revision 1.4 91/10/13 13:44:26 rick * UT(7) * * Revision 1.3 91/10/03 12:43:01 rick * UT(5) * *------------------------------------------------------------------ * $Endlog$ */ /* Copyright (C) 1985, 1992, Trustees of Columbia University in the City of New York. Permission is granted to any individual or institution to use this software as long as it is not sold for profit. This copyright notice must be retained. This software may not be included in commercial products without written permission of Columbia University. */ #define MAX_SCREENSIZE 288 /* maximum number of lines possible */ #define INIT_SCREENSIZE 24 /* PWP: was 24 */ #define MAXCOL 80 #define TOPMARGIN 2 /* Terminal display constants */ #define bottomMARGIN (termw->lineheight * termw->screensize + TOPMARGIN + 1) #define LEFTMARGIN 4 #define rightMARGIN (termw->charwidth * MAXCOL + LEFTMARGIN) #define toplin 0 #define botlin (termw->screensize-1) /* Font Numbers (UoR Mod) to fix bolding problems */ /* These should be placed in the RESOURCE FORK of the executable */ #define VT100FONT 128 /* VT100 Terminal Font (not-bold) */ #define VT100BOLD 129 /* VT100 Bold Font */ #define VTDECTECH 130 /* DEC VT300 Technical */ #ifdef COMMENT #define VT100FONT 4 /* VT100 Terminal Font (not-bold) */ #define VT100BOLD 4 /* VT100 Bold Font */ #define VTDECTECH 4 /* DEC VT300 Technical */ #endif /*****************************************/ /* Stuff for escape character processing */ #define CF_OUTC 0 /* Just output the char */ #define CF_ESC 1 /* In a single char escape seq */ #define CF_CSI 2 /* In a multi char '[' escape seq */ #define CF_TOSS 3 /* Toss this char */ #define CF_GS_0 4 /* (UoR) for graphics sequence 0, allways 94 char set */ #define CF_GS_1 5 /* (UoR) GS 1, 94 char. set */ #define CF_GS_2 6 /* (PWP) GS 2, 94 char. set */ #define CF_GS_3 7 /* (PWP) GS 3, 94 char. set */ #define CF_T_ST 8 /* (PWP) Toss chars till ST */ #define CF_DCS 9 /* (PWP) In a device control string sequence */ /* (UoR) constansts that point to the function definitions for arrow keys */ /* Used by mouse cursor positioning func. (chars that are transmitted last) */ # define UPARROW 'A' # define DOWNARROW 'B' # define leftARROW 'D' # define rightARROW 'C' #ifdef notdef extern int lineheight; extern int charwidth; extern int chardescent; #endif #define MOVEBEGLINE(v) MoveTo ((LEFTMARGIN), \ (((v) + 1) * termw->lineheight + TOPMARGIN - termw->chardescent)) #define MOVETOCHAR(h,v) MoveTo (((h) * termw->charwidth + LEFTMARGIN), \ (((v) + 1) * termw->lineheight + TOPMARGIN - termw->chardescent)) typedef unsigned char *ucharptr; #define MAX_ARGCOUNT 16 /* max number of CSI ; ; ... CMD args */ #define NUMBUFSIZ 16 /* max. length of digits or intermeadiate chars */ /* in a paramater string */ /* stuff for text styles */ /* these styles we actually do with toolbox */ #define STY_STY 0x0F #define STY_MSTY 0x07 /* styles that the Mac toobox can do */ #define STY_FONT 0xF0 #define VT_UNDER 1 /* character style type bits */ #define VT_BLINK 2 #define VT_BOLD 4 #define VT_INVERT 8 #define VT_SNGL 0 /* line style types (pick one, not ORable) */ #define VT_DBLW 1 #define VT_DBLH_T 2 #define VT_DBLH_B 3 #define F_VTLAT1 0 #define ANS_VT100AVO "\033[?1;2c" #define ANS_VT102 "\033[?6c" #define ANS_VT320 "\033[63;1;2;8;9c" #define ANS_VT52 "\033/Z" #define ANS_H19 "\033/K" /* * Struct to describe a terminal window. */ struct termw { struct termw *next; /* pointer to next in list */ WindowPtr window; /* Window Pointer */ Rect ScreenRect; ControlHandle t_vscroll; WindowRecord terminalWRec; ucharptr *scr, *scr_attrs; /* virtual screen pointer */ ucharptr *real_scr; /* The real screen, */ /* including scrollback */ ucharptr *real_attrs; /* the attributes of each character */ int display_topline; /* top line actually displayed */ int display_totlines; /* number of real lines in screen + */ /* scrollback */ int curlin, curcol; /* Cursor position */ int scrtop, scrbot; /* Absolute scrolling region bounds */ int current_font; int current_size; /* used to determine if we need */ /* to change the QD style */ int textstyle; /* (UoR) current style */ int current_style; unsigned char *line_attrs; /* the attrs of each (virt) line */ unsigned char *real_ln_attrs; /* real ptr to beginning of these */ int draw_sing_chars; int font_is_locked; int lineheight; int charwidth; int chardescent; int out_maxcol, out_mincol; int oldlin; int oldcol; /* (UoR) for last mouse position */ int saved_tlin; /* scroll_amount/high-speed scrolling*/ int saved_blin; /* (PWP) variables for controling the selected text */ int from_lin; int from_col; int to_lin; int to_col; Boolean have_selection; int cursor_invert; /* (UoR) for flashing cursor */ int cur_drawn; long last_flash; int mousecurs_drawn; /* (PWP) is the mouse cursor drawn? */ int in_front; /* true when we are the front window */ int showing; /* true when the window is showing */ int scroll_drawn; /* 1 when thumb drawn, 0 not, */ /* -1 when we don't know */ int screensize; /* number of lines on screen */ int topmargin; /* Edges of adjustable window */ int bottommargin; int graphicsinset[4]; /* (UoR) current character sets */ int Gl_set; /* (UoR) current chosen set */ int Gr_set; /* (PWP) current chosen RH set */ int old_Gl_set; /* set to come back to after */ /* single shift GL */ int ch_protect; /* Flag for protected characters */ int screeninvert; /* (UoR) inverted screen flag */ int insert; int newline; /* (UoR) linefeed mode by default */ int autowrap; /* Autowrap on by default */ int relorigin; /* (UoR) relative origin off */ int autorepeat; /* (UoR) auto repeat flag */ int appl_mode; /* (PWP) keypad application mode */ int curskey_mode; /* (PWP) cursor key application mode */ int smoothscroll; /* do smooth scrolling (PWP: or not) */ int scroll_amount; /* #lines of scroll we have saved up */ int refresh_amount; /* number of lines yet to refresh */ int dispcontchar; /* do not show control characters */ int blockcursor; /* show block or underline cursor */ int cursor_shown; /* (PWP) show the cursor */ int mouse_arrows; /* mouse down does arrow keys */ int visible_bell; /* true if blink instead of bell */ int eightbit_disp; /* do 8 bit wide to the screen */ int nat_char_mode; /* true if 7 bit national character */ /* sets rather than ISO 8859 */ int nat_set; /* national char. set used */ int blinkcursor; /* true if we make the cursor blink */ int savlin; /* Cursor save variables */ int savcol; int savsty; int savfnt; int savGl; int savGr; int savmod; int savset[4]; int charflg; /* state variable */ char intermedbuf[NUMBUFSIZ]; /* intermed. char buffer */ char *intermedptr; char paramarg[MAX_ARGCOUNT][NUMBUFSIZ]; /* (non-num) param buf */ char *argptr; int numarg[MAX_ARGCOUNT]; /* numeric argument buffer */ int argcount; char numbuf[NUMBUFSIZ]; /* buffer for collecting numbers */ char *numptr; /* into numarg */ }; /* * externals */ extern struct termw *ttermw; extern struct termw *ctermw;