#ifndef __GUI_H__
#define __GUI_H__

#include <string>
#include "SDL.h"
#include "SDL_image.h"
#include "SDL_ttf.h"

#define BUTTON 0
#define WINDOW 1
#define STATIC 2
#define STATICLEFT 3
#define DIRBUTTONUP 4
#define DIRBUTTONDOWN 5
#define DIRBUTTONLEFT 6
#define DIRBUTTONRIGHT 7
#define BUTTON_UP 0
#define BUTTON_DOWN 1
#define BUTTON_UPHOVER 2
#define BUTTON_DOWNHOVER 3

extern int SMOOTH;

class FFTWindow
{
public:
	FFTWindow() {};
	~FFTWindow() {};
	void Create(int sx, int sy, int sw, int sh, int stype, std::string sstr, int fsize);
	int GetType();
	int GetState();
	int GetX();
	int GetY();
	int GetW();
	int GetH();
	int GetFontSize();
	std::string GetString();
	void SetState(int newstate);
	void SetString(std::string newstring);
private:
	int x, y, w, h;
	int type;
	std::string str;
	int state;
	int fontsize;
};

class GUI
{
public:
	GUI() {};
	~GUI();
	void Init();
	int MakeWindow(int x, int y, int w, int h);
	int MakeButton(int x, int y, int w, std::string str, int fsize=10);
	int MakeDirButton(int x, int y, int dir);
	int MakeBigButton(int x, int y, int w, int h, std::string str, int fsize=10);
	int MakeStatic(int x, int y, int w, int h, std::string str, int fsize=10);
	int MakeStaticLeft(int x, int y, int w, int h, std::string str, int fsize=10);
	void NewString(int windowid, std::string string);
	int GetButtonID(int x, int y, int w, std::string string);
	void Draw();
	int SendMouseClick(int getx, int gety);
	int SendMouseMotion(int getx, int gety);
	void UpdateButtons();
private:
	int wnext;
	FFTWindow *windows[250];
	SDL_Surface *bg;
	SDL_Surface *right;
	SDL_Surface *bottom;
	SDL_Surface *buttonup;
	SDL_Surface *buttondown;
	SDL_Surface *buttonuphover;
	SDL_Surface *buttondownhover;
	SDL_Surface *dirup;
	SDL_Surface *dirdown;
	SDL_Surface *dirleft;
	SDL_Surface *dirright;
	SDL_Surface *dirupg;
	SDL_Surface *dirdowng;
	SDL_Surface *dirleftg;
	SDL_Surface *dirrightg;
    TTF_Font *font10;
    TTF_Font *font12;
    TTF_Font *font14;
    TTF_Font *font16;
    TTF_Font *font18;
	bool buttonisdown;
};

#endif /* __GUI_H__ */

