[epiphany] EphyDialog: Use G_DECLARE_DERIVABLE_TYPE



commit 5b19e75b9217c043d9fa41c0a1a3675cb52edad5
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Tue Sep 15 19:53:49 2015 -0500

    EphyDialog: Use G_DECLARE_DERIVABLE_TYPE

 lib/ephy-dialog.c |    4 ++--
 lib/ephy-dialog.h |   21 +++------------------
 2 files changed, 5 insertions(+), 20 deletions(-)
---
diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c
index 340645f..084c7a3 100644
--- a/lib/ephy-dialog.c
+++ b/lib/ephy-dialog.c
@@ -45,7 +45,7 @@ enum
        PROP_DEFAULT_HEIGHT
 };
 
-struct _EphyDialogPrivate
+typedef struct
 {
        char *name;
 
@@ -60,7 +60,7 @@ struct _EphyDialogPrivate
        guint persist_position : 1;
        int default_width;
        int default_height;
-};
+} EphyDialogPrivate;
 
 G_DEFINE_TYPE_WITH_PRIVATE (EphyDialog, ephy_dialog, GTK_TYPE_DIALOG)
 
diff --git a/lib/ephy-dialog.h b/lib/ephy-dialog.h
index d531afc..4a4130f 100644
--- a/lib/ephy-dialog.h
+++ b/lib/ephy-dialog.h
@@ -31,17 +31,9 @@
 
 G_BEGIN_DECLS
 
-#define EPHY_TYPE_DIALOG               (ephy_dialog_get_type ())
-#define EPHY_DIALOG(o)                 (G_TYPE_CHECK_INSTANCE_CAST ((o), EPHY_TYPE_DIALOG, EphyDialog))
-#define EPHY_DIALOG_CLASS(k)           (G_TYPE_CHECK_CLASS_CAST((k), EPHY_TYPE_DIALOG, EphyDialogClass))
-#define EPHY_IS_DIALOG(o)              (G_TYPE_CHECK_INSTANCE_TYPE ((o), EPHY_TYPE_DIALOG))
-#define EPHY_IS_DIALOG_CLASS(k)                (G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_DIALOG))
-#define EPHY_DIALOG_GET_CLASS(o)       (G_TYPE_INSTANCE_GET_CLASS ((o), EPHY_TYPE_DIALOG, EphyDialogClass))
-
-typedef struct _EphyDialogClass                EphyDialogClass;
-typedef struct _EphyDialog             EphyDialog;
-typedef struct _EphyDialogPrivate      EphyDialogPrivate;
-typedef struct _EphyDialogProperty     EphyDialogProperty;
+#define EPHY_TYPE_DIALOG (ephy_dialog_get_type ())
+
+G_DECLARE_DERIVABLE_TYPE (EphyDialog, ephy_dialog, EPHY, DIALOG, GtkDialog)
 
 struct _EphyDialogClass
 {
@@ -60,13 +52,6 @@ struct _EphyDialogClass
        void    (* show)        (EphyDialog *dialog);
 };
 
-struct _EphyDialog
-{
-       GObject parent;
-};
-
-GType          ephy_dialog_get_type            (void);
-
 EphyDialog     *ephy_dialog_new                        (void);
 
 EphyDialog     *ephy_dialog_new_with_parent    (GtkWidget *parent_window);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]