aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/menus/gal-view-factory.c
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 /widgets/menus/gal-view-factory.c
parentc0533ef0530a1dfb8802731ad5fe6c4f8b3dccaf (diff)
downloadgsoc2013-evolution-6af1b3178dcf5e3271f6be4d785c28cbe9043404.tar
gsoc2013-evolution-6af1b3178dcf5e3271f6be4d785c28cbe9043404.tar.gz
gsoc2013-evolution-6af1b3178dcf5e3271f6be4d785c28cbe9043404.tar.bz2
gsoc2013-evolution-6af1b3178dcf5e3271f6be4d785c28cbe9043404.tar.lz
gsoc2013-evolution-6af1b3178dcf5e3271f6be4d785c28cbe9043404.tar.xz
gsoc2013-evolution-6af1b3178dcf5e3271f6be4d785c28cbe9043404.tar.zst
gsoc2013-evolution-6af1b3178dcf5e3271f6be4d785c28cbe9043404.zip
Clean up GalView and related classes.
Diffstat (limited to 'widgets/menus/gal-view-factory.c')
-rw-r--r--widgets/menus/gal-view-factory.c88
1 files changed, 43 insertions, 45 deletions
diff --git a/widgets/menus/gal-view-factory.c b/widgets/menus/gal-view-factory.c
index d58a1545d0..7dec4416ef 100644
--- a/widgets/menus/gal-view-factory.c
+++ b/widgets/menus/gal-view-factory.c
@@ -20,83 +20,81 @@
*
*/
-#include <config.h>
-
-#include "e-util/e-util.h"
-
#include "gal-view-factory.h"
+#include <config.h>
+#include <e-util/e-util.h>
+
G_DEFINE_TYPE (GalViewFactory, gal_view_factory, G_TYPE_OBJECT)
-#define d(x)
+/* XXX Should GalViewFactory be a GInterface? */
-d(static gint depth = 0;)
+static void
+gal_view_factory_class_init (GalViewFactoryClass *class)
+{
+}
+
+static void
+gal_view_factory_init (GalViewFactory *factory)
+{
+}
/**
* gal_view_factory_get_title:
- * @factory: The factory to query.
+ * @factory: a #GalViewFactory
*
* Returns: The title of the factory.
*/
const gchar *
gal_view_factory_get_title (GalViewFactory *factory)
{
- g_return_val_if_fail (factory != NULL, NULL);
- g_return_val_if_fail (GAL_IS_VIEW_FACTORY (factory), NULL);
-
- if (GAL_VIEW_FACTORY_GET_CLASS (factory)->get_title)
- return GAL_VIEW_FACTORY_GET_CLASS (factory)->get_title (factory);
- else
- return NULL;
-}
+ GalViewFactoryClass *class;
-/**
- * gal_view_factory_new_view:
- * @factory: The factory to use
- * @name: the name for the view.
- *
- * Returns: The new view
- */
-GalView *
-gal_view_factory_new_view (GalViewFactory *factory,
- const gchar *name)
-{
- g_return_val_if_fail (factory != NULL, NULL);
g_return_val_if_fail (GAL_IS_VIEW_FACTORY (factory), NULL);
- if (GAL_VIEW_FACTORY_GET_CLASS (factory)->new_view)
- return GAL_VIEW_FACTORY_GET_CLASS (factory)->new_view (factory, name);
- else
- return NULL;
+ class = GAL_VIEW_FACTORY_GET_CLASS (factory);
+ g_return_val_if_fail (class->get_title != NULL, NULL);
+
+ return class->get_title (factory);
}
/**
* gal_view_factory_get_type_code:
- * @factory: The factory to use
+ * @factory: a #GalViewFactory
*
* Returns: The type code
*/
const gchar *
gal_view_factory_get_type_code (GalViewFactory *factory)
{
- g_return_val_if_fail (factory != NULL, NULL);
+ GalViewFactoryClass *class;
+
g_return_val_if_fail (GAL_IS_VIEW_FACTORY (factory), NULL);
- if (GAL_VIEW_FACTORY_GET_CLASS (factory)->get_type_code)
- return GAL_VIEW_FACTORY_GET_CLASS (factory)->get_type_code (factory);
- else
- return NULL;
-}
+ class = GAL_VIEW_FACTORY_GET_CLASS (factory);
+ g_return_val_if_fail (class->get_type_code != NULL, NULL);
-static void
-gal_view_factory_class_init (GalViewFactoryClass *klass)
-{
- klass->get_title = NULL;
- klass->new_view = NULL;
+ return class->get_type_code (factory);
}
-static void
-gal_view_factory_init (GalViewFactory *factory)
+/**
+ * gal_view_factory_new_view:
+ * @factory: a #GalViewFactory
+ * @name: the name for the view
+ *
+ * Returns: The new view
+ */
+GalView *
+gal_view_factory_new_view (GalViewFactory *factory,
+ const gchar *name)
{
+ GalViewFactoryClass *class;
+
+ g_return_val_if_fail (GAL_IS_VIEW_FACTORY (factory), NULL);
+
+ class = GAL_VIEW_FACTORY_GET_CLASS (factory);
+ g_return_val_if_fail (class->new_view != NULL, NULL);
+
+ return class->new_view (factory, name);
}