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

Public Member Functions | |
| void | MarkSheetModified (uint16_t sheet_id) |
| Mark a sheet as modified for save tracking. | |
| void | ClearModifiedSheets () |
| Clear modification tracking (after save) | |
| bool | HasUnsavedChanges () const |
| Check if any sheets have unsaved changes. | |
| void | PushUndoState (uint16_t sheet_id, const std::vector< uint8_t > &pixel_data, const gfx::SnesPalette &palette) |
| Push current state to undo stack before modification. | |
| bool | PopUndoState (PixelEditorSnapshot &out) |
| Pop and return the last undo state. | |
| bool | PopRedoState (PixelEditorSnapshot &out) |
| Pop and return the last redo state. | |
| bool | CanUndo () const |
| bool | CanRedo () const |
| void | SelectSheet (uint16_t sheet_id) |
| Select a sheet for editing. | |
| 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. | |
Static Public Attributes | |
| static constexpr size_t | kMaxUndoHistory = 50 |
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 74 of file graphics_editor_state.h.
|
inline |
Mark a sheet as modified for save tracking.
Definition at line 130 of file graphics_editor_state.h.
References modified_sheets, and on_sheet_modified.
Referenced by yaze::editor::PixelEditorPanel::ApplyBrush(), yaze::editor::PixelEditorPanel::ApplyEraser(), yaze::editor::PixelEditorPanel::ApplyFill(), yaze::editor::PixelEditorPanel::ApplyPencil(), yaze::editor::PixelEditorPanel::DrawLine(), yaze::editor::PixelEditorPanel::DrawRectangle(), and yaze::editor::PixelEditorPanel::PasteSelection().
|
inline |
Clear modification tracking (after save)
Definition at line 140 of file graphics_editor_state.h.
References modified_sheets.
Referenced by yaze::editor::GraphicsEditor::Save().
|
inline |
Check if any sheets have unsaved changes.
Definition at line 145 of file graphics_editor_state.h.
References modified_sheets.
Referenced by yaze::editor::GraphicsEditor::Save().
|
inline |
Push current state to undo stack before modification.
Definition at line 150 of file graphics_editor_state.h.
References kMaxUndoHistory, redo_stack, and undo_stack.
Referenced by yaze::editor::PixelEditorPanel::SaveUndoState().
|
inline |
Pop and return the last undo state.
Definition at line 167 of file graphics_editor_state.h.
References redo_stack, and undo_stack.
Referenced by yaze::editor::PixelEditorPanel::DrawToolbar().
|
inline |
Pop and return the last redo state.
Definition at line 178 of file graphics_editor_state.h.
References redo_stack, and undo_stack.
Referenced by yaze::editor::PixelEditorPanel::DrawToolbar().
|
inline |
Definition at line 186 of file graphics_editor_state.h.
References undo_stack.
Referenced by yaze::editor::PixelEditorPanel::DrawToolbar().
|
inline |
Definition at line 187 of file graphics_editor_state.h.
References redo_stack.
Referenced by yaze::editor::PixelEditorPanel::DrawToolbar().
|
inline |
Select a sheet for editing.
Definition at line 192 of file graphics_editor_state.h.
References current_sheet_id, on_sheet_selected, and open_sheets.
Referenced by yaze::editor::SheetBrowserPanel::DrawSearchBar(), and yaze::editor::SheetBrowserPanel::DrawSheetThumbnail().
|
inline |
Close a sheet tab.
Definition at line 203 of file graphics_editor_state.h.
References open_sheets.
Referenced by yaze::editor::PixelEditorPanel::DrawCanvas().
|
inline |
Set the current editing tool.
Definition at line 208 of file graphics_editor_state.h.
References current_tool, and on_tool_changed.
Referenced by yaze::editor::PixelEditorPanel::DrawToolbar(), and yaze::editor::GraphicsEditor::HandleEditorShortcuts().
|
inline |
Set zoom level with clamping.
Definition at line 218 of file graphics_editor_state.h.
References zoom_level.
Referenced by yaze::editor::PixelEditorPanel::DrawViewControls(), ZoomIn(), and ZoomOut().
|
inline |
Definition at line 222 of file graphics_editor_state.h.
References SetZoom(), and zoom_level.
Referenced by yaze::editor::PixelEditorPanel::DrawViewControls(), and yaze::editor::GraphicsEditor::HandleEditorShortcuts().

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

|
inline |
Get tool name for status display.
Definition at line 228 of file graphics_editor_state.h.
References current_tool, yaze::editor::kBrush, yaze::editor::kEraser, yaze::editor::kEyedropper, yaze::editor::kFill, yaze::editor::kLasso, yaze::editor::kLine, yaze::editor::kPencil, yaze::editor::kRectangle, and yaze::editor::kSelect.
Referenced by yaze::editor::PixelEditorPanel::DrawStatusBar().
| uint16_t yaze::editor::GraphicsEditorState::current_sheet_id = 0 |
Definition at line 77 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::ApplyBrush(), yaze::editor::PixelEditorPanel::ApplyEraser(), yaze::editor::PixelEditorPanel::ApplyEyedropper(), yaze::editor::PixelEditorPanel::ApplyFill(), yaze::editor::PixelEditorPanel::ApplyPencil(), yaze::editor::PaletteControlsPanel::DrawApplyButtons(), yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::PixelEditorPanel::DrawColorPicker(), yaze::editor::PixelEditorPanel::DrawLine(), yaze::editor::PixelEditorPanel::DrawMiniMap(), yaze::editor::PixelEditorPanel::DrawRectangle(), yaze::editor::SheetBrowserPanel::DrawSheetThumbnail(), yaze::editor::PixelEditorPanel::DrawStatusBar(), yaze::editor::PixelEditorPanel::EndSelection(), yaze::editor::PixelEditorPanel::HandleCanvasInput(), yaze::editor::GraphicsEditor::NextSheet(), yaze::editor::PixelEditorPanel::PasteSelection(), yaze::editor::GraphicsEditor::PrevSheet(), yaze::editor::PixelEditorPanel::SaveUndoState(), and SelectSheet().
| std::set<uint16_t> yaze::editor::GraphicsEditorState::open_sheets |
Definition at line 78 of file graphics_editor_state.h.
Referenced by CloseSheet(), yaze::editor::PaletteControlsPanel::DrawApplyButtons(), 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 |
Definition at line 79 of file graphics_editor_state.h.
Referenced by yaze::editor::PaletteControlsPanel::DrawApplyButtons(), yaze::editor::SheetBrowserPanel::DrawBatchOperations(), and yaze::editor::SheetBrowserPanel::DrawSheetThumbnail().
| PixelTool yaze::editor::GraphicsEditorState::current_tool = PixelTool::kPencil |
| uint8_t yaze::editor::GraphicsEditorState::current_color_index = 1 |
Definition at line 83 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(), and yaze::editor::PixelEditorPanel::DrawRectangle().
| ImVec4 yaze::editor::GraphicsEditorState::current_color |
Definition at line 84 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::ApplyEyedropper(), and yaze::editor::PixelEditorPanel::DrawColorPicker().
| uint8_t yaze::editor::GraphicsEditorState::brush_size = 1 |
Definition at line 85 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 86 of file graphics_editor_state.h.
| float yaze::editor::GraphicsEditorState::zoom_level = 4.0f |
Definition at line 89 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawBrushPreview(), yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::PixelEditorPanel::DrawCursorCrosshair(), yaze::editor::PixelEditorPanel::DrawStatusBar(), yaze::editor::PixelEditorPanel::DrawViewControls(), yaze::editor::PixelEditorPanel::PixelToScreen(), yaze::editor::PixelEditorPanel::ScreenToPixel(), SetZoom(), ZoomIn(), and ZoomOut().
| bool yaze::editor::GraphicsEditorState::show_grid = true |
Definition at line 90 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::PixelEditorPanel::DrawViewControls(), and yaze::editor::GraphicsEditor::HandleEditorShortcuts().
| bool yaze::editor::GraphicsEditorState::show_tile_boundaries = true |
Definition at line 91 of file graphics_editor_state.h.
| ImVec2 yaze::editor::GraphicsEditorState::pan_offset = {0, 0} |
Definition at line 92 of file graphics_editor_state.h.
| bool yaze::editor::GraphicsEditorState::show_cursor_crosshair = true |
Definition at line 95 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 96 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 97 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 98 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawCanvas().
| uint64_t yaze::editor::GraphicsEditorState::palette_group_index = 0 |
Definition at line 101 of file graphics_editor_state.h.
Referenced by yaze::editor::PaletteControlsPanel::ApplyPaletteToAllSheets(), yaze::editor::PaletteControlsPanel::ApplyPaletteToSheet(), yaze::editor::PaletteControlsPanel::DrawPaletteDisplay(), yaze::editor::PaletteControlsPanel::DrawPaletteGroupSelector(), yaze::editor::PaletteControlsPanel::DrawPresets(), and yaze::editor::PaletteControlsPanel::Initialize().
| uint64_t yaze::editor::GraphicsEditorState::palette_index = 0 |
Definition at line 102 of file graphics_editor_state.h.
Referenced by yaze::editor::PaletteControlsPanel::ApplyPaletteToAllSheets(), yaze::editor::PaletteControlsPanel::ApplyPaletteToSheet(), yaze::editor::PaletteControlsPanel::DrawPaletteDisplay(), yaze::editor::PaletteControlsPanel::DrawPaletteGroupSelector(), yaze::editor::PaletteControlsPanel::DrawPresets(), and yaze::editor::PaletteControlsPanel::Initialize().
| uint64_t yaze::editor::GraphicsEditorState::sub_palette_index = 0 |
Definition at line 103 of file graphics_editor_state.h.
Referenced by yaze::editor::PaletteControlsPanel::ApplyPaletteToAllSheets(), yaze::editor::PaletteControlsPanel::ApplyPaletteToSheet(), yaze::editor::PaletteControlsPanel::DrawPaletteDisplay(), yaze::editor::PaletteControlsPanel::DrawPaletteGroupSelector(), and yaze::editor::PaletteControlsPanel::Initialize().
| bool yaze::editor::GraphicsEditorState::refresh_graphics = false |
Definition at line 104 of file graphics_editor_state.h.
Referenced by yaze::editor::PaletteControlsPanel::DrawApplyButtons(), yaze::editor::PaletteControlsPanel::DrawPaletteDisplay(), yaze::editor::PaletteControlsPanel::DrawPaletteGroupSelector(), and yaze::editor::PaletteControlsPanel::DrawPresets().
| PixelSelection yaze::editor::GraphicsEditorState::selection |
Definition at line 107 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::BeginSelection(), yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::PixelEditorPanel::EndSelection(), yaze::editor::PixelEditorPanel::FlipSelectionHorizontal(), yaze::editor::PixelEditorPanel::FlipSelectionVertical(), yaze::editor::PixelEditorPanel::PasteSelection(), and yaze::editor::PixelEditorPanel::UpdateSelection().
| ImVec2 yaze::editor::GraphicsEditorState::selection_start |
Definition at line 108 of file graphics_editor_state.h.
| bool yaze::editor::GraphicsEditorState::is_selecting = false |
Definition at line 109 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::BeginSelection(), and yaze::editor::PixelEditorPanel::EndSelection().
| std::vector<PixelEditorSnapshot> yaze::editor::GraphicsEditorState::undo_stack |
Definition at line 112 of file graphics_editor_state.h.
Referenced by CanUndo(), PopRedoState(), PopUndoState(), and PushUndoState().
| std::vector<PixelEditorSnapshot> yaze::editor::GraphicsEditorState::redo_stack |
Definition at line 113 of file graphics_editor_state.h.
Referenced by CanRedo(), PopRedoState(), PopUndoState(), and PushUndoState().
|
staticconstexpr |
Definition at line 114 of file graphics_editor_state.h.
Referenced by PushUndoState().
| std::set<uint16_t> yaze::editor::GraphicsEditorState::modified_sheets |
Definition at line 117 of file graphics_editor_state.h.
Referenced by ClearModifiedSheets(), yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::SheetBrowserPanel::DrawSheetGrid(), yaze::editor::SheetBrowserPanel::DrawSheetThumbnail(), yaze::editor::PixelEditorPanel::DrawStatusBar(), HasUnsavedChanges(), MarkSheetModified(), and yaze::editor::GraphicsEditor::Save().
| std::function<void(uint16_t)> yaze::editor::GraphicsEditorState::on_sheet_selected |
Definition at line 120 of file graphics_editor_state.h.
Referenced by SelectSheet().
| std::function<void()> yaze::editor::GraphicsEditorState::on_palette_changed |
Definition at line 121 of file graphics_editor_state.h.
| std::function<void()> yaze::editor::GraphicsEditorState::on_tool_changed |
Definition at line 122 of file graphics_editor_state.h.
Referenced by SetTool().
| std::function<void(uint16_t)> yaze::editor::GraphicsEditorState::on_sheet_modified |
Definition at line 123 of file graphics_editor_state.h.
Referenced by MarkSheetModified().