150
150
sp_xml_ns_register_defaults()
152
static SPXMLNs defaults[9];
152
static SPXMLNs defaults[10];
154
154
defaults[0].uri = g_quark_from_static_string(SP_SODIPODI_NS_URI);
155
155
defaults[0].prefix = g_quark_from_static_string("sodipodi");
195
195
defaults[8].uri = g_quark_from_static_string("http://inkscape.sourceforge.net/DTD/s odipodi-0.dtd");
196
196
defaults[8].prefix = g_quark_from_static_string("sodipodi");
197
defaults[8].next = NULL;
197
defaults[8].next = &defaults[9];
199
// This namespace URI is being phased out by Creative Commons
201
defaults[9].uri = g_quark_from_static_string(SP_OLD_CC_NS_URI);
202
defaults[9].prefix = g_quark_from_static_string("cc");
203
defaults[9].next = NULL;
199
205
namespaces = &defaults[0];
579
unsigned sp_repr_set_point(Inkscape::XML::Node *repr, gchar const *key, Geom::Point val)
581
g_return_val_if_fail(repr != NULL, FALSE);
582
g_return_val_if_fail(key != NULL, FALSE);
584
Inkscape::SVGOStringStream os;
585
os << val[Geom::X] << "," << val[Geom::Y];
587
repr->setAttribute(key, os.str().c_str());
592
sp_repr_get_point(Inkscape::XML::Node *repr, gchar const *key, Geom::Point *val)
594
g_return_val_if_fail(repr != NULL, FALSE);
595
g_return_val_if_fail(key != NULL, FALSE);
596
g_return_val_if_fail(val != NULL, FALSE);
598
gchar const *v = repr->attribute(key);
600
gchar ** strarray = g_strsplit(v, ",", 2);
602
if (strarray && strarray[0] && strarray[1]) {
604
newx = g_ascii_strtod(strarray[0], NULL);
605
newy = g_ascii_strtod(strarray[1], NULL);
606
g_strfreev (strarray);
607
*val = Geom::Point(newx, newy);
611
g_strfreev (strarray);