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
ToolbarIconSet.h File Reference

Toolbar tool icons, rendered from embedded two-tone SVG art through Donner. Black cores and white halos are preserved so the toolbar and OS cursors use one contrast system on every surface (see donner/editor/art/STYLE.md). More...

#include <array>
#include <cstdint>
#include <functional>
#include <optional>
#include <span>
#include "donner/base/Vector2.h"
#include "donner/editor/ImGuiIncludes.h"
#include "donner/svg/renderer/RendererInterface.h"
Include dependency graph for ToolbarIconSet.h:

Classes

struct  donner::editor::ToolbarIconTexture
 An uploaded icon texture plus the valid payload UV range (icon bitmaps may be padded to a texture-friendly size). More...

Namespaces

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

Typedefs

using donner::editor::ToolbarIconTextureProvider
 Uploads a Donner-rendered icon mask bitmap to an ImGui texture. Mirrors the IconTextureProvider callbacks the layers/inspector panels already pass down, so the shell reuses one texture-upload path.

Enumerations

enum class  donner::editor::ToolbarIcon : std::uint8_t {
  Select ,
  Pen ,
  Text
}
 A tool that has a toolbar icon. Mirrors the palette buttons in display order; kept standalone so the registry-coverage test can iterate it without a live ImGui context. More...

Functions

std::span< const unsigned char > donner::editor::ToolbarIconSvg (ToolbarIcon icon)
 Embedded SVG source bytes for icon.
std::uint64_t donner::editor::ToolbarIconTextureKey (ToolbarIcon icon)
 Stable texture-cache key for icon.
const std::optional< svg::RendererBitmap > & donner::editor::CachedToolbarIconBitmap (ToolbarIcon icon)
 The Donner-rendered two-tone bitmap for icon, rendered once and cached for the process lifetime. std::nullopt if parsing/rendering failed.
void donner::editor::DrawToolbarIcon (ToolbarIcon icon, const ImVec2 &min, const ImVec2 &max, ImU32 tintColor, const ToolbarIconTextureProvider &provider)
 Draw icon centered within the button rect [min, max], tinted with tintColor. No-op when provider is null or the icon can't be uploaded (e.g. headless tests with no GL context), leaving the button blank rather than crashing.

Variables

constexpr std::array< ToolbarIcon, 3 > donner::editor::kToolbarIcons
 Every toolbar icon, in palette order. The single source of truth for the icon registry and its coverage test.

Detailed Description

Toolbar tool icons, rendered from embedded two-tone SVG art through Donner. Black cores and white halos are preserved so the toolbar and OS cursors use one contrast system on every surface (see donner/editor/art/STYLE.md).

Typedef Documentation

◆ ToolbarIconTextureProvider

Initial value:
std::function<ToolbarIconTexture(std::uint64_t stableId, const svg::RendererBitmap& bitmap)>
An uploaded icon texture plus the valid payload UV range (icon bitmaps may be padded to a texture-fri...
Definition ToolbarIconSet.h:39
CPU-readable bitmap produced by a renderer snapshot.
Definition RendererInterface.h:59

Uploads a Donner-rendered icon mask bitmap to an ImGui texture. Mirrors the IconTextureProvider callbacks the layers/inspector panels already pass down, so the shell reuses one texture-upload path.

Enumeration Type Documentation

◆ ToolbarIcon

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

A tool that has a toolbar icon. Mirrors the palette buttons in display order; kept standalone so the registry-coverage test can iterate it without a live ImGui context.

Enumerator
Select 

Selection / arrow tool.

Pen 

Pen (path) tool.

Text 

Type / text tool.

Variable Documentation

◆ kToolbarIcons

std::array<ToolbarIcon, 3> donner::editor::kToolbarIcons
inlineconstexpr
Initial value:
= {
}
@ Text
Type / text tool.
Definition ToolbarIconSet.h:26
@ Select
Selection / arrow tool.
Definition ToolbarIconSet.h:24
@ Pen
Pen (path) tool.
Definition ToolbarIconSet.h:25

Every toolbar icon, in palette order. The single source of truth for the icon registry and its coverage test.