From 8ad8a4febfe44788ed09b3308146e9340abdecc6 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 1 Apr 2012 07:28:35 +0200 Subject: [PATCH] cssvalue: Add _gtk_css_value_to_string() This is a tiny wrapper around _gtk_css_value_print(). It's intended for usage in gdb and printf debugging. --- gtk/gtkcssvalue.c | 12 ++++++++++++ gtk/gtkcssvalueprivate.h | 1 + 2 files changed, 13 insertions(+) diff --git a/gtk/gtkcssvalue.c b/gtk/gtkcssvalue.c index 9fef5769b0..25d3668df5 100644 --- a/gtk/gtkcssvalue.c +++ b/gtk/gtkcssvalue.c @@ -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) diff --git a/gtk/gtkcssvalueprivate.h b/gtk/gtkcssvalueprivate.h index 6e2e89c66f..a3143a3cc0 100644 --- a/gtk/gtkcssvalueprivate.h +++ b/gtk/gtkcssvalueprivate.h @@ -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);