diff options
author | Benjamin Otte <otte@redhat.com> | 2012-03-30 17:47:26 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-04-17 08:59:15 +0200 |
commit | 1a9dfab825eb18ee101b579743a47ebb55e06a35 (patch) | |
tree | f20cbc616f04045ec1f4c89eab598760f704929b /gtk/gtkcssvalue.c | |
parent | bf92f2f7ac5ac55b7ae4b59d8cd3a449d9ab5b20 (diff) | |
download | gtk+-1a9dfab825eb18ee101b579743a47ebb55e06a35.tar.gz |
cssvalue: Add _gtk_css_value_transition()
Returns a value that transitions between start and end or %NULL if the
values cannot be transitioned.
So far, all implementations but numbers and rgba return NULL.
Diffstat (limited to 'gtk/gtkcssvalue.c')
-rw-r--r-- | gtk/gtkcssvalue.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gtk/gtkcssvalue.c b/gtk/gtkcssvalue.c index 7dd1d7b292..9fef5769b0 100644 --- a/gtk/gtkcssvalue.c +++ b/gtk/gtkcssvalue.c @@ -86,6 +86,14 @@ gtk_css_value_default_equal (const GtkCssValue *value1, return FALSE; } +static GtkCssValue * +gtk_css_value_default_transition (GtkCssValue *start, + GtkCssValue *end, + double progress) +{ + return NULL; +} + static void gtk_css_value_default_print (const GtkCssValue *value, GString *string) @@ -100,6 +108,7 @@ gtk_css_value_default_print (const GtkCssValue *value, static const GtkCssValueClass GTK_CSS_VALUE_DEFAULT = { gtk_css_value_default_free, gtk_css_value_default_equal, + gtk_css_value_default_transition, gtk_css_value_default_print }; @@ -395,6 +404,20 @@ _gtk_css_value_equal (const GtkCssValue *value1, return value1->class->equal (value1, value2); } +GtkCssValue * +_gtk_css_value_transition (GtkCssValue *start, + GtkCssValue *end, + double progress) +{ + g_return_val_if_fail (start != NULL, FALSE); + g_return_val_if_fail (end != NULL, FALSE); + + if (start->class != end->class) + return NULL; + + return start->class->transition (start, end, progress); +} + void _gtk_css_value_print (const GtkCssValue *value, GString *string) |