Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::editor::Tool Class Referenceabstract

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"

Inheritance diagram for donner::editor::Tool:
[legend]

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.

Detailed Description

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.

Member Function Documentation

◆ onMouseDown()

virtual void donner::editor::Tool::onMouseDown ( EditorApp & editor,
const Vector2d & documentPoint,
MouseModifiers modifiers )
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::SelectTool.

◆ onMouseMove()

virtual void donner::editor::Tool::onMouseMove ( EditorApp & editor,
const Vector2d & documentPoint,
bool buttonHeld )
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::SelectTool.

◆ onMouseUp()

virtual void donner::editor::Tool::onMouseUp ( EditorApp & editor,
const Vector2d & documentPoint )
pure virtual

Mouse button was released at documentPoint.

Implemented in donner::editor::SelectTool.


The documentation for this class was generated from the following file: