aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/calendar-view.c')
-rw-r--r--calendar/gui/calendar-view.c162
1 files changed, 60 insertions, 102 deletions
diff --git a/calendar/gui/calendar-view.c b/calendar/gui/calendar-view.c
index 3639d3f7f6..f373469541 100644
--- a/calendar/gui/calendar-view.c
+++ b/calendar/gui/calendar-view.c
@@ -1,5 +1,5 @@
/*
- * Evolution calendar - Generic view object for calendar views
+ * calendar-view.c
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -14,137 +14,95 @@
* You should have received a copy of the GNU Lesser General Public
* License along with the program; if not, see <http://www.gnu.org/licenses/>
*
- *
- * Authors:
- * Federico Mena-Quintero <federico@ximian.com>
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "calendar-view.h"
-#define CALENDAR_VIEW_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), TYPE_CALENDAR_VIEW, CalendarViewPrivate))
+G_DEFINE_TYPE (
+ GalViewCalendarDay,
+ gal_view_calendar_day,
+ GAL_TYPE_VIEW)
-struct _CalendarViewPrivate {
- /* Type of the view */
- GnomeCalendarViewType view_type;
-};
+G_DEFINE_TYPE (
+ GalViewCalendarWorkWeek,
+ gal_view_calendar_work_week,
+ GAL_TYPE_VIEW)
-static const gchar *calendar_view_get_type_code (GalView *view);
-static GalView *calendar_view_clone (GalView *view);
+G_DEFINE_TYPE (
+ GalViewCalendarWeek,
+ gal_view_calendar_week,
+ GAL_TYPE_VIEW)
-G_DEFINE_TYPE (CalendarView, calendar_view, GAL_TYPE_VIEW)
+G_DEFINE_TYPE (
+ GalViewCalendarMonth,
+ gal_view_calendar_month,
+ GAL_TYPE_VIEW)
-/* Class initialization function for the calendar view */
-static void
-calendar_view_class_init (CalendarViewClass *class)
+static const gchar *
+gal_view_calendar_day_get_type_code (GalView *view)
{
- GalViewClass *gal_view_class;
-
- g_type_class_add_private (class, sizeof (CalendarViewPrivate));
-
- gal_view_class = (GalViewClass *) class;
+ return "day_view";
+}
- gal_view_class->get_type_code = calendar_view_get_type_code;
- gal_view_class->clone = calendar_view_clone;
+static void
+gal_view_calendar_day_class_init (GalViewClass *class)
+{
+ class->get_type_code = gal_view_calendar_day_get_type_code;
}
-/* Object initialization function for the calendar view */
static void
-calendar_view_init (CalendarView *cal_view)
+gal_view_calendar_day_init (GalView *view)
{
- cal_view->priv = CALENDAR_VIEW_GET_PRIVATE (cal_view);
}
-/* get_type_code method for the calendar view */
static const gchar *
-calendar_view_get_type_code (GalView *view)
+gal_view_calendar_work_week_get_type_code (GalView *view)
{
- CalendarView *cal_view;
- CalendarViewPrivate *priv;
-
- cal_view = CALENDAR_VIEW (view);
- priv = cal_view->priv;
-
- switch (priv->view_type) {
- case GNOME_CAL_DAY_VIEW:
- return "day_view";
-
- case GNOME_CAL_WORK_WEEK_VIEW:
- return "work_week_view";
-
- case GNOME_CAL_WEEK_VIEW:
- return "week_view";
-
- case GNOME_CAL_MONTH_VIEW:
- return "month_view";
-
- default:
- g_return_val_if_reached (NULL);
- }
+ return "work_week_view";
}
-/* clone method for the calendar view */
-static GalView *
-calendar_view_clone (GalView *view)
+static void
+gal_view_calendar_work_week_class_init (GalViewClass *class)
{
- CalendarView *cal_view;
- GalView *clone;
-
- /* Chain up to parent's clone() method. */
- clone = GAL_VIEW_CLASS (calendar_view_parent_class)->clone (view);
-
- cal_view = CALENDAR_VIEW (view);
- CALENDAR_VIEW (clone)->priv->view_type = cal_view->priv->view_type;
-
- return clone;
+ class->get_type_code = gal_view_calendar_work_week_get_type_code;
}
-/**
- * calendar_view_new:
- * @view_type: The type of calendar view that this object will represent.
- * @title: Title for the view.
- *
- * Creates a new calendar view object.
- *
- * Return value: A newly-created calendar view.
- **/
-CalendarView *
-calendar_view_new (GnomeCalendarViewType view_type,
- const gchar *title)
+static void
+gal_view_calendar_work_week_init (GalView *view)
{
- CalendarView *cal_view;
+}
- cal_view = g_object_new (TYPE_CALENDAR_VIEW, "title", title, NULL);
+static const gchar *
+gal_view_calendar_week_get_type_code (GalView *view)
+{
+ return "week_view";
+}
- cal_view->priv->view_type = view_type;
+static void
+gal_view_calendar_week_class_init (GalViewClass *class)
+{
+ class->get_type_code = gal_view_calendar_week_get_type_code;
+}
- return cal_view;
+static void
+gal_view_calendar_week_init (GalView *view)
+{
}
-/**
- * calendar_view_get_view_type:
- * @cal_view: A calendar view.
- *
- * Queries the calendar view type of a calendar view.
- *
- * Return value: Type of calendar view.
- **/
-GnomeCalendarViewType
-calendar_view_get_view_type (CalendarView *cal_view)
+static const gchar *
+gal_view_calendar_month_get_type_code (GalView *view)
{
- CalendarViewPrivate *priv;
+ return "month_view";
+}
- g_return_val_if_fail (cal_view != NULL, GNOME_CAL_DAY_VIEW);
- g_return_val_if_fail (IS_CALENDAR_VIEW (cal_view), GNOME_CAL_DAY_VIEW);
+static void
+gal_view_calendar_month_class_init (GalViewClass *class)
+{
+ class->get_type_code = gal_view_calendar_month_get_type_code;
+}
- priv = cal_view->priv;
- return priv->view_type;
+static void
+gal_view_calendar_month_init (GalView *view)
+{
}
+