1
/* @(#)aglstruc.h 19.1 (OAA-ASTRONET) 02/25/03 13:49:25 */
3
* HEADER : aglstruc.h - Vers 3.6.001 - Jul 1993 - L. Fini, OAA
4
* - Vers 3.6.000 - Nov 1991 - L. Fini, OAA
10
/********************************* *********************************/
14
enum GRAPH_MODES { NORMAL=0, USER=1, SPECIAL=2 };
16
struct polyline { /* POLYLINE STRUCTURE */
17
int maxvects; /* Maximum number of elements allowed into */
18
/* polyline body vectors */
19
int nvects; /* Number of elements into polyline */
20
int marker; /* Either -1 for polyline, or marker code */
22
float *XV, *YV; /* polyline body */
23
enum GRAPH_MODES grmode;/* Graphic mode attached to polyline. */
24
/* Either USER, NORMAL or SPECIAL. */
25
enum GRAPH_MODES clipmode; /* Clipping mode attached to polyline*/
26
/* Either USER or NORMAL. */
27
int join; /* flag to specify joining of a series of */
29
void (*flush)(); /* Flushing routine address */
33
struct AGL_cmod { /* Character modification structure */
34
/* ------------------------------------------*/
35
/* The following parameters are set up by */
36
/* metacharacter interpretation */
37
int the_char; /* Code of character to draw */
39
int backspace; /* number of backspaces prior of drawing */
40
int newline; /* Number of newlines prior of drawing */
41
int lwdt; /* Line width to be used in drawing */
42
int color; /* Color to be used in drawing */
43
double mfact; /* Multiplying factor */
44
double vshift; /* Vertical shift */
45
double slant; /* Slant factor */
48
struct AGL_cdes { /* Character description structure */
49
/* ------------------------------------------*/
50
double blk_gap; /* Blank gap to next character (pixels) */
51
double heigth; /* Character heigth (pixels) maximum as in */
53
double width; /* Character width (pixels) */
54
double down_ext; /* Downward extension (pixels) as in p,q */
55
double scale; /* Scaling factor initialized from font scale*/
56
int ncodes; /* number of codes in char description */
57
unsigned char *codes; /* pointer to char description */
58
int nstrokes; /* Number of strokes to draw the character */
59
struct polyline strokes[MAX_STROKES]; /* Stroke polilines */
60
float XB[CHARPOLYBUFLNG]; /* Coordinate buffers */
61
float YB[CHARPOLYBUFLNG]; /* Coordinate buffers */
65
struct AGL_cmod modifier;
66
struct AGL_cdes descriptor;
69
/* The following structure holds character definition for AGL character */
70
/* fonts. Character fonts for basic ASCII characters and for marker symbols */
71
/* are coded within AGL, More fonts may be provided (and actually are) as */
72
/* files to be read at run time, if required. */
75
char fontnam [12]; /* Font name */
76
int fcode; /* First code accepted (lower codes return */
77
/* the same character as the first one) */
78
unsigned nchars; /* Number of characters */
79
unsigned nbytes; /* Number of bytes in character buffer */
80
float c_gap; /* Blank gap between characters (standard=1) */
81
float maxup; /* Maximum character dimension upward (as in */
83
float maxdown; /* Maximum character dimension downward (as */
84
/* in characters p,q) */
85
float fscale; /* Scaling factor to get same dimension as */
87
/* For the standard font this value is 1.0 */
88
short *index; /* Pointer to indexes array */
89
unsigned char *chrwdt; /* Character widths pointer */
90
unsigned char *dsclen; /* Character description lengths pointer */
91
unsigned char *cbuffr; /* Character description buffer pointer */
100
/********************** AGL DYNAMIC STATUS STRUCTURE **********************/
102
/* AGL dynamic status is the set of variables associated with each viewport */
104
struct VWPDYN { /**************************************/
105
/* DRIVER INTERFACE SUPPORT */
106
int devidx; /* Device internal index */
107
int curchan; /* Device graphic channel */
109
/**************************************/
110
/* GRAPHIC STATUS VARIABLES */
111
int color; /* Current pen/color */
112
int lstyle; /* Current line style */
113
int lwidth; /* Current line width */
114
int wrmode; /* Current write mode (S,X,O,E) */
115
int curstyl; /* Current cursor style */
116
enum GRAPH_MODES modeflag; /* Current graphic mode */
117
int autoasp; /* Auto aspect ratio control flag */
118
struct limits vwprt; /* Current viewport bounds */
119
struct limits clpng; /* Current clipping area bounds */
120
struct limits saved; /* Clipping area limits save buffer */
122
int window; /* Window defined flag */
123
int flogx,flogy; /* Logarithm. transform flags */
124
struct limits usrwn; /* User window limits */
126
void (*UsrInit)(); /* User initialization routine */
127
int (*UsrTransf)(); /* User transformation routine */
128
int (*UsrRTransf)(); /* User inverse transformation routine*/
130
/**************************************/
131
/* TEXT RELATED VARIABLES */
132
int textlw; /* Current line width for text */
133
double angfct; /* Angular conversion factor */
134
double changle; /* Current string orientation */
135
double chrhsize,chrvsize; /* Current character sizes */
136
double symbsize; /* Current symbol size */
137
double scale; /* Global scaling factor for symbols */
139
int curfont; /* Current font selector */
141
/**************************************/
142
/* METAFILE RELATED VARIABLES */
143
int filact; /* Metafile active flag */
144
int metamode; /* Temporary storage for flag */
145
FILE *metafile; /* Metafile file pointer */
147
/**************************************/
148
/* USER DEFINABLE AREA */
149
int n_int_user; /* Number of integer values defined */
150
int int_user[MAX_INT_US]; /* Integer user parameters area */
151
int n_float_user; /* Number of float values defined */
152
float float_user[MAX_FLOAT_US]; /* Float user parameters area */
156
/************************ DEVICE STATUS STRUCTURE *************************/
159
double xpixels,ypixels; /* Dimensions in pixels */
160
double xleng,yleng; /* Default axes length (cm.) */
161
double xmaxl,ymaxl; /* Max axes lengths (zero if unsupp.) */
162
double xcurl,ycurl; /* Current axes lengths */
163
double rslx,rsly; /* resolution (1/xpixel,1/ypixel) */
164
double ratyx; /* Device aspect ratio Y/X */
165
double ratxy; /* Device aspect ratio X/Y */
166
double dotlen; /* Dot lenght (for dot/dashes) */
167
double charmult; /* Character dimension multiplier */
168
unsigned flags; /* Characteristics flags */
169
int (*(*drvaddr))(); /* Device driver table pointer */
170
int nplans; /* Number of colors (pens) */
171
int grchan; /* Graphic I/O channel */
172
int actreqst; /* Active viewport requests */
173
int maxlwid; /* Max line width identifier */
174
int colors[AGLCOLORS]; /* Standard colors */
175
char curbackgr; /* Current background color */
176
char defbackgr; /* Default background color */
177
char defforegr; /* Default foreground color */
178
char devnam[PHNAMLNG]; /* Device name */
179
char filnam[PHNAMLNG]; /* Associated file name */
180
char devcmd[DEVCMDLNG]; /* Command to execute at device close */
183
struct AGL_STATUS { /* This structure contains the full */
186
struct DEVPAR actidx[MAXACTIVE];/* DEVICE CHARACTERISTICS */
189
/**************************************/
190
/* STATIC STATUS VARIABLES */
193
struct VWPDYN *vwpts[MAXVWPTS];
194
int curvwp; /* Current viewport id */
195
int devid; /* Current device index (=DY(devidx)) */
196
struct VWPDYN *vwpoint; /* Current viewport pointer */
198
int (*CURS_POINTER)(); /* Current driver entry points */
199
int (*ERAS_POINTER)();
200
int (*ESCP_POINTER)();
201
int (*INIT_POINTER)();
202
int (*SEND_POINTER)();
203
int (*TERM_POINTER)();
204
int (*POLY_POINTER)();
206
/**************************************/
207
/* GRAPHIC STATUS VARIABLES */
208
double aglfcx,aglfcy, /* Auxiliary params for coord.convers.*/
211
int DefBkgr; /* Try to set this as default backgr. */
212
/* color at device init. */
213
int ersonst; /* Erase on start flag */
214
int xlogon,ylogon; /* Current transformation flags */
216
int UTransf; /* User transformation active flag */
217
int (*CUsrTransf)(); /* Current user transformation entry */
219
/**************************************/
221
int dashon; /* TRUE if dashing is on */
222
/**************************************/
224
/**************************************/
225
/* ERROR MANAGEMENT VARIABLES */
227
int errstat; /* Most recent error status */
228
int lasterr; /* Last error code */
229
char *lastname; /* last module name */
230
int sevmsg; /* Severity treshold for messages */
231
int sevterm; /* Severity treshold for termination */
233
/*--------------------------------*/
234
/* Device drivers support */
236
int ndevs; /* Number of device drivers */
238
drvname[NDRIVERS][DRVNAMLNG]; /* device driver names table */
240
(*drvtab[NDRIVERS][NFUNCTS])(); /* driver entry points table */
242
struct bufcom cmbuffr;