Main pixel editing panel for graphics sheets. More...
#include <pixel_editor_panel.h>
Public Member Functions | |
| PixelEditorPanel (GraphicsEditorState *state, Rom *rom, UndoManager *undo_manager=nullptr) | |
| std::string | GetId () const override |
| Unique identifier for this panel. | |
| std::string | GetDisplayName () const override |
| Human-readable name shown in menus and title bars. | |
| std::string | GetIcon () const override |
| Material Design icon for this panel. | |
| std::string | GetEditorCategory () const override |
| Editor category this panel belongs to. | |
| int | GetPriority () const override |
| Get display priority for menu ordering. | |
| void | Initialize () |
| Initialize the panel. | |
| void | SetRom (Rom *rom) |
| void | SetSourcePreviewCallback (std::function< void()> draw) |
| void | ShowSourcePreview () |
| void | SetScratchCallback (std::function< void()> open) |
| void | SetSheetBrowserCallbacks (std::function< bool()> visible, std::function< void(bool)> set_visible) |
| void | Draw (bool *p_open) override |
| Draw the pixel editor UI (WindowContent interface) | |
| absl::Status | Update () |
| Legacy Update method for backward compatibility. | |
| void | CopyToSystemClipboard () |
| void | CutToSystemClipboard () |
| void | PasteFromSystemClipboard () |
| bool | HasActiveStroke () const |
| void | FinishGesture () |
| void | FinishReleasedGesture () |
| void | SetHistoryCallbacks (std::function< absl::Status()> undo, std::function< absl::Status()> redo) |
| void | SetPaletteReorderCallback (PaletteReorderControl::Apply apply) |
Public Member Functions inherited from yaze::editor::WindowContent | |
| virtual | ~WindowContent ()=default |
| 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 WindowPresentationPolicy | GetPresentationPolicy () const |
| How this content is hosted and advertised by workspace chrome. | |
| virtual bool | IsEnabled () const |
| Check if this panel is currently enabled. | |
| virtual std::string | GetDisabledTooltip () const |
| Get tooltip text when panel is disabled. | |
| virtual std::string | GetShortcutHint () const |
| Get keyboard shortcut hint for display. | |
| 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 | HasExactPreferredWidth () const |
| Whether GetPreferredWidth() is an exact content width. | |
| virtual float | GetPreferredHeight () const |
| Get preferred height for this panel (optional) | |
| virtual bool | PrefersFloating () const |
| 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 Member Functions | |
| void | DrawSourceContext () |
| gfx::Bitmap & | DisplaySheet () |
| gfx::SnesPalette | DisplayPalette () const |
| void | DrawToolbar () |
| Draw the toolbar with tool selection. | |
| void | DrawViewControls () |
| Draw zoom and view controls. | |
| void | DrawCanvas () |
| Draw the main editing canvas. | |
| void | DrawColorPicker () |
| Draw the color palette picker. | |
| void | DrawIndexSwapControls () |
| void | DrawStatusBar () |
| Draw the status bar with cursor position. | |
| void | DrawMiniMap () |
| Draw the mini navigation map. | |
| void | HandleCanvasInput () |
| Handle canvas mouse input for current tool. | |
| void | ApplyPencil (int x, int y) |
| Apply pencil tool at position. | |
| void | ApplyBrush (int x, int y) |
| Apply brush tool at position. | |
| void | ApplyEraser (int x, int y) |
| Apply eraser tool at position. | |
| void | ApplyFill (int x, int y) |
| Apply flood fill starting at position. | |
| void | ApplyEyedropper (int x, int y) |
| Apply eyedropper tool at position. | |
| void | DrawLine (int x1, int y1, int x2, int y2) |
| Draw line from start to end. | |
| void | DrawRectangle (int x1, int y1, int x2, int y2, bool filled) |
| Draw rectangle from start to end. | |
| void | BeginSelection (int x, int y) |
| Start a new selection. | |
| void | UpdateSelection (int x, int y) |
| Update selection during drag. | |
| void | EndSelection () |
| Finalize the selection. | |
| void | CopySelection () |
| Copy selection to clipboard. | |
| void | PasteSelection (int x, int y) |
| Paste clipboard at position. | |
| void | FlipSelectionHorizontal () |
| Flip selection horizontally. | |
| void | FlipSelectionVertical () |
| Flip selection vertically. | |
| void | BeginStroke () |
| Starts a stroke on the current sheet. Pixel writes go to the session's GraphicsSheetStore until EndStroke(). | |
| void | EndStroke () |
| Ends the stroke: the sheet's store revision changes once and one GraphicsPixelEditAction (the changed pixels) is pushed for undo. | |
| zelda3::GraphicsSheetStore::Edit * | StrokeEdit () |
| void | ShowStrokeChanges (bool changed) |
| After pixel writes: refresh the Arena copy and mark the sheet modified. | |
| ImVec2 | ScreenToPixel (ImVec2 screen_pos) |
| Convert screen coordinates to pixel coordinates. | |
| ImVec2 | PixelToScreen (int x, int y) |
| Convert pixel coordinates to screen coordinates. | |
| void | DrawTransparencyGrid (float canvas_width, float canvas_height) |
| Draw checkerboard pattern for transparent pixels. | |
| void | DrawCursorCrosshair () |
| Draw crosshair at cursor position. | |
| void | DrawBrushPreview () |
| Draw brush size preview circle. | |
| void | DrawPixelInfoTooltip (const gfx::Bitmap &sheet) |
| Draw tooltip with pixel information. | |
| void | DrawTileHighlight (const gfx::Bitmap &sheet) |
| Draw a transient highlight for a target tile. | |
| void | HandleFloatingPasteKeys () |
| void | DrawClipboardControls () |
| void | DrawFloatingPaste () |
| bool | HandleFloatingPasteInput () |
| void | CommitFloatingPaste () |
| void | CancelFloatingPaste () |
| void | ClampFloatingPaste () |
| SheetColors | CurrentSheetColors () const |
| bool | HandlePanInput () |
| void | DrawPaletteRowPicker () |
| void | DrawPixelGrids (float canvas_width, float canvas_height) |
Friends | |
| class | PixelEditorPanelTestPeer |
| class | AuthoringSaveWorkflowTestPeer |
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) | |
Main pixel editing panel for graphics sheets.
Provides a full-featured pixel editor with tools for drawing, selecting, and manipulating graphics data.
Definition at line 28 of file pixel_editor_panel.h.
|
inlineexplicit |
Definition at line 30 of file pixel_editor_panel.h.
|
inlineoverridevirtual |
Unique identifier for this panel.
IDs should be:
Implements yaze::editor::WindowContent.
Definition at line 38 of file pixel_editor_panel.h.
|
inlineoverridevirtual |
Human-readable name shown in menus and title bars.
Implements yaze::editor::WindowContent.
Definition at line 39 of file pixel_editor_panel.h.
|
inlineoverridevirtual |
Material Design icon for this panel.
Implements yaze::editor::WindowContent.
Definition at line 40 of file pixel_editor_panel.h.
References ICON_MD_BRUSH.
|
inlineoverridevirtual |
Editor category this panel belongs to.
Implements yaze::editor::WindowContent.
Definition at line 41 of file pixel_editor_panel.h.
|
inlineoverridevirtual |
Get display priority for menu ordering.
Reimplemented from yaze::editor::WindowContent.
Definition at line 42 of file pixel_editor_panel.h.
| void yaze::editor::PixelEditorPanel::Initialize | ( | ) |
Initialize the panel.
Definition at line 33 of file pixel_editor_panel.cc.
|
inline |
Definition at line 53 of file pixel_editor_panel.h.
References rom_.
|
inline |
Definition at line 55 of file pixel_editor_panel.h.
References draw_source_preview_.
|
inline |
Definition at line 58 of file pixel_editor_panel.h.
References show_source_preview_.
|
inline |
Definition at line 59 of file pixel_editor_panel.h.
References open_scratch_.
|
inline |
Definition at line 63 of file pixel_editor_panel.h.
References set_sheet_browser_visible_, and sheet_browser_visible_.
|
overridevirtual |
Draw the pixel editor UI (WindowContent interface)
Implements yaze::editor::WindowContent.
Definition at line 37 of file pixel_editor_panel.cc.
References Update().
| absl::Status yaze::editor::PixelEditorPanel::Update | ( | ) |
Legacy Update method for backward compatibility.
Definition at line 42 of file pixel_editor_panel.cc.
References yaze::gui::AutoRegisterLastItem(), yaze::gui::CenteredIconButton(), draw_source_preview_, DrawCanvas(), DrawClipboardControls(), DrawColorPicker(), DrawSourceContext(), DrawStatusBar(), DrawToolbar(), DrawViewControls(), FinishReleasedGesture(), fit_canvas_requested_, yaze::editor::GraphicsEditorState::game_data, yaze::gui::GetPrimaryVec4(), HandleFloatingPasteKeys(), HOVER_HINT, ICON_MD_MORE_HORIZ, ICON_MD_TUNE, yaze::editor::PixelSelection::is_floating, yaze::editor::GraphicsEditorState::selection, set_sheet_browser_visible_, sheet_browser_visible_, show_source_preview_, yaze::editor::GraphicsEditorState::source_context, and state_.
Referenced by Draw().
| void yaze::editor::PixelEditorPanel::CopyToSystemClipboard | ( | ) |
Definition at line 1561 of file pixel_editor_panel.cc.
References clipboard_status_, clipboard_status_is_error_, yaze::editor::GraphicsEditorState::current_sheet_id, CurrentSheetColors(), yaze::editor::EncodeClipboardPng(), yaze::gfx::Arena::Get(), yaze::gfx::Arena::gfx_sheets(), yaze::editor::GraphicsEditorState::selection, yaze::util::SetClipboardPng(), state_, and yaze::editor::PixelSelection::width.
Referenced by CutToSystemClipboard(), and DrawClipboardControls().
| void yaze::editor::PixelEditorPanel::CutToSystemClipboard | ( | ) |
Definition at line 1601 of file pixel_editor_panel.cc.
References BeginStroke(), clipboard_status_, clipboard_status_is_error_, CopyToSystemClipboard(), yaze::editor::GraphicsEditorState::current_sheet_id, EndStroke(), yaze::editor::GraphicsEditorState::selection, ShowStrokeChanges(), state_, and StrokeEdit().
| void yaze::editor::PixelEditorPanel::PasteFromSystemClipboard | ( | ) |
Definition at line 1633 of file pixel_editor_panel.cc.
References ClampFloatingPaste(), clipboard_status_, clipboard_status_is_error_, yaze::editor::GraphicsEditorState::current_sheet_id, CurrentSheetColors(), yaze::editor::DescribeClipboardPaste(), yaze::gfx::Arena::Get(), yaze::util::GetClipboardPng(), yaze::gfx::Arena::gfx_sheets(), yaze::editor::PixelSelection::is_active, yaze::editor::MapClipboardPng(), yaze::editor::GraphicsEditorState::selection, and state_.
Referenced by DrawClipboardControls().
|
inline |
Definition at line 86 of file pixel_editor_panel.h.
References stroke_.
Referenced by DrawColorPicker(), DrawIndexSwapControls(), and DrawToolbar().
| void yaze::editor::PixelEditorPanel::FinishGesture | ( | ) |
Definition at line 1083 of file pixel_editor_panel.cc.
References yaze::editor::ActiveSheetStore(), cursor_x_, cursor_y_, DrawLine(), DrawRectangle(), EndSelection(), EndStroke(), gesture_tool_, is_drawing_, yaze::editor::kLine, yaze::editor::kRectangle, yaze::editor::kSelect, show_tool_preview_, state_, stroke_, and tool_start_pixel_.
Referenced by DrawCanvas(), DrawSourceContext(), FinishReleasedGesture(), and HandleCanvasInput().
| void yaze::editor::PixelEditorPanel::FinishReleasedGesture | ( | ) |
Definition at line 1073 of file pixel_editor_panel.cc.
References cursor_x_, cursor_y_, FinishGesture(), is_drawing_, and last_mouse_pixel_.
Referenced by Update().
|
inline |
Definition at line 91 of file pixel_editor_panel.h.
|
inline |
Definition at line 96 of file pixel_editor_panel.h.
References apply_palette_reorder_.
|
private |
Definition at line 191 of file pixel_editor_panel.cc.
References yaze::gui::AutoRegisterLastItem(), yaze::editor::GraphicsEditorState::ClearSourceContext(), draw_source_preview_, FinishGesture(), yaze::editor::GraphicsEditorState::game_data, HOVER_HINT, ICON_MD_INFO_OUTLINE, yaze::editor::PixelSelection::is_floating, yaze::editor::GraphicsEditorState::selection, yaze::editor::GraphicsEditorState::SelectSourceTarget(), show_source_preview_, yaze::editor::GraphicsEditorState::source_context, yaze::editor::GraphicsEditorState::SourceTarget(), and state_.
Referenced by Update().
|
private |
Definition at line 160 of file pixel_editor_panel.cc.
References context_sheet_, yaze::gfx::Bitmap::Create(), yaze::gfx::Arena::CREATE, yaze::editor::GraphicsEditorState::current_sheet_id, DisplayPalette(), yaze::gfx::Arena::Get(), yaze::gfx::Bitmap::is_active(), yaze::gfx::Arena::mutable_gfx_sheets(), yaze::gfx::Bitmap::palette(), yaze::gfx::Arena::QueueTextureCommand(), yaze::gfx::Bitmap::set_data(), yaze::gfx::Bitmap::SetPaletteWithTransparent(), yaze::gfx::SnesPalette::size(), yaze::editor::GraphicsEditorState::SourceTarget(), state_, yaze::gfx::Bitmap::texture(), yaze::gfx::Arena::UPDATE, and yaze::gfx::Bitmap::vector().
Referenced by DrawCanvas(), and DrawMiniMap().
|
private |
Definition at line 136 of file pixel_editor_panel.cc.
References yaze::editor::GraphicsEditorState::current_sheet_id, yaze::gfx::Arena::Get(), yaze::platform::GetSurfacePalette(), yaze::gfx::Arena::gfx_sheets(), yaze::editor::GraphicsEditorState::SourceTarget(), and state_.
Referenced by CurrentSheetColors(), DisplaySheet(), DrawColorPicker(), DrawPixelInfoTooltip(), and EndSelection().
|
private |
Draw the toolbar with tool selection.
Definition at line 303 of file pixel_editor_panel.cc.
References yaze::gui::AutoRegisterLastItem(), yaze::editor::GraphicsEditorState::brush_size, yaze::editor::UndoManager::CanRedo(), yaze::editor::UndoManager::CanUndo(), yaze::gui::CenteredIconButton(), yaze::editor::GraphicsEditorState::current_tool, yaze::gui::GetPrimaryVec4(), yaze::editor::GraphicsEditorState::GetToolName(), HasActiveStroke(), history_error_, HOVER_HINT, ICON_MD_AUTO_FIX_HIGH, ICON_MD_BRUSH, ICON_MD_COLORIZE, ICON_MD_CROP_SQUARE, ICON_MD_DRAW, ICON_MD_FORMAT_COLOR_FILL, ICON_MD_HORIZONTAL_RULE, ICON_MD_PAN_TOOL, ICON_MD_REDO, ICON_MD_SELECT_ALL, ICON_MD_UNDO, yaze::editor::kBrush, yaze::editor::kEraser, yaze::editor::kEyedropper, yaze::editor::kFill, yaze::editor::kHand, yaze::editor::kLine, yaze::editor::kPencil, yaze::editor::kRectangle, yaze::editor::kSelect, open_scratch_, yaze::editor::UndoManager::Redo(), redo_, yaze::editor::GraphicsEditorState::SetTool(), state_, yaze::editor::UndoManager::Undo(), undo_, and undo_manager_.
Referenced by Update().
|
private |
Draw zoom and view controls.
Definition at line 399 of file pixel_editor_panel.cc.
References DrawMiniMap(), yaze::editor::GraphicsEditorState::show_brush_preview, yaze::editor::GraphicsEditorState::show_cursor_crosshair, yaze::editor::GraphicsEditorState::show_grid, yaze::editor::GraphicsEditorState::show_pixel_grid, yaze::editor::GraphicsEditorState::show_tile_boundaries, yaze::editor::GraphicsEditorState::show_transparency_grid, and state_.
Referenced by Update().
|
private |
Draw the main editing canvas.
Definition at line 411 of file pixel_editor_panel.cc.
References yaze::gui::BeginThemedTabBar(), canvas_, yaze::editor::GraphicsEditorState::CloseSheet(), yaze::editor::GraphicsEditorState::current_sheet_id, yaze::editor::GraphicsEditorState::current_tool, cursor_in_canvas_, DisplaySheet(), yaze::gui::Canvas::draw_list(), yaze::gui::Canvas::DrawBackground(), DrawBrushPreview(), DrawCursorCrosshair(), DrawFloatingPaste(), yaze::gui::Canvas::DrawGrid(), yaze::gui::Canvas::DrawOverlay(), DrawPixelGrids(), DrawPixelInfoTooltip(), DrawTileHighlight(), DrawTransparencyGrid(), yaze::gui::EndThemedTabBar(), FinishGesture(), fit_canvas_requested_, yaze::gfx::Arena::Get(), yaze::gfx::Arena::gfx_sheets(), HandleCanvasInput(), yaze::editor::PixelSelection::height, yaze::editor::PixelSelection::is_active, is_drawing_, yaze::editor::kBrush, yaze::editor::kEraser, yaze::editor::kLine, yaze::editor::kRectangle, yaze::editor::GraphicsEditorState::modified_sheets, yaze::editor::GraphicsEditorState::open_sheets, PixelToScreen(), preview_end_, yaze::editor::GraphicsEditorState::requested_sheet_tab, yaze::editor::GraphicsEditorState::selection, yaze::editor::GraphicsEditorState::SetZoom(), yaze::editor::GraphicsEditorState::show_brush_preview, yaze::editor::GraphicsEditorState::show_cursor_crosshair, yaze::editor::GraphicsEditorState::show_grid, yaze::editor::GraphicsEditorState::show_pixel_info_tooltip, show_tool_preview_, yaze::editor::GraphicsEditorState::show_transparency_grid, state_, tool_start_pixel_, yaze::editor::PixelSelection::width, yaze::editor::PixelSelection::x, yaze::editor::PixelSelection::y, yaze::gui::Canvas::zero_point(), and yaze::editor::GraphicsEditorState::zoom_level.
Referenced by Update().
|
private |
Draw the color palette picker.
Definition at line 726 of file pixel_editor_panel.cc.
References apply_palette_reorder_, yaze::gui::AutoRegisterLastItem(), yaze::gui::ConvertSnesColorToImVec4(), yaze::editor::GraphicsEditorState::current_color_index, DisplayPalette(), yaze::editor::PaletteReorderControl::Draw(), DrawIndexSwapControls(), DrawPaletteRowPicker(), yaze::gui::GetSelectedColor(), HasActiveStroke(), HOVER_HINT, yaze::editor::GraphicsEditorState::open_sheets, palette_reorder_, and state_.
Referenced by Update().
|
private |
Definition at line 822 of file pixel_editor_panel.cc.
References yaze::editor::ApplyPixelIndexPermutation(), yaze::gui::AutoRegisterLastItem(), yaze::editor::GraphicsEditorState::current_sheet_id, HasActiveStroke(), yaze::editor::PixelSelection::height, index_swap_status_, yaze::editor::PixelSelection::is_active, yaze::editor::PixelSelection::is_floating, yaze::editor::MakePixelIndexRectangleSelection(), yaze::editor::GraphicsEditorState::selection, yaze::editor::GraphicsEditorState::source_context, state_, swap_from_id_, swap_scope_, swap_to_id_, undo_manager_, and yaze::editor::PixelSelection::width.
Referenced by DrawColorPicker().
|
private |
Draw the status bar with cursor position.
Definition at line 914 of file pixel_editor_panel.cc.
References yaze::editor::TileHighlight::active, yaze::gui::AutoRegisterLastItem(), yaze::gui::CenteredIconButton(), yaze::editor::GraphicsEditorState::current_color_index, yaze::editor::GraphicsEditorState::current_sheet_id, cursor_in_canvas_, cursor_x_, cursor_y_, fit_canvas_requested_, yaze::editor::GraphicsEditorState::GetToolName(), history_error_, HOVER_HINT, ICON_MD_ZOOM_IN, ICON_MD_ZOOM_OUT, yaze::editor::GraphicsEditorState::modified_sheets, yaze::editor::GraphicsEditorState::SetZoom(), yaze::editor::TileHighlight::sheet_id, state_, yaze::editor::GraphicsEditorState::tile_highlight, yaze::editor::TileHighlight::tile_index, yaze::editor::GraphicsEditorState::zoom_level, yaze::editor::GraphicsEditorState::ZoomIn(), and yaze::editor::GraphicsEditorState::ZoomOut().
Referenced by Update().
|
private |
Draw the mini navigation map.
Definition at line 886 of file pixel_editor_panel.cc.
References DisplaySheet(), yaze::editor::GraphicsEditorState::open_sheets, and state_.
Referenced by DrawViewControls().
|
private |
Handle canvas mouse input for current tool.
Definition at line 980 of file pixel_editor_panel.cc.
References ApplyBrush(), ApplyEraser(), ApplyEyedropper(), ApplyFill(), ApplyPencil(), BeginSelection(), BeginStroke(), yaze::editor::GraphicsEditorState::current_sheet_id, yaze::editor::GraphicsEditorState::current_tool, cursor_in_canvas_, cursor_x_, cursor_y_, FinishGesture(), gesture_tool_, yaze::gfx::Arena::Get(), HandleFloatingPasteInput(), HandlePanInput(), is_drawing_, yaze::editor::kBrush, yaze::editor::kEraser, yaze::editor::kEyedropper, yaze::editor::kFill, yaze::editor::kLine, yaze::editor::kPencil, yaze::editor::kRectangle, yaze::editor::kSelect, last_mouse_pixel_, yaze::gfx::Arena::mutable_gfx_sheets(), preview_end_, ScreenToPixel(), show_tool_preview_, state_, tool_start_pixel_, and UpdateSelection().
Referenced by DrawCanvas().
|
private |
Apply pencil tool at position.
Definition at line 1111 of file pixel_editor_panel.cc.
References yaze::editor::GraphicsEditorState::current_color_index, ShowStrokeChanges(), state_, and StrokeEdit().
Referenced by HandleCanvasInput().
|
private |
Apply brush tool at position.
Definition at line 1119 of file pixel_editor_panel.cc.
References yaze::editor::GraphicsEditorState::brush_size, yaze::editor::GraphicsEditorState::current_color_index, ShowStrokeChanges(), state_, and StrokeEdit().
Referenced by HandleCanvasInput().
|
private |
Apply eraser tool at position.
Definition at line 1135 of file pixel_editor_panel.cc.
References yaze::editor::GraphicsEditorState::brush_size, ShowStrokeChanges(), state_, and StrokeEdit().
Referenced by HandleCanvasInput().
|
private |
Apply flood fill starting at position.
Definition at line 1151 of file pixel_editor_panel.cc.
References yaze::editor::GraphicsEditorState::current_color_index, ShowStrokeChanges(), state_, and StrokeEdit().
Referenced by HandleCanvasInput().
|
private |
Apply eyedropper tool at position.
Definition at line 1201 of file pixel_editor_panel.cc.
References yaze::editor::GraphicsEditorState::current_color_index, yaze::editor::GraphicsEditorState::current_sheet_id, yaze::gfx::Arena::Get(), yaze::gfx::Arena::gfx_sheets(), and state_.
Referenced by HandleCanvasInput().
|
private |
Draw line from start to end.
Definition at line 1209 of file pixel_editor_panel.cc.
References yaze::editor::GraphicsEditorState::current_color_index, ShowStrokeChanges(), state_, and StrokeEdit().
Referenced by FinishGesture().
|
private |
Draw rectangle from start to end.
Definition at line 1243 of file pixel_editor_panel.cc.
References yaze::editor::GraphicsEditorState::current_color_index, ShowStrokeChanges(), state_, and StrokeEdit().
Referenced by FinishGesture().
|
private |
Start a new selection.
Definition at line 1279 of file pixel_editor_panel.cc.
References yaze::editor::PixelSelection::height, yaze::editor::PixelSelection::is_active, yaze::editor::GraphicsEditorState::is_selecting, yaze::editor::GraphicsEditorState::selection, state_, yaze::editor::PixelSelection::width, yaze::editor::PixelSelection::x, and yaze::editor::PixelSelection::y.
Referenced by HandleCanvasInput().
|
private |
Update selection during drag.
Definition at line 1288 of file pixel_editor_panel.cc.
References yaze::editor::PixelSelection::height, yaze::editor::GraphicsEditorState::selection, state_, tool_start_pixel_, yaze::editor::PixelSelection::width, yaze::editor::PixelSelection::x, and yaze::editor::PixelSelection::y.
Referenced by HandleCanvasInput().
|
private |
Finalize the selection.
Definition at line 1298 of file pixel_editor_panel.cc.
References yaze::editor::GraphicsEditorState::current_sheet_id, DisplayPalette(), yaze::gfx::Arena::Get(), yaze::gfx::Arena::gfx_sheets(), yaze::editor::PixelSelection::height, yaze::editor::GraphicsEditorState::is_selecting, yaze::editor::PixelSelection::palette, yaze::editor::PixelSelection::pixel_data, yaze::editor::GraphicsEditorState::selection, state_, yaze::editor::PixelSelection::width, yaze::editor::PixelSelection::x, and yaze::editor::PixelSelection::y.
Referenced by FinishGesture().
|
private |
Copy selection to clipboard.
Definition at line 1323 of file pixel_editor_panel.cc.
|
private |
Paste clipboard at position.
Definition at line 1327 of file pixel_editor_panel.cc.
References BeginStroke(), EndStroke(), yaze::editor::PixelSelection::height, yaze::editor::PixelSelection::pixel_data, yaze::editor::GraphicsEditorState::selection, ShowStrokeChanges(), state_, StrokeEdit(), and yaze::editor::PixelSelection::width.
|
private |
Flip selection horizontally.
Definition at line 1348 of file pixel_editor_panel.cc.
References yaze::editor::PixelSelection::height, yaze::editor::PixelSelection::pixel_data, yaze::editor::GraphicsEditorState::selection, state_, and yaze::editor::PixelSelection::width.
|
private |
Flip selection vertically.
Definition at line 1364 of file pixel_editor_panel.cc.
References yaze::editor::PixelSelection::height, yaze::editor::PixelSelection::pixel_data, yaze::editor::GraphicsEditorState::selection, state_, and yaze::editor::PixelSelection::width.
|
private |
Starts a stroke on the current sheet. Pixel writes go to the session's GraphicsSheetStore until EndStroke().
Definition at line 1380 of file pixel_editor_panel.cc.
References yaze::editor::ActiveSheetStore(), yaze::editor::GraphicsEditorState::current_sheet_id, EndStroke(), state_, and stroke_.
Referenced by CommitFloatingPaste(), CutToSystemClipboard(), HandleCanvasInput(), PasteSelection(), and StrokeEdit().
|
private |
Ends the stroke: the sheet's store revision changes once and one GraphicsPixelEditAction (the changed pixels) is pushed for undo.
Definition at line 1407 of file pixel_editor_panel.cc.
References yaze::editor::SheetPixelDiff::empty(), yaze::editor::MakeSheetPixelDiff(), yaze::editor::GraphicsEditorState::MarkSheetModified(), yaze::editor::UndoManager::Push(), yaze::editor::RefreshArenaSheet(), state_, stroke_, and undo_manager_.
Referenced by BeginStroke(), CommitFloatingPaste(), CutToSystemClipboard(), FinishGesture(), and PasteSelection().
|
private |
The stroke's edit on the current sheet (starting one if needed), or null when the sheet cannot be edited: graphics are not loaded, or the Arena shows another open ROM's sheets.
Definition at line 1392 of file pixel_editor_panel.cc.
References BeginStroke(), yaze::editor::GraphicsEditorState::current_sheet_id, state_, and stroke_.
Referenced by ApplyBrush(), ApplyEraser(), ApplyFill(), ApplyPencil(), CommitFloatingPaste(), CutToSystemClipboard(), DrawLine(), DrawRectangle(), and PasteSelection().
|
private |
After pixel writes: refresh the Arena copy and mark the sheet modified.
Definition at line 1399 of file pixel_editor_panel.cc.
References yaze::editor::GraphicsEditorState::MarkSheetModified(), yaze::editor::RefreshArenaSheet(), state_, and stroke_.
Referenced by ApplyBrush(), ApplyEraser(), ApplyFill(), ApplyPencil(), CommitFloatingPaste(), CutToSystemClipboard(), DrawLine(), DrawRectangle(), and PasteSelection().
|
private |
Convert screen coordinates to pixel coordinates.
Definition at line 1775 of file pixel_editor_panel.cc.
References canvas_, state_, yaze::gui::Canvas::zero_point(), and yaze::editor::GraphicsEditorState::zoom_level.
Referenced by HandleCanvasInput().
|
private |
Convert pixel coordinates to screen coordinates.
Definition at line 1781 of file pixel_editor_panel.cc.
References canvas_, state_, yaze::gui::Canvas::zero_point(), and yaze::editor::GraphicsEditorState::zoom_level.
Referenced by DrawBrushPreview(), DrawCanvas(), DrawCursorCrosshair(), DrawFloatingPaste(), and DrawTileHighlight().
|
private |
Draw checkerboard pattern for transparent pixels.
Definition at line 574 of file pixel_editor_panel.cc.
References canvas_, yaze::gui::Canvas::draw_list(), and yaze::gui::Canvas::zero_point().
Referenced by DrawCanvas().
|
private |
Draw crosshair at cursor position.
Definition at line 596 of file pixel_editor_panel.cc.
References canvas_, yaze::gui::Canvas::canvas_size(), cursor_x_, cursor_y_, yaze::gui::Canvas::draw_list(), PixelToScreen(), state_, yaze::gui::Canvas::zero_point(), and yaze::editor::GraphicsEditorState::zoom_level.
Referenced by DrawCanvas().
|
private |
Draw brush size preview circle.
Definition at line 622 of file pixel_editor_panel.cc.
References yaze::editor::GraphicsEditorState::brush_size, canvas_, yaze::editor::GraphicsEditorState::current_tool, cursor_x_, cursor_y_, yaze::gui::Canvas::draw_list(), yaze::editor::kEraser, PixelToScreen(), state_, and yaze::editor::GraphicsEditorState::zoom_level.
Referenced by DrawCanvas().
|
private |
Draw tooltip with pixel information.
Definition at line 647 of file pixel_editor_panel.cc.
References cursor_x_, cursor_y_, DisplayPalette(), yaze::gfx::Bitmap::GetPixel(), yaze::gfx::Bitmap::height(), and yaze::gfx::Bitmap::width().
Referenced by DrawCanvas().
|
private |
Draw a transient highlight for a target tile.
Definition at line 676 of file pixel_editor_panel.cc.
References yaze::editor::TileHighlight::active, canvas_, yaze::editor::TileHighlight::Clear(), yaze::editor::GraphicsEditorState::current_sheet_id, yaze::gui::Canvas::draw_list(), yaze::editor::TileHighlight::duration, yaze::gui::GetSelectedColor(), yaze::editor::TileHighlight::label, PixelToScreen(), yaze::editor::TileHighlight::sheet_id, yaze::editor::TileHighlight::start_time, state_, yaze::editor::GraphicsEditorState::tile_highlight, yaze::editor::TileHighlight::tile_index, and yaze::gfx::Bitmap::width().
Referenced by DrawCanvas().
|
private |
Definition at line 1492 of file pixel_editor_panel.cc.
References CancelFloatingPaste(), ClampFloatingPaste(), CommitFloatingPaste(), yaze::editor::PixelSelection::is_floating, yaze::editor::GraphicsEditorState::selection, state_, and yaze::editor::PixelSelection::x.
Referenced by Update().
|
private |
Definition at line 1520 of file pixel_editor_panel.cc.
References CancelFloatingPaste(), clipboard_status_, clipboard_status_is_error_, CommitFloatingPaste(), CopyToSystemClipboard(), yaze::gui::GetErrorColor(), yaze::gui::GetInfoColor(), HOVER_HINT, ICON_MD_CHECK, ICON_MD_CLOSE, ICON_MD_CONTENT_COPY, ICON_MD_CONTENT_PASTE, yaze::util::ImageClipboardSupported(), yaze::editor::PixelSelection::is_floating, paste_skip_color0_, PasteFromSystemClipboard(), yaze::editor::GraphicsEditorState::selection, state_, and yaze::gui::ToolbarIconButton().
Referenced by Update().
|
private |
Definition at line 1745 of file pixel_editor_panel.cc.
References canvas_, CurrentSheetColors(), yaze::gui::Canvas::draw_list(), yaze::gui::GetInfoColor(), paste_skip_color0_, PixelToScreen(), yaze::editor::GraphicsEditorState::selection, and state_.
Referenced by DrawCanvas().
|
private |
Definition at line 1716 of file pixel_editor_panel.cc.
References ClampFloatingPaste(), CommitFloatingPaste(), cursor_x_, cursor_y_, dragging_paste_, paste_drag_dx_, paste_drag_dy_, yaze::editor::GraphicsEditorState::selection, state_, and yaze::editor::PixelSelection::x.
Referenced by HandleCanvasInput().
|
private |
Definition at line 1677 of file pixel_editor_panel.cc.
References BeginStroke(), clipboard_status_, clipboard_status_is_error_, dragging_paste_, EndStroke(), paste_skip_color0_, yaze::editor::GraphicsEditorState::selection, ShowStrokeChanges(), state_, and StrokeEdit().
Referenced by DrawClipboardControls(), HandleFloatingPasteInput(), and HandleFloatingPasteKeys().
|
private |
Definition at line 1709 of file pixel_editor_panel.cc.
References yaze::editor::PixelSelection::Clear(), clipboard_status_, clipboard_status_is_error_, dragging_paste_, yaze::editor::GraphicsEditorState::selection, and state_.
Referenced by DrawClipboardControls(), and HandleFloatingPasteKeys().
|
private |
Definition at line 1668 of file pixel_editor_panel.cc.
References yaze::editor::GraphicsEditorState::current_sheet_id, yaze::gfx::Arena::Get(), yaze::gfx::Arena::gfx_sheets(), yaze::editor::GraphicsEditorState::selection, state_, and yaze::editor::PixelSelection::x.
Referenced by HandleFloatingPasteInput(), HandleFloatingPasteKeys(), and PasteFromSystemClipboard().
|
private |
Definition at line 1473 of file pixel_editor_panel.cc.
References DisplayPalette().
Referenced by CopyToSystemClipboard(), DrawFloatingPaste(), and PasteFromSystemClipboard().
|
private |
Definition at line 1427 of file pixel_editor_panel.cc.
References yaze::editor::GraphicsEditorState::current_tool, yaze::editor::kHand, and state_.
Referenced by HandleCanvasInput().
|
private |
Definition at line 1462 of file pixel_editor_panel.cc.
References yaze::editor::DrawGraphicsPreviewPaletteSelector(), HOVER_HINT, yaze::editor::kInline, yaze::editor::GraphicsEditorState::SourceTarget(), and state_.
Referenced by DrawColorPicker().
|
private |
Definition at line 1440 of file pixel_editor_panel.cc.
References canvas_, yaze::gui::Canvas::draw_list(), yaze::gui::GetInfoColor(), yaze::editor::GraphicsEditorState::show_pixel_grid, yaze::editor::GraphicsEditorState::show_tile_boundaries, state_, yaze::gui::Canvas::zero_point(), and yaze::editor::GraphicsEditorState::zoom_level.
Referenced by DrawCanvas().
|
friend |
Definition at line 288 of file pixel_editor_panel.h.
|
friend |
Definition at line 289 of file pixel_editor_panel.h.
|
private |
Definition at line 101 of file pixel_editor_panel.h.
Referenced by DrawToolbar(), and SetHistoryCallbacks().
|
private |
Definition at line 102 of file pixel_editor_panel.h.
Referenced by DrawToolbar(), and SetHistoryCallbacks().
|
private |
Definition at line 103 of file pixel_editor_panel.h.
Referenced by DrawStatusBar(), and DrawToolbar().
|
private |
Definition at line 104 of file pixel_editor_panel.h.
Referenced by FinishGesture(), and HandleCanvasInput().
|
private |
Definition at line 105 of file pixel_editor_panel.h.
Referenced by DrawColorPicker().
|
private |
Definition at line 106 of file pixel_editor_panel.h.
Referenced by DrawColorPicker(), and SetPaletteReorderCallback().
|
private |
Definition at line 111 of file pixel_editor_panel.h.
Referenced by DisplaySheet().
|
private |
Definition at line 112 of file pixel_editor_panel.h.
Referenced by DrawCanvas(), DrawStatusBar(), and Update().
|
private |
Definition at line 113 of file pixel_editor_panel.h.
Referenced by DrawSourceContext(), ShowSourcePreview(), and Update().
|
private |
Definition at line 114 of file pixel_editor_panel.h.
Referenced by DrawSourceContext(), SetSourcePreviewCallback(), and Update().
|
private |
Definition at line 115 of file pixel_editor_panel.h.
Referenced by DrawToolbar(), and SetScratchCallback().
|
private |
Definition at line 116 of file pixel_editor_panel.h.
Referenced by SetSheetBrowserCallbacks(), and Update().
|
private |
Definition at line 117 of file pixel_editor_panel.h.
Referenced by SetSheetBrowserCallbacks(), and Update().
|
private |
Definition at line 139 of file pixel_editor_panel.h.
Referenced by DrawIndexSwapControls().
|
private |
Definition at line 140 of file pixel_editor_panel.h.
Referenced by DrawIndexSwapControls().
|
private |
Definition at line 141 of file pixel_editor_panel.h.
Referenced by DrawIndexSwapControls().
|
private |
Definition at line 142 of file pixel_editor_panel.h.
Referenced by DrawIndexSwapControls().
|
private |
Definition at line 291 of file pixel_editor_panel.h.
Referenced by ApplyBrush(), ApplyEraser(), ApplyEyedropper(), ApplyFill(), ApplyPencil(), BeginSelection(), BeginStroke(), CancelFloatingPaste(), ClampFloatingPaste(), CommitFloatingPaste(), CopyToSystemClipboard(), CutToSystemClipboard(), DisplayPalette(), DisplaySheet(), DrawBrushPreview(), DrawCanvas(), DrawClipboardControls(), DrawColorPicker(), DrawCursorCrosshair(), DrawFloatingPaste(), DrawIndexSwapControls(), DrawLine(), DrawMiniMap(), DrawPaletteRowPicker(), DrawPixelGrids(), DrawRectangle(), DrawSourceContext(), DrawStatusBar(), DrawTileHighlight(), DrawToolbar(), DrawViewControls(), EndSelection(), EndStroke(), FinishGesture(), FlipSelectionHorizontal(), FlipSelectionVertical(), HandleCanvasInput(), HandleFloatingPasteInput(), HandleFloatingPasteKeys(), HandlePanInput(), PasteFromSystemClipboard(), PasteSelection(), PixelToScreen(), ScreenToPixel(), ShowStrokeChanges(), StrokeEdit(), Update(), and UpdateSelection().
|
private |
Definition at line 292 of file pixel_editor_panel.h.
Referenced by SetRom().
|
private |
Definition at line 293 of file pixel_editor_panel.h.
Referenced by DrawIndexSwapControls(), DrawToolbar(), and EndStroke().
|
private |
Definition at line 294 of file pixel_editor_panel.h.
Referenced by DrawBrushPreview(), DrawCanvas(), DrawCursorCrosshair(), DrawFloatingPaste(), DrawPixelGrids(), DrawTileHighlight(), DrawTransparencyGrid(), PixelToScreen(), and ScreenToPixel().
|
private |
Definition at line 298 of file pixel_editor_panel.h.
Referenced by BeginStroke(), EndStroke(), FinishGesture(), HasActiveStroke(), ShowStrokeChanges(), and StrokeEdit().
|
private |
Definition at line 301 of file pixel_editor_panel.h.
Referenced by DrawCanvas(), FinishGesture(), FinishReleasedGesture(), and HandleCanvasInput().
|
private |
Definition at line 302 of file pixel_editor_panel.h.
Referenced by FinishReleasedGesture(), and HandleCanvasInput().
|
private |
Definition at line 303 of file pixel_editor_panel.h.
Referenced by DrawCanvas(), FinishGesture(), HandleCanvasInput(), and UpdateSelection().
|
private |
Definition at line 306 of file pixel_editor_panel.h.
Referenced by DrawCanvas(), FinishGesture(), and HandleCanvasInput().
|
private |
Definition at line 307 of file pixel_editor_panel.h.
Referenced by DrawCanvas(), and HandleCanvasInput().
|
private |
Definition at line 310 of file pixel_editor_panel.h.
Referenced by DrawBrushPreview(), DrawCursorCrosshair(), DrawPixelInfoTooltip(), DrawStatusBar(), FinishGesture(), FinishReleasedGesture(), HandleCanvasInput(), and HandleFloatingPasteInput().
|
private |
Definition at line 311 of file pixel_editor_panel.h.
Referenced by DrawBrushPreview(), DrawCursorCrosshair(), DrawPixelInfoTooltip(), DrawStatusBar(), FinishGesture(), FinishReleasedGesture(), HandleCanvasInput(), and HandleFloatingPasteInput().
|
private |
Definition at line 312 of file pixel_editor_panel.h.
Referenced by DrawCanvas(), DrawStatusBar(), and HandleCanvasInput().
|
private |
Definition at line 326 of file pixel_editor_panel.h.
Referenced by CancelFloatingPaste(), CommitFloatingPaste(), CopyToSystemClipboard(), CutToSystemClipboard(), DrawClipboardControls(), and PasteFromSystemClipboard().
|
private |
Definition at line 327 of file pixel_editor_panel.h.
Referenced by CancelFloatingPaste(), CommitFloatingPaste(), CopyToSystemClipboard(), CutToSystemClipboard(), DrawClipboardControls(), and PasteFromSystemClipboard().
|
private |
Definition at line 328 of file pixel_editor_panel.h.
Referenced by CommitFloatingPaste(), DrawClipboardControls(), and DrawFloatingPaste().
|
private |
Definition at line 329 of file pixel_editor_panel.h.
Referenced by CancelFloatingPaste(), CommitFloatingPaste(), and HandleFloatingPasteInput().
|
private |
Definition at line 330 of file pixel_editor_panel.h.
Referenced by HandleFloatingPasteInput().
|
private |
Definition at line 331 of file pixel_editor_panel.h.
Referenced by HandleFloatingPasteInput().