[gcr/wip/nielsdg/autoptr-funcs: 9/9] ui: Provide support for g_autoptr for all types



commit dec8ca2f5fb97ebf89934cde291dd61f45f91992
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Tue Jan 7 07:56:15 2020 +0100

    ui: Provide support for g_autoptr for all types
    
    https://gitlab.gnome.org/GNOME/gcr/issues/16

 ui/eggimagemenuitem.h                 |  2 ++
 ui/gcr-certificate-exporter.h         |  2 ++
 ui/gcr-certificate-renderer.h         |  2 ++
 ui/gcr-certificate-request-renderer.h |  2 ++
 ui/gcr-certificate-widget.h           |  2 ++
 ui/gcr-collection-model.h             |  2 ++
 ui/gcr-combo-selector.h               |  2 ++
 ui/gcr-display-scrolled.h             |  2 ++
 ui/gcr-display-view.h                 |  2 ++
 ui/gcr-failure-renderer.h             |  2 ++
 ui/gcr-gnupg-renderer.h               |  2 ++
 ui/gcr-import-button.h                |  2 ++
 ui/gcr-key-widget.h                   |  2 ++
 ui/gcr-list-selector.h                |  2 ++
 ui/gcr-pkcs11-import-dialog.c         | 10 ----------
 ui/gcr-pkcs11-import-dialog.h         | 11 ++++-------
 ui/gcr-pkcs11-import-interaction.c    | 10 ----------
 ui/gcr-pkcs11-import-interaction.h    | 11 ++++-------
 ui/gcr-prompt-dialog.h                |  2 ++
 ui/gcr-secure-entry-buffer.h          |  2 ++
 ui/gcr-tree-selector.h                |  2 ++
 ui/gcr-unlock-options-widget.h        |  2 ++
 ui/gcr-unlock-renderer.h              |  2 ++
 ui/gcr-viewer-widget.c                | 16 +---------------
 ui/gcr-viewer-widget.h                | 12 ++++--------
 ui/gcr-viewer-window.h                |  2 ++
 26 files changed, 53 insertions(+), 57 deletions(-)
---
diff --git a/ui/eggimagemenuitem.h b/ui/eggimagemenuitem.h
index 28d26ff..6576a1d 100644
--- a/ui/eggimagemenuitem.h
+++ b/ui/eggimagemenuitem.h
@@ -73,6 +73,8 @@ void       egg_image_menu_item_set_image         (EggImageMenuItem *image_menu_i
                                                   GtkWidget        *image);
 GtkWidget* egg_image_menu_item_get_image         (EggImageMenuItem *image_menu_item);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (EggImageMenuItem, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __EGG_IMAGE_MENUITEM_H__ */
diff --git a/ui/gcr-certificate-exporter.h b/ui/gcr-certificate-exporter.h
index 241bd95..d5dd9c2 100644
--- a/ui/gcr-certificate-exporter.h
+++ b/ui/gcr-certificate-exporter.h
@@ -67,6 +67,8 @@ gboolean                  _gcr_certificate_exporter_export_finish     (GcrCertif
                                                                        GAsyncResult *result,
                                                                        GError **error);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrCertificateExporter, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_CERTIFICATE_EXPORTER_H__ */
diff --git a/ui/gcr-certificate-renderer.h b/ui/gcr-certificate-renderer.h
index 3986124..c5a6c92 100644
--- a/ui/gcr-certificate-renderer.h
+++ b/ui/gcr-certificate-renderer.h
@@ -66,6 +66,8 @@ GcrCertificate*           gcr_certificate_renderer_get_certificate    (GcrCertif
 void                      gcr_certificate_renderer_set_certificate    (GcrCertificateRenderer *self,
                                                                        GcrCertificate *certificate);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrCertificateRenderer, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_CERTIFICATE_RENDERER_H__ */
diff --git a/ui/gcr-certificate-request-renderer.h b/ui/gcr-certificate-request-renderer.h
index e5ea514..d43d8fe 100644
--- a/ui/gcr-certificate-request-renderer.h
+++ b/ui/gcr-certificate-request-renderer.h
@@ -64,6 +64,8 @@ GckAttributes *   _gcr_certificate_request_renderer_get_attributes        (GcrCe
 void              _gcr_certificate_request_renderer_set_attributes        (GcrCertificateRequestRenderer 
*self,
                                                                        GckAttributes *attrs);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrCertificateRequestRenderer, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_CERTIFICATE_REQUEST_RENDERER_H__ */
diff --git a/ui/gcr-certificate-widget.h b/ui/gcr-certificate-widget.h
index b967444..6dfc1ec 100644
--- a/ui/gcr-certificate-widget.h
+++ b/ui/gcr-certificate-widget.h
@@ -61,6 +61,8 @@ GcrCertificate*         gcr_certificate_widget_get_certificate        (GcrCertif
 void                    gcr_certificate_widget_set_certificate        (GcrCertificateWidget *self,
                                                                        GcrCertificate *certificate);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrCertificateWidget, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_CERTIFICATE_WIDGET_H__ */
diff --git a/ui/gcr-collection-model.h b/ui/gcr-collection-model.h
index 4241d3a..a202046 100644
--- a/ui/gcr-collection-model.h
+++ b/ui/gcr-collection-model.h
@@ -97,4 +97,6 @@ GList*                gcr_collection_model_get_selected_objects  (GcrCollectionM
 void                  gcr_collection_model_set_selected_objects  (GcrCollectionModel *self,
                                                                   GList *selected);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrCollectionModel, g_object_unref)
+
 #endif /* __GCR_COLLECTION_MODEL_H__ */
diff --git a/ui/gcr-combo-selector.h b/ui/gcr-combo-selector.h
index d1b91d0..e46ef8a 100644
--- a/ui/gcr-combo-selector.h
+++ b/ui/gcr-combo-selector.h
@@ -60,6 +60,8 @@ GObject*                 gcr_combo_selector_get_selected     (GcrComboSelector *
 void                     gcr_combo_selector_set_selected     (GcrComboSelector *self,
                                                               GObject *selected);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrComboSelector, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_COMBO_SELECTOR_H__ */
diff --git a/ui/gcr-display-scrolled.h b/ui/gcr-display-scrolled.h
index 9bf9fc1..8726ae2 100644
--- a/ui/gcr-display-scrolled.h
+++ b/ui/gcr-display-scrolled.h
@@ -50,6 +50,8 @@ GType                _gcr_display_scrolled_get_type                    (void);
 
 GcrDisplayScrolled*  _gcr_display_scrolled_new                         (void);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrDisplayScrolled, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_DISPLAY_SCROLLED_H__ */
diff --git a/ui/gcr-display-view.h b/ui/gcr-display-view.h
index 415bff5..99c3bed 100644
--- a/ui/gcr-display-view.h
+++ b/ui/gcr-display-view.h
@@ -109,6 +109,8 @@ void             _gcr_display_view_add_widget_area             (GcrDisplayView *
                                                                 GcrRenderer *render,
                                                                 GtkWidget *area);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrDisplayView, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_DISPLAY_VIEW_H__ */
diff --git a/ui/gcr-failure-renderer.h b/ui/gcr-failure-renderer.h
index a7972d2..4dd1027 100644
--- a/ui/gcr-failure-renderer.h
+++ b/ui/gcr-failure-renderer.h
@@ -60,6 +60,8 @@ GcrRenderer *          gcr_failure_renderer_new              (const gchar *label
 
 GcrRenderer *          gcr_failure_renderer_new_unsupported  (const gchar *label);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrFailureRenderer, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_FAILURE_RENDERER_H__ */
diff --git a/ui/gcr-gnupg-renderer.h b/ui/gcr-gnupg-renderer.h
index f009a58..fc68713 100644
--- a/ui/gcr-gnupg-renderer.h
+++ b/ui/gcr-gnupg-renderer.h
@@ -70,6 +70,8 @@ GckAttributes *      _gcr_gnupg_renderer_get_attributes     (GcrGnupgRenderer *s
 void                 _gcr_gnupg_renderer_set_attributes     (GcrGnupgRenderer *self,
                                                              GckAttributes *attrs);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrGnupgRenderer, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_GNUPG_RENDERER_H__ */
diff --git a/ui/gcr-import-button.h b/ui/gcr-import-button.h
index 01743e2..5a06408 100644
--- a/ui/gcr-import-button.h
+++ b/ui/gcr-import-button.h
@@ -67,6 +67,8 @@ GcrImportButton *   gcr_import_button_new                    (const gchar *label
 void                gcr_import_button_add_parsed             (GcrImportButton *self,
                                                               GcrParsed *parsed);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrImportButton, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_IMPORT_BUTTON_H__ */
diff --git a/ui/gcr-key-widget.h b/ui/gcr-key-widget.h
index 9384c08..bdbb797 100644
--- a/ui/gcr-key-widget.h
+++ b/ui/gcr-key-widget.h
@@ -54,6 +54,8 @@ void                    gcr_key_widget_set_attributes         (GcrKeyWidget *sel
 
 GckAttributes*          gcr_key_widget_get_attributes         (GcrKeyWidget *self);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrKeyWidget, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_KEY_WIDGET_H__ */
diff --git a/ui/gcr-list-selector.h b/ui/gcr-list-selector.h
index d6454d9..0d980bb 100644
--- a/ui/gcr-list-selector.h
+++ b/ui/gcr-list-selector.h
@@ -64,6 +64,8 @@ GList*                   gcr_list_selector_get_selected     (GcrListSelector *se
 void                     gcr_list_selector_set_selected     (GcrListSelector *self,
                                                              GList *selected);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrListSelector, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_LIST_SELECTOR_H__ */
diff --git a/ui/gcr-pkcs11-import-dialog.c b/ui/gcr-pkcs11-import-dialog.c
index 46781a9..746b946 100644
--- a/ui/gcr-pkcs11-import-dialog.c
+++ b/ui/gcr-pkcs11-import-dialog.c
@@ -33,10 +33,6 @@
 
 EGG_SECURE_DECLARE (import_dialog);
 
-#define GCR_PKCS11_IMPORT_DIALOG_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), 
GCR_TYPE_PKCS11_IMPORT_DIALOG, GcrPkcs11ImportDialogClass))
-#define GCR_IS_PKCS11_IMPORT_DIALOG_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), 
GCR_TYPE_PKCS11_IMPORT_DIALOG))
-#define GCR_PKCS11_IMPORT_DIALOG_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), 
GCR_TYPE_PKCS11_IMPORT_DIALOG, GcrPkcs11ImportDialogClass))
-
 enum {
        PROP_0,
        PROP_IMPORTER
@@ -53,12 +49,6 @@ struct _GcrPkcs11ImportDialog {
        gboolean label_changed;
 };
 
-typedef struct _GcrPkcs11ImportDialogClass GcrPkcs11ImportDialogClass;
-
-struct _GcrPkcs11ImportDialogClass {
-       GtkDialogClass parent;
-};
-
 G_DEFINE_TYPE (GcrPkcs11ImportDialog, _gcr_pkcs11_import_dialog, GTK_TYPE_DIALOG);
 
 static void
diff --git a/ui/gcr-pkcs11-import-dialog.h b/ui/gcr-pkcs11-import-dialog.h
index 07a0205..57f799a 100644
--- a/ui/gcr-pkcs11-import-dialog.h
+++ b/ui/gcr-pkcs11-import-dialog.h
@@ -29,13 +29,10 @@
 
 G_BEGIN_DECLS
 
-#define GCR_TYPE_PKCS11_IMPORT_DIALOG               (_gcr_pkcs11_import_dialog_get_type ())
-#define GCR_PKCS11_IMPORT_DIALOG(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GCR_TYPE_PKCS11_IMPORT_DIALOG, GcrPkcs11ImportDialog))
-#define GCR_IS_PKCS11_IMPORT_DIALOG(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
GCR_TYPE_PKCS11_IMPORT_DIALOG))
-
-typedef struct _GcrPkcs11ImportDialog GcrPkcs11ImportDialog;
-
-GType                   _gcr_pkcs11_import_dialog_get_type          (void) G_GNUC_CONST;
+#define GCR_TYPE_PKCS11_IMPORT_DIALOG (_gcr_pkcs11_import_dialog_get_type ())
+G_DECLARE_FINAL_TYPE (GcrPkcs11ImportDialog, _gcr_pkcs11_import_dialog,
+                      GCR, PKCS11_IMPORT_DIALOG,
+                      GtkDialog)
 
 GcrPkcs11ImportDialog * _gcr_pkcs11_import_dialog_new               (GtkWindow *parent);
 
diff --git a/ui/gcr-pkcs11-import-interaction.c b/ui/gcr-pkcs11-import-interaction.c
index 22a17ff..ecdc8f3 100644
--- a/ui/gcr-pkcs11-import-interaction.c
+++ b/ui/gcr-pkcs11-import-interaction.c
@@ -26,17 +26,11 @@
 
 #include <glib/gi18n-lib.h>
 
-#define GCR_PKCS11_IMPORT_INTERACTION_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), 
GCR_TYPE_PKCS11_IMPORT_INTERACTION, GcrPkcs11ImportInteractionClass))
-#define GCR_IS_PKCS11_IMPORT_INTERACTION_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), 
GCR_TYPE_PKCS11_IMPORT_INTERACTION))
-#define GCR_PKCS11_IMPORT_INTERACTION_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), 
GCR_TYPE_PKCS11_IMPORT_INTERACTION, GcrPkcs11ImportInteractionClass))
-
 enum {
        PROP_0,
        PROP_PARENT_WINDOW
 };
 
-typedef struct _GcrPkcs11ImportInteractionClass GcrPkcs11ImportInteractionClass;
-
 struct _GcrPkcs11ImportInteraction {
        GTlsInteraction parent;
        gboolean supplemented;
@@ -44,10 +38,6 @@ struct _GcrPkcs11ImportInteraction {
        GcrPkcs11ImportDialog *dialog;
 };
 
-struct _GcrPkcs11ImportInteractionClass {
-       GTlsInteractionClass parent_class;
-};
-
 static void _gcr_pkcs11_import_interaction_iface_init (GcrImportInteractionIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE(GcrPkcs11ImportInteraction, _gcr_pkcs11_import_interaction, G_TYPE_TLS_INTERACTION,
diff --git a/ui/gcr-pkcs11-import-interaction.h b/ui/gcr-pkcs11-import-interaction.h
index 041aaf5..a36db2e 100644
--- a/ui/gcr-pkcs11-import-interaction.h
+++ b/ui/gcr-pkcs11-import-interaction.h
@@ -26,13 +26,10 @@
 
 G_BEGIN_DECLS
 
-#define GCR_TYPE_PKCS11_IMPORT_INTERACTION               (_gcr_pkcs11_import_interaction_get_type ())
-#define GCR_PKCS11_IMPORT_INTERACTION(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
GCR_TYPE_PKCS11_IMPORT_INTERACTION, GcrPkcs11ImportInteraction))
-#define GCR_IS_PKCS11_IMPORT_INTERACTION(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
GCR_TYPE_PKCS11_IMPORT_INTERACTION))
-
-typedef struct _GcrPkcs11ImportInteraction GcrPkcs11ImportInteraction;
-
-GType               _gcr_pkcs11_import_interaction_get_type     (void) G_GNUC_CONST;
+#define GCR_TYPE_PKCS11_IMPORT_INTERACTION (_gcr_pkcs11_import_interaction_get_type ())
+G_DECLARE_FINAL_TYPE (GcrPkcs11ImportInteraction, _gcr_pkcs11_import_interaction,
+                      GCR, PKCS11_IMPORT_INTERACTION,
+                      GTlsInteraction)
 
 GTlsInteraction *   _gcr_pkcs11_import_interaction_new          (GtkWindow *parent_window);
 
diff --git a/ui/gcr-prompt-dialog.h b/ui/gcr-prompt-dialog.h
index 6181fa0..9a94457 100644
--- a/ui/gcr-prompt-dialog.h
+++ b/ui/gcr-prompt-dialog.h
@@ -56,6 +56,8 @@ struct _GcrPromptDialogClass {
 
 GType                gcr_prompt_dialog_get_type                  (void);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrPromptDialog, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_PROMPT_DIALOG_H__ */
diff --git a/ui/gcr-secure-entry-buffer.h b/ui/gcr-secure-entry-buffer.h
index 24399f4..c7a0c60 100644
--- a/ui/gcr-secure-entry-buffer.h
+++ b/ui/gcr-secure-entry-buffer.h
@@ -58,6 +58,8 @@ GType                     gcr_secure_entry_buffer_get_type               (void)
 
 GtkEntryBuffer *          gcr_secure_entry_buffer_new                    (void);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrSecureEntryBuffer, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_SECURE_ENTRY_BUFFER_H__ */
diff --git a/ui/gcr-tree-selector.h b/ui/gcr-tree-selector.h
index 3355ca2..de16602 100644
--- a/ui/gcr-tree-selector.h
+++ b/ui/gcr-tree-selector.h
@@ -63,6 +63,8 @@ GList*                   gcr_tree_selector_get_selected      (GcrTreeSelector *s
 void                     gcr_tree_selector_set_selected      (GcrTreeSelector *self,
                                                               GList *selected);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrTreeSelector, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_TREE_SELECTOR_H__ */
diff --git a/ui/gcr-unlock-options-widget.h b/ui/gcr-unlock-options-widget.h
index 3052f13..bd1f396 100644
--- a/ui/gcr-unlock-options-widget.h
+++ b/ui/gcr-unlock-options-widget.h
@@ -75,6 +75,8 @@ void                          gcr_unlock_options_widget_set_sensitive          (
                                                                                 gboolean sensitive,
                                                                                 const gchar *reason);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrUnlockOptionsWidget, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_UNLOCK_OPTIONS_WIDGET_H__ */
diff --git a/ui/gcr-unlock-renderer.h b/ui/gcr-unlock-renderer.h
index 3f504a1..32de573 100644
--- a/ui/gcr-unlock-renderer.h
+++ b/ui/gcr-unlock-renderer.h
@@ -76,6 +76,8 @@ void                   _gcr_unlock_renderer_show_warning      (GcrUnlockRenderer
 
 GBytes *               _gcr_unlock_renderer_get_locked_data   (GcrUnlockRenderer *self);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrUnlockRenderer, g_object_unref)
+
 G_END_DECLS
 
 #endif /* __GCR_UNLOCK_RENDERER_H__ */
diff --git a/ui/gcr-viewer-widget.c b/ui/gcr-viewer-widget.c
index 3401f46..0c95fa2 100644
--- a/ui/gcr-viewer-widget.c
+++ b/ui/gcr-viewer-widget.c
@@ -71,11 +71,6 @@ enum {
  * implementation, the parent class we derive from.
  */
 
-#define GCR_VIEWER_WIDGET_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GCR_TYPE_VIEWER_WIDGET, 
GcrViewerWidgetClass))
-#define GCR_IS_VIEWER_WIDGET_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), GCR_TYPE_VIEWER_WIDGET))
-#define GCR_VIEWER_WIDGET_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GCR_TYPE_VIEWER_WIDGET, 
GcrViewerWidgetClass))
-
-typedef struct _GcrViewerWidgetClass GcrViewerWidgetClass;
 typedef struct _GcrViewerWidgetPrivate GcrViewerWidgetPrivate;
 
 struct _GcrViewerWidget {
@@ -84,14 +79,6 @@ struct _GcrViewerWidget {
        GcrViewerWidgetPrivate *pv;
 };
 
-struct _GcrViewerWidgetClass {
-       GtkBoxClass parent_class;
-
-       void       (*added)        (GcrViewerWidget *widget,
-                                   GcrRenderer *renderer,
-                                   GcrParsed *parsed);
-};
-
 struct _GcrViewerWidgetPrivate {
        GcrViewer *viewer;
        GtkInfoBar *message_bar;
@@ -384,8 +371,7 @@ gcr_viewer_widget_class_init (GcrViewerWidgetClass *klass)
         * This signal is emitted when an item is added to the viewer widget.
         */
        signals[ADDED] = g_signal_new ("added", GCR_TYPE_VIEWER_WIDGET, G_SIGNAL_RUN_LAST,
-                                      G_STRUCT_OFFSET (GcrViewerWidgetClass, added),
-                                      NULL, NULL, _gcr_marshal_VOID__OBJECT_BOXED,
+                                      0, NULL, NULL, _gcr_marshal_VOID__OBJECT_BOXED,
                                       G_TYPE_NONE, 2, G_TYPE_OBJECT, GCR_TYPE_PARSED);
 }
 
diff --git a/ui/gcr-viewer-widget.h b/ui/gcr-viewer-widget.h
index 72237c2..93515c5 100644
--- a/ui/gcr-viewer-widget.h
+++ b/ui/gcr-viewer-widget.h
@@ -25,14 +25,10 @@
 
 #include <gtk/gtk.h>
 
-#define GCR_TYPE_VIEWER_WIDGET               (gcr_viewer_widget_get_type ())
-#define GCR_VIEWER_WIDGET(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_VIEWER_WIDGET, 
GcrViewerWidget))
-#define GCR_IS_VIEWER_WIDGET(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_VIEWER_WIDGET))
-
-typedef struct _GcrViewerWidget GcrViewerWidget;
-
-
-GType              gcr_viewer_widget_get_type         (void);
+#define GCR_TYPE_VIEWER_WIDGET (gcr_viewer_widget_get_type ())
+G_DECLARE_FINAL_TYPE (GcrViewerWidget, gcr_viewer_widget,
+                      GCR, VIEWER_WIDGET,
+                      GtkBox)
 
 GcrViewerWidget *  gcr_viewer_widget_new              (void);
 
diff --git a/ui/gcr-viewer-window.h b/ui/gcr-viewer-window.h
index b64a8b3..de42926 100644
--- a/ui/gcr-viewer-window.h
+++ b/ui/gcr-viewer-window.h
@@ -60,6 +60,8 @@ void               gcr_viewer_window_load             (GcrViewerWindow *self,
 
 GcrViewer *        gcr_viewer_window_get_viewer       (GcrViewerWindow *self);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrViewerWindow, g_object_unref)
+
 #endif /* GCR_DISABLE_DEPRECATED */
 
 #endif /* GCR_VIEWER_WINDOW_H */


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