summaryrefslogtreecommitdiffstats
path: root/src/ui
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/ui
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/ui')
-rw-r--r--src/ui/dialog/layers.cpp7
-rw-r--r--src/ui/dialog/swatches.cpp3
-rw-r--r--src/ui/dialog/symbols.cpp5
-rw-r--r--src/ui/widget/page-sizer.cpp3
-rw-r--r--src/ui/widget/style-swatch.cpp3
5 files changed, 13 insertions, 8 deletions
diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp
index 5cc9578f1..32d85574d 100644
--- a/src/ui/dialog/layers.cpp
+++ b/src/ui/dialog/layers.cpp
@@ -27,6 +27,7 @@
#include "document.h"
#include "document-undo.h"
#include "helper/action.h"
+#include "helper/action-context.h"
#include "inkscape.h"
#include "layer-fns.h"
#include "layer-manager.h"
@@ -99,7 +100,7 @@ void LayersPanel::_styleButton( Gtk::Button& btn, SPDesktop *desktop, unsigned i
if ( desktop ) {
Verb *verb = Verb::get( code );
if ( verb ) {
- SPAction *action = verb->get_action(desktop);
+ SPAction *action = verb->get_action(Inkscape::ActionContext(desktop));
if ( !set && action && action->image ) {
GtkWidget *child = sp_icon_new( Inkscape::ICON_SIZE_SMALL_TOOLBAR, action->image );
gtk_widget_show( child );
@@ -131,7 +132,7 @@ Gtk::MenuItem& LayersPanel::_addPopupItem( SPDesktop *desktop, unsigned int code
if ( desktop ) {
Verb *verb = Verb::get( code );
if ( verb ) {
- SPAction *action = verb->get_action(desktop);
+ SPAction *action = verb->get_action(Inkscape::ActionContext(desktop));
if ( !iconWidget && action && action->image ) {
iconWidget = sp_icon_new( Inkscape::ICON_SIZE_MENU, action->image );
}
@@ -172,7 +173,7 @@ void LayersPanel::_fireAction( unsigned int code )
if ( _desktop ) {
Verb *verb = Verb::get( code );
if ( verb ) {
- SPAction *action = verb->get_action(_desktop);
+ SPAction *action = verb->get_action(Inkscape::ActionContext(_desktop));
if ( action ) {
sp_action_perform( action, NULL );
// } else {
diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp
index 90cb1cdc9..094a6fa6a 100644
--- a/src/ui/dialog/swatches.cpp
+++ b/src/ui/dialog/swatches.cpp
@@ -57,6 +57,7 @@
#include "verbs.h"
#include "gradient-chemistry.h"
#include "helper/action.h"
+#include "helper/action-context.h"
namespace Inkscape {
namespace UI {
@@ -154,7 +155,7 @@ static void editGradientImpl( SPDesktop* desktop, SPGradient* gr )
// Invoke the gradient tool
Inkscape::Verb *verb = Inkscape::Verb::get( SP_VERB_CONTEXT_GRADIENT );
if ( verb ) {
- SPAction *action = verb->get_action( ( Inkscape::UI::View::View * ) SP_ACTIVE_DESKTOP);
+ SPAction *action = verb->get_action( Inkscape::ActionContext( ( Inkscape::UI::View::View * ) SP_ACTIVE_DESKTOP ) );
if ( action ) {
sp_action_perform( action, NULL );
}
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp
index 5eb7084d6..09bf1a863 100644
--- a/src/ui/dialog/symbols.cpp
+++ b/src/ui/dialog/symbols.cpp
@@ -66,6 +66,7 @@
#include "verbs.h"
#include "helper/action.h"
+#include "helper/action-context.h"
#include "xml/repr.h"
namespace Inkscape {
@@ -328,13 +329,13 @@ void SymbolsDialog::rebuild() {
void SymbolsDialog::insertSymbol() {
Inkscape::Verb *verb = Inkscape::Verb::get( SP_VERB_EDIT_SYMBOL );
- SPAction *action = verb->get_action((Inkscape::UI::View::View *) this->currentDesktop);
+ SPAction *action = verb->get_action(Inkscape::ActionContext( (Inkscape::UI::View::View *) this->currentDesktop) );
sp_action_perform (action, NULL);
}
void SymbolsDialog::revertSymbol() {
Inkscape::Verb *verb = Inkscape::Verb::get( SP_VERB_EDIT_UNSYMBOL );
- SPAction *action = verb->get_action((Inkscape::UI::View::View *) this->currentDesktop);
+ SPAction *action = verb->get_action(Inkscape::ActionContext( (Inkscape::UI::View::View *) this->currentDesktop ) );
sp_action_perform (action, NULL);
}
diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp
index fa3f8e3a1..988c4e5de 100644
--- a/src/ui/widget/page-sizer.cpp
+++ b/src/ui/widget/page-sizer.cpp
@@ -36,6 +36,7 @@
#include "document.h"
#include "desktop.h"
#include "helper/action.h"
+#include "helper/action-context.h"
#include "helper/units.h"
#include "inkscape.h"
#include "sp-namedview.h"
@@ -619,7 +620,7 @@ PageSizer::fire_fit_canvas_to_selection_or_drawing()
Verb *verb = Verb::get( SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING );
if (verb) {
- SPAction *action = verb->get_action(dt);
+ SPAction *action = verb->get_action(Inkscape::ActionContext(dt));
if (action) {
sp_action_perform(action, NULL);
}
diff --git a/src/ui/widget/style-swatch.cpp b/src/ui/widget/style-swatch.cpp
index a89f42575..aedab3fa5 100644
--- a/src/ui/widget/style-swatch.cpp
+++ b/src/ui/widget/style-swatch.cpp
@@ -28,6 +28,7 @@
#include "widgets/widget-sizes.h"
#include "helper/units.h"
#include "helper/action.h"
+#include "helper/action-context.h"
#include "preferences.h"
#include "inkscape.h"
#include "verbs.h"
@@ -200,7 +201,7 @@ StyleSwatch::on_click(GdkEventButton */*event*/)
{
if (this->_desktop && this->_verb_t != SP_VERB_NONE) {
Inkscape::Verb *verb = Inkscape::Verb::get(this->_verb_t);
- SPAction *action = verb->get_action((Inkscape::UI::View::View *) this->_desktop);
+ SPAction *action = verb->get_action(Inkscape::ActionContext((Inkscape::UI::View::View *) this->_desktop));
sp_action_perform (action, NULL);
return true;
}