]> Pileus Git - ~andy/gtk/commitdiff
cssvalue: Add _gtk_css_value_to_string()
authorBenjamin Otte <otte@redhat.com>
Sun, 1 Apr 2012 05:28:35 +0000 (07:28 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 17 Apr 2012 06:59:16 +0000 (08:59 +0200)
This is a tiny wrapper around _gtk_css_value_print().
It's intended for usage in gdb and printf debugging.

gtk/gtkcssvalue.c
gtk/gtkcssvalueprivate.h

index 9fef5769b09673ac184f1267db93ceaa0b29545e..25d3668df568e5dd03fca2e51c80f7f5325ea355 100644 (file)
@@ -418,6 +418,18 @@ _gtk_css_value_transition (GtkCssValue *start,
   return start->class->transition (start, end, progress);
 }
 
+char *
+_gtk_css_value_to_string (const GtkCssValue *value)
+{
+  GString *string;
+
+  g_return_val_if_fail (value != NULL, NULL);
+
+  string = g_string_new (NULL);
+  _gtk_css_value_print (value, string);
+  return g_string_free (string, FALSE);
+}
+
 void
 _gtk_css_value_print (const GtkCssValue *value,
                       GString           *string)
index 6e2e89c66ff1601fe52f4072e2f154235af5764f..a3143a3cc0837bb131700ac349d74c2b9c498e11 100644 (file)
@@ -71,6 +71,7 @@ GtkCssValue *_gtk_css_value_transition                (GtkCssValue
                                                        GtkCssValue                *end,
                                                        double                      progress);
 
+char *       _gtk_css_value_to_string                 (const GtkCssValue          *value);
 void         _gtk_css_value_print                     (const GtkCssValue          *value,
                                                        GString                    *string);