/* =======================================================
 * draw.h
 */
/* =======================================================
 * Public Constants
 */
enum DRAW_TAGS  {DR_done, \
                 DR_lticks, DR_bticks, \
                 DR_rticks, DR_tticks, \
                 DR_title, DR_label, \
                 DR_llab, DR_blab, DR_rlab, DR_tlab, \
                 DR_lmargin, DR_rmargin, DR_tmargin, DR_bmargin, \
                 DR_lmin, DR_lmax, DR_bmin, DR_bmax, \
                 DR_rmin, DR_rmax, DR_tmin, DR_tmax, \
                 DR_data, DR_size, DR_type, DR_color, \
                 DR_laxis, DR_baxis, DR_raxis, DR_taxis, \
                 DR_x, DR_y, DR_text, DR_ticklen, \
                 DR_legend, DR_legendx, DR_legendy, DR_legendw, DR_legendh \
                 };

enum DRAW_TYPES { DR_none, DR_xy, DR_linexy, DR_bar, DR_stackbar, DR_pie };
enum DRAW_ERROR { DR_noerr, DR_dl, DR_db, DR_dr, DR_dt, DR_col, DR_mar, \
				  DR_lt, DR_bt, DR_rt, DR_tt };

#define WHITE   0
#define RED     1
#define GREEN   2
#define BLUE    3
#define ORANGE  4
#define AQUA    5
#define PINK    6
#define BLACK   7

/* =======================================================
 * Public Type Definitions
 */

typedef struct {
    float	lticks, bticks, rticks, tticks;
    float	llab, blab, rlab, tlab;
    float	lmin, lmax, bmin, bmax;
    float	rmin, rmax, tmin, tmax;
    char	label[10];
    char	title[80];
    int		ml, mb, mr, mt;		/* Margins */
    int		color;
    int		width;
    int		type;
    BOOL	laxis, baxis, raxis, taxis;
    BOOL	date;
    int		size;
    int		xpos, ypos;
    char	text[80];
    int		ticklen;
    BOOL	legend;
    int		lx, ly, lw, lh;
    float	*x, *y;		/* Data array of float, depending on type */
} DrawAttr;

#define draw_defaults { 0.0, 0.0, 0.0, 0.0, \
                        0.0, 0.0, 0.0, 0.0, \
                        0.0, 100.0, 0.0, 100.0, \
                        0.0, 100.0, 0.0, 100.0, \
                        "%3.0f", "", 20, 20, 20, 30, \
                        1, 10, DR_none, FALSE, FALSE, FALSE, FALSE, \
                        FALSE, 0, 0, 0, "", 0, \
			FALSE, 0, 0, 0, 0, \
                        (float*)NULL, (float*)NULL }

/* =======================================================
 * Public Function Prototypes
 */
int DRAW_open ( int x, int y, int h, int w, char *title );
int DRAW_close ( BOOL all );
int DRAW_window ( int num );
int DRAW_set ( char *var, char *value);
int DRAW_reset ( void );
int DRAW_do ( void );
int DRAW_clear ( void );
int DRAW_chart ( Account *a, char* type, FundId fund, Date date, Date date2 );
