index c6619dbf5f70d30b0104418432511a1c1f4e9564..a1cb045e59f33a5adff6962380ec78fe19553a12 100644 (file)
--- a/src/sp-use-reference.cpp
+++ b/src/sp-use-reference.cpp
* Released under GNU GPL, read the file 'COPYING' for more information.
*/
+#include <cstring>
+#include <string>
+#include <string.h>
+
#include "enums.h"
#include "sp-use-reference.h"
static void sp_usepath_href_changed(SPObject *old_ref, SPObject *ref, SPUsePath *offset);
static void sp_usepath_move_compensate(NR::Matrix const *mp, SPItem *original, SPUsePath *self);
static void sp_usepath_delete_self(SPObject *deleted, SPUsePath *offset);
-static void sp_usepath_source_modified(SPObject *iSource, guint flags, SPItem *item);
+static void sp_usepath_source_modified(SPObject *iSource, guint flags, SPUsePath *offset);
SPUsePath::SPUsePath(SPObject* i_owner):SPUseReference(i_owner)
{
sourceHref = NULL;
sourceRepr = NULL;
sourceObject = NULL;
- new (&_delete_connection) sigc::connection();
- new (&_changed_connection) sigc::connection();
- new (&_transformed_connection) sigc::connection();
_changed_connection = changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_usepath_href_changed), this)); // listening to myself, this should be virtual instead
user_unlink = NULL;
quit_listening();
unlink();
-
- _delete_connection.~connection();
- _changed_connection.~connection();
- _transformed_connection.~connection();
}
void
sourceRepr = SP_OBJECT_REPR(to);
_delete_connection = to->connectDelete(sigc::bind(sigc::ptr_fun(&sp_usepath_delete_self), this));
_transformed_connection = SP_ITEM(to)->connectTransformed(sigc::bind(sigc::ptr_fun(&sp_usepath_move_compensate), this));
- _modified_connection = g_signal_connect(G_OBJECT(to), "modified", G_CALLBACK(sp_usepath_source_modified), this);
+ _modified_connection = to->connectModified(sigc::bind<2>(sigc::ptr_fun(&sp_usepath_source_modified), this));
}
void
if ( sourceObject == NULL ) {
return;
}
- g_signal_handler_disconnect(sourceObject, _modified_connection);
+ _modified_connection.disconnect();
_delete_connection.disconnect();
_transformed_connection.disconnect();
sourceRepr = NULL;
@@ -150,6 +147,7 @@ sp_usepath_move_compensate(NR::Matrix const *mp, SPItem *original, SPUsePath *se
}
SPItem *item = SP_ITEM(self->owner);
+// TODO kill naughty naughty #if 0
#if 0
NR::Matrix m(*mp);
if (!(m.is_translation())) {
@@ -173,6 +171,9 @@ sp_usepath_move_compensate(NR::Matrix const *mp, SPItem *original, SPUsePath *se
// Commit the compensation.
item->transform *= clone_move;
sp_item_write_transform(item, SP_OBJECT_REPR(item), item->transform, &advertized_move);
+#else
+ (void)mp;
+ (void)original;
#endif
self->sourceDirty = true;
}
static void
-sp_usepath_source_modified(SPObject *iSource, guint flags, SPItem *item)
+sp_usepath_source_modified(SPObject */*iSource*/, guint /*flags*/, SPUsePath *offset)
{
- SPUsePath *offset = (SPUsePath*)item;
offset->sourceDirty = true;
offset->owner->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
}
}
}
originalPath = new Path;
- originalPath->LoadArtBPath(curve->bpath, NR::Matrix(item->transform), true);
- sp_curve_unref(curve);
+ originalPath->LoadArtBPath(SP_CURVE_BPATH(curve), NR::Matrix(item->transform), true);
+ curve->unref();
}