Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::UI::Tools::FreehandBase Class Reference

#include <freehand-base.h>

Inheritance diagram for Inkscape::UI::Tools::FreehandBase:
Inkscape::UI::Tools::ToolBase Inkscape::UI::Tools::PenTool Inkscape::UI::Tools::PencilTool Inkscape::UI::Tools::LpeTool

Public Member Functions

 FreehandBase (SPDesktop *desktop, std::string &&prefs_path, std::string &&cursor_filename)
 
 ~FreehandBase () override
 
std::optional< Geom::Pointred_curve_get_last_point () const
 
void onSelectionModified ()
 
- Public Member Functions inherited from Inkscape::UI::Tools::ToolBase
 ToolBase (SPDesktop *desktop, std::string &&prefs_path, std::string &&cursor_filename, bool uses_snap=true)
 
virtual ~ToolBase ()
 
virtual void set (Preferences::Entry const &val)
 Called by our pref_observer if a preference has been changed.
 
virtual bool item_handler (SPItem *item, CanvasEvent const &event)
 Handles item specific events.
 
virtual void menu_popup (CanvasEvent const &event, SPObject *obj=nullptr)
 Create popup menu and tell Gtk to show it.
 
virtual bool can_undo (bool redo=false)
 
virtual bool is_ready () const
 
virtual void switching_away (std::string const &new_tool)
 
std::string const & getPrefsPath () const
 
void enableSelectionCue (bool enable=true)
 Enables/disables the ToolBase's SelCue.
 
MessageContextdefaultMessageContext () const
 
SPDesktopgetDesktop () const
 
SPGroupcurrentLayer () const
 
void set_last_active_tool (Glib::ustring last_tool)
 
const Glib::ustring & get_last_active_tool () const
 
bool start_root_handler (CanvasEvent const &event)
 Handles snapping events for all tools and then passes to tool_root_handler.
 
bool tool_root_handler (CanvasEvent const &event)
 Calls the right tool's event handler, depending on the selected tool and state.
 
bool start_item_handler (SPItem *item, CanvasEvent const &event)
 Starts handling item snapping and pass to virtual_item_handler afterwards.
 
bool virtual_item_handler (SPItem *item, CanvasEvent const &event)
 
bool is_panning () const
 True if we're panning with any method (space bar, middle-mouse, right-mouse+Ctrl)
 
bool is_space_panning () const
 True if we're panning with the space bar.
 
void snap_delay_handler (gpointer item, gpointer item2, MotionEvent const &event, DelayedSnapEvent::Origin origin)
 Analyses the current event, calculates the mouse speed, turns snapping off (temporarily) if the mouse speed is above a threshold, and stores the current event such that it can be re-triggered when needed (re-triggering is controlled by a timeout).
 
void process_delayed_snap_event ()
 When the delayed snap event timer expires, this method will be called and will re-inject the last motion event in an appropriate place, with snapping being turned on again.
 
void discard_delayed_snap_event ()
 If a delayed snap event has been scheduled, this function will cancel it.
 
void set_cursor (std::string filename)
 Sets the current cursor to the given filename.
 
void use_cursor (Glib::RefPtr< Gdk::Cursor > cursor)
 Set the cursor to this specific one, don't remember it.
 
Glib::RefPtr< Gdk::Cursor > get_cursor (Gtk::Widget &widget, std::string const &filename) const
 Returns the Gdk Cursor for the given filename.
 
void use_tool_cursor ()
 Uses the saved cursor, based on the saved filename.
 
void enableGrDrag (bool enable=true)
 
bool deleteSelectedDrag (bool just_one)
 Delete a selected GrDrag point.
 
bool hasGradientDrag () const
 Return true if there is a gradient drag.
 
GrDragget_drag ()
 

Public Attributes

Selectionselection = nullptr
 
CanvasItemPtr< CanvasItemBpathred_bpath
 
Geom::PathVector red_curve
 
CanvasItemPtr< CanvasItemBpathblue_bpath
 
Geom::PathVector blue_curve
 
std::vector< CanvasItemPtr< CanvasItemBpath > > green_bpaths
 
std::shared_ptr< Geom::PathVectorgreen_curve
 
std::unique_ptr< SPDrawAnchorgreen_anchor
 
bool green_closed = false
 
SPItemwhite_item = nullptr
 
std::vector< std::shared_ptr< Geom::PathVector > > white_curves
 
std::vector< std::unique_ptr< SPDrawAnchor > > white_anchors
 
std::shared_ptr< Geom::PathVectorsa_overwrited
 
SPDrawAnchorsa = nullptr
 
SPDrawAnchorea = nullptr
 
LivePathEffect::EffectType waiting_LPE_type = LivePathEffect::INVALID_LPE
 
sigc::connection sel_changed_connection
 
sigc::connection sel_modified_connection
 
bool red_curve_is_valid = false
 
bool anchor_statusbar = false
 
bool tablet_enabled = false
 
bool is_tablet = false
 
double pressure = 1.0
 
- Public Attributes inherited from Inkscape::UI::Tools::ToolBase
std::unique_ptr< MessageContextmessage_context
 
SelCue_selcue = nullptr
 
GrDrag_grdrag = nullptr
 
ShapeEditorshape_editor = nullptr
 
bool _uses_snap = false
 

Protected Member Functions

bool root_handler (CanvasEvent const &event) override
 
void _attachSelection ()
 
- Protected Member Functions inherited from Inkscape::UI::Tools::ToolBase
void setup_for_drag_start (ButtonPressEvent const &ev)
 
void saveDragOrigin (Geom::Point const &pos)
 
bool checkDragMoved (Geom::Point const &pos)
 Analyse the current position and return true once it has moved farther than tolerance from the drag origin (indicating they intend to move the object, not click).
 
void grabCanvasEvents (EventMask mask=EventType::KEY_PRESS|EventType::BUTTON_RELEASE|EventType::MOTION|EventType::BUTTON_PRESS)
 Grab events from the Canvas Catchall.
 
void ungrabCanvasEvents ()
 Ungrab events from the Canvas Catchall.
 
bool sp_event_context_knot_mouseover () const
 Returns true if we're hovering above a knot (needed because we don't want to pre-snap in that case).
 
void set_high_motion_precision (bool high_precision=true)
 Enable (or disable) high precision for motion events.
 

Protected Attributes

uint32_t red_color = 0xff00007f
 
uint32_t blue_color = 0x0000ff7f
 
uint32_t green_color = 0x00ff007f
 
uint32_t highlight_color = 0x0000007f
 
- Protected Attributes inherited from Inkscape::UI::Tools::ToolBase
Glib::RefPtr< Gdk::Cursor > _cursor
 
std::string _cursor_filename = "select.svg"
 
std::string _cursor_default = "select.svg"
 
Geom::IntPoint xyp
 where drag started
 
bool dragging = false
 are we dragging?
 
int tolerance = 0
 
bool within_tolerance = false
 are we still within tolerance of origin
 
bool _button1on = false
 
bool _button2on = false
 
bool _button3on = false
 
SPItemitem_to_select = nullptr
 the item where mouse_press occurred, to be selected if this is a click not drag
 
SPDesktop_desktop = nullptr
 
Util::ActionAccel _acc_undo
 
Util::ActionAccel _acc_redo
 
Util::ActionAccel _acc_quick_preview
 
Util::ActionAccel _acc_quick_zoom
 
Util::ActionAccel _acc_quick_pan
 

Detailed Description

Definition at line 44 of file freehand-base.h.

Constructor & Destructor Documentation

◆ FreehandBase()

◆ ~FreehandBase()

Inkscape::UI::Tools::FreehandBase::~FreehandBase ( )
override

Member Function Documentation

◆ _attachSelection()

void Inkscape::UI::Tools::FreehandBase::_attachSelection ( )
protected

◆ onSelectionModified()

void Inkscape::UI::Tools::FreehandBase::onSelectionModified ( )

Definition at line 530 of file freehand-base.cpp.

References _attachSelection().

Referenced by FreehandBase(), and Inkscape::UI::Tools::spdc_flush_white().

◆ red_curve_get_last_point()

std::optional< Geom::Point > Inkscape::UI::Tools::FreehandBase::red_curve_get_last_point ( ) const

◆ root_handler()

Member Data Documentation

◆ anchor_statusbar

◆ blue_bpath

◆ blue_color

uint32_t Inkscape::UI::Tools::FreehandBase::blue_color = 0x0000ff7f
protected

◆ blue_curve

◆ ea

◆ green_anchor

◆ green_bpaths

◆ green_closed

bool Inkscape::UI::Tools::FreehandBase::green_closed = false

◆ green_color

◆ green_curve

◆ highlight_color

uint32_t Inkscape::UI::Tools::FreehandBase::highlight_color = 0x0000007f
protected

◆ is_tablet

◆ pressure

◆ red_bpath

◆ red_color

uint32_t Inkscape::UI::Tools::FreehandBase::red_color = 0xff00007f
protected

◆ red_curve

◆ red_curve_is_valid

◆ sa

◆ sa_overwrited

◆ sel_changed_connection

sigc::connection Inkscape::UI::Tools::FreehandBase::sel_changed_connection

Definition at line 91 of file freehand-base.h.

Referenced by FreehandBase(), and ~FreehandBase().

◆ sel_modified_connection

sigc::connection Inkscape::UI::Tools::FreehandBase::sel_modified_connection

Definition at line 92 of file freehand-base.h.

Referenced by FreehandBase(), and ~FreehandBase().

◆ selection

◆ tablet_enabled

◆ waiting_LPE_type

◆ white_anchors

std::vector<std::unique_ptr<SPDrawAnchor> > Inkscape::UI::Tools::FreehandBase::white_anchors

◆ white_curves

std::vector<std::shared_ptr<Geom::PathVector> > Inkscape::UI::Tools::FreehandBase::white_curves

◆ white_item


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