Logo Search packages:      
Sourcecode: inkscape version File versions

SPSelection Class Reference

#include <selection.h>

Inheritance diagram for SPSelection:

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.

Definition at line 42 of file selection.h.


Public Member Functions

void add (SPObject *obj)
 Add an SPObject to the set of selected objects.
void addItem (SPItem *item)
 Add an SPItem to the set of selected objects.
void addList (GSList const *objs)
 Adds the specified objects to selection, without deselecting first.
void addRepr (SPRepr *repr)
 Add an XML node's SPObject to the set of selected objects.
void anchor () const
NR::Rect bounds () const
 Returns the bounding rectangle of the selection.
NRRect * bounds (NRRect *dest) const
 Returns the bounding rectangle of the selection.
NR::Rect boundsInDocument () const
 Returns the bounding rectangle of the selection.
NRRect * boundsInDocument (NRRect *dest) const
 Returns the bounding rectangle of the selection.
template<typename T>
void cancelClearOnceInaccessible (T **p_ptr)
 Cancels the registration of a pointer, so it will not be cleared when this object becomes inacessible.
void clear ()
 Unselects all selected objects.
template<typename T>
void clearOnceInaccessible (T **p_ptr)
 Registers a pointer to be cleared when this object becomes inaccessible.
sigc::connection connectChanged (const sigc::slot< void, SPSelection * > &slot)
 Connects a slot to be notified of selection changes.
sigc::connection connectModified (sigc::slot< void, SPSelection *, guint > slot)
 Connects a slot to be notified of selected object modifications.
SPDesktop * desktop ()
 Returns the desktop the seoection is bound to.
std::vector< NR::Point > getBBoxPoints () const
std::vector< NR::Point > getSnapPoints () const
 Gets the selection's snap points.
bool includes (SPObject *obj) const
 Returns true if the given object is selected.
bool includesItem (SPItem *item) const
 Returns true if the given item is selected.
bool includesRepr (SPRepr *repr) const
 Returns true if the given item is selected.
bool isEmpty () const
 Returns true if no items are selected.
GSList const * itemList ()
 Returns the list of selected SPItems.
void list (std::list< SPItem * > &l)
 Appends selected SPItems to list.
GSList const * list ()
 Returns the list of selected objects.
guint numberOfLayers ()
 Returns the number of layers in which there are selected objects.
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)
void release () const
void remove (SPObject *obj)
 Removes an item from the set of selected objects.
void removeItem (SPItem *item)
 Removes an item from the set of selected objects.
void removeRepr (SPRepr *repr)
 Removes an item from the set of selected objects.
GSList const * reprList ()
 Returns a list of the xml nodes of all selected objects.
void set (SPObject *obj)
 Set the selection to a single specific object.
void setItem (SPItem *item)
 Set the selection to a single specific object.
void setItemList (GSList const *items)
 Clears the selection and selects the specified objects.
void setList (GSList const *objs)
 Selects exactly the specified objects.
void setRepr (SPRepr *repr)
 Set the selection to an XML node's SPObject.
void setReprList (GSList const *reprs)
 Clears the selection and selects the specified objects.
SPObject * single ()
 Returns a single selected object.
SPItemsingleItem ()
 Returns a single selected item.
SPRepr * singleRepr ()
 Returns a single selected object's xml node.
 SPSelection (SPDesktop *desktop)

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 ()
void _emitModified (guint flags)
void _invalidateCachedLists ()
SPObject * _objectForRepr (SPRepr *repr) const
 returns the SPObject corresponding to an xml node (if any)
void _remove (SPObject *obj)
 removes an object (without issuing a notification)
void _removeObjectChildren (SPObject *obj)
 unselect all children of the given item
void operator= (SPSelection const &)
 no assign
 SPSelection (SPSelection const &)
 no copy

Static Private Member Functions

static gboolean _emit_modified (SPSelection *selection)
 Issues modification notification signals.
static void _release (SPObject *obj, SPSelection *selection)
 Releases a selected object that is being removed.
static void _schedule_modified (SPObject *obj, guint flags, SPSelection *selection)
 Schedules an item modification signal to be sent.

Private Attributes

sigc::signal< void, SPSelection * > _changed_signal
SPDesktop * _desktop
guint _flags
guint _idle
GSList * _item_reprs
GSList * _items
sigc::signal< void,
SPSelection *, guint > 
_modified_signal
GSList * _objs
unsigned _refcount
GSList * _reprs

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

Generated by  Doxygen 1.6.0   Back to index