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