[gtk/wip/otte/css: 2/2] styleproperty: Remove ability to query properties
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/css: 2/2] styleproperty: Remove ability to query properties
- Date: Tue, 28 Jan 2020 01:59:24 +0000 (UTC)
commit 5e4b102273b9e085fba9be5923f4c0f14d68223b
Author: Benjamin Otte <otte redhat com>
Date: Tue Jan 28 00:46:43 2020 +0100
styleproperty: Remove ability to query properties
With gtk_style_context_get() gone, this is no longer used.
gtk/gtkcssshorthandproperty.c | 12 --
gtk/gtkcssshorthandpropertyimpl.c | 307 ++++++++---------------------------
gtk/gtkcssshorthandpropertyprivate.h | 5 -
gtk/gtkcssstyleproperty.c | 17 --
gtk/gtkcssstylepropertyimpl.c | 305 ----------------------------------
gtk/gtkstyleproperty.c | 64 +-------
gtk/gtkstylepropertyprivate.h | 11 --
7 files changed, 67 insertions(+), 654 deletions(-)
---
diff --git a/gtk/gtkcssshorthandproperty.c b/gtk/gtkcssshorthandproperty.c
index 486a44b3cc..c33bbe449f 100644
--- a/gtk/gtkcssshorthandproperty.c
+++ b/gtk/gtkcssshorthandproperty.c
@@ -62,17 +62,6 @@ gtk_css_shorthand_property_set_property (GObject *object,
}
}
-static void
-_gtk_css_shorthand_property_query (GtkStyleProperty *property,
- GValue *value,
- GtkStyleQueryFunc query_func,
- gpointer query_data)
-{
- GtkCssShorthandProperty *shorthand = GTK_CSS_SHORTHAND_PROPERTY (property);
-
- shorthand->query (shorthand, value, query_func, query_data);
-}
-
static GtkCssValue *
gtk_css_shorthand_property_parse_value (GtkStyleProperty *property,
GtkCssParser *parser)
@@ -160,7 +149,6 @@ _gtk_css_shorthand_property_class_init (GtkCssShorthandPropertyClass *klass)
G_TYPE_STRV,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
- property_class->query = _gtk_css_shorthand_property_query;
property_class->parse_value = gtk_css_shorthand_property_parse_value;
}
diff --git a/gtk/gtkcssshorthandpropertyimpl.c b/gtk/gtkcssshorthandpropertyimpl.c
index 6ae99f01a0..2b524d5256 100644
--- a/gtk/gtkcssshorthandpropertyimpl.c
+++ b/gtk/gtkcssshorthandpropertyimpl.c
@@ -1076,152 +1076,19 @@ parse_all (GtkCssShorthandProperty *shorthand,
return FALSE;
}
-/*** PACKING ***/
-
-static void
-pack_border (GtkCssShorthandProperty *shorthand,
- GValue *value,
- GtkStyleQueryFunc query_func,
- gpointer query_data)
-{
- GtkCssStyleProperty *prop;
- GtkBorder border;
- GValue v;
-
- prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 0);
- _gtk_style_property_query (GTK_STYLE_PROPERTY (prop), &v, query_func, query_data);
- border.top = g_value_get_int (&v);
- g_value_unset (&v);
-
- prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 1);
- _gtk_style_property_query (GTK_STYLE_PROPERTY (prop), &v, query_func, query_data);
- border.right = g_value_get_int (&v);
- g_value_unset (&v);
-
- prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 2);
- _gtk_style_property_query (GTK_STYLE_PROPERTY (prop), &v, query_func, query_data);
- border.bottom = g_value_get_int (&v);
- g_value_unset (&v);
-
- prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 3);
- _gtk_style_property_query (GTK_STYLE_PROPERTY (prop), &v, query_func, query_data);
- border.left = g_value_get_int (&v);
- g_value_unset (&v);
-
- g_value_init (value, GTK_TYPE_BORDER);
- g_value_set_boxed (value, &border);
-}
-
-static void
-pack_border_radius (GtkCssShorthandProperty *shorthand,
- GValue *value,
- GtkStyleQueryFunc query_func,
- gpointer query_data)
-{
- GtkCssValue *v;
- int i = 0;
-
- v = (* query_func) (GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS, query_data);
- if (v)
- i = _gtk_css_corner_value_get_x (v, 100);
-
- g_value_init (value, G_TYPE_INT);
- g_value_set_int (value, i);
-}
-
-static void
-pack_font_description (GtkCssShorthandProperty *shorthand,
- GValue *value,
- GtkStyleQueryFunc query_func,
- gpointer query_data)
-{
- PangoFontDescription *description;
- GtkCssValue *v;
-
- description = pango_font_description_new ();
-
- v = (* query_func) (GTK_CSS_PROPERTY_FONT_FAMILY, query_data);
- if (v)
- {
- if (_gtk_css_array_value_get_n_values (v) > 1)
- {
- int i;
- GString *s = g_string_new ("");
-
- for (i = 0; i < _gtk_css_array_value_get_n_values (v); i++)
- {
- if (i > 0)
- g_string_append (s, ",");
- g_string_append (s, _gtk_css_string_value_get (_gtk_css_array_value_get_nth (v, i)));
- }
-
- pango_font_description_set_family (description, s->str);
- g_string_free (s, TRUE);
- }
- else
- {
- pango_font_description_set_family (description,
- _gtk_css_string_value_get (_gtk_css_array_value_get_nth (v,
0)));
- }
- }
-
- v = (* query_func) (GTK_CSS_PROPERTY_FONT_SIZE, query_data);
- if (v)
- pango_font_description_set_absolute_size (description, round (_gtk_css_number_value_get (v, 100) *
PANGO_SCALE));
-
- v = (* query_func) (GTK_CSS_PROPERTY_FONT_STYLE, query_data);
- if (v)
- pango_font_description_set_style (description, _gtk_css_font_style_value_get (v));
-
- v = (* query_func) (GTK_CSS_PROPERTY_FONT_WEIGHT, query_data);
- if (v)
- pango_font_description_set_weight (description, _gtk_css_number_value_get (v, 100));
-
- v = (* query_func) (GTK_CSS_PROPERTY_FONT_STRETCH, query_data);
- if (v)
- pango_font_description_set_stretch (description, _gtk_css_font_stretch_value_get (v));
-
- g_value_init (value, PANGO_TYPE_FONT_DESCRIPTION);
- g_value_take_boxed (value, description);
-}
-
-static void
-pack_first_element (GtkCssShorthandProperty *shorthand,
- GValue *value,
- GtkStyleQueryFunc query_func,
- gpointer query_data)
-{
- GtkCssStyleProperty *prop;
-
- /* NB: This is a fallback for properties that originally were
- * not used as shorthand. We just pick the first subproperty
- * as a representative.
- * Lesson learned: Don't query the shorthand, query the
- * real properties instead. */
- prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 0);
- _gtk_style_property_query (GTK_STYLE_PROPERTY (prop),
- value,
- query_func,
- query_data);
-}
-
static void
-_gtk_css_shorthand_property_register (const char *name,
- GType value_type,
- const char **subproperties,
- GtkCssShorthandPropertyParseFunc parse_func,
- GtkCssShorthandPropertyQueryFunc query_func)
+gtk_css_shorthand_property_register (const char *name,
+ const char **subproperties,
+ GtkCssShorthandPropertyParseFunc parse_func)
{
GtkCssShorthandProperty *node;
node = g_object_new (GTK_TYPE_CSS_SHORTHAND_PROPERTY,
"name", name,
- "value-type", value_type,
"subproperties", subproperties,
NULL);
node->parse = parse_func;
- node->query = query_func;
}
/* NB: return value is transfer: container */
@@ -1277,112 +1144,70 @@ _gtk_css_shorthand_property_init_properties (void)
const char **all_subproperties;
- _gtk_css_shorthand_property_register ("font",
- PANGO_TYPE_FONT_DESCRIPTION,
- font_subproperties,
- parse_font,
- pack_font_description);
- _gtk_css_shorthand_property_register ("margin",
- GTK_TYPE_BORDER,
- margin_subproperties,
- parse_margin,
- pack_border);
- _gtk_css_shorthand_property_register ("padding",
- GTK_TYPE_BORDER,
- padding_subproperties,
- parse_padding,
- pack_border);
- _gtk_css_shorthand_property_register ("border-width",
- GTK_TYPE_BORDER,
- border_width_subproperties,
- parse_border_width,
- pack_border);
- _gtk_css_shorthand_property_register ("border-radius",
- G_TYPE_INT,
- border_radius_subproperties,
- parse_border_radius,
- pack_border_radius);
- _gtk_css_shorthand_property_register ("border-color",
- GDK_TYPE_RGBA,
- border_color_subproperties,
- parse_border_color,
- pack_first_element);
- _gtk_css_shorthand_property_register ("border-style",
- GTK_TYPE_BORDER_STYLE,
- border_style_subproperties,
- parse_border_style,
- pack_first_element);
- _gtk_css_shorthand_property_register ("border-image",
- G_TYPE_NONE,
- border_image_subproperties,
- parse_border_image,
- NULL);
- _gtk_css_shorthand_property_register ("border-top",
- G_TYPE_NONE,
- border_top_subproperties,
- parse_border_side,
- NULL);
- _gtk_css_shorthand_property_register ("border-right",
- G_TYPE_NONE,
- border_right_subproperties,
- parse_border_side,
- NULL);
- _gtk_css_shorthand_property_register ("border-bottom",
- G_TYPE_NONE,
- border_bottom_subproperties,
- parse_border_side,
- NULL);
- _gtk_css_shorthand_property_register ("border-left",
- G_TYPE_NONE,
- border_left_subproperties,
- parse_border_side,
- NULL);
- _gtk_css_shorthand_property_register ("border",
- G_TYPE_NONE,
- border_subproperties,
- parse_border,
- NULL);
- _gtk_css_shorthand_property_register ("-gtk-outline-radius",
- G_TYPE_INT,
- outline_radius_subproperties,
- parse_border_radius,
- pack_border_radius);
- _gtk_css_shorthand_property_register ("outline",
- G_TYPE_NONE,
- outline_subproperties,
- parse_border_side,
- NULL);
- _gtk_css_shorthand_property_register ("background",
- G_TYPE_NONE,
- background_subproperties,
- parse_background,
- NULL);
- _gtk_css_shorthand_property_register ("transition",
- G_TYPE_NONE,
- transition_subproperties,
- parse_transition,
- NULL);
- _gtk_css_shorthand_property_register ("animation",
- G_TYPE_NONE,
- animation_subproperties,
- parse_animation,
- NULL);
- _gtk_css_shorthand_property_register ("text-decoration",
- G_TYPE_NONE,
- text_decoration_subproperties,
- parse_text_decoration,
- NULL);
- _gtk_css_shorthand_property_register ("font-variant",
- G_TYPE_NONE,
- font_variant_subproperties,
- parse_font_variant,
- NULL);
+ gtk_css_shorthand_property_register ("font",
+ font_subproperties,
+ parse_font);
+ gtk_css_shorthand_property_register ("margin",
+ margin_subproperties,
+ parse_margin);
+ gtk_css_shorthand_property_register ("padding",
+ padding_subproperties,
+ parse_padding);
+ gtk_css_shorthand_property_register ("border-width",
+ border_width_subproperties,
+ parse_border_width);
+ gtk_css_shorthand_property_register ("border-radius",
+ border_radius_subproperties,
+ parse_border_radius);
+ gtk_css_shorthand_property_register ("border-color",
+ border_color_subproperties,
+ parse_border_color);
+ gtk_css_shorthand_property_register ("border-style",
+ border_style_subproperties,
+ parse_border_style);
+ gtk_css_shorthand_property_register ("border-image",
+ border_image_subproperties,
+ parse_border_image);
+ gtk_css_shorthand_property_register ("border-top",
+ border_top_subproperties,
+ parse_border_side);
+ gtk_css_shorthand_property_register ("border-right",
+ border_right_subproperties,
+ parse_border_side);
+ gtk_css_shorthand_property_register ("border-bottom",
+ border_bottom_subproperties,
+ parse_border_side);
+ gtk_css_shorthand_property_register ("border-left",
+ border_left_subproperties,
+ parse_border_side);
+ gtk_css_shorthand_property_register ("border",
+ border_subproperties,
+ parse_border);
+ gtk_css_shorthand_property_register ("-gtk-outline-radius",
+ outline_radius_subproperties,
+ parse_border_radius);
+ gtk_css_shorthand_property_register ("outline",
+ outline_subproperties,
+ parse_border_side);
+ gtk_css_shorthand_property_register ("background",
+ background_subproperties,
+ parse_background);
+ gtk_css_shorthand_property_register ("transition",
+ transition_subproperties,
+ parse_transition);
+ gtk_css_shorthand_property_register ("animation",
+ animation_subproperties,
+ parse_animation);
+ gtk_css_shorthand_property_register ("text-decoration",
+ text_decoration_subproperties,
+ parse_text_decoration);
+ gtk_css_shorthand_property_register ("font-variant",
+ font_variant_subproperties,
+ parse_font_variant);
all_subproperties = get_all_subproperties ();
- _gtk_css_shorthand_property_register ("all",
- G_TYPE_NONE,
- all_subproperties,
- parse_all,
- NULL);
+ gtk_css_shorthand_property_register ("all",
+ all_subproperties,
+ parse_all);
g_free (all_subproperties);
}
diff --git a/gtk/gtkcssshorthandpropertyprivate.h b/gtk/gtkcssshorthandpropertyprivate.h
index 89a70140ae..52b8a470a9 100644
--- a/gtk/gtkcssshorthandpropertyprivate.h
+++ b/gtk/gtkcssshorthandpropertyprivate.h
@@ -41,10 +41,6 @@ typedef struct _GtkCssShorthandPropertyClass GtkCssShorthandPropertyClass;
typedef gboolean (* GtkCssShorthandPropertyParseFunc) (GtkCssShorthandProperty *shorthand,
GtkCssValue **values,
GtkCssParser *parser);
-typedef void (* GtkCssShorthandPropertyQueryFunc) (GtkCssShorthandProperty *shorthand,
- GValue *value,
- GtkStyleQueryFunc query_func,
- gpointer
query_data);
struct _GtkCssShorthandProperty
{
@@ -53,7 +49,6 @@ struct _GtkCssShorthandProperty
GPtrArray *subproperties;
GtkCssShorthandPropertyParseFunc parse;
- GtkCssShorthandPropertyQueryFunc query;
};
struct _GtkCssShorthandPropertyClass
diff --git a/gtk/gtkcssstyleproperty.c b/gtk/gtkcssstyleproperty.c
index 7a7b77c084..473ba206f7 100644
--- a/gtk/gtkcssstyleproperty.c
+++ b/gtk/gtkcssstyleproperty.c
@@ -120,22 +120,6 @@ gtk_css_style_property_get_property (GObject *object,
}
}
-static void
-_gtk_css_style_property_query (GtkStyleProperty *property,
- GValue *value,
- GtkStyleQueryFunc query_func,
- gpointer query_data)
-{
- GtkCssStyleProperty *style_property = GTK_CSS_STYLE_PROPERTY (property);
- GtkCssValue *css_value;
-
- css_value = (* query_func) (GTK_CSS_STYLE_PROPERTY (property)->id, query_data);
- if (css_value == NULL)
- css_value =_gtk_css_style_property_get_initial_value (style_property);
-
- style_property->query_value (style_property, css_value, value);
-}
-
static GtkCssValue *
gtk_css_style_property_parse_value (GtkStyleProperty *property,
GtkCssParser *parser)
@@ -218,7 +202,6 @@ _gtk_css_style_property_class_init (GtkCssStylePropertyClass *klass)
GTK_TYPE_CSS_VALUE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
- property_class->query = _gtk_css_style_property_query;
property_class->parse_value = gtk_css_style_property_parse_value;
klass->style_properties = g_ptr_array_new ();
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index ce076944d5..27bada82a8 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -69,21 +69,17 @@ typedef enum {
static void
gtk_css_style_property_register (const char * name,
guint expected_id,
- GType value_type,
GtkStylePropertyFlags flags,
GtkCssAffects affects,
GtkCssStylePropertyParseFunc parse_value,
- GtkCssStylePropertyQueryFunc query_value,
GtkCssValue * initial_value)
{
GtkCssStyleProperty *node;
g_assert (initial_value != NULL);
g_assert (parse_value != NULL);
- g_assert (value_type == G_TYPE_NONE || query_value != NULL);
node = g_object_new (GTK_TYPE_CSS_STYLE_PROPERTY,
- "value-type", value_type,
"affects", affects,
"animated", (flags & GTK_STYLE_PROPERTY_ANIMATED) ? TRUE : FALSE,
"inherit", (flags & GTK_STYLE_PROPERTY_INHERIT) ? TRUE : FALSE,
@@ -92,7 +88,6 @@ gtk_css_style_property_register (const char * name,
NULL);
node->parse_value = parse_value;
- node->query_value = query_value;
_gtk_css_value_unref (initial_value);
@@ -101,41 +96,6 @@ gtk_css_style_property_register (const char * name,
/*** IMPLEMENTATIONS ***/
-static void
-query_length_as_int (GtkCssStyleProperty *property,
- GtkCssValue *css_value,
- GValue *value)
-{
- g_value_init (value, G_TYPE_INT);
- g_value_set_int (value, round (_gtk_css_number_value_get (css_value, 100)));
-}
-
-static void
-query_font_size (GtkCssStyleProperty *property,
- GtkCssValue *css_value,
- GValue *value)
-{
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, _gtk_css_number_value_get (css_value, 100));
-}
-
-static void
-query_border (GtkCssStyleProperty *property,
- GtkCssValue *css_value,
- GValue *value)
-{
- GtkBorder border;
-
- g_value_init (value, GTK_TYPE_BORDER);
-
- border.top = round (_gtk_css_number_value_get (_gtk_css_border_value_get_top (css_value), 100));
- border.right = round (_gtk_css_number_value_get (_gtk_css_border_value_get_right (css_value), 100));
- border.bottom = round (_gtk_css_number_value_get (_gtk_css_border_value_get_bottom (css_value), 100));
- border.left = round (_gtk_css_number_value_get (_gtk_css_border_value_get_left (css_value), 100));
-
- g_value_set_boxed (value, &border);
-}
-
static GtkCssValue *
color_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
@@ -143,15 +103,6 @@ color_parse (GtkCssStyleProperty *property,
return _gtk_css_color_value_parse (parser);
}
-static void
-color_query (GtkCssStyleProperty *property,
- GtkCssValue *css_value,
- GValue *value)
-{
- g_value_init (value, GDK_TYPE_RGBA);
- g_value_set_boxed (value, gtk_css_color_value_get_rgba (css_value));
-}
-
static GtkCssValue *
font_family_parse_one (GtkCssParser *parser)
{
@@ -196,28 +147,6 @@ font_family_parse (GtkCssStyleProperty *property,
return gtk_css_font_family_value_parse (parser);
}
-static void
-font_family_query (GtkCssStyleProperty *property,
- GtkCssValue *css_value,
- GValue *value)
-{
- GPtrArray *array;
- guint i;
-
- array = g_ptr_array_new ();
-
- for (i = 0; i < _gtk_css_array_value_get_n_values (css_value); i++)
- {
- g_ptr_array_add (array, g_strdup (_gtk_css_string_value_get (_gtk_css_array_value_get_nth (css_value,
i))));
- }
-
- /* NULL-terminate */
- g_ptr_array_add (array, NULL);
-
- g_value_init (value, G_TYPE_STRV);
- g_value_set_boxed (value, g_ptr_array_free (array, FALSE));
-}
-
static GtkCssValue *
font_style_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
@@ -230,15 +159,6 @@ font_style_parse (GtkCssStyleProperty *property,
return value;
}
-static void
-font_style_query (GtkCssStyleProperty *property,
- GtkCssValue *css_value,
- GValue *value)
-{
- g_value_init (value, PANGO_TYPE_STYLE);
- g_value_set_enum (value, _gtk_css_font_style_value_get (css_value));
-}
-
static GtkCssValue *
font_weight_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
@@ -263,15 +183,6 @@ font_weight_parse (GtkCssStyleProperty *property,
return value;
}
-static void
-font_weight_query (GtkCssStyleProperty *property,
- GtkCssValue *css_value,
- GValue *value)
-{
- g_value_init (value, PANGO_TYPE_WEIGHT);
- g_value_set_enum (value, _gtk_css_number_value_get (css_value, 100));
-}
-
static GtkCssValue *
font_stretch_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
@@ -284,15 +195,6 @@ font_stretch_parse (GtkCssStyleProperty *property,
return value;
}
-static void
-font_stretch_query (GtkCssStyleProperty *property,
- GtkCssValue *css_value,
- GValue *value)
-{
- g_value_init (value, PANGO_TYPE_STRETCH);
- g_value_set_enum (value, _gtk_css_font_stretch_value_get (css_value));
-}
-
static GtkCssValue *
parse_border_style (GtkCssStyleProperty *property,
GtkCssParser *parser)
@@ -305,15 +207,6 @@ parse_border_style (GtkCssStyleProperty *property,
return value;
}
-static void
-query_border_style (GtkCssStyleProperty *property,
- GtkCssValue *css_value,
- GValue *value)
-{
- g_value_init (value, GTK_TYPE_BORDER_STYLE);
- g_value_set_enum (value, _gtk_css_border_style_value_get (css_value));
-}
-
static GtkCssValue *
parse_css_area_one (GtkCssParser *parser)
{
@@ -357,16 +250,6 @@ opacity_parse (GtkCssStyleProperty *property,
return _gtk_css_number_value_parse (parser, GTK_CSS_PARSE_NUMBER);
}
-static void
-opacity_query (GtkCssStyleProperty *property,
- GtkCssValue *css_value,
- GValue *value)
-{
- g_value_init (value, G_TYPE_DOUBLE);
- g_value_set_double (value, _gtk_css_number_value_get (css_value, 100));
-}
-
-
static GtkCssValue *
parse_one_css_play_state (GtkCssParser *parser)
{
@@ -933,43 +816,33 @@ _gtk_css_style_property_init_properties (void)
* sizes in em can be looked up properly */
gtk_css_style_property_register ("color",
GTK_CSS_PROPERTY_COLOR,
- GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_CONTENT | GTK_CSS_AFFECTS_ICON_REDRAW_SYMBOLIC,
color_parse,
- color_query,
gtk_css_color_value_new_white ());
gtk_css_style_property_register ("-gtk-dpi",
GTK_CSS_PROPERTY_DPI,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_TEXT_SIZE,
dpi_parse,
- NULL,
_gtk_css_number_value_new (96.0, GTK_CSS_NUMBER));
gtk_css_style_property_register ("font-size",
GTK_CSS_PROPERTY_FONT_SIZE,
- G_TYPE_DOUBLE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_TEXT_SIZE,
font_size_parse,
- query_font_size,
_gtk_css_font_size_value_new (GTK_CSS_FONT_SIZE_MEDIUM));
gtk_css_style_property_register ("-gtk-icon-theme",
GTK_CSS_PROPERTY_ICON_THEME,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_ICON_TEXTURE,
icon_theme_value_parse,
- NULL,
gtk_css_icon_theme_value_new (NULL));
gtk_css_style_property_register ("-gtk-icon-palette",
GTK_CSS_PROPERTY_ICON_PALETTE,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_ICON_REDRAW_SYMBOLIC,
icon_palette_parse,
- NULL,
gtk_css_palette_value_new_default ());
@@ -977,514 +850,392 @@ _gtk_css_style_property_init_properties (void)
* start here */
gtk_css_style_property_register ("background-color",
GTK_CSS_PROPERTY_BACKGROUND_COLOR,
- GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND,
color_parse,
- color_query,
gtk_css_color_value_new_transparent ());
gtk_css_style_property_register ("font-family",
GTK_CSS_PROPERTY_FONT_FAMILY,
- G_TYPE_STRV,
GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_TEXT_SIZE,
font_family_parse,
- font_family_query,
_gtk_css_string_value_new ("Sans"));
gtk_css_style_property_register ("font-style",
GTK_CSS_PROPERTY_FONT_STYLE,
- PANGO_TYPE_STYLE,
GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_TEXT_SIZE,
font_style_parse,
- font_style_query,
_gtk_css_font_style_value_new (PANGO_STYLE_NORMAL));
gtk_css_style_property_register ("font-weight",
GTK_CSS_PROPERTY_FONT_WEIGHT,
- PANGO_TYPE_WEIGHT,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_TEXT_SIZE,
font_weight_parse,
- font_weight_query,
_gtk_css_number_value_new (PANGO_WEIGHT_NORMAL, GTK_CSS_NUMBER));
gtk_css_style_property_register ("font-stretch",
GTK_CSS_PROPERTY_FONT_STRETCH,
- PANGO_TYPE_STRETCH,
GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_TEXT_SIZE,
font_stretch_parse,
- font_stretch_query,
_gtk_css_font_stretch_value_new (PANGO_STRETCH_NORMAL));
gtk_css_style_property_register ("letter-spacing",
GTK_CSS_PROPERTY_LETTER_SPACING,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_TEXT_ATTRS | GTK_CSS_AFFECTS_TEXT_SIZE,
parse_letter_spacing,
- NULL,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("text-decoration-line",
GTK_CSS_PROPERTY_TEXT_DECORATION_LINE,
- G_TYPE_NONE,
0,
GTK_CSS_AFFECTS_TEXT_ATTRS,
parse_text_decoration_line,
- NULL,
_gtk_css_text_decoration_line_value_new
(GTK_CSS_TEXT_DECORATION_LINE_NONE));
gtk_css_style_property_register ("text-decoration-color",
GTK_CSS_PROPERTY_TEXT_DECORATION_COLOR,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_TEXT_ATTRS,
color_parse,
- NULL,
_gtk_css_color_value_new_current_color ());
gtk_css_style_property_register ("text-decoration-style",
GTK_CSS_PROPERTY_TEXT_DECORATION_STYLE,
- G_TYPE_NONE,
0,
GTK_CSS_AFFECTS_TEXT_ATTRS,
parse_text_decoration_style,
- NULL,
_gtk_css_text_decoration_style_value_new
(GTK_CSS_TEXT_DECORATION_STYLE_SOLID));
gtk_css_style_property_register ("font-kerning",
GTK_CSS_PROPERTY_FONT_KERNING,
- G_TYPE_NONE,
0,
GTK_CSS_AFFECTS_TEXT_ATTRS | GTK_CSS_AFFECTS_TEXT_SIZE,
parse_font_kerning,
- NULL,
_gtk_css_font_kerning_value_new (GTK_CSS_FONT_KERNING_AUTO));
gtk_css_style_property_register ("font-variant-ligatures",
GTK_CSS_PROPERTY_FONT_VARIANT_LIGATURES,
- G_TYPE_NONE,
0,
GTK_CSS_AFFECTS_TEXT_ATTRS,
parse_font_variant_ligatures,
- NULL,
_gtk_css_font_variant_ligature_value_new
(GTK_CSS_FONT_VARIANT_LIGATURE_NORMAL));
gtk_css_style_property_register ("font-variant-position",
GTK_CSS_PROPERTY_FONT_VARIANT_POSITION,
- G_TYPE_NONE,
0,
GTK_CSS_AFFECTS_TEXT_ATTRS,
parse_font_variant_position,
- NULL,
_gtk_css_font_variant_position_value_new
(GTK_CSS_FONT_VARIANT_POSITION_NORMAL));
gtk_css_style_property_register ("font-variant-caps",
GTK_CSS_PROPERTY_FONT_VARIANT_CAPS,
- G_TYPE_NONE,
0,
GTK_CSS_AFFECTS_TEXT_ATTRS,
parse_font_variant_caps,
- NULL,
_gtk_css_font_variant_caps_value_new
(GTK_CSS_FONT_VARIANT_CAPS_NORMAL));
gtk_css_style_property_register ("font-variant-numeric",
GTK_CSS_PROPERTY_FONT_VARIANT_NUMERIC,
- G_TYPE_NONE,
0,
GTK_CSS_AFFECTS_TEXT_ATTRS,
parse_font_variant_numeric,
- NULL,
_gtk_css_font_variant_numeric_value_new
(GTK_CSS_FONT_VARIANT_NUMERIC_NORMAL));
gtk_css_style_property_register ("font-variant-alternates",
GTK_CSS_PROPERTY_FONT_VARIANT_ALTERNATES,
- G_TYPE_NONE,
0,
GTK_CSS_AFFECTS_TEXT_ATTRS,
parse_font_variant_alternates,
- NULL,
_gtk_css_font_variant_alternate_value_new
(GTK_CSS_FONT_VARIANT_ALTERNATE_NORMAL));
gtk_css_style_property_register ("font-variant-east-asian",
GTK_CSS_PROPERTY_FONT_VARIANT_EAST_ASIAN,
- G_TYPE_NONE,
0,
GTK_CSS_AFFECTS_TEXT_ATTRS,
parse_font_variant_east_asian,
- NULL,
_gtk_css_font_variant_east_asian_value_new
(GTK_CSS_FONT_VARIANT_EAST_ASIAN_NORMAL));
gtk_css_style_property_register ("text-shadow",
GTK_CSS_PROPERTY_TEXT_SHADOW,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_TEXT_CONTENT,
shadow_value_parse,
- NULL,
gtk_css_shadow_value_new_none ());
gtk_css_style_property_register ("box-shadow",
GTK_CSS_PROPERTY_BOX_SHADOW,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND,
box_shadow_value_parse,
- NULL,
gtk_css_shadow_value_new_none ());
gtk_css_style_property_register ("margin-top",
GTK_CSS_PROPERTY_MARGIN_TOP,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_margin,
- query_length_as_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("margin-left",
GTK_CSS_PROPERTY_MARGIN_LEFT,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_margin,
- query_length_as_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("margin-bottom",
GTK_CSS_PROPERTY_MARGIN_BOTTOM,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_margin,
- query_length_as_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("margin-right",
GTK_CSS_PROPERTY_MARGIN_RIGHT,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_margin,
- query_length_as_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("padding-top",
GTK_CSS_PROPERTY_PADDING_TOP,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_padding,
- query_length_as_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("padding-left",
GTK_CSS_PROPERTY_PADDING_LEFT,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_padding,
- query_length_as_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("padding-bottom",
GTK_CSS_PROPERTY_PADDING_BOTTOM,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_padding,
- query_length_as_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("padding-right",
GTK_CSS_PROPERTY_PADDING_RIGHT,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_padding,
- query_length_as_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
/* IMPORTANT: the border-width properties must come after border-style properties,
* they depend on them for their value computation.
*/
gtk_css_style_property_register ("border-top-style",
GTK_CSS_PROPERTY_BORDER_TOP_STYLE,
- GTK_TYPE_BORDER_STYLE,
0,
GTK_CSS_AFFECTS_BORDER,
parse_border_style,
- query_border_style,
_gtk_css_border_style_value_new (GTK_BORDER_STYLE_NONE));
gtk_css_style_property_register ("border-top-width",
GTK_CSS_PROPERTY_BORDER_TOP_WIDTH,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BORDER | GTK_CSS_AFFECTS_SIZE,
parse_border_width,
- query_length_as_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("border-left-style",
GTK_CSS_PROPERTY_BORDER_LEFT_STYLE,
- GTK_TYPE_BORDER_STYLE,
0,
GTK_CSS_AFFECTS_BORDER,
parse_border_style,
- query_border_style,
_gtk_css_border_style_value_new (GTK_BORDER_STYLE_NONE));
gtk_css_style_property_register ("border-left-width",
GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BORDER | GTK_CSS_AFFECTS_SIZE,
parse_border_width,
- query_length_as_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("border-bottom-style",
GTK_CSS_PROPERTY_BORDER_BOTTOM_STYLE,
- GTK_TYPE_BORDER_STYLE,
0,
GTK_CSS_AFFECTS_BORDER,
parse_border_style,
- query_border_style,
_gtk_css_border_style_value_new (GTK_BORDER_STYLE_NONE));
gtk_css_style_property_register ("border-bottom-width",
GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BORDER | GTK_CSS_AFFECTS_SIZE,
parse_border_width,
- query_length_as_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("border-right-style",
GTK_CSS_PROPERTY_BORDER_RIGHT_STYLE,
- GTK_TYPE_BORDER_STYLE,
0,
GTK_CSS_AFFECTS_BORDER,
parse_border_style,
- query_border_style,
_gtk_css_border_style_value_new (GTK_BORDER_STYLE_NONE));
gtk_css_style_property_register ("border-right-width",
GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BORDER | GTK_CSS_AFFECTS_SIZE,
parse_border_width,
- query_length_as_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("border-top-left-radius",
GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
border_corner_radius_value_parse,
- NULL,
_gtk_css_number_value_new (0, GTK_CSS_PX));
gtk_css_style_property_register ("border-top-right-radius",
GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_RADIUS,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
border_corner_radius_value_parse,
- NULL,
_gtk_css_number_value_new (0, GTK_CSS_PX));
gtk_css_style_property_register ("border-bottom-right-radius",
GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
border_corner_radius_value_parse,
- NULL,
_gtk_css_number_value_new (0, GTK_CSS_PX));
gtk_css_style_property_register ("border-bottom-left-radius",
GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
border_corner_radius_value_parse,
- NULL,
_gtk_css_number_value_new (0, GTK_CSS_PX));
gtk_css_style_property_register ("outline-style",
GTK_CSS_PROPERTY_OUTLINE_STYLE,
- GTK_TYPE_BORDER_STYLE,
0,
GTK_CSS_AFFECTS_OUTLINE,
parse_border_style,
- query_border_style,
_gtk_css_border_style_value_new (GTK_BORDER_STYLE_NONE));
gtk_css_style_property_register ("outline-width",
GTK_CSS_PROPERTY_OUTLINE_WIDTH,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_OUTLINE,
parse_border_width,
- query_length_as_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("outline-offset",
GTK_CSS_PROPERTY_OUTLINE_OFFSET,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_OUTLINE,
outline_parse,
- query_length_as_int,
_gtk_css_number_value_new (0.0, GTK_CSS_PX));
gtk_css_style_property_register ("-gtk-outline-top-left-radius",
GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_OUTLINE,
border_corner_radius_value_parse,
- NULL,
_gtk_css_number_value_new (0, GTK_CSS_PX));
gtk_css_style_property_register ("-gtk-outline-top-right-radius",
GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_OUTLINE,
border_corner_radius_value_parse,
- NULL,
_gtk_css_number_value_new (0, GTK_CSS_PX));
gtk_css_style_property_register ("-gtk-outline-bottom-right-radius",
GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_OUTLINE,
border_corner_radius_value_parse,
- NULL,
_gtk_css_number_value_new (0, GTK_CSS_PX));
gtk_css_style_property_register ("-gtk-outline-bottom-left-radius",
GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_OUTLINE,
border_corner_radius_value_parse,
- NULL,
_gtk_css_number_value_new (0, GTK_CSS_PX));
gtk_css_style_property_register ("background-clip",
GTK_CSS_PROPERTY_BACKGROUND_CLIP,
- G_TYPE_NONE,
0,
GTK_CSS_AFFECTS_BACKGROUND,
parse_css_area,
- NULL,
_gtk_css_area_value_new (GTK_CSS_AREA_BORDER_BOX));
gtk_css_style_property_register ("background-origin",
GTK_CSS_PROPERTY_BACKGROUND_ORIGIN,
- G_TYPE_NONE,
0,
GTK_CSS_AFFECTS_BACKGROUND,
parse_css_area,
- NULL,
_gtk_css_area_value_new (GTK_CSS_AREA_PADDING_BOX));
gtk_css_style_property_register ("background-size",
GTK_CSS_PROPERTY_BACKGROUND_SIZE,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND,
background_size_parse,
- NULL,
_gtk_css_bg_size_value_new (NULL, NULL));
gtk_css_style_property_register ("background-position",
GTK_CSS_PROPERTY_BACKGROUND_POSITION,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND,
background_position_parse,
- NULL,
_gtk_css_position_value_new (_gtk_css_number_value_new (0,
GTK_CSS_PERCENT),
_gtk_css_number_value_new (0,
GTK_CSS_PERCENT)));
gtk_css_style_property_register ("border-top-color",
GTK_CSS_PROPERTY_BORDER_TOP_COLOR,
- GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BORDER,
color_parse,
- color_query,
_gtk_css_color_value_new_current_color ());
gtk_css_style_property_register ("border-right-color",
GTK_CSS_PROPERTY_BORDER_RIGHT_COLOR,
- GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BORDER,
color_parse,
- color_query,
_gtk_css_color_value_new_current_color ());
gtk_css_style_property_register ("border-bottom-color",
GTK_CSS_PROPERTY_BORDER_BOTTOM_COLOR,
- GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BORDER,
color_parse,
- color_query,
_gtk_css_color_value_new_current_color ());
gtk_css_style_property_register ("border-left-color",
GTK_CSS_PROPERTY_BORDER_LEFT_COLOR,
- GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BORDER,
color_parse,
- color_query,
_gtk_css_color_value_new_current_color ());
gtk_css_style_property_register ("outline-color",
GTK_CSS_PROPERTY_OUTLINE_COLOR,
- GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_OUTLINE,
color_parse,
- color_query,
_gtk_css_color_value_new_current_color ());
gtk_css_style_property_register ("background-repeat",
GTK_CSS_PROPERTY_BACKGROUND_REPEAT,
- G_TYPE_NONE,
0,
GTK_CSS_AFFECTS_BACKGROUND,
background_repeat_value_parse,
- NULL,
_gtk_css_background_repeat_value_new (GTK_CSS_REPEAT_STYLE_REPEAT,
GTK_CSS_REPEAT_STYLE_REPEAT));
gtk_css_style_property_register ("background-image",
GTK_CSS_PROPERTY_BACKGROUND_IMAGE,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND,
background_image_value_parse,
- NULL,
_gtk_css_image_value_new (NULL));
gtk_css_style_property_register ("background-blend-mode",
GTK_CSS_PROPERTY_BACKGROUND_BLEND_MODE,
- G_TYPE_NONE,
0,
GTK_CSS_AFFECTS_BACKGROUND,
blend_mode_value_parse,
- NULL,
_gtk_css_blend_mode_value_new (GSK_BLEND_MODE_DEFAULT));
gtk_css_style_property_register ("border-image-source",
GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BORDER,
css_image_value_parse,
- NULL,
_gtk_css_image_value_new (NULL));
gtk_css_style_property_register ("border-image-repeat",
GTK_CSS_PROPERTY_BORDER_IMAGE_REPEAT,
- G_TYPE_NONE,
0,
GTK_CSS_AFFECTS_BORDER,
border_image_repeat_parse,
- NULL,
_gtk_css_border_repeat_value_new (GTK_CSS_REPEAT_STYLE_STRETCH,
GTK_CSS_REPEAT_STYLE_STRETCH));
gtk_css_style_property_register ("border-image-slice",
GTK_CSS_PROPERTY_BORDER_IMAGE_SLICE,
- GTK_TYPE_BORDER,
0,
GTK_CSS_AFFECTS_BORDER,
border_image_slice_parse,
- query_border,
_gtk_css_border_value_new (_gtk_css_number_value_new (100,
GTK_CSS_PERCENT),
_gtk_css_number_value_new (100,
GTK_CSS_PERCENT),
_gtk_css_number_value_new (100,
GTK_CSS_PERCENT),
_gtk_css_number_value_new (100,
GTK_CSS_PERCENT)));
gtk_css_style_property_register ("border-image-width",
GTK_CSS_PROPERTY_BORDER_IMAGE_WIDTH,
- GTK_TYPE_BORDER,
0,
GTK_CSS_AFFECTS_BORDER,
border_image_width_parse,
- query_border,
_gtk_css_border_value_new (_gtk_css_number_value_new (1,
GTK_CSS_NUMBER),
_gtk_css_number_value_new (1,
GTK_CSS_NUMBER),
_gtk_css_number_value_new (1,
GTK_CSS_NUMBER),
@@ -1492,232 +1243,176 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("-gtk-icon-source",
GTK_CSS_PROPERTY_ICON_SOURCE,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_ICON_TEXTURE,
css_image_value_parse,
- NULL,
_gtk_css_image_value_new (NULL));
gtk_css_style_property_register ("-gtk-icon-size",
GTK_CSS_PROPERTY_ICON_SIZE,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_ICON_SIZE,
icon_size_parse,
- NULL,
_gtk_css_number_value_new (16, GTK_CSS_PX));
gtk_css_style_property_register ("-gtk-icon-shadow",
GTK_CSS_PROPERTY_ICON_SHADOW,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_ICON_REDRAW,
shadow_value_parse,
- NULL,
gtk_css_shadow_value_new_none ());
gtk_css_style_property_register ("-gtk-icon-style",
GTK_CSS_PROPERTY_ICON_STYLE,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_ICON_TEXTURE,
icon_style_parse,
- NULL,
_gtk_css_icon_style_value_new (GTK_CSS_ICON_STYLE_REQUESTED));
gtk_css_style_property_register ("-gtk-icon-transform",
GTK_CSS_PROPERTY_ICON_TRANSFORM,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_CONTENT,
transform_value_parse,
- NULL,
_gtk_css_transform_value_new_none ());
gtk_css_style_property_register ("-gtk-icon-filter",
GTK_CSS_PROPERTY_ICON_FILTER,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_CONTENT,
filter_value_parse,
- NULL,
gtk_css_filter_value_new_none ());
gtk_css_style_property_register ("border-spacing",
GTK_CSS_PROPERTY_BORDER_SPACING,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
border_spacing_value_parse,
- NULL,
_gtk_css_position_value_new (_gtk_css_number_value_new (0,
GTK_CSS_PX),
_gtk_css_number_value_new (0,
GTK_CSS_PX)));
gtk_css_style_property_register ("transform",
GTK_CSS_PROPERTY_TRANSFORM,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_TRANSFORM,
transform_value_parse,
- NULL,
_gtk_css_transform_value_new_none ());
gtk_css_style_property_register ("min-width",
GTK_CSS_PROPERTY_MIN_WIDTH,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
minmax_parse,
- query_length_as_int,
_gtk_css_number_value_new (0, GTK_CSS_PX));
gtk_css_style_property_register ("min-height",
GTK_CSS_PROPERTY_MIN_HEIGHT,
- G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
minmax_parse,
- query_length_as_int,
_gtk_css_number_value_new (0, GTK_CSS_PX));
gtk_css_style_property_register ("transition-property",
GTK_CSS_PROPERTY_TRANSITION_PROPERTY,
- G_TYPE_NONE,
0,
0,
transition_property_parse,
- NULL,
_gtk_css_ident_value_new ("all"));
gtk_css_style_property_register ("transition-duration",
GTK_CSS_PROPERTY_TRANSITION_DURATION,
- G_TYPE_NONE,
0,
0,
transition_time_parse,
- NULL,
_gtk_css_number_value_new (0, GTK_CSS_S));
gtk_css_style_property_register ("transition-timing-function",
GTK_CSS_PROPERTY_TRANSITION_TIMING_FUNCTION,
- G_TYPE_NONE,
0,
0,
transition_timing_function_parse,
- NULL,
_gtk_css_ease_value_new_cubic_bezier (0.25, 0.1, 0.25, 1.0));
gtk_css_style_property_register ("transition-delay",
GTK_CSS_PROPERTY_TRANSITION_DELAY,
- G_TYPE_NONE,
0,
0,
transition_time_parse,
- NULL,
_gtk_css_number_value_new (0, GTK_CSS_S));
gtk_css_style_property_register ("animation-name",
GTK_CSS_PROPERTY_ANIMATION_NAME,
- G_TYPE_NONE,
0,
0,
transition_property_parse,
- NULL,
_gtk_css_ident_value_new ("none"));
gtk_css_style_property_register ("animation-duration",
GTK_CSS_PROPERTY_ANIMATION_DURATION,
- G_TYPE_NONE,
0,
0,
transition_time_parse,
- NULL,
_gtk_css_number_value_new (0, GTK_CSS_S));
gtk_css_style_property_register ("animation-timing-function",
GTK_CSS_PROPERTY_ANIMATION_TIMING_FUNCTION,
- G_TYPE_NONE,
0,
0,
transition_timing_function_parse,
- NULL,
_gtk_css_ease_value_new_cubic_bezier (0.25, 0.1, 0.25, 1.0));
gtk_css_style_property_register ("animation-iteration-count",
GTK_CSS_PROPERTY_ANIMATION_ITERATION_COUNT,
- G_TYPE_NONE,
0,
0,
iteration_count_parse,
- NULL,
_gtk_css_number_value_new (1, GTK_CSS_NUMBER));
gtk_css_style_property_register ("animation-direction",
GTK_CSS_PROPERTY_ANIMATION_DIRECTION,
- G_TYPE_NONE,
0,
0,
parse_css_direction,
- NULL,
_gtk_css_direction_value_new (GTK_CSS_DIRECTION_NORMAL));
gtk_css_style_property_register ("animation-play-state",
GTK_CSS_PROPERTY_ANIMATION_PLAY_STATE,
- G_TYPE_NONE,
0,
0,
parse_css_play_state,
- NULL,
_gtk_css_play_state_value_new (GTK_CSS_PLAY_STATE_RUNNING));
gtk_css_style_property_register ("animation-delay",
GTK_CSS_PROPERTY_ANIMATION_DELAY,
- G_TYPE_NONE,
0,
0,
transition_time_parse,
- NULL,
_gtk_css_number_value_new (0, GTK_CSS_S));
gtk_css_style_property_register ("animation-fill-mode",
GTK_CSS_PROPERTY_ANIMATION_FILL_MODE,
- G_TYPE_NONE,
0,
0,
parse_css_fill_mode,
- NULL,
_gtk_css_fill_mode_value_new (GTK_CSS_FILL_NONE));
gtk_css_style_property_register ("opacity",
GTK_CSS_PROPERTY_OPACITY,
- G_TYPE_DOUBLE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_POSTEFFECT,
opacity_parse,
- opacity_query,
_gtk_css_number_value_new (1, GTK_CSS_NUMBER));
gtk_css_style_property_register ("filter",
GTK_CSS_PROPERTY_FILTER,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_POSTEFFECT,
filter_value_parse,
- NULL,
gtk_css_filter_value_new_none ());
gtk_css_style_property_register ("caret-color",
GTK_CSS_PROPERTY_CARET_COLOR,
- GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_CONTENT,
color_parse,
- color_query,
_gtk_css_color_value_new_current_color ());
gtk_css_style_property_register ("-gtk-secondary-caret-color",
GTK_CSS_PROPERTY_SECONDARY_CARET_COLOR,
- GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_CONTENT,
color_parse,
- color_query,
_gtk_css_color_value_new_current_color ());
gtk_css_style_property_register ("font-feature-settings",
GTK_CSS_PROPERTY_FONT_FEATURE_SETTINGS,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_TEXT_ATTRS | GTK_CSS_AFFECTS_TEXT_SIZE,
parse_font_feature_settings,
- NULL,
gtk_css_font_features_value_new_default ());
gtk_css_style_property_register ("font-variation-settings",
GTK_CSS_PROPERTY_FONT_VARIATION_SETTINGS,
- G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_TEXT_ATTRS | GTK_CSS_AFFECTS_TEXT_SIZE,
parse_font_variation_settings,
- NULL,
gtk_css_font_variations_value_new_default ());
}
diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c
index d09d510680..7f4785252a 100644
--- a/gtk/gtkstyleproperty.c
+++ b/gtk/gtkstyleproperty.c
@@ -29,8 +29,7 @@
enum {
PROP_0,
- PROP_NAME,
- PROP_VALUE_TYPE
+ PROP_NAME
};
G_DEFINE_ABSTRACT_TYPE (GtkStyleProperty, _gtk_style_property, G_TYPE_OBJECT)
@@ -62,9 +61,6 @@ gtk_style_property_set_property (GObject *object,
g_assert (g_hash_table_lookup (klass->properties, property->name) == NULL);
g_hash_table_insert (klass->properties, property->name, property);
break;
- case PROP_VALUE_TYPE:
- property->value_type = g_value_get_gtype (value);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -84,9 +80,6 @@ gtk_style_property_get_property (GObject *object,
case PROP_NAME:
g_value_set_string (value, property->name);
break;
- case PROP_VALUE_TYPE:
- g_value_set_gtype (value, property->value_type);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -109,13 +102,6 @@ _gtk_style_property_class_init (GtkStylePropertyClass *klass)
P_("The name of the property"),
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property (object_class,
- PROP_VALUE_TYPE,
- g_param_spec_gtype ("value-type",
- P_("Value type"),
- P_("The value type returned by GtkStyleContext"),
- G_TYPE_NONE,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
klass->properties = g_hash_table_new (g_str_hash, g_str_equal);
}
@@ -123,7 +109,6 @@ _gtk_style_property_class_init (GtkStylePropertyClass *klass)
static void
_gtk_style_property_init (GtkStyleProperty *property)
{
- property->value_type = G_TYPE_NONE;
}
/**
@@ -157,35 +142,6 @@ _gtk_style_property_parse_value (GtkStyleProperty *property,
return klass->parse_value (property, parser);
}
-/**
- * _gtk_style_property_query:
- * @property: the property
- * @value: (out): an uninitialized #GValue to be filled with the
- * contents of the lookup
- * @query_func: The function to use to query properties
- * @query_data: The data to pass to @query_func
- *
- * This function is called by gtk_style_properties_get() and in
- * turn gtk_style_context_get() and similar functions to get the
- * value to return to code using old APIs.
- **/
-void
-_gtk_style_property_query (GtkStyleProperty *property,
- GValue *value,
- GtkStyleQueryFunc query_func,
- gpointer query_data)
-{
- GtkStylePropertyClass *klass;
-
- g_return_if_fail (value != NULL);
- g_return_if_fail (GTK_IS_STYLE_PROPERTY (property));
- g_return_if_fail (query_func != NULL);
-
- klass = GTK_STYLE_PROPERTY_GET_CLASS (property);
-
- klass->query (property, value, query_func, query_data);
-}
-
void
_gtk_style_property_init_properties (void)
{
@@ -240,21 +196,3 @@ _gtk_style_property_get_name (GtkStyleProperty *property)
return property->name;
}
-
-/**
- * _gtk_style_property_get_value_type:
- * @property: the property to query
- *
- * Gets the value type of the @property, if the property is usable
- * in public API via _gtk_style_property_query(). If the @property is not
- * usable in that way, %G_TYPE_NONE is returned.
- *
- * Returns: the value type in use or %G_TYPE_NONE if none.
- **/
-GType
-_gtk_style_property_get_value_type (GtkStyleProperty *property)
-{
- g_return_val_if_fail (GTK_IS_STYLE_PROPERTY (property), G_TYPE_NONE);
-
- return property->value_type;
-}
diff --git a/gtk/gtkstylepropertyprivate.h b/gtk/gtkstylepropertyprivate.h
index 5bd5a2cdf0..385913f83e 100644
--- a/gtk/gtkstylepropertyprivate.h
+++ b/gtk/gtkstylepropertyprivate.h
@@ -42,17 +42,12 @@ struct _GtkStyleProperty
GObject parent;
char *name;
- GType value_type;
};
struct _GtkStylePropertyClass
{
GObjectClass parent_class;
- void (* query) (GtkStyleProperty *property,
- GValue *value,
- GtkStyleQueryFunc query_func,
- gpointer query_data);
GtkCssValue * (* parse_value) (GtkStyleProperty * property,
GtkCssParser *parser);
@@ -70,12 +65,6 @@ const char * _gtk_style_property_get_name (GtkStyleProperty
GtkCssValue * _gtk_style_property_parse_value (GtkStyleProperty * property,
GtkCssParser *parser);
-GType _gtk_style_property_get_value_type(GtkStyleProperty * property);
-void _gtk_style_property_query (GtkStyleProperty * property,
- GValue *value,
- GtkStyleQueryFunc query_func,
- gpointer query_data);
-
G_END_DECLS
#endif /* __GTK_CSS_STYLEPROPERTY_PRIVATE_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]