diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2007-04-20 02:53:33 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-04-20 02:53:33 +0800 |
commit | 64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6 (patch) | |
tree | 4ebe95239bef43cb97c0e46aa8194d44e6c88be6 /widgets | |
parent | bb05f6e6d0541bf29c8dde4e264cc7c23ba52fbb (diff) | |
download | gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.tar.gz gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.tar.zst gsoc2013-evolution-64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6.zip |
Massive code cleanup (bug #429422)
svn path=/trunk/; revision=33432
Diffstat (limited to 'widgets')
58 files changed, 400 insertions, 216 deletions
diff --git a/widgets/ChangeLog b/widgets/ChangeLog index 391b928373..06bb844447 100644 --- a/widgets/ChangeLog +++ b/widgets/ChangeLog @@ -1,3 +1,58 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * text/e-text-model-uri.c (e_text_model_uri_dispose), + (objectify_idle_flush): + Use g_source_remove() instead of gtk_idle_remove(). + + * text/e-text-model-uri.c (e_text_model_uri_objectify): + Use g_idle_add() instead of gtk_idle_add(). + + * text/e-text.c (e_text_dispose), (e_text_event): + * text/e-entry.c (e_entry_text_keypress), (proxy_changed), + (e_entry_cancel_delayed_completion), (e_entry_dispose): + Use g_source_remove() instead of gtk_timeout_remove(). + + * text/e-text.c (e_text_event): + * text/e-entry.c (proxy_changed), (e_entry_start_delayed_completion): + * e-timezone-dialog/e-timezone-dialog.c (on_map_visibility_changed): + Use g_timeout_add() instead of gtk_timeout_add(). + + * text/e-completion-view.c (e_completion_view_set_width): + * text/e-text.c (_do_tooltip): + Use gtk_widget_set_size_request() instead of gtk_widget_set_usize(). + + * text/e-completion-callbacks.c (e_completion_callbacks_new): + Use g_object_new() instead of gtk_type_new(). + + * text/e-entry.c (e_entry_enable_completion_full): + Use g_object_ref_sink() instead of gtk_object_sink(). + + * text/e-entry.c (e_entry_class_init): + Use g_cclosure_marshal_VOID__INT instead of gtk_marshal_NONE__INT. + + * menus/gal-view-new-dialog.c (gal_view_new_dialog_init): + * menus/gal-view-instance-save-as-dialog.c + (gal_view_instance_save_as_dialog_init): + * menus/gal-define-views-dialog.c (gal_define_views_dialog_init): + Use g_object_ref() instead of gtk_widget_ref(). + Use g_object_unref() instead of gtk_widget_unref(). + + * menus/gal-view-collection.c (gal_view_collection_dispose): + e_free_object_list() is dead; just do it manually. + + * menus/gal-view-collection.c (load_single_file), (load_single_dir), + (gal_view_collection_save): + * menus/gal-view-instance.c (gal_view_instance_construct): + Use g_build_filename() instead of g_concat_dir_and_file(). + + * menus/gal-view-collection.c (gal_view_collection_load): + Use g_mkdir_with_parents() instead of e_create_directory(). + + * e-timezone-dialog/e-timezone-dialog.c (e_timezone_dialog_construct): + Use gtk_editable_set_editable() instead of gtk_entry_set_editable(). + 2007-03-20 Matthew Barnes <mbarnes@redhat.com> ** Fixes part of bug #419524 diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.c b/widgets/e-timezone-dialog/e-timezone-dialog.c index 66bd67bc46..291ea500ee 100644 --- a/widgets/e-timezone-dialog/e-timezone-dialog.c +++ b/widgets/e-timezone-dialog/e-timezone-dialog.c @@ -24,6 +24,8 @@ #include <config.h> #endif +#include <string.h> +#include <glib/gi18n.h> #include <gtk/gtksignal.h> #include <gtk/gtkcombo.h> #include <gtk/gtkentry.h> @@ -277,7 +279,7 @@ e_timezone_dialog_construct (ETimezoneDialog *etd) | GDK_LEAVE_NOTIFY_MASK | GDK_VISIBILITY_NOTIFY_MASK); - gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (priv->timezone_combo)->entry), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->timezone_combo)->entry), FALSE); e_timezone_dialog_add_timezones (etd); @@ -547,7 +549,7 @@ on_map_visibility_changed (GtkWidget *w, GdkEventVisibility *event, /* Map is visible, at least partly, so make sure we flash the selected point. */ if (!priv->timeout_id) - priv->timeout_id = gtk_timeout_add (100, on_map_timeout, etd); + priv->timeout_id = g_timeout_add (100, on_map_timeout, etd); } else { /* Map is invisible, so don't waste resources on the timeout.*/ if (priv->timeout_id) { diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index 104e706b6d..3630780817 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -258,12 +258,12 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog) if (!widget) { return; } - gtk_widget_ref(widget); + g_object_ref(widget); gtk_container_remove (GTK_CONTAINER (widget->parent), widget); gtk_window_set_default_size(GTK_WINDOW(dialog), 360, 270); gtk_container_set_border_width(GTK_CONTAINER(dialog), 6); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0); - gtk_widget_unref(widget); + g_object_unref(widget); gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c index 848b789235..36f9cea25c 100644 --- a/widgets/menus/gal-view-collection.c +++ b/widgets/menus/gal-view-collection.c @@ -166,7 +166,10 @@ gal_view_collection_dispose (GObject *object) collection->view_data = NULL; collection->view_count = 0; - e_free_object_list (collection->factory_list); + g_list_foreach ( + collection->factory_list, + (GFunc) g_object_unref, NULL); + g_list_free (collection->factory_list); collection->factory_list = NULL; for (i = 0; i < collection->removed_view_count; i++) { @@ -375,7 +378,7 @@ load_single_file (GalViewCollection *collection, if (item->filename) { char *fullpath; - fullpath = g_concat_dir_and_file(dir, item->filename); + fullpath = g_build_filename(dir, item->filename, NULL); item->view = gal_view_collection_real_load_view_from_file (collection, item->type, item->title, dir, fullpath); g_free(fullpath); if (item->view) { @@ -395,7 +398,7 @@ load_single_dir (GalViewCollection *collection, xmlDoc *doc = NULL; xmlNode *root; xmlNode *child; - char *filename = g_concat_dir_and_file(dir, "galview.xml"); + char *filename = g_build_filename(dir, "galview.xml", NULL); char *default_view; if (g_file_test (filename, G_FILE_TEST_IS_REGULAR)) { @@ -488,7 +491,7 @@ gal_view_collection_load (GalViewCollection *collection) g_return_if_fail (collection->system_dir != NULL); g_return_if_fail (!collection->loaded); - if ((e_create_directory(collection->local_dir) == -1) && (errno != EEXIST)) + if ((g_mkdir_with_parents (collection->local_dir, 0777) == -1) && (errno != EEXIST)) g_warning ("Unable to create dir %s: %s", collection->local_dir, g_strerror(errno)); load_single_dir(collection, collection->local_dir, TRUE); @@ -539,7 +542,7 @@ gal_view_collection_save (GalViewCollection *collection) e_xml_set_string_prop_by_name(child, "type", item->type); if (item->changed) { - filename = g_concat_dir_and_file(collection->local_dir, item->filename); + filename = g_build_filename(collection->local_dir, item->filename, NULL); gal_view_save(item->view, filename); g_free(filename); } @@ -556,7 +559,7 @@ gal_view_collection_save (GalViewCollection *collection) e_xml_set_string_prop_by_name(child, "title", item->title); e_xml_set_string_prop_by_name(child, "type", item->type); } - filename = g_concat_dir_and_file(collection->local_dir, "galview.xml"); + filename = g_build_filename(collection->local_dir, "galview.xml", NULL); if (e_xml_save_file (filename, doc) == -1) g_warning ("Unable to save view to %s - %s", filename, g_strerror(errno)); xmlFreeDoc(doc); diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c index 663097567f..622b99a049 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.c +++ b/widgets/menus/gal-view-instance-save-as-dialog.c @@ -205,10 +205,10 @@ gal_view_instance_save_as_dialog_init (GalViewInstanceSaveAsDialog *dialog) if (!widget) { return; } - gtk_widget_ref(widget); + g_object_ref(widget); gtk_container_remove (GTK_CONTAINER (widget->parent), widget); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0); - gtk_widget_unref(widget); + g_object_unref(widget); gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c index df84a38948..821a299afb 100644 --- a/widgets/menus/gal-view-instance.c +++ b/widgets/menus/gal-view-instance.c @@ -349,11 +349,11 @@ gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *colle e_filename_make_safe (safe_id); filename = g_strdup_printf ("custom_view-%s.xml", safe_id); - instance->custom_filename = g_concat_dir_and_file (instance->collection->local_dir, filename); + instance->custom_filename = g_build_filename (instance->collection->local_dir, filename, NULL); g_free (filename); filename = g_strdup_printf ("current_view-%s.xml", safe_id); - instance->current_view_filename = g_concat_dir_and_file (instance->collection->local_dir, filename); + instance->current_view_filename = g_build_filename (instance->collection->local_dir, filename, NULL); g_free (filename); g_free (safe_id); diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c index a256baccdb..c41ce03123 100644 --- a/widgets/menus/gal-view-new-dialog.c +++ b/widgets/menus/gal-view-new-dialog.c @@ -100,10 +100,10 @@ gal_view_new_dialog_init (GalViewNewDialog *dialog) if (!widget) { return; } - gtk_widget_ref(widget); + g_object_ref(widget); gtk_container_remove (GTK_CONTAINER (widget->parent), widget); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0); - gtk_widget_unref(widget); + g_object_unref(widget); gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index de72bfed87..2c2f245a68 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,76 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * e-combo-cell-editable.c (ecce_init): + * e-dateedit.c (e_date_edit_set_editable): + Use gtk_editable_set_editable() instead of gtk_entry_set_editable(). + + * e-dateedit.c (create_children): + * e-cell-date-edit.c (e_cell_date_edit_init): + Use gtk_box_set_spacing() instead of gtk_button_box_set_spacing(). + Remove gtk_button_box_set_child_ipadding() and + gtk_button_box_set_child_size(). Use style properties instead. + + * e-clipped-label.c (e_clipped_label_new): + * e-combo-button.c (e_combo_button_new): + * e-config-page.c (e_config_page_init): + * e-multi-config-dialog.c (e_multi_config_dialog_init): + * e-dropdown-button.c (e_dropdown_button_new): + * e-cell-date-edit.c (e_cell_date_edit_new): + * e-filter-bar.c (e_filter_bar_new): + * e-url-entry.c (mnemonic_activate): + * e-map.c (e_map_new): + * e-search-bar.c (e_search_bar_new): + * e-calendar.c (e_calendar_new): + Use g_object_new() instead of gtk_type_new(). + + * test-calendar.c (main): + * test-info-label.c (main): + * test-multi-config-dialog.c (main): + * test-dropdown-button.c (main): + Use gnome_program_init() instead of gnome_init(). + + * e-combo-button.c (impl_released): + Replace gtk_widget_draw() with GTK's 2-line implementation. + + * e-multi-config-dialog.c (set_page_timeout_callback), + (e_multi_config_dialog_show_page): + Use gtk_notebook_set_current_page() instead of + gtk_notebook_set_page(). + + * e-dropdown-button.c (impl_destroy): + Use g_object_unref() instead of gtk_accel_group_unref(). + + * e-cell-percent.c (show_percent_warning): + * e-cell-date-edit.c (e_cell_date_edit_show_time_invalid_warning): + Use GtkMessageDialog instead of GnomeMessageDialog. + + * e-cell-date-edit.c (e_cell_date_edit_select_matching_time), + (e_cell_date_edit_on_time_selected): + Use gtk_label_get_text() instead of gtk_label_get(). + + * e-filter-bar.c (class_init): + * gal-combo-box.c (gal_combo_box_init), (gtk_combo_popup_tear_off), + (gtk_combo_popup_reparent): + * e-map.c (e_map_set_scroll_adjustments): + * e-task-widget.c (e_task_widget_construct): + Use g_object_ref_sink() instead of gtk_object_sink(). + + * gal-combo-box.c (gtk_combo_tearoff_bg_copy), + (gtk_combo_popup_reparent): + * gal-combo-text.c (gal_combo_text_construct): + Use gtk_widget_set_size_request() instead of gtk_widget_set_usize(). + + * test-dropdown-button.c: + Use GTK_STOCK_* constants instead of GNOME_STOCK_*. + + * e-calendar.c (e_calendar_init): + Use g_signal_connect_swapped() instead of gtk_signal_connect_object(). + + * e-calendar.c (e_calendar_destroy), (e_calendar_stop_auto_move): + Use g_source_remove() instead of gtk_timeout_remove(). + 2007-04-11 Srinivasa Ragavan <sragavan@novell.com> ** Added spinner widgets. diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index 7933998445..741bdfb19d 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -155,15 +155,15 @@ e_calendar_init (ECalendar *cal) button = gtk_button_new (); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); gtk_widget_show (button); - gtk_signal_connect_object (GTK_OBJECT (button), "pressed", - G_CALLBACK (e_calendar_on_prev_pressed), - GTK_OBJECT (cal)); - gtk_signal_connect_object (GTK_OBJECT (button), "released", - G_CALLBACK (e_calendar_on_prev_released), - GTK_OBJECT (cal)); - gtk_signal_connect_object (GTK_OBJECT (button), "clicked", - G_CALLBACK (e_calendar_on_prev_clicked), - GTK_OBJECT (cal)); + g_signal_connect_swapped ( + button, "pressed", + G_CALLBACK (e_calendar_on_prev_pressed), cal); + g_signal_connect_swapped ( + button, "released", + G_CALLBACK (e_calendar_on_prev_released), cal); + g_signal_connect_swapped ( + button, "clicked", + G_CALLBACK (e_calendar_on_prev_clicked), cal); pixmap = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE); gtk_widget_show (pixmap); @@ -179,15 +179,15 @@ e_calendar_init (ECalendar *cal) button = gtk_button_new (); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); gtk_widget_show (button); - gtk_signal_connect_object (GTK_OBJECT (button), "pressed", - G_CALLBACK (e_calendar_on_next_pressed), - GTK_OBJECT (cal)); - gtk_signal_connect_object (GTK_OBJECT (button), "released", - G_CALLBACK (e_calendar_on_next_released), - GTK_OBJECT (cal)); - gtk_signal_connect_object (GTK_OBJECT (button), "clicked", - G_CALLBACK (e_calendar_on_next_clicked), - GTK_OBJECT (cal)); + g_signal_connect_swapped ( + button, "pressed", + G_CALLBACK (e_calendar_on_next_pressed), cal); + g_signal_connect_swapped ( + button, "released", + G_CALLBACK (e_calendar_on_next_released), cal); + g_signal_connect_swapped ( + button, "clicked", + G_CALLBACK (e_calendar_on_next_clicked), cal); pixmap = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE); gtk_widget_show (pixmap); @@ -221,7 +221,7 @@ e_calendar_new (void) GtkWidget *cal; AtkObject *a11y; - cal = gtk_type_new (e_calendar_get_type ()); + cal = g_object_new (e_calendar_get_type (), NULL); a11y = gtk_widget_get_accessible (cal); atk_object_set_name (a11y, _("Month Calendar")); @@ -240,7 +240,7 @@ e_calendar_destroy (GtkObject *object) cal = E_CALENDAR (object); if (cal->timeout_id != 0) { - gtk_timeout_remove (cal->timeout_id); + g_source_remove (cal->timeout_id); cal->timeout_id = 0; } @@ -514,7 +514,7 @@ static void e_calendar_stop_auto_move (ECalendar *cal) { if (cal->timeout_id != 0) { - gtk_timeout_remove (cal->timeout_id); + g_source_remove (cal->timeout_id); cal->timeout_id = 0; } } diff --git a/widgets/misc/e-cell-date-edit.c b/widgets/misc/e-cell-date-edit.c index f8a4f134a2..14691b99b6 100644 --- a/widgets/misc/e-cell-date-edit.c +++ b/widgets/misc/e-cell-date-edit.c @@ -224,9 +224,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) bbox = gtk_hbutton_box_new (); gtk_container_set_border_width (GTK_CONTAINER (bbox), 4); - gtk_button_box_set_spacing (GTK_BUTTON_BOX (bbox), 2); - gtk_button_box_set_child_ipadding (GTK_BUTTON_BOX (bbox), 2, 0); - gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), 0, 0); + gtk_box_set_spacing (GTK_BOX (bbox), 2); gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0); gtk_widget_show (bbox); @@ -283,9 +281,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) ECell * e_cell_date_edit_new (void) { - ECellDateEdit *ecde = gtk_type_new (e_cell_date_edit_get_type ()); - - return (ECell*) ecde; + return g_object_new (e_cell_date_edit_get_type (), NULL); } @@ -513,14 +509,14 @@ e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, GtkWidget *listitem, *label; GList *elem; gboolean found = FALSE; - char *list_item_text; + const gchar *list_item_text; list = GTK_LIST (ecde->time_list); elem = list->children; while (elem) { listitem = GTK_WIDGET (elem->data); label = GTK_BIN (listitem)->child; - gtk_label_get (GTK_LABEL (label), &list_item_text); + list_item_text = gtk_label_get_text (GTK_LABEL (label)); if (!strcmp (list_item_text, time)) { found = TRUE; @@ -777,7 +773,7 @@ e_cell_date_edit_show_time_invalid_warning (ECellDateEdit *ecde) { GtkWidget *dialog; struct tm date_tm; - char buffer[64], *message; + char buffer[64]; /* Create a useful error message showing the correct format. */ date_tm.tm_year = 100; @@ -790,18 +786,16 @@ e_cell_date_edit_show_time_invalid_warning (ECellDateEdit *ecde) e_time_format_time (&date_tm, ecde->use_24_hour_format, FALSE, buffer, sizeof (buffer)); - message = g_strdup_printf (_("The time must be in the format: %s"), - buffer); - - dialog = gnome_message_box_new (message, GNOME_MESSAGE_BOX_ERROR, - GNOME_STOCK_BUTTON_OK, NULL); /* FIXME: Fix transient settings - I'm not sure it works with popup windows. Maybe we need to use a normal window without decorations.*/ - gtk_window_set_transient_for (GTK_WINDOW (dialog), - GTK_WINDOW (ecde->popup_window)); - gnome_dialog_run (GNOME_DIALOG (dialog)); - - g_free (message); + dialog = gtk_message_dialog_new ( + GTK_WINDOW (ecde->popup_window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + _("The time must be in the format: %s"), + buffer); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); } @@ -899,14 +893,14 @@ e_cell_date_edit_on_time_selected (GtkList *list, ECellDateEdit *ecde) { GtkWidget *listitem, *label; - char *list_item_text; + const gchar *list_item_text; if (!list->selection) return; listitem = list->selection->data; label = GTK_BIN (listitem)->child; - gtk_label_get (GTK_LABEL (label), &list_item_text); + list_item_text = gtk_label_get_text (GTK_LABEL (label)); gtk_entry_set_text (GTK_ENTRY (ecde->time_entry), list_item_text); } diff --git a/widgets/misc/e-cell-percent.c b/widgets/misc/e-cell-percent.c index 76b4ffc06f..d50d0924b8 100644 --- a/widgets/misc/e-cell-percent.c +++ b/widgets/misc/e-cell-percent.c @@ -73,10 +73,12 @@ show_percent_warning (void) { GtkWidget *dialog; - dialog = gnome_message_box_new (_("The percent value must be between 0 and 100, inclusive"), - GNOME_MESSAGE_BOX_ERROR, - GNOME_STOCK_BUTTON_OK, NULL); - gtk_widget_show (dialog); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + _("The percent value must be between 0 and 100, inclusive")); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); } static void diff --git a/widgets/misc/e-clipped-label.c b/widgets/misc/e-clipped-label.c index 98e3ecf62e..0338f8529c 100644 --- a/widgets/misc/e-clipped-label.c +++ b/widgets/misc/e-clipped-label.c @@ -138,7 +138,7 @@ e_clipped_label_new (const gchar *text, GtkWidget *label; EClippedLabel *clipped; - label = GTK_WIDGET (gtk_type_new (e_clipped_label_get_type ())); + label = g_object_new (e_clipped_label_get_type (), NULL); clipped = E_CLIPPED_LABEL (label); diff --git a/widgets/misc/e-combo-button.c b/widgets/misc/e-combo-button.c index 6a8bebb8ee..08da2c1eac 100644 --- a/widgets/misc/e-combo-button.c +++ b/widgets/misc/e-combo-button.c @@ -399,7 +399,11 @@ impl_released (GtkButton *button) /* We _draw () instead of queue_draw so that if the operation blocks, the label doesn't vanish. */ - gtk_widget_draw (GTK_WIDGET (button), NULL); + /* XXX gtk_widget_draw() is deprecated. + * Replace it with GTK's implementation. */ + gtk_widget_queue_draw (GTK_WIDGET (button)); + gdk_window_process_updates ( + GTK_WIDGET (button)->window, TRUE); } } } @@ -542,7 +546,7 @@ e_combo_button_new (void) { EComboButton *new; - new = gtk_type_new (e_combo_button_get_type ()); + new = g_object_new (e_combo_button_get_type (), NULL); e_combo_button_construct (new); return GTK_WIDGET (new); diff --git a/widgets/misc/e-combo-cell-editable.c b/widgets/misc/e-combo-cell-editable.c index 5a39974f17..dc20ede481 100644 --- a/widgets/misc/e-combo-cell-editable.c +++ b/widgets/misc/e-combo-cell-editable.c @@ -327,7 +327,7 @@ ecce_init (EComboCellEditable *ecce) entry = gtk_entry_new (); ecce->priv->entry = GTK_ENTRY (entry); gtk_entry_set_has_frame (ecce->priv->entry, FALSE); - gtk_entry_set_editable (ecce->priv->entry, FALSE); + gtk_editable_set_editable (GTK_EDITABLE (ecce->priv->entry), FALSE); g_signal_connect (entry, "activate", G_CALLBACK (entry_activated_cb), ecce); g_signal_connect (entry, "key_press_event", G_CALLBACK (entry_key_press_event_cb), ecce); gtk_widget_show (entry); diff --git a/widgets/misc/e-config-page.c b/widgets/misc/e-config-page.c index 7b3f288431..df8dcd023c 100644 --- a/widgets/misc/e-config-page.c +++ b/widgets/misc/e-config-page.c @@ -44,7 +44,7 @@ e_config_page_init (EConfigPage *page) GtkWidget * e_config_page_new (void) { - return gtk_type_new (e_config_page_get_type ()); + return g_object_new (e_config_page_get_type (), NULL); } diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 9706632c6e..a3e8dc21d8 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -452,9 +452,7 @@ create_children (EDateEdit *dedit) bbox = gtk_hbutton_box_new (); gtk_container_set_border_width (GTK_CONTAINER (bbox), 4); - gtk_button_box_set_spacing (GTK_BUTTON_BOX (bbox), 2); - gtk_button_box_set_child_ipadding (GTK_BUTTON_BOX (bbox), 2, 0); - gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), 0, 0); + gtk_box_set_spacing (GTK_BOX (bbox), 2); gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0); gtk_widget_show (bbox); @@ -547,7 +545,7 @@ e_date_edit_set_editable (EDateEdit *dedit, gboolean editable) priv = dedit->priv; - gtk_entry_set_editable (GTK_ENTRY (priv->date_entry), editable); + gtk_editable_set_editable (GTK_EDITABLE (priv->date_entry), editable); gtk_widget_set_sensitive (priv->date_button, editable); } diff --git a/widgets/misc/e-dateedit.h b/widgets/misc/e-dateedit.h index c8ee3f2832..cfd64e86bd 100644 --- a/widgets/misc/e-dateedit.h +++ b/widgets/misc/e-dateedit.h @@ -76,7 +76,7 @@ struct _EDateEditClass { GType e_date_edit_get_type (void); GtkWidget* e_date_edit_new (void); -/* Analogous to gtk_entry_set_editable. disable editing, while still +/* Analogous to gtk_editable_set_editable. disable editing, while still allowing selection. */ void e_date_edit_set_editable (EDateEdit *dedit, gboolean editable); diff --git a/widgets/misc/e-dropdown-button.c b/widgets/misc/e-dropdown-button.c index f939175661..0b0f9e25c3 100644 --- a/widgets/misc/e-dropdown-button.c +++ b/widgets/misc/e-dropdown-button.c @@ -30,7 +30,9 @@ #include <stdio.h> #include <gtk/gtkarrow.h> +#include <gtk/gtkhbox.h> #include <gtk/gtklabel.h> +#include <gtk/gtksignal.h> #include <gtk/gtkwidget.h> #include <libgnomeui/gnome-popup-menu.h> @@ -99,7 +101,7 @@ impl_destroy (GtkObject *object) dropdown_button = E_DROPDOWN_BUTTON (object); priv = dropdown_button->priv; - gtk_accel_group_unref (priv->accel_group); + g_object_unref (priv->accel_group); gtk_widget_destroy (priv->menu); g_free (priv); @@ -230,7 +232,7 @@ e_dropdown_button_new (const char *label_text, g_return_val_if_fail (menu != NULL, NULL); g_return_val_if_fail (GTK_IS_MENU (menu), NULL); - widget = gtk_type_new (e_dropdown_button_get_type ()); + widget = g_object_new (e_dropdown_button_get_type (), NULL); e_dropdown_button_construct (E_DROPDOWN_BUTTON (widget), label_text, menu); return widget; diff --git a/widgets/misc/e-filter-bar.c b/widgets/misc/e-filter-bar.c index b94e5f21da..0c1fce045c 100644 --- a/widgets/misc/e-filter-bar.c +++ b/widgets/misc/e-filter-bar.c @@ -915,7 +915,7 @@ class_init (EFilterBarClass *klass) GTK_RUN_LAST, object_class->type, G_STRUCT_OFFSET (EFilterBarClass, menu_activated), - gtk_marshal_NONE__INT, + g_cclosure_marshal_VOID__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); gtk_object_class_add_signals (object_class, esb_signals, LAST_SIGNAL); @@ -946,7 +946,7 @@ e_filter_bar_new (RuleContext *context, EFilterBar *bar; ESearchBarItem item = { NULL, -1, 0 }; - bar = gtk_type_new (e_filter_bar_get_type ()); + bar = g_object_new (e_filter_bar_get_type (), NULL); bar->context = context; g_object_ref (context); diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c index 74359a26ac..e8b5956eb8 100644 --- a/widgets/misc/e-map.c +++ b/widgets/misc/e-map.c @@ -507,8 +507,7 @@ e_map_set_scroll_adjustments (GtkWidget *widget, GtkAdjustment *hadj, GtkAdjustm if (priv->hadj != hadj) { priv->hadj = hadj; - g_object_ref (priv->hadj); - gtk_object_sink (GTK_OBJECT (priv->hadj)); + g_object_ref_sink (priv->hadj); g_signal_connect (priv->hadj, "value_changed", G_CALLBACK (adjustment_changed_cb), view); @@ -519,8 +518,7 @@ e_map_set_scroll_adjustments (GtkWidget *widget, GtkAdjustment *hadj, GtkAdjustm if (priv->vadj != vadj) { priv->vadj = vadj; - g_object_ref (priv->vadj); - gtk_object_sink (GTK_OBJECT (priv->vadj)); + g_object_ref_sink (priv->vadj); g_signal_connect (priv->vadj, "value_changed", G_CALLBACK (adjustment_changed_cb), view); @@ -624,7 +622,7 @@ e_map_new () GtkWidget *widget; AtkObject *a11y; - widget = GTK_WIDGET (gtk_type_new (TYPE_E_MAP)); + widget = g_object_new (TYPE_E_MAP, NULL); a11y = gtk_widget_get_accessible (widget); atk_object_set_name (a11y, _("World Map")); atk_object_set_role (a11y, ATK_ROLE_IMAGE); diff --git a/widgets/misc/e-multi-config-dialog.c b/widgets/misc/e-multi-config-dialog.c index fef0a507a9..360c124f66 100644 --- a/widgets/misc/e-multi-config-dialog.c +++ b/widgets/misc/e-multi-config-dialog.c @@ -119,7 +119,8 @@ set_page_timeout_callback (void *data) multi_config_dialog = E_MULTI_CONFIG_DIALOG (data); priv = multi_config_dialog->priv; - gtk_notebook_set_page (GTK_NOTEBOOK (priv->notebook), priv->set_page_timeout_page); + gtk_notebook_set_current_page ( + GTK_NOTEBOOK (priv->notebook), priv->set_page_timeout_page); priv->set_page_timeout_id = 0; gtk_widget_grab_focus(priv->list_e_table); @@ -372,11 +373,7 @@ e_multi_config_dialog_init (EMultiConfigDialog *multi_config_dialog) GtkWidget * e_multi_config_dialog_new (void) { - EMultiConfigDialog *dialog; - - dialog = gtk_type_new (e_multi_config_dialog_get_type ()); - - return GTK_WIDGET (dialog); + return g_object_new (e_multi_config_dialog_get_type (), NULL); } @@ -440,6 +437,6 @@ e_multi_config_dialog_show_page (EMultiConfigDialog *dialog, int page) priv = dialog->priv; e_table_set_cursor_row (e_table_scrolled_get_table (E_TABLE_SCROLLED (priv->list_e_table)), page); - gtk_notebook_set_page (GTK_NOTEBOOK (priv->notebook), page); + gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), page); } diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index 6b20492e43..fdfaee0671 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -32,6 +32,7 @@ #include <gdk/gdkkeysyms.h> #include <gtk/gtkdrawingarea.h> #include <gtk/gtkeventbox.h> +#include <gtk/gtklabel.h> #include <gtk/gtkmenuitem.h> #include <gtk/gtkoptionmenu.h> #include <gtk/gtkradiomenuitem.h> @@ -1255,7 +1256,7 @@ e_search_bar_new (ESearchBarItem *menu_items, g_return_val_if_fail (option_items != NULL, NULL); - widget = GTK_WIDGET (gtk_type_new (e_search_bar_get_type ())); + widget = g_object_new (e_search_bar_get_type (), NULL); e_search_bar_construct (E_SEARCH_BAR (widget), menu_items, option_items); diff --git a/widgets/misc/e-task-widget.c b/widgets/misc/e-task-widget.c index 2f591ab49f..d0f52f9191 100644 --- a/widgets/misc/e-task-widget.c +++ b/widgets/misc/e-task-widget.c @@ -167,8 +167,7 @@ e_task_widget_construct (ETaskWidget *task_widget, g_object_unref (mask); priv->tooltips = gtk_tooltips_new (); - g_object_ref (priv->tooltips); - gtk_object_sink (GTK_OBJECT (priv->tooltips)); + g_object_ref_sink (priv->tooltips); e_task_widget_update (task_widget, information, -1.0); } diff --git a/widgets/misc/e-url-entry.c b/widgets/misc/e-url-entry.c index 06820c0dd0..5f2eb6cd50 100644 --- a/widgets/misc/e-url-entry.c +++ b/widgets/misc/e-url-entry.c @@ -150,7 +150,7 @@ mnemonic_activate (GtkWidget *widget, gboolean group_cycling) GtkWidget * e_url_entry_new (void) { - return gtk_type_new (E_TYPE_URL_ENTRY); + return g_object_new (E_TYPE_URL_ENTRY, NULL); } diff --git a/widgets/misc/gal-combo-box.c b/widgets/misc/gal-combo-box.c index 49fddfb92f..ba010bc2d2 100644 --- a/widgets/misc/gal-combo-box.c +++ b/widgets/misc/gal-combo-box.c @@ -416,8 +416,7 @@ gal_combo_box_init (GalComboBox *combo_box) */ combo_box->priv->toplevel = gtk_window_new (GTK_WINDOW_POPUP); - gtk_widget_ref (combo_box->priv->toplevel); - gtk_object_sink (GTK_OBJECT (combo_box->priv->toplevel)); + g_object_ref_sink (combo_box->priv->toplevel); gtk_window_set_policy (GTK_WINDOW (combo_box->priv->toplevel), FALSE, TRUE, FALSE); @@ -509,8 +508,7 @@ gtk_combo_popup_tear_off (GalComboBox *combo, gboolean set_position) /* FIXME: made this a toplevel, not a dialog ! */ tearoff = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_ref (tearoff); - gtk_object_sink (GTK_OBJECT (tearoff)); + g_object_ref_sink (tearoff); combo->priv->tearoff_window = tearoff; gtk_widget_set_app_paintable (tearoff, TRUE); g_signal_connect (tearoff, "key_press_event", @@ -612,7 +610,7 @@ gtk_combo_tearoff_bg_copy (GalComboBox *combo) 0, 0, 0, 0, -1, -1); g_object_unref (gc); - gtk_widget_set_usize (combo->priv->tearoff_window, + gtk_widget_set_size_request (combo->priv->tearoff_window, widget->allocation.width, widget->allocation.height); @@ -637,11 +635,10 @@ gtk_combo_popup_reparent (GtkWidget *popup, GtkWidget *new_parent, gboolean unrealize) { - GtkObject *object = GTK_OBJECT (popup); - gboolean was_floating = GTK_OBJECT_FLOATING (object); + GObject *object = G_OBJECT (popup); + gboolean was_floating = g_object_is_floating (object); - g_object_ref (object); - gtk_object_sink (object); + g_object_ref_sink (object); if (unrealize) { g_object_ref (object); @@ -651,10 +648,10 @@ gtk_combo_popup_reparent (GtkWidget *popup, } else gtk_widget_reparent (GTK_WIDGET (popup), new_parent); - gtk_widget_set_usize (new_parent, -1, -1); + gtk_widget_set_size_request (new_parent, -1, -1); if (was_floating) - GTK_OBJECT_SET_FLAGS (object, GTK_FLOATING); + g_object_force_floating (object); else g_object_unref (object); } diff --git a/widgets/misc/gal-combo-text.c b/widgets/misc/gal-combo-text.c index ccec4b748d..fe75a7a353 100644 --- a/widgets/misc/gal-combo-text.c +++ b/widgets/misc/gal-combo-text.c @@ -392,7 +392,7 @@ gal_combo_text_construct (GalComboText *ct, gboolean const is_scrolled) GTK_CONTAINER (list), gtk_scrolled_window_get_vadjustment ( GTK_SCROLLED_WINDOW (scroll))); - gtk_widget_set_usize (scroll, 0, 200); /* MAGIC NUMBER */ + gtk_widget_set_size_request (scroll, 0, 200); /* MAGIC NUMBER */ } else display_widget = list; diff --git a/widgets/misc/test-calendar.c b/widgets/misc/test-calendar.c index 2b017ae6fe..4d341e25a4 100644 --- a/widgets/misc/test-calendar.c +++ b/widgets/misc/test-calendar.c @@ -67,7 +67,9 @@ main (int argc, char **argv) GtkWidget *vbox; ECalendarItem *calitem; - gnome_init ("test-calendar", "0.0", argc, argv); + gnome_program_init ( + "test-calendar", "0.0", LIBGNOMEUI_MODULE, + argc, argv, GNOME_PARAM_NONE); app = gnome_app_new ("Test", "Test"); gtk_window_set_default_size (GTK_WINDOW (app), 400, 400); diff --git a/widgets/misc/test-dropdown-button.c b/widgets/misc/test-dropdown-button.c index 349176d05c..ab258c0c27 100644 --- a/widgets/misc/test-dropdown-button.c +++ b/widgets/misc/test-dropdown-button.c @@ -52,25 +52,25 @@ item_activated (GtkWidget *widget, static GnomeUIInfo ui_info[] = { { GNOME_APP_UI_ITEM, "_New", "Create a new file", item_activated, "file/new", NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_NEW, 'n', GDK_CONTROL_MASK, NULL }, + GNOME_APP_PIXMAP_STOCK, GTK_STOCK_NEW, 'n', GDK_CONTROL_MASK, NULL }, { GNOME_APP_UI_ITEM, "_Open...", "Open an existing file", item_activated, "file/open", NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN, 'o', GDK_CONTROL_MASK, NULL }, + GNOME_APP_PIXMAP_STOCK, GTK_STOCK_OPEN, 'o', GDK_CONTROL_MASK, NULL }, { GNOME_APP_UI_ITEM, "_Save", "Save the current file", item_activated, "file/save", NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE, 's', GDK_CONTROL_MASK, NULL }, + GNOME_APP_PIXMAP_STOCK, GTK_STOCK_SAVE, 's', GDK_CONTROL_MASK, NULL }, { GNOME_APP_UI_ITEM, "Save _as...", "Save the current file with a new name", item_activated, "file/save as", NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE_AS, 0, 0, NULL }, + GNOME_APP_PIXMAP_STOCK, GTK_STOCK_SAVE_AS, 0, 0, NULL }, GNOMEUIINFO_SEPARATOR, { GNOME_APP_UI_ITEM, "_Print...", "Print the current file", item_activated, "file/print", NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_PRINT, 'p', GDK_CONTROL_MASK, NULL }, + GNOME_APP_PIXMAP_STOCK, GTK_STOCK_PRINT, 'p', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_SEPARATOR, { GNOME_APP_UI_ITEM, "_Close", "Close the current file", item_activated, "file/close", NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CLOSE, 0, 0, NULL }, + GNOME_APP_PIXMAP_STOCK, GTK_STOCK_CLOSE, 0, 0, NULL }, { GNOME_APP_UI_ITEM, "E_xit", "Exit the program", item_activated, "file/exit", NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXIT, 'q', GDK_CONTROL_MASK, NULL }, + GNOME_APP_PIXMAP_STOCK, GTK_STOCK_QUIT, 'q', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_END }; @@ -82,7 +82,9 @@ main (int argc, char **argv) GtkWidget *menu; GtkWidget *dropdown_button; - gnome_init ("test-dropdown-button", "0.0", argc, argv); + gnome_program_init ( + "test-dropdown-button", "0.0", LIBGNOMEUI_MODULE, + argc, argv, GNOME_PARAM_NONE); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 1, 1); diff --git a/widgets/misc/test-info-label.c b/widgets/misc/test-info-label.c index e4b053d81d..eb71e199a8 100644 --- a/widgets/misc/test-info-label.c +++ b/widgets/misc/test-info-label.c @@ -51,7 +51,9 @@ main (int argc, char **argv) GtkWidget *label; GtkWidget *vbox; - gnome_init ("test-title-bar", "0.0", argc, argv); + gnome_program_init ( + "test-title-bar", "0.0", LIBGNOMEUI_MODULE, + argc, argv, GNOME_PARAM_NONE); e_icon_factory_init (); app = gnome_app_new ("Test", "Test"); diff --git a/widgets/misc/test-multi-config-dialog.c b/widgets/misc/test-multi-config-dialog.c index 1a56af9a30..5d72087803 100644 --- a/widgets/misc/test-multi-config-dialog.c +++ b/widgets/misc/test-multi-config-dialog.c @@ -76,7 +76,9 @@ main (int argc, char **argv) { GtkWidget *dialog; - gnome_init ("test-multi-config-dialog", "0.0", argc, argv); + gnome_program_init ( + "test-multi-config-dialog", "0.0", LIBGNOMEUI_MODULE, + argc, argv, GNOME_PARAM_NONE); dialog = e_multi_config_dialog_new (); diff --git a/widgets/table/ChangeLog b/widgets/table/ChangeLog index ee46792ce3..43d102a326 100644 --- a/widgets/table/ChangeLog +++ b/widgets/table/ChangeLog @@ -1,3 +1,53 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * e-table-size-test.c (create_table): + * test-table.c (main): + * e-cell-combo.c (e_cell_combo_show_popup): + * e-table-example-1.c (create_table): + * e-tree.c (header_canvas_size_allocate), (e_tree_setup_header): + * e-cell-text.c (ect_show_tooltip): + * e-table-example-2.c (create_table): + * e-table.c (header_canvas_size_allocate): + Use gtk_widget_set_size_request() or g_object_set() instead of + gtk_widget_set_usize(). + + * e-cell-tree.c (e_cell_tree_construct): + * e-table-header-item.c (ethi_header_context_menu), (ethi_event): + * e-table-extras.c (e_table_extras_add_cell): + Use g_object_ref_sink() instead of gtk_object_sink(). + + * e-cell-date.c (ecd_get_text): + e_strdup_strip() is dead; just do it manually. + + * e-table-header-item.c (ethi_header_context_menu): + Use gtk_radio_menu_item_get_group() instead of + gtk_radio_menu_item_group(). + + * e-table-search.c (e_table_search_class_init): + * e-table-sort-info.c (e_table_sort_info_class_init): + * e-tree-model.c (e_tree_model_class_init): + * e-tree-memory.c (e_tree_memory_class_init): + * e-table-header.c (e_table_header_class_init): + * e-table-model.c (e_table_model_class_init): + * e-table-config.c (config_class_init): + * e-tree-sorted.c (e_tree_sorted_class_init): + Use G_TYPE_FROM_CLASS() instead of E_OBJECT_CLASS_TYPE(). + + * e-table-item.c (eti_dispose), (eti_unrealize), (eti_event): + Use g_source_remove() instead of gtk_timeout_remove(). + + * e-table-item.c (eti_event): + Use g_timeout_add() instead of gtk_timeout_add(). + + * e-tree.c (et_dispose): + e_free_string_list() is dead; just do it manually. + + * e-tree-memory.c (e_tree_memory_sort_node): + * e-table-sorting-utils.c (e_table_sorting_utils_sort): + Use g_qsort_with_data() instead of e_sort(). + 2007-03-29 Matthew Barnes <mbarnes@redhat.com> * e-table-header-utils.c: diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index 629a3588ed..e7fc235a05 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -365,7 +365,7 @@ e_cell_combo_show_popup (ECellCombo *ecc, int row, int view_col) } gtk_widget_set_uposition (ecc->popup_window, x, y); - gtk_widget_set_usize (ecc->popup_window, width, height); + gtk_widget_set_size_request (ecc->popup_window, width, height); gtk_widget_realize (ecc->popup_window); gdk_window_resize (ecc->popup_window->window, width, height); gtk_widget_show (ecc->popup_window); diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c index d2319ee61e..85f2324ad4 100644 --- a/widgets/table/e-cell-date.c +++ b/widgets/table/e-cell-date.c @@ -108,8 +108,7 @@ ecd_get_text(ECellText *cell, ETableModel *model, int col, int row) while ((temp = strstr (temp, " "))) { memmove (temp, temp + 1, strlen (temp)); } - temp = e_strdup_strip (buf); - return temp; + return g_strstrip (g_strdup (buf)); } static void diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 25a00085f8..47088029a6 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -1623,8 +1623,8 @@ ect_show_tooltip (ECellView *ecell_view, "x2", (double) tooltip_width + 6, "y2", (double) tooltip->row_height + 1, NULL); - gtk_widget_set_usize (window, tooltip_width + 6, - tooltip->row_height + 1); + gtk_widget_set_size_request (window, tooltip_width + 6, + tooltip->row_height + 1); gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas), 0.0, 0.0, (double) tooltip_width + 6, (double) tooltip_height); diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c index fc7f835fd1..8853a7a132 100644 --- a/widgets/table/e-cell-tree.c +++ b/widgets/table/e-cell-tree.c @@ -873,10 +873,8 @@ e_cell_tree_construct (ECellTree *ect, ECell *subcell) { ect->subcell = subcell; - if (subcell) { - g_object_ref (subcell); - gtk_object_sink (GTK_OBJECT (subcell)); - } + if (subcell) + g_object_ref_sink (subcell); if (open_pixbuf) ect->open_pixbuf = open_pixbuf; else diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index f32f09cd21..7af4a8fb00 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -33,7 +33,6 @@ #include <string.h> #include <gtk/gtk.h> -#include <libgnomeui/gnome-propertybox.h> #include <glade/glade.h> #include <glib/gi18n.h> @@ -138,7 +137,7 @@ config_class_init (GObjectClass *object_class) e_table_config_signals [CHANGED] = g_signal_new ("changed", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableConfigClass, changed), (GSignalAccumulator) NULL, NULL, diff --git a/widgets/table/e-table-example-1.c b/widgets/table/e-table-example-1.c index 37ac85770f..bbfc070d62 100644 --- a/widgets/table/e-table-example-1.c +++ b/widgets/table/e-table-example-1.c @@ -281,7 +281,7 @@ create_table (void) gtk_container_add (GTK_CONTAINER (window), frame); /* Size the initial window. */ - gtk_widget_set_usize (window, 200, 200); + gtk_widget_set_size_request (window, 200, 200); /* Show it all. */ gtk_widget_show_all (window); diff --git a/widgets/table/e-table-example-2.c b/widgets/table/e-table-example-2.c index a442ee2546..a91087c82a 100644 --- a/widgets/table/e-table-example-2.c +++ b/widgets/table/e-table-example-2.c @@ -327,7 +327,7 @@ create_table () gtk_container_add (GTK_CONTAINER (window), frame); /* Size the initial window. */ - gtk_widget_set_usize (window, 200, 200); + gtk_widget_set_size_request (window, 200, 200); /* Show it all. */ gtk_widget_show_all (window); } diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c index 5b13c4e5f4..93013bbd78 100644 --- a/widgets/table/e-table-extras.c +++ b/widgets/table/e-table-extras.c @@ -209,10 +209,8 @@ e_table_extras_add_cell (ETableExtras *extras, g_object_unref (old_cell); } - if (cell) { - g_object_ref (cell); - gtk_object_sink (GTK_OBJECT (cell)); - } + if (cell) + g_object_ref_sink (cell); g_hash_table_insert (extras->cells, g_strdup(id), cell); } diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 596fbbcb73..7dff0b5469 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -1552,7 +1552,7 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) /* Custom */ menu_item = gtk_radio_menu_item_new_with_label (group, _("Custom")); - group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menu_item)); + group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item)); gtk_widget_show (menu_item); gtk_menu_shell_prepend (GTK_MENU_SHELL (sub_menu), menu_item); if (sort_col == -1) @@ -1587,8 +1587,7 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) g_signal_connect (menu_item, "activate", G_CALLBACK (sort_by_id), ethi); } - g_object_ref (popup); - gtk_object_sink (GTK_OBJECT (popup)); + g_object_ref_sink (popup); g_signal_connect (popup, "selection-done", G_CALLBACK (free_popup_info), info); e_popup_menu (popup, (GdkEvent *) event); @@ -1814,8 +1813,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) ((e_table_header_count (ethi->eth) > 1) ? 0 : 8), ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) + 128, info, GETTEXT_PACKAGE); - g_object_ref (popup); - gtk_object_sink (GTK_OBJECT (popup)); + g_object_ref_sink (popup); g_signal_connect (popup, "selection-done", G_CALLBACK (free_popup_info), info); e_popup_menu (popup, NULL); diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index 2acfb1c446..5e7d28300b 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -277,7 +277,7 @@ e_table_header_class_init (GObjectClass *object_class) eth_signals [STRUCTURE_CHANGE] = g_signal_new ("structure_change", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableHeaderClass, structure_change), (GSignalAccumulator) NULL, NULL, @@ -285,7 +285,7 @@ e_table_header_class_init (GObjectClass *object_class) G_TYPE_NONE, 0); eth_signals [DIMENSION_CHANGE] = g_signal_new ("dimension_change", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableHeaderClass, dimension_change), (GSignalAccumulator) NULL, NULL, @@ -293,7 +293,7 @@ e_table_header_class_init (GObjectClass *object_class) G_TYPE_NONE, 1, G_TYPE_INT); eth_signals [EXPANSION_CHANGE] = g_signal_new ("expansion_change", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableHeaderClass, expansion_change), (GSignalAccumulator) NULL, NULL, @@ -301,7 +301,7 @@ e_table_header_class_init (GObjectClass *object_class) G_TYPE_NONE, 0); eth_signals [REQUEST_WIDTH] = g_signal_new ("request_width", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableHeaderClass, request_width), (GSignalAccumulator) NULL, NULL, diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index 72a3decfca..c4b5ea17d0 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -1446,7 +1446,7 @@ eti_dispose (GObject *object) eti->tooltip->foreground = NULL; if (eti->tooltip->timer) { - gtk_timeout_remove (eti->tooltip->timer); + g_source_remove (eti->tooltip->timer); eti->tooltip->timer = 0; } g_free (eti->tooltip); @@ -1782,7 +1782,7 @@ eti_unrealize (GnomeCanvasItem *item) eti->tooltip->foreground = NULL; } if (eti->tooltip->timer) { - gtk_timeout_remove (eti->tooltip->timer); + g_source_remove (eti->tooltip->timer); eti->tooltip->timer = 0; } } @@ -2288,7 +2288,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) d(g_print("%s: GDK_BUTTON_PRESS received, button %d\n", __FUNCTION__, e->button.button)); if (eti->tooltip->timer) { - gtk_timeout_remove (eti->tooltip->timer); + g_source_remove (eti->tooltip->timer); eti->tooltip->timer = 0; } @@ -2429,7 +2429,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } if (eti->tooltip->timer) { - gtk_timeout_remove (eti->tooltip->timer); + g_source_remove (eti->tooltip->timer); eti->tooltip->timer = 0; } e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(eti)->canvas)); @@ -2597,12 +2597,12 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) #ifdef DO_TOOLTIPS if (!g_getenv ("GAL_DONT_DO_TOOLTIPS")) { if (eti->tooltip->timer) - gtk_timeout_remove (eti->tooltip->timer); + g_source_remove (eti->tooltip->timer); eti->tooltip->col = col; eti->tooltip->row = row; eti->tooltip->cx = e->motion.x; eti->tooltip->cy = e->motion.y; - eti->tooltip->timer = gtk_timeout_add (100, (GSourceFunc)_do_tooltip, eti); + eti->tooltip->timer = g_timeout_add (100, (GSourceFunc)_do_tooltip, eti); } #endif @@ -2636,7 +2636,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) NULL); if (eti->tooltip->timer) { - gtk_timeout_remove (eti->tooltip->timer); + g_source_remove (eti->tooltip->timer); eti->tooltip->timer = 0; } e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(eti)->canvas)); @@ -2850,7 +2850,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) case GDK_ENTER_NOTIFY: d(g_print("%s: %s received\n", __FUNCTION__, leave ? "GDK_LEAVE_NOTIFY" : "GDK_ENTER_NOTIFY")); if (eti->tooltip->timer) - gtk_timeout_remove (eti->tooltip->timer); + g_source_remove (eti->tooltip->timer); eti->tooltip->timer = 0; if (eti->motion_row != -1 && eti->motion_col != -1) return_val = eti_e_cell_event (eti, eti->cell_views [eti->motion_col], diff --git a/widgets/table/e-table-model.c b/widgets/table/e-table-model.c index f600c0832d..cef8846049 100644 --- a/widgets/table/e-table-model.c +++ b/widgets/table/e-table-model.c @@ -284,7 +284,7 @@ e_table_model_class_init (GObjectClass *object_class) e_table_model_signals [MODEL_NO_CHANGE] = g_signal_new ("model_no_change", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableModelClass, model_no_change), (GSignalAccumulator) NULL, NULL, @@ -294,7 +294,7 @@ e_table_model_class_init (GObjectClass *object_class) e_table_model_signals [MODEL_CHANGED] = g_signal_new ("model_changed", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableModelClass, model_changed), (GSignalAccumulator) NULL, NULL, @@ -303,7 +303,7 @@ e_table_model_class_init (GObjectClass *object_class) e_table_model_signals [MODEL_PRE_CHANGE] = g_signal_new ("model_pre_change", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableModelClass, model_pre_change), (GSignalAccumulator) NULL, NULL, @@ -312,7 +312,7 @@ e_table_model_class_init (GObjectClass *object_class) e_table_model_signals [MODEL_ROW_CHANGED] = g_signal_new ("model_row_changed", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableModelClass, model_row_changed), (GSignalAccumulator) NULL, NULL, @@ -321,7 +321,7 @@ e_table_model_class_init (GObjectClass *object_class) e_table_model_signals [MODEL_CELL_CHANGED] = g_signal_new ("model_cell_changed", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableModelClass, model_cell_changed), (GSignalAccumulator) NULL, NULL, @@ -330,7 +330,7 @@ e_table_model_class_init (GObjectClass *object_class) e_table_model_signals [MODEL_ROWS_INSERTED] = g_signal_new ("model_rows_inserted", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableModelClass, model_rows_inserted), (GSignalAccumulator) NULL, NULL, @@ -339,7 +339,7 @@ e_table_model_class_init (GObjectClass *object_class) e_table_model_signals [MODEL_ROWS_DELETED] = g_signal_new ("model_rows_deleted", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableModelClass, model_rows_deleted), (GSignalAccumulator) NULL, NULL, diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c index 898b179d16..0f014c1a76 100644 --- a/widgets/table/e-table-search.c +++ b/widgets/table/e-table-search.c @@ -127,7 +127,7 @@ e_table_search_class_init (GObjectClass *object_class) e_table_search_signals [SEARCH_SEARCH] = g_signal_new ("search", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableSearchClass, search), (GSignalAccumulator) NULL, NULL, @@ -136,7 +136,7 @@ e_table_search_class_init (GObjectClass *object_class) e_table_search_signals [SEARCH_ACCEPT] = g_signal_new ("accept", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableSearchClass, accept), (GSignalAccumulator) NULL, NULL, diff --git a/widgets/table/e-table-size-test.c b/widgets/table/e-table-size-test.c index 07810d4893..308ad484b9 100644 --- a/widgets/table/e-table-size-test.c +++ b/widgets/table/e-table-size-test.c @@ -281,7 +281,7 @@ create_table (void) gtk_container_add (GTK_CONTAINER (window), frame); /* Size the initial window. */ - gtk_widget_set_usize (window, 300, 200); + gtk_widget_set_size_request (window, 300, 200); /* Show it all. */ gtk_widget_show_all (window); diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c index 5bbf443b76..cfc5f05e1c 100644 --- a/widgets/table/e-table-sort-info.c +++ b/widgets/table/e-table-sort-info.c @@ -82,7 +82,7 @@ e_table_sort_info_class_init (ETableSortInfoClass *klass) e_table_sort_info_signals [SORT_INFO_CHANGED] = g_signal_new ("sort_info_changed", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableSortInfoClass, sort_info_changed), (GSignalAccumulator) NULL, NULL, @@ -91,7 +91,7 @@ e_table_sort_info_class_init (ETableSortInfoClass *klass) e_table_sort_info_signals [GROUP_INFO_CHANGED] = g_signal_new ("group_info_changed", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableSortInfoClass, group_info_changed), (GSignalAccumulator) NULL, NULL, diff --git a/widgets/table/e-table-sorting-utils.c b/widgets/table/e-table-sorting-utils.c index 7ac671fd84..7b3f078654 100644 --- a/widgets/table/e-table-sorting-utils.c +++ b/widgets/table/e-table-sorting-utils.c @@ -142,7 +142,8 @@ e_table_sorting_utils_sort(ETableModel *source, ETableSortInfo *sort_info, ETabl closure.ascending[j] = column.ascending; } - e_sort(map_table, rows, sizeof(int), e_sort_callback, &closure); + g_qsort_with_data ( + map_table, rows, sizeof(int), e_sort_callback, &closure); g_free(closure.vals); g_free(closure.ascending); @@ -295,7 +296,8 @@ e_table_sorting_utils_tree_sort(ETreeModel *source, ETableSortInfo *sort_info, E map[i] = i; } - e_sort(map, count, sizeof(int), e_sort_callback, &closure); + g_qsort_with_data ( + map, count, sizeof(int), e_sort_callback, &closure); map_copy = g_new(ETreePath, count); for (i = 0; i < count; i++) { diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index b42d860779..4a3e8efccc 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -621,8 +621,10 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_ header is correct */ if (GTK_WIDGET (e_table->header_canvas)->allocation.height != E_TABLE_HEADER_ITEM (e_table->header_item)->height) - gtk_widget_set_usize (GTK_WIDGET (e_table->header_canvas), -2, - E_TABLE_HEADER_ITEM (e_table->header_item)->height); + g_object_set ( + e_table->header_canvas, "height-request", + E_TABLE_HEADER_ITEM (e_table->header_item)->height, + NULL); } static void @@ -674,8 +676,9 @@ e_table_setup_header (ETable *e_table) G_OBJECT (e_table->header_canvas), "size_allocate", G_CALLBACK (header_canvas_size_allocate), e_table); - gtk_widget_set_usize (GTK_WIDGET (e_table->header_canvas), -2, - E_TABLE_HEADER_ITEM (e_table->header_item)->height); + g_object_set ( + e_table->header_canvas, "height-request", + E_TABLE_HEADER_ITEM (e_table->header_item)->height, NULL); } static gboolean diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c index 7de48802fd..b24aef5e72 100644 --- a/widgets/table/e-tree-memory.c +++ b/widgets/table/e-tree-memory.c @@ -357,7 +357,7 @@ e_tree_memory_class_init (ETreeMemoryClass *klass) signals [FILL_IN_CHILDREN] = g_signal_new ("fill_in_children", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeMemoryClass, fill_in_children), (GSignalAccumulator) NULL, NULL, @@ -679,7 +679,9 @@ e_tree_memory_sort_node (ETreeMemory *etmm, mac.closure = user_data; mac.callback = callback; - e_sort (children, count, sizeof (ETreeMemoryPath *), sort_callback, &mac); + g_qsort_with_data ( + children, count, sizeof (ETreeMemoryPath *), + sort_callback, &mac); path->first_child = NULL; last = NULL; diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c index af88c0e3cb..976d3f85b9 100644 --- a/widgets/table/e-tree-model.c +++ b/widgets/table/e-tree-model.c @@ -69,7 +69,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [PRE_CHANGE] = g_signal_new ("pre_change", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, pre_change), (GSignalAccumulator) NULL, NULL, @@ -78,7 +78,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NO_CHANGE] = g_signal_new ("no_change", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, no_change), (GSignalAccumulator) NULL, NULL, @@ -87,7 +87,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NODE_CHANGED] = g_signal_new ("node_changed", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, node_changed), (GSignalAccumulator) NULL, NULL, @@ -96,7 +96,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NODE_DATA_CHANGED] = g_signal_new ("node_data_changed", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, node_data_changed), (GSignalAccumulator) NULL, NULL, @@ -105,7 +105,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NODE_COL_CHANGED] = g_signal_new ("node_col_changed", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, node_col_changed), (GSignalAccumulator) NULL, NULL, @@ -114,7 +114,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NODE_INSERTED] = g_signal_new ("node_inserted", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, node_inserted), (GSignalAccumulator) NULL, NULL, @@ -123,7 +123,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NODE_REMOVED] = g_signal_new ("node_removed", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, node_removed), (GSignalAccumulator) NULL, NULL, @@ -132,7 +132,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NODE_DELETED] = g_signal_new ("node_deleted", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, node_deleted), (GSignalAccumulator) NULL, NULL, @@ -141,7 +141,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NODE_REQUEST_COLLAPSE] = g_signal_new ("node_request_collapse", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, node_request_collapse), (GSignalAccumulator) NULL, NULL, diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c index b5c67dc906..39e3a1cdfb 100644 --- a/widgets/table/e-tree-sorted.c +++ b/widgets/table/e-tree-sorted.c @@ -1196,7 +1196,7 @@ e_tree_sorted_class_init (ETreeSortedClass *klass) signals [NODE_RESORTED] = g_signal_new ("node_resorted", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeSortedClass, node_resorted), (GSignalAccumulator) NULL, NULL, diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index f6679e59b3..6445cd14e8 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -387,7 +387,10 @@ et_dispose (GObject *object) scroll_off (et); hover_off (et); - e_free_string_list (et->priv->expanded_list); + g_list_foreach ( + et->priv->expanded_list, + (GFunc) g_free, NULL); + g_list_free (et->priv->expanded_list); et_disconnect_from_etta (et); @@ -674,7 +677,7 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *e_t header is correct */ if (GTK_WIDGET (e_tree->priv->header_canvas)->allocation.height != E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height) - gtk_widget_set_usize (GTK_WIDGET (e_tree->priv->header_canvas), -1, + gtk_widget_set_size_request (GTK_WIDGET (e_tree->priv->header_canvas), -1, E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height); } @@ -705,8 +708,9 @@ e_tree_setup_header (ETree *e_tree) e_tree->priv->header_canvas, "size_allocate", G_CALLBACK (header_canvas_size_allocate), e_tree); - gtk_widget_set_usize (GTK_WIDGET (e_tree->priv->header_canvas), -1, - E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height); + gtk_widget_set_size_request ( + GTK_WIDGET (e_tree->priv->header_canvas), -1, + E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height); } static gboolean diff --git a/widgets/table/test-table.c b/widgets/table/test-table.c index a33ecc3c15..3eb42e42a7 100644 --- a/widgets/table/test-table.c +++ b/widgets/table/test-table.c @@ -446,7 +446,7 @@ compare=\"string\"/>\n", i, column_labels[i]); gtk_box_pack_start (GTK_BOX (vbox), bhide, FALSE, FALSE, 0); #endif - gtk_widget_set_usize (window, 400, 200); + gtk_widget_set_size_request (window, 400, 200); gtk_widget_show_all (window); #ifdef BIT_ROT diff --git a/widgets/text/e-completion-callbacks.c b/widgets/text/e-completion-callbacks.c index b819513141..229a28d760 100644 --- a/widgets/text/e-completion-callbacks.c +++ b/widgets/text/e-completion-callbacks.c @@ -92,7 +92,7 @@ e_completion_callbacks_new (ECompletionCallbacksRequestCompletionFn request_comp g_return_val_if_fail (request_completion != NULL, NULL); g_return_val_if_fail (end_completion != NULL, NULL); - cc = gtk_type_new (E_COMPLETION_CALLBACKS_TYPE); + cc = g_object_new (E_COMPLETION_CALLBACKS_TYPE, NULL); cc->request_completion = request_completion; cc->end_completion = end_completion; diff --git a/widgets/text/e-completion-view.c b/widgets/text/e-completion-view.c index 57d02bb865..0837160d6f 100644 --- a/widgets/text/e-completion-view.c +++ b/widgets/text/e-completion-view.c @@ -810,7 +810,7 @@ e_completion_view_set_width (ECompletionView *cv, gint width) w = GTK_WIDGET (cv); if (! GTK_WIDGET_REALIZED (w)) { - gtk_widget_set_usize (w, width, -1); + gtk_widget_set_size_request (w, width, -1); return; } @@ -841,7 +841,7 @@ e_completion_view_set_width (ECompletionView *cv, gint width) /* We reduce the total height by a bit; in practice, this seems to work out well. */ final_height = (gint) floor (line_height * (0.5 + (float)lines) * 0.97); - gtk_widget_set_usize (w, width, final_height); + gtk_widget_set_size_request (w, width, final_height); } void diff --git a/widgets/text/e-entry.c b/widgets/text/e-entry.c index d5f7cb4fe9..979048671f 100644 --- a/widgets/text/e-entry.c +++ b/widgets/text/e-entry.c @@ -243,7 +243,7 @@ static void e_entry_text_keypress (EText *text, guint keyval, guint state, EEntry *entry) { if (entry->priv->changed_since_keypress_tag) { - gtk_timeout_remove (entry->priv->changed_since_keypress_tag); + g_source_remove (entry->priv->changed_since_keypress_tag); entry->priv->changed_since_keypress_tag = 0; } @@ -276,9 +276,9 @@ static void proxy_changed (EText *text, EEntry *entry) { if (entry->priv->changed_since_keypress_tag) - gtk_timeout_remove (entry->priv->changed_since_keypress_tag); + g_source_remove (entry->priv->changed_since_keypress_tag); entry->priv->changed_since_keypress = TRUE; - entry->priv->changed_since_keypress_tag = gtk_timeout_add (20, changed_since_keypress_timeout_fn, entry); + entry->priv->changed_since_keypress_tag = g_timeout_add (20, changed_since_keypress_timeout_fn, entry); g_signal_emit (entry, e_entry_signals [E_ENTRY_CHANGED], 0); } @@ -599,7 +599,7 @@ e_entry_start_delayed_completion (EEntry *entry, gint delay) return; e_entry_cancel_delayed_completion (entry); - entry->priv->completion_delay_tag = gtk_timeout_add (MAX (delay, 1), start_delayed_cb, entry); + entry->priv->completion_delay_tag = g_timeout_add (MAX (delay, 1), start_delayed_cb, entry); } static void @@ -609,7 +609,7 @@ e_entry_cancel_delayed_completion (EEntry *entry) return; if (entry->priv->completion_delay_tag) { - gtk_timeout_remove (entry->priv->completion_delay_tag); + g_source_remove (entry->priv->completion_delay_tag); entry->priv->completion_delay_tag = 0; } } @@ -778,8 +778,7 @@ e_entry_enable_completion_full (EEntry *entry, ECompletion *completion, gint del g_return_if_fail (entry->priv->completion == NULL); entry->priv->completion = completion; - g_object_ref (completion); - gtk_object_sink (GTK_OBJECT (completion)); + g_object_ref_sink (completion); entry->priv->completion_delay = delay; entry->priv->handler = handler; @@ -840,8 +839,7 @@ e_entry_enable_completion_full (EEntry *entry, ECompletion *completion, gint del e_completion_view_connect_keys (E_COMPLETION_VIEW (entry->priv->completion_view), GTK_WIDGET (entry->canvas)); - g_object_ref (entry->priv->completion_view_popup); - gtk_object_sink (GTK_OBJECT (entry->priv->completion_view_popup)); + g_object_ref_sink (entry->priv->completion_view_popup); gtk_window_set_policy (GTK_WINDOW (entry->priv->completion_view_popup), TRUE, TRUE, TRUE); gtk_container_add (GTK_CONTAINER (entry->priv->completion_view_popup), entry->priv->completion_view); gtk_widget_show (entry->priv->completion_view); @@ -1106,7 +1104,7 @@ e_entry_dispose (GObject *object) if (entry->priv) { if (entry->priv->completion_delay_tag) - gtk_timeout_remove (entry->priv->completion_delay_tag); + g_source_remove (entry->priv->completion_delay_tag); if (entry->priv->completion) g_object_unref (entry->priv->completion); @@ -1123,7 +1121,7 @@ e_entry_dispose (GObject *object) g_free (entry->priv->pre_browse_text); if (entry->priv->changed_since_keypress_tag) - gtk_timeout_remove (entry->priv->changed_since_keypress_tag); + g_source_remove (entry->priv->changed_since_keypress_tag); g_free (entry->priv); entry->priv = NULL; @@ -1201,7 +1199,7 @@ e_entry_class_init (GObjectClass *object_class) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (EEntryClass, completion_popup), NULL, NULL, - gtk_marshal_NONE__INT, + g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); g_object_class_install_property (object_class, PROP_MODEL, diff --git a/widgets/text/e-text-model-uri.c b/widgets/text/e-text-model-uri.c index 6736b41cde..95ce7cc076 100644 --- a/widgets/text/e-text-model-uri.c +++ b/widgets/text/e-text-model-uri.c @@ -96,7 +96,7 @@ e_text_model_uri_dispose (GObject *object) GList *iter; if (model_uri->objectify_idle) { - gtk_idle_remove (model_uri->objectify_idle); + g_source_remove (model_uri->objectify_idle); model_uri->objectify_idle = 0; } @@ -252,7 +252,7 @@ e_text_model_uri_objectify (ETextModel *model) ETextModelURI *model_uri = E_TEXT_MODEL_URI (model); if (model_uri->objectify_idle == 0) - model_uri->objectify_idle = gtk_idle_add (objectify_idle_cb, model); + model_uri->objectify_idle = g_idle_add (objectify_idle_cb, model); if (E_TEXT_MODEL_CLASS(parent_class)->objectify) E_TEXT_MODEL_CLASS(parent_class)->objectify (model); @@ -262,7 +262,7 @@ static void objectify_idle_flush (ETextModelURI *model_uri) { if (model_uri->objectify_idle) { - gtk_idle_remove (model_uri->objectify_idle); + g_source_remove (model_uri->objectify_idle); model_uri->objectify_idle = 0; objectify_uris (model_uri); } diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 0ae2d2203d..be81a88232 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -244,17 +244,17 @@ e_text_dispose (GObject *object) } if ( text->tooltip_timeout ) { - gtk_timeout_remove (text->tooltip_timeout); + g_source_remove (text->tooltip_timeout); text->tooltip_timeout = 0; } if ( text->dbl_timeout ) { - gtk_timeout_remove (text->dbl_timeout); + g_source_remove (text->dbl_timeout); text->dbl_timeout = 0; } if ( text->tpl_timeout ) { - gtk_timeout_remove (text->tpl_timeout); + g_source_remove (text->tpl_timeout); text->tpl_timeout = 0; } @@ -2093,9 +2093,9 @@ _do_tooltip (gpointer data) gtk_widget_show (canvas); gtk_widget_realize (tooltip_window); - gtk_widget_set_usize (tooltip_window, - tooltip_width + 4 + (text->draw_borders ? BORDER_INDENT * 2 : 0), - tooltip_height + 4 + (text->draw_borders ? BORDER_INDENT * 2 : 0)); + gtk_widget_set_size_request (tooltip_window, + tooltip_width + 4 + (text->draw_borders ? BORDER_INDENT * 2 : 0), + tooltip_height + 4 + (text->draw_borders ? BORDER_INDENT * 2 : 0)); gnome_canvas_set_scroll_region (GNOME_CANVAS(canvas), 0.0, 0.0, tooltip_width + (text->draw_borders ? BORDER_INDENT * 2 : 0), (double)tooltip_height + (text->draw_borders ? BORDER_INDENT * 2 : 0)); @@ -2295,7 +2295,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) text->tooltip_count --; if ( text->tooltip_count == 0 && text->clip) { if ( text->tooltip_timeout ) { - gtk_timeout_remove (text->tooltip_timeout); + g_source_remove (text->tooltip_timeout); text->tooltip_timeout = 0; } } @@ -2344,7 +2344,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) case GDK_BUTTON_PRESS: /* Fall Through */ case GDK_BUTTON_RELEASE: if (text->tooltip_timeout) { - gtk_timeout_remove (text->tooltip_timeout); + g_source_remove (text->tooltip_timeout); text->tooltip_timeout = 0; } e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(text)->canvas)); @@ -2394,13 +2394,13 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) if (event->type == GDK_BUTTON_PRESS) { if (text->dbl_timeout == 0 && text->tpl_timeout == 0) { - text->dbl_timeout = gtk_timeout_add (200, - _click, - &(text->dbl_timeout)); + text->dbl_timeout = g_timeout_add (200, + _click, + &(text->dbl_timeout)); } else { if (text->tpl_timeout == 0) { e_tep_event.type = GDK_2BUTTON_PRESS; - text->tpl_timeout = gtk_timeout_add (200, _click, &(text->tpl_timeout)); + text->tpl_timeout = g_timeout_add (200, _click, &(text->tpl_timeout)); } else { e_tep_event.type = GDK_3BUTTON_PRESS; } @@ -2445,7 +2445,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) { if ( text->tooltip_count == 0 && text->clip) { if (!text->tooltip_timeout) - text->tooltip_timeout = gtk_timeout_add (2000, _do_tooltip, text); + text->tooltip_timeout = g_timeout_add (2000, _do_tooltip, text); } text->tooltip_count ++; } @@ -2463,7 +2463,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) text->tooltip_count --; if ( text->tooltip_count == 0 && text->clip) { if ( text->tooltip_timeout ) { - gtk_timeout_remove (text->tooltip_timeout); + g_source_remove (text->tooltip_timeout); text->tooltip_timeout = 0; } } |