summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 068e269)
raw | patch | inline | side by side (parent: 068e269)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sat, 7 Oct 2006 19:43:42 +0000 (19:43 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sat, 7 Oct 2006 19:43:42 +0000 (19:43 +0000) |
src/style.cpp | patch | blob | history | |
src/style.h | patch | blob | history |
diff --git a/src/style.cpp b/src/style.cpp
index bd880b857cb4760adaa117b8dd3cf59eb4072643..048801ae4e74eff778a873ee754d5c4b7bba152e 100644 (file)
--- a/src/style.cpp
+++ b/src/style.cpp
}
+// FIXME: Everything below this line belongs in a different file - css-chemistry?
+
+void
+sp_style_set_property_url (SPObject *item, gchar const *property, SPObject *linked, bool recursive)
+{
+ Inkscape::XML::Node *repr = SP_OBJECT_REPR(item);
+
+ if (repr == NULL) return;
+
+ g_return_if_fail(linked != NULL);
+
+ gchar *val = g_strdup_printf("url(#%s)", SP_OBJECT_ID(linked));
+
+ SPCSSAttr *css = sp_repr_css_attr_new();
+ sp_repr_css_set_property(css, property, val);
+ g_free(val);
+ if (recursive) {
+ sp_repr_css_change_recursive(repr, css, "style");
+ } else {
+ sp_repr_css_change(repr, css, "style");
+ }
+ sp_repr_css_attr_unref(css);
+}
+
+
/**
* Clear all style property attributes in object.
*/
diff --git a/src/style.h b/src/style.h
index a7572317e3b897209b4395e43abfefd92323cb42..b7932404c985b66dac7b8bc0446412984838b71b 100644 (file)
--- a/src/style.h
+++ b/src/style.h
void sp_style_unset_property_attrs(SPObject *o);
+void sp_style_set_property_url (SPObject *item, gchar const *property, SPObject *linked, bool recursive);
+
#endif