|
|
Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
|
LayersPanel is the user-facing Layers panel UI. It renders the flat LayerTreeModel row list as an ImGui tree with disclosure chevrons, per-row preview thumbnails, and selection that stays synchronized with the canvas and source panes. More...
#include <cstdint>#include <functional>#include <optional>#include <string>#include <unordered_map>#include <vector>#include "donner/base/Vector2.h"#include "donner/css/Color.h"#include "donner/editor/EditorApp.h"#include "donner/editor/ImGuiIncludes.h"#include "donner/editor/LayerTreeModel.h"#include "donner/svg/renderer/RendererInterface.h"Classes | |
| struct | donner::editor::LayersLockedRejectionFlash |
| Current "this element is locked, you can't select it" flash fed into the Layers panel so the rejected element's row flashes red in sync with the canvas outline flash. Mirrors OverlayRenderer.h's LockedRejectionFlashInput but is kept local so LayersPanel stays decoupled from SelectTool / OverlayRenderer; EditorShell maps the tool's flash into this struct. More... | |
| class | donner::editor::LayersPanel |
| ImGui Layers panel backed by a LayerTreeModel snapshot. More... | |
| struct | donner::editor::LayersPanel::ThumbnailTexture |
| Maps a per-row rendered thumbnail bitmap to an ImGui texture handle for display. The editor shell supplies an implementation backed by GlTextureCache (the same Donner-bitmap -> GL/WGPU texture path the render pane uses); when null (e.g. in headless unit tests) the panel falls back to the deterministic swatch. Donner renders the thumbnail pixels; ImGui only blits the resulting texture - see CLAUDE.md "No Rendering Vector Graphics
With ImGui". More... | |
| struct | donner::editor::LayersPanel::IconTexture |
| Maps a static layer-affordance icon bitmap to an ImGui texture handle for display. The icon bitmaps are rendered from embedded Bootstrap SVG resources through Donner; ImGui only receives the final raster texture for the image button. More... | |
| struct | donner::editor::LayersPanel::ThumbnailRefreshStats |
| Diagnostics for the most recent thumbnail refresh. More... | |
| struct | donner::editor::LayersPanel::ClickModifiers |
| Modifier state for a row click. Mirrors the ImGui click path so tests can drive selection without a live ImGui frame. More... | |
Namespaces | |
| namespace | donner |
| Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css. | |
LayersPanel is the user-facing Layers panel UI. It renders the flat LayerTreeModel row list as an ImGui tree with disclosure chevrons, per-row preview thumbnails, and selection that stays synchronized with the canvas and source panes.
Selection requests flow out through the live EditorApp (setSelection, toggleInSelection), mirroring SidebarPresenter's discipline: when the async renderer owns the document, clicks are dropped rather than racing the worker.
The panel deliberately exposes non-ImGui testing seams (rows, handleRowClick, hasThumbnailOrSwatch, rowFallbackSwatch, rowThumbnail) so the selection logic and preview guarantees can be exercised without an ImGui frame.
| struct donner::editor::LayersPanel::ThumbnailTexture |
Maps a per-row rendered thumbnail bitmap to an ImGui texture handle for display. The editor shell supplies an implementation backed by GlTextureCache (the same Donner-bitmap -> GL/WGPU texture path the render pane uses); when null (e.g. in headless unit tests) the panel falls back to the deterministic swatch. Donner renders the thumbnail pixels; ImGui only blits the resulting texture - see CLAUDE.md "No Rendering Vector Graphics With ImGui".
| stableId | Stable id of the row whose thumbnail is being uploaded. |
| bitmap | The Donner-rendered RGBA thumbnail bitmap. |
| Class Members | ||
|---|---|---|
| ImTextureID | texture = 0 | ImGui texture handle. |
| Vector2d | uvBottomRight = Vector2d(1.0, 1.0) | Bottom-right valid payload UV. |
| struct donner::editor::LayersPanel::IconTexture |
Maps a static layer-affordance icon bitmap to an ImGui texture handle for display. The icon bitmaps are rendered from embedded Bootstrap SVG resources through Donner; ImGui only receives the final raster texture for the image button.
| stableId | Stable id of the static icon resource being uploaded. |
| bitmap | The Donner-rendered RGBA icon bitmap. |
| Class Members | ||
|---|---|---|
| ImTextureID | texture = 0 | ImGui texture handle. |
| Vector2d | uvBottomRight = Vector2d(1.0, 1.0) | Bottom-right valid payload UV. |
| struct donner::editor::LayersPanel::ThumbnailRefreshStats |
Diagnostics for the most recent thumbnail refresh.
| struct donner::editor::LayersPanel::ClickModifiers |