home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
257.img
/
PRO-C1.ZIP
/
HELP.ZIP
/
WINDOW.H
< prev
Wrap
C/C++ Source or Header
|
1990-05-28
|
18KB
|
653 lines
/* ==( hdr/window.h )== */
/* ----------------------------------------------- */
/* Pro-C - Copyright (C) 1988, 1989 Vestronix Inc. */
/* Modification to this source is not supported */
/* by Vestronix Inc. */
/* All Rights Reserved */
/* ----------------------------------------------- */
/* Written Geo 26-Aug-88 */
/* Modified Geo 24-Apr-90 See comments below */
/* ----------------------------------------------- */
/* %W% (%H% %T%) */
/*
* Modifications
*
* 24-Apr-90 Geo - Merged crtio.h,colour.h and mouse.h
* 13-Dec-89 Geo - New constants and fields
* 25-Oct-89 Geo - 1.32 Merge
*
*
*/
# ifndef _H_WINDOW /* Guard against multiple includes */
/* Auto low-level curses selection */
# ifdef UNIX
# ifndef TERMCAP
# ifndef TERMINFO
# define TERMINFO
# endif
# endif
# endif
/* Auto DEBUG Section */
# if defined(DEBUG) || defined(DEBUGI)
# ifndef WDEBUG
# define WDEBUG
# endif
# ifdef DEBUGI
# ifndef WDEBUGI
# define WDEBUGI
# endif
# endif
# endif
/* Physical constants */
# define W_PHY_WIDTH 150
# define W_PHY_HEIGHT 60
/* Actual space considerations */
# define W_PHY_WIDTHB (W_PHY_WIDTH * 2)
# define W_PHY_HEIGHTB W_PHY_HEIGHT
# define WNULL (struct window_rec *)0
/* Window structure */
struct xwinsize
{
int row; /* Start row of window, 0 - 24 */
int col; /* Start col of window, 0 - 79 */
int height; /* Height of window */
int width2; /* Width of window x2 */
};
/* Flags */
# define W_NEW 0x01 /* New window - draw it */
# define W_OLD 0x02 /* Old window - delete it */
# define W_MSK 0x03 /* Mask for old and new */
# define W_DUP 0x04 /* Duplicated memory - don't free it */
# define W_ACT 0x08 /* Window under active consideration */
/* Type fields in window header */
# define WT_NORMAL 0 /* Normal window */
# define WT_STATUS 1 /* Status status */
# define WT_V_SCROLL 2 /* Vertical scroll bar */
# define WT_H_SCROLL 3 /* Horizontal scroll bar */
/* Utility flags used by opt_w */
# define WO_SHADE 1 /* Shading on */
# define WO_OTHER 2 /* Other on */
/* Bit fields used on snowwait */
# define W_HORIZ 0x01 /* Wait for horizontal retrace */
# define W_VERT 0x02 /* Wait for vertical retrace, mv_w() */
/* Replacement for on create */
# define W_NEWIN (winptr->flags & W_NEW)
/* Faster update to window buffers : MUST call poke_w first, see disp_w() */
# define ADDPOKE(attr, ch) *++sysbase = (char)(ch),*++sysbase = (char)(attr)
struct window_rec
{
/*
* Doubly linked list
* - screens are built from scratch
*/
struct window_rec *next;
struct window_rec *prev;
struct window_rec *w_status; /* Status chain */
/* Sizes */
struct xwinsize wabs; /* Absolute window info, for writing */
struct xwinsize wrel; /* Relative window info, for display */
/* Pointers */
char *w_ptr; /* Pointer to window buffer */
char *w_plb; /* Pointer to Pending Line Buffer */
int *handle; /* pointer to handle */
int lplb; /* Line currently buffered */
/* Flags */
/* values will increase so keep as 8bit bytes */
unsigned char flags; /* Normal window flags */
unsigned char uflags; /* Utility flags */
unsigned char wtype; /* Window type */
unsigned char wnum; /* Debug to see change of windows don't use */
};
/* EXTERNs */
/* Data in win/mip/win.c */
extern int w_nrows;
extern int w_ncols;
extern struct window_rec *winptr;
extern int boxset; /* bench.c */
/* All this is to be updated - GEO - bench.c */
extern int ichar; /* bench.c */
extern char ibuf[]; /* bench.c */
/* Used to be colour.h */
/*
* Colour things
*/
extern char *colournames[];
extern char *strattr[];
extern char *strpattr[];
extern char *strsymbol[];
extern unsigned char colour[];
/*
* Other Environment things
*/
extern char editorname[];
extern short dbmnum;
extern short compilernum;
extern char snowwait;
extern int txt_compress;
extern int genoptflags[];
extern char choice_prompt[];
extern char scroll_prompt[];
extern char rescan_prompt[];
extern char invoke_prompt[];
extern char cont_prompt[];
extern char res_prompt[];
extern char move_prompt[];
extern char accept_prompt[];
extern char cancel_prompt[];
extern char exit_prompt[];
extern char help_prompt[];
extern char menu_prompt[];
extern char no_prompt[];
extern char ok_prompt[];
extern char popup_prompt[];
extern char select_prompt[];
extern char toggle_prompt[];
extern char yes_prompt[];
extern char proc_root[]; /* directory where PRO-C is loaded */
extern char exe_dir[]; /* directory to put executables in */
extern char menu_dir[]; /* directory to put menus in */
extern char record_dir[]; /* directory to put records in */
extern char report_dir[]; /* directory to put reports in */
extern char screen_dir[]; /* directory to put screens in */
extern char source_dir[]; /* directory to put C source in */
extern char batch_dir[]; /* directory to put batches in */
/* Using fill_w instead of clrbox_w */
# define clrbox_w(r,c,a,h,w) fill_w(r,c,a,h,w,' ')
/* --------------------- */
/* --- start crtio.h --- */
/* --------------------- */
# define BW 0 /* Mono */
# define MONO 0 /* Mono */
# define CGA 1 /* Colour */
# define EGA 1 /* Colour */
# define GRAPHIC 16
# define NORMAL 1
# define REVVID 2
# define UNDERLINED 3
# define BLINK 4
# define BOLD 5
# define REVVIDBLINK 6
# define BOLDUNDER 7
# define BOLDBLINK 8
# define USRCOL1 9
# define USRCOL2 10
# define USRCOL3 11
# define USRCOL4 12
# define USRCOL5 13
# define USRCOL6 14
# define USRCOL7 15
/*
* Key Constants
* Totally new key constants
* this list must match _keystr in win/mip/keytab.c
* exactly as defines are used as indexes
*/
# define _K_Base(n) (256 + n)
/* Key definitions */
# define K_CR _K_Base(1)
# define K_TAB _K_Base(2)
# define K_ESC _K_Base(3)
# define K_BS _K_Base(4)
# define K_BTAB _K_Base(5)
/* Arrow Keys */
# define K_LEFT _K_Base(6)
# define K_RIGHT _K_Base(7)
# define K_UP _K_Base(8)
# define K_DOWN _K_Base(9)
/* Paging keys */
# define K_INS _K_Base(10)
# define K_DEL _K_Base(11)
# define K_HOME _K_Base(12)
# define K_END _K_Base(13)
# define K_PGUP _K_Base(14)
# define K_PGDN _K_Base(15)
/* Function Keys */
# define K_F1 _K_Base(16)
# define K_F2 _K_Base(17)
# define K_F3 _K_Base(18)
# define K_F4 _K_Base(19)
# define K_F5 _K_Base(20)
# define K_F6 _K_Base(21)
# define K_F7 _K_Base(22)
# define K_F8 _K_Base(23)
# define K_F9 _K_Base(24)
# define K_F10 _K_Base(25)
# define K_F11 _K_Base(26)
# define K_F12 _K_Base(27)
# define K_F13 _K_Base(28)
# define K_F14 _K_Base(29)
# define K_F15 _K_Base(30)
# define K_F16 _K_Base(31)
# define K_F17 _K_Base(32)
# define K_F18 _K_Base(33)
# define K_F19 _K_Base(34)
# define K_F20 _K_Base(35)
# define K_ALTF1 _K_Base(36)
# define K_ALTF2 _K_Base(37)
# define K_ALTF3 _K_Base(38)
# define K_ALTF4 _K_Base(39)
# define K_ALTF5 _K_Base(40)
# define K_ALTF6 _K_Base(41)
# define K_ALTF7 _K_Base(42)
# define K_ALTF8 _K_Base(43)
# define K_ALTF9 _K_Base(44)
# define K_ALTF10 _K_Base(45)
# define K_CTRLF1 _K_Base(46)
# define K_CTRLF2 _K_Base(47)
# define K_CTRLF3 _K_Base(48)
# define K_CTRLF4 _K_Base(49)
# define K_CTRLF5 _K_Base(50)
# define K_CTRLF6 _K_Base(51)
# define K_CTRLF7 _K_Base(52)
# define K_CTRLF8 _K_Base(53)
# define K_CTRLF9 _K_Base(54)
# define K_CTRLF10 _K_Base(55)
/* extended keys */
# define K_ALTA _K_Base(56)
# define K_ALTB _K_Base(57)
# define K_ALTC _K_Base(58)
# define K_ALTD _K_Base(59)
# define K_ALTE _K_Base(60)
# define K_ALTF _K_Base(61)
# define K_ALTG _K_Base(62)
# define K_ALTH _K_Base(63)
# define K_ALTI _K_Base(64)
# define K_ALTJ _K_Base(65)
# define K_ALTK _K_Base(66)
# define K_ALTL _K_Base(67)
# define K_ALTM _K_Base(68)
# define K_ALTN _K_Base(69)
# define K_ALTO _K_Base(70)
# define K_ALTP _K_Base(71)
# define K_ALTQ _K_Base(72)
# define K_ALTR _K_Base(73)
# define K_ALTS _K_Base(74)
# define K_ALTT _K_Base(75)
# define K_ALTU _K_Base(76)
# define K_ALTV _K_Base(77)
# define K_ALTW _K_Base(78)
# define K_ALTX _K_Base(79)
# define K_ALTY _K_Base(80)
# define K_ALTZ _K_Base(81)
# define K_ALT1 _K_Base(82)
# define K_ALT2 _K_Base(83)
# define K_ALT3 _K_Base(84)
# define K_ALT4 _K_Base(85)
# define K_ALT5 _K_Base(86)
# define K_ALT6 _K_Base(87)
# define K_ALT7 _K_Base(88)
# define K_ALT8 _K_Base(89)
# define K_ALT9 _K_Base(90)
# define K_ALT0 _K_Base(91)
# define K_ALTMINUS _K_Base(92)
# define K_ALTEQ _K_Base(93)
# define K_CTRLLEFT _K_Base(94)
# define K_CTRLRIGHT _K_Base(95)
# define K_CTRLPRTSC _K_Base(96)
# define K_CTRLEND _K_Base(97)
# define K_CTRLHOME _K_Base(98)
# define K_CTRLPGDN _K_Base(99)
# define K_CTRLPGUP _K_Base(100)
/* Control ascii - great for Unix */
# define K_CTRLA _K_Base(101)
# define K_CTRLB _K_Base(102)
# define K_CTRLC _K_Base(103)
# define K_CTRLD _K_Base(104)
# define K_CTRLE _K_Base(105)
# define K_CTRLF _K_Base(106)
# define K_CTRLG _K_Base(107)
# define K_CTRLH _K_Base(108)
# define K_CTRLI _K_Base(109)
# define K_CTRLJ _K_Base(110)
# define K_CTRLK _K_Base(111)
# define K_CTRLL _K_Base(112)
# define K_CTRLM _K_Base(113)
# define K_CTRLN _K_Base(114)
# define K_CTRLO _K_Base(115)
# define K_CTRLP _K_Base(116)
# define K_CTRLQ _K_Base(117)
# define K_CTRLR _K_Base(118)
# define K_CTRLS _K_Base(119)
# define K_CTRLT _K_Base(120)
# define K_CTRLU _K_Base(121)
# define K_CTRLV _K_Base(122)
# define K_CTRLW _K_Base(123)
# define K_CTRLX _K_Base(124)
# define K_CTRLY _K_Base(125)
# define K_CTRLZ _K_Base(126)
/* Cannot remap these keys but keep here */
/* Also there are no scancodes for these */
/* Note that they are relative to the last key above */
# define M_PRESS (K_CTRLZ + 1)
# define M_ESC (M_PRESS + 1)
# define M_RELEASE (M_ESC + 1)
# define M_MENU (M_RELEASE + 1)
# define K_NULL (M_MENU + 1) /* Last key - please update if changed */
/* Size of ttykeys */
# define MAX_TTYKEYS 256 /* Should be big enough */
/* Happy keys ! */
# define K_HELP K_F1
# define K_EXIT K_ESC
/*
* Define the PRINTER Library
*/
#define FF '\014' /* Form Feed */
#define LF '\012' /* Line Feed */
#define TOP 1 /* Screen Based */
#define EOP 23 /* Reports Only */
/* Graphic boxes */
# define BOXCHCNT 11
/* Default references */
# define URIGHT 1
# define ULEFT 2
# define LLEFT 3
# define LRIGHT 4
# define LEFTT 5
# define RIGHTT 6
# define HORIZ 7
# define VERT 8
# define CROSST 9
# define BOTTY 10
# define TOPT 11
/* Generated code references */
# define BURIGHT(n) (URIGHT + ((n) * BOXCHCNT))
# define BULEFT(n) (ULEFT + ((n) * BOXCHCNT))
# define BLLEFT(n) (LLEFT + ((n) * BOXCHCNT))
# define BLRIGHT(n) (LRIGHT + ((n) * BOXCHCNT))
# define BLEFTT(n) (LEFTT + ((n) * BOXCHCNT))
# define BRIGHTT(n) (RIGHTT + ((n) * BOXCHCNT))
# define BHORIZ(n) (HORIZ + ((n) * BOXCHCNT))
# define BVERT(n) (VERT + ((n) * BOXCHCNT))
# define BCROSST(n) (CROSST + ((n) * BOXCHCNT))
# define BBOTTY(n) (BOTTY + ((n) * BOXCHCNT))
# define BTOPT(n) (TOPT + ((n) * BOXCHCNT))
/* ------------------- */
/* --- end crtio.h --- */
/* ------------------- */
/* Function prototypes */
# ifdef ANSI
char *gets_w(int, int, char *);
char *keytext(short);
int CDECL bdisp_w(int ,int ,int ,int ,char *, ...);
int CDECL center_w(int, int, int, int, char *, ...);
int coords_w(int *, int *, int *, int *, int *);
int cursor(int);
int CDECL disp_w(int ,int ,int ,char *, ...);
int fdisp_w(int ,int ,int ,int ,char *);
int get_term(void);
int inchar(void);
int inchar_nowait(void);
int inchar_hit(void);
int CDECL input_w(int, int, int, int, int, char *, char *, int, ...);
void mv_w(int, int);
int ndisp_w(int ,int ,int ,int ,char *);
int opt_w(int *, int);
int sel_w(int *);
int top_w(int *);
int xdisp_w(int, int, int, char *);
int CDECL yn_w(int, int, int, int, int, int, ...);
short unget_stream(void);
struct window_rec *find_w(int *);
struct window_rec *link_w(struct window_rec *, struct window_rec *);
struct window_rec *new_hdr_w(int, int, int, int);
void abs_w(int *, int *, int *, int *);
void border_w(int, int);
void box_w(int, int, int, int, int);
void cls(void);
void create_w(int, int, int, int);
void delete_w(void);
void _del_w(struct window_rec *);
void dup_w(void);
void end_w(int);
void fill_w(int, int, int, int, int, int);
void flushcurs(void);
void flushln(void);
void flushposn(void);
void flushscr(void);
void init_w(int, int);
void CDECL keys_w(int, ...);
void keywait(int);
void loadvect(struct window_rec *);
void moveto(int, int);
void moveto_w(int, int);
void ncreate_w(int, int, int, int, int *);
void new_w(void);
void poke_w(int, int, int, int);
void raw_off(void);
void raw_on(void);
void redraws(void);
void rephoriz_w(int ,int ,int ,int ,int );
void repvert_w(int ,int ,int ,int ,int );
void resetscr(void);
void set_w(int, int);
void subpokel(int, int, int, char *, char *);
void underln_w(int ,int ,int ,int );
void unget_inchar(short);
void unlink_w(struct window_rec *);
void upperln_w(int, int, int, int);
# else
char *gets_w();
char *keytext();
int bdisp_w();
int center_w();
int coords_w();
int cursor();
int disp_w();
int fdisp_w();
int get_term();
int inchar();
int inchar_nowait();
int inchar_hit();
int input_w();
void mv_w();
int ndisp_w();
int opt_w();
int sel_w();
int top_w();
int xdisp_w();
int yn_w();
short unget_stream();
struct window_rec *find_w();
struct window_rec *link_w();
struct window_rec *new_hdr_w();
void abs_w();
void border_w();
void box_w();
void cls();
void create_w();
void _del_w();
void delete_w();
void dup_w();
void end_w();
void fill_w();
void flushcurs();
void flushln();
void flushposn();
void flushscr();
void init_w();
void keys_w();
void keywait();
void loadvect();
void moveto();
void moveto_w();
void ncreate_w();
void new_w();
void poke_w();
void raw_off();
void raw_on();
void redraws();
void rephoriz_w();
void repvert_w();
void resetscr();
void set_w();
void subpokel();
void underln_w();
void unget_inchar();
void unlink_w();
void upperln_w();
# endif
/* Mouse Section */
/* Mouse can be switch in or out by -DMOUSE */
# ifdef MOUSE
# define LEFT_BUTTON 0x01
# define RIGHT_BUTTON 0x02
# define M_UP 0
# define M_DEPRESSED 1
# define M_LEFT 0
# define M_RIGHT 1
extern int mouse_present;
extern int mouse_num_buttons;
extern int mouse_up_down;
extern int mouse_level;
extern int mouse_ver_movement;
extern int mouse_hor_movement;
extern int mouse_click_count;
extern int mouse_num_objects;
extern int mouse_limit;
extern int mouse_reset_pos;
extern int lefty_mouse;
extern unsigned int mouse_x;
extern unsigned int mouse_y;
extern unsigned int mouse_row;
extern unsigned int mouse_col;
/* extern unsigned int mouse_status; */
extern unsigned int mouse_x_divisor;
extern unsigned int mouse_y_divisor;
struct _mouse_object
{
int level;
int key;
int index;
unsigned char srow;
unsigned char scol;
unsigned char erow;
unsigned char ecol;
char *name; /* name of the object */
struct _mouse_object *next_object;
};
extern struct _mouse_object *mouse_object;
/*
* mouse routines
*/
# ifdef ANSI
int mouse_add_object(unsigned char, unsigned char, unsigned char, unsigned char, int, int, char *);
int mouse_button_down(int);
int mouse_check_bounds(void);
int mouse_click(int *, int);
int mouse_hit(void);
int mouse_position(unsigned int *, unsigned int *);
int mouse_waitkey(void);
short check_mouse(void);
void mouse_init(void);
void mouse_end(void);
void mouse_button_info(int, unsigned int *, unsigned int *);
void mouse_button_release(int, unsigned int *, unsigned int *);
void mouse_cursor(int);
void mouse_delete_keys(void);
void mouse_delete_notkeys(void);
void mouse_delete_level(int);
void mouse_get_movement(unsigned int *, unsigned int *);
void mouse_limit_level(int);
void mouse_move_cursor(int *, int *);
void mouse_move_object(int, int, int, int, char *);
void mouse_movement(int, int);
void mouse_set_position(unsigned int, unsigned int);
void mouse_set_text_cursor(int, int, int);
void mouse_set_xbounds(unsigned int, unsigned int);
void mouse_set_ybounds(unsigned int, unsigned int);
void mouse_wait_release(int);
# else
int mouse_add_object();
int mouse_button_down();
int mouse_check_bounds();
int mouse_click();
int mouse_hit();
int mouse_position();
int mouse_waitkey();
short check_mouse();
void mouse_init();
void mouse_end();
void mouse_button_info();
void mouse_button_release();
void mouse_cursor();
void mouse_delete_keys();
void mouse_delete_notkeys();
void mouse_delete_level();
void mouse_get_movement();
void mouse_limit_level();
void mouse_move_cursor();
void mouse_move_object();
void mouse_movement();
void mouse_set_position();
void mouse_set_text_cursor();
void mouse_set_xbounds();
void mouse_set_ybounds();
void mouse_wait_release();
# endif
# endif /* MOUSE */
# define _H_WINDOW
# endif /* _H_WINDOW */