[gtk/wip/otte/css: 6/16] cssnode: Remove init_matcher() vfunc



commit 8e549ec691b6ad1842ef9be63920d9ea80368a46
Author: Benjamin Otte <otte redhat com>
Date:   Thu Jan 23 02:28:46 2020 +0100

    cssnode: Remove init_matcher() vfunc
    
    It's unused.

 gtk/gtkcssmatcher.c     |  6 ++++--
 gtk/gtkcssnode.c        | 33 ++++++---------------------------
 gtk/gtkcssnodeprivate.h |  4 ----
 gtk/gtkcsswidgetnode.c  | 13 -------------
 4 files changed, 10 insertions(+), 46 deletions(-)
---
diff --git a/gtk/gtkcssmatcher.c b/gtk/gtkcssmatcher.c
index b1fb4fe404..4f85eb1810 100644
--- a/gtk/gtkcssmatcher.c
+++ b/gtk/gtkcssmatcher.c
@@ -49,7 +49,8 @@ gtk_css_matcher_node_get_parent (GtkCssMatcher       *matcher,
   if (node == NULL)
     return FALSE;
 
-  return gtk_css_node_init_matcher (node, matcher);
+  _gtk_css_matcher_node_init (matcher, node);
+  return TRUE;
 }
 
 static GtkCssNode *
@@ -82,7 +83,8 @@ gtk_css_matcher_node_get_previous (GtkCssMatcher       *matcher,
   if (node == NULL)
     return FALSE;
 
-  return gtk_css_node_init_matcher (node, matcher);
+  _gtk_css_matcher_node_init (matcher, node);
+  return TRUE;
 }
 
 static gboolean
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index 1b45366f38..59e16e1495 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -383,16 +383,12 @@ gtk_css_node_create_style (GtkCssNode   *cssnode,
       style_change = gtk_css_static_style_get_change (gtk_css_style_get_static_style (cssnode->style));
     }
 
-  if (gtk_css_node_init_matcher (cssnode, &matcher))
-    style = gtk_css_static_style_new_compute (gtk_css_node_get_style_provider (cssnode),
-                                              &matcher,
-                                              parent,
-                                              style_change);
-  else
-    style = gtk_css_static_style_new_compute (gtk_css_node_get_style_provider (cssnode),
-                                              NULL,
-                                              parent,
-                                              style_change);
+  _gtk_css_matcher_node_init (&matcher, cssnode);
+
+  style = gtk_css_static_style_new_compute (gtk_css_node_get_style_provider (cssnode),
+                                            &matcher,
+                                            parent,
+                                            style_change);
 
   store_in_global_parent_cache (cssnode, decl, style);
 
@@ -488,15 +484,6 @@ gtk_css_node_real_validate (GtkCssNode *node)
 {
 }
 
-static gboolean
-gtk_css_node_real_init_matcher (GtkCssNode     *cssnode,
-                                GtkCssMatcher  *matcher)
-{
-  _gtk_css_matcher_node_init (matcher, cssnode);
-
-  return TRUE;
-}
-
 static GtkStyleProvider *
 gtk_css_node_real_get_style_provider (GtkCssNode *cssnode)
 {
@@ -576,7 +563,6 @@ gtk_css_node_class_init (GtkCssNodeClass *klass)
   klass->validate = gtk_css_node_real_validate;
   klass->queue_validate = gtk_css_node_real_queue_validate;
   klass->dequeue_validate = gtk_css_node_real_dequeue_validate;
-  klass->init_matcher = gtk_css_node_real_init_matcher;
   klass->get_style_provider = gtk_css_node_real_get_style_provider;
   klass->get_frame_clock = gtk_css_node_real_get_frame_clock;
 
@@ -1371,13 +1357,6 @@ gtk_css_node_validate (GtkCssNode *cssnode)
     }
 }
 
-gboolean
-gtk_css_node_init_matcher (GtkCssNode     *cssnode,
-                           GtkCssMatcher  *matcher)
-{
-  return GTK_CSS_NODE_GET_CLASS (cssnode)->init_matcher (cssnode, matcher);
-}
-
 GtkStyleProvider *
 gtk_css_node_get_style_provider (GtkCssNode *cssnode)
 {
diff --git a/gtk/gtkcssnodeprivate.h b/gtk/gtkcssnodeprivate.h
index ae8597c796..9f49e09b65 100644
--- a/gtk/gtkcssnodeprivate.h
+++ b/gtk/gtkcssnodeprivate.h
@@ -76,8 +76,6 @@ struct _GtkCssNodeClass
   void                  (* style_changed)               (GtkCssNode            *cssnode,
                                                          GtkCssStyleChange     *style_change);
 
-  gboolean              (* init_matcher)                (GtkCssNode            *cssnode,
-                                                         GtkCssMatcher         *matcher);
   /* get style provider to use or NULL to use parent's */
   GtkStyleProvider *    (* get_style_provider)          (GtkCssNode            *cssnode);
   /* get frame clock or NULL (only relevant for root node) */
@@ -150,8 +148,6 @@ void                    gtk_css_node_invalidate         (GtkCssNode            *
                                                          GtkCssChange           change);
 void                    gtk_css_node_validate           (GtkCssNode            *cssnode);
 
-gboolean                gtk_css_node_init_matcher       (GtkCssNode            *cssnode,
-                                                         GtkCssMatcher         *matcher);
 GtkStyleProvider *      gtk_css_node_get_style_provider (GtkCssNode            *cssnode) G_GNUC_PURE;
 
 void                    gtk_css_node_print              (GtkCssNode                *cssnode,
diff --git a/gtk/gtkcsswidgetnode.c b/gtk/gtkcsswidgetnode.c
index d71cd21f2d..90a0127661 100644
--- a/gtk/gtkcsswidgetnode.c
+++ b/gtk/gtkcsswidgetnode.c
@@ -107,18 +107,6 @@ gtk_css_widget_node_validate (GtkCssNode *node)
   gtk_css_style_change_finish (&change);
 }
 
-static gboolean
-gtk_css_widget_node_init_matcher (GtkCssNode     *node,
-                                  GtkCssMatcher  *matcher)
-{
-  GtkCssWidgetNode *widget_node = GTK_CSS_WIDGET_NODE (node);
-
-  if (widget_node->widget == NULL)
-    return FALSE;
-
-  return GTK_CSS_NODE_CLASS (gtk_css_widget_node_parent_class)->init_matcher (node, matcher);
-}
-
 static GtkStyleProvider *
 gtk_css_widget_node_get_style_provider (GtkCssNode *node)
 {
@@ -162,7 +150,6 @@ gtk_css_widget_node_class_init (GtkCssWidgetNodeClass *klass)
   node_class->validate = gtk_css_widget_node_validate;
   node_class->queue_validate = gtk_css_widget_node_queue_validate;
   node_class->dequeue_validate = gtk_css_widget_node_dequeue_validate;
-  node_class->init_matcher = gtk_css_widget_node_init_matcher;
   node_class->get_style_provider = gtk_css_widget_node_get_style_provider;
   node_class->get_frame_clock = gtk_css_widget_node_get_frame_clock;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]