/*************************************************************************
Copyright(c) 2004-2006 Analog Devices, Inc. All Rights Reserved.

This software is proprietary and confidential.  By using this software you agree
to the terms of the associated Analog Devices License Agreement.

File Name: adi_graph.h 

Description - Part of 'adi_graph' library.  See readme file  for details.

*********************************************************************************/

#ifndef __ADI_GRAPH_H__
#define __ADI_GRAPH_H__

// building the library with this define enables printf to console
//#define PRINT_TO_CONSOLE

typedef enum { ADI_FILL_SOLID, ADI_FILL_PIXMAP, ADI_FILL_TRANSPARENT, ADI_FILL_OPAQUE } ADI_FillStyle;

typedef struct
{
	void *canvas;
	int x1, y1, x2, y2;
	int clip_x1, clip_y1, clip_x2, clip_y2;
	int canvas_x, canvas_y;
	int fg_color;
	int bg_color;
	void *font;
	unsigned char dash_pattern[4];
	unsigned char line_pattern[8];
	ADI_FillStyle fill_style;
	unsigned char fill_pattern[8];
	void *reserved1;
	void *reserved2;
} ADI_sGraphPrim;


#define ADI_Swap(v1,v2) { int swap = v1; v1 = v2; v2 = swap; }
#define ADI_SwapIfGreaterThan(v1,v2) if ( v1 > v2 ) ADI_Swap ( v1, v2 )


/* Function Prototypes */
void ADI_Arc ( ADI_sGraphPrim *, double, double ) ;
void ADI_ArcFill ( ADI_sGraphPrim *, double, double ) ;
int  ADI_LookupCommonColor ( const char *, int *, int *, int * );
void ADI_Line ( ADI_sGraphPrim *, int * );
void ADI_CanvasCopyArea ( ADI_sGraphPrim *, ADI_sGraphPrim * );
void ADI_CanvasDelete ( void * );
void *ADI_CanvasGetScreenCanvas ();
void *ADI_CanvasNew ( int, int );
void ADI_Point ( ADI_sGraphPrim * );
void ADI_PointConsideringFillPattern ( ADI_sGraphPrim * );
void ADI_Rect ( ADI_sGraphPrim * );
void ADI_RectFill ( ADI_sGraphPrim * );
void ADI_Text ( ADI_sGraphPrim *, const char * );
void ADI_TextGetExtent ( ADI_sGraphPrim *, const char * );


#endif

