aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-07-17 20:00:40 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-07-17 20:00:40 +0800
commitce6939b848eb228ec705aac4c8de6cfec16ecd10 (patch)
tree045f620b4d4c22352cba5568b697c688ed8c5a10 /calendar/gui
parente05eb7f89e180a734a07ee6576f56b8bfa84fc17 (diff)
downloadgsoc2013-evolution-ce6939b848eb228ec705aac4c8de6cfec16ecd10.tar.gz
gsoc2013-evolution-ce6939b848eb228ec705aac4c8de6cfec16ecd10.tar.zst
gsoc2013-evolution-ce6939b848eb228ec705aac4c8de6cfec16ecd10.zip
new base class for calendar views.
2003-07-17 Rodrigo Moya <rodrigo@ximian.com> * gui/e-cal-view.[ch]: new base class for calendar views. * gui/e-day-view.[ch]: * gui/e-week-view.[ch]: base these classes on ECalView. * gui/Makefile.am: added new files. svn path=/trunk/; revision=21854
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/e-cal-view.c70
-rw-r--r--calendar/gui/e-cal-view.h55
-rw-r--r--calendar/gui/e-calendar-view.c70
-rw-r--r--calendar/gui/e-calendar-view.h55
-rw-r--r--calendar/gui/e-day-view.c2
-rw-r--r--calendar/gui/e-day-view.h6
-rw-r--r--calendar/gui/e-week-view.c4
-rw-r--r--calendar/gui/e-week-view.h5
8 files changed, 260 insertions, 7 deletions
diff --git a/calendar/gui/e-cal-view.c b/calendar/gui/e-cal-view.c
new file mode 100644
index 0000000000..af2223bbff
--- /dev/null
+++ b/calendar/gui/e-cal-view.c
@@ -0,0 +1,70 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * Author :
+ * Rodrigo Moya <rodrigo@ximian.com>
+ *
+ * Copyright 2003, Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#include <config.h>
+#include <gal/util/e-util.h>
+#include "e-cal-view.h"
+
+struct _ECalViewPrivate {
+};
+
+static void e_cal_view_class_init (ECalViewClass *klass);
+static void e_cal_view_init (ECalView *cal_view, ECalViewClass *klass);
+static void e_cal_view_destroy (GtkObject *object);
+
+static GObjectClass *parent_class = NULL;
+
+static void
+e_cal_view_class_init (ECalViewClass *klass)
+{
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ object_class->destroy = e_cal_view_destroy;
+}
+
+static void
+e_cal_view_init (ECalView *cal_view, ECalViewClass *klass)
+{
+ cal_view->priv = g_new0 (ECalViewPrivate, 1);
+}
+
+static void
+e_cal_view_destroy (GtkObject *object)
+{
+ ECalView *cal_view = (ECalView *) object;
+
+ g_return_if_fail (E_IS_CAL_VIEW (cal_view));
+
+ if (cal_view->priv) {
+ g_free (cal_view->priv);
+ cal_view->priv = NULL;
+ }
+
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ GTK_OBJECT_CLASS (parent_class)->destroy (object);
+}
+
+E_MAKE_TYPE (e_cal_view, "ECalView", ECalView, e_cal_view_class_init,
+ e_cal_view_init, GTK_TYPE_TABLE);
diff --git a/calendar/gui/e-cal-view.h b/calendar/gui/e-cal-view.h
new file mode 100644
index 0000000000..bbcfbc8990
--- /dev/null
+++ b/calendar/gui/e-cal-view.h
@@ -0,0 +1,55 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * Author :
+ * Rodrigo Moya <rodrigo@ximian.com>
+ *
+ * Copyright 2003, Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+#ifndef _E_CAL_VIEW_H_
+#define _E_CAL_VIEW_H_
+
+#include <gtk/gtktable.h>
+
+G_BEGIN_DECLS
+
+/*
+ * EView - base widget class for the calendar views.
+ */
+
+#define E_CAL_VIEW(obj) GTK_CHECK_CAST (obj, e_cal_view_get_type (), ECalView)
+#define E_CAL_VIEW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_cal_view_get_type (), ECalViewClass)
+#define E_IS_CAL_VIEW(obj) GTK_CHECK_TYPE (obj, e_cal_view_get_type ())
+
+typedef struct _ECalView ECalView;
+typedef struct _ECalViewClass ECalViewClass;
+typedef struct _ECalViewPrivate ECalViewPrivate;
+
+struct _ECalView {
+ GtkTable table;
+ ECalViewPrivate *priv;
+};
+
+struct _ECalViewClass {
+ GtkTableClass parent_class;
+};
+
+GType e_cal_view_get_type (void);
+
+G_END_DECLS
+
+#endif
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
new file mode 100644
index 0000000000..af2223bbff
--- /dev/null
+++ b/calendar/gui/e-calendar-view.c
@@ -0,0 +1,70 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * Author :
+ * Rodrigo Moya <rodrigo@ximian.com>
+ *
+ * Copyright 2003, Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#include <config.h>
+#include <gal/util/e-util.h>
+#include "e-cal-view.h"
+
+struct _ECalViewPrivate {
+};
+
+static void e_cal_view_class_init (ECalViewClass *klass);
+static void e_cal_view_init (ECalView *cal_view, ECalViewClass *klass);
+static void e_cal_view_destroy (GtkObject *object);
+
+static GObjectClass *parent_class = NULL;
+
+static void
+e_cal_view_class_init (ECalViewClass *klass)
+{
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ object_class->destroy = e_cal_view_destroy;
+}
+
+static void
+e_cal_view_init (ECalView *cal_view, ECalViewClass *klass)
+{
+ cal_view->priv = g_new0 (ECalViewPrivate, 1);
+}
+
+static void
+e_cal_view_destroy (GtkObject *object)
+{
+ ECalView *cal_view = (ECalView *) object;
+
+ g_return_if_fail (E_IS_CAL_VIEW (cal_view));
+
+ if (cal_view->priv) {
+ g_free (cal_view->priv);
+ cal_view->priv = NULL;
+ }
+
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ GTK_OBJECT_CLASS (parent_class)->destroy (object);
+}
+
+E_MAKE_TYPE (e_cal_view, "ECalView", ECalView, e_cal_view_class_init,
+ e_cal_view_init, GTK_TYPE_TABLE);
diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h
new file mode 100644
index 0000000000..bbcfbc8990
--- /dev/null
+++ b/calendar/gui/e-calendar-view.h
@@ -0,0 +1,55 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ * Author :
+ * Rodrigo Moya <rodrigo@ximian.com>
+ *
+ * Copyright 2003, Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+#ifndef _E_CAL_VIEW_H_
+#define _E_CAL_VIEW_H_
+
+#include <gtk/gtktable.h>
+
+G_BEGIN_DECLS
+
+/*
+ * EView - base widget class for the calendar views.
+ */
+
+#define E_CAL_VIEW(obj) GTK_CHECK_CAST (obj, e_cal_view_get_type (), ECalView)
+#define E_CAL_VIEW_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_cal_view_get_type (), ECalViewClass)
+#define E_IS_CAL_VIEW(obj) GTK_CHECK_TYPE (obj, e_cal_view_get_type ())
+
+typedef struct _ECalView ECalView;
+typedef struct _ECalViewClass ECalViewClass;
+typedef struct _ECalViewPrivate ECalViewPrivate;
+
+struct _ECalView {
+ GtkTable table;
+ ECalViewPrivate *priv;
+};
+
+struct _ECalViewClass {
+ GtkTableClass parent_class;
+};
+
+GType e_cal_view_get_type (void);
+
+G_END_DECLS
+
+#endif
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 223a2fe3bd..f40417ec50 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -500,7 +500,7 @@ static GtkTableClass *parent_class;
static GdkAtom clipboard_atom = GDK_NONE;
E_MAKE_TYPE (e_day_view, "EDayView", EDayView, e_day_view_class_init,
- e_day_view_init, GTK_TYPE_TABLE);
+ e_day_view_init, e_cal_view_get_type ());
static void
e_day_view_class_init (EDayViewClass *class)
diff --git a/calendar/gui/e-day-view.h b/calendar/gui/e-day-view.h
index 6485102fc7..f8889ac26b 100644
--- a/calendar/gui/e-day-view.h
+++ b/calendar/gui/e-day-view.h
@@ -26,9 +26,11 @@
#include <time.h>
#include <gtk/gtktable.h>
+#include <gtk/gtktooltips.h>
#include <libgnomecanvas/gnome-canvas.h>
#include <gal/widgets/e-popup-menu.h>
+#include "e-cal-view.h"
#include "gnome-cal.h"
#include "evolution-activity-client.h"
@@ -222,7 +224,7 @@ typedef struct _EDayViewClass EDayViewClass;
struct _EDayView
{
- GtkTable table;
+ ECalView cal_view;
/* The top canvas where the dates and long appointments are shown. */
GtkWidget *top_canvas;
@@ -505,7 +507,7 @@ struct _EDayView
struct _EDayViewClass
{
- GtkTableClass parent_class;
+ ECalViewClass parent_class;
/* Notification signals */
void (* selection_changed) (EDayView *day_view);
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index ec2bf212f1..120c494583 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -250,11 +250,11 @@ static void e_week_view_queue_layout (EWeekView *week_view);
static void e_week_view_cancel_layout (EWeekView *week_view);
static gboolean e_week_view_layout_timeout_cb (gpointer data);
-static GtkTableClass *parent_class;
+static ECalViewClass *parent_class;
static GdkAtom clipboard_atom = GDK_NONE;
E_MAKE_TYPE (e_week_view, "EWeekView", EWeekView, e_week_view_class_init,
- e_week_view_init, GTK_TYPE_TABLE);
+ e_week_view_init, e_cal_view_get_type ());
static void
e_week_view_class_init (EWeekViewClass *class)
diff --git a/calendar/gui/e-week-view.h b/calendar/gui/e-week-view.h
index fe535c5335..c1379f6728 100644
--- a/calendar/gui/e-week-view.h
+++ b/calendar/gui/e-week-view.h
@@ -28,6 +28,7 @@
#include <libgnomecanvas/gnome-canvas.h>
#include <gal/widgets/e-popup-menu.h>
+#include "e-cal-view.h"
#include "gnome-cal.h"
#include "evolution-activity-client.h"
@@ -178,7 +179,7 @@ typedef struct _EWeekViewClass EWeekViewClass;
struct _EWeekView
{
- GtkTable table;
+ ECalView cal_view;
/* The top canvas where the dates are shown. */
GtkWidget *titles_canvas;
@@ -374,7 +375,7 @@ struct _EWeekView
struct _EWeekViewClass
{
- GtkTableClass parent_class;
+ ECalViewClass parent_class;
/* Notification signals */
void (* selection_changed) (EWeekView *week_view);