FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::LibRocketManager Class Reference

#include <librocketmanager.h>

+ Inheritance diagram for FIFE::LibRocketManager:
+ Collaboration diagram for FIFE::LibRocketManager:

Public Member Functions

 LibRocketManager ()
 Constructor. More...
 
virtual ~LibRocketManager ()
 Destructor. More...
 
void init (const std::string &backend, int32_t screenWidth, int32_t screenHeight)
 Initializes the librocket manager. More...
 
virtual float GetElapsedTime ()
 NOTE There is an inconsistency in the naming of this method. More...
 
virtual void turn ()
 Updates and renders the gui. More...
 
virtual void resizeTopContainer (uint32_t x, uint32_t y, uint32_t width, uint32_t height)
 Resizes the top container. More...
 
virtual Rocket::Core::ElementDocument * loadDocument (const std::string &id, const std::string &documentPath)
 Loads a rocket .rml file and shows it. More...
 
virtual Rocket::Core::ElementDocument * getDocument (const std::string &id)
 
virtual void unloadDocument (Rocket::Core::ElementDocument *document)
 Unloads a rocket document. More...
 
virtual void unloadDocument (const std::string &id)
 Unloads a rocket document with given id. More...
 
virtual void loadFont (const std::string &filepath)
 Loads a font to be used by librocket. More...
 
virtual bool onSdlEvent (SDL_Event &evt)
 Receives input and converts it to librocket format, then it forwards it to librocket. More...
 
void showDebugger () const
 Shows the librocket debugger. More...
 
void hideDebugger () const
 Hides the librocket debugger. More...
 
- 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::IListener
virtual bool isActive ()
 Indicates if the listener is active. More...
 
virtual void setActive (bool active)
 Changes the listener status. More...
 
virtual ~IListener ()
 
- Public Member Functions inherited from FIFE::DynamicSingleton< LibRocketManager >
 DynamicSingleton ()
 
virtual ~DynamicSingleton ()
 

Private Member Functions

void unloadDocuments ()
 Unloads documents opened by librocket. More...
 

Private Attributes

Rocket::Core::Context * m_context
 Librocket's context. More...
 
LibRocketRenderInterfacem_renderInterface
 Render Interface for librocket. More...
 
LibRocketInputProcessorm_inputProcessor
 Input processor for librocket. More...
 
std::map< std::string, Rocket::Core::ElementDocument * > m_openDocuments
 A set of all open documents. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from FIFE::DynamicSingleton< LibRocketManager >
static LibRocketManagerinstance ()
 
- Protected Member Functions inherited from FIFE::IListener
 IListener ()
 

Detailed Description

Definition at line 52 of file librocketmanager.h.

Constructor & Destructor Documentation

◆ LibRocketManager()

FIFE::LibRocketManager::LibRocketManager ( )

Constructor.

Definition at line 43 of file librocketmanager.cpp.

References m_renderInterface.

◆ ~LibRocketManager()

FIFE::LibRocketManager::~LibRocketManager ( )
virtual

Destructor.

Definition at line 53 of file librocketmanager.cpp.

References m_context, m_inputProcessor, m_renderInterface, and unloadDocuments().

Member Function Documentation

◆ getDocument()

Rocket::Core::ElementDocument * FIFE::LibRocketManager::getDocument ( const std::string &  id)
virtual
Returns
Document with id.

Definition at line 113 of file librocketmanager.cpp.

References m_openDocuments.

◆ GetElapsedTime()

float FIFE::LibRocketManager::GetElapsedTime ( )
virtual

NOTE There is an inconsistency in the naming of this method.

It's in upper camelcase and should have been in lower camelcase, but it overrides Rocket::Core::SystemInterface::GetElapsedTime.

Returns
The number of seconds elapsed since the start of the application.

Definition at line 73 of file librocketmanager.cpp.

References FIFE::TimeManager::getTime(), and FIFE::DynamicSingleton< TimeManager >::instance().

◆ hideDebugger()

void FIFE::LibRocketManager::hideDebugger ( ) const

Hides the librocket debugger.

Definition at line 167 of file librocketmanager.cpp.

◆ init()

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

Initializes the librocket manager.

Definition at line 62 of file librocketmanager.cpp.

References m_context, and m_inputProcessor.

◆ loadDocument()

Rocket::Core::ElementDocument * FIFE::LibRocketManager::loadDocument ( const std::string &  id,
const std::string &  documentPath 
)
virtual

Loads a rocket .rml file and shows it.

Parameters
idId of the document chosen by the user.
documentPathPath to the file.
Returns
A document if the .rml file exists, NULL otherwise.

Definition at line 94 of file librocketmanager.cpp.

References m_context, and m_openDocuments.

◆ loadFont()

void FIFE::LibRocketManager::loadFont ( const std::string &  filepath)
virtual

Loads a font to be used by librocket.

Parameters
filepathPath of the font.

Definition at line 145 of file librocketmanager.cpp.

◆ onSdlEvent()

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

Receives input and converts it to librocket format, then it forwards it to librocket.

Implements FIFE::ISdlEventListener.

Definition at line 154 of file librocketmanager.cpp.

References m_inputProcessor, and FIFE::LibRocketInputProcessor::onSdlEvent().

◆ resizeTopContainer()

void FIFE::LibRocketManager::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 90 of file librocketmanager.cpp.

References m_context.

◆ showDebugger()

void FIFE::LibRocketManager::showDebugger ( ) const

Shows the librocket debugger.

Definition at line 159 of file librocketmanager.cpp.

◆ turn()

void FIFE::LibRocketManager::turn ( )
virtual

◆ unloadDocument() [1/2]

void FIFE::LibRocketManager::unloadDocument ( Rocket::Core::ElementDocument *  document)
virtual

Unloads a rocket document.

Definition at line 121 of file librocketmanager.cpp.

References m_context, and m_openDocuments.

◆ unloadDocument() [2/2]

void FIFE::LibRocketManager::unloadDocument ( const std::string &  id)
virtual

Unloads a rocket document with given id.

Definition at line 136 of file librocketmanager.cpp.

References m_context, and m_openDocuments.

◆ unloadDocuments()

void FIFE::LibRocketManager::unloadDocuments ( )
private

Unloads documents opened by librocket.

Definition at line 175 of file librocketmanager.cpp.

References m_context, and m_openDocuments.

Referenced by ~LibRocketManager().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_context

Rocket::Core::Context* FIFE::LibRocketManager::m_context
private

Librocket's context.

Definition at line 146 of file librocketmanager.h.

Referenced by init(), loadDocument(), resizeTopContainer(), turn(), unloadDocument(), unloadDocuments(), and ~LibRocketManager().

◆ m_inputProcessor

LibRocketInputProcessor* FIFE::LibRocketManager::m_inputProcessor
private

Input processor for librocket.

Definition at line 154 of file librocketmanager.h.

Referenced by init(), onSdlEvent(), turn(), and ~LibRocketManager().

◆ m_openDocuments

std::map<std::string, Rocket::Core::ElementDocument*> FIFE::LibRocketManager::m_openDocuments
private

A set of all open documents.

Definition at line 158 of file librocketmanager.h.

Referenced by getDocument(), loadDocument(), unloadDocument(), and unloadDocuments().

◆ m_renderInterface

LibRocketRenderInterface* FIFE::LibRocketManager::m_renderInterface
private

Render Interface for librocket.

Definition at line 150 of file librocketmanager.h.

Referenced by LibRocketManager(), turn(), and ~LibRocketManager().


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