17#ifndef SEEN_INKSCAPE_SELECTION_H
18#define SEEN_INKSCAPE_SELECTION_H
22#include <unordered_map>
25#include <sigc++/signal.h>
26#include <sigc++/slot.h>
28#include <sigc++/scoped_connection.h>
272 void _emitChanged(
bool persist_selection_context =
false)
override;
Two-dimensional point that doubles as a vector.
SPObject * includesAncestor(SPObject *object)
Returns ancestor if the given object has ancestor selected.
SPDesktop * desktop()
Returns the desktop the selection is bound to.
bool remove(SPObject *object)
Removes an item from the set of selected objects.
bool add(SPObject *object, bool nosignal=false)
Add an SPObject to the set of selected objects.
void set(SPObject *object, bool persist_selection_context=false)
Set the selection to a single specific object.
SPDocument * document()
Returns the document the selection is bound to.
bool includes(SPObject *object, bool anyAncestor=false)
Returns true if the given object is selected.
The set of selected SPObjects for a given document and layer model.
SPObject * _selection_context
void _releaseSignals(SPObject *object) override
sigc::scoped_connection _context_release_connection
void add(XML::Node *repr)
Add an XML node's SPObject to the set of selected objects.
sigc::signal< void(Selection *, unsigned)> _modified_signal
std::vector< Inkscape::SnapCandidatePoint > getSnapPoints(SnapPreferences const *snapprefs) const
Compute the list of points in the selection that are to be considered for snapping from.
void _releaseContext(SPObject *obj)
Releases an active layer object that is being removed.
void setAnchor(double x, double y, bool set=true)
Set the anchor point of the selection, used for telling it how transforms should be anchored against.
std::unordered_map< SPObject *, sigc::scoped_connection > _modified_connections
SPObject * activeContext()
Returns active layer for selection (currentLayer or its parent).
void set(XML::Node *repr)
Set the selection to an XML node's SPObject.
void remove(XML::Node *repr)
Removes an item from the set of selected objects.
void _connectSignals(SPObject *object) override
size_t numberOfLayers()
Returns the number of layers in which there are selected objects.
void setChangePage(bool option)
Geom::Point _previous_rotate_anchor
void _emitChanged(bool persist_selection_context=false) override
Issues changed selection signal.
static int _emit_modified(Selection *selection)
Issues modification notification signals.
void rotateAnchored(double angle_degrees, double zoom=1.0)
Rotate the selection, anchoring it against the center, or a selected anchor.
SelectionState getState()
Returns the current selection state including selected objects and nodes.
sigc::connection connectModifiedFirst(sigc::slot< void(Selection *, unsigned)> slot)
Similar to connectModified, but will be run first.
SPObject * includesAncestor(XML::Node *repr)
Returns ancestor if the given object has ancestor selected.
bool includes(XML::Node *repr, bool anyAncestor=false)
Returns true if the given item is selected.
void setChangeLayer(bool option)
Decide if the selection changing should change the layer and page selection too.
void scaleAnchored(double amount, bool fixed=true)
Scale the selection, anchoring it against the center, or a selected anchor.
void _emitModified(unsigned int flags)
Issues modified selection signal.
void setState(SelectionState const &state)
Restores a selection state previously obtained from getState()
size_t numberOfParents()
Returns the number of parents to which the selected objects belong.
sigc::connection connectChangedFirst(sigc::slot< void(Selection *)> slot)
Similar to connectChanged, but will be run first.
void _schedule_modified(SPObject *obj, unsigned int flags)
Schedules an item modification signal to be sent.
sigc::connection connectChanged(sigc::slot< void(Selection *)> slot)
Connects a slot to be notified of selection changes.
sigc::signal< void(Selection *)> _changed_signal
SPObject * _objectForXMLNode(XML::Node *repr) const
returns the SPObject corresponding to an xml node (if any).
sigc::connection connectModified(sigc::slot< void(Selection *, unsigned)> slot)
Connects a slot to be notified of selected object modifications.
Storing of snapping preferences.
Interface for refcounted XML nodes.
To do: update description of desktop.
Typed SVG document implementation.
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Helper class to stream background task notifications as a series of messages.
Represents a selected node in a path.
PathNodeState(std::string id, int sp, int n)
Complete state of a selection, including selected objects and nodes.
std::vector< std::string > selected_ids
std::vector< PathNodeState > selected_nodes