shorthand: Remove old parse func support

It's not used anymore
This commit is contained in:
Benjamin Otte 2012-01-02 09:22:35 +01:00
parent 069cb74691
commit 47a27a00f5
2 changed files with 9 additions and 73 deletions

View File

@ -180,64 +180,10 @@ _gtk_css_shorthand_property_class_init (GtkCssShorthandPropertyClass *klass)
property_class->parse_value = gtk_css_shorthand_property_parse_value;
}
/* XXX: This function is compat only, don't read it */
static gboolean
gtk_css_shorthand_property_parse (GtkCssShorthandProperty *shorthand,
GValue *values,
GtkCssParser *parser,
GFile *base)
{
GtkStyleProperty *property = GTK_STYLE_PROPERTY (shorthand);
GParameter *parameters;
guint i, j, n_parameters;
GValue val = G_VALUE_INIT;
g_value_init (&val, _gtk_style_property_get_value_type (property));
if (property->parse_func)
{
if (!(* property->parse_func) (parser, base, &val))
{
g_value_unset (&val);
return FALSE;
}
}
else if (!_gtk_css_style_parse_value (&val, parser, base))
{
g_value_unset (&val);
return FALSE;
}
parameters = property->unpack_func (&val, &n_parameters);
g_value_unset (&val);
for (i = 0; i < shorthand->subproperties->len; i++)
{
for (j = 0; j < n_parameters; j++)
{
if (GTK_STYLE_PROPERTY (_gtk_css_shorthand_property_get_subproperty (shorthand, i))
== _gtk_style_property_lookup (parameters[j].name))
{
g_value_init (&values[i], G_VALUE_TYPE (&parameters[j].value));
g_value_copy (&parameters[j].value, &values[i]);
g_value_unset (&parameters[j].value);
break;
}
}
g_assert (j < n_parameters);
}
g_free (parameters);
return TRUE;
}
static void
_gtk_css_shorthand_property_init (GtkCssShorthandProperty *shorthand)
{
shorthand->subproperties = g_ptr_array_new_with_free_func (g_object_unref);
shorthand->parse = gtk_css_shorthand_property_parse;
}
GtkCssStyleProperty *

View File

@ -609,8 +609,7 @@ _gtk_css_shorthand_property_register (const char *name,
const char **subproperties,
GtkCssShorthandPropertyParseFunc parse_func,
GtkStyleUnpackFunc unpack_func,
GtkStylePackFunc pack_func,
GtkStyleParseFunc old_parse_func)
GtkStylePackFunc pack_func)
{
GtkStyleProperty *node;
@ -623,11 +622,9 @@ _gtk_css_shorthand_property_register (const char *name,
"subproperties", subproperties,
NULL);
if (parse_func)
GTK_CSS_SHORTHAND_PROPERTY (node)->parse = parse_func;
node->pack_func = pack_func;
node->unpack_func = unpack_func;
node->parse_func = old_parse_func;
}
void
@ -648,48 +645,41 @@ _gtk_css_shorthand_property_init_properties (void)
font_subproperties,
parse_font,
unpack_font_description,
pack_font_description,
NULL);
pack_font_description);
_gtk_css_shorthand_property_register ("margin",
GTK_TYPE_BORDER,
margin_subproperties,
parse_border,
unpack_margin,
pack_margin,
NULL);
pack_margin);
_gtk_css_shorthand_property_register ("padding",
GTK_TYPE_BORDER,
padding_subproperties,
parse_border,
unpack_padding,
pack_padding,
NULL);
pack_padding);
_gtk_css_shorthand_property_register ("border-width",
GTK_TYPE_BORDER,
border_width_subproperties,
parse_border,
unpack_border_width,
pack_border_width,
NULL);
pack_border_width);
_gtk_css_shorthand_property_register ("border-radius",
G_TYPE_INT,
border_radius_subproperties,
parse_border_radius,
unpack_border_radius,
pack_border_radius,
NULL);
pack_border_radius);
_gtk_css_shorthand_property_register ("border-color",
GDK_TYPE_RGBA,
border_color_subproperties,
parse_border_color,
unpack_border_color,
pack_border_color,
NULL);
pack_border_color);
_gtk_css_shorthand_property_register ("border-image",
GTK_TYPE_BORDER_IMAGE,
border_image_subproperties,
parse_border_image,
_gtk_border_image_unpack,
_gtk_border_image_pack,
NULL);
_gtk_border_image_pack);
}