sp-tag-use.cpp revision 2b9e5de12a7774e2f1db30c1c7a762eb76093e1a
/*
* SVG <inkscape:tagref> implementation
*
* Authors:
* Theodore Janeczko
* Liam P White
*
* Copyright (C) Theodore Janeczko 2012-2014 <flutterguy317@gmail.com>
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <cstring>
#include <string>
#include "display/drawing-group.h"
#include "attributes.h"
#include "document.h"
#include "uri.h"
#include "preferences.h"
#include "style.h"
#include "sp-factory.h"
#include "sp-symbol.h"
#include "sp-tag-use.h"
#include "sp-tag-use-reference.h"
namespace {
SPObject* createTagUse() {
return new SPTagUse();
}
}
{
//new (_changed_connection) sigc::connection;
ref = new SPTagUseReference(this);
}
{
if (child) {
}
delete ref;
ref = 0;
}
void
{
readAttr( "xlink:href" );
// We don't need to create child here:
// reading xlink:href will attach ref, and that will cause the changed signal to be emitted,
// which will call sp_tag_use_href_changed, and that will take care of the child
}
void
{
if (child) {
}
}
void
{
switch (key) {
case SP_ATTR_XLINK_HREF: {
/* No change, do nothing. */
} else {
if (value) {
// First, set the href field, because sp_tag_use_href_changed will need it.
// Now do the attaching, which emits the changed signal.
try {
} catch (Inkscape::BadURIException &e) {
}
} else {
}
}
break;
}
default:
break;
}
}
{
}
}
return repr;
}
/**
* Returns the ultimate original of a SPTagUse (i.e. the first object in the chain of its originals
* which is not an SPTagUse). If no original is found, NULL is returned (it is the responsibility
* of the caller to make sure that this is handled correctly).
*
* Note that the returned is the clone object, i.e. the child of an SPTagUse (of the argument one for
* the trivial case) and not the "true original".
*/
{
}
return NULL;
}
void
{
if (href) {
if (refobj) {
if (child_) {
sp_object_unref(child_, 0);
}
}
}
}
{
if (ref) {
}
return ref_;
}
/*
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 :