summaryrefslogtreecommitdiffstats
path: root/src/widgets/toolbox.cpp
diff options
context:
space:
mode:
authorEric Greveson <eric@greveson.co.uk>2013-07-01 20:04:32 +0000
committerEric Greveson <eric@greveson.co.uk>2013-07-01 20:04:32 +0000
commitc3a160589a9cb41c70a56e5e7b66a65857a0d10e (patch)
tree46860c161eda2e11687aff38141e04b40185798b /src/widgets/toolbox.cpp
parentCorrectly ignore symbolic link to ltmain.sh (diff)
downloadinkscape-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/widgets/toolbox.cpp')
-rw-r--r--src/widgets/toolbox.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 0fdf36d5f..ca593976f 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -47,6 +47,8 @@
#include "../ege-output-action.h"
#include "../ege-select-one-action.h"
#include "../graphlayout.h"
+#include "../helper/action.h"
+#include "../helper/action-context.h"
#include "../helper/unit-menu.h"
#include "../helper/units.h"
#include "../helper/unit-tracker.h"
@@ -591,9 +593,9 @@ private:
Glib::RefPtr<VerbAction> VerbAction::create(Inkscape::Verb* verb, Inkscape::Verb* verb2, Inkscape::UI::View::View *view)
{
Glib::RefPtr<VerbAction> result;
- SPAction *action = verb->get_action(view);
+ SPAction *action = verb->get_action(Inkscape::ActionContext(view));
if ( action ) {
- //SPAction* action2 = verb2 ? verb2->get_action(view) : 0;
+ //SPAction* action2 = verb2 ? verb2->get_action(Inkscape::ActionContext(view)) : 0;
result = Glib::RefPtr<VerbAction>(new VerbAction(verb, verb2, view));
}
@@ -680,7 +682,7 @@ void VerbAction::set_active(bool active)
void VerbAction::on_activate()
{
if ( verb ) {
- SPAction *action = verb->get_action(view);
+ SPAction *action = verb->get_action(Inkscape::ActionContext(view));
if ( action ) {
sp_action_perform(action, 0);
}
@@ -770,14 +772,14 @@ GtkToolItem * sp_toolbox_button_item_new_from_verb_with_doubleclick(GtkWidget *t
Inkscape::Verb *verb, Inkscape::Verb *doubleclick_verb,
Inkscape::UI::View::View *view)
{
- SPAction *action = verb->get_action(view);
+ SPAction *action = verb->get_action(Inkscape::ActionContext(view));
if (!action) {
return NULL;
}
SPAction *doubleclick_action;
if (doubleclick_verb) {
- doubleclick_action = doubleclick_verb->get_action(view);
+ doubleclick_action = doubleclick_verb->get_action(Inkscape::ActionContext(view));
} else {
doubleclick_action = NULL;
}
@@ -822,7 +824,7 @@ static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::Vi
{
GtkAction* act = 0;
- SPAction* targetAction = verb->get_action(view);
+ SPAction* targetAction = verb->get_action(Inkscape::ActionContext(view));
InkAction* inky = ink_action_new( verb->get_id(), _(verb->get_name()), verb->get_tip(), verb->get_image(), size );
act = GTK_ACTION(inky);
gtk_action_set_sensitive( act, targetAction->sensitive );