diff options
| author | Eric Greveson <eric@greveson.co.uk> | 2013-07-01 20:04:32 +0000 |
|---|---|---|
| committer | Eric Greveson <eric@greveson.co.uk> | 2013-07-01 20:04:32 +0000 |
| commit | c3a160589a9cb41c70a56e5e7b66a65857a0d10e (patch) | |
| tree | 46860c161eda2e11687aff38141e04b40185798b /src/selection.h | |
| parent | Correctly ignore symbolic link to ltmain.sh (diff) | |
| download | inkscape-c3a160589a9cb41c70a56e5e7b66a65857a0d10e.tar.gz inkscape-c3a160589a9cb41c70a56e5e7b66a65857a0d10e.zip | |
Factored layer model out into new Inkscape::LayerModel class. This allows
Inkscape::Selection to use a LayerModel that is not associated with a UI.
Changed the interface of verbs (SPAction) to use a new ActionContext
rather than UI::View::View, again so that verbs may be used in a console
mode.
Modified boolean operation verbs to work in console-only mode.
Fixed up DESKTOP_IS_ACTIVE macro to work in the case of no desktops.
Modified main.cpp to process selections and verbs in no-GUI mode.
Other changes are all consequences of the SPDesktop, Selection and
LayerModel interface changes.
(bzr r12387.1.1)
Diffstat (limited to 'src/selection.h')
| -rw-r--r-- | src/selection.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/selection.h b/src/selection.h index 10775dcb5..65a6c5140 100644 --- a/src/selection.h +++ b/src/selection.h @@ -33,6 +33,7 @@ class SPBox3D; struct Persp3D; namespace Inkscape { +class LayerModel; namespace XML { class Node; } @@ -41,10 +42,10 @@ class Node; namespace Inkscape { /** - * The set of selected SPObjects for a given desktop. + * The set of selected SPObjects for a given document and layer model. * * This class represents the set of selected SPItems for a given - * SPDesktop. + * document (referenced in LayerModel). * * An SPObject and its parent cannot be simultaneously selected; * selecting an SPObjects has the side-effect of unselecting any of @@ -64,17 +65,26 @@ class Selection : public Inkscape::GC::Managed<>, public: /** * Constructs an selection object, bound to a particular - * SPDesktop + * layer model * - * @param desktop the desktop in question + * @param layer_model the layer model (for the SPDesktop, if GUI) + * @param desktop the desktop associated with the layer model, or NULL if in console mode */ - Selection(SPDesktop *desktop); + Selection(LayerModel *layer_model, SPDesktop *desktop); ~Selection(); /** + * Returns the layer model the selection is bound to (works in console or GUI mode) + * + * @return the layer model the selection is bound to, which is the same as the desktop + * layer model for GUI mode + */ + LayerModel *layerModel() { return _layer_model; } + + /** * Returns the desktop the selection is bound to * - * @return the desktop the selection is bound to + * @return the desktop the selection is bound to, or NULL if in console mode */ SPDesktop *desktop() { return _desktop; } @@ -342,6 +352,7 @@ private: std::list<SPBox3D *> _3dboxes; + LayerModel *_layer_model; GC::soft_ptr<SPDesktop> _desktop; SPObject* _selection_context; guint _flags; |
