/* FSM gdos bindings */

/* ---------------------------------------------------------------------------
 * Retrieve placement information for FSM generated characters
 * Information is placed in infoarray of 52 ints.
 * Borrow a soothsayer from DRI or Atari to find its meaning.
 *
 * This is a temporary bindings since one genius decided
 * that some entries in infoarray will represent real numbers.
 * You may fully expect that that this representation of reals is
 * absolutely different from what your compiler is using.
 * Count your lucky stars if at least sizeof(double) == 2 * sizeof(int).
 * Or maybe sizeof(double) is supposed to be sizeof(float)?
 */
__EXTERN void v_getbitmap_info __PROTO((int handle, int ch, int infoarray[]));

/*
 * Inquire text extent, accounting for FSM text placement
 */
__EXTERN void vqt_f_extent __PROTO((int handle, const char *str, int extent[]));

/*
 * Draw FSM text (accounts for fractional advances in rotated text)
 */
__EXTERN void v_ftext __PROTO((int handle, int x, int y, const char *str));

/*
 * Release memory associated with outline component generated by v_getoutline()
 */
__EXTERN void v_killoutline __PROTO((int handle, void *component));

/*
 * Generate an outline for character ch, and return the address of the outline.
 */
__EXTERN void v_getoutline __PROTO((int handle, int ch, void **component));

/*
 * Set scratch buffer allocation mode.
 * mode=0: (default) account for FSM fonts when allocating scratch buffers
 * mode=1: account only for BM fonts
 * mode=2: allocate no scratch buffer
 */
__EXTERN void vst_scratch __PROTO((int handle, int mode));

/*
 * Set FSM error mode.
 * mode=1: (default) errors go to screen.
 * mode=0: errors reported in error variable `errorvar'.
 */
__EXTERN void vst_error __PROTO((int handle, int mode, int *errorvar));

/*
 * v_gtext with optional shadow attribute
 */
__EXTERN void	v_shtext __PROTO(( int wsid, int x, int y, const char *text,
				  int color, int xshadow, int yshadow ));

/*
 * Set character cell height by arbitrary points.
 */
__EXTERN int	vst_arbpt __PROTO((  int handle, int point, int *wchar,
				   int *hchar, int *wcell, int *hcell ));

/*
 * Inquire FSM text advance placement vector.
 */
__EXTERN void	vqt_advance __PROTO(( int handle, int ch, int *xadv,
					 int *yadv, int *xrem, int *yrem));

/*
 * Inquire device status information.
 */
__EXTERN void	vqt_devinfo __PROTO(( int handle, int device, int *isdev,
					 char *drivername ));

/*
 * Save FSM cache to disk.
 */
__EXTERN int	v_savecache __PROTO(( int handle, char *filename ));

/*
 * Load/merge FSM cache from disk.
 */
__EXTERN int	v_loadcache __PROTO(( int handle, char *filename, int mode ));

/*
 * Flush FSM cache.
 */
__EXTERN int	v_flushcache __PROTO(( int handle ));

/*
 * Set character cell width by arbitrary points.
 */
__EXTERN int	vst_setsize __PROTO(( int handle, int point, int *wchar,
					 int *hchar, int *wcell, int *hcell ));

/*
 * Set FSM skew.
 */
__EXTERN int	vst_skew __PROTO(( int handle, int skew ));

/*
 * Get FSM GASCII tables.
 */
__EXTERN void	vqt_get_tables __PROTO(( int handle, void **gascii,
					void **style ));

/*
 * Get FSM cashe size
 */
__EXTERN void	vqt_cachesize __PROTO(( int handle, int which_cache,
					   size_t *size ));

/*
 * bezier curves stuff
 */
__EXTERN void v_set_app_buff __PROTO((void **buf_p, int size));

__EXTERN int v_bez __PROTO((int handle, int count,
					 int *xyarr, char *bezarr,
				 int extent[4], int *npts, int *nmvs));
__EXTERN int v_bez_fill __PROTO((int handle, int count,
				 int *xyarr, char *bezarr,
				 int extent[4], int *npts, int *nmvs));
__EXTERN int v_bez_qual __PROTO((int handle, int percent, int *actual));

#ifdef ALTERNATE

/* Use these #defines if you _really_ want to stick to DRI conventions */

__EXTERN int v_bez_con __PROTO((int handle, int onoff));
#define v_bez_on(x) (int)v_bez_con((x), 1)
#define v_bez_off(x)	(void)v_bez_con((x), 0)

#else
__EXTERN int v_bez_on __PROTO((int handle));
__EXTERN void v_bez_off __PROTO((int handle));
#endif /* ALTERNATE */

