Main controller for the application. More...
#include <controller.h>

Classes | |
| struct | ScreenshotRequest |
Public Member Functions | |
| bool | IsActive () const |
| absl::Status | OnEntry (std::string filename="") |
| void | OnInput () |
| absl::Status | OnLoad () |
| void | DoRender () const |
| void | OnExit () |
| void | RequestScreenshot (const ScreenshotRequest &request) |
| void | SetStartupEditor (const std::string &editor_name, const std::string &cards) |
| void | ShowWindow () |
| void | HideWindow () |
| auto | window () -> SDL_Window * |
| void | set_active (bool active) |
| auto | active () const |
| auto | overworld () -> yaze::zelda3::Overworld * |
| auto | GetCurrentRom () -> Rom * |
| auto | renderer () -> gfx::IRenderer * |
| editor::EditorManager * | editor_manager () |
| platform::IWindowBackend * | window_backend () |
| void | SetWindowBackendForTesting (std::unique_ptr< platform::IWindowBackend > window_backend) |
| absl::Status | LoadRomForTesting (const std::string &rom_path) |
Private Member Functions | |
| friend | int::main (int argc, char **argv) |
| void | ProcessScreenshotRequests () const |
Private Attributes | |
| bool | active_ = false |
| std::unique_ptr< platform::IWindowBackend > | window_backend_ |
| editor::EditorManager | editor_manager_ |
| std::unique_ptr< gfx::IRenderer > | renderer_ |
| std::mutex | screenshot_mutex_ |
| std::queue< ScreenshotRequest > | screenshot_requests_ |
Main controller for the application.
This class is responsible for managing the main window and the main editor. It is the main entry point for the application.
Definition at line 33 of file controller.h.
|
inline |
Definition at line 40 of file controller.h.
References active_.
| absl::Status yaze::Controller::OnEntry | ( | std::string | filename = "" | ) |
Definition at line 37 of file controller.cc.
References active_, yaze::gfx::RendererFactory::Create(), yaze::platform::WindowBackendFactory::Create(), editor_manager_, yaze::editor::EditorManager::emulator(), yaze::gfx::Arena::Get(), yaze::Application::GetConfig(), yaze::gfx::RendererFactory::GetDefaultBackendType(), yaze::platform::WindowBackendFactory::GetDefaultType(), yaze::platform::WindowConfig::hidden, yaze::platform::WindowConfig::high_dpi, yaze::editor::EditorManager::Initialize(), yaze::gfx::Arena::Initialize(), yaze::Application::Instance(), yaze::platform::IOS, LOG_INFO, yaze::gfx::Metal, yaze::gfx::Null, yaze::platform::Null, renderer_, yaze::platform::WindowConfig::resizable, RETURN_IF_ERROR, yaze::editor::EditorManager::SetAssetLoadMode(), yaze::platform::WindowConfig::title, and window_backend_.
| void yaze::Controller::OnInput | ( | ) |
Definition at line 113 of file controller.cc.
References yaze::platform::Close, editor_manager_, yaze::editor::EditorManager::emulator(), yaze::platform::Exposed, yaze::platform::FocusGained, yaze::platform::FocusLost, yaze::editor::EditorManager::HandleHostVisibilityChanged(), yaze::platform::WindowEvent::has_native_event, yaze::platform::Hidden, yaze::platform::Minimized, yaze::platform::WindowEvent::native_event, yaze::editor::EditorManager::Quit(), yaze::platform::Quit, yaze::platform::Restored, yaze::platform::Shown, yaze::platform::WindowEvent::type, and window_backend_.

| absl::Status yaze::Controller::OnLoad | ( | ) |
Definition at line 155 of file controller.cc.
References active_, yaze::gui::DockSpaceRenderer::BeginEnhancedDockSpace(), yaze::gui::WidgetIdRegistry::BeginFrame(), yaze::platform::ios::EditorStateSnapshot::can_redo, yaze::platform::ios::EditorStateSnapshot::can_save, yaze::platform::ios::EditorStateSnapshot::can_undo, yaze::editor::FrameGuiBeginEvent::Create(), yaze::Rom::dirty(), yaze::editor::EditorManager::DrawMainMenuBar(), yaze::editor::UICoordinator::DrawMenuBarRestoreButton(), editor_manager_, yaze::platform::ios::EditorStateSnapshot::editor_type, yaze::editor::EditorTypeIndex(), yaze::gui::DockSpaceRenderer::EndEnhancedDockSpace(), yaze::gui::WidgetIdRegistry::EndFrame(), yaze::editor::ContentRegistry::Context::event_bus(), yaze::gui::ThemeManager::Get(), yaze::editor::EditorManager::GetBottomLayoutOffset(), yaze::editor::EditorManager::GetCurrentEditor(), yaze::editor::EditorManager::GetCurrentRom(), yaze::editor::EditorManager::GetLeftLayoutOffset(), yaze::platform::ios::GetOverlayTopInset(), yaze::editor::EditorManager::GetRightLayoutOffset(), yaze::platform::ios::GetSafeAreaInsets(), yaze::gui::WidgetIdRegistry::Instance(), yaze::platform::ios::EditorStateSnapshot::is_dirty, yaze::Rom::is_loaded(), yaze::editor::UICoordinator::IsMenuBarVisible(), yaze::editor::kEditorNames, yaze::editor::ContentRegistry::Context::layout_manager(), yaze::platform::ios::PostEditorStateUpdate(), yaze::editor::EditorManager::quit(), RETURN_IF_ERROR, yaze::platform::ios::EditorStateSnapshot::rom_title, yaze::Rom::title(), yaze::editor::EditorManager::ui_coordinator(), yaze::editor::EditorManager::Update(), yaze::gui::ThemeManager::UpdateTransition(), yaze::editor::ContentRegistry::Context::user_settings(), and window_backend_.
| void yaze::Controller::DoRender | ( | ) | const |
Definition at line 298 of file controller.cc.
References editor_manager_, yaze::gfx::Arena::Get(), yaze::TimingManager::Get(), yaze::test::TestManager::Get(), yaze::editor::EditorManager::GetUiSyncStateSnapshot(), yaze::Application::Instance(), yaze::editor::EditorManager::UiSyncState::layout_rebuild_pending, yaze::test::TestManager::OnPostSwap(), ProcessScreenshotRequests(), yaze::gfx::Arena::ProcessTextureQueue(), yaze::gfx::Arena::ProcessTextureQueueWithBudget(), renderer_, yaze::TimingManager::Update(), and window_backend_.
| void yaze::Controller::OnExit | ( | ) |
Definition at line 352 of file controller.cc.
References renderer_, and window_backend_.
| void yaze::Controller::RequestScreenshot | ( | const ScreenshotRequest & | request | ) |
Definition at line 374 of file controller.cc.
References screenshot_mutex_, and screenshot_requests_.
| void yaze::Controller::SetStartupEditor | ( | const std::string & | editor_name, |
| const std::string & | cards ) |
Definition at line 104 of file controller.cc.
References editor_manager_, and yaze::editor::EditorManager::OpenEditorAndPanelsFromFlags().

|
inline |
Definition at line 55 of file controller.h.
References window_backend_.
|
inline |
Definition at line 59 of file controller.h.
References window_backend_.
|
inline |
Definition at line 64 of file controller.h.
References window_backend_.
|
inline |
Definition at line 67 of file controller.h.
References active(), and active_.

|
inline |
|
inline |
Definition at line 69 of file controller.h.
References editor_manager_, and yaze::editor::EditorManager::overworld().

|
inline |
Definition at line 72 of file controller.h.
References editor_manager_, and yaze::editor::EditorManager::GetCurrentRom().

|
inline |
Definition at line 73 of file controller.h.
References renderer_.
|
inline |
Definition at line 76 of file controller.h.
References editor_manager_.
Referenced by yaze::app::GetGlobalEditorManager(), yaze::app::GetGlobalEmulator(), and main().
|
inline |
Definition at line 79 of file controller.h.
References window_backend_.
Referenced by SetWindowBackendForTesting().
|
inline |
Definition at line 82 of file controller.h.
References window_backend(), and window_backend_.

| absl::Status yaze::Controller::LoadRomForTesting | ( | const std::string & | rom_path | ) |
Definition at line 361 of file controller.cc.
References yaze::editor::EditorManager::asset_load_mode(), editor_manager_, yaze::kFull, yaze::editor::EditorManager::OpenRomOrProject(), and yaze::editor::EditorManager::SetAssetLoadMode().

|
private |
|
private |
Definition at line 379 of file controller.cc.
References screenshot_mutex_, and screenshot_requests_.
Referenced by DoRender().
|
private |
Definition at line 100 of file controller.h.
Referenced by active(), IsActive(), OnEntry(), OnLoad(), and set_active().
|
private |
Definition at line 101 of file controller.h.
Referenced by DoRender(), HideWindow(), OnEntry(), OnExit(), OnInput(), OnLoad(), SetWindowBackendForTesting(), ShowWindow(), window(), and window_backend().
|
private |
Definition at line 102 of file controller.h.
Referenced by DoRender(), editor_manager(), GetCurrentRom(), LoadRomForTesting(), OnEntry(), OnInput(), OnLoad(), overworld(), and SetStartupEditor().
|
private |
Definition at line 103 of file controller.h.
Referenced by DoRender(), OnEntry(), OnExit(), and renderer().
|
mutableprivate |
Definition at line 106 of file controller.h.
Referenced by ProcessScreenshotRequests(), and RequestScreenshot().
|
mutableprivate |
Definition at line 107 of file controller.h.
Referenced by ProcessScreenshotRequests(), and RequestScreenshot().