From 3f5f362e0df717f2aaca8d21c3b3e180904a6897 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 2 Jul 2013 14:44:14 -0400 Subject: Split CalendarView into separate classes by view type. It's better to have separate classes each with a fixed type code, than one class with a variable type code. You'll see why in the next commit. --- calendar/gui/calendar-view.h | 57 +++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 32 deletions(-) (limited to 'calendar/gui/calendar-view.h') diff --git a/calendar/gui/calendar-view.h b/calendar/gui/calendar-view.h index 00e1eb6ed1..60b41ea0ea 100644 --- a/calendar/gui/calendar-view.h +++ b/calendar/gui/calendar-view.h @@ -1,6 +1,5 @@ /* - * - * Evolution calendar - Generic view object for calendar views + * calendar-view.h * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -15,48 +14,42 @@ * You should have received a copy of the GNU Lesser General Public * License along with the program; if not, see * - * - * Authors: - * Federico Mena-Quintero - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * */ #ifndef CALENDAR_VIEW_H #define CALENDAR_VIEW_H -#include "gnome-cal.h" +#include -G_BEGIN_DECLS - -#define TYPE_CALENDAR_VIEW (calendar_view_get_type ()) -#define CALENDAR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CALENDAR_VIEW, CalendarView)) -#define CALENDAR_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CALENDAR_VIEW, \ - CalendarViewClass)) -#define IS_CALENDAR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CALENDAR_VIEW)) -#define IS_CALENDAR_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CALENDAR_VIEW)) +/* Standard GObject macros */ +#define GAL_TYPE_VIEW_CALENDAR_DAY \ + (gal_view_calendar_day_get_type ()) +#define GAL_TYPE_VIEW_CALENDAR_WORK_WEEK \ + (gal_view_calendar_work_week_get_type ()) +#define GAL_TYPE_VIEW_CALENDAR_WEEK \ + (gal_view_calendar_week_get_type ()) +#define GAL_TYPE_VIEW_CALENDAR_MONTH \ + (gal_view_calendar_month_get_type ()) -typedef struct _CalendarViewPrivate CalendarViewPrivate; - -typedef struct { - GalView view; +G_BEGIN_DECLS - /* Private data */ - CalendarViewPrivate *priv; -} CalendarView; +typedef struct _GalView GalViewCalendarDay; +typedef struct _GalViewClass GalViewCalendarDayClass; -typedef struct { - GalViewClass parent_class; -} CalendarViewClass; +typedef struct _GalView GalViewCalendarWorkWeek; +typedef struct _GalViewClass GalViewCalendarWorkWeekClass; -GType calendar_view_get_type (void); +typedef struct _GalView GalViewCalendarWeek; +typedef struct _GalViewClass GalViewCalendarWeekClass; -CalendarView *calendar_view_new (GnomeCalendarViewType view_type, - const gchar *title); +typedef struct _GalView GalViewCalendarMonth; +typedef struct _GalViewClass GalViewCalendarMonthClass; -GnomeCalendarViewType calendar_view_get_view_type (CalendarView *cal_view); +GType gal_view_calendar_day_get_type (void) G_GNUC_CONST; +GType gal_view_calendar_work_week_get_type (void) G_GNUC_CONST; +GType gal_view_calendar_week_get_type (void) G_GNUC_CONST; +GType gal_view_calendar_month_get_type (void) G_GNUC_CONST; G_END_DECLS -#endif +#endif /* CALENDAR_VIEW_H */ -- cgit v1.2.3