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

Global context for accessing shared resources. More...

Functions

void SetGlobalContext (GlobalEditorContext *ctx)
 
Romrom ()
 Get the current ROM instance.
 
void SetRom (Rom *rom)
 Set the current ROM instance.
 
::yaze::EventBusevent_bus ()
 Get the current EventBus instance.
 
void SetEventBus (::yaze::EventBus *bus)
 Set the current EventBus instance.
 
Editorcurrent_editor ()
 Get the currently active editor.
 
void SetCurrentEditor (Editor *editor)
 Set the currently active editor.
 
Editoreditor_window_context (const std::string &category)
 
void SetEditorWindowContext (const std::string &category, Editor *editor)
 
::yaze::zelda3::GameDatagame_data ()
 Get the current game data instance.
 
void SetGameData (::yaze::zelda3::GameData *data)
 Set the current game data instance.
 
::yaze::project::YazeProjectcurrent_project ()
 Get the current project instance.
 
void SetCurrentProject (::yaze::project::YazeProject *project)
 Set the current project instance.
 
workflow::HackWorkflowBackendhack_workflow_backend ()
 
workflow::ValidationCapabilityhack_validation_backend ()
 
workflow::ProgressionCapabilityhack_progression_backend ()
 
workflow::PlanningCapabilityhack_planning_backend ()
 
void SetHackWorkflowBackend (workflow::HackWorkflowBackend *backend)
 
ProjectWorkflowStatus build_workflow_status ()
 
void SetBuildWorkflowStatus (const ProjectWorkflowStatus &status)
 
ProjectWorkflowStatus run_workflow_status ()
 
void SetRunWorkflowStatus (const ProjectWorkflowStatus &status)
 
std::string build_workflow_log ()
 
void SetBuildWorkflowLog (const std::string &output)
 
std::vector< ProjectWorkflowHistoryEntryworkflow_history ()
 
void AppendWorkflowHistory (const ProjectWorkflowHistoryEntry &entry)
 
void ClearWorkflowHistory ()
 
std::function< void()> start_build_workflow_callback ()
 
void SetStartBuildWorkflowCallback (std::function< void()> callback)
 
std::function< void()> run_project_workflow_callback ()
 
void SetRunProjectWorkflowCallback (std::function< void()> callback)
 
std::function< void()> show_workflow_output_callback ()
 
void SetShowWorkflowOutputCallback (std::function< void()> callback)
 
std::function< void()> cancel_build_workflow_callback ()
 
void SetCancelBuildWorkflowCallback (std::function< void()> callback)
 
void Clear ()
 Clear all context state.
 
void SetGlobalContext (::yaze::editor::GlobalEditorContext *ctx)
 Set the backing GlobalEditorContext instance.
 

Detailed Description

Global context for accessing shared resources.

Context provides access to the current ROM and other shared state. This replaces the need for panels to receive dependencies via constructor.

Function Documentation

◆ SetGlobalContext() [1/2]

void yaze::editor::ContentRegistry::Context::SetGlobalContext ( GlobalEditorContext * ctx)

Definition at line 71 of file content_registry.cc.

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

◆ rom()

◆ SetRom()

void yaze::editor::ContentRegistry::Context::SetRom ( Rom * rom)

◆ event_bus()

◆ SetEventBus()

void yaze::editor::ContentRegistry::Context::SetEventBus ( ::yaze::EventBus * bus)

Set the current EventBus instance.

Parameters
busPointer to the EventBus to set as current.

Definition at line 99 of file content_registry.cc.

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

◆ current_editor()

Editor * yaze::editor::ContentRegistry::Context::current_editor ( )

Get the currently active editor.

Returns
Pointer to the current editor, or nullptr if none active.

Definition at line 107 of file content_registry.cc.

◆ SetCurrentEditor()

void yaze::editor::ContentRegistry::Context::SetCurrentEditor ( Editor * editor)

Set the currently active editor.

Parameters
editorPointer to the editor to set as current.

Called when switching between editors (Overworld, Dungeon, etc.)

Definition at line 114 of file content_registry.cc.

Referenced by yaze::editor::WorkspaceWindowManager::DrawAllVisiblePanels(), and yaze::editor::EditorManager::SetCurrentEditor().

◆ editor_window_context()

Editor * yaze::editor::ContentRegistry::Context::editor_window_context ( const std::string & category)

Definition at line 123 of file content_registry.cc.

Referenced by yaze::editor::CurrentTypedWindowContext().

◆ SetEditorWindowContext()

void yaze::editor::ContentRegistry::Context::SetEditorWindowContext ( const std::string & category,
Editor * editor )

◆ game_data()

yaze::zelda3::GameData * yaze::editor::ContentRegistry::Context::game_data ( )

Get the current game data instance.

Returns
Pointer to the current GameData, or nullptr if not set.

Definition at line 138 of file content_registry.cc.

◆ SetGameData()

void yaze::editor::ContentRegistry::Context::SetGameData ( ::yaze::zelda3::GameData * data)

Set the current game data instance.

Parameters
dataPointer to the GameData to set as current.

Called when loading a ROM or switching sessions.

Definition at line 145 of file content_registry.cc.

Referenced by yaze::editor::EditorManager::EnsureGameDataLoaded(), yaze::editor::EditorManager::HandleSessionRomLoaded(), and yaze::editor::EditorManager::HandleSessionSwitched().

◆ current_project()

◆ SetCurrentProject()

void yaze::editor::ContentRegistry::Context::SetCurrentProject ( ::yaze::project::YazeProject * project)

Set the current project instance.

Parameters
projectPointer to the project to set as current.

Called when opening or switching projects.

Definition at line 161 of file content_registry.cc.

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

◆ hack_workflow_backend()

workflow::HackWorkflowBackend * yaze::editor::ContentRegistry::Context::hack_workflow_backend ( )

◆ hack_validation_backend()

workflow::ValidationCapability * yaze::editor::ContentRegistry::Context::hack_validation_backend ( )

◆ hack_progression_backend()

workflow::ProgressionCapability * yaze::editor::ContentRegistry::Context::hack_progression_backend ( )

◆ hack_planning_backend()

workflow::PlanningCapability * yaze::editor::ContentRegistry::Context::hack_planning_backend ( )

◆ SetHackWorkflowBackend()

void yaze::editor::ContentRegistry::Context::SetHackWorkflowBackend ( workflow::HackWorkflowBackend * backend)

◆ build_workflow_status()

ProjectWorkflowStatus yaze::editor::ContentRegistry::Context::build_workflow_status ( )

◆ SetBuildWorkflowStatus()

void yaze::editor::ContentRegistry::Context::SetBuildWorkflowStatus ( const ProjectWorkflowStatus & status)

◆ run_workflow_status()

ProjectWorkflowStatus yaze::editor::ContentRegistry::Context::run_workflow_status ( )

◆ SetRunWorkflowStatus()

void yaze::editor::ContentRegistry::Context::SetRunWorkflowStatus ( const ProjectWorkflowStatus & status)

◆ build_workflow_log()

std::string yaze::editor::ContentRegistry::Context::build_workflow_log ( )

◆ SetBuildWorkflowLog()

void yaze::editor::ContentRegistry::Context::SetBuildWorkflowLog ( const std::string & output)

◆ workflow_history()

std::vector< ProjectWorkflowHistoryEntry > yaze::editor::ContentRegistry::Context::workflow_history ( )

◆ AppendWorkflowHistory()

void yaze::editor::ContentRegistry::Context::AppendWorkflowHistory ( const ProjectWorkflowHistoryEntry & entry)

◆ ClearWorkflowHistory()

void yaze::editor::ContentRegistry::Context::ClearWorkflowHistory ( )

◆ start_build_workflow_callback()

std::function< void()> yaze::editor::ContentRegistry::Context::start_build_workflow_callback ( )

◆ SetStartBuildWorkflowCallback()

void yaze::editor::ContentRegistry::Context::SetStartBuildWorkflowCallback ( std::function< void()> callback)

◆ run_project_workflow_callback()

std::function< void()> yaze::editor::ContentRegistry::Context::run_project_workflow_callback ( )

◆ SetRunProjectWorkflowCallback()

void yaze::editor::ContentRegistry::Context::SetRunProjectWorkflowCallback ( std::function< void()> callback)

◆ show_workflow_output_callback()

std::function< void()> yaze::editor::ContentRegistry::Context::show_workflow_output_callback ( )

◆ SetShowWorkflowOutputCallback()

void yaze::editor::ContentRegistry::Context::SetShowWorkflowOutputCallback ( std::function< void()> callback)

◆ cancel_build_workflow_callback()

std::function< void()> yaze::editor::ContentRegistry::Context::cancel_build_workflow_callback ( )

◆ SetCancelBuildWorkflowCallback()

void yaze::editor::ContentRegistry::Context::SetCancelBuildWorkflowCallback ( std::function< void()> callback)

◆ Clear()

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

Clear all context state.

Called during shutdown or when switching sessions.

Definition at line 288 of file content_registry.cc.

Referenced by yaze::editor::EditorManager::HandleSessionClosed(), and yaze::test::CoreSystemsTestSuite::RunContentRegistryContextClearTest().

◆ SetGlobalContext() [2/2]

void yaze::editor::ContentRegistry::Context::SetGlobalContext ( ::yaze::editor::GlobalEditorContext * ctx)

Set the backing GlobalEditorContext instance.

When set, Context getters/setters delegate to this instance. Called once during EditorManager initialization. Pass nullptr to revert to standalone static storage.