summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-08-30 15:51:29 +0200
committerBenjamin Otte <otte@redhat.com>2012-09-03 12:54:14 +0200
commite3fc081c5dbb5ab04c8b0d3bd9aa52fe16aba640 (patch)
tree6b90497d19255d9e66bab89f480a9bc3c22d8736 /gtk
parentfd7668bfb54674bda04cc74c2a6ad571939943e9 (diff)
downloadgtk+-e3fc081c5dbb5ab04c8b0d3bd9aa52fe16aba640.tar.gz
cssvalue: Pass property ID to transition function
This is to allow animating arrays properly. I'm not really thrilled about this solution (we leak propertys into the values again...), but it's the best I can come up with - I prefer it to having N different array types...
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkcssarrayvalue.c1
-rw-r--r--gtk/gtkcssbgsizevalue.c5
-rw-r--r--gtk/gtkcssbordervalue.c1
-rw-r--r--gtk/gtkcsscornervalue.c9
-rw-r--r--gtk/gtkcsseasevalue.c1
-rw-r--r--gtk/gtkcssenginevalue.c1
-rw-r--r--gtk/gtkcssenumvalue.c1
-rw-r--r--gtk/gtkcssimagevalue.c1
-rw-r--r--gtk/gtkcssinheritvalue.c1
-rw-r--r--gtk/gtkcssinitialvalue.c1
-rw-r--r--gtk/gtkcssnumbervalue.c1
-rw-r--r--gtk/gtkcsspositionvalue.c5
-rw-r--r--gtk/gtkcssrepeatvalue.c1
-rw-r--r--gtk/gtkcssrgbavalue.c1
-rw-r--r--gtk/gtkcssshadowsvalue.c7
-rw-r--r--gtk/gtkcssshadowvalue.c11
-rw-r--r--gtk/gtkcssstringvalue.c1
-rw-r--r--gtk/gtkcsstransition.c1
-rw-r--r--gtk/gtkcsstypedvalue.c1
-rw-r--r--gtk/gtkcssvalue.c3
-rw-r--r--gtk/gtkcssvalueprivate.h2
-rw-r--r--gtk/gtksymboliccolor.c1
22 files changed, 40 insertions, 17 deletions
diff --git a/gtk/gtkcssarrayvalue.c b/gtk/gtkcssarrayvalue.c
index fb22294c5c..dab397ea0e 100644
--- a/gtk/gtkcssarrayvalue.c
+++ b/gtk/gtkcssarrayvalue.c
@@ -95,6 +95,7 @@ gtk_css_value_array_equal (const GtkCssValue *value1,
static GtkCssValue *
gtk_css_value_array_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
return NULL;
diff --git a/gtk/gtkcssbgsizevalue.c b/gtk/gtkcssbgsizevalue.c
index d7349ddd58..e545f61b34 100644
--- a/gtk/gtkcssbgsizevalue.c
+++ b/gtk/gtkcssbgsizevalue.c
@@ -84,6 +84,7 @@ gtk_css_value_bg_size_equal (const GtkCssValue *value1,
static GtkCssValue *
gtk_css_value_bg_size_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
GtkCssValue *x, *y;
@@ -99,7 +100,7 @@ gtk_css_value_bg_size_transition (GtkCssValue *start,
if (start->x)
{
- x = _gtk_css_value_transition (start->x, end->x, progress);
+ x = _gtk_css_value_transition (start->x, end->x, property_id, progress);
if (x == NULL)
return NULL;
}
@@ -108,7 +109,7 @@ gtk_css_value_bg_size_transition (GtkCssValue *start,
if (start->y)
{
- y = _gtk_css_value_transition (start->y, end->y, progress);
+ y = _gtk_css_value_transition (start->y, end->y, property_id, progress);
if (y == NULL)
{
_gtk_css_value_unref (x);
diff --git a/gtk/gtkcssbordervalue.c b/gtk/gtkcssbordervalue.c
index dab46319ae..953ab53ca5 100644
--- a/gtk/gtkcssbordervalue.c
+++ b/gtk/gtkcssbordervalue.c
@@ -95,6 +95,7 @@ gtk_css_value_border_equal (const GtkCssValue *value1,
static GtkCssValue *
gtk_css_value_border_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
return NULL;
diff --git a/gtk/gtkcsscornervalue.c b/gtk/gtkcsscornervalue.c
index d26dffd1d7..48586dfa12 100644
--- a/gtk/gtkcsscornervalue.c
+++ b/gtk/gtkcsscornervalue.c
@@ -68,15 +68,16 @@ gtk_css_value_corner_equal (const GtkCssValue *corner1,
static GtkCssValue *
gtk_css_value_corner_transition (GtkCssValue *start,
- GtkCssValue *end,
- double progress)
+ GtkCssValue *end,
+ guint property_id,
+ double progress)
{
GtkCssValue *x, *y;
- x = _gtk_css_value_transition (start->x, end->x, progress);
+ x = _gtk_css_value_transition (start->x, end->x, property_id, progress);
if (x == NULL)
return NULL;
- y = _gtk_css_value_transition (start->y, end->y, progress);
+ y = _gtk_css_value_transition (start->y, end->y, property_id, progress);
if (y == NULL)
{
_gtk_css_value_unref (x);
diff --git a/gtk/gtkcsseasevalue.c b/gtk/gtkcsseasevalue.c
index 81c9bce56a..19f979b06d 100644
--- a/gtk/gtkcsseasevalue.c
+++ b/gtk/gtkcsseasevalue.c
@@ -84,6 +84,7 @@ gtk_css_value_ease_equal (const GtkCssValue *ease1,
static GtkCssValue *
gtk_css_value_ease_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
return NULL;
diff --git a/gtk/gtkcssenginevalue.c b/gtk/gtkcssenginevalue.c
index a39ac6c57d..851c6310c5 100644
--- a/gtk/gtkcssenginevalue.c
+++ b/gtk/gtkcssenginevalue.c
@@ -53,6 +53,7 @@ gtk_css_value_engine_equal (const GtkCssValue *value1,
static GtkCssValue *
gtk_css_value_engine_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
return NULL;
diff --git a/gtk/gtkcssenumvalue.c b/gtk/gtkcssenumvalue.c
index 9ea7ae8f01..2d847f8e87 100644
--- a/gtk/gtkcssenumvalue.c
+++ b/gtk/gtkcssenumvalue.c
@@ -54,6 +54,7 @@ gtk_css_value_enum_equal (const GtkCssValue *enum1,
static GtkCssValue *
gtk_css_value_enum_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
return NULL;
diff --git a/gtk/gtkcssimagevalue.c b/gtk/gtkcssimagevalue.c
index c40354ffdb..b8baa509f2 100644
--- a/gtk/gtkcssimagevalue.c
+++ b/gtk/gtkcssimagevalue.c
@@ -67,6 +67,7 @@ gtk_css_value_image_equal (const GtkCssValue *value1,
static GtkCssValue *
gtk_css_value_image_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
GtkCssImage *fade;
diff --git a/gtk/gtkcssinheritvalue.c b/gtk/gtkcssinheritvalue.c
index d70200d038..585a9760e5 100644
--- a/gtk/gtkcssinheritvalue.c
+++ b/gtk/gtkcssinheritvalue.c
@@ -65,6 +65,7 @@ gtk_css_value_inherit_equal (const GtkCssValue *value1,
static GtkCssValue *
gtk_css_value_inherit_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
return NULL;
diff --git a/gtk/gtkcssinitialvalue.c b/gtk/gtkcssinitialvalue.c
index 45cadd7c17..d9d960f0fc 100644
--- a/gtk/gtkcssinitialvalue.c
+++ b/gtk/gtkcssinitialvalue.c
@@ -54,6 +54,7 @@ gtk_css_value_initial_equal (const GtkCssValue *value1,
static GtkCssValue *
gtk_css_value_initial_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
return NULL;
diff --git a/gtk/gtkcssnumbervalue.c b/gtk/gtkcssnumbervalue.c
index db9e154a77..c84bce6a1b 100644
--- a/gtk/gtkcssnumbervalue.c
+++ b/gtk/gtkcssnumbervalue.c
@@ -142,6 +142,7 @@ gtk_css_value_number_equal (const GtkCssValue *number1,
static GtkCssValue *
gtk_css_value_number_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
/* FIXME: This needs to be supported at least for percentages,
diff --git a/gtk/gtkcsspositionvalue.c b/gtk/gtkcsspositionvalue.c
index e69147a995..077ab8429b 100644
--- a/gtk/gtkcsspositionvalue.c
+++ b/gtk/gtkcsspositionvalue.c
@@ -69,14 +69,15 @@ gtk_css_value_position_equal (const GtkCssValue *position1,
static GtkCssValue *
gtk_css_value_position_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
GtkCssValue *x, *y;
- x = _gtk_css_value_transition (start->x, end->x, progress);
+ x = _gtk_css_value_transition (start->x, end->x, property_id, progress);
if (x == NULL)
return NULL;
- y = _gtk_css_value_transition (start->y, end->y, progress);
+ y = _gtk_css_value_transition (start->y, end->y, property_id, progress);
if (y == NULL)
{
_gtk_css_value_unref (x);
diff --git a/gtk/gtkcssrepeatvalue.c b/gtk/gtkcssrepeatvalue.c
index 6f070727e8..b9387eb7de 100644
--- a/gtk/gtkcssrepeatvalue.c
+++ b/gtk/gtkcssrepeatvalue.c
@@ -53,6 +53,7 @@ gtk_css_value_repeat_equal (const GtkCssValue *repeat1,
static GtkCssValue *
gtk_css_value_repeat_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
return NULL;
diff --git a/gtk/gtkcssrgbavalue.c b/gtk/gtkcssrgbavalue.c
index 3bb6897d13..99bcfa2b00 100644
--- a/gtk/gtkcssrgbavalue.c
+++ b/gtk/gtkcssrgbavalue.c
@@ -53,6 +53,7 @@ gtk_css_value_rgba_equal (const GtkCssValue *rgba1,
static GtkCssValue *
gtk_css_value_rgba_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
GdkRGBA transition;
diff --git a/gtk/gtkcssshadowsvalue.c b/gtk/gtkcssshadowsvalue.c
index 78e092a6b1..d565d89d72 100644
--- a/gtk/gtkcssshadowsvalue.c
+++ b/gtk/gtkcssshadowsvalue.c
@@ -93,6 +93,7 @@ gtk_css_value_shadows_equal (const GtkCssValue *value1,
static GtkCssValue *
gtk_css_value_shadows_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
GtkCssValue *result;
@@ -109,14 +110,14 @@ gtk_css_value_shadows_transition (GtkCssValue *start,
for (i = 0; i < MIN (start->len, end->len); i++)
{
- result->values[i] = _gtk_css_value_transition (start->values[i], end->values[i], progress);
+ result->values[i] = _gtk_css_value_transition (start->values[i], end->values[i], property_id, progress);
}
if (start->len > end->len)
{
for (; i < result->len; i++)
{
GtkCssValue *fill = _gtk_css_shadow_value_new_for_transition (start->values[i]);
- result->values[i] = _gtk_css_value_transition (start->values[i], fill, progress);
+ result->values[i] = _gtk_css_value_transition (start->values[i], fill, property_id, progress);
_gtk_css_value_unref (fill);
}
}
@@ -125,7 +126,7 @@ gtk_css_value_shadows_transition (GtkCssValue *start,
for (; i < result->len; i++)
{
GtkCssValue *fill = _gtk_css_shadow_value_new_for_transition (end->values[i]);
- result->values[i] = _gtk_css_value_transition (fill, end->values[i], progress);
+ result->values[i] = _gtk_css_value_transition (fill, end->values[i], property_id, progress);
_gtk_css_value_unref (fill);
}
}
diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c
index bdfa8d25d4..ed311a17ef 100644
--- a/gtk/gtkcssshadowvalue.c
+++ b/gtk/gtkcssshadowvalue.c
@@ -106,17 +106,18 @@ gtk_css_value_shadow_equal (const GtkCssValue *shadow1,
static GtkCssValue *
gtk_css_value_shadow_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
if (start->inset != end->inset)
return NULL;
- return gtk_css_shadow_value_new (_gtk_css_value_transition (start->hoffset, end->hoffset, progress),
- _gtk_css_value_transition (start->voffset, end->voffset, progress),
- _gtk_css_value_transition (start->radius, end->radius, progress),
- _gtk_css_value_transition (start->spread, end->spread, progress),
+ return gtk_css_shadow_value_new (_gtk_css_value_transition (start->hoffset, end->hoffset, property_id, progress),
+ _gtk_css_value_transition (start->voffset, end->voffset, property_id, progress),
+ _gtk_css_value_transition (start->radius, end->radius, property_id, progress),
+ _gtk_css_value_transition (start->spread, end->spread, property_id, progress),
start->inset,
- _gtk_css_value_transition (start->color, end->color, progress));
+ _gtk_css_value_transition (start->color, end->color, property_id, progress));
}
static void
diff --git a/gtk/gtkcssstringvalue.c b/gtk/gtkcssstringvalue.c
index 328fd21dc5..78273d3327 100644
--- a/gtk/gtkcssstringvalue.c
+++ b/gtk/gtkcssstringvalue.c
@@ -51,6 +51,7 @@ gtk_css_value_string_equal (const GtkCssValue *value1,
static GtkCssValue *
gtk_css_value_string_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
return NULL;
diff --git a/gtk/gtkcsstransition.c b/gtk/gtkcsstransition.c
index cbedc8b6cc..ede18b32b7 100644
--- a/gtk/gtkcsstransition.c
+++ b/gtk/gtkcsstransition.c
@@ -46,6 +46,7 @@ gtk_css_transition_set_values (GtkStyleAnimation *animation,
value = _gtk_css_value_transition (transition->start,
transition->end,
+ transition->property,
progress);
if (value == NULL)
value = _gtk_css_value_ref (transition->end);
diff --git a/gtk/gtkcsstypedvalue.c b/gtk/gtkcsstypedvalue.c
index a939bac0aa..5ce5effae5 100644
--- a/gtk/gtkcsstypedvalue.c
+++ b/gtk/gtkcsstypedvalue.c
@@ -55,6 +55,7 @@ gtk_css_value_typed_equal (const GtkCssValue *value1,
static GtkCssValue *
gtk_css_value_typed_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
return NULL;
diff --git a/gtk/gtkcssvalue.c b/gtk/gtkcssvalue.c
index e057f90b50..b71eed1957 100644
--- a/gtk/gtkcssvalue.c
+++ b/gtk/gtkcssvalue.c
@@ -125,6 +125,7 @@ _gtk_css_value_equal0 (const GtkCssValue *value1,
GtkCssValue *
_gtk_css_value_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
g_return_val_if_fail (start != NULL, FALSE);
@@ -133,7 +134,7 @@ _gtk_css_value_transition (GtkCssValue *start,
if (start->class != end->class)
return NULL;
- return start->class->transition (start, end, progress);
+ return start->class->transition (start, end, property_id, progress);
}
char *
diff --git a/gtk/gtkcssvalueprivate.h b/gtk/gtkcssvalueprivate.h
index 629cc754b2..a7f9b9628f 100644
--- a/gtk/gtkcssvalueprivate.h
+++ b/gtk/gtkcssvalueprivate.h
@@ -50,6 +50,7 @@ struct _GtkCssValueClass {
const GtkCssValue *value2);
GtkCssValue * (* transition) (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress);
void (* print) (const GtkCssValue *value,
GString *string);
@@ -74,6 +75,7 @@ gboolean _gtk_css_value_equal0 (const GtkCssValue
const GtkCssValue *value2);
GtkCssValue *_gtk_css_value_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress);
char * _gtk_css_value_to_string (const GtkCssValue *value);
diff --git a/gtk/gtksymboliccolor.c b/gtk/gtksymboliccolor.c
index a96f9f594f..1cca34c47e 100644
--- a/gtk/gtksymboliccolor.c
+++ b/gtk/gtksymboliccolor.c
@@ -238,6 +238,7 @@ gtk_css_value_symbolic_equal (const GtkCssValue *value1,
static GtkCssValue *
gtk_css_value_symbolic_transition (GtkCssValue *start,
GtkCssValue *end,
+ guint property_id,
double progress)
{
return NULL;