Inkscape
Vector Graphics Editor
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages Concepts
Inkscape::UI::ShapeEditor Class Reference

#include <shape-editor.h>

Inheritance diagram for Inkscape::UI::ShapeEditor:
Inkscape::XML::NodeObserver

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< KnotHolderknotholder
 
std::unique_ptr< KnotHolderlpeknotholder
 

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.
 
- Private Member Functions inherited from Inkscape::XML::NodeObserver
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

SPDesktopdesktop
 
Inkscape::XML::Nodeknotholder_listener_attached_for {nullptr}
 
Inkscape::XML::Nodelpeknotholder_listener_attached_for {nullptr}
 
Geom::Affine _edit_transform
 
double _edit_rotation
 
int _edit_marker_mode
 

Static Private Attributes

static bool _blockSetItem = false
 

Detailed Description

Definition at line 28 of file shape-editor.h.

Constructor & Destructor Documentation

◆ ShapeEditor()

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.

◆ ~ShapeEditor()

Inkscape::UI::ShapeEditor::~ShapeEditor ( )
override

Definition at line 37 of file shape-editor.cpp.

References unset_item().

Member Function Documentation

◆ blockSetItem()

static void Inkscape::UI::ShapeEditor::blockSetItem ( bool  b)
inlinestatic

◆ decrement_local_change()

void Inkscape::UI::ShapeEditor::decrement_local_change ( )

Definition at line 86 of file shape-editor.cpp.

References knotholder, and lpeknotholder.

Referenced by notifyAttributeChanged().

◆ has_knotholder()

bool Inkscape::UI::ShapeEditor::has_knotholder ( ) const
inline

◆ has_local_change()

bool Inkscape::UI::ShapeEditor::has_local_change ( ) const

Definition at line 81 of file shape-editor.cpp.

References knotholder, and lpeknotholder.

Referenced by notifyAttributeChanged().

◆ knot_mouseover()

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.

◆ notifyAttributeChanged()

void Inkscape::UI::ShapeEditor::notifyAttributeChanged ( Inkscape::XML::Node node,
GQuark  name,
Inkscape::Util::ptr_shared  old_value,
Inkscape::Util::ptr_shared  new_value 
)
finalprivatevirtual

Attribute change callback.

This method is called whenever one of a node's attributes is changed.

Parameters
nodeThe changed XML node
nameGQuark corresponding to the attribute's name
old_valueOld value of the modified attribute. Is a nullptr when the attribute is added.
new_valueNew 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().

◆ reset_item()

void Inkscape::UI::ShapeEditor::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().

◆ set_item()

◆ unset_item()

◆ update_knotholder()

void Inkscape::UI::ShapeEditor::update_knotholder ( )

Definition at line 72 of file shape-editor.cpp.

References knotholder, and lpeknotholder.

Member Data Documentation

◆ _blockSetItem

bool Inkscape::UI::ShapeEditor::_blockSetItem = false
staticprivate

Definition at line 51 of file shape-editor.h.

Referenced by blockSetItem(), and set_item().

◆ _edit_marker_mode

int Inkscape::UI::ShapeEditor::_edit_marker_mode
private

Definition at line 58 of file shape-editor.h.

Referenced by set_item().

◆ _edit_rotation

double Inkscape::UI::ShapeEditor::_edit_rotation
private

Definition at line 57 of file shape-editor.h.

Referenced by set_item().

◆ _edit_transform

Geom::Affine Inkscape::UI::ShapeEditor::_edit_transform
private

Definition at line 56 of file shape-editor.h.

Referenced by set_item().

◆ desktop

SPDesktop* Inkscape::UI::ShapeEditor::desktop
private

Definition at line 53 of file shape-editor.h.

Referenced by reset_item(), and set_item().

◆ knotholder

◆ knotholder_listener_attached_for

Inkscape::XML::Node* Inkscape::UI::ShapeEditor::knotholder_listener_attached_for {nullptr}
private

Definition at line 54 of file shape-editor.h.

Referenced by reset_item(), set_item(), and unset_item().

◆ lpeknotholder

◆ lpeknotholder_listener_attached_for

Inkscape::XML::Node* Inkscape::UI::ShapeEditor::lpeknotholder_listener_attached_for {nullptr}
private

Definition at line 55 of file shape-editor.h.

Referenced by reset_item(), set_item(), and unset_item().


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