Manages editor types, categories, and lifecycle. More...
#include <editor_registry.h>
Public Types | |
| using | EditorFactory = std::function<std::unique_ptr<Editor>(Rom*)> |
Public Member Functions | |
| EditorRegistry ()=default | |
| ~EditorRegistry ()=default | |
| std::vector< EditorType > | GetEditorsInCategory (const std::string &category) const |
| std::vector< std::string > | GetAvailableCategories () const |
| std::string | GetEditorDisplayName (EditorType type) const |
| void | RegisterEditor (EditorType type, Editor *editor) |
| void | UnregisterEditor (EditorType type) |
| Editor * | GetEditor (EditorType type) const |
| void | RegisterFactory (EditorType type, EditorFactory factory) |
| void | UnregisterFactory (EditorType type) |
| bool | HasFactory (EditorType type) const |
| std::unique_ptr< Editor > | CreateEditor (EditorType type, Rom *rom) const |
| bool | IsEditorActive (EditorType type) const |
| bool | IsEditorVisible (EditorType type) const |
| void | SetEditorActive (EditorType type, bool active) |
Static Public Member Functions | |
| static bool | IsPanelBasedEditor (EditorType type) |
| static std::string | GetEditorCategory (EditorType type) |
| static EditorType | GetEditorTypeFromCategory (const std::string &category) |
| static std::vector< std::string > | GetAllEditorCategories () |
| Get all editor categories in display order for sidebar. | |
Private Member Functions | |
| bool | IsValidEditorType (EditorType type) const |
| void | ValidateEditorType (EditorType type) const |
Private Attributes | |
| std::unordered_map< EditorType, Editor * > | registered_editors_ |
| std::unordered_map< EditorType, EditorFactory > | editor_factories_ |
Static Private Attributes | |
| static const std::unordered_map< EditorType, std::string > | kEditorCategories |
| static const std::unordered_map< EditorType, std::string > | kEditorNames |
| static const std::unordered_map< EditorType, bool > | kPanelBasedEditors |
Manages editor types, categories, and lifecycle.
Extracted from EditorManager to provide focused editor management:
Definition at line 24 of file editor_registry.h.
| using yaze::editor::EditorRegistry::EditorFactory = std::function<std::unique_ptr<Editor>(Rom*)> |
Definition at line 26 of file editor_registry.h.
|
default |
|
default |
|
static |
Definition at line 60 of file editor_registry.cc.
References kPanelBasedEditors.
Referenced by yaze::editor::EditorActivator::DeactivatePanelBasedEditor(), yaze::editor::EditorManager::IsPanelBasedEditor(), and yaze::editor::EditorActivator::SwitchToEditor().
|
static |
Definition at line 65 of file editor_registry.cc.
References kEditorCategories.
Referenced by yaze::editor::EditorActivator::ActivatePanelBasedEditor(), yaze::editor::EditorActivator::DeactivatePanelBasedEditor(), yaze::editor::EditorManager::DrawInterface(), and yaze::editor::PanelManager::ResetToDefaults().
|
static |
Definition at line 73 of file editor_registry.cc.
References kEditorCategories, yaze::editor::kHex, and yaze::editor::kSettings.
Referenced by yaze::editor::UICoordinator::InitializeCommandPalette(), yaze::editor::WorkspaceManager::ResetWorkspaceLayout(), yaze::editor::EditorManager::ResolveEditorForCategory(), and yaze::editor::EditorManager::SetupSidebarCallbacks().
|
static |
Get all editor categories in display order for sidebar.
Definition at line 86 of file editor_registry.cc.
Referenced by yaze::editor::EditorManager::DrawInterface(), and yaze::editor::CommandPalette::RegisterEditorCommands().
| std::vector< EditorType > yaze::editor::EditorRegistry::GetEditorsInCategory | ( | const std::string & | category | ) | const |
Definition at line 105 of file editor_registry.cc.
References kEditorCategories.
| std::vector< std::string > yaze::editor::EditorRegistry::GetAvailableCategories | ( | ) | const |
Definition at line 118 of file editor_registry.cc.
References kEditorCategories.
| std::string yaze::editor::EditorRegistry::GetEditorDisplayName | ( | EditorType | type | ) | const |
Definition at line 132 of file editor_registry.cc.
References kEditorNames.
Referenced by RegisterEditor(), and UnregisterEditor().
| void yaze::editor::EditorRegistry::RegisterEditor | ( | EditorType | type, |
| Editor * | editor ) |
Definition at line 140 of file editor_registry.cc.
References GetEditorDisplayName(), registered_editors_, and ValidateEditorType().

| void yaze::editor::EditorRegistry::UnregisterEditor | ( | EditorType | type | ) |
Definition at line 180 of file editor_registry.cc.
References GetEditorDisplayName(), registered_editors_, and ValidateEditorType().

| Editor * yaze::editor::EditorRegistry::GetEditor | ( | EditorType | type | ) | const |
Definition at line 191 of file editor_registry.cc.
References registered_editors_, and ValidateEditorType().

| void yaze::editor::EditorRegistry::RegisterFactory | ( | EditorType | type, |
| EditorFactory | factory ) |
Definition at line 152 of file editor_registry.cc.
References editor_factories_, and ValidateEditorType().
Referenced by yaze::editor::RegisterDefaultEditorFactories().

| void yaze::editor::EditorRegistry::UnregisterFactory | ( | EditorType | type | ) |
Definition at line 160 of file editor_registry.cc.
References editor_factories_, and ValidateEditorType().

| bool yaze::editor::EditorRegistry::HasFactory | ( | EditorType | type | ) | const |
Definition at line 165 of file editor_registry.cc.
References editor_factories_, and ValidateEditorType().

| std::unique_ptr< Editor > yaze::editor::EditorRegistry::CreateEditor | ( | EditorType | type, |
| Rom * | rom ) const |
Definition at line 170 of file editor_registry.cc.
References editor_factories_, and ValidateEditorType().
Referenced by yaze::editor::EditorSet::EditorSet().

| bool yaze::editor::EditorRegistry::IsEditorActive | ( | EditorType | type | ) | const |
Definition at line 201 of file editor_registry.cc.
References registered_editors_, and ValidateEditorType().

| bool yaze::editor::EditorRegistry::IsEditorVisible | ( | EditorType | type | ) | const |
Definition at line 211 of file editor_registry.cc.
References registered_editors_, and ValidateEditorType().

| void yaze::editor::EditorRegistry::SetEditorActive | ( | EditorType | type, |
| bool | active ) |
Definition at line 221 of file editor_registry.cc.
References registered_editors_, and ValidateEditorType().

|
private |
Definition at line 230 of file editor_registry.cc.
References kEditorCategories.
Referenced by ValidateEditorType().
|
private |
Definition at line 234 of file editor_registry.cc.
References IsValidEditorType().
Referenced by CreateEditor(), GetEditor(), HasFactory(), IsEditorActive(), IsEditorVisible(), RegisterEditor(), RegisterFactory(), SetEditorActive(), UnregisterEditor(), and UnregisterFactory().

|
staticprivate |
Definition at line 66 of file editor_registry.h.
Referenced by GetAvailableCategories(), GetEditorCategory(), GetEditorsInCategory(), GetEditorTypeFromCategory(), and IsValidEditorType().
|
staticprivate |
Definition at line 67 of file editor_registry.h.
Referenced by GetEditorDisplayName().
|
staticprivate |
Definition at line 68 of file editor_registry.h.
Referenced by IsPanelBasedEditor().
|
private |
Definition at line 71 of file editor_registry.h.
Referenced by GetEditor(), IsEditorActive(), IsEditorVisible(), RegisterEditor(), SetEditorActive(), and UnregisterEditor().
|
private |
Definition at line 74 of file editor_registry.h.
Referenced by CreateEditor(), HasFactory(), RegisterFactory(), and UnregisterFactory().