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

Modern, robust canvas for drawing and manipulating graphics. More...

#include <canvas.h>

Public Types

using CanvasMenuItem = gui::CanvasMenuItem
 

Public Member Functions

 Canvas ()
 
 ~Canvas ()
 
void Init (const CanvasConfig &config)
 Initialize canvas with configuration (post-construction) Preferred over constructor parameters for new code.
 
void Init (const std::string &id, ImVec2 canvas_size=ImVec2(0, 0))
 
 Canvas (const std::string &id)
 
 Canvas (const std::string &id, ImVec2 canvas_size)
 
 Canvas (const std::string &id, ImVec2 canvas_size, CanvasGridSize grid_size)
 
 Canvas (const std::string &id, ImVec2 canvas_size, CanvasGridSize grid_size, float global_scale)
 
 Canvas (gfx::IRenderer *renderer)
 
 Canvas (gfx::IRenderer *renderer, const std::string &id)
 
 Canvas (gfx::IRenderer *renderer, const std::string &id, ImVec2 canvas_size)
 
 Canvas (gfx::IRenderer *renderer, const std::string &id, ImVec2 canvas_size, CanvasGridSize grid_size)
 
 Canvas (gfx::IRenderer *renderer, const std::string &id, ImVec2 canvas_size, CanvasGridSize grid_size, float global_scale)
 
void SetRenderer (gfx::IRenderer *renderer)
 
gfx::IRenderer * renderer () const
 
void SetGridSize (CanvasGridSize grid_size)
 
void SetCustomGridStep (float step)
 
void SetCanvasGridSize (CanvasGridSize grid_size)
 
CanvasGridSize grid_size () const
 
void UpdateColorPainter (gfx::IRenderer *renderer, gfx::Bitmap &bitmap, const ImVec4 &color, const std::function< void()> &event, int tile_size, float scale=1.0f)
 
void UpdateInfoGrid (ImVec2 bg_size, float grid_size=64.0f, int label_id=0)
 
void Begin (ImVec2 canvas_size=ImVec2(0, 0))
 Begin canvas rendering (ImGui-style)
 
void Begin (const CanvasFrameOptions &options)
 
void End ()
 End canvas rendering (ImGui-style)
 
void End (const CanvasFrameOptions &options)
 
void DrawBackground (ImVec2 canvas_size=ImVec2(0, 0), std::optional< ImVec2 > viewport_size=std::nullopt)
 
void DrawContextMenu ()
 
void AddContextMenuItem (const gui::CanvasMenuItem &item)
 
void ClearContextMenuItems ()
 
void SetContextMenuOpenCallback (std::function< bool(const ImVec2 &)> callback)
 
bool PrepareContextMenu (const ImVec2 &screen_position)
 
std::optional< ImVec2 > context_menu_open_screen_position () const
 
CanvasMenuDefinition & editor_menu ()
 
const CanvasMenuDefinition & editor_menu () const
 
void SetContextMenuEnabled (bool enabled)
 
void SetShowBuiltinContextMenu (bool show)
 
void OpenPersistentPopup (const std::string &popup_id, std::function< void()> render_callback)
 
void ClosePersistentPopup (const std::string &popup_id)
 
void RenderPersistentPopups ()
 
PopupRegistry & GetPopupRegistry ()
 
const PopupRegistry & GetPopupRegistry () const
 
void ShowAdvancedCanvasProperties ()
 
void ShowScalingControls ()
 
void SetZoomToFit (const gfx::Bitmap &bitmap)
 
void ResetView ()
 
void ApplyConfigSnapshot (const CanvasConfig &snapshot)
 
void ApplyScaleSnapshot (const CanvasConfig &snapshot)
 
CanvasConfig & GetConfig ()
 
const CanvasConfig & GetConfig () const
 
CanvasSelection & GetSelection ()
 
const CanvasSelection & GetSelection () const
 
void ClearSelection ()
 
void InitializePaletteEditor (Rom *rom)
 
void ShowPaletteEditor ()
 
void ShowColorAnalysis ()
 
bool ApplyROMPalette (int group_index, int palette_index)
 
void ShowBppFormatSelector ()
 
void ShowBppAnalysis ()
 
void ShowBppConversionDialog ()
 
bool ConvertBitmapFormat (gfx::BppFormat target_format)
 
gfx::BppFormat GetCurrentBppFormat () const
 
void InitializeEnhancedComponents ()
 
void SetUsageMode (CanvasUsage usage)
 
auto usage_mode () const
 
void RecordCanvasOperation (const std::string &operation_name, double time_ms)
 
void ShowPerformanceUI ()
 
void ShowUsageReport ()
 
CanvasInteractionHandler & GetInteractionHandler ()
 
const CanvasInteractionHandler & GetInteractionHandler () const
 
CanvasAutomationAPI * GetAutomationAPI ()
 
void InitializeDefaults ()
 
void Cleanup ()
 
ImVec2 GetMinimumSize () const
 
ImVec2 GetPreferredSize () const
 
ImVec2 GetCurrentSize () const
 
void SetAutoResize (bool auto_resize)
 
bool IsAutoResize () const
 
void ReserveTableSpace (const std::string &label="")
 
bool BeginTableCanvas (const std::string &label="")
 
void EndTableCanvas ()
 
CanvasRuntime BeginInTable (const std::string &label, const CanvasFrameOptions &options)
 Begin canvas in table cell with frame options (modern API) Returns CanvasRuntime for stateless helper usage. Handles child sizing, scrollbars, and table integration.
 
void EndInTable (CanvasRuntime &runtime, const CanvasFrameOptions &options)
 
bool HasValidSelection () const
 
bool WasClicked (ImGuiMouseButton button=ImGuiMouseButton_Left) const
 
bool WasDoubleClicked (ImGuiMouseButton button=ImGuiMouseButton_Left) const
 
ImVec2 GetLastClickPosition () const
 
bool DrawTilePainter (const Bitmap &bitmap, int size, float scale=1.0f)
 
bool DrawSolidTilePainter (const ImVec4 &color, int size)
 
void DrawTileOnBitmap (int tile_size, gfx::Bitmap *bitmap, ImVec4 color)
 
void DrawOutline (int x, int y, int w, int h)
 
void DrawOutlineWithColor (int x, int y, int w, int h, ImVec4 color)
 
void DrawOutlineWithColor (int x, int y, int w, int h, uint32_t color)
 
void DrawRect (int x, int y, int w, int h, ImVec4 color)
 
void DrawText (const std::string &text, int x, int y)
 
void DrawGridLines (float grid_step)
 
void DrawInfoGrid (float grid_step=64.0f, int tile_id_offset=8, int label_id=0)
 
void DrawLayeredElements ()
 
int GetTileIdFromMousePos ()
 
void DrawCustomHighlight (float grid_step)
 
bool IsMouseHovering () const
 
void ZoomIn ()
 
void ZoomOut ()
 
const ImVector< ImVec2 > & points () const
 
ImVector< ImVec2 > * mutable_points ()
 
auto push_back (ImVec2 pos)
 
auto draw_list () const
 
auto zero_point () const
 
ImVec2 ToCanvasPos (ImVec2 local) const
 
auto scrolling () const
 
void set_scrolling (ImVec2 scroll)
 
auto drawn_tile_position () const
 
auto canvas_size () const
 
void set_global_scale (float scale)
 
void set_draggable (bool draggable)
 
bool IsSelectRectActive () const
 
const std::vector< ImVec2 > & GetSelectedTiles () const
 
ImVec2 GetSelectedTilePos () const
 
void SetSelectedTilePos (ImVec2 pos)
 
void SetCanvasSize (ImVec2 canvas_size)
 
float GetGlobalScale () const
 
void SetGlobalScale (float scale)
 
bool * GetCustomLabelsEnabled ()
 
float GetGridStep () const
 
void SetClampRectToLocalMaps (bool clamp)
 
bool GetClampRectToLocalMaps () const
 
float GetCanvasWidth () const
 
float GetCanvasHeight () const
 
auto select_rect_active () const
 
auto selected_tiles () const
 
auto selected_tile_pos () const
 
void set_selected_tile_pos (ImVec2 pos)
 
auto global_scale () const
 
auto custom_labels_enabled ()
 
auto custom_step () const
 
auto width () const
 
auto height () const
 
auto canvas_id () const
 
void DrawBitmap (Bitmap &bitmap, int border_offset, float scale)
 
void DrawBitmap (Bitmap &bitmap, int x_offset, int y_offset, float scale=1.0f, int alpha=255)
 
void DrawBitmap (Bitmap &bitmap, ImVec2 dest_pos, ImVec2 dest_size, ImVec2 src_pos, ImVec2 src_size)
 
void DrawBitmapTable (const BitmapTable &gfx_bin)
 
void DrawBitmapGroup (std::vector< int > &group, gfx::Tilemap &tilemap, int tile_size, float scale=1.0f, int local_map_size=0x200, ImVec2 total_map_size=ImVec2(0x1000, 0x1000))
 Draw group of bitmaps for multi-tile selection preview.
 
void DrawBitmapPreview (Bitmap &bitmap, const BitmapPreviewOptions &options)
 
bool DrawTilemapPainter (gfx::Tilemap &tilemap, int current_tile)
 
void DrawSelectRect (int current_map, int tile_size=0x10, float scale=1.0f)
 
bool DrawTileSelector (int size, int size_y=0)
 
void DrawGrid (float grid_step=64.0f, int tile_id_offset=8)
 
void DrawOverlay ()
 
auto labels (int i)
 
auto mutable_labels (int i)
 
auto set_current_labels (int i)
 
auto set_highlight_tile_id (int i)
 
auto mutable_selected_tiles ()
 
auto mutable_selected_points ()
 
auto selected_points () const
 
auto hover_mouse_pos () const
 
void set_rom (Rom *rom)
 
Rom * rom () const
 
void SetGameData (zelda3::GameData *game_data)
 
zelda3::GameData * game_data () const
 
void AddImageAt (ImTextureID texture, ImVec2 local_top_left, ImVec2 size)
 
void AddRectFilledAt (ImVec2 local_top_left, ImVec2 size, uint32_t color)
 
void AddTextAt (ImVec2 local_pos, const std::string &text, uint32_t color)
 

Public Attributes

std::unique_ptr< CanvasContextMenu > context_menu_
 
std::shared_ptr< CanvasUsageTracker > usage_tracker_
 
std::shared_ptr< CanvasPerformanceIntegration > performance_integration_
 
CanvasInteractionHandler interaction_handler_
 

Private Member Functions

void DrawContextMenuItem (const gui::CanvasMenuItem &item)
 
void SyncLegacyGeometryFromState ()
 
void EnsurePerformanceIntegration ()
 
CanvasRuntime BuildCurrentRuntime () const
 
CanvasExtensions & EnsureExtensions ()
 

Private Attributes

gfx::IRenderer * renderer_ = nullptr
 
CanvasConfig config_
 
CanvasSelection selection_
 
std::unique_ptr< CanvasExtensions > extensions_
 
CanvasState state_
 
bool is_hovered_ = false
 
bool refresh_graphics_ = false
 
CanvasMenuDefinition editor_menu_
 
bool context_menu_enabled_ = true
 
std::function< bool(const ImVec2 &) context_menu_open_callback_ )
 
PopupRegistry popup_registry_
 
int current_labels_ = 0
 
int highlight_tile_id = -1
 
uint16_t edit_palette_index_ = 0
 
uint64_t edit_palette_group_name_index_ = 0
 
uint64_t edit_palette_sub_index_ = 0
 
Bitmap * bitmap_ = nullptr
 
Rom * rom_ = nullptr
 
zelda3::GameData * game_data_ = nullptr
 
ImDrawList * draw_list_ = nullptr
 
ImVec2 scrolling_
 
ImVec2 canvas_sz_
 
ImVec2 canvas_p0_
 
ImVec2 canvas_p1_
 
ImVec2 drawn_tile_pos_
 
ImVec2 mouse_pos_in_canvas_
 
ImVector< ImVec2 > points_
 
ImVector< ImVector< std::string > > labels_
 
std::string canvas_id_ = "Canvas"
 
std::string context_id_ = "CanvasContext"
 
std::vector< ImVec2 > selected_tiles_
 
ImVector< ImVec2 > selected_points_
 
ImVec2 selected_tile_pos_ = ImVec2(-1, -1)
 
bool select_rect_active_ = false
 
float custom_step_ = 32.0f
 
float global_scale_ = 1.0f
 
bool enable_grid_ = true
 
bool enable_hex_tile_labels_ = false
 
bool enable_custom_labels_ = false
 
bool enable_context_menu_ = true
 
bool custom_canvas_size_ = false
 
bool draggable_ = false
 

Detailed Description

Modern, robust canvas for drawing and manipulating graphics.

Following ImGui design patterns, this Canvas class provides:

  • Modular configuration through CanvasConfig
  • Separate selection state management
  • Enhanced palette management integration
  • Performance-optimized rendering
  • Comprehensive context menu system

Definition at line 64 of file canvas.h.

Member Typedef Documentation

◆ CanvasMenuItem

Constructor & Destructor Documentation

◆ Canvas() [1/10]

yaze::gui::Canvas::Canvas ( )

Definition at line 108 of file canvas.cc.

References InitializeDefaults().

Here is the call graph for this function:

◆ ~Canvas()

yaze::gui::Canvas::~Canvas ( )

Definition at line 112 of file canvas.cc.

References labels_.

◆ Canvas() [2/10]

yaze::gui::Canvas::Canvas ( const std::string & id)
explicit

Definition at line 124 of file canvas.cc.

References Init().

Here is the call graph for this function:

◆ Canvas() [3/10]

yaze::gui::Canvas::Canvas ( const std::string & id,
ImVec2 canvas_size )
explicit

Definition at line 128 of file canvas.cc.

References canvas_size(), and Init().

Here is the call graph for this function:

◆ Canvas() [4/10]

yaze::gui::Canvas::Canvas ( const std::string & id,
ImVec2 canvas_size,
CanvasGridSize grid_size )
explicit

Definition at line 132 of file canvas.cc.

References canvas_size(), grid_size(), Init(), and SetGridSize().

Here is the call graph for this function:

◆ Canvas() [5/10]

yaze::gui::Canvas::Canvas ( const std::string & id,
ImVec2 canvas_size,
CanvasGridSize grid_size,
float global_scale )
explicit

◆ Canvas() [6/10]

yaze::gui::Canvas::Canvas ( gfx::IRenderer * renderer)
explicit

Definition at line 148 of file canvas.cc.

References renderer(), and SetRenderer().

Here is the call graph for this function:

◆ Canvas() [7/10]

yaze::gui::Canvas::Canvas ( gfx::IRenderer * renderer,
const std::string & id )
explicit

Definition at line 152 of file canvas.cc.

References Init(), renderer(), and SetRenderer().

Here is the call graph for this function:

◆ Canvas() [8/10]

yaze::gui::Canvas::Canvas ( gfx::IRenderer * renderer,
const std::string & id,
ImVec2 canvas_size )
explicit

Definition at line 157 of file canvas.cc.

References canvas_size(), Init(), renderer(), and SetRenderer().

Here is the call graph for this function:

◆ Canvas() [9/10]

yaze::gui::Canvas::Canvas ( gfx::IRenderer * renderer,
const std::string & id,
ImVec2 canvas_size,
CanvasGridSize grid_size )
explicit

Definition at line 164 of file canvas.cc.

References canvas_size(), grid_size(), Init(), renderer(), SetGridSize(), and SetRenderer().

◆ Canvas() [10/10]

yaze::gui::Canvas::Canvas ( gfx::IRenderer * renderer,
const std::string & id,
ImVec2 canvas_size,
CanvasGridSize grid_size,
float global_scale )
explicit

Member Function Documentation

◆ Init() [1/2]

◆ Init() [2/2]

void yaze::gui::Canvas::Init ( const std::string & id,
ImVec2 canvas_size = ImVec2(0, 0) )

◆ SetRenderer()

void yaze::gui::Canvas::SetRenderer ( gfx::IRenderer * renderer)
inline

Definition at line 95 of file canvas.h.

References renderer(), and renderer_.

Referenced by Canvas(), Canvas(), Canvas(), Canvas(), Canvas(), and yaze::gui::ScopedCanvas::ScopedCanvas().

Here is the call graph for this function:

◆ renderer()

gfx::IRenderer * yaze::gui::Canvas::renderer ( ) const
inline

Definition at line 96 of file canvas.h.

References renderer_.

Referenced by Canvas(), Canvas(), Canvas(), Canvas(), Canvas(), and SetRenderer().

◆ SetGridSize()

void yaze::gui::Canvas::SetGridSize ( CanvasGridSize grid_size)
inline

Definition at line 99 of file canvas.h.

References config_, custom_step_, grid_size(), yaze::gui::CanvasConfig::grid_step, yaze::gui::k16x16, yaze::gui::k32x32, yaze::gui::k64x64, and yaze::gui::k8x8.

Referenced by Canvas(), Canvas(), Canvas(), Canvas(), and SetCanvasGridSize().

Here is the call graph for this function:

◆ SetCustomGridStep()

void yaze::gui::Canvas::SetCustomGridStep ( float step)
inline

Definition at line 118 of file canvas.h.

References config_, custom_step_, and yaze::gui::CanvasConfig::grid_step.

Referenced by Begin().

◆ SetCanvasGridSize()

void yaze::gui::Canvas::SetCanvasGridSize ( CanvasGridSize grid_size)
inline

Definition at line 124 of file canvas.h.

References grid_size(), and SetGridSize().

Here is the call graph for this function:

◆ grid_size()

◆ UpdateColorPainter()

void yaze::gui::Canvas::UpdateColorPainter ( gfx::IRenderer * renderer,
gfx::Bitmap & bitmap,
const ImVec4 & color,
const std::function< void()> & event,
int tile_size,
float scale = 1.0f )

◆ UpdateInfoGrid()

void yaze::gui::Canvas::UpdateInfoGrid ( ImVec2 bg_size,
float grid_size = 64.0f,
int label_id = 0 )

Definition at line 694 of file canvas.cc.

References config_, DrawBackground(), DrawInfoGrid(), DrawOverlay(), yaze::gui::CanvasConfig::enable_custom_labels, enable_custom_labels_, and grid_size().

Here is the call graph for this function:

◆ Begin() [1/2]

void yaze::gui::Canvas::Begin ( ImVec2 canvas_size = ImVec2(0, 0))

Begin canvas rendering (ImGui-style)

Modern alternative to DrawBackground(). Handles:

  • Background and border rendering
  • Size calculation
  • Scroll/drag setup
  • Context menu

Usage:

canvas.Begin();
canvas.DrawBitmap(bitmap);
if (canvas.DrawTilePainter(tile, 16)) { ... }
canvas.End(); // Draws grid and overlay

Definition at line 607 of file canvas.cc.

References canvas_size(), DrawBackground(), and DrawContextMenu().

Referenced by yaze::gui::BeginCanvas(), BeginInTable(), yaze::gui::CanvasFrame::CanvasFrame(), yaze::gui::ScopedCanvas::ScopedCanvas(), yaze::gui::ScopedCanvas::ScopedCanvas(), and yaze::gui::ScopedCanvas::ScopedCanvas().

Here is the call graph for this function:

◆ Begin() [2/2]

◆ End() [1/2]

void yaze::gui::Canvas::End ( )

End canvas rendering (ImGui-style)

Modern alternative to manual DrawGrid() + DrawOverlay(). Automatically draws grid and overlay if enabled.

Definition at line 613 of file canvas.cc.

References config_, DrawGrid(), DrawOverlay(), yaze::gui::CanvasConfig::enable_grid, and RenderPersistentPopups().

Referenced by yaze::gui::EndCanvas(), yaze::gui::CanvasFrame::operator=(), yaze::gui::CanvasFrame::~CanvasFrame(), and yaze::gui::ScopedCanvas::~ScopedCanvas().

Here is the call graph for this function:

◆ End() [2/2]

◆ DrawBackground()

void yaze::gui::Canvas::DrawBackground ( ImVec2 canvas_size = ImVec2(0, 0),
std::optional< ImVec2 > viewport_size = std::nullopt )

Definition at line 702 of file canvas.cc.

References yaze::gui::ApplyScrollDelta(), yaze::gui::CalculateCanvasGeometry(), yaze::gui::CalculateMouseInCanvas(), canvas_id_, yaze::gui::CanvasGeometry::canvas_p0, yaze::gui::CanvasGeometry::canvas_p1, canvas_size(), yaze::gui::CanvasConfig::canvas_size, yaze::gui::CanvasGeometry::canvas_sz, yaze::gui::ComputeScrollForZoomAtScreenPos(), config_, draw_list_, enable_context_menu_, yaze::gui::CanvasState::geometry, global_scale_, yaze::gui::CanvasConfig::is_draggable, yaze::gui::CanvasState::is_hovered, is_hovered_, yaze::gui::LayoutHelpers::IsTouchDevice(), yaze::gui::kMouseFlags, yaze::gui::CanvasState::mouse_pos_in_canvas, mouse_pos_in_canvas_, yaze::gui::RenderCanvasBackground(), yaze::gui::CanvasGeometry::scaled_size, yaze::gui::CanvasGeometry::scrolling, yaze::gui::CanvasConfig::scrolling, scrolling_, set_global_scale(), state_, SyncLegacyGeometryFromState(), and yaze::gui::CanvasGeometry::viewport_size.

Referenced by Begin(), Begin(), yaze::gui::BeginCanvas(), yaze::gui::BitmapCanvasPipeline(), yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::SpriteEditor::DrawCurrentSheets(), yaze::editor::ScreenEditor::DrawDungeonMapScreen(), yaze::editor::ScreenEditor::DrawDungeonMapsEditor(), yaze::editor::MenuTilemapEditorUI::DrawMainCanvas(), yaze::editor::ScreenEditor::DrawOverworldMapEditor(), yaze::editor::anonymous_namespace{gfx_group_editor.cc}::DrawScaledSheet(), yaze::editor::SpriteEditor::DrawSpriteCanvas(), yaze::editor::ScreenEditor::DrawTitleScreenBG1Canvas(), yaze::editor::ScreenEditor::DrawTitleScreenBG2Canvas(), yaze::editor::ScreenEditor::DrawTitleScreenBlocksetSelector(), yaze::editor::ScreenEditor::DrawTitleScreenCompositeCanvas(), yaze::editor::SpriteEditor::DrawZSpriteOnCanvas(), yaze::gui::GraphicsBinCanvasPipeline(), yaze::gui::TileSelectorWidget::Render(), yaze::gui::TableCanvasPipeline(), UpdateColorPainter(), and UpdateInfoGrid().

◆ DrawContextMenu()

void yaze::gui::Canvas::DrawContextMenu ( )

Definition at line 823 of file canvas.cc.

References ApplyConfigSnapshot(), ApplyScaleSnapshot(), yaze::gui::CanvasConfig::auto_resize, bitmap_, canvas_id_, canvas_p0_, yaze::gui::CanvasConfig::canvas_size, canvas_sz_, config_, yaze::gui::CanvasConfig::content_size, context_id_, context_menu_, custom_step_, draggable_, yaze::gui::CanvasConfig::enable_context_menu, enable_context_menu_, yaze::gui::CanvasConfig::enable_custom_labels, enable_custom_labels_, yaze::gui::CanvasConfig::enable_grid, enable_grid_, yaze::gui::CanvasConfig::enable_hex_labels, enable_hex_tile_labels_, EnsureExtensions(), extensions_, yaze::gui::CanvasConfig::global_scale, global_scale_, yaze::gui::CanvasConfig::grid_step, yaze::gui::CanvasConfig::is_draggable, yaze::gui::CanvasContextMenu::kOpenAdvancedProperties, yaze::gui::CanvasContextMenu::kOpenScalingControls, yaze::gui::CanvasContextMenu::kResetView, yaze::gui::CanvasContextMenu::kSetGridStep, yaze::gui::CanvasContextMenu::kSetScale, yaze::gui::CanvasContextMenu::kToggleAutoResize, yaze::gui::CanvasContextMenu::kToggleContextMenu, yaze::gui::CanvasContextMenu::kToggleCustomLabels, yaze::gui::CanvasContextMenu::kToggleDraggable, yaze::gui::CanvasContextMenu::kToggleGrid, yaze::gui::CanvasContextMenu::kToggleHexLabels, yaze::gui::CanvasContextMenu::kZoomIn, yaze::gui::CanvasContextMenu::kZoomOut, yaze::gui::CanvasContextMenu::kZoomToFit, yaze::gfx::Bitmap::mutable_palette(), yaze::gui::CanvasConfig::on_config_changed, yaze::gui::CanvasConfig::on_scale_changed, ResetView(), rom_, yaze::gui::CanvasConfig::scrolling, scrolling_, SetGlobalScale(), SetZoomToFit(), ShowAdvancedCanvasProperties(), ShowScalingControls(), and usage_tracker_.

Referenced by Begin(), Begin(), yaze::gui::BeginCanvas(), yaze::gui::BitmapCanvasPipeline(), yaze::editor::SpriteEditor::DrawCurrentSheets(), yaze::editor::ScreenEditor::DrawDungeonMapsEditor(), yaze::editor::MenuTilemapEditorUI::DrawMainCanvas(), yaze::editor::ScreenEditor::DrawOverworldMapEditor(), yaze::editor::anonymous_namespace{gfx_group_editor.cc}::DrawScaledSheet(), yaze::editor::SpriteEditor::DrawSpriteCanvas(), yaze::editor::ScreenEditor::DrawTitleScreenBG1Canvas(), yaze::editor::ScreenEditor::DrawTitleScreenBG2Canvas(), yaze::editor::ScreenEditor::DrawTitleScreenBlocksetSelector(), yaze::editor::ScreenEditor::DrawTitleScreenCompositeCanvas(), yaze::editor::SpriteEditor::DrawZSpriteOnCanvas(), yaze::gui::GraphicsBinCanvasPipeline(), yaze::gui::TileSelectorWidget::Render(), yaze::gui::TableCanvasPipeline(), and UpdateColorPainter().

◆ AddContextMenuItem()

◆ ClearContextMenuItems()

◆ SetContextMenuOpenCallback()

void yaze::gui::Canvas::SetContextMenuOpenCallback ( std::function< bool(const ImVec2 &)> callback)
inline

◆ PrepareContextMenu()

bool yaze::gui::Canvas::PrepareContextMenu ( const ImVec2 & screen_position)
inline

Definition at line 207 of file canvas.h.

References context_menu_open_callback_.

Referenced by yaze::gui::CanvasContextMenu::Render().

◆ context_menu_open_screen_position()

std::optional< ImVec2 > yaze::gui::Canvas::context_menu_open_screen_position ( ) const
inline

Definition at line 211 of file canvas.h.

References context_menu_.

Referenced by yaze::editor::DungeonCanvasViewer::GetObjectUnderContextCursor().

◆ editor_menu() [1/2]

CanvasMenuDefinition & yaze::gui::Canvas::editor_menu ( )
inline

Definition at line 217 of file canvas.h.

References editor_menu_.

Referenced by yaze::gui::CanvasContextMenu::Render().

◆ editor_menu() [2/2]

const CanvasMenuDefinition & yaze::gui::Canvas::editor_menu ( ) const
inline

Definition at line 218 of file canvas.h.

References editor_menu_.

◆ SetContextMenuEnabled()

void yaze::gui::Canvas::SetContextMenuEnabled ( bool enabled)
inline

Definition at line 219 of file canvas.h.

References context_menu_enabled_.

◆ SetShowBuiltinContextMenu()

◆ OpenPersistentPopup()

void yaze::gui::Canvas::OpenPersistentPopup ( const std::string & popup_id,
std::function< void()> render_callback )

Definition at line 998 of file canvas.cc.

References yaze::gui::PopupRegistry::Open(), and popup_registry_.

Referenced by yaze::editor::DungeonCanvasViewer::OpenIssueReportPopup().

Here is the call graph for this function:

◆ ClosePersistentPopup()

void yaze::gui::Canvas::ClosePersistentPopup ( const std::string & popup_id)

Definition at line 1004 of file canvas.cc.

References yaze::gui::PopupRegistry::Close(), and popup_registry_.

Referenced by yaze::editor::DungeonCanvasViewer::OpenIssueReportPopup().

Here is the call graph for this function:

◆ RenderPersistentPopups()

void yaze::gui::Canvas::RenderPersistentPopups ( )

◆ GetPopupRegistry() [1/2]

PopupRegistry & yaze::gui::Canvas::GetPopupRegistry ( )
inline

Definition at line 231 of file canvas.h.

References popup_registry_.

Referenced by yaze::gui::CanvasContextMenu::Render().

◆ GetPopupRegistry() [2/2]

const PopupRegistry & yaze::gui::Canvas::GetPopupRegistry ( ) const
inline

Definition at line 232 of file canvas.h.

References popup_registry_.

◆ ShowAdvancedCanvasProperties()

◆ ShowScalingControls()

◆ SetZoomToFit()

◆ ResetView()

void yaze::gui::Canvas::ResetView ( )

◆ ApplyConfigSnapshot()

◆ ApplyScaleSnapshot()

void yaze::gui::Canvas::ApplyScaleSnapshot ( const CanvasConfig & snapshot)

◆ GetConfig() [1/2]

◆ GetConfig() [2/2]

const CanvasConfig & yaze::gui::Canvas::GetConfig ( ) const
inline

Definition at line 244 of file canvas.h.

References config_.

◆ GetSelection() [1/2]

CanvasSelection & yaze::gui::Canvas::GetSelection ( )
inline

Definition at line 245 of file canvas.h.

References selection_.

◆ GetSelection() [2/2]

const CanvasSelection & yaze::gui::Canvas::GetSelection ( ) const
inline

Definition at line 246 of file canvas.h.

References selection_.

◆ ClearSelection()

◆ InitializePaletteEditor()

void yaze::gui::Canvas::InitializePaletteEditor ( Rom * rom)

Definition at line 433 of file canvas.cc.

References EnsureExtensions(), rom(), and rom_.

Referenced by yaze::editor::Tile16Editor::Initialize().

Here is the call graph for this function:

◆ ShowPaletteEditor()

void yaze::gui::Canvas::ShowPaletteEditor ( )

Definition at line 449 of file canvas.cc.

References bitmap_, EnsureExtensions(), yaze::gfx::Bitmap::IsIndexed(), and yaze::gfx::Bitmap::mutable_palette().

Referenced by yaze::editor::Tile16Editor::DrawPaletteSettings().

Here is the call graph for this function:

◆ ShowColorAnalysis()

void yaze::gui::Canvas::ShowColorAnalysis ( )

Definition at line 463 of file canvas.cc.

References bitmap_, EnsureExtensions(), and yaze::gfx::Bitmap::IsIndexed().

Referenced by yaze::editor::Tile16Editor::DrawPaletteSettings().

Here is the call graph for this function:

◆ ApplyROMPalette()

bool yaze::gui::Canvas::ApplyROMPalette ( int group_index,
int palette_index )

Definition at line 475 of file canvas.cc.

References bitmap_, extensions_, and yaze::gfx::Bitmap::IsIndexed().

Referenced by yaze::editor::Tile16Editor::DrawPaletteSettings().

Here is the call graph for this function:

◆ ShowBppFormatSelector()

void yaze::gui::Canvas::ShowBppFormatSelector ( )

Definition at line 1971 of file canvas.cc.

References bitmap_, canvas_id_, EnsureExtensions(), yaze::gfx::Bitmap::IsIndexed(), and yaze::gfx::Bitmap::palette().

Here is the call graph for this function:

◆ ShowBppAnalysis()

void yaze::gui::Canvas::ShowBppAnalysis ( )

Definition at line 1984 of file canvas.cc.

References bitmap_, canvas_id_, EnsureExtensions(), yaze::gfx::Bitmap::IsIndexed(), and yaze::gfx::Bitmap::palette().

Here is the call graph for this function:

◆ ShowBppConversionDialog()

void yaze::gui::Canvas::ShowBppConversionDialog ( )

Definition at line 1995 of file canvas.cc.

References bitmap_, canvas_id_, EnsureExtensions(), yaze::gfx::Bitmap::IsIndexed(), and yaze::gfx::Bitmap::palette().

Here is the call graph for this function:

◆ ConvertBitmapFormat()

◆ GetCurrentBppFormat()

◆ InitializeEnhancedComponents()

void yaze::gui::Canvas::InitializeEnhancedComponents ( )

◆ SetUsageMode()

◆ usage_mode()

auto yaze::gui::Canvas::usage_mode ( ) const
inline

Definition at line 266 of file canvas.h.

References config_, and yaze::gui::CanvasConfig::usage_mode.

Referenced by RecordCanvasOperation().

◆ RecordCanvasOperation()

void yaze::gui::Canvas::RecordCanvasOperation ( const std::string & operation_name,
double time_ms )

Definition at line 395 of file canvas.cc.

References EnsurePerformanceIntegration(), performance_integration_, usage_mode(), and usage_tracker_.

Here is the call graph for this function:

◆ ShowPerformanceUI()

void yaze::gui::Canvas::ShowPerformanceUI ( )

Definition at line 407 of file canvas.cc.

References EnsurePerformanceIntegration(), and performance_integration_.

Here is the call graph for this function:

◆ ShowUsageReport()

void yaze::gui::Canvas::ShowUsageReport ( )

Definition at line 414 of file canvas.cc.

References usage_tracker_.

◆ GetInteractionHandler() [1/2]

CanvasInteractionHandler & yaze::gui::Canvas::GetInteractionHandler ( )
inline

Definition at line 273 of file canvas.h.

References interaction_handler_.

◆ GetInteractionHandler() [2/2]

const CanvasInteractionHandler & yaze::gui::Canvas::GetInteractionHandler ( ) const
inline

Definition at line 276 of file canvas.h.

References interaction_handler_.

◆ GetAutomationAPI()

CanvasAutomationAPI * yaze::gui::Canvas::GetAutomationAPI ( )

Definition at line 2054 of file canvas.cc.

References EnsureExtensions().

Referenced by yaze::editor::OverworldEditor::SetupCanvasAutomation().

Here is the call graph for this function:

◆ InitializeDefaults()

◆ Cleanup()

void yaze::gui::Canvas::Cleanup ( )

Definition at line 337 of file canvas.cc.

References ClearSelection(), context_menu_, extensions_, performance_integration_, and usage_tracker_.

Here is the call graph for this function:

◆ GetMinimumSize()

ImVec2 yaze::gui::Canvas::GetMinimumSize ( ) const

◆ GetPreferredSize()

ImVec2 yaze::gui::Canvas::GetPreferredSize ( ) const

◆ GetCurrentSize()

ImVec2 yaze::gui::Canvas::GetCurrentSize ( ) const
inline

Definition at line 290 of file canvas.h.

References yaze::gui::CanvasConfig::canvas_size, and config_.

Referenced by Begin(), yaze::gui::BeginCanvas(), and yaze::gui::BeginCanvas().

◆ SetAutoResize()

void yaze::gui::Canvas::SetAutoResize ( bool auto_resize)
inline

◆ IsAutoResize()

bool yaze::gui::Canvas::IsAutoResize ( ) const
inline

Definition at line 292 of file canvas.h.

References yaze::gui::CanvasConfig::auto_resize, and config_.

Referenced by Begin(), and yaze::gui::BeginCanvas().

◆ ReserveTableSpace()

void yaze::gui::Canvas::ReserveTableSpace ( const std::string & label = "")

◆ BeginTableCanvas()

bool yaze::gui::Canvas::BeginTableCanvas ( const std::string & label = "")

◆ EndTableCanvas()

void yaze::gui::Canvas::EndTableCanvas ( )

Definition at line 523 of file canvas.cc.

Referenced by yaze::gui::TableCanvasPipeline().

◆ BeginInTable()

CanvasRuntime yaze::gui::Canvas::BeginInTable ( const std::string & label,
const CanvasFrameOptions & options )

Begin canvas in table cell with frame options (modern API) Returns CanvasRuntime for stateless helper usage. Handles child sizing, scrollbars, and table integration.

Definition at line 527 of file canvas.cc.

References yaze::gui::CanvasConfig::auto_resize, Begin(), BuildCurrentRuntime(), canvas_id_, yaze::gui::CanvasFrameOptions::canvas_size, yaze::gui::CanvasConfig::canvas_size, config_, GetPreferredSize(), yaze::gui::CanvasRuntime::grid_step, yaze::gui::CanvasFrameOptions::grid_step, yaze::gui::CanvasUtils::SetNextCanvasSize(), and yaze::gui::CanvasFrameOptions::show_scrollbar.

Here is the call graph for this function:

◆ EndInTable()

◆ HasValidSelection()

bool yaze::gui::Canvas::HasValidSelection ( ) const

Definition at line 585 of file canvas.cc.

References points_.

Referenced by GetLastClickPosition(), WasClicked(), and WasDoubleClicked().

◆ WasClicked()

bool yaze::gui::Canvas::WasClicked ( ImGuiMouseButton button = ImGuiMouseButton_Left) const

Definition at line 589 of file canvas.cc.

References HasValidSelection().

Here is the call graph for this function:

◆ WasDoubleClicked()

bool yaze::gui::Canvas::WasDoubleClicked ( ImGuiMouseButton button = ImGuiMouseButton_Left) const

Definition at line 593 of file canvas.cc.

References HasValidSelection().

Here is the call graph for this function:

◆ GetLastClickPosition()

ImVec2 yaze::gui::Canvas::GetLastClickPosition ( ) const

Definition at line 598 of file canvas.cc.

References HasValidSelection(), and points_.

Here is the call graph for this function:

◆ DrawTilePainter()

bool yaze::gui::Canvas::DrawTilePainter ( const Bitmap & bitmap,
int size,
float scale = 1.0f )

◆ DrawSolidTilePainter()

bool yaze::gui::Canvas::DrawSolidTilePainter ( const ImVec4 & color,
int size )

◆ DrawTileOnBitmap()

void yaze::gui::Canvas::DrawTileOnBitmap ( int tile_size,
gfx::Bitmap * bitmap,
ImVec4 color )

Definition at line 1208 of file canvas.cc.

References drawn_tile_pos_, global_scale_, yaze::gfx::Bitmap::width(), and yaze::gfx::Bitmap::WriteColor().

Here is the call graph for this function:

◆ DrawOutline()

void yaze::gui::Canvas::DrawOutline ( int x,
int y,
int w,
int h )

Definition at line 1359 of file canvas.cc.

References canvas_p0_, draw_list_, yaze::gui::CanvasUtils::DrawCanvasOutline(), global_scale(), and scrolling_.

Referenced by yaze::editor::CanvasNavigationManager::CheckForCurrentMap().

Here is the call graph for this function:

◆ DrawOutlineWithColor() [1/2]

void yaze::gui::Canvas::DrawOutlineWithColor ( int x,
int y,
int w,
int h,
ImVec4 color )

◆ DrawOutlineWithColor() [2/2]

void yaze::gui::Canvas::DrawOutlineWithColor ( int x,
int y,
int w,
int h,
uint32_t color )

Definition at line 1371 of file canvas.cc.

References canvas_p0_, draw_list_, yaze::gui::CanvasUtils::DrawCanvasOutline(), global_scale(), and scrolling_.

Here is the call graph for this function:

◆ DrawRect()

◆ DrawText()

◆ DrawGridLines()

void yaze::gui::Canvas::DrawGridLines ( float grid_step)

Definition at line 1573 of file canvas.cc.

References canvas_p0_, canvas_p1_, config_, draw_list_, yaze::gui::CanvasUtils::DrawCanvasGridLines(), yaze::gui::CanvasConfig::global_scale, and scrolling_.

Referenced by DrawInfoGrid().

Here is the call graph for this function:

◆ DrawInfoGrid()

void yaze::gui::Canvas::DrawInfoGrid ( float grid_step = 64.0f,
int tile_id_offset = 8,
int label_id = 0 )

◆ DrawLayeredElements()

void yaze::gui::Canvas::DrawLayeredElements ( )

Definition at line 1667 of file canvas.cc.

References draw_list().

Here is the call graph for this function:

◆ GetTileIdFromMousePos()

int yaze::gui::Canvas::GetTileIdFromMousePos ( )
inline

◆ DrawCustomHighlight()

void yaze::gui::Canvas::DrawCustomHighlight ( float grid_step)

Definition at line 1615 of file canvas.cc.

References canvas_p0_, draw_list_, yaze::gui::CanvasUtils::DrawCustomHighlight(), highlight_tile_id, and scrolling_.

Referenced by DrawInfoGrid().

Here is the call graph for this function:

◆ IsMouseHovering()

◆ ZoomIn()

◆ ZoomOut()

◆ points()

◆ mutable_points()

ImVector< ImVec2 > * yaze::gui::Canvas::mutable_points ( )
inline

◆ push_back()

auto yaze::gui::Canvas::push_back ( ImVec2 pos)
inline

Definition at line 362 of file canvas.h.

References points_.

◆ draw_list()

◆ zero_point()

auto yaze::gui::Canvas::zero_point ( ) const
inline

Definition at line 364 of file canvas.h.

References canvas_p0_.

Referenced by yaze::gui::BeginCanvas(), yaze::editor::RoomGraphicsContent::Draw(), yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::DungeonCanvasViewer::DrawCoordinateOverlayHud(), yaze::editor::PixelEditorPanel::DrawCursorCrosshair(), yaze::editor::DungeonCanvasViewer::DrawHeaderHiddenMetadataHud(), yaze::editor::OverworldEntityRenderer::DrawItems(), yaze::editor::DungeonCanvasViewer::DrawLayerInfoWindow(), yaze::editor::InteractionCoordinator::DrawMultiEntitySelectionHighlights(), yaze::editor::PixelEditorPanel::DrawPixelGrids(), yaze::editor::ObjectSelection::DrawRectangleSelectionBox(), yaze::editor::DungeonCanvasViewer::DrawRoomDebugWindow(), yaze::editor::ObjectSelection::DrawSelectionHighlights(), yaze::editor::SheetBrowserPanel::DrawSheetThumbnail(), yaze::editor::OverworldEntityRenderer::DrawSprites(), yaze::editor::DungeonCanvasViewer::DrawTextureDebugWindow(), yaze::editor::Tile16Editor::DrawTile16EditorWorkbenchColumn(), yaze::editor::Tile16Editor::DrawTile8UsageOverlay(), yaze::editor::PixelEditorPanel::DrawTransparencyGrid(), yaze::editor::DungeonObjectInteraction::GetCanvasTransform(), yaze::editor::BaseEntityHandler::GetCanvasTransform(), yaze::editor::BaseEntityHandler::GetCanvasZeroPoint(), yaze::editor::DungeonCanvasViewer::GetObjectUnderContextCursor(), yaze::gui::GraphicsBinCanvasPipeline(), yaze::editor::DungeonCanvasViewer::HandleRoomCanvasDropTargets(), yaze::editor::Tile16Editor::HandleTile8SourceSelection(), yaze::editor::PixelEditorPanel::PixelToScreen(), yaze::gui::TileSelectorWidget::ResolveTileAtCursor(), yaze::editor::PixelEditorPanel::ScreenToPixel(), and yaze::editor::InteractionCoordinator::UpdateSelectionCycleHudPreview().

◆ ToCanvasPos()

ImVec2 yaze::gui::Canvas::ToCanvasPos ( ImVec2 local) const

◆ scrolling()

◆ set_scrolling()

◆ drawn_tile_position()

auto yaze::gui::Canvas::drawn_tile_position ( ) const
inline

◆ canvas_size()

◆ set_global_scale()

◆ set_draggable()

void yaze::gui::Canvas::set_draggable ( bool draggable)
inline

Definition at line 376 of file canvas.h.

References draggable_.

Referenced by yaze::editor::Tile16Editor::DrawTile8SourcePanel().

◆ IsSelectRectActive()

bool yaze::gui::Canvas::IsSelectRectActive ( ) const
inline

Definition at line 379 of file canvas.h.

References select_rect_active_.

◆ GetSelectedTiles()

const std::vector< ImVec2 > & yaze::gui::Canvas::GetSelectedTiles ( ) const
inline

Definition at line 380 of file canvas.h.

References selected_tiles_.

◆ GetSelectedTilePos()

ImVec2 yaze::gui::Canvas::GetSelectedTilePos ( ) const
inline

Definition at line 383 of file canvas.h.

References selected_tile_pos_.

◆ SetSelectedTilePos()

void yaze::gui::Canvas::SetSelectedTilePos ( ImVec2 pos)
inline

Definition at line 384 of file canvas.h.

References selected_tile_pos_.

◆ SetCanvasSize()

◆ GetGlobalScale()

◆ SetGlobalScale()

void yaze::gui::Canvas::SetGlobalScale ( float scale)
inline

◆ GetCustomLabelsEnabled()

bool * yaze::gui::Canvas::GetCustomLabelsEnabled ( )
inline

Definition at line 395 of file canvas.h.

References config_, and yaze::gui::CanvasConfig::enable_custom_labels.

◆ GetGridStep()

float yaze::gui::Canvas::GetGridStep ( ) const
inline

Definition at line 396 of file canvas.h.

References config_, and yaze::gui::CanvasConfig::grid_step.

Referenced by yaze::gui::BeginCanvas(), and End().

◆ SetClampRectToLocalMaps()

void yaze::gui::Canvas::SetClampRectToLocalMaps ( bool clamp)
inline

Definition at line 399 of file canvas.h.

References yaze::gui::CanvasConfig::clamp_rect_to_local_maps, and config_.

◆ GetClampRectToLocalMaps()

bool yaze::gui::Canvas::GetClampRectToLocalMaps ( ) const
inline

Definition at line 402 of file canvas.h.

References yaze::gui::CanvasConfig::clamp_rect_to_local_maps, and config_.

◆ GetCanvasWidth()

float yaze::gui::Canvas::GetCanvasWidth ( ) const
inline

Definition at line 405 of file canvas.h.

References yaze::gui::CanvasConfig::canvas_size, and config_.

◆ GetCanvasHeight()

float yaze::gui::Canvas::GetCanvasHeight ( ) const
inline

Definition at line 406 of file canvas.h.

References yaze::gui::CanvasConfig::canvas_size, and config_.

◆ select_rect_active()

auto yaze::gui::Canvas::select_rect_active ( ) const
inline

◆ selected_tiles()

auto yaze::gui::Canvas::selected_tiles ( ) const
inline

Definition at line 410 of file canvas.h.

References selected_tiles_.

Referenced by yaze::editor::OverworldEditor::DrawScratchSpace().

◆ selected_tile_pos()

auto yaze::gui::Canvas::selected_tile_pos ( ) const
inline

Definition at line 411 of file canvas.h.

References selected_tile_pos_.

◆ set_selected_tile_pos()

void yaze::gui::Canvas::set_selected_tile_pos ( ImVec2 pos)
inline

Definition at line 412 of file canvas.h.

References selected_tile_pos_.

◆ global_scale()

auto yaze::gui::Canvas::global_scale ( ) const
inline

Definition at line 413 of file canvas.h.

References config_, and yaze::gui::CanvasConfig::global_scale.

Referenced by yaze::editor::DungeonCanvasViewer::AddLoadedRoomContextMenuItems(), yaze::editor::CanvasNavigationManager::BeginCanvasViewport(), Canvas(), Canvas(), yaze::gui::CanvasAutomationAPI::CanvasToTile(), yaze::editor::CanvasNavigationManager::CenterOnMap(), yaze::editor::CanvasNavigationManager::CenterOnWorldTile(), yaze::editor::DungeonCanvasViewer::ConnectedCanvasScale(), yaze::editor::DungeonCanvasViewer::ConsumePendingCanvasScroll(), yaze::editor::CanvasNavigationManager::ContentSize(), yaze::editor::RoomGraphicsContent::Draw(), yaze::editor::DungeonCanvasViewer::DrawConnectedRoomMatrix(), yaze::editor::DungeonCanvasViewer::DrawCoordinateOverlayHud(), yaze::editor::OverworldEntityRenderer::DrawEntrances(), yaze::editor::OverworldEntityRenderer::DrawExits(), yaze::editor::OverworldEntityRenderer::DrawItems(), yaze::editor::DungeonCanvasViewer::DrawLayerInfoWindow(), yaze::editor::InteractionCoordinator::DrawMultiEntitySelectionHighlights(), DrawOutline(), DrawOutlineWithColor(), DrawOutlineWithColor(), yaze::editor::MapPropertiesSystem::DrawOverlayPreviewOnMap(), yaze::editor::ObjectSelection::DrawRectangleSelectionBox(), yaze::editor::DungeonCanvasViewer::DrawRoomBackgroundLayers(), yaze::editor::ObjectSelection::DrawSelectionHighlights(), yaze::editor::OverworldEntityRenderer::DrawSprites(), yaze::editor::DungeonObjectInteraction::GetCanvasTransform(), yaze::editor::BaseEntityHandler::GetCanvasTransform(), yaze::gui::CanvasAutomationAPI::GetDimensions(), yaze::editor::DungeonCanvasViewer::GetObjectUnderContextCursor(), yaze::gui::CanvasAutomationAPI::GetVisibleRegion(), yaze::gui::CanvasAutomationAPI::GetZoom(), yaze::editor::anonymous_namespace{dungeon_canvas_connected_matrix.cc}::HandleConnectedCanvasZoom(), yaze::editor::DungeonCanvasViewer::HandleRoomCanvasDropTargets(), yaze::editor::DungeonCanvasViewer::HandleRoomCanvasNavigation(), yaze::editor::TilePaintingManager::HoveredTile(), yaze::editor::OverworldEditor::Initialize(), yaze::editor::anonymous_namespace{canvas_navigation_manager.cc}::MapFromCanvasPosition(), yaze::editor::TilePaintingManager::PickTile16FromHoveredCanvas(), yaze::editor::CanvasNavigationManager::SetScaleAboutAnchor(), yaze::gui::CanvasAutomationAPI::TileToCanvas(), yaze::editor::OverworldEditor::TryPlaceArmedItem(), yaze::editor::DungeonCanvasViewer::UpdateRoomCanvasViewport(), yaze::editor::InteractionCoordinator::UpdateSelectionCycleHudPreview(), and yaze::editor::CanvasNavigationManager::ZoomBySteps().

◆ custom_labels_enabled()

◆ custom_step()

auto yaze::gui::Canvas::custom_step ( ) const
inline

Definition at line 415 of file canvas.h.

References config_, and yaze::gui::CanvasConfig::grid_step.

◆ width()

auto yaze::gui::Canvas::width ( ) const
inline

◆ height()

auto yaze::gui::Canvas::height ( ) const
inline

◆ canvas_id()

auto yaze::gui::Canvas::canvas_id ( ) const
inline

Definition at line 420 of file canvas.h.

References canvas_id_.

Referenced by Begin(), and yaze::gui::BeginCanvas().

◆ DrawBitmap() [1/3]

void yaze::gui::Canvas::DrawBitmap ( Bitmap & bitmap,
int border_offset,
float scale )

◆ DrawBitmap() [2/3]

void yaze::gui::Canvas::DrawBitmap ( Bitmap & bitmap,
int x_offset,
int y_offset,
float scale = 1.0f,
int alpha = 255 )

◆ DrawBitmap() [3/3]

void yaze::gui::Canvas::DrawBitmap ( Bitmap & bitmap,
ImVec2 dest_pos,
ImVec2 dest_size,
ImVec2 src_pos,
ImVec2 src_size )

◆ DrawBitmapTable()

void yaze::gui::Canvas::DrawBitmapTable ( const BitmapTable & gfx_bin)
Todo
Add parameters for sizing and positioning

Definition at line 1340 of file canvas.cc.

References canvas_p0_, and draw_list_.

Referenced by yaze::editor::ScreenEditor::DrawDungeonMapsEditor().

◆ DrawBitmapGroup()

void yaze::gui::Canvas::DrawBitmapGroup ( std::vector< int > & group,
gfx::Tilemap & tilemap,
int tile_size,
float scale = 1.0f,
int local_map_size = 0x200,
ImVec2 total_map_size = ImVec2(0x1000, 0x1000) )

Draw group of bitmaps for multi-tile selection preview.

Parameters
groupVector of tile IDs to draw
tilemapTilemap containing the tiles
tile_sizeSize of each tile (default 16)
scaleRendering scale (default 1.0)
local_map_sizeSize of local map in pixels (default 512 for standard maps)
total_map_sizeTotal map size for boundary clamping (default 4096x4096)

Definition at line 1377 of file canvas.cc.

References yaze::gfx::Tilemap::atlas, canvas_p0_, yaze::gui::CanvasConfig::clamp_rect_to_local_maps, config_, draw_list_, yaze::gui::CanvasConfig::global_scale, yaze::gfx::Bitmap::height(), yaze::gfx::Bitmap::is_active(), yaze::gfx::Tilemap::map_size, scrolling_, select_rect_active_, selected_points_, yaze::gfx::Bitmap::texture(), yaze::gfx::Tilemap::tile_size, yaze::gfx::Bitmap::width(), yaze::gfx::Pair::x, and yaze::gfx::Pair::y.

Here is the call graph for this function:

◆ DrawBitmapPreview()

void yaze::gui::Canvas::DrawBitmapPreview ( Bitmap & bitmap,
const BitmapPreviewOptions & options )

◆ DrawTilemapPainter()

bool yaze::gui::Canvas::DrawTilemapPainter ( gfx::Tilemap & tilemap,
int current_tile )

◆ DrawSelectRect()

◆ DrawTileSelector()

◆ DrawGrid()

void yaze::gui::Canvas::DrawGrid ( float grid_step = 64.0f,
int tile_id_offset = 8 )

Definition at line 1620 of file canvas.cc.

References canvas_p0_, canvas_p1_, config_, current_labels_, yaze::gui::CanvasUtils::CanvasRenderContext::draw_list, draw_list_, yaze::gui::CanvasUtils::DrawCanvasGrid(), yaze::gui::CanvasUtils::DrawCanvasLabels(), yaze::gui::CanvasConfig::enable_custom_labels, yaze::gui::CanvasConfig::enable_grid, yaze::gui::CanvasConfig::enable_hex_labels, yaze::gui::CanvasConfig::global_scale, yaze::gui::CanvasConfig::grid_step, highlight_tile_id, labels_, and scrolling_.

Referenced by yaze::gui::BitmapCanvasPipeline(), yaze::editor::PixelEditorPanel::DrawCanvas(), yaze::editor::SpriteEditor::DrawCurrentSheets(), yaze::editor::ScreenEditor::DrawDungeonMapScreen(), yaze::editor::ScreenEditor::DrawDungeonMapsEditor(), yaze::editor::MenuTilemapEditorUI::DrawMainCanvas(), yaze::editor::ScreenEditor::DrawOverworldMapEditor(), yaze::editor::anonymous_namespace{gfx_group_editor.cc}::DrawScaledSheet(), yaze::editor::SpriteEditor::DrawSpriteCanvas(), yaze::editor::ScreenEditor::DrawTitleScreenBG1Canvas(), yaze::editor::ScreenEditor::DrawTitleScreenBG2Canvas(), yaze::editor::ScreenEditor::DrawTitleScreenBlocksetSelector(), yaze::editor::ScreenEditor::DrawTitleScreenCompositeCanvas(), yaze::editor::SpriteEditor::DrawZSpriteOnCanvas(), End(), End(), yaze::gui::EndCanvas(), EndInTable(), yaze::gui::GraphicsBinCanvasPipeline(), yaze::gui::TileSelectorWidget::Render(), yaze::gui::TableCanvasPipeline(), and UpdateColorPainter().

Here is the call graph for this function:

◆ DrawOverlay()

◆ labels()

auto yaze::gui::Canvas::labels ( int i)
inline

Definition at line 451 of file canvas.h.

References labels_.

◆ mutable_labels()

auto yaze::gui::Canvas::mutable_labels ( int i)
inline

Definition at line 457 of file canvas.h.

References labels_.

Referenced by yaze::editor::Tile16Editor::Initialize().

◆ set_current_labels()

auto yaze::gui::Canvas::set_current_labels ( int i)
inline

Definition at line 469 of file canvas.h.

References current_labels_.

◆ set_highlight_tile_id()

auto yaze::gui::Canvas::set_highlight_tile_id ( int i)
inline

Definition at line 470 of file canvas.h.

References highlight_tile_id.

◆ mutable_selected_tiles()

auto yaze::gui::Canvas::mutable_selected_tiles ( )
inline

Definition at line 472 of file canvas.h.

References selected_tiles_.

◆ mutable_selected_points()

◆ selected_points()

auto yaze::gui::Canvas::selected_points ( ) const
inline

◆ hover_mouse_pos()

◆ set_rom()

void yaze::gui::Canvas::set_rom ( Rom * rom)
inline

Definition at line 478 of file canvas.h.

References rom(), and rom_.

Here is the call graph for this function:

◆ rom()

Rom * yaze::gui::Canvas::rom ( ) const
inline

Definition at line 479 of file canvas.h.

References rom_.

Referenced by InitializePaletteEditor(), and set_rom().

◆ SetGameData()

void yaze::gui::Canvas::SetGameData ( zelda3::GameData * game_data)

Definition at line 442 of file canvas.cc.

References extensions_, game_data(), and game_data_.

Here is the call graph for this function:

◆ game_data()

zelda3::GameData * yaze::gui::Canvas::game_data ( ) const
inline

Definition at line 481 of file canvas.h.

References game_data_.

Referenced by SetGameData().

◆ AddImageAt()

void yaze::gui::Canvas::AddImageAt ( ImTextureID texture,
ImVec2 local_top_left,
ImVec2 size )

Definition at line 2064 of file canvas.cc.

References canvas_p0_, draw_list_, and global_scale_.

◆ AddRectFilledAt()

void yaze::gui::Canvas::AddRectFilledAt ( ImVec2 local_top_left,
ImVec2 size,
uint32_t color )

Definition at line 2076 of file canvas.cc.

References canvas_p0_, draw_list_, and global_scale_.

Referenced by yaze::editor::SheetBrowserPanel::DrawSheetThumbnail().

◆ AddTextAt()

void yaze::gui::Canvas::AddTextAt ( ImVec2 local_pos,
const std::string & text,
uint32_t color )

Definition at line 2087 of file canvas.cc.

References canvas_p0_, draw_list_, and global_scale_.

Referenced by yaze::editor::SheetBrowserPanel::DrawSheetThumbnail().

◆ DrawContextMenuItem()

void yaze::gui::Canvas::DrawContextMenuItem ( const gui::CanvasMenuItem & item)
private

Definition at line 961 of file canvas.cc.

References yaze::gui::PopupRegistry::Open(), popup_registry_, and yaze::gui::RenderMenuItem().

Here is the call graph for this function:

◆ SyncLegacyGeometryFromState()

◆ EnsurePerformanceIntegration()

void yaze::gui::Canvas::EnsurePerformanceIntegration ( )
private

◆ BuildCurrentRuntime()

◆ EnsureExtensions()

Member Data Documentation

◆ context_menu_

std::unique_ptr<CanvasContextMenu> yaze::gui::Canvas::context_menu_

◆ usage_tracker_

std::shared_ptr<CanvasUsageTracker> yaze::gui::Canvas::usage_tracker_

◆ performance_integration_

std::shared_ptr<CanvasPerformanceIntegration> yaze::gui::Canvas::performance_integration_

◆ interaction_handler_

CanvasInteractionHandler yaze::gui::Canvas::interaction_handler_

◆ renderer_

gfx::IRenderer* yaze::gui::Canvas::renderer_ = nullptr
private

Definition at line 509 of file canvas.h.

Referenced by renderer(), and SetRenderer().

◆ config_

◆ selection_

CanvasSelection yaze::gui::Canvas::selection_
private

Definition at line 511 of file canvas.h.

Referenced by ClearSelection(), GetSelection(), GetSelection(), and InitializeDefaults().

◆ extensions_

std::unique_ptr<CanvasExtensions> yaze::gui::Canvas::extensions_
private

Definition at line 516 of file canvas.h.

Referenced by ApplyROMPalette(), Cleanup(), DrawContextMenu(), EnsureExtensions(), and SetGameData().

◆ state_

CanvasState yaze::gui::Canvas::state_
private

◆ is_hovered_

bool yaze::gui::Canvas::is_hovered_ = false
private

◆ refresh_graphics_

bool yaze::gui::Canvas::refresh_graphics_ = false
private

Definition at line 524 of file canvas.h.

◆ editor_menu_

CanvasMenuDefinition yaze::gui::Canvas::editor_menu_
private

Definition at line 527 of file canvas.h.

Referenced by AddContextMenuItem(), ClearContextMenuItems(), editor_menu(), and editor_menu().

◆ context_menu_enabled_

bool yaze::gui::Canvas::context_menu_enabled_ = true
private

Definition at line 528 of file canvas.h.

Referenced by SetContextMenuEnabled().

◆ context_menu_open_callback_

std::function<bool(const ImVec2&) yaze::gui::Canvas::context_menu_open_callback_)
private

Definition at line 529 of file canvas.h.

Referenced by PrepareContextMenu(), and SetContextMenuOpenCallback().

◆ popup_registry_

PopupRegistry yaze::gui::Canvas::popup_registry_
private

◆ current_labels_

int yaze::gui::Canvas::current_labels_ = 0
private

Definition at line 535 of file canvas.h.

Referenced by DrawGrid(), and set_current_labels().

◆ highlight_tile_id

int yaze::gui::Canvas::highlight_tile_id = -1
private

Definition at line 536 of file canvas.h.

Referenced by DrawCustomHighlight(), DrawGrid(), and set_highlight_tile_id().

◆ edit_palette_index_

uint16_t yaze::gui::Canvas::edit_palette_index_ = 0
private

Definition at line 537 of file canvas.h.

◆ edit_palette_group_name_index_

uint64_t yaze::gui::Canvas::edit_palette_group_name_index_ = 0
private

Definition at line 538 of file canvas.h.

◆ edit_palette_sub_index_

uint64_t yaze::gui::Canvas::edit_palette_sub_index_ = 0
private

Definition at line 539 of file canvas.h.

◆ bitmap_

◆ rom_

Rom* yaze::gui::Canvas::rom_ = nullptr
private

Definition at line 543 of file canvas.h.

Referenced by DrawContextMenu(), InitializePaletteEditor(), rom(), and set_rom().

◆ game_data_

zelda3::GameData* yaze::gui::Canvas::game_data_ = nullptr
private

Definition at line 544 of file canvas.h.

Referenced by game_data(), and SetGameData().

◆ draw_list_

◆ scrolling_

◆ canvas_sz_

◆ canvas_p0_

◆ canvas_p1_

ImVec2 yaze::gui::Canvas::canvas_p1_
private

◆ drawn_tile_pos_

ImVec2 yaze::gui::Canvas::drawn_tile_pos_
private

◆ mouse_pos_in_canvas_

ImVec2 yaze::gui::Canvas::mouse_pos_in_canvas_
private

◆ points_

◆ labels_

ImVector<ImVector<std::string> > yaze::gui::Canvas::labels_
private

Definition at line 559 of file canvas.h.

Referenced by DrawGrid(), DrawInfoGrid(), labels(), mutable_labels(), and ~Canvas().

◆ canvas_id_

◆ context_id_

std::string yaze::gui::Canvas::context_id_ = "CanvasContext"
private

Definition at line 563 of file canvas.h.

Referenced by DrawContextMenu(), and Init().

◆ selected_tiles_

std::vector<ImVec2> yaze::gui::Canvas::selected_tiles_
private

◆ selected_points_

ImVector<ImVec2> yaze::gui::Canvas::selected_points_
private

◆ selected_tile_pos_

ImVec2 yaze::gui::Canvas::selected_tile_pos_ = ImVec2(-1, -1)
private

◆ select_rect_active_

bool yaze::gui::Canvas::select_rect_active_ = false
private

◆ custom_step_

◆ global_scale_

◆ enable_grid_

bool yaze::gui::Canvas::enable_grid_ = true
private

◆ enable_hex_tile_labels_

bool yaze::gui::Canvas::enable_hex_tile_labels_ = false
private

◆ enable_custom_labels_

bool yaze::gui::Canvas::enable_custom_labels_ = false
private

◆ enable_context_menu_

bool yaze::gui::Canvas::enable_context_menu_ = true
private

◆ custom_canvas_size_

bool yaze::gui::Canvas::custom_canvas_size_ = false
private

Definition at line 576 of file canvas.h.

Referenced by Init(), and InitializeDefaults().

◆ draggable_

bool yaze::gui::Canvas::draggable_ = false
private

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