css: Have finer-grained definitions for effects of CSS props

This adds the GtkCssAffects enum and implements it for all style
properties.
So far, this is not exposed outside of the implementation file.
This commit is contained in:
Benjamin Otte 2014-10-01 06:49:01 +02:00
parent 7afac9670b
commit f7ee61c833
2 changed files with 171 additions and 61 deletions

View File

@ -68,8 +68,6 @@
typedef enum {
GTK_STYLE_PROPERTY_INHERIT = (1 << 0),
GTK_STYLE_PROPERTY_ANIMATED = (1 << 1),
GTK_STYLE_PROPERTY_NO_RESIZE = (1 << 2),
GTK_STYLE_PROPERTY_AFFECTS_FONT = (1 << 3)
} GtkStylePropertyFlags;
static void
@ -77,6 +75,7 @@ gtk_css_style_property_register (const char * name,
guint expected_id,
GType value_type,
GtkStylePropertyFlags flags,
GtkCssAffects affects,
GtkCssStylePropertyParseFunc parse_value,
GtkCssStylePropertyQueryFunc query_value,
GtkCssStylePropertyAssignFunc assign_value,
@ -91,8 +90,8 @@ gtk_css_style_property_register (const char * name,
node = g_object_new (GTK_TYPE_CSS_STYLE_PROPERTY,
"value-type", value_type,
"affects-size", (flags & GTK_STYLE_PROPERTY_NO_RESIZE) ? FALSE : TRUE,
"affects-font", (flags & GTK_STYLE_PROPERTY_AFFECTS_FONT) ? TRUE : FALSE,
"affects-size", (affects & GTK_CSS_AFFECTS_SIZE) ? TRUE : FALSE,
"affects-font", (affects & GTK_CSS_AFFECTS_FONT) ? TRUE : FALSE,
"animated", (flags & GTK_STYLE_PROPERTY_ANIMATED) ? TRUE : FALSE,
"inherit", (flags & GTK_STYLE_PROPERTY_INHERIT) ? TRUE : FALSE,
"initial-value", initial_value,
@ -948,7 +947,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("color",
GTK_CSS_PROPERTY_COLOR,
GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_FOREGROUND | GTK_CSS_AFFECTS_TEXT | GTK_CSS_AFFECTS_ICON,
color_parse,
color_query,
color_assign,
@ -956,7 +956,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("font-size",
GTK_CSS_PROPERTY_FONT_SIZE,
G_TYPE_DOUBLE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_AFFECTS_FONT,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_FONT | GTK_CSS_AFFECTS_TEXT,
font_size_parse,
query_length_as_double,
assign_length_from_double,
@ -967,7 +968,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("background-color",
GTK_CSS_PROPERTY_BACKGROUND_COLOR,
GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND,
color_parse,
color_query,
color_assign,
@ -976,7 +978,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("font-family",
GTK_CSS_PROPERTY_FONT_FAMILY,
G_TYPE_STRV,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_AFFECTS_FONT,
GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_FONT | GTK_CSS_AFFECTS_TEXT,
font_family_parse,
font_family_query,
font_family_assign,
@ -984,7 +987,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("font-style",
GTK_CSS_PROPERTY_FONT_STYLE,
PANGO_TYPE_STYLE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_AFFECTS_FONT,
GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_FONT | GTK_CSS_AFFECTS_TEXT,
parse_pango_style,
query_pango_style,
assign_pango_style,
@ -992,7 +996,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("font-variant",
GTK_CSS_PROPERTY_FONT_VARIANT,
PANGO_TYPE_VARIANT,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_AFFECTS_FONT,
GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_FONT | GTK_CSS_AFFECTS_TEXT,
parse_pango_variant,
query_pango_variant,
assign_pango_variant,
@ -1000,7 +1005,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("font-weight",
GTK_CSS_PROPERTY_FONT_WEIGHT,
PANGO_TYPE_WEIGHT,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_AFFECTS_FONT,
GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_FONT | GTK_CSS_AFFECTS_TEXT,
parse_pango_weight,
query_pango_weight,
assign_pango_weight,
@ -1008,7 +1014,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("font-stretch",
GTK_CSS_PROPERTY_FONT_STRETCH,
PANGO_TYPE_STRETCH,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_AFFECTS_FONT,
GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_FONT | GTK_CSS_AFFECTS_TEXT,
parse_pango_stretch,
query_pango_stretch,
assign_pango_stretch,
@ -1017,7 +1024,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("text-shadow",
GTK_CSS_PROPERTY_TEXT_SHADOW,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_TEXT | GTK_CSS_AFFECTS_CLIP,
shadow_value_parse,
NULL,
NULL,
@ -1026,7 +1034,8 @@ _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_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_ICON,
css_image_value_parse,
NULL,
NULL,
@ -1034,7 +1043,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("icon-shadow",
GTK_CSS_PROPERTY_ICON_SHADOW,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_ICON | GTK_CSS_AFFECTS_CLIP,
shadow_value_parse,
NULL,
NULL,
@ -1042,7 +1052,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("-gtk-icon-style",
GTK_CSS_PROPERTY_ICON_STYLE,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_ICON,
icon_style_parse,
NULL,
NULL,
@ -1051,6 +1062,7 @@ _gtk_css_style_property_init_properties (void)
GTK_CSS_PROPERTY_ICON_TRANSFORM,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_ICON | GTK_CSS_AFFECTS_CLIP,
transform_value_parse,
NULL,
NULL,
@ -1060,6 +1072,7 @@ _gtk_css_style_property_init_properties (void)
GTK_CSS_PROPERTY_BOX_SHADOW,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_CLIP,
box_shadow_value_parse,
NULL,
NULL,
@ -1069,6 +1082,7 @@ _gtk_css_style_property_init_properties (void)
GTK_CSS_PROPERTY_MARGIN_TOP,
G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_margin,
query_length_as_int,
assign_length_from_int,
@ -1077,6 +1091,7 @@ _gtk_css_style_property_init_properties (void)
GTK_CSS_PROPERTY_MARGIN_LEFT,
G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_margin,
query_length_as_int,
assign_length_from_int,
@ -1085,6 +1100,7 @@ _gtk_css_style_property_init_properties (void)
GTK_CSS_PROPERTY_MARGIN_BOTTOM,
G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_margin,
query_length_as_int,
assign_length_from_int,
@ -1093,6 +1109,7 @@ _gtk_css_style_property_init_properties (void)
GTK_CSS_PROPERTY_MARGIN_RIGHT,
G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_margin,
query_length_as_int,
assign_length_from_int,
@ -1101,6 +1118,7 @@ _gtk_css_style_property_init_properties (void)
GTK_CSS_PROPERTY_PADDING_TOP,
G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_padding,
query_length_as_int,
assign_length_from_int,
@ -1109,6 +1127,7 @@ _gtk_css_style_property_init_properties (void)
GTK_CSS_PROPERTY_PADDING_LEFT,
G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_padding,
query_length_as_int,
assign_length_from_int,
@ -1117,6 +1136,7 @@ _gtk_css_style_property_init_properties (void)
GTK_CSS_PROPERTY_PADDING_BOTTOM,
G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_padding,
query_length_as_int,
assign_length_from_int,
@ -1125,6 +1145,7 @@ _gtk_css_style_property_init_properties (void)
GTK_CSS_PROPERTY_PADDING_RIGHT,
G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_SIZE,
parse_padding,
query_length_as_int,
assign_length_from_int,
@ -1135,7 +1156,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-top-style",
GTK_CSS_PROPERTY_BORDER_TOP_STYLE,
GTK_TYPE_BORDER_STYLE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
GTK_CSS_AFFECTS_BORDER,
parse_border_style,
query_border_style,
assign_border_style,
@ -1144,6 +1166,7 @@ _gtk_css_style_property_init_properties (void)
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,
assign_length_from_int,
@ -1151,7 +1174,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-left-style",
GTK_CSS_PROPERTY_BORDER_LEFT_STYLE,
GTK_TYPE_BORDER_STYLE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
GTK_CSS_AFFECTS_BORDER,
parse_border_style,
query_border_style,
assign_border_style,
@ -1160,6 +1184,7 @@ _gtk_css_style_property_init_properties (void)
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,
assign_length_from_int,
@ -1167,7 +1192,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-bottom-style",
GTK_CSS_PROPERTY_BORDER_BOTTOM_STYLE,
GTK_TYPE_BORDER_STYLE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
GTK_CSS_AFFECTS_BORDER,
parse_border_style,
query_border_style,
assign_border_style,
@ -1176,6 +1202,7 @@ _gtk_css_style_property_init_properties (void)
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,
assign_length_from_int,
@ -1183,7 +1210,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-right-style",
GTK_CSS_PROPERTY_BORDER_RIGHT_STYLE,
GTK_TYPE_BORDER_STYLE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
GTK_CSS_AFFECTS_BORDER,
parse_border_style,
query_border_style,
assign_border_style,
@ -1192,6 +1220,7 @@ _gtk_css_style_property_init_properties (void)
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,
assign_length_from_int,
@ -1200,7 +1229,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-top-left-radius",
GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
border_corner_radius_value_parse,
NULL,
NULL,
@ -1209,7 +1239,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-top-right-radius",
GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
border_corner_radius_value_parse,
NULL,
NULL,
@ -1218,7 +1249,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-bottom-right-radius",
GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
border_corner_radius_value_parse,
NULL,
NULL,
@ -1227,7 +1259,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-bottom-left-radius",
GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND | GTK_CSS_AFFECTS_BORDER,
border_corner_radius_value_parse,
NULL,
NULL,
@ -1237,7 +1270,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("outline-style",
GTK_CSS_PROPERTY_OUTLINE_STYLE,
GTK_TYPE_BORDER_STYLE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
GTK_CSS_AFFECTS_OUTLINE,
parse_border_style,
query_border_style,
assign_border_style,
@ -1246,6 +1280,7 @@ _gtk_css_style_property_init_properties (void)
GTK_CSS_PROPERTY_OUTLINE_WIDTH,
G_TYPE_INT,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_OUTLINE | GTK_CSS_AFFECTS_CLIP,
parse_border_width,
query_length_as_int,
assign_length_from_int,
@ -1253,7 +1288,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("outline-offset",
GTK_CSS_PROPERTY_OUTLINE_OFFSET,
G_TYPE_INT,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
GTK_CSS_AFFECTS_OUTLINE,
outline_parse,
query_length_as_int,
assign_length_from_int,
@ -1262,7 +1298,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("outline-top-left-radius",
GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_OUTLINE,
border_corner_radius_value_parse,
NULL,
NULL,
@ -1271,7 +1308,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("outline-top-right-radius",
GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_OUTLINE,
border_corner_radius_value_parse,
NULL,
NULL,
@ -1280,7 +1318,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("outline-bottom-right-radius",
GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_OUTLINE,
border_corner_radius_value_parse,
NULL,
NULL,
@ -1289,7 +1328,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("outline-bottom-left-radius",
GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_OUTLINE,
border_corner_radius_value_parse,
NULL,
NULL,
@ -1299,7 +1339,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("background-clip",
GTK_CSS_PROPERTY_BACKGROUND_CLIP,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
GTK_CSS_AFFECTS_BACKGROUND,
parse_css_area,
NULL,
NULL,
@ -1307,7 +1348,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("background-origin",
GTK_CSS_PROPERTY_BACKGROUND_ORIGIN,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
GTK_CSS_AFFECTS_BACKGROUND,
parse_css_area,
NULL,
NULL,
@ -1315,7 +1357,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("background-size",
GTK_CSS_PROPERTY_BACKGROUND_SIZE,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND,
background_size_parse,
NULL,
NULL,
@ -1323,7 +1366,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("background-position",
GTK_CSS_PROPERTY_BACKGROUND_POSITION,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND,
background_position_parse,
NULL,
NULL,
@ -1333,7 +1377,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-top-color",
GTK_CSS_PROPERTY_BORDER_TOP_COLOR,
GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BORDER,
color_parse,
color_query,
color_assign,
@ -1341,7 +1386,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-right-color",
GTK_CSS_PROPERTY_BORDER_RIGHT_COLOR,
GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BORDER,
color_parse,
color_query,
color_assign,
@ -1349,7 +1395,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-bottom-color",
GTK_CSS_PROPERTY_BORDER_BOTTOM_COLOR,
GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BORDER,
color_parse,
color_query,
color_assign,
@ -1357,7 +1404,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-left-color",
GTK_CSS_PROPERTY_BORDER_LEFT_COLOR,
GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BORDER,
color_parse,
color_query,
color_assign,
@ -1365,7 +1413,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("outline-color",
GTK_CSS_PROPERTY_OUTLINE_COLOR,
GDK_TYPE_RGBA,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_OUTLINE,
color_parse,
color_query,
color_assign,
@ -1374,7 +1423,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("background-repeat",
GTK_CSS_PROPERTY_BACKGROUND_REPEAT,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
GTK_CSS_AFFECTS_BACKGROUND,
background_repeat_value_parse,
NULL,
NULL,
@ -1383,7 +1433,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("background-image",
GTK_CSS_PROPERTY_BACKGROUND_IMAGE,
CAIRO_GOBJECT_TYPE_PATTERN,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BACKGROUND,
background_image_value_parse,
background_image_value_query,
background_image_value_assign,
@ -1392,7 +1443,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-image-source",
GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE,
CAIRO_GOBJECT_TYPE_PATTERN,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_BORDER,
css_image_value_parse,
css_image_value_query,
css_image_value_assign,
@ -1400,7 +1452,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-image-repeat",
GTK_CSS_PROPERTY_BORDER_IMAGE_REPEAT,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
GTK_CSS_AFFECTS_BORDER,
border_image_repeat_parse,
NULL,
NULL,
@ -1410,7 +1463,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-image-slice",
GTK_CSS_PROPERTY_BORDER_IMAGE_SLICE,
GTK_TYPE_BORDER,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
GTK_CSS_AFFECTS_BORDER,
border_image_slice_parse,
query_border,
assign_border,
@ -1421,7 +1475,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("border-image-width",
GTK_CSS_PROPERTY_BORDER_IMAGE_WIDTH,
GTK_TYPE_BORDER,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
GTK_CSS_AFFECTS_BORDER,
border_image_width_parse,
query_border,
assign_border,
@ -1433,7 +1488,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("transition-property",
GTK_CSS_PROPERTY_TRANSITION_PROPERTY,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
0,
transition_property_parse,
NULL,
NULL,
@ -1441,7 +1497,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("transition-duration",
GTK_CSS_PROPERTY_TRANSITION_DURATION,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
0,
transition_time_parse,
NULL,
NULL,
@ -1449,7 +1506,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("transition-timing-function",
GTK_CSS_PROPERTY_TRANSITION_TIMING_FUNCTION,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
0,
transition_timing_function_parse,
NULL,
NULL,
@ -1458,7 +1516,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("transition-delay",
GTK_CSS_PROPERTY_TRANSITION_DELAY,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
0,
transition_time_parse,
NULL,
NULL,
@ -1467,7 +1526,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-name",
GTK_CSS_PROPERTY_ANIMATION_NAME,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
0,
transition_property_parse,
NULL,
NULL,
@ -1475,7 +1535,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-duration",
GTK_CSS_PROPERTY_ANIMATION_DURATION,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
0,
transition_time_parse,
NULL,
NULL,
@ -1483,7 +1544,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-timing-function",
GTK_CSS_PROPERTY_ANIMATION_TIMING_FUNCTION,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
0,
transition_timing_function_parse,
NULL,
NULL,
@ -1492,7 +1554,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-iteration-count",
GTK_CSS_PROPERTY_ANIMATION_ITERATION_COUNT,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
0,
iteration_count_parse,
NULL,
NULL,
@ -1500,7 +1563,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-direction",
GTK_CSS_PROPERTY_ANIMATION_DIRECTION,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
0,
parse_css_direction,
NULL,
NULL,
@ -1508,7 +1572,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-play-state",
GTK_CSS_PROPERTY_ANIMATION_PLAY_STATE,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
0,
parse_css_play_state,
NULL,
NULL,
@ -1516,7 +1581,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-delay",
GTK_CSS_PROPERTY_ANIMATION_DELAY,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
0,
transition_time_parse,
NULL,
NULL,
@ -1524,15 +1590,18 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("animation-fill-mode",
GTK_CSS_PROPERTY_ANIMATION_FILL_MODE,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
0,
parse_css_fill_mode,
NULL,
NULL,
_gtk_css_array_value_new (_gtk_css_fill_mode_value_new (GTK_CSS_FILL_NONE)));
gtk_css_style_property_register ("opacity",
GTK_CSS_PROPERTY_OPACITY,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_ANIMATED | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_ANIMATED,
0,
opacity_parse,
NULL,
NULL,
@ -1540,7 +1609,8 @@ _gtk_css_style_property_init_properties (void)
gtk_css_style_property_register ("-gtk-image-effect",
GTK_CSS_PROPERTY_GTK_IMAGE_EFFECT,
G_TYPE_NONE,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_NO_RESIZE,
GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_ICON,
image_effect_parse,
NULL,
NULL,
@ -1550,7 +1620,8 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_css_style_property_register ("engine",
GTK_CSS_PROPERTY_ENGINE,
GTK_TYPE_THEMING_ENGINE,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
0,
engine_parse,
engine_query,
engine_assign,
@ -1561,7 +1632,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
gtk_css_style_property_register ("gtk-key-bindings",
GTK_CSS_PROPERTY_GTK_KEY_BINDINGS,
G_TYPE_PTR_ARRAY,
GTK_STYLE_PROPERTY_NO_RESIZE,
0,
0,
bindings_value_parse,
bindings_value_query,
bindings_value_assign,

View File

@ -70,6 +70,44 @@ typedef enum /*< skip >*/ {
GTK_CSS_DEPENDS_ON_FONT_SIZE = (1 << 3)
} GtkCssDependencies;
/*
* GtkCssAffects:
* @GTK_CSS_AFFECTS_FOREGROUND: The foreground rendering is affected.
* This does not include things that affect the font. For those,
* see @GTK_CSS_AFFECTS_FONT.
* @GTK_CSS_AFFECTS_BACKGROUND: The background rendering is affected.
* @GTK_CSS_AFFECTS_BORDER: The border styling is affected.
* @GTK_CSS_AFFECTS_PANGO_LAYOUT: Font rendering is affected.
* @GTK_CSS_AFFECTS_FONT: The font is affected and should be reloaded
* if it was cached.
* @GTK_CSS_AFFECTS_TEXT: Text rendering is affected.
* @GTK_CSS_AFFECTS_ICON: Icons and icon rendering is affected.
* @GTK_CSS_AFFECTS_OUTLINE: The outline styling is affected. Outlines
* only affect elements that can be focused.
* @GTK_CSS_AFFECTS_CLIP: Changes in this property may have an effect
* on the clipping area of the element. Changes in these properties
* should cause a reevaluation of the element's clip area.
* @GTK_CSS_AFFECTS_SIZE: Changes in this property may have an effect
* on the allocated size of the element. Changes in these properties
* should cause a recomputation of the element's allocated size.
*
* The generic effects that a CSS property can have. If a value is
* set, then the property will have an influence on that feature.
*
* Note that multiple values can be set.
*/
typedef enum /*< skip >*/ {
GTK_CSS_AFFECTS_FOREGROUND = (1 << 0),
GTK_CSS_AFFECTS_BACKGROUND = (1 << 1),
GTK_CSS_AFFECTS_BORDER = (1 << 2),
GTK_CSS_AFFECTS_FONT = (1 << 3),
GTK_CSS_AFFECTS_TEXT = (1 << 4),
GTK_CSS_AFFECTS_ICON = (1 << 5),
GTK_CSS_AFFECTS_OUTLINE = (1 << 6),
GTK_CSS_AFFECTS_CLIP = (1 << 7),
GTK_CSS_AFFECTS_SIZE = (1 << 8)
} GtkCssAffects;
enum { /*< skip >*/
GTK_CSS_PROPERTY_COLOR,
GTK_CSS_PROPERTY_FONT_SIZE,