uri-references.cpp revision 3a8e479f331858946168c32bfc7622c9010b6680
#define __SP_URI_REFERENCES_C__
/*
* Helper methods for resolving URI References
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
*
* Copyright (C) 2001-2002 Lauris Kaplinski
* Copyright (C) 2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "document.h"
#include "sp-object.h"
#include "uri.h"
#include "uri-references.h"
namespace Inkscape {
{
/* FIXME !!! attach to owner's destroy signal to clean up in case */
}
{
}
URIReference::~URIReference() {
detach();
}
{
if (_owner) {
} else if (_owner_document) {
} else {
}
throw UnsupportedURIException();
}
/* FIXME !!! real xpointer support should be delegated to document */
/* for now this handles the minimal xpointer form that SVG 1.0
* requires of us
*/
/* FIXME !!! this is wasteful */
/* FIXME: It looks as though this is including "))" in the id. I suggest moving
the strlen calculation and validity testing to before strdup, and copying just
the id without the "))". -- pjrm */
throw MalformedURIException();
}
} else {
throw UnsupportedURIException();
}
} else {
}
/* FIXME !!! validate id as an NCName somewhere */
if (_uri) {
delete _uri;
}
}
void URIReference::detach() {
delete _uri;
}
}
if (_obj) {
}
if (old_obj) {
/* release the old object _after_ the signal emission */
}
}
/* If an object is deleted, current semantics require that we release
* it on its "release" signal, rather than later, when its ID is actually
* unregistered from the document.
*/
}
} /* namespace Inkscape */
static gchar *
{
const gchar *e;
/* fixme: xpointer, everything */
e = uri + 5;
while (*e) {
if (*e == ')') break;
e += 1;
if (!*e) return NULL;
}
return id;
}
SPObject *
{
return ref;
}