summaryrefslogtreecommitdiff
path: root/gtk/gtkcssenumvalue.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2020-01-11 13:40:13 +0100
committerTimm Bäder <mail@baedert.org>2020-01-18 08:49:51 +0100
commit24d8c0a7dccc12edc97753049c1b7765dd4d5a27 (patch)
treeae438868d480f52b0d8b9eadf7ce185446b3362c /gtk/gtkcssenumvalue.c
parentba08f5e67da5dcb0bb68e23f50c37091846ce682 (diff)
downloadgtk+-24d8c0a7dccc12edc97753049c1b7765dd4d5a27.tar.gz
css: Set the is_computed flag for more values
With these changes, we skip roughly 85% of compute() calls during widget-factory startup
Diffstat (limited to 'gtk/gtkcssenumvalue.c')
-rw-r--r--gtk/gtkcssenumvalue.c77
1 files changed, 40 insertions, 37 deletions
diff --git a/gtk/gtkcssenumvalue.c b/gtk/gtkcssenumvalue.c
index 90e84834b4..d558964fc9 100644
--- a/gtk/gtkcssenumvalue.c
+++ b/gtk/gtkcssenumvalue.c
@@ -355,9 +355,9 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_STYLE = {
};
static GtkCssValue font_style_values[] = {
- { &GTK_CSS_VALUE_FONT_STYLE, 1, FALSE, PANGO_STYLE_NORMAL, "normal" },
- { &GTK_CSS_VALUE_FONT_STYLE, 1, FALSE, PANGO_STYLE_OBLIQUE, "oblique" },
- { &GTK_CSS_VALUE_FONT_STYLE, 1, FALSE, PANGO_STYLE_ITALIC, "italic" }
+ { &GTK_CSS_VALUE_FONT_STYLE, 1, TRUE, PANGO_STYLE_NORMAL, "normal" },
+ { &GTK_CSS_VALUE_FONT_STYLE, 1, TRUE, PANGO_STYLE_OBLIQUE, "oblique" },
+ { &GTK_CSS_VALUE_FONT_STYLE, 1, TRUE, PANGO_STYLE_ITALIC, "italic" }
};
GtkCssValue *
@@ -504,15 +504,15 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_STRETCH = {
};
static GtkCssValue font_stretch_values[] = {
- { &GTK_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_ULTRA_CONDENSED, "ultra-condensed" },
- { &GTK_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_EXTRA_CONDENSED, "extra-condensed" },
- { &GTK_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_CONDENSED, "condensed" },
- { &GTK_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_SEMI_CONDENSED, "semi-condensed" },
- { &GTK_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_NORMAL, "normal" },
- { &GTK_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_SEMI_EXPANDED, "semi-expanded" },
- { &GTK_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_EXPANDED, "expanded" },
- { &GTK_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_EXTRA_EXPANDED, "extra-expanded" },
- { &GTK_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_ULTRA_EXPANDED, "ultra-expanded" },
+ { &GTK_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_ULTRA_CONDENSED, "ultra-condensed" },
+ { &GTK_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_EXTRA_CONDENSED, "extra-condensed" },
+ { &GTK_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_CONDENSED, "condensed" },
+ { &GTK_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_SEMI_CONDENSED, "semi-condensed" },
+ { &GTK_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_NORMAL, "normal" },
+ { &GTK_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_SEMI_EXPANDED, "semi-expanded" },
+ { &GTK_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_EXPANDED, "expanded" },
+ { &GTK_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_EXTRA_EXPANDED, "extra-expanded" },
+ { &GTK_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_ULTRA_EXPANDED, "ultra-expanded" },
};
GtkCssValue *
@@ -561,9 +561,9 @@ static const GtkCssValueClass GTK_CSS_VALUE_TEXT_DECORATION_LINE = {
};
static GtkCssValue text_decoration_line_values[] = {
- { &GTK_CSS_VALUE_TEXT_DECORATION_LINE, 1, FALSE, GTK_CSS_TEXT_DECORATION_LINE_NONE, "none" },
- { &GTK_CSS_VALUE_TEXT_DECORATION_LINE, 1, FALSE, GTK_CSS_TEXT_DECORATION_LINE_UNDERLINE, "underline" },
- { &GTK_CSS_VALUE_TEXT_DECORATION_LINE, 1, FALSE, GTK_CSS_TEXT_DECORATION_LINE_LINE_THROUGH, "line-through" },
+ { &GTK_CSS_VALUE_TEXT_DECORATION_LINE, 1, TRUE, GTK_CSS_TEXT_DECORATION_LINE_NONE, "none" },
+ { &GTK_CSS_VALUE_TEXT_DECORATION_LINE, 1, TRUE, GTK_CSS_TEXT_DECORATION_LINE_UNDERLINE, "underline" },
+ { &GTK_CSS_VALUE_TEXT_DECORATION_LINE, 1, TRUE, GTK_CSS_TEXT_DECORATION_LINE_LINE_THROUGH, "line-through" },
};
GtkCssValue *
@@ -612,9 +612,9 @@ static const GtkCssValueClass GTK_CSS_VALUE_TEXT_DECORATION_STYLE = {
};
static GtkCssValue text_decoration_style_values[] = {
- { &GTK_CSS_VALUE_TEXT_DECORATION_STYLE, 1, FALSE, GTK_CSS_TEXT_DECORATION_STYLE_SOLID, "solid" },
- { &GTK_CSS_VALUE_TEXT_DECORATION_STYLE, 1, FALSE, GTK_CSS_TEXT_DECORATION_STYLE_DOUBLE, "double" },
- { &GTK_CSS_VALUE_TEXT_DECORATION_STYLE, 1, FALSE, GTK_CSS_TEXT_DECORATION_STYLE_WAVY, "wavy" },
+ { &GTK_CSS_VALUE_TEXT_DECORATION_STYLE, 1, TRUE, GTK_CSS_TEXT_DECORATION_STYLE_SOLID, "solid" },
+ { &GTK_CSS_VALUE_TEXT_DECORATION_STYLE, 1, TRUE, GTK_CSS_TEXT_DECORATION_STYLE_DOUBLE, "double" },
+ { &GTK_CSS_VALUE_TEXT_DECORATION_STYLE, 1, TRUE, GTK_CSS_TEXT_DECORATION_STYLE_WAVY, "wavy" },
};
GtkCssValue *
@@ -720,10 +720,10 @@ static const GtkCssValueClass GTK_CSS_VALUE_DIRECTION = {
};
static GtkCssValue direction_values[] = {
- { &GTK_CSS_VALUE_DIRECTION, 1, FALSE, GTK_CSS_DIRECTION_NORMAL, "normal" },
- { &GTK_CSS_VALUE_DIRECTION, 1, FALSE, GTK_CSS_DIRECTION_REVERSE, "reverse" },
- { &GTK_CSS_VALUE_DIRECTION, 1, FALSE, GTK_CSS_DIRECTION_ALTERNATE, "alternate" },
- { &GTK_CSS_VALUE_DIRECTION, 1, FALSE, GTK_CSS_DIRECTION_ALTERNATE_REVERSE, "alternate-reverse" }
+ { &GTK_CSS_VALUE_DIRECTION, 1, TRUE, GTK_CSS_DIRECTION_NORMAL, "normal" },
+ { &GTK_CSS_VALUE_DIRECTION, 1, TRUE, GTK_CSS_DIRECTION_REVERSE, "reverse" },
+ { &GTK_CSS_VALUE_DIRECTION, 1, TRUE, GTK_CSS_DIRECTION_ALTERNATE, "alternate" },
+ { &GTK_CSS_VALUE_DIRECTION, 1, TRUE, GTK_CSS_DIRECTION_ALTERNATE_REVERSE, "alternate-reverse" }
};
GtkCssValue *
@@ -952,9 +952,9 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_KERNING = {
};
static GtkCssValue font_kerning_values[] = {
- { &GTK_CSS_VALUE_FONT_KERNING, 1, FALSE, GTK_CSS_FONT_KERNING_AUTO, "auto" },
- { &GTK_CSS_VALUE_FONT_KERNING, 1, FALSE, GTK_CSS_FONT_KERNING_NORMAL, "normal" },
- { &GTK_CSS_VALUE_FONT_KERNING, 1, FALSE, GTK_CSS_FONT_KERNING_NONE, "none" }
+ { &GTK_CSS_VALUE_FONT_KERNING, 1, TRUE, GTK_CSS_FONT_KERNING_AUTO, "auto" },
+ { &GTK_CSS_VALUE_FONT_KERNING, 1, TRUE, GTK_CSS_FONT_KERNING_NORMAL, "normal" },
+ { &GTK_CSS_VALUE_FONT_KERNING, 1, TRUE, GTK_CSS_FONT_KERNING_NONE, "none" }
};
GtkCssValue *
@@ -1009,9 +1009,9 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_VARIANT_POSITION = {
};
static GtkCssValue font_variant_position_values[] = {
- { &GTK_CSS_VALUE_FONT_VARIANT_POSITION, 1, FALSE, GTK_CSS_FONT_VARIANT_POSITION_NORMAL, "normal" },
- { &GTK_CSS_VALUE_FONT_VARIANT_POSITION, 1, FALSE, GTK_CSS_FONT_VARIANT_POSITION_SUB, "sub" },
- { &GTK_CSS_VALUE_FONT_VARIANT_POSITION, 1, FALSE, GTK_CSS_FONT_VARIANT_POSITION_SUPER, "super" }
+ { &GTK_CSS_VALUE_FONT_VARIANT_POSITION, 1, TRUE, GTK_CSS_FONT_VARIANT_POSITION_NORMAL, "normal" },
+ { &GTK_CSS_VALUE_FONT_VARIANT_POSITION, 1, TRUE, GTK_CSS_FONT_VARIANT_POSITION_SUB, "sub" },
+ { &GTK_CSS_VALUE_FONT_VARIANT_POSITION, 1, TRUE, GTK_CSS_FONT_VARIANT_POSITION_SUPER, "super" }
};
GtkCssValue *
@@ -1066,13 +1066,13 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_VARIANT_CAPS = {
};
static GtkCssValue font_variant_caps_values[] = {
- { &GTK_CSS_VALUE_FONT_VARIANT_CAPS, 1, FALSE, GTK_CSS_FONT_VARIANT_CAPS_NORMAL, "normal" },
- { &GTK_CSS_VALUE_FONT_VARIANT_CAPS, 1, FALSE, GTK_CSS_FONT_VARIANT_CAPS_SMALL_CAPS, "small-caps" },
- { &GTK_CSS_VALUE_FONT_VARIANT_CAPS, 1, FALSE, GTK_CSS_FONT_VARIANT_CAPS_ALL_SMALL_CAPS, "all-small-caps" },
- { &GTK_CSS_VALUE_FONT_VARIANT_CAPS, 1, FALSE, GTK_CSS_FONT_VARIANT_CAPS_PETITE_CAPS, "petite-caps" },
- { &GTK_CSS_VALUE_FONT_VARIANT_CAPS, 1, FALSE, GTK_CSS_FONT_VARIANT_CAPS_ALL_PETITE_CAPS, "all-petite-caps" },
- { &GTK_CSS_VALUE_FONT_VARIANT_CAPS, 1, FALSE, GTK_CSS_FONT_VARIANT_CAPS_UNICASE, "unicase" },
- { &GTK_CSS_VALUE_FONT_VARIANT_CAPS, 1, FALSE, GTK_CSS_FONT_VARIANT_CAPS_TITLING_CAPS, "titling-caps" }
+ { &GTK_CSS_VALUE_FONT_VARIANT_CAPS, 1, TRUE, GTK_CSS_FONT_VARIANT_CAPS_NORMAL, "normal" },
+ { &GTK_CSS_VALUE_FONT_VARIANT_CAPS, 1, TRUE, GTK_CSS_FONT_VARIANT_CAPS_SMALL_CAPS, "small-caps" },
+ { &GTK_CSS_VALUE_FONT_VARIANT_CAPS, 1, TRUE, GTK_CSS_FONT_VARIANT_CAPS_ALL_SMALL_CAPS, "all-small-caps" },
+ { &GTK_CSS_VALUE_FONT_VARIANT_CAPS, 1, TRUE, GTK_CSS_FONT_VARIANT_CAPS_PETITE_CAPS, "petite-caps" },
+ { &GTK_CSS_VALUE_FONT_VARIANT_CAPS, 1, TRUE, GTK_CSS_FONT_VARIANT_CAPS_ALL_PETITE_CAPS, "all-petite-caps" },
+ { &GTK_CSS_VALUE_FONT_VARIANT_CAPS, 1, TRUE, GTK_CSS_FONT_VARIANT_CAPS_UNICASE, "unicase" },
+ { &GTK_CSS_VALUE_FONT_VARIANT_CAPS, 1, TRUE, GTK_CSS_FONT_VARIANT_CAPS_TITLING_CAPS, "titling-caps" }
};
GtkCssValue *
@@ -1127,8 +1127,8 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_VARIANT_ALTERNATE = {
};
static GtkCssValue font_variant_alternate_values[] = {
- { &GTK_CSS_VALUE_FONT_VARIANT_ALTERNATE, 1, FALSE, GTK_CSS_FONT_VARIANT_ALTERNATE_NORMAL, "normal" },
- { &GTK_CSS_VALUE_FONT_VARIANT_ALTERNATE, 1, FALSE, GTK_CSS_FONT_VARIANT_ALTERNATE_HISTORICAL_FORMS, "historical-forms" }
+ { &GTK_CSS_VALUE_FONT_VARIANT_ALTERNATE, 1, TRUE, GTK_CSS_FONT_VARIANT_ALTERNATE_NORMAL, "normal" },
+ { &GTK_CSS_VALUE_FONT_VARIANT_ALTERNATE, 1, TRUE, GTK_CSS_FONT_VARIANT_ALTERNATE_HISTORICAL_FORMS, "historical-forms" }
};
GtkCssValue *
@@ -1271,6 +1271,7 @@ _gtk_css_font_variant_ligature_value_new (GtkCssFontVariantLigature ligatures)
value = _gtk_css_value_new (GtkCssValue, &GTK_CSS_VALUE_FONT_VARIANT_LIGATURE);
value->value = ligatures;
value->name = NULL;
+ value->is_computed = TRUE;
return value;
}
@@ -1374,6 +1375,7 @@ _gtk_css_font_variant_numeric_value_new (GtkCssFontVariantNumeric numeric)
value = _gtk_css_value_new (GtkCssValue, &GTK_CSS_VALUE_FONT_VARIANT_NUMERIC);
value->value = numeric;
value->name = NULL;
+ value->is_computed = TRUE;
return value;
}
@@ -1517,6 +1519,7 @@ _gtk_css_font_variant_east_asian_value_new (GtkCssFontVariantEastAsian east_asia
value = _gtk_css_value_new (GtkCssValue, &GTK_CSS_VALUE_FONT_VARIANT_EAST_ASIAN);
value->value = east_asian;
value->name = NULL;
+ value->is_computed = TRUE;
return value;
}