#ifndef __GUI_H__
#define __GUI_H__


#include <stdlib.h>
#include "lcd.h"

//define 
#define LCD_WIDE 176
#define LCD_HEIGHT 220

//define the typedef
typedef unsigned char gui_uint8;
typedef unsigned int gui_uint16; 
typedef unsigned long int gui_uint32;
typedef char gui_int8;
typedef int gui_int16;
typedef long int gui_int32;
typedef gui_int16 gui_color;

//need transplant
#define drawPixel(x, y, color) LCD_Point( x, y, color)
#define fillRect(x,y,w,h,color) rect(x,y,w ,h,color)


//fuction
#define swap(a, b) { gui_uint16 t = a; a = b; b = t; }

gui_color RGB(gui_uint16 r,gui_uint16 g , gui_uint16 b);

//function
void drawFastHLine(gui_int16 x, gui_int16 y, gui_int16 w, gui_color color);
void drawFastVLine(gui_int16 x, gui_int16 y, gui_int16 h, gui_color color);
void drawLine(gui_int16 x0, gui_int16 y0, gui_int16 x1, gui_int16 y1, 
		gui_color color);
void drawRect(gui_int16 x, gui_int16 y, gui_int16 w, gui_int16 h, gui_color color);
void fillScreen(gui_color color);

void drawCircleHelper(gui_int16 x0, gui_int16 y0,gui_int16 r, gui_int8 cornername, 
		gui_color color);
void drawCircle(gui_int16 x0, gui_int16 y0, gui_int16 r, gui_color color);
void fillCircleHelper(gui_int16 x0, gui_int16 y0, gui_int16 r,
		      gui_int8 cornername, gui_int16 delta, gui_color color);
void fillCircle(gui_int16 x0, gui_int16 y0, gui_int16 r, gui_color color);
void drawTriangle(gui_int16 x0, gui_int16 y0, gui_int16 x1, gui_int16 y1,
		    gui_int16 x2, gui_int16 y2, gui_color color);
void fillTriangle(gui_int16 x0, gui_int16 y0, gui_int16 x1, gui_int16 y1,
		    gui_int16 x2, gui_int16 y2, gui_color color);
void drawRoundRect(gui_int16 x0, gui_int16 y0, gui_int16 w, gui_int16 h,
		     gui_int16 radius, gui_color color);
void fillRoundRect(gui_int16 x0, gui_int16 y0, gui_int16 w, gui_int16 h,
		     gui_int16 radius, gui_color color);

#endif
