Commit 9b953829 authored by Benjamin Otte's avatar Benjamin Otte

css: Introduce _gtk_css_value_compute()

This commit is essentially a large reorganization. Instead of all value
subtypes having their own compute function, there is the general
_gtk_css_value_compute() function that then calls a vfunc on the
subtype.
parent 3f00801e
......@@ -40,6 +40,33 @@ gtk_css_value_array_free (GtkCssValue *value)
g_slice_free1 (sizeof (GtkCssValue) + sizeof (GtkCssValue *) * (value->n_values - 1), value);
}
static GtkCssValue *
gtk_css_value_array_compute (GtkCssValue *value,
GtkStyleContext *context)
{
GtkCssValue *result;
gboolean changed = FALSE;
guint i;
if (value->n_values == 0)
return _gtk_css_value_ref (value);
result = _gtk_css_array_value_new_from_array (value->values, value->n_values);
for (i = 0; i < value->n_values; i++)
{
result->values[i] = _gtk_css_value_compute (value->values[i], context);
changed |= (result->values[i] != value->values[i]);
}
if (!changed)
{
_gtk_css_value_unref (result);
return _gtk_css_value_ref (value);
}
return result;
}
static gboolean
gtk_css_value_array_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
......@@ -89,6 +116,7 @@ gtk_css_value_array_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_ARRAY = {
gtk_css_value_array_free,
gtk_css_value_array_compute,
gtk_css_value_array_equal,
gtk_css_value_array_transition,
gtk_css_value_array_print
......@@ -153,37 +181,6 @@ _gtk_css_array_value_parse (GtkCssParser *parser,
return result;
}
GtkCssValue *
_gtk_css_array_value_compute (GtkCssValue *value,
GtkCssValue * (* compute_func) (GtkCssValue *, GtkStyleContext *),
GtkStyleContext *context)
{
GtkCssValue *result;
gboolean changed = FALSE;
guint i;
g_return_val_if_fail (value->class == &GTK_CSS_VALUE_ARRAY, NULL);
g_return_val_if_fail (compute_func != NULL, NULL);
if (value->n_values == 0)
return _gtk_css_value_ref (value);
result = _gtk_css_array_value_new_from_array (value->values, value->n_values);
for (i = 0; i < value->n_values; i++)
{
result->values[i] = (* compute_func) (value->values[i], context);
changed |= (result->values[i] != value->values[i]);
}
if (!changed)
{
_gtk_css_value_unref (result);
return _gtk_css_value_ref (value);
}
return result;
}
GtkCssValue *
_gtk_css_array_value_get_nth (const GtkCssValue *value,
guint i)
......
......@@ -33,9 +33,6 @@ GtkCssValue * _gtk_css_array_value_parse (GtkCssParser *
GtkCssValue * (* parse_func) (GtkCssParser *),
gboolean allow_none);
GtkCssValue * _gtk_css_array_value_compute (GtkCssValue *value,
GtkCssValue * (* compute_func) (GtkCssValue *, GtkStyleContext *),
GtkStyleContext *context);
GtkCssValue * _gtk_css_array_value_get_nth (const GtkCssValue *value,
guint i);
guint _gtk_css_array_value_get_n_values (const GtkCssValue *value);
......
......@@ -40,6 +40,17 @@ gtk_css_value_bg_size_free (GtkCssValue *value)
g_slice_free (GtkCssValue, value);
}
GtkCssValue *
gtk_css_value_bg_size_compute (GtkCssValue *value,
GtkStyleContext *context)
{
if (value->x == NULL && value->y == NULL)
return _gtk_css_value_ref (value);
return _gtk_css_bg_size_value_new (value->x ? _gtk_css_value_compute (value->x, context) : NULL,
value->y ? _gtk_css_value_compute (value->y, context) : NULL);
}
static gboolean
gtk_css_value_bg_size_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
......@@ -119,6 +130,7 @@ gtk_css_value_bg_size_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_BG_SIZE = {
gtk_css_value_bg_size_free,
gtk_css_value_bg_size_compute,
gtk_css_value_bg_size_equal,
gtk_css_value_bg_size_transition,
gtk_css_value_bg_size_print
......@@ -243,16 +255,3 @@ _gtk_css_bg_size_value_compute_size (const GtkCssValue *value,
out_width, out_height);
}
GtkCssValue *
_gtk_css_bg_size_value_compute (GtkCssValue *value,
GtkStyleContext *context)
{
g_return_val_if_fail (value->class == &GTK_CSS_VALUE_BG_SIZE, NULL);
if (value->x == NULL && value->y == NULL)
return _gtk_css_value_ref (value);
return _gtk_css_bg_size_value_new (value->x ? _gtk_css_number_value_compute (value->x, context) : NULL,
value->y ? _gtk_css_number_value_compute (value->y, context) : NULL);
}
......@@ -36,8 +36,6 @@ void _gtk_css_bg_size_value_compute_size (const GtkCssValue *bg_
double area_height,
double *out_width,
double *out_height);
GtkCssValue * _gtk_css_bg_size_value_compute (GtkCssValue *bg_size,
GtkStyleContext *context);
G_END_DECLS
......
......@@ -41,6 +41,35 @@ gtk_css_value_border_free (GtkCssValue *value)
g_slice_free (GtkCssValue, value);
}
static GtkCssValue *
gtk_css_value_border_compute (GtkCssValue *value,
GtkStyleContext *context)
{
GtkCssValue *computed;
gboolean changed = FALSE;
guint i;
computed = _gtk_css_border_value_new (NULL, NULL, NULL, NULL);
computed->fill = value->fill;
for (i = 0; i < 4; i++)
{
if (value->values[i])
{
computed->values[i] = _gtk_css_value_compute (value->values[i], context);
changed |= (computed->values[i] != value->values[i]);
}
}
if (!changed)
{
_gtk_css_value_unref (computed);
return _gtk_css_value_ref (value);
}
return computed;
}
static gboolean
gtk_css_value_border_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
......@@ -99,6 +128,7 @@ gtk_css_value_border_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_BORDER = {
gtk_css_value_border_free,
gtk_css_value_border_compute,
gtk_css_value_border_equal,
gtk_css_value_border_transition,
gtk_css_value_border_print
......@@ -202,34 +232,3 @@ _gtk_css_border_value_get_left (const GtkCssValue *value)
return value->values[GTK_CSS_LEFT];
}
GtkCssValue *
_gtk_css_border_value_compute (GtkCssValue *value,
GtkStyleContext *context)
{
GtkCssValue *computed;
gboolean changed = FALSE;
guint i;
g_return_val_if_fail (value->class == &GTK_CSS_VALUE_BORDER, NULL);
computed = _gtk_css_border_value_new (NULL, NULL, NULL, NULL);
computed->fill = value->fill;
for (i = 0; i < 4; i++)
{
if (value->values[i])
{
computed->values[i] = _gtk_css_number_value_compute (value->values[i], context);
changed |= (computed->values[i] != value->values[i]);
}
}
if (!changed)
{
_gtk_css_value_unref (computed);
return _gtk_css_value_ref (value);
}
return computed;
}
......@@ -40,9 +40,6 @@ GtkCssValue * _gtk_css_border_value_get_right (const GtkCssValue *val
GtkCssValue * _gtk_css_border_value_get_bottom (const GtkCssValue *value);
GtkCssValue * _gtk_css_border_value_get_left (const GtkCssValue *value);
GtkCssValue * _gtk_css_border_value_compute (GtkCssValue *border,
GtkStyleContext *context);
G_END_DECLS
......
......@@ -36,6 +36,24 @@ gtk_css_value_corner_free (GtkCssValue *value)
g_slice_free (GtkCssValue, value);
}
static GtkCssValue *
gtk_css_value_corner_compute (GtkCssValue *corner,
GtkStyleContext *context)
{
GtkCssValue *x, *y;
x = _gtk_css_value_compute (corner->x, context);
y = _gtk_css_value_compute (corner->y, context);
if (x == corner->x && y == corner->y)
{
_gtk_css_value_unref (x);
_gtk_css_value_unref (y);
return _gtk_css_value_ref (corner);
}
return _gtk_css_corner_value_new (x, y);
}
static gboolean
gtk_css_value_corner_equal (const GtkCssValue *corner1,
const GtkCssValue *corner2)
......@@ -78,6 +96,7 @@ gtk_css_value_corner_print (const GtkCssValue *corner,
static const GtkCssValueClass GTK_CSS_VALUE_CORNER = {
gtk_css_value_corner_free,
gtk_css_value_corner_compute,
gtk_css_value_corner_equal,
gtk_css_value_corner_transition,
gtk_css_value_corner_print
......@@ -148,23 +167,3 @@ _gtk_css_corner_value_get_y (const GtkCssValue *corner,
return _gtk_css_number_value_get (corner->y, one_hundred_percent);
}
GtkCssValue *
_gtk_css_corner_value_compute (GtkCssValue *corner,
GtkStyleContext *context)
{
GtkCssValue *x, *y;
g_return_val_if_fail (corner->class == &GTK_CSS_VALUE_CORNER, NULL);
x = _gtk_css_number_value_compute (corner->x, context);
y = _gtk_css_number_value_compute (corner->y, context);
if (x == corner->x && y == corner->y)
{
_gtk_css_value_unref (x);
_gtk_css_value_unref (y);
return _gtk_css_value_ref (corner);
}
return _gtk_css_corner_value_new (x, y);
}
......@@ -33,8 +33,6 @@ double _gtk_css_corner_value_get_x (const GtkCssValue *cor
double one_hundred_percent);
double _gtk_css_corner_value_get_y (const GtkCssValue *corner,
double one_hundred_percent);
GtkCssValue * _gtk_css_corner_value_compute (GtkCssValue *corner,
GtkStyleContext *context);
G_END_DECLS
......
......@@ -49,6 +49,13 @@ gtk_css_value_ease_free (GtkCssValue *value)
g_slice_free (GtkCssValue, value);
}
static GtkCssValue *
gtk_css_value_ease_compute (GtkCssValue *value,
GtkStyleContext *context)
{
return _gtk_css_value_ref (value);
}
static gboolean
gtk_css_value_ease_equal (const GtkCssValue *ease1,
const GtkCssValue *ease2)
......@@ -125,6 +132,7 @@ gtk_css_value_ease_print (const GtkCssValue *ease,
static const GtkCssValueClass GTK_CSS_VALUE_EASE = {
gtk_css_value_ease_free,
gtk_css_value_ease_compute,
gtk_css_value_ease_equal,
gtk_css_value_ease_transition,
gtk_css_value_ease_print
......
......@@ -34,6 +34,13 @@ gtk_css_value_engine_free (GtkCssValue *value)
g_slice_free (GtkCssValue, value);
}
static GtkCssValue *
gtk_css_value_engine_compute (GtkCssValue *value,
GtkStyleContext *context)
{
return _gtk_css_value_ref (value);
}
static gboolean
gtk_css_value_engine_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
......@@ -67,6 +74,7 @@ gtk_css_value_engine_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_ENGINE = {
gtk_css_value_engine_free,
gtk_css_value_engine_compute,
gtk_css_value_engine_equal,
gtk_css_value_engine_transition,
gtk_css_value_engine_print
......
......@@ -35,6 +35,13 @@ gtk_css_value_enum_free (GtkCssValue *value)
g_slice_free (GtkCssValue, value);
}
static GtkCssValue *
gtk_css_value_enum_compute (GtkCssValue *value,
GtkStyleContext *context)
{
return _gtk_css_value_ref (value);
}
static gboolean
gtk_css_value_enum_equal (const GtkCssValue *enum1,
const GtkCssValue *enum2)
......@@ -61,6 +68,7 @@ gtk_css_value_enum_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_BORDER_STYLE = {
gtk_css_value_enum_free,
gtk_css_value_enum_compute,
gtk_css_value_enum_equal,
gtk_css_value_enum_transition,
gtk_css_value_enum_print
......@@ -115,6 +123,7 @@ _gtk_css_border_style_value_get (const GtkCssValue *value)
static const GtkCssValueClass GTK_CSS_VALUE_FONT_STYLE = {
gtk_css_value_enum_free,
gtk_css_value_enum_compute,
gtk_css_value_enum_equal,
gtk_css_value_enum_transition,
gtk_css_value_enum_print
......@@ -162,6 +171,7 @@ _gtk_css_font_style_value_get (const GtkCssValue *value)
static const GtkCssValueClass GTK_CSS_VALUE_FONT_VARIANT = {
gtk_css_value_enum_free,
gtk_css_value_enum_compute,
gtk_css_value_enum_equal,
gtk_css_value_enum_transition,
gtk_css_value_enum_print
......@@ -208,6 +218,7 @@ _gtk_css_font_variant_value_get (const GtkCssValue *value)
static const GtkCssValueClass GTK_CSS_VALUE_FONT_WEIGHT = {
gtk_css_value_enum_free,
gtk_css_value_enum_compute,
gtk_css_value_enum_equal,
gtk_css_value_enum_transition,
gtk_css_value_enum_print
......@@ -275,6 +286,7 @@ _gtk_css_font_weight_value_get (const GtkCssValue *value)
static const GtkCssValueClass GTK_CSS_VALUE_AREA = {
gtk_css_value_enum_free,
gtk_css_value_enum_compute,
gtk_css_value_enum_equal,
gtk_css_value_enum_transition,
gtk_css_value_enum_print
......
......@@ -421,7 +421,7 @@ gtk_css_image_linear_compute (GtkCssImage *image,
copy = g_object_new (GTK_TYPE_CSS_IMAGE_LINEAR, NULL);
copy->repeating = linear->repeating;
copy->angle = _gtk_css_number_value_compute (linear->angle, context);
copy->angle = _gtk_css_value_compute (linear->angle, context);
fallback = _gtk_css_symbolic_value_new_take_symbolic_color (gtk_symbolic_color_new_literal (&transparent));
g_array_set_size (copy->stops, linear->stops->len);
......@@ -438,7 +438,7 @@ gtk_css_image_linear_compute (GtkCssImage *image,
FALSE);
if (stop->offset)
scopy->offset = _gtk_css_number_value_compute (stop->offset, context);
scopy->offset = _gtk_css_value_compute (stop->offset, context);
else
scopy->offset = NULL;
}
......
......@@ -33,6 +33,28 @@ gtk_css_value_image_free (GtkCssValue *value)
g_slice_free (GtkCssValue, value);
}
static GtkCssValue *
gtk_css_value_image_compute (GtkCssValue *value,
GtkStyleContext *context)
{
GtkCssImage *image, *computed;
image = _gtk_css_image_value_get_image (value);
if (image == NULL)
return _gtk_css_value_ref (value);
computed = _gtk_css_image_compute (image, context);
if (computed == image)
{
g_object_unref (computed);
return _gtk_css_value_ref (value);
}
return _gtk_css_image_value_new (computed);
}
static gboolean
gtk_css_value_image_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
......@@ -66,6 +88,7 @@ gtk_css_value_image_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_IMAGE = {
gtk_css_value_image_free,
gtk_css_value_image_compute,
gtk_css_value_image_equal,
gtk_css_value_image_transition,
gtk_css_value_image_print
......
......@@ -30,6 +30,14 @@ gtk_css_value_inherit_free (GtkCssValue *value)
g_assert_not_reached ();
}
static GtkCssValue *
gtk_css_value_inherit_compute (GtkCssValue *value,
GtkStyleContext *context)
{
/* This value should be caught further up */
g_return_val_if_reached (_gtk_css_value_ref (value));
}
static gboolean
gtk_css_value_inherit_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
......@@ -54,6 +62,7 @@ gtk_css_value_inherit_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_INHERIT = {
gtk_css_value_inherit_free,
gtk_css_value_inherit_compute,
gtk_css_value_inherit_equal,
gtk_css_value_inherit_transition,
gtk_css_value_inherit_print
......
......@@ -30,6 +30,14 @@ gtk_css_value_initial_free (GtkCssValue *value)
g_assert_not_reached ();
}
static GtkCssValue *
gtk_css_value_initial_compute (GtkCssValue *value,
GtkStyleContext *context)
{
/* This value should be caught further up */
g_return_val_if_reached (_gtk_css_value_ref (value));
}
static gboolean
gtk_css_value_initial_equal (const GtkCssValue *value1,
const GtkCssValue *value2)
......@@ -54,6 +62,7 @@ gtk_css_value_initial_print (const GtkCssValue *value,
static const GtkCssValueClass GTK_CSS_VALUE_INITIAL = {
gtk_css_value_initial_free,
gtk_css_value_initial_compute,
gtk_css_value_initial_equal,
gtk_css_value_initial_transition,
gtk_css_value_initial_print
......
......@@ -33,6 +33,65 @@ gtk_css_value_number_free (GtkCssValue *value)
g_slice_free (GtkCssValue, value);
}
static GtkCssValue *
gtk_css_value_number_compute (GtkCssValue *number,
GtkStyleContext *context)
{
switch (number->unit)
{
default:
g_assert_not_reached();
/* fall through */
case GTK_CSS_PERCENT:
case GTK_CSS_NUMBER:
case GTK_CSS_PX:
case GTK_CSS_DEG:
case GTK_CSS_S:
return _gtk_css_value_ref (number);
case GTK_CSS_PT:
return _gtk_css_number_value_new (number->value * 96.0 / 72.0,
GTK_CSS_PX);
case GTK_CSS_PC:
return _gtk_css_number_value_new (number->value * 96.0 / 72.0 * 12.0,
GTK_CSS_PX);
break;
case GTK_CSS_IN:
return _gtk_css_number_value_new (number->value * 96.0,
GTK_CSS_PX);
break;
case GTK_CSS_CM:
return _gtk_css_number_value_new (number->value * 96.0 * 0.39370078740157477,
GTK_CSS_PX);
break;
case GTK_CSS_MM:
return _gtk_css_number_value_new (number->value * 96.0 * 0.039370078740157477,
GTK_CSS_PX);
break;
case GTK_CSS_EM:
return _gtk_css_number_value_new (number->value *
_gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_FONT_SIZE), 100),
GTK_CSS_PX);
break;
case GTK_CSS_EX:
/* for now we pretend ex is half of em */
return _gtk_css_number_value_new (number->value * 0.5 *
_gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_FONT_SIZE), 100),
GTK_CSS_PX);
case GTK_CSS_RAD:
return _gtk_css_number_value_new (number->value * 360.0 / (2 * G_PI),
GTK_CSS_DEG);
case GTK_CSS_GRAD:
return _gtk_css_number_value_new (number->value * 360.0 / 400.0,
GTK_CSS_DEG);
case GTK_CSS_TURN:
return _gtk_css_number_value_new (number->value * 360.0,
GTK_CSS_DEG);
case GTK_CSS_MS:
return _gtk_css_number_value_new (number->value / 1000.0,
GTK_CSS_S);
}
}
static gboolean
gtk_css_value_number_equal (const GtkCssValue *number1,
const GtkCssValue *number2)
......@@ -88,6 +147,7 @@ gtk_css_value_number_print (const GtkCssValue *number,
static const GtkCssValueClass GTK_CSS_VALUE_NUMBER = {
gtk_css_value_number_free,
gtk_css_value_number_compute,
gtk_css_value_number_equal,
gtk_css_value_number_transition,
gtk_css_value_number_print
......@@ -148,64 +208,3 @@ _gtk_css_number_value_get (const GtkCssValue *number,
return number->value;
}
GtkCssValue *
_gtk_css_number_value_compute (GtkCssValue *number,
GtkStyleContext *context)
{
g_return_val_if_fail (number->class == &GTK_CSS_VALUE_NUMBER, NULL);
switch (number->unit)
{
default:
g_assert_not_reached();
/* fall through */
case GTK_CSS_PERCENT:
case GTK_CSS_NUMBER:
case GTK_CSS_PX:
case GTK_CSS_DEG:
case GTK_CSS_S:
return _gtk_css_value_ref (number);
case GTK_CSS_PT:
return _gtk_css_number_value_new (number->value * 96.0 / 72.0,
GTK_CSS_PX);
case GTK_CSS_PC:
return _gtk_css_number_value_new (number->value * 96.0 / 72.0 * 12.0,
GTK_CSS_PX);
break;
case GTK_CSS_IN:
return _gtk_css_number_value_new (number->value * 96.0,
GTK_CSS_PX);
break;
case GTK_CSS_CM:
return _gtk_css_number_value_new (number->value * 96.0 * 0.39370078740157477,
GTK_CSS_PX);
break;
case GTK_CSS_MM:
return _gtk_css_number_value_new (number->value * 96.0 * 0.039370078740157477,
GTK_CSS_PX);
break;
case GTK_CSS_EM:
return _gtk_css_number_value_new (number->value *
_gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_FONT_SIZE), 100),
GTK_CSS_PX);
break;
case GTK_CSS_EX:
/* for now we pretend ex is half of em */
return _gtk_css_number_value_new (number->value * 0.5 *
_gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_FONT_SIZE), 100),
GTK_CSS_PX);
case GTK_CSS_RAD:
return _gtk_css_number_value_new (number->value * 360.0 / (2 * G_PI),
GTK_CSS_DEG);
case GTK_CSS_GRAD:
return _gtk_css_number_value_new (number->value * 360.0 / 400.0,
GTK_CSS_DEG);
case GTK_CSS_TURN:
return _gtk_css_number_value_new (number->value * 360.0,
GTK_CSS_DEG);
case GTK_CSS_MS:
return _gtk_css_number_value_new (number->value / 1000.0,
GTK_CSS_S);
}
}
......@@ -45,8 +45,6 @@ GtkCssValue * _gtk_css_number_value_parse (GtkCssParser *par
GtkCssUnit _gtk_css_number_value_get_unit (const GtkCssValue *value);
double _gtk_css_number_value_get (const GtkCssValue *number,
double one_hundred_percent);
GtkCssValue * _gtk_css_number_value_compute (GtkCssValue *number,
GtkStyleContext *context);
G_END_DECLS
......
......@@ -36,6 +36,24 @@ gtk_css_value_position_free (GtkCssValue *value)
g_slice_free (GtkCssValue, value);
}
static GtkCssValue *
gtk_css_value_position_compute (GtkCssValue *position,
GtkStyleContext *context)
{
GtkCssValue *x, *y;
x = _gtk_css_value_compute (position->x, context);
y = _gtk_css_value_compute (position->y, context);
if (x == position->x && y == position->y)
{
_gtk_css_value_unref (x);
_gtk_css_value_unref (y);
return _gtk_css_value_ref (position);
}
return _gtk_css_position_value_new (x, y);
}
static gboolean
gtk_css_value_position_equal (const GtkCssValue *position1,
const GtkCssValue *position2)
......@@ -129,6 +147,7 @@ done:
static const GtkCssValueClass GTK_CSS_VALUE_POSITION = {
gtk_css_value_position_free,
gtk_css_value_position_compute,
gtk_css_value_position_equal,
gtk_css_value_position_transition,
gtk_css_value_position_print
......@@ -270,23 +289,3 @@ _gtk_css_position_value_get_y (const GtkCssValue *position,
return _gtk_css_number_value_get (position->y, one_hundred_percent);
}
GtkCssValue *
_gtk_css_position_value_compute (GtkCssValue *position,
GtkStyleContext *context)
{
GtkCssValue *x, *y;
g_return_val_if_fail (position->class == &GTK_CSS_VALUE_POSITION, NULL);
x = _gtk_css_number_value_compute (position->x, context);
y = _gtk_css_number_value_compute (position->y, context);
if (x == position->x && y == position->y)
{
_gtk_css_value_unref (x);
_gtk_css_value_unref (y);
return _gtk_css_value_ref (position);
}
return _gtk_css_position_value_new (x, y);
}
......@@ -33,8 +33,6 @@ double _gtk_css_position_value_get_x (const GtkCssValue *p
double one_hundred_percent);
double _gtk_css_position_value_get_y (const GtkCssValue *position,
double one_hundred_percent);
GtkCssValue * _gtk_css_position_value_compute (GtkCssValue *position,
GtkStyleContext *context);
G_END_DECLS
......
......@@ -33,6 +33,13 @@ gtk_css_value_repeat_free (GtkCssValue *value)
g_slice_free (GtkCssValue, value);
}
static GtkCssValue *
gtk_css_value_repeat_compute (GtkCssValue *value,
GtkStyleContext *context)
{
return _gtk_css_value_ref (value);
}
static gboolean
gtk_css_value_repeat_equal (const GtkCssValue *repeat1,
const GtkCssValue *repeat2)
......@@ -103,6 +110,7 @@ gtk_css_value_border_repeat_print (const GtkCssValue *repeat,
static const GtkCssValueClass GTK_CSS_VALUE_BACKGROUND_REPEAT = {
gtk_css_value_repeat_free,
gtk_css_value_repeat_compute,
gtk_css_value_repeat_equal,
gtk_css_value_repeat_transition,