[gtk+] widgetnode: We never need widget paths anymore
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widgetnode: We never need widget paths anymore
- Date: Sat, 19 Nov 2016 17:08:58 +0000 (UTC)
commit 9dae0a9b00db3be2b4f53efee6d3d20d34f89627
Author: Benjamin Otte <otte redhat com>
Date: Sat Nov 19 18:06:50 2016 +0100
widgetnode: We never need widget paths anymore
Backwards compat is not necessary in GTK4.
gtk/gtkcsswidgetnode.c | 47 +----------------------------------------------
1 files changed, 1 insertions(+), 46 deletions(-)
---
diff --git a/gtk/gtkcsswidgetnode.c b/gtk/gtkcsswidgetnode.c
index 4e63c3f..a112d7c 100644
--- a/gtk/gtkcsswidgetnode.c
+++ b/gtk/gtkcsswidgetnode.c
@@ -140,46 +140,6 @@ gtk_css_widget_node_validate (GtkCssNode *node)
gtk_css_style_change_finish (&change);
}
-typedef GtkWidgetPath * (* GetPathForChildFunc) (GtkContainer *, GtkWidget *);
-
-static gboolean
-widget_needs_widget_path (GtkWidget *widget)
-{
- static GetPathForChildFunc funcs[2];
- GtkContainerClass *class;
- GtkWidget *parent;
- GetPathForChildFunc parent_func;
- guint i;
-
- if (G_UNLIKELY (funcs[0] == NULL))
- {
- i = 0;
-
- class = (GtkContainerClass*)g_type_class_ref (GTK_TYPE_CONTAINER);
- funcs[i++] = class->get_path_for_child;
- g_type_class_unref (class);
-
- class = (GtkContainerClass*)g_type_class_ref (GTK_TYPE_BOX);
- funcs[i++] = class->get_path_for_child;
- g_type_class_unref (class);
-
- g_assert (i == G_N_ELEMENTS (funcs));
- }
-
- parent = _gtk_widget_get_parent (widget);
- if (parent == NULL)
- return FALSE;
-
- parent_func = GTK_CONTAINER_GET_CLASS (GTK_CONTAINER (parent))->get_path_for_child;
- for (i = 0; i < G_N_ELEMENTS (funcs); i++)
- {
- if (funcs[i] == parent_func)
- return FALSE;
- }
-
- return TRUE;
-}
-
static gboolean
gtk_css_widget_node_init_matcher (GtkCssNode *node,
GtkCssMatcher *matcher)
@@ -189,12 +149,7 @@ gtk_css_widget_node_init_matcher (GtkCssNode *node,
if (widget_node->widget == NULL)
return FALSE;
- if (!widget_needs_widget_path (widget_node->widget))
- return GTK_CSS_NODE_CLASS (gtk_css_widget_node_parent_class)->init_matcher (node, matcher);
-
- return _gtk_css_matcher_init (matcher,
- gtk_widget_get_path (widget_node->widget),
- gtk_css_node_get_declaration (node));
+ return GTK_CSS_NODE_CLASS (gtk_css_widget_node_parent_class)->init_matcher (node, matcher);
}
static GtkWidgetPath *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]