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.
Loading...
Searching...
No Matches
SidebarPresenter.h File Reference
#include <array>
#include <cstdint>
#include <functional>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <unordered_set>
#include <utility>
#include <vector>
#include "donner/base/Box.h"
#include "donner/base/EcsRegistry.h"
#include "donner/base/Transform.h"
#include "donner/base/Vector2.h"
#include "donner/editor/AttributeWriteback.h"
#include "donner/editor/EditorApp.h"
#include "donner/editor/ImGuiIncludes.h"
#include "donner/editor/ViewportState.h"
#include "donner/svg/renderer/RendererInterface.h"
Include dependency graph for SidebarPresenter.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::editor::TreeViewState
struct  donner::editor::DecomposedTransform
 Scale-rotate-translate view of a transform, used by the inspector's editable transform fields. The equivalent matrix is Scale(scale) * Rotate(rotationRadians) * Translate(translation) with Donner's apply-left-to-right composition (scale first, translation last). More...
struct  donner::editor::InspectorStyleDisplayValue
 User-facing form of a computed CSS value and its provenance. More...
class  donner::editor::SidebarPresenter
 Renders the editor's tree view and inspector panes. More...
struct  donner::editor::SidebarPresenter::IconTexture
 Maps a static path-operation 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...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Enumerations

enum class  donner::editor::InspectorStyleState : std::uint8_t {
  Unspecified ,
  Default ,
  Set
}
 Provenance shown beside a computed CSS value in the Inspector. More...

Functions

std::optional< DecomposedTransformdonner::editor::DecomposeTransform (const Transform2d &transform)
 Decompose transform into scale, rotation, and translation.
Transform2d donner::editor::ComposeTransform (const DecomposedTransform &decomposed)
 Compose the decomposed fields back into a matrix: scale is applied first, then rotation, then translation. Inverse of DecomposeTransform for every decomposable matrix.
InspectorStyleDisplayValue donner::editor::FormatInspectorStyleValue (std::string_view serializedValue)
 Convert the Inspector's serialized computed-style value to user-facing CSS.

Class Documentation

◆ donner::editor::SidebarPresenter::IconTexture

struct donner::editor::SidebarPresenter::IconTexture

Maps a static path-operation 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.

Parameters
stableIdStable id of the static icon resource being uploaded.
bitmapThe Donner-rendered RGBA icon bitmap.
Returns
An ImGui texture handle plus the valid payload UV range, or an empty texture if upload failed.
Class Members
ImTextureID texture = 0 ImGui texture handle.
Vector2d uvBottomRight = Vector2d(1.0, 1.0) Bottom-right valid payload UV.

Enumeration Type Documentation

◆ InspectorStyleState

enum class donner::editor::InspectorStyleState : std::uint8_t
strong

Provenance shown beside a computed CSS value in the Inspector.

Enumerator
Unspecified 

The serialized value did not include provenance metadata.

Default 

The computed value comes from the property's default.

Set 

The computed value was set by the active style cascade.

Function Documentation

◆ DecomposeTransform()

std::optional< DecomposedTransform > donner::editor::DecomposeTransform ( const Transform2d & transform)
nodiscard

Decompose transform into scale, rotation, and translation.

Returns std::nullopt when the matrix cannot be represented without a skew component (its basis columns are not orthogonal) or is singular (zero-length x basis). Callers should fall back to raw matrix editing in that case rather than force-fitting the fields.

◆ FormatInspectorStyleValue()

InspectorStyleDisplayValue donner::editor::FormatInspectorStyleValue ( std::string_view serializedValue)
nodiscard

Convert the Inspector's serialized computed-style value to user-facing CSS.

Removes the snapshot's provenance suffix and internal PaintServer(...) or Color(...) wrappers while preserving the actual CSS value.

Parameters
serializedValueValue captured by the Inspector snapshot.
Returns
CSS-shaped value plus the captured provenance state.