lookup: Add a getter

This will make it easier to change the internals
in the next commits.
This commit is contained in:
Matthias Clasen
2020-02-10 18:27:15 -05:00
parent acb5c2abef
commit 6fb18b74b4
2 changed files with 10 additions and 2 deletions

View File

@@ -58,6 +58,13 @@ gtk_css_lookup_get_set_values (const GtkCssLookup *lookup)
return lookup->set_values;
}
static inline GtkCssLookupValue *
gtk_css_lookup_get (GtkCssLookup *lookup,
guint id)
{
return &lookup->values[id];
}
G_END_DECLS
#endif /* __GTK_CSS_LOOKUP_PRIVATE_H__ */

View File

@@ -206,12 +206,13 @@ gtk_css_ ## NAME ## _values_new_compute (GtkCssStaticStyle *sstyle, \
for (i = 0; i < G_N_ELEMENTS (NAME ## _props); i++) \
{ \
guint id = NAME ## _props[i]; \
GtkCssLookupValue *value = gtk_css_lookup_get (lookup, id); \
gtk_css_static_style_compute_value (sstyle, \
provider, \
parent_style, \
id, \
lookup->values[id].value, \
lookup->values[id].section); \
value ? value->value : NULL, \
value ? value->section : NULL); \
} \
} \
static GtkBitmask * gtk_css_ ## NAME ## _values_mask; \