aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Rosevear <jpr@novell.com>2004-10-14 23:53:29 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-10-14 23:53:29 +0800
commitdce3735025a16ac72151b751a061120fe4209648 (patch)
treef3c60bed93fe807fbeccbbde1cce6c2599852610
parent086338bb035c96491b792bd93f65a94d1f236916 (diff)
downloadgsoc2013-evolution-dce3735025a16ac72151b751a061120fe4209648.tar.gz
gsoc2013-evolution-dce3735025a16ac72151b751a061120fe4209648.tar.zst
gsoc2013-evolution-dce3735025a16ac72151b751a061120fe4209648.zip
convert to G_DEFINE_TYPE
2004-10-14 JP Rosevear <jpr@novell.com> * gui/e-meeting-attendee.c: convert to G_DEFINE_TYPE * gui/e-meeting-list-view.c: ditto * gui/e-meeting-time-sel.c: ditto * gui/e-meeting-time-sel-item.c: ditto * gui/e-select-names-renderer.c: ditto * gui/e-timezone-entry.c: ditto * gui/e-tasks.c: ditto * gui/gnome-cal.c: ditto * gui/weekday-picker.c: ditto svn path=/trunk/; revision=27584
-rw-r--r--calendar/ChangeLog20
-rw-r--r--calendar/gui/e-meeting-attendee.c24
-rw-r--r--calendar/gui/e-meeting-list-view.c19
-rw-r--r--calendar/gui/e-meeting-time-sel-item.c26
-rw-r--r--calendar/gui/e-meeting-time-sel.c29
-rw-r--r--calendar/gui/e-select-names-renderer.c42
-rw-r--r--calendar/gui/e-tasks.c24
-rw-r--r--calendar/gui/e-timezone-entry.c14
-rw-r--r--calendar/gui/gnome-cal.c36
-rw-r--r--calendar/gui/weekday-picker.c26
10 files changed, 108 insertions, 152 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 713b25cb07..6c3d306f4d 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,25 @@
2004-10-14 JP Rosevear <jpr@novell.com>
+ * gui/e-meeting-attendee.c: convert to G_DEFINE_TYPE
+
+ * gui/e-meeting-list-view.c: ditto
+
+ * gui/e-meeting-time-sel.c: ditto
+
+ * gui/e-meeting-time-sel-item.c: ditto
+
+ * gui/e-select-names-renderer.c: ditto
+
+ * gui/e-timezone-entry.c: ditto
+
+ * gui/e-tasks.c: ditto
+
+ * gui/gnome-cal.c: ditto
+
+ * gui/weekday-picker.c: ditto
+
+2004-10-14 JP Rosevear <jpr@novell.com>
+
* gui/e-cell-date-edit-config.c: convert to G_DEFINE_TYPE
* gui/e-cell-date-edit-text.c: ditto
diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c
index 474cf7b1a4..e66667fd0b 100644
--- a/calendar/gui/e-meeting-attendee.c
+++ b/calendar/gui/e-meeting-attendee.c
@@ -26,7 +26,6 @@
#include <stdlib.h>
#include <gtk/gtk.h>
-#include <gal/util/e-util.h>
#include "e-meeting-attendee.h"
struct _EMeetingAttendeePrivate {
@@ -68,23 +67,16 @@ enum {
};
static guint signals[LAST_SIGNAL];
-static void class_init (EMeetingAttendeeClass *klass);
-static void init (EMeetingAttendee *ia);
-static void finalize (GObject *obj);
+static void e_meeting_attendee_finalize (GObject *obj);
-
-static GObjectClass *parent_class = NULL;
-
-E_MAKE_TYPE (e_meeting_attendee, "EMeetingAttendee", EMeetingAttendee,
- class_init, init, G_TYPE_OBJECT);
+G_DEFINE_TYPE (EMeetingAttendee, e_meeting_attendee, G_TYPE_OBJECT);
static void
-class_init (EMeetingAttendeeClass *klass)
+e_meeting_attendee_class_init (EMeetingAttendeeClass *klass)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass);
- parent_class = g_type_class_peek_parent (klass);
signals[CHANGED] =
g_signal_new ("changed",
@@ -95,7 +87,7 @@ class_init (EMeetingAttendeeClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- object_class->finalize = finalize;
+ object_class->finalize = e_meeting_attendee_finalize;
}
static gchar *
@@ -120,7 +112,7 @@ notify_changed (EMeetingAttendee *ia)
}
static void
-init (EMeetingAttendee *ia)
+e_meeting_attendee_init (EMeetingAttendee *ia)
{
EMeetingAttendeePrivate *priv;
@@ -167,7 +159,7 @@ init (EMeetingAttendee *ia)
static void
-finalize (GObject *obj)
+e_meeting_attendee_finalize (GObject *obj)
{
EMeetingAttendee *ia = E_MEETING_ATTENDEE (obj);
EMeetingAttendeePrivate *priv;
@@ -188,8 +180,8 @@ finalize (GObject *obj)
g_free (priv);
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (obj);
+ if (G_OBJECT_CLASS (e_meeting_attendee_parent_class)->finalize)
+ (* G_OBJECT_CLASS (e_meeting_attendee_parent_class)->finalize) (obj);
}
GObject *
diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c
index 82be947d8c..a8f30f9bec 100644
--- a/calendar/gui/e-meeting-list-view.c
+++ b/calendar/gui/e-meeting-list-view.c
@@ -67,10 +67,10 @@ static icalparameter_role roles[] = {ICAL_ROLE_CHAIR,
ICAL_ROLE_NONPARTICIPANT,
ICAL_ROLE_NONE};
-static GtkTreeViewClass *parent_class = NULL;
+G_DEFINE_TYPE (EMeetingListView, e_meeting_list_view, GTK_TYPE_TREE_VIEW);
static void
-emlv_finalize (GObject *obj)
+e_meeting_list_view_finalize (GObject *obj)
{
EMeetingListView *view = E_MEETING_LIST_VIEW (obj);
EMeetingListViewPrivate *priv = view->priv;
@@ -84,21 +84,23 @@ emlv_finalize (GObject *obj)
g_free (priv);
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (obj);
+ if (G_OBJECT_CLASS (e_meeting_list_view_parent_class)->finalize)
+ (* G_OBJECT_CLASS (e_meeting_list_view_parent_class)->finalize) (obj);
}
static void
-emlv_class_init (GObjectClass *klass)
+e_meeting_list_view_class_init (EMeetingListViewClass *klass)
{
- parent_class = g_type_class_peek_parent (klass);
+ GObjectClass *object_class;
- klass->finalize = emlv_finalize;
+ object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = e_meeting_list_view_finalize;
}
static void
-emlv_init (EMeetingListView *view)
+e_meeting_list_view_init (EMeetingListView *view)
{
EMeetingListViewPrivate *priv;
@@ -109,7 +111,6 @@ emlv_init (EMeetingListView *view)
priv->corba_select_names = CORBA_OBJECT_NIL;
}
-E_MAKE_TYPE (e_meeting_list_view, "EMeetingListView", EMeetingListView, emlv_class_init, emlv_init, GTK_TYPE_TREE_VIEW);
static GList *
get_type_strings ()
{
diff --git a/calendar/gui/e-meeting-time-sel-item.c b/calendar/gui/e-meeting-time-sel-item.c
index c714684569..74d2931b5e 100644
--- a/calendar/gui/e-meeting-time-sel-item.c
+++ b/calendar/gui/e-meeting-time-sel-item.c
@@ -45,8 +45,6 @@
lines across the top of cells. */
#define E_MEETING_TIME_SELECTOR_DRAW_GRID_LINES_AT_BOTTOM 0
-static void e_meeting_time_selector_item_class_init (EMeetingTimeSelectorItemClass *mts_item_class);
-static void e_meeting_time_selector_item_init (EMeetingTimeSelectorItem *mts_item);
static void e_meeting_time_selector_item_destroy (GtkObject *object);
static void e_meeting_time_selector_item_set_arg (GtkObject *o, GtkArg *arg,
@@ -96,17 +94,13 @@ static gboolean e_meeting_time_selector_item_calculate_busy_range (EMeetingTimeS
gint *start_x,
gint *end_x);
-static GnomeCanvasItemClass *parent_class;
-
/* The arguments we take */
enum {
ARG_0,
ARG_MEETING_TIME_SELECTOR
};
-E_MAKE_TYPE (e_meeting_time_selector_item, "EMeetingTimeSelectorItem", EMeetingTimeSelectorItem,
- e_meeting_time_selector_item_class_init, e_meeting_time_selector_item_init,
- GNOME_TYPE_CANVAS_ITEM);
+G_DEFINE_TYPE (EMeetingTimeSelectorItem, e_meeting_time_selector_item, GNOME_TYPE_CANVAS_ITEM);
static void
e_meeting_time_selector_item_class_init (EMeetingTimeSelectorItemClass *mts_item_class)
@@ -114,8 +108,6 @@ e_meeting_time_selector_item_class_init (EMeetingTimeSelectorItemClass *mts_item
GtkObjectClass *object_class;
GnomeCanvasItemClass *item_class;
- parent_class = g_type_class_peek_parent (mts_item_class);
-
object_class = (GtkObjectClass *) mts_item_class;
item_class = (GnomeCanvasItemClass *) mts_item_class;
@@ -174,8 +166,8 @@ e_meeting_time_selector_item_destroy (GtkObject *object)
mts_item->resize_cursor = NULL;
}
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (*GTK_OBJECT_CLASS (parent_class)->destroy)(object);
+ if (GTK_OBJECT_CLASS (e_meeting_time_selector_item_parent_class)->destroy)
+ (*GTK_OBJECT_CLASS (e_meeting_time_selector_item_parent_class)->destroy)(object);
}
@@ -203,8 +195,8 @@ e_meeting_time_selector_item_realize (GnomeCanvasItem *item)
GdkWindow *window;
EMeetingTimeSelectorItem *mts_item;
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->realize)
- (*GNOME_CANVAS_ITEM_CLASS (parent_class)->realize)(item);
+ if (GNOME_CANVAS_ITEM_CLASS (e_meeting_time_selector_item_parent_class)->realize)
+ (*GNOME_CANVAS_ITEM_CLASS (e_meeting_time_selector_item_parent_class)->realize)(item);
mts_item = E_MEETING_TIME_SELECTOR_ITEM (item);
@@ -228,16 +220,16 @@ e_meeting_time_selector_item_unrealize (GnomeCanvasItem *item)
gdk_gc_unref (mts_item->stipple_gc);
mts_item->stipple_gc = NULL;
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize)
- (*GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize)(item);
+ if (GNOME_CANVAS_ITEM_CLASS (e_meeting_time_selector_item_parent_class)->unrealize)
+ (*GNOME_CANVAS_ITEM_CLASS (e_meeting_time_selector_item_parent_class)->unrealize)(item);
}
static void
e_meeting_time_selector_item_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags)
{
- if (GNOME_CANVAS_ITEM_CLASS (parent_class)->update)
- (* GNOME_CANVAS_ITEM_CLASS (parent_class)->update) (item, affine, clip_path, flags);
+ if (GNOME_CANVAS_ITEM_CLASS (e_meeting_time_selector_item_parent_class)->update)
+ (* GNOME_CANVAS_ITEM_CLASS (e_meeting_time_selector_item_parent_class)->update) (item, affine, clip_path, flags);
/* The grid covers the entire canvas area. */
item->x1 = 0;
diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c
index 6acd0cd8e6..0ae13bf07f 100644
--- a/calendar/gui/e-meeting-time-sel.c
+++ b/calendar/gui/e-meeting-time-sel.c
@@ -103,8 +103,6 @@ enum {
static gint mts_signals [LAST_SIGNAL] = { 0 };
-static void e_meeting_time_selector_class_init (EMeetingTimeSelectorClass * klass);
-static void e_meeting_time_selector_init (EMeetingTimeSelector * mts);
static void e_meeting_time_selector_destroy (GtkObject *object);
static void e_meeting_time_selector_alloc_named_color (EMeetingTimeSelector * mts,
const char *name, GdkColor *c);
@@ -209,11 +207,7 @@ static void row_inserted_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter
static void row_changed_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data);
static void row_deleted_cb (GtkTreeModel *model, GtkTreePath *path, gpointer data);
-static GtkTableClass *parent_class;
-
-E_MAKE_TYPE (e_meeting_time_selector, "EMeetingTimeSelector", EMeetingTimeSelector,
- e_meeting_time_selector_class_init, e_meeting_time_selector_init,
- GTK_TYPE_TABLE);
+G_DEFINE_TYPE (EMeetingTimeSelector, e_meeting_time_selector, GTK_TYPE_TABLE);
static void
e_meeting_time_selector_class_init (EMeetingTimeSelectorClass * klass)
@@ -221,7 +215,6 @@ e_meeting_time_selector_class_init (EMeetingTimeSelectorClass * klass)
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
- parent_class = g_type_class_peek_parent (klass);
object_class = (GtkObjectClass *) klass;
widget_class = (GtkWidgetClass *) klass;
@@ -833,8 +826,8 @@ e_meeting_time_selector_destroy (GtkObject *object)
mts->display_top = NULL;
mts->display_main = NULL;
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (*GTK_OBJECT_CLASS (parent_class)->destroy)(object);
+ if (GTK_OBJECT_CLASS (e_meeting_time_selector_parent_class)->destroy)
+ (*GTK_OBJECT_CLASS (e_meeting_time_selector_parent_class)->destroy)(object);
}
@@ -843,8 +836,8 @@ e_meeting_time_selector_realize (GtkWidget *widget)
{
EMeetingTimeSelector *mts;
- if (GTK_WIDGET_CLASS (parent_class)->realize)
- (*GTK_WIDGET_CLASS (parent_class)->realize)(widget);
+ if (GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->realize)
+ (*GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->realize)(widget);
mts = E_MEETING_TIME_SELECTOR (widget);
@@ -862,8 +855,8 @@ e_meeting_time_selector_unrealize (GtkWidget *widget)
gdk_gc_unref (mts->color_key_gc);
mts->color_key_gc = NULL;
- if (GTK_WIDGET_CLASS (parent_class)->unrealize)
- (*GTK_WIDGET_CLASS (parent_class)->unrealize)(widget);
+ if (GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->unrealize)
+ (*GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->unrealize)(widget);
}
static int
@@ -895,8 +888,8 @@ e_meeting_time_selector_style_set (GtkWidget *widget,
GtkTreePath *path;
GdkRectangle cell_area;
- if (GTK_WIDGET_CLASS (parent_class)->style_set)
- (*GTK_WIDGET_CLASS (parent_class)->style_set)(widget, previous_style);
+ if (GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->style_set)
+ (*GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->style_set)(widget, previous_style);
mts = E_MEETING_TIME_SELECTOR (widget);
@@ -960,8 +953,8 @@ e_meeting_time_selector_expose_event (GtkWidget *widget,
e_meeting_time_selector_draw_shadow (mts);
- if (GTK_WIDGET_CLASS (parent_class)->expose_event)
- (*GTK_WIDGET_CLASS (parent_class)->expose_event)(widget, event);
+ if (GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->expose_event)
+ (*GTK_WIDGET_CLASS (e_meeting_time_selector_parent_class)->expose_event)(widget, event);
return FALSE;
}
diff --git a/calendar/gui/e-select-names-renderer.c b/calendar/gui/e-select-names-renderer.c
index 59f8169843..0ee5ea2455 100644
--- a/calendar/gui/e-select-names-renderer.c
+++ b/calendar/gui/e-select-names-renderer.c
@@ -22,7 +22,6 @@
#include <config.h>
#include <gtk/gtkcellrenderertext.h>
-#include <gal/util/e-util.h>
#include "e-calendar-marshal.h"
@@ -46,11 +45,12 @@ enum {
LAST_SIGNAL
};
-static GtkCellRendererTextClass *parent_class;
static gint signals [LAST_SIGNAL];
+G_DEFINE_TYPE (ESelectNamesRenderer, e_select_names_renderer, GTK_TYPE_CELL_RENDERER_TEXT)
+
static void
-esnr_editing_done (GtkCellEditable *editable, ESelectNamesRenderer *cell)
+e_select_names_renderer_editing_done (GtkCellEditable *editable, ESelectNamesRenderer *cell)
{
gchar *new_address, *new_name;
BonoboControlFrame *cf;
@@ -70,14 +70,14 @@ esnr_editing_done (GtkCellEditable *editable, ESelectNamesRenderer *cell)
}
static void
-esnr_activated (BonoboControlFrame *cf, gboolean activated, ESelectNamesRenderer *cell)
+e_select_names_renderer_activated (BonoboControlFrame *cf, gboolean activated, ESelectNamesRenderer *cell)
{
if (!activated)
- esnr_editing_done (GTK_CELL_EDITABLE (cell->priv->editable), cell);
+ e_select_names_renderer_editing_done (GTK_CELL_EDITABLE (cell->priv->editable), cell);
}
static GtkCellEditable *
-esnr_start_editing (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path,
+e_select_names_renderer_start_editing (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path,
GdkRectangle *bg_area, GdkRectangle *cell_area, GtkCellRendererState flags)
{
ESelectNamesRenderer *sn_cell = E_SELECT_NAMES_RENDERER (cell);
@@ -92,13 +92,13 @@ esnr_start_editing (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, c
e_select_names_editable_set_address (editable, sn_cell->priv->address);
gtk_widget_show (GTK_WIDGET (editable));
- g_signal_connect (editable, "editing_done", G_CALLBACK (esnr_editing_done), sn_cell);
+ g_signal_connect (editable, "editing_done", G_CALLBACK (e_select_names_renderer_editing_done), sn_cell);
/* Listen for de-activation/loss of focus */
cf = bonobo_widget_get_control_frame (BONOBO_WIDGET (editable));
bonobo_control_frame_set_autoactivate (cf, TRUE);
- g_signal_connect (cf, "activated", G_CALLBACK (esnr_activated), sn_cell);
+ g_signal_connect (cf, "activated", G_CALLBACK (e_select_names_renderer_activated), sn_cell);
sn_cell->priv->editable = g_object_ref (editable);
sn_cell->priv->path = g_strdup (path);
@@ -107,7 +107,7 @@ esnr_start_editing (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, c
}
static void
-esnr_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+e_select_names_renderer_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
ESelectNamesRenderer *esnr = E_SELECT_NAMES_RENDERER (object);
@@ -121,7 +121,7 @@ esnr_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps
}
static void
-esnr_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+e_select_names_renderer_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
ESelectNamesRenderer *esnr = E_SELECT_NAMES_RENDERER (object);
@@ -136,7 +136,7 @@ esnr_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp
}
static void
-esnr_finalize (GObject *obj)
+e_select_names_renderer_finalize (GObject *obj)
{
ESelectNamesRenderer *cell = (ESelectNamesRenderer *) obj;
@@ -148,29 +148,27 @@ esnr_finalize (GObject *obj)
g_free (cell->priv->address);
g_free (cell->priv);
- if (G_OBJECT_CLASS (parent_class)->finalize)
- G_OBJECT_CLASS (parent_class)->finalize (obj);
+ if (G_OBJECT_CLASS (e_select_names_renderer_parent_class)->finalize)
+ G_OBJECT_CLASS (e_select_names_renderer_parent_class)->finalize (obj);
}
static void
-esnr_init (ESelectNamesRenderer *cell)
+e_select_names_renderer_init (ESelectNamesRenderer *cell)
{
cell->priv = g_new0 (ESelectNamesRendererPriv, 1);
}
static void
-esnr_class_init (ESelectNamesRendererClass *class)
+e_select_names_renderer_class_init (ESelectNamesRendererClass *class)
{
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (class);
GObjectClass *obj_class = G_OBJECT_CLASS (class);
- parent_class = GTK_CELL_RENDERER_TEXT_CLASS (g_type_class_peek_parent (class));
-
- obj_class->finalize = esnr_finalize;
- obj_class->get_property = esnr_get_property;
- obj_class->set_property = esnr_set_property;
+ obj_class->finalize = e_select_names_renderer_finalize;
+ obj_class->get_property = e_select_names_renderer_get_property;
+ obj_class->set_property = e_select_names_renderer_set_property;
- cell_class->start_editing = esnr_start_editing;
+ cell_class->start_editing = e_select_names_renderer_start_editing;
g_object_class_install_property (obj_class, PROP_ADDRESS,
g_param_spec_string ("address", "Address", "Email address.", NULL, G_PARAM_READWRITE));
@@ -185,8 +183,6 @@ esnr_class_init (ESelectNamesRendererClass *class)
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
}
-E_MAKE_TYPE (e_select_names_renderer, "ESelectNamesRenderer", ESelectNamesRenderer, esnr_class_init, esnr_init, GTK_TYPE_CELL_RENDERER_TEXT)
-
GtkCellRenderer *
e_select_names_renderer_new (void)
{
diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c
index 068be379f8..e6c82a4355 100644
--- a/calendar/gui/e-tasks.c
+++ b/calendar/gui/e-tasks.c
@@ -28,7 +28,6 @@
#include <gnome.h>
#include <libgnomevfs/gnome-vfs-ops.h>
-#include <gal/util/e-util.h>
#include <gal/e-table/e-table-scrolled.h>
#include <gal/menus/gal-view-instance.h>
#include <gal/menus/gal-view-factory-etable.h>
@@ -89,8 +88,6 @@ struct _ETasksPrivate {
GList *notifications;
};
-static void e_tasks_class_init (ETasksClass *class);
-static void e_tasks_init (ETasks *tasks);
static void setup_widgets (ETasks *tasks);
static void e_tasks_destroy (GtkObject *object);
static void update_view (ETasks *tasks);
@@ -115,13 +112,9 @@ static GtkTargetEntry list_drag_types[] = {
};
static const int num_list_drag_types = sizeof (list_drag_types) / sizeof (list_drag_types[0]);
-static GtkTableClass *parent_class;
static guint e_tasks_signals[LAST_SIGNAL] = { 0 };
-
-E_MAKE_TYPE (e_tasks, "ETasks", ETasks,
- e_tasks_class_init, e_tasks_init,
- GTK_TYPE_TABLE)
+G_DEFINE_TYPE (ETasks, e_tasks, GTK_TYPE_TABLE)
/* Callback used when the cursor changes in the table */
static void
@@ -373,11 +366,10 @@ table_drag_data_get (ETable *table,
priv = tasks->priv;
if (priv->current_uid) {
- ETableModel *model;
+ ECalModel *model;
model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
-
- comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), row);
+ comp_data = e_cal_model_get_component_at (model, row);
if (info == TARGET_VCALENDAR) {
/* we will pass an icalcalendar component for both types */
@@ -432,13 +424,13 @@ table_drag_data_delete (ETable *table,
{
ETasksPrivate *priv;
ECalModelComponent *comp_data;
- ETableModel *model;
+ ECalModel *model;
gboolean read_only = TRUE;
priv = tasks->priv;
model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
- comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), row);
+ comp_data = e_cal_model_get_component_at (model, row);
e_cal_is_read_only (comp_data->client, &read_only, NULL);
if (read_only)
@@ -551,8 +543,6 @@ e_tasks_class_init (ETasksClass *class)
object_class = (GtkObjectClass *) class;
- parent_class = gtk_type_class (GTK_TYPE_TABLE);
-
e_tasks_signals[SELECTION_CHANGED] =
gtk_signal_new ("selection_changed",
GTK_RUN_LAST,
@@ -705,8 +695,8 @@ e_tasks_destroy (GtkObject *object)
tasks->priv = NULL;
}
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ if (GTK_OBJECT_CLASS (e_tasks_parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (e_tasks_parent_class)->destroy) (object);
}
static void
diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c
index 0c2c795bf3..8e4c65e64d 100644
--- a/calendar/gui/e-timezone-entry.c
+++ b/calendar/gui/e-timezone-entry.c
@@ -34,7 +34,6 @@
#include <gtk/gtkentry.h>
#include <gtk/gtksignal.h>
#include <gnome.h>
-#include <gal/util/e-util.h>
#include <widgets/e-timezone-dialog/e-timezone-dialog.h>
#include <libgnome/gnome-i18n.h>
#include "e-timezone-entry.h"
@@ -62,9 +61,6 @@ enum {
LAST_SIGNAL
};
-
-static void e_timezone_entry_class_init (ETimezoneEntryClass *class);
-static void e_timezone_entry_init (ETimezoneEntry *tentry);
static void e_timezone_entry_destroy (GtkObject *object);
static gboolean e_timezone_entry_mnemonic_activate (GtkWidget *widget,
@@ -79,11 +75,9 @@ static void on_button_clicked (GtkWidget *widget,
static void e_timezone_entry_set_entry (ETimezoneEntry *tentry);
-static GtkHBoxClass *parent_class;
static guint timezone_entry_signals[LAST_SIGNAL] = { 0 };
-E_MAKE_TYPE (e_timezone_entry, "ETimezoneEntry", ETimezoneEntry,
- e_timezone_entry_class_init, e_timezone_entry_init, GTK_TYPE_HBOX);
+G_DEFINE_TYPE (ETimezoneEntry, e_timezone_entry, GTK_TYPE_HBOX);
static void
e_timezone_entry_class_init (ETimezoneEntryClass *class)
@@ -93,8 +87,6 @@ e_timezone_entry_class_init (ETimezoneEntryClass *class)
object_class = (GtkObjectClass*) class;
- parent_class = g_type_class_peek_parent (class);
-
widget_class->mnemonic_activate = e_timezone_entry_mnemonic_activate;
widget_class->focus = e_timezone_entry_focus;
timezone_entry_signals[CHANGED] =
@@ -186,8 +178,8 @@ e_timezone_entry_destroy (GtkObject *object)
g_free (tentry->priv);
tentry->priv = NULL;
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ if (GTK_OBJECT_CLASS (e_timezone_entry_parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (e_timezone_entry_parent_class)->destroy) (object);
}
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index f5ac1895d7..dcabbf9181 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -198,8 +198,6 @@ static guint gnome_calendar_signals[LAST_SIGNAL];
-static void gnome_calendar_class_init (GnomeCalendarClass *class);
-static void gnome_calendar_init (GnomeCalendar *gcal);
static void gnome_calendar_destroy (GtkObject *object);
static void gnome_calendar_goto_date (GnomeCalendar *gcal,
GnomeCalendarGotoDateType goto_date);
@@ -223,14 +221,7 @@ static void update_query (GnomeCalendar *gcal);
static void update_todo_view (GnomeCalendar *gcal);
-
-static GtkVBoxClass *parent_class;
-
-
-
-
-E_MAKE_TYPE (gnome_calendar, "GnomeCalendar", GnomeCalendar, gnome_calendar_class_init,
- gnome_calendar_init, GTK_TYPE_VBOX);
+G_DEFINE_TYPE (GnomeCalendar, gnome_calendar, GTK_TYPE_VBOX);
/* Class initialization function for the gnome calendar */
static void
@@ -241,8 +232,6 @@ gnome_calendar_class_init (GnomeCalendarClass *class)
object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_peek_parent (class);
-
gnome_calendar_signals[DATES_SHOWN_CHANGED] =
gtk_signal_new ("dates_shown_changed",
GTK_RUN_LAST,
@@ -721,7 +710,7 @@ update_query (GnomeCalendar *gcal)
priv = gcal->priv;
- e_calendar_view_set_status_message (priv->week_view, _("Updating query"));
+ e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), _("Updating query"));
e_calendar_item_clear_marks (priv->date_navigator->calitem);
/* free the previous queries */
@@ -742,7 +731,7 @@ update_query (GnomeCalendar *gcal)
real_sexp = adjust_e_cal_view_sexp (gcal, priv->sexp);
if (!real_sexp) {
- e_calendar_view_set_status_message (priv->week_view, NULL);
+ e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL);
return; /* No time range is set, so don't start a query */
}
@@ -774,7 +763,7 @@ update_query (GnomeCalendar *gcal)
}
g_free (real_sexp);
- e_calendar_view_set_status_message (priv->week_view, NULL);
+ e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL);
update_todo_view (gcal);
}
@@ -1501,8 +1490,8 @@ gnome_calendar_destroy (GtkObject *object)
gcal->priv = NULL;
}
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ if (GTK_OBJECT_CLASS (gnome_calendar_parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (gnome_calendar_parent_class)->destroy) (object);
}
static void
@@ -2164,7 +2153,7 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal)
source = e_cal_get_source (ecal);
if (source_type == E_CAL_SOURCE_TYPE_EVENT)
- e_calendar_view_set_status_message (priv->week_view, NULL);
+ e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL);
else
e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL);
@@ -2191,7 +2180,7 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal)
switch (source_type) {
case E_CAL_SOURCE_TYPE_EVENT :
msg = g_strdup_printf (_("Loading appointments at %s"), e_cal_get_uri (ecal));
- e_calendar_view_set_status_message (priv->week_view, msg);
+ e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), msg);
g_free (msg);
/* add client to the views */
@@ -2205,7 +2194,7 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal)
/* update date navigator query */
update_query (gcal);
- e_calendar_view_set_status_message (priv->week_view, NULL);
+ e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL);
break;
case E_CAL_SOURCE_TYPE_TODO :
@@ -2239,7 +2228,7 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar
switch (source_type) {
case E_CAL_SOURCE_TYPE_EVENT:
- e_calendar_view_set_status_message (priv->week_view, NULL);
+ e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL);
break;
case E_CAL_SOURCE_TYPE_TODO:
e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL);
@@ -2305,7 +2294,7 @@ open_ecal (GnomeCalendar *gcal, ECal *cal, gboolean only_if_exists, open_func of
msg = g_strdup_printf (_("Opening %s"), e_cal_get_uri (cal));
switch (e_cal_get_source_type (cal)) {
case E_CAL_SOURCE_TYPE_EVENT :
- e_calendar_view_set_status_message (priv->week_view, msg);
+ e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), msg);
break;
case E_CAL_SOURCE_TYPE_TODO :
e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), msg);
@@ -2428,7 +2417,6 @@ backend_died_cb (ECal *ecal, gpointer data)
ECalSourceType source_type;
ESource *source;
const char *id;
- int i;
gcal = GNOME_CALENDAR (data);
priv = gcal->priv;
@@ -2446,7 +2434,7 @@ backend_died_cb (ECal *ecal, gpointer data)
case E_CAL_SOURCE_TYPE_EVENT:
id = "calendar:calendar-crashed";
- e_calendar_view_set_status_message (priv->week_view, NULL);
+ e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL);
gtk_signal_emit (GTK_OBJECT (gcal), gnome_calendar_signals[SOURCE_REMOVED], source_type, source);
break;
diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c
index 3e49119528..dc795c545d 100644
--- a/calendar/gui/weekday-picker.c
+++ b/calendar/gui/weekday-picker.c
@@ -28,7 +28,6 @@
#include <libgnome/gnome-i18n.h>
#include <libgnomecanvas/gnome-canvas-rect-ellipse.h>
#include <libgnomecanvas/gnome-canvas-text.h>
-#include <gal/util/e-util.h>
#include "weekday-picker.h"
@@ -77,14 +76,9 @@ static void weekday_picker_style_set (GtkWidget *widget, GtkStyle *previous_styl
static gboolean weekday_picker_focus (GtkWidget *widget, GtkDirectionType direction);
static void colorize_items (WeekdayPicker *wp);
-static GnomeCanvasClass *parent_class;
-
static guint wp_signals[LAST_SIGNAL];
-
-
-E_MAKE_TYPE (weekday_picker, "WeekdayPicker", WeekdayPicker,
- weekday_picker_class_init, weekday_picker_init, GNOME_TYPE_CANVAS);
+G_DEFINE_TYPE (WeekdayPicker, weekday_picker, GNOME_TYPE_CANVAS);
/* Class initialization function for the weekday picker */
static void
@@ -96,8 +90,6 @@ weekday_picker_class_init (WeekdayPickerClass *class)
object_class = (GtkObjectClass *) class;
widget_class = (GtkWidgetClass *) class;
- parent_class = g_type_class_peek_parent (class);
-
wp_signals[CHANGED] =
gtk_signal_new ("changed",
GTK_RUN_FIRST,
@@ -263,8 +255,8 @@ weekday_picker_destroy (GtkObject *object)
g_free (priv);
wp->priv = NULL;
- if (GTK_OBJECT_CLASS (parent_class)->destroy)
- (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+ if (GTK_OBJECT_CLASS (weekday_picker_parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (weekday_picker_parent_class)->destroy) (object);
}
static void
@@ -393,8 +385,8 @@ weekday_picker_realize (GtkWidget *widget)
wp = WEEKDAY_PICKER (widget);
- if (GTK_WIDGET_CLASS (parent_class)->realize)
- (* GTK_WIDGET_CLASS (parent_class)->realize) (widget);
+ if (GTK_WIDGET_CLASS (weekday_picker_parent_class)->realize)
+ (* GTK_WIDGET_CLASS (weekday_picker_parent_class)->realize) (widget);
configure_items (wp);
}
@@ -421,8 +413,8 @@ weekday_picker_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
wp = WEEKDAY_PICKER (widget);
- if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
- (* GTK_WIDGET_CLASS (parent_class)->size_allocate) (widget, allocation);
+ if (GTK_WIDGET_CLASS (weekday_picker_parent_class)->size_allocate)
+ (* GTK_WIDGET_CLASS (weekday_picker_parent_class)->size_allocate) (widget, allocation);
gnome_canvas_set_scroll_region (GNOME_CANVAS (wp),
0, 0, allocation->width, allocation->height);
@@ -477,8 +469,8 @@ weekday_picker_style_set (GtkWidget *widget, GtkStyle *previous_style)
g_object_unref (layout);
pango_font_metrics_unref (font_metrics);
- if (GTK_WIDGET_CLASS (parent_class)->style_set)
- (* GTK_WIDGET_CLASS (parent_class)->style_set) (widget, previous_style);
+ if (GTK_WIDGET_CLASS (weekday_picker_parent_class)->style_set)
+ (* GTK_WIDGET_CLASS (weekday_picker_parent_class)->style_set) (widget, previous_style);
}