i6engine
1.0
|
This class interacts with CEGUI. It's methods are executed in the OGRE / CEGUI thread. More...
#include <D:/Projekte/i6engine/libs/i6engine-modules/include/i6engine/modules/gui/GUIManager.h>
Public Types | |
typedef std::map< std::string, boost::function< void(void)> > | GUIFunctions |
typedef std::map< std::pair< api::KeyCode, std::string >, boost::function< void(void)> > | GUIKeyFunctions |
Public Member Functions | |
GUIManager (GUIController *ctrl) | |
constructor, registers basic GUI stuff More... | |
~GUIManager () | |
destructor, cleans up GUI More... | |
void | initializeGUI (Ogre::Root *root) |
Automatically sets up all necessary dat structures of the underlying gui library. More... | |
CEGUI::Window * | getRootWindow () const |
Returns a pointer to gui root window. More... | |
void | setFunction (const std::string &name, const boost::function< void(void)> &ptrEventMethod) |
Adds the given function associated with the window to the GUIFunctions map. More... | |
bool | allowedEvent (const std::string &name) |
returns true, if the event is allowed to be called More... | |
void | changeEvent (const std::string &name, const bool b) |
changes the status of the event More... | |
bool | getVisibility (const std::string &windowname) |
return visibility of the window More... | |
void | processCreateMessage (uint16_t type, api::gui::GUIUpdateMessageStruct *data) |
Handles an incoming message to create a GUI widget. More... | |
void | processUpdateMessage (uint16_t type, api::gui::GUIUpdateMessageStruct *data) |
Handles an incoming message to update a GUI widget This method forwards the message to the right widget. More... | |
void | processDeleteMessage (uint16_t type, api::gui::GUIUpdateMessageStruct *data) |
Handles an incoming message to delete a GUI widget. More... | |
void | processInputUpdateMessage (uint16_t type, core::MessageStruct *data) |
Handles incoming input messages. More... | |
void | addTicker (api::GUIWidget *widget) |
registers a widget to be ticked More... | |
void | removeTicker (api::GUIWidget *widget) |
removes a widget from the tick list More... | |
void | tickWidgets () |
ticks all registered GUIWidgets More... | |
void | registerGUIWidgetTemplate (const std::string &name, GUIWidget_factory createFunc) |
registers a widget-template to create new widgets via messages. More... | |
Protected Member Functions | |
void | createGUI (const std::string &strScheme, const std::string &strFont, const std::string &strDefaultFont, const std::string &strDefaultMouseImageSet, const std::string &strDefaultMouseImageName) |
Creates the GUI. More... | |
void | MouseMove (const double fltDeltaX, const double fltDeltaY, const double fltDeltaZ) const |
Injects a mouse movement into the gui subsystem. More... | |
void | MousePos (const double fltPosX, const double fltPosY) const |
Injects a new absolute cursor position into the gui subsystem. More... | |
void | MouseDown (const api::KeyCode enuButton) const |
Injects the press of a mouse button into the gui subsytem. More... | |
void | MouseUp (const api::KeyCode enuButton) const |
Injects the release of a mouse button into the gui subsytem. More... | |
void | KeyDown (const api::KeyCode intKeyCode, uint32_t text) |
Injects the press of a keyboard key into the gui subsystem. More... | |
void | KeyHold (const api::KeyCode intKeyCode) |
Injects a hold key. More... | |
void | KeyUp (const api::KeyCode intKeyCode) |
Injects the release of a keyboard key into the gui subsystem. More... | |
void | MouseLeaves () const |
Notifies the gui subsystem that the cursor has left the game window. More... | |
void | addChildWindow (const std::string &parent_widget, const std::string &child_widget) |
Calls the CEGUI method addChildWindow (see CEGUI documentation) More... | |
void | addToRootWindow (CEGUI::Window *child) |
Calls the CEGUI method addChildWindow with the root window (see CEGUI documentation) More... | |
void | setMouseVisibility (const bool visibility) |
Calls the CEGUI method setVisible on the mouse cursor (see CEGUI documentation) More... | |
void | cleanUpAllWindows () |
Calls clear on _objGUIWindows. More... | |
void | subscribeEvent (const std::string &name, const std::string &type) |
Calls the CEGUI method subscribeEvent for mouse actions or keystrokes (see CEGUI documentation) More... | |
void | triggerFunction (const std::string &name) |
Triggers the previously subscribed event by clicking the window, with the name "name". Only clicking so far available. More... | |
void | triggerKeyFunction (const uint32_t keyCode, const std::string &type) |
Triggers the previously subscribed event for a key "Pressed" or "Released" event. More... | |
void | handleCreateMessage (uint16_t type, api::gui::GUIUpdateMessageStruct *data) |
Handles all create messages, which are for the GUIManager. More... | |
void | handleUpdateMessage (uint16_t type, api::gui::GUIUpdateMessageStruct *data) |
Handles all update messages, which are for the GUIManager. More... | |
void | handleDeleteMessage (uint16_t type, api::gui::GUIUpdateMessageStruct *data) |
Handles all delete messages, which are for the GUIManager. More... | |
CEGUI::OgreRenderer * | getRenderer () const |
Returns a pointer to the renderer of the gui subsystem. More... | |
void | Tick () |
Tick method of the GUI Subsystem. More... | |
Friends | |
class | GUICanvas |
class | GUIController |
class | GUIMailbox |
This class interacts with CEGUI. It's methods are executed in the OGRE / CEGUI thread.
Definition at line 77 of file GUIManager.h.
typedef std::map<std::string, boost::function<void(void)> > i6e::modules::GUIManager::GUIFunctions |
Definition at line 83 of file GUIManager.h.
typedef std::map<std::pair<api::KeyCode, std::string>, boost::function<void(void)> > i6e::modules::GUIManager::GUIKeyFunctions |
Definition at line 85 of file GUIManager.h.
i6e::modules::GUIManager::GUIManager | ( | GUIController * | ctrl | ) |
constructor, registers basic GUI stuff
i6e::modules::GUIManager::~GUIManager | ( | ) |
destructor, cleans up GUI
|
protected |
Calls the CEGUI method addChildWindow (see CEGUI documentation)
parent_widget | Name of the parent widget |
child_widget | Name of the child widget |
void i6e::modules::GUIManager::addTicker | ( | api::GUIWidget * | widget | ) |
registers a widget to be ticked
|
protected |
Calls the CEGUI method addChildWindow with the root window (see CEGUI documentation)
adds a given window to root
child | The window to add to root |
bool i6e::modules::GUIManager::allowedEvent | ( | const std::string & | name | ) |
returns true, if the event is allowed to be called
returns value depending on whether or not _enabledFunctions count is equal to zero
const | std::string & name |
|
inline |
changes the status of the event
Definition at line 134 of file GUIManager.h.
|
protected |
Calls clear on _objGUIWindows.
calls clear on _objGUIWindows
|
protected |
Creates the GUI.
creates new Windows by calling CEGUIs createWindow function thereby setting a default mouse cursor
[in] | strScheme | - the Scheme which should be loaded (.scheme / XML) |
[in] | strFont | - the default font set |
[in] | strDefaultFont | - the default font (out of the set) |
[in] | strDefaultMouseImageSet | - the mouse image set |
[in] | strDefaultMouseImageName | - the name out of the mouseimageset |
|
inlineprotected |
Returns a pointer to the renderer of the gui subsystem.
Definition at line 365 of file GUIManager.h.
|
inline |
Returns a pointer to gui root window.
Definition at line 108 of file GUIManager.h.
bool i6e::modules::GUIManager::getVisibility | ( | const std::string & | windowname | ) |
return visibility of the window
returns boolean whether window specified by name is set to visible or not
const | std::string & windowname |
|
protected |
Handles all create messages, which are for the GUIManager.
|
protected |
Handles all delete messages, which are for the GUIManager.
|
protected |
Handles all update messages, which are for the GUIManager.
void i6e::modules::GUIManager::initializeGUI | ( | Ogre::Root * | root | ) |
Automatically sets up all necessary dat structures of the underlying gui library.
initializes CEGUI by calling its initialization functions
|
protected |
Injects the press of a keyboard key into the gui subsystem.
fakes key press by using CEGUI's injectKeyDown and injectChar possibly handler for OIS
[in] | intapi::KeyCode | Keycode of the keyboard key that was pressed |
|
protected |
Injects a hold key.
|
protected |
Injects the release of a keyboard key into the gui subsystem.
fakes key release by using CEGUI's injectKeyUp possibly handler for OIS
[in] | intapi::KeyCode | Keycode of the keyboard key that was released |
|
protected |
Injects the press of a mouse button into the gui subsytem.
MouseDown handler for OIS, receives events and invokes CEGUI's injectMouseButtonDown
Injected mouse buttons: left, right, middle, b3, b4
[in] | enuButton | Button which was pressed |
|
protected |
Notifies the gui subsystem that the cursor has left the game window.
|
protected |
Injects a mouse movement into the gui subsystem.
fakes mouse movement and mouse wheel change by using CEGUI's injectMouseMove and injectMouseWheelChange possibly handler for OIS
[in] | fltDelatX | Change of the cursors x position \param[in] fltDeltaY Change of the cursor s y position |
[in] | fltDeltaZ | Change of the mousewheel position |
|
protected |
Injects a new absolute cursor position into the gui subsystem.
fakes mouse movement by using CEGUI's injectMouseMove
[in] | fltPosX | New absolute x position of the cursor |
[in] | FltPosY | New absolute y position of the cursor |
|
protected |
Injects the release of a mouse button into the gui subsytem.
MouseUp handler for OIS, receives events and invokes CEGUI's injectMouseButtonUp
Injected mouse buttons: left, right, middle, b3, b4
[in] | enuButton | Button which was released |
void i6e::modules::GUIManager::processCreateMessage | ( | uint16_t | type, |
api::gui::GUIUpdateMessageStruct * | data | ||
) |
Handles an incoming message to create a GUI widget.
type | The subtype of the message |
data | The content of the message |
void i6e::modules::GUIManager::processDeleteMessage | ( | uint16_t | type, |
api::gui::GUIUpdateMessageStruct * | data | ||
) |
Handles an incoming message to delete a GUI widget.
type | The subtype of the message |
data | The content of the message |
void i6e::modules::GUIManager::processInputUpdateMessage | ( | uint16_t | type, |
core::MessageStruct * | data | ||
) |
Handles incoming input messages.
void i6e::modules::GUIManager::processUpdateMessage | ( | uint16_t | type, |
api::gui::GUIUpdateMessageStruct * | data | ||
) |
Handles an incoming message to update a GUI widget This method forwards the message to the right widget.
type | The subtype of the message |
data | The content of the message |
void i6e::modules::GUIManager::registerGUIWidgetTemplate | ( | const std::string & | name, |
GUIWidget_factory | createFunc | ||
) |
registers a widget-template to create new widgets via messages.
[in] | name | Name of the widget-type. |
[in] | createFunc | A boost::function which takes a string name and a string style, and returns a GUIWidget * Tip: You can use boost::factory to register the Constructor of a GUIWidget. |
void i6e::modules::GUIManager::removeTicker | ( | api::GUIWidget * | widget | ) |
removes a widget from the tick list
void i6e::modules::GUIManager::setFunction | ( | const std::string & | name, |
const boost::function< void(void)> & | ptrEventMethod | ||
) |
Adds the given function associated with the window to the GUIFunctions map.
adds a function pointer to _objGUIFunctions by name (function is called on clicks)
name | Name of the associated window |
ptrEventMethod | Pointer to the designated function |
|
protected |
Calls the CEGUI method setVisible on the mouse cursor (see CEGUI documentation)
sets mouse visibility by calling CEGUI's setVisible function
visibility | True to show, false to hide. |
|
protected |
Calls the CEGUI method subscribeEvent for mouse actions or keystrokes (see CEGUI documentation)
Sets specific EventHandler depending on event type specified by name (i.e. ClickedEventHandler, PressedEventHandler, ReleasedEventHandler)
name | The name of the window OR the OIS::api::KeyCode of the designated key. |
type | Type of the event, either "Clicked" for mouseklicks on windows OR "Pressed"/"Released" for key actions. |
|
protected |
Tick method of the GUI Subsystem.
void i6e::modules::GUIManager::tickWidgets | ( | ) |
ticks all registered GUIWidgets
|
protected |
Triggers the previously subscribed event by clicking the window, with the name "name". Only clicking so far available.
seems to invoke a function call to function in _objGUIFunctions specified by name merely checks existance of name in _objGUIFunctions and calls boost::thread(iter->second) on success
name |
|
protected |
Triggers the previously subscribed event for a key "Pressed" or "Released" event.
seems to invoke a function call to function in _objGUIFunctions specified by name and type merely checks existance of name and type value pair in _objGUIFunctions and calls boost::thread(iter->second) on success
|
friend |
Definition at line 78 of file GUIManager.h.
|
friend |
Definition at line 79 of file GUIManager.h.
|
friend |
Definition at line 80 of file GUIManager.h.