After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 572353 - Remove deprecated GTK+ symbols
Remove deprecated GTK+ symbols
Status: RESOLVED FIXED
Product: gnome-media
Classification: Deprecated
Component: general
2.25.x
Other Linux
: Normal normal
: ---
Assigned To: gnome media maintainers
gnome media maintainers
Depends on:
Blocks: 585692
 
 
Reported: 2009-02-19 00:30 UTC by André Klapper
Modified: 2010-04-15 15:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix deprecated calls in grecord (2.17 KB, patch)
2009-02-21 17:52 UTC, Felix Riemann
committed Details | Review
[PATCH] Replace deprecated gtk_timeout_* calls (1.32 KB, patch)
2009-06-27 17:11 UTC, Felix Riemann
committed Details | Review
remove GtkOptionMenus from gst-properties (119.00 KB, patch)
2009-06-27 20:06 UTC, Felix Riemann
committed Details | Review
Replace deprecated gtk_fixed_set_has_window with gtk_widget_set_has_window (808 bytes, patch)
2010-01-17 00:54 UTC, Thomas Andersen
none Details | Review
Replace deprecated gtk_fixed_set_has_window with gtk_widget_set_has_window (v2) (863 bytes, patch)
2010-01-17 18:42 UTC, Thomas Andersen
committed Details | Review
Replace GTK_WIDGET_STATE() and GTK_WIDGET_TOPLEVEL() macros (2.36 KB, patch)
2010-04-15 15:03 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review

Description André Klapper 2009-02-19 00:30:28 UTC
http://live.gnome.org/GnomeGoals/RemoveDeprecatedSymbols/GTK%2B

For potential patch contributors:
It might make sense to break this into several smaller patches. :-P
Also make sure that the gtk and glib versions in configure.in are high enough
and take a look since which version the new non-deprecated functions are
available. http://library.gnome.org is your friend.

Also, gnome-cd and cddb-slave2 are unmaintained - definitely LOW priority and they might be dropped in future. The other stuff is more important.

Complete list of deprecated functions in gnome-media:
gdk_color_alloc, gdk_input_add, gdk_pixbuf_render_to_drawable_alpha, gdk_window_ref, gdk_window_unref, gtk_combo_new, gtk_combo_set_popdown_strings, gtk_combo_set_value_in_list, gtk_container_border_width, gtk_draw_shadow, gtk_label_set, gtk_object_ref, gtk_object_sink, gtk_option_menu_get_history, gtk_option_menu_get_menu, gtk_option_menu_new, gtk_option_menu_remove_menu, gtk_option_menu_set_history, gtk_option_menu_set_menu, gtk_progress_set_percentage, gtk_status_icon_set_tooltip, gtk_timeout_add, gtk_timeout_remove, gtk_tooltips_new, gtk_tooltips_set_tip, gtk_tree_model_get_iter_root, gtk_type_new, gtk_widget_draw, gtk_widget_set_uposition



$:andre\> grep -r gdk_color_alloc .
./gnome-cd/display.c:	gdk_color_alloc (cmap, &disp->priv->red);
./gnome-cd/display.c:	gdk_color_alloc (cmap, &disp->priv->blue);
./vu-meter/gtkled.c:	gdk_color_alloc (cmap, &(led->fg[LED_COLOR_ON]));
./vu-meter/gtkled.c:	gdk_color_alloc (cmap, &(led->fg[LED_COLOR_OFF]));

$:andre\> grep -r gdk_input_add .
./vu-meter/main.c:	gdk_input_add (sound, GDK_INPUT_READ, handle_read, meter);

$:andre\> grep -r gdk_pixbuf_render_to_drawable_alpha .
./gnome-cd/display.c:	gdk_pixbuf_render_to_drawable_alpha (pixbuf,

$:andre\> grep -r gdk_window_ref .
./vu-meter/gtkled.c:	gdk_window_ref (widget->window);

$:andre\> grep -r gdk_window_unref .
./gnome-cd/cd-selection.c: gdk_window_unref (cd_selection->owner_window);
./gnome-cd/cd-selection.c: gdk_window_unref (cd_selection->owner_window);

$:andre\> grep -r gtk_combo_new .
./cddb-slave2/cddb-track-editor.c:	td->genre = gtk_combo_new ();

$:andre\> grep -r gtk_combo_set_popdown_strings .
./cddb-slave2/cddb-track-editor.c:	gtk_combo_set_popdown_strings (GTK_COMBO (td->genre),

$:andre\> grep -r gtk_combo_set_value_in_list .
./cddb-slave2/cddb-track-editor.c:	gtk_combo_set_value_in_list (GTK_COMBO (td->genre), FALSE, TRUE);

$:andre\> grep -r gtk_container_border_width .
./vu-meter/main.c:	gtk_container_border_width (GTK_CONTAINER (frame), 4);
./vu-meter/main.c:	gtk_container_border_width (GTK_CONTAINER (hbox), 5);

$:andre\> grep -r gtk_draw_shadow .
./vu-meter/gtkled.c:	gtk_draw_shadow (widget->style, widget->window,

$:andre\> grep -r gtk_label_set .
./gnome-volume-control/src/gvc-channel-bar.c:  gtk_label_set_text (GTK_LABEL (bar->priv->label),
./gnome-volume-control/src/gvc-balance-bar.c:  gtk_label_set_mnemonic_widget (GTK_LABEL (bar->priv->label),
./gnome-cd/gnome-cd.c:		gtk_label_set_text (GTK_LABEL (GTK_MESSAGE_DIALOG (dialog)->label),
./gnome-cd/callbacks.c:		gtk_label_set_use_markup (GTK_LABEL (GTK_MESSAGE_DIALOG (dialog)->label), TRUE);
./gnome-cd/preferences.c:	gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
./gnome-cd/preferences.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (label), pd->cd_device);
./gnome-cd/preferences.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (label), pd->theme_list);
./cddb-slave2/cddb-slave-capplet.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (label), pd->real_name);
./cddb-slave2/cddb-slave-capplet.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (label), pd->real_host);
./cddb-slave2/cddb-slave-capplet.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (label), pd->update);
./cddb-slave2/cddb-slave-capplet.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (label), pd->other_host);
./cddb-slave2/cddb-slave-capplet.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (label), pd->other_port);
./cddb-slave2/cddb-track-editor.c:	gtk_label_set_text (GTK_LABEL (td->discid), title);
./cddb-slave2/cddb-track-editor.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (label), td->artist);
./cddb-slave2/cddb-track-editor.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (label), td->disctitle);
./cddb-slave2/cddb-track-editor.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (label), td->disccomments);
./cddb-slave2/cddb-track-editor.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (label),
./cddb-slave2/cddb-track-editor.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (label), td->year);
./cddb-slave2/cddb-track-editor.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (label), td->extra_info);
./gst-mixer/src/preferences.c:  gtk_label_set_mnemonic_widget (GTK_LABEL(label), GTK_WIDGET (prefs->treeview));
./gst-mixer/src/window.c:  gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("_Device: "));
./gst-mixer/src/window.c:  gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo_box);
./grecord/src/gsr-window.c:	gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
./grecord/src/gsr-window.c:	gtk_label_set_selectable (GTK_LABEL (label), TRUE);
./grecord/src/gsr-window.c:	gtk_label_set_line_wrap (GTK_LABEL (label), GTK_WRAP_WORD);
./grecord/src/gsr-window.c:	gtk_label_set_text (GTK_LABEL (fp->dirname), "");
./grecord/src/gsr-window.c:	gtk_label_set_text (GTK_LABEL (fp->dirname), text);
./grecord/src/gsr-window.c:	gtk_label_set_text (GTK_LABEL (fp->filename), text);
./grecord/src/gsr-window.c:	gtk_label_set_text (GTK_LABEL (fp->size), text);
./grecord/src/gsr-window.c:	gtk_label_set_text (GTK_LABEL (fp->length), text);
./grecord/src/gsr-window.c:	gtk_label_set_text (GTK_LABEL (fp->samplerate), text);
./grecord/src/gsr-window.c:	gtk_label_set_text (GTK_LABEL (fp->bitrate), text);
./grecord/src/gsr-window.c:	gtk_label_set_text (GTK_LABEL (fp->channels), text);
./grecord/src/gsr-window.c:	gtk_label_set (GTK_LABEL (window->priv->length_label), len_str);
./grecord/src/gsr-window.c:	gtk_label_set (GTK_LABEL (window->priv->length_label), _("Unknown"));
./grecord/src/gsr-window.c:	gtk_label_set (GTK_LABEL (window->priv->length_label), len_str);
./grecord/src/gsr-window.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (priv->input_label), priv->input);
./grecord/src/gsr-window.c:	gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->profile);
./grecord/src/gsr-window.c:	gtk_label_set_selectable (GTK_LABEL (priv->name_label), TRUE);
./grecord/src/gsr-window.c:	gtk_label_set_line_wrap (GTK_LABEL (priv->name_label), GTK_WRAP_WORD);
./grecord/src/gsr-window.c:	gtk_label_set_selectable (GTK_LABEL (priv->length_label), TRUE);
./grecord/src/gsr-window.c:	gtk_label_set (GTK_LABEL (priv->name_label), utf8_name);
./profiles/audio-profiles-edit.c:  gtk_label_set_mnemonic_widget (GTK_LABEL (label),
./profiles/audio-profiles-edit.c:  gtk_label_set_mnemonic_widget (GTK_LABEL (wl), w);
./profiles/audio-profiles-edit.c:  gtk_label_set_mnemonic_widget (GTK_LABEL (wl), w);
./profiles/gmp-util.c:    gtk_label_set_text (GTK_LABEL (GTK_MESSAGE_DIALOG (*weak_ptr)->label),

$:andre\> grep -r gtk_object_ref .
./vu-meter/main.c:	gtk_object_ref (GTK_OBJECT (client));

$:andre\> grep -r gtk_object_sink .
./vu-meter/main.c:	gtk_object_sink (GTK_OBJECT (client));

$:andre\> grep -r gtk_option_menu_get_history .
./gnome-cd/gnome-cd.c:	track = gtk_option_menu_get_history (GTK_OPTION_MENU (gcd->tracks));
./gnome-cd/callbacks.c:	track = gtk_option_menu_get_history (GTK_OPTION_MENU (gcd->tracks)) + 1;

$:andre\> grep -r gtk_option_menu_get_menu .
./gstreamer-properties/gstreamer-properties.c:  menu = GTK_MENU (gtk_option_menu_get_menu (devicemenu));
./gstreamer-properties/gstreamer-properties.c:  GTK_MENU_SHELL (gtk_option_menu_get_menu (editor->optionmenu));
./gstreamer-properties/gstreamer-properties.c:  GtkMenu *menu = GTK_MENU (gtk_option_menu_get_menu (editor->optionmenu));
./gstreamer-properties/gstreamer-properties.c:  menu = GTK_MENU (gtk_option_menu_get_menu (optionmenu));

$:andre\> grep -r gtk_option_menu_new .
./gnome-cd/gnome-cd.c:	gcd->tracks = gtk_option_menu_new ();

$:andre\> grep -r gtk_option_menu_remove_menu .
./gnome-cd/gnome-cd.c:	gtk_option_menu_remove_menu (GTK_OPTION_MENU (gcd->tracks));
./gstreamer-properties/gstreamer-properties.c:    gtk_option_menu_remove_menu (editor->devicemenu);

$:andre\> grep -r gtk_option_menu_set_history .
./gnome-cd/callbacks.c:	gtk_option_menu_set_history (menu, track - 1);
./gstreamer-properties/gstreamer-properties.c:    gtk_option_menu_set_history (editor->devicemenu,
./gstreamer-properties/gstreamer-properties.c:    gtk_option_menu_set_history (editor->optionmenu,

$:andre\> grep -r gtk_option_menu_set_menu .
./gnome-cd/gnome-cd.c:	gtk_option_menu_set_menu (GTK_OPTION_MENU (gcd->tracks), GTK_WIDGET (menu));
./gstreamer-properties/gstreamer-properties.c:    gtk_option_menu_set_menu (editor->devicemenu, GTK_WIDGET (menu));
./gstreamer-properties/gstreamer-properties.c:    gtk_option_menu_set_menu (option, GTK_WIDGET (menu));

$:andre\> grep -r gtk_progress_set_percentage .
./grecord/src/gsr-window.c:	gtk_progress_set_percentage (GTK_PROGRESS (window->priv->level), 0);
./grecord/src/gsr-window.c:	gtk_progress_set_percentage (GTK_PROGRESS (priv->level), myind);

$:andre\> grep -r gtk_status_icon_set_tooltip .
./gnome-volume-control/src/gvc-stream-status-icon.c:        gtk_status_icon_set_tooltip_markup (GTK_STATUS_ICON (icon), markup);
./gnome-cd/gnome-cd.c:	gtk_status_icon_set_tooltip (gcd->tray, _("CD Player"));
./gnome-cd/callbacks.c:	gtk_status_icon_set_tooltip (gcd->tray, text);
./gnome-cd/callbacks.c:	gtk_status_icon_set_tooltip (gcd->tray, _("Paused"));
./gnome-cd/callbacks.c:	gtk_status_icon_set_tooltip (gcd->tray, _("CD Player"));
./gnome-cd/callbacks.c:	gtk_status_icon_set_tooltip (gcd->tray, _("Stopped"));
./gnome-cd/callbacks.c:	gtk_status_icon_set_tooltip (gcd->tray, _("No disc"));
./gnome-cd/callbacks.c:	gtk_status_icon_set_tooltip (gcd->tray, _("No Cdrom"));

$:andre\> grep -r gtk_timeout_add .
./gnome-cd/callbacks.c:	gcd->timeout = gtk_timeout_add (140, ffwd_timeout_cb, gcd);
./gnome-cd/callbacks.c:	gcd->timeout = gtk_timeout_add (140, rewind_timeout_cb, gcd);
./gstreamer-properties/pipeline-tests.c: gtk_timeout_add (50, user_test_pipeline_timeout,
./vu-meter/main.c:	/* time_id = gtk_timeout_add (50000, (GtkFunction)update_display, meter); */

$:andre\> grep -r gtk_timeout_remove .
./gnome-cd/callbacks.c:	gtk_timeout_remove (gcd->timeout);
./gnome-cd/callbacks.c:	gtk_timeout_remove (gcd->timeout);
./gstreamer-properties/pipeline-tests.c: gtk_timeout_remove (timeout_tag);

$:andre\> grep -r gtk_tooltips_new .
./gnome-cd/gnome-cd.c:	gcd->tooltips = gtk_tooltips_new ();

$:andre\> grep -r gtk_tooltips_set_tip .
./gnome-cd/gnome-cd.c:	gtk_tooltips_set_tip (gcd->tooltips, item, info->name, NULL);
./gnome-cd/gnome-cd.c:	gtk_tooltips_set_tip (gcd->tooltips, button, tooltip, "");
./gnome-cd/gnome-cd.c:	gtk_tooltips_set_tip (gcd->tooltips, GTK_WIDGET (gcd->slider), volume_level, NULL);
./gnome-cd/gnome-cd.c:	gtk_tooltips_set_tip (gcd->tooltips, GTK_WIDGET (gcd->position_slider),
./gnome-cd/gnome-cd.c:	gtk_tooltips_set_tip (gcd->tooltips, GTK_WIDGET (gcd->tracks), 
./gnome-cd/callbacks.c:	gtk_tooltips_set_tip (gcd->tooltips, GTK_WIDGET(gcd->display), current_time, NULL);
./gnome-cd/callbacks.c:	gtk_tooltips_set_tip (gcd->tooltips, GTK_WIDGET(gcd->display), _("CD Player"), NULL);
./gnome-cd/callbacks.c:	gtk_tooltips_set_tip (gcd->tooltips, GTK_WIDGET (gcd->slider), volume_level, NULL);

$:andre\> grep -r gtk_tree_model_get_iter_root .
./gnome-cd/preferences.c:	gtk_tree_model_get_iter_root (model, &iter);

$:andre\> grep -r gtk_type_new .
./vu-meter/gtkledbar.c:	led_bar = gtk_type_new (led_bar_get_type ());
./vu-meter/gtkled.c:	led = gtk_type_new (gtk_led_get_type ());

$:andre\> grep -r gtk_widget_draw .
./vu-meter/gtkled.c:	gtk_widget_draw (GTK_WIDGET (led), NULL);

$:andre\> grep -r gtk_widget_set_uposition .
./vu-meter/main.c:	gtk_widget_set_uposition (window, session_xpos, session_ypos);
Comment 1 Felix Riemann 2009-02-21 17:52:14 UTC
Created attachment 129217 [details] [review]
fix deprecated calls in grecord
Comment 2 Felix Riemann 2009-02-21 17:54:11 UTC
You should change your grep pattern to something like "gtk_label_set[ 	]*(" when searching for gtk_label_set as the current one produced many false positives.
Comment 3 André Klapper 2009-02-26 11:05:59 UTC
(In reply to comment #1)
> Created an attachment (id=129217) [edit]
> fix deprecated calls in grecord

Can this get a review please?
Comment 4 André Klapper 2009-04-20 22:15:07 UTC
(In reply to comment #1)
> Created an attachment (id=129217) [edit]
> fix deprecated calls in grecord

Can this get a review/commit please?
Marc-Andre?
Comment 5 Cosimo Cecchi 2009-04-25 23:33:41 UTC
FWIW, the patch looks good to me (but I'm not a maintainer of this module).
Comment 6 Felix Riemann 2009-04-26 09:56:18 UTC
Btw, note that it's only a partial fix for this bug.
So, maybe the maintainers are waiting for a complete solution.
Comment 7 André Klapper 2009-04-30 10:24:39 UTC
Felix, please commit your patch to master (gnome-media has branched for 2.26 already) and blame me if someone complains.
Comment 8 Felix Riemann 2009-05-01 10:14:31 UTC
(In reply to comment #7)
> Felix, please commit your patch to master (gnome-media has branched for 2.26
> already) and blame me if someone complains.
> 

Ok, here we go. :-)
http://git.gnome.org/cgit/gnome-media/commit/?id=8170e9e9fcfe8483ba6d58007d1b2cdd72ada27c
Comment 9 Thomas Andersen 2009-05-21 13:48:45 UTC
vu-meter, gnome-cd, and cddb-slave2 are unmaintained. All that makes sense to fix is:

gtk_timeout_add, gtk_timeout_remove:
gstreamer-properties/pipelines-tests.c

GtkOptionMenu stuff:
gstreamer-properties/gstreamer-properties-struckts.h
gstreamer-properties/gstreamer-properties.c
gstreamer-properties/gstreamer-properties.glade (will conflict with patch in #524364)
Comment 10 Felix Riemann 2009-06-27 17:11:38 UTC
Created attachment 137465 [details] [review]
[PATCH] Replace deprecated gtk_timeout_* calls

(In reply to comment #9)
> 
> gtk_timeout_add, gtk_timeout_remove:
> gstreamer-properties/pipelines-tests.c
> 
These are pretty straight-forward. "Fixed" by this patch.
Comment 11 Felix Riemann 2009-06-27 20:06:00 UTC
Created attachment 137475 [details] [review]
remove GtkOptionMenus from gst-properties

(In reply to comment #9)
> GtkOptionMenu stuff:
> gstreamer-properties/gstreamer-properties-struckts.h
> gstreamer-properties/gstreamer-properties.c
> gstreamer-properties/gstreamer-properties.glade (will conflict with patch in
> #524364)
> 

Should be fixed by this patch. It replaces the GtkOptionMenus by GtkComboBoxes.
Depends on the updated GtkBuilder patch from bug 524364 comment 9 (or simply attachment 137474 [details] [review])
Comment 12 Marc-Andre Lureau 2009-06-29 13:18:55 UTC
Thanks a lot Felix! will review soon.
Comment 13 Marc-Andre Lureau 2009-07-12 14:49:58 UTC
Thanks felix, that was also my approach in an experimental branch, but you did better and faster. Committed both patches, and a minor correction on top.
Comment 14 Marc-Andre Lureau 2009-07-27 21:05:15 UTC
commit ce6efc01b852c92db7f783f538b42f82065c11ed
Author: Marc-André Lureau <marcandre.lureau@gmail.com>
Date:   Mon Jul 27 21:56:29 2009 +0300

    Remove vumeter, cddb, and gnome-cd
Comment 15 Thomas Andersen 2010-01-17 00:24:31 UTC
gtk_fixed_set_has_window is deprecated since gtk 2.20
http://library.gnome.org/devel/gtk/unstable/GtkFixed.html#gtk-fixed-get-has-window

gst-mixer/src/volume.c:73:  gtk_fixed_set_has_window (GTK_FIXED (vol), TRUE);
Comment 16 Thomas Andersen 2010-01-17 00:54:23 UTC
Created attachment 151577 [details] [review]
Replace deprecated gtk_fixed_set_has_window with gtk_widget_set_has_window

Note that the patch requires gtk 2.20
Comment 17 Felix Riemann 2010-01-17 11:28:03 UTC
(In reply to comment #16)
> Note that the patch requires gtk 2.20

Is there a special reason for this requirement? gtk_widget_set_has_window should be available in 2.18 also.
Comment 18 Marc-Andre Lureau 2010-01-17 16:57:49 UTC
(In reply to comment #16)
> Created an attachment (id=151577) [details] [review]
> Replace deprecated gtk_fixed_set_has_window with gtk_widget_set_has_window
> 
> Note that the patch requires gtk 2.20

You can commit with a:
#if GTK_CHECK_VERSION(2,18,0)
..
#else
...old code
#endif

thanks
Comment 19 Thomas Andersen 2010-01-17 18:09:55 UTC
(In reply to comment #17)
> (In reply to comment #16)
> > Note that the patch requires gtk 2.20
> 
> Is there a special reason for this requirement? gtk_widget_set_has_window
> should be available in 2.18 also.

Sorry. I looked at when gtk_fixed_set_has_window got deprecated instead of when gtk_widget_set_has_window got included. Oops.

I'll commit the patch with gtk version check
Comment 20 Thomas Andersen 2010-01-17 18:42:59 UTC
Created attachment 151615 [details] [review]
Replace deprecated gtk_fixed_set_has_window with gtk_widget_set_has_window (v2)
Comment 21 André Klapper 2010-04-12 16:32:43 UTC
As per http://people.gnome.org/~fpeters/reports/299.html and after a look at the code GTK_WIDGET_STATE, GTK_WIDGET_TOPLEVEL are still used, hence reopening.
Comment 22 Bastien Nocera 2010-04-15 14:51:24 UTC
Seems like there are some false positives here.

This is the only change I needed to make it compile with GTK+ 2.20. Let me know the exact location of other deprecated function uses if you can find any.

commit 4f99dc3be20fb96abdcac3ec16032adfe7a98930
Author: Bastien Nocera <hadess@hadess.net>
Date:   Thu Apr 15 15:49:55 2010 +0100

    Replace deprecated GTK_WIDGET_HAS_GRAB call
    
    And up the GTK+ version to one that has the replacement for it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=572353
Comment 23 Javier Jardón (IRC: jjardon) 2010-04-15 15:03:32 UTC
Created attachment 158819 [details] [review]
Replace GTK_WIDGET_STATE() and GTK_WIDGET_TOPLEVEL() macros