FIFE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FIFE::GUIChanManager Class Reference

#include <guichanmanager.h>

+ Inheritance diagram for FIFE::GUIChanManager:
+ Collaboration diagram for FIFE::GUIChanManager:

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...
 
ConsolegetConsole () const
 Gets the console. More...
 
GuiFontsetDefaultFont (const std::string &path, uint32_t size, const std::string &glyphs)
 Set the global font properties. More...
 
GuiFontgetDefaultFont ()
 Gets the default font. More...
 
GuiFontcreateFont (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)
 
- 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< GUIChanManager >
 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
 
GuiImageLoaderm_imgloader
 
gcn::SDLInput * m_input
 
Consolem_console
 
GuiFontm_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 Public Member Functions inherited from FIFE::DynamicSingleton< GUIChanManager >
static GUIChanManagerinstance ()
 

Detailed Description

Definition at line 66 of file guichanmanager.h.

Constructor & Destructor Documentation

FIFE::GUIChanManager::GUIChanManager ( )
FIFE::GUIChanManager::~GUIChanManager ( )
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.

Member Function Documentation

void FIFE::GUIChanManager::add ( gcn::Widget *  widget)

Adds a new widget.

Parameters
widgetA 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().

+ Here is the caller graph for this function:

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().

+ Here is the caller graph for this function:

Console* FIFE::GUIChanManager::getConsole ( ) const
inline

Gets the console.

Returns
The console.

Definition at line 126 of file guichanmanager.h.

References m_console.

GuiFont* FIFE::GUIChanManager::getDefaultFont ( )
inline

Gets the default font.

Definition at line 134 of file guichanmanager.h.

References m_defaultfont.

gcn::Gui * FIFE::GUIChanManager::getGuichanGUI ( ) const

Gets the member pointer to the Guichan GUI.

Returns
The member pointer to the Guichan GUI.

Definition at line 188 of file guichanmanager.cpp.

References m_gcn_gui.

gcn::Container* FIFE::GUIChanManager::getTopContainer ( ) const
inline

Gets the top container.

Returns
The top container.

Definition at line 120 of file guichanmanager.h.

References m_gcn_topcontainer.

Referenced by FIFE::Console::doShow().

+ Here is the caller graph for this function:

void FIFE::GUIChanManager::init ( const std::string &  backend,
int32_t  screenWidth,
int32_t  screenHeight 
)

Inits the GUI Manager.

Parameters
backendgraphics backend specific grapchics object to use
screenWidthwidth for the gui top container
screenHeightheight 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().

+ Here is the caller graph for this function:

bool FIFE::GUIChanManager::onSdlEvent ( SDL_Event &  evt)
virtual

Called when an SDL event is received from SDL.

Parameters
evtSDL 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)

Releases given font.

Definition at line 258 of file guichanmanager.cpp.

References m_fonts.

void FIFE::GUIChanManager::remove ( gcn::Widget *  widget)

Removes a widget.

Parameters
widgetA 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().

+ Here is the caller graph for this function:

void FIFE::GUIChanManager::resizeTopContainer ( uint32_t  x,
uint32_t  y,
uint32_t  width,
uint32_t  height 
)
virtual

Resizes the top container.

Parameters
xThe new starting X coordinate.
yThe new starting Y coordinate.
widthThe new width.
heightThe 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().

+ Here is the caller graph for this function:

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().

void FIFE::GUIChanManager::turn ( )
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.

Member Data Documentation

Console* FIFE::GUIChanManager::m_console
private
GuiFont* FIFE::GUIChanManager::m_defaultfont
private

Definition at line 170 of file guichanmanager.h.

Referenced by getDefaultFont(), and setDefaultFont().

gcn::FocusHandler* FIFE::GUIChanManager::m_focushandler
private

Definition at line 160 of file guichanmanager.h.

Referenced by GUIChanManager(), and onSdlEvent().

std::string FIFE::GUIChanManager::m_fontglyphs
private

Definition at line 183 of file guichanmanager.h.

Referenced by createFont(), and setDefaultFont().

std::string FIFE::GUIChanManager::m_fontpath
private

Definition at line 182 of file guichanmanager.h.

Referenced by createFont(), and setDefaultFont().

std::vector<GuiFont*> FIFE::GUIChanManager::m_fonts
private

Definition at line 172 of file guichanmanager.h.

Referenced by createFont(), invalidateFonts(), releaseFont(), and ~GUIChanManager().

int32_t FIFE::GUIChanManager::m_fontsize
private

Definition at line 184 of file guichanmanager.h.

Referenced by createFont(), and setDefaultFont().

gcn::Gui* FIFE::GUIChanManager::m_gcn_gui
private

Definition at line 156 of file guichanmanager.h.

Referenced by getGuichanGUI(), GUIChanManager(), init(), turn(), and ~GUIChanManager().

gcn::Container* FIFE::GUIChanManager::m_gcn_topcontainer
private
gcn::Graphics* FIFE::GUIChanManager::m_gui_graphics
private

Definition at line 158 of file guichanmanager.h.

Referenced by init(), and ~GUIChanManager().

bool FIFE::GUIChanManager::m_had_mouse
private

Definition at line 177 of file guichanmanager.h.

Referenced by GUIChanManager(), and onSdlEvent().

bool FIFE::GUIChanManager::m_had_widget
private

Definition at line 178 of file guichanmanager.h.

Referenced by GUIChanManager(), and onSdlEvent().

GuiImageLoader* FIFE::GUIChanManager::m_imgloader
private

Definition at line 164 of file guichanmanager.h.

Referenced by GUIChanManager(), and ~GUIChanManager().

gcn::SDLInput* FIFE::GUIChanManager::m_input
private

Definition at line 166 of file guichanmanager.h.

Referenced by GUIChanManager(), onSdlEvent(), and ~GUIChanManager().

bool FIFE::GUIChanManager::m_isPressed
private

Definition at line 179 of file guichanmanager.h.

Referenced by GUIChanManager(), and onSdlEvent().

bool FIFE::GUIChanManager::m_logic_executed
private

Definition at line 187 of file guichanmanager.h.

Referenced by turn().

std::set<gcn::Widget*> FIFE::GUIChanManager::m_widgets
private

Definition at line 174 of file guichanmanager.h.

Referenced by add(), and remove().


The documentation for this class was generated from the following files: