22 #ifndef FIFE_VIDEO_GUI_GUIMANAGER_H
23 #define FIFE_VIDEO_GUI_GUIMANAGER_H
29 #include <guichan.hpp>
35 #include "util/base/singleton.h"
36 #include "eventchannel/sdl/ec_isdleventlistener.h"
66 public DynamicSingleton<GUIManager>,
67 public ISdlEventListener
72 GUIManager(ImagePool& pool);
75 virtual ~GUIManager();
81 gcn::Gui* getGuichanGUI()
const;
94 void init(gcn::Graphics* graphics,
int screenWidth,
int screenHeight);
103 void resizeTopContainer(
unsigned int x,
unsigned int y,
unsigned int width,
unsigned int height);
109 void add(gcn::Widget* widget);
114 void remove(gcn::Widget* widget);
119 gcn::Container* getTopContainer()
const {
return m_gcn_topcontainer; }
125 Console* getConsole()
const {
return m_console; };
129 GuiFont* setDefaultFont(
const std::string& path,
unsigned int size,
const std::string& glyphs);
133 GuiFont* createFont(
const std::string& path =
"",
unsigned int size = 0,
const std::string& glyphs =
"");
137 void releaseFont(GuiFont* font);
139 void invalidateFonts();
141 bool onSdlEvent(SDL_Event& evt);
143 KeyEvent translateKeyEvent(
const gcn::KeyEvent& evt);
144 MouseEvent translateMouseEvent(
const gcn::MouseEvent& evt);
147 static int convertGuichanKeyToFifeKey(
int value);
153 gcn::FocusHandler* m_focushandler;
155 gcn::Container* m_gcn_topcontainer;
157 GuiImageLoader* m_imgloader;
159 gcn::SDLInput *m_input;
163 std::vector<GuiFont*> m_fonts;
165 std::set<gcn::Widget*> m_widgets;
174 std::string m_fontpath;
175 std::string m_fontglyphs;
179 bool m_logic_executed;