home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource4
/
263_01
/
c_wndw.h
< prev
next >
Wrap
Text File
|
1990-02-15
|
12KB
|
327 lines
/* header file for windowing system
*
* Copr. (c) Marietta Systems, Inc. 1987,1988,1989
* All rights reserved
* Version 1.2x
*
* This header file declares the functions for the windowing system
* Globals for the windowing system.
*
*/
/*
* * * * * * * * *
* Figure out which compiler is being used
*
*/
#ifdef _CDECL
#define QUICKC
#endif
#ifdef _Cdecl
#define TURBOC
#endif
#ifndef LATTICE
typedef unsigned char byte;
#define _STACK _stklen
#endif
/*
*/
enum fld_type {alphanum, graphic, flag, boolean, calendar, numeric, value,
real, chrono};
enum COLOR_OF {Mblack,Mblue,Mgreen,Mcyan,Mred,Mmagenta,Myellow,Mwhite};
enum _JUST {left, right, as_typed, center, code, decimal, db_number,
c_number, date, _time};
enum ATTRIB {low,high,reverse,blink,blank,alt_low,alt_high,alt_reverse}
OLD_BRIG = low;
enum F_READ {firstrec, previous, nextrec, lastrec, random, relative};
enum F_MODE {append, readonly, recreate, update};
enum F_TYPE {ascii, binary, dbase3, hashed, marietta};
struct CURSR {int X,Y;} _CURSOR; /* Current cursor position in window */
struct WINDW { /* window tracking struct */
void *sobj; /* pointer to list of screen objects */
byte *SCREEN, *FUNCTION;
struct CURSR LOCN;
int X, Y; /* location of top left corner of window */
int H, W; /* height and width of window, including borders */
int P;
int CODE, K, Z, sequ, tx, ty;
} *WINDOW;
struct CLR_TYPE {
enum COLOR_OF FORE, BACK;
int ALT_CLR;
};
struct F_DEF { /* file definition control struct */
long prime; /* size of file in records */
long location;
long r_count; /* active (IN_USE) record count (set by program) */
byte *record; /* pointer to start of record */
void *fnext; /* pointer to data dictionary */
void *fptr[5];
enum F_TYPE ftype; /* type of file */
int key_len, offset; /* key info for hashed files */
int start; /* size of header area at start of file */
unsigned rec_len; /* record length */
unsigned fbloc;
int keycode;
int ismemo; /* set 1 if .DBF file with associated memo file */
int write;
int ndx;
int realfile; /* contains the real file handle of the file */
unsigned bufsize;
char fvol; /* disk/volume code */
char fpath[61]; /* directory path */
char fname[13]; /* file name with extension */
} *FN;
struct DBF_DEF { /* dBase III Plus data dictionary struct */
void *dnext;
enum _JUST just; /* justification code of field (modifyable) */
int dbf_len; /* dBASE field length */
int dbf_dec; /* decimals for an N type field */
int dbf_set; /* Active field (set by program) */
int dbf_dig; /* justify() and accept() 'len' parameter */
unsigned posn; /* position of start of field in record */
unsigned ndxfield;
byte dbf_name[11]; /* field name in ASCIIZ format */
byte dbf_type; /* Type (C, D, L, M, N) */
};
/*
* * * * * * * * * * * *
* Initiation of globals for the windowing system.
*
*/
long _SIZMEM;
unsigned SCRN_PTR, CLR_PTR = 0X0000, _DSEG, _DOFF, CLR_SEG = 0XB800,
MONO_SEG = 0XB000;
unsigned short SCR_SIZE, OLD_CODE, _brkflag;
unsigned INCHAR, INCHAR_F;
int INS_FLAG = 1, W_NUM = 0, CLR_INIT = 0;
int COLOR_SC, EGA_SCRN, CLR_CODE;
byte *MEM_LINE;
char *xgoodbye;
struct CLR_TYPE COLOR [7] = { /* number of elements must match
* "_COLORS" configuration constant */
{Mgreen, Mblack, 6}, /* base window color, #0 */
{Mwhite, Mblue, 3}, /* color #1 */
{Mcyan, Mblack, 4}, /* color #2 */
{Mcyan, Mred, 5}, /* color #3 */
{Mwhite, Mmagenta, 2}, /* color #4 */
{Myellow, Mblack, 1}, /* color #5 */
{Mwhite, Mred, 0}, /* color #6 */
};
struct CLR_TYPE TOP_CLR = {Myellow,Mblue,6}; /* top line color */
struct CLR_TYPE ER_COLOR = {Mgreen,Mred,6}; /* bottom line color */
unsigned KEYMATCH[8] /* the key match array which determines which
* function keys are treated as 'end-of-field'
* keys by the 'isendch' function */
= {0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0};
byte *KEY_DISPLAY[7] = {"Srch", "Move", "Ins", "Del", "Zoom","Amnd", "AKey"};
/* meanings for function keys F3 through F9 displayed on bottom line */
byte *BANNER_MSG = /* Modifyable initial window display on software loading */
" The \"c_wndw\" (tm) and \"c_ndx\" (tm) toolkits \n\
are the copyright of Marietta Systems, Inc. \n\
1987, 1988, 1989. All rights reserved. \n\
Release Version 2.01 - 8/30/89 ";
/*
* * * * * * * * * * * * *
* Configuration constants
*
* Change their initial value to suit your set-up
* - but be careful!!
*
*/
int CLR_TONE = 25; /* controls display of copywrite box by 'clr_scrn()' */
int A_TRACK = -1; /* used by 'accept()' function */
int SAVEWAIT = 900; /* clock ticks before 'scrnsave(0)' flushes file buffers */
enum ATTRIB ACC_DISP = reverse; /* Attribute of accept() fields after entry */
int ERR_BEEP = 2; /* For beep length with 'shortbeep()', 0 = tiny beep */
int UP_NAME = 0; /* 1 if names are to be in uppercase only */
int FLD_FULL = 1; /* 1 for auto ENTER on full field; 0 = ENTER required */
int TAB_SET = 4; /* size of tab increments on screen for '\t' code */
int _WINDW = 10; /* maximum number of windows */
int _COLORS = 7; /* maximum number of different color selections */
int SCRN_LEN = 25; /* screen length in lines */
int SCRN_WID = 80; /* screen width in columns */
int TOP_LINE = 1; /* lines dedicated to the "top-frame" at top of screen */
int BOT_LINE = 1; /* True if active keys to be displayed on bottom line */
int MENULINE = 1; /* True to display assist line for menus */
int ERRORMSG = 1; /* True to display non-critical errors with sys_wndw() */
int GOODBYEMSG = 1; /* True to display end of program message */
int MAXFILES = 9; /* maximum number of files to create file buffers */
int D_FORMAT = 'U'; /* U for USA format, E for european, I for intl */
int D_PUNCT = '/'; /* punctuation character for date formats */
int D_20XX = 10; /* split between 20xx and 19xx in years */
int PERIOD = '.'; /* decimal point character */
int COMMA = ','; /* thousands seperator */
int BOOL_YES = 'Y'; /* The TRUE or YES boolean entry code */
int BOOL_NO = 'N'; /* The FALSE or NO boolean entry code */
int CLOCK24 = 0; /* 0 for am/pm, or 1 for 24 hour european/military time */
int QTRHOUR = 0; /* */
int T_PUNCT = ':'; /* time punctuation character, default colon */
unsigned DISCBLCK = 4100; /* maximum record size of any file to be opened,
* Minimum size is 512, but recommended minimum is 2060.
* if actual record size is less than one third of this size,
* the file access software will perform disk caching
* Maximum size is 65000 */
short MEM_WARN = 1024; /* Warning will be issued when unused heap memory is
* under this. Maximum is 9999, minimum is 0 */
long MAX_WIND = 15000L; /* maximum amount of heap space for windowing
* functions. The maximum size is 65000, and the minimum size
* of MAX_WIND should be 8500. To calculate, use the formula:-
* ((number of windows * average size * 2) + 2500)
* where 'average size' is (height * width) */
long _MNEED = 20000L; /* minimum heap space needed, which must be
* at least MAX_WIND + 5000. */
unsigned _STACK = 10000; /* size of stack, (at least 7000) */
/*
* * * * * * * * * * *
* This section contains the #define codes
*
*/
#define CTL_A 1 /* all the other CTL combinations can be defined here */
#define PGDN 3
#define CRS_RT 4 /* Right cursor */
#define CRS_UP 5 /* Up cursor */
#define DEL 7
#define B_SPACE 8
#define TAB 9
#define CTL_ENT 10
#define SFT_TAB 11
#define ENTER 13
#define PGUP 18
#define CRS_LT 19 /* Left cursor */
#define CTL_BSPC 20 /* Ctrl + backspace */
#define INS 22
#define HOME 23
#define CRS_DN 24 /* Down cursor */
#define END 26
#define CTL_Z 26 /* 0X1A */
#define ESC 27
#define ALT_Q 129 /* The other ALT alpha keys can be defined here */
#define ALT_P 138 /* Print translated screen */
#define