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.
This commit is contained in:
Benjamin Otte 2012-04-01 07:28:35 +02:00
parent 41ce29767c
commit 8ad8a4febf
2 changed files with 13 additions and 0 deletions

View 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)

View 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);