
#ifndef __GUI_H__
#define __GUI_H__

#include "fonts.h"
#include "font.h"
#include "lcd.h"
#include "string.h"
#include "globales.h"
#include <stdio.h>

#define LEFT 0
#define RIGHT 480 //9999
#define CENTER 240 //9998
#define LCD_W 480
#define LCD_H 800

#define PORTRAIT 0
#define LANDSCAPE 1


_current_font cfont;
bool _transparent;
uint8_t	orient;

uint32_t mypow(uint8_t m,uint8_t n);
void GUI_DrawPoint(uint16_t x,uint16_t y,uint16_t color);
void LCD_Fill(uint16_t sx,uint16_t sy,uint16_t ex,uint16_t ey,uint16_t color);
void LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
void LCD_DrawRectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
void Draw_Circle(uint16_t x0,uint16_t y0,uint16_t fc,uint8_t r);
void Draw_Triangel(uint16_t x0,uint16_t y0,uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2);
void Fill_Triangel(uint16_t x0,uint16_t y0,uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2);
void LCD_ShowChar(uint16_t x,uint16_t y,uint16_t fc, uint16_t bc, uint8_t num,uint8_t Size,uint8_t mode);
void LCD_ShowNum(uint16_t x,uint16_t y,uint32_t num,uint8_t len,uint8_t Size);
void LCD_Show2Num(uint16_t x,uint16_t y,uint16_t num,uint8_t len,uint8_t Size,uint8_t mode);
void LCD_ShowString(uint16_t x,uint16_t y,uint8_t Size,uint8_t *p,uint8_t mode);
void Show_Str(uint16_t x, uint16_t y, uint16_t fc, uint16_t bc, uint8_t *str,uint8_t Size,uint8_t mode);
void Gui_Drawbmp16(uint16_t x,uint16_t y,uint16_t w,uint16_t h,const unsigned char *p); 
void gui_circle(int xc, int yc,uint16_t c,int r, int fill);
void Gui_StrCenter(uint16_t x, uint16_t y, uint16_t fc, uint16_t bc, uint8_t *str,uint8_t Size,uint8_t mode);
void LCD_DrawFillRectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
void LCD_setFont(FONTYPE fontype);
void DrawTestPage(uint8_t *str);
void NT35510_printChar(uint8_t c, int x, int y,uint16_t fc, uint16_t bc);
void NT35510_rotateChar(uint8_t c, int x, int y, int pos, int deg,uint16_t fc, uint16_t bc);
void NT35510_print(char *st, int x, int y, int deg, uint16_t fc, uint16_t bc);
void NT35510_printNumI(long num, int x, int y, int length, char filler, uint16_t fc, uint16_t bc);
void NT35510_printNumF(double num, uint8_t lenght, uint8_t dec, char filler, int x, int y, uint16_t fc, uint16_t bc);
void NT35510_drawBitmap_from_w25q(int x, int y, int sx, int sy,uint32_t p, int scale);
void NT35510_drawBitmap(int x, int y, int sx, int sy,uint8_t * p, int scale);

#endif

