[evolution] GalViewFactoryClass: Add a "gal_view_type" member.



commit 880cf290462273744bd3da929d9f10964e618e2a
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Jul 2 16:54:22 2013 -0400

    GalViewFactoryClass: Add a "gal_view_type" member.
    
    This is the GType of the GalView instances the factory creates.
    
    Having this information will allow GalViewFactoryClass to do more itself
    and be less reliant on subclasses.

 .../gui/widgets/gal-view-factory-minicard.c        |    1 +
 calendar/gui/calendar-view-factory.c               |    4 ++++
 e-util/gal-view-factory-etable.c                   |    1 +
 e-util/gal-view-factory.h                          |    2 ++
 4 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.c 
b/addressbook/gui/widgets/gal-view-factory-minicard.c
index 5efd699..f9c78f9 100644
--- a/addressbook/gui/widgets/gal-view-factory-minicard.c
+++ b/addressbook/gui/widgets/gal-view-factory-minicard.c
@@ -51,6 +51,7 @@ gal_view_factory_minicard_class_init (GalViewFactoryMinicardClass *minicard_clas
        GalViewFactoryClass *view_factory_class;
 
        view_factory_class = GAL_VIEW_FACTORY_CLASS (minicard_class);
+       view_factory_class->gal_view_type = GAL_TYPE_VIEW_MINICARD;
        view_factory_class->get_type_code = gal_view_factory_minicard_get_type_code;
        view_factory_class->new_view = gal_view_factory_minicard_new_view;
 }
diff --git a/calendar/gui/calendar-view-factory.c b/calendar/gui/calendar-view-factory.c
index f23c997..ca4a117 100644
--- a/calendar/gui/calendar-view-factory.c
+++ b/calendar/gui/calendar-view-factory.c
@@ -61,6 +61,7 @@ gal_view_factory_calendar_day_new_view (GalViewFactory *factory,
 static void
 gal_view_factory_calendar_day_class_init (GalViewFactoryClass *class)
 {
+       class->gal_view_type = GAL_TYPE_VIEW_CALENDAR_DAY;
        class->get_type_code = gal_view_factory_calendar_day_get_type_code;
        class->new_view = gal_view_factory_calendar_day_new_view;
 }
@@ -88,6 +89,7 @@ gal_view_factory_calendar_work_week_new_view (GalViewFactory *factory,
 static void
 gal_view_factory_calendar_work_week_class_init (GalViewFactoryClass *class)
 {
+       class->gal_view_type = GAL_TYPE_VIEW_CALENDAR_WORK_WEEK;
        class->get_type_code = gal_view_factory_calendar_work_week_get_type_code;
        class->new_view = gal_view_factory_calendar_work_week_new_view;
 }
@@ -115,6 +117,7 @@ gal_view_factory_calendar_week_new_view (GalViewFactory *factory,
 static void
 gal_view_factory_calendar_week_class_init (GalViewFactoryClass *class)
 {
+       class->gal_view_type = GAL_TYPE_VIEW_CALENDAR_WEEK;
        class->get_type_code = gal_view_factory_calendar_week_get_type_code;
        class->new_view = gal_view_factory_calendar_week_new_view;
 }
@@ -142,6 +145,7 @@ gal_view_factory_calendar_month_new_view (GalViewFactory *factory,
 static void
 gal_view_factory_calendar_month_class_init (GalViewFactoryClass *class)
 {
+       class->gal_view_type = GAL_TYPE_VIEW_CALENDAR_MONTH;
        class->get_type_code = gal_view_factory_calendar_month_get_type_code;
        class->new_view = gal_view_factory_calendar_month_new_view;
 }
diff --git a/e-util/gal-view-factory-etable.c b/e-util/gal-view-factory-etable.c
index cc54468..53f58e8 100644
--- a/e-util/gal-view-factory-etable.c
+++ b/e-util/gal-view-factory-etable.c
@@ -51,6 +51,7 @@ gal_view_factory_etable_class_init (GalViewFactoryEtableClass *class)
        GalViewFactoryClass *view_factory_class;
 
        view_factory_class = GAL_VIEW_FACTORY_CLASS (class);
+       view_factory_class->gal_view_type = GAL_TYPE_VIEW_ETABLE;
        view_factory_class->get_type_code = view_factory_etable_get_type_code;
        view_factory_class->new_view = view_factory_etable_new_view;
 }
diff --git a/e-util/gal-view-factory.h b/e-util/gal-view-factory.h
index 2a67dbe..19f644e 100644
--- a/e-util/gal-view-factory.h
+++ b/e-util/gal-view-factory.h
@@ -61,6 +61,8 @@ struct _GalViewFactory {
 struct _GalViewFactoryClass {
        GObjectClass parent_class;
 
+       GType gal_view_type;
+
        /* Methods */
        const gchar *   (*get_type_code)        (GalViewFactory *factory);
        GalView *       (*new_view)             (GalViewFactory *factory,


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