summaryrefslogtreecommitdiff
path: root/gtk/gtkcssnodedeclaration.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2014-12-21 20:26:26 +0100
committerBenjamin Otte <otte@redhat.com>2015-01-07 14:26:48 +0100
commit26f36ef8aefb81c3d87f4c577a248efd77733e2d (patch)
tree7c75709512a7cad4ba14e6a492ee5a70ebeff459 /gtk/gtkcssnodedeclaration.c
parent9645daf48fa28c26ff623fc9541a860217426e60 (diff)
downloadgtk+-26f36ef8aefb81c3d87f4c577a248efd77733e2d.tar.gz
cssnodedeclaration: Store the GType of the node
Diffstat (limited to 'gtk/gtkcssnodedeclaration.c')
-rw-r--r--gtk/gtkcssnodedeclaration.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/gtk/gtkcssnodedeclaration.c b/gtk/gtkcssnodedeclaration.c
index 1c099304c0..e5c718708a 100644
--- a/gtk/gtkcssnodedeclaration.c
+++ b/gtk/gtkcssnodedeclaration.c
@@ -32,6 +32,7 @@ struct _GtkRegion
struct _GtkCssNodeDeclaration {
guint refcount;
GtkJunctionSides junction_sides;
+ GType type;
GtkStateFlags state;
guint n_classes;
guint n_regions;
@@ -161,6 +162,25 @@ gtk_css_node_declaration_get_junction_sides (const GtkCssNodeDeclaration *decl)
}
gboolean
+gtk_css_node_declaration_set_type (GtkCssNodeDeclaration **decl,
+ GType type)
+{
+ if ((*decl)->type == type)
+ return FALSE;
+
+ gtk_css_node_declaration_make_writable (decl);
+ (*decl)->type = type;
+
+ return TRUE;
+}
+
+GType
+gtk_css_node_declaration_get_type (const GtkCssNodeDeclaration *decl)
+{
+ return decl->type;
+}
+
+gboolean
gtk_css_node_declaration_set_state (GtkCssNodeDeclaration **decl,
GtkStateFlags state)
{
@@ -426,7 +446,7 @@ gtk_css_node_declaration_hash (gconstpointer elem)
GtkRegion *regions;
guint hash, i;
- hash = 0;
+ hash = (guint) decl->type;
classes = get_classes (decl);
for (i = 0; i < decl->n_classes; i++)
@@ -462,6 +482,9 @@ gtk_css_node_declaration_equal (gconstpointer elem1,
if (decl1 == decl2)
return TRUE;
+ if (decl1->type != decl2->type)
+ return FALSE;
+
if (decl1->state != decl2->state)
return FALSE;