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