From 9bab218314201437f22b6cd1442cc8e5ed1c8f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 8 Jul 2018 10:02:43 +0200 Subject: [PATCH] aspectframe: Remove priv pointer --- gtk/gtkaspectframe.c | 27 ++++++++++++--------------- gtk/gtkaspectframe.h | 6 +----- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/gtk/gtkaspectframe.c b/gtk/gtkaspectframe.c index c4b0d7af43..f07f03ca24 100644 --- a/gtk/gtkaspectframe.c +++ b/gtk/gtkaspectframe.c @@ -56,13 +56,13 @@ -struct _GtkAspectFramePrivate +typedef struct { gboolean obey_child; gfloat xalign; gfloat yalign; gfloat ratio; -}; +} GtkAspectFramePrivate; enum { @@ -138,12 +138,12 @@ gtk_aspect_frame_class_init (GtkAspectFrameClass *class) static void gtk_aspect_frame_init (GtkAspectFrame *aspect_frame) { - aspect_frame->priv = gtk_aspect_frame_get_instance_private (aspect_frame); + GtkAspectFramePrivate *priv = gtk_aspect_frame_get_instance_private (aspect_frame); - aspect_frame->priv->xalign = 0.5; - aspect_frame->priv->yalign = 0.5; - aspect_frame->priv->ratio = 1.0; - aspect_frame->priv->obey_child = TRUE; + priv->xalign = 0.5; + priv->yalign = 0.5; + priv->ratio = 1.0; + priv->obey_child = TRUE; } static void @@ -153,7 +153,7 @@ gtk_aspect_frame_set_property (GObject *object, GParamSpec *pspec) { GtkAspectFrame *aspect_frame = GTK_ASPECT_FRAME (object); - GtkAspectFramePrivate *priv = aspect_frame->priv; + GtkAspectFramePrivate *priv = gtk_aspect_frame_get_instance_private (aspect_frame); switch (prop_id) { @@ -199,7 +199,7 @@ gtk_aspect_frame_get_property (GObject *object, GParamSpec *pspec) { GtkAspectFrame *aspect_frame = GTK_ASPECT_FRAME (object); - GtkAspectFramePrivate *priv = aspect_frame->priv; + GtkAspectFramePrivate *priv = gtk_aspect_frame_get_instance_private (aspect_frame); switch (prop_id) { @@ -249,8 +249,7 @@ gtk_aspect_frame_new (const gchar *label, GtkAspectFramePrivate *priv; aspect_frame = g_object_new (GTK_TYPE_ASPECT_FRAME, NULL); - - priv = aspect_frame->priv; + priv = gtk_aspect_frame_get_instance_private (aspect_frame); priv->xalign = CLAMP (xalign, 0.0, 1.0); priv->yalign = CLAMP (yalign, 0.0, 1.0); @@ -284,12 +283,10 @@ gtk_aspect_frame_set (GtkAspectFrame *aspect_frame, gfloat ratio, gboolean obey_child) { - GtkAspectFramePrivate *priv; + GtkAspectFramePrivate *priv = gtk_aspect_frame_get_instance_private (aspect_frame); g_return_if_fail (GTK_IS_ASPECT_FRAME (aspect_frame)); - priv = aspect_frame->priv; - xalign = CLAMP (xalign, 0.0, 1.0); yalign = CLAMP (yalign, 0.0, 1.0); ratio = CLAMP (ratio, MIN_RATIO, MAX_RATIO); @@ -333,7 +330,7 @@ gtk_aspect_frame_compute_child_allocation (GtkFrame *frame, GtkAllocation *child_allocation) { GtkAspectFrame *aspect_frame = GTK_ASPECT_FRAME (frame); - GtkAspectFramePrivate *priv = aspect_frame->priv; + GtkAspectFramePrivate *priv = gtk_aspect_frame_get_instance_private (aspect_frame); GtkBin *bin = GTK_BIN (frame); GtkWidget *child; gdouble ratio; diff --git a/gtk/gtkaspectframe.h b/gtk/gtkaspectframe.h index be06f1fb18..6fd4be6535 100644 --- a/gtk/gtkaspectframe.h +++ b/gtk/gtkaspectframe.h @@ -43,15 +43,11 @@ G_BEGIN_DECLS #define GTK_ASPECT_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ASPECT_FRAME, GtkAspectFrameClass)) typedef struct _GtkAspectFrame GtkAspectFrame; -typedef struct _GtkAspectFramePrivate GtkAspectFramePrivate; typedef struct _GtkAspectFrameClass GtkAspectFrameClass; struct _GtkAspectFrame { - GtkFrame frame; - - /*< private >*/ - GtkAspectFramePrivate *priv; + GtkFrame parent_instance; }; /**