#sccs "@(#)uts/kern/sys:wd.h 1.2" /* Unix Window System Common Definitions and Structures */ #ifndef WD_H #define WD_H #include "sys/param.h" #include "sys/iohw.h" #include "sys/font.h" #include "sys/window.h" /* Cursor Params */ #define CURONTICKS (HZ/2) /* cursor on time */ #define CUROFFTICKS (HZ/4) /* cursor off time */ #define CURFAIRCNT 2 /* fairness count (see wd.c) */ #define CURFAIRTICKS (HZ/4) /* fairness on time (see wd.c) */ /* Clicks */ #define btopxc(x) (((int)(x)+1) & (~1)) /* ansi interpreter states */ #define NORM 0 /* normal characters */ #define ESC 1 /* received ESC (0x1b) */ #define CSI 2 /* received CSI (ESC [) */ #define PARAM 3 /* parsing parm string */ #define TRUNC 4 /* truncating a long line */ /* ansi flags */ #define ANOWRAP 0x1 /* truncate, don't wrap */ #define ALASTLF 0x2 /* last control char was nl */ #define ACUROFF 0x4 /* cursor off, don't blink */ /* ansi attributes */ #define ATTRNORM 0x0 /* no attributes */ #define ATTRUNDER A_UNDERLINE /* underlined */ #define ATTRREV A_REVERSE /* inverse video */ #define ATTRBOLD A_BOLD /* bold (one to left) */ #define ATTRSTRIKE A_STRIKE /* strike-out */ #define ATTRDIM A_DIM /* dim (and'ed with half-tone */ /* other ansi parameters */ #define NAPARAM 16 /* max number of parameters */ #define UNDLRATIO 12 /* undline thickness = vs/this */ #define STRKRATIO 2 /* strkline row = baseline/this */ /* system patterns */ #define PATBLACK 0 /* all black */ #define PATWHITE 1 /* all white */ #define PATGRAY 2 /* half-tone */ #define PATLTGRAY 3 /* quarter-tone */ #define PATDKGRAY 4 /* reverse semi 1/4 tone */ #define PATBGROUND PATLTGRAY /* background */ #define PATFGROUND PATBLACK /* foreground */ #define PATCURSE PATWHITE /* cursor pattern */ /* border parameters */ #define BORDTOP 20 #define BORDBOT 20 #define BORDLEFT 6 #define BORDRIGHT 28 /* w_flags */ #define WDOPEN 0x01 /* opened */ #define WDINIT 0x02 /* inited */ #define WOLGC 0x04 /* garbage collection flags */ #define WGCSKIP 0x08 /* " */ #define WDWRITE 0x10 /* writing */ #define WDESC 0x20 /* double esc flag */ /* Generic Rectangle */ struct recdef { unsigned short rec_ulx; /* upper-left x */ unsigned short rec_uly; /* upper-left y */ unsigned short rec_lrx; /* lower-right x (exclusive) */ unsigned short rec_lry; /* lower-right y (exclusive) */ }; typedef int (*fint)(); /* Window Structure */ struct windef { struct recdef w_rec; /* window dimensions */ struct recdef w_inrec; /* rectangle inside borders */ struct oldef *w_ol; /* obscured list */ struct windef *w_back; /* window behind this one */ struct windef *w_front; /* window in front of this one */ struct windef *w_parent; /* parent window */ struct tty *w_tp; /* window teletype pointer */ struct windef *w_outlist; /* list of windows with output */ char w_flags; /* window status flags */ unsigned short w_uflags; /* user settable flags */ unsigned char w_hs; /* horizonal spacing */ unsigned char w_vs; /* vertical spacing */ unsigned char w_baseline; /* baseline */ struct wfont *w_font[8]; /* window font ptrs */ char w_astate; /* ansi parser state */ char w_iparam; /* parameter index */ char w_nparam; /* parameter count */ short w_aparam[NAPARAM];/* parameters */ fint *w_adisp; /* ptr to dispatch table */ unsigned char w_aflags; /* ansi flags */ unsigned char w_attr; /* current attributes */ unsigned short w_cx; /* current x (relative to wdw) */ unsigned short w_cy; /* current y */ struct fntdef *w_cff; /* ptr to current fntdef */ char w_mflags; /* mouse flags */ struct icon w_micon; /* mouse icon */ struct recdef w_mrec; /* mouse motion rectangle */ char *w_text[WTXTNUM];/* window text pointers */ }; /* Obscured Rectangle */ struct oldef { struct recdef ol_rec; /* dimensions of obs. on screen */ struct windef *ol_lobs; /* ptr to frontmost wp */ struct oldef *ol_next; /* next oldef in a chain */ struct oldef *ol_last; /* prev oldef in a chain */ short *ol_base; /* ptr to pixels */ short ol_width; /* bytes wide of pixel map */ }; /* display list item (used in wrastop()) */ struct dldef { struct recdef dl_rec; /* size of display bitmap */ struct dldef *dl_next; /* next item */ struct oldef *dl_ol; /* ol containing pixels */ }; #endif WD_H