#ifndef GLCD_WRITE_H
#define GLCD_WRITE_H
#include "GLCD_types.h"
#include "GR_types.h"

#define TRUE		1
#define FALSE		0
#define UNDF		-1


enum GLCD_ICONS_SMALL
{
	/*BATTERY,
	SOCKET,
	ORDER_RECEIVED,
	ORDED_SENT,
	ENVELOPE,
	EMPTY,
	SQUARE*/
};

enum GLCD_ICON_SIZE
{
	ICON_SIZE_MINIMAL,
	ICON_SIZE_SMALL,
};

#define ICON_SMALL_HEIGHT		16
#define ICON_SMALL_WIDTH		16
/*
#define ICON_MINIMAL_HEIGHT		8
#define ICON_SMALL_HEIGHT		16
#define ICON_MEDIUM_HEIGHT		UNDF
#define ICON_BIG_HEIGHT			UNDF
#define ICON_HUGE_HEIGHT		UNDF

#define ICON_MINIMAL_WIDTH		8
#define ICON_SMALL_WIDTH		18
#define ICON_MEDIUM_WIDTH		UNDF
#define ICON_BIG_WIDTH			UNDF
#define ICON_HUGE_WIDTH			UNDF*/

#define FONT_MINIMAL_HEIGHT		11

#ifdef SIMPLE_FORMAT
	#define FONT_SMALL_HEIGHT		FONT_MINIMAL_HEIGHT*2
#else
	#define FONT_SMALL_HEIGHT		17
#endif

#define FONT_MEDIUM_HEIGHT		UNDF
#define FONT_BIG_HEIGHT			UNDF
#define FONT_HUGE_HEIGHT		UNDF


#define FONT_MINIMAL_WIDTH		6
#ifdef SIMPLE_FORMAT
	#define FONT_SMALL_WIDTH		FONT_MINIMAL_WIDTH*2
#else
	#define FONT_SMALL_WIDTH		10
#endif
#define FONT_MEDIUM_WIDTH		UNDF
#define FONT_BIG_WIDTH			UNDF
#define FONT_HUGE_WIDTH			UNDF

typedef struct CURSOR_INFO
{
	int x;
	int y;
	unsigned char C;
	FONT font;
	char lineHeight;
	TRect roi;
	
}CURSOR_INFO;


void LCD_char(int x, int y, unsigned char c , RGB_COLORS color, FONT_SIZE size);
void LCD_enable_redrawing(char enable);
char LCD_putchar(unsigned char c);
void LCD_Set_Font(FONT *font);
FONT_SIZE LCD_Set_Font_Size(FONT_SIZE font);
void LCD_Set_Font_Color(RGB_COLORS color);
void LCD_Goto_XY(int x, int y);
void LCD_ClrScr(void);
void LCD_printf(unsigned char * text);
void LCD_Set_ROI(TRect * R);
void LCD_enable_inverted(char enable);
void LCD_cursor_pos(int pos);
char LCD_get_lines_count(void);
short LCD_cprintf(int start, unsigned char * input, int curPos);
char LCD_get_font_height(FONT_SIZE font);
char LCD_get_font_width(FONT_SIZE font);
void drawCursor(ANSWER visible);
void LCD_putchar_empty(void);
void LCD_Set_BG_Color(RGB_COLORS current);
void LCD_Save_cursor_pos(char z);
void LCD_console_printf(FORMATED_CHAR * text, int length, int curpos);
extern RGB_COLORS RGB_BACKGROUND;
void LCD_icon(int x, int y, unsigned char c, RGB_COLORS color);
#endif