Inkscape
Vector Graphics Editor
|
#include <shape-editor.h>
Public Member Functions | |
ShapeEditor (SPDesktop *desktop, Geom::Affine edit_transform=Geom::identity(), double edit_rotation=0.0, int edit_marker_mode=-1) | |
~ShapeEditor () override | |
void | set_item (SPItem *item) |
void | unset_item (bool keep_knotholder=false) |
void | update_knotholder () |
bool | has_local_change () const |
void | decrement_local_change () |
bool | knot_mouseover () const |
Returns true if this ShapeEditor has a knot above which the mouse currently hovers. | |
bool | has_knotholder () const |
Static Public Member Functions | |
static void | blockSetItem (bool b) |
Public Attributes | |
std::unique_ptr< KnotHolder > | knotholder |
std::unique_ptr< KnotHolder > | lpeknotholder |
Private Member Functions | |
void | reset_item () |
FIXME: This thing is only called when the item needs to be updated in response to repr change. | |
void | notifyAttributeChanged (Inkscape::XML::Node &node, GQuark key, Inkscape::Util::ptr_shared oldvalue, Inkscape::Util::ptr_shared newval) final |
Attribute change callback. | |
![]() | |
virtual | ~NodeObserver ()=default |
virtual void | notifyChildAdded (Node &node, Node &child, Node *prev) |
Child addition callback. | |
virtual void | notifyChildRemoved (Node &node, Node &child, Node *prev) |
Child removal callback. | |
virtual void | notifyChildOrderChanged (Node &node, Node &child, Node *old_prev, Node *new_prev) |
Child order change callback. | |
virtual void | notifyContentChanged (Node &node, Util::ptr_shared old_content, Util::ptr_shared new_content) |
Content change callback. | |
virtual void | notifyElementNameChanged (Node &node, GQuark old_name, GQuark new_name) |
Element name change callback. | |
NodeObserver ()=default | |
Private Attributes | |
SPDesktop * | desktop |
Inkscape::XML::Node * | knotholder_listener_attached_for {nullptr} |
Inkscape::XML::Node * | lpeknotholder_listener_attached_for {nullptr} |
Geom::Affine | _edit_transform |
double | _edit_rotation |
int | _edit_marker_mode |
Static Private Attributes | |
static bool | _blockSetItem = false |
Definition at line 28 of file shape-editor.h.
Inkscape::UI::ShapeEditor::ShapeEditor | ( | SPDesktop * | desktop, |
Geom::Affine | edit_transform = Geom::identity() , |
||
double | edit_rotation = 0.0 , |
||
int | edit_marker_mode = -1 |
||
) |
Definition at line 29 of file shape-editor.cpp.
|
override |
Definition at line 37 of file shape-editor.cpp.
References unset_item().
|
inlinestatic |
Definition at line 48 of file shape-editor.h.
References _blockSetItem.
Referenced by Inkscape::Extension::Internal::Metafile::setViewBoxIfMissing(), and sp_file_convert_dpi().
void Inkscape::UI::ShapeEditor::decrement_local_change | ( | ) |
Definition at line 86 of file shape-editor.cpp.
References knotholder, and lpeknotholder.
Referenced by notifyAttributeChanged().
|
inline |
Definition at line 46 of file shape-editor.h.
References knotholder, and lpeknotholder.
Referenced by Inkscape::UI::Tools::ToolBase::_keyboardMove(), Inkscape::UI::Tools::TextTool::_selectionModified(), and notifyAttributeChanged().
bool Inkscape::UI::ShapeEditor::has_local_change | ( | ) | const |
Definition at line 81 of file shape-editor.cpp.
References knotholder, and lpeknotholder.
Referenced by notifyAttributeChanged().
bool Inkscape::UI::ShapeEditor::knot_mouseover | ( | ) | const |
Returns true if this ShapeEditor has a knot above which the mouse currently hovers.
Definition at line 181 of file shape-editor.cpp.
References knotholder, and lpeknotholder.
|
finalprivatevirtual |
Attribute change callback.
This method is called whenever one of a node's attributes is changed.
node | The changed XML node |
name | GQuark corresponding to the attribute's name |
old_value | Old value of the modified attribute. Is a nullptr when the attribute is added. |
new_value | New value of the modified attribute. Is a nullptr when the attribute is removed. |
Reimplemented from Inkscape::XML::NodeObserver.
Definition at line 95 of file shape-editor.cpp.
References decrement_local_change(), has_knotholder(), has_local_change(), and reset_item().
|
private |
FIXME: This thing is only called when the item needs to be updated in response to repr change.
Why not make a reload function in KnotHolder?
note that it is not certain that this is an SPItem; it could be a LivePathEffectObject.
note that it is not certain that this is an SPItem; it could be a LivePathEffectObject.
Definition at line 167 of file shape-editor.cpp.
References desktop, SPDesktop::getDocument(), SPDocument::getObjectByRepr(), knotholder, knotholder_listener_attached_for, lpeknotholder, lpeknotholder_listener_attached_for, and set_item().
Referenced by notifyAttributeChanged().
void Inkscape::UI::ShapeEditor::set_item | ( | SPItem * | item | ) |
Definition at line 111 of file shape-editor.cpp.
References _blockSetItem, _edit_marker_mode, _edit_rotation, _edit_transform, Inkscape::XML::Node::addObserver(), Inkscape::GC::anchor(), Inkscape::UI::create_knot_holder(), Inkscape::UI::create_LPE_knot_holder(), desktop, item, knotholder, knotholder_listener_attached_for, lpeknotholder, lpeknotholder_listener_attached_for, and unset_item().
Referenced by Inkscape::UI::Tools::TextTool::_selectionChanged(), Inkscape::UI::Tools::ArcTool::ArcTool(), Inkscape::UI::Tools::Box3dTool::Box3dTool(), Inkscape::UI::Tools::FloodTool::FloodTool(), Inkscape::UI::Tools::RectTool::RectTool(), Inkscape::LivePathEffect::NodeSatelliteArrayParam::reloadKnots(), reset_item(), Inkscape::UI::Tools::ArcTool::selection_changed(), Inkscape::UI::Tools::Box3dTool::selection_changed(), Inkscape::UI::Tools::FloodTool::selection_changed(), Inkscape::UI::Tools::RectTool::selection_changed(), Inkscape::UI::Tools::SpiralTool::selection_changed(), Inkscape::UI::Tools::StarTool::selection_changed(), Inkscape::UI::Tools::SpiralTool::SpiralTool(), Inkscape::UI::Tools::StarTool::StarTool(), and Inkscape::UI::Tools::TextTool::TextTool().
void Inkscape::UI::ShapeEditor::unset_item | ( | bool | keep_knotholder = false | ) |
Definition at line 41 of file shape-editor.cpp.
References knotholder, knotholder_listener_attached_for, lpeknotholder, lpeknotholder_listener_attached_for, Inkscape::GC::release(), remove(), and Inkscape::XML::Node::removeObserver().
Referenced by Inkscape::UI::Tools::TextTool::_selectionChanged(), Inkscape::UI::Tools::ArcTool::selection_changed(), Inkscape::UI::Tools::Box3dTool::selection_changed(), Inkscape::UI::Tools::FloodTool::selection_changed(), Inkscape::UI::Tools::RectTool::selection_changed(), Inkscape::UI::Tools::SpiralTool::selection_changed(), Inkscape::UI::Tools::StarTool::selection_changed(), set_item(), and ~ShapeEditor().
void Inkscape::UI::ShapeEditor::update_knotholder | ( | ) |
Definition at line 72 of file shape-editor.cpp.
References knotholder, and lpeknotholder.
|
staticprivate |
Definition at line 51 of file shape-editor.h.
Referenced by blockSetItem(), and set_item().
|
private |
Definition at line 58 of file shape-editor.h.
Referenced by set_item().
|
private |
Definition at line 57 of file shape-editor.h.
Referenced by set_item().
|
private |
Definition at line 56 of file shape-editor.h.
Referenced by set_item().
|
private |
Definition at line 53 of file shape-editor.h.
Referenced by reset_item(), and set_item().
std::unique_ptr<KnotHolder> Inkscape::UI::ShapeEditor::knotholder |
Definition at line 44 of file shape-editor.h.
Referenced by Inkscape::UI::Tools::ToolBase::_keyboardMove(), Inkscape::UI::Tools::TextTool::_selectionModified(), Inkscape::UI::Tools::TextTool::_updateTextSelection(), decrement_local_change(), has_knotholder(), has_local_change(), KnotHolder::knot_mousedown_handler(), knot_mouseover(), reset_item(), set_item(), unset_item(), and update_knotholder().
|
private |
Definition at line 54 of file shape-editor.h.
Referenced by reset_item(), set_item(), and unset_item().
std::unique_ptr<KnotHolder> Inkscape::UI::ShapeEditor::lpeknotholder |
Definition at line 45 of file shape-editor.h.
Referenced by decrement_local_change(), has_knotholder(), has_local_change(), knot_mouseover(), Inkscape::LivePathEffect::NodeSatelliteArrayParam::reloadKnots(), reset_item(), set_item(), unset_item(), and update_knotholder().
|
private |
Definition at line 55 of file shape-editor.h.
Referenced by reset_item(), set_item(), and unset_item().