3#include "absl/strings/str_format.h"
9#include "imgui/imgui.h"
10#include "imgui/imgui_internal.h"
77 ImGuiContext* imgui_ctx = ImGui::GetCurrentContext();
78 if (imgui_ctx && imgui_ctx->WithinFrameScope) {
79 ImGuiID dockspace_id = ImGui::GetID(
"MainDockSpace");
84 LOG_INFO(
"LayoutCoordinator",
"Emulator layout reset complete");
89 LOG_INFO(
"LayoutCoordinator",
"Layout reset queued for next frame");
102 if (preset_name ==
"Minimal") {
104 }
else if (preset_name ==
"Developer") {
106 }
else if (preset_name ==
"Designer") {
108 }
else if (preset_name ==
"Modder") {
110 }
else if (preset_name ==
"Overworld Expert") {
112 }
else if (preset_name ==
"Dungeon Expert") {
114 }
else if (preset_name ==
"Testing") {
116 }
else if (preset_name ==
"Audio") {
119 LOG_WARN(
"LayoutCoordinator",
"Unknown layout preset: %s",
120 preset_name.c_str());
141 LOG_INFO(
"LayoutCoordinator",
"Applied layout preset: %s",
142 preset_name.c_str());
170 LOG_INFO(
"LayoutCoordinator",
"Reset editor layout to defaults for type %d",
171 static_cast<int>(editor_type));
182 bool is_emulator_visible) {
188 ImGuiContext* imgui_ctx = ImGui::GetCurrentContext();
189 if (!imgui_ctx || !imgui_ctx->WithinFrameScope) {
193 ImGuiID dockspace_id = ImGui::GetID(
"MainDockSpace");
197 if (is_emulator_visible) {
200 rebuild_type = current_editor_type;
206 LOG_INFO(
"LayoutCoordinator",
"Layout rebuilt for editor type %d",
207 static_cast<int>(rebuild_type));
225 ImGuiID dockspace_id = ImGui::GetID(
"MainDockSpace");
226 layout_manager_->InitializeEditorLayout(type, dockspace_id);
240 std::vector<std::function<void()>> actions_to_execute;
243 for (
auto& action : actions_to_execute) {
std::vector< std::function< void()> > deferred_actions_
void QueueDeferredAction(std::function< void()> action)
Queue an action to be executed on the next frame.
LayoutManager * layout_manager_
RightPanelManager * right_panel_manager_
void ProcessDeferredActions()
Process all queued deferred actions.
float GetBottomLayoutOffset() const
Get the bottom margin needed for status bar.
PanelManager * panel_manager_
UICoordinator * ui_coordinator_
void ResetWorkspaceLayout()
Reset the workspace layout to defaults.
void ProcessLayoutRebuild(EditorType current_editor_type, bool is_emulator_visible)
Process pending layout rebuild requests.
ToastManager * toast_manager_
void InitializeEditorLayout(EditorType type)
Initialize layout for an editor type on first activation.
float GetRightLayoutOffset() const
Get the right margin needed for panels.
void ResetCurrentEditorLayout(EditorType editor_type, size_t session_id)
Reset current editor layout to its default configuration.
void ApplyLayoutPreset(const std::string &preset_name, size_t session_id)
Apply a named layout preset.
void Initialize(const Dependencies &deps)
Initialize with all dependencies.
float GetLeftLayoutOffset() const
Get the left margin needed for sidebar (Activity Bar + Side Panel)
void RebuildLayout(EditorType type, ImGuiID dockspace_id)
Force rebuild of layout for a specific editor type.
void ClearInitializationFlags()
Clear all initialization flags (for testing)
bool IsLayoutInitialized(EditorType type) const
Check if a layout has been initialized for an editor.
void ResetToDefaultLayout(EditorType type)
Reset the layout for an editor to its default.
void ClearRebuildRequest()
Clear rebuild request flag.
void RequestRebuild()
Request a layout rebuild on next frame.
bool IsRebuildRequested() const
Check if rebuild was requested.
static PanelLayoutPreset GetDungeonExpertPreset()
Get the "dungeon expert" workspace preset.
static PanelLayoutPreset GetTestingPreset()
Get the "testing" workspace preset (QA focused)
static PanelLayoutPreset GetDesignerPreset()
Get the "designer" workspace preset (visual-focused)
static PanelLayoutPreset GetAudioPreset()
Get the "audio" workspace preset (music focused)
static PanelLayoutPreset GetDefaultPreset(EditorType type)
Get the default layout preset for an editor type.
static PanelLayoutPreset GetModderPreset()
Get the "modder" workspace preset (full-featured)
static PanelLayoutPreset GetOverworldExpertPreset()
Get the "overworld expert" workspace preset.
static PanelLayoutPreset GetMinimalPreset()
Get the "minimal" workspace preset (minimal cards)
static PanelLayoutPreset GetDeveloperPreset()
Get the "developer" workspace preset (debug-focused)
bool ShowPanel(size_t session_id, const std::string &base_card_id)
bool IsPanelExpanded() const
void HideAll(size_t session_id)
static constexpr float GetSidebarWidth()
void ResetToDefaults(size_t session_id)
bool IsSidebarVisible() const
static constexpr float GetSidePanelWidth()
float GetPanelWidth() const
Get the width of the panel when expanded.
float GetHeight() const
Get the height of the status bar.
void Show(const std::string &message, ToastType type=ToastType::kInfo, float ttl_seconds=3.0f)
bool IsEmulatorVisible() const
bool ShouldShowActivityBar() const
bool IsPanelSidebarVisible() const
#define LOG_WARN(category, format,...)
#define LOG_INFO(category, format,...)
All dependencies required by LayoutCoordinator.
PanelManager * panel_manager
ToastManager * toast_manager
UICoordinator * ui_coordinator
RightPanelManager * right_panel_manager
LayoutManager * layout_manager
Defines default panel visibility for an editor type.
std::vector< std::string > default_visible_panels