summaryrefslogtreecommitdiff
path: root/gtk/gtkcssnode.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-07-12 21:39:49 +0200
committerBenjamin Otte <otte@redhat.com>2015-07-16 06:15:13 +0200
commit6e4f42f97e4b61d9fb2c3e8ecc0ac9baa3eb890b (patch)
treefe6397faf7a322a2f372bfe45b63d0c817d05697 /gtk/gtkcssnode.c
parent79f2400c0dd769755b8e2034a9d574f567987c0d (diff)
downloadgtk+-6e4f42f97e4b61d9fb2c3e8ecc0ac9baa3eb890b.tar.gz
cssnode: Change API of some functions
gtk_css_node_set_after/before() are now called gtk_css_node_insert_after/before(). This brings them in line with other similar APIs (ie GtkListStore). And it allows easier usage of the API (see changes to gtkbox.c).
Diffstat (limited to 'gtk/gtkcssnode.c')
-rw-r--r--gtk/gtkcssnode.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index 0b88b916dd..8f1e4d9df5 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -741,27 +741,35 @@ gtk_css_node_set_parent (GtkCssNode *node,
}
void
-gtk_css_node_set_after (GtkCssNode *cssnode,
- GtkCssNode *previous_sibling)
+gtk_css_node_insert_after (GtkCssNode *parent,
+ GtkCssNode *cssnode,
+ GtkCssNode *previous_sibling)
{
- if (cssnode->previous_sibling == previous_sibling)
+ g_return_if_fail (previous_sibling == NULL || previous_sibling->parent == parent);
+
+ if (cssnode->previous_sibling == previous_sibling &&
+ cssnode->parent == parent)
return;
gtk_css_node_reposition (cssnode,
- previous_sibling->parent,
+ parent,
previous_sibling);
}
void
-gtk_css_node_set_before (GtkCssNode *cssnode,
- GtkCssNode *next_sibling)
+gtk_css_node_insert_before (GtkCssNode *parent,
+ GtkCssNode *cssnode,
+ GtkCssNode *next_sibling)
{
- if (cssnode->next_sibling == next_sibling)
+ g_return_if_fail (next_sibling == NULL || next_sibling->parent == parent);
+
+ if (cssnode->next_sibling == next_sibling &&
+ cssnode->parent == parent)
return;
gtk_css_node_reposition (cssnode,
- next_sibling->parent,
- next_sibling->previous_sibling);
+ parent,
+ next_sibling ? next_sibling->previous_sibling : parent->last_child);
}
GtkCssNode *