|
|
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.
|
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...
#include "donner/editor/Tool.h"
Public Member Functions | |
| Tool (const Tool &)=delete | |
| Tool & | operator= (const Tool &)=delete |
| Tool (Tool &&)=delete | |
| Tool & | operator= (Tool &&)=delete |
| virtual void | onMouseDown (EditorApp &editor, const Vector2d &documentPoint, MouseModifiers modifiers)=0 |
| Mouse button (left) was pressed at documentPoint. modifiers captures the modifier-key state at the moment of the press; implementations that don't care can ignore it. Default arguments on virtuals are banned by the style guide, so callers that don't need modifier state should pass MouseModifiers{} explicitly. | |
| virtual void | onMouseMove (EditorApp &editor, const Vector2d &documentPoint, bool buttonHeld)=0 |
| Mouse moved to documentPoint. buttonHeld is true while the left button is down - i.e., this is a drag continuation rather than a hover. | |
| virtual void | onMouseUp (EditorApp &editor, const Vector2d &documentPoint)=0 |
| Mouse button was released at documentPoint. | |
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.
|
pure virtual |
Mouse button (left) was pressed at documentPoint. modifiers captures the modifier-key state at the moment of the press; implementations that don't care can ignore it. Default arguments on virtuals are banned by the style guide, so callers that don't need modifier state should pass MouseModifiers{} explicitly.
Implemented in donner::editor::PenTool, donner::editor::SelectTool, and donner::editor::TextTool.
|
pure virtual |
Mouse moved to documentPoint. buttonHeld is true while the left button is down - i.e., this is a drag continuation rather than a hover.
Implemented in donner::editor::PenTool, donner::editor::SelectTool, and donner::editor::TextTool.
|
pure virtual |
Mouse button was released at documentPoint.
Implemented in donner::editor::PenTool, donner::editor::SelectTool, and donner::editor::TextTool.