yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::WindowDelegate Class Reference

Low-level window operations with minimal dependencies. More...

#include <window_delegate.h>

Classes

struct  WindowInfo
 

Public Member Functions

 WindowDelegate ()=default
 
 ~WindowDelegate ()=default
 
void ShowAllWindows ()
 
void HideAllWindows ()
 
void ShowWindow (const std::string &window_id)
 
void HideWindow (const std::string &window_id)
 
void ToggleWindow (const std::string &window_id)
 
bool IsWindowVisible (const std::string &window_id) const
 
void FocusWindow (const std::string &window_id)
 
void MaximizeWindow (const std::string &window_id)
 
void RestoreWindow (const std::string &window_id)
 
void CenterWindow (const std::string &window_id)
 
void DockWindow (const std::string &window_id, ImGuiDir dock_direction)
 
void UndockWindow (const std::string &window_id)
 
void SetDockSpace (const std::string &dock_space_id, const ImVec2 &size=ImVec2(0, 0))
 
absl::Status SaveLayout (const std::string &preset_name)
 
absl::Status LoadLayout (const std::string &preset_name)
 
absl::Status ResetLayout ()
 
std::vector< std::string > GetAvailableLayouts () const
 
void SaveWorkspaceLayout ()
 
void LoadWorkspaceLayout ()
 
void ResetWorkspaceLayout ()
 
void LoadDeveloperLayout ()
 
void LoadDesignerLayout ()
 
void LoadModderLayout ()
 
std::vector< std::string > GetVisibleWindows () const
 
std::vector< std::string > GetHiddenWindows () const
 
ImVec2 GetWindowSize (const std::string &window_id) const
 
ImVec2 GetWindowPosition (const std::string &window_id) const
 
void ShowWindowsInCategory (const std::string &category)
 
void HideWindowsInCategory (const std::string &category)
 
void ShowOnlyWindow (const std::string &window_id)
 
void RegisterWindow (const std::string &window_id, const std::string &category="")
 
void UnregisterWindow (const std::string &window_id)
 
void LoadMinimalLayout ()
 
void set_apply_preset_callback (std::function< void(const std::string &)> callback)
 

Private Member Functions

bool IsWindowRegistered (const std::string &window_id) const
 
std::string GetLayoutFilePath (const std::string &preset_name) const
 
void ApplyLayoutToWindow (const std::string &window_id, const std::string &layout_data)
 

Private Attributes

std::unordered_map< std::string, WindowInforegistered_windows_
 
std::function< void(const std::string &) apply_preset_callback_ )
 

Detailed Description

Low-level window operations with minimal dependencies.

Provides window management functionality extracted from EditorManager:

  • Window visibility management
  • Docking operations
  • Layout persistence
  • Focus management

This class has minimal dependencies (only ImGui and absl) to avoid linker issues and circular dependencies.

Definition at line 28 of file window_delegate.h.

Constructor & Destructor Documentation

◆ WindowDelegate()

yaze::editor::WindowDelegate::WindowDelegate ( )
default

◆ ~WindowDelegate()

yaze::editor::WindowDelegate::~WindowDelegate ( )
default

Member Function Documentation

◆ ShowAllWindows()

void yaze::editor::WindowDelegate::ShowAllWindows ( )

Definition at line 14 of file window_delegate.cc.

References registered_windows_.

Referenced by yaze::editor::UICoordinator::ShowAllWindows().

◆ HideAllWindows()

void yaze::editor::WindowDelegate::HideAllWindows ( )

Definition at line 21 of file window_delegate.cc.

References registered_windows_.

Referenced by yaze::editor::UICoordinator::HideAllWindows().

◆ ShowWindow()

void yaze::editor::WindowDelegate::ShowWindow ( const std::string & window_id)

Definition at line 28 of file window_delegate.cc.

References IsWindowRegistered().

Here is the call graph for this function:

◆ HideWindow()

void yaze::editor::WindowDelegate::HideWindow ( const std::string & window_id)

Definition at line 35 of file window_delegate.cc.

References IsWindowRegistered().

Here is the call graph for this function:

◆ ToggleWindow()

void yaze::editor::WindowDelegate::ToggleWindow ( const std::string & window_id)

Definition at line 42 of file window_delegate.cc.

References IsWindowRegistered().

Here is the call graph for this function:

◆ IsWindowVisible()

bool yaze::editor::WindowDelegate::IsWindowVisible ( const std::string & window_id) const

Definition at line 49 of file window_delegate.cc.

References IsWindowRegistered().

Here is the call graph for this function:

◆ FocusWindow()

void yaze::editor::WindowDelegate::FocusWindow ( const std::string & window_id)

Definition at line 57 of file window_delegate.cc.

References IsWindowRegistered().

Here is the call graph for this function:

◆ MaximizeWindow()

void yaze::editor::WindowDelegate::MaximizeWindow ( const std::string & window_id)

Definition at line 64 of file window_delegate.cc.

References IsWindowRegistered().

Here is the call graph for this function:

◆ RestoreWindow()

void yaze::editor::WindowDelegate::RestoreWindow ( const std::string & window_id)

Definition at line 71 of file window_delegate.cc.

References IsWindowRegistered().

Here is the call graph for this function:

◆ CenterWindow()

void yaze::editor::WindowDelegate::CenterWindow ( const std::string & window_id)

Definition at line 78 of file window_delegate.cc.

References IsWindowRegistered().

Here is the call graph for this function:

◆ DockWindow()

void yaze::editor::WindowDelegate::DockWindow ( const std::string & window_id,
ImGuiDir dock_direction )

Definition at line 85 of file window_delegate.cc.

References IsWindowRegistered().

Here is the call graph for this function:

◆ UndockWindow()

void yaze::editor::WindowDelegate::UndockWindow ( const std::string & window_id)

Definition at line 94 of file window_delegate.cc.

References IsWindowRegistered().

Here is the call graph for this function:

◆ SetDockSpace()

void yaze::editor::WindowDelegate::SetDockSpace ( const std::string & dock_space_id,
const ImVec2 & size = ImVec2(0, 0) )

Definition at line 101 of file window_delegate.cc.

◆ SaveLayout()

absl::Status yaze::editor::WindowDelegate::SaveLayout ( const std::string & preset_name)

Definition at line 108 of file window_delegate.cc.

References GetLayoutFilePath().

Here is the call graph for this function:

◆ LoadLayout()

absl::Status yaze::editor::WindowDelegate::LoadLayout ( const std::string & preset_name)
Todo
Parse and apply layout data

Definition at line 144 of file window_delegate.cc.

References GetLayoutFilePath().

Here is the call graph for this function:

◆ ResetLayout()

absl::Status yaze::editor::WindowDelegate::ResetLayout ( )

Definition at line 180 of file window_delegate.cc.

References yaze::util::PlatformPaths::GetImGuiIniPath().

Here is the call graph for this function:

◆ GetAvailableLayouts()

std::vector< std::string > yaze::editor::WindowDelegate::GetAvailableLayouts ( ) const

Definition at line 199 of file window_delegate.cc.

References yaze::util::PlatformPaths::GetAppDataSubdirectory().

Here is the call graph for this function:

◆ SaveWorkspaceLayout()

void yaze::editor::WindowDelegate::SaveWorkspaceLayout ( )

Definition at line 330 of file window_delegate.cc.

References yaze::util::PlatformPaths::GetAppDataSubdirectory().

Here is the call graph for this function:

◆ LoadWorkspaceLayout()

void yaze::editor::WindowDelegate::LoadWorkspaceLayout ( )

Definition at line 341 of file window_delegate.cc.

References yaze::util::PlatformPaths::GetAppDataSubdirectory().

Here is the call graph for this function:

◆ ResetWorkspaceLayout()

void yaze::editor::WindowDelegate::ResetWorkspaceLayout ( )

Definition at line 352 of file window_delegate.cc.

◆ LoadDeveloperLayout()

void yaze::editor::WindowDelegate::LoadDeveloperLayout ( )

◆ LoadDesignerLayout()

void yaze::editor::WindowDelegate::LoadDesignerLayout ( )

◆ LoadModderLayout()

void yaze::editor::WindowDelegate::LoadModderLayout ( )

Definition at line 295 of file window_delegate.cc.

References apply_preset_callback_.

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

◆ GetVisibleWindows()

std::vector< std::string > yaze::editor::WindowDelegate::GetVisibleWindows ( ) const
Todo
Implement actual visibility checking

Definition at line 220 of file window_delegate.cc.

◆ GetHiddenWindows()

std::vector< std::string > yaze::editor::WindowDelegate::GetHiddenWindows ( ) const
Todo
Implement actual visibility checking

Definition at line 226 of file window_delegate.cc.

◆ GetWindowSize()

ImVec2 yaze::editor::WindowDelegate::GetWindowSize ( const std::string & window_id) const
Todo
Implement actual size retrieval

Definition at line 232 of file window_delegate.cc.

References IsWindowRegistered().

Here is the call graph for this function:

◆ GetWindowPosition()

ImVec2 yaze::editor::WindowDelegate::GetWindowPosition ( const std::string & window_id) const
Todo
Implement actual position retrieval

Definition at line 240 of file window_delegate.cc.

References IsWindowRegistered().

Here is the call graph for this function:

◆ ShowWindowsInCategory()

void yaze::editor::WindowDelegate::ShowWindowsInCategory ( const std::string & category)
Todo
Implement category-based window showing

Definition at line 248 of file window_delegate.cc.

◆ HideWindowsInCategory()

void yaze::editor::WindowDelegate::HideWindowsInCategory ( const std::string & category)
Todo
Implement category-based window hiding

Definition at line 253 of file window_delegate.cc.

◆ ShowOnlyWindow()

void yaze::editor::WindowDelegate::ShowOnlyWindow ( const std::string & window_id)
Todo
Implement show-only functionality

Definition at line 258 of file window_delegate.cc.

◆ RegisterWindow()

void yaze::editor::WindowDelegate::RegisterWindow ( const std::string & window_id,
const std::string & category = "" )

◆ UnregisterWindow()

void yaze::editor::WindowDelegate::UnregisterWindow ( const std::string & window_id)

Definition at line 275 of file window_delegate.cc.

References registered_windows_.

◆ LoadMinimalLayout()

void yaze::editor::WindowDelegate::LoadMinimalLayout ( )

Definition at line 301 of file window_delegate.cc.

References apply_preset_callback_.

◆ set_apply_preset_callback()

void yaze::editor::WindowDelegate::set_apply_preset_callback ( std::function< void(const std::string &)> callback)
inline

◆ IsWindowRegistered()

bool yaze::editor::WindowDelegate::IsWindowRegistered ( const std::string & window_id) const
private

◆ GetLayoutFilePath()

std::string yaze::editor::WindowDelegate::GetLayoutFilePath ( const std::string & preset_name) const
private

Definition at line 312 of file window_delegate.cc.

References yaze::util::PlatformPaths::GetAppDataSubdirectory().

Referenced by LoadLayout(), and SaveLayout().

Here is the call graph for this function:

◆ ApplyLayoutToWindow()

void yaze::editor::WindowDelegate::ApplyLayoutToWindow ( const std::string & window_id,
const std::string & layout_data )
private
Todo
Implement layout application

Definition at line 322 of file window_delegate.cc.

References IsWindowRegistered().

Here is the call graph for this function:

Member Data Documentation

◆ registered_windows_

std::unordered_map<std::string, WindowInfo> yaze::editor::WindowDelegate::registered_windows_
private

◆ apply_preset_callback_

std::function<void(const std::string&) yaze::editor::WindowDelegate::apply_preset_callback_)
private

The documentation for this class was generated from the following files: