home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
decus
/
RB140
/
grlib03a.arj
/
GRAPH.H
< prev
next >
Wrap
Text File
|
1988-12-19
|
9KB
|
248 lines
/************************************************************************/
/* */
/* GRAPH.H Header file for use with the MSDOS GRAPHICS */
/* LIBRARY V3.0 */
/* */
/************************************************************************/
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#define MAX_WS 6 /* maximum number of work stations which */
/* can be open at one time */
#define HIRES (gbmod & 0x01)
#define MEDRES (! (gbmod & 0x01))
#define SMIDMON 1
#define SHIGHMON 2
#define SMIDCOL 3
#define SHIGHCOL 4
#define DMID 5
#define DHIGH 6
#define SH_SW 0
#define SH_DW 1
#define DH_SW 2
#define DH_DW 3
#define F_HOLLOW 0 /* Interior Fill Types */
#define F_SOLID 1
#define F_PATTERN 2
#define F_HATCH 3
#define REPLACE 0 /* Write Modes */
#define COMPLIMENT 1
#define OVERLAY 2
#define ERASE 3
#define segment segment_ /* gets around the MASM's SEGMENT directive */
/***** WORK STATION VARIABLES *****/
struct work_station {
unsigned char ws_data_[28], /*All the bytes needed to initialise the work*/
/*station ****** DO NOT CHANGE ******/
p1_[16]; /*param table for PRAM & FIGS cmnds.*/
char ws_type_, /*work station type. 1 to 6*/
ws_wmo_; /*write mode. 0 to 3*/
unsigned char gbmod_, /*GO's mode register.*/
fgbg_, /*defines fore_grnd/back_grnd colour.*/
alups_, /*defines the writing mode.*/
gbmskl_, /*GO's write mask, split into low and*/
gbmskh_, /*high bytes.*/
gdcml_, /*GDC's write mask, as above.*/
gdcmh_,
curl0_, /*three bytes which define the GDC's*/
curl1_, /*cursor position.*/
curl2_; /*curl2 only uses it's high nibble.*/
int ymax_, /*max pixels on 'y' axis. 0 to ymax*/
xmax_; /*max pixels on 'x' axis. 0 to xmax*/
char twdir_; /*direct'n for word & vector drawing.*/
unsigned char nmritl_, /*# words to write. used by FIGS*/
nmrith_;
int sh_p_lin_, /*number of shifts to do to convert a*/
/*line number to an absolute address.*/
bytes_p_lin_, /*number of bytes displayed per line.*/
x_start_, /*four gen. purpose variables_, mainly*/
y_start_, /*used for line drawing to defined*/
x_stop_, /*the start and stop vectors.*/
y_stop_,
g_strtx_; /*defines current 'x' offset from the*/
/*start of line to 1st pix. displayed*/
unsigned char scr_top_, /*define the top & bottom lines for*/
scr_bot_, /*vertical scrolling.*/
scrltb_[256]; /*mirror of line number sequence.*/
struct _clmpda { /*defines the colour intensities.*/
unsigned char red_green[16],
mono_blue[16];
} clmpda_;
struct _pattbl { /*defines patterns & repeat factors*/
unsigned char patern, /* for drawing lines.*/
multiplier;
} pattbl_[16];
/****** LINE VARIABLES ******/
char l_col_, /*line colour.*/
l_type_, /*line type_, indexes "pattbl".*/
l_wid_; /*line width. (not used currently).*/
/****** FILL VARIABLES ********/
char f_col_, /*fill colour.*/
f_type_, /*fill type. 0 to 3*/
f_style_; /*fill style. 0 to 7*/
struct _f_patrn { /*table of patterns for filling:*/
unsigned char solid[8], /*f_patrn[0] solid. f_type = 1.*/
pattern[8][8], /*f_patrn[1-8] patterns. f_type = 2.*/
hatch[8][8]; /*f_patrn[9-16] hatches. f_type = 3.*/
} f_patrn_;
/****** TEXT VARIABLES ******/
char t_col_, /*text colour.affects "text"&"gtext."*/
t_font_; /*text font. affects "gtext" only.*/
unsigned char t_sca_; /*text scale. affects "text" only.*/
int t_dir_; /*direction that text is written.*/
/* affects "text" only.*/
int t_x_, /*define the bottom left of the char.*/
t_y_; /*cell in which char. is displayed.*/
/****** MARKER VARIABLES ******/
char m_col_, /*marker colour.*/
m_type_; /*marker type. 0 to 15*/
unsigned char m_sca_; /*marker scale.*/
struct _m_tab { /*vector table for markers.*/
unsigned char mkr0[16],
mkr1[16],
mkr2[16],
mkr3[16],
mkr4[16],
mkr5[16],
mkr6[16],
mkr7[16],
mkr8[16],
mkr9[16],
mkr10[16],
mkr11[16],
mkr12[16],
mkr13[16],
mkr14[16],
mkr15[16];
} m_tab_;
};
extern struct work_station cur_ws;
#define ws_data cur_ws.ws_data_
#define p1 cur_ws.p1_
#define ws_type cur_ws.ws_type_
#define ws_wmo cur_ws.ws_wmo_
#define gbmod cur_ws.gbmod_
#define fgbg cur_ws.fgbg_
#define alups cur_ws.alups_
#define gbmskl cur_ws.gbmskl_
#define gbmskh cur_ws.gbmskh_
#define gdcml cur_ws.gdcml_
#define gdcmh cur_ws.gdcmh_
#define curl0 cur_ws.curl0_
#define curl1 cur_ws.curl1_
#define curl2 cur_ws.curl2_
#define ymax cur_ws.ymax_
#define xmax cur_ws.xmax_
#define twdir cur_ws.twdir_
#define nmritl cur_ws.nmritl_
#define nmrith cur_ws.nmrith_
#define sh_p_lin cur_ws.sh_p_lin_
#define bytes_p_lin cur_ws.bytes_p_lin_
#define x_start cur_ws.x_start_
#define y_start cur_ws.y_start_
#define x_stop cur_ws.x_stop_
#define y_stop cur_ws.y_stop_
#define g_strtx cur_ws.g_strtx_
#define scr_top cur_ws.scr_top_
#define scr_bot cur_ws.scr_bot_
#define scrltb cur_ws.scrltb_
#define clmpda cur_ws.clmpda_
#define pattbl cur_ws.pattbl_
#define l_col cur_ws.l_col_
#define l_type cur_ws.l_type_
#define l_wid cur_ws.l_wid_
#define f_col cur_ws.f_col_
#define f_type cur_ws.f_type_
#define f_style cur_ws.f_style_
#define f_patrn cur_ws.f_patrn_
#define t_col cur_ws.t_col_
#define t_font cur_ws.t_font_
#define t_sca cur_ws.t_sca_
#define t_dir cur_ws.t_dir_
#define t_x cur_ws.t_x_
#define t_y cur_ws.t_y_
#define m_col cur_ws.m_col_
#define m_type cur_ws.m_type_
#define m_sca cur_ws.m_sca_
#define m_tab cur_ws.m_tab_
/*************************************************************************/
/*table of 4 pointers, each to a 2560 byte area set out as 256 chars with*/
/*10 scan lines (bytes) per character Each pointer/area is set/allocated */
/*when ld_font() is called. */
/*************************************************************************/
extern struct _fnt_ {
char f_char[256][10];
} *tfonts[4];
/***************************************************************/
/* Read/write bitmap cell structure */
/***************************************************************/
struct g_cell {
int c_corner[4]; /*defines bottom-left & top-right*/
int c_plane; /*plane number read*/
int c_rows; /*#rows read*/
int c_bytes; /*#bytelength of each row element*/
unsigned char *c_segment; /*opt segment addr of temp area*/
unsigned char *c_offset; /*opt offset addr of temp area*/
};
#define WS_OPEN 1
#define WS_SAVED 2
extern struct _gr_data { /*This structure is used to manage */
char ws_ty, /*which work stations are active, */
ws_flags; /*where their stuctures are and where*/
struct work_station *ws; /*the screen image has been saved. */
struct g_cell *ws_cell; /* (If it has.) */
} gr_data[MAX_WS];
extern unsigned int gp_buff[1024]; /*gen. purpose array for 'xy' points.*/
/*Used heavily by "circle","segment",*/
/*"arc" and "rectangle", therefore*/
/*don't use it for these functions.*/
/***************************************************************/
/* GSX86MWC COMPATABLE FUNCTION CALLS AS MACROS */
/***************************************************************/
#define direction(_td_) cur_ws.t_dir_=_td_
#define fillcolor(_fc_) cur_ws.f_col_=_fc_
#define fillstyle(_fs_) cur_ws.f_style_=_fs_
#define filltype(_ft_) cur_ws.f_type_=_ft_
#define linecolor(_lc_) cur_ws.l_col_=_lc_
#define linetype(_lt_) cur_ws.l_type_=_lt_
#define linewidth(_lw_) cur_ws.l_wid_=_lw_
#define markercolor(_mc_) cur_ws.m_col_=_mc_
#define markerscale(_ms_) cur_ws.m_sca_=_ms_
#define markertype(_mt_) cur_ws.m_type_=_mt_
#define setwmode(_md_) cur_ws.ws_wmo_=_md_,a_wmode()
#define textcolor(_tc_) cur_ws.t_col_=_tc_
#define textfont(_tf_) cur_ws.t_font_=_tf_
#define charht(_ts_) cur_ws.t_sca_=_ts_
#define updatews() ;