yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
layout_manager.cc File Reference
#include "app/editor/layout/layout_manager.h"
#include <algorithm>
#include <array>
#include <cstdio>
#include <cstring>
#include <filesystem>
#include <fstream>
#include <functional>
#include <string>
#include <unordered_set>
#include <utility>
#include "absl/strings/str_cat.h"
#include "app/editor/layout/layout_designer/dock_tree_json.h"
#include "app/editor/layout/layout_presets.h"
#include "app/editor/system/session/user_settings.h"
#include "app/editor/system/workspace/workspace_window_manager.h"
#include "app/gui/core/background_renderer.h"
#include "imgui/imgui.h"
#include "imgui/imgui_internal.h"
#include "util/json.h"
#include "util/log.h"
#include "util/platform_paths.h"

Go to the source code of this file.

Classes

struct  yaze::editor::anonymous_namespace{layout_manager.cc}::DockSplitConfig
 
struct  yaze::editor::anonymous_namespace{layout_manager.cc}::DockNodeIds
 
struct  yaze::editor::anonymous_namespace{layout_manager.cc}::DockSplitNeeds
 
struct  yaze::editor::anonymous_namespace{layout_manager.cc}::RegionWidthPreference
 
struct  yaze::editor::anonymous_namespace{layout_manager.cc}::PanelLookupEntry
 

Namespaces

namespace  yaze
 
namespace  yaze::editor
 Editors are the view controllers for the application.
 
namespace  yaze::editor::anonymous_namespace{layout_manager.cc}
 

Functions

void yaze::editor::anonymous_namespace{layout_manager.cc}::ShowDefaultWindowsForEditor (WorkspaceWindowManager *registry, EditorType type)
 
yaze::Json yaze::editor::anonymous_namespace{layout_manager.cc}::BoolMapToJson (const std::unordered_map< std::string, bool > &map)
 
void yaze::editor::anonymous_namespace{layout_manager.cc}::JsonToBoolMap (const yaze::Json &obj, std::unordered_map< std::string, bool > *map)
 
void yaze::editor::anonymous_namespace{layout_manager.cc}::JsonToWindowMap (const yaze::Json &entry, std::unordered_map< std::string, bool > *windows)
 
std::filesystem::path yaze::editor::anonymous_namespace{layout_manager.cc}::GetLayoutsFilePath (LayoutScope scope, const std::string &project_key)
 
std::string yaze::editor::anonymous_namespace{layout_manager.cc}::ResolveProfilePresetName (const std::string &profile_id, EditorType editor_type)
 
bool yaze::editor::anonymous_namespace{layout_manager.cc}::ShouldDockPanelInDefaultLayout (const PanelLayoutPreset &preset, const std::string &panel_id)
 
std::vector< std::pair< std::string, DockPosition > > yaze::editor::anonymous_namespace{layout_manager.cc}::CollectDockedPanels (const PanelLayoutPreset &preset)
 
DockSplitNeeds yaze::editor::anonymous_namespace{layout_manager.cc}::ComputeSplitNeeds (const std::vector< std::pair< std::string, DockPosition > > &docked_panels)
 
bool yaze::editor::anonymous_namespace{layout_manager.cc}::IsRightDockPosition (DockPosition pos)
 
bool yaze::editor::anonymous_namespace{layout_manager.cc}::IsLeftDockPosition (DockPosition pos)
 
RegionWidthPreference yaze::editor::anonymous_namespace{layout_manager.cc}::ResolvePreferredRegionWidth (WorkspaceWindowManager *window_manager, const std::vector< std::pair< std::string, DockPosition > > &docked_panels, bool(*matches_region)(DockPosition))
 
float yaze::editor::anonymous_namespace{layout_manager.cc}::ExactRegionRatio (float preferred_width, float available_width, float max_ratio)
 
void yaze::editor::anonymous_namespace{layout_manager.cc}::ApplyPreferredSplitWidths (DockSplitConfig *cfg, const DockSplitNeeds &needs, float viewport_width, float dockspace_width, WorkspaceWindowManager *window_manager, const std::vector< std::pair< std::string, DockPosition > > &docked_panels)
 
DockNodeIds yaze::editor::anonymous_namespace{layout_manager.cc}::BuildDockTree (ImGuiID dockspace_id, const DockSplitNeeds &needs, const DockSplitConfig &cfg)
 
ImGuiAxis yaze::editor::anonymous_namespace{layout_manager.cc}::PinAxis (ImGuiDir dir)
 
ImGuiDockNode * yaze::editor::anonymous_namespace{layout_manager.cc}::FindCentralLeaf (ImGuiDockNode *node)
 
ImGuiID yaze::editor::anonymous_namespace{layout_manager.cc}::DockRootId (ImGuiID node_id)
 
ImGuiDir yaze::editor::anonymous_namespace{layout_manager.cc}::ChildSide (const ImGuiDockNode *parent, const ImGuiDockNode *child)
 
ImGuiDir yaze::editor::anonymous_namespace{layout_manager.cc}::DockspaceEdgeSide (const ImGuiDockNode *node, float *size)
 
void yaze::editor::anonymous_namespace{layout_manager.cc}::LayoutIniClearAll (ImGuiContext *, ImGuiSettingsHandler *handler)
 
void * yaze::editor::anonymous_namespace{layout_manager.cc}::LayoutIniReadOpen (ImGuiContext *, ImGuiSettingsHandler *handler, const char *name)
 
void yaze::editor::anonymous_namespace{layout_manager.cc}::LayoutIniReadLine (ImGuiContext *, ImGuiSettingsHandler *, void *entry, const char *line)
 
void yaze::editor::anonymous_namespace{layout_manager.cc}::LayoutIniApplyAll (ImGuiContext *, ImGuiSettingsHandler *handler)
 
void yaze::editor::anonymous_namespace{layout_manager.cc}::LayoutIniWriteAll (ImGuiContext *, ImGuiSettingsHandler *handler, ImGuiTextBuffer *buf)
 
void yaze::editor::anonymous_namespace{layout_manager.cc}::BackupLegacyLayoutIni ()
 
ImGuiDir yaze::editor::anonymous_namespace{layout_manager.cc}::SplitDirectionToImGuiDir (layout_designer::SplitDirection d)
 
std::string yaze::editor::anonymous_namespace{layout_manager.cc}::ResolveDockWindowTitle (const WorkspaceWindowManager *wm, size_t session_id, const layout_designer::PanelEntry &panel)
 
void yaze::editor::anonymous_namespace{layout_manager.cc}::ApplyDockNodeRecursive (WorkspaceWindowManager *wm, size_t session_id, const layout_designer::DockNode &node, ImGuiID target_id, const std::function< void(ImGuiID, ImGuiID, ImGuiID, std::vector< ImGuiID >)> &queue_selection)
 
std::unique_ptr< layout_designer::DockNode > yaze::editor::anonymous_namespace{layout_manager.cc}::CaptureDockNodeRecursive (const ImGuiDockNode *node, const std::unordered_map< std::string, PanelLookupEntry > &by_window_name)
 
void yaze::editor::anonymous_namespace{layout_manager.cc}::CollectPanelIdsInSubtree (const layout_designer::DockNode &node, std::vector< std::string > *out)
 

Variables

constexpr char yaze::editor::anonymous_namespace{layout_manager.cc}::kLegacyPanelsKey [] = "panels"
 
constexpr char yaze::editor::anonymous_namespace{layout_manager.cc}::kWindowsKey [] = "windows"
 
constexpr char yaze::editor::anonymous_namespace{layout_manager.cc}::kOuterDockspaceName [] = "yaze.MainDockSpace"
 
constexpr char yaze::editor::anonymous_namespace{layout_manager.cc}::kEditorDockspacePrefix [] = "yaze.EditorDock/"
 
constexpr char yaze::editor::anonymous_namespace{layout_manager.cc}::kEditorHostWindowName [] = "###YazeEditorHost"
 
constexpr char yaze::editor::anonymous_namespace{layout_manager.cc}::kLayoutIniTypeName [] = "YazeLayout"
 
constexpr char yaze::editor::anonymous_namespace{layout_manager.cc}::kLayoutIniInitializedKey [] = "Initialized="
 
constexpr char yaze::editor::anonymous_namespace{layout_manager.cc}::kLayoutIniPinSideKey [] = "PinSide="
 
constexpr float yaze::editor::anonymous_namespace{layout_manager.cc}::kPinRatio = 0.22f
 
constexpr float yaze::editor::anonymous_namespace{layout_manager.cc}::kPinMinRatio = 0.05f
 
constexpr float yaze::editor::anonymous_namespace{layout_manager.cc}::kPinMaxRatio = 0.6f
 
constexpr std::array< const char *, 4 > yaze::editor::anonymous_namespace{layout_manager.cc}::kPinSideNames