Inkscape: A Vector Drawing Tool

Remove deprecated GTK+ symbols

Reported by Andre Klapper on 2009-04-26
4
Affects Status Importance Assigned to Milestone
Inkscape
Medium
John Smith

Bug Description

Inkscape uses a number of deprecated GTK+ symbols that have now been removed from GTK+ 3.[1]

We need to replace all of these. See the attached build log for a list of remaining issues.

To test, build Inkscape using:
make CPPFLAGS+="-DGTK_DISABLE DEPRECATED"

Once we manage to build cleanly, we should add the GTK_DISABLE DEPRECATED flag to configure.ac to prevent any inadvertent usage of deprecated symbols in future.

Also see http://live.gnome.org/GnomeGoals/RemoveDeprecatedSymbols/GTK%2B and http://library.gnome.org/devel/gtk/stable/ .

== List of remaining source files with deprecation issues ==
* display/sodipodi-ctrl.cpp: GtkObject, GTK_VALUE
* widgets/sp-xmlview-tree.h: GtkCTree
* widgets/sp-xmlview-tree.cpp: GtkCTree, GtkCList

Related branches

nightrow (jb-benoit) on 2009-05-10
Changed in inkscape:
importance: Undecided → Wishlist
jazzynico (jazzynico) wrote :

Do we have a plan for this?
Seems quite critical, but I can't find anything related in the roadmap.

Changed in inkscape:
status: New → Confirmed
Javier Jardón (jjardon) wrote :

Hello!

I think that the status of this bug should be changed to high or normal

All these symbols will be removed for GTK 3 which will be released in March 2010.

See http://www.gnome.org/~fpeters/299.html for more info

jazzynico (jazzynico) on 2009-07-21
Changed in inkscape:
importance: Wishlist → Medium
milestone: none → 0.47.1
~suv (suv-lp) on 2010-04-15
Changed in inkscape:
milestone: 0.47.1 → 0.48
jazzynico (jazzynico) on 2010-07-13
Changed in inkscape:
milestone: 0.48 → 0.49
tags: added: build
~suv (suv-lp) wrote :

> gtk_tooltips_disable, gtk_tooltips_enable,
> gtk_tooltips_new, gtk_tooltips_set_tip,

-> Bug #793086 “Replace use of deprecated GtkTooltips”

Alex Valavanis (valavanisalex) wrote :

Here's a list of currently-used deprecated symbols. Hopefully this should help us with the clean-up!

Changed in inkscape:
status: Confirmed → Triaged
Kris (kris-degussem) wrote :

Alex, can you compile a new list or is everything taken care of and can we close this bug?

Alex Valavanis (valavanisalex) wrote :

Hi Kris,

There's still a lot of work to do, I'm afraid. There's a sort of task list in the migration blueprint (see list of linked bugs)[1]. I'll run an updated search for deprecated symbols now.

[1] https://blueprints.launchpad.net/inkscape/+spec/gtk3-migration

Alex Valavanis (valavanisalex) wrote :

Here's an updated list of deprecated symbol usage.

Kris (kris-degussem) wrote :

I do not know if this is the right bug report for the gtkmm symbols, but after the recent commits, I do not only get the build error mentioned on the devmail, but also build errors related to the renaming to the append function:

Make error line 289: problem compiling: src/extension/internal/pdf-input-cairo.c
pp: In constructor 'Inkscape::Extension::Internal::PdfImportCairoDialog::PdfImpo
rtCairoDialog(PopplerDocument*)':
src/extension/internal/pdf-input-cairo.cpp:90:25: error: 'class Gtk::ComboBoxTex
t' has no member named 'append'
src/extension/internal/pdf-input-cairo.cpp:112:25: error: 'class Gtk::ComboBoxTe
xt' has no member named 'append'

And several others, if you wish I can provide the complete build output, though at first sight it seems that all files, where functions were renamed to append, fail to compile.

~suv (suv-lp) wrote :

Build errors seem to be limited to Windows: no issues building r10940 - 10946 on
- Mac OS X 10.5.8 with Apple's GCC 4.2.1, Gtk+/X11 2.24.4, Gtk+/Quartz 2.24.9, glib 2.28.8
- OS X 10.7.2 with Apple's llvm-gcc-4.2.1 and FSF GCC 4.6.2, Gtk+/X11 2.24.9, glib 2.30.2

Alex Valavanis (valavanisalex) wrote :

Ah... sorry about that (again!!).

Apparently, the "append" member function was only added to Gtk::ComboBoxText in gtkmm-2.24. I'll try to get a conditional build written this evening.

Kris (kris-degussem) on 2012-02-16
Changed in inkscape:
status: Triaged → In Progress
Alex Valavanis (valavanisalex) wrote :

Here's the latest buildlog, now that I have fixed the false alarms that come from inside gtkmm. Still plenty of work to do!

description: updated
John Smith (john-smithi) wrote :

@Alex

FYI - The build log above doesn't seem to include gtkmm deprecated symbols (such as Gtk::OptionMenu in src/widgets/stroke-style.cpp)

http://developer.gnome.org/gtkmm/2.24/classGtk_1_1OptionMenu.html#_details

Alex Valavanis (valavanisalex) wrote :

Hi John,

I've been tracking those separately in bug #943225. In fact, stroke-style is the last gtkmm issue to be fixed!

John Smith (john-smithi) wrote :

Great !
I have a patch for the stroke-style markers , will commit it shortly.

description: updated
description: updated
description: updated
John Smith (john-smithi) wrote :

Commit r11139.
Deprecated *_unref symbols replaced with g_object_unref.

Alex Valavanis (valavanisalex) wrote :

Great! New build log attached.

description: updated
John Smith (john-smithi) wrote :

r11140, some more deprecated symbols replaced - *_unref and gtk_combo_box_*.

Alex Valavanis (valavanisalex) wrote :

There's light at the end of the tunnel! Build log attached.

description: updated
description: updated
John Smith (john-smithi) wrote :

Committed r11219 - Replace deprecated sp_ctrl_set_arg and gtk_object_add_arg_type calls in sodipodi-ctrl.cpp

@Alex, there is a patch for the last remaining symbols awaiting testing in bug #903676 (comment #8) , if you feel like testing :)

Alex Valavanis (valavanisalex) wrote :

Great! Here's the latest (final?) buildlog.

I've checked the patch in bug #903676 and it seems good to me on Ubuntu 12.04. Once it's committed, I think we can close this report.

John Smith (john-smithi) wrote :

Committed r11221 - Replace GtkCTree with GtkTreeView in XML Dialog tree.
Should now clean build with CPPFLAGS+="-DGTK_DISABLE_DEPRECATED".

Changed in inkscape:
assignee: nobody → John Smith (john-smithi)
status: In Progress → Fix Committed
Alex Valavanis (valavanisalex) wrote :

@John... Thanks very much!

We should note that even though we can build cleanly with GTK_DISABLE_DEPRECATED, there are still a lot of deprecated symbols in use. The reason for this is that a lot of Gtkmm headers disable the deprecation flag, so that Gtkmm can continue to use deprecated stuff... so any of our source files that include a gtkmm header before <gtk/gtk.h> can still contain deprecated GTK+ symbols.

The only "true" check is to compile against GTK+3 in which the deprecated symbols have been completely removed. Over to bug #972797 for the real fun!

~suv (suv-lp) wrote :

With GTK_DISABLE_DEPRECATED, build fails if configured with '--enable-dbusapi':

  CXX extension/dbus/document-interface.o
In file included from ../../src/ui/dialog/ocaldialogs.h:17,
                 from ../../src/file.h:19,
                 from ../../src/extension/dbus/document-interface.cpp:29:
/opt/local/include/gtkmm-2.4/gtkmm/box.h:105: error: expected class-name before ‘{’ token
/opt/local/include/gtkmm-2.4/gtkmm/box.h:112: error: ISO C++ forbids declaration of ‘_GtkBoxChild’ with no type
/opt/local/include/gtkmm-2.4/gtkmm/box.h:112: error: ‘_GtkBoxChild’ declared as an ‘inline’ field
/opt/local/include/gtkmm-2.4/gtkmm/box.h:112: error: expected ‘;’ before ‘*’ token
/opt/local/include/gtkmm-2.4/gtkmm/box.h:114: error: expected `;' before ‘inline’
/opt/local/include/gtkmm-2.4/gtkmm/box.h:114: error: ISO C++ forbids declaration of ‘_GtkBoxChild’ with no type
/opt/local/include/gtkmm-2.4/gtkmm/box.h:114: error: ‘_GtkBoxChild’ declared as an ‘inline’ field
/opt/local/include/gtkmm-2.4/gtkmm/box.h:114: error: expected ‘;’ before ‘*’ token
/opt/local/include/gtkmm-2.4/gtkmm/box.h:116: error: expected `;' before ‘Widget’
/opt/local/include/gtkmm-2.4/gtkmm/box.h: In member function ‘guint16 Gtk::Box_Helpers::Child::get_padding() const’:
/opt/local/include/gtkmm-2.4/gtkmm/box.h:118: error: ‘gobj’ was not declared in this scope
/opt/local/include/gtkmm-2.4/gtkmm/box.h: In member function ‘bool Gtk::Box_Helpers::Child::get_expand() const’:
/opt/local/include/gtkmm-2.4/gtkmm/box.h:119: error: ‘gobj’ was not declared in this scope
/opt/local/include/gtkmm-2.4/gtkmm/box.h: In member function ‘bool Gtk::Box_Helpers::Child::get_fill() const’:
/opt/local/include/gtkmm-2.4/gtkmm/box.h:120: error: ‘gobj’ was not declared in this scope
/opt/local/include/gtkmm-2.4/gtkmm/box.h: In member function ‘bool Gtk::Box_Helpers::Child::get_pack() const’:
/opt/local/include/gtkmm-2.4/gtkmm/box.h:121: error: ‘gobj’ was not declared in this scope
/opt/local/include/gtkmm-2.4/gtkmm/box.h: In member function ‘GtkBox* Gtk::Box_Helpers::Child::parent()’:
/opt/local/include/gtkmm-2.4/gtkmm/box.h:130: error: ‘gobj’ was not declared in this scope
make[3]: *** [extension/dbus/document-interface.o] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

With this change to configure.ac (reverting r11222), build succeeds:

$ bzr diff configure.ac
=== modified file 'configure.ac'
--- configure.ac 2012-04-11 15:17:53 +0000
+++ configure.ac 2012-04-14 01:00:47 +0000
@@ -60,7 +60,7 @@
   CPPFLAGS="-DG_DISABLE_DEPRECATED $CPPFLAGS"
   CPPFLAGS="-DGTK_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
   CPPFLAGS="-DGTKMM_DISABLE_DEPRECATED $CPPFLAGS"
- CPPFLAGS="-DGTK_DISABLE_DEPRECATED $CPPFLAGS"
+ #CPPFLAGS="-DGTK_DISABLE_DEPRECATED $CPPFLAGS"
   CPPFLAGS="-DGDKMM_DISABLE_DEPRECATED $CPPFLAGS"

   # Test for -Werror=... (introduced some time post-4.0)

$

Alex Valavanis (valavanisalex) wrote :

Oops... looking into this now!

Alex Valavanis (valavanisalex) wrote :

Should be fixed in lp:inkscape r11243

~suv (suv-lp) wrote :

> Should be fixed in lp:inkscape r11243

Thx & confirmed: r11243 builds successfully with '--enable-dbusapi' on
- Mac OS X 10.5.8 (32bit), Apple GCC 4.2.1, glib 2.28.8, glibmm 2.28.0, gtk2/x11 2.24.8, gtkmm 2.24.0
- OS X 10.7.2 (64bit), Apple llvm-gcc-4.2, glib 2.32.0, glibmm 2.28.2, gtk2/x11 2.24.10, gtkmm 2.24.2
- OS X 10.7.2 (64bit) FSF GCC 4.6.3, glib 2.32.0, glibmm 2.32.0, gtk2/x11 2.24.10, gtkmm 2.24.2

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints