#ifndef __INTERFACEHANDLER_H__
#define __INTERFACEHANDLER_H__
#include <string>
#include <vector>
#include <SDL/SDL_keysym.h>
#include "interface.h"
class InterfaceHandler {
public:
InterfaceHandler();
~InterfaceHandler();
bool handleEvents();
void addGump(string gump,int x=0,int y=0,int w=0,int h=0);
void addGump(string gump,void (Action::*close)(), int x=0,int y=0,int w=0,int h=0);
void removeGump(string gump);
void removeAllGumps();
void draw();
void buttonClicked(Uint32 ID);
void buttonToggled(Uint32 ID,bool state);
void vListChosen(Uint32 ID);
void colorChosen(Uint32 ID,Uint16 hue);
void primeText(string &text);
void message(string &message);
char SDL2ASC(SDLKey c,SDLMod m);
bool processKey(SDLKey c,SDLMod m);
void focusTextArea(string *textArea);
GumpTextArea *registerTextArea(GumpTextArea *textarea);
GumpVList *registerVList(GumpVList *vlist);
GumpVList *getVList(Uint32 ID);
GumpColorPicker *registerColorPicker(GumpColorPicker *picker);
void showColorPicker(Uint32 ID);
void initCharacters(Uint8 numChars);
void addCharacter(string chr);
int getNextCharacter();
string &getCharacter(int id);
void setProfession(string &profession);
int getScreenHeight() { return screenH; }
int getScreenWidth() { return screenW; }
private:
Uint16 mouseX,mouseY,oldX,oldY;
vector<GumpMain *>gumpList;
map<Uint32,GumpVList *>vLists;
map<Uint32,GumpColorPicker *>colorPickers;
InterfaceGump *activeGump;
GumpMain *currentGump;
string version,profession;
string *primedText,*activeText,*textMessage;
vector<string*>activeStrings;
vector<string>characters;
unsigned int textFocus;
int maxCharacters,curCharacter;
int screenW, screenH;
};
#endif