snapshot: "Inherit" from GdkSnapshot
authorBenjamin Otte <otte@redhat.com>
Fri, 16 Feb 2018 05:30:48 +0000 (06:30 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 16 Mar 2018 05:04:44 +0000 (06:04 +0100)
This is a neat trick to get around the circularity between GDK, GSK and
GTK that we inherit with the GdkPaintable interface.

GdkPaintable uses GtkSnapshot
GtkSnapshot creates GskRenderNodes
GskRenderNodes use GdkTextures
GdkTexture will soon implement GdkPaintable

This causes a loop that spans GDK, GSK and GTK and this is the easiest
way to resolve it without breaking bindings (at least that's the idea).

gtk/gtksnapshotprivate.h
gtk/gtktypes.h

index f78b5ede1999f1ec02f587e4b7a14bf329183140..370784e27df2e1e6ab63b5276f5b2c171db9d3db 100644 (file)
@@ -80,7 +80,7 @@ struct _GtkSnapshotState {
   } data;
 };
 
-struct _GtkSnapshot {
+struct _GdkSnapshot {
   int ref_count;
   gboolean               record_names;
   GskRenderer           *renderer;
index c38a84516574cf94532514cab9256b384d738cbd..b7298d00db9e361cb2e0dfb95c4f85d1aea44f28 100644 (file)
@@ -39,7 +39,7 @@ typedef struct _GtkClipboard         GtkClipboard;
 typedef struct _GtkRequisition        GtkRequisition;
 typedef struct _GtkSelectionData       GtkSelectionData;
 typedef struct _GtkSettings            GtkSettings;
-typedef struct _GtkSnapshot            GtkSnapshot;
+typedef GdkSnapshot                    GtkSnapshot;
 typedef struct _GtkStyleContext        GtkStyleContext;
 typedef struct _GtkTooltip             GtkTooltip;
 typedef struct _GtkWidget              GtkWidget;