widget: Add gtk_widget_get_css_node()

and replace gtk_style_context_get_root() with it.
This commit is contained in:
Benjamin Otte 2015-02-09 22:27:44 +01:00
parent 507016cafc
commit b92fe2fa85
6 changed files with 12 additions and 8 deletions

View File

@ -1853,7 +1853,7 @@ gtk_container_idle_sizer (GdkFrameClock *clock,
current_time = g_get_monotonic_time ();
container->priv->restyle_pending = FALSE;
gtk_css_node_validate (gtk_style_context_get_root (gtk_widget_get_style_context (GTK_WIDGET (container))),
gtk_css_node_validate (gtk_widget_get_css_node (GTK_WIDGET (container)),
current_time,
empty);

View File

@ -181,6 +181,7 @@ static void gtk_style_context_impl_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
static GtkCssNode * gtk_style_context_get_root (GtkStyleContext *context);
G_DEFINE_TYPE_WITH_PRIVATE (GtkStyleContext, gtk_style_context, G_TYPE_OBJECT)
@ -459,7 +460,7 @@ gtk_style_context_is_saved (GtkStyleContext *context)
return context->priv->saved_nodes != NULL;
}
GtkCssNode *
static GtkCssNode *
gtk_style_context_get_root (GtkStyleContext *context)
{
GtkStyleContextPrivate *priv;

View File

@ -30,7 +30,6 @@ G_BEGIN_DECLS
GtkStyleContext *gtk_style_context_new_for_node (GtkCssNode *node);
GtkCssNode * gtk_style_context_get_root (GtkStyleContext *context);
void gtk_style_context_set_id (GtkStyleContext *context,
const char *id);
const char * gtk_style_context_get_id (GtkStyleContext *context);

View File

@ -16413,6 +16413,12 @@ _gtk_widget_style_context_invalidated (GtkWidget *widget)
}
}
GtkCssNode *
gtk_widget_get_css_node (GtkWidget *widget)
{
return widget->priv->cssnode;
}
/**
* gtk_widget_get_style_context:
* @widget: a #GtkWidget
@ -16466,10 +16472,7 @@ _gtk_widget_invalidate_style_context (GtkWidget *widget,
priv = widget->priv;
if (priv->context == NULL)
return;
gtk_css_node_invalidate (gtk_style_context_get_root (priv->context), change);
gtk_css_node_invalidate (priv->cssnode, change);
}
/**

View File

@ -32,6 +32,7 @@
G_BEGIN_DECLS
GtkCssNode * gtk_widget_get_css_node (GtkWidget *widget);
void _gtk_widget_set_visible_flag (GtkWidget *widget,
gboolean visible);
gboolean _gtk_widget_get_in_reparent (GtkWidget *widget);

View File

@ -5849,7 +5849,7 @@ gtk_window_show (GtkWidget *widget)
need_resize = _gtk_widget_get_alloc_needed (widget) || !gtk_widget_get_realized (widget);
empty = _gtk_bitmask_new ();
gtk_css_node_validate (gtk_style_context_get_root (gtk_widget_get_style_context (widget)),
gtk_css_node_validate (gtk_widget_get_css_node (widget),
g_get_monotonic_time (),
empty);
_gtk_bitmask_free (empty);