summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9959e9b)
raw | patch | inline | side by side (parent: 9959e9b)
author | mental <mental@users.sourceforge.net> | |
Sat, 29 Jul 2006 20:21:27 +0000 (20:21 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Sat, 29 Jul 2006 20:21:27 +0000 (20:21 +0000) |
ChangeLog | patch | blob | history | |
src/widgets/desktop-widget.cpp | patch | blob | history | |
src/widgets/desktop-widget.h | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 0053906a4c60810c8d42286310bbc2fab293b947..ec994c951dc3daf1815c58a73f893e17473685bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
2006-06-29 MenTaLguY <mental@rydia.net>
- * src/widgets/gradient-image.cpp, src/widgets/gradient-image.h,
+ * src/widgets/desktop-widget.cpp, src/widgets/desktop-widget.h,
+ src/widgets/gradient-image.cpp, src/widgets/gradient-image.h,
src/widgets/gradient-toolbar.cpp, src/widgets/gradient-toolbar.cpp:
switch to sigc++ SPObject signals
index 0a4536bb1ba5deb64b160ca9e1496aadac8308d7..9590af94c898c241ceddf0a2bdcd6d37acae2a5b 100644 (file)
static void sp_desktop_widget_adjustment_value_changed (GtkAdjustment *adj, SPDesktopWidget *dtw);
-static void sp_desktop_widget_namedview_modified (SPNamedView *nv, guint flags, SPDesktopWidget *dtw);
+static void sp_desktop_widget_namedview_modified (SPObject *obj, guint flags, SPDesktopWidget *dtw);
static gdouble sp_dtw_zoom_value_to_display (gdouble value);
static gdouble sp_dtw_zoom_display_to_value (gdouble value);
GtkWidget *eventbox;
GtkStyle *style;
+ new (&dtw->modified_connection) sigc::connection();
+
widget = GTK_WIDGET (dtw);
dtw->window = 0;
if (dtw->desktop) {
dtw->layer_selector->unreference();
inkscape_remove_desktop (dtw->desktop); // clears selection too
- sp_signal_disconnect_by_data (G_OBJECT (dtw->desktop->namedview), dtw);
+ dtw->modified_connection.disconnect();
dtw->desktop->destroy();
Inkscape::GC::release (dtw->desktop);
dtw->desktop = NULL;
}
+ dtw->modified_connection.~connection();
+
if (GTK_OBJECT_CLASS (dtw_parent_class)->destroy) {
(* GTK_OBJECT_CLASS (dtw_parent_class)->destroy) (object);
}
dtw->desktop->set_display_area (d.x0, d.y0, d.x1, d.y1, 10);
/* Listen on namedview modification */
- g_signal_connect (G_OBJECT (dtw->desktop->namedview), "modified", G_CALLBACK (sp_desktop_widget_namedview_modified), dtw);
+ // originally (prior to the sigc++ conversion) the signal was simply
+ // connected twice rather than disconnecting the first connection
+ dtw->modified_connection.disconnect();
+ dtw->modified_connection = dtw->desktop->namedview->connectModified(sigc::bind<2>(sigc::ptr_fun(&sp_desktop_widget_namedview_modified), dtw));
sp_desktop_widget_namedview_modified (dtw->desktop->namedview, SP_OBJECT_MODIFIED_FLAG, dtw);
dtw->updateTitle(SP_DOCUMENT_NAME (dtw->desktop->doc()));
sp_view_widget_set_view (SP_VIEW_WIDGET (dtw), dtw->desktop);
/* Listen on namedview modification */
- g_signal_connect (G_OBJECT (namedview), "modified", G_CALLBACK (sp_desktop_widget_namedview_modified), dtw);
+ dtw->modified_connection = namedview->connectModified(sigc::bind<2>(sigc::ptr_fun(&sp_desktop_widget_namedview_modified), dtw));
dtw->layer_selector->setDesktop(dtw->desktop);
static void
-sp_desktop_widget_namedview_modified (SPNamedView *nv, guint flags, SPDesktopWidget *dtw)
+sp_desktop_widget_namedview_modified (SPObject *obj, guint flags, SPDesktopWidget *dtw)
{
+ SPNamedView *nv=SP_NAMEDVIEW(obj);
if (flags & SP_OBJECT_MODIFIED_FLAG) {
dtw->dt2r = 1.0 / nv->doc_units->unittobase;
dtw->ruler_origin = nv->gridorigin;
index 5129fbf490a5d6346c3e3f2bb4040c798e142eaa..cc66bf1800cd6772be2f52d0918ef712aea40afe 100644 (file)
#include "ui/view/view-widget.h"
#include "ui/view/edit-widget-interface.h"
+#include <sigc++/connection.h>
+
#define SP_TYPE_DESKTOP_WIDGET (sp_desktop_widget_get_type ())
#define SP_DESKTOP_WIDGET(o) (GTK_CHECK_CAST ((o), SP_TYPE_DESKTOP_WIDGET, SPDesktopWidget))
#define SP_DESKTOP_WIDGET_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), SP_TYPE_DESKTOP_WIDGET, SPDesktopWidgetClass))
unsigned int update : 1;
+ sigc::connection modified_connection;
+
GtkTooltips *tt;
SPDesktop *desktop;