Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::ui_document_component Struct Reference

Component that holds a reference to a UI document for RmlUi rendering. More...

#include <ui_document_component.h>

Inheritance diagram for unravel::ui_document_component:
unravel::component_crtp< ui_document_component, owned_component > unravel::owned_component unravel::basic_component

Public Member Functions

auto is_loaded () const -> bool
 Check if document is currently loaded.
 
auto is_enabled () const -> bool
 Check if document is currently enabled.
 
void set_enabled (bool enabled)
 Set the enabled state of the document.
 
- Public Member Functions inherited from unravel::owned_component
auto operator= (const owned_component &other) -> owned_component &=default
 
void set_owner (entt::handle owner)
 Sets the owner of the component.
 
auto get_owner () const noexcept -> entt::const_handle
 Gets the owner of the component.
 
auto get_owner () noexcept -> entt::handle
 Gets the owner of the component.
 
- Public Member Functions inherited from unravel::basic_component
void touch ()
 Marks the component as 'touched'.
 

Public Attributes

asset_handle< ui_treeasset
 Path to the UI document file (HTML/RML)
 
Rml::ElementDocument * document = nullptr
 Shared pointer to the loaded RmlUi document.
 
uint64_t version = 0
 
- Public Attributes inherited from unravel::basic_component
bool eto {}
 Disable empty type optimizations.
 

Additional Inherited Members

- Public Types inherited from unravel::component_crtp< ui_document_component, owned_component >
using base
 
- Static Public Member Functions inherited from unravel::owned_component
template<typename T >
static void on_create_component (entt::registry &r, entt::entity e)
 
template<typename T >
static void on_destroy_component (entt::registry &r, entt::entity e)
 
- Static Public Attributes inherited from unravel::component_crtp< ui_document_component, owned_component >
static constexpr bool in_place_delete
 Indicates if the component can be deleted in place.
 

Detailed Description

Component that holds a reference to a UI document for RmlUi rendering.

This component manages an RmlUi document within the shared UI context. Each component instance holds its own document while sharing the global UI context.

Definition at line 25 of file ui_document_component.h.

Member Function Documentation

◆ is_enabled()

auto unravel::ui_document_component::is_enabled ( ) const -> bool
nodiscard

Check if document is currently enabled.

Returns
True if document is enabled

Definition at line 16 of file ui_document_component.cpp.

◆ is_loaded()

auto unravel::ui_document_component::is_loaded ( ) const -> bool
nodiscard

Check if document is currently loaded.

Returns
True if document is loaded and valid

Definition at line 11 of file ui_document_component.cpp.

◆ set_enabled()

void unravel::ui_document_component::set_enabled ( bool enabled)

Set the enabled state of the document.

Parameters
enabledTrue if document should be enabled

Definition at line 21 of file ui_document_component.cpp.

Member Data Documentation

◆ asset

asset_handle<ui_tree> unravel::ui_document_component::asset

Path to the UI document file (HTML/RML)

Definition at line 28 of file ui_document_component.h.

◆ document

Rml::ElementDocument* unravel::ui_document_component::document = nullptr

Shared pointer to the loaded RmlUi document.

Definition at line 32 of file ui_document_component.h.

◆ version

uint64_t unravel::ui_document_component::version = 0

Definition at line 34 of file ui_document_component.h.


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