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

Canonical editor tool identity plus its industry-standard single-key shortcut and display label. Kept as a tiny pure header (no ImGui, no EditorShell) so the toolbar tooltip text and the keyboard shortcut handler share one source of truth and the mapping can be unit-tested without a live ImGui/GL context. More...

#include <array>
#include <cstdint>
#include <string_view>
Include dependency graph for ToolKeybinding.h:

Classes

struct  donner::editor::ToolKeybinding
 Display label and single-key shortcut for a tool. key is the binding design-tool users expect (Selection = V, Pen = P, Type = T); label is the tool's human name. The toolbar renders the tooltip as "<label> (<key>)". 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::ToolId : std::uint8_t {
  Select ,
  Pen ,
  Text
}
 The editor's interactive tools. Mirrors EditorShell::ActiveTool one-to-one; kept as a standalone enum so the keybinding mapping is testable in isolation. More...

Functions

constexpr ToolKeybinding donner::editor::KeybindingForTool (ToolId tool)
 Map a tool to its display label and standard shortcut key.

Variables

constexpr std::array< ToolId, 3 > donner::editor::kToolbarTools
 The full toolbar tool list in display (top-to-bottom) order. The single source of truth shared by the toolbar buttons, the tooltip text, and the keyboard shortcut handler.

Detailed Description

Canonical editor tool identity plus its industry-standard single-key shortcut and display label. Kept as a tiny pure header (no ImGui, no EditorShell) so the toolbar tooltip text and the keyboard shortcut handler share one source of truth and the mapping can be unit-tested without a live ImGui/GL context.

Enumeration Type Documentation

◆ ToolId

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

The editor's interactive tools. Mirrors EditorShell::ActiveTool one-to-one; kept as a standalone enum so the keybinding mapping is testable in isolation.

Enumerator
Select 

Selection / Arrow tool.

Pen 

Pen (path) tool.

Text 

Type / Text tool.

Variable Documentation

◆ kToolbarTools

std::array<ToolId, 3> donner::editor::kToolbarTools
inlineconstexpr
Initial value:
= {
}
@ Text
Type / Text tool.
Definition ToolKeybinding.h:21
@ Select
Selection / Arrow tool.
Definition ToolKeybinding.h:19
@ Pen
Pen (path) tool.
Definition ToolKeybinding.h:20

The full toolbar tool list in display (top-to-bottom) order. The single source of truth shared by the toolbar buttons, the tooltip text, and the keyboard shortcut handler.