Commit 3e24b5db authored by Benjamin Otte's avatar Benjamin Otte

styleproperty: Add _gtk_style_property_query()

This way, we only need to export one function, not 3.
parent 2573e72f
......@@ -744,7 +744,6 @@ _gtk_style_properties_get_property (GtkStyleProperties *props,
GValue *value)
{
const GtkStyleProperty *node;
const GValue *val;
g_return_val_if_fail (GTK_IS_STYLE_PROPERTIES (props), FALSE);
g_return_val_if_fail (property != NULL, FALSE);
......@@ -757,16 +756,7 @@ _gtk_style_properties_get_property (GtkStyleProperties *props,
return FALSE;
}
val = _gtk_style_properties_peek_property (props, node, state);
g_value_init (value, node->pspec->value_type);
if (val)
_gtk_style_property_resolve (node, props, state, context, (GValue *) val, value);
else if (_gtk_style_property_is_shorthand (node))
_gtk_style_property_pack (node, props, state, context, value);
else
_gtk_style_property_default_value (node, props, state, value);
_gtk_style_property_query (node, props, state, context, value);
return TRUE;
}
......
......@@ -33,6 +33,7 @@
#include "gtkcssparserprivate.h"
#include "gtkcsstypesprivate.h"
#include "gtkprivatetypebuiltins.h"
#include "gtkstylepropertiesprivate.h"
/* the actual parsers we have */
#include "gtkanimationdescription.h"
......@@ -2440,7 +2441,7 @@ _gtk_style_property_print_value (const GtkStyleProperty *property,
func (value, string);
}
void
static void
_gtk_style_property_default_value (const GtkStyleProperty *property,
GtkStyleProperties *properties,
GtkStateFlags state,
......@@ -2565,7 +2566,7 @@ resolve_shadow (GtkStyleProperties *props,
return TRUE;
}
void
static void
_gtk_style_property_resolve (const GtkStyleProperty *property,
GtkStyleProperties *props,
GtkStateFlags state,
......@@ -2668,7 +2669,7 @@ _gtk_style_property_unpack (const GtkStyleProperty *property,
return property->unpack_func (value, n_params);
}
void
static void
_gtk_style_property_pack (const GtkStyleProperty *property,
GtkStyleProperties *props,
GtkStateFlags state,
......@@ -2683,6 +2684,31 @@ _gtk_style_property_pack (const GtkStyleProperty *property,
property->pack_func (value, props, state, context);
}
void
_gtk_style_property_query (const GtkStyleProperty *property,
GtkStyleProperties *props,
GtkStateFlags state,
GtkStylePropertyContext *context,
GValue *value)
{
const GValue *val;
g_return_if_fail (property != NULL);
g_return_if_fail (GTK_IS_STYLE_PROPERTIES (props));
g_return_if_fail (context != NULL);
g_return_if_fail (value != NULL);
val = _gtk_style_properties_peek_property (props, property, state);
g_value_init (value, property->pspec->value_type);
if (val)
_gtk_style_property_resolve (property, props, state, context, (GValue *) val, value);
else if (_gtk_style_property_is_shorthand (property))
_gtk_style_property_pack (property, props, state, context, value);
else
_gtk_style_property_default_value (property, props, state, value);
}
#define rgba_init(rgba, r, g, b, a) G_STMT_START{ \
(rgba)->red = (r); \
(rgba)->green = (g); \
......
......@@ -78,29 +78,13 @@ void _gtk_style_property_register (GParamSpec
gboolean _gtk_style_property_is_inherit (const GtkStyleProperty *property);
guint _gtk_style_property_get_id (const GtkStyleProperty *property);
void _gtk_style_property_default_value (const GtkStyleProperty *property,
GtkStyleProperties *properties,
GtkStateFlags state,
GValue *value);
const GValue * _gtk_style_property_get_initial_value
(const GtkStyleProperty *property);
void _gtk_style_property_resolve (const GtkStyleProperty *property,
GtkStyleProperties *properties,
GtkStateFlags state,
GtkStylePropertyContext *context,
GValue *orig_value,
GValue *out_value);
gboolean _gtk_style_property_is_shorthand (const GtkStyleProperty *property);
GParameter * _gtk_style_property_unpack (const GtkStyleProperty *property,
const GValue *value,
guint *n_params);
void _gtk_style_property_pack (const GtkStyleProperty *property,
GtkStyleProperties *props,
GtkStateFlags state,
GtkStylePropertyContext *context,
GValue *value);
gboolean _gtk_style_property_parse_value (const GtkStyleProperty *property,
GValue *value,
......@@ -110,6 +94,12 @@ void _gtk_style_property_print_value (const GtkStyleProper
const GValue *value,
GString *string);
void _gtk_style_property_query (const GtkStyleProperty *property,
GtkStyleProperties *props,
GtkStateFlags state,
GtkStylePropertyContext *context,
GValue *value);
G_END_DECLS
#endif /* __GTK_CSS_STYLEPROPERTY_PRIVATE_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment