Inkscape
Vector Graphics Editor
|
Desktop-bound selectable control object. More...
#include <selectable-control-point.h>
Public Member Functions | |
~SelectableControlPoint () override | |
bool | selected () const |
void | updateState () |
virtual Geom::Rect | bounds () const |
virtual void | select (bool toselect) |
![]() | |
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. | |
![]() | |
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 |
![]() | |
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 | |
![]() | |
enum | State { STATE_NORMAL , STATE_MOUSEOVER , STATE_CLICKED } |
Enumeration representing the possible states of the control point, used to determine its appearance. More... | |
![]() | |
static Glib::ustring | format_tip (char const *format,...) G_GNUC_PRINTF(1 |
![]() | |
SPDesktop *const | _desktop |
The desktop this control point resides on. | |
![]() | |
static ControlPoint * | mouseovered_point = nullptr |
Holds the currently mouseovered control point. | |
static sigc::signal< void(ControlPoint *)> | signal_mouseover_change |
Emitted when the mouseovered point changes. | |
![]() | |
static Geom::Point const & | _last_click_event_point () |
static Geom::Point const & | _last_drag_origin () |
static bool | _is_drag_cancelled (MotionEvent const &event) |
![]() | |
static bool | _drag_initiated = false |
Desktop-bound selectable control object.
Definition at line 22 of file selectable-control-point.h.
|
override |
Definition at line 28 of file selectable-control-point.cpp.
References _selection, Inkscape::UI::ControlPointSelection::allPoints(), and Inkscape::UI::ControlPointSelection::erase().
|
protected |
Definition at line 17 of file selectable-control-point.cpp.
References Inkscape::UI::ControlPoint::_canvas_item_ctrl, _selection, and Inkscape::UI::ControlPointSelection::allPoints().
|
overrideprotectedvirtual |
Change the state of the knot.
Alters the appearance of the knot to match one of the states: normal, mouseover or clicked.
Reimplemented from Inkscape::UI::ControlPoint.
Definition at line 94 of file selectable-control-point.cpp.
References Inkscape::UI::ControlPoint::_canvas_item_ctrl, Inkscape::UI::ControlPoint::_setState(), Inkscape::UI::ControlPoint::_state, selected(), Inkscape::UI::ControlPoint::state(), Inkscape::UI::ControlPoint::STATE_CLICKED, Inkscape::UI::ControlPoint::STATE_MOUSEOVER, and Inkscape::UI::ControlPoint::STATE_NORMAL.
Referenced by Inkscape::UI::Node::_setState(), and updateState().
|
private |
Definition at line 82 of file selectable-control-point.cpp.
References _selection, Inkscape::UI::ControlPointSelection::clear(), and Inkscape::UI::ControlPointSelection::insert().
|
inlinevirtual |
Reimplemented in Inkscape::UI::Node.
Definition at line 29 of file selectable-control-point.h.
References Inkscape::UI::ControlPoint::position().
Referenced by Inkscape::UI::ControlPointSelection::_updateTransformHandles().
|
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.
event | Button release event |
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().
|
overrideprotectedvirtual |
Called while dragging, but before moving the knot to new position.
pos | Old position, always equal to position() |
new_pos | New 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. |
event | Motion 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().
|
overrideprotectedvirtual |
Called when the user moves the point beyond the drag tolerance with the first button held down.
event | Motion event when drag tolerance was exceeded. |
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().
|
virtual |
Definition at line 73 of file selectable-control-point.cpp.
References _selection, Inkscape::UI::ControlPointSelection::erase(), and Inkscape::UI::ControlPointSelection::insert().
bool Inkscape::UI::SelectableControlPoint::selected | ( | ) | const |
Definition at line 88 of file selectable-control-point.cpp.
References _selection, Inkscape::UI::ControlPointSelection::end(), and Inkscape::UI::ControlPointSelection::find().
Referenced by Inkscape::UI::Node::_getTip(), Inkscape::UI::Node::_linearGrow(), Inkscape::UI::ControlPointSelection::_pointClicked(), Inkscape::UI::Node::_setState(), _setState(), clicked(), Inkscape::UI::Node::dragged(), grabbed(), Inkscape::UI::Handle::setVisible(), and Inkscape::UI::ControlPointSelection::spatialGrow().
|
overrideprotectedvirtual |
Called when the control point finishes a drag.
event | Button release event |
Reimplemented from Inkscape::UI::ControlPoint.
Definition at line 49 of file selectable-control-point.cpp.
References Inkscape::UI::ControlPointSelection::_pointUngrabbed(), and _selection.
|
inline |
Definition at line 28 of file selectable-control-point.h.
References _setState(), and Inkscape::UI::ControlPoint::_state.
Referenced by Inkscape::UI::ControlPointSelection::erase(), Inkscape::UI::ControlPointSelection::insert(), Inkscape::UI::Node::pickBestType(), and Inkscape::UI::Node::setType().
|
friend |
Definition at line 33 of file selectable-control-point.h.
|
protected |
Definition at line 48 of file selectable-control-point.h.
Referenced by Inkscape::UI::Node::_eventHandler(), Inkscape::UI::Node::_getTip(), Inkscape::UI::Node::_linearGrow(), _takeSelection(), Inkscape::UI::NodeList::clear(), clicked(), Inkscape::UI::Node::dragged(), dragged(), grabbed(), select(), SelectableControlPoint(), selected(), ungrabbed(), and ~SelectableControlPoint().