summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 605f7fa)
raw | patch | inline | side by side (parent: 605f7fa)
author | glimmer07 <glimmer07@users.sourceforge.net> | |
Thu, 23 Jul 2009 16:41:13 +0000 (16:41 +0000) | ||
committer | glimmer07 <glimmer07@users.sourceforge.net> | |
Thu, 23 Jul 2009 16:41:13 +0000 (16:41 +0000) |
src/extension/dbus/document-interface.cpp | patch | blob | history | |
src/extension/dbus/document-interface.h | patch | blob | history | |
src/extension/dbus/document-interface.xml | patch | blob | history |
index 76eeec509d7ea8323f9007a278b2dcdb06ef13d2..53674790a28a3d251500a4c58bdb6273e2fbd3a0 100644 (file)
}
gboolean
-dbus_check_string (gchar *string, GError ** error, gchar * errorstr)
+dbus_check_string (gchar *string, GError ** error, const gchar * errorstr)
{
if (string == NULL)
{
return TRUE;
}
+gboolean
+document_interface_set_color (DocumentInterface *object, gchar *shape,
+ int r, int g, int b, gboolean fill, GError **error)
+{
+ gchar style[15];
+ if (r<0 || r>255 || g<0 || g>255 || b<0 || b>255)
+ {
+ g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Given (%d,%d,%d). All values must be between 0-255 inclusive.", r, g, b);
+ return FALSE;
+ }
+
+ if (fill)
+ snprintf(style, 15, "fill:#%.2x%.2x%.2x", r, g, b);
+ else
+ snprintf(style, 15, "stroke:#%.2x%.2x%.2x", r, g, b);
+
+ if (strcmp(shape, "document") == 0)
+ return document_interface_document_merge_css (object, style, error);
+
+ return document_interface_merge_css (object, shape, style, error);
+}
+
gboolean
document_interface_move_to_layer (DocumentInterface *object, gchar *shape,
gchar *layerstr, GError **error)
index ff0452a14b166d3fd7544b5bd3a9f48aefabd9cc..413673862dc27036c2179cd508a3844db5d79f98 100644 (file)
document_interface_merge_css (DocumentInterface *object, gchar *shape,
gchar *stylestring, GError **error);
+gboolean
+document_interface_set_color (DocumentInterface *object, gchar *shape,
+ int r, int g, int b, gboolean fill, GError **error);
+
gboolean
document_interface_move_to_layer (DocumentInterface *object, gchar *shape,
gchar *layerstr, GError **error);
index 7c16c6d1e2f285e85259509d404ee73693000e6e..3ccae9556d2482d0f1b909fda589b4e0d6ec262a 100644 (file)
<doc:seealso><doc:ref type="interface" to="Style Strings">Style Strings</doc:ref></doc:seealso>
</doc:doc>
</method>
+
+ <method name="set_color">
+ <arg type="s" name="shape" direction="in" >
+ <doc:doc>
+ <doc:summary>Any object, or 'document' to apply to document style.</doc:summary>
+ </doc:doc>
+ </arg>
+ <arg type="i" name="red" direction="in" >
+ <doc:doc>
+ <doc:summary>The red component.</doc:summary>
+ </doc:doc>
+ </arg>
+ <arg type="i" name="green" direction="in" >
+ <doc:doc>
+ <doc:summary>The green component.</doc:summary>
+ </doc:doc>
+ </arg>
+ <arg type="i" name="blue" direction="in" >
+ <doc:doc>
+ <doc:summary>The blue component.</doc:summary>
+ </doc:doc>
+ </arg>
+ <arg type="b" name="fill" direction="in" >
+ <doc:doc>
+ <doc:summary>True to change fill color, false for stroke color.</doc:summary>
+ </doc:doc>
+ </arg>
+ <doc:doc>
+ <doc:description>
+ <doc:para>Modifies the fill or stroke color of an object (or the document style) based on RGB values.</doc:para>
+ <doc:para>Red green and blue must be between 0-255 inclusive.</doc:para>
+ </doc:description>
+ </doc:doc>
+ </method>
<method name="move_to_layer">
<arg type="s" name="objectname" direction="in" >