aboutsummaryrefslogtreecommitdiffstats
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
parent66152fe6537418489c2186a5e5c269c6e7c81db3 (diff)
downloadgsoc2013-evolution-6ff314b9cc64c6a409f61913d40e1e935439a46c.tar
gsoc2013-evolution-6ff314b9cc64c6a409f61913d40e1e935439a46c.tar.gz
gsoc2013-evolution-6ff314b9cc64c6a409f61913d40e1e935439a46c.tar.bz2
gsoc2013-evolution-6ff314b9cc64c6a409f61913d40e1e935439a46c.tar.lz
gsoc2013-evolution-6ff314b9cc64c6a409f61913d40e1e935439a46c.tar.xz
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
-rw-r--r--calendar/ChangeLog18
-rw-r--r--calendar/gui/e-cal-list-view-config.c19
-rw-r--r--calendar/gui/e-cal-list-view.c13
-rw-r--r--calendar/gui/e-cal-model-calendar.c46
-rw-r--r--calendar/gui/e-cal-model-tasks.c48
-rw-r--r--calendar/gui/e-cal-model.c23
-rw-r--r--calendar/gui/e-calendar-table-config.c19
-rw-r--r--calendar/gui/e-calendar-table.c10
-rw-r--r--calendar/gui/e-calendar-view.c20
9 files changed, 97 insertions, 119 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 6332e6d2c6..5bbe96ecd0 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,23 @@
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
+
+2004-10-14 JP Rosevear <jpr@novell.com>
+
* gui/calendar-view.c: convert to G_DEFINE_TYPE
* gui/calendar-view-factory.c: ditto
diff --git a/calendar/gui/e-cal-list-view-config.c b/calendar/gui/e-cal-list-view-config.c
index 72c97455c6..51ebd58ed4 100644
--- a/calendar/gui/e-cal-list-view-config.c
+++ b/calendar/gui/e-cal-list-view-config.c
@@ -30,14 +30,14 @@ struct _ECalListViewConfigPrivate {
GList *notifications;
};
-static GObjectClass *parent_class = NULL;
-
/* Property IDs */
enum props {
PROP_0,
PROP_VIEW,
};
+G_DEFINE_TYPE (ECalListViewConfig, e_cal_list_view_config, G_TYPE_OBJECT);
+
static void
e_cal_list_view_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{
@@ -86,8 +86,8 @@ e_cal_list_view_config_dispose (GObject *object)
e_cal_list_view_config_set_view (view_config, NULL);
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ if (G_OBJECT_CLASS (e_cal_list_view_config_parent_class)->dispose)
+ G_OBJECT_CLASS (e_cal_list_view_config_parent_class)->dispose (object);
}
static void
@@ -100,8 +100,8 @@ e_cal_list_view_config_finalize (GObject *object)
g_free (priv);
- if (G_OBJECT_CLASS (parent_class)->finalize)
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ if (G_OBJECT_CLASS (e_cal_list_view_config_parent_class)->finalize)
+ G_OBJECT_CLASS (e_cal_list_view_config_parent_class)->finalize (object);
}
static void
@@ -110,8 +110,6 @@ e_cal_list_view_config_class_init (ECalListViewConfigClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GParamSpec *spec;
- parent_class = g_type_class_peek_parent (klass);
-
/* Method override */
gobject_class->set_property = e_cal_list_view_config_set_property;
gobject_class->get_property = e_cal_list_view_config_get_property;
@@ -124,15 +122,12 @@ e_cal_list_view_config_class_init (ECalListViewConfigClass *klass)
}
static void
-e_cal_list_view_config_init (ECalListViewConfig *view_config, ECalListViewConfigClass *klass)
+e_cal_list_view_config_init (ECalListViewConfig *view_config)
{
view_config->priv = g_new0 (ECalListViewConfigPrivate, 1);
}
-E_MAKE_TYPE (e_cal_list_view_config, "ECalListViewConfig", ECalListViewConfig, e_cal_list_view_config_class_init,
- e_cal_list_view_config_init, G_TYPE_OBJECT);
-
ECalListViewConfig *
e_cal_list_view_config_new (ECalListView *list_view)
{
diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c
index 69f4c85aa9..8e13003b12 100644
--- a/calendar/gui/e-cal-list-view.c
+++ b/calendar/gui/e-cal-list-view.c
@@ -25,7 +25,9 @@
* ECalListView - display calendar events in an ETable.
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include "e-cal-list-view.h"
#include "ea-calendar.h"
@@ -41,7 +43,6 @@
#include <gtk/gtkvscrollbar.h>
#include <gtk/gtkwindow.h>
#include <gal/widgets/e-gui-utils.h>
-#include <gal/util/e-util.h>
#include <gal/e-table/e-table-memory-store.h>
#include <gal/e-table/e-cell-checkbox.h>
#include <gal/e-table/e-cell-toggle.h>
@@ -70,8 +71,6 @@
#include "goto.h"
#include "misc.h"
-static void e_cal_list_view_class_init (ECalListViewClass *class);
-static void e_cal_list_view_init (ECalListView *cal_list_view);
static void e_cal_list_view_destroy (GtkObject *object);
static GList *e_cal_list_view_get_selected_events (ECalendarView *cal_view);
@@ -88,10 +87,7 @@ static gboolean e_cal_list_view_on_table_double_click (GtkWidget *table, gint
static gboolean e_cal_list_view_on_table_right_click (GtkWidget *table, gint row, gint col,
GdkEvent *event, gpointer data);
-static GtkTableClass *parent_class; /* Should be ECalendarViewClass? */
-
-E_MAKE_TYPE (e_cal_list_view, "ECalListView", ECalListView, e_cal_list_view_class_init,
- e_cal_list_view_init, e_calendar_view_get_type ());
+G_DEFINE_TYPE (ECalListView, e_cal_list_view, E_TYPE_CALENDAR_VIEW);
static void
e_cal_list_view_class_init (ECalListViewClass *class)
@@ -100,7 +96,6 @@ e_cal_list_view_class_init (ECalListViewClass *class)
GtkWidgetClass *widget_class;
ECalendarViewClass *view_class;
- parent_class = g_type_class_peek_parent (class);
object_class = (GtkObjectClass *) class;
widget_class = (GtkWidgetClass *) class;
view_class = (ECalendarViewClass *) class;
@@ -361,7 +356,7 @@ e_cal_list_view_destroy (GtkObject *object)
cal_list_view->table_scrolled = NULL;
}
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
+ GTK_OBJECT_CLASS (e_cal_list_view_parent_class)->destroy (object);
}
static void
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 :
diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c
index 508406c80d..0d36136b51 100644
--- a/calendar/gui/e-cal-model-tasks.c
+++ b/calendar/gui/e-cal-model-tasks.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,12 +18,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <math.h>
#include <string.h>
#include <gtk/gtkmessagedialog.h>
#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
#include "calendar-config.h"
#include "e-cal-model-tasks.h"
#include "e-cell-date-edit-text.h"
@@ -33,9 +34,7 @@
struct _ECalModelTasksPrivate {
};
-static void ecmt_class_init (ECalModelTasksClass *klass);
-static void ecmt_init (ECalModelTasks *model, ECalModelTasksClass *klass);
-static void ecmt_finalize (GObject *object);
+static void e_cal_model_tasks_finalize (GObject *object);
static int ecmt_column_count (ETableModel *etm);
static void *ecmt_value_at (ETableModel *etm, int col, int row);
@@ -51,21 +50,16 @@ static const char *ecmt_get_color_for_component (ECalModel *model, ECalModelComp
static void ecmt_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_tasks, "ECalModelTasks", ECalModelTasks, ecmt_class_init,
- ecmt_init, E_TYPE_CAL_MODEL);
+G_DEFINE_TYPE (ECalModelTasks, e_cal_model_tasks, E_TYPE_CAL_MODEL);
static void
-ecmt_class_init (ECalModelTasksClass *klass)
+e_cal_model_tasks_class_init (ECalModelTasksClass *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 = ecmt_finalize;
+ object_class->finalize = e_cal_model_tasks_finalize;
etm_class->column_count = ecmt_column_count;
etm_class->value_at = ecmt_value_at;
@@ -82,7 +76,7 @@ ecmt_class_init (ECalModelTasksClass *klass)
}
static void
-ecmt_init (ECalModelTasks *model, ECalModelTasksClass *klass)
+e_cal_model_tasks_init (ECalModelTasks *model)
{
ECalModelTasksPrivate *priv;
@@ -93,7 +87,7 @@ ecmt_init (ECalModelTasks *model, ECalModelTasksClass *klass)
}
static void
-ecmt_finalize (GObject *object)
+e_cal_model_tasks_finalize (GObject *object)
{
ECalModelTasksPrivate *priv;
ECalModelTasks *model = (ECalModelTasks *) object;
@@ -106,8 +100,8 @@ ecmt_finalize (GObject *object)
model->priv = NULL;
}
- if (parent_class->finalize)
- parent_class->finalize (object);
+ if (G_OBJECT_CLASS (e_cal_model_tasks_parent_class)->finalize)
+ G_OBJECT_CLASS (e_cal_model_tasks_parent_class)->finalize (object);
}
/* ETableModel methods */
@@ -472,7 +466,7 @@ ecmt_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_tasks_parent_class)->value_at (etm, col, row);
comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), row);
if (!comp_data)
@@ -789,7 +783,7 @@ ecmt_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_tasks_parent_class)->set_value_at (etm, col, row, value);
return;
}
@@ -846,7 +840,7 @@ ecmt_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_tasks_parent_class)->is_cell_editable (etm, col, row);
switch (col) {
case E_CAL_MODEL_TASKS_FIELD_COMPLETED :
@@ -869,7 +863,7 @@ ecmt_duplicate_value (ETableModel *etm, int col, const void *value)
g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_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_tasks_parent_class)->duplicate_value (etm, col, value);
switch (col) {
case E_CAL_MODEL_TASKS_FIELD_GEO :
@@ -905,7 +899,7 @@ ecmt_free_value (ETableModel *etm, int col, void *value)
g_return_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_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_tasks_parent_class)->free_value (etm, col, value);
return;
}
@@ -935,7 +929,7 @@ ecmt_initialize_value (ETableModel *etm, int col)
g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_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_tasks_parent_class)->initialize_value (etm, col);
switch (col) {
case E_CAL_MODEL_TASKS_FIELD_GEO :
@@ -967,7 +961,7 @@ ecmt_value_is_empty (ETableModel *etm, int col, const void *value)
priv = model->priv;
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_tasks_parent_class)->value_is_empty (etm, col, value);
switch (col) {
case E_CAL_MODEL_TASKS_FIELD_GEO :
@@ -997,7 +991,7 @@ ecmt_value_to_string (ETableModel *etm, int col, const void *value)
g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_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_tasks_parent_class)->value_to_string (etm, col, value);
switch (col) {
case E_CAL_MODEL_TASKS_FIELD_GEO :
@@ -1040,7 +1034,7 @@ ecmt_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data)
break;
}
- return E_CAL_MODEL_CLASS (parent_class)->get_color_for_component (model, comp_data);
+ return E_CAL_MODEL_CLASS (e_cal_model_tasks_parent_class)->get_color_for_component (model, comp_data);
}
static void
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 87f23b2f45..77f7e622ef 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.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>
*
@@ -26,7 +25,6 @@
#include <string.h>
#include <glib/garray.h>
#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
#include <e-util/e-time-utils.h>
#include <libecal/e-cal-time-util.h>
#include "comp-util.h"
@@ -76,8 +74,6 @@ struct _ECalModelPrivate {
gboolean use_24_hour_format;
};
-static void e_cal_model_class_init (ECalModelClass *klass);
-static void e_cal_model_init (ECalModel *model, ECalModelClass *klass);
static void e_cal_model_dispose (GObject *object);
static void e_cal_model_finalize (GObject *object);
@@ -109,10 +105,7 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
-static GObjectClass *parent_class = NULL;
-
-E_MAKE_TYPE (e_cal_model, "ECalModel", ECalModel, e_cal_model_class_init,
- e_cal_model_init, E_TABLE_MODEL_TYPE);
+G_DEFINE_TYPE (ECalModel, e_cal_model, E_TABLE_MODEL_TYPE);
static void
e_cal_model_class_init (ECalModelClass *klass)
@@ -120,8 +113,6 @@ e_cal_model_class_init (ECalModelClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ETableModelClass *etm_class = E_TABLE_MODEL_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
-
object_class->dispose = e_cal_model_dispose;
object_class->finalize = e_cal_model_finalize;
@@ -160,7 +151,7 @@ e_cal_model_class_init (ECalModelClass *klass)
}
static void
-e_cal_model_init (ECalModel *model, ECalModelClass *klass)
+e_cal_model_init (ECalModel *model)
{
ECalModelPrivate *priv;
@@ -271,8 +262,8 @@ e_cal_model_dispose (GObject *object)
priv->clients = NULL;
}
- if (parent_class->dispose)
- parent_class->dispose (object);
+ if (G_OBJECT_CLASS (e_cal_model_parent_class)->dispose)
+ G_OBJECT_CLASS (e_cal_model_parent_class)->dispose (object);
}
static void
@@ -295,8 +286,8 @@ e_cal_model_finalize (GObject *object)
g_free (priv);
- if (parent_class->finalize)
- parent_class->finalize (object);
+ if (G_OBJECT_CLASS (e_cal_model_parent_class)->finalize)
+ G_OBJECT_CLASS (e_cal_model_parent_class)->finalize (object);
}
/* ETableModel methods */
diff --git a/calendar/gui/e-calendar-table-config.c b/calendar/gui/e-calendar-table-config.c
index 25dd3d825d..ebe148b4fd 100644
--- a/calendar/gui/e-calendar-table-config.c
+++ b/calendar/gui/e-calendar-table-config.c
@@ -32,14 +32,14 @@ struct _ECalendarTableConfigPrivate {
GList *notifications;
};
-static GObjectClass *parent_class = NULL;
-
/* Property IDs */
enum props {
PROP_0,
PROP_TABLE
};
+G_DEFINE_TYPE (ECalendarTableConfig, e_calendar_table_config, G_TYPE_OBJECT);
+
static void
e_calendar_table_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{
@@ -88,8 +88,8 @@ e_calendar_table_config_dispose (GObject *object)
e_calendar_table_config_set_table (table_config, NULL);
- if (G_OBJECT_CLASS (parent_class)->dispose)
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ if (G_OBJECT_CLASS (e_calendar_table_config_parent_class)->dispose)
+ G_OBJECT_CLASS (e_calendar_table_config_parent_class)->dispose (object);
}
static void
@@ -102,8 +102,8 @@ e_calendar_table_config_finalize (GObject *object)
g_free (priv);
- if (G_OBJECT_CLASS (parent_class)->finalize)
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ if (G_OBJECT_CLASS (e_calendar_table_config_parent_class)->finalize)
+ G_OBJECT_CLASS (e_calendar_table_config_parent_class)->finalize (object);
}
static void
@@ -112,8 +112,6 @@ e_calendar_table_config_class_init (ECalendarTableConfigClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GParamSpec *spec;
- parent_class = g_type_class_peek_parent (klass);
-
/* Method override */
gobject_class->set_property = e_calendar_table_config_set_property;
gobject_class->get_property = e_calendar_table_config_get_property;
@@ -126,15 +124,12 @@ e_calendar_table_config_class_init (ECalendarTableConfigClass *klass)
}
static void
-e_calendar_table_config_init (ECalendarTableConfig *table_config, ECalendarTableConfigClass *klass)
+e_calendar_table_config_init (ECalendarTableConfig *table_config)
{
table_config->priv = g_new0 (ECalendarTableConfigPrivate, 1);
}
-E_MAKE_TYPE (e_calendar_table_config, "ECalendarTableConfig", ECalendarTableConfig, e_calendar_table_config_class_init,
- e_calendar_table_config_init, G_TYPE_OBJECT);
-
ECalendarTableConfig *
e_calendar_table_config_new (ECalendarTable *table)
{
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index d91297e249..6f84233ccd 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -27,7 +27,10 @@
* Used for calendar events and tasks.
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <sys/stat.h>
#include <unistd.h>
#include <gnome.h>
@@ -103,11 +106,9 @@ static const char* icon_names[E_CALENDAR_MODEL_NUM_ICONS] = {
};
static GdkPixbuf* icon_pixbufs[E_CALENDAR_MODEL_NUM_ICONS] = { 0 };
-static GtkTableClass *parent_class;
static GdkAtom clipboard_atom = GDK_NONE;
-E_MAKE_TYPE (e_calendar_table, "ECalendarTable", ECalendarTable, e_calendar_table_class_init,
- e_calendar_table_init, GTK_TYPE_TABLE);
+G_DEFINE_TYPE (ECalendarTable, e_calendar_table, GTK_TYPE_TABLE);
static void
e_calendar_table_class_init (ECalendarTableClass *class)
@@ -115,7 +116,6 @@ e_calendar_table_class_init (ECalendarTableClass *class)
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
- parent_class = g_type_class_peek_parent (class);
object_class = (GtkObjectClass *) class;
widget_class = (GtkWidgetClass *) class;
@@ -559,7 +559,7 @@ e_calendar_table_destroy (GtkObject *object)
cal_table->model = NULL;
}
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
+ GTK_OBJECT_CLASS (e_calendar_table_parent_class)->destroy (object);
}
/**
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index fea758bc17..2e9ccc33d1 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -21,7 +21,10 @@
* USA
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <string.h>
#include <time.h>
#include <gtk/gtkimage.h>
@@ -29,7 +32,6 @@
#include <gdk/gdkkeysyms.h>
#include <gtk/gtkbindings.h>
#include <libgnome/gnome-i18n.h>
-#include <gal/util/e-util.h>
#include <e-util/e-dialog-utils.h>
#include <e-util/e-icon-factory.h>
#include "e-calendar-marshal.h"
@@ -77,13 +79,10 @@ struct _ECalendarViewPrivate {
char *default_category;
};
-static void e_calendar_view_class_init (ECalendarViewClass *klass);
-static void e_calendar_view_init (ECalendarView *cal_view, ECalendarViewClass *klass);
static void e_calendar_view_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
static void e_calendar_view_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
static void e_calendar_view_destroy (GtkObject *object);
-static GObjectClass *parent_class = NULL;
static GdkAtom clipboard_atom = GDK_NONE;
extern ECompEditorRegistry *comp_editor_registry;
@@ -108,6 +107,8 @@ enum {
static guint e_calendar_view_signals[LAST_SIGNAL] = { 0 };
+G_DEFINE_TYPE (ECalendarView, e_calendar_view, GTK_TYPE_TABLE);
+
static void
e_calendar_view_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{
@@ -154,8 +155,6 @@ e_calendar_view_class_init (ECalendarViewClass *klass)
GtkBindingSet *binding_set;
- parent_class = g_type_class_peek_parent (klass);
-
/* Method override */
gobject_class->set_property = e_calendar_view_set_property;
gobject_class->get_property = e_calendar_view_get_property;
@@ -381,7 +380,7 @@ e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart
}
static void
-e_calendar_view_init (ECalendarView *cal_view, ECalendarViewClass *klass)
+e_calendar_view_init (ECalendarView *cal_view)
{
cal_view->priv = g_new0 (ECalendarViewPrivate, 1);
@@ -413,13 +412,10 @@ e_calendar_view_destroy (GtkObject *object)
cal_view->priv = NULL;
}
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
+ if (GTK_OBJECT_CLASS (e_calendar_view_parent_class)->destroy)
+ GTK_OBJECT_CLASS (e_calendar_view_parent_class)->destroy (object);
}
-E_MAKE_TYPE (e_calendar_view, "ECalendarView", ECalendarView, e_calendar_view_class_init,
- e_calendar_view_init, GTK_TYPE_TABLE);
-
GnomeCalendar *
e_calendar_view_get_calendar (ECalendarView *cal_view)
{