[gnome-desktop] Support g_autoptr() for all libgnome-desktop object types



commit e4396139eff0d88f113aa5a5698e956215d4ee1d
Author: Kalev Lember <klember redhat com>
Date:   Tue Sep 8 19:02:46 2015 +0200

    Support g_autoptr() for all libgnome-desktop object types
    
    ... and bump glib dep to 2.44.0 for the cleanup macro support.
    
    This allows using e.g. g_autoptr(GnomeBG) in other programs, but does
    not make libgnome-desktop itself use g_autoptr.

 configure.ac                               |    2 +-
 libgnome-desktop/gnome-bg-crossfade.h      |    2 ++
 libgnome-desktop/gnome-bg-slide-show.h     |    2 ++
 libgnome-desktop/gnome-bg.h                |    2 ++
 libgnome-desktop/gnome-desktop-thumbnail.h |    2 ++
 libgnome-desktop/gnome-idle-monitor.h      |    2 ++
 libgnome-desktop/gnome-pnp-ids.h           |    2 ++
 libgnome-desktop/gnome-rr-config.h         |    4 ++++
 libgnome-desktop/gnome-rr.h                |    2 ++
 libgnome-desktop/gnome-wall-clock.h        |    2 ++
 libgnome-desktop/gnome-xkb-info.h          |    2 ++
 11 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index fb437dc..798874c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,7 +115,7 @@ dnl it too, or it will never make it into the spec file!
 
 GDK_PIXBUF_REQUIRED=2.21.3
 GTK_REQUIRED=3.3.6
-GLIB_REQUIRED=2.38.0
+GLIB_REQUIRED=2.44.0
 XRANDR_REQUIRED=1.3
 GSETTINGS_DESKTOP_SCHEMAS_REQUIRED=3.5.91
 XEXT_REQUIRED=1.1
diff --git a/libgnome-desktop/gnome-bg-crossfade.h b/libgnome-desktop/gnome-bg-crossfade.h
index bfab93d..119047d 100644
--- a/libgnome-desktop/gnome-bg-crossfade.h
+++ b/libgnome-desktop/gnome-bg-crossfade.h
@@ -58,6 +58,8 @@ struct _GnomeBGCrossfadeClass
        void (* finished) (GnomeBGCrossfade *fade, GdkWindow *window);
 };
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GnomeBGCrossfade, g_object_unref)
+
 GType             gnome_bg_crossfade_get_type              (void);
 GnomeBGCrossfade *gnome_bg_crossfade_new (int width, int height);
 gboolean          gnome_bg_crossfade_set_start_surface (GnomeBGCrossfade *fade,
diff --git a/libgnome-desktop/gnome-bg-slide-show.h b/libgnome-desktop/gnome-bg-slide-show.h
index d453527..bcf1713 100644
--- a/libgnome-desktop/gnome-bg-slide-show.h
+++ b/libgnome-desktop/gnome-bg-slide-show.h
@@ -56,6 +56,8 @@ struct _GnomeBGSlideShowClass
        GObjectClass parent_class;
 };
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GnomeBGSlideShow, g_object_unref)
+
 GType             gnome_bg_slide_show_get_type (void);
 GnomeBGSlideShow *gnome_bg_slide_show_new (const char *filename);
 gboolean          gnome_bg_slide_show_load (GnomeBGSlideShow  *self,
diff --git a/libgnome-desktop/gnome-bg.h b/libgnome-desktop/gnome-bg.h
index 69d1bef..3ec97a7 100644
--- a/libgnome-desktop/gnome-bg.h
+++ b/libgnome-desktop/gnome-bg.h
@@ -48,6 +48,8 @@ G_BEGIN_DECLS
 typedef struct _GnomeBG GnomeBG;
 typedef struct _GnomeBGClass GnomeBGClass;
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GnomeBG, g_object_unref)
+
 GType            gnome_bg_get_type              (void);
 GnomeBG *        gnome_bg_new                   (void);
 void             gnome_bg_load_from_preferences (GnomeBG               *bg,
diff --git a/libgnome-desktop/gnome-desktop-thumbnail.h b/libgnome-desktop/gnome-desktop-thumbnail.h
index b8e409f..424f6cc 100644
--- a/libgnome-desktop/gnome-desktop-thumbnail.h
+++ b/libgnome-desktop/gnome-desktop-thumbnail.h
@@ -62,6 +62,8 @@ struct _GnomeDesktopThumbnailFactoryClass {
        GObjectClass parent;
 };
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GnomeDesktopThumbnailFactory, g_object_unref)
+
 GType                  gnome_desktop_thumbnail_factory_get_type (void);
 GnomeDesktopThumbnailFactory *gnome_desktop_thumbnail_factory_new      (GnomeDesktopThumbnailSize     size);
 
diff --git a/libgnome-desktop/gnome-idle-monitor.h b/libgnome-desktop/gnome-idle-monitor.h
index 9c61cda..167b9a1 100644
--- a/libgnome-desktop/gnome-idle-monitor.h
+++ b/libgnome-desktop/gnome-idle-monitor.h
@@ -54,6 +54,8 @@ struct _GnomeIdleMonitorClass
         GObjectClass          parent_class;
 };
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GnomeIdleMonitor, g_object_unref)
+
 typedef void (*GnomeIdleMonitorWatchFunc) (GnomeIdleMonitor      *monitor,
                                            guint                  id,
                                            gpointer               user_data);
diff --git a/libgnome-desktop/gnome-pnp-ids.h b/libgnome-desktop/gnome-pnp-ids.h
index cfd3846..e204b21 100644
--- a/libgnome-desktop/gnome-pnp-ids.h
+++ b/libgnome-desktop/gnome-pnp-ids.h
@@ -47,6 +47,8 @@ struct _GnomePnpIdsClass
         GObjectClass    parent_class;
 };
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GnomePnpIds, g_object_unref)
+
 GType            gnome_pnp_ids_get_type                    (void);
 GnomePnpIds     *gnome_pnp_ids_new                         (void);
 gchar           *gnome_pnp_ids_get_pnp_id                  (GnomePnpIds            *pnp_ids,
diff --git a/libgnome-desktop/gnome-rr-config.h b/libgnome-desktop/gnome-rr-config.h
index 333d705..e9e2316 100644
--- a/libgnome-desktop/gnome-rr-config.h
+++ b/libgnome-desktop/gnome-rr-config.h
@@ -58,6 +58,8 @@ struct _GnomeRROutputInfoClass
 #define GNOME_IS_RR_OUTPUT_INFO_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), 
GNOME_TYPE_RR_OUTPUT_INFO))
 #define GNOME_RR_OUTPUT_INFO_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), 
GNOME_TYPE_RR_OUTPUT_INFO, GnomeRROutputInfoClass))
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GnomeRROutputInfo, g_object_unref)
+
 GType gnome_rr_output_info_get_type (void);
 
 char *gnome_rr_output_info_get_name (GnomeRROutputInfo *self);
@@ -117,6 +119,8 @@ struct _GnomeRRConfigClass
 #define GNOME_IS_RR_CONFIG_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_RR_CONFIG))
 #define GNOME_RR_CONFIG_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_TYPE_RR_CONFIG, 
GnomeRRConfigClass))
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GnomeRRConfig, g_object_unref)
+
 GType               gnome_rr_config_get_type     (void);
 
 GnomeRRConfig      *gnome_rr_config_new_current  (GnomeRRScreen  *screen,
diff --git a/libgnome-desktop/gnome-rr.h b/libgnome-desktop/gnome-rr.h
index 1f0e5f9..e186849 100644
--- a/libgnome-desktop/gnome-rr.h
+++ b/libgnome-desktop/gnome-rr.h
@@ -99,6 +99,8 @@ typedef enum {
 #define GNOME_TYPE_RR_MODE   (gnome_rr_mode_get_type())
 #define GNOME_TYPE_RR_DPMS_MODE (gnome_rr_dpms_mode_get_type())
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GnomeRRScreen, g_object_unref)
+
 GType gnome_rr_screen_get_type (void);
 GType gnome_rr_output_get_type (void);
 GType gnome_rr_crtc_get_type (void);
diff --git a/libgnome-desktop/gnome-wall-clock.h b/libgnome-desktop/gnome-wall-clock.h
index cda2397..9549504 100644
--- a/libgnome-desktop/gnome-wall-clock.h
+++ b/libgnome-desktop/gnome-wall-clock.h
@@ -58,6 +58,8 @@ struct _GnomeWallClockClass
        GObjectClass parent_class;
 };
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GnomeWallClock, g_object_unref)
+
 GType             gnome_wall_clock_get_type      (void);
 
 GnomeWallClock *  gnome_wall_clock_new           (void);
diff --git a/libgnome-desktop/gnome-xkb-info.h b/libgnome-desktop/gnome-xkb-info.h
index a373f81..938bc31 100644
--- a/libgnome-desktop/gnome-xkb-info.h
+++ b/libgnome-desktop/gnome-xkb-info.h
@@ -55,6 +55,8 @@ struct _GnomeXkbInfoClass
   GObjectClass parent_class;
 };
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GnomeXkbInfo, g_object_unref)
+
 GType           gnome_xkb_info_get_type                         (void);
 GnomeXkbInfo   *gnome_xkb_info_new                              (void);
 GList          *gnome_xkb_info_get_all_layouts                  (GnomeXkbInfo *self);


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