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

#include <screen_editor_views.h>

Inherits yaze::editor::WindowContent.

Inherited by yaze::editor::DungeonMapsView, yaze::editor::InventoryMenuView, yaze::editor::NamingScreenView, yaze::editor::OverworldMapScreenView, and yaze::editor::TitleScreenView.

Collaboration diagram for yaze::editor::ScreenWorkspaceView:

Public Types

using DrawCallback = std::function<void()>
 
using EnabledCallback = std::function<bool()>
 

Public Member Functions

 ScreenWorkspaceView (DrawCallback draw_callback, EnabledCallback enabled_callback, std::string shortcut_hint)
 
bool IsEnabled () const override
 Check if this panel is currently enabled.
 
std::string GetDisabledTooltip () const override
 Get tooltip text when panel is disabled.
 
std::string GetShortcutHint () const override
 Get keyboard shortcut hint for display.
 
void Draw (bool *p_open) override
 Draw the panel content.
 
- Public Member Functions inherited from yaze::editor::WindowContent
virtual ~WindowContent ()=default
 
virtual std::string GetId () const =0
 Unique identifier for this panel.
 
virtual std::string GetDisplayName () const =0
 Human-readable name shown in menus and title bars.
 
virtual std::string GetIcon () const =0
 Material Design icon for this panel.
 
virtual std::string GetEditorCategory () const =0
 Editor category this panel belongs to.
 
virtual void OnFirstDraw ()
 Called once before the first Draw() in a session.
 
virtual bool RequiresLazyInit () const
 Whether this panel uses lazy initialization.
 
void InvalidateLazyInit ()
 Reset lazy init state so OnFirstDraw() runs again.
 
virtual void OnOpen ()
 Called when panel becomes visible.
 
virtual void OnClose ()
 Called when panel is hidden.
 
virtual void OnFocus ()
 Called when panel receives focus.
 
virtual WindowLifecycle GetWindowLifecycle () const
 Get the lifecycle category for this window.
 
virtual WindowContextScope GetContextScope () const
 Optional context binding for this window (room/selection/etc)
 
virtual WindowScope GetScope () const
 Get the registration scope for this window.
 
virtual int GetPriority () const
 Get display priority for menu ordering.
 
virtual std::string GetWorkflowGroup () const
 Optional workflow group for hack-centric actions.
 
virtual std::string GetWorkflowLabel () const
 Optional workflow label for menus/command palette.
 
virtual std::string GetWorkflowDescription () const
 Optional workflow description for menus/command palette.
 
virtual int GetWorkflowPriority () const
 Optional workflow ordering priority (lower sorts first).
 
virtual float GetPreferredWidth () const
 Get preferred width for this panel (optional)
 
virtual bool PreferAutoHideTabBar () const
 Whether the dock node hosting this panel should auto-hide its tab bar.
 
virtual bool IsVisibleByDefault () const
 Whether this panel should be visible by default.
 
virtual std::string GetParentPanelId () const
 Get parent panel ID for cascade behavior.
 
virtual bool CascadeCloseChildren () const
 Whether closing this panel should close child panels.
 
void DrawWithLazyInit (bool *p_open)
 Execute lazy initialization if needed, then call Draw()
 

Private Attributes

DrawCallback draw_callback_
 
EnabledCallback enabled_callback_
 
std::string shortcut_hint_
 

Additional Inherited Members

- Protected Member Functions inherited from yaze::editor::WindowContent
void InvalidateCache ()
 Invalidate all cached computations.
 
template<typename T >
T & GetCached (const std::string &key, std::function< T()> compute)
 Get or compute a cached value.
 
bool IsCacheValid () const
 Check if cache has been invalidated.
 
void ClearCache ()
 Clear all cached values (more aggressive than InvalidateCache)
 

Detailed Description

Definition at line 17 of file screen_editor_views.h.

Member Typedef Documentation

◆ DrawCallback

using yaze::editor::ScreenWorkspaceView::DrawCallback = std::function<void()>

Definition at line 19 of file screen_editor_views.h.

◆ EnabledCallback

Definition at line 20 of file screen_editor_views.h.

Constructor & Destructor Documentation

◆ ScreenWorkspaceView()

yaze::editor::ScreenWorkspaceView::ScreenWorkspaceView ( DrawCallback draw_callback,
EnabledCallback enabled_callback,
std::string shortcut_hint )
inline

Definition at line 22 of file screen_editor_views.h.

Member Function Documentation

◆ IsEnabled()

bool yaze::editor::ScreenWorkspaceView::IsEnabled ( ) const
inlineoverridevirtual

Check if this panel is currently enabled.

Returns
true if panel can be shown, false if disabled

Disabled panels appear grayed out in menus. Override to implement conditional availability (e.g., requires ROM loaded).

Reimplemented from yaze::editor::WindowContent.

Definition at line 29 of file screen_editor_views.h.

References enabled_callback_.

◆ GetDisabledTooltip()

std::string yaze::editor::ScreenWorkspaceView::GetDisabledTooltip ( ) const
inlineoverridevirtual

Get tooltip text when panel is disabled.

Returns
Explanation of why panel is disabled (e.g., "Requires ROM to be loaded")

Reimplemented from yaze::editor::WindowContent.

Definition at line 33 of file screen_editor_views.h.

◆ GetShortcutHint()

std::string yaze::editor::ScreenWorkspaceView::GetShortcutHint ( ) const
inlineoverridevirtual

Get keyboard shortcut hint for display.

Returns
Shortcut string (e.g., "Ctrl+Shift+R")

Reimplemented from yaze::editor::WindowContent.

Definition at line 34 of file screen_editor_views.h.

References shortcut_hint_.

◆ Draw()

void yaze::editor::ScreenWorkspaceView::Draw ( bool * p_open)
inlineoverridevirtual

Draw the panel content.

Parameters
p_openPointer to visibility flag (nullptr if not closable)

Called by WorkspaceWindowManager when the panel is visible. Do NOT call ImGui::Begin/End - the PanelWindow wrapper handles that. Just draw your content directly.

Implements yaze::editor::WindowContent.

Definition at line 36 of file screen_editor_views.h.

References draw_callback_.

Member Data Documentation

◆ draw_callback_

DrawCallback yaze::editor::ScreenWorkspaceView::draw_callback_
private

Definition at line 43 of file screen_editor_views.h.

Referenced by Draw().

◆ enabled_callback_

EnabledCallback yaze::editor::ScreenWorkspaceView::enabled_callback_
private

Definition at line 44 of file screen_editor_views.h.

Referenced by IsEnabled().

◆ shortcut_hint_

std::string yaze::editor::ScreenWorkspaceView::shortcut_hint_
private

Definition at line 45 of file screen_editor_views.h.

Referenced by GetShortcutHint().


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