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 572240 - [Fixed by ifdef] Remove deprecated GTK+ symbols
[Fixed by ifdef] Remove deprecated GTK+ symbols
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Compilation
git master
Other All
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks: 585692
 
 
Reported: 2009-02-18 04:29 UTC by André Klapper
Modified: 2010-05-28 13:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description André Klapper 2009-02-18 04:29:09 UTC
http://live.gnome.org/GnomeGoals/RemoveDeprecatedSymbols/GTK%2B


http://library.gnome.org/devel/gtk/stable/gtk-Types.html#GTK-CHECK-GET-CLASS--CAPS

./src/widgets/gnumeric-cell-renderer-expr-entry.h:
#define GNUMERIC_CELL_RENDERER_EXPR_ENTRY_GET_CLASS(o)	(GTK_CHECK_GET_CLASS ((o), GNUMERIC_TYPE_CELL_RENDERER_EXPR_ENTRY, GnumericCellRendererExprEntryClass))
./src/widgets/gnumeric-cell-renderer-text.h:
#define GNUMERIC_CELL_RENDERER_TEXT_GET_CLASS(o) (GTK_CHECK_GET_CLASS ((o), GNUMERIC_TYPE_CELL_RENDERER_TEXT, GnumericCellRendererTextClass))
./src/widgets/gnumeric-cell-renderer-toggle.h:
#define GNUMERIC_CELL_RENDERER_TOGGLE_GET_CLASS(o)i	(GTK_CHECK_GET_CLASS ((o), GNUMERIC_TYPE_CELL_RENDERER_TOGGLE, GnumericCellRendererToggleClass))


http://library.gnome.org/devel/gtk/stable/GtkCList.html#gtk-clist-moveto

./src/widgets/widget-font-selector.c:
gtk_clist_moveto (clist, row, 0, 0.5, 0.0);


http://library.gnome.org/devel/gtk/unstable/GtkObject.html#gtk-object-sink

./plugins/python-loader/py-interpreter-selector.c:
gtk_object_sink (GTK_OBJECT (obj));
./src/wbc-gtk.c:
gtk_object_sink (GTK_OBJECT (arrow));
./src/sheet-object-widget.c:
gtk_object_sink (GTK_OBJECT (swa->adjustment));
./src/gui-util.c:
gtk_object_sink (GTK_OBJECT (menu));
Comment 1 André Klapper 2009-02-18 15:35:26 UTC
...plus gtk_toolbar_set_orientation
Comment 2 Morten Welinder 2009-02-18 15:44:48 UTC
Oh, another gift from the gtk+ people in the form of another pointless
API change.

http://library.gnome.org/devel/gtk/unstable/GtkToolbar.html#gtk-toolbar-set-orientation

I note that the latest OpenSuSE has 2.12.9 and that gtk_toolbar_set_orientation
was just fine until 2.16.x, so it might half a year before I can even start
fixing that one.  And then only in the #ifdef way.
Comment 3 Morten Welinder 2009-02-18 15:48:21 UTC
Re gtk_clist_moveto in src/widgets/widget-font-selector.c: it occurs in a
comment only!

(A comment we can kill, it seems, but your grep is a bit aggressive.)
Comment 4 Morten Welinder 2009-02-18 17:11:09 UTC
GTK_CHECK_GET_CLASS fixed.
gtk_object_sink is #ifdef'd.
gtk_clist_moveto removed.

That leaves gtk_toolbar_set_orientation, see above.
Comment 5 Morten Welinder 2009-02-19 16:28:06 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

Tentatively fixed using ifdef.  I can't actually compile the new code,
so quality control is minimal.
Comment 6 André Klapper 2010-05-28 11:27:24 UTC
Reopening:

$:andre\> grep -r GTK_WIDGET_TOPLEVEL .
./src/widgets/gnm-notebook.c:  if (!GTK_WIDGET_TOPLEVEL (toplevel))
./src/widgets/gnm-notebook.c:  if (toplevel && GTK_WIDGET_TOPLEVEL (toplevel))
$:andre\> grep -r GTK_WIDGET_STATE .
./src/widgets/gnumeric-cell-renderer-text.c:	if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
./src/widgets/gnm-notebook.c:     GTK_WIDGET_STATE (widget), NULL, widget, "tab",
./src/widgets/gnm-notebook.c:     state_type = GTK_WIDGET_STATE (widget);
$:andre\> grep -r GTK_WIDGET_FLAGS .
./src/widgets/gnumeric-expr-entry.c:	if (toplevel != NULL && (GTK_WIDGET_FLAGS (toplevel) & GTK_TOPLEVEL)) {
Comment 7 Morten Welinder 2010-05-28 12:27:32 UTC
src/widgets/gnm-notebook.c:

Not a problem.  This is a fixed copy of gtknotebook.c and it not used if
you have 2.17.1 or later.

That leaves:
./src/widgets/gnumeric-cell-renderer-text.c:    if (GTK_WIDGET_STATE (widget)
== GTK_STATE_INSENSITIVE)
./src/widgets/gnumeric-expr-entry.c:    if (toplevel != NULL &&
(GTK_WIDGET_FLAGS (toplevel) & GTK_TOPLEVEL)) {

I don't even know if we can solve this given the available API.
(And that means gtk+ 2.12, btw.)
Comment 8 André Klapper 2010-05-28 12:57:54 UTC
(In reply to comment #7)
> I don't even know if we can solve this given the available API.

> ./src/widgets/gnumeric-cell-renderer-text.c:    if (GTK_WIDGET_STATE (widget)
> == GTK_STATE_INSENSITIVE)

#if GTK_CHECK_VERSION (2,18,0)
if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE)
#else
if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
#endif

> ./src/widgets/gnumeric-expr-entry.c:    if (toplevel != NULL &&
> (GTK_WIDGET_FLAGS (toplevel) & GTK_TOPLEVEL)) {

GTK_CHECK_VERSION and gtk_widget_is_toplevel (toplevel) ?
Comment 9 Morten Welinder 2010-05-28 13:00:09 UTC
GTK_WIDGET_FLAGS is now only used when gtk_widget_get_state is not
available.
Comment 10 Morten Welinder 2010-05-28 13:09:44 UTC
gtk_widget_is_toplevel now used, if present.  Now we can just sit and
wait for the gtk+ people to discover that it should have been named
_get_ and not _is_.

Note: GTK_CHECK_VERSION is one of the last choices for this.  The question
is whether the library has a given function, not what version number it
calls itself.
Comment 11 André Klapper 2010-05-28 13:14:15 UTC
Thanks for quick fixing. Yeah, let's see what next thing will be broken by gtk+.