summaryrefslogtreecommitdiff
path: root/gtk/gtksnapshot.h
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-12-13 09:40:24 +0100
committerBenjamin Otte <otte@redhat.com>2016-12-20 18:01:10 +0100
commit1137483d156a9062a746b07a6958a4057c115f6c (patch)
tree3a6fa6dba1c79ee4f98b8993bb871faaa005cda2 /gtk/gtksnapshot.h
parent1f988d8b050b039f031122e906b0abb72f227cac (diff)
downloadgtk+-1137483d156a9062a746b07a6958a4057c115f6c.tar.gz
snapshot: Work on pushing and popping again
It is now possible to call push() subfunctions for simple container nodes with just a single child. So you can for example gtk_snapshot_push_clip() a clip region that all the nodes that get appended later will then obey. gtk_snapshot_pop() will then not return a container node, but a clip node containing the container node (and similar for the transform example). This is implemented internally by providing a "collect function" when pushing that is called when popping to collects all the accumulated nodes and combine them into the single node that gets returned. To simplify things even more, gtk_snapshot_pop_and_append() has been added, which pops the currently pushed node and appends it to the parent. The icon rendering code has been converted to this approach.
Diffstat (limited to 'gtk/gtksnapshot.h')
-rw-r--r--gtk/gtksnapshot.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk/gtksnapshot.h b/gtk/gtksnapshot.h
index 7b7e5efe09..5f4bb4b474 100644
--- a/gtk/gtksnapshot.h
+++ b/gtk/gtksnapshot.h
@@ -42,7 +42,19 @@ void gtk_snapshot_push (GtkSnapshot
const char *name,
...) G_GNUC_PRINTF (3, 4);
GDK_AVAILABLE_IN_3_90
+void gtk_snapshot_push_transform (GtkSnapshot *snapshot,
+ const graphene_matrix_t*transform,
+ const char *name,
+ ...) G_GNUC_PRINTF (3, 4);
+GDK_AVAILABLE_IN_3_90
+void gtk_snapshot_push_clip (GtkSnapshot *snapshot,
+ const graphene_rect_t *bounds,
+ const char *name,
+ ...) G_GNUC_PRINTF (3, 4);
+GDK_AVAILABLE_IN_3_90
GskRenderNode * gtk_snapshot_pop (GtkSnapshot *snapshot) G_GNUC_WARN_UNUSED_RESULT;
+GDK_AVAILABLE_IN_3_90
+void gtk_snapshot_pop_and_append (GtkSnapshot *snapshot);
GDK_AVAILABLE_IN_3_90
void gtk_snapshot_translate_2d (GtkSnapshot *snapshot,