Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

Inkscape::Selection Class Reference

#include <selection.h>

Inheritance diagram for Inkscape::Selection:

Inkscape::GC::Managed< default_scan, default_collect > Inkscape::GC::Anchored

List of all members.


Detailed Description

The set of selected SPObjects for a given desktop.

This class represents the set of selected SPItems for a given SPDesktop.

An SPObject and its parent cannot be simultaneously selected; selecting an SPObjects has the side-effect of unselecting any of its children which might have been selected.

This is a per-desktop object that keeps the list of selected objects at the given desktop. Both SPItem and SPRepr lists can be retrieved from the selection. Many actions operate on the selection, so it is widely used throughout the code. It also implements its own asynchronous notification signals that UI elements can listen to.

Definition at line 64 of file selection.h.


Public Member Functions

unsigned _anchored_refcount () const
SPObjectactiveContext ()
 Returns active layer for selection (currentLayer or its parent).
template<typename InputIterator>
void add (InputIterator from, InputIterator to)
 Add items from an STL iterator range to the selection.
void add (XML::Node *repr)
 Add an XML node's SPObject to the set of selected objects.
void add (SPObject *obj, bool persist_selection_context=false)
 Add an SPObject to the set of selected objects.
void addList (GSList const *objs)
 Adds the specified objects to selection, without deselecting first.
void anchor () const
Geom::OptRect bounds (SPItem::BBoxType type=SPItem::APPROXIMATE_BBOX) const
 Returns the bounding rectangle of the selection.
NRRect * bounds (NRRect *dest, SPItem::BBoxType type=SPItem::APPROXIMATE_BBOX) const
 Returns the bounding rectangle of the selection.
Geom::OptRect boundsInDocument (SPItem::BBoxType type=SPItem::APPROXIMATE_BBOX) const
 Returns the bounding rectangle of the selection.
NRRect * boundsInDocument (NRRect *dest, SPItem::BBoxType type=SPItem::APPROXIMATE_BBOX) const
 Returns the bounding rectangle of the selection.
std::list< SPBox3D * > const box3DList ()
boost::optional< Geom::Pointcenter () const
 Returns the rotation/skew center of the selection.
void clear ()
 Unselects all selected objects.
sigc::connection connectChanged (sigc::slot< void, Selection * > const &slot)
 Connects a slot to be notified of selection changes.
sigc::connection connectModified (sigc::slot< void, Selection *, guint > const &slot)
 Connects a slot to be notified of selected object modifications.
SPDesktopdesktop ()
 Returns the desktop the selection is bound to.
std::vector< std::pair
< Geom::Point, int > > 
getSnapPoints (SnapPreferences const *snapprefs) const
 Gets the selection's snap points.
std::vector< std::pair
< Geom::Point, int > > 
getSnapPointsConvexHull (SnapPreferences const *snapprefs) const
 Gets the snap points of a selection that form a convex hull.
bool includes (XML::Node *repr) const
 Returns true if the given item is selected.
bool includes (SPObject *obj) const
 Returns true if the given object is selected.
bool isEmpty () const
 Returns true if no items are selected.
GSList const * itemList ()
 Returns the list of selected SPItems.
GSList const * list ()
 Returns the list of selected objects.
guint numberOfLayers ()
 Returns the number of layers in which there are selected objects.
guint numberOfParents ()
 Returns the number of parents to which the selected objects belong.
void operator delete (void *p)
void * operator new (std::size_t size, ScanPolicy scan=default_scan, CollectionPolicy collect=default_collect) throw (std::bad_alloc)
void * operator new[] (std::size_t size, ScanPolicy scan=default_scan, CollectionPolicy collect=default_collect) throw (std::bad_alloc)
std::list< Persp3D * > const perspList ()
void release () const
void remove (XML::Node *repr)
 Removes an item from the set of selected objects.
void remove (SPObject *obj)
 Removes an item from the set of selected objects.
GSList const * reprList ()
 Returns a list of the xml nodes of all selected objects.
 Selection (SPDesktop *desktop)
void set (XML::Node *repr)
 Set the selection to an XML node's SPObject.
void set (SPObject *obj, bool persist_selection_context=false)
 Set the selection to a single specific object.
void setList (GSList const *objs)
 Selects exactly the specified objects.
void setReprList (GSList const *reprs)
 Clears the selection and selects the specified objects.
SPObjectsingle ()
 Returns a single selected object.
SPItemsingleItem ()
 Returns a single selected item.
XML::NodesingleRepr ()
 Returns a single selected object's xml node.
void toggle (SPObject *obj)
 Removes an item if selected, adds otherwise.

Private Member Functions

void _add (SPObject *obj)
 adds an object (without issuing a notification)
void _clear ()
 clears the selection (without issuing a notification)
void _emitChanged (bool persist_selection_context=false)
 Issues changed selection signal.
void _emitModified (guint flags)
 Issues modified selection signal.
void _invalidateCachedLists ()
SPObject_objectForXMLNode (XML::Node *repr) const
 returns the SPObject corresponding to an xml node (if any)
void _releaseContext (SPObject *obj)
 Releases an active layer object that is being removed.
void _remove (SPObject *obj)
 removes an object (without issuing a notification)
void _removeObjectAncestors (SPObject *obj)
 unselect all ancestors of the given item
void _removeObjectDescendants (SPObject *obj)
 unselect all descendants of the given item
void _schedule_modified (SPObject *obj, guint flags)
 Schedules an item modification signal to be sent.
void add_3D_boxes_recursively (SPObject *obj)
void add_box_perspective (SPBox3D *box)
void operator= (Selection const &)
 no assign
void remove_3D_boxes_recursively (SPObject *obj)
void remove_box_perspective (SPBox3D *box)
 Selection (Selection const &)
 no copy

Static Private Member Functions

static gboolean _emit_modified (Selection *selection)
 Issues modification notification signals.

Private Attributes

std::list< SPBox3D * > _3dboxes
sigc::signal< void, Selection * > _changed_signal
sigc::connection _context_release_connection
GC::soft_ptr< SPDesktop_desktop
guint _flags
guint _idle
GSList * _items
std::map< SPObject
*, sigc::connection > 
_modified_connections
sigc::signal< void, Selection
*, guint > 
_modified_signal
GSList * _objs
std::map< Persp3D *, unsigned int > _persps
std::map< SPObject
*, sigc::connection > 
_release_connections
GSList * _reprs
SPObject_selection_context

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

Generated by  Doxygen 1.6.0   Back to index