#ifndef GFXCORE_H
#define GFXCORE_H

#include "bitmap.h"
#include "gfxfont.h"

/**
 * Scratch memory for internal use.
 *
 */
#define GFX_SCRATCH_SIZE 2048
extern  Bitmap *_gfx_scratch;

/**
 * fillStyles
 *
 */
extern char emptyFill[];
extern char solidFill[];
extern char lineFill[];
extern char ltSlashFill[];
extern char slashFill[];
extern char bkSlashFill[];
extern char ltBkSlashFill[];
extern char hatchFill[];
extern char xHatchFill[];
extern char xLeaveFill[];
extern char wDotFill[];
extern char cDotFill[];


/**
 * Structure to hold information about a
 * graphics context.
 *
 */
typedef struct Graphics {
  struct    Bitmap  *bitmap;
  struct    Font    *font;
  char     *fillStyle;
  int       x, y;
  int       color;
  int       blitMode;
} Graphics;


extern void GFX_Init(Graphics *gfx, Bitmap   *bm);
extern void GFX_Init(Graphics *gfx, Graphics *gfx2);

extern void GFX_SetFont(Graphics *gfx, Font *font);
extern void GFX_SetFillStyle(Graphics *gfx, char *style);
extern void GFX_SetColor(Graphics *gfx, int color);
extern void GFX_SetBlitMode(Graphics *gfx, int mode);

extern void GFX_MoveRel(Graphics *gfx, int dx, int dy);
extern void GFX_MoveTo (Graphics *gfx, int  x, int  y);

extern void GFX_HLine  (Graphics *gfx, int x, int y, int w);
extern void GFX_VLine  (Graphics *gfx, int x, int y, int h);
extern void GFX_Line   (Graphics *gfx, int x1, int y1, int x2, int y2);
extern void GFX_LineRel(Graphics *gfx, int dx, int dy);
extern void GFX_LineTo (Graphics *gfx, int x, int y);

extern void GFX_Circle   (Graphics *gfx, int xc, int yc, int r);
extern void GFX_Rectangle(Graphics *gfx, int x, int y, int w, int h);
extern void GFX_FillRect (Graphics *gfx, int x, int y, int w, int h);

#endif
