diff options
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 66 | ||||
-rw-r--r-- | calendar/gui/calendar-commands.c | 2 | ||||
-rw-r--r-- | calendar/gui/calendar-model.c | 10 | ||||
-rw-r--r-- | calendar/gui/dialogs/alarm-page.c | 44 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 45 | ||||
-rw-r--r-- | calendar/gui/dialogs/e-delegate-dialog.c | 45 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-editor.c | 40 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 58 | ||||
-rw-r--r-- | calendar/gui/dialogs/meeting-page.c | 43 | ||||
-rw-r--r-- | calendar/gui/dialogs/recurrence-page.c | 116 | ||||
-rw-r--r-- | calendar/gui/dialogs/schedule-page.c | 43 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-details-page.c | 43 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-editor.c | 40 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 38 | ||||
-rw-r--r-- | calendar/gui/e-comp-editor-registry.c | 4 | ||||
-rw-r--r-- | calendar/gui/e-day-view.c | 10 | ||||
-rw-r--r-- | calendar/gui/e-tasks.c | 6 | ||||
-rw-r--r-- | calendar/gui/e-week-view.c | 10 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 12 | ||||
-rw-r--r-- | calendar/gui/tasks-control.c | 2 |
20 files changed, 265 insertions, 412 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index b414696472..eaadd1b2f9 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,69 @@ +2002-12-19 Hans Petter Jansson <hpj@ximian.com> + + * gui/calendar-commands.c (calendar_control_deactivate): + Replace gtk_signal_disconnect_by_data() with + g_signal_handlers_disconnect_matched(). Former takes GtkObject, + latter takes GObject. + + * gui/calendar-model.c (calendar_model_destroy): Ditto. + (update_query): Ditto. + (calendar_model_set_cal_client): Ditto. + + * gui/e-day-view.c (e_day_view_destroy): Ditto. + (update_query): Ditto. + (e_day_view_set_cal_client): Ditto. + + * gui/e-tasks.c (query_eval_error_cb): Ditto. + (query_query_done_cb): Ditto. + + * gui/e-week-view.c (e_week_view_destroy): Ditto. + (update_query): Ditto. + (e_week_view_set_cal_client): Ditto. + + * gui/gnome-cal.c (update_query): Ditto. + (gnome_calendar_destroy): Ditto. + + * gui/tasks-control.c (tasks_control_deactivate): Ditto. + + * gui/e-comp-editor-registry.c (foreach_close_cb): Replace + gtk_signal_handler_(un)block_by_data() with + g_signal_handlers_(un)block_matched(). Former takes GtkObject, latter + takes GObject. + + * gui/dialogs/alarm-page.c (alarm_page_get_type): Replace with + E_MAKE_TYPE(). + (alarm_page_class_init): Use GObject as base class instead of + GtkObject, and set up finalization instead of destroy handler. + (alarm_page_destroy): Change to alarm_page_finalize() and assume + parent is GObject, not GtkObject. + (alarm_page_new): Use g_object_new(), not gtk_type_new(). + + * gui/dialogs/event-page.c: Same general changes as above file. + (update_time): Replace gtk_signal_handler_(un)block_by_data() + with g_signal_handlers_(un)block_matched(). + (clear_widgets): Ditto. + (times_updated): Ditto. + + * gui/dialogs/recurrence-page.c: Same general changes as above file. + (clear_widgets): Replace gtk_signal_handler_(un)block_by_data() + with g_signal_handlers_(un)block_matched(). + (append_exception): Ditto. + (fill_ending_date): Ditto. + (recurrence_page_fill_widgets): Ditto. + + * gui/dialogs/comp-editor.c: Same general changes as above file. + (comp_editor_finalize): Replace gtk_signal_disconnect_by_data() + with g_signal_handlers_disconnect_matched(). + (comp_editor_remove_page): Ditto. + + * gui/dialogs/event-editor.c: Same general changes as above file. + * gui/dialogs/meeting-page.c: Same general changes as above file. + * gui/dialogs/schedule-page.c: Same general changes as above file. + * gui/dialogs/task-details-page.c: Same general changes. + * gui/dialogs/task-editor.c: Same general changes as above file. + * gui/dialogs/task-page.c: Same general changes as above file. + * gui/dialogs/e-delegate-dialog.c: Same general changes. + 2002-12-16 Jeffrey Stedfast <fejj@ximian.com> * gui/e-itip-control.c (write_html): Use camel_text_to_html() diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c index edce58a44a..3140b1fc90 100644 --- a/calendar/gui/calendar-commands.c +++ b/calendar/gui/calendar-commands.c @@ -776,7 +776,7 @@ calendar_control_deactivate (BonoboControl *control, GnomeCalendar *gcal) gnome_calendar_discard_view_menus (gcal); - gtk_signal_disconnect_by_data (GTK_OBJECT (gcal), control); + g_signal_handlers_disconnect_matched (gcal, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, control); bonobo_ui_component_rm (uic, "/", NULL); bonobo_ui_component_unset_container (uic, NULL); diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c index a9cc62577b..1cd62dd371 100644 --- a/calendar/gui/calendar-model.c +++ b/calendar/gui/calendar-model.c @@ -308,7 +308,7 @@ calendar_model_destroy (GtkObject *object) /* Free the calendar client interface object */ if (priv->client) { - gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), model); + g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, model); g_object_unref (priv->client); priv->client = NULL; } @@ -319,7 +319,8 @@ calendar_model_destroy (GtkObject *object) } if (priv->query) { - gtk_signal_disconnect_by_data (GTK_OBJECT (priv->query), model); + g_signal_handlers_disconnect_matched (priv->query, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, model); g_object_unref (priv->query); priv->query = NULL; } @@ -1965,7 +1966,8 @@ update_query (CalendarModel *model) priv->query = NULL; if (old_query) { - gtk_signal_disconnect_by_data (GTK_OBJECT (old_query), model); + g_signal_handlers_disconnect_matched (old_query, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, model); g_object_unref (old_query); } @@ -2156,7 +2158,7 @@ calendar_model_set_cal_client (CalendarModel *model, CalClient *client, CalObjTy g_object_ref (client); if (priv->client) { - gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), model); + g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, model); g_object_unref (priv->client); } diff --git a/calendar/gui/dialogs/alarm-page.c b/calendar/gui/dialogs/alarm-page.c index 64e79d8f9d..1af357e7c3 100644 --- a/calendar/gui/dialogs/alarm-page.c +++ b/calendar/gui/dialogs/alarm-page.c @@ -115,7 +115,7 @@ static const int time_map[] = { static void alarm_page_class_init (AlarmPageClass *class); static void alarm_page_init (AlarmPage *apage); -static void alarm_page_destroy (GtkObject *object); +static void alarm_page_finalize (GObject *object); static GtkWidget *alarm_page_get_widget (CompEditorPage *page); static void alarm_page_focus_main_widget (CompEditorPage *page); @@ -136,41 +136,21 @@ static CompEditorPageClass *parent_class = NULL; * * Return value: The type ID of the #AlarmPage class. **/ -GtkType -alarm_page_get_type (void) -{ - static GtkType alarm_page_type; - - if (!alarm_page_type) { - static const GtkTypeInfo alarm_page_info = { - "AlarmPage", - sizeof (AlarmPage), - sizeof (AlarmPageClass), - (GtkClassInitFunc) alarm_page_class_init, - (GtkObjectInitFunc) alarm_page_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL - }; - - alarm_page_type = gtk_type_unique (TYPE_COMP_EDITOR_PAGE, - &alarm_page_info); - } - return alarm_page_type; -} +E_MAKE_TYPE (alarm_page, "AlarmPage", AlarmPage, alarm_page_class_init, + alarm_page_init, TYPE_COMP_EDITOR_PAGE); /* Class initialization function for the alarm page */ static void alarm_page_class_init (AlarmPageClass *class) { CompEditorPageClass *editor_page_class; - GtkObjectClass *object_class; + GObjectClass *gobject_class; editor_page_class = (CompEditorPageClass *) class; - object_class = (GtkObjectClass *) class; + gobject_class = (GObjectClass *) class; - parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE); + parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE); editor_page_class->get_widget = alarm_page_get_widget; editor_page_class->focus_main_widget = alarm_page_focus_main_widget; @@ -179,7 +159,7 @@ alarm_page_class_init (AlarmPageClass *class) editor_page_class->set_summary = alarm_page_set_summary; editor_page_class->set_dates = alarm_page_set_dates; - object_class->destroy = alarm_page_destroy; + gobject_class->finalize = alarm_page_finalize; } /* Object initialization function for the alarm page */ @@ -223,7 +203,7 @@ alarm_page_init (AlarmPage *apage) /* Destroy handler for the alarm page */ static void -alarm_page_destroy (GtkObject *object) +alarm_page_finalize (GObject *object) { AlarmPage *apage; AlarmPagePrivate *priv; @@ -247,8 +227,8 @@ alarm_page_destroy (GtkObject *object) g_free (priv); apage->priv = NULL; - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->finalize) + (* G_OBJECT_CLASS (parent_class)->finalize) (object); } @@ -891,9 +871,9 @@ alarm_page_new (void) { AlarmPage *apage; - apage = gtk_type_new (TYPE_ALARM_PAGE); + apage = g_object_new (TYPE_ALARM_PAGE, NULL); if (!alarm_page_construct (apage)) { - g_object_unref((apage)); + g_object_unref ((apage)); return NULL; } diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index b2197dc5bc..46a08da33d 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -86,7 +86,7 @@ struct _CompEditorPrivate { static void comp_editor_class_init (CompEditorClass *class); static void comp_editor_init (CompEditor *editor); static gint comp_editor_key_press_event (GtkWidget *d, GdkEventKey *e); -static void comp_editor_destroy (GtkObject *object); +static void comp_editor_finalize (GObject *object); static void real_set_cal_client (CompEditor *editor, CalClient *client); static void real_edit_comp (CompEditor *editor, CalComponent *comp); @@ -148,38 +148,17 @@ static GtkObjectClass *parent_class; -GtkType -comp_editor_get_type (void) -{ - static GtkType comp_editor_type = 0; - - if (!comp_editor_type) { - static const GtkTypeInfo comp_editor_info = { - "CompEditor", - sizeof (CompEditor), - sizeof (CompEditorClass), - (GtkClassInitFunc) comp_editor_class_init, - (GtkObjectInitFunc) comp_editor_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL - }; - - comp_editor_type = gtk_type_unique (BONOBO_TYPE_WINDOW, - &comp_editor_info); - } - - return comp_editor_type; -} +E_MAKE_TYPE (comp_editor, "CompEditor", CompEditor, comp_editor_class_init, comp_editor_init, + BONOBO_TYPE_WINDOW); /* Class initialization function for the calendar component editor */ static void comp_editor_class_init (CompEditorClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; GtkWidgetClass *widget_class; - object_class = GTK_OBJECT_CLASS (klass); + object_class = G_OBJECT_CLASS (klass); widget_class = GTK_WIDGET_CLASS (klass); parent_class = g_type_class_ref(BONOBO_TYPE_WINDOW); @@ -189,7 +168,7 @@ comp_editor_class_init (CompEditorClass *klass) klass->send_comp = real_send_comp; widget_class->key_press_event = comp_editor_key_press_event; - object_class->destroy = comp_editor_destroy; + object_class->finalize = comp_editor_finalize; } /* Creates the basic in the editor */ @@ -271,7 +250,7 @@ comp_editor_key_press_event (GtkWidget *d, GdkEventKey *e) /* Destroy handler for the calendar component editor */ static void -comp_editor_destroy (GtkObject *object) +comp_editor_finalize (GObject *object) { CompEditor *editor; CompEditorPrivate *priv; @@ -280,7 +259,7 @@ comp_editor_destroy (GtkObject *object) editor = COMP_EDITOR (object); priv = editor->priv; - gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), editor); + g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor); /* We want to destroy the pages after the widgets get destroyed, since they have lots of signal handlers connected to the widgets @@ -296,8 +275,8 @@ comp_editor_destroy (GtkObject *object) g_free (priv); editor->priv = NULL; - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->finalize) + (* G_OBJECT_CLASS (parent_class)->finalize) (object); } static gboolean @@ -708,8 +687,8 @@ comp_editor_remove_page (CompEditor *editor, CompEditorPage *page) return; /* Disconnect all the signals added in append_page(). */ - gtk_signal_disconnect_by_data (GTK_OBJECT (page), editor); - gtk_signal_disconnect_by_data (GTK_OBJECT (page_widget), page); + g_signal_handlers_disconnect_matched (page, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor); + g_signal_handlers_disconnect_matched (page_widget, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page); gtk_notebook_remove_page (priv->notebook, page_num); diff --git a/calendar/gui/dialogs/e-delegate-dialog.c b/calendar/gui/dialogs/e-delegate-dialog.c index 43aea1c0ba..da49772f00 100644 --- a/calendar/gui/dialogs/e-delegate-dialog.c +++ b/calendar/gui/dialogs/e-delegate-dialog.c @@ -31,6 +31,7 @@ #include <gnome.h> #include <ical.h> #include <glade/glade.h> +#include <gal/util/e-util.h> #include <widgets/misc/e-map.h> #include <ebook/e-destination.h> #include "Evolution-Addressbook-SelectNames.h" @@ -57,49 +58,27 @@ static const char *section_name = "Delegate To"; static void e_delegate_dialog_class_init (EDelegateDialogClass *class); static void e_delegate_dialog_init (EDelegateDialog *edd); -static void e_delegate_dialog_destroy (GtkObject *object); +static void e_delegate_dialog_finalize (GObject *object); static gboolean get_widgets (EDelegateDialog *edd); static void addressbook_clicked_cb (GtkWidget *widget, gpointer data); static GtkObjectClass *parent_class; - -GtkType -e_delegate_dialog_get_type (void) -{ - static GtkType e_delegate_dialog_type = 0; - - if (!e_delegate_dialog_type) { - static const GtkTypeInfo e_delegate_dialog_info = { - "EDelegateDialog", - sizeof (EDelegateDialog), - sizeof (EDelegateDialogClass), - (GtkClassInitFunc) e_delegate_dialog_class_init, - (GtkObjectInitFunc) e_delegate_dialog_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL - }; - - e_delegate_dialog_type = gtk_type_unique (GTK_TYPE_OBJECT, - &e_delegate_dialog_info); - } - - return e_delegate_dialog_type; -} +E_MAKE_TYPE (e_delegate_dialog, "EDelegateDialog", EDelegateDialog, e_delegate_dialog_class_init, + e_delegate_dialog_init, G_TYPE_OBJECT); /* Class initialization function for the event editor */ static void e_delegate_dialog_class_init (EDelegateDialogClass *class) { - GtkObjectClass *object_class; + GObjectClass *gobject_class; - object_class = (GtkObjectClass *) class; + gobject_class = (GObjectClass *) class; - parent_class = g_type_class_ref(GTK_TYPE_OBJECT); + parent_class = g_type_class_ref (G_TYPE_OBJECT); - object_class->destroy = e_delegate_dialog_destroy; + gobject_class->finalize = e_delegate_dialog_finalize; } /* Object initialization function for the event editor */ @@ -116,7 +95,7 @@ e_delegate_dialog_init (EDelegateDialog *edd) /* Destroy handler for the event editor */ static void -e_delegate_dialog_destroy (GtkObject *object) +e_delegate_dialog_finalize (GObject *object) { EDelegateDialog *edd; EDelegateDialogPrivate *priv; @@ -138,8 +117,8 @@ e_delegate_dialog_destroy (GtkObject *object) g_free (priv); edd->priv = NULL; - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->finalize) + (* G_OBJECT_CLASS (parent_class)->finalize) (object); } @@ -269,7 +248,7 @@ e_delegate_dialog_new (const char *name, const char *address) { EDelegateDialog *edd; - edd = E_DELEGATE_DIALOG (gtk_type_new (E_TYPE_DELEGATE_DIALOG)); + edd = E_DELEGATE_DIALOG (g_object_new (E_TYPE_DELEGATE_DIALOG, NULL)); return e_delegate_dialog_construct (E_DELEGATE_DIALOG (edd), name, address); } diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 59d639f9b9..758d3c03b4 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -58,7 +58,7 @@ static void event_editor_init (EventEditor *ee); static void event_editor_set_cal_client (CompEditor *editor, CalClient *client); static void event_editor_edit_comp (CompEditor *editor, CalComponent *comp); static gboolean event_editor_send_comp (CompEditor *editor, CalComponentItipMethod method); -static void event_editor_destroy (GtkObject *object); +static void event_editor_finalize (GObject *object); static void schedule_meeting_cmd (GtkWidget *widget, gpointer data); static void refresh_meeting_cmd (GtkWidget *widget, gpointer data); @@ -94,38 +94,18 @@ static CompEditorClass *parent_class; * * Return value: The type ID of the #EventEditor class. **/ -GtkType -event_editor_get_type (void) -{ - static GtkType event_editor_type = 0; - - if (!event_editor_type) { - static const GtkTypeInfo event_editor_info = { - "EventEditor", - sizeof (EventEditor), - sizeof (EventEditorClass), - (GtkClassInitFunc) event_editor_class_init, - (GtkObjectInitFunc) event_editor_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL - }; - - event_editor_type = gtk_type_unique (TYPE_COMP_EDITOR, - &event_editor_info); - } - return event_editor_type; -} +E_MAKE_TYPE (event_editor, "EventEditor", EventEditor, event_editor_class_init, + event_editor_init, TYPE_COMP_EDITOR); /* Class initialization function for the event editor */ static void event_editor_class_init (EventEditorClass *klass) { - GtkObjectClass *object_class; + GObjectClass *gobject_class; CompEditorClass *editor_class; - object_class = (GtkObjectClass *) klass; + gobject_class = (GObjectClass *) klass; editor_class = (CompEditorClass *) klass; parent_class = g_type_class_ref(TYPE_COMP_EDITOR); @@ -134,7 +114,7 @@ event_editor_class_init (EventEditorClass *klass) editor_class->edit_comp = event_editor_edit_comp; editor_class->send_comp = event_editor_send_comp; - object_class->destroy = event_editor_destroy; + gobject_class->finalize = event_editor_finalize; } static void @@ -378,7 +358,7 @@ event_editor_send_comp (CompEditor *editor, CalComponentItipMethod method) /* Destroy handler for the event editor */ static void -event_editor_destroy (GtkObject *object) +event_editor_finalize (GObject *object) { EventEditor *ee; EventEditorPrivate *priv; @@ -398,8 +378,8 @@ event_editor_destroy (GtkObject *object) gtk_object_destroy (GTK_OBJECT (priv->model)); g_object_unref((priv->model)); - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->finalize) + (* G_OBJECT_CLASS (parent_class)->finalize) (object); } /** @@ -416,7 +396,7 @@ event_editor_new (CalClient *client) { EventEditor *ee; - ee = EVENT_EDITOR (gtk_type_new (TYPE_EVENT_EDITOR)); + ee = EVENT_EDITOR (g_object_new (TYPE_EVENT_EDITOR, NULL)); return event_editor_construct (ee, client); } diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 060912c235..4556e9c46b 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -93,7 +93,7 @@ struct _EventPagePrivate { static void event_page_class_init (EventPageClass *class); static void event_page_init (EventPage *epage); -static void event_page_destroy (GtkObject *object); +static void event_page_finalize (GObject *object); static GtkWidget *event_page_get_widget (CompEditorPage *page); static void event_page_focus_main_widget (CompEditorPage *page); @@ -114,41 +114,21 @@ static CompEditorPageClass *parent_class = NULL; * * Return value: The type ID of the #EventPage class. **/ -GtkType -event_page_get_type (void) -{ - static GtkType event_page_type; - - if (!event_page_type) { - static const GtkTypeInfo event_page_info = { - "EventPage", - sizeof (EventPage), - sizeof (EventPageClass), - (GtkClassInitFunc) event_page_class_init, - (GtkObjectInitFunc) event_page_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL - }; - - event_page_type = gtk_type_unique (TYPE_COMP_EDITOR_PAGE, - &event_page_info); - } - return event_page_type; -} +E_MAKE_TYPE (event_page, "EventPage", EventPage, event_page_class_init, event_page_init, + TYPE_COMP_EDITOR_PAGE); /* Class initialization function for the event page */ static void event_page_class_init (EventPageClass *class) { CompEditorPageClass *editor_page_class; - GtkObjectClass *object_class; + GObjectClass *object_class; editor_page_class = (CompEditorPageClass *) class; - object_class = (GtkObjectClass *) class; + object_class = (GObjectClass *) class; - parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE); + parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE); editor_page_class->get_widget = event_page_get_widget; editor_page_class->focus_main_widget = event_page_focus_main_widget; @@ -157,7 +137,7 @@ event_page_class_init (EventPageClass *class) editor_page_class->set_summary = event_page_set_summary; editor_page_class->set_dates = event_page_set_dates; - object_class->destroy = event_page_destroy; + object_class->finalize = event_page_finalize; } /* Object initialization function for the event page */ @@ -199,7 +179,7 @@ event_page_init (EventPage *epage) /* Destroy handler for the event page */ static void -event_page_destroy (GtkObject *object) +event_page_finalize (GObject *object) { EventPage *epage; EventPagePrivate *priv; @@ -226,8 +206,8 @@ event_page_destroy (GtkObject *object) g_free (priv); epage->priv = NULL; - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->finalize) + (* G_OBJECT_CLASS (parent_class)->finalize) (object); } @@ -360,7 +340,7 @@ update_time (EventPage *epage, CalComponentDateTime *start_date, CalComponentDat gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time), epage); - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_time), epage); + g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); e_date_edit_set_date (E_DATE_EDIT (priv->start_time), start_tt->year, start_tt->month, start_tt->day); @@ -381,7 +361,7 @@ update_time (EventPage *epage, CalComponentDateTime *start_date, CalComponentDat are the same. */ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_timezone), epage); - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_timezone), epage); + g_signal_handlers_block_matched (priv->end_timezone, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->start_timezone), start_zone); @@ -413,7 +393,7 @@ clear_widgets (EventPage *epage) /* Start and end times */ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time), epage); - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_time), epage); + g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); e_date_edit_set_time (E_DATE_EDIT (priv->start_time), 0); e_date_edit_set_time (E_DATE_EDIT (priv->end_time), 0); @@ -1011,22 +991,22 @@ times_updated (EventPage *epage, gboolean adjust_end_time) if (set_start_date) { - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time), epage); + g_signal_handlers_block_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); e_date_edit_set_date (E_DATE_EDIT (priv->start_time), start_tt.year, start_tt.month, start_tt.day); e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_time), start_tt.hour, start_tt.minute); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->start_time), epage); + g_signal_handlers_unblock_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); } if (set_end_date) { - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_time), epage); + g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); e_date_edit_set_date (E_DATE_EDIT (priv->end_time), end_tt.year, end_tt.month, end_tt.day); e_date_edit_set_time_of_day (E_DATE_EDIT (priv->end_time), end_tt.hour, end_tt.minute); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->end_time), epage); + g_signal_handlers_unblock_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); } /* Notify upstream */ @@ -1433,9 +1413,9 @@ event_page_new (void) { EventPage *epage; - epage = gtk_type_new (TYPE_EVENT_PAGE); + epage = g_object_new (TYPE_EVENT_PAGE, NULL); if (!event_page_construct (epage)) { - g_object_unref((epage)); + g_object_unref ((epage)); return NULL; } diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c index e97386ae62..323ba6fb2c 100644 --- a/calendar/gui/dialogs/meeting-page.c +++ b/calendar/gui/dialogs/meeting-page.c @@ -107,7 +107,7 @@ struct _MeetingPagePrivate { static void meeting_page_class_init (MeetingPageClass *class); static void meeting_page_init (MeetingPage *mpage); -static void meeting_page_destroy (GtkObject *object); +static void meeting_page_finalize (GObject *object); static GtkWidget *meeting_page_get_widget (CompEditorPage *page); static void meeting_page_focus_main_widget (CompEditorPage *page); @@ -128,42 +128,21 @@ static CompEditorPageClass *parent_class = NULL; * * Return value: The type ID of the #MeetingPage class. **/ -GtkType -meeting_page_get_type (void) -{ - static GtkType meeting_page_type; - - if (!meeting_page_type) { - static const GtkTypeInfo meeting_page_info = { - "MeetingPage", - sizeof (MeetingPage), - sizeof (MeetingPageClass), - (GtkClassInitFunc) meeting_page_class_init, - (GtkObjectInitFunc) meeting_page_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL - }; - - meeting_page_type = - gtk_type_unique (TYPE_COMP_EDITOR_PAGE, - &meeting_page_info); - } - return meeting_page_type; -} +E_MAKE_TYPE (meeting_page, "MeetingPage", MeetingPage, meeting_page_class_init, meeting_page_init, + TYPE_COMP_EDITOR_PAGE); /* Class initialization function for the task page */ static void meeting_page_class_init (MeetingPageClass *class) { CompEditorPageClass *editor_page_class; - GtkObjectClass *object_class; + GObjectClass *object_class; editor_page_class = (CompEditorPageClass *) class; - object_class = (GtkObjectClass *) class; + object_class = (GObjectClass *) class; - parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE); + parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE); editor_page_class->get_widget = meeting_page_get_widget; editor_page_class->focus_main_widget = meeting_page_focus_main_widget; @@ -172,7 +151,7 @@ meeting_page_class_init (MeetingPageClass *class) editor_page_class->set_summary = NULL; editor_page_class->set_dates = NULL; - object_class->destroy = meeting_page_destroy; + object_class->finalize = meeting_page_finalize; } /* Object initialization function for the task page */ @@ -235,7 +214,7 @@ cleanup_attendees (GPtrArray *attendees) /* Destroy handler for the task page */ static void -meeting_page_destroy (GtkObject *object) +meeting_page_finalize (GObject *object) { MeetingPage *mpage; MeetingPagePrivate *priv; @@ -264,8 +243,8 @@ meeting_page_destroy (GtkObject *object) g_free (priv); mpage->priv = NULL; - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->finalize) + (* G_OBJECT_CLASS (parent_class)->finalize) (object); } @@ -818,7 +797,7 @@ meeting_page_new (EMeetingModel *emm, CalClient *client) { MeetingPage *mpage; - mpage = gtk_type_new (TYPE_MEETING_PAGE); + mpage = g_object_new (TYPE_MEETING_PAGE, NULL); if (!meeting_page_construct (mpage, emm, client)) { g_object_unref((mpage)); return NULL; diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index ecf5c26cec..f88b79ad9b 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -226,7 +226,7 @@ struct _RecurrencePagePrivate { static void recurrence_page_class_init (RecurrencePageClass *class); static void recurrence_page_init (RecurrencePage *rpage); -static void recurrence_page_destroy (GtkObject *object); +static void recurrence_page_finalize (GObject *object); static GtkWidget *recurrence_page_get_widget (CompEditorPage *page); static void recurrence_page_focus_main_widget (CompEditorPage *page); @@ -249,39 +249,19 @@ static CompEditorPageClass *parent_class = NULL; * * Return value: The type ID of the #RecurrencePage class. **/ -GtkType -recurrence_page_get_type (void) -{ - static GtkType recurrence_page_type; - - if (!recurrence_page_type) { - static const GtkTypeInfo recurrence_page_info = { - "RecurrencePage", - sizeof (RecurrencePage), - sizeof (RecurrencePageClass), - (GtkClassInitFunc) recurrence_page_class_init, - (GtkObjectInitFunc) recurrence_page_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL - }; - - recurrence_page_type = gtk_type_unique (TYPE_COMP_EDITOR_PAGE, - &recurrence_page_info); - } - return recurrence_page_type; -} +E_MAKE_TYPE (recurrence_page, "RecurrencePage", RecurrencePage, recurrence_page_class_init, + recurrence_page_init, TYPE_COMP_EDITOR_PAGE); /* Class initialization function for the recurrence page */ static void recurrence_page_class_init (RecurrencePageClass *class) { CompEditorPageClass *editor_page_class; - GtkObjectClass *object_class; + GObjectClass *object_class; editor_page_class = (CompEditorPageClass *) class; - object_class = (GtkObjectClass *) class; + object_class = (GObjectClass *) class; parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE); @@ -292,7 +272,7 @@ recurrence_page_class_init (RecurrencePageClass *class) editor_page_class->set_summary = recurrence_page_set_summary; editor_page_class->set_dates = recurrence_page_set_dates; - object_class->destroy = recurrence_page_destroy; + object_class->finalize = recurrence_page_finalize; } /* Object initialization function for the recurrence page */ @@ -346,7 +326,7 @@ free_exception_date_time (CalComponentDateTime *dt) /* Destroy handler for the recurrence page */ static void -recurrence_page_destroy (GtkObject *object) +recurrence_page_finalize (GObject *object) { RecurrencePage *rpage; RecurrencePagePrivate *priv; @@ -370,8 +350,8 @@ recurrence_page_destroy (GtkObject *object) g_free (priv); rpage->priv = NULL; - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->finalize) + (* G_OBJECT_CLASS (parent_class)->finalize) (object); } @@ -425,35 +405,35 @@ clear_widgets (RecurrencePage *rpage) priv->month_num = MONTH_NUM_DAY; priv->month_day = MONTH_DAY_NTH; - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->none), rpage); - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->simple), rpage); - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->custom), rpage); + g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); e_dialog_radio_set (priv->none, RECUR_NONE, type_map); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->none), rpage); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->simple), rpage); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->custom), rpage); + g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value)); - gtk_signal_handler_block_by_data (GTK_OBJECT (adj), rpage); + g_signal_handlers_block_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); e_dialog_spin_set (priv->interval_value, 1); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (adj), rpage); + g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit)); - gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage); + g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); e_dialog_option_menu_set (priv->interval_unit, ICAL_DAILY_RECURRENCE, freq_map); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage); + g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); priv->ending_date_tt = icaltime_today (); priv->ending_count = 1; menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu)); - gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage); + g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); e_dialog_option_menu_set (priv->ending_menu, ENDING_FOREVER, ending_types_map); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage); + g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); /* Exceptions list */ gtk_clist_clear (GTK_CLIST (priv->exception_list)); @@ -503,7 +483,7 @@ append_exception (RecurrencePage *rpage, CalComponentDateTime *datetime) clist = GTK_CLIST (priv->exception_list); - gtk_signal_handler_block_by_data (GTK_OBJECT (clist), rpage); + g_signal_handlers_block_matched (clist, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); c[0] = get_exception_string (dt); i = gtk_clist_append (clist, c); @@ -511,7 +491,7 @@ append_exception (RecurrencePage *rpage, CalComponentDateTime *datetime) gtk_clist_set_row_data_full (clist, i, dt, (GtkDestroyNotify) free_exception_date_time); gtk_clist_select_row (clist, i, 0); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (clist), rpage); + g_signal_handlers_unblock_matched (clist, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); tt = dt->value; e_date_edit_set_date (E_DATE_EDIT (priv->exception_date), @@ -1523,7 +1503,7 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r) priv = rpage->priv; menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu)); - gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage); + g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); if (r->count == 0) { if (r->until.year == 0) { @@ -1573,7 +1553,7 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r) ending_types_map); } - gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage); + g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); make_ending_special (rpage); } @@ -1715,11 +1695,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp) goto custom; menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit)); - gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage); + g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); e_dialog_option_menu_set (priv->interval_unit, ICAL_DAILY_RECURRENCE, freq_map); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage); + g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; case ICAL_WEEKLY_RECURRENCE: { @@ -1782,11 +1762,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp) priv->weekday_day_mask = day_mask; menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit)); - gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage); + g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); e_dialog_option_menu_set (priv->interval_unit, ICAL_WEEKLY_RECURRENCE, freq_map); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage); + g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; } @@ -1881,11 +1861,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp) goto custom; menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit)); - gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage); + g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); e_dialog_option_menu_set (priv->interval_unit, ICAL_MONTHLY_RECURRENCE, freq_map); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage); + g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; case ICAL_YEARLY_RECURRENCE: @@ -1898,11 +1878,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp) goto custom; menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit)); - gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage); + g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); e_dialog_option_menu_set (priv->interval_unit, ICAL_YEARLY_RECURRENCE, freq_map); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage); + g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; default: @@ -1911,13 +1891,13 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp) /* If we got here it means it is a simple recurrence */ - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->none), rpage); - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->simple), rpage); - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->custom), rpage); + g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); e_dialog_radio_set (priv->simple, RECUR_SIMPLE, type_map); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->none), rpage); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->simple), rpage); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->custom), rpage); + g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); gtk_widget_set_sensitive (priv->custom, FALSE); @@ -1925,9 +1905,9 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp) make_recurrence_special (rpage); adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value)); - gtk_signal_handler_block_by_data (GTK_OBJECT (adj), rpage); + g_signal_handlers_block_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); e_dialog_spin_set (priv->interval_value, r->interval); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (adj), rpage); + g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); fill_ending_date (rpage, r); @@ -1935,13 +1915,13 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp) custom: - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->none), rpage); - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->simple), rpage); - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->custom), rpage); + g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); e_dialog_radio_set (priv->custom, RECUR_CUSTOM, type_map); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->none), rpage); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->simple), rpage); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->custom), rpage); + g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); + g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); gtk_widget_set_sensitive (priv->custom, TRUE); sensitize_recur_widgets (rpage); @@ -2459,7 +2439,7 @@ recurrence_page_new (void) { RecurrencePage *rpage; - rpage = gtk_type_new (TYPE_RECURRENCE_PAGE); + rpage = g_object_new (TYPE_RECURRENCE_PAGE, NULL); if (!recurrence_page_construct (rpage)) { g_object_unref((rpage)); return NULL; diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index e0bc4c848f..d3ad165c70 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -77,7 +77,7 @@ struct _SchedulePagePrivate { static void schedule_page_class_init (SchedulePageClass *class); static void schedule_page_init (SchedulePage *spage); -static void schedule_page_destroy (GtkObject *object); +static void schedule_page_finalize (GObject *object); static GtkWidget *schedule_page_get_widget (CompEditorPage *page); static void schedule_page_focus_main_widget (CompEditorPage *page); @@ -99,42 +99,21 @@ static CompEditorPageClass *parent_class = NULL; * * Return value: The type ID of the #SchedulePage class. **/ -GtkType -schedule_page_get_type (void) -{ - static GtkType schedule_page_type; - - if (!schedule_page_type) { - static const GtkTypeInfo schedule_page_info = { - "SchedulePage", - sizeof (SchedulePage), - sizeof (SchedulePageClass), - (GtkClassInitFunc) schedule_page_class_init, - (GtkObjectInitFunc) schedule_page_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL - }; - - schedule_page_type = - gtk_type_unique (TYPE_COMP_EDITOR_PAGE, - &schedule_page_info); - } - return schedule_page_type; -} +E_MAKE_TYPE (schedule_page, "SchedulePage", SchedulePage, schedule_page_class_init, + schedule_page_init, TYPE_COMP_EDITOR_PAGE); /* Class initialization function for the schedule page */ static void schedule_page_class_init (SchedulePageClass *class) { CompEditorPageClass *editor_page_class; - GtkObjectClass *object_class; + GObjectClass *object_class; editor_page_class = (CompEditorPageClass *) class; - object_class = (GtkObjectClass *) class; + object_class = (GObjectClass *) class; - parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE); + parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE); editor_page_class->get_widget = schedule_page_get_widget; editor_page_class->focus_main_widget = schedule_page_focus_main_widget; @@ -143,7 +122,7 @@ schedule_page_class_init (SchedulePageClass *class) editor_page_class->set_summary = NULL; editor_page_class->set_dates = schedule_page_set_dates; - object_class->destroy = schedule_page_destroy; + object_class->finalize = schedule_page_finalize; } /* Object initialization function for the schedule page */ @@ -166,7 +145,7 @@ schedule_page_init (SchedulePage *spage) /* Destroy handler for the schedule page */ static void -schedule_page_destroy (GtkObject *object) +schedule_page_finalize (GObject *object) { SchedulePage *spage; SchedulePagePrivate *priv; @@ -187,8 +166,8 @@ schedule_page_destroy (GtkObject *object) g_free (priv); spage->priv = NULL; - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->finalize) + (* G_OBJECT_CLASS (parent_class)->finalize) (object); } @@ -474,7 +453,7 @@ schedule_page_new (EMeetingModel *emm) { SchedulePage *spage; - spage = gtk_type_new (TYPE_SCHEDULE_PAGE); + spage = g_object_new (TYPE_SCHEDULE_PAGE, NULL); if (!schedule_page_construct (spage, emm)) { g_object_unref((spage)); return NULL; diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index 9c03d31bdd..d8c04f1a09 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -89,7 +89,7 @@ static const int priority_map[] = { static void task_details_page_class_init (TaskDetailsPageClass *class); static void task_details_page_init (TaskDetailsPage *tdpage); -static void task_details_page_destroy (GtkObject *object); +static void task_details_page_finalize (GObject *object); static GtkWidget *task_details_page_get_widget (CompEditorPage *page); static void task_details_page_focus_main_widget (CompEditorPage *page); @@ -108,40 +108,19 @@ static CompEditorPageClass *parent_class = NULL; * * Return value: The type ID of the #TaskDetailsPage class. **/ -GtkType -task_details_page_get_type (void) -{ - static GtkType task_details_page_type; - - if (!task_details_page_type) { - static const GtkTypeInfo task_details_page_info = { - "TaskDetailsPage", - sizeof (TaskDetailsPage), - sizeof (TaskDetailsPageClass), - (GtkClassInitFunc) task_details_page_class_init, - (GtkObjectInitFunc) task_details_page_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL - }; - - task_details_page_type = - gtk_type_unique (TYPE_COMP_EDITOR_PAGE, - &task_details_page_info); - } - return task_details_page_type; -} +E_MAKE_TYPE (task_details_page, "TaskDetailsPage", TaskDetailsPage, task_details_page_class_init, + task_details_page_init, TYPE_COMP_EDITOR_PAGE); /* Class initialization function for the task page */ static void task_details_page_class_init (TaskDetailsPageClass *class) { CompEditorPageClass *editor_page_class; - GtkObjectClass *object_class; + GObjectClass *object_class; editor_page_class = (CompEditorPageClass *) class; - object_class = (GtkObjectClass *) class; + object_class = (GObjectClass *) class; parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE); @@ -150,7 +129,7 @@ task_details_page_class_init (TaskDetailsPageClass *class) editor_page_class->fill_widgets = task_details_page_fill_widgets; editor_page_class->fill_component = task_details_page_fill_component; - object_class->destroy = task_details_page_destroy; + object_class->finalize = task_details_page_finalize; } /* Object initialization function for the task page */ @@ -180,7 +159,7 @@ task_details_page_init (TaskDetailsPage *tdpage) /* Destroy handler for the task page */ static void -task_details_page_destroy (GtkObject *object) +task_details_page_finalize (GObject *object) { TaskDetailsPage *tdpage; TaskDetailsPagePrivate *priv; @@ -199,8 +178,8 @@ task_details_page_destroy (GtkObject *object) g_free (priv); tdpage->priv = NULL; - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->finalize) + (* G_OBJECT_CLASS (parent_class)->finalize) (object); } @@ -760,9 +739,9 @@ task_details_page_new (void) { TaskDetailsPage *tdpage; - tdpage = gtk_type_new (TYPE_TASK_DETAILS_PAGE); + tdpage = g_object_new (TYPE_TASK_DETAILS_PAGE, NULL); if (!task_details_page_construct (tdpage)) { - g_object_unref((tdpage)); + g_object_unref ((tdpage)); return NULL; } diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 62c7a07e4a..6f6e402883 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -52,7 +52,7 @@ static void task_editor_class_init (TaskEditorClass *class); static void task_editor_init (TaskEditor *te); static void task_editor_edit_comp (CompEditor *editor, CalComponent *comp); static gboolean task_editor_send_comp (CompEditor *editor, CalComponentItipMethod method); -static void task_editor_destroy (GtkObject *object); +static void task_editor_finalize (GObject *object); static void assign_task_cmd (GtkWidget *widget, gpointer data); static void refresh_task_cmd (GtkWidget *widget, gpointer data); @@ -83,38 +83,18 @@ static CompEditorClass *parent_class; * * Return value: The type ID of the #TaskEditor class. **/ -GtkType -task_editor_get_type (void) -{ - static GtkType task_editor_type = 0; - - if (!task_editor_type) { - static const GtkTypeInfo task_editor_info = { - "TaskEditor", - sizeof (TaskEditor), - sizeof (TaskEditorClass), - (GtkClassInitFunc) task_editor_class_init, - (GtkObjectInitFunc) task_editor_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL - }; - - task_editor_type = gtk_type_unique (TYPE_COMP_EDITOR, - &task_editor_info); - } - return task_editor_type; -} +E_MAKE_TYPE (task_editor, "TaskEditor", TaskEditor, task_editor_class_init, task_editor_init, + TYPE_COMP_EDITOR); /* Class initialization function for the event editor */ static void task_editor_class_init (TaskEditorClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; CompEditorClass *editor_class; - object_class = (GtkObjectClass *) klass; + object_class = (GObjectClass *) klass; editor_class = (CompEditorClass *) klass; parent_class = g_type_class_ref(TYPE_COMP_EDITOR); @@ -122,7 +102,7 @@ task_editor_class_init (TaskEditorClass *klass) editor_class->edit_comp = task_editor_edit_comp; editor_class->send_comp = task_editor_send_comp; - object_class->destroy = task_editor_destroy; + object_class->finalize = task_editor_finalize; } static void @@ -334,7 +314,7 @@ task_editor_send_comp (CompEditor *editor, CalComponentItipMethod method) /* Destroy handler for the event editor */ static void -task_editor_destroy (GtkObject *object) +task_editor_finalize (GObject *object) { TaskEditor *te; TaskEditorPrivate *priv; @@ -351,8 +331,8 @@ task_editor_destroy (GtkObject *object) g_object_unref((priv->model)); - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->finalize) + (* G_OBJECT_CLASS (parent_class)->finalize) (object); } /** @@ -369,7 +349,7 @@ task_editor_new (CalClient *client) { TaskEditor *te; - te = TASK_EDITOR (gtk_type_new (TYPE_TASK_EDITOR)); + te = g_object_new (TYPE_TASK_EDITOR, NULL); return task_editor_construct (te, client); } diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 2ed31b3be2..177c100b8b 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -91,7 +91,7 @@ static const int classification_map[] = { static void task_page_class_init (TaskPageClass *class); static void task_page_init (TaskPage *tpage); -static void task_page_destroy (GtkObject *object); +static void task_page_finalize (GObject *object); static GtkWidget *task_page_get_widget (CompEditorPage *page); static void task_page_focus_main_widget (CompEditorPage *page); @@ -112,39 +112,19 @@ static CompEditorPageClass *parent_class = NULL; * * Return value: The type ID of the #TaskPage class. **/ -GtkType -task_page_get_type (void) -{ - static GtkType task_page_type; - - if (!task_page_type) { - static const GtkTypeInfo task_page_info = { - "TaskPage", - sizeof (TaskPage), - sizeof (TaskPageClass), - (GtkClassInitFunc) task_page_class_init, - (GtkObjectInitFunc) task_page_init, - NULL, /* reserved_1 */ - NULL, /* reserved_2 */ - (GtkClassInitFunc) NULL - }; - - task_page_type = gtk_type_unique (TYPE_COMP_EDITOR_PAGE, - &task_page_info); - } - return task_page_type; -} +E_MAKE_TYPE (task_page, "TaskPage", TaskPage, task_page_class_init, task_page_init, + TYPE_COMP_EDITOR_PAGE); /* Class initialization function for the task page */ static void task_page_class_init (TaskPageClass *class) { CompEditorPageClass *editor_page_class; - GtkObjectClass *object_class; + GObjectClass *object_class; editor_page_class = (CompEditorPageClass *) class; - object_class = (GtkObjectClass *) class; + object_class = (GObjectClass *) class; parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE); @@ -155,7 +135,7 @@ task_page_class_init (TaskPageClass *class) editor_page_class->set_summary = task_page_set_summary; editor_page_class->set_dates = task_page_set_dates; - object_class->destroy = task_page_destroy; + object_class->finalize = task_page_finalize; } /* Object initialization function for the task page */ @@ -192,7 +172,7 @@ task_page_init (TaskPage *tpage) /* Destroy handler for the task page */ static void -task_page_destroy (GtkObject *object) +task_page_finalize (GObject *object) { TaskPage *tpage; TaskPagePrivate *priv; @@ -219,8 +199,8 @@ task_page_destroy (GtkObject *object) g_free (priv); tpage->priv = NULL; - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->finalize) + (* G_OBJECT_CLASS (parent_class)->finalize) (object); } diff --git a/calendar/gui/e-comp-editor-registry.c b/calendar/gui/e-comp-editor-registry.c index c5d621fa76..1e9962c26f 100644 --- a/calendar/gui/e-comp-editor-registry.c +++ b/calendar/gui/e-comp-editor-registry.c @@ -148,11 +148,11 @@ foreach_close_cb (gpointer key, gpointer value, gpointer data) rdata = value; - gtk_signal_handler_block_by_data (GTK_OBJECT (rdata->editor), data); + g_signal_handlers_block_matched (rdata->editor, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, data); comp_editor_focus (rdata->editor); if (!comp_editor_close (rdata->editor)) { - gtk_signal_handler_unblock_by_data (GTK_OBJECT (rdata->editor), data); + g_signal_handlers_unblock_matched (rdata->editor, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, data); return FALSE; } diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 2528cfbed3..7609ad90fa 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -891,7 +891,7 @@ e_day_view_destroy (GtkObject *object) e_day_view_stop_auto_scroll (day_view); if (day_view->client) { - gtk_signal_disconnect_by_data (GTK_OBJECT (day_view->client), day_view); + g_signal_handlers_disconnect_matched (day_view->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, day_view); g_object_unref (day_view->client); day_view->client = NULL; } @@ -902,7 +902,8 @@ e_day_view_destroy (GtkObject *object) } if (day_view->query) { - gtk_signal_disconnect_by_data (GTK_OBJECT (day_view->query), day_view); + g_signal_handlers_disconnect_matched (day_view->query, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, day_view); g_object_unref (day_view->query); day_view->query = NULL; } @@ -1648,7 +1649,8 @@ update_query (EDayView *day_view) day_view->query = NULL; if (old_query) { - gtk_signal_disconnect_by_data (GTK_OBJECT (old_query), day_view); + g_signal_handlers_disconnect_matched (old_query, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, day_view); g_object_unref (old_query); } @@ -1715,7 +1717,7 @@ e_day_view_set_cal_client (EDayView *day_view, g_object_ref (client); if (day_view->client) { - gtk_signal_disconnect_by_data (GTK_OBJECT (day_view->client), day_view); + g_signal_handlers_disconnect_matched (day_view->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, day_view); g_object_unref (day_view->client); } diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index 9b99bea23b..cdcead83b2 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -620,7 +620,8 @@ query_eval_error_cb (CalQuery *query, const char *error_str, gpointer data) set_status_message (tasks, NULL); - gtk_signal_disconnect_by_data (GTK_OBJECT (priv->query), tasks); + g_signal_handlers_disconnect_matched (priv->query, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, tasks); g_object_unref (priv->query); priv->query = NULL; } @@ -639,7 +640,8 @@ query_query_done_cb (CalQuery *query, CalQueryDoneStatus status, const char *err set_status_message (tasks, NULL); - gtk_signal_disconnect_by_data (GTK_OBJECT (priv->query), tasks); + g_signal_handlers_disconnect_matched (priv->query, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, tasks); g_object_unref (priv->query); priv->query = NULL; } diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 7028915b0b..d73f14e774 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -477,7 +477,7 @@ e_week_view_destroy (GtkObject *object) week_view->events = NULL; if (week_view->client) { - gtk_signal_disconnect_by_data (GTK_OBJECT (week_view->client), week_view); + g_signal_handlers_disconnect_matched (week_view->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, week_view); g_object_unref (week_view->client); week_view->client = NULL; } @@ -488,7 +488,8 @@ e_week_view_destroy (GtkObject *object) } if (week_view->query) { - gtk_signal_disconnect_by_data (GTK_OBJECT (week_view->query), week_view); + g_signal_handlers_disconnect_matched (week_view->query, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, week_view); g_object_unref (week_view->query); week_view->query = NULL; } @@ -1170,7 +1171,8 @@ update_query (EWeekView *week_view) week_view->query = NULL; if (old_query) { - gtk_signal_disconnect_by_data (GTK_OBJECT (old_query), week_view); + g_signal_handlers_disconnect_matched (old_query, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, week_view); g_object_unref (old_query); } @@ -1238,7 +1240,7 @@ e_week_view_set_cal_client (EWeekView *week_view, g_object_ref (client); if (week_view->client) { - gtk_signal_disconnect_by_data (GTK_OBJECT (week_view->client), week_view); + g_signal_handlers_disconnect_matched (week_view->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, week_view); g_object_unref (week_view->client); } diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 13f51fab36..f929fc872d 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -513,7 +513,8 @@ update_query (GnomeCalendar *gcal) priv->dn_query = NULL; if (old_query) { - gtk_signal_disconnect_by_data (GTK_OBJECT (old_query), gcal); + g_signal_handlers_disconnect_matched (old_query, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, gcal); g_object_unref (old_query); } @@ -926,7 +927,8 @@ gnome_calendar_destroy (GtkObject *object) g_free (filename); if (priv->dn_query) { - gtk_signal_disconnect_by_data (GTK_OBJECT (priv->dn_query), gcal); + g_signal_handlers_disconnect_matched (priv->dn_query, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, gcal); g_object_unref (priv->dn_query); priv->dn_query = NULL; } @@ -937,13 +939,15 @@ gnome_calendar_destroy (GtkObject *object) } if (priv->client) { - gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), gcal); + g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, gcal); g_object_unref (priv->client); priv->client = NULL; } if (priv->task_pad_client) { - gtk_signal_disconnect_by_data (GTK_OBJECT (priv->task_pad_client), gcal); + g_signal_handlers_disconnect_matched (priv->task_pad_client, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, gcal); g_object_unref (priv->task_pad_client); priv->task_pad_client = NULL; } diff --git a/calendar/gui/tasks-control.c b/calendar/gui/tasks-control.c index 9bf6b0e249..a4a4c4937f 100644 --- a/calendar/gui/tasks-control.c +++ b/calendar/gui/tasks-control.c @@ -364,7 +364,7 @@ tasks_control_deactivate (BonoboControl *control, ETasks *tasks) e_tasks_discard_view_menus (tasks); /* Stop monitoring the "selection_changed" signal */ - gtk_signal_disconnect_by_data (GTK_OBJECT (tasks), control); + g_signal_handlers_disconnect_matched (tasks, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, control); bonobo_ui_component_rm (uic, "/", NULL); bonobo_ui_component_unset_container (uic, NULL); |