/*
* The reference corresponding to href of <use> element.
*
* Copyright (C) 2004 Bulia Byak
* Copyright (C) 2004 Monash University
*
* 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"
#include "preferences.h"
#include "sp-shape.h"
#include "sp-text.h"
#include "uri.h"
{
}
{
originalPath = NULL;
sourceDirty=false;
sourceHref = NULL;
sourceRepr = NULL;
sourceObject = NULL;
_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;
}
{
delete originalPath;
originalPath = NULL;
unlink();
}
void
{
unlink();
} else {
try {
} catch (Inkscape::BadURIException &e) {
/* TODO: Proper error handling as per
* http://www.w3.org/TR/SVG11/implnote.html#ErrorProcessing.
*/
detach();
}
}
}
}
void
{
sourceHref = NULL;
detach();
}
void
{
return;
}
sourceObject = to;
_transformed_connection = SP_ITEM(to)->connectTransformed(sigc::bind(sigc::ptr_fun(&sp_usepath_move_compensate), this));
_modified_connection = to->connectModified(sigc::bind<2>(sigc::ptr_fun(&sp_usepath_source_modified), this));
}
void
{
if ( sourceObject == NULL ) {
return;
}
sourceRepr = NULL;
sourceObject = NULL;
}
static void
{
offset->quit_listening();
if ( refobj ) {
}
offset->sourceDirty=true;
}
static void
{
if (mode == SP_CLONE_COMPENSATION_NONE) {
return;
}
// TODO kill naughty naughty #if 0
#if 0
if (!(m.is_translation())) {
return;
}
// Calculate the compensation matrix and the advertized movement matrix.
if (mode == SP_CLONE_COMPENSATION_PARALLEL) {
//clone_move = clone_move.inverse();
} else if (mode == SP_CLONE_COMPENSATION_UNMOVED) {
advertized_move = m;
} else {
}
// Commit the compensation.
#else
(void)mp;
(void)original;
#endif
self->sourceDirty = true;
}
static void
{
if (mode == SP_CLONE_ORPHANS_UNLINK) {
// leave it be. just forget about the source
offset->quit_listening();
if (offset->user_unlink)
} else if (mode == SP_CLONE_ORPHANS_DELETE) {
}
}
static void
{
offset->sourceDirty = true;
}
{
sourceDirty = false;
delete originalPath;
originalPath = NULL;
// le mauvais cas: pas d'attribut d => il faut verifier que c'est une SPShape puis prendre le contour
// [tr: The bad case: no d attribute. Must check that it's a SPShape and then take the outline.]
if (SP_IS_SHAPE(item))
{
}
else if (SP_IS_TEXT(item))
{
}
else
{
return;
}
return;
originalPath = new Path;
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :