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"
13#include "imgui/imgui.h"
14
15namespace yaze {
16namespace editor {
17
18// Forward declarations
19class WorkspaceWindowManager;
20class UICoordinator;
21class ToastManager;
22class StatusBar;
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.
RightDrawerManager * right_drawer_manager_
WorkspaceWindowManager * window_manager_
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 drawers.
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.
Manages right-side sliding drawers for agent chat, proposals, settings.
A session-aware status bar displayed at the bottom of the application.
Definition status_bar.h:54
Handles all UI drawing operations and state management.
Central registry for all editor cards with session awareness and dependency injection.
All dependencies required by LayoutCoordinator.