Commit 0899ef7c authored by Emmanuele Bassi's avatar Emmanuele Bassi

gtk: Use new macros for defining private data

https://bugzilla.gnome.org/show_bug.cgi?id=702996
parent 365919d5
......@@ -175,9 +175,6 @@ struct _GtkAboutDialogPrivate
#define CREDITS_PAGE_ID 1
#define LICENSE_PAGE_ID 2
#define GTK_ABOUT_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_ABOUT_DIALOG, GtkAboutDialogPrivate))
enum
{
PROP_0,
......@@ -251,7 +248,7 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (GtkAboutDialog, gtk_about_dialog, GTK_TYPE_DIALOG)
G_DEFINE_TYPE_WITH_PRIVATE (GtkAboutDialog, gtk_about_dialog, GTK_TYPE_DIALOG)
static void
......@@ -581,8 +578,6 @@ gtk_about_dialog_class_init (GtkAboutDialogClass *klass)
gtk_widget_class_bind_callback (widget_class, text_view_key_press_event);
gtk_widget_class_bind_callback (widget_class, text_view_visibility_notify_event);
gtk_widget_class_bind_callback (widget_class, text_view_motion_notify_event);
g_type_class_add_private (object_class, sizeof (GtkAboutDialogPrivate));
}
static gboolean
......@@ -691,7 +686,7 @@ gtk_about_dialog_init (GtkAboutDialog *about)
GtkAboutDialogPrivate *priv;
/* Data */
priv = GTK_ABOUT_DIALOG_GET_PRIVATE (about);
priv = gtk_about_dialog_get_instance_private (about);
about->priv = priv;
priv->name = NULL;
......
......@@ -87,7 +87,7 @@ enum {
PROP_MODIFIER_MASK,
};
G_DEFINE_TYPE (GtkAccelGroup, gtk_accel_group, G_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_PRIVATE (GtkAccelGroup, gtk_accel_group, G_TYPE_OBJECT)
/* --- functions --- */
static void
......@@ -167,8 +167,6 @@ gtk_accel_group_class_init (GtkAccelGroupClass *class)
G_TYPE_UINT,
GDK_TYPE_MODIFIER_TYPE,
G_TYPE_CLOSURE);
g_type_class_add_private (object_class, sizeof (GtkAccelGroupPrivate));
}
static void
......@@ -225,9 +223,7 @@ gtk_accel_group_init (GtkAccelGroup *accel_group)
{
GtkAccelGroupPrivate *priv;
accel_group->priv = G_TYPE_INSTANCE_GET_PRIVATE (accel_group,
GTK_TYPE_ACCEL_GROUP,
GtkAccelGroupPrivate);
accel_group->priv = gtk_accel_group_get_instance_private (accel_group);
priv = accel_group->priv;
priv->lock_count = 0;
......
......@@ -129,7 +129,7 @@ static void gtk_accel_label_get_preferred_width (GtkWidget *wi
gint *nat_width);
G_DEFINE_TYPE (GtkAccelLabel, gtk_accel_label, GTK_TYPE_LABEL)
G_DEFINE_TYPE_WITH_PRIVATE (GtkAccelLabel, gtk_accel_label, GTK_TYPE_LABEL)
static void
gtk_accel_label_class_init (GtkAccelLabelClass *class)
......@@ -196,8 +196,6 @@ gtk_accel_label_class_init (GtkAccelLabelClass *class)
P_("The widget to be monitored for accelerator changes"),
GTK_TYPE_WIDGET,
GTK_PARAM_READWRITE));
g_type_class_add_private (gobject_class, sizeof (GtkAccelLabelPrivate));
}
static void
......@@ -253,9 +251,7 @@ gtk_accel_label_init (GtkAccelLabel *accel_label)
{
GtkAccelLabelPrivate *priv;
accel_label->priv = G_TYPE_INSTANCE_GET_PRIVATE (accel_label,
GTK_TYPE_ACCEL_LABEL,
GtkAccelLabelPrivate);
accel_label->priv = gtk_accel_label_get_instance_private (accel_label);
priv = accel_label->priv;
priv->accel_padding = 3;
......
......@@ -52,7 +52,7 @@ enum {
static void gtk_accessible_real_connect_widget_destroyed (GtkAccessible *accessible);
G_DEFINE_TYPE (GtkAccessible, gtk_accessible, ATK_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_PRIVATE (GtkAccessible, gtk_accessible, ATK_TYPE_OBJECT)
static void
gtk_accessible_set_property (GObject *object,
......@@ -96,9 +96,7 @@ gtk_accessible_get_property (GObject *object,
static void
gtk_accessible_init (GtkAccessible *accessible)
{
accessible->priv = G_TYPE_INSTANCE_GET_PRIVATE (accessible,
GTK_TYPE_ACCESSIBLE,
GtkAccessiblePrivate);
accessible->priv = gtk_accessible_get_instance_private (accessible);
}
static AtkStateSet *
......@@ -159,8 +157,6 @@ gtk_accessible_class_init (GtkAccessibleClass *klass)
P_("The widget referenced by this accessible."),
GTK_TYPE_WIDGET,
G_PARAM_READWRITE));
g_type_class_add_private (klass, sizeof (GtkAccessiblePrivate));
}
/**
......
......@@ -163,6 +163,7 @@ static void gtk_action_buildable_set_name (GtkBuildable *buildable,
static const gchar* gtk_action_buildable_get_name (GtkBuildable *buildable);
G_DEFINE_TYPE_WITH_CODE (GtkAction, gtk_action, G_TYPE_OBJECT,
G_ADD_PRIVATE (GtkAction)
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
gtk_action_buildable_init))
......@@ -514,17 +515,13 @@ gtk_action_class_init (GtkActionClass *klass)
G_STRUCT_OFFSET (GtkActionClass, activate), NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
g_type_class_add_private (gobject_class, sizeof (GtkActionPrivate));
}
static void
gtk_action_init (GtkAction *action)
{
action->private_data = G_TYPE_INSTANCE_GET_PRIVATE (action,
GTK_TYPE_ACTION,
GtkActionPrivate);
action->private_data = gtk_action_get_instance_private (action);
action->private_data->name = NULL;
action->private_data->label = NULL;
......
......@@ -171,53 +171,19 @@ static void gtk_action_group_buildable_custom_tag_end (GtkBuildable *buildable,
const gchar *tagname,
gpointer *user_data);
GType
gtk_action_group_get_type (void)
{
static GType type = 0;
if (!type)
{
const GTypeInfo type_info =
{
sizeof (GtkActionGroupClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gtk_action_group_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkActionGroup),
0, /* n_preallocs */
(GInstanceInitFunc) gtk_action_group_init,
};
const GInterfaceInfo buildable_info =
{
(GInterfaceInitFunc) gtk_action_group_buildable_init,
NULL,
NULL
};
type = g_type_register_static (G_TYPE_OBJECT, I_("GtkActionGroup"),
&type_info, 0);
g_type_add_interface_static (type,
GTK_TYPE_BUILDABLE,
&buildable_info);
}
return type;
}
static GObjectClass *parent_class = NULL;
static guint action_group_signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE_WITH_CODE (GtkActionGroup, gtk_action_group, G_TYPE_OBJECT,
G_ADD_PRIVATE (GtkActionGroup)
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
gtk_action_group_buildable_init))
static void
gtk_action_group_class_init (GtkActionGroupClass *klass)
{
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
gobject_class->finalize = gtk_action_group_finalize;
gobject_class->set_property = gtk_action_group_set_property;
......@@ -381,8 +347,6 @@ gtk_action_group_class_init (GtkActionGroupClass *klass)
_gtk_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
GTK_TYPE_ACTION);
g_type_class_add_private (gobject_class, sizeof (GtkActionGroupPrivate));
}
......@@ -396,22 +360,16 @@ remove_action (GtkAction *action)
static void
gtk_action_group_init (GtkActionGroup *action_group)
{
GtkActionGroupPrivate *private;
action_group->priv = G_TYPE_INSTANCE_GET_PRIVATE (action_group,
GTK_TYPE_ACTION_GROUP,
GtkActionGroupPrivate);
private = action_group->priv;
private->name = NULL;
private->sensitive = TRUE;
private->visible = TRUE;
private->actions = g_hash_table_new_full (g_str_hash, g_str_equal,
NULL,
(GDestroyNotify) remove_action);
private->translate_func = NULL;
private->translate_data = NULL;
private->translate_notify = NULL;
action_group->priv = gtk_action_group_get_instance_private (action_group);
action_group->priv->name = NULL;
action_group->priv->sensitive = TRUE;
action_group->priv->visible = TRUE;
action_group->priv->actions = g_hash_table_new_full (g_str_hash, g_str_equal,
NULL,
(GDestroyNotify) remove_action);
action_group->priv->translate_func = NULL;
action_group->priv->translate_data = NULL;
action_group->priv->translate_notify = NULL;
}
static void
......@@ -592,24 +550,18 @@ gtk_action_group_new (const gchar *name)
static void
gtk_action_group_finalize (GObject *object)
{
GtkActionGroup *self;
GtkActionGroupPrivate *private;
self = GTK_ACTION_GROUP (object);
private = self->priv;
GtkActionGroup *self = GTK_ACTION_GROUP (object);
g_free (private->name);
private->name = NULL;
g_free (self->priv->name);
g_hash_table_destroy (private->actions);
private->actions = NULL;
g_hash_table_destroy (self->priv->actions);
g_clear_object (&private->accel_group);
g_clear_object (&self->priv->accel_group);
if (private->translate_notify)
private->translate_notify (private->translate_data);
if (self->priv->translate_notify != NULL)
self->priv->translate_notify (self->priv->translate_data);
parent_class->finalize (object);
G_OBJECT_CLASS (gtk_action_group_parent_class)->finalize (object);
}
static void
......
......@@ -94,7 +94,7 @@ static guint adjustment_signals[LAST_SIGNAL] = { 0 };
static guint64 adjustment_changed_stamp = 0; /* protected by global gdk lock */
G_DEFINE_TYPE (GtkAdjustment, gtk_adjustment, G_TYPE_INITIALLY_UNOWNED)
G_DEFINE_TYPE_WITH_PRIVATE (GtkAdjustment, gtk_adjustment, G_TYPE_INITIALLY_UNOWNED)
static void
gtk_adjustment_class_init (GtkAdjustmentClass *class)
......@@ -246,16 +246,12 @@ gtk_adjustment_class_init (GtkAdjustmentClass *class)
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
g_type_class_add_private (class, sizeof (GtkAdjustmentPrivate));
}
static void
gtk_adjustment_init (GtkAdjustment *adjustment)
{
adjustment->priv = G_TYPE_INSTANCE_GET_PRIVATE (adjustment,
GTK_TYPE_ADJUSTMENT,
GtkAdjustmentPrivate);
adjustment->priv = gtk_adjustment_get_instance_private (adjustment);
}
static void
......
......@@ -115,7 +115,7 @@ static void gtk_alignment_get_preferred_height_and_baseline_for_width (GtkWidget
gint *minimum_baseline,
gint *natural_baseline);
G_DEFINE_TYPE (GtkAlignment, gtk_alignment, GTK_TYPE_BIN)
G_DEFINE_TYPE_WITH_PRIVATE (GtkAlignment, gtk_alignment, GTK_TYPE_BIN)
static void
gtk_alignment_class_init (GtkAlignmentClass *class)
......@@ -242,8 +242,6 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
G_MAXINT,
0,
GTK_PARAM_READWRITE));
g_type_class_add_private (gobject_class, sizeof (GtkAlignmentPrivate));
}
static void
......@@ -251,9 +249,7 @@ gtk_alignment_init (GtkAlignment *alignment)
{
GtkAlignmentPrivate *priv;
alignment->priv = G_TYPE_INSTANCE_GET_PRIVATE (alignment,
GTK_TYPE_ALIGNMENT,
GtkAlignmentPrivate);
alignment->priv = gtk_alignment_get_instance_private (alignment);
priv = alignment->priv;
gtk_widget_set_has_window (GTK_WIDGET (alignment), FALSE);
......
......@@ -101,10 +101,6 @@ static void real_insert_separator (GtkAppChooserButton *self,
static guint signals[NUM_SIGNALS] = { 0, };
G_DEFINE_TYPE_WITH_CODE (GtkAppChooserButton, gtk_app_chooser_button, GTK_TYPE_COMBO_BOX,
G_IMPLEMENT_INTERFACE (GTK_TYPE_APP_CHOOSER,
app_chooser_iface_init));
struct _GtkAppChooserButtonPrivate {
GtkListStore *store;
......@@ -117,6 +113,11 @@ struct _GtkAppChooserButtonPrivate {
GHashTable *custom_item_names;
};
G_DEFINE_TYPE_WITH_CODE (GtkAppChooserButton, gtk_app_chooser_button, GTK_TYPE_COMBO_BOX,
G_ADD_PRIVATE (GtkAppChooserButton)
G_IMPLEMENT_INTERFACE (GTK_TYPE_APP_CHOOSER,
app_chooser_iface_init));
static gboolean
row_separator_func (GtkTreeModel *model,
GtkTreeIter *iter,
......@@ -670,15 +671,12 @@ gtk_app_chooser_button_class_init (GtkAppChooserButtonClass *klass)
_gtk_marshal_VOID__STRING,
G_TYPE_NONE,
1, G_TYPE_STRING);
g_type_class_add_private (klass, sizeof (GtkAppChooserButtonPrivate));
}
static void
gtk_app_chooser_button_init (GtkAppChooserButton *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTK_TYPE_APP_CHOOSER_BUTTON,
GtkAppChooserButtonPrivate);
self->priv = gtk_app_chooser_button_get_instance_private (self);
self->priv->custom_item_names =
g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
......
......@@ -90,6 +90,7 @@ enum {
static void gtk_app_chooser_dialog_iface_init (GtkAppChooserIface *iface);
G_DEFINE_TYPE_WITH_CODE (GtkAppChooserDialog, gtk_app_chooser_dialog, GTK_TYPE_DIALOG,
G_ADD_PRIVATE (GtkAppChooserDialog)
G_IMPLEMENT_INTERFACE (GTK_TYPE_APP_CHOOSER,
gtk_app_chooser_dialog_iface_init));
......@@ -665,15 +666,12 @@ gtk_app_chooser_dialog_class_init (GtkAppChooserDialogClass *klass)
gtk_widget_class_bind_child (widget_class, GtkAppChooserDialogPrivate, show_more_button);
gtk_widget_class_bind_child (widget_class, GtkAppChooserDialogPrivate, inner_box);
gtk_widget_class_bind_callback (widget_class, show_more_button_clicked_cb);
g_type_class_add_private (klass, sizeof (GtkAppChooserDialogPrivate));
}
static void
gtk_app_chooser_dialog_init (GtkAppChooserDialog *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTK_TYPE_APP_CHOOSER_DIALOG,
GtkAppChooserDialogPrivate);
self->priv = gtk_app_chooser_dialog_get_instance_private (self);
gtk_widget_init_template (GTK_WIDGET (self));
......
......@@ -34,8 +34,18 @@
static void app_chooser_online_iface_init (GtkAppChooserOnlineInterface *iface);
static void app_chooser_online_pk_async_initable_init (GAsyncInitableIface *iface);
struct _GtkAppChooserOnlinePkPrivate {
GSimpleAsyncResult *init_result;
guint watch_id;
GDBusProxy *proxy;
GSimpleAsyncResult *result;
GtkWindow *parent;
};
G_DEFINE_TYPE_WITH_CODE (GtkAppChooserOnlinePk, gtk_app_chooser_online_pk,
G_TYPE_OBJECT,
G_ADD_PRIVATE (GtkAppChooserOnlinePk)
G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE,
app_chooser_online_pk_async_initable_init)
G_IMPLEMENT_INTERFACE (GTK_TYPE_APP_CHOOSER_ONLINE,
......@@ -44,15 +54,6 @@ G_DEFINE_TYPE_WITH_CODE (GtkAppChooserOnlinePk, gtk_app_chooser_online_pk,
g_define_type_id,
"packagekit", 10));
struct _GtkAppChooserOnlinePkPrivate {
GSimpleAsyncResult *init_result;
guint watch_id;
GDBusProxy *proxy;
GSimpleAsyncResult *result;
GtkWindow *parent;
};
static void
gtk_app_chooser_online_pk_dispose (GObject *obj)
{
......@@ -70,15 +71,12 @@ gtk_app_chooser_online_pk_class_init (GtkAppChooserOnlinePkClass *klass)
GObjectClass *oclass = G_OBJECT_CLASS (klass);
oclass->dispose = gtk_app_chooser_online_pk_dispose;
g_type_class_add_private (klass, sizeof (GtkAppChooserOnlinePkPrivate));
}
static void
gtk_app_chooser_online_pk_init (GtkAppChooserOnlinePk *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTK_TYPE_APP_CHOOSER_ONLINE_PK,
GtkAppChooserOnlinePkPrivate);
self->priv = gtk_app_chooser_online_pk_get_instance_private (self);
}
static gboolean
......
......@@ -126,6 +126,7 @@ static guint signals[N_SIGNALS] = { 0, };
static void gtk_app_chooser_widget_iface_init (GtkAppChooserIface *iface);
G_DEFINE_TYPE_WITH_CODE (GtkAppChooserWidget, gtk_app_chooser_widget, GTK_TYPE_BOX,
G_ADD_PRIVATE (GtkAppChooserWidget)
G_IMPLEMENT_INTERFACE (GTK_TYPE_APP_CHOOSER,
gtk_app_chooser_widget_iface_init));
......@@ -1093,8 +1094,6 @@ gtk_app_chooser_widget_class_init (GtkAppChooserWidgetClass *klass)
gtk_widget_class_bind_callback (widget_class, refresh_and_emit_app_selected);
gtk_widget_class_bind_callback (widget_class, program_list_selection_activated);
gtk_widget_class_bind_callback (widget_class, widget_button_press_event_cb);
g_type_class_add_private (klass, sizeof (GtkAppChooserWidgetPrivate));
}
static void
......@@ -1103,8 +1102,7 @@ gtk_app_chooser_widget_init (GtkAppChooserWidget *self)
GtkTreeSelection *selection;
GtkTreeModel *sort;
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTK_TYPE_APP_CHOOSER_WIDGET,
GtkAppChooserWidgetPrivate);
self->priv = gtk_app_chooser_widget_get_instance_private (self);
gtk_widget_init_template (GTK_WIDGET (self));
......
......@@ -137,8 +137,6 @@ enum {
PROP_ACTIVE_WINDOW
};
G_DEFINE_TYPE (GtkApplication, gtk_application, G_TYPE_APPLICATION)
struct _GtkApplicationPrivate
{
GList *windows;
......@@ -176,6 +174,8 @@ struct _GtkApplicationPrivate
#endif
};
G_DEFINE_TYPE_WITH_PRIVATE (GtkApplication, gtk_application, G_TYPE_APPLICATION)
#ifdef GDK_WINDOWING_X11
static void
gtk_application_x11_publish_menu (GtkApplication *application,
......@@ -492,9 +492,7 @@ gtk_application_after_emit (GApplication *application,
static void
gtk_application_init (GtkApplication *application)
{
application->priv = G_TYPE_INSTANCE_GET_PRIVATE (application,
GTK_TYPE_APPLICATION,
GtkApplicationPrivate);
application->priv = gtk_application_get_instance_private (application);
#ifdef GDK_WINDOWING_X11
application->priv->next_id = 1;
......@@ -689,8 +687,6 @@ gtk_application_class_init (GtkApplicationClass *class)
class->window_added = gtk_application_window_added;
class->window_removed = gtk_application_window_removed;
g_type_class_add_private (class, sizeof (GtkApplicationPrivate));
/**
* GtkApplication::window-added:
* @application: the #GtkApplication which emitted the signal
......
......@@ -598,6 +598,7 @@ gtk_application_window_map_iface_init (GActionMapInterface *iface)
}
G_DEFINE_TYPE_WITH_CODE (GtkApplicationWindow, gtk_application_window, GTK_TYPE_WINDOW,
G_ADD_PRIVATE (GtkApplicationWindow)
G_IMPLEMENT_INTERFACE (G_TYPE_ACTION_GROUP, gtk_application_window_group_iface_init)
G_IMPLEMENT_INTERFACE (G_TYPE_ACTION_MAP, gtk_application_window_map_iface_init))
......@@ -946,7 +947,7 @@ gtk_application_window_dispose (GObject *object)
static void
gtk_application_window_init (GtkApplicationWindow *window)
{
window->priv = G_TYPE_INSTANCE_GET_PRIVATE (window, GTK_TYPE_APPLICATION_WINDOW, GtkApplicationWindowPrivate);
window->priv = gtk_application_window_get_instance_private (window);
window->priv->actions = gtk_application_window_actions_new (window);
window->priv->app_menu_section = g_menu_new ();
......@@ -1007,7 +1008,6 @@ gtk_application_window_class_init (GtkApplicationWindowClass *class)
"menubar at the top of the window"),
TRUE, G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE);
g_object_class_install_properties (object_class, N_PROPS, gtk_application_window_properties);
g_type_class_add_private (class, sizeof (GtkApplicationWindowPrivate));
}
/**
......
......@@ -85,8 +85,7 @@ static void gtk_arrow_get_preferred_height (GtkWidget *widg
gint *minimum_size,
gint *natural_size);
G_DEFINE_TYPE (GtkArrow, gtk_arrow, GTK_TYPE_MISC)
G_DEFINE_TYPE_WITH_PRIVATE (GtkArrow, gtk_arrow, GTK_TYPE_MISC)
static void
gtk_arrow_class_init (GtkArrowClass *class)
......@@ -129,8 +128,6 @@ gtk_arrow_class_init (GtkArrowClass *class)
0.0, 1.0, 0.7,
GTK_PARAM_READABLE));
g_type_class_add_private (class, sizeof (GtkArrowPrivate));
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_ARROW_ACCESSIBLE);
}
......@@ -187,17 +184,12 @@ gtk_arrow_get_property (GObject *object,
static void
gtk_arrow_init (GtkArrow *arrow)
{
GtkArrowPrivate *priv;
arrow->priv = G_TYPE_INSTANCE_GET_PRIVATE (arrow,
GTK_TYPE_ARROW,
GtkArrowPrivate);
priv = arrow->priv;
arrow->priv = gtk_arrow_get_instance_private (arrow);
gtk_widget_set_has_window (GTK_WIDGET (arrow), FALSE);
priv->arrow_type = GTK_ARROW_RIGHT;
priv->shadow_type = GTK_SHADOW_OUT;
arrow->priv->arrow_type = GTK_ARROW_RIGHT;
arrow->priv->shadow_type = GTK_SHADOW_OUT;
}
static void
......
......@@ -85,7 +85,7 @@ static void gtk_aspect_frame_compute_child_allocation (GtkFrame *fram
#define MAX_RATIO 10000.0
#define MIN_RATIO 0.0001
G_DEFINE_TYPE (GtkAspectFrame, gtk_aspect_frame, GTK_TYPE_FRAME)
G_DEFINE_TYPE_WITH_PRIVATE (GtkAspectFrame, gtk_aspect_frame, GTK_TYPE_FRAME)
static void
gtk_aspect_frame_class_init (GtkAspectFrameClass *class)
......@@ -129,24 +129,17 @@ gtk_aspect_frame_class_init (GtkAspectFrameClass *class)
P_("Force aspect ratio to match that of the frame's child"),
TRUE,
GTK_PARAM_READWRITE));
g_type_class_add_private (class, sizeof (GtkAspectFramePrivate));
}
static void
gtk_aspect_frame_init (GtkAspectFrame *aspect_frame)
{
GtkAspectFramePrivate *priv;
aspect_frame->priv = G_TYPE_INSTANCE_GET_PRIVATE (aspect_frame,
GTK_TYPE_ASPECT_FRAME,
GtkAspectFramePrivate);
priv = aspect_frame->priv;
aspect_frame->priv = gtk_aspect_frame_get_instance_private (aspect_frame);
priv->xalign = 0.5;
priv->yalign = 0.5;
priv->ratio = 1.0;
priv->obey_child = TRUE;
aspect_frame->priv->xalign = 0.5;
aspect_frame->priv->yalign = 0.5;
aspect_frame->priv->ratio = 1.0;
aspect_frame->priv->obey_child = TRUE;
}
static void
......
......@@ -213,6 +213,7 @@ static guint signals [LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE_WITH_CODE (GtkAssistant, gtk_assistant, GTK_TYPE_WINDOW,
G_ADD_PRIVATE (GtkAssistant)
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
gtk_assistant_buildable_interface_init))
......@@ -450,8 +451,6 @@ gtk_assistant_class_init (GtkAssistantClass *class)
gtk_widget_class_bind_callback (widget_class, on_assistant_back);
gtk_widget_class_bind_callback (widget_class, on_assistant_cancel);
gtk_widget_class_bind_callback (widget_class, on_assistant_last);
g_type_class_add_private (gobject_class, sizeof (GtkAssistantPrivate));
}
static gint
......@@ -995,9 +994,8 @@ gtk_assistant_init (GtkAssistant *assistant)
{
GtkAssistantPrivate *priv;
assistant->priv = G_TYPE_INSTANCE_GET_PRIVATE (assistant,
GTK_TYPE_ASSISTANT,
GtkAssistantPrivate);
assistant->priv = gtk_assistant_get_instance_private (assistant);
priv = assistant->priv;
priv->pages = NULL;
priv->current_page = NULL;
......
......@@ -130,7 +130,7 @@ static void gtk_button_box_get_child_property (GtkContainer *container,
#define DEFAULT_CHILD_IPAD_Y 0
#define DEFAULT_LAYOUT_STYLE GTK_BUTTONBOX_EDGE
G_DEFINE_TYPE (GtkButtonBox, gtk_button_box, GTK_TYPE_BOX)
G_DEFINE_TYPE_WITH_PRIVATE (GtkButtonBox, gtk_button_box, GTK_TYPE_BOX)
static void
gtk_button_box_class_init (GtkButtonBoxClass *class)
......@@ -220,22 +220,15 @@ gtk_button_box_class_init (GtkButtonBoxClass *class)
P_("If TRUE, the child will not be subject to homogeneous sizing"),
FALSE,
GTK_PARAM_READWRITE));
g_type_class_add_private (class, sizeof (GtkButtonBoxPrivate));
}
static void
gtk_button_box_init (GtkButtonBox *button_box)
{
GtkButtonBoxPrivate *priv;
button_box->priv = G_TYPE_INSTANCE_GET_PRIVATE (button_box,
GTK_TYPE_BUTTON_BOX,
GtkButtonBoxPrivate);
priv = button_box->priv;
button_box->priv = gtk_button_box_get_instance_private (button_box);
button_box->priv->layout_style = DEFAULT_LAYOUT_STYLE;
gtk_box_set_spacing