summaryrefslogtreecommitdiff
path: root/gtk/gtksnapshotprivate.h
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-03-18 19:21:33 +0100
committerBenjamin Otte <otte@redhat.com>2018-03-18 19:21:33 +0100
commitea84e974e6eb8565554c8514cf18a326e5b256ed (patch)
tree8275f6c6df004361fa4e535ad2bb12bca4a37086 /gtk/gtksnapshotprivate.h
parentabc9b944f9153b5e770f0127589744c8b3f629c0 (diff)
downloadgtk+-ea84e974e6eb8565554c8514cf18a326e5b256ed.tar.gz
snapshot: Turn into GObject
This makes GdkSnapshot the base class for GtkSnapshot and hopefully stops confusing bindings. C code should see no difference to before.
Diffstat (limited to 'gtk/gtksnapshotprivate.h')
-rw-r--r--gtk/gtksnapshotprivate.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/gtk/gtksnapshotprivate.h b/gtk/gtksnapshotprivate.h
index 370784e27d..d6e534deef 100644
--- a/gtk/gtksnapshotprivate.h
+++ b/gtk/gtksnapshotprivate.h
@@ -80,14 +80,24 @@ struct _GtkSnapshotState {
} data;
};
+/* This is a nasty little hack. We typedef GtkSnapshot to the fake object GdkSnapshot
+ * so that we don't need to typecast between them.
+ * After all, the GdkSnapshot only exist so poor language bindings don't trip. Hardcore
+ * C code can just blatantly ignore such layering violations with a typedef.
+ */
struct _GdkSnapshot {
- int ref_count;
+ GObject parent_instance; /* it's really GdkSnapshot, but don't tell anyone! */
+
gboolean record_names;
GskRenderer *renderer;
GArray *state_stack;
GPtrArray *nodes;
};
+struct _GtkSnapshotClass {
+ GObjectClass parent_class; /* it's really GdkSnapshotClass, but don't tell anyone! */
+};
+
G_END_DECLS
#endif /* __GTK_SNAPSHOT_PRIVATE_H__ */