yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
canvas_modals.cc
Go to the documentation of this file.
1#include "canvas_modals.h"
2#include "util/i18n/tr.h"
3
4#include <algorithm>
5#include <iomanip>
6#include <sstream>
7
11#include "app/gui/core/icons.h"
13#include "imgui/imgui.h"
14
15namespace yaze {
16namespace gui {
17
18// Helper functions for dispatching config callbacks
19namespace {
20inline void DispatchConfig(
21 const std::function<void(const CanvasConfig&)>& callback,
22 const CanvasConfig& config) {
23 if (callback)
24 callback(config);
25}
26
27inline void DispatchScale(
28 const std::function<void(const CanvasConfig&)>& callback,
29 const CanvasConfig& config) {
30 if (callback)
31 callback(config);
32}
33} // namespace
34
35void CanvasModals::ShowAdvancedProperties(const std::string& canvas_id,
36 const CanvasConfig& config,
37 const gfx::Bitmap* bitmap) {
38 std::string modal_id = canvas_id + "_advanced_properties";
39
40 auto render_func = [=]() mutable {
41 CanvasConfig mutable_config = config; // Create mutable copy
42 mutable_config.on_config_changed = config.on_config_changed;
43 mutable_config.on_scale_changed = config.on_scale_changed;
44 RenderAdvancedPropertiesModal(modal_id, mutable_config, bitmap);
45 };
46
47 OpenModal(modal_id, render_func);
48}
49
50void CanvasModals::ShowScalingControls(const std::string& canvas_id,
51 const CanvasConfig& config,
52 const gfx::Bitmap* bitmap) {
53 std::string modal_id = canvas_id + "_scaling_controls";
54
55 auto render_func = [=]() mutable {
56 CanvasConfig mutable_config = config; // Create mutable copy
57 mutable_config.on_config_changed = config.on_config_changed;
58 mutable_config.on_scale_changed = config.on_scale_changed;
59 RenderScalingControlsModal(modal_id, mutable_config, bitmap);
60 };
61
62 OpenModal(modal_id, render_func);
63}
64
66 const std::string& canvas_id, const BppConversionOptions& options) {
67 std::string modal_id = canvas_id + "_bpp_conversion";
68
69 auto render_func = [=]() {
70 RenderBppConversionModal(modal_id, options);
71 };
72
73 OpenModal(modal_id, render_func);
74}
75
76void CanvasModals::ShowPaletteEditor(const std::string& canvas_id,
77 const PaletteEditorOptions& options) {
78 std::string modal_id = canvas_id + "_palette_editor";
79
80 auto render_func = [=]() {
81 RenderPaletteEditorModal(modal_id, options);
82 };
83
84 OpenModal(modal_id, render_func);
85}
86
87void CanvasModals::ShowColorAnalysis(const std::string& canvas_id,
88 const ColorAnalysisOptions& options) {
89 std::string modal_id = canvas_id + "_color_analysis";
90
91 auto render_func = [=]() {
92 RenderColorAnalysisModal(modal_id, options);
93 };
94
95 OpenModal(modal_id, render_func);
96}
97
99 const std::string& canvas_id, const PerformanceOptions& options) {
100 std::string modal_id = canvas_id + "_performance";
101
102 auto render_func = [=]() {
103 RenderPerformanceModal(modal_id, options);
104 };
105
106 OpenModal(modal_id, render_func);
107}
108
110 for (auto& modal : active_modals_) {
111 if (modal.is_open) {
112 modal.render_func();
113 }
114 }
115
116 // Remove closed modals
117 active_modals_.erase(
118 std::remove_if(active_modals_.begin(), active_modals_.end(),
119 [](const ModalState& modal) { return !modal.is_open; }),
120 active_modals_.end());
121}
122
124 return std::any_of(active_modals_.begin(), active_modals_.end(),
125 [](const ModalState& modal) { return modal.is_open; });
126}
127
128void CanvasModals::RenderAdvancedPropertiesModal(const std::string& canvas_id,
129 CanvasConfig& config,
130 const gfx::Bitmap* bitmap) {
131 std::string modal_title = "Advanced Canvas Properties";
132 ImGui::SetNextWindowSize(ImVec2(600, 500), ImGuiCond_FirstUseEver);
133
134 if (ImGui::BeginPopupModal(modal_title.c_str(), nullptr,
135 ImGuiWindowFlags_AlwaysAutoResize)) {
136 // Header with icon
137 ImGui::Text("%s %s", ICON_MD_SETTINGS, modal_title.c_str());
138 ImGui::Separator();
139
140 // Canvas Information Section
141 if (ImGui::CollapsingHeader(ICON_MD_ANALYTICS " Canvas Information",
142 ImGuiTreeNodeFlags_DefaultOpen)) {
143 ImGui::Columns(2, "CanvasInfo");
144
146 "Canvas Size",
147 std::to_string(static_cast<int>(config.canvas_size.x)) + " x " +
148 std::to_string(static_cast<int>(config.canvas_size.y)),
149 ICON_MD_STRAIGHTEN, ImVec4(0.2F, 0.8F, 1.0F, 1.0F));
150
152 "Content Size",
153 std::to_string(static_cast<int>(config.content_size.x)) + " x " +
154 std::to_string(static_cast<int>(config.content_size.y)),
155 ICON_MD_IMAGE, ImVec4(0.8F, 0.2F, 1.0F, 1.0F));
156
157 ImGui::NextColumn();
158
160 "Global Scale",
161 std::to_string(static_cast<int>(config.global_scale * 100)) + "%",
162 ICON_MD_ZOOM_IN, ImVec4(1.0F, 0.8F, 0.2F, 1.0F));
163
165 "Grid Step",
166 std::to_string(static_cast<int>(config.grid_step)) + "px",
167 ICON_MD_GRID_ON, ImVec4(0.2F, 1.0F, 0.2F, 1.0F));
168
169 ImGui::Columns(1);
170 }
171
172 // View Settings Section
173 if (ImGui::CollapsingHeader(tr("👁️ View Settings"),
174 ImGuiTreeNodeFlags_DefaultOpen)) {
175 ImGui::Checkbox(tr("Show Grid"), &config.enable_grid);
176 ImGui::SameLine();
177 RenderMaterialIcon("grid_on");
178
179 ImGui::Checkbox(tr("Show Hex Labels"), &config.enable_hex_labels);
180 ImGui::SameLine();
181 RenderMaterialIcon("label");
182
183 ImGui::Checkbox(tr("Show Custom Labels"), &config.enable_custom_labels);
184 ImGui::SameLine();
185 RenderMaterialIcon("edit");
186
187 ImGui::Checkbox(tr("Enable Context Menu"), &config.enable_context_menu);
188 ImGui::SameLine();
189 RenderMaterialIcon("menu");
190
191 ImGui::Checkbox(tr("Draggable Canvas"), &config.is_draggable);
192 ImGui::SameLine();
193 RenderMaterialIcon("drag_indicator");
194
195 ImGui::Checkbox(tr("Auto Resize for Tables"), &config.auto_resize);
196 ImGui::SameLine();
197 RenderMaterialIcon("fit_screen");
198 }
199
200 // Scale Controls Section
201 if (ImGui::CollapsingHeader(ICON_MD_BUILD " Scale Controls",
202 ImGuiTreeNodeFlags_DefaultOpen)) {
203 RenderSliderWithIcon("Global Scale", "zoom_in", &config.global_scale,
204 0.1f, 10.0f, "%.2f");
205 RenderSliderWithIcon("Grid Step", "grid_on", &config.grid_step, 1.0f,
206 128.0f, "%.1f");
207
208 // Preset scale buttons
209 ImGui::Text(tr("Preset Scales:"));
210 ImGui::SameLine();
211
212 const char* preset_labels[] = {"0.25x", "0.5x", "1x", "2x", "4x", "8x"};
213 const float preset_values[] = {0.25f, 0.5f, 1.0f, 2.0f, 4.0f, 8.0f};
214
215 for (int i = 0; i < 6; ++i) {
216 if (i > 0)
217 ImGui::SameLine();
218 if (ImGui::Button(preset_labels[i])) {
219 config.global_scale = preset_values[i];
220 DispatchConfig(config.on_config_changed, config);
221 }
222 }
223 }
224
225 // Scrolling Controls Section
226 if (ImGui::CollapsingHeader(tr("📜 Scrolling Controls"))) {
227 ImGui::Text(tr("Current Scroll: %.1f, %.1f"), config.scrolling.x,
228 config.scrolling.y);
229
230 if (ImGui::Button(tr("Reset Scroll"))) {
231 config.scrolling = ImVec2(0, 0);
232 DispatchConfig(config.on_config_changed, config);
233 }
234 ImGui::SameLine();
235
236 if (ImGui::Button(tr("Center View")) && bitmap) {
237 config.scrolling = ImVec2(
238 -(bitmap->width() * config.global_scale - config.canvas_size.x) /
239 2.0f,
240 -(bitmap->height() * config.global_scale - config.canvas_size.y) /
241 2.0f);
242 DispatchConfig(config.on_config_changed, config);
243 }
244 }
245
246 // Performance Integration Section
247 if (ImGui::CollapsingHeader(ICON_MD_TRENDING_UP " Performance")) {
248 auto& profiler = gfx::PerformanceProfiler::Get();
249
250 // Get stats for canvas operations
251 auto canvas_stats = profiler.GetStats("canvas_operations");
252 auto draw_stats = profiler.GetStats("canvas_draw");
253
254 RenderMetricPanel("Canvas Operations",
255 std::to_string(canvas_stats.sample_count) + " ops",
256 "speed", ImVec4(0.2F, 1.0F, 0.2F, 1.0F));
257
258 RenderMetricPanel("Average Time",
259 std::to_string(draw_stats.avg_time_us / 1000.0) + " ms",
260 "timer", ImVec4(1.0F, 0.8F, 0.2F, 1.0F));
261
262 if (ImGui::Button(tr("Open Performance Dashboard"))) {
264 }
265 }
266
267 // Action Buttons
268 ImGui::Separator();
269 ImGui::Spacing();
270
271 if (ImGui::Button(tr("Apply Changes"), ImVec2(120, 0))) {
272 DispatchConfig(config.on_config_changed, config);
273 ImGui::CloseCurrentPopup();
274 }
275 ImGui::SameLine();
276
277 if (ImGui::Button(tr("Cancel"), ImVec2(120, 0))) {
278 ImGui::CloseCurrentPopup();
279 }
280 ImGui::SameLine();
281
282 if (ImGui::Button(tr("Reset to Defaults"), ImVec2(150, 0))) {
283 config.global_scale = 1.0f;
284 config.grid_step = 32.0f;
285 config.enable_grid = true;
286 config.enable_hex_labels = false;
287 config.enable_custom_labels = false;
288 config.enable_context_menu = true;
289 config.is_draggable = false;
290 config.auto_resize = false;
291 config.scrolling = ImVec2(0, 0);
292 DispatchConfig(config.on_config_changed, config);
293 }
294
295 ImGui::EndPopup();
296 }
297}
298
299void CanvasModals::RenderScalingControlsModal(const std::string& canvas_id,
300 CanvasConfig& config,
301 const gfx::Bitmap* bitmap) {
302 std::string modal_title = "Canvas Scaling Controls";
303 ImGui::SetNextWindowSize(ImVec2(500, 400), ImGuiCond_FirstUseEver);
304
305 if (ImGui::BeginPopupModal(modal_title.c_str(), nullptr,
306 ImGuiWindowFlags_AlwaysAutoResize)) {
307 // Header with icon
308 ImGui::Text("%s %s", ICON_MD_ZOOM_IN, modal_title.c_str());
309 ImGui::Separator();
310
311 // Global Scale Section
312 ImGui::Text(tr("Global Scale: %.3f"), config.global_scale);
313 RenderSliderWithIcon("##GlobalScale", "zoom_in", &config.global_scale, 0.1f,
314 10.0f, "%.2f");
315
316 // Preset scale buttons
317 ImGui::Text(tr("Preset Scales:"));
318 const char* preset_labels[] = {"0.25x", "0.5x", "1x", "2x", "4x", "8x"};
319 const float preset_values[] = {0.25f, 0.5f, 1.0f, 2.0f, 4.0f, 8.0f};
320
321 for (int i = 0; i < 6; ++i) {
322 if (i > 0)
323 ImGui::SameLine();
324 if (ImGui::Button(preset_labels[i])) {
325 config.global_scale = preset_values[i];
326 DispatchScale(config.on_scale_changed, config);
327 }
328 }
329
330 ImGui::Separator();
331
332 // Grid Configuration Section
333 ImGui::Text(tr("Grid Step: %.1f"), config.grid_step);
334 RenderSliderWithIcon("##GridStep", "grid_on", &config.grid_step, 1.0f,
335 128.0f, "%.1f");
336
337 // Grid size presets
338 ImGui::Text(tr("Grid Presets:"));
339 const char* grid_labels[] = {"8x8", "16x16", "32x32", "64x64"};
340 const float grid_values[] = {8.0f, 16.0f, 32.0f, 64.0f};
341
342 for (int i = 0; i < 4; ++i) {
343 if (i > 0)
344 ImGui::SameLine();
345 if (ImGui::Button(grid_labels[i])) {
346 config.grid_step = grid_values[i];
347 DispatchScale(config.on_scale_changed, config);
348 }
349 }
350
351 ImGui::Separator();
352
353 // Canvas Information Section
354 ImGui::Text(tr("Canvas Information"));
355 ImGui::Text(tr("Canvas Size: %.0f x %.0f"), config.canvas_size.x,
356 config.canvas_size.y);
357 ImGui::Text(tr("Scaled Size: %.0f x %.0f"),
358 config.canvas_size.x * config.global_scale,
359 config.canvas_size.y * config.global_scale);
360
361 if (bitmap) {
362 ImGui::Text(tr("Bitmap Size: %d x %d"), bitmap->width(),
363 bitmap->height());
364 ImGui::Text(
365 tr("Effective Scale: %.3f x %.3f"),
366 (config.canvas_size.x * config.global_scale) / bitmap->width(),
367 (config.canvas_size.y * config.global_scale) / bitmap->height());
368 }
369
370 // Action Buttons
371 ImGui::Separator();
372 ImGui::Spacing();
373
374 if (ImGui::Button(tr("Apply"), ImVec2(120, 0))) {
375 DispatchScale(config.on_scale_changed, config);
376 ImGui::CloseCurrentPopup();
377 }
378 ImGui::SameLine();
379
380 if (ImGui::Button(tr("Cancel"), ImVec2(120, 0))) {
381 ImGui::CloseCurrentPopup();
382 }
383
384 ImGui::EndPopup();
385 }
386}
387
389 const std::string& canvas_id, const BppConversionOptions& options) {
390 std::string modal_title = "BPP Format Conversion";
391 ImGui::SetNextWindowSize(ImVec2(600, 500), ImGuiCond_FirstUseEver);
392
393 if (ImGui::BeginPopupModal(modal_title.c_str(), nullptr,
394 ImGuiWindowFlags_AlwaysAutoResize)) {
395 // Header with icon
396 ImGui::Text("%s %s", ICON_MD_SWAP_HORIZ, modal_title.c_str());
397 ImGui::Separator();
398
399 // Use the existing BppFormatUI for the conversion dialog
400 static std::unique_ptr<gui::BppFormatUI> bpp_ui =
401 std::make_unique<gui::BppFormatUI>(canvas_id + "_bpp_ui");
402
403 // Render the format selector
404 if (options.bitmap && options.palette) {
405 bpp_ui->RenderFormatSelector(const_cast<gfx::Bitmap*>(options.bitmap),
406 *options.palette, options.on_convert);
407 }
408
409 // Action Buttons
410 ImGui::Separator();
411 ImGui::Spacing();
412
413 if (ImGui::Button(tr("Close"), ImVec2(120, 0))) {
414 ImGui::CloseCurrentPopup();
415 }
416
417 ImGui::EndPopup();
418 }
419}
420
422 const std::string& canvas_id, const PaletteEditorOptions& options) {
423 std::string modal_title =
424 options.title.empty() ? "Palette Editor" : options.title;
425 ImGui::SetNextWindowSize(ImVec2(800, 600), ImGuiCond_FirstUseEver);
426
427 if (ImGui::BeginPopupModal(modal_title.c_str(), nullptr,
428 ImGuiWindowFlags_AlwaysAutoResize)) {
429 // Header with icon
430 ImGui::Text("%s %s", ICON_MD_PALETTE, modal_title.c_str());
431 ImGui::Separator();
432
433 // Use the existing PaletteWidget
434 static std::unique_ptr<gui::PaletteEditorWidget> palette_editor =
435 std::make_unique<gui::PaletteEditorWidget>();
436
437 if (options.palette) {
438 palette_editor->ShowPaletteEditor(*options.palette, modal_title);
439 }
440
441 // Action Buttons
442 ImGui::Separator();
443 ImGui::Spacing();
444
445 if (ImGui::Button(tr("Close"), ImVec2(120, 0))) {
446 ImGui::CloseCurrentPopup();
447 }
448
449 ImGui::EndPopup();
450 }
451}
452
454 const std::string& canvas_id, const ColorAnalysisOptions& options) {
455 std::string modal_title = "Color Analysis";
456 ImGui::SetNextWindowSize(ImVec2(700, 500), ImGuiCond_FirstUseEver);
457
458 if (ImGui::BeginPopupModal(modal_title.c_str(), nullptr,
459 ImGuiWindowFlags_AlwaysAutoResize)) {
460 // Header with icon
461 ImGui::Text("%s %s", ICON_MD_ZOOM_IN, modal_title.c_str());
462 ImGui::Separator();
463
464 // Use the existing PaletteWidget for color analysis
465 static std::unique_ptr<gui::PaletteEditorWidget> palette_editor =
466 std::make_unique<gui::PaletteEditorWidget>();
467
468 if (options.bitmap) {
469 palette_editor->ShowColorAnalysis(*options.bitmap, modal_title);
470 }
471
472 // Action Buttons
473 ImGui::Separator();
474 ImGui::Spacing();
475
476 if (ImGui::Button(tr("Close"), ImVec2(120, 0))) {
477 ImGui::CloseCurrentPopup();
478 }
479
480 ImGui::EndPopup();
481 }
482}
483
484void CanvasModals::RenderPerformanceModal(const std::string& canvas_id,
485 const PerformanceOptions& options) {
486 std::string modal_title = "Canvas Performance";
487 ImGui::SetNextWindowSize(ImVec2(500, 300), ImGuiCond_FirstUseEver);
488
489 if (ImGui::BeginPopupModal(modal_title.c_str(), nullptr,
490 ImGuiWindowFlags_AlwaysAutoResize)) {
491 // Header with icon
492 ImGui::Text("%s %s", ICON_MD_TRENDING_UP, modal_title.c_str());
493 ImGui::Separator();
494
495 // Performance metrics
496 RenderMetricPanel("Operation", options.operation_name, "speed",
497 ImVec4(0.2f, 1.0f, 0.2f, 1.0f));
498 RenderMetricPanel("Time", std::to_string(options.operation_time_ms) + " ms",
499 "timer", ImVec4(1.0f, 0.8f, 0.2f, 1.0f));
500
501 // Get overall performance stats
502 auto& profiler = gfx::PerformanceProfiler::Get();
503 auto canvas_stats = profiler.GetStats("canvas_operations");
504 auto draw_stats = profiler.GetStats("canvas_draw");
505
506 RenderMetricPanel("Total Operations",
507 std::to_string(canvas_stats.sample_count), "functions",
508 ImVec4(0.2F, 0.8F, 1.0F, 1.0F));
509 RenderMetricPanel("Average Time",
510 std::to_string(draw_stats.avg_time_us / 1000.0) + " ms",
511 "schedule", ImVec4(0.8F, 0.2F, 1.0F, 1.0F));
512
513 // Action Buttons
514 ImGui::Separator();
515 ImGui::Spacing();
516
517 if (ImGui::Button(tr("Open Dashboard"), ImVec2(150, 0))) {
519 }
520 ImGui::SameLine();
521
522 if (ImGui::Button(tr("Close"), ImVec2(120, 0))) {
523 ImGui::CloseCurrentPopup();
524 }
525
526 ImGui::EndPopup();
527 }
528}
529
530void CanvasModals::OpenModal(const std::string& id,
531 std::function<void()> render_func) {
532 // Check if modal already exists
533 auto it =
534 std::find_if(active_modals_.begin(), active_modals_.end(),
535 [&id](const ModalState& modal) { return modal.id == id; });
536
537 if (it != active_modals_.end()) {
538 it->is_open = true;
539 it->render_func = render_func;
540 } else {
541 active_modals_.push_back({true, id, render_func});
542 }
543
544 // Open the popup
545 ImGui::OpenPopup(id.c_str());
546}
547
548void CanvasModals::CloseModal(const std::string& id) {
549 auto it =
550 std::find_if(active_modals_.begin(), active_modals_.end(),
551 [&id](const ModalState& modal) { return modal.id == id; });
552
553 if (it != active_modals_.end()) {
554 it->is_open = false;
555 }
556}
557
558bool CanvasModals::IsModalOpen(const std::string& id) const {
559 auto it =
560 std::find_if(active_modals_.begin(), active_modals_.end(),
561 [&id](const ModalState& modal) { return modal.id == id; });
562
563 return it != active_modals_.end() && it->is_open;
564}
565
566void CanvasModals::RenderMaterialIcon(const std::string& icon_name,
567 const ImVec4& color) {
568 // Simple material icon rendering using Unicode symbols
569 // In a real implementation, you'd use a proper icon font
570 static std::unordered_map<std::string, const char*> icon_map = {
571 {"grid_on", ICON_MD_GRID_ON},
572 {"label", ICON_MD_LABEL},
573 {"edit", ICON_MD_EDIT},
574 {"menu", ICON_MD_MENU},
575 {"drag_indicator", ICON_MD_DRAG_INDICATOR},
576 {"fit_screen", ICON_MD_FIT_SCREEN},
577 {"zoom_in", ICON_MD_ZOOM_IN},
578 {"speed", ICON_MD_SPEED},
579 {"timer", ICON_MD_TIMER},
580 {"functions", ICON_MD_FUNCTIONS},
581 {"schedule", ICON_MD_SCHEDULE},
582 {"refresh", ICON_MD_REFRESH},
583 {"settings", ICON_MD_SETTINGS},
584 {"info", ICON_MD_INFO}};
585
586 auto it = icon_map.find(icon_name);
587 if (it != icon_map.end()) {
588 ImGui::TextColored(color, "%s", it->second);
589 }
590}
591
592void CanvasModals::RenderMetricPanel(const std::string& title,
593 const std::string& value,
594 const std::string& icon,
595 const ImVec4& color) {
596 ImGui::BeginGroup();
597
598 // Icon and title
599 ImGui::Text("%s %s", icon.c_str(), title.c_str());
600
601 // Value with color
602 ImGui::TextColored(color, "%s", value.c_str());
603
604 ImGui::EndGroup();
605}
606
607void CanvasModals::RenderSliderWithIcon(const std::string& label,
608 const std::string& icon, float* value,
609 float min_val, float max_val,
610 const char* format) {
611 ImGui::Text("%s %s", icon.c_str(), label.c_str());
612 ImGui::SameLine();
613 ImGui::SetNextItemWidth(200);
614 ImGui::SliderFloat(("##" + label).c_str(), value, min_val, max_val, format);
615}
616
617} // namespace gui
618} // namespace yaze
Represents a bitmap image optimized for SNES ROM hacking.
Definition bitmap.h:67
int height() const
Definition bitmap.h:395
int width() const
Definition bitmap.h:394
static PerformanceDashboard & Get()
void SetVisible(bool visible)
Show/hide the dashboard.
static PerformanceProfiler & Get()
void ShowAdvancedProperties(const std::string &canvas_id, const CanvasConfig &config, const gfx::Bitmap *bitmap=nullptr)
Show advanced canvas properties modal.
void ShowPaletteEditor(const std::string &canvas_id, const PaletteEditorOptions &options)
Show palette editor modal.
void RenderSliderWithIcon(const std::string &label, const std::string &icon, float *value, float min_val, float max_val, const char *format="%.2f")
void ShowPerformanceIntegration(const std::string &canvas_id, const PerformanceOptions &options)
Show performance dashboard integration.
std::vector< ModalState > active_modals_
void RenderMetricPanel(const std::string &title, const std::string &value, const std::string &icon, const ImVec4 &color=ImVec4(1, 1, 1, 1))
void RenderMaterialIcon(const std::string &icon_name, const ImVec4 &color=ImVec4(1, 1, 1, 1))
void RenderScalingControlsModal(const std::string &canvas_id, CanvasConfig &config, const gfx::Bitmap *bitmap)
void CloseModal(const std::string &id)
void Render()
Render all active modals.
void RenderPerformanceModal(const std::string &canvas_id, const PerformanceOptions &options)
void OpenModal(const std::string &id, std::function< void()> render_func)
void RenderAdvancedPropertiesModal(const std::string &canvas_id, CanvasConfig &config, const gfx::Bitmap *bitmap)
void RenderBppConversionModal(const std::string &canvas_id, const BppConversionOptions &options)
void RenderPaletteEditorModal(const std::string &canvas_id, const PaletteEditorOptions &options)
void ShowColorAnalysis(const std::string &canvas_id, const ColorAnalysisOptions &options)
Show color analysis modal.
void ShowBppConversionDialog(const std::string &canvas_id, const BppConversionOptions &options)
Show BPP format conversion dialog.
void RenderColorAnalysisModal(const std::string &canvas_id, const ColorAnalysisOptions &options)
void ShowScalingControls(const std::string &canvas_id, const CanvasConfig &config, const gfx::Bitmap *bitmap=nullptr)
Show scaling controls modal.
bool IsAnyModalOpen() const
Check if any modal is open.
bool IsModalOpen(const std::string &id) const
#define ICON_MD_FUNCTIONS
Definition icons.h:863
#define ICON_MD_SETTINGS
Definition icons.h:1699
#define ICON_MD_INFO
Definition icons.h:993
#define ICON_MD_FIT_SCREEN
Definition icons.h:781
#define ICON_MD_TRENDING_UP
Definition icons.h:2016
#define ICON_MD_SWAP_HORIZ
Definition icons.h:1896
#define ICON_MD_REFRESH
Definition icons.h:1572
#define ICON_MD_SCHEDULE
Definition icons.h:1652
#define ICON_MD_LABEL
Definition icons.h:1053
#define ICON_MD_DRAG_INDICATOR
Definition icons.h:624
#define ICON_MD_EDIT
Definition icons.h:645
#define ICON_MD_SPEED
Definition icons.h:1817
#define ICON_MD_GRID_ON
Definition icons.h:896
#define ICON_MD_TIMER
Definition icons.h:1982
#define ICON_MD_IMAGE
Definition icons.h:982
#define ICON_MD_BUILD
Definition icons.h:328
#define ICON_MD_STRAIGHTEN
Definition icons.h:1871
#define ICON_MD_ZOOM_IN
Definition icons.h:2194
#define ICON_MD_MENU
Definition icons.h:1196
#define ICON_MD_PALETTE
Definition icons.h:1370
#define ICON_MD_ANALYTICS
Definition icons.h:154
void DispatchConfig(const std::function< void(const CanvasConfig &)> &callback, const CanvasConfig &config)
void DispatchScale(const std::function< void(const CanvasConfig &)> &callback, const CanvasConfig &config)
BPP conversion options.
std::function< void(gfx::BppFormat)> on_convert
const gfx::SnesPalette * palette
Unified configuration for canvas display and interaction.
std::function< void(const CanvasConfig &) on_config_changed)
std::function< void(const CanvasConfig &) on_scale_changed)
Color analysis options.
Palette editor options.
Performance integration options.