FIFE
|
#include <guichanmanager.h>
Public Member Functions | |
GUIChanManager () | |
Constructor. More... | |
virtual | ~GUIChanManager () |
Destructor. More... | |
gcn::Gui * | getGuichanGUI () const |
Gets the member pointer to the Guichan GUI. More... | |
virtual void | turn () |
Performs the GUI logic and draws the GUI accordingly. More... | |
void | init (const std::string &backend, int32_t screenWidth, int32_t screenHeight) |
Inits the GUI Manager. More... | |
void | resizeTopContainer (uint32_t x, uint32_t y, uint32_t width, uint32_t height) |
Resizes the top container. More... | |
void | add (gcn::Widget *widget) |
Adds a new widget. More... | |
void | remove (gcn::Widget *widget) |
Removes a widget. More... | |
gcn::Container * | getTopContainer () const |
Gets the top container. More... | |
Console * | getConsole () const |
Gets the console. More... | |
GuiFont * | setDefaultFont (const std::string &path, uint32_t size, const std::string &glyphs) |
Set the global font properties. More... | |
GuiFont * | getDefaultFont () |
Gets the default font. More... | |
GuiFont * | createFont (const std::string &path="", uint32_t size=0, const std::string &glyphs="") |
Gets font with given properties. More... | |
void | releaseFont (GuiFont *font) |
Releases given font. More... | |
void | invalidateFonts () |
virtual bool | onSdlEvent (SDL_Event &evt) |
Called when an SDL event is received from SDL. More... | |
KeyEvent | translateKeyEvent (const gcn::KeyEvent &evt) |
MouseEvent | translateMouseEvent (const gcn::MouseEvent &evt) |
![]() | |
virtual | ~IGUIManager () |
Destructor. More... | |
![]() | |
virtual | ~ISdlEventListener () |
![]() | |
DynamicSingleton () | |
virtual | ~DynamicSingleton () |
Static Protected Member Functions | |
static int32_t | convertGuichanKeyToFifeKey (int32_t value) |
Private Attributes | |
gcn::Gui * | m_gcn_gui |
gcn::Graphics * | m_gui_graphics |
gcn::FocusHandler * | m_focushandler |
gcn::Container * | m_gcn_topcontainer |
GuiImageLoader * | m_imgloader |
gcn::SDLInput * | m_input |
Console * | m_console |
GuiFont * | m_defaultfont |
std::vector< GuiFont * > | m_fonts |
std::set< gcn::Widget * > | m_widgets |
bool | m_had_mouse |
bool | m_had_widget |
bool | m_isPressed |
std::string | m_fontpath |
std::string | m_fontglyphs |
int32_t | m_fontsize |
bool | m_logic_executed |
Additional Inherited Members | |
![]() | |
static GUIChanManager * | instance () |
Definition at line 66 of file guichanmanager.h.
FIFE::GUIChanManager::GUIChanManager | ( | ) |
Constructor.
Definition at line 61 of file guichanmanager.cpp.
References m_focushandler, m_gcn_gui, m_gcn_topcontainer, m_had_mouse, m_had_widget, m_imgloader, m_input, and m_isPressed.
|
virtual |
Destructor.
Definition at line 85 of file guichanmanager.cpp.
References m_console, m_fonts, m_gcn_gui, m_gcn_topcontainer, m_gui_graphics, m_imgloader, and m_input.
void FIFE::GUIChanManager::add | ( | gcn::Widget * | widget | ) |
Adds a new widget.
widget | A pointer to the Widget to add. |
Definition at line 192 of file guichanmanager.cpp.
References m_gcn_topcontainer, and m_widgets.
Referenced by FIFE::Console::doShow().
|
staticprotected |
Definition at line 383 of file guichanmanager.cpp.
References FIFE::Key::ALT_GR, FIFE::Key::BACKSPACE, FIFE::Key::CAPS_LOCK, FIFE::Key::DELETE, FIFE::Key::DOWN, FIFE::Key::END, FIFE::Key::ENTER, FIFE::Key::ESCAPE, FIFE::Key::F1, FIFE::Key::F10, FIFE::Key::F11, FIFE::Key::F12, FIFE::Key::F13, FIFE::Key::F14, FIFE::Key::F15, FIFE::Key::F2, FIFE::Key::F3, FIFE::Key::F4, FIFE::Key::F5, FIFE::Key::F6, FIFE::Key::F7, FIFE::Key::F8, FIFE::Key::F9, FIFE::Key::HOME, FIFE::Key::INSERT, FIFE::Key::LEFT, FIFE::Key::LEFT_ALT, FIFE::Key::LEFT_CONTROL, FIFE::Key::LEFT_META, FIFE::Key::LEFT_SHIFT, FIFE::Key::LEFT_SUPER, FIFE::Key::NUM_LOCK, FIFE::Key::PAGE_DOWN, FIFE::Key::PAGE_UP, FIFE::Key::PAUSE, FIFE::Key::PRINT_SCREEN, FIFE::Key::RIGHT, FIFE::Key::RIGHT_ALT, FIFE::Key::RIGHT_CONTROL, FIFE::Key::RIGHT_META, FIFE::Key::RIGHT_SHIFT, FIFE::Key::RIGHT_SUPER, FIFE::Key::SCROLL_LOCK, FIFE::Key::SPACE, FIFE::Key::TAB, and FIFE::Key::UP.
Referenced by translateKeyEvent().
GuiFont * FIFE::GUIChanManager::createFont | ( | const std::string & | path = "" , |
uint32_t | size = 0 , |
||
const std::string & | glyphs = "" |
||
) |
Gets font with given properties.
Note that font will be owned by GUIChanManager
Definition at line 229 of file guichanmanager.cpp.
References m_fontglyphs, m_fontpath, m_fonts, and m_fontsize.
Referenced by FIFE::Console::Console(), and setDefaultFont().
|
inline |
Gets the console.
Definition at line 126 of file guichanmanager.h.
References m_console.
|
inline |
gcn::Gui * FIFE::GUIChanManager::getGuichanGUI | ( | ) | const |
Gets the member pointer to the Guichan GUI.
Definition at line 188 of file guichanmanager.cpp.
References m_gcn_gui.
|
inline |
Gets the top container.
Definition at line 120 of file guichanmanager.h.
References m_gcn_topcontainer.
Referenced by FIFE::Console::doShow().
void FIFE::GUIChanManager::init | ( | const std::string & | backend, |
int32_t | screenWidth, | ||
int32_t | screenHeight | ||
) |
Inits the GUI Manager.
backend | graphics backend specific grapchics object to use |
screenWidth | width for the gui top container |
screenHeight | height for the gui top container |
Definition at line 206 of file guichanmanager.cpp.
References m_console, m_gcn_gui, m_gui_graphics, and resizeTopContainer().
void FIFE::GUIChanManager::invalidateFonts | ( | ) |
Definition at line 270 of file guichanmanager.cpp.
References m_fonts.
Referenced by resizeTopContainer().
|
virtual |
Called when an SDL event is received from SDL.
evt | SDL event |
Implements FIFE::ISdlEventListener.
Definition at line 99 of file guichanmanager.cpp.
References FIFE::_log, FL_WARN, m_focushandler, m_gcn_topcontainer, m_had_mouse, m_had_widget, m_input, and m_isPressed.
void FIFE::GUIChanManager::releaseFont | ( | GuiFont * | font | ) |
void FIFE::GUIChanManager::remove | ( | gcn::Widget * | widget | ) |
Removes a widget.
widget | A pointer to the Widget to remove. |
Definition at line 199 of file guichanmanager.cpp.
References m_gcn_topcontainer, and m_widgets.
Referenced by FIFE::Console::doHide().
|
virtual |
Resizes the top container.
x | The new starting X coordinate. |
y | The new starting Y coordinate. |
width | The new width. |
height | The new height. |
Implements FIFE::IGUIManager.
Definition at line 182 of file guichanmanager.cpp.
References invalidateFonts(), m_console, m_gcn_topcontainer, and FIFE::Console::reLayout().
Referenced by init().
GuiFont * FIFE::GUIChanManager::setDefaultFont | ( | const std::string & | path, |
uint32_t | size, | ||
const std::string & | glyphs | ||
) |
Set the global font properties.
Definition at line 278 of file guichanmanager.cpp.
References createFont(), m_console, m_defaultfont, m_fontglyphs, m_fontpath, m_fontsize, and FIFE::Console::reLayout().
KeyEvent FIFE::GUIChanManager::translateKeyEvent | ( | const gcn::KeyEvent & | evt | ) |
Definition at line 299 of file guichanmanager.cpp.
References FIFE::_log, convertGuichanKeyToFifeKey(), FL_WARN, FIFE::KeyEvent::PRESSED, FIFE::KeyEvent::RELEASED, FIFE::KeyEvent::setAltPressed(), FIFE::KeyEvent::setControlPressed(), FIFE::KeyEvent::setKey(), FIFE::KeyEvent::setMetaPressed(), FIFE::KeyEvent::setNumericPad(), FIFE::KeyEvent::setShiftPressed(), FIFE::KeyEvent::setType(), and FIFE::KeyEvent::UNKNOWN.
MouseEvent FIFE::GUIChanManager::translateMouseEvent | ( | const gcn::MouseEvent & | evt | ) |
Definition at line 324 of file guichanmanager.cpp.
References FIFE::MouseEvent::CLICKED, FIFE::MouseEvent::DRAGGED, FIFE::MouseEvent::ENTERED, FIFE::MouseEvent::EXITED, FIFE::MouseEvent::LEFT, FIFE::MouseEvent::MIDDLE, FIFE::MouseEvent::MOVED, FIFE::MouseEvent::PRESSED, FIFE::MouseEvent::RELEASED, FIFE::MouseEvent::RIGHT, FIFE::MouseEvent::setAltPressed(), FIFE::MouseEvent::setButton(), FIFE::MouseEvent::setControlPressed(), FIFE::MouseEvent::setMetaPressed(), FIFE::MouseEvent::setShiftPressed(), FIFE::MouseEvent::setType(), FIFE::MouseEvent::setX(), FIFE::MouseEvent::setY(), FIFE::MouseEvent::UNKNOWN_BUTTON, FIFE::MouseEvent::UNKNOWN_EVENT, FIFE::MouseEvent::WHEEL_MOVED_DOWN, and FIFE::MouseEvent::WHEEL_MOVED_UP.
|
virtual |
Performs the GUI logic and draws the GUI accordingly.
This will be called each frame.
Implements FIFE::IGUIManager.
Definition at line 292 of file guichanmanager.cpp.
References m_gcn_gui, and m_logic_executed.
|
private |
Definition at line 168 of file guichanmanager.h.
Referenced by getConsole(), init(), resizeTopContainer(), setDefaultFont(), and ~GUIChanManager().
|
private |
Definition at line 170 of file guichanmanager.h.
Referenced by getDefaultFont(), and setDefaultFont().
|
private |
Definition at line 160 of file guichanmanager.h.
Referenced by GUIChanManager(), and onSdlEvent().
|
private |
Definition at line 183 of file guichanmanager.h.
Referenced by createFont(), and setDefaultFont().
|
private |
Definition at line 182 of file guichanmanager.h.
Referenced by createFont(), and setDefaultFont().
|
private |
Definition at line 172 of file guichanmanager.h.
Referenced by createFont(), invalidateFonts(), releaseFont(), and ~GUIChanManager().
|
private |
Definition at line 184 of file guichanmanager.h.
Referenced by createFont(), and setDefaultFont().
|
private |
Definition at line 156 of file guichanmanager.h.
Referenced by getGuichanGUI(), GUIChanManager(), init(), turn(), and ~GUIChanManager().
|
private |
Definition at line 162 of file guichanmanager.h.
Referenced by add(), getTopContainer(), GUIChanManager(), onSdlEvent(), remove(), resizeTopContainer(), and ~GUIChanManager().
|
private |
Definition at line 158 of file guichanmanager.h.
Referenced by init(), and ~GUIChanManager().
|
private |
Definition at line 177 of file guichanmanager.h.
Referenced by GUIChanManager(), and onSdlEvent().
|
private |
Definition at line 178 of file guichanmanager.h.
Referenced by GUIChanManager(), and onSdlEvent().
|
private |
Definition at line 164 of file guichanmanager.h.
Referenced by GUIChanManager(), and ~GUIChanManager().
|
private |
Definition at line 166 of file guichanmanager.h.
Referenced by GUIChanManager(), onSdlEvent(), and ~GUIChanManager().
|
private |
Definition at line 179 of file guichanmanager.h.
Referenced by GUIChanManager(), and onSdlEvent().
|
private |
Definition at line 187 of file guichanmanager.h.
Referenced by turn().
|
private |
Definition at line 174 of file guichanmanager.h.