Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
Tool.h File Reference

Tool is the abstract interface for editor pointer tools (Select, future Path, future Node-edit, etc.). Tools observe the editor state via the EditorApp& parameter and produce DOM mutations exclusively by calling EditorApp::applyMutation() — they never touch the DOM directly. More...

Include dependency graph for Tool.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::editor::MouseModifiers
 Modifier-key state captured at the moment a mouse event was dispatched. Tools use this for shift-add-to-selection, alt-clone, etc. Default-constructed = no modifiers, which keeps existing callsites that don't care about modifiers source-compatible. More...
class  donner::editor::Tool
 Abstract editor pointer tool. Implementations are stateless across document load (the editor recreates them on document change is fine since Tool instances are cheap), but may carry per-drag state. More...

Namespaces

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

Detailed Description

Tool is the abstract interface for editor pointer tools (Select, future Path, future Node-edit, etc.). Tools observe the editor state via the EditorApp& parameter and produce DOM mutations exclusively by calling EditorApp::applyMutation() — they never touch the DOM directly.

Coordinates passed to tool methods are in document space (the same coordinate system as the SVG canvas). Coordinate translation from screen space happens at the main-loop layer using donner::editor::ViewportGeometry, so tools are insulated from the viewport / pan / zoom state.