yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
layout_coordinator.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_LAYOUT_LAYOUT_COORDINATOR_H_
2#define YAZE_APP_EDITOR_LAYOUT_LAYOUT_COORDINATOR_H_
3
4#include <atomic>
5#include <functional>
6#include <memory>
7#include <string>
8
9#include "app/editor/editor.h"
12#include "imgui/imgui.h"
13
14namespace yaze {
15namespace editor {
16
17// Forward declarations
18class PanelManager;
19class UICoordinator;
20class ToastManager;
21class StatusBar;
22class RightPanelManager;
23
38 public:
51
52 LayoutCoordinator() = default;
53 ~LayoutCoordinator() = default;
54
59 void Initialize(const Dependencies& deps);
60
61 // ==========================================================================
62 // Layout Offset Calculations
63 // ==========================================================================
64
69 float GetLeftLayoutOffset() const;
70
75 float GetRightLayoutOffset() const;
76
81 float GetBottomLayoutOffset() const;
82
83 // ==========================================================================
84 // Layout Operations
85 // ==========================================================================
86
94
100 void ApplyLayoutPreset(const std::string& preset_name, size_t session_id);
101
107 void ResetCurrentEditorLayout(EditorType editor_type, size_t session_id);
108
109 // ==========================================================================
110 // Layout Rebuild Handling
111 // ==========================================================================
112
122 void ProcessLayoutRebuild(EditorType current_editor_type,
123 bool is_emulator_visible);
124
133
141 void QueueDeferredAction(std::function<void()> action);
142
149
154 return pending_deferred_actions_.load(std::memory_order_relaxed);
155 }
156
157 // ==========================================================================
158 // Accessors
159 // ==========================================================================
160
163
164 bool IsInitialized() const { return layout_manager_ != nullptr; }
165
166 private:
167 // Dependencies (injected)
174
175 // Deferred action queue
176 std::vector<std::function<void()>> deferred_actions_;
177 std::atomic<int> pending_deferred_actions_{0};
178};
179
180} // namespace editor
181} // namespace yaze
182
183#endif // YAZE_APP_EDITOR_LAYOUT_LAYOUT_COORDINATOR_H_
Facade class that coordinates all layout-related operations.
std::vector< std::function< void()> > deferred_actions_
void QueueDeferredAction(std::function< void()> action)
Queue an action to be executed on the next frame.
void ProcessDeferredActions()
Process all queued deferred actions.
float GetBottomLayoutOffset() const
Get the bottom margin needed for status bar.
void ResetWorkspaceLayout()
Reset the workspace layout to defaults.
void ProcessLayoutRebuild(EditorType current_editor_type, bool is_emulator_visible)
Process pending layout rebuild requests.
std::atomic< int > pending_deferred_actions_
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.
int PendingDeferredActionCount() const
Approximate pending deferred layout actions for sync diagnostics.
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.
const LayoutManager * layout_manager() const
float GetLeftLayoutOffset() const
Get the left margin needed for sidebar (Activity Bar + Side Panel)
Manages ImGui DockBuilder layouts for each editor type.
Central registry for all editor cards with session awareness and dependency injection.
Manages right-side sliding panels for agent chat, proposals, settings.
A session-aware status bar displayed at the bottom of the application.
Definition status_bar.h:39
Handles all UI drawing operations and state management.
All dependencies required by LayoutCoordinator.