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) | |
| 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. | |
Public Attributes | |
| uint16_t | current_sheet_id = 0 |
| std::set< uint16_t > | open_sheets |
| std::set< uint16_t > | selected_sheets |
| PixelTool | current_tool = PixelTool::kPencil |
| uint8_t | current_color_index = 1 |
| ImVec4 | current_color |
| uint8_t | brush_size = 1 |
| bool | fill_contiguous = true |
| float | zoom_level = 4.0f |
| bool | show_grid = true |
| bool | show_tile_boundaries = true |
| ImVec2 | pan_offset = {0, 0} |
| bool | show_cursor_crosshair = true |
| bool | show_brush_preview = true |
| bool | show_transparency_grid = true |
| bool | show_pixel_info_tooltip = true |
| uint64_t | palette_group_index = 0 |
| uint64_t | palette_index = 0 |
| uint64_t | sub_palette_index = 0 |
| bool | refresh_graphics = false |
| PixelSelection | selection |
| ImVec2 | selection_start |
| bool | is_selecting = false |
| TileHighlight | tile_highlight |
| std::set< uint16_t > | modified_sheets |
| std::function< void(uint16_t)> | on_sheet_selected |
| std::function< void()> | on_palette_changed |
| std::function< void()> | on_tool_changed |
| std::function< void(uint16_t)> | on_sheet_modified |
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 81 of file graphics_editor_state.h.
|
inline |
Mark a sheet as modified for save tracking.
Definition at line 133 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 143 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 148 of file graphics_editor_state.h.
References modified_sheets.
|
inline |
Check if any sheets have unsaved changes.
Definition at line 157 of file graphics_editor_state.h.
References modified_sheets.
Referenced by yaze::editor::GraphicsEditor::Save().
|
inline |
Select a sheet for editing.
Definition at line 162 of file graphics_editor_state.h.
References current_sheet_id, on_sheet_selected, and open_sheets.
Referenced by yaze::editor::SheetBrowserPanel::DrawSearchBar(), yaze::editor::SheetBrowserPanel::DrawSheetThumbnail(), and yaze::editor::GraphicsEditor::SelectSheet().
|
inline |
Highlight a tile in the current sheet for quick visual focus.
Definition at line 173 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().
|
inline |
Close a sheet tab.
Definition at line 187 of file graphics_editor_state.h.
References open_sheets.
Referenced by yaze::editor::PixelEditorPanel::DrawCanvas().
|
inline |
Set the current editing tool.
Definition at line 192 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 202 of file graphics_editor_state.h.
References zoom_level.
Referenced by yaze::editor::PixelEditorPanel::DrawViewControls(), ZoomIn(), and ZoomOut().
|
inline |
Definition at line 206 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 207 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 212 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 84 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::DrawTileHighlight(), 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 85 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 86 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 90 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 91 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 92 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 93 of file graphics_editor_state.h.
| float yaze::editor::GraphicsEditorState::zoom_level = 4.0f |
Definition at line 96 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 97 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 98 of file graphics_editor_state.h.
| ImVec2 yaze::editor::GraphicsEditorState::pan_offset = {0, 0} |
Definition at line 99 of file graphics_editor_state.h.
| bool yaze::editor::GraphicsEditorState::show_cursor_crosshair = true |
Definition at line 102 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 103 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 104 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 105 of file graphics_editor_state.h.
Referenced by yaze::editor::PixelEditorPanel::DrawCanvas().
| uint64_t yaze::editor::GraphicsEditorState::palette_group_index = 0 |
Definition at line 108 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 109 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 110 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 111 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 114 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 115 of file graphics_editor_state.h.
| bool yaze::editor::GraphicsEditorState::is_selecting = false |
Definition at line 116 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 117 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 120 of file graphics_editor_state.h.
Referenced by ClearModifiedSheets(), 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 123 of file graphics_editor_state.h.
Referenced by SelectSheet().
| std::function<void()> yaze::editor::GraphicsEditorState::on_palette_changed |
Definition at line 124 of file graphics_editor_state.h.
| std::function<void()> yaze::editor::GraphicsEditorState::on_tool_changed |
Definition at line 125 of file graphics_editor_state.h.
Referenced by SetTool().
| std::function<void(uint16_t)> yaze::editor::GraphicsEditorState::on_sheet_modified |
Definition at line 126 of file graphics_editor_state.h.
Referenced by MarkSheetModified().