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

Desktop-bound selectable control object. More...

#include <selectable-control-point.h>

Inheritance diagram for Inkscape::UI::SelectableControlPoint:
Inkscape::UI::ControlPoint Inkscape::UI::Node

Public Member Functions

 ~SelectableControlPoint () override
 
bool selected () const
 
void updateState ()
 
virtual Geom::Rect bounds () const
 
virtual void select (bool toselect)
 
- Public Member Functions inherited from Inkscape::UI::ControlPoint
virtual ~ControlPoint ()
 
 ControlPoint (ControlPoint const &other)=delete
 
void operator= (ControlPoint const &other)=delete
 
static Glib::ustring virtual bool _eventHandler (Inkscape::UI::Tools::ToolBase *event_context, CanvasEvent const &event)
 
bool doubleClicked () const
 
void set_selected_appearance (bool selected)
 
Geom::Point const & position () const
 Current position of the control point.
 
virtual void move (Geom::Point const &pos)
 Move the control point to new position with side effects.
 
virtual void setPosition (Geom::Point const &pos)
 Relocate the control point without side effects.
 
virtual void transform (Geom::Affine const &m)
 Apply an arbitrary affine transformation to a control point.
 
virtual void fixNeighbors ()
 Apply any node repairs, by default no fixing is applied but Nodes will update smooth nodes to make sure nodes are kept consistent.
 
bool visible () const
 
virtual void setVisible (bool v)
 Set the visibility of the control point.
 
void transferGrab (ControlPoint *from, MotionEvent const &event)
 Transfer the grab to another point.
 
State state () const
 
bool mouseovered () const
 

Protected Member Functions

 SelectableControlPoint (SPDesktop *d, Geom::Point const &initial_pos, SPAnchorType anchor, Inkscape::CanvasItemCtrlType type, ControlPointSelection &sel, Inkscape::CanvasItemGroup *group=nullptr)
 
void _setState (State state) override
 Change the state of the knot.
 
void dragged (Geom::Point &new_pos, MotionEvent const &event) override
 Called while dragging, but before moving the knot to new position.
 
bool grabbed (MotionEvent const &event) override
 Called when the user moves the point beyond the drag tolerance with the first button held down.
 
void ungrabbed (ButtonReleaseEvent const *event) override
 Called when the control point finishes a drag.
 
bool clicked (ButtonReleaseEvent const &event) override
 Called when the control point is clicked, at mouse button release.
 
- Protected Member Functions inherited from Inkscape::UI::ControlPoint
 ControlPoint (SPDesktop *d, Geom::Point const &initial_pos, SPAnchorType anchor, Inkscape::CanvasItemCtrlType type, Inkscape::CanvasItemGroup *group=nullptr)
 Create a regular control point.
 
virtual bool doubleclicked (ButtonReleaseEvent const &event)
 Called when the control point is doubleclicked, at mouse button release.
 
void _handleControlStyling ()
 
void _setSize (unsigned int size)
 
void _setControlType (Inkscape::CanvasItemCtrlType type)
 
void _setAnchor (SPAnchorType anchor)
 
virtual Glib::ustring _getTip (unsigned) const
 
virtual Glib::ustring _getDragTip (MotionEvent const &event) const
 
virtual bool _hasDragTips () const
 

Protected Attributes

ControlPointSelection_selection
 
- Protected Attributes inherited from Inkscape::UI::ControlPoint
CanvasItemPtr< Inkscape::CanvasItemCtrl_canvas_item_ctrl
 Visual representation of the control point.
 
State _state = STATE_NORMAL
 

Private Member Functions

void _takeSelection ()
 

Friends

class NodeList
 

Additional Inherited Members

- Public Types inherited from Inkscape::UI::ControlPoint
enum  State { STATE_NORMAL , STATE_MOUSEOVER , STATE_CLICKED }
 Enumeration representing the possible states of the control point, used to determine its appearance. More...
 
- Static Public Member Functions inherited from Inkscape::UI::ControlPoint
static Glib::ustring format_tip (char const *format,...) G_GNUC_PRINTF(1
 
- Public Attributes inherited from Inkscape::UI::ControlPoint
SPDesktop *const _desktop
 The desktop this control point resides on.
 
- Static Public Attributes inherited from Inkscape::UI::ControlPoint
static ControlPointmouseovered_point = nullptr
 Holds the currently mouseovered control point.
 
static sigc::signal< void(ControlPoint *)> signal_mouseover_change
 Emitted when the mouseovered point changes.
 
- Static Protected Member Functions inherited from Inkscape::UI::ControlPoint
static Geom::Point const & _last_click_event_point ()
 
static Geom::Point const & _last_drag_origin ()
 
static bool _is_drag_cancelled (MotionEvent const &event)
 
- Static Protected Attributes inherited from Inkscape::UI::ControlPoint
static bool _drag_initiated = false
 

Detailed Description

Desktop-bound selectable control object.

Definition at line 22 of file selectable-control-point.h.

Constructor & Destructor Documentation

◆ ~SelectableControlPoint()

Inkscape::UI::SelectableControlPoint::~SelectableControlPoint ( )
override

◆ SelectableControlPoint()

Inkscape::UI::SelectableControlPoint::SelectableControlPoint ( SPDesktop d,
Geom::Point const &  initial_pos,
SPAnchorType  anchor,
Inkscape::CanvasItemCtrlType  type,
ControlPointSelection sel,
Inkscape::CanvasItemGroup group = nullptr 
)
protected

Member Function Documentation

◆ _setState()

void Inkscape::UI::SelectableControlPoint::_setState ( State  state)
overrideprotectedvirtual

◆ _takeSelection()

void Inkscape::UI::SelectableControlPoint::_takeSelection ( )
private

◆ bounds()

virtual Geom::Rect Inkscape::UI::SelectableControlPoint::bounds ( ) const
inlinevirtual

◆ clicked()

bool Inkscape::UI::SelectableControlPoint::clicked ( ButtonReleaseEvent const &  event)
overrideprotectedvirtual

Called when the control point is clicked, at mouse button release.

Improperly implementing this method can cause the default context menu not to appear when a control point is right-clicked.

Parameters
eventButton release event
Returns
true if the click had some effect, false if it did nothing.

Reimplemented from Inkscape::UI::ControlPoint.

Definition at line 54 of file selectable-control-point.cpp.

References Inkscape::UI::ControlPointSelection::_pointClicked(), _selection, _takeSelection(), Inkscape::ButtonEvent::button, Inkscape::UI::ControlPointSelection::erase(), Inkscape::UI::ControlPointSelection::insert(), Inkscape::mod_shift(), and selected().

Referenced by Inkscape::UI::Node::clicked().

◆ dragged()

void Inkscape::UI::SelectableControlPoint::dragged ( Geom::Point new_pos,
MotionEvent const &  event 
)
overrideprotectedvirtual

Called while dragging, but before moving the knot to new position.

Parameters
posOld position, always equal to position()
new_posNew position (after drag). This is passed as a non-const reference, so you can change it from the handler - that's how constrained dragging is implemented.
eventMotion event.

Reimplemented from Inkscape::UI::ControlPoint.

Definition at line 44 of file selectable-control-point.cpp.

References Inkscape::UI::ControlPointSelection::_pointDragged(), and _selection.

Referenced by Inkscape::UI::Node::dragged().

◆ grabbed()

bool Inkscape::UI::SelectableControlPoint::grabbed ( MotionEvent const &  event)
overrideprotectedvirtual

Called when the user moves the point beyond the drag tolerance with the first button held down.

Parameters
eventMotion event when drag tolerance was exceeded.
Returns
true if you called transferGrab() during this method.

Reimplemented from Inkscape::UI::ControlPoint.

Definition at line 34 of file selectable-control-point.cpp.

References Inkscape::UI::ControlPointSelection::_pointGrabbed(), _selection, _takeSelection(), and selected().

Referenced by Inkscape::UI::Node::grabbed().

◆ select()

void Inkscape::UI::SelectableControlPoint::select ( bool  toselect)
virtual

◆ selected()

◆ ungrabbed()

void Inkscape::UI::SelectableControlPoint::ungrabbed ( ButtonReleaseEvent const *  event)
overrideprotectedvirtual

Called when the control point finishes a drag.

Parameters
eventButton release event

Reimplemented from Inkscape::UI::ControlPoint.

Definition at line 49 of file selectable-control-point.cpp.

References Inkscape::UI::ControlPointSelection::_pointUngrabbed(), and _selection.

◆ updateState()

Friends And Related Symbol Documentation

◆ NodeList

friend class NodeList
friend

Definition at line 33 of file selectable-control-point.h.

Member Data Documentation

◆ _selection


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