GNOME Bugzilla – Bug 572686
Remove deprecated GTK+ symbols
Last modified: 2009-09-26 14:56:56 UTC
http://live.gnome.org/GnomeGoals/RemoveDeprecatedSymbols/GTK%2B GTK_SIGNAL_FUNC, GtkClassInitFunc, GtkDestroyNotify, GtkObjectInitFunc, GtkType, GtkTypeInfo, gdk_cursor_destroy, gdk_input_add, gdk_input_remove, gdk_window_get_size, gtk_combo_new, gtk_combo_set_popdown_strings, gtk_entry_set_editable, gtk_file_selection_new, gtk_object_get_data, gtk_object_set_data, gtk_object_set_data_full, gtk_radio_button_group, gtk_signal_connect, gtk_toggle_button_set_state, gtk_tooltips_new, gtk_type_unique, gtk_widget_ref, gtk_widget_unref To potential patch contributors: It might make sense to break this into several smaller patches. :-P When patching also make sure that the gtk and glib versions in configure.in/.ac are high enough and take a look since which version the new non-deprecated functions are available. http://library.gnome.org is your friend here. :-) (Note: Some lines are listed twice because they contain two different deprecated symbols) $:andre\> grep -r GTK_SIGNAL_FUNC . ./gok/gok-page-accessmethod.c: GTK_SIGNAL_FUNC (gok_page_accessmethod_checkbox_changed),NULL); ./gok/main.c: GTK_SIGNAL_FUNC (on_window1_motion_notify_event), ./gok/main.c: GTK_SIGNAL_FUNC (on_window1_leave_notify_event), ./gok/main.c: GTK_SIGNAL_FUNC (on_window1_enter_notify_event), ./gok/main.c: GTK_SIGNAL_FUNC (on_window1_size_allocate), ./gok/main.c: GTK_SIGNAL_FUNC (on_window1_delete_event), ./gok/main.c: GTK_SIGNAL_FUNC (on_window1_configure_event), ./gok/main.c: GTK_SIGNAL_FUNC (on_gok_window_state_event), ./gok/gok-control.c: GTK_SIGNAL_FUNC (gok_control_button_handler), NULL); ./gok/gok-editor.c: GTK_SIGNAL_FUNC (on_editor_keyboard_delete_event), ./gok/gok-keyboard.c: GTK_SIGNAL_FUNC (on_window1_button_press_event), ./gok/gok-keyboard.c: GTK_SIGNAL_FUNC (on_window1_button_release_event), ./gok/gok-keyboard.c: GTK_SIGNAL_FUNC (on_window1_button_toggle_event), ./gok/gok-keyboard.c: GTK_SIGNAL_FUNC (gok_button_enter_notify), ./gok/gok-keyboard.c: GTK_SIGNAL_FUNC (gok_button_leave_notify), ./gok/gok-keyboard.c: GTK_SIGNAL_FUNC (gok_button_state_changed), ./gok/gok-keyboard.c: GTK_SIGNAL_FUNC (on_editor_button_press_event), $:andre\> grep -r GtkClassInitFunc . ./gok/gok-button.c: (GtkClassInitFunc) gok_button_class_init, ./gok/gok-button.c: (GtkClassInitFunc) NULL, $:andre\> grep -r GtkDestroyNotify . ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/main.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-actions.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-actions.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-editor.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-feedbacks.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-feedbacks.c: (GtkDestroyNotify) gtk_widget_unref); $:andre\> grep -r GtkObjectInitFunc . ./gok/gok-button.c: (GtkObjectInitFunc) gok_button_init, $:andre\> grep -r GtkType . ./gok/gok-button.c: GtkType ./gok/gok-button.c: static GtkType GokButtonType = 0; ./gok/gok-button.h: GtkType gok_button_get_type (void) G_GNUC_CONST; $:andre\> grep -r GtkTypeInfo . ./gok/gok-button.c: static const GtkTypeInfo GokButtonInfo = $:andre\> grep -r gdk_cursor_destroy . ./gok/callbacks.c: gdk_cursor_destroy (cursor); $:andre\> grep -r gdk_input_add . ./gok/switchapi.c: joydata->gdktag = gdk_input_add(joydata->joystickfd, GDK_INPUT_READ, joystick_event, joydata); $:andre\> grep -r gdk_input_remove . ./gok/switchapi.c: gdk_input_remove(joydata->gdktag); $:andre\> grep -r gdk_window_get_size . ./gok/main.c: gdk_window_get_size (m_pWindowMain->window, &winWidthCurrent, &winHeightCurrent); ./gok/main.c: gdk_window_get_size (widget->window, &w, &h); ./gok/gok-page-keysizespace.c: gdk_window_get_size (pWindowSettings->window, &width, NULL); ./gok/gok-keyboard.c: gdk_window_get_size ((GdkWindow*)pWindowMain->window, &widthMax, ./gok/gok-keyboard.c: gdk_window_get_size (pWindow->window, &widthWindow, &heightWindow); ./gok/gok-keyboard.c: gdk_window_get_size (pWindow->window, &widthWindow, &heightWindow); $:andre\> grep -r gtk_combo_new . ./gok/gok-page-accessmethod.c: pWidget = gtk_combo_new (); $:andre\> grep -r gtk_combo_set_popdown_strings . ./gok/gok-page-accessmethod.c: gtk_combo_set_popdown_strings (GTK_COMBO (pComboBox), items); ./gok/gok-page-accessmethod.c: gtk_combo_set_popdown_strings (GTK_COMBO (pGokFilledCombo->pCombo), items); ./gok/gok-page-actions.c: gtk_combo_set_popdown_strings (GTK_COMBO (pComboBox), items); ./gok/gok-page-actions.c: gtk_combo_set_popdown_strings (GTK_COMBO (pComboBox), items); ./gok/gok-page-feedbacks.c: gtk_combo_set_popdown_strings (GTK_COMBO (pComboBox), items); ./gok/gok-page-feedbacks.c: gtk_combo_set_popdown_strings (GTK_COMBO (pComboBox), items); ./gok/gok-page-feedbacks.c: gtk_combo_set_popdown_strings (GTK_COMBO (pCombo), items); $:andre\> grep -r gtk_entry_set_editable . ./gok/gok-page-accessmethod.c: gtk_entry_set_editable (GTK_ENTRY (pEntry), FALSE); $:andre\> grep -r gtk_file_selection_new . ./gok/gok-control.c: pFileSelectorDialog = gtk_file_selection_new (_("Select Sound File")); $:andre\> grep -r gtk_object_get_data . ./gok/gok-page-accessmethod.c: pRadioControl = (GokControl*)gtk_object_get_data (GTK_OBJECT(pRadioButton), "control"); $:andre\> grep -r gtk_object_set_data . ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKlabel", pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKhbox", pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKvbox", pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), pControlName, pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKseparator", pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKframe", pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), pControlName, pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKcheckbutton", pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKradiobutton", pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data(GTK_OBJECT (pWidget), "control", pControl); ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKspinbutton", pWidget, ./gok/main.c: gtk_object_set_data_full (GTK_OBJECT (window1), "fixed1", fixed1, ./gok/gok-page-actions.c: gtk_object_set_data_full (GTK_OBJECT (pDialogChangeName), "pLabel", pLabel, ./gok/gok-page-actions.c: gtk_object_set_data_full (GTK_OBJECT (pDialogChangeName), "Entry", pEntryNewName, ./gok/gok-editor.c: gtk_object_set_data (GTK_OBJECT (m_pWindowKeyboard), "m_pWindowKeyboard", m_pWindowKeyboard); ./gok/gok-editor.c: gtk_object_set_data_full (GTK_OBJECT (m_pWindowKeyboard), "fixed1", fixed1, ./gok/gok-page-feedbacks.c: gtk_object_set_data_full (GTK_OBJECT (pDialogChangeName), "pLabel", pLabel, ./gok/gok-page-feedbacks.c: gtk_object_set_data_full (GTK_OBJECT (pDialogChangeName), "Entry", pEntryNewName, ./gok/gok-keyboard.c: gtk_object_set_data (GTK_OBJECT(pNewButton), "key", pKey); $:andre\> grep -r gtk_object_set_data_full . ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKlabel", pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKhbox", pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKvbox", pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), pControlName, pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKseparator", pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKframe", pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), pControlName, pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKcheckbutton", pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKradiobutton", pWidget, ./gok/gok-page-accessmethod.c: gtk_object_set_data_full (GTK_OBJECT (gok_settingsdialog_get_window()), "GOKspinbutton", pWidget, ./gok/main.c: gtk_object_set_data_full (GTK_OBJECT (window1), "fixed1", fixed1, ./gok/gok-page-actions.c: gtk_object_set_data_full (GTK_OBJECT (pDialogChangeName), "pLabel", pLabel, ./gok/gok-page-actions.c: gtk_object_set_data_full (GTK_OBJECT (pDialogChangeName), "Entry", pEntryNewName, ./gok/gok-editor.c: gtk_object_set_data_full (GTK_OBJECT (m_pWindowKeyboard), "fixed1", fixed1, ./gok/gok-page-feedbacks.c: gtk_object_set_data_full (GTK_OBJECT (pDialogChangeName), "pLabel", pLabel, ./gok/gok-page-feedbacks.c: gtk_object_set_data_full (GTK_OBJECT (pDialogChangeName), "Entry", pEntryNewName, $:andre\> grep -r gtk_radio_button_group . ./gok/gok-page-accessmethod.c: ListRadioButtons = gtk_radio_button_group (GTK_RADIO_BUTTON (pWidget)); $:andre\> grep -r gtk_signal_connect . ./gok/gok-page-accessmethod.c: gtk_signal_connect (GTK_OBJECT (pWidget), "toggled", ./gok/main.c: gtk_signal_connect (GTK_OBJECT (window1), "motion_notify_event", ./gok/main.c: gtk_signal_connect (GTK_OBJECT (window1), "leave_notify_event", ./gok/main.c: gtk_signal_connect (GTK_OBJECT (window1), "enter_notify_event", ./gok/main.c: gtk_signal_connect (GTK_OBJECT (window1), "size_allocate", ./gok/main.c: gtk_signal_connect (GTK_OBJECT (window1), "delete_event", ./gok/main.c: gtk_signal_connect (GTK_OBJECT (window1), "configure_event", ./gok/main.c: gtk_signal_connect (GTK_OBJECT (window1), "window_state_event", ./gok/gok-control.c: gtk_signal_connect (GTK_OBJECT (pWidget), "clicked", ./gok/gok-editor.c: gtk_signal_connect (GTK_OBJECT (m_pWindowKeyboard), "delete_event", ./gok/gok-keyboard.c: gtk_signal_connect (GTK_OBJECT (pNewButton), "button_press_event", ./gok/gok-keyboard.c: gtk_signal_connect (GTK_OBJECT (pNewButton), "button_release_event", ./gok/gok-keyboard.c: gtk_signal_connect (GTK_OBJECT (pNewButton), "toggled", ./gok/gok-keyboard.c: gtk_signal_connect (GTK_OBJECT (pNewButton), "enter_notify_event", ./gok/gok-keyboard.c: gtk_signal_connect (GTK_OBJECT (pNewButton), "leave_notify_event", ./gok/gok-keyboard.c: gtk_signal_connect (GTK_OBJECT (pNewButton), "state_changed", ./gok/gok-keyboard.c: gtk_signal_connect (GTK_OBJECT (pNewButton), "button_press_event", $:andre\> grep -r gtk_toggle_button_set_state . ./gok/gok-key.c: gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (pKey->pButton), $:andre\> grep -r gtk_tooltips_new . ./gok/gok-page-keysizespace.c: tooltips = gtk_tooltips_new (); $:andre\> grep -r gtk_type_unique . ./gok/gok-button.c: GokButtonType = gtk_type_unique (GTK_TYPE_TOGGLE_BUTTON, &GokButtonInfo); $:andre\> grep -r gtk_widget_ref . ./gok/gok-page-accessmethod.c: gtk_widget_ref (pWidget); ./gok/gok-page-accessmethod.c: gtk_widget_ref (pWidget); ./gok/gok-page-accessmethod.c: gtk_widget_ref (pWidget); ./gok/gok-page-accessmethod.c: gtk_widget_ref (pWidget); ./gok/gok-page-accessmethod.c: gtk_widget_ref (pWidget); ./gok/gok-page-accessmethod.c: gtk_widget_ref (pWidget); ./gok/gok-page-accessmethod.c: gtk_widget_ref (pWidget); ./gok/gok-page-accessmethod.c: gtk_widget_ref (pWidget); ./gok/gok-page-accessmethod.c: gtk_widget_ref (pWidget); ./gok/gok-page-accessmethod.c: gtk_widget_ref (pWidget); ./gok/main.c: gtk_widget_ref (fixed1); ./gok/gok-page-actions.c: gtk_widget_ref (pLabel); ./gok/gok-page-actions.c: gtk_widget_ref (pEntryNewName); ./gok/gok-editor.c: gtk_widget_ref (fixed1); ./gok/gok-page-feedbacks.c: gtk_widget_ref (pLabel); ./gok/gok-page-feedbacks.c: gtk_widget_ref (pEntryNewName); $:andre\> grep -r gtk_widget_unref . ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-accessmethod.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/main.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-actions.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-actions.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-editor.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-feedbacks.c: (GtkDestroyNotify) gtk_widget_unref); ./gok/gok-page-feedbacks.c: (GtkDestroyNotify) gtk_widget_unref);
Created attachment 132547 [details] [review] First part - gtk_type_unique - GtkType - GtkTypeInfo - GtkObjectInitFunc - GtkClassInitFunc
Created attachment 132550 [details] [review] Second Part - gtk_signal_connect - GTK_SIGNAL_FUNC
Created attachment 132556 [details] [review] Third part - gtk_widget_ref - gtk_widget_unref - gtk_object_set_data - gtk_object_get_data - gtk_object_set_data_full - GtkDestroyNotify
...so? Commit to trunk (as gok has been already branched for 2-26)?
r=me Please file bugs for the TODOs. Thanks!
Committed to master. Thanks for the review David. (In reply to comment #5) > r=me > > Please file bugs for the TODOs. Thanks! > Do you mean the TODO comments in the patches?
Cool, http://www.gnome.org/~fpeters/299.html looks better now and lists "gdk_cursor_destroy, gdk_input_add, gdk_input_remove, gdk_window_get_size, gtk_combo_new, gtk_combo_set_popdown_strings, gtk_entry_set_editable, gtk_radio_button_group, gtk_toggle_button_set_state, gtk_tooltips_new" as being left.
Created attachment 133407 [details] [review] Replace gdk_input_* The patch compiles and should work, but I don't have a joystick to test.
Created attachment 133409 [details] [review] another - gdk_cursor_destroy - gdk_window_get_size - gtk_entry_set_editable - gtk_radio_button_group - gtk_toggle_button_set_state - gtk_tooltips_new - GtkTooltips Tested.
The remaining symbols are gtk_combo_new and gtk_combo_set_popdown_strings. This will require lots of changes - most of the GtkCombo widgets are in the glade file. grep -nH GtkCombo gok.glade2: gok.glade2:1050: <widget class="GtkCombo" id="comboActionNames"> gok.glade2:2500: <widget class="GtkCombo" id="comboInputDevice"> gok.glade2:2686: <widget class="GtkCombo" id="comboFeedback"> gok.glade2:3228: <widget class="GtkCombo" id="comboSoundName"> gok.glade2:3468: <widget class="GtkCombo" id="comboAccessMethods"> gok.glade2:4877: <widget class="GtkCombo" id="combo1"> gok.glade2:5016: <widget class="GtkCombo" id="combo2"> gok.glade2:5384: <widget class="GtkCombo" id="combo3"> gok.glade2:5472: <widget class="GtkCombo" id="combo4"> gok.glade2:5658: <widget class="GtkCombo" id="combo5"> gok.glade2:6220: <widget class="GtkCombo" id="combo6"> gok.glade2:6392: <widget class="GtkCombo" id="combo7"> gok.glade2:6617: <widget class="GtkCombo" id="combo8">
Created attachment 143496 [details] [review] Replace GtkCombo This patch removes the last remaining deprecated symbols. It replaces all GtkCombo widgets with GtkComboBox widgets.
Gerd, I just tried the patch you posted to comment#11. Everything seems to be working. The only suggestions I have are: * you should add your copyright information to files that are touched by this patch - this applies to future contributions as well :-) * this whitespace issue should be fixed: % git apply ~/gok_replace-gtkcombo.diff /home/ben/gok_replace-gtkcombo.diff:1926: trailing whitespace. be at the top of the list, and therefore not overridden warning: 1 line adds whitespace errors. -> this is caused by the space after this sentence in gok-page-actions.c Thanks for your hard work! Ben
Thanks for the review Ben. I've removed the whitespace and added my copyright infos to the files. Commit: http://git.gnome.org/cgit/gok/commit/?id=214a1a8fd50292a435b57e2be9387d78e7d1df84 GOK compiles with -DGTK_DISABLE_DEPRECATED so I'm marking the bug to fixed.