Inkscape
Vector Graphics Editor
|
#include <node-tool.h>
Public Member Functions | |
NodeTool (SPDesktop *desktop) | |
~NodeTool () override | |
void | set (Preferences::Entry const &val) override |
Called by our pref_observer if a preference has been changed. | |
bool | root_handler (CanvasEvent const &event) override |
bool | item_handler (SPItem *item, CanvasEvent const &event) override |
Handles item specific events. | |
void | deleteSelected () |
![]() | |
ToolBase (SPDesktop *desktop, std::string &&prefs_path, std::string &&cursor_filename, bool uses_snap=true) | |
virtual | ~ToolBase () |
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. | |
MessageContext * | defaultMessageContext () const |
SPDesktop * | getDesktop () const |
SPGroup * | currentLayer () 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. | |
GrDrag * | get_drag () |
Public Attributes | |
Inkscape::UI::ControlPointSelection * | _selected_nodes = nullptr |
Inkscape::UI::MultiPathManipulator * | _multipath = nullptr |
std::vector< Inkscape::Display::TemporaryItem * > | _helperpath_tmpitem |
std::map< SPItem *, std::unique_ptr< ShapeEditor > > | _shape_editors |
bool | edit_clipping_paths = false |
bool | edit_masks = false |
![]() | |
std::unique_ptr< MessageContext > | message_context |
SelCue * | _selcue = nullptr |
GrDrag * | _grdrag = nullptr |
ShapeEditor * | shape_editor = nullptr |
bool | _uses_snap = false |
Private Member Functions | |
Inkscape::Rubberband * | get_rubberband () const |
void | selection_changed (Inkscape::Selection *sel) |
void | select_area (Geom::Path const &path, ButtonReleaseEvent const &event) |
void | select_point (ButtonReleaseEvent const &event) |
void | mouseover_changed (Inkscape::UI::ControlPoint *p) |
void | update_tip (CanvasEvent const &event) |
void | update_tip () |
void | handleControlUiStyleChange () |
void | _updateSelectionColor (CanvasEvent const &event) |
Private Attributes | |
sigc::connection | _selection_changed_connection |
sigc::connection | _mouseover_changed_connection |
SPItem * | flashed_item = nullptr |
Inkscape::Display::TemporaryItem * | flash_tempitem = nullptr |
Inkscape::UI::Selector * | _selector = nullptr |
Inkscape::UI::PathSharedData * | _path_data = nullptr |
Inkscape::CanvasItemGroup * | _transform_handle_group = nullptr |
SPItem * | _last_over = nullptr |
bool | cursor_drag = false |
bool | show_handles = false |
bool | show_outline =false |
bool | live_outline = false |
bool | live_objects = false |
bool | show_path_direction = false |
bool | show_transform_handles = false |
bool | single_node_transform_handles = false |
std::vector< SPItem * > | _current_selection |
std::vector< SPItem * > | _previous_selection |
Additional Inherited Members | |
![]() | |
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. | |
![]() | |
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 |
SPItem * | item_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 |
Definition at line 39 of file node-tool.h.
NodeTool::NodeTool | ( | SPDesktop * | desktop | ) |
Definition at line 107 of file node-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, _mouseover_changed_connection, _multipath, _path_data, _selected_nodes, _selection_changed_connection, _transform_handle_group, Inkscape::Selection::connectChanged(), Inkscape::UI::Tools::create_control_group(), data, Inkscape::UI::NodeSharedData::desktop, desktop, SPDesktop::emit_control_point_selected(), Inkscape::UI::Tools::ToolBase::enableGrDrag(), Inkscape::UI::Tools::ToolBase::enableSelectionCue(), Inkscape::Preferences::get(), SPDesktop::getCanvasControls(), SPDesktop::getSelection(), mouseover_changed(), Inkscape::UI::PathSharedData::node_data, Inkscape::UI::NodeSharedData::selection, selection_changed(), Inkscape::UI::MultiPathManipulator::signal_coords_changed, Inkscape::UI::ControlPoint::signal_mouseover_change, Inkscape::UI::ControlPointSelection::signal_selection_changed, Inkscape::UI::Tools::sp_event_context_read(), Inkscape::UI::Tools::sp_update_helperpath(), and update_tip().
|
override |
Definition at line 177 of file node-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, _helperpath_tmpitem, _mouseover_changed_connection, _multipath, _path_data, _selected_nodes, _selection_changed_connection, _transform_handle_group, Inkscape::UI::ControlPointSelection::clear(), Inkscape::UI::PathSharedData::dragpoint_group, Inkscape::UI::Tools::ToolBase::enableGrDrag(), flash_tempitem, get_rubberband(), Inkscape::UI::NodeSharedData::handle_group, Inkscape::UI::NodeSharedData::handle_line_group, Inkscape::UI::PathSharedData::node_data, Inkscape::UI::NodeSharedData::node_group, Inkscape::UI::PathSharedData::outline_group, SPDesktop::remove_temporary_canvasitem(), Inkscape::Rubberband::stop(), and Inkscape::CanvasItem::unlink().
|
private |
Definition at line 809 of file node-tool.cpp.
References Inkscape::Rubberband::ADD, get_rubberband(), Inkscape::Rubberband::INVERT, Inkscape::CanvasEvent::modifiersAfter(), Inkscape::Modifiers::NODE_INVERT, Inkscape::Modifiers::NODE_REMOVE_FROM, and Inkscape::Rubberband::REMOVE.
Referenced by root_handler().
void NodeTool::deleteSelected | ( | ) |
Definition at line 210 of file node-tool.cpp.
References _multipath, Inkscape::UI::automatic, Inkscape::UI::MultiPathManipulator::deleteNodes(), and Inkscape::Preferences::get().
|
private |
Definition at line 205 of file node-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, and Inkscape::Rubberband::get().
Referenced by _updateSelectionColor(), root_handler(), and ~NodeTool().
|
private |
Definition at line 805 of file node-tool.cpp.
References _multipath, and Inkscape::UI::MultiPathManipulator::updateHandles().
|
overridevirtual |
Handles item specific events.
Gets called from Gdk.
Only reacts to right mouse button at the moment.
Reimplemented from Inkscape::UI::Tools::ToolBase.
Definition at line 606 of file node-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, _shape_editors, SPDesktop::dt2doc(), SPDesktop::getItemAtPoint(), Inkscape::inspect_event(), item, Inkscape::UI::Tools::ToolBase::item_handler(), and SPDesktop::w2d().
|
private |
Definition at line 791 of file node-tool.cpp.
References cursor_drag, and Inkscape::UI::Tools::ToolBase::set_cursor().
Referenced by NodeTool().
|
overridevirtual |
Reimplemented from Inkscape::UI::Tools::ToolBase.
Definition at line 383 of file node-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, _last_over, _multipath, _previous_selection, _selected_nodes, _updateSelectionColor(), SPDesktop::add_temporary_canvasitem(), Inkscape::ObjectSet::addList(), c, Inkscape::UI::ControlPointSelection::clear(), Inkscape::UI::Tools::ToolBase::defaultMessageContext(), Inkscape::UI::ControlPointSelection::empty(), Inkscape::UI::ControlPointSelection::event(), Inkscape::UI::MultiPathManipulator::event(), flash_tempitem, flashed_item, Inkscape::Preferences::get(), Inkscape::UI::Tools::get_latin_keyval(), get_rubberband(), SPDesktop::getCanvasTemp(), SPDesktop::getNamedView(), SPDesktop::getSelection(), SPItem::i2dt_affine(), Inkscape::UI::MultiPathManipulator::insertNode(), Inkscape::inspect_event(), Inkscape::ObjectSet::isEmpty(), Inkscape::mod_alt(), Inkscape::mod_ctrl(), Inkscape::mod_ctrl_only(), Inkscape::CanvasEvent::modifiers, Inkscape::NORMAL_MESSAGE, SPDesktop::point(), SPDesktop::remove_temporary_canvasitem(), Inkscape::UI::Tools::ToolBase::root_handler(), Inkscape::RUBBERBAND_TOUCHPATH, select_area(), select_point(), Inkscape::Modifiers::SELECT_TOUCH_PATH, Inkscape::UI::ControlPointSelection::selectAll(), Inkscape::SelectionHelper::selectNone(), Inkscape::MessageContext::setF(), SnapManager::setup(), Inkscape::UI::MultiPathManipulator::shiftSelection(), show_handles, SPNamedView::snap_manager, Inkscape::SNAPSOURCE_OTHER_HANDLE, Inkscape::UI::Tools::sp_event_context_find_item(), Inkscape::UI::Tools::sp_update_helperpath(), SP_WIND_RULE_NONZERO, Inkscape::Rubberband::TOUCHPATH, update_tip(), and SPDesktop::w2d().
|
private |
Definition at line 730 of file node-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, _multipath, _selected_nodes, Geom::Path::boundsFast(), Inkscape::UI::ControlPointSelection::clear(), SPDesktop::dkey, SPDesktop::dt2doc(), Inkscape::UI::MultiPathManipulator::empty(), SPDesktop::getDocument(), SPDocument::getItemsInBox(), SPDesktop::getSelection(), Inkscape::UI::ControlPointSelection::invertSelection(), items, Inkscape::mod_ctrl(), Inkscape::mod_shift(), Inkscape::UI::ControlPointSelection::selectArea(), and shift().
Referenced by root_handler().
|
private |
Definition at line 760 of file node-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, _selected_nodes, Inkscape::ButtonEvent::button, Inkscape::UI::ControlPointSelection::clear(), Inkscape::UI::ControlPointSelection::empty(), SPDesktop::getSelection(), Inkscape::mod_shift(), Inkscape::CanvasEvent::modifiers, Inkscape::ButtonEvent::pos, and Inkscape::UI::Tools::sp_event_context_find_item().
Referenced by root_handler().
|
private |
Definition at line 347 of file node-tool.cpp.
References _current_selection, Inkscape::UI::Tools::ToolBase::_desktop, _multipath, _previous_selection, _shape_editors, Inkscape::UI::Tools::gather_items(), item, Inkscape::ObjectSet::items(), Inkscape::UI::ShapeRecord::object, Inkscape::UI::MultiPathManipulator::setItems(), Inkscape::UI::SHAPE_ROLE_NORMAL, Inkscape::UI::Tools::sp_update_helperpath(), and update_tip().
Referenced by NodeTool(), and set().
|
overridevirtual |
Called by our pref_observer if a preference has been changed.
Reimplemented from Inkscape::UI::Tools::ToolBase.
Definition at line 271 of file node-tool.cpp.
References Inkscape::UI::Tools::ToolBase::_desktop, _multipath, _selected_nodes, edit_clipping_paths, edit_masks, Inkscape::Preferences::Entry::getBool(), Inkscape::Preferences::Entry::getEntryName(), SPDesktop::getSelection(), live_objects, live_outline, selection_changed(), Inkscape::UI::Tools::ToolBase::set(), Inkscape::UI::MultiPathManipulator::setLiveObjects(), Inkscape::UI::MultiPathManipulator::setLiveOutline(), show_handles, show_outline, show_path_direction, show_transform_handles, Inkscape::UI::MultiPathManipulator::showHandles(), Inkscape::UI::MultiPathManipulator::showOutline(), Inkscape::UI::MultiPathManipulator::showPathDirection(), Inkscape::UI::ControlPointSelection::showTransformHandles(), and single_node_transform_handles.
|
private |
Definition at line 668 of file node-tool.cpp.
References _last_over, _multipath, _selected_nodes, Inkscape::UI::ControlPointSelection::allPoints(), Inkscape::UI::MultiPathManipulator::empty(), Inkscape::ustring::format_classic(), Inkscape::UI::Tools::ToolBase::message_context, Inkscape::NORMAL_MESSAGE, and Inkscape::UI::ControlPointSelection::size().
Referenced by NodeTool(), root_handler(), selection_changed(), and update_tip().
|
private |
Definition at line 640 of file node-tool.cpp.
References _last_over, Inkscape::KEY_PRESS, Inkscape::KEY_RELEASE, Inkscape::UI::Tools::ToolBase::message_context, Inkscape::mod_shift(), Inkscape::NORMAL_MESSAGE, Inkscape::CanvasEvent::type(), and update_tip().
|
private |
Definition at line 81 of file node-tool.h.
Referenced by selection_changed().
std::vector<Inkscape::Display::TemporaryItem *> Inkscape::UI::Tools::NodeTool::_helperpath_tmpitem |
Definition at line 47 of file node-tool.h.
Referenced by ~NodeTool().
|
private |
Definition at line 70 of file node-tool.h.
Referenced by root_handler(), update_tip(), and update_tip().
|
private |
Definition at line 62 of file node-tool.h.
Referenced by NodeTool(), and ~NodeTool().
Inkscape::UI::MultiPathManipulator* Inkscape::UI::Tools::NodeTool::_multipath = nullptr |
Definition at line 46 of file node-tool.h.
Referenced by deleteSelected(), handleControlUiStyleChange(), Inkscape::SelectionHelper::invert(), NodeTool(), Inkscape::SelectionHelper::reverse(), root_handler(), select_area(), Inkscape::SelectionHelper::selectAll(), selection_changed(), set(), update_tip(), and ~NodeTool().
|
private |
Definition at line 68 of file node-tool.h.
Referenced by NodeTool(), and ~NodeTool().
|
private |
Definition at line 82 of file node-tool.h.
Referenced by root_handler(), and selection_changed().
Inkscape::UI::ControlPointSelection* Inkscape::UI::Tools::NodeTool::_selected_nodes = nullptr |
Definition at line 45 of file node-tool.h.
Referenced by Inkscape::UI::TransformHandle::grabbed(), Inkscape::SelectionHelper::invertAllInAll(), NodeTool(), root_handler(), select_area(), select_point(), Inkscape::SelectionHelper::selectAllInAll(), Inkscape::SelectionHelper::selectNone(), set(), Inkscape::Selection::setState(), Inkscape::UI::TransformHandle::ungrabbed(), update_tip(), and ~NodeTool().
|
private |
Definition at line 61 of file node-tool.h.
Referenced by NodeTool(), and ~NodeTool().
|
private |
Definition at line 67 of file node-tool.h.
std::map<SPItem *, std::unique_ptr<ShapeEditor> > Inkscape::UI::Tools::NodeTool::_shape_editors |
Definition at line 48 of file node-tool.h.
Referenced by item_handler(), Inkscape::LivePathEffect::NodeSatelliteArrayParam::reloadKnots(), and selection_changed().
|
private |
Definition at line 69 of file node-tool.h.
Referenced by NodeTool(), and ~NodeTool().
|
private |
Definition at line 72 of file node-tool.h.
Referenced by mouseover_changed().
bool Inkscape::UI::Tools::NodeTool::edit_clipping_paths = false |
Definition at line 50 of file node-tool.h.
Referenced by Inkscape::UI::Tools::gather_items(), and set().
bool Inkscape::UI::Tools::NodeTool::edit_masks = false |
Definition at line 51 of file node-tool.h.
Referenced by Inkscape::UI::Tools::gather_items(), and set().
|
private |
Definition at line 66 of file node-tool.h.
Referenced by root_handler(), and ~NodeTool().
|
private |
Definition at line 64 of file node-tool.h.
Referenced by root_handler().
|
private |
Definition at line 76 of file node-tool.h.
Referenced by set().
|
private |
Definition at line 75 of file node-tool.h.
Referenced by set().
|
private |
Definition at line 73 of file node-tool.h.
Referenced by root_handler(), and set().
|
private |
Definition at line 74 of file node-tool.h.
Referenced by set().
|
private |
Definition at line 77 of file node-tool.h.
Referenced by set().
|
private |
Definition at line 78 of file node-tool.h.
Referenced by set().
|
private |
Definition at line 79 of file node-tool.h.
Referenced by set().