From ed52a7ae4585751c659506805b6064208b32dbed Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Thu, 31 Mar 2016 20:48:36 -0400 Subject: [PATCH] Use pre-2.44 GObject boilerplate in new glLabelPropertiesDialog. Maintains compatability with older or less bleeding-edge distributions. --- src/label-properties-dialog.c | 16 +++------------- src/label-properties-dialog.h | 28 +++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/label-properties-dialog.c b/src/label-properties-dialog.c index 595ec5f4..b7dff9ed 100644 --- a/src/label-properties-dialog.c +++ b/src/label-properties-dialog.c @@ -40,7 +40,7 @@ /* Private types. */ /*========================================================*/ -typedef struct +struct _glLabelPropertiesDialogPrivate { glLabel *label; GtkBox *box; @@ -58,15 +58,6 @@ typedef struct GtkBox *orientation_box; GtkRadioButton *normal_orientation; GtkRadioButton *rotated_orientation; - -} glLabelPropertiesDialogPrivate; - - -struct _glLabelPropertiesDialog -{ - GtkDialog parent; - - glLabelPropertiesDialogPrivate *priv; }; @@ -94,8 +85,7 @@ static void gl_label_properties_dialog_construct (glLabelPropertiesDialog *dia /*****************************************************************************/ /* Boilerplate object stuff. */ /*****************************************************************************/ - -G_DEFINE_TYPE_WITH_PRIVATE (glLabelPropertiesDialog, gl_label_properties_dialog, GTK_TYPE_DIALOG) +G_DEFINE_TYPE (glLabelPropertiesDialog, gl_label_properties_dialog, GTK_TYPE_DIALOG) @@ -165,7 +155,7 @@ gl_label_properties_dialog_init (glLabelPropertiesDialog *dialog) gl_debug (DEBUG_UI, "START"); - dialog->priv = gl_label_properties_dialog_get_instance_private (dialog); + dialog->priv = g_new0 (glLabelPropertiesDialogPrivate, 1); vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); diff --git a/src/label-properties-dialog.h b/src/label-properties-dialog.h index 53c98ccf..78a67cfb 100644 --- a/src/label-properties-dialog.h +++ b/src/label-properties-dialog.h @@ -32,8 +32,34 @@ G_BEGIN_DECLS #define GL_RESPONSE_SELECT_OTHER 1 #define GL_TYPE_LABEL_PROPERTIES_DIALOG (gl_label_properties_dialog_get_type ()) +#define GL_LABEL_PROPERTIES_DIALOG(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_PROPERTIES_DIALOG, glLabelPropertiesDialog)) +#define GL_LABEL_PROPERTIES_DIALOG_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_PROPERTIES_DIALOG, glLabelPropertiesDialogClass)) +#define GL_IS_LABEL_PROPERTIES_DIALOG(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_PROPERTIES_DIALOG)) +#define GL_IS_LABEL_PROPERTIES_DIALOG_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_PROPERTIES_DIALOG)) +#define GL_LABEL_PROPERTIES_DIALOG_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), GL_TYPE_LABEL_PROPERTIES_DIALOG, glLabelPropertiesDialogClass)) + +typedef struct _glLabelPropertiesDialog glLabelPropertiesDialog; +typedef struct _glLabelPropertiesDialogClass glLabelPropertiesDialogClass; + +typedef struct _glLabelPropertiesDialogPrivate glLabelPropertiesDialogPrivate; + +struct _glLabelPropertiesDialog +{ + GtkDialog parent_instance; + + glLabelPropertiesDialogPrivate *priv; +}; + +struct _glLabelPropertiesDialogClass +{ + GtkDialogClass parent_class; +}; -G_DECLARE_FINAL_TYPE (glLabelPropertiesDialog, gl_label_properties_dialog, GL, LABEL_PROPERTIES_DIALOG, GtkDialog) GtkWidget *gl_label_properties_dialog_new (glLabel *label, GtkWindow *parent); -- 2.39.5