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

Namespaces

namespace  anonymous_namespace{dock_tree.cc}
 
namespace  anonymous_namespace{dock_tree_json.cc}
 
namespace  anonymous_namespace{dock_tree_renderer.cc}
 
namespace  anonymous_namespace{layout_designer_panel.cc}
 
namespace  anonymous_namespace{layout_designer_window.cc}
 
namespace  anonymous_namespace{layout_serialization.cc}
 
namespace  anonymous_namespace{split_boundary_drag.cc}
 
namespace  internal
 
namespace  panel_palette_internal
 

Classes

struct  DockNode
 Represents a dock node in the layout tree. More...
 
struct  DockTree
 
struct  DockTreeLayout
 
struct  DropSuggestion
 
struct  LayoutDefinition
 Complete layout definition with metadata. More...
 
class  LayoutDesignerPanel
 
class  LayoutDesignerWindow
 Main window for the WYSIWYG layout designer. More...
 
struct  LayoutPanel
 Represents a single panel in a layout. More...
 
class  LayoutSerializer
 Handles JSON serialization and deserialization of layouts. More...
 
struct  PanelDesign
 Complete design definition for a panel's internal layout. More...
 
struct  PanelEntry
 
struct  PanelPaletteEntry
 
struct  SplitBoundaryHit
 
struct  ThemeProperties
 Encapsulates ImGui style properties for visual design. More...
 
class  ThemePropertiesPanel
 UI panel for editing theme properties in the layout designer. More...
 
class  TreeUndoStack
 
class  WidgetCodeGenerator
 Generates C++ ImGui code from widget definitions. More...
 
struct  WidgetDefinition
 Defines a widget instance in a panel layout. More...
 
struct  WidgetProperty
 Represents a configurable property of a widget. More...
 

Typedefs

using DockNodeId = std::uint64_t
 

Enumerations

enum class  SplitDirection : std::uint8_t { kLeft , kRight , kUp , kDown }
 
enum class  DockNodeType { Root , Split , Leaf }
 Type of dock node in the layout tree. More...
 
enum class  DesignMode { PanelLayout , WidgetDesign }
 Design mode for the layout designer. More...
 
enum class  WidgetType {
  Text , TextWrapped , TextColored , Button ,
  SmallButton , Checkbox , RadioButton , InputText ,
  InputInt , InputFloat , SliderInt , SliderFloat ,
  ColorEdit , ColorPicker , Separator , SameLine ,
  Spacing , Dummy , NewLine , Indent ,
  Unindent , BeginGroup , EndGroup , BeginChild ,
  EndChild , CollapsingHeader , TreeNode , TabBar ,
  TabItem , BeginTable , EndTable , TableNextRow ,
  TableNextColumn , TableSetupColumn , Canvas , Image ,
  ImageButton , ProgressBar , BulletText , BeginMenu ,
  EndMenu , MenuItem , BeginCombo , EndCombo ,
  Selectable , ListBox
}
 Types of ImGui widgets available in the designer. More...
 
enum class  YazeWidgetType {
  ThemedButton , PrimaryButton , DangerButton , ThemedIconButton ,
  TransparentIconButton , BeginField , EndField , PropertyTable ,
  PropertyRow , SectionHeader , PaddedPanel , TableWithTheming ,
  CanvasPanel , AutoInputField , AutoButton , AutoCheckbox ,
  AutoInputText , PaletteColorButton , PanelHeader
}
 Extended widget types using yaze GUI abstractions. More...
 

Functions

DockTree MakeEmptyTree (std::string name)
 
const DockNodeHitTestNode (const DockTreeLayout &layout, ImVec2 mouse)
 
nlohmann::json DockTreeToJson (const DockTree &tree)
 
absl::StatusOr< DockTreeDockTreeFromJson (const nlohmann::json &j)
 
DockTreeLayout ComputeLayout (const DockTree &tree, const ImRect &viewport)
 
void RenderDockTree (const DockTree &tree, const DockTreeLayout &layout, const DockNode *selected, ImDrawList *dl)
 
DropSuggestion SuggestDrop (const ImRect &leaf_rect, ImVec2 mouse)
 
ImRect ComputeDropPreviewRect (const ImRect &leaf_rect, const DropSuggestion &suggestion)
 
DockNodeApplyDropSuggestion (DockTree *tree, DockNode *leaf, const DropSuggestion &suggestion, PanelEntry panel)
 
 REGISTER_PANEL (LayoutDesignerPanel)
 
std::vector< PanelPaletteEntryCollectPaletteEntries (const std::string &exclude_panel_id)
 
void DrawPanelPalette (const std::vector< PanelPaletteEntry > &entries, std::string *query)
 
SplitBoundaryHit HitTestSplitBoundary (const DockTree &tree, const DockTreeLayout &layout, ImVec2 mouse, float tolerance)
 
float ComputeDraggedSplitRatio (float start_ratio, float axis_delta_px, float axis_size_px)
 
const char * GetWidgetTypeName (WidgetType type)
 Get human-readable name for widget type.
 
const char * GetWidgetTypeIcon (WidgetType type)
 Get icon for widget type.
 
bool IsContainerWidget (WidgetType type)
 Check if widget type is a container.
 
bool RequiresEndCall (WidgetType type)
 Check if widget type requires an End*() call.
 
std::vector< WidgetPropertyGetDefaultProperties (WidgetType type)
 Get default properties for a widget type.
 
const char * GetYazeWidgetTypeName (YazeWidgetType type)
 Get human-readable name for yaze widget type.
 
const char * GetYazeWidgetTypeIcon (YazeWidgetType type)
 Get icon for yaze widget type.
 
std::string GenerateYazeWidgetCode (YazeWidgetType yaze_type, const WidgetDefinition &widget, int indent_level=0)
 Generate code for yaze widget (uses yaze abstractions)
 
std::vector< std::string > GetRequiredIncludes (YazeWidgetType type)
 Check if yaze widget requires specific includes.
 
std::vector< WidgetPropertyGetYazeDefaultProperties (YazeWidgetType type)
 Get default properties for yaze widget type.
 
WidgetType ToWidgetType (YazeWidgetType type)
 Convert YazeWidgetType to WidgetType (for base widget system)
 

Variables

constexpr DockNodeId kInvalidDockNodeId = 0
 
constexpr float kMinCellSize = 20.0f
 
constexpr float kDropEdgeFraction = 0.3f
 
constexpr float kDropSplitRatio = 0.3f
 
constexpr float kMinSplitRatio = 0.05f
 
constexpr float kMaxSplitRatio = 0.95f
 
constexpr float kSplitBoundaryTolerance = 4.0f
 

Typedef Documentation

◆ DockNodeId

Definition at line 21 of file dock_tree.h.

Enumeration Type Documentation

◆ SplitDirection

enum class yaze::editor::layout_designer::SplitDirection : std::uint8_t
strong
Enumerator
kLeft 
kRight 
kUp 
kDown 

Definition at line 41 of file dock_tree.h.

◆ DockNodeType

Type of dock node in the layout tree.

Enumerator
Root 
Split 
Leaf 

Definition at line 20 of file layout_definition.h.

◆ DesignMode

Design mode for the layout designer.

Enumerator
PanelLayout 
WidgetDesign 

Definition at line 27 of file layout_designer_window.h.

◆ WidgetType

Types of ImGui widgets available in the designer.

Enumerator
Text 
TextWrapped 
TextColored 
Button 
SmallButton 
Checkbox 
RadioButton 
InputText 
InputInt 
InputFloat 
SliderInt 
SliderFloat 
ColorEdit 
ColorPicker 
Separator 
SameLine 
Spacing 
Dummy 
NewLine 
Indent 
Unindent 
BeginGroup 
EndGroup 
BeginChild 
EndChild 
CollapsingHeader 
TreeNode 
TabBar 
TabItem 
BeginTable 
EndTable 
TableNextRow 
TableNextColumn 
TableSetupColumn 
Canvas 
Image 
ImageButton 
ProgressBar 
BulletText 
BeginMenu 
EndMenu 
MenuItem 
BeginCombo 
EndCombo 
Selectable 
ListBox 

Definition at line 19 of file widget_definition.h.

◆ YazeWidgetType

Extended widget types using yaze GUI abstractions.

Enumerator
ThemedButton 
PrimaryButton 
DangerButton 
ThemedIconButton 
TransparentIconButton 
BeginField 
EndField 
PropertyTable 
PropertyRow 
SectionHeader 
PaddedPanel 
TableWithTheming 
CanvasPanel 
AutoInputField 
AutoButton 
AutoCheckbox 
AutoInputText 
PaletteColorButton 
PanelHeader 

Definition at line 14 of file yaze_widgets.h.

Function Documentation

◆ MakeEmptyTree()

DockTree yaze::editor::layout_designer::MakeEmptyTree ( std::string name)

◆ HitTestNode()

const DockNode * yaze::editor::layout_designer::HitTestNode ( const DockTreeLayout & layout,
ImVec2 mouse )

◆ DockTreeToJson()

◆ DockTreeFromJson()

◆ ComputeLayout()

DockTreeLayout yaze::editor::layout_designer::ComputeLayout ( const DockTree & tree,
const ImRect & viewport )

◆ RenderDockTree()

void yaze::editor::layout_designer::RenderDockTree ( const DockTree & tree,
const DockTreeLayout & layout,
const DockNode * selected,
ImDrawList * dl )

◆ SuggestDrop()

◆ ComputeDropPreviewRect()

◆ ApplyDropSuggestion()

◆ REGISTER_PANEL()

yaze::editor::layout_designer::REGISTER_PANEL ( LayoutDesignerPanel )

◆ CollectPaletteEntries()

◆ DrawPanelPalette()

void yaze::editor::layout_designer::DrawPanelPalette ( const std::vector< PanelPaletteEntry > & entries,
std::string * query )

◆ HitTestSplitBoundary()

◆ ComputeDraggedSplitRatio()

float yaze::editor::layout_designer::ComputeDraggedSplitRatio ( float start_ratio,
float axis_delta_px,
float axis_size_px )

◆ GetWidgetTypeName()

◆ GetWidgetTypeIcon()

◆ IsContainerWidget()

bool yaze::editor::layout_designer::IsContainerWidget ( WidgetType type)

◆ RequiresEndCall()

bool yaze::editor::layout_designer::RequiresEndCall ( WidgetType type)

Check if widget type requires an End*() call.

Definition at line 272 of file widget_definition.cc.

References BeginChild, BeginCombo, BeginGroup, BeginMenu, BeginTable, TabBar, and TreeNode.

Referenced by yaze::editor::layout_designer::WidgetDefinition::RequiresEnd().

◆ GetDefaultProperties()

◆ GetYazeWidgetTypeName()

const char * yaze::editor::layout_designer::GetYazeWidgetTypeName ( YazeWidgetType type)

◆ GetYazeWidgetTypeIcon()

◆ GenerateYazeWidgetCode()

std::string yaze::editor::layout_designer::GenerateYazeWidgetCode ( YazeWidgetType yaze_type,
const WidgetDefinition & widget,
int indent_level = 0 )

Generate code for yaze widget (uses yaze abstractions)

Parameters
yaze_typeThe yaze widget type
widgetThe widget definition (for properties)
indent_levelIndentation level
Returns
Generated C++ code using yaze helpers

Definition at line 93 of file yaze_widgets.cc.

References AutoButton, yaze::editor::layout_designer::WidgetDefinition::callback_name, CanvasPanel, DangerButton, GetYazeWidgetTypeName(), ICON_MD_LABEL, ICON_MD_WINDOW, PanelHeader, PrimaryButton, PropertyRow, PropertyTable, SectionHeader, TableWithTheming, and ThemedButton.

Here is the call graph for this function:

◆ GetRequiredIncludes()

std::vector< std::string > yaze::editor::layout_designer::GetRequiredIncludes ( YazeWidgetType type)

◆ GetYazeDefaultProperties()

◆ ToWidgetType()

WidgetType yaze::editor::layout_designer::ToWidgetType ( YazeWidgetType type)

Convert YazeWidgetType to WidgetType (for base widget system)

Variable Documentation

◆ kInvalidDockNodeId

◆ kMinCellSize

constexpr float yaze::editor::layout_designer::kMinCellSize = 20.0f
constexpr

◆ kDropEdgeFraction

constexpr float yaze::editor::layout_designer::kDropEdgeFraction = 0.3f
constexpr

Definition at line 31 of file drop_zone_suggester.h.

Referenced by SuggestDrop().

◆ kDropSplitRatio

constexpr float yaze::editor::layout_designer::kDropSplitRatio = 0.3f
constexpr

Definition at line 36 of file drop_zone_suggester.h.

Referenced by ApplyDropSuggestion(), and ComputeDropPreviewRect().

◆ kMinSplitRatio

constexpr float yaze::editor::layout_designer::kMinSplitRatio = 0.05f
constexpr

◆ kMaxSplitRatio

constexpr float yaze::editor::layout_designer::kMaxSplitRatio = 0.95f
constexpr

◆ kSplitBoundaryTolerance

constexpr float yaze::editor::layout_designer::kSplitBoundaryTolerance = 4.0f
constexpr

Definition at line 19 of file split_boundary_drag.h.