diff options
author | Benjamin Otte <otte@redhat.com> | 2015-02-09 11:29:48 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-03-18 15:23:30 +0100 |
commit | 76ca9a9181a5d7e71896cf74753bff68df8752b2 (patch) | |
tree | 6cc57765aa1b6394db2ec73353720d55db0b3913 /gtk/gtkcsspathnode.c | |
parent | 2bf7bdd651bb4cdec54831667c11fbead43b1246 (diff) | |
download | gtk+-76ca9a9181a5d7e71896cf74753bff68df8752b2.tar.gz |
cssnode: Make path node create matcher without copying
... the WidgetPath. This uses the functionality introduced in the
previous commits.
Diffstat (limited to 'gtk/gtkcsspathnode.c')
-rw-r--r-- | gtk/gtkcsspathnode.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk/gtkcsspathnode.c b/gtk/gtkcsspathnode.c index 1e5018202e..e3c2e16002 100644 --- a/gtk/gtkcsspathnode.c +++ b/gtk/gtkcsspathnode.c @@ -47,6 +47,22 @@ gtk_css_path_node_invalidate (GtkCssNode *node) } } +gboolean +gtk_css_path_node_real_init_matcher (GtkCssNode *node, + GtkCssMatcher *matcher, + GtkWidgetPath **path_out) +{ + GtkCssPathNode *path_node = GTK_CSS_PATH_NODE (node); + + if (path_node->path == NULL || + gtk_widget_path_length (path_node->path) == 0) + return FALSE; + + return _gtk_css_matcher_init (matcher, + path_node->path, + gtk_css_node_get_declaration (node)); +} + static GtkWidgetPath * gtk_css_path_node_real_create_widget_path (GtkCssNode *node) { @@ -98,6 +114,7 @@ gtk_css_path_node_class_init (GtkCssPathNodeClass *klass) object_class->finalize = gtk_css_path_node_finalize; node_class->invalidate = gtk_css_path_node_invalidate; + node_class->init_matcher = gtk_css_path_node_real_init_matcher; node_class->create_widget_path = gtk_css_path_node_real_create_widget_path; node_class->get_widget_path = gtk_css_path_node_real_get_widget_path; node_class->get_style_provider = gtk_css_path_node_get_style_provider; |