selection.h revision 1f6daa293cacc62d85a023412c70534a12f6e99a
f200d31b8a03050faa7243929bbd5698db488399Diederik van Lierop * Lauris Kaplinski <lauris@kaplinski.com>
f200d31b8a03050faa7243929bbd5698db488399Diederik van Lierop * MenTaLguY <mental@rydia.net>
f200d31b8a03050faa7243929bbd5698db488399Diederik van Lierop * bulia byak <buliabyak@users.sf.net>
f200d31b8a03050faa7243929bbd5698db488399Diederik van Lierop * Copyright (C) 2004-2005 MenTaLguY
f200d31b8a03050faa7243929bbd5698db488399Diederik van Lierop * Copyright (C) 1999-2002 Lauris Kaplinski
f200d31b8a03050faa7243929bbd5698db488399Diederik van Lierop * Copyright (C) 2001-2002 Ximian, Inc.
f200d31b8a03050faa7243929bbd5698db488399Diederik van Lierop * Released under GNU GPL, read the file 'COPYING' for more information
f200d31b8a03050faa7243929bbd5698db488399Diederik van Lieroptypedef std::list<SPObject*> SelContainer;
727eeb2592befe925906eb7605e9ed770697162bDiederik van Lierop/*template<typename T>
45d2569e428fc3733725b5e64e313e48c2a9d989Diederik van Lieropconst GSList* std_list_to_GS_list(const std::list<T *> list) const
c60180049420944fe78f7d8b2ca1df28cba163fdDiederik van Lierop gpointer l=NULL;
45d2569e428fc3733725b5e64e313e48c2a9d989Diederik van Lierop for(auto x:list){
72cd517ebd6730a0b8b1b71bdb267ffe9f1d94ffDiederik van Lierop * The set of selected SPObjects for a given document and layer model.
45d2569e428fc3733725b5e64e313e48c2a9d989Diederik van Lierop * This class represents the set of selected SPItems for a given
45d2569e428fc3733725b5e64e313e48c2a9d989Diederik van Lierop * document (referenced in LayerModel).
72cd517ebd6730a0b8b1b71bdb267ffe9f1d94ffDiederik van Lierop * An SPObject and its parent cannot be simultaneously selected;
72cd517ebd6730a0b8b1b71bdb267ffe9f1d94ffDiederik van Lierop * selecting an SPObjects has the side-effect of unselecting any of
72cd517ebd6730a0b8b1b71bdb267ffe9f1d94ffDiederik van Lierop * its children which might have been selected.
727eeb2592befe925906eb7605e9ed770697162bDiederik van Lierop * This is a per-desktop object that keeps the list of selected objects
72cd517ebd6730a0b8b1b71bdb267ffe9f1d94ffDiederik van Lierop * at the given desktop. Both SPItem and SPRepr lists can be retrieved
72cd517ebd6730a0b8b1b71bdb267ffe9f1d94ffDiederik van Lierop * from the selection. Many actions operate on the selection, so it is
72cd517ebd6730a0b8b1b71bdb267ffe9f1d94ffDiederik van Lierop * widely used throughout the code.
72cd517ebd6730a0b8b1b71bdb267ffe9f1d94ffDiederik van Lierop * It also implements its own asynchronous notification signals that
72cd517ebd6730a0b8b1b71bdb267ffe9f1d94ffDiederik van Lierop * UI elements can listen to.
45d2569e428fc3733725b5e64e313e48c2a9d989Diederik van Lieropclass Selection : public Inkscape::GC::Managed<>,
72cd517ebd6730a0b8b1b71bdb267ffe9f1d94ffDiederik van Lierop enum CompareSize { HORIZONTAL, VERTICAL, AREA };
72cd517ebd6730a0b8b1b71bdb267ffe9f1d94ffDiederik van Lierop * Constructs an selection object, bound to a particular
727eeb2592befe925906eb7605e9ed770697162bDiederik van Lierop * @param layers the layer model (for the SPDesktop, if GUI)
727eeb2592befe925906eb7605e9ed770697162bDiederik van Lierop * @param desktop the desktop associated with the layer model, or NULL if in console mode
72cd517ebd6730a0b8b1b71bdb267ffe9f1d94ffDiederik van Lierop Selection(LayerModel *layers, SPDesktop *desktop);
72cd517ebd6730a0b8b1b71bdb267ffe9f1d94ffDiederik van Lierop * Returns the layer model the selection is bound to (works in console or GUI mode)
45d2569e428fc3733725b5e64e313e48c2a9d989Diederik van Lierop * @return the layer model the selection is bound to, which is the same as the desktop
45d2569e428fc3733725b5e64e313e48c2a9d989Diederik van Lierop * layer model for GUI mode
72cd517ebd6730a0b8b1b71bdb267ffe9f1d94ffDiederik van Lierop LayerModel *layers() { return _layers; }
f200d31b8a03050faa7243929bbd5698db488399Diederik van Lierop * Returns the desktop the selection is bound to
++from;
_emitChanged();
void clear();
unsigned int numberOfLayers();
unsigned int numberOfParents();
void _invalidateCachedLists();
void _clear();
unsigned int _flags;
unsigned int _idle;