[epiphany/wip/modern_gobject: 23/31] EphyEmbedShell: Use G_DECLARE_DERIVABLE_TYPE



commit a1f8f62f45d06ca5a6638a132edb94a76d227575
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Tue Sep 15 20:36:14 2015 -0500

    EphyEmbedShell: Use G_DECLARE_DERIVABLE_TYPE

 embed/ephy-embed-shell.c |    5 ++---
 embed/ephy-embed-shell.h |   17 ++---------------
 2 files changed, 4 insertions(+), 18 deletions(-)
---
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 4a4668d..4cdea9d 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -46,8 +46,7 @@
 #define PRINT_SETTINGS_FILENAME "print-settings.ini"
 #define OVERVIEW_RELOAD_DELAY 500
 
-struct _EphyEmbedShellPrivate
-{
+typedef struct {
   WebKitWebContext *web_context;
   EphyHistoryService *global_history_service;
   EphyEncodings *encodings;
@@ -61,7 +60,7 @@ struct _EphyEmbedShellPrivate
   GDBusConnection *bus;
   GList *web_extensions;
   guint web_extensions_page_created_signal_id;
-};
+} EphyEmbedShellPrivate;
 
 enum
 {
diff --git a/embed/ephy-embed-shell.h b/embed/ephy-embed-shell.h
index d791a0a..42c76b7 100644
--- a/embed/ephy-embed-shell.h
+++ b/embed/ephy-embed-shell.h
@@ -30,16 +30,9 @@
 
 G_BEGIN_DECLS
 
-#define EPHY_TYPE_EMBED_SHELL   (ephy_embed_shell_get_type ())
-#define EPHY_EMBED_SHELL(o)   (G_TYPE_CHECK_INSTANCE_CAST ((o), EPHY_TYPE_EMBED_SHELL, EphyEmbedShell))
-#define EPHY_EMBED_SHELL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EPHY_TYPE_EMBED_SHELL, EphyEmbedShellClass))
-#define EPHY_IS_EMBED_SHELL(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), EPHY_TYPE_EMBED_SHELL))
-#define EPHY_IS_EMBED_SHELL_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_EMBED_SHELL))
-#define EPHY_EMBED_SHELL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EPHY_TYPE_EMBED_SHELL, 
EphyEmbedShellClass))
+#define EPHY_TYPE_EMBED_SHELL (ephy_embed_shell_get_type ())
 
-typedef struct _EphyEmbedShellClass EphyEmbedShellClass;
-typedef struct _EphyEmbedShell    EphyEmbedShell;
-typedef struct _EphyEmbedShellPrivate EphyEmbedShellPrivate;
+G_DECLARE_DERIVABLE_TYPE (EphyEmbedShell, ephy_embed_shell, EPHY, EMBED_SHELL, GtkApplication)
 
 typedef enum
 {
@@ -55,11 +48,6 @@ typedef enum
 #define EPHY_EMBED_SHELL_MODE_HAS_PRIVATE_PROFILE(mode) \
   (mode == EPHY_EMBED_SHELL_MODE_PRIVATE || mode == EPHY_EMBED_SHELL_MODE_INCOGNITO)
 
-struct _EphyEmbedShell
-{
-  GtkApplication parent;
-};
-
 struct _EphyEmbedShellClass
 {
   GtkApplicationClass parent_class;
@@ -69,7 +57,6 @@ struct _EphyEmbedShellClass
   void    (* restored_window)  (EphyEmbedShell *shell);
 };
 
-GType              ephy_embed_shell_get_type                   (void);
 EphyEmbedShell    *ephy_embed_shell_get_default                (void);
 WebKitWebContext  *ephy_embed_shell_get_web_context            (EphyEmbedShell   *shell);
 GObject           *ephy_embed_shell_get_global_history_service (EphyEmbedShell   *shell);


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