libRocket context abstraction
More...
#include <UIContext.hpp>
|
|
| UIContext () |
| | Default constructor; initialize the visual debugger state to boolean FALSE.
|
|
virtual | ~UIContext () |
| | Destructor.
|
| void | shutdown () |
| | Free the resources (documents) used by the context followed by the context itself.
|
|
bool | debugger_enabled () const |
| | Get the state of the visual debugger for the context.
|
|
void | enable_debugger () |
| | Enable libRocket's visual debugger tool.
|
|
void | disable_debugger () |
| | Disable libRocket's visual debugger tool.
|
| Size2i | debugger_size () const |
| | Get the visual debugger's dimensions.
|
| void | set_debugger_position (const Point2i &pos) |
| | Set the visual debugger's position.
|
| Size2i | beacon_size () const |
| | Get the visual error beacon dimensions.
|
| void | set_beacon_position (const Point2i &pos) |
| | Set the visual error beacon position.
|
| void | set_debugger_size (const Size2i &dims) |
| | Set the visual debugger's dimensions.
|
| Rocket::Core::Context * | context () const |
| | Get libRocket's context.
|
| Size2i | size () const |
| | Get the dimensions (width and height) of this context instance.
|
|
bool | valid () const |
| | Get the validity status of this context instance.
|
| bool | create_context (const std::string &name, const Size2i &res, Rocket::Core::RenderInterface *interface=nullptr) |
| | Create a new element context used by libRocket.
|
|
Rocket::Core::ElementDocument * | load_document_file (const std::string &filename) |
|
Rocket::Core::ElementDocument * | load_mouse_cursor_file (const std::string &filename) |
|
void | show_mouse_cursor (bool state) |
|
bool | load_font (const std::string &filename) |
| void | set_size (const Size2i &dims) |
| | Resize the dimensions (width and height) of this context instance.
|
| void | set_event_handler (nom::EventHandler &evt_handler) |
| | Install the event handler used by the context.
|
| void | update () |
| void | draw () |
|
| void | initialize_debugger () |
| | Initialize libRocket's visual debugger tool.
|
|
void | process_event (const nom::Event &evt) |
| | Internal event processing loop for the context.
|
|
| bool | debugger_ |
| | Active state of libRocket's visual debugger.
|
| Rocket::Core::Context * | context_ |
| | The implementation's element context (used by libRocket).
|
| Rocket::Core::RenderInterface * | renderer_ |
| | Rendering bridge between libRocket and nomlib.
|
| std::unique_ptr< IUIEventHandler > | evt_ |
| | The internal event handler for the context.
|
| EventHandler * | event_handler_ = nullptr |
| Size2i | res_ |
| | The dimensions of the context.
|
libRocket context abstraction
- Todo
- Consider inheriting off nom::IDrawable?
Definition at line 59 of file UIContext.hpp.
◆ self_type
◆ beacon_size()
| Size2i nom::UIContext::beacon_size |
( |
| ) |
const |
Get the visual error beacon dimensions.
- Returns
- The size of the visual err beacon on success, or Size2i::null on failure, such as when the debugger has not been initialized.
◆ context()
| Rocket::Core::Context * nom::UIContext::context |
( |
| ) |
const |
◆ create_context()
| bool nom::UIContext::create_context |
( |
const std::string & | name, |
|
|
const Size2i & | res, |
|
|
Rocket::Core::RenderInterface * | interface = nullptr ) |
Create a new element context used by libRocket.
\params interface The custom rendering interface to use, or NULL to use the default interface. The default interface must be provided by an explicit call to Rocket::Core::SetRenderInterface.
- Note
- The visual debugger must be explicitly enabled with a call to UIContext::enable_debugger.
- See also
- nom::init_librocket and nom::shutdown_librocket.
-
nom::RocketSDL2RenderInterface.
◆ debugger_size()
| Size2i nom::UIContext::debugger_size |
( |
| ) |
const |
Get the visual debugger's dimensions.
- Returns
- The size of the top-level debugger element on success, or Size2i::null on failure, such as when the debugger has not been initialized.
◆ draw()
| void nom::UIContext::draw |
( |
| ) |
|
◆ initialize_debugger()
| void nom::UIContext::initialize_debugger |
( |
| ) |
|
|
private |
Initialize libRocket's visual debugger tool.
- Todo
- Handle positioning of the event log window in regards to independent scale.
◆ set_beacon_position()
| void nom::UIContext::set_beacon_position |
( |
const Point2i & | pos | ) |
|
Set the visual error beacon position.
- Parameters
-
| pos | The X, Y coordinates used for positioning; these will be relative to the context's dimensions. |
◆ set_debugger_position()
| void nom::UIContext::set_debugger_position |
( |
const Point2i & | pos | ) |
|
Set the visual debugger's position.
- Parameters
-
| pos | The X, Y coordinates used for positioning; these will be relative to the context's dimensions. |
◆ set_debugger_size()
| void nom::UIContext::set_debugger_size |
( |
const Size2i & | dims | ) |
|
Set the visual debugger's dimensions.
- Note
- This overwrites the minimum width, width and max-height of the Element Info window.
◆ set_event_handler()
Install the event handler used by the context.
- Note
- The installed event handler must outlive the destruction of this interface!
◆ set_size()
| void nom::UIContext::set_size |
( |
const Size2i & | dims | ) |
|
Resize the dimensions (width and height) of this context instance.
◆ shutdown()
| void nom::UIContext::shutdown |
( |
| ) |
|
Free the resources (documents) used by the context followed by the context itself.
◆ size()
| Size2i nom::UIContext::size |
( |
| ) |
const |
Get the dimensions (width and height) of this context instance.
- Returns
- A nom::Size2i with a non-zero width and height in pixel units on success, or zero width and height on failure – such as if the context is invalid.
◆ update()
| void nom::UIContext::update |
( |
| ) |
|
◆ context_
| Rocket::Core::Context* nom::UIContext::context_ |
|
private |
The implementation's element context (used by libRocket).
Definition at line 228 of file UIContext.hpp.
◆ debugger_
| bool nom::UIContext::debugger_ |
|
private |
Active state of libRocket's visual debugger.
Definition at line 223 of file UIContext.hpp.
◆ event_handler_
◆ evt_
The internal event handler for the context.
Definition at line 236 of file UIContext.hpp.
◆ renderer_
| Rocket::Core::RenderInterface* nom::UIContext::renderer_ |
|
private |
Rendering bridge between libRocket and nomlib.
Definition at line 233 of file UIContext.hpp.
◆ res_
| Size2i nom::UIContext::res_ |
|
private |
The documentation for this class was generated from the following file: