SDEngine
Game Engine
Loading...
Searching...
No Matches
sd::LayoutManager Class Reference

Manages window layouts using ImGui DockBuilder for presets and INI for user layouts. More...

#include <LayoutManager.hpp>

Public Types

enum class  Preset { DEFAULT , MINIMAL }
 

Public Member Functions

 LayoutManager ()
 
 ~LayoutManager ()=default
 
void init ()
 Initialize - loads last used layout name but doesn't apply yet.
 
void apply_preset (Preset preset, ApplicationRuntime runtime)
 Apply a preset layout (uses DockBuilder API) - call this after dockspace exists.
 
void apply_pending_layout (ApplicationRuntime runtime)
 Apply the pending layout (call from first frame when dockspace is ready)
 
void save_layout (const std::string &name)
 Save current layout to a user-named file.
 
bool load_layout (const std::string &name, ApplicationRuntime runtime)
 Load a user-saved layout.
 
void delete_layout (const std::string &name, ApplicationRuntime runtime)
 Delete a user layout.
 
std::vector< std::string > get_user_layout_names () const
 Get list of user-saved layout names.
 
bool has_layout (const std::string &name) const
 Check if a user layout exists.
 
const std::string & get_current_layout () const
 Get the currently active layout/preset name.
 

Private Member Functions

void ensure_layouts_directory_exists ()
 
std::string get_layout_path (const std::string &name) const
 
void save_current_layout_name ()
 
void refresh_layout_list ()
 

Private Attributes

std::map< std::string, std::string > m_user_layouts
 
std::string m_current_layout = "Default"
 
std::string m_pending_layout
 
bool m_is_initialized = false
 
bool m_has_applied_initial_layout = false
 

Detailed Description

Manages window layouts using ImGui DockBuilder for presets and INI for user layouts.

Member Enumeration Documentation

◆ Preset

Enumerator
DEFAULT 
MINIMAL 

Constructor & Destructor Documentation

◆ LayoutManager()

sd::LayoutManager::LayoutManager ( )
default

◆ ~LayoutManager()

sd::LayoutManager::~LayoutManager ( )
default

Member Function Documentation

◆ apply_pending_layout()

void sd::LayoutManager::apply_pending_layout ( ApplicationRuntime  runtime)

Apply the pending layout (call from first frame when dockspace is ready)

◆ apply_preset()

void sd::LayoutManager::apply_preset ( Preset  preset,
ApplicationRuntime  runtime 
)

Apply a preset layout (uses DockBuilder API) - call this after dockspace exists.

◆ delete_layout()

void sd::LayoutManager::delete_layout ( const std::string &  name,
ApplicationRuntime  runtime 
)

Delete a user layout.

◆ ensure_layouts_directory_exists()

void sd::LayoutManager::ensure_layouts_directory_exists ( )
private

◆ get_current_layout()

const std::string & sd::LayoutManager::get_current_layout ( ) const
inline

Get the currently active layout/preset name.

◆ get_layout_path()

std::string sd::LayoutManager::get_layout_path ( const std::string &  name) const
private

◆ get_user_layout_names()

std::vector< std::string > sd::LayoutManager::get_user_layout_names ( ) const

Get list of user-saved layout names.

◆ has_layout()

bool sd::LayoutManager::has_layout ( const std::string &  name) const

Check if a user layout exists.

◆ init()

void sd::LayoutManager::init ( )

Initialize - loads last used layout name but doesn't apply yet.

◆ load_layout()

bool sd::LayoutManager::load_layout ( const std::string &  name,
ApplicationRuntime  runtime 
)

Load a user-saved layout.

◆ refresh_layout_list()

void sd::LayoutManager::refresh_layout_list ( )
private

◆ save_current_layout_name()

void sd::LayoutManager::save_current_layout_name ( )
private

◆ save_layout()

void sd::LayoutManager::save_layout ( const std::string &  name)

Save current layout to a user-named file.

Member Data Documentation

◆ m_current_layout

std::string sd::LayoutManager::m_current_layout = "Default"
private

◆ m_has_applied_initial_layout

bool sd::LayoutManager::m_has_applied_initial_layout = false
private

◆ m_is_initialized

bool sd::LayoutManager::m_is_initialized = false
private

◆ m_pending_layout

std::string sd::LayoutManager::m_pending_layout
private

◆ m_user_layouts

std::map<std::string, std::string> sd::LayoutManager::m_user_layouts
private

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