Filter:   InfoImg
download interfacehandler.h
Language: C++
LOC: 53
Project Info
Ultima Online Project(uop)
Server: SourceForge
Type: cvs
SourceForge\u\uop\uop\uop\
   acinclude.m4
   aclocal.m4
   action.cc
   action.h
   animation.cc
   animation.h
   artexport.cc
   artfactory.cc
   artfactory.h
   audio.cc
   audio.h
   btree.cc
   btree.h
   cache.h
   cliloc.cc
   cliloc.h
   config.h.in
   configure.in
   cvs2cl.pl
   entity.cc
   entity.h
   gumps.cc
   gumps.h
   interface.cc
   interface.h
   interfacegumps.cc
   interfacegumps.h
   interfacehandler.cc
   interfacehandler.h
   intrface.def
   Makefile.am
   Makefile.in
   message.cc
   message.h
   musicmap.def
   network.cc
   network.h
   patchhandler.cc
   patchhandler.h
   readable.pl
   serverhandler.cc
   serverhandler.h
   sprite.cc
   sprite.h
   stamp-h.in
   texthandler.cc
   texthandler.h
   tiledata.cc
   tiledata.h
   unreadable.pl
   uop.cc
   uop.cfg
   uop.dox
   uop.h
   uopconfig.cc
   uopconfig.h
   uosprite.h
   uostub.pl
   world.cc
   world.h

#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