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 575017 - Remove deprecated GTK+ symbols
Remove deprecated GTK+ symbols
Status: RESOLVED OBSOLETE
Product: gthumb
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks: 583464
 
 
Reported: 2009-03-12 01:50 UTC by André Klapper
Modified: 2011-07-05 17:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Removing gdk_pango_context_set_colormap. (1.07 KB, patch)
2009-05-02 06:50 UTC, Lincoln de Sousa
committed Details | Review
Removing deprecated GTK_TYPE macros in favor of G_TYPE. (4.46 KB, patch)
2009-05-02 06:51 UTC, Lincoln de Sousa
committed Details | Review
Removing gdk_pixbuf_render_to_drawable{_alpha,} (7.32 KB, patch)
2009-05-02 06:52 UTC, Lincoln de Sousa
committed Details | Review
Removing more references of gdk_pixbuf_render_to_drawable{_alpha,} (2.50 KB, patch)
2009-05-02 06:53 UTC, Lincoln de Sousa
committed Details | Review
Time to gtk_action_connect_proxy die (2.28 KB, patch)
2009-05-02 06:54 UTC, Lincoln de Sousa
rejected Details | Review
Removing deprecated symbol gtk_menu_insert. (1.41 KB, patch)
2009-05-02 06:54 UTC, Lincoln de Sousa
committed Details | Review
Removing gtk_menu_tool_button_set_arrow_tooltip (1.26 KB, patch)
2009-05-02 06:55 UTC, Lincoln de Sousa
committed Details | Review
Replacing gtk_object_sink by g_object_ref_sink. (2.66 KB, patch)
2009-05-02 06:56 UTC, Lincoln de Sousa
none Details | Review
removing tooltips deprecated stuff (4.20 KB, patch)
2009-05-03 06:51 UTC, Lincoln de Sousa
rejected Details | Review
Remove GtkOptionMenu from dlg-save-image (5.07 KB, patch)
2009-05-03 08:08 UTC, Marc Pavot
committed Details | Review
Removing GtkOptionMenu from dlg-preferences.c (18.15 KB, patch)
2009-05-03 09:08 UTC, Lincoln de Sousa
committed Details | Review
Removing GtkOptionMenu from dlg-search.c (and glade) (4.72 KB, patch)
2009-05-11 02:12 UTC, Lincoln de Sousa
committed Details | Review
Remove gtk_object_sink (4.20 KB, patch)
2009-05-28 21:10 UTC, Marc Pavot
committed Details | Review
Improve tag search (942 bytes, patch)
2009-05-28 21:13 UTC, Marc Pavot
committed Details | Review
Replace GtkTooltips API with the new GtkTooltip API (2.67 KB, patch)
2009-05-29 23:37 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review
Replace deprecated gdk_pixbuf_render_to_drawable* functions (1.58 KB, patch)
2009-05-30 00:18 UTC, Javier Jardón (IRC: jjardon)
needs-work Details | Review
Replace deprecated gdk_pixbuf_render_to_drawable* functions (1.59 KB, patch)
2009-05-31 05:15 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review
Replace gtk_action_connect_proxy function (2.40 KB, patch)
2009-05-31 05:57 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
Replace gtk_action_connect_proxy function (2.40 KB, patch)
2009-05-31 06:05 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review
Replace gtk_widget_get_action (1.48 KB, patch)
2009-05-31 06:21 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review
removed deprecated symbols (this is just a test, please ignore) (13.21 KB, patch)
2009-09-06 08:33 UTC, Paolo Bacchilega
rejected Details | Review

Description André Klapper 2009-03-12 01:50:45 UTC
http://live.gnome.org/GnomeGoals/RemoveDeprecatedSymbols/GTK%2B

GTK3 (March 2010) will not ship deprecated symbols anymore, and gthumb uses a lot
of them.
Potential patch contributors see http://library.gnome.org .

GTK_CHECK_CAST, GTK_CHECK_CLASS_CAST, GTK_CHECK_CLASS_TYPE, GTK_CHECK_GET_CLASS, GTK_CHECK_TYPE, GtkType, gdk_pango_context_set_colormap, gdk_pixbuf_render_to_drawable, gdk_pixbuf_render_to_drawable_alpha, gtk_action_connect_proxy, gtk_menu_insert, gtk_menu_tool_button_set_arrow_tooltip, 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_tool_item_set_tooltip, gtk_tooltips_disable, gtk_tooltips_enable, gtk_tooltips_new, gtk_tooltips_set_tip, gtk_widget_get_action
Comment 1 Anatolii Sakhnik 2009-04-30 15:16:29 UTC
I’m going to give it a try.
Comment 2 Lincoln de Sousa 2009-05-02 06:48:20 UTC
(In reply to comment #1)
> I’m going to give it a try.
> 

Hey buddy,

I was planning to work on this thing too, hehe, and I have checked this page some minutes before you comment. I have already removed 12 deprecated symbols from gthumb. I'm working on option menu, but I think it is going to be a bit hard once there are soooo many places using it.

Here goes the update list of deprecated symbols.

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_tool_item_set_tooltip, gtk_tooltips_disable,
gtk_tooltips_enable, gtk_tooltips_new, gtk_tooltips_set_tip,
gtk_widget_get_action

I'm going to publish a set of small patches with the fixes, but you can also fetch the `removing-deprecated-symbols' branch from the following git:

git clone git://labs.alfaiati.net/lincoln/gthumb
Comment 3 Lincoln de Sousa 2009-05-02 06:50:55 UTC
Created attachment 133784 [details] [review]
Removing gdk_pango_context_set_colormap.
Comment 4 Lincoln de Sousa 2009-05-02 06:51:38 UTC
Created attachment 133785 [details] [review]
Removing deprecated GTK_TYPE macros in favor of G_TYPE.
Comment 5 Lincoln de Sousa 2009-05-02 06:52:27 UTC
Created attachment 133786 [details] [review]
Removing gdk_pixbuf_render_to_drawable{_alpha,}
Comment 6 Lincoln de Sousa 2009-05-02 06:53:16 UTC
Created attachment 133787 [details] [review]
Removing more references of gdk_pixbuf_render_to_drawable{_alpha,}
Comment 7 Lincoln de Sousa 2009-05-02 06:54:06 UTC
Created attachment 133788 [details] [review]
Time to gtk_action_connect_proxy die
Comment 8 Lincoln de Sousa 2009-05-02 06:54:43 UTC
Created attachment 133789 [details] [review]
Removing deprecated symbol gtk_menu_insert.
Comment 9 Lincoln de Sousa 2009-05-02 06:55:37 UTC
Created attachment 133790 [details] [review]
Removing gtk_menu_tool_button_set_arrow_tooltip
Comment 10 Lincoln de Sousa 2009-05-02 06:56:11 UTC
Created attachment 133791 [details] [review]
Replacing gtk_object_sink by g_object_ref_sink.
Comment 11 Anatolii Sakhnik 2009-05-02 19:08:47 UTC
Thanks, Linkoln. I don’t have access to the web during week-ends, neither the time. That’s why I won’t hinder you.
Please keep in mind the following issues:
1. Dependent libgnomeui, libgnomecanvas (probably others) must be fixed as well.
2. Some option menues contain separator, so getting active indexes must be shifted (if were 'history + 2' must be 'idx + 1')
3. Some menue items are changed their sensitivity. How to do that for combo box strings?
Sorry, if those questions are obvious to you, because I’m very new to Gtk.
Comment 12 Lincoln de Sousa 2009-05-03 06:30:09 UTC
(In reply to comment #11)
> Thanks, Linkoln. I don’t have access to the web during week-ends, neither the
> time. That’s why I won’t hinder you.

Hehe, ok.

> Please keep in mind the following issues:
> 1. Dependent libgnomeui, libgnomecanvas (probably others) must be fixed as
> well.

Yep, if it does not exist, we should file a new bug report about it.

> 2. Some option menues contain separator, so getting active indexes must be
> shifted (if were 'history + 2' must be 'idx + 1')
> 3. Some menue items are changed their sensitivity. How to do that for combo box
> strings?
> Sorry, if those questions are obvious to you, because I’m very new to Gtk.

I understood your questions, but I think we'll need to change the way that it works today. I think it is not possible (or at least too hard) to change sensitivity of a combobox option, so we can just hide it. And I think stop using separators can make our life easier =D.

But this is my point of view. I think we should wait for the opinion of a gthumb developer. I'll poke Michael Chudobiak and ask him his opinion about this.
Comment 13 Lincoln de Sousa 2009-05-03 06:51:19 UTC
Created attachment 133846 [details] [review]
removing tooltips deprecated stuff
Comment 14 Lincoln de Sousa 2009-05-03 06:53:47 UTC
Now the last deprecated symbols are about GtkOptionMenu. I'll look for cases that GtkOptionMenu can be replaced by GtkComboBox without dealing with separators and sensitivity.
Comment 15 Marc Pavot 2009-05-03 08:08:12 UTC
Created attachment 133848 [details] [review]
Remove GtkOptionMenu from dlg-save-image

This patch (already proposed in bug 581128 replaces GtkOptionMenu by GtkComboBox in dlg-save-image.c.

Marc
Comment 16 Lincoln de Sousa 2009-05-03 08:39:17 UTC
(In reply to comment #15)
> Created an attachment (id=133848) [edit]
> Remove GtkOptionMenu
> 
> This patch (already proposed in bug 581128 replaces GtkOptionMenu by
> GtkComboBox in dlg-save-image.c.

Very nice =)

Right now I'm removing GtkOptionMenu from dlg-preferences.c. So, if you are going to work on this issue, I recommend to go look at another file.
Comment 17 Lincoln de Sousa 2009-05-03 09:08:05 UTC
Created attachment 133850 [details] [review]
Removing GtkOptionMenu from dlg-preferences.c
Comment 18 Lincoln de Sousa 2009-05-11 02:12:50 UTC
Created attachment 134372 [details] [review]
Removing GtkOptionMenu from dlg-search.c (and glade)
Comment 19 Michael Chudobiak 2009-05-28 15:28:53 UTC
gtk_activatable_set_related_action has only been available since 2.16. Fedora 10 only has 2.14. We can't use that yet.

- Mike
Comment 20 Michael Chudobiak 2009-05-28 15:40:58 UTC
Marc, does attachment 133791 [details] [review] look right to you? Do both g_object_ref and g_object_ref_sink need to be called?

- Mike
Comment 21 Michael Chudobiak 2009-05-28 16:40:11 UTC
Thanks for the patches!

Everything has been committed, except for the gtk_activatable_set_related_action stuff (too new), and the g_object_ref_sink stuff (needs to be checked).

- Mike
Comment 22 Marc Pavot 2009-05-28 20:10:46 UTC
Hi Mike,

No we should probably not call both methods. I will send you a patch which fixes this issue and other issues (for example in gth-image-selector, hadj and vadj are never freed).

Marc
Comment 23 Marc Pavot 2009-05-28 21:10:18 UTC
Created attachment 135520 [details] [review]
Remove gtk_object_sink

This patch replace call to gtk_object_sink by g_object_ref_sink with no extra g_object_ref.

It also free priv->hadj and priv->vadj in gth-image-selector and remove a method that is never called (set_scroll_adjustments)

Marc
Comment 24 Marc Pavot 2009-05-28 21:13:55 UTC
Created attachment 135521 [details] [review]
Improve tag search

This patch improves tag search that is a little broken since removal of g_strcasecmp. The main problem is with accentuated characters that are not well handled.  

The patch simply remove call to gtk_tree_view_set_search_equal_func as default implementation works well.

Marc
Comment 25 Michael Chudobiak 2009-05-29 12:42:21 UTC
I thought g_utf8_casefold + g_utf8_collate was the correct way to handle keywords. Are those functions broken?

Anyway, I guess it doesn't matter if the default sorting works well, but I'm curious anyway.

- Mike
Comment 26 Michael Chudobiak 2009-05-29 12:47:58 UTC
Are we done with this bug, or is there more to come?

- Mike
Comment 27 Lincoln de Sousa 2009-05-29 16:33:07 UTC
(In reply to comment #26)
> Are we done with this bug, or is there more to come?
> 
> - Mike
> 

No, we need to purge more references of GtkOptionMenu, like in dlg-{crop,comment,scale-image,image-prop}.c, print-callbacks.c and some other glade files.

I'll back to work on these things this weekend.
Comment 28 Javier Jardón (IRC: jjardon) 2009-05-29 23:14:05 UTC
Michael, you can take a look here: http://www.gnome.org/~fpeters/299.html
(the page is automatically updated, every two hours)
Comment 29 Javier Jardón (IRC: jjardon) 2009-05-29 23:37:33 UTC
Created attachment 135589 [details] [review]
Replace GtkTooltips API with the new GtkTooltip API
Comment 30 Javier Jardón (IRC: jjardon) 2009-05-30 00:18:21 UTC
Created attachment 135590 [details] [review]
Replace deprecated gdk_pixbuf_render_to_drawable* functions
Comment 31 Michael Chudobiak 2009-05-30 17:29:18 UTC
Javier,

The last patch has warnings:

[mjc@adama gthumb]$ make > eraseme
nav-window.c: In function ‘nav_window_expose’:
nav-window.c:208: warning: type defaults to ‘int’ in declaration of ‘type name’
nav-window.c:214: warning: passing argument 3 of ‘gdk_draw_pixbuf’ from incompatible pointer type


- Mike
Comment 32 Javier Jardón (IRC: jjardon) 2009-05-31 05:15:04 UTC
Created attachment 135643 [details] [review]
Replace deprecated gdk_pixbuf_render_to_drawable* functions

Sorry, hope that the patch is good now.
Comment 33 Javier Jardón (IRC: jjardon) 2009-05-31 05:57:49 UTC
Created attachment 135644 [details] [review]
Replace gtk_action_connect_proxy function

I've used the #if GTK_CHECK_VERSION(2,16,0) macro so is not needed bump to new gtk+ version
Comment 34 Javier Jardón (IRC: jjardon) 2009-05-31 06:05:43 UTC
Created attachment 135645 [details] [review]
Replace gtk_action_connect_proxy function

Sorry, this is the correct patch
Comment 35 Javier Jardón (IRC: jjardon) 2009-05-31 06:21:21 UTC
Created attachment 135647 [details] [review]
Replace gtk_widget_get_action

I've used the #if GTK_CHECK_VERSION(2,16,0) macro so is not needed bump to new
gtk+ version
Comment 36 Michael Chudobiak 2009-06-01 18:34:42 UTC
Committed, thanks!

- Mike
Comment 37 Javier Jardón (IRC: jjardon) 2009-09-05 19:38:45 UTC
Is this bug fixed in the ext branch?
Comment 38 Paolo Bacchilega 2009-09-06 08:03:17 UTC
still not fixed
Comment 39 Paolo Bacchilega 2009-09-06 08:33:46 UTC
Created attachment 142583 [details] [review]
removed deprecated symbols (this is just a test, please ignore)
Comment 40 Paolo Bacchilega 2009-09-06 08:37:06 UTC
Comment on attachment 142583 [details] [review]
removed deprecated symbols (this is just a test, please ignore)

this is just a test, please ignore
Comment 41 Paolo Bacchilega 2009-09-06 08:44:26 UTC
sorry for mess with the attachments above, anyway this now fixed in the ext branch.
Comment 42 André Klapper 2010-05-28 11:22:20 UTC
Reopening:

$:andre\> grep -r GTK_WIDGET_STATE .
./gthumb/gth-empty-list.c: widget->style->text_gc[GTK_WIDGET_STATE (widget)],
./gthumb/gth-empty-list.c: GTK_WIDGET_STATE (widget),
./gthumb/gth-histogram-view.c: gdk_cairo_set_source_color (cr, &widget->style->dark[GTK_WIDGET_STATE (widget)]);
./gthumb/gth-histogram-view.c: gdk_cairo_set_source_color (cr, &widget->style->base[GTK_WIDGET_STATE (widget)]);
./extensions/gstreamer_tools/gth-media-viewer-page.c:			    self->priv->has_video ? widget->style->black_gc : widget->style->text_gc[GTK_WIDGET_STATE (widget)],
./extensions/gstreamer_tools/gth-media-viewer-page.c:				 widget->style->base_gc[GTK_WIDGET_STATE (widget)],
./extensions/gstreamer_tools/gth-media-viewer-page.c:				 widget->style->base_gc[GTK_WIDGET_STATE (widget)],
$:andre\> grep -r GTK_WIDGET_TOPLEVEL .
./gthumb/gth-tags-entry.c:       if (! GTK_WIDGET_TOPLEVEL (toplevel))
./gthumb/gth-file-tool.c:	if (! GTK_WIDGET_TOPLEVEL (self->priv->window))
./gthumb/gtk-utils.c:	if (! GTK_WIDGET_TOPLEVEL (w))
./gthumb/gtk-utils.c:	if (! GTK_WIDGET_TOPLEVEL (top_level))
./gthumb/eggfileformatchooser.c:  if (!GTK_WIDGET_TOPLEVEL (toplevel))
Comment 43 David Futcher 2010-12-19 14:11:24 UTC
This seems to have been fixed:


bobbo@tiger:~/Code/gthumb/gthumb$ grep -r GTK_WIDGET_STATE .
bobbo@tiger:~/Code/gthumb/gthumb$ grep -r GTK_WIDGET_TOPLEVEL .
./eggfileformatchooser.c:  if (!GTK_WIDGET_TOPLEVEL (toplevel))


The GTK_WIDGET_TOPLEVEL call in eggfileformatchooser.c is if-guarded:

/* Returns a toplevel GtkWindow, or NULL if none */
static GtkWindow *
get_toplevel (GtkWidget *widget)
{
  GtkWidget *toplevel;

  toplevel = gtk_widget_get_toplevel (widget);
#if GTK_CHECK_VERSION (2,18,0)
  if (!gtk_widget_is_toplevel (toplevel))
#else
  if (!GTK_WIDGET_TOPLEVEL (toplevel))
#endif
    return NULL;
  else
    return GTK_WINDOW (toplevel);
}
Comment 44 Paolo Bacchilega 2011-07-05 17:38:08 UTC
the current development version doesn't use any deprecated symbol of Gtk+ 2.24 (which is the minimum required version).