summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-07-04 15:27:06 +0000
committerJaviertxo <jtx@jtx.marker.es>2013-07-04 15:27:06 +0000
commitb8ef835cd10460cf7548bae4970b395e9d7767d9 (patch)
tree12e14b42023385cf8bf8192c2ae482a4f59deff1 /src/ui
parentIm not sure what changes are (diff)
parentShape calculations. do not quantize the coordinates. (Bug 168158) (diff)
downloadinkscape-b8ef835cd10460cf7548bae4970b395e9d7767d9.tar.gz
inkscape-b8ef835cd10460cf7548bae4970b395e9d7767d9.zip
Upadate to trunk
(bzr r11950.1.122)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/aboutbox.cpp2
-rw-r--r--src/ui/dialog/aboutbox.h8
-rw-r--r--src/ui/dialog/align-and-distribute.cpp4
-rw-r--r--src/ui/dialog/calligraphic-profile-rename.h4
-rw-r--r--src/ui/dialog/color-item.cpp9
-rw-r--r--src/ui/dialog/debug.cpp4
-rw-r--r--src/ui/dialog/export.cpp4
-rw-r--r--src/ui/dialog/filedialogimpl-gtkmm.h8
-rw-r--r--src/ui/dialog/filedialogimpl-win32.h3
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp15
-rw-r--r--src/ui/dialog/filter-effects-dialog.h1
-rw-r--r--src/ui/dialog/floating-behavior.cpp8
-rw-r--r--src/ui/dialog/font-substitution.cpp4
-rw-r--r--src/ui/dialog/guides.h4
-rw-r--r--src/ui/dialog/icon-preview.cpp4
-rw-r--r--src/ui/dialog/layer-properties.h4
-rw-r--r--src/ui/dialog/layers.cpp4
-rw-r--r--src/ui/dialog/layers.h8
-rw-r--r--src/ui/dialog/livepatheffect-add.h8
-rw-r--r--src/ui/dialog/messages.h8
-rw-r--r--src/ui/dialog/ocaldialogs.h8
-rw-r--r--src/ui/dialog/spellcheck.h8
-rw-r--r--src/ui/dialog/symbols.cpp281
-rw-r--r--src/ui/dialog/symbols.h17
-rw-r--r--src/ui/dialog/text-edit.h8
-rw-r--r--src/ui/dialog/tile.h4
-rw-r--r--src/ui/dialog/transformation.cpp43
-rw-r--r--src/ui/previewholder.h4
-rw-r--r--src/ui/tool/multi-path-manipulator.cpp8
-rw-r--r--src/ui/widget/button.h8
-rw-r--r--src/ui/widget/color-picker.h9
-rw-r--r--src/ui/widget/color-preview.h4
-rw-r--r--src/ui/widget/dock-item.h8
-rw-r--r--src/ui/widget/dock.h8
-rw-r--r--src/ui/widget/entity-entry.cpp4
-rw-r--r--src/ui/widget/filter-effect-chooser.h8
-rw-r--r--src/ui/widget/frame.h8
-rw-r--r--src/ui/widget/imageicon.h8
-rw-r--r--src/ui/widget/imagetoggler.h4
-rw-r--r--src/ui/widget/labelled.h8
-rw-r--r--src/ui/widget/licensor.h8
-rw-r--r--src/ui/widget/notebook-page.h4
-rw-r--r--src/ui/widget/object-composite-settings.h8
-rw-r--r--src/ui/widget/panel.cpp4
-rw-r--r--src/ui/widget/panel.h4
-rw-r--r--src/ui/widget/preferences-widget.cpp4
-rw-r--r--src/ui/widget/preferences-widget.h9
-rw-r--r--src/ui/widget/rotateable.cpp8
-rw-r--r--src/ui/widget/selected-style.h4
-rw-r--r--src/ui/widget/spin-scale.cpp3
-rw-r--r--src/ui/widget/spin-scale.h8
-rw-r--r--src/ui/widget/spin-slider.h8
-rw-r--r--src/ui/widget/spinbutton.h8
-rw-r--r--src/ui/widget/style-swatch.h4
-rw-r--r--src/ui/widget/tolerance-slider.cpp4
-rw-r--r--src/ui/widget/unit-menu.h8
56 files changed, 542 insertions, 126 deletions
diff --git a/src/ui/dialog/aboutbox.cpp b/src/ui/dialog/aboutbox.cpp
index ba9670d86..6f1137e46 100644
--- a/src/ui/dialog/aboutbox.cpp
+++ b/src/ui/dialog/aboutbox.cpp
@@ -359,7 +359,7 @@ void AboutBox::initStrings() {
"Nick\n"
"Andreas Nilsson\n"
"Mitsuru Oka\n"
-"Marten Owens\n"
+"Martin Owens\n"
"Alvin Penner\n"
"Jon Phillips\n"
"Zdenko Podobny\n"
diff --git a/src/ui/dialog/aboutbox.h b/src/ui/dialog/aboutbox.h
index 622b1324f..7b3308672 100644
--- a/src/ui/dialog/aboutbox.h
+++ b/src/ui/dialog/aboutbox.h
@@ -15,6 +15,14 @@
#ifndef INKSCAPE_UI_DIALOG_ABOUTBOX_H
#define INKSCAPE_UI_DIALOG_ABOUTBOX_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/dialog.h>
namespace Inkscape {
diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp
index dbd06d9e8..7f88824f7 100644
--- a/src/ui/dialog/align-and-distribute.cpp
+++ b/src/ui/dialog/align-and-distribute.cpp
@@ -195,7 +195,7 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) {
//Move each item in the selected list separately
for (std::list<SPItem *>::iterator it(selected.begin());
it != selected.end();
- it++)
+ ++it)
{
sp_desktop_document (desktop)->ensureUpToDate();
if (!sel_as_group)
@@ -347,7 +347,7 @@ private :
float pos = sorted.front().bbox.min()[_orientation];
for ( std::vector<BBoxSort> ::iterator it (sorted.begin());
it < sorted.end();
- it ++ )
+ ++it )
{
if (!Geom::are_near(pos, it->bbox.min()[_orientation], 1e-6)) {
Geom::Point t(0.0, 0.0);
diff --git a/src/ui/dialog/calligraphic-profile-rename.h b/src/ui/dialog/calligraphic-profile-rename.h
index 4ef71900b..3256338eb 100644
--- a/src/ui/dialog/calligraphic-profile-rename.h
+++ b/src/ui/dialog/calligraphic-profile-rename.h
@@ -15,6 +15,10 @@
# include "config.h"
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/dialog.h>
#include <gtkmm/entry.h>
#include <gtkmm/label.h>
diff --git a/src/ui/dialog/color-item.cpp b/src/ui/dialog/color-item.cpp
index e09d9b1d1..2292b66fc 100644
--- a/src/ui/dialog/color-item.cpp
+++ b/src/ui/dialog/color-item.cpp
@@ -11,7 +11,16 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <errno.h>
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/label.h>
#include <glibmm/i18n.h>
#include <cairo.h>
diff --git a/src/ui/dialog/debug.cpp b/src/ui/dialog/debug.cpp
index d127261c0..9e2287f80 100644
--- a/src/ui/dialog/debug.cpp
+++ b/src/ui/dialog/debug.cpp
@@ -13,6 +13,10 @@
# include <config.h>
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/dialog.h>
#include <gtkmm/textview.h>
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp
index fe15a4e86..a851503fe 100644
--- a/src/ui/dialog/export.cpp
+++ b/src/ui/dialog/export.cpp
@@ -20,6 +20,10 @@
// This has to be included prior to anything that includes setjmp.h, it croaks otherwise
#include <png.h>
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/buttonbox.h>
#include <gtkmm/dialog.h>
diff --git a/src/ui/dialog/filedialogimpl-gtkmm.h b/src/ui/dialog/filedialogimpl-gtkmm.h
index 7501b5e14..6687915d7 100644
--- a/src/ui/dialog/filedialogimpl-gtkmm.h
+++ b/src/ui/dialog/filedialogimpl-gtkmm.h
@@ -17,6 +17,14 @@
#ifndef __FILE_DIALOGIMPL_H__
#define __FILE_DIALOGIMPL_H__
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
//Gtk includes
#include <gtkmm/filechooserdialog.h>
#include <glib/gstdio.h>
diff --git a/src/ui/dialog/filedialogimpl-win32.h b/src/ui/dialog/filedialogimpl-win32.h
index 0839be8a8..2e6bb4bb8 100644
--- a/src/ui/dialog/filedialogimpl-win32.h
+++ b/src/ui/dialog/filedialogimpl-win32.h
@@ -15,8 +15,11 @@
#ifdef WIN32
#if WITH_GLIBMM_2_32
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
# include <glibmm/threads.h>
#endif
+
+#endif
#include "gc-core.h"
#include <windows.h>
#include "filedialogimpl-gtkmm.h"
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index 4c289d54e..4401d5658 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -1155,7 +1155,13 @@ FilterEffectsDialog::FilterModifier::FilterModifier(FilterEffectsDialog& d)
sw->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
_list.get_column(1)->set_resizable(true);
-
+ _list.set_reorderable(true);
+
+ // We can track the drag/drop reordering from the row_delete (occurs after
+ // row_inserted and may occur many times when adding a new item)
+ _model->signal_row_deleted().connect(
+ sigc::mem_fun(*this, &FilterModifier::on_filter_reorder));
+
sw->set_shadow_type(Gtk::SHADOW_IN);
show_all_children();
_add.signal_clicked().connect(sigc::mem_fun(*this, &FilterModifier::add_filter));
@@ -1301,6 +1307,13 @@ void FilterEffectsDialog::FilterModifier::on_name_edited(const Glib::ustring& pa
}
}
+void FilterEffectsDialog::FilterModifier::on_filter_reorder(const Gtk::TreeModel::Path& path) {
+ for(Gtk::TreeModel::iterator i = _model->children().begin(); i != _model->children().end(); ++i) {
+ SPObject* object = (*i)[_columns.filter];
+ object->getRepr()->setPosition(0);
+ }
+}
+
void FilterEffectsDialog::FilterModifier::on_selection_toggled(const Glib::ustring& path)
{
Gtk::TreeIter iter = _model->get_iter(path);
diff --git a/src/ui/dialog/filter-effects-dialog.h b/src/ui/dialog/filter-effects-dialog.h
index 658aac790..a2a2a3c6e 100644
--- a/src/ui/dialog/filter-effects-dialog.h
+++ b/src/ui/dialog/filter-effects-dialog.h
@@ -86,6 +86,7 @@ private:
void on_filter_selection_changed();
void on_name_edited(const Glib::ustring&, const Glib::ustring&);
+ void on_filter_reorder(const Gtk::TreeModel::Path& path);
void on_selection_toggled(const Glib::ustring&);
void update_filters();
diff --git a/src/ui/dialog/floating-behavior.cpp b/src/ui/dialog/floating-behavior.cpp
index d70c5f187..dd07f009a 100644
--- a/src/ui/dialog/floating-behavior.cpp
+++ b/src/ui/dialog/floating-behavior.cpp
@@ -10,6 +10,14 @@
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/dialog.h>
#include <gtkmm/stock.h>
#include <glibmm/main.h>
diff --git a/src/ui/dialog/font-substitution.cpp b/src/ui/dialog/font-substitution.cpp
index 9fa94ca8f..bf9133086 100644
--- a/src/ui/dialog/font-substitution.cpp
+++ b/src/ui/dialog/font-substitution.cpp
@@ -10,6 +10,10 @@
# include <config.h>
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/messagedialog.h>
#include <gtkmm/checkbutton.h>
#include <gtkmm/scrolledwindow.h>
diff --git a/src/ui/dialog/guides.h b/src/ui/dialog/guides.h
index a15667152..422fed7fe 100644
--- a/src/ui/dialog/guides.h
+++ b/src/ui/dialog/guides.h
@@ -15,6 +15,10 @@
# include <config.h>
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/dialog.h>
#if WITH_GTKMM_3_0
diff --git a/src/ui/dialog/icon-preview.cpp b/src/ui/dialog/icon-preview.cpp
index 1a52410b8..468e85d36 100644
--- a/src/ui/dialog/icon-preview.cpp
+++ b/src/ui/dialog/icon-preview.cpp
@@ -17,6 +17,10 @@
# include <config.h>
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/buttonbox.h>
#include <boost/scoped_ptr.hpp>
diff --git a/src/ui/dialog/layer-properties.h b/src/ui/dialog/layer-properties.h
index 0e2f8ed94..d38b8edf5 100644
--- a/src/ui/dialog/layer-properties.h
+++ b/src/ui/dialog/layer-properties.h
@@ -16,6 +16,10 @@
# include <config.h>
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/dialog.h>
#include <gtkmm/entry.h>
#include <gtkmm/label.h>
diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp
index 5cc9578f1..ce923f6b4 100644
--- a/src/ui/dialog/layers.cpp
+++ b/src/ui/dialog/layers.cpp
@@ -404,13 +404,13 @@ void LayersPanel::_addLayer( SPDocument* doc, SPObject* layer, Gtk::TreeModel::R
SPObject *child = _desktop->layer_manager->nthChildOf(layer, i);
if ( child ) {
#if DUMP_LAYERS
- g_message(" %3d layer:%p {%s} [%s]", level, child, child->id, child->label() );
+ g_message(" %3d layer:%p {%s} [%s]", level, child, child->getId(), child->label() );
#endif // DUMP_LAYERS
Gtk::TreeModel::iterator iter = parentRow ? _store->prepend(parentRow->children()) : _store->prepend();
Gtk::TreeModel::Row row = *iter;
row[_model->_colObject] = child;
- row[_model->_colLabel] = child->label() ? child->label() : child->getId();
+ row[_model->_colLabel] = child->defaultLabel();
row[_model->_colVisible] = SP_IS_ITEM(child) ? !SP_ITEM(child)->isHidden() : false;
row[_model->_colLocked] = SP_IS_ITEM(child) ? SP_ITEM(child)->isLocked() : false;
diff --git a/src/ui/dialog/layers.h b/src/ui/dialog/layers.h
index e9fd9ebc6..ae0ac6040 100644
--- a/src/ui/dialog/layers.h
+++ b/src/ui/dialog/layers.h
@@ -12,6 +12,14 @@
#ifndef SEEN_LAYERS_PANEL_H
#define SEEN_LAYERS_PANEL_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/treeview.h>
#include <gtkmm/treestore.h>
diff --git a/src/ui/dialog/livepatheffect-add.h b/src/ui/dialog/livepatheffect-add.h
index 00f58b038..7fa766272 100644
--- a/src/ui/dialog/livepatheffect-add.h
+++ b/src/ui/dialog/livepatheffect-add.h
@@ -11,6 +11,14 @@
#ifndef INKSCAPE_DIALOG_LIVEPATHEFFECT_ADD_H
#define INKSCAPE_DIALOG_LIVEPATHEFFECT_ADD_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/dialog.h>
#include <gtkmm/liststore.h>
#include <gtkmm/treeview.h>
diff --git a/src/ui/dialog/messages.h b/src/ui/dialog/messages.h
index 6ed246ece..54ca84f47 100644
--- a/src/ui/dialog/messages.h
+++ b/src/ui/dialog/messages.h
@@ -16,6 +16,14 @@
#ifndef INKSCAPE_UI_DIALOG_MESSAGES_H
#define INKSCAPE_UI_DIALOG_MESSAGES_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/textview.h>
#include <gtkmm/button.h>
diff --git a/src/ui/dialog/ocaldialogs.h b/src/ui/dialog/ocaldialogs.h
index 8cb247766..e21030bcd 100644
--- a/src/ui/dialog/ocaldialogs.h
+++ b/src/ui/dialog/ocaldialogs.h
@@ -13,6 +13,14 @@
#ifndef __OCAL_DIALOG_H__
#define __OCAL_DIALOG_H__
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
//Gtk includes
#include <gtkmm/box.h>
#include <gtkmm/eventbox.h>
diff --git a/src/ui/dialog/spellcheck.h b/src/ui/dialog/spellcheck.h
index ab75809f3..27b89e34e 100644
--- a/src/ui/dialog/spellcheck.h
+++ b/src/ui/dialog/spellcheck.h
@@ -12,6 +12,14 @@
#ifndef SEEN_SPELLCHECK_H
#define SEEN_SPELLCHECK_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/button.h>
#include <gtkmm/buttonbox.h>
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp
index 103302f41..b71686a17 100644
--- a/src/ui/dialog/symbols.cpp
+++ b/src/ui/dialog/symbols.cpp
@@ -18,10 +18,15 @@
#include <functional>
#include <sstream>
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/buttonbox.h>
#include <gtkmm/label.h>
#if WITH_GTKMM_3_0
+# include <gtkmm/togglebutton.h>
# include <gtkmm/grid.h>
#else
# include <gtkmm/table.h>
@@ -40,9 +45,11 @@
#include "ui/cache/svg_preview_cache.h"
#include "ui/clipboard.h"
+#include "ui/icon-names.h"
#include "symbols.h"
+#include "selection.h"
#include "desktop.h"
#include "desktop-handles.h"
#include "document.h"
@@ -51,6 +58,7 @@
#include "sp-use.h"
#include "sp-defs.h"
#include "sp-symbol.h"
+#include "widgets/icon.h"
#ifdef WITH_LIBVISIO
#include <libvisio/libvisio.h>
@@ -58,6 +66,7 @@
#endif
#include "verbs.h"
+#include "helper/action.h"
#include "xml/repr.h"
namespace Inkscape {
@@ -96,8 +105,6 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) :
UI::Widget::Panel("", prefsPath, SP_VERB_DIALOG_SYMBOLS),
store(Gtk::ListStore::create(*getColumns())),
iconView(0),
- previewScale(0),
- previewSize(0),
currentDesktop(0),
deskTrack(),
currentDocument(0),
@@ -136,8 +143,8 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) :
table->attach(*Gtk::manage(symbolSet),1,2,row,row+1,Gtk::FILL|Gtk::EXPAND,Gtk::SHRINK);
#endif
- sigc::connection connSet =
- symbolSet->signal_changed().connect(sigc::mem_fun(*this, &SymbolsDialog::rebuild));
+ sigc::connection connSet = symbolSet->signal_changed().connect(
+ sigc::mem_fun(*this, &SymbolsDialog::rebuild));
instanceConns.push_back(connSet);
++row;
@@ -148,7 +155,7 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) :
iconView = new Gtk::IconView(static_cast<Glib::RefPtr<Gtk::TreeModel> >(store));
//iconView->set_text_column( columns->symbol_id );
iconView->set_tooltip_column( 1 );
- iconView->set_pixbuf_column( columns->symbol_image );
+ iconView->set_pixbuf_column( columns->symbol_image );
// Giving the iconview a small minimum size will help users understand
// What the dialog does.
iconView->set_size_request( 100, 200 );
@@ -157,11 +164,12 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) :
targets.push_back(Gtk::TargetEntry( "application/x-inkscape-paste"));
iconView->enable_model_drag_source (targets, Gdk::BUTTON1_MASK, Gdk::ACTION_COPY);
- iconView->signal_drag_data_get().connect(sigc::mem_fun(*this, &SymbolsDialog::iconDragDataGet));
+ iconView->signal_drag_data_get().connect(
+ sigc::mem_fun(*this, &SymbolsDialog::iconDragDataGet));
sigc::connection connIconChanged;
- connIconChanged =
- iconView->signal_selection_changed().connect(sigc::mem_fun(*this, &SymbolsDialog::iconChanged));
+ connIconChanged = iconView->signal_selection_changed().connect(
+ sigc::mem_fun(*this, &SymbolsDialog::iconChanged));
instanceConns.push_back(connIconChanged);
Gtk::ScrolledWindow *scroller = new Gtk::ScrolledWindow();
@@ -178,63 +186,68 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) :
++row;
- /******************** Preview Scale ***********************/
- Gtk::Label* labelScale = new Gtk::Label(_("Preview scale: "));
+ /******************** Tools *******************************/
+ Gtk::Button* button;
+ Gtk::HBox* tools = new Gtk::HBox();
+ //tools->set_layout( Gtk::BUTTONBOX_END );
#if WITH_GTKMM_3_0
- table->attach(*Gtk::manage(labelScale),0,row,1,1);
+ scroller->set_hexpand();
+ table->attach(*Gtk::manage(tools),0,row,2,1);
#else
- table->attach(*Gtk::manage(labelScale),0,1,row,row+1,Gtk::SHRINK,Gtk::SHRINK);
+ table->attach(*Gtk::manage(tools),0,2,row,row+1,Gtk::EXPAND|Gtk::FILL,Gtk::FILL);
#endif
- previewScale = new Gtk::ComboBoxText();
- const gchar *scales[] =
- {_("Fit"), _("Fit to width"), _("Fit to height"), "0.1", "0.2", "0.5", "1.0", "2.0", "5.0", NULL};
- for( int i = 0; scales[i]; ++i ) {
- previewScale->append(scales[i]);
- }
- previewScale->set_active_text(scales[0]);
+ addSymbol = Gtk::manage(new Gtk::Button());
+ addSymbol->add(*Gtk::manage(Glib::wrap(
+ sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("symbol-add")))) );
+ addSymbol->set_tooltip_text(_("Add Symbol from the current document."));
+ addSymbol->set_relief( Gtk::RELIEF_NONE );
+ addSymbol->set_focus_on_click( false );
+ addSymbol->signal_clicked().connect(sigc::mem_fun(*this, &SymbolsDialog::insertSymbol));
+ tools->pack_start(* addSymbol, Gtk::PACK_SHRINK);
+
+ removeSymbol = Gtk::manage(new Gtk::Button());
+ removeSymbol->add(*Gtk::manage(Glib::wrap(
+ sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("symbol-remove")))) );
+ removeSymbol->set_tooltip_text(_("Remove Symbol from the current document."));
+ removeSymbol->set_relief( Gtk::RELIEF_NONE );
+ removeSymbol->set_focus_on_click( false );
+ removeSymbol->signal_clicked().connect(sigc::mem_fun(*this, &SymbolsDialog::revertSymbol));
+ tools->pack_start(* removeSymbol, Gtk::PACK_SHRINK);
+
+ Gtk::Label* spacer = Gtk::manage(new Gtk::Label(""));
+ tools->pack_start(* Gtk::manage(spacer));
+
+ in_sizes = 2; // Default 32px
+ button = Gtk::manage(new Gtk::Button());
+ button->add(*Gtk::manage(Glib::wrap(
+ sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("symbol-bigger")))) );
+ button->set_tooltip_text(_("Make Icons bigger by zooming in."));
+ button->set_relief( Gtk::RELIEF_NONE );
+ button->set_focus_on_click( false );
+ button->signal_clicked().connect(sigc::mem_fun(*this, &SymbolsDialog::zoomin));
+ tools->pack_start(* button, Gtk::PACK_SHRINK);
+
+ button = Gtk::manage(new Gtk::Button());
+ button->add(*Gtk::manage(Glib::wrap(
+ sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("symbol-smaller")))) );
+ button->set_tooltip_text(_("Make Icons smaller by zooming out."));
+ button->set_relief( Gtk::RELIEF_NONE );
+ button->set_focus_on_click( false );
+ button->signal_clicked().connect(sigc::mem_fun(*this, &SymbolsDialog::zoomout));
+ tools->pack_start(* button, Gtk::PACK_SHRINK);
+
+ fitSymbol = Gtk::manage(new Gtk::ToggleButton());
+ fitSymbol->add(*Gtk::manage(Glib::wrap(
+ sp_icon_new (Inkscape::ICON_SIZE_SMALL_TOOLBAR, INKSCAPE_ICON("symbol-fit")))) );
+ fitSymbol->set_tooltip_text(_("Toggle 'fit' symbols in icon space."));
+ fitSymbol->set_relief( Gtk::RELIEF_NONE );
+ fitSymbol->set_focus_on_click( false );
+ fitSymbol->set_active( true );
+ fitSymbol->signal_clicked().connect(sigc::mem_fun(*this, &SymbolsDialog::rebuild));
+ tools->pack_start(* fitSymbol, Gtk::PACK_SHRINK);
-#if WITH_GTKMM_3_0
- previewScale->set_hexpand();
- table->attach(*Gtk::manage(previewScale),1,row,1,1);
-#else
- table->attach(*Gtk::manage(previewScale),1,2,row,row+1,Gtk::FILL|Gtk::EXPAND,Gtk::SHRINK);
-#endif
-
- sigc::connection connScale =
- previewScale->signal_changed().connect(sigc::mem_fun(*this, &SymbolsDialog::rebuild));
- instanceConns.push_back(connScale);
-
- ++row;
-
- /******************** Preview Size ************************/
- Gtk::Label* labelSize = new Gtk::Label(_("Preview size: "));
-
-#if WITH_GTKMM_3_0
- table->attach(*Gtk::manage(labelSize),0,row,1,1);
-#else
- table->attach(*Gtk::manage(labelSize),0,1,row,row+1,Gtk::SHRINK,Gtk::SHRINK);
-#endif
-
- previewSize = new Gtk::ComboBoxText();
- const gchar *sizes[] = {"16", "24", "32", "48", "64", NULL};
- for( int i = 0; sizes[i]; ++i ) {
- previewSize->append(sizes[i]);
- }
- previewSize->set_active_text(sizes[2]);
-
-#if WITH_GTKMM_3_0
- previewSize->set_hexpand();
- table->attach(*Gtk::manage(previewSize),1,row,1,1);
-#else
- table->attach(*Gtk::manage(previewSize),1,2,row,row+1,Gtk::FILL|Gtk::EXPAND,Gtk::SHRINK);
-#endif
-
- sigc::connection connSize =
- previewSize->signal_changed().connect(sigc::mem_fun(*this, &SymbolsDialog::rebuild));
- instanceConns.push_back(connSize);
-
++row;
/**********************************************************/
@@ -253,6 +266,10 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) :
sigc::mem_fun(*this, &SymbolsDialog::defsModified));
instanceConns.push_back(defsModifiedConn);
+ sigc::connection selectionChangedConn = currentDesktop->selection->connectChanged(
+ sigc::mem_fun(*this, &SymbolsDialog::selectionChanged));
+ instanceConns.push_back(selectionChangedConn);
+
get_symbols();
draw_symbols( currentDocument ); /* Defaults to current document */
@@ -277,6 +294,20 @@ SymbolsDialog& SymbolsDialog::getInstance()
return *new SymbolsDialog();
}
+void SymbolsDialog::zoomin() {
+ if(in_sizes < 4) {
+ in_sizes++;
+ rebuild();
+ }
+}
+
+void SymbolsDialog::zoomout() {
+ if(in_sizes > 0) {
+ in_sizes--;
+ rebuild();
+ }
+}
+
void SymbolsDialog::rebuild() {
store->clear();
@@ -287,10 +318,27 @@ void SymbolsDialog::rebuild() {
// Symbol must be from Current Document (this method of
// checking should be language independent).
symbolDocument = currentDocument;
+ addSymbol->set_sensitive( true );
+ removeSymbol->set_sensitive( true );
+ } else {
+ addSymbol->set_sensitive( false );
+ removeSymbol->set_sensitive( false );
}
draw_symbols( symbolDocument );
}
+void SymbolsDialog::insertSymbol() {
+ Inkscape::Verb *verb = Inkscape::Verb::get( SP_VERB_EDIT_SYMBOL );
+ SPAction *action = verb->get_action((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);
+ sp_action_perform (action, NULL);
+}
+
void SymbolsDialog::iconDragDataGet(const Glib::RefPtr<Gdk::DragContext>& /*context*/, Gtk::SelectionData& data, guint /*info*/, guint /*time*/)
{
#if WITH_GTKMM_3_0
@@ -319,48 +367,68 @@ void SymbolsDialog::defsModified(SPObject * /*object*/, guint /*flags*/)
}
}
-void SymbolsDialog::iconChanged() {
-#if WITH_GTKMM_3_0
- std::vector<Gtk::TreePath> iconArray = iconView->get_selected_items();
-#else
- Gtk::IconView::ArrayHandle_TreePaths iconArray = iconView->get_selected_items();
-#endif
+void SymbolsDialog::selectionChanged(Inkscape::Selection *selection) {
+ Glib::ustring symbol_id = selectedSymbolId();
+ SPDocument* symbolDocument = selectedSymbols();
+ SPObject* symbol = symbolDocument->getObjectById(symbol_id);
- if( iconArray.empty() ) {
- //std::cout << " iconArray empty: huh? " << std::endl;
- } else {
+ if(symbol && !selection->includes(symbol)) {
+ iconView->unselect_all();
+ }
+}
+
+SPDocument* SymbolsDialog::selectedSymbols() {
+ /* OK, we know symbol name... now we need to copy it to clipboard, bon chance! */
+ Glib::ustring symbolSetString = symbolSet->get_active_text();
+
+ SPDocument* symbolDocument = symbolSets[symbolSetString];
+ if( !symbolDocument ) {
+ // Symbol must be from Current Document (this method of checking should be language independent).
+ return currentDocument;
+ }
+ return symbolDocument;
+}
+
+Glib::ustring SymbolsDialog::selectedSymbolId() {
+ #if WITH_GTKMM_3_0
+ std::vector<Gtk::TreePath> iconArray = iconView->get_selected_items();
+ #else
+ Gtk::IconView::ArrayHandle_TreePaths iconArray = iconView->get_selected_items();
+ #endif
+ if( !iconArray.empty() ) {
Gtk::TreeModel::Path const & path = *iconArray.begin();
Gtk::ListStore::iterator row = store->get_iter(path);
- Glib::ustring symbol_id = (*row)[getColumns()->symbol_id];
+ return (*row)[getColumns()->symbol_id];
+ }
+ return Glib::ustring("");
+}
- /* OK, we know symbol name... now we need to copy it to clipboard, bon chance! */
- Glib::ustring symbolSetString = symbolSet->get_active_text();
+void SymbolsDialog::iconChanged() {
- SPDocument* symbolDocument = symbolSets[symbolSetString];
- if( !symbolDocument ) {
- // Symbol must be from Current Document (this method of
- // checking should be language independent).
- symbolDocument = currentDocument;
- }
+ Glib::ustring symbol_id = selectedSymbolId();
+ SPDocument* symbolDocument = selectedSymbols();
+ SPObject* symbol = symbolDocument->getObjectById(symbol_id);
- SPObject* symbol = symbolDocument->getObjectById(symbol_id);
- if( symbol ) {
-
- // Find style for use in <use>
- // First look for default style stored in <symbol>
- gchar const* style = symbol->getAttribute("inkscape:symbol-style");
- if( !style ) {
- // If no default style in <symbol>, look in documents.
- if( symbolDocument == currentDocument ) {
- style = style_from_use( symbol_id.c_str(), currentDocument );
- } else {
- style = symbolDocument->getReprRoot()->attribute("style");
- }
- }
+ if( symbol ) {
+ if( symbolDocument == currentDocument ) {
+ // Select the symbol on the canvas so it can be manipulated
+ currentDesktop->selection->set( symbol, false );
+ }
- ClipboardManager *cm = ClipboardManager::get();
- cm->copySymbol(symbol->getRepr(), style);
+ // Find style for use in <use>
+ // First look for default style stored in <symbol>
+ gchar const* style = symbol->getAttribute("inkscape:symbol-style");
+ if( !style ) {
+ // If no default style in <symbol>, look in documents.
+ if( symbolDocument == currentDocument ) {
+ style = style_from_use( symbol_id.c_str(), currentDocument );
+ } else {
+ style = symbolDocument->getReprRoot()->attribute("style");
+ }
}
+
+ ClipboardManager *cm = ClipboardManager::get();
+ cm->copySymbol(symbol->getRepr(), style);
}
}
@@ -485,6 +553,9 @@ void SymbolsDialog::get_symbols() {
symbol_doc = SPDocument::createNewDoc( fullname, FALSE );
if( symbol_doc ) {
gchar *title = symbol_doc->getRoot()->title();
+ if( title == NULL ) {
+ title = _("Unnamed Symbols");
+ }
symbolSets[Glib::ustring(title)] = symbol_doc;
symbolSet->append(title);
}
@@ -672,11 +743,7 @@ SymbolsDialog::create_symbol_image(gchar const *symbol_id, SPObject *symbol)
SPItem *item = SP_ITEM(object_temp);
- Glib::ustring previewSizeString = previewSize->get_active_text();
- unsigned psize = atol( previewSizeString.c_str() );
-
- Glib::ustring previewScaleString = previewScale->get_active_text();
- int previewScaleRow = previewScale->get_active_row_number();
+ unsigned psize = SYMBOL_ICON_SIZES[in_sizes];
/* Update to renderable state */
Glib::ustring key = svg_preview_cache.cache_key(previewDocument->getURI(), symbol_id, psize);
@@ -707,21 +774,9 @@ SymbolsDialog::create_symbol_image(gchar const *symbol_id, SPObject *symbol)
height = 1.0;
}
- switch (previewScaleRow) {
- case 0:
- /* Fit */
- scale = psize/std::max(width,height);
- break;
- case 1:
- /* Fit width */
- scale = psize/width;
- break;
- case 2:
- /* Fit height */
- scale = psize/height;
- break;
- default:
- scale = atof( previewScaleString.c_str() );
+ if( fitSymbol->get_active() ) {
+ /* Fit */
+ scale = psize/std::max(width,height);
}
pixbuf = Glib::wrap(render_pixbuf(renderDrawing, scale, *dbox, psize));
diff --git a/src/ui/dialog/symbols.h b/src/ui/dialog/symbols.h
index 352d24ec0..54b1a3ab0 100644
--- a/src/ui/dialog/symbols.h
+++ b/src/ui/dialog/symbols.h
@@ -48,6 +48,9 @@ class SymbolColumns; // For Gtk::ListStore
* new symbols documents to be constructed and if saved in the prefs folder will
* make those symbols available for all future documents.
*/
+
+const int SYMBOL_ICON_SIZES[] = {16, 24, 32, 48, 64};
+
class SymbolsDialog : public UI::Widget::Panel {
public:
@@ -62,8 +65,15 @@ private:
static SymbolColumns *getColumns();
+ void zoomin();
+ void zoomout();
void rebuild();
+ void insertSymbol();
+ void revertSymbol();
void defsModified(SPObject *object, guint flags);
+ void selectionChanged(Inkscape::Selection *selection);
+ SPDocument* selectedSymbols();
+ Glib::ustring selectedSymbolId();
void iconChanged();
void iconDragDataGet(const Glib::RefPtr<Gdk::DragContext>& context, Gtk::SelectionData& selection_data, guint info, guint time);
@@ -84,12 +94,15 @@ private:
/* Keep track of all symbol template documents */
std::map<Glib::ustring, SPDocument*> symbolSets;
+ // Index into sizes which is selected
+ int in_sizes;
Glib::RefPtr<Gtk::ListStore> store;
Gtk::ComboBoxText* symbolSet;
Gtk::IconView* iconView;
- Gtk::ComboBoxText* previewScale;
- Gtk::ComboBoxText* previewSize;
+ Gtk::Button* addSymbol;
+ Gtk::Button* removeSymbol;
+ Gtk::ToggleButton* fitSymbol;
void setTargetDesktop(SPDesktop *desktop);
SPDesktop* currentDesktop;
diff --git a/src/ui/dialog/text-edit.h b/src/ui/dialog/text-edit.h
index 0e3ebafa7..8683d80a3 100644
--- a/src/ui/dialog/text-edit.h
+++ b/src/ui/dialog/text-edit.h
@@ -18,6 +18,14 @@
#ifndef INKSCAPE_UI_DIALOG_TEXT_EDIT_H
#define INKSCAPE_UI_DIALOG_TEXT_EDIT_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/notebook.h>
#include <gtkmm/button.h>
diff --git a/src/ui/dialog/tile.h b/src/ui/dialog/tile.h
index 86dbd25a9..6e41723fd 100644
--- a/src/ui/dialog/tile.h
+++ b/src/ui/dialog/tile.h
@@ -19,6 +19,10 @@
# include <config.h>
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/notebook.h>
#include <gtkmm/checkbutton.h>
diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp
index c071fcf95..ce8af3f1f 100644
--- a/src/ui/dialog/transformation.cpp
+++ b/src/ui/dialog/transformation.cpp
@@ -15,6 +15,10 @@
# include <config.h>
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/dialog.h>
#include <gtkmm/stock.h>
#include <2geom/transforms.h>
@@ -27,6 +31,7 @@
#include "inkscape.h"
#include "selection.h"
#include "selection-chemistry.h"
+#include "message-stack.h"
#include "verbs.h"
#include "preferences.h"
#include "sp-namedview.h"
@@ -758,7 +763,7 @@ void Transformation::applyPageMove(Inkscape::Selection *selection)
double move = x;
for ( std::vector<BBoxSort> ::iterator it (sorted.begin());
it < sorted.end();
- it ++ )
+ ++it )
{
sp_item_move_rel(it->item, Geom::Translate(move, 0));
// move each next object by x relative to previous
@@ -782,7 +787,7 @@ void Transformation::applyPageMove(Inkscape::Selection *selection)
double move = y;
for ( std::vector<BBoxSort> ::iterator it (sorted.begin());
it < sorted.end();
- it ++ )
+ ++it )
{
sp_item_move_rel(it->item, Geom::Translate(0, move));
// move each next object by x relative to previous
@@ -898,10 +903,21 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection)
if (!_units_skew.isAbsolute()) { // percentage
double skewX = _scalar_skew_horizontal.getValue("%");
double skewY = _scalar_skew_vertical.getValue("%");
+ if (fabs(0.01*skewX*0.01*skewY - 1.0) < Geom::EPSILON) {
+ sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
+ return;
+ }
sp_item_skew_rel (item, 0.01*skewX, 0.01*skewY);
} else if (_units_skew.isRadial()) { //deg or rad
double angleX = _scalar_skew_horizontal.getValue("rad");
double angleY = _scalar_skew_vertical.getValue("rad");
+ if ((fabs(angleX - angleY + M_PI/2) < Geom::EPSILON)
+ || (fabs(angleX - angleY - M_PI/2) < Geom::EPSILON)
+ || (fabs((angleX - angleY)/3 + M_PI/2) < Geom::EPSILON)
+ || (fabs((angleX - angleY)/3 - M_PI/2) < Geom::EPSILON)) {
+ sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
+ return;
+ }
double skewX = tan(-angleX);
double skewY = tan(angleY);
sp_item_skew_rel (item, skewX, skewY);
@@ -912,6 +928,10 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection)
if (bbox) {
double width = bbox->dimensions()[Geom::X];
double height = bbox->dimensions()[Geom::Y];
+ if (fabs(skewX*skewY - width*height) < Geom::EPSILON) {
+ sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
+ return;
+ }
sp_item_skew_rel (item, skewX/height, skewY/width);
}
}
@@ -927,16 +947,31 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection)
if (!_units_skew.isAbsolute()) { // percentage
double skewX = _scalar_skew_horizontal.getValue("%");
double skewY = _scalar_skew_vertical.getValue("%");
+ if (fabs(0.01*skewX*0.01*skewY - 1.0) < Geom::EPSILON) {
+ sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
+ return;
+ }
sp_selection_skew_relative(selection, *center, 0.01*skewX, 0.01*skewY);
} else if (_units_skew.isRadial()) { //deg or rad
double angleX = _scalar_skew_horizontal.getValue("rad");
double angleY = _scalar_skew_vertical.getValue("rad");
+ if ((fabs(angleX - angleY + M_PI/2) < Geom::EPSILON)
+ || (fabs(angleX - angleY - M_PI/2) < Geom::EPSILON)
+ || (fabs((angleX - angleY)/3 + M_PI/2) < Geom::EPSILON)
+ || (fabs((angleX - angleY)/3 - M_PI/2) < Geom::EPSILON)) {
+ sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
+ return;
+ }
double skewX = tan(-angleX);
double skewY = tan(angleY);
sp_selection_skew_relative(selection, *center, skewX, skewY);
} else { // absolute displacement
double skewX = _scalar_skew_horizontal.getValue("px");
double skewY = _scalar_skew_vertical.getValue("px");
+ if (fabs(skewX*skewY - width*height) < Geom::EPSILON) {
+ sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
+ return;
+ }
sp_selection_skew_relative(selection, *center, skewX/height, skewY/width);
}
}
@@ -957,6 +992,10 @@ void Transformation::applyPageTransform(Inkscape::Selection *selection)
double f = _scalar_transform_f.getValue();
Geom::Affine displayed(a, b, c, d, e, f);
+ if (displayed.isSingular()) {
+ sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>."));
+ return;
+ }
if (_check_replace_matrix.get_active()) {
for (GSList const *l = selection->itemList(); l != NULL; l = l->next) {
diff --git a/src/ui/previewholder.h b/src/ui/previewholder.h
index f6d1985cc..f9f923be4 100644
--- a/src/ui/previewholder.h
+++ b/src/ui/previewholder.h
@@ -16,6 +16,10 @@
# include "config.h"
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/bin.h>
diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp
index 87b8e2635..6c3a0d282 100644
--- a/src/ui/tool/multi-path-manipulator.cpp
+++ b/src/ui/tool/multi-path-manipulator.cpp
@@ -224,10 +224,12 @@ void MultiPathManipulator::shiftSelection(int dir)
SubpathList::iterator last_j;
NodeList::iterator last_k;
bool anything_found = false;
+ bool anynode_found = false;
for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ++i) {
SubpathList &sp = i->second->subpathList();
for (SubpathList::iterator j = sp.begin(); j != sp.end(); ++j) {
+ anynode_found = true;
for (NodeList::iterator k = (*j)->begin(); k != (*j)->end(); ++k) {
if (k->selected()) {
last_i = i;
@@ -249,10 +251,12 @@ void MultiPathManipulator::shiftSelection(int dir)
if (!anything_found) {
// select first / last node
// this should never fail because there must be at least 1 non-empty manipulator
- if (dir == 1) {
+ if (anynode_found) {
+ if (dir == 1) {
_selection.insert((*_mmap.begin()->second->subpathList().begin())->begin().ptr());
- } else {
+ } else {
_selection.insert((--(*--(--_mmap.end())->second->subpathList().end())->end()).ptr());
+ }
}
return;
}
diff --git a/src/ui/widget/button.h b/src/ui/widget/button.h
index efadfad07..a214dd881 100644
--- a/src/ui/widget/button.h
+++ b/src/ui/widget/button.h
@@ -10,6 +10,14 @@
#ifndef INKSCAPE_UI_WIDGET_BUTTON_H
#define INKSCAPE_UI_WIDGET_BUTTON_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/checkbutton.h>
#include <gtkmm/radiobutton.h>
diff --git a/src/ui/widget/color-picker.h b/src/ui/widget/color-picker.h
index e20212615..b4da5dbf2 100644
--- a/src/ui/widget/color-picker.h
+++ b/src/ui/widget/color-picker.h
@@ -13,7 +13,16 @@
#ifndef __COLOR_PICKER_H__
#define __COLOR_PICKER_H__
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stddef.h>
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/dialog.h>
#include <gtkmm/button.h>
#include <sigc++/sigc++.h>
diff --git a/src/ui/widget/color-preview.h b/src/ui/widget/color-preview.h
index caddfb9a2..959b5e09b 100644
--- a/src/ui/widget/color-preview.h
+++ b/src/ui/widget/color-preview.h
@@ -15,6 +15,10 @@
# include <config.h>
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/widget.h>
namespace Inkscape {
diff --git a/src/ui/widget/dock-item.h b/src/ui/widget/dock-item.h
index 608badb62..cc0c13eea 100644
--- a/src/ui/widget/dock-item.h
+++ b/src/ui/widget/dock-item.h
@@ -11,6 +11,14 @@
#ifndef INKSCAPE_UI_WIGET_DOCK_ITEM_H
#define INKSCAPE_UI_WIGET_DOCK_ITEM_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/frame.h>
#include <gtkmm/window.h>
diff --git a/src/ui/widget/dock.h b/src/ui/widget/dock.h
index 28ab42740..611c10f46 100644
--- a/src/ui/widget/dock.h
+++ b/src/ui/widget/dock.h
@@ -12,6 +12,14 @@
#ifndef INKSCAPE_UI_WIDGET_DOCK_H
#define INKSCAPE_UI_WIDGET_DOCK_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <list>
#include "ui/widget/dock-item.h"
diff --git a/src/ui/widget/entity-entry.cpp b/src/ui/widget/entity-entry.cpp
index c622796b2..0f526f77a 100644
--- a/src/ui/widget/entity-entry.cpp
+++ b/src/ui/widget/entity-entry.cpp
@@ -17,6 +17,10 @@
# include <config.h>
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/entry.h>
diff --git a/src/ui/widget/filter-effect-chooser.h b/src/ui/widget/filter-effect-chooser.h
index ae3ec07c4..6f0c2f26e 100644
--- a/src/ui/widget/filter-effect-chooser.h
+++ b/src/ui/widget/filter-effect-chooser.h
@@ -12,6 +12,14 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/combobox.h>
diff --git a/src/ui/widget/frame.h b/src/ui/widget/frame.h
index a04666651..55638ad40 100644
--- a/src/ui/widget/frame.h
+++ b/src/ui/widget/frame.h
@@ -10,6 +10,14 @@
#ifndef INKSCAPE_UI_WIDGET_FRAME_H
#define INKSCAPE_UI_WIDGET_FRAME_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/alignment.h>
#include <gtkmm/frame.h>
#include <gtkmm/label.h>
diff --git a/src/ui/widget/imageicon.h b/src/ui/widget/imageicon.h
index 2ea8b8533..8faf13cb1 100644
--- a/src/ui/widget/imageicon.h
+++ b/src/ui/widget/imageicon.h
@@ -12,6 +12,14 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <glibmm/ustring.h>
diff --git a/src/ui/widget/imagetoggler.h b/src/ui/widget/imagetoggler.h
index 7b02fa4dc..df6eb7ded 100644
--- a/src/ui/widget/imagetoggler.h
+++ b/src/ui/widget/imagetoggler.h
@@ -14,6 +14,10 @@
#include "config.h"
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/cellrendererpixbuf.h>
#include <gtkmm/widget.h>
#include <glibmm/property.h>
diff --git a/src/ui/widget/labelled.h b/src/ui/widget/labelled.h
index 88eb3ce19..5334454bc 100644
--- a/src/ui/widget/labelled.h
+++ b/src/ui/widget/labelled.h
@@ -11,6 +11,14 @@
#ifndef INKSCAPE_UI_WIDGET_LABELLED_H
#define INKSCAPE_UI_WIDGET_LABELLED_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
namespace Gtk {
diff --git a/src/ui/widget/licensor.h b/src/ui/widget/licensor.h
index ab6abd0a4..0ac3e5ab8 100644
--- a/src/ui/widget/licensor.h
+++ b/src/ui/widget/licensor.h
@@ -10,6 +10,14 @@
#ifndef INKSCAPE_UI_WIDGET_LICENSOR_H
#define INKSCAPE_UI_WIDGET_LICENSOR_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
class SPDocument;
diff --git a/src/ui/widget/notebook-page.h b/src/ui/widget/notebook-page.h
index d8b8fb0c4..38ae9e054 100644
--- a/src/ui/widget/notebook-page.h
+++ b/src/ui/widget/notebook-page.h
@@ -14,6 +14,10 @@
# include <config.h>
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
namespace Gtk {
diff --git a/src/ui/widget/object-composite-settings.h b/src/ui/widget/object-composite-settings.h
index bee9f09b9..19a6cb2a5 100644
--- a/src/ui/widget/object-composite-settings.h
+++ b/src/ui/widget/object-composite-settings.h
@@ -11,6 +11,14 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/alignment.h>
#include <gtkmm/adjustment.h>
diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp
index 7eb114d0a..d60eeefe0 100644
--- a/src/ui/widget/panel.cpp
+++ b/src/ui/widget/panel.cpp
@@ -15,6 +15,10 @@
# include <config.h>
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/dialog.h> // for Gtk::RESPONSE_*
#include <gtkmm/menu.h>
#include <gtkmm/stock.h>
diff --git a/src/ui/widget/panel.h b/src/ui/widget/panel.h
index 5bb054577..0c3d822b8 100644
--- a/src/ui/widget/panel.h
+++ b/src/ui/widget/panel.h
@@ -17,6 +17,10 @@
# include <config.h>
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/arrow.h>
#include <gtkmm/button.h>
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp
index d32de6871..567f29f91 100644
--- a/src/ui/widget/preferences-widget.cpp
+++ b/src/ui/widget/preferences-widget.cpp
@@ -18,6 +18,10 @@
#include <windows.h>
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/frame.h>
#include <gtkmm/alignment.h>
diff --git a/src/ui/widget/preferences-widget.h b/src/ui/widget/preferences-widget.h
index e3968045d..cb4ce17d1 100644
--- a/src/ui/widget/preferences-widget.h
+++ b/src/ui/widget/preferences-widget.h
@@ -15,8 +15,17 @@
#ifndef INKSCAPE_UI_WIDGET_INKSCAPE_PREFERENCES_H
#define INKSCAPE_UI_WIDGET_INKSCAPE_PREFERENCES_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <iostream>
#include <vector>
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/filechooserbutton.h>
#include "ui/widget/spinbutton.h"
#include <stddef.h>
diff --git a/src/ui/widget/rotateable.cpp b/src/ui/widget/rotateable.cpp
index 1d91515e5..18d53bf5c 100644
--- a/src/ui/widget/rotateable.cpp
+++ b/src/ui/widget/rotateable.cpp
@@ -7,6 +7,14 @@
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/eventbox.h>
#include <glibmm/i18n.h>
diff --git a/src/ui/widget/selected-style.h b/src/ui/widget/selected-style.h
index 9b78cb17f..e5bc4f883 100644
--- a/src/ui/widget/selected-style.h
+++ b/src/ui/widget/selected-style.h
@@ -15,6 +15,10 @@
# include "config.h"
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#if WITH_GTKMM_3_0
diff --git a/src/ui/widget/spin-scale.cpp b/src/ui/widget/spin-scale.cpp
index 548e9a6a6..ade3d1e60 100644
--- a/src/ui/widget/spin-scale.cpp
+++ b/src/ui/widget/spin-scale.cpp
@@ -6,11 +6,12 @@
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
+#include "spin-scale.h"
+
#include <gtkmm/adjustment.h>
#include <glibmm/i18n.h>
#include <glibmm/stringutils.h>
-#include "spin-scale.h"
#include "ui/widget/gimpspinscale.h"
namespace Inkscape {
diff --git a/src/ui/widget/spin-scale.h b/src/ui/widget/spin-scale.h
index a8403307f..5fec8b1d8 100644
--- a/src/ui/widget/spin-scale.h
+++ b/src/ui/widget/spin-scale.h
@@ -9,6 +9,14 @@
#ifndef INKSCAPE_UI_WIDGET_SPIN_SCALE_H
#define INKSCAPE_UI_WIDGET_SPIN_SCALE_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/adjustment.h>
#include <gtkmm/box.h>
#include <gtkmm/scale.h>
diff --git a/src/ui/widget/spin-slider.h b/src/ui/widget/spin-slider.h
index 8a45299e5..5f86fd15a 100644
--- a/src/ui/widget/spin-slider.h
+++ b/src/ui/widget/spin-slider.h
@@ -10,6 +10,14 @@
#ifndef INKSCAPE_UI_WIDGET_SPIN_SLIDER_H
#define INKSCAPE_UI_WIDGET_SPIN_SLIDER_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/adjustment.h>
#include <gtkmm/box.h>
#include <gtkmm/scale.h>
diff --git a/src/ui/widget/spinbutton.h b/src/ui/widget/spinbutton.h
index 57c48369e..fe5d699e7 100644
--- a/src/ui/widget/spinbutton.h
+++ b/src/ui/widget/spinbutton.h
@@ -10,6 +10,14 @@
#ifndef INKSCAPE_UI_WIDGET_SPINBUTTON_H
#define INKSCAPE_UI_WIDGET_SPINBUTTON_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/spinbutton.h>
namespace Inkscape {
diff --git a/src/ui/widget/style-swatch.h b/src/ui/widget/style-swatch.h
index d7bab3732..6bdb5e248 100644
--- a/src/ui/widget/style-swatch.h
+++ b/src/ui/widget/style-swatch.h
@@ -17,6 +17,10 @@
# include "config.h"
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/label.h>
#include <gtkmm/eventbox.h>
diff --git a/src/ui/widget/tolerance-slider.cpp b/src/ui/widget/tolerance-slider.cpp
index f92a08d0a..d166e3831 100644
--- a/src/ui/widget/tolerance-slider.cpp
+++ b/src/ui/widget/tolerance-slider.cpp
@@ -12,6 +12,10 @@
# include <config.h>
#endif
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/adjustment.h>
#include <gtkmm/box.h>
#include <gtkmm/label.h>
diff --git a/src/ui/widget/unit-menu.h b/src/ui/widget/unit-menu.h
index 142b11186..3104d5aef 100644
--- a/src/ui/widget/unit-menu.h
+++ b/src/ui/widget/unit-menu.h
@@ -10,6 +10,14 @@
#ifndef INKSCAPE_UI_WIDGET_UNIT_H
#define INKSCAPE_UI_WIDGET_UNIT_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+#include <glibmm/threads.h>
+#endif
+
#include <gtkmm/comboboxtext.h>
#include "util/units.h"