Shared state between GraphicsEditor panel components. More...
#include <graphics_editor_state.h>

Public Member Functions | |
| const GraphicsPaletteSelection * | PreviewPalette (uint16_t sheet) const |
| const GraphicsEditTarget * | SourceTarget () const |
| void | SelectSourceTarget (size_t index) |
| void | ClearSourceContext () |
| void | MarkSheetModified (uint16_t sheet_id) |
| Mark a sheet as modified for save tracking. | |
| void | ClearModifiedSheets () |
| Clear modification tracking (after save) | |
| void | ClearModifiedSheets (const std::set< uint16_t > &sheet_ids) |
| Clear specific sheets from modification tracking. | |
| bool | HasUnsavedChanges () const |
| Check if any sheets have unsaved changes. | |
| void | SelectSheet (uint16_t sheet_id) |
| Select a sheet for editing. | |
| void | HighlightTile (uint16_t sheet_id, uint16_t tile_index, const std::string &label="", double duration_secs=3.0) |
| Highlight a tile in the current sheet for quick visual focus. | |
| void | CloseSheet (uint16_t sheet_id) |
| Close a sheet tab. | |
| void | SetTool (PixelTool tool) |
| Set the current editing tool. | |
| void | SetZoom (float zoom) |
| Set zoom level with clamping. | |
| void | ZoomIn () |
| void | ZoomOut () |
| const char * | GetToolName () const |
| Get tool name for status display. | |
Shared state between GraphicsEditor panel components.
This class maintains the state that needs to be shared between the Sheet Browser, Pixel Editor, and Palette Controls panels. It provides a single source of truth for selection, current sheet, palette, and editing state.
Definition at line 96 of file graphics_editor_state.h.
|
inline |
Definition at line 126 of file graphics_editor_state.h.
References preview_palettes.
Referenced by yaze::editor::PaletteControlsPanel::DrawApplyButtons(), yaze::editor::DrawGraphicsPreviewPaletteSelector(), and yaze::editor::PaletteControlsPanel::DrawPaletteDisplay().
|
inline |
Definition at line 149 of file graphics_editor_state.h.
References current_sheet_id, game_data, yaze::editor::GraphicsEditTarget::sheet_id, and source_context.
Referenced by yaze::editor::GraphicsEditor::BuildContextSnapshot(), yaze::editor::PixelEditorPanel::DisplayPalette(), yaze::editor::PixelEditorPanel::DisplaySheet(), yaze::editor::PaletteReorderControl::Draw(), yaze::editor::PixelEditorPanel::DrawPaletteRowPicker(), yaze::editor::SheetBrowserPanel::DrawPngTransfer(), yaze::editor::PixelEditorPanel::DrawSourceContext(), yaze::editor::SheetBrowserPanel::PngPalette(), yaze::editor::UsagePreviewView::ScanSharedUses(), and yaze::editor::PaletteControlsPanel::Update().
|
inline |
Definition at line 159 of file graphics_editor_state.h.
References current_color_index, HighlightTile(), on_before_sheet_selected, requested_sheet_tab, SelectSheet(), and source_context.
Referenced by yaze::editor::PixelEditorPanel::DrawSourceContext(), and yaze::editor::GraphicsEditor::OpenInContext().

|
inline |
Definition at line 173 of file graphics_editor_state.h.
References source_context, and source_context_revision.
Referenced by yaze::editor::AttachSheetStore(), yaze::editor::PixelEditorPanel::DrawSourceContext(), yaze::editor::GraphicsEditor::Load(), yaze::editor::GraphicsEditor::set_rom(), and yaze::editor::PaletteControlsPanel::Update().
|
inline |
Mark a sheet as modified for save tracking.
Definition at line 191 of file graphics_editor_state.h.
References modified_sheets, and on_sheet_modified.
Referenced by yaze::editor::ApplySheetPixelDiff(), yaze::editor::CommitSheetPixels(), yaze::editor::PixelEditorPanel::EndStroke(), yaze::editor::ExecutePalettePixelPlan(), and yaze::editor::PixelEditorPanel::ShowStrokeChanges().
|
inline |
Clear modification tracking (after save)
Definition at line 201 of file graphics_editor_state.h.
References modified_sheets.
Referenced by yaze::editor::GraphicsEditor::Save().
|
inline |
Clear specific sheets from modification tracking.
Definition at line 206 of file graphics_editor_state.h.
References modified_sheets.
|
inline |
Check if any sheets have unsaved changes.
Definition at line 215 of file graphics_editor_state.h.
References modified_sheets.
Referenced by yaze::editor::GraphicsEditor::BuildContextSnapshot(), yaze::editor::GraphicsEditor::ContributeStatus(), yaze::editor::GraphicsEditor::HasPendingGraphicsChanges(), and yaze::editor::GraphicsEditor::Save().
|
inline |
Select a sheet for editing.
Definition at line 220 of file graphics_editor_state.h.
References current_sheet_id, on_before_sheet_selected, on_sheet_selected, and open_sheets.
Referenced by yaze::editor::SheetBrowserPanel::DrawSearchBar(), yaze::editor::SheetBrowserPanel::DrawSheetThumbnail(), yaze::editor::GraphicsEditor::NextSheet(), yaze::editor::GraphicsEditor::PrevSheet(), yaze::editor::GraphicsEditor::SelectSheet(), and SelectSourceTarget().
|
inline |
Highlight a tile in the current sheet for quick visual focus.
Definition at line 233 of file graphics_editor_state.h.
References yaze::editor::TileHighlight::active, yaze::editor::TileHighlight::duration, yaze::editor::TileHighlight::label, yaze::editor::TileHighlight::sheet_id, yaze::editor::TileHighlight::start_time, tile_highlight, and yaze::editor::TileHighlight::tile_index.
Referenced by yaze::editor::GraphicsEditor::HighlightTile(), and SelectSourceTarget().
|
inline |
Close a sheet tab.
Definition at line 247 of file graphics_editor_state.h.
References open_sheets.
Referenced by yaze::editor::PixelEditorPanel::DrawCanvas().
|
inline |
Set the current editing tool.
Definition at line 252 of file graphics_editor_state.h.
References current_tool, and on_tool_changed.
Referenced by yaze::editor::PixelEditorPanel::DrawToolbar(), and yaze::editor::GraphicsEditor::SetPixelTool().
|
inline |
Set zoom level with clamping.
Definition at line 262 of file graphics_editor_state.h.
References zoom_level.
Referenced by yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::PixelEditorPanel::DrawStatusBar(), ZoomIn(), and ZoomOut().
|
inline |
Definition at line 264 of file graphics_editor_state.h.
References SetZoom(), and zoom_level.
Referenced by yaze::editor::PixelEditorPanel::DrawStatusBar(), and yaze::editor::GraphicsEditor::ZoomIn().

|
inline |
Definition at line 265 of file graphics_editor_state.h.
References SetZoom(), and zoom_level.
Referenced by yaze::editor::PixelEditorPanel::DrawStatusBar(), and yaze::editor::GraphicsEditor::ZoomOut().

|
inline |
Get tool name for status display.
Definition at line 270 of file graphics_editor_state.h.
References current_tool, yaze::editor::kBrush, yaze::editor::kEraser, yaze::editor::kEyedropper, yaze::editor::kFill, yaze::editor::kHand, yaze::editor::kLasso, yaze::editor::kLine, yaze::editor::kPencil, yaze::editor::kRectangle, and yaze::editor::kSelect.
Referenced by yaze::editor::PixelEditorPanel::DrawStatusBar(), and yaze::editor::PixelEditorPanel::DrawToolbar().
| uint16_t yaze::editor::GraphicsEditorState::current_sheet_id = 0 |
Definition at line 99 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::ApplyEyedropper(), yaze::editor::PixelEditorPanel::BeginStroke(), yaze::editor::GraphicsEditor::BuildContextSnapshot(), yaze::editor::anonymous_namespace{palette_controls_panel.cc}::Choose(), yaze::editor::PixelEditorPanel::ClampFloatingPaste(), yaze::editor::GraphicsEditor::ContributeStatus(), yaze::editor::PixelEditorPanel::CopyToSystemClipboard(), yaze::editor::PixelEditorPanel::CutToSystemClipboard(), yaze::editor::PixelEditorPanel::DisplayPalette(), yaze::editor::PixelEditorPanel::DisplaySheet(), yaze::editor::UsagePreviewView::Draw(), yaze::editor::PaletteControlsPanel::DrawApplyButtons(), yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::DrawGraphicsPreviewPaletteSelector(), yaze::editor::PaletteControlsPanel::DrawPaletteDisplay(), yaze::editor::SheetBrowserPanel::DrawSelectedSheetInfo(), yaze::editor::SheetBrowserPanel::DrawSheetThumbnail(), yaze::editor::PixelEditorPanel::DrawStatusBar(), yaze::editor::PixelEditorPanel::DrawTileHighlight(), yaze::editor::PixelEditorPanel::EndSelection(), yaze::editor::PixelEditorPanel::HandleCanvasInput(), yaze::editor::UsagePreviewView::HashWatchedSheets(), yaze::editor::GraphicsEditor::NextSheet(), yaze::editor::PixelEditorPanel::PasteFromSystemClipboard(), yaze::editor::GraphicsEditor::PrevSheet(), yaze::editor::UsagePreviewView::RefreshRoomContexts(), SelectSheet(), yaze::editor::UsagePreviewView::SharedUsesHash(), yaze::editor::UsagePreviewView::Snapshot(), SourceTarget(), yaze::editor::PixelEditorPanel::StrokeEdit(), and yaze::editor::SheetBrowserPanel::Update().
| std::set<uint16_t> yaze::editor::GraphicsEditorState::open_sheets |
Definition at line 100 of file graphics_editor_state.h.
Referenced by CloseSheet(), yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::PixelEditorPanel::DrawColorPicker(), yaze::editor::PixelEditorPanel::DrawMiniMap(), yaze::editor::SheetBrowserPanel::DrawSheetThumbnail(), and SelectSheet().
| std::set<uint16_t> yaze::editor::GraphicsEditorState::selected_sheets |
| PixelTool yaze::editor::GraphicsEditorState::current_tool = PixelTool::kPencil |
Definition at line 104 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawBrushPreview(), yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::PixelEditorPanel::DrawToolbar(), GetToolName(), yaze::editor::PixelEditorPanel::HandleCanvasInput(), yaze::editor::PixelEditorPanel::HandlePanInput(), and SetTool().
| uint8_t yaze::editor::GraphicsEditorState::current_color_index = 1 |
Definition at line 105 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::ApplyBrush(), yaze::editor::PixelEditorPanel::ApplyEyedropper(), yaze::editor::PixelEditorPanel::ApplyFill(), yaze::editor::PixelEditorPanel::ApplyPencil(), yaze::editor::PixelEditorPanel::DrawColorPicker(), yaze::editor::PixelEditorPanel::DrawLine(), yaze::editor::PixelEditorPanel::DrawRectangle(), yaze::editor::PixelEditorPanel::DrawStatusBar(), and SelectSourceTarget().
| uint8_t yaze::editor::GraphicsEditorState::brush_size = 1 |
Definition at line 106 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::ApplyBrush(), yaze::editor::PixelEditorPanel::ApplyEraser(), yaze::editor::PixelEditorPanel::DrawBrushPreview(), and yaze::editor::PixelEditorPanel::DrawToolbar().
| bool yaze::editor::GraphicsEditorState::fill_contiguous = true |
Definition at line 107 of file graphics_editor_state.h.
| float yaze::editor::GraphicsEditorState::zoom_level = 4.0f |
Definition at line 110 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawBrushPreview(), yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::PixelEditorPanel::DrawCursorCrosshair(), yaze::editor::PixelEditorPanel::DrawPixelGrids(), yaze::editor::PixelEditorPanel::DrawStatusBar(), yaze::editor::PixelEditorPanel::PixelToScreen(), yaze::editor::PixelEditorPanel::ScreenToPixel(), SetZoom(), ZoomIn(), and ZoomOut().
| bool yaze::editor::GraphicsEditorState::show_grid = true |
Definition at line 111 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::PixelEditorPanel::DrawViewControls(), and yaze::editor::GraphicsEditor::ToggleGrid().
| bool yaze::editor::GraphicsEditorState::show_pixel_grid = false |
Definition at line 112 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawPixelGrids(), and yaze::editor::PixelEditorPanel::DrawViewControls().
| bool yaze::editor::GraphicsEditorState::show_tile_boundaries = true |
Definition at line 113 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawPixelGrids(), and yaze::editor::PixelEditorPanel::DrawViewControls().
| ImVec2 yaze::editor::GraphicsEditorState::pan_offset = {0, 0} |
Definition at line 114 of file graphics_editor_state.h.
| bool yaze::editor::GraphicsEditorState::show_cursor_crosshair = true |
Definition at line 117 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawCanvas(), and yaze::editor::PixelEditorPanel::DrawViewControls().
| bool yaze::editor::GraphicsEditorState::show_brush_preview = true |
Definition at line 118 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawCanvas(), and yaze::editor::PixelEditorPanel::DrawViewControls().
| bool yaze::editor::GraphicsEditorState::show_transparency_grid = true |
Definition at line 119 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawCanvas(), and yaze::editor::PixelEditorPanel::DrawViewControls().
| bool yaze::editor::GraphicsEditorState::show_pixel_info_tooltip = true |
Definition at line 120 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawCanvas().
| std::map<uint16_t, GraphicsPaletteSelection> yaze::editor::GraphicsEditorState::preview_palettes |
Definition at line 124 of file graphics_editor_state.h.
Referenced by yaze::editor::AttachSheetStore(), yaze::editor::GraphicsEditor::Load(), PreviewPalette(), yaze::editor::RefreshGraphicsPreviewPalettes(), yaze::editor::GraphicsEditor::set_rom(), and yaze::editor::SetGraphicsPreviewPalette().
| PixelSelection yaze::editor::GraphicsEditorState::selection |
Definition at line 132 of file graphics_editor_state.h.
Referenced by yaze::editor::GraphicsEditor::BeginSaveTransaction(), yaze::editor::PixelEditorPanel::BeginSelection(), yaze::editor::PixelEditorPanel::CancelFloatingPaste(), yaze::editor::PixelEditorPanel::ClampFloatingPaste(), yaze::editor::PixelEditorPanel::CommitFloatingPaste(), yaze::editor::PixelEditorPanel::CopyToSystemClipboard(), yaze::editor::PixelEditorPanel::CutToSystemClipboard(), yaze::editor::PaletteReorderControl::Draw(), yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::PixelEditorPanel::DrawClipboardControls(), yaze::editor::PixelEditorPanel::DrawFloatingPaste(), yaze::editor::PixelEditorPanel::DrawSourceContext(), yaze::editor::PixelEditorPanel::EndSelection(), yaze::editor::ExecutePalettePixelPlan(), yaze::editor::PixelEditorPanel::FlipSelectionHorizontal(), yaze::editor::PixelEditorPanel::FlipSelectionVertical(), yaze::editor::PixelEditorPanel::HandleFloatingPasteInput(), yaze::editor::PixelEditorPanel::HandleFloatingPasteKeys(), yaze::editor::GraphicsEditor::HasPendingGraphicsChanges(), yaze::editor::GraphicsEditor::OpenInContext(), yaze::editor::PixelEditorPanel::PasteFromSystemClipboard(), yaze::editor::PixelEditorPanel::PasteSelection(), yaze::editor::GraphicsEditor::Save(), yaze::editor::UsagePreviewView::SelectedTileIndex(), yaze::editor::PixelEditorPanel::Update(), and yaze::editor::PixelEditorPanel::UpdateSelection().
| ImVec2 yaze::editor::GraphicsEditorState::selection_start |
Definition at line 133 of file graphics_editor_state.h.
| bool yaze::editor::GraphicsEditorState::is_selecting = false |
Definition at line 134 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::BeginSelection(), and yaze::editor::PixelEditorPanel::EndSelection().
| TileHighlight yaze::editor::GraphicsEditorState::tile_highlight |
Definition at line 135 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawStatusBar(), yaze::editor::PixelEditorPanel::DrawTileHighlight(), and HighlightTile().
| std::set<uint16_t> yaze::editor::GraphicsEditorState::modified_sheets |
Definition at line 138 of file graphics_editor_state.h.
Referenced by yaze::editor::GraphicsEditor::BeginSaveTransaction(), ClearModifiedSheets(), ClearModifiedSheets(), yaze::editor::GraphicsEditor::ContributeStatus(), yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::SheetBrowserPanel::DrawPendingSave(), yaze::editor::SheetBrowserPanel::DrawPngTransfer(), yaze::editor::SheetBrowserPanel::DrawSheetGrid(), yaze::editor::SheetBrowserPanel::DrawSheetThumbnail(), yaze::editor::PixelEditorPanel::DrawStatusBar(), yaze::editor::UsagePreviewView::HashWatchedSheets(), HasUnsavedChanges(), MarkSheetModified(), yaze::editor::GraphicsEditor::PrepareGraphicsSave(), yaze::editor::GraphicsEditor::RollbackSaveTransaction(), and yaze::editor::UsagePreviewView::Snapshot().
| zelda3::GameData* yaze::editor::GraphicsEditorState::game_data = nullptr |
Definition at line 143 of file graphics_editor_state.h.
Referenced by yaze::editor::ActiveSheetStore(), yaze::editor::ApplyPalettePixelPermutation(), yaze::editor::AttachSheetStore(), yaze::editor::PaletteReorderControl::Begin(), yaze::editor::GraphicsEditor::BuildContextSnapshot(), yaze::editor::anonymous_namespace{palette_controls_panel.cc}::CanPreview(), yaze::editor::DrawGraphicsPreviewPaletteSelector(), yaze::editor::PaletteControlsPanel::DrawPaletteDisplay(), yaze::editor::PaletteControlsPanel::DrawPresets(), yaze::editor::PixelEditorPanel::DrawSourceContext(), yaze::editor::ExecutePalettePixelPlan(), yaze::editor::GraphicsEditor::OpenInContext(), yaze::editor::SheetBrowserPanel::PngPalette(), yaze::editor::RefreshGraphicsPreviewPalettes(), yaze::editor::SetGraphicsPreviewPalette(), yaze::editor::PaletteReorderControl::SourceChanged(), SourceTarget(), and yaze::editor::PixelEditorPanel::Update().
| std::optional<GraphicsEditContext> yaze::editor::GraphicsEditorState::source_context |
Definition at line 144 of file graphics_editor_state.h.
Referenced by yaze::editor::ApplyPalettePixelPermutation(), yaze::editor::PaletteReorderControl::Begin(), yaze::editor::GraphicsEditor::BuildContextSnapshot(), ClearSourceContext(), yaze::editor::PixelEditorPanel::DrawSourceContext(), yaze::editor::UsagePreviewView::DrawSourcePreview(), yaze::editor::UsagePreviewView::HashWatchedSheets(), yaze::editor::GraphicsEditor::OpenInContext(), yaze::editor::RefreshGraphicsPreviewPalettes(), yaze::editor::UsagePreviewView::ScanSharedUses(), SelectSourceTarget(), yaze::editor::UsagePreviewView::SharedUsesHash(), yaze::editor::PaletteReorderControl::SourceChanged(), SourceTarget(), and yaze::editor::PixelEditorPanel::Update().
| uint64_t yaze::editor::GraphicsEditorState::source_context_revision = 0 |
Definition at line 145 of file graphics_editor_state.h.
Referenced by yaze::editor::PaletteReorderControl::Begin(), ClearSourceContext(), yaze::editor::UsagePreviewView::Draw(), yaze::editor::UsagePreviewView::DrawSourcePreview(), yaze::editor::GraphicsEditor::OpenInContext(), yaze::editor::UsagePreviewView::SharedUsesHash(), and yaze::editor::PaletteReorderControl::SourceChanged().
| std::optional<uint16_t> yaze::editor::GraphicsEditorState::requested_sheet_tab |
Definition at line 147 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::GraphicsEditor::SelectSheet(), and SelectSourceTarget().
| std::array<uint64_t, 223> yaze::editor::GraphicsEditorState::arena_revisions {} |
Definition at line 178 of file graphics_editor_state.h.
Referenced by yaze::editor::AttachSheetStore(), yaze::editor::RefreshArenaSheet(), and yaze::editor::SyncArenaFromStore().
| std::function<void()> yaze::editor::GraphicsEditorState::on_before_sheet_selected |
Definition at line 181 of file graphics_editor_state.h.
Referenced by yaze::editor::GraphicsEditor::Initialize(), SelectSheet(), and SelectSourceTarget().
| std::function<void(uint16_t)> yaze::editor::GraphicsEditorState::on_sheet_selected |
Definition at line 182 of file graphics_editor_state.h.
Referenced by SelectSheet().
| std::function<void()> yaze::editor::GraphicsEditorState::on_tool_changed |
Definition at line 183 of file graphics_editor_state.h.
Referenced by SetTool().
| std::function<void(uint16_t)> yaze::editor::GraphicsEditorState::on_sheet_modified |
Definition at line 184 of file graphics_editor_state.h.
Referenced by MarkSheetModified().