summaryrefslogtreecommitdiff
path: root/gtk/gtkcssnode.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-01-12 03:58:21 +0100
committerBenjamin Otte <otte@redhat.com>2015-03-18 15:23:29 +0100
commite2f6d4db431e7cb2e21e18bf36783d361697385c (patch)
tree0e767c9de6dfe1a62ac98208117ad7386c540a02 /gtk/gtkcssnode.c
parent726d8abb7d890ec696f933da6c1c8687ca640fa5 (diff)
downloadgtk+-e2f6d4db431e7cb2e21e18bf36783d361697385c.tar.gz
cssnode: Split into 3 objects
- GtkCssWidgetNode for style contexts owned by a widget - GtkCssPathNode for style contexts using a GtkWidgetPath - GtkCssTransientNode for nodes created with gtk_style_context_save()/restore()
Diffstat (limited to 'gtk/gtkcssnode.c')
-rw-r--r--gtk/gtkcssnode.c46
1 files changed, 28 insertions, 18 deletions
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index a4b5a6308a..86c0a07992 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -33,12 +33,27 @@ gtk_css_node_finalize (GObject *object)
G_OBJECT_CLASS (gtk_css_node_parent_class)->finalize (object);
}
+static GtkWidgetPath *
+gtk_css_node_real_create_widget_path (GtkCssNode *cssnode)
+{
+ return gtk_widget_path_new ();
+}
+
+static const GtkWidgetPath *
+gtk_css_node_real_get_widget_path (GtkCssNode *cssnode)
+{
+ return NULL;
+}
+
static void
gtk_css_node_class_init (GtkCssNodeClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gtk_css_node_finalize;
+
+ klass->create_widget_path = gtk_css_node_real_create_widget_path;
+ klass->get_widget_path = gtk_css_node_real_get_widget_path;
}
static void
@@ -47,24 +62,6 @@ gtk_css_node_init (GtkCssNode *cssnode)
cssnode->decl = gtk_css_node_declaration_new ();
}
-GtkCssNode *
-gtk_css_node_new (void)
-{
- return g_object_new (GTK_TYPE_CSS_NODE, NULL);
-}
-
-GtkCssNode *
-gtk_css_node_copy (GtkCssNode *cssnode)
-{
- GtkCssNode *copy;
-
- copy = gtk_css_node_new ();
- gtk_css_node_declaration_unref (copy->decl);
- copy->decl = gtk_css_node_declaration_ref (cssnode->decl);
-
- return copy;
-}
-
void
gtk_css_node_set_parent (GtkCssNode *cssnode,
GtkCssNode *parent)
@@ -220,3 +217,16 @@ gtk_css_node_dup_declaration (GtkCssNode *cssnode)
{
return gtk_css_node_declaration_ref (cssnode->decl);
}
+
+GtkWidgetPath *
+gtk_css_node_create_widget_path (GtkCssNode *cssnode)
+{
+ return GTK_CSS_NODE_GET_CLASS (cssnode)->create_widget_path (cssnode);
+}
+
+const GtkWidgetPath *
+gtk_css_node_get_widget_path (GtkCssNode *cssnode)
+{
+ return GTK_CSS_NODE_GET_CLASS (cssnode)->get_widget_path (cssnode);
+}
+