yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::ContentRegistry::Panels Namespace Reference

Registry for editor panels. More...

Typedefs

using PanelFactory = std::function<std::unique_ptr<EditorPanel>()>
 

Functions

void RegisterFactory (PanelFactory factory)
 Register a panel factory.
 
std::vector< std::unique_ptr< EditorPanel > > CreateAll ()
 Create new instances of all registered panels.
 
void Register (std::unique_ptr< EditorPanel > panel)
 Register a panel instance (Legacy/Global).
 
std::vector< EditorPanel * > GetAll ()
 Get all registered panels.
 
EditorPanelGet (const std::string &id)
 Get a specific panel by its ID.
 
void Clear ()
 Clear all registered panels.
 
template<typename T >
void add ()
 Register a panel type for auto-creation.
 

Detailed Description

Registry for editor panels.

Panels can register themselves here for centralized management. This enables features like:

  • Discovery of available panels
  • Lazy initialization
  • Lifecycle management

Typedef Documentation

◆ PanelFactory

using yaze::editor::ContentRegistry::Panels::PanelFactory = std::function<std::unique_ptr<EditorPanel>()>

Definition at line 148 of file content_registry.h.

Function Documentation

◆ RegisterFactory()

void yaze::editor::ContentRegistry::Panels::RegisterFactory ( PanelFactory factory)

Register a panel factory.

Parameters
factoryFunction that creates a new instance of the panel.

Definition at line 163 of file content_registry.cc.

Referenced by add().

◆ CreateAll()

std::vector< std::unique_ptr< EditorPanel > > yaze::editor::ContentRegistry::Panels::CreateAll ( )

Create new instances of all registered panels.

Returns
Vector of unique pointers to new panel instances.

Definition at line 168 of file content_registry.cc.

Referenced by yaze::editor::EditorManager::RegisterEditors().

◆ Register()

void yaze::editor::ContentRegistry::Panels::Register ( std::unique_ptr< EditorPanel > panel)

Register a panel instance (Legacy/Global).

Parameters
panelUnique pointer to the panel to register.

Definition at line 186 of file content_registry.cc.

◆ GetAll()

std::vector< EditorPanel * > yaze::editor::ContentRegistry::Panels::GetAll ( )

Get all registered panels.

Returns
Vector of raw pointers to all registered panels.

Definition at line 193 of file content_registry.cc.

Referenced by yaze::test::CoreSystemsTestSuite::RunContentRegistryPanelRegistrationTest().

◆ Get()

EditorPanel * yaze::editor::ContentRegistry::Panels::Get ( const std::string & id)

Get a specific panel by its ID.

Parameters
idThe unique identifier of the panel.
Returns
Pointer to the panel, or nullptr if not found.

Definition at line 206 of file content_registry.cc.

◆ Clear()

void yaze::editor::ContentRegistry::Panels::Clear ( )

Clear all registered panels.

Called during shutdown for cleanup.

Definition at line 218 of file content_registry.cc.

◆ add()

template<typename T >
void yaze::editor::ContentRegistry::Panels::add ( )

Register a panel type for auto-creation.

Template Parameters
TThe panel class to register (must have default constructor).

Definition at line 161 of file content_registry.h.

References RegisterFactory().

Here is the call graph for this function: