#ifndef V_WMF_H
#define V_WMF_H

#ifdef	CONFIG_METAFILE

#ifdef 	__cplusplus
extern	"C" {
#endif	/* __cplusplus */
	/*
	 *	metaCreateRenderer() - creates vector renderer.
	 *	Returned handle must than be passed as first arg to any drawing
	 *	functions returned by metaGetRefAPI(). Logical size of viewport
	 *	is (0.0,0.0) - (1.0,1.0); origin is lower - left corner.
	 *	Input:
	 *		file_name: disk file name (may be '//./clipboard' under Win32)
	 *		mm_width, mm_height: width and height of drawing in 
	 *			millimeters, used when saving.
	 *	Notes.
	 *		1. If at least one of mm_width and mm_height parameters is 
	 *			zero, extents of metafile set to 240 x 160 mm 
	 *			(interior of A4 parer sheet).
	 *		2. Win32 only: raw extents of metafile set to 0x7FFF by 0x7FFF.
	 */
	vhandle_t V_GLOBAL	metaCreateRenderer(char *file_name,
		u32_t mm_width,u32_t mm_height);
	/*
	 *	Same as above, but allow control of logical and raw extents.
	 */		
	vhandle_t V_GLOBAL	metaCreateRendererEx(char *file_name,
		u32_t mm_width,u32_t mm_height,
		vec_t logical_width,vec_t logical_height,
		s16_t raw_width,s16_t raw_height);
	/*
	 *	Finishes drawing and saves metafile.
	 */
	void V_GLOBAL	metaDestroyRenderer(vhandle_t handle);
	/*
	 *	Dircards current contents of render buffers.
	 *	Note (Win32 only): metaClearBuffer() invalidates Win32 device
	 *	context, so it must than be re-aquired via metaGetHandleNP().
	 */
	void	V_GLOBAL	metaClearBuffer(vhandle_t handle);
	/*
	 *	Returns minimal set of drawing functions.
	 *	See v_gl.c for definition of gl_tl_callbacks_t.
	 */
	gl_tl_callbacks_p V_GLOBAL	metaGetRefAPI(vhandle_t handle);
#ifndef	CONFIG_METAFILE_GDI_EMULATION
	/*
	 * Non - portable (WIN32 - only) functions.
	 */
	u32_t	V_GLOBAL		metaGetMaxXNP(vhandle_t handle);
	u32_t	V_GLOBAL		metaGetMaxYNP(vhandle_t handle);
	void_p	V_GLOBAL		metaGetHandleNP(vhandle_t handle);
	/*
	 * GDI's GetTextExtentPoint32 not always works with metafiles.
	 */
	void	V_GLOBAL		metaTextExtentNP(vhandle_t handle,
		char *str,u32_t *cx,u32_t *cy);
	/*
	 * Changes font for DC of metafile.
	 * Input:
	 *		handle - metafile renderer;
	 *		char_height - height of character (in metafile's logical
	 *			units; 100 mean 1/10 of metafile's height etc.);
	 *		deg_ori - orientation in degrees (counter-clockwise);
	 *		weight - weight from 0 to 900;
	 *		italic - if 1, italic font used;
	 *		face - font face name.
	 */
	void	V_GLOBAL		metaChangeFontNP(vhandle_t handle,
		int char_height,int deg_ori,int weight,int italic,char *face);
#endif	/* !CONFIG_METAFILE_GDI_EMULATION */
	/*
	 *	OpenGL capture API.
	 */
	vhandle_t	V_GLOBAL	metaBeginCapture(char *file_name,
		u32_t mmWidth,u32_t mmHeight);
	vboolean V_GLOBAL		metaDrawAgain(vhandle_t handle);
	vboolean V_GLOBAL		metaFinishCapture(vhandle_t handle);
#ifdef 	__cplusplus
}
#endif	/* __cplusplus */

#endif	/* CONFIG_METAFILE */

#endif	/* V_WMF_H */
