aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-cal-model-calendar.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@novell.com>2004-10-14 23:22:32 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-10-14 23:22:32 +0800
commit6ff314b9cc64c6a409f61913d40e1e935439a46c (patch)
tree423306d7f315ab72dbc34d9df87657ba6e808af5 /calendar/gui/e-cal-model-calendar.c
parent66152fe6537418489c2186a5e5c269c6e7c81db3 (diff)
downloadgsoc2013-evolution-6ff314b9cc64c6a409f61913d40e1e935439a46c.tar.gz
gsoc2013-evolution-6ff314b9cc64c6a409f61913d40e1e935439a46c.tar.zst
gsoc2013-evolution-6ff314b9cc64c6a409f61913d40e1e935439a46c.zip
convert to G_DEFINE_TYPE
2004-10-14 JP Rosevear <jpr@novell.com> * gui/e-cal-list-view-config.c: convert to G_DEFINE_TYPE * gui/e-cal-list-view.c: ditto * gui/e-cal-model-calendar.c: ditto * gui/e-cal-model-tasks.c: ditto * gui/e-cal-model.c: ditto * gui/e-calendar-table-config.c: ditto * gui/e-calendar-table.c: ditto * gui/e-calendar-view.c: ditto svn path=/trunk/; revision=27580
Diffstat (limited to 'calendar/gui/e-cal-model-calendar.c')
-rw-r--r--calendar/gui/e-cal-model-calendar.c46
1 files changed, 20 insertions, 26 deletions
diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c
index 63532c5be8..c4734d4d6f 100644
--- a/calendar/gui/e-cal-model-calendar.c
+++ b/calendar/gui/e-cal-model-calendar.c
@@ -1,7 +1,6 @@
/* Evolution calendar - Data model for ETable
*
- * Copyright (C) 2000 Ximian, Inc.
- * Copyright (C) 2000 Ximian, Inc.
+ * Copyright (C) 2004 Ximian, Inc.
*
* Authors: Rodrigo Moya <rodrigo@ximian.com>
*
@@ -19,10 +18,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <string.h>
#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
#include "e-cal-model-calendar.h"
#include "e-cell-date-edit-text.h"
#include "misc.h"
@@ -30,9 +31,7 @@
struct _ECalModelCalendarPrivate {
};
-static void ecmc_class_init (ECalModelCalendarClass *klass);
-static void ecmc_init (ECalModelCalendar *model, ECalModelCalendarClass *klass);
-static void ecmc_finalize (GObject *object);
+static void e_cal_model_calendar_finalize (GObject *object);
static int ecmc_column_count (ETableModel *etm);
static void *ecmc_value_at (ETableModel *etm, int col, int row);
static void ecmc_set_value_at (ETableModel *etm, int col, int row, const void *value);
@@ -46,21 +45,16 @@ static char *ecmc_value_to_string (ETableModel *etm, int col, const void *value)
static void ecmc_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data,
ETableModel *source_model, gint row);
-static GObjectClass *parent_class = NULL;
-
-E_MAKE_TYPE (e_cal_model_calendar, "ECalModelCalendar", ECalModelCalendar, ecmc_class_init,
- ecmc_init, E_TYPE_CAL_MODEL);
+G_DEFINE_TYPE (ECalModelCalendar, e_cal_model_calendar, E_TYPE_CAL_MODEL);
static void
-ecmc_class_init (ECalModelCalendarClass *klass)
+e_cal_model_calendar_class_init (ECalModelCalendarClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ETableModelClass *etm_class = E_TABLE_MODEL_CLASS (klass);
ECalModelClass *model_class = E_CAL_MODEL_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->finalize = ecmc_finalize;
+ object_class->finalize = e_cal_model_calendar_finalize;
etm_class->column_count = ecmc_column_count;
etm_class->value_at = ecmc_value_at;
@@ -76,7 +70,7 @@ ecmc_class_init (ECalModelCalendarClass *klass)
}
static void
-ecmc_init (ECalModelCalendar *model, ECalModelCalendarClass *klass)
+e_cal_model_calendar_init (ECalModelCalendar *model)
{
ECalModelCalendarPrivate *priv;
@@ -87,7 +81,7 @@ ecmc_init (ECalModelCalendar *model, ECalModelCalendarClass *klass)
}
static void
-ecmc_finalize (GObject *object)
+e_cal_model_calendar_finalize (GObject *object)
{
ECalModelCalendarPrivate *priv;
ECalModelCalendar *model = (ECalModelCalendar *) object;
@@ -100,8 +94,8 @@ ecmc_finalize (GObject *object)
model->priv = NULL;
}
- if (parent_class->finalize)
- parent_class->finalize (object);
+ if (G_OBJECT_CLASS (e_cal_model_calendar_parent_class)->finalize)
+ G_OBJECT_CLASS (e_cal_model_calendar_parent_class)->finalize (object);
}
/* ETableModel methods */
@@ -202,7 +196,7 @@ ecmc_value_at (ETableModel *etm, int col, int row)
g_return_val_if_fail (row >= 0 && row < e_table_model_row_count (etm), NULL);
if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->value_at (etm, col, row);
+ return E_TABLE_MODEL_CLASS (e_cal_model_calendar_parent_class)->value_at (etm, col, row);
comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), row);
if (!comp_data)
@@ -342,7 +336,7 @@ ecmc_set_value_at (ETableModel *etm, int col, int row, const void *value)
g_return_if_fail (row >= 0 && row < e_table_model_row_count (etm));
if (col < E_CAL_MODEL_FIELD_LAST) {
- E_TABLE_MODEL_CLASS (parent_class)->set_value_at (etm, col, row, value);
+ E_TABLE_MODEL_CLASS (e_cal_model_calendar_parent_class)->set_value_at (etm, col, row, value);
return;
}
@@ -380,7 +374,7 @@ ecmc_is_cell_editable (ETableModel *etm, int col, int row)
g_return_val_if_fail (row >= -1 || (row >= 0 && row < e_table_model_row_count (etm)), FALSE);
if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->is_cell_editable (etm, col, row);
+ return E_TABLE_MODEL_CLASS (e_cal_model_calendar_parent_class)->is_cell_editable (etm, col, row);
switch (col) {
case E_CAL_MODEL_CALENDAR_FIELD_DTEND :
@@ -398,7 +392,7 @@ ecmc_duplicate_value (ETableModel *etm, int col, const void *value)
g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, NULL);
if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->duplicate_value (etm, col, value);
+ return E_TABLE_MODEL_CLASS (e_cal_model_calendar_parent_class)->duplicate_value (etm, col, value);
switch (col) {
case E_CAL_MODEL_CALENDAR_FIELD_DTEND :
@@ -426,7 +420,7 @@ ecmc_free_value (ETableModel *etm, int col, void *value)
g_return_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST);
if (col < E_CAL_MODEL_FIELD_LAST) {
- E_TABLE_MODEL_CLASS (parent_class)->free_value (etm, col, value);
+ E_TABLE_MODEL_CLASS (e_cal_model_calendar_parent_class)->free_value (etm, col, value);
return;
}
@@ -446,7 +440,7 @@ ecmc_initialize_value (ETableModel *etm, int col)
g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, NULL);
if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->initialize_value (etm, col);
+ return E_TABLE_MODEL_CLASS (e_cal_model_calendar_parent_class)->initialize_value (etm, col);
switch (col) {
case E_CAL_MODEL_CALENDAR_FIELD_DTEND :
@@ -465,7 +459,7 @@ ecmc_value_is_empty (ETableModel *etm, int col, const void *value)
g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, TRUE);
if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->value_is_empty (etm, col, value);
+ return E_TABLE_MODEL_CLASS (e_cal_model_calendar_parent_class)->value_is_empty (etm, col, value);
switch (col) {
case E_CAL_MODEL_CALENDAR_FIELD_DTEND :
@@ -484,7 +478,7 @@ ecmc_value_to_string (ETableModel *etm, int col, const void *value)
g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, g_strdup (""));
if (col < E_CAL_MODEL_FIELD_LAST)
- return E_TABLE_MODEL_CLASS (parent_class)->value_to_string (etm, col, value);
+ return E_TABLE_MODEL_CLASS (e_cal_model_calendar_parent_class)->value_to_string (etm, col, value);
switch (col) {
case E_CAL_MODEL_CALENDAR_FIELD_DTEND :