aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-03-11 06:29:50 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-03-11 08:19:33 +0800
commit6af1b3178dcf5e3271f6be4d785c28cbe9043404 (patch)
treef3d05886ecb1a9f300adca7799ca59f8de4e717c /addressbook
parentc0533ef0530a1dfb8802731ad5fe6c4f8b3dccaf (diff)
downloadgsoc2013-evolution-6af1b3178dcf5e3271f6be4d785c28cbe9043404.tar.gz
gsoc2013-evolution-6af1b3178dcf5e3271f6be4d785c28cbe9043404.tar.zst
gsoc2013-evolution-6af1b3178dcf5e3271f6be4d785c28cbe9043404.zip
Clean up GalView and related classes.
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/gui/widgets/gal-view-factory-minicard.c52
-rw-r--r--addressbook/gui/widgets/gal-view-factory-minicard.h52
-rw-r--r--addressbook/gui/widgets/gal-view-minicard.c2
3 files changed, 56 insertions, 50 deletions
diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.c b/addressbook/gui/widgets/gal-view-factory-minicard.c
index ee61207855..d5804b18d9 100644
--- a/addressbook/gui/widgets/gal-view-factory-minicard.c
+++ b/addressbook/gui/widgets/gal-view-factory-minicard.c
@@ -29,39 +29,42 @@
#include "gal-view-factory-minicard.h"
#include "gal-view-minicard.h"
-G_DEFINE_TYPE (GalViewFactoryMinicard, gal_view_factory_minicard, GAL_VIEW_FACTORY_TYPE)
+G_DEFINE_TYPE (
+ GalViewFactoryMinicard,
+ gal_view_factory_minicard, GAL_TYPE_VIEW_FACTORY)
static const gchar *
-gal_view_factory_minicard_get_title (GalViewFactory *factory)
+gal_view_factory_minicard_get_title (GalViewFactory *factory)
{
return _("Card View");
}
-static GalView *
-gal_view_factory_minicard_new_view (GalViewFactory *factory,
- const gchar *name)
-{
- return gal_view_minicard_new(name);
-}
-
static const gchar *
gal_view_factory_minicard_get_type_code (GalViewFactory *factory)
{
return "minicard";
}
+static GalView *
+gal_view_factory_minicard_new_view (GalViewFactory *factory,
+ const gchar *name)
+{
+ return gal_view_minicard_new (name);
+}
+
static void
-gal_view_factory_minicard_class_init (GalViewFactoryMinicardClass *minicard_class)
+gal_view_factory_minicard_class_init (GalViewFactoryMinicardClass *minicard_class)
{
- GalViewFactoryClass *view_factory_class = GAL_VIEW_FACTORY_CLASS(minicard_class);
+ GalViewFactoryClass *view_factory_class;
- view_factory_class->get_title = gal_view_factory_minicard_get_title;
- view_factory_class->new_view = gal_view_factory_minicard_new_view;
- view_factory_class->get_type_code = gal_view_factory_minicard_get_type_code;
+ view_factory_class = GAL_VIEW_FACTORY_CLASS (minicard_class);
+ view_factory_class->get_title = gal_view_factory_minicard_get_title;
+ view_factory_class->get_type_code = gal_view_factory_minicard_get_type_code;
+ view_factory_class->new_view = gal_view_factory_minicard_new_view;
}
static void
-gal_view_factory_minicard_init (GalViewFactoryMinicard *factory)
+gal_view_factory_minicard_init (GalViewFactoryMinicard *factory)
{
}
@@ -74,23 +77,8 @@ gal_view_factory_minicard_init (GalViewFactoryMinicard *factory)
* Returns: The new GalViewFactoryMinicard.
*/
GalViewFactory *
-gal_view_factory_minicard_new (void)
-{
- return gal_view_factory_minicard_construct (g_object_new (GAL_TYPE_VIEW_FACTORY_MINICARD, NULL));
-}
-
-/**
- * gal_view_minicard_construct
- * @factory: The factory to construct
- *
- * constructs the GalViewFactoryMinicard. To be used by subclasses and
- * language bindings.
- *
- * Returns: The GalViewFactoryMinicard.
- */
-GalViewFactory *
-gal_view_factory_minicard_construct (GalViewFactoryMinicard *factory)
+gal_view_factory_minicard_new (void)
{
- return GAL_VIEW_FACTORY(factory);
+ return g_object_new (GAL_TYPE_VIEW_FACTORY_MINICARD, NULL);
}
diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.h b/addressbook/gui/widgets/gal-view-factory-minicard.h
index 0aa6dc5ba9..aa27bf9a27 100644
--- a/addressbook/gui/widgets/gal-view-factory-minicard.h
+++ b/addressbook/gui/widgets/gal-view-factory-minicard.h
@@ -23,29 +23,47 @@
*
*/
-#ifndef _GAL_VIEW_FACTORY_MINICARD_H_
-#define _GAL_VIEW_FACTORY_MINICARD_H_
+#ifndef GAL_VIEW_FACTORY_MINICARD_H
+#define GAL_VIEW_FACTORY_MINICARD_H
#include <glib-object.h>
#include <widgets/menus/gal-view-factory.h>
-#define GAL_TYPE_VIEW_FACTORY_MINICARD (gal_view_factory_minicard_get_type ())
-#define GAL_VIEW_FACTORY_MINICARD(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GAL_TYPE_VIEW_FACTORY_MINICARD, GalViewFactoryMinicard))
-#define GAL_VIEW_FACTORY_MINICARD_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GAL_TYPE_VIEW_FACTORY_MINICARD, GalViewFactoryMinicardClass))
-#define GAL_IS_VIEW_FACTORY_MINICARD(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GAL_TYPE_VIEW_FACTORY_MINICARD))
-#define GAL_IS_VIEW_FACTORY_MINICARD_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GAL_TYPE_VIEW_FACTORY_MINICARD))
+/* Standard GObject macros */
+#define GAL_TYPE_VIEW_FACTORY_MINICARD \
+ (gal_view_factory_minicard_get_type ())
+#define GAL_VIEW_FACTORY_MINICARD(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), GAL_TYPE_VIEW_FACTORY_MINICARD, GalViewFactoryMinicard))
+#define GAL_VIEW_FACTORY_MINICARD_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), GAL_TYPE_VIEW_FACTORY_MINICARD, GalViewFactoryMinicardClass))
+#define GAL_IS_VIEW_FACTORY_MINICARD(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), GAL_TYPE_VIEW_FACTORY_MINICARD))
+#define GAL_IS_VIEW_FACTORY_MINICARD_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), GAL_TYPE_VIEW_FACTORY_MINICARD))
+#define GAL_VIEW_FACTORY_MINICARD_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), GAL_TYPE_VIEW_FACTORY_MINICARD, GalViewFactoryMinicardClass))
-typedef struct {
- GalViewFactory base;
-} GalViewFactoryMinicard;
+G_BEGIN_DECLS
-typedef struct {
+typedef struct _GalViewFactoryMinicard GalViewFactoryMinicard;
+typedef struct _GalViewFactoryMinicardClass GalViewFactoryMinicardClass;
+
+struct _GalViewFactoryMinicard {
+ GalViewFactory parent;
+};
+
+struct _GalViewFactoryMinicardClass {
GalViewFactoryClass parent_class;
-} GalViewFactoryMinicardClass;
+};
+
+GType gal_view_factory_minicard_get_type (void);
+GalViewFactory *gal_view_factory_minicard_new (void);
-/* Standard functions */
-GType gal_view_factory_minicard_get_type (void);
-GalViewFactory *gal_view_factory_minicard_new (void);
-GalViewFactory *gal_view_factory_minicard_construct (GalViewFactoryMinicard *factory);
+G_END_DECLS
-#endif /* _GAL_VIEW_FACTORY_MINICARD_H_ */
+#endif /* GAL_VIEW_FACTORY_MINICARD_H */
diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c
index a40cd8420f..e5fe93d380 100644
--- a/addressbook/gui/widgets/gal-view-minicard.c
+++ b/addressbook/gui/widgets/gal-view-minicard.c
@@ -201,7 +201,7 @@ gal_view_minicard_get_type (void)
};
type = g_type_register_static (
- GAL_VIEW_TYPE, "GalViewMinicard", &type_info, 0);
+ GAL_TYPE_VIEW, "GalViewMinicard", &type_info, 0);
}
return type;