forked from AuroraMiddleware/gtk
GtkCssProvider: refactor out selector matching.
This commit is contained in:
parent
eec75f1f59
commit
eaddc9f254
@ -472,17 +472,15 @@ struct StylePriorityInfo
|
||||
GtkStateType state;
|
||||
};
|
||||
|
||||
static GtkStyleSet *
|
||||
gtk_style_get_style (GtkStyleProvider *provider,
|
||||
GtkWidgetPath *path)
|
||||
static GArray *
|
||||
css_provider_get_selectors (GtkCssProvider *css_provider,
|
||||
GtkWidgetPath *path)
|
||||
{
|
||||
GtkCssProviderPrivate *priv;
|
||||
GtkStyleSet *set;
|
||||
GArray *priority_info;
|
||||
guint i, j;
|
||||
|
||||
priv = GTK_CSS_PROVIDER_GET_PRIVATE (provider);
|
||||
set = gtk_style_set_new ();
|
||||
priv = GTK_CSS_PROVIDER_GET_PRIVATE (css_provider);
|
||||
priority_info = g_array_new (FALSE, FALSE, sizeof (StylePriorityInfo));
|
||||
|
||||
for (i = 0; i < priv->selectors_info->len; i++)
|
||||
@ -520,6 +518,23 @@ gtk_style_get_style (GtkStyleProvider *provider,
|
||||
g_array_append_val (priority_info, new);
|
||||
}
|
||||
|
||||
return priority_info;
|
||||
}
|
||||
|
||||
static GtkStyleSet *
|
||||
gtk_css_provider_get_style (GtkStyleProvider *provider,
|
||||
GtkWidgetPath *path)
|
||||
{
|
||||
GtkCssProviderPrivate *priv;
|
||||
GtkStyleSet *set;
|
||||
GArray *priority_info;
|
||||
guint i;
|
||||
|
||||
priv = GTK_CSS_PROVIDER_GET_PRIVATE (provider);
|
||||
set = gtk_style_set_new ();
|
||||
|
||||
priority_info = css_provider_get_selectors (GTK_CSS_PROVIDER (provider), path);
|
||||
|
||||
for (i = 0; i < priority_info->len; i++)
|
||||
{
|
||||
StylePriorityInfo *info;
|
||||
|
Loading…
Reference in New Issue
Block a user