summaryrefslogtreecommitdiff
path: root/gtk/gtkcssnodedeclaration.c
diff options
context:
space:
mode:
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;