summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-11-26 01:17:02 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-11-26 01:17:02 +0000
commitbed3cc55fe40330718204c540b328d95407b00fa (patch)
treee4269aab0a32957163935ec6b828b25d00613d68 /src/ui
parentAdd CMake file to find LCMS2 (diff)
parentUpdate to trunk r13766 (diff)
downloadinkscape-bed3cc55fe40330718204c540b328d95407b00fa.tar.gz
inkscape-bed3cc55fe40330718204c540b328d95407b00fa.zip
Merge inkscape-cppify branch
(bzr r13767)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/CMakeLists.txt4
-rw-r--r--src/ui/clipboard.cpp2
-rw-r--r--src/ui/dialog-events.cpp9
-rw-r--r--src/ui/dialog-events.h12
-rw-r--r--src/ui/dialog/align-and-distribute.cpp16
-rw-r--r--src/ui/dialog/align-and-distribute.h3
-rw-r--r--src/ui/dialog/clonetiler.cpp36
-rw-r--r--src/ui/dialog/clonetiler.h5
-rw-r--r--src/ui/dialog/desktop-tracker.cpp17
-rw-r--r--src/ui/dialog/desktop-tracker.h4
-rw-r--r--src/ui/dialog/dialog.cpp38
-rw-r--r--src/ui/dialog/dialog.h1
-rw-r--r--src/ui/dialog/document-metadata.cpp4
-rw-r--r--src/ui/dialog/document-metadata.h5
-rw-r--r--src/ui/dialog/document-properties.cpp4
-rw-r--r--src/ui/dialog/document-properties.h4
-rw-r--r--src/ui/dialog/export.cpp4
-rw-r--r--src/ui/dialog/filedialogimpl-gtkmm.cpp7
-rw-r--r--src/ui/dialog/fill-and-stroke.h3
-rw-r--r--src/ui/dialog/grid-arrange-tab.cpp13
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp2
-rw-r--r--src/ui/dialog/panel-dialog.h33
-rw-r--r--src/ui/dialog/swatches.cpp2
-rw-r--r--src/ui/dialog/symbols.cpp10
-rw-r--r--src/ui/dialog/template-load-tab.cpp2
-rw-r--r--src/ui/dialog/transformation.cpp14
-rw-r--r--src/ui/dialog/transformation.h3
-rw-r--r--src/ui/interface.cpp12
-rw-r--r--src/ui/tools-switch.cpp4
-rw-r--r--src/ui/tools/connector-tool.cpp2
-rw-r--r--src/ui/view/view.cpp8
-rw-r--r--src/ui/widget/dock.cpp5
-rw-r--r--src/ui/widget/imageicon.cpp5
-rw-r--r--src/ui/widget/object-composite-settings.cpp21
-rw-r--r--src/ui/widget/object-composite-settings.h4
-rw-r--r--src/ui/widget/panel.cpp6
-rw-r--r--src/ui/widget/panel.h9
37 files changed, 135 insertions, 198 deletions
diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt
index e5c605889..98a5a224c 100644
--- a/src/ui/CMakeLists.txt
+++ b/src/ui/CMakeLists.txt
@@ -4,8 +4,8 @@ set(ui_SRC
control-manager.cpp
dialog-events.cpp
draw-anchor.cpp
- interface.cpp
- object-edit.cpp
+ interface.cpp
+ object-edit.cpp
previewholder.cpp
shape-editor.cpp
tools-switch.cpp
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index 153ed9830..7c82fb230 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -331,7 +331,7 @@ void ClipboardManagerImpl::copySymbol(Inkscape::XML::Node* symbol, gchar const*
// Set a default style in <use> rather than <symbol> so it can be changed.
use->setAttribute("style", style );
- Inkscape::XML::Node *nv_repr = sp_desktop_namedview(inkscape_active_desktop())->getRepr();
+ Inkscape::XML::Node *nv_repr = sp_desktop_namedview(SP_ACTIVE_DESKTOP)->getRepr();
gdouble scale_units = Inkscape::Util::Quantity::convert(1, nv_repr->attribute("inkscape:document-units"), "px");
gchar *transform_str = sp_svg_transform_write(Geom::Scale(scale_units, scale_units));
use->setAttribute("transform", transform_str);
diff --git a/src/ui/dialog-events.cpp b/src/ui/dialog-events.cpp
index 6bd93bbc3..5bc8088a1 100644
--- a/src/ui/dialog-events.cpp
+++ b/src/ui/dialog-events.cpp
@@ -6,7 +6,7 @@
* bulia byak <bulia@dr.com>
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
*
- * Copyright (C) 2003-2007 Authors
+ * Copyright (C) 2003-2014 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
@@ -25,7 +25,7 @@
#include "macros.h"
#include <gtk/gtk.h>
#include "desktop.h"
-#include "inkscape-private.h"
+#include "inkscape.h"
#include "preferences.h"
#include "ui/tools/tool-base.h"
@@ -183,12 +183,11 @@ void sp_transientize(GtkWidget *dialog)
void on_transientize (SPDesktop *desktop, win_data *wd )
{
- sp_transientize_callback (0, desktop, wd);
+ sp_transientize_callback (desktop, wd);
}
void
-sp_transientize_callback ( InkscapeApplication * /*inkscape*/,
- SPDesktop *desktop, win_data *wd )
+sp_transientize_callback ( SPDesktop *desktop, win_data *wd )
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
gint transient_policy = prefs->getIntLimited( "/options/transientpolicy/value", 1, 0, 2);
diff --git a/src/ui/dialog-events.h b/src/ui/dialog-events.h
index b33eb3f38..b4a5d7c35 100644
--- a/src/ui/dialog-events.h
+++ b/src/ui/dialog-events.h
@@ -4,7 +4,7 @@
/* Authors:
* bulia byak <bulia@dr.com>
*
- * Copyright (C) 2003 authors
+ * Copyright (C) 2003-2014 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
@@ -28,8 +28,6 @@ class Entry;
}
class SPDesktop;
-
-struct InkscapeApplication;
typedef struct {
GtkWidget *win;
@@ -53,14 +51,14 @@ void sp_transientize ( GtkWidget *win );
void on_transientize ( SPDesktop *desktop,
win_data *wd );
-void sp_transientize_callback ( InkscapeApplication *inkscape,
- SPDesktop *desktop,
+void sp_transientize_callback ( SPDesktop *desktop,
win_data *wd );
void on_dialog_hide (GtkWidget *w);
void on_dialog_unhide (GtkWidget *w);
-gboolean sp_dialog_hide (GObject *object, gpointer data);
-gboolean sp_dialog_unhide (GObject *object, gpointer data);
+
+//gboolean sp_dialog_hide (GObject *object, gpointer data);
+//gboolean sp_dialog_unhide (GObject *object, gpointer data);
#endif
diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp
index 431da7ad1..c538968d6 100644
--- a/src/ui/dialog/align-and-distribute.cpp
+++ b/src/ui/dialog/align-and-distribute.cpp
@@ -829,14 +829,14 @@ private :
-static void on_tool_changed(InkscapeApplication */*inkscape*/, Inkscape::UI::Tools::ToolBase */*context*/, AlignAndDistribute *daad)
+static void on_tool_changed(AlignAndDistribute *daad)
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
if (desktop && desktop->getEventContext())
daad->setMode(tools_active(desktop) == TOOLS_NODES);
}
-static void on_selection_changed(InkscapeApplication */*inkscape*/, Inkscape::Selection */*selection*/, AlignAndDistribute *daad)
+static void on_selection_changed(AlignAndDistribute *daad)
{
daad->randomize_bbox = Geom::OptRect();
}
@@ -1044,10 +1044,10 @@ AlignAndDistribute::AlignAndDistribute()
contents->pack_start(_nodesFrame, true, true);
//Connect to the global tool change signal
- g_signal_connect (G_OBJECT (INKSCAPE), "set_eventcontext", G_CALLBACK (on_tool_changed), this);
+ _toolChangeConn = INKSCAPE.signal_eventcontext_set.connect(sigc::hide<0>(sigc::bind(sigc::ptr_fun(&on_tool_changed), this)));
// Connect to the global selection change, to invalidate cached randomize_bbox
- g_signal_connect (G_OBJECT (INKSCAPE), "change_selection", G_CALLBACK (on_selection_changed), this);
+ _selChangeConn = INKSCAPE.signal_selection_changed.connect(sigc::hide<0>(sigc::bind(sigc::ptr_fun(&on_selection_changed), this)));
randomize_bbox = Geom::OptRect();
_desktopChangeConn = _deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &AlignAndDistribute::setDesktop) );
@@ -1055,18 +1055,18 @@ AlignAndDistribute::AlignAndDistribute()
show_all_children();
- on_tool_changed (NULL, NULL, this); // set current mode
+ on_tool_changed (this); // set current mode
}
AlignAndDistribute::~AlignAndDistribute()
{
- sp_signal_disconnect_by_data (G_OBJECT (INKSCAPE), this);
-
for (std::list<Action *>::iterator it = _actionList.begin();
it != _actionList.end(); ++it) {
delete *it;
}
+ _toolChangeConn.disconnect();
+ _selChangeConn.disconnect();
_desktopChangeConn.disconnect();
_deskTrack.disconnect();
}
@@ -1075,7 +1075,7 @@ void AlignAndDistribute::setTargetDesktop(SPDesktop *desktop)
{
if (_desktop != desktop) {
_desktop = desktop;
- on_tool_changed (NULL, NULL, this);
+ on_tool_changed (this);
}
}
diff --git a/src/ui/dialog/align-and-distribute.h b/src/ui/dialog/align-and-distribute.h
index dfd84535b..eecc30ff8 100644
--- a/src/ui/dialog/align-and-distribute.h
+++ b/src/ui/dialog/align-and-distribute.h
@@ -127,7 +127,8 @@ protected:
SPDesktop *_desktop;
DesktopTracker _deskTrack;
sigc::connection _desktopChangeConn;
-
+ sigc::connection _toolChangeConn;
+ sigc::connection _selChangeConn;
private:
AlignAndDistribute(AlignAndDistribute const &d);
AlignAndDistribute& operator=(AlignAndDistribute const &d);
diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp
index 7a776a9b8..37881d4ae 100644
--- a/src/ui/dialog/clonetiler.cpp
+++ b/src/ui/dialog/clonetiler.cpp
@@ -76,15 +76,12 @@ static gdouble trace_zoom;
static SPDocument *trace_doc = NULL;
-CloneTiler::CloneTiler (void) :
+CloneTiler::CloneTiler () :
UI::Widget::Panel ("", "/dialogs/clonetiler/", SP_VERB_DIALOG_CLONETILER),
dlg(NULL),
desktop(NULL),
deskTrack(),
- table_row_labels(NULL),
- selectChangedConn(),
- subselChangedConn(),
- selectModifiedConn()
+ table_row_labels(NULL)
{
Gtk::Box *contents = _getContents();
contents->set_spacing(0);
@@ -1273,12 +1270,13 @@ CloneTiler::CloneTiler (void) :
// connect to global selection changed signal (so we can change desktops) and
// external_change (so we're not fooled by undo)
- g_signal_connect (G_OBJECT (INKSCAPE), "change_selection", G_CALLBACK (clonetiler_change_selection), dlg);
- g_signal_connect (G_OBJECT (INKSCAPE), "external_change", G_CALLBACK (clonetiler_external_change), dlg);
- g_signal_connect(G_OBJECT(dlg), "destroy", G_CALLBACK(clonetiler_disconnect_gsignal), G_OBJECT (INKSCAPE));
+ selectChangedConn = INKSCAPE.signal_selection_changed.connect(sigc::bind(sigc::ptr_fun(&CloneTiler::clonetiler_change_selection), dlg));
+ externChangedConn = INKSCAPE.signal_external_change.connect (sigc::bind(sigc::ptr_fun(&CloneTiler::clonetiler_external_change), dlg));
+
+ g_signal_connect(G_OBJECT(dlg), "destroy", G_CALLBACK(clonetiler_disconnect_gsignal), this);
// update now
- clonetiler_change_selection (NULL, sp_desktop_selection(SP_ACTIVE_DESKTOP), dlg);
+ clonetiler_change_selection (sp_desktop_selection(SP_ACTIVE_DESKTOP), dlg);
}
{
@@ -1350,7 +1348,7 @@ void CloneTiler::on_picker_color_changed(guint rgba)
is_updating = false;
}
-void CloneTiler::clonetiler_change_selection(InkscapeApplication * /*inkscape*/, Inkscape::Selection *selection, GtkWidget *dlg)
+void CloneTiler::clonetiler_change_selection(Inkscape::Selection *selection, GtkWidget *dlg)
{
GtkWidget *buttons = GTK_WIDGET(g_object_get_data (G_OBJECT(dlg), "buttons_on_tiles"));
GtkWidget *status = GTK_WIDGET(g_object_get_data (G_OBJECT(dlg), "status"));
@@ -1379,16 +1377,18 @@ void CloneTiler::clonetiler_change_selection(InkscapeApplication * /*inkscape*/,
}
}
-void CloneTiler::clonetiler_external_change(InkscapeApplication * /*inkscape*/, GtkWidget *dlg)
+void CloneTiler::clonetiler_external_change(GtkWidget *dlg)
{
- clonetiler_change_selection (NULL, sp_desktop_selection(SP_ACTIVE_DESKTOP), dlg);
+ clonetiler_change_selection (sp_desktop_selection(SP_ACTIVE_DESKTOP), dlg);
}
-void CloneTiler::clonetiler_disconnect_gsignal(GObject *widget, gpointer source)
+void CloneTiler::clonetiler_disconnect_gsignal(GObject *, gpointer source)
{
- if (source && G_IS_OBJECT(source)) {
- sp_signal_disconnect_by_data (source, widget);
- }
+ g_return_if_fail(source != NULL);
+
+ CloneTiler* dlg = reinterpret_cast<CloneTiler*>(source);
+ dlg->selectChangedConn.disconnect();
+ dlg->externChangedConn.disconnect();
}
Geom::Affine CloneTiler::clonetiler_get_transform(
@@ -2169,7 +2169,7 @@ void CloneTiler::clonetiler_remove(GtkWidget */*widget*/, GtkWidget *dlg, bool d
}
g_slist_free (to_delete);
- clonetiler_change_selection (NULL, selection, dlg);
+ clonetiler_change_selection (selection, dlg);
if (do_undo) {
DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_DIALOG_CLONETILER,
@@ -2643,7 +2643,7 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg)
clonetiler_trace_finish ();
}
- clonetiler_change_selection (NULL, selection, dlg);
+ clonetiler_change_selection (selection, dlg);
desktop->clearWaitingCursor();
diff --git a/src/ui/dialog/clonetiler.h b/src/ui/dialog/clonetiler.h
index 70da86338..e5f5638b2 100644
--- a/src/ui/dialog/clonetiler.h
+++ b/src/ui/dialog/clonetiler.h
@@ -57,8 +57,8 @@ protected:
static void clonetiler_keep_bbox_toggled(GtkToggleButton *tb, gpointer /*data*/);
static void clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg);
static void clonetiler_unclump(GtkWidget */*widget*/, void *);
- static void clonetiler_change_selection(InkscapeApplication * /*inkscape*/, Inkscape::Selection *selection, GtkWidget *dlg);
- static void clonetiler_external_change(InkscapeApplication * /*inkscape*/, GtkWidget *dlg);
+ static void clonetiler_change_selection(Inkscape::Selection *selection, GtkWidget *dlg);
+ static void clonetiler_external_change(GtkWidget *dlg);
static void clonetiler_disconnect_gsignal(GObject *widget, gpointer source);
static void clonetiler_reset(GtkWidget */*widget*/, GtkWidget *dlg);
static guint clonetiler_number_of_clones(SPObject *obj);
@@ -129,6 +129,7 @@ private:
sigc::connection desktopChangeConn;
sigc::connection selectChangedConn;
+ sigc::connection externChangedConn;
sigc::connection subselChangedConn;
sigc::connection selectModifiedConn;
sigc::connection color_changed_connection;
diff --git a/src/ui/dialog/desktop-tracker.cpp b/src/ui/dialog/desktop-tracker.cpp
index 3ed998252..0659de67b 100644
--- a/src/ui/dialog/desktop-tracker.cpp
+++ b/src/ui/dialog/desktop-tracker.cpp
@@ -22,7 +22,6 @@ DesktopTracker::DesktopTracker() :
desktop(0),
widget(0),
hierID(0),
- inkID(0),
trackActive(false),
desktopChangedSig()
{
@@ -41,7 +40,10 @@ void DesktopTracker::connect(GtkWidget *widget)
// Use C/gobject callbacks to avoid gtkmm rewrap-during-destruct issues:
hierID = g_signal_connect( G_OBJECT(widget), "hierarchy-changed", G_CALLBACK(hierarchyChangeCB), this );
- inkID = g_signal_connect( G_OBJECT(INKSCAPE), "activate_desktop", G_CALLBACK(activateDesktopCB), this );
+ inkID = INKSCAPE.signal_activate_desktop.connect(
+ sigc::bind(
+ sigc::ptr_fun(&DesktopTracker::activateDesktopCB), this)
+ );
GtkWidget *wdgt = gtk_widget_get_ancestor(widget, SP_TYPE_DESKTOP_WIDGET);
if (wdgt && !base) {
@@ -60,11 +62,8 @@ void DesktopTracker::disconnect()
}
hierID = 0;
}
- if (inkID) {
- if (INKSCAPE) {
- g_signal_handler_disconnect(G_OBJECT(INKSCAPE), inkID);
- }
- inkID = 0;
+ if (inkID.connected()) {
+ inkID.disconnect();
}
}
@@ -94,12 +93,12 @@ sigc::connection DesktopTracker::connectDesktopChanged( const sigc::slot<void, S
return desktopChangedSig.connect(slot);
}
-gboolean DesktopTracker::activateDesktopCB(InkscapeApplication */*inkscape*/, SPDesktop *desktop, DesktopTracker *self )
+void DesktopTracker::activateDesktopCB(SPDesktop *desktop, DesktopTracker *self )
{
if (self && self->trackActive) {
self->setDesktop(desktop);
}
- return FALSE;
+ //return FALSE;
}
bool DesktopTracker::hierarchyChangeCB(GtkWidget * /*widget*/, GtkWidget* /*prev*/, DesktopTracker *self)
diff --git a/src/ui/dialog/desktop-tracker.h b/src/ui/dialog/desktop-tracker.h
index 7b944ddfa..8cb205a35 100644
--- a/src/ui/dialog/desktop-tracker.h
+++ b/src/ui/dialog/desktop-tracker.h
@@ -36,7 +36,7 @@ public:
sigc::connection connectDesktopChanged( const sigc::slot<void, SPDesktop*> & slot );
private:
- static gboolean activateDesktopCB(InkscapeApplication *inkscape, SPDesktop *desktop, DesktopTracker *self );
+ static void activateDesktopCB(SPDesktop *desktop, DesktopTracker *self );
static bool hierarchyChangeCB(GtkWidget *widget, GtkWidget* prev, DesktopTracker *self);
void handleHierarchyChange();
@@ -46,7 +46,7 @@ private:
SPDesktop *desktop;
GtkWidget *widget;
gulong hierID;
- gulong inkID;
+ sigc::connection inkID;
bool trackActive;
sigc::signal<void, SPDesktop*> desktopChangedSig;
};
diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp
index 213965a18..6dabcfb6b 100644
--- a/src/ui/dialog/dialog.cpp
+++ b/src/ui/dialog/dialog.cpp
@@ -41,12 +41,6 @@ namespace Inkscape {
namespace UI {
namespace Dialog {
-void sp_retransientize(InkscapeApplication */*inkscape*/, SPDesktop *desktop, gpointer dlgPtr)
-{
- Dialog *dlg = static_cast<Dialog *>(dlgPtr);
- dlg->onDesktopActivated (desktop);
-}
-
gboolean sp_retransientize_again(gpointer dlgPtr)
{
Dialog *dlg = static_cast<Dialog *>(dlgPtr);
@@ -54,30 +48,6 @@ gboolean sp_retransientize_again(gpointer dlgPtr)
return FALSE; // so that it is only called once
}
-void sp_dialog_shutdown(GObject * /*object*/, gpointer dlgPtr)
-{
- Dialog *dlg = static_cast<Dialog *>(dlgPtr);
- dlg->onShutdown();
-}
-
-
-static void hideCallback(GObject * /*object*/, gpointer dlgPtr)
-{
- g_return_if_fail( dlgPtr != NULL );
-
- Dialog *dlg = static_cast<Dialog *>(dlgPtr);
- dlg->onHideF12();
-}
-
-static void unhideCallback(GObject * /*object*/, gpointer dlgPtr)
-{
- g_return_if_fail( dlgPtr != NULL );
-
- Dialog *dlg = static_cast<Dialog *>(dlgPtr);
- dlg->onShowF12();
-}
-
-
//=====================================================================
Dialog::Dialog(Behavior::BehaviorFactory behavior_factory, const char *prefs_path, int verb_num,
@@ -103,10 +73,10 @@ Dialog::Dialog(Behavior::BehaviorFactory behavior_factory, const char *prefs_pat
_behavior = behavior_factory(*this);
_desktop = SP_ACTIVE_DESKTOP;
- g_signal_connect(G_OBJECT(INKSCAPE), "activate_desktop", G_CALLBACK(sp_retransientize), (void *)this);
- g_signal_connect(G_OBJECT(INKSCAPE), "dialogs_hide", G_CALLBACK(hideCallback), (void *)this);
- g_signal_connect(G_OBJECT(INKSCAPE), "dialogs_unhide", G_CALLBACK(unhideCallback), (void *)this);
- g_signal_connect(G_OBJECT(INKSCAPE), "shut_down", G_CALLBACK(sp_dialog_shutdown), (void *)this);
+ INKSCAPE.signal_activate_desktop.connect(sigc::mem_fun(*this, &Dialog::onDesktopActivated));
+ INKSCAPE.signal_dialogs_hide.connect(sigc::mem_fun(*this, &Dialog::onHideF12));
+ INKSCAPE.signal_dialogs_unhide.connect(sigc::mem_fun(*this, &Dialog::onShowF12));
+ INKSCAPE.signal_shut_down.connect(sigc::mem_fun(*this, &Dialog::onShutdown));
Glib::wrap(gobj())->signal_event().connect(sigc::mem_fun(*this, &Dialog::_onEvent));
Glib::wrap(gobj())->signal_key_press_event().connect(sigc::mem_fun(*this, &Dialog::_onKeyPress));
diff --git a/src/ui/dialog/dialog.h b/src/ui/dialog/dialog.h
index ccff43a56..9c7efd47b 100644
--- a/src/ui/dialog/dialog.h
+++ b/src/ui/dialog/dialog.h
@@ -30,7 +30,6 @@ namespace Dialog {
enum BehaviorType { FLOATING, DOCK };
-void sp_retransientize(InkscapeApplication *inkscape, SPDesktop *desktop, gpointer dlgPtr);
gboolean sp_retransientize_again(gpointer dlgPtr);
void sp_dialog_shutdown(GObject *object, gpointer dlgPtr);
diff --git a/src/ui/dialog/document-metadata.cpp b/src/ui/dialog/document-metadata.cpp
index 77ea175d9..820d5a8bb 100644
--- a/src/ui/dialog/document-metadata.cpp
+++ b/src/ui/dialog/document-metadata.cpp
@@ -223,7 +223,7 @@ DocumentMetadata::_handleDocumentReplaced(SPDesktop* desktop, SPDocument *)
}
void
-DocumentMetadata::_handleActivateDesktop(InkscapeApplication *, SPDesktop *desktop)
+DocumentMetadata::_handleActivateDesktop(SPDesktop *desktop)
{
Inkscape::XML::Node *repr = sp_desktop_namedview(desktop)->getRepr();
repr->addListener(&_repr_events, this);
@@ -231,7 +231,7 @@ DocumentMetadata::_handleActivateDesktop(InkscapeApplication *, SPDesktop *deskt
}
void
-DocumentMetadata::_handleDeactivateDesktop(InkscapeApplication *, SPDesktop *desktop)
+DocumentMetadata::_handleDeactivateDesktop(SPDesktop *desktop)
{
Inkscape::XML::Node *repr = sp_desktop_namedview(desktop)->getRepr();
repr->removeListenerByData(this);
diff --git a/src/ui/dialog/document-metadata.h b/src/ui/dialog/document-metadata.h
index 77084bc3d..cde5d92fd 100644
--- a/src/ui/dialog/document-metadata.h
+++ b/src/ui/dialog/document-metadata.h
@@ -28,6 +28,7 @@
# include <gtkmm/table.h>
#endif
+#include "inkscape.h"
#include "ui/widget/licensor.h"
#include "ui/widget/registry.h"
@@ -56,8 +57,8 @@ protected:
void init();
void _handleDocumentReplaced(SPDesktop* desktop, SPDocument *document);
- void _handleActivateDesktop(InkscapeApplication *application, SPDesktop *desktop);
- void _handleDeactivateDesktop(InkscapeApplication *application, SPDesktop *desktop);
+ void _handleActivateDesktop(SPDesktop *desktop);
+ void _handleDeactivateDesktop(SPDesktop *desktop);
Gtk::Notebook _notebook;
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index f7701655c..13ee8a6c6 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -1599,7 +1599,7 @@ void DocumentProperties::_handleDocumentReplaced(SPDesktop* desktop, SPDocument
update();
}
-void DocumentProperties::_handleActivateDesktop(InkscapeApplication *, SPDesktop *desktop)
+void DocumentProperties::_handleActivateDesktop(SPDesktop *desktop)
{
Inkscape::XML::Node *repr = sp_desktop_namedview(desktop)->getRepr();
repr->addListener(&_repr_events, this);
@@ -1608,7 +1608,7 @@ void DocumentProperties::_handleActivateDesktop(InkscapeApplication *, SPDesktop
update();
}
-void DocumentProperties::_handleDeactivateDesktop(InkscapeApplication *, SPDesktop *desktop)
+void DocumentProperties::_handleDeactivateDesktop(SPDesktop *desktop)
{
Inkscape::XML::Node *repr = sp_desktop_namedview(desktop)->getRepr();
repr->removeListenerByData(this);
diff --git a/src/ui/dialog/document-properties.h b/src/ui/dialog/document-properties.h
index ee7e88b18..b1f90b4b7 100644
--- a/src/ui/dialog/document-properties.h
+++ b/src/ui/dialog/document-properties.h
@@ -94,8 +94,8 @@ protected:
void save_default_metadata();
void _handleDocumentReplaced(SPDesktop* desktop, SPDocument *document);
- void _handleActivateDesktop(InkscapeApplication *application, SPDesktop *desktop);
- void _handleDeactivateDesktop(InkscapeApplication *application, SPDesktop *desktop);
+ void _handleActivateDesktop(SPDesktop *desktop);
+ void _handleDeactivateDesktop(SPDesktop *desktop);
Inkscape::XML::SignalObserver _emb_profiles_observer, _scripts_observer;
Gtk::Notebook _notebook;
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp
index 37022a186..1ebd1fc7c 100644
--- a/src/ui/dialog/export.cpp
+++ b/src/ui/dialog/export.cpp
@@ -51,7 +51,7 @@
#include "ui/widget/unit-menu.h"
#include "util/units.h"
#include "helper/window.h"
-#include "inkscape-private.h"
+#include "inkscape.h"
#include "document.h"
#include "document-undo.h"
#include "desktop-handles.h"
@@ -588,7 +588,7 @@ Glib::ustring Export::create_filepath_from_id (Glib::ustring id, const Glib::ust
}
if (directory.empty()) {
- directory = homedir_path(NULL);
+ directory = INKSCAPE.homedir_path(NULL);
}
Glib::ustring filename = Glib::build_filename(directory, id+".png");
diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp
index 5d330f7f0..17cf835cd 100644
--- a/src/ui/dialog/filedialogimpl-gtkmm.cpp
+++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp
@@ -577,8 +577,9 @@ bool SVGPreview::set(Glib::ustring &fileName, int dialogType)
SVGPreview::SVGPreview()
{
- if (!INKSCAPE)
- inkscape_application_init("", false);
+ // \FIXME Why?!!??
+ if (!Inkscape::Application::exists())
+ Inkscape::Application::create("", false);
document = NULL;
viewerGtk = NULL;
set_size_request(150, 150);
@@ -1083,7 +1084,7 @@ FileSaveDialogImplGtk::FileSaveDialogImplGtk(Gtk::Window &parentWindow, const Gl
}
// allow easy access to the user's own templates folder
- gchar *templates = profile_path("templates");
+ gchar *templates = Inkscape::Application::profile_path("templates");
if (Inkscape::IO::file_test(templates, G_FILE_TEST_EXISTS) &&
Inkscape::IO::file_test(templates, G_FILE_TEST_IS_DIR) && g_path_is_absolute(templates)) {
add_shortcut_folder(templates);
diff --git a/src/ui/dialog/fill-and-stroke.h b/src/ui/dialog/fill-and-stroke.h
index 35c98ef9c..f2a6bf39d 100644
--- a/src/ui/dialog/fill-and-stroke.h
+++ b/src/ui/dialog/fill-and-stroke.h
@@ -41,8 +41,7 @@ public:
virtual void setDesktop(SPDesktop *desktop);
- void selectionChanged(InkscapeApplication *inkscape,
- Inkscape::Selection *selection);
+ //void selectionChanged(Inkscape::Selection *selection);
void showPageFill();
void showPageStrokePaint();
diff --git a/src/ui/dialog/grid-arrange-tab.cpp b/src/ui/dialog/grid-arrange-tab.cpp
index 1417b39fa..2ff647a74 100644
--- a/src/ui/dialog/grid-arrange-tab.cpp
+++ b/src/ui/dialog/grid-arrange-tab.cpp
@@ -567,17 +567,6 @@ void GridArrangeTab::updateSelection()
}
-
-/*##########################
-## Experimental
-##########################*/
-
-static void updateSelectionCallback(InkscapeApplication */*inkscape*/, Inkscape::Selection */*selection*/, GridArrangeTab *dlg)
-{
- dlg->updateSelection();
-}
-
-
//#########################################################################
//## C O N S T R U C T O R / D E S T R U C T O R
//#########################################################################
@@ -605,7 +594,7 @@ GridArrangeTab::GridArrangeTab(ArrangeDialog *parent)
{
// Selection Change signal
- g_signal_connect ( G_OBJECT (INKSCAPE), "change_selection", G_CALLBACK (updateSelectionCallback), this);
+ INKSCAPE.signal_selection_changed.connect(sigc::hide<0>(sigc::mem_fun(*this, &GridArrangeTab::updateSelection)));
}
Gtk::Box *contents = this;
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index 1fd8aa9be..ed4b16008 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -1913,7 +1913,7 @@ void InkscapePreferences::initPageSystem()
_page_system.add_group_header( _("System info"));
- _sys_user_config.set_text((char const *)profile_path(""));
+ _sys_user_config.set_text((char const *)Inkscape::Application::profile_path(""));
_sys_user_config.set_editable(false);
_page_system.add_line(true, _("User config: "), _sys_user_config, "", _("Location of users configuration"), true);
diff --git a/src/ui/dialog/panel-dialog.h b/src/ui/dialog/panel-dialog.h
index b4a355083..39110f47a 100644
--- a/src/ui/dialog/panel-dialog.h
+++ b/src/ui/dialog/panel-dialog.h
@@ -49,19 +49,10 @@ public:
virtual UI::Widget::Panel &getPanel() { return _panel; }
protected:
- static void handle_deactivate_desktop(InkscapeApplication *application, SPDesktop *desktop, void *data) {
- g_return_if_fail(data != NULL);
- static_cast<PanelDialogBase *>(data)->_propagateDesktopDeactivated(application, desktop);
- }
-
- static void _handle_activate_desktop(InkscapeApplication *application, SPDesktop *desktop, void *data) {
- g_return_if_fail(data != NULL);
- static_cast<PanelDialogBase *>(data)->_propagateDesktopActivated(application, desktop);
- }
inline virtual void _propagateDocumentReplaced(SPDesktop* desktop, SPDocument *document);
- inline virtual void _propagateDesktopActivated(InkscapeApplication *, SPDesktop *);
- inline virtual void _propagateDesktopDeactivated(InkscapeApplication *, SPDesktop *);
+ inline virtual void _propagateDesktopActivated(SPDesktop *);
+ inline virtual void _propagateDesktopDeactivated(SPDesktop *);
UI::Widget::Panel &_panel;
sigc::connection _document_replaced_connection;
@@ -134,17 +125,17 @@ void PanelDialogBase::_propagateDocumentReplaced(SPDesktop *desktop, SPDocument
_panel.signalDocumentReplaced().emit(desktop, document);
}
-void PanelDialogBase::_propagateDesktopActivated(InkscapeApplication *application, SPDesktop *desktop)
+void PanelDialogBase::_propagateDesktopActivated(SPDesktop *desktop)
{
_document_replaced_connection =
desktop->connectDocumentReplaced(sigc::mem_fun(*this, &PanelDialogBase::_propagateDocumentReplaced));
- _panel.signalActivateDesktop().emit(application, desktop);
+ _panel.signalActivateDesktop().emit(desktop);
}
-void PanelDialogBase::_propagateDesktopDeactivated(InkscapeApplication *application, SPDesktop *desktop)
+void PanelDialogBase::_propagateDesktopDeactivated(SPDesktop *desktop)
{
_document_replaced_connection.disconnect();
- _panel.signalDeactiveDesktop().emit(application, desktop);
+ _panel.signalDeactiveDesktop().emit(desktop);
}
@@ -162,7 +153,7 @@ PanelDialog<B>::PanelDialog(Widget::Panel &panel, char const *prefs_path, int co
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- _propagateDesktopActivated(INKSCAPE, desktop);
+ _propagateDesktopActivated(desktop);
_document_replaced_connection =
desktop->connectDocumentReplaced(sigc::mem_fun(*this, &PanelDialog::_propagateDocumentReplaced));
@@ -211,7 +202,7 @@ PanelDialog<Behavior::FloatingBehavior>::PanelDialog(UI::Widget::Panel &panel, c
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- _propagateDesktopActivated(INKSCAPE, desktop);
+ _propagateDesktopActivated(desktop);
_document_replaced_connection =
desktop->connectDocumentReplaced(sigc::mem_fun(*this, &PanelDialog::_propagateDocumentReplaced));
@@ -247,8 +238,12 @@ PanelDialog<Behavior::FloatingBehavior> *PanelDialog<Behavior::FloatingBehavior>
new PanelDialog<Behavior::FloatingBehavior>(panel, panel.getPrefsPath(),
panel.getVerb(), panel.getApplyLabel());
- g_signal_connect(G_OBJECT(INKSCAPE), "activate_desktop", G_CALLBACK(_handle_activate_desktop), instance);
- g_signal_connect(G_OBJECT(INKSCAPE), "deactivate_desktop", G_CALLBACK(handle_deactivate_desktop), instance);
+ INKSCAPE.signal_activate_desktop.connect(
+ sigc::mem_fun(*instance, &PanelDialog<Behavior::FloatingBehavior>::_propagateDesktopActivated)
+ );
+ INKSCAPE.signal_deactivate_desktop.connect(
+ sigc::mem_fun(*instance, &PanelDialog<Behavior::FloatingBehavior>::_propagateDesktopDeactivated)
+ );
return instance;
}
diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp
index a3cfeeba8..187e31233 100644
--- a/src/ui/dialog/swatches.cpp
+++ b/src/ui/dialog/swatches.cpp
@@ -527,7 +527,7 @@ static void loadEmUp()
beenHere = true;
std::list<gchar *> sources;
- sources.push_back( profile_path("palettes") );
+ sources.push_back( Inkscape::Application::profile_path("palettes") );
sources.push_back( g_strdup(INKSCAPE_PALETTESDIR) );
sources.push_back( g_strdup(CREATE_PALETTESDIR) );
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp
index a17a03861..c9d9bb36c 100644
--- a/src/ui/dialog/symbols.cpp
+++ b/src/ui/dialog/symbols.cpp
@@ -287,7 +287,7 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) :
++row;
/**********************************************************/
- currentDesktop = inkscape_active_desktop();
+ currentDesktop = INKSCAPE.active_desktop();
currentDocument = sp_desktop_document(currentDesktop);
previewDocument = symbols_preview_doc(); /* Template to render symbols in */
@@ -585,13 +585,15 @@ void SymbolsDialog::get_symbols() {
std::list<Glib::ustring> directories;
+// \TODO optimize this
+
if( Inkscape::IO::file_test( INKSCAPE_SYMBOLSDIR, G_FILE_TEST_EXISTS ) &&
Inkscape::IO::file_test( INKSCAPE_SYMBOLSDIR, G_FILE_TEST_IS_DIR ) ) {
directories.push_back( INKSCAPE_SYMBOLSDIR );
}
- if( Inkscape::IO::file_test( profile_path("symbols"), G_FILE_TEST_EXISTS ) &&
- Inkscape::IO::file_test( profile_path("symbols"), G_FILE_TEST_IS_DIR ) ) {
- directories.push_back( profile_path("symbols") );
+ if( Inkscape::IO::file_test( Inkscape::Application::profile_path("symbols"), G_FILE_TEST_EXISTS ) &&
+ Inkscape::IO::file_test( Inkscape::Application::profile_path("symbols"), G_FILE_TEST_IS_DIR ) ) {
+ directories.push_back( Inkscape::Application::profile_path("symbols") );
}
std::list<Glib::ustring>::iterator it;
diff --git a/src/ui/dialog/template-load-tab.cpp b/src/ui/dialog/template-load-tab.cpp
index 13cb01eef..fca1f7b30 100644
--- a/src/ui/dialog/template-load-tab.cpp
+++ b/src/ui/dialog/template-load-tab.cpp
@@ -194,7 +194,7 @@ void TemplateLoadTab::_refreshTemplatesList()
void TemplateLoadTab::_loadTemplates()
{
// user's local dir
- _getTemplatesFromDir(profile_path("templates") + _loading_path);
+ _getTemplatesFromDir(Inkscape::Application::profile_path("templates") + _loading_path);
// system templates dir
_getTemplatesFromDir(INKSCAPE_TEMPLATESDIR + _loading_path);
diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp
index 6dbcf4a05..2c6692777 100644
--- a/src/ui/dialog/transformation.cpp
+++ b/src/ui/dialog/transformation.cpp
@@ -47,16 +47,13 @@ namespace Inkscape {
namespace UI {
namespace Dialog {
-static void on_selection_changed(InkscapeApplication */*inkscape*/, Inkscape::Selection *selection, Transformation *daad)
+static void on_selection_changed(Inkscape::Selection *selection, Transformation *daad)
{
int page = daad->getCurrentPage();
daad->updateSelection((Inkscape::UI::Dialog::Transformation::PageType)page, selection);
}
-static void on_selection_modified( InkscapeApplication */*inkscape*/,
- Inkscape::Selection *selection,
- guint /*flags*/,
- Transformation *daad )
+static void on_selection_modified(Inkscape::Selection *selection, Transformation *daad)
{
int page = daad->getCurrentPage();
daad->updateSelection((Inkscape::UI::Dialog::Transformation::PageType)page, selection);
@@ -159,8 +156,8 @@ Transformation::Transformation()
}
// Connect to the global selection changed & modified signals
- g_signal_connect (G_OBJECT (INKSCAPE), "change_selection", G_CALLBACK (on_selection_changed), this);
- g_signal_connect (G_OBJECT (INKSCAPE), "modify_selection", G_CALLBACK (on_selection_modified), this);
+ _selChangeConn = INKSCAPE.signal_selection_changed.connect(sigc::bind(sigc::ptr_fun(&on_selection_changed), this));
+ _selModifyConn = INKSCAPE.signal_selection_modified.connect(sigc::hide<1>(sigc::bind(sigc::ptr_fun(&on_selection_modified), this)));
_desktopChangeConn = _deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &Transformation::setDesktop) );
_deskTrack.connect(GTK_WIDGET(gobj()));
@@ -170,7 +167,8 @@ Transformation::Transformation()
Transformation::~Transformation()
{
- sp_signal_disconnect_by_data (G_OBJECT (INKSCAPE), this);
+ _selModifyConn.disconnect();
+ _selChangeConn.disconnect();
_desktopChangeConn.disconnect();
_deskTrack.disconnect();
}
diff --git a/src/ui/dialog/transformation.h b/src/ui/dialog/transformation.h
index 1d24a0c94..89aa95d90 100644
--- a/src/ui/dialog/transformation.h
+++ b/src/ui/dialog/transformation.h
@@ -232,6 +232,9 @@ private:
Gtk::Button *applyButton;
Gtk::Button *resetButton;
Gtk::Button *cancelButton;
+
+ sigc::connection _selChangeConn;
+ sigc::connection _selModifyConn;
};
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp
index 7830a8de1..7abbb5934 100644
--- a/src/ui/interface.cpp
+++ b/src/ui/interface.cpp
@@ -29,7 +29,7 @@
#include <gtkmm/imagemenuitem.h>
#include <gtkmm/separatormenuitem.h>
-#include "inkscape-private.h"
+#include "inkscape.h"
#include "extension/db.h"
#include "extension/effect.h"
#include "extension/input.h"
@@ -270,7 +270,7 @@ sp_create_window(SPViewWidget *vw, bool editable)
// needed because the first ACTIVATE_DESKTOP was sent when there was no window yet
if ( SP_IS_DESKTOP_WIDGET(vw) ) {
- inkscape_reactivate_desktop(SP_DESKTOP_WIDGET(vw)->desktop);
+ INKSCAPE.reactivate_desktop(SP_DESKTOP_WIDGET(vw)->desktop);
}
}
@@ -318,7 +318,7 @@ sp_ui_close_view(GtkWidget */*widget*/)
// If closing the last document, open a new document so Inkscape doesn't quit.
std::list<SPDesktop *> desktops;
- inkscape_get_all_desktops(desktops);
+ INKSCAPE.get_all_desktops(desktops);
if (desktops.size() == 1) {
Glib::ustring templateUri = sp_file_default_template_uri();
SPDocument *doc = SPDocument::createNewDoc( templateUri.c_str() , TRUE, true );
@@ -921,7 +921,7 @@ static void sp_ui_build_dyn_menus(Inkscape::XML::Node *menus, GtkWidget *menu, I
GtkWidget *sp_ui_main_menubar(Inkscape::UI::View::View *view)
{
GtkWidget *mbar = gtk_menu_bar_new();
- sp_ui_build_dyn_menus(inkscape_get_menus(INKSCAPE), mbar, view);
+ sp_ui_build_dyn_menus(INKSCAPE.get_menus(), mbar, view);
return mbar;
}
@@ -2117,13 +2117,13 @@ void ContextMenu::ImageEdit(void)
void ContextMenu::ImageTraceBitmap(void)
{
- inkscape_dialogs_unhide();
+ INKSCAPE.dialogs_unhide();
_desktop->_dlg_mgr->showDialog("Trace");
}
void ContextMenu::ImageTracePixelArt(void)
{
- inkscape_dialogs_unhide();
+ INKSCAPE.dialogs_unhide();
_desktop->_dlg_mgr->showDialog("PixelArt");
}
diff --git a/src/ui/tools-switch.cpp b/src/ui/tools-switch.cpp
index 47b9d2832..07d68471f 100644
--- a/src/ui/tools-switch.cpp
+++ b/src/ui/tools-switch.cpp
@@ -16,7 +16,7 @@
#include <cstring>
#include <string>
-#include "inkscape-private.h"
+#include "inkscape.h"
#include "desktop.h"
#include "desktop-handles.h"
#include <glibmm/i18n.h>
@@ -159,7 +159,7 @@ tools_switch(SPDesktop *dt, int num)
/* fixme: This is really ugly hack. We should bind and unbind class methods */
/* First 4 tools use guides, first is undefined but we don't care */
dt->activate_guides(num < 5);
- inkscape_eventcontext_set(dt->getEventContext());
+ INKSCAPE.eventcontext_set(dt->getEventContext());
}
void tools_switch_by_item(SPDesktop *dt, SPItem *item, Geom::Point const p)
diff --git a/src/ui/tools/connector-tool.cpp b/src/ui/tools/connector-tool.cpp
index 7b5c84c16..776bc9c89 100644
--- a/src/ui/tools/connector-tool.cpp
+++ b/src/ui/tools/connector-tool.cpp
@@ -1304,7 +1304,7 @@ bool cc_item_is_connector(SPItem *item)
void cc_selection_set_avoid(bool const set_avoid)
{
- SPDesktop *desktop = inkscape_active_desktop();
+ SPDesktop *desktop = INKSCAPE.active_desktop();
if (desktop == NULL) {
return;
}
diff --git a/src/ui/view/view.cpp b/src/ui/view/view.cpp
index 72548e213..47e2a1e0d 100644
--- a/src/ui/view/view.cpp
+++ b/src/ui/view/view.cpp
@@ -20,7 +20,7 @@
#include "message-stack.h"
#include "message-context.h"
#include "verbs.h"
-#include "inkscape-private.h"
+#include "inkscape.h"
namespace Inkscape {
namespace UI {
@@ -85,7 +85,7 @@ void View::_close() {
if (_doc) {
_document_uri_set_connection.disconnect();
_document_resized_connection.disconnect();
- if (inkscape_remove_document(_doc)) {
+ if (INKSCAPE.remove_document(_doc)) {
// this was the last view of this document, so delete it
delete _doc;
}
@@ -111,13 +111,13 @@ void View::setDocument(SPDocument *doc) {
if (_doc) {
_document_uri_set_connection.disconnect();
_document_resized_connection.disconnect();
- if (inkscape_remove_document(_doc)) {
+ if (INKSCAPE.remove_document(_doc)) {
// this was the last view of this document, so delete it
delete _doc;
}
}
- inkscape_add_document(doc);
+ INKSCAPE.add_document(doc);
_doc = doc;
_document_uri_set_connection =
diff --git a/src/ui/widget/dock.cpp b/src/ui/widget/dock.cpp
index 52e9ea605..c5e14d4f0 100644
--- a/src/ui/widget/dock.cpp
+++ b/src/ui/widget/dock.cpp
@@ -119,8 +119,9 @@ Dock::Dock(Gtk::Orientation orientation)
gdl_dock_bar_set_style(_gdl_dock_bar, gdl_dock_bar_style);
- g_signal_connect(G_OBJECT(INKSCAPE), "dialogs_hide", G_CALLBACK(hideCallback), (void *)this);
- g_signal_connect(G_OBJECT(INKSCAPE), "dialogs_unhide", G_CALLBACK(unhideCallback), (void *)this);
+
+ INKSCAPE.signal_dialogs_hide.connect(sigc::mem_fun(*this, &Dock::hide));
+ INKSCAPE.signal_dialogs_unhide.connect(sigc::mem_fun(*this, &Dock::show));
g_signal_connect(_paned->gobj(), "button-press-event", G_CALLBACK(_on_paned_button_event), (void *)this);
g_signal_connect(_paned->gobj(), "button-release-event", G_CALLBACK(_on_paned_button_event), (void *)this);
diff --git a/src/ui/widget/imageicon.cpp b/src/ui/widget/imageicon.cpp
index 22abd04ba..df261b69a 100644
--- a/src/ui/widget/imageicon.cpp
+++ b/src/ui/widget/imageicon.cpp
@@ -88,8 +88,9 @@ ImageIcon::~ImageIcon()
*/
void ImageIcon::init()
{
- if (!INKSCAPE)
- inkscape_application_init("",false);
+ // \FIXME Why?
+ if (!Inkscape::Application::exists())
+ Inkscape::Application::create("", false);
document = NULL;
viewerGtkmm = NULL;
//set_size_request(150,150);
diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp
index e4cd76345..a377bf118 100644
--- a/src/ui/widget/object-composite-settings.cpp
+++ b/src/ui/widget/object-composite-settings.cpp
@@ -39,26 +39,6 @@ namespace Inkscape {
namespace UI {
namespace Widget {
-/*void ObjectCompositeSettings::_on_desktop_activate(
- InkscapeApplication *application,
- SPDesktop *desktop,
- ObjectCompositeSettings *w
-) {
- if (w->_subject) {
- w->_subject->setDesktop(desktop);
- }
-}
-
-void ObjectCompositeSettings::_on_desktop_deactivate(
- InkscapeApplication *application,
- SPDesktop *desktop,
- ObjectCompositeSettings *w
-) {
- if (w->_subject) {
- w->_subject->setDesktop(NULL);
- }
-}*/
-
ObjectCompositeSettings::ObjectCompositeSettings(unsigned int verb_code, char const *history_prefix, int flags)
: _verb_code(verb_code),
_blur_tag(Glib::ustring(history_prefix) + ":blur"),
@@ -102,7 +82,6 @@ ObjectCompositeSettings::ObjectCompositeSettings(unsigned int verb_code, char co
ObjectCompositeSettings::~ObjectCompositeSettings() {
setSubject(NULL);
- g_signal_handler_disconnect(G_OBJECT(INKSCAPE), _desktop_activated);
}
void ObjectCompositeSettings::setSubject(StyleSubject *subject) {
diff --git a/src/ui/widget/object-composite-settings.h b/src/ui/widget/object-composite-settings.h
index e375bf24a..5a723a2fd 100644
--- a/src/ui/widget/object-composite-settings.h
+++ b/src/ui/widget/object-composite-settings.h
@@ -66,8 +66,8 @@ private:
gulong _desktop_activated;
sigc::connection _subject_changed;
- static void _on_desktop_activate(InkscapeApplication *application, SPDesktop *desktop, ObjectCompositeSettings *w);
- static void _on_desktop_deactivate(InkscapeApplication *application, SPDesktop *desktop, ObjectCompositeSettings *w);
+ static void _on_desktop_activate(SPDesktop *desktop, ObjectCompositeSettings *w);
+ static void _on_desktop_deactivate(SPDesktop *desktop, ObjectCompositeSettings *w);
void _subjectChanged();
void _blendBlurValueChanged();
void _opacityValueChanged();
diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp
index 0abd81b16..c96eac838 100644
--- a/src/ui/widget/panel.cpp
+++ b/src/ui/widget/panel.cpp
@@ -293,7 +293,7 @@ void Panel::_init()
signalResponse().connect(sigc::mem_fun(*this, &Panel::_handleResponse));
- signalActivateDesktop().connect(sigc::hide<0>(sigc::mem_fun(*this, &Panel::setDesktop)));
+ signalActivateDesktop().connect(sigc::mem_fun(*this, &Panel::setDesktop));
show_all_children();
@@ -643,13 +643,13 @@ Panel::signalDocumentReplaced()
return _signal_document_replaced;
}
-sigc::signal<void, InkscapeApplication *, SPDesktop *> &
+sigc::signal<void, SPDesktop *> &
Panel::signalActivateDesktop()
{
return _signal_activate_desktop;
}
-sigc::signal<void, InkscapeApplication *, SPDesktop *> &
+sigc::signal<void, SPDesktop *> &
Panel::signalDeactiveDesktop()
{
return _signal_deactive_desktop;
diff --git a/src/ui/widget/panel.h b/src/ui/widget/panel.h
index 177314797..5680cac30 100644
--- a/src/ui/widget/panel.h
+++ b/src/ui/widget/panel.h
@@ -48,6 +48,7 @@ namespace Gtk {
struct InkscapeApplication;
namespace Inkscape {
+
class Selection;
namespace UI {
@@ -116,8 +117,8 @@ public:
void setResponseSensitive(int response_id, bool setting);
virtual sigc::signal<void, SPDesktop *, SPDocument *> &signalDocumentReplaced();
- virtual sigc::signal<void, InkscapeApplication *, SPDesktop *> &signalActivateDesktop();
- virtual sigc::signal<void, InkscapeApplication *, SPDesktop *> &signalDeactiveDesktop();
+ virtual sigc::signal<void, SPDesktop *> &signalActivateDesktop();
+ virtual sigc::signal<void, SPDesktop *> &signalDeactiveDesktop();
protected:
/**
@@ -147,8 +148,8 @@ protected:
sigc::signal<void, int> _signal_response;
sigc::signal<void> _signal_present;
sigc::signal<void, SPDesktop *, SPDocument *> _signal_document_replaced;
- sigc::signal<void, InkscapeApplication *, SPDesktop *> _signal_activate_desktop;
- sigc::signal<void, InkscapeApplication *, SPDesktop *> _signal_deactive_desktop;
+ sigc::signal<void, SPDesktop *> _signal_activate_desktop;
+ sigc::signal<void, SPDesktop *> _signal_deactive_desktop;
private:
void _init();