[cheese] Use G_DECLARE_FINAL_TYPE where possible



commit c32c9fcc5de035e388bec2704c8c754b375a4f40
Author: David King <amigadave amigadave com>
Date:   Mon Apr 13 21:44:49 2015 +0100

    Use G_DECLARE_FINAL_TYPE where possible

 libcheese/cheese-avatar-chooser.c |    4 +-
 libcheese/cheese-avatar-chooser.h |   34 ++++------------------------
 libcheese/cheese-avatar-widget.c  |    4 +-
 libcheese/cheese-avatar-widget.h  |   34 ++++------------------------
 libcheese/cheese-camera-device.c  |    4 +-
 libcheese/cheese-camera-device.h  |   42 ++++++-----------------------------
 libcheese/cheese-effect.c         |    4 +-
 libcheese/cheese-effect.h         |   41 ++++------------------------------
 libcheese/cheese-fileutil.c       |    4 +-
 libcheese/cheese-fileutil.h       |   31 ++++---------------------
 libcheese/cheese-flash.c          |    4 +-
 libcheese/cheese-flash.h          |   33 +++++----------------------
 libcheese/cheese-widget.c         |   16 +++++++++++-
 libcheese/cheese-widget.h         |   44 +++---------------------------------
 src/thumbview/cheese-thumb-view.c |    5 ++++
 src/thumbview/cheese-thumb-view.h |   28 ++++-------------------
 src/thumbview/eog-thumb-nav.c     |    5 ++++
 src/thumbview/eog-thumb-nav.h     |   27 +++-------------------
 18 files changed, 82 insertions(+), 282 deletions(-)
---
diff --git a/libcheese/cheese-avatar-chooser.c b/libcheese/cheese-avatar-chooser.c
index 9cd268e..aa64db6 100644
--- a/libcheese/cheese-avatar-chooser.c
+++ b/libcheese/cheese-avatar-chooser.c
@@ -46,10 +46,10 @@ enum
   PROP_LAST
 };
 
-struct _CheeseAvatarChooserPrivate
+typedef struct
 {
   GtkWidget *widget;
-};
+} CheeseAvatarChooserPrivate;
 
 static GParamSpec *properties[PROP_LAST];
 
diff --git a/libcheese/cheese-avatar-chooser.h b/libcheese/cheese-avatar-chooser.h
index 9ebbdb3..d1f719d 100644
--- a/libcheese/cheese-avatar-chooser.h
+++ b/libcheese/cheese-avatar-chooser.h
@@ -17,39 +17,14 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _CHEESE_AVATAR_CHOOSER_H_
-#define _CHEESE_AVATAR_CHOOSER_H_
+#ifndef CHEESE_AVATAR_CHOOSER_H_
+#define CHEESE_AVATAR_CHOOSER_H_
 
 #include <glib-object.h>
 #include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
-#define CHEESE_TYPE_AVATAR_CHOOSER (cheese_avatar_chooser_get_type ())
-#define CHEESE_AVATAR_CHOOSER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
CHEESE_TYPE_AVATAR_CHOOSER, \
-                                                                           CheeseAvatarChooser))
-#define CHEESE_AVATAR_CHOOSER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), CHEESE_TYPE_AVATAR_CHOOSER, 
\
-                                                                        CheeseAvatarChooserClass))
-#define CHEESE_IS_AVATAR_CHOOSER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
CHEESE_TYPE_AVATAR_CHOOSER))
-#define CHEESE_IS_AVATAR_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CHEESE_TYPE_AVATAR_CHOOSER))
-#define CHEESE_AVATAR_CHOOSER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), CHEESE_TYPE_AVATAR_CHOOSER, 
\
-                                                                          CheeseAvatarChooserClass))
-
-typedef struct _CheeseAvatarChooserPrivate CheeseAvatarChooserPrivate;
-typedef struct _CheeseAvatarChooserClass CheeseAvatarChooserClass;
-typedef struct _CheeseAvatarChooser CheeseAvatarChooser;
-
-/**
- * CheeseAvatarChooserClass:
- *
- * Use the accessor functions below.
- */
-struct _CheeseAvatarChooserClass
-{
-  /*< private >*/
-  GtkDialogClass parent_class;
-};
-
 /**
  * CheeseAvatarChooser:
  *
@@ -62,11 +37,12 @@ struct _CheeseAvatarChooser
   void *unused;
 };
 
-GType cheese_avatar_chooser_get_type (void);
+#define CHEESE_TYPE_AVATAR_CHOOSER (cheese_avatar_chooser_get_type ())
+G_DECLARE_FINAL_TYPE (CheeseAvatarChooser, cheese_avatar_chooser, CHEESE, AVATAR_CHOOSER, GtkDialog)
 
 GtkWidget *cheese_avatar_chooser_new (void);
 GdkPixbuf *cheese_avatar_chooser_get_picture (CheeseAvatarChooser *chooser);
 
 G_END_DECLS
 
-#endif /* _CHEESE_AVATAR_CHOOSER_H_ */
+#endif /* CHEESE_AVATAR_CHOOSER_H_ */
diff --git a/libcheese/cheese-avatar-widget.c b/libcheese/cheese-avatar-widget.c
index 9fb4f81..0fe338a 100644
--- a/libcheese/cheese-avatar-widget.c
+++ b/libcheese/cheese-avatar-widget.c
@@ -51,7 +51,7 @@ enum
   IMAGE_PAGE  = 1,
 };
 
-struct _CheeseAvatarWidgetPrivate
+typedef struct
 {
   GtkWidget *notebook;
   GtkWidget *camera;
@@ -61,7 +61,7 @@ struct _CheeseAvatarWidgetPrivate
   GtkSizeGroup *sizegroup;
   CheeseFlash *flash;
   gulong photo_taken_id;
-};
+} CheeseAvatarWidgetPrivate;
 
 static GParamSpec *properties[PROP_LAST];
 
diff --git a/libcheese/cheese-avatar-widget.h b/libcheese/cheese-avatar-widget.h
index 29bbfa5..f887843 100644
--- a/libcheese/cheese-avatar-widget.h
+++ b/libcheese/cheese-avatar-widget.h
@@ -17,39 +17,14 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _CHEESE_AVATAR_WIDGET_H_
-#define _CHEESE_AVATAR_WIDGET_H_
+#ifndef CHEESE_AVATAR_WIDGET_H_
+#define CHEESE_AVATAR_WIDGET_H_
 
 #include <glib-object.h>
 #include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
-#define CHEESE_TYPE_AVATAR_WIDGET (cheese_avatar_widget_get_type ())
-#define CHEESE_AVATAR_WIDGET(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHEESE_TYPE_AVATAR_WIDGET, \
-                                                                           CheeseAvatarWidget))
-#define CHEESE_AVATAR_WIDGET_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), CHEESE_TYPE_AVATAR_WIDGET, \
-                                                                        CheeseAvatarWidgetClass))
-#define CHEESE_IS_AVATAR_WIDGET(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHEESE_TYPE_AVATAR_WIDGET))
-#define CHEESE_IS_AVATAR_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CHEESE_TYPE_AVATAR_WIDGET))
-#define CHEESE_AVATAR_WIDGET_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), CHEESE_TYPE_AVATAR_WIDGET, \
-                                                                          CheeseAvatarWidgetClass))
-
-typedef struct _CheeseAvatarWidgetPrivate CheeseAvatarWidgetPrivate;
-typedef struct _CheeseAvatarWidgetClass CheeseAvatarWidgetClass;
-typedef struct _CheeseAvatarWidget CheeseAvatarWidget;
-
-/**
- * CheeseAvatarWidgetClass:
- *
- * Use the accessor functions below.
- */
-struct _CheeseAvatarWidgetClass
-{
-  /*< private >*/
-  GtkBinClass parent_class;
-};
-
 /**
  * CheeseAvatarWidget:
  *
@@ -62,11 +37,12 @@ struct _CheeseAvatarWidget
   void *unused;
 };
 
-GType cheese_avatar_widget_get_type (void);
+#define CHEESE_TYPE_AVATAR_WIDGET (cheese_avatar_widget_get_type ())
+G_DECLARE_FINAL_TYPE (CheeseAvatarWidget, cheese_avatar_widget, CHEESE, AVATAR_WIDGET, GtkBin)
 
 GtkWidget *cheese_avatar_widget_new (void);
 GdkPixbuf *cheese_avatar_widget_get_picture (CheeseAvatarWidget *widget);
 
 G_END_DECLS
 
-#endif /* _CHEESE_AVATAR_WIDGET_H_ */
+#endif /* CHEESE_AVATAR_WIDGET_H_ */
diff --git a/libcheese/cheese-camera-device.c b/libcheese/cheese-camera-device.c
index c0ef6b5..f4ff19d 100644
--- a/libcheese/cheese-camera-device.c
+++ b/libcheese/cheese-camera-device.c
@@ -94,7 +94,7 @@ enum
 
 static GParamSpec *properties[PROP_LAST];
 
-struct _CheeseCameraDevicePrivate
+typedef struct
 {
   gchar *device_node;
   gchar *uuid;
@@ -105,7 +105,7 @@ struct _CheeseCameraDevicePrivate
   GList   *formats; /* list members are CheeseVideoFormatFull structs. */
 
   GError *construct_error;
-};
+} CheeseCameraDevicePrivate;
 
 G_DEFINE_TYPE_WITH_CODE (CheeseCameraDevice, cheese_camera_device,
                          G_TYPE_OBJECT,
diff --git a/libcheese/cheese-camera-device.h b/libcheese/cheese-camera-device.h
index 8249474..071eb6b 100644
--- a/libcheese/cheese-camera-device.h
+++ b/libcheese/cheese-camera-device.h
@@ -20,39 +20,14 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __CHEESE_CAMERA_DEVICE_H__
-#define __CHEESE_CAMERA_DEVICE_H__
+#ifndef CHEESE_CAMERA_DEVICE_H_
+#define CHEESE_CAMERA_DEVICE_H_
 
 #include <glib-object.h>
 #include <gst/gst.h>
 
 G_BEGIN_DECLS
 
-#define CHEESE_TYPE_CAMERA_DEVICE (cheese_camera_device_get_type ())
-#define CHEESE_CAMERA_DEVICE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), CHEESE_TYPE_CAMERA_DEVICE, \
-                                                                       CheeseCameraDevice))
-#define CHEESE_CAMERA_DEVICE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST ((k), CHEESE_TYPE_CAMERA_DEVICE, \
-                                                                    CheeseCameraDeviceClass))
-#define CHEESE_IS_CAMERA_DEVICE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), CHEESE_TYPE_CAMERA_DEVICE))
-#define CHEESE_IS_CAMERA_DEVICE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), CHEESE_TYPE_CAMERA_DEVICE))
-#define CHEESE_CAMERA_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CHEESE_TYPE_CAMERA_DEVICE, \
-                                                                      CheeseCameraDeviceClass))
-
-typedef struct _CheeseCameraDevicePrivate CheeseCameraDevicePrivate;
-typedef struct _CheeseCameraDeviceClass CheeseCameraDeviceClass;
-typedef struct _CheeseCameraDevice CheeseCameraDevice;
-
-/**
- * CheeseCameraDeviceClass:
- *
- * Use the accessor functions below.
- */
-struct _CheeseCameraDeviceClass
-{
-  /*< private >*/
-  GObjectClass parent_class;
-};
-
 /**
  * CheeseCameraDevice:
  *
@@ -67,8 +42,6 @@ struct _CheeseCameraDevice
 
 #define CHEESE_TYPE_VIDEO_FORMAT (cheese_video_format_get_type ())
 
-typedef struct _CheeseVideoFormat CheeseVideoFormat;
-
 /**
  * CheeseVideoFormat:
  * @width: the width of of the video, in pixels
@@ -77,16 +50,17 @@ typedef struct _CheeseVideoFormat CheeseVideoFormat;
  * A description of the resolution, in pixels, of the format to capture with a
  * #CheeseCameraDevice.
  */
-struct _CheeseVideoFormat
+typedef struct
 {
   /*< public >*/
   gint width;
   gint height;
-};
+} CheeseVideoFormat;
 
 GType cheese_video_format_get_type (void);
 
-GType cheese_camera_device_get_type (void);
+#define CHEESE_TYPE_CAMERA_DEVICE (cheese_camera_device_get_type ())
+G_DECLARE_FINAL_TYPE (CheeseCameraDevice, cheese_camera_device, CHEESE, CAMERA_DEVICE, GObject)
 
 CheeseCameraDevice *cheese_camera_device_new (const gchar *uuid,
                                               const gchar *device_node,
@@ -104,8 +78,6 @@ const gchar *cheese_camera_device_get_src (CheeseCameraDevice *device);
 const gchar *cheese_camera_device_get_uuid (CheeseCameraDevice *device);
 const gchar *cheese_camera_device_get_device_node (CheeseCameraDevice *device);
 
-
-
 G_END_DECLS
 
-#endif /* __CHEESE_CAMERA_DEVICE_H__ */
+#endif /* CHEESE_CAMERA_DEVICE_H_ */
diff --git a/libcheese/cheese-effect.c b/libcheese/cheese-effect.c
index be090c0..0605ed6 100644
--- a/libcheese/cheese-effect.c
+++ b/libcheese/cheese-effect.c
@@ -42,12 +42,12 @@ enum
 
 static GParamSpec *properties[PROP_LAST];
 
-struct _CheeseEffectPrivate
+typedef struct
 {
   gchar *name;
   gchar *pipeline_desc;
   GstElement *control_valve;
-};
+} CheeseEffectPrivate;
 
 G_DEFINE_TYPE_WITH_PRIVATE (CheeseEffect, cheese_effect, G_TYPE_OBJECT)
 
diff --git a/libcheese/cheese-effect.h b/libcheese/cheese-effect.h
index 287790e..a09ac7a 100644
--- a/libcheese/cheese-effect.h
+++ b/libcheese/cheese-effect.h
@@ -17,45 +17,13 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _CHEESE_EFFECT_H_
-#define _CHEESE_EFFECT_H_
+#ifndef CHEESE_EFFECT_H_
+#define CHEESE_EFFECT_H_
 
 #include <glib-object.h>
 
 G_BEGIN_DECLS
 
-#define CHEESE_TYPE_EFFECT cheese_effect_get_type ()
-
-#define CHEESE_EFFECT(obj) \
-  (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHEESE_TYPE_EFFECT, CheeseEffect))
-
-#define CHEESE_EFFECT_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_CAST ((klass), CHEESE_TYPE_EFFECT, CheeseEffectClass))
-
-#define CHEESE_IS_EFFECT(obj) \
-  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHEESE_TYPE_EFFECT))
-
-#define CHEESE_IS_EFFECT_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_TYPE ((klass), CHEESE_TYPE_EFFECT))
-
-#define CHEESE_EFFECT_GET_CLASS(obj) \
-  (G_TYPE_INSTANCE_GET_CLASS ((obj), CHEESE_TYPE_EFFECT, CheeseEffectClass))
-
-typedef struct _CheeseEffectPrivate CheeseEffectPrivate;
-typedef struct _CheeseEffectClass CheeseEffectClass;
-typedef struct _CheeseEffect CheeseEffect;
-
-/**
- * CheeseEffectClass:
- *
- * Use the accessor functions below.
- */
-struct _CheeseEffectClass
-{
-  /*< private >*/
-  GObjectClass parent_class;
-};
-
 /**
  * CheeseEffect:
  *
@@ -68,7 +36,8 @@ struct _CheeseEffect
   void *unused;
 };
 
-GType cheese_effect_get_type (void);
+#define CHEESE_TYPE_EFFECT cheese_effect_get_type ()
+G_DECLARE_FINAL_TYPE (CheeseEffect, cheese_effect, CHEESE, EFFECT, GObject)
 
 CheeseEffect *cheese_effect_new (const gchar *name,
                                  const gchar *pipeline_desc);
@@ -83,4 +52,4 @@ GList        *cheese_effect_load_effects (void);
 
 G_END_DECLS
 
-#endif /* _CHEESE_EFFECT_H_ */
+#endif /* CHEESE_EFFECT_H_ */
diff --git a/libcheese/cheese-fileutil.c b/libcheese/cheese-fileutil.c
index d2d1658..6eb4c3f 100644
--- a/libcheese/cheese-fileutil.c
+++ b/libcheese/cheese-fileutil.c
@@ -39,13 +39,13 @@
  * for photos and videos.
  */
 
-struct _CheeseFileUtilPrivate
+typedef struct
 {
   gchar *video_path;
   gchar *photo_path;
   guint  burst_count;
   gchar *burst_raw_name;
-};
+} CheeseFileUtilPrivate;
 
 G_DEFINE_TYPE_WITH_PRIVATE (CheeseFileUtil, cheese_fileutil, G_TYPE_OBJECT)
 
diff --git a/libcheese/cheese-fileutil.h b/libcheese/cheese-fileutil.h
index 0553020..87f827f 100644
--- a/libcheese/cheese-fileutil.h
+++ b/libcheese/cheese-fileutil.h
@@ -19,8 +19,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __CHEESE_FILEUTIL_H__
-#define __CHEESE_FILEUTIL_H__
+#ifndef CHEESE_FILEUTIL_H_
+#define CHEESE_FILEUTIL_H_
 
 #include <glib-object.h>
 
@@ -40,28 +40,6 @@
 
 G_BEGIN_DECLS
 
-#define CHEESE_TYPE_FILEUTIL (cheese_fileutil_get_type ())
-#define CHEESE_FILEUTIL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHEESE_TYPE_FILEUTIL, 
CheeseFileUtil))
-#define CHEESE_FILEUTIL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), CHEESE_TYPE_FILEUTIL, 
CheeseFileUtilClass))
-#define CHEESE_IS_FILEUTIL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHEESE_TYPE_FILEUTIL))
-#define CHEESE_IS_FILEUTIL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CHEESE_TYPE_FILEUTIL))
-#define CHEESE_FILEUTIL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), CHEESE_TYPE_FILEUTIL, 
CheeseFileUtilClass))
-
-typedef struct _CheeseFileUtilPrivate CheeseFileUtilPrivate;
-typedef struct _CheeseFileUtilClass CheeseFileUtilClass;
-typedef struct _CheeseFileUtil CheeseFileUtil;
-
-/**
- * CheeseFileUtilClass:
- *
- * Use the accessor functions below.
- */
-struct _CheeseFileUtilClass
-{
-  /*< private >*/
-  GObjectClass parent_class;
-};
-
 /**
  * CheeseFileUtil:
  *
@@ -91,9 +69,10 @@ typedef enum
 } CheeseMediaMode;
 
 
-GType           cheese_fileutil_get_type (void);
-CheeseFileUtil *cheese_fileutil_new (void);
+#define CHEESE_TYPE_FILEUTIL (cheese_fileutil_get_type ())
+G_DECLARE_FINAL_TYPE (CheeseFileUtil, cheese_fileutil, CHEESE, FILEUTIL, GObject)
 
+CheeseFileUtil *cheese_fileutil_new (void);
 const gchar *cheese_fileutil_get_video_path (CheeseFileUtil *fileutil);
 const gchar *cheese_fileutil_get_photo_path (CheeseFileUtil *fileutil);
 gchar       *cheese_fileutil_get_new_media_filename (CheeseFileUtil *fileutil, CheeseMediaMode mode);
diff --git a/libcheese/cheese-flash.c b/libcheese/cheese-flash.c
index 8500acb..59959db 100644
--- a/libcheese/cheese-flash.c
+++ b/libcheese/cheese-flash.c
@@ -64,14 +64,14 @@ static const gdouble FLASH_LOW_THRESHOLD = 0.01;
  *
  * Private data for #CheeseFlash.
  */
-struct _CheeseFlashPrivate
+typedef struct
 {
   /*< private >*/
   GtkWidget *parent;
   guint flash_timeout_tag;
   guint fade_timeout_tag;
   gdouble opacity;
-};
+} CheeseFlashPrivate;
 
 G_DEFINE_TYPE_WITH_PRIVATE (CheeseFlash, cheese_flash, GTK_TYPE_WINDOW)
 
diff --git a/libcheese/cheese-flash.h b/libcheese/cheese-flash.h
index e1ca6ad..56a80b4 100644
--- a/libcheese/cheese-flash.h
+++ b/libcheese/cheese-flash.h
@@ -17,36 +17,14 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _CHEESE_FLASH_H_
-#define _CHEESE_FLASH_H_
+#ifndef CHEESE_FLASH_H_
+#define CHEESE_FLASH_H_
 
 #include <gtk/gtk.h>
 #include <glib-object.h>
 
 G_BEGIN_DECLS
 
-#define CHEESE_TYPE_FLASH (cheese_flash_get_type ())
-#define CHEESE_FLASH(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHEESE_TYPE_FLASH, CheeseFlash))
-#define CHEESE_FLASH_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), CHEESE_TYPE_FLASH, CheeseFlashClass))
-#define CHEESE_IS_FLASH(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHEESE_TYPE_FLASH))
-#define CHEESE_IS_FLASH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CHEESE_TYPE_FLASH))
-#define CHEESE_FLASH_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), CHEESE_TYPE_FLASH, CheeseFlashClass))
-
-typedef struct _CheeseFlashPrivate CheeseFlashPrivate;
-typedef struct _CheeseFlashClass CheeseFlashClass;
-typedef struct _CheeseFlash CheeseFlash;
-
-/**
- * CheeseFlashClass:
- *
- * Use the accessor functions below.
- */
-struct _CheeseFlashClass
-{
-  /*< private >*/
-  GtkWindowClass parent_class;
-};
-
 /**
  * CheeseFlash:
  *
@@ -59,11 +37,12 @@ struct _CheeseFlash
   void *unused;
 };
 
-GType        cheese_flash_get_type (void);
-CheeseFlash *cheese_flash_new (GtkWidget *parent);
+#define CHEESE_TYPE_FLASH (cheese_flash_get_type ())
+G_DECLARE_FINAL_TYPE (CheeseFlash, cheese_flash, CHEESE, FLASH, GtkWindow)
 
+CheeseFlash *cheese_flash_new (GtkWidget *parent);
 void cheese_flash_fire (CheeseFlash *flash);
 
 G_END_DECLS
 
-#endif /* _CHEESE_FLASH_H_ */
+#endif /* CHEESE_FLASH_H_ */
diff --git a/libcheese/cheese-widget.c b/libcheese/cheese-widget.c
index 586824d..2777b90 100644
--- a/libcheese/cheese-widget.c
+++ b/libcheese/cheese-widget.c
@@ -54,7 +54,19 @@ enum
 
 static GParamSpec *properties[PROP_LAST];
 
-struct _CheeseWidgetPrivate
+/**
+ * CheeseWidget:
+ *
+ * Use the accessor functions below.
+ */
+struct _CheeseWidget
+{
+  /*< private >*/
+  GtkNotebook parent_instance;
+  void *unused;
+};
+
+typedef struct
 {
   GtkWidget *spinner;
   GtkWidget *screen;
@@ -64,7 +76,7 @@ struct _CheeseWidgetPrivate
   CheeseCamera *webcam;
   CheeseWidgetState state;
   GError *error;
-};
+} CheeseWidgetPrivate;
 
 G_DEFINE_TYPE_WITH_PRIVATE (CheeseWidget, cheese_widget, GTK_TYPE_NOTEBOOK)
 
diff --git a/libcheese/cheese-widget.h b/libcheese/cheese-widget.h
index 799c7c0..e892387 100644
--- a/libcheese/cheese-widget.h
+++ b/libcheese/cheese-widget.h
@@ -17,8 +17,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _CHEESE_WIDGET_H_
-#define _CHEESE_WIDGET_H_
+#ifndef CHEESE_WIDGET_H_
+#define CHEESE_WIDGET_H_
 
 #include <glib-object.h>
 #include <gtk/gtk.h>
@@ -28,43 +28,7 @@
 G_BEGIN_DECLS
 
 #define CHEESE_TYPE_WIDGET (cheese_widget_get_type ())
-#define CHEESE_WIDGET(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHEESE_TYPE_WIDGET, \
-                                                                   CheeseWidget))
-#define CHEESE_WIDGET_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), CHEESE_TYPE_WIDGET, \
-                                                                CheeseWidgetClass))
-#define CHEESE_IS_WIDGET(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHEESE_TYPE_WIDGET))
-#define CHEESE_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CHEESE_TYPE_WIDGET))
-#define CHEESE_WIDGET_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), CHEESE_TYPE_WIDGET, \
-                                                                  CheeseWidgetClass))
-
-typedef struct _CheeseWidgetPrivate CheeseWidgetPrivate;
-typedef struct _CheeseWidgetClass CheeseWidgetClass;
-typedef struct _CheeseWidget CheeseWidget;
-
-/**
- * CheeseWidgetClass:
- *
- * Use the accessor functions below.
- */
-struct _CheeseWidgetClass
-{
-  /*< private >*/
-  GtkNotebookClass parent_class;
-};
-
-/**
- * CheeseWidget:
- *
- * Use the accessor functions below.
- */
-struct _CheeseWidget
-{
-  /*< private >*/
-  GtkNotebook parent_instance;
-  void *unused;
-};
-
-GType cheese_widget_get_type (void);
+G_DECLARE_FINAL_TYPE (CheeseWidget, cheese_widget, CHEESE, WIDGET, GtkNotebook)
 
 GtkWidget *cheese_widget_new (void);
 void       cheese_widget_get_error (CheeseWidget *widget, GError **error);
@@ -88,4 +52,4 @@ typedef enum
 
 G_END_DECLS
 
-#endif /* _CHEESE_WIDGET_H_ */
+#endif /* CHEESE_WIDGET_H_ */
diff --git a/src/thumbview/cheese-thumb-view.c b/src/thumbview/cheese-thumb-view.c
index 8a2f0b4..1d2d88f 100644
--- a/src/thumbview/cheese-thumb-view.c
+++ b/src/thumbview/cheese-thumb-view.c
@@ -38,6 +38,11 @@ const guint THUMB_VIEW_MINIMUM_HEIGHT = 100;
 
 const gchar CHEESE_OLD_VIDEO_NAME_SUFFIX[] = ".ogv";
 
+struct _CheeseThumbView
+{
+  GtkIconView parent;
+};
+
 typedef struct
 {
   GtkListStore *store;
diff --git a/src/thumbview/cheese-thumb-view.h b/src/thumbview/cheese-thumb-view.h
index 368a8ed..b7f7c1b 100644
--- a/src/thumbview/cheese-thumb-view.h
+++ b/src/thumbview/cheese-thumb-view.h
@@ -18,8 +18,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __CHEESE_THUMB_VIEW_H__
-#define __CHEESE_THUMB_VIEW_H__
+#ifndef CHEESE_THUMB_VIEW_H_
+#define CHEESE_THUMB_VIEW_H_
 
 #include <glib.h>
 #include <gtk/gtk.h>
@@ -28,26 +28,8 @@
 G_BEGIN_DECLS
 
 #define CHEESE_TYPE_THUMB_VIEW (cheese_thumb_view_get_type ())
-#define CHEESE_THUMB_VIEW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHEESE_TYPE_THUMB_VIEW, 
CheeseThumbView))
-#define CHEESE_THUMB_VIEW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), CHEESE_TYPE_THUMB_VIEW, \
-                                                                    CheeseThumbViewClass))
-#define CHEESE_IS_THUMB_VIEW(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHEESE_TYPE_THUMB_VIEW))
-#define CHEESE_IS_THUMB_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CHEESE_TYPE_THUMB_VIEW))
-#define CHEESE_THUMB_VIEW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), CHEESE_TYPE_THUMB_VIEW, \
-                                                                      CheeseThumbViewClass))
-
-typedef struct
-{
-  GtkIconView parent;
-} CheeseThumbView;
-
-typedef struct
-{
-  GtkIconViewClass parent_class;
-} CheeseThumbViewClass;
-
-
-GType      cheese_thumb_view_get_type (void);
+G_DECLARE_FINAL_TYPE (CheeseThumbView, cheese_thumb_view, CHEESE, THUMB_VIEW, GtkIconView)
+
 GtkWidget *cheese_thumb_view_new (void);
 
 GList *cheese_thumb_view_get_selected_images_list (CheeseThumbView *thumb_view);
@@ -60,4 +42,4 @@ void cheese_thumb_view_start_monitoring_video_path (CheeseThumbView *thumbview,
 
 G_END_DECLS
 
-#endif /* __CHEESE_THUMB_VIEW_H__ */
+#endif /* CHEESE_THUMB_VIEW_H__ */
diff --git a/src/thumbview/eog-thumb-nav.c b/src/thumbview/eog-thumb-nav.c
index 5a4114d..6c489ab 100644
--- a/src/thumbview/eog-thumb-nav.c
+++ b/src/thumbview/eog-thumb-nav.c
@@ -33,6 +33,11 @@
 #include <string.h>
 #include <math.h>
 
+struct _EogThumbNav
+{
+  GtkBox base_instance;
+};
+
 typedef struct
 {
   gboolean show_buttons;
diff --git a/src/thumbview/eog-thumb-nav.h b/src/thumbview/eog-thumb-nav.h
index b63374a..572bf03 100644
--- a/src/thumbview/eog-thumb-nav.h
+++ b/src/thumbview/eog-thumb-nav.h
@@ -19,8 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#ifndef __EOG_THUMB_NAV_H__
-#define __EOG_THUMB_NAV_H__
+#ifndef EOG_THUMB_NAV_H_
+#define EOG_THUMB_NAV_H_
 
 #include "cheese-thumb-view.h"
 
@@ -30,27 +30,8 @@
 
 G_BEGIN_DECLS
 
-typedef struct _EogThumbNav EogThumbNav;
-typedef struct _EogThumbNavClass EogThumbNavClass;
-
 #define EOG_TYPE_THUMB_NAV (eog_thumb_nav_get_type ())
-#define EOG_THUMB_NAV(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), EOG_TYPE_THUMB_NAV, EogThumbNav))
-#define EOG_THUMB_NAV_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), EOG_TYPE_THUMB_NAV, 
EogThumbNavClass))
-#define EOG_IS_THUMB_NAV(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EOG_TYPE_THUMB_NAV))
-#define EOG_IS_THUMB_NAV_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EOG_TYPE_THUMB_NAV))
-#define EOG_THUMB_NAV_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), EOG_TYPE_THUMB_NAV, 
EogThumbNavClass))
-
-struct _EogThumbNav
-{
-  GtkBox base_instance;
-};
-
-struct _EogThumbNavClass
-{
-  GtkBoxClass parent_class;
-};
-
-GType eog_thumb_nav_get_type (void);
+G_DECLARE_FINAL_TYPE (EogThumbNav, eog_thumb_nav, EOG, THUMB_NAV, GtkBox)
 
 GtkWidget *eog_thumb_nav_new (GtkWidget *thumbview,
                               gboolean   show_buttons);
@@ -71,4 +52,4 @@ void eog_thumb_nav_set_policy (EogThumbNav  *nav,
 
 G_END_DECLS
 
-#endif /* __EOG_THUMB_NAV_H__ */
+#endif /* EOG_THUMB_NAV_H__ */


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