From 3eb0ff8e1f03d27d7fd5ea6c3f8e699a54d31a4c Mon Sep 17 00:00:00 2001 From: Wu Xiaotian Date: Wed, 9 Jan 2019 22:08:17 +0800 Subject: [eel] Avoid deprecated g_type_class_add_private With minimal changes to avoid deprecated g_type_class_add_private --- eel/eel-wrap-table.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'eel/eel-wrap-table.c') diff --git a/eel/eel-wrap-table.c b/eel/eel-wrap-table.c index be7cf9a7..52e1e2ab 100644 --- a/eel/eel-wrap-table.c +++ b/eel/eel-wrap-table.c @@ -42,7 +42,7 @@ enum }; /* Detail member struct */ -struct EelWrapTableDetails +struct EelWrapTablePrivate { guint x_spacing; guint y_spacing; @@ -70,16 +70,15 @@ static gboolean wrap_table_child_focus_in (GtkWidget *w static void wrap_table_layout (EelWrapTable *wrap_table); -G_DEFINE_TYPE (EelWrapTable, eel_wrap_table, GTK_TYPE_CONTAINER) +G_DEFINE_TYPE_WITH_CODE (EelWrapTable, eel_wrap_table, GTK_TYPE_CONTAINER, + G_ADD_PRIVATE (EelWrapTable)) static void eel_wrap_table_init (EelWrapTable *wrap_table) { gtk_widget_set_has_window (GTK_WIDGET (wrap_table), FALSE); - wrap_table->details = G_TYPE_INSTANCE_GET_PRIVATE (wrap_table, - EEL_TYPE_WRAP_TABLE, - EelWrapTableDetails); + wrap_table->details = eel_wrap_table_get_instance_private (wrap_table); wrap_table->details->x_justification = EEL_JUSTIFICATION_BEGINNING; wrap_table->details->y_justification = EEL_JUSTIFICATION_END; wrap_table->details->cols = 1; @@ -485,7 +484,6 @@ eel_wrap_table_class_init (EelWrapTableClass *wrap_table_class) g_param_spec_boolean ("homogeneous", NULL, NULL, FALSE, G_PARAM_READWRITE)); - g_type_class_add_private (wrap_table_class, sizeof (EelWrapTableDetails)); } /* Private EelWrapTable methods */ -- cgit v1.2.1