make _gtk_style_property_resolve copy the result to an output value
This is preparation for allowing it to return a newly created value, rather than just copying one.
This commit is contained in:
@ -672,10 +672,7 @@ _gtk_style_properties_get_property (GtkStyleProperties *props,
|
|||||||
g_value_init (value, node->pspec->value_type);
|
g_value_init (value, node->pspec->value_type);
|
||||||
|
|
||||||
if (val)
|
if (val)
|
||||||
{
|
_gtk_style_property_resolve (node, props, state, context, val, value);
|
||||||
_gtk_style_property_resolve (node, props, state, context, val);
|
|
||||||
g_value_copy (val, value);
|
|
||||||
}
|
|
||||||
else if (_gtk_style_property_is_shorthand (node))
|
else if (_gtk_style_property_is_shorthand (node))
|
||||||
_gtk_style_property_pack (node, props, state, context, value);
|
_gtk_style_property_pack (node, props, state, context, value);
|
||||||
else
|
else
|
||||||
|
@ -2519,19 +2519,20 @@ _gtk_style_property_resolve (const GtkStyleProperty *property,
|
|||||||
GtkStyleProperties *props,
|
GtkStyleProperties *props,
|
||||||
GtkStateFlags state,
|
GtkStateFlags state,
|
||||||
GtkStylePropertyContext *context,
|
GtkStylePropertyContext *context,
|
||||||
GValue *val)
|
GValue *val,
|
||||||
|
GValue *val_out)
|
||||||
{
|
{
|
||||||
if (G_VALUE_TYPE (val) == GTK_TYPE_SYMBOLIC_COLOR)
|
if (G_VALUE_TYPE (val) == GTK_TYPE_SYMBOLIC_COLOR)
|
||||||
{
|
{
|
||||||
if (property->pspec->value_type == GDK_TYPE_RGBA)
|
if (property->pspec->value_type == GDK_TYPE_RGBA)
|
||||||
{
|
{
|
||||||
if (resolve_color (props, val))
|
if (resolve_color (props, val))
|
||||||
return;
|
goto out;
|
||||||
}
|
}
|
||||||
else if (property->pspec->value_type == GDK_TYPE_COLOR)
|
else if (property->pspec->value_type == GDK_TYPE_COLOR)
|
||||||
{
|
{
|
||||||
if (resolve_color_rgb (props, val))
|
if (resolve_color_rgb (props, val))
|
||||||
return;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_value_unset (val);
|
g_value_unset (val);
|
||||||
@ -2559,6 +2560,9 @@ _gtk_style_property_resolve (const GtkStyleProperty *property,
|
|||||||
if (!resolve_shadow (props, val))
|
if (!resolve_shadow (props, val))
|
||||||
_gtk_style_property_default_value (property, props, state, val);
|
_gtk_style_property_default_value (property, props, state, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
g_value_copy (val, val_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -85,7 +85,8 @@ void _gtk_style_property_resolve (const GtkStyleProper
|
|||||||
GtkStyleProperties *properties,
|
GtkStyleProperties *properties,
|
||||||
GtkStateFlags state,
|
GtkStateFlags state,
|
||||||
GtkStylePropertyContext *context,
|
GtkStylePropertyContext *context,
|
||||||
GValue *orig_value);
|
GValue *orig_value,
|
||||||
|
GValue *out_value);
|
||||||
|
|
||||||
gboolean _gtk_style_property_is_shorthand (const GtkStyleProperty *property);
|
gboolean _gtk_style_property_is_shorthand (const GtkStyleProperty *property);
|
||||||
GParameter * _gtk_style_property_unpack (const GtkStyleProperty *property,
|
GParameter * _gtk_style_property_unpack (const GtkStyleProperty *property,
|
||||||
|
Reference in New Issue
Block a user