|
FIFE
|
#include <fifechanmanager.h>
Inheritance diagram for FIFE::FifechanManager:
Collaboration diagram for FIFE::FifechanManager:Public Member Functions | |
| FifechanManager () | |
| Constructor. More... | |
| virtual | ~FifechanManager () |
| Destructor. More... | |
| fcn::Gui * | getFifechanGUI () const |
| Gets the member pointer to the Fifechan 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 Fifechan GUI Manager. More... | |
| void | resizeTopContainer (uint32_t x, uint32_t y, uint32_t width, uint32_t height) |
| Resizes the top container. More... | |
| void | add (fcn::Widget *widget) |
| Adds a new widget. More... | |
| void | remove (fcn::Widget *widget) |
| Removes a widget. More... | |
| fcn::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 fcn::KeyEvent &evt) |
| MouseEvent | translateMouseEvent (const fcn::MouseEvent &evt) |
Public Member Functions inherited from FIFE::IGUIManager | |
| virtual | ~IGUIManager () |
| Destructor. More... | |
Public Member Functions inherited from FIFE::ISdlEventListener | |
| virtual | ~ISdlEventListener () |
Public Member Functions inherited from FIFE::DynamicSingleton< FifechanManager > | |
| DynamicSingleton () | |
| virtual | ~DynamicSingleton () |
Static Protected Member Functions | |
| static int32_t | convertFifechanKeyToFifeKey (int32_t value) |
Private Attributes | |
| fcn::Gui * | m_fcn_gui |
| fcn::Graphics * | m_gui_graphics |
| fcn::FocusHandler * | m_focushandler |
| fcn::Container * | m_fcn_topcontainer |
| GuiImageLoader * | m_imgloader |
| fcn::SDLInput * | m_input |
| Console * | m_console |
| GuiFont * | m_defaultfont |
| std::vector< GuiFont * > | m_fonts |
| std::set< fcn::Widget * > | m_widgets |
| bool | m_had_mouse |
| bool | m_had_widget |
| std::string | m_fontpath |
| std::string | m_fontglyphs |
| int32_t | m_fontsize |
| bool | m_logic_executed |
Additional Inherited Members | |
Static Public Member Functions inherited from FIFE::DynamicSingleton< FifechanManager > | |
| static FifechanManager * | instance () |
Definition at line 66 of file fifechanmanager.h.
| FIFE::FifechanManager::FifechanManager | ( | ) |
Constructor.
Definition at line 57 of file fifechanmanager.cpp.
References m_fcn_gui, m_fcn_topcontainer, m_focushandler, m_had_mouse, m_had_widget, m_imgloader, and m_input.
|
virtual |
Destructor.
Definition at line 80 of file fifechanmanager.cpp.
References m_console, m_fcn_gui, m_fcn_topcontainer, m_fonts, m_gui_graphics, m_imgloader, and m_input.
| void FIFE::FifechanManager::add | ( | fcn::Widget * | widget | ) |
Adds a new widget.
| A | pointer to the widget to add. |
Definition at line 169 of file fifechanmanager.cpp.
References m_fcn_topcontainer, and m_widgets.
Referenced by FIFE::Console::doShow().
Here is the caller graph for this function:
|
staticprotected |
Definition at line 357 of file fifechanmanager.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().
Here is the caller graph for this function:| GuiFont * FIFE::FifechanManager::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 Fifechan GUI Manager
Definition at line 203 of file fifechanmanager.cpp.
References m_fontglyphs, m_fontpath, m_fonts, and m_fontsize.
Referenced by FIFE::Console::Console(), and setDefaultFont().
Here is the caller graph for this function:
|
inline |
Gets the console.
Definition at line 126 of file fifechanmanager.h.
References m_console.
|
inline |
| fcn::Gui * FIFE::FifechanManager::getFifechanGUI | ( | ) | const |
Gets the member pointer to the Fifechan GUI.
Definition at line 165 of file fifechanmanager.cpp.
References m_fcn_gui.
|
inline |
Gets the top container.
Definition at line 120 of file fifechanmanager.h.
References m_fcn_topcontainer.
Referenced by FIFE::Console::doShow().
Here is the caller graph for this function:| void FIFE::FifechanManager::init | ( | const std::string & | backend, |
| int32_t | screenWidth, | ||
| int32_t | screenHeight | ||
| ) |
Inits the Fifechan GUI Manager.
| graphics | backend specific grapchics object to use |
| screenWidth | width for the gui top container |
| screenHeight | height for the gui top container |
Definition at line 183 of file fifechanmanager.cpp.
References m_console, m_fcn_gui, m_gui_graphics, and resizeTopContainer().
| void FIFE::FifechanManager::invalidateFonts | ( | ) |
Definition at line 244 of file fifechanmanager.cpp.
References m_fonts.
Referenced by resizeTopContainer().
Here is the caller graph for this function:
|
virtual |
Called when an SDL event is received from SDL.
| evt | SDL event |
Implements FIFE::ISdlEventListener.
Definition at line 94 of file fifechanmanager.cpp.
References FIFE::_log, FL_WARN, m_fcn_topcontainer, m_focushandler, m_had_mouse, m_had_widget, and m_input.
| void FIFE::FifechanManager::releaseFont | ( | GuiFont * | font | ) |
| void FIFE::FifechanManager::remove | ( | fcn::Widget * | widget | ) |
Removes a widget.
| A | pointer to the widget to remove. |
Definition at line 176 of file fifechanmanager.cpp.
References m_fcn_topcontainer, and m_widgets.
Referenced by FIFE::Console::doHide().
Here is the caller graph for this function:
|
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 159 of file fifechanmanager.cpp.
References invalidateFonts(), m_console, m_fcn_topcontainer, and FIFE::Console::reLayout().
Referenced by init().
Here is the caller graph for this function:| GuiFont * FIFE::FifechanManager::setDefaultFont | ( | const std::string & | path, |
| uint32_t | size, | ||
| const std::string & | glyphs | ||
| ) |
Set the global font properties.
Definition at line 252 of file fifechanmanager.cpp.
References createFont(), m_console, m_defaultfont, m_fontglyphs, m_fontpath, m_fontsize, and FIFE::Console::reLayout().
| KeyEvent FIFE::FifechanManager::translateKeyEvent | ( | const fcn::KeyEvent & | evt | ) |
Definition at line 273 of file fifechanmanager.cpp.
References FIFE::_log, convertFifechanKeyToFifeKey(), 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::FifechanManager::translateMouseEvent | ( | const fcn::MouseEvent & | evt | ) |
Definition at line 298 of file fifechanmanager.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 266 of file fifechanmanager.cpp.
References m_fcn_gui, and m_logic_executed.
|
private |
Definition at line 168 of file fifechanmanager.h.
Referenced by getConsole(), init(), resizeTopContainer(), setDefaultFont(), and ~FifechanManager().
|
private |
Definition at line 170 of file fifechanmanager.h.
Referenced by getDefaultFont(), and setDefaultFont().
|
private |
Definition at line 156 of file fifechanmanager.h.
Referenced by FifechanManager(), getFifechanGUI(), init(), turn(), and ~FifechanManager().
|
private |
Definition at line 162 of file fifechanmanager.h.
Referenced by add(), FifechanManager(), getTopContainer(), onSdlEvent(), remove(), resizeTopContainer(), and ~FifechanManager().
|
private |
Definition at line 160 of file fifechanmanager.h.
Referenced by FifechanManager(), and onSdlEvent().
|
private |
Definition at line 182 of file fifechanmanager.h.
Referenced by createFont(), and setDefaultFont().
|
private |
Definition at line 181 of file fifechanmanager.h.
Referenced by createFont(), and setDefaultFont().
|
private |
Definition at line 172 of file fifechanmanager.h.
Referenced by createFont(), invalidateFonts(), releaseFont(), and ~FifechanManager().
|
private |
Definition at line 183 of file fifechanmanager.h.
Referenced by createFont(), and setDefaultFont().
|
private |
Definition at line 158 of file fifechanmanager.h.
Referenced by init(), and ~FifechanManager().
|
private |
Definition at line 177 of file fifechanmanager.h.
Referenced by FifechanManager(), and onSdlEvent().
|
private |
Definition at line 178 of file fifechanmanager.h.
Referenced by FifechanManager(), and onSdlEvent().
|
private |
Definition at line 164 of file fifechanmanager.h.
Referenced by FifechanManager(), and ~FifechanManager().
|
private |
Definition at line 166 of file fifechanmanager.h.
Referenced by FifechanManager(), onSdlEvent(), and ~FifechanManager().
|
private |
Definition at line 186 of file fifechanmanager.h.
Referenced by turn().
|
private |
Definition at line 174 of file fifechanmanager.h.