home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Sybase Data Workbench Version 2.0
- ** Confidential property of Sybase, Inc.
- ** (c) Copyright Sybase, Inc. 1985-1988
- ** All rights reserved
- */
-
- /* screenio.h: 41.2 10/7/88 */
-
- /*
- **
- ** SCREENIO.H - Header for the Screen I/O Subsystem
- **
- */
-
- #define SCREENIO 1 /* Used to tell if screenio.h has *
- * been included by source code. */
-
- /* !!! */
- #if ((MSDOS || OS2) && _PCAPT_PRIVATE_)
- /*
- ** Special defines for the IBMPC console.
- */
- #include <scracc.h>
-
- extern char *ColorMap;
-
- /*
- ** Basic structure into which keyboard or mouse event is read.
- */
- typedef struct event
- {
- unsigned char inphystype; /* phys type of event that occurred*/
- short inmoux; /* physical x of mouse location picked */
- short inmouy; /* physical y of mouse location picked */
- char inkey; /* key just entered */
-
- /*
- ** inkey modifier - possible states: CNTRL, ALT, SHIFT & META.
- */
- unsigned short inaccent;
-
- char PAD;
-
- } EVENT;
- #endif /* If MSDOS or OS/2 and _PCAPT_PRIVATE_ */
-
- #if defined(SDBL_40)
- /*
- ** Moved REGION here from SYBFRONT.H =======================================
- */
- typedef struct region
- {
- short rgx; /* Starting (upper left) coordinates */
- short rgy;
- short rgwidth; /* Width (horizontal extent) */
- short rgheight; /* Height (vertical extent) */
- } REGION;
-
- #endif /* SDBL_40 */
- /*
- ** Typedefs
- */
-
- typedef unsigned char DBBOOL; /* Less likely to collide than "BOOL". */
-
- /*
- ** Pointers to functions returning ...
- */
-
- typedef int (*INTFUNCPTR)();
- typedef DBBOOL (*BOOLFUNCPTR)();
-
- typedef BYTE *POINTER;
-
- typedef int SYBINT;
-
- /*
- ** ===========================================================================
- */
-
- /*
- ** General type definitions for screen I/O
- */
-
- typedef unsigned char BITFLD; /* Byte Field - 8 bits */
- typedef unsigned short SBITFLD; /* Short Field - 16 bits */
- typedef SBITFLD FLAGS; /* Flags (bitmask) */
- typedef SBITFLD FONT; /* Font/Size (bitmask) */
- typedef unsigned char SYBCOLOR; /* Color/Grey-scale */
- typedef SBITFLD VIDEO; /* Video Attribute */
- # define CHOICEVAL short /* Values which id an option or menu */
-
-
- /*
- ** Standard Screen I/O Command Tokens
- */
-
- #define TKSPBAR (CHOICEVAL)0 /* Selectport bar identifier */
- #define TKBEGSIO (CHOICEVAL)1 /* begin standard screen I/O tokens */
- #define TKBEGEDIT (CHOICEVAL)1 /* begin editing tokens */
- #define TKCURSUP (CHOICEVAL)1 /* cursor up */
- #define TKCURSDN (CHOICEVAL)2 /* cursor down */
- #define TKCURSLT (CHOICEVAL)3 /* cursor left */
- #define TKCURSRT (CHOICEVAL)4 /* cursor right */
- #define TKTAB (CHOICEVAL)5 /* tab key */
- #define TKBACKSP (CHOICEVAL)6 /* backspace */
- #define TKCR (CHOICEVAL)7 /* carriage return */
- #define TKNWORD (CHOICEVAL)8 /* move to next word */
- #define TKPWORD (CHOICEVAL)9 /* move to previous word */
- #define TKNEXT (CHOICEVAL)10 /* move to next object */
- #define TKPREV (CHOICEVAL)11 /* move to previous object */
- #define TKBEGLINE (CHOICEVAL)12 /* move to beginning of line */
- #define TKENDLINE (CHOICEVAL)13 /* move to end of line */
- #define TKBEGENTRY (CHOICEVAL)14 /* move to beginning of ENTRY */
- #define TKENDENTRY (CHOICEVAL)15 /* move to end of ENTRY */
- #define TKENFORWARD (CHOICEVAL)16 /* scroll ENTRY forward */
- #define TKENBACK (CHOICEVAL)17 /* scroll ENTRY back */
- #define TKDELLINE (CHOICEVAL)18 /* delete current line */
- #define TKDELCHAR (CHOICEVAL)19 /* delete current character */
- #define TKDELWORD (CHOICEVAL)20 /* delete current word */
- #define TKDELENTRY (CHOICEVAL)21 /* delete entire entry */
- #define TKENDEDIT TKDELENTRY /* last editing token */
-
- /* standard selport tokens */
- #define TKHELP (CHOICEVAL)22 /* help */
- #define TKBEGSP TKHELP /* beginning of selport tokens */
- #define TKEXIT (CHOICEVAL)23 /* exit */
- #define TKUP (CHOICEVAL)24 /* scroll up */
- #define TKDOWN (CHOICEVAL)25 /* scroll down */
- #define TKLEFT (CHOICEVAL)26 /* pan left */
- #define TKRIGHT (CHOICEVAL)27 /* pan right */
- #define TKPLUS (CHOICEVAL)28 /* plus, the scroll accelerator */
- #define TKTOOLS (CHOICEVAL)29 /* the tools select option */
- #define TKCOMMAND (CHOICEVAL)30 /* command introducer */
- #define TKENDSP TKCOMMAND /* end of selport standard tokens */
-
- #define TKMETA (CHOICEVAL)31 /* begins a function key string */
- #define TKINTERRUPT (CHOICEVAL)32 /* interrupt key*/
- #define TKVALUES (CHOICEVAL)33 /* show values list */
- #define TKREDRAW (CHOICEVAL)34 /* redraw the screen */
- #define TKPRSCREEN (CHOICEVAL)35 /* print the screen */
- #define TKVPDUMP (CHOICEVAL)36 /* dump viewport to file */
- #define TKRECORD (CHOICEVAL)37 /* record input events */
- #define TKPLAYBACK (CHOICEVAL)38 /* play back stored input events */
- #define TKPORT (CHOICEVAL)39 /* change port - toggle txt/selport */
- #define TKCHGWIN (CHOICEVAL)40 /* change window */
- #define TKFUNCKEY (CHOICEVAL)41 /* function key */
-
- /* tokens for keystroke files */
- #define TKKEYSTACK (CHOICEVAL)42 /* key stack follows */
- #define TKTEXT (CHOICEVAL)43 /* user text follows */
- #define TKCLICK (CHOICEVAL)44 /* user click follows */
- #define TKMOVE (CHOICEVAL)45 /* user locator move follows */
- #define TKINCLUDE (CHOICEVAL)46 /* include keystroke file */
-
- #define TKENDSIO TKMOVE /* current end of screen I/O tokens */
- #define TKMAXSIO (CHOICEVAL)60 /* maximum screen I/O token */
-
- #define TKKEY_CNTRL (CHOICEVAL)995 /* Control key accent. */
- #define TKKEY_ALT (CHOICEVAL)996 /* Alternate key accent. */
- #define TKKEY_SHIFT (CHOICEVAL)997 /* Shift key accent. */
- #define TKKEY_META (CHOICEVAL)998 /* Meta or composite key accent. */
-
-
-
- /*
- ** Define Logical Key Numbers for Fast Key Binding
- */
-
- #define LKEYS 30 /* number of logical keys */
-
- #define LK1 1
- #define LK2 2
- #define LK3 3
- #define LK4 4
- #define LK5 5
- #define LK6 6
- #define LK7 7
- #define LK8 8
- #define LK9 9
- #define LK10 10
- #define LK11 11
- #define LK12 12
- #define LK13 13
- #define LK14 14
- #define LK15 15
- #define LK16 16
- #define LK17 17
- #define LK18 18
- #define LK19 19
- #define LK20 20
- #define LK21 21
- #define LK22 22
- #define LK23 23
- #define LK24 24
- #define LK25 25
- #define LK26 26
- #define LK27 27
- #define LK28 28
- #define LK29 29
- #define LK30 30
-
-
- /*
- ** Maximum number of VISIBLE windows.
- */
-
- #define WNMAXVISWIN 25
-
- /*
- ** Definitions for Fonts and Font Sizes
- */
-
- /* Parms for fontsize function */
- #define FTHEIGHT 0 /* caller is asking for char height */
- #define FTWIDTH 1 /* caller wants char width */
-
- /* Logical Fonts */
- #define FTROMAN 0x001 /* Standard serif face; default */
- #define FTBROMAN 0x002 /* Roman bold */
- #define FTITALIC 0x004 /* Italics */
- #define FTBITALIC 0x008 /* Italics Bold */
- #define FTHELVET 0x010 /* Helvetica - some non-serif face */
- #define FTBHELVET 0x020 /* Helvetica Bold */
- #define FTSPECIAL 0x040 /* Some special face- for selports */
- #define FTBSPECIAL 0x080 /* Special Bold - */
-
- /* Logical Font Sizes */
- #define FTSMALL 0x100 /* smallest size */
- #define FTMEDIUM 0x200 /* medium, the default size */
- #define FTLARGE 0x400 /* Large */
- #define FTVLARGE 0x800 /* Very Large */
- #define FTUNDEFINED 0x1000 /* Unspecified */
-
- #define FTSELPORT FTSPECIAL | FTMEDIUM /* selport logical font */
- #define FTSELTITLE FTSELPORT /* selport title font */
- #define FTMENU FTSPECIAL | FTMEDIUM /* menuline font */
- #define FTTEXTPORT FTBHELVET | FTMEDIUM /* default texport font */
-
-
-
- /*
- ** Definitions for Logical Colors/Gray Tones
- */
-
- #define CLNORMAL (SYBCOLOR)0 /* Normal, do nothing special */
- #define CLWHITE (SYBCOLOR)1 /* White */
- #define CLVLTGRAY (SYBCOLOR)2 /* Very light gray */
- #define CLLTGRAY (SYBCOLOR)3 /* Light gray */
- #define CLMIDGRAY (SYBCOLOR)4 /* Mid gray */
- #define CLDKGRAY (SYBCOLOR)5 /* Dark gray */
- #define CLBLACK (SYBCOLOR)6 /* Black */
-
- #define CLRED (SYBCOLOR)7
- #define CLORANGE (SYBCOLOR)8
- #define CLYELLOW (SYBCOLOR)9
- #define CLGREEN (SYBCOLOR)10
- #define CLBLUE (SYBCOLOR)11
- #define CLINDIGO (SYBCOLOR)12
- #define CLVIOLET (SYBCOLOR)13
- #define CLUNDEFINED (SYBCOLOR)14 /* Unspecified color */
-
- #define CLSELPORT CLVLTGRAY /* selectport background color */
- #define CLCOUNT 9 /* count of colors */
- #define CLGRAYCNT 4 /* count of special grays */
-
-
-
- /*
- ** Definitions for Logical Video Attributes
- */
-
- #define VONORMAL (VIDEO)0x000 /* Normal */
- #define VOREVERSE (VIDEO)0x001 /* Reverse video */
- #define VOUNDER (VIDEO)0x002 /* Underscore */
- #define VOBLINK (VIDEO)0x004 /* Blinking */
- #define VODIM (VIDEO)0x008 /* Dim; Half Intensity */
- #define VOBOLD (VIDEO)0x010 /* Bold; Bright Intensity */
- #define VOINVIS (VIDEO)0x020 /* Invisible (do not display) */
- #define VOALTSET (VIDEO)0x040 /* Alternate character set */
- #define VOHILITE (VIDEO)0x080 /* Highlight mode */
- #define VOINACTIVE (VIDEO)0x100 /* Inactive ("off") mode */
- #define VOUNDEFINED (VIDEO)0x200 /* Unspecified video mode */
- #define VOSELPORT (VIDEO)0x400 /* Video modes for selectports */
-
- #define VOOFFCHAR ':' /* Char for inactive, if terminal */
- /* cannot do an "off" mode */
-
- /*
- ** Offsets into ColorMap for desired effect.
- */
- #define CONORMAL 0x00
- #define COREVERSE 0x01
- #define COUNDER 0x02
- #define COBLINK 0x03
- #define CODIM 0x04
- #define COBOLD 0x05
- #define COINVIS 0x06
- #define COHILITE 0x07
- #define COINACTIVE 0x08
- #define COSELPORT 0x09
-
- #define COFRAME (COSELPORT + 1) /* Window border color */
- #define COTITLE (COFRAME + 1) /* Window title color */
-
- #define COSPORTH (COTITLE + 1) /* Selport on color */
- #define COSPORTL (COSPORTH + 1) /* Selport off color */
- #define COSPORTS (COSPORTL + 1) /* Selport highlight color */
-
- #define COSCROLLH (COSPORTS + 1) /* Scroll icon no color */
- #define COSCROLLL (COSCROLLH + 1) /* Scroll icon off color */
- #define COSCROLLS (COSCROLLL + 1) /* Scroll icon highlight color */
-
- #define COTOOLH (COSCROLLS + 1) /* Tools icon on color */
- #define COTOOLL (COTOOLH + 1) /* Tools icon off color */
- #define COTOOLS (COTOOLL + 1) /* Tools icon highlight color */
-
- #define COHELPH (COTOOLS + 1) /* Help icon on color */
- #define COHELPL (COHELPH + 1) /* Help icon off color */
- #define COHELPS (COHELPL + 1) /* Help icon highlight color */
-
- #define COEXITH (COHELPS + 1) /* Exit icon on color */
- #define COEXITL (COEXITH + 1) /* Exit icon off color */
- #define COEXITS (COEXITL + 1) /* Exit icon highlight color */
-
- #define COTEXTH (COEXITS + 1) /* Textport on color */
- #define COTEXTL (COTEXTH + 1) /* Textport off color */
- #define COTEXTS (COTEXTL + 1) /* Textport highlight color */
-
- #define COCOMMANDH (COTEXTS + 1) /* Command icon on color */
- #define COCOMMANDL (COCOMMANDH + 1)/* Command icon off color */
- #define COCOMMANDS (COCOMMANDL + 1)/* Command icon hightlight color*/
-
- #define COSPOPTH (COCOMMANDS + 1)/* Selport option on color */
- #define COSPOPTL (COSPOPTH + 1) /* Selport option off color */
- #define COSPOPTS (COSPOPTL + 1) /* Selport option highlight color*/
-
- #define COBUSYH (COSPOPTS + 1) /* Busy icon on color */
- #define COBUSYL (COBUSYH + 1) /* Busy icon off color */
- #define COBUSYS (COBUSYL + 1) /* Busy icon highlight color */
-
- #define COPRNH (COBUSYS + 1) /* Printer icon on color */
- #define COPRNL (COPRNH + 1) /* Printer icon off color */
- #define COPRNS (COPRNL + 1) /* Printer icon highlight color */
-
- #define COMNUTXTH (COPRNS +1) /* Menu text on color */
- #define COMNUTXTL (COMNUTXTH + 1) /* Menu text off color */
- #define COMNUTXTS (COMNUTXTL + 1) /* Menu text highlight color */
-
- /*
- ** Definitions for Logical Line Styles and Widths
- */
-
- /* Styles */
- #define LNDEFAULT 0x000 /* default line style */
- #define LNDOTTED 0x001 /* Dotted line */
- #define LNDASHED 0x002 /* Dashed line */
- #define LNDOTDASH 0x004 /* Dot-Dash line */
-
- /* Widths */
- #define LNNARROW 0x008 /* Narrow width */
- #define LNMEDIUM 0x010 /* Medium width */
- #define LNTHICK 0x020 /* Thick width */
- #define LNDOUBLE 0x040 /* Double line */
-
-
- /*
- ** Definitions for window areas and display types.
- */
-
- #define WNSPREPAIR (short)0 /* Damage repair of selport */
- #define WNTXTPORT (short)1 /* Normal printable ascii chars */
- #define WNBOUNDARY (short)2 /* Window boundary line */
- #define WNTPSPLINE (short)3 /* Special line drawing chars */
-
-
-
- /*
- ** INPSTACK - choicevalues which have been input on the currently
- ** active window
- */
-
- #define INSTACKMAX 10
-
-
- typedef struct inpstack
- {
- CHOICEVAL isvalues[INSTACKMAX];
- /* array of input choice values */
- short iscount; /* count of array elements */
- char *iscomment; /* description of functionality - */
- /* used for Logical Key binding */
- } INPSTACK;
-
-
- /*
- ** INPEVENT - input event; screenio internal data structure
- **
- */
-
- /* generic types of physical input events */
- #define INKEY 0x001 /* keyboard entry */
- #define INCLICK 0x002 /* locator click */
- #define INMOVE 0x004 /* locator motion */
- #define INFLUSHMOVE 0x008 /* flush to the last move */
-
-
- /* logical types of input events for */
- /* OPTION.optype and INPEVENT.intype */
-
- #define INMENU (unsigned char)1 /* menu line picked */
- #define INCXTOK (unsigned char)2 /* token set up in Cntxt */
- #define INLOCPIC (unsigned char)3 /* txtport location picked */
- #define INENTRY (unsigned char)4 /* an entry was last input */
- #define INERROR (unsigned char)5 /* input event error */
- #define INNOEVENT (unsigned char)6 /* no significant inp event */
-
-
- /* Bits for inflags */
- #define INCMDMODE (BITFLD)0x001 /* currently in cmd mode */
- #define INRECORDMODE (BITFLD)0x002 /* currently recording */
- #define INPLAYMODE (BITFLD)0x004 /* currently playing back */
- #define INWAITMODE (BITFLD)0x008 /* wait on playback */
- #define ININTERRUPT (BITFLD)0x010 /* an interrupt occurred */
-
- /* Handler return codes */
-
- #define HNDL_RETURN 1 /* Return control to client */
- #define HNDL_CONTINUE 2 /* Continue thru inpevent code*/
-
- typedef struct inpevent
- {
- BITFLD inflags; /* bits as defined above */
- BITFLD inmask; /* types of physical events wanted */
- unsigned char inphystype; /* phys type of event that occurred*/
- unsigned char intype; /* logical type of event that occurred*/
- short inphysx; /* physical x of a location picked */
- short inphysy; /* physical y of a location picked */
- short inoldx; /* last phys x (-1 initially) */
- short inoldy; /* last phys y (-1 initially) */
- char inkey; /* key just entered */
-
- /*
- ** inkey modifier - possible states: CNTRL, ALT, SHIFT & META.
- */
- unsigned short inaccent;
-
- CHOICEVAL intoken; /* current screen I/O token */
- INPSTACK *incurstack; /* currently input values */
- INPSTACK *inkeystack; /* fast key stack values */
- struct window *inwin; /* window on which input occurred */
- struct selport *inselport; /* use this selport for input */
- struct menu *inmenu; /* menu to execute */
- REGION *inregion; /* region to drag, size */
- struct scr_entry *inentry; /* text entry pointer */
- BOOLFUNCPTR inhandler; /* pointer to input handler function */
- } INPEVENT;
-
- /*
- ** OPTION - data returned from getoption
- */
-
- typedef struct option
- {
- unsigned char optype; /* logical type of event that occurred*/
- short oplogx; /* logical x on current win txtport */
- short oplogy; /* logical y on current win txtport */
- struct window *opwin; /* window on which option was entered */
- INPSTACK *opstack; /* inputs which occurred on opwin */
- } OPTION;
-
-
- /*
- ** ENTRY - text entry structure
- */
-
- /* Values for enedtype */
- #define ENTEXT (unsigned char)1 /* text, chars and numbers */
- #define ENALPHA (unsigned char)2 /* letters only */
- #define ENDIGIT (unsigned char)3 /* 0 - 9 only */
-
- /* Bits for enflags */
- #define ENEDIT (FLAGS)0x001 /* Can entry buffer be edited? */
- #define ENRETURN (FLAGS)0x002 /* Auto return when max len entered? */
- #define ENSAVESTAT (FLAGS)0x004 /* Should scroll status be preserved? */
- #define ENLITE (FLAGS)0x008 /* Is region currently hilited? */
- #define ENTRAP (FLAGS)0x010 /* Trap cursor motion toks in entry? */
- #define ENCHANGED (FLAGS)0x020 /* Has entry changed (touched)? */
- /* set only by entry mgr */
- #define ENERROR (FLAGS)0x040 /* Is an error message currently up? */
- /* set only by entry mgr */
- #define ENCR (FLAGS)0x080 /* Always return TKNEXT at CR */
- #define ENNOECHO (FLAGS)0x100 /* No echo of chars or cursorposition */
- #define ENNOSCROLL (FLAGS)0x200 /* Do not show scrolling characters */
- /* set only by entry mgr */
- #define ENTAB (FLAGS)0x400 /* Consider TAB same as TKNEXT */
- #define ENAUTOTAB (FLAGS)0x800 /* Consider full field same as TKNEXT */
-
-
- #define ENBACK "<" /* entry scroll back character */
- #define ENFORWARD ">" /* entry scroll forward character */
-
- #define ENAPPEND (DBINT)-9 /* offset value set for appends */
-
-
- /*
- ** ENFMTNODE - node stores format info as entry is scrolled
- ** region by region
- */
-
- typedef struct enfmtnode
- {
- DBINT enstartbuf; /* index into buffer of first char in region */
- struct enfmtnode
- *enfmtprev; /* previous node */
- } ENFMTNODE;
-
- /*
- ** ENFMTLINES - offsets to start/end of formatted lines
- */
- typedef struct enfmtlines
- {
- DBINT enfirst; /* offset of first source char on line */
- DBINT enlast; /* offset of last source char on line
- ** or (first + width - 1),
- ** whichever is less
- */
-
- } ENFMTLINES;
-
- /*
- ** ENSTATDATA - "status" data; data which may optionally be
- ** preserved by client between calls to getentry.
- */
-
- typedef struct enstatdata
- {
- char *enstring; /* formatted text for a region put here */
- struct enfmtlines
- *enlines; /* ptr to array of formatted line indices */
- struct enfmtlines
- *enprevlines; /* offsets save before reformatting */
- short enlnlast; /* index of enlines holding last significant */
- /* character in the region */
- DBINT eneditbuf; /* index into buffer of last char */
- /* edited. Cursor placed here. */
- ENFMTNODE
- *enfmtcur; /* pointer to current region's format node */
- struct scrmap
- *enmap; /* pointer to output map: only for bitmaps */
- } ENSTATDATA;
-
-
- /*
- ** ENMGRDATA - entry data private to entry manager
- */
-
- typedef struct enmgrdata
- {
- short enlocx; /* current x-coord of cursor */
- short enlocy; /* current y-coord of cursor */
- short enxforward; /* x-coord of scroll entry forward char */
- short enyforward; /* y-coord of scroll entry forward char */
- short enxback; /* x-coord of scroll entry back char */
- short enyback; /* y-coord of scroll entry back char */
- short enxpad; /* beginning x-coord of any padding chars */
- short enypad; /* beginning y-coord of any padding chars */
- short encount; /* count of chars in last insert/append/del */
- char enadddel; /* a = add chars; d = delete chars */
- DBBOOL enokchamode; /* after change locator position, */
- /* ok to change insert/append mode */
- struct window
- *enwin; /* window entry is on */
- struct window
- *enmsgwin; /* a window for error messages */
- } ENMGRDATA;
-
-
- typedef struct scr_entry
- {
- FLAGS enflags; /* bits as defined above */
- unsigned char enedtype; /* types above */
- REGION enregion; /* entry input & display region */
- char *enbuffer; /* pointer to buffer to hold entry */
- DBINT encurlen; /* current length of the buffer */
- DBINT enmaxlen; /* max entry length */
- DBINT enminlen; /* min entry length */
- char enpadchar; /* pad char for prompt line, or null */
- REGION *enmsgreg; /* ptr to region for messages */
- /* If NULL, one is made as needed */
- ENSTATDATA *enstatus; /* if NULL, buffer is formatted and */
- /* output from beginning; if client */
- /* wishes to preserve scroll status */
- /* of entry, s/he should keep this */
- /* pointer; else free it via a call*/
- /* to the function 'enstfree' */
- struct option *enoption; /* option info entered */
- ENMGRDATA *enmgr; /* private data for entry manager */
- } ENTRY;
-
-
- /*
- ** CNTLKEY - maps a control key to an input stack for
- ** fastkey binding
- ** Index in control key array is equal to the
- ** key's decimal value, except for DEL key
- ** which is the last entry in the array.
- ** Allocated in ldfastkeys.
- */
-
-
- #define CKEYLABEL 4 /* length of control key label string */
- #define FKEYLABEL 10 /* length of funct key label */
- #define FKEYLEN 12 /* length of transmitted fkey string */
- #define OFFEIGHT 95 /* offset into Ckey array for DEL key
- ** and eight bit characters (127-159)*/
-
-
- typedef struct cntlkey
- {
- char cklabel[CKEYLABEL + 1]; /* label on the key e.g. ^N */
- CHOICEVAL cktoken; /* bound to screenio token */
- struct inpstack *ckstack; /* bound to application stack*/
- } CNTLKEY;
-
-
-
-
- /*
- ** FUNCTKEY - holds the transmitted strings for function keys
- ** and special keys (printscreen, scroll, etc)
- ** and serves to bind these to inputs.
- ** Allocated and loaded in ldfastkeys.
- */
-
- typedef struct functkey
- {
- char fkstring[FKEYLEN + 1]; /* transmitted string */
- char fklabel[FKEYLABEL + 1]; /* label on the key */
- short fktermkey; /* key number in termdef */
- CHOICEVAL fktoken; /* bound to this sio token */
- struct inpstack *fkstack; /* bound to this stack */
- } FUNCTKEY;
-
-
- /*
- ** SCRMAP - Map of what is on the screen: for character terminals.
- ** Allocated in scralloc, called from physinit.
- ** Freed in scrfree, called from physend.
- ** Updated by the output routines:
- ** outtext, outline, outcorner, outground.
- ** Also used for optimization of ENTRYs on bitmaps
- */
-
-
- typedef struct scrmap
- {
- char *scchars; /* ptr to array lines * cols big */
- VIDEO *scvideo; /* array of video attrib for each char*/
- SYBCOLOR *scolor; /* color of each char - unused now */
- } SCRMAP;
-
- /* Maximum number of seloptions or menulines in a single menu */
-
- #define MAXMENULINES 15
- #define MAXOPTIONS 10
-
-
- /*
- ** MLPARMS - Menu Line Parameters.
- ** This structure is assigned by clients to
- ** specify a menu. Also see MUPARMS, below.
- */
-
- typedef struct mlparms
- {
- char *mlptext; /* Text to display */
- CHOICEVAL
- mlpchoiceval; /* value to indicate line chosen */
- struct muparms *mlpmuslide; /* Pointer to menu to execute if */
- /* this line brings up a "slide */
- /* off" menu. */
- DBBOOL mlpinitactive; /* Initial state active ? */
- int mlpid; /* Internal id used by menu editor */
- POINTER mlpproclist; /* Pointer to runtime processing list */
- } MLPARMS;
-
- /*
- ** MUPARMS - Menu Parameters.
- ** This structure is assigned by a client
- ** in order to specify a menu.
- */
- /* Bit fields for mupflags */
- #define MUREQ 0x001 /* Is a menu choice required? */
- #define MUSTICKY 0x002 /* Is user's choice sticky? (Last */
- /* choice becomes next default) */
- typedef struct muparms
- {
- char *muptitle; /* Menu title (ignored if selbar menu)*/
- short mupxnorm; /* Normalized coords of upper left */
- short mupynorm; /* corner of menu (ignored if is a */
- /* selectbar menu). */
- BITFLD mupflags; /* Bits as defined above */
- MLPARMS *muplines; /* Pointer to array of mlparms */
- short mupcntlines; /* Count of lines */
- CHOICEVAL
- mupdefault; /* choice value of default line */
- } MUPARMS;
-
- /*
- ** SELPARMS - Selectport Parameters.
- ** Assigned by client to specify a selectport.
- */
-
- typedef struct selparms
- {
- char *spptitle; /* Selectport title */
- DBBOOL sppscroll; /* Is there a scroll icon? */
- MLPARMS *spphelp; /* Help option parameters */
- MLPARMS *sppexit; /* Exit parms */
- MLPARMS *spptools; /* Tools parms */
- MLPARMS *sppbar; /* Menu bar parms - ptr to array of */
- short sppbarcnt; /* Count of sppbar elements */
- } SELPARMS;
-
-
- /*
- ** MENULINE - Describes a line on a menu.
- ** Screen I/O internal data structure
- ** created from client's MLPARMS.
- */
-
- typedef struct menuline
- {
- char *mltext; /* Complete text to show */
- CHOICEVAL
- mlchoiceval; /* value to indicate chosen */
- struct menu
- *mlmuslide; /* slide off menu to execute */
- BITFLD mlstatus; /* see selopt status bits */
- DBBOOL mlinitactive;
- POINTER mlproclist;
- SYBCOLOR mlcolor; /* Color */
- } MENULINE;
-
- /*
- ** MENU - Describes a menu. Screen I/O internal
- ** data structure created from client's MUPARMS.
- */
-
- typedef struct menu
- {
- char *mutitle; /* title (ignored if selbar menu) */
- BITFLD muflags; /* as defined in MUPARMS */
- MENULINE
- *mulines[MAXMENULINES]; /* array of pointers to menulines */
- short mucntlines; /* count of lines */
- short mudefault; /* index of default line */
- short mulastline; /* last highlighted line */
- CHOICEVAL
- muchoice; /* choiceval of chosen menuline */
- REGION muregion; /* physical region of menu */
- short mutpwidth; /* logical width of menu textport */
- short mutpheight; /* logical height of menu textport */
- struct window
- *muwin; /* window created for the menu */
- } MENU;
-
-
- /*
- ** SELOPTION - Selectport Option.
- ** Screen I/O internal data structure
- ** created from client's SPOPTPARMS.
- */
-
-
- /* Bits for sostatus */
- #define SO_ON 0x001 /* Turn option on(normal; active) */
- #define SO_OFF 0x002 /* Turn option off (dehilite; */
- /* inactive) */
- #define SO_LITE 0x004 /* Highlite the option */
- #define SO_CHANGED 0x008 /* Has this option changed since */
- /* last sprefresh? */
-
- typedef struct seloption
- {
- CHOICEVAL sovalue; /* value to indicate picked */
- char *sotext; /* text for select bar options */
- MENU *somenu; /* menu to execute if opt picked */
- BITFLD sostatus; /* status bits as defined above */
- REGION soregion; /* physical region of the option */
- POINTER sophysmap; /* pointer to object holding physical */
- /* image of the option e.g. on Sun */
- /* it's a ptr to pixrect, elsewhere */
- /* it's a ptr to a char array */
- DBBOOL soinitactive;
- POINTER soproclist;
- SYBCOLOR socolor; /* Current color/status of this opt. */
- } SELOPTION;
-
-
- /*
- ** SELPORT - Selectport Structure. Screen I/O internal
- ** data structure created from clients SELPARMS
- */
-
- typedef struct selport
- {
- struct window *spwin; /* window selport is in */
- char *sptitle; /* Selectport title */
- POINTER spmaptitle; /* pointer to physical map of title */
- SYBCOLOR spcolortitle; /* color of title. */
- REGION spregtitle; /* region occupied by title */
- SELOPTION *spup; /* pointer to up icon opt */
- SELOPTION *spdown; /* down icon option */
- SELOPTION *spleft; /* pan left icon */
- SELOPTION *spright; /* pan right icon */
- SELOPTION *spplus; /* plus (scroll accelerator) icon */
- SELOPTION *sphelp; /* help icon */
- SELOPTION *spexit; /* exit icon */
- SELOPTION *sptools; /* special selbar option "Tools" */
- SELOPTION *spcommand; /* the command icon */
- SELOPTION
- *spbar[MAXOPTIONS]; /* array of options on bar */
- short spbarcnt; /* count of bar opts */
- SELOPTION *splastopt; /* option last picked */
- REGION spregion; /* physical region of entire selport */
- struct damage *spdamage; /* pointer to head of damage list */
-
-
-
-
- } SELPORT;
-
-
- /*
- ** VIEWPORT - Visible portion of textport.
- */
-
- typedef struct viewport
- {
- REGION vppregion; /* Viewport region expressed in */
- /* physical (screen) coordinates */
- REGION vplregion; /* Viewport region expressed in */
- /* logical (textport) coordinates */
- short vplastx; /* Last logical x-coord at chgwin */
- /* or chgport */
- short vplasty; /* Last logical y-coord */
- } VIEWPORT;
-
- /*
- ** TEXTLINE - Textport Line Buffer.
- */
-
- /*
- ** Special line drawing characters which may be inserted into the textport.
- */
-
- #define SPTPHLINE '\001'
- #define SPTPVLINE '\002'
- #define SPTPULCORNER '\003'
- #define SPTPURCORNER '\004'
- #define SPTPLLCORNER '\005'
- #define SPTPLRCORNER '\006'
- #define SPTPBOTTEE '\007'
- #define SPTPTOPTEE '\010'
- #define SPTPRIGHTTEE '\011'
- #define SPTPLEFTTEE '\012'
- #define SPTPCROSS '\013'
-
- typedef struct textline
- {
- char *tlline; /* Pointer to characters on line */
- VIDEO *tlvideo; /* Array of video attribute bit masks */
- /* for each character on the line */
- FONT *tlfont; /* Array of font/size bit masks */
- /* for each character on the line */
- SYBCOLOR *tlcolor; /* Array of character colors */
- /* for each character on the line */
- short tlheight; /* Height (physical dimension) of */
- /* tallest character on the line */
- /* (Used to determine line height */
- /* when multiple sized chars lie on */
- /* the same line) */
- char tltemp; /* Used to temporarily hold a char */
- /* while a '\0' has been inserted */
- /* in its place (used by display */
- /* routines to make any subset of */
- /* a line into a string) */
- DBBOOL tlfcvchg; /* TRUE if font, color, or video */
- /* changed from default for this line */
- DBBOOL tlspcchg; /* TRUE if any special line */
- /* character is on this line */
- } TEXTLINE;
-
- /*
- ** Textport Change list Defines
- */
-
- #define WNTPCHGEOL (short)-1 /* Change from (x,y) to end-of-line */
- #define WNTPCHGEOP (short)-2 /* Change from (x,y) to end-of-port */
-
- #define TPCHGMOVE 0 /* Move the viewport */
- #define TPCHGWRITE 1 /* TP change type = tp write */
- #define TPCHGCLEAR 2 /* Clear the textport */
-
- /*
- ** TCHANGE - Textport Changes (used to optimize refresh)
- */
-
- typedef struct tchange
- {
- int tctype; /* Type of change (see above) */
- short tcx; /* Starting location of change (in */
- short tcy; /* logical coordinates) */
- FONT tcfont; /* Font of change (if type = write) */
- SYBCOLOR tccolor; /* Color of change (if type = write) */
- VIDEO tcvideo; /* Video of change (if type = write) */
- short tccount; /* Number of characters in the change */
- struct tchange *tcnext; /* Link to next element of list */
- } TCHANGE;
-
- /*
- ** TPNDCHG - Textport Pending Change.
- */
-
- typedef struct tpndchg
- {
-
- int octype; /* Type of change (see above) */
- short ocx; /* Starting location of the change */
- short ocy;
- FONT ocfont; /* font of the change */
- SYBCOLOR occolor; /* color of the change */
- VIDEO ocvideo; /* video of the change */
- char *octext; /* Text of the change */
- struct tpndchg *ocnext; /* Link to next element of list */
- } TPNDCHG;
-
- /*
- ** DAMAGE - Damage List Node.
- */
-
- typedef struct damage
- {
- REGION dmregion; /* Region describing damage in */
- /* physical coordinates */
- struct damage *dmprev; /* Link to previous list item */
- struct damage *dmnext; /* Link to next list item */
- } DAMAGE;
-
- /*
- ** TEXTPORT - Textport Structure. ### Not Fully Defined ###
- */
-
- typedef struct textport
- {
- REGION tplregion; /* Textport region (logical coords) */
- REGION tppregion; /* Textport region (phys. coords) */
- VIEWPORT *tpviewport; /* Viewport */
- TEXTLINE **tplines; /* Textport data lines */
- char *tplinblk; /* Pointer to line list storage */
- VIDEO *tpvidblk; /* Pointer to video storage block */
- SYBCOLOR *tpcolblk; /* Pointer to color storage block */
- FONT *tpfntblk; /* Pointer to font storage block */
- FONT tpdfont; /* Default font/size for textport */
- FONT tpfont; /* Current font/size for textport */
- SYBCOLOR tpdcolor; /* Default color for the textport */
- SYBCOLOR tpcolor; /* Current color for textport chars */
- VIDEO tpdvideo; /* Default video attribute */
- VIDEO tpvideo; /* Current video for textport chars */
- SYBCOLOR tpbckgnd; /* Current textport background color */
- TCHANGE *tpchg; /* Textport change list */
- TCHANGE *tpchgend; /* End of change list */
- TPNDCHG *tppndchg; /* Pending change list */
- TPNDCHG *tppndend; /* End of pending change list */
- short tpcurx; /* coordinates of last (most */
- /* recent) textport change */
- short tpcury;
- DAMAGE *tpdamage; /* List of regions in viewport */
- /* damaged due to overlay by other */
- /* windows (physical coordinates) */
- } TEXTPORT;
-
- /*
- ** Window Flags
- */
-
- /* Window placement definitions for wnwinx, wnwiny functions */
-
- #define WNUPLEFT 1
- #define WNUPRIGHT 2
- #define WNLOWLEFT 3
- #define WNLOWRIGHT 4
- #define WNCENTER 5
-
- /* Wnmgrflags - Private Window System Flags */
-
- #define WNACTIVE (FLAGS)0x001 /* Window is ACTIVE (current) */
- #define WNTPREFRESH (FLAGS)0x002 /* Refresh entire textport */
- /* (regardless of changes) */
- #define WNNEWWIN (FLAGS)0x004 /* Window is new (never refreshed) */
- #define WNSPREFRESH (FLAGS)0x008 /* Refresh entire selectport */
- #define WNSPCHANGED (FLAGS)0x010 /* Part of selectport changed */
- /* If WNSPREFRESH or WNSPCHANGED */
- /* wnrefresh must call sprefresh */
- #define WNOPEN (FLAGS)0x020 /* Window is currently open */
- #define WNIAMWINDOW (FLAGS)0x040 /* Shows that struct is a window */
- #define WNSAFEREFRESH (FLAGS)0x80 /* Assume no update regions overlap */
-
-
- /* Wnflags - General Window Flags set by client */
-
- #define WNBOX (FLAGS)0x001 /* Box the window */
- #define WNUSRWIN (FLAGS)0x002 /* Normal "user" window */
- #define WNMENUWIN (FLAGS)0x004 /* Menu window */
- #define WNPREVINPUT (FLAGS)0x008 /* Keep input status of previously */
- /* visible windows */
- #define WNNOINPUT (FLAGS)0x010 /* Do not accept input on this win */
- /* (default is input accepted) */
- #define WNPREVSELPORT (FLAGS)0x020 /* If no selport, accept input on */
- /* most recent parent's selport*/
- #define WNSPLAST (FLAGS)0x080 /* Last place saved was in selport */
- #define WNVPLAST (FLAGS)0x100 /* Last place save was in viewport */
- #define WNNOTEXTPORT (FLAGS)0x200 /* This window is viewport-less. */
- #define WNSUBWINDOW (FLAGS)0x400 /* Window placement important, window
- guarantees it will behave. */
-
-
- /*
- ** OVWINDOW - Overlapping Window List Node.
- */
-
- typedef struct ovwindow
- {
- struct window *owwin; /* Pointer to the overlapping window */
- struct ovwindow *ownext; /* Link to next element of list */
- } OVWINDOW;
-
- /*
- ** WINDOW - Window Structure.
- */
-
- typedef struct window
- {
- REGION wnregion; /* Region occupied by the visible */
- /* portion of the window expressed */
- /* in physical coordinates. */
- SELPORT *wnselport; /* Pointer to the window's selectport */
- TEXTPORT *wntxtport; /* Pointer to the window's textport */
- struct window *wnparent; /* Pointer to the parent */
- struct window *wnchild; /* Pointer to the child window */
- struct window *wnprevactive; /* Pointer to prev active window */
- OVWINDOW *wnovlapwin; /* List of overlapping window ptrs */
- FLAGS wnmgrflags; /* Flags private to window system */
- FLAGS wnflags; /* Flags set by window system client */
- /* as defined above */
- DAMAGE *wndamage; /* pointer to boundary damage */
- DAMAGE *wnclip; /* list of visible regions */
- DBBOOL wninpstatus[WNMAXVISWIN];
- /* Input status of previously */
- /* opened & refreshed windows */
- } WINDOW;
-
- /*
- ** CONTEXT - Screen I/O Environment
- */
- typedef struct context
- {
- WINDOW *cxrootwin; /* Pointer to the "root" window */
- WINDOW *cxactwin; /* Pointer to the active window */
- WINDOW *cxlastwin; /* Pointer to last active window */
- WINDOW *cxtailwin; /* Pointer to tail of window chain */
- INPEVENT *cxinpevent; /* Pointer to current input event */
- int (*cxinterrupt)();
- /* Pointer to function which returns */
- /* an int: the function to call */
- /* when an interrupt is received */
- /* Set by sioinit and calls to */
- /* siointerrupt. */
- DBBOOL cxcmdtokens[TKENDSIO];
- /* Status of token in context */
- } CONTEXT;
-
- /*
- ** Display List - Used for refresh and damage repair of screen.
- */
-
- typedef struct dispnode
- {
- short dnlogx; /* Logical x coordinate */
- short dnlogy; /* Logical y coordinate */
- short dnphysx; /* Physical x coordinate */
- short dnphysy; /* Physical y coordinate */
- short dncount; /* Number of contiguous chars in */
- /* this item */
- short dntype; /* Display type (see types below) */
- WINDOW *dnwindow; /* Pointer to window containing */
- /* this item */
- struct dispnode *dnnext; /* Next display element in list */
- } DISPNODE;
-
- /*
- ** Macro Definitions.
- */
-
- /*
- ** Selectport Accessing Macros.
- */
-
- #define SPWIDTH(sp) ((sp)->spregion.rgwidth)
- #define SPHEIGHT(sp) ((sp)->spregion.rgheight)
-
- /*
- ** Textport Accessing Macros.
- */
-
- #define TPGTFONT(win, x, y) (win->wntxtport->tplines[y-1]->tlfont[x-1])
- #define TPGTCOLOR(win, x, y) (win->wntxtport->tplines[y-1]->tlcolor[x-1])
- #define TPGTVIDEO(win, x, y) (win->wntxtport->tplines[y-1]->tlvideo[x-1])
- #define TPGTCHAR(win, x, y) (win->wntxtport->tplines[y-1]->tlline[x-1])
- #define TPGTSTR(win, x, y) (&(win->wntxtport->tplines[y-1]->tlline[x-1]))
-
- /*
- ** Text/Viewport size Macros
- */
-
- #define WNTPREGION(win) (&(win->wntxtport->tplregion))
- #define WNTPWIDTH(win) (win->wntxtport->tplregion.rgwidth)
- #define WNTPHEIGHT(win) (win->wntxtport->tplregion.rgheight)
- #define WNVPWIDTH(win) (win->wntxtport->tpviewport->vplregion.rgwidth)
- #define WNVPHEIGHT(win) (win->wntxtport->tpviewport->vplregion.rgheight)
- #define WNVPXLOC(win) (win->wntxtport->tpviewport->vplregion.rgx)
- #define WNVPYLOC(win) (win->wntxtport->tpviewport->vplregion.rgy)
- #define WNWINXLOC(win) ((win)->wnregion.rgx)
- #define WNWINYLOC(win) ((win)->wnregion.rgy)
- #define WNWINWIDTH(win) ((win)->wnregion.rgwidth)
- #define WNWINHEIGHT(win) ((win)->wnregion.rgheight)
-
- /*
- ** Definitions of the keyboard (ScanCode) mapping functions.
- */
- #define ESC_KEY (0x01U)
-
- #define RSHIFT_KEY_MASK (0x0001) /* The Right Shift Key. */
- #define LSHIFT_KEY_MASK (0x0002) /* The Left Shift Key. */
- #define SHIFT_KEYS_MASK (0x0003) /* Either L or R Shift Key. */
- #define CTRL_KEY_MASK (0x0004) /* The Control Key. */
- #define ALT_KEY_MASK (0x0008) /* The Alt Key. */
- #define SCROLL_LOCK_MASK (0x0010) /* The Scroll Lock Key. */
- #define NUM_LOCK_MASK (0x0020) /* The Num Lock Key. */
- #define CAPS_LOCK_MASK (0x0040) /* The Caps Lock Key. */
- #define INS_TOGGLE_MASK (0x0080) /* The Insert Key Toggle Mask. */
-
- #define BYTE_SHIFT (8) /* Shift to get only the scan code. */
- #define STATUS_MASK (0x00ff) /* Mask through only the status bits. */
- #define VALUE_MASK (0xff00)
-
- #define ALPHANUM_SCANCODE_END (0x39U) /* Highest alphanum scancode value.*/
-
- #define MAXCFGTABLE 256 /* 256 possible scan codes. */
-
- /*
- ** ScanCodes to exclude during normal key stroke processing.
- */
- #define SPACE_SC (0x39U)
- #define BACKSP_SC (0x0eU)
- #define O_ABRACKET_SC (0x33U)
- #define C_ABRACKET_SC (0x34U)
- #define O_CBRACKET_SC (0x1aU)
- #define C_CBRACKET_SC (0x1bU)
- #define COLON_SC (0x27U)
- #define DQUOTE_SC (0x28U)
- #define QUESTION_SC (0x35U)
- #define TILDE_SC (0x29U)
- #define TAB_SC (0x0fU)
- #define ENTER_SC (0x1cU)
- #define PAD_ENTER_SC (0xe0U)
- #define PAD_PLUS_SC (0x4eU)
- #define PAD_MINUS_SC (0x4aU)
- #define PAD_MUL_SC (0x37U)
- #define PAD_DIV_SC (0xe0U)
- #define BAR_SC (0x2bU)
- #define ESC_KEY_SC (0x01U) /* The ScanCode value for the ESC key. */
- #define COMMAND_KEY_SC (0x41U)
- #define HELP_KEY_SC (0x43U)
- #define EXIT_KEY_SC (0x44U)
-
- #define BEG_1ST_ALPHA_SC (0x10U) /* Fist line in the ALPHA section. */
- #define END_1ST_ALPHA_SC (0x19U)
- #define BEG_2ND_ALPHA_SC (0x1eU) /* Second line in the ALPHA section. */
- #define END_2ND_ALPHA_SC (0x26U)
- #define BEG_3RD_ALPHA_SC (0x2cU) /* Third line in the ALPHA section. */
- #define END_3RD_ALPHA_SC (0x32U)
-
- #define BEG_NUMPAD_SC (0x47U)
- #define END_NUMPAD_SC (0x53U)
-
- #define BEG_FUNCKEY_SC (0x3bU)
- #define END_FUNCKEY_SC (0x44U)
-
- #define BEG_NUMROW_SC (0x02U)
- #define END_NUMROW_SC (0x0dU)
-
- #define EXTENDED_SC (0xe0U)
-
- #define PAD_ENTER_VAL ((int)0x0d00)
- #define PAD_DIV_VAL ((int)0x2f00)
- #define INVERT_T_VAL ((int)0xe000) /* Interted T encoder */
-
- #define TOK_EVENT (0xaaU)
- #define CH_EVENT (0xbbU)
-