From c3a160589a9cb41c70a56e5e7b66a65857a0d10e Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Mon, 1 Jul 2013 21:04:32 +0100 Subject: 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) --- src/selection-describer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/selection-describer.cpp') diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index 72467c187..ce2d1c90b 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -17,6 +17,7 @@ #include #include "xml/quote.h" +#include "layer-model.h" #include "selection.h" #include "selection-describer.h" #include "desktop.h" @@ -144,8 +145,8 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select _context.set(Inkscape::NORMAL_MESSAGE, _when_nothing); } else { SPItem *item = SP_ITEM(items->data); - SPObject *layer = selection->desktop()->layerForObject(item); - SPObject *root = selection->desktop()->currentRoot(); + SPObject *layer = selection->layerModel()->layerForObject(item); + SPObject *root = selection->layerModel()->currentRoot(); // Layer name gchar *layer_name; -- cgit v1.2.3 From 104efe4e3ecadc975ab76748c66f041abf8ee7b1 Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Thu, 4 Jul 2013 15:01:44 +0100 Subject: Code readability improvements and licence changes for action-context.* based on merge request code review and feedback (bzr r12387.1.7) --- src/selection-describer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/selection-describer.cpp') diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index ce2d1c90b..6ed8ca584 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -145,8 +145,8 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select _context.set(Inkscape::NORMAL_MESSAGE, _when_nothing); } else { SPItem *item = SP_ITEM(items->data); - SPObject *layer = selection->layerModel()->layerForObject(item); - SPObject *root = selection->layerModel()->currentRoot(); + SPObject *layer = selection->layers()->layerForObject(item); + SPObject *root = selection->layers()->currentRoot(); // Layer name gchar *layer_name; -- cgit v1.2.3 From 6777466eda0b6952746a7bfb443d5e773857185a Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sat, 3 Aug 2013 23:39:12 +0200 Subject: reduce variable scope (bzr r12464) --- src/selection-describer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/selection-describer.cpp') diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index 6ed8ca584..b5704bb76 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -100,9 +100,8 @@ static GSList *collect_terms (GSList *items) static int count_filtered (GSList *items) { int count=0; - SPItem *item=NULL; for (GSList *i = items; i != NULL; i = i->next) { - item = SP_ITEM(i->data); + SPItem *item = SP_ITEM(i->data); count += item->ifilt(); } return count; -- cgit v1.2.3