Difference between revisions of "GTK+ 3 migration"
(Started with a non-exhaustive list) |
(→Deprecated symbols: Explain that this list is incomplete) |
||
Line 5: | Line 5: | ||
== Deprecated symbols == | == Deprecated symbols == | ||
Inkscape currently makes use of a number of deprecated GTK+ symbols. We need to get rid of all of these before we can upgrade. Some are very easy to replace. Some are a little more challenging. We need to ensure that Inkscape still builds correctly when the "-DGTK_DISABLE_DEPRECATED" compiler flag is applied. | Inkscape currently makes use of a number of deprecated GTK+ symbols. We need to get rid of all of these before we can upgrade. Some are very easy to replace. Some are a little more challenging. We need to ensure that Inkscape still builds correctly when the "-DGTK_DISABLE_DEPRECATED" compiler flag is applied. An incomplete "to do" list follows: | ||
=== Switch to gobject === | === Switch to gobject === |
Revision as of 10:20, 21 June 2011
Inkscape currently makes use of the GTK+ 2.20 library API. Ultimately, we will need to switch to the new GTK+ 3 API. This version of the library introduces a number of major changes that are incompatible with GTK, so we need to make some changes to Inkscape.
Guidance from upstream
The GTK+ 3 reference manual offers some guidance for the upgrade process.
Deprecated symbols
Inkscape currently makes use of a number of deprecated GTK+ symbols. We need to get rid of all of these before we can upgrade. Some are very easy to replace. Some are a little more challenging. We need to ensure that Inkscape still builds correctly when the "-DGTK_DISABLE_DEPRECATED" compiler flag is applied. An incomplete "to do" list follows:
Switch to gobject
The GtkType and GtkObject API has been replaced by the gobject library.
Use accessor functions to GtkWidget
Accessor functions such as gtk_widget_has_focus()
should be used instead of deprecated macros such as GTK_WIDGET_HAS_FOCUS()
Get rid of "visual" functions for GtkWidgets
The visual for a widget, and also the default visual is now derived from the colormap for the widget and the default colormap. gtk_widget_set_visual()
, gtk_widget_set_default_visual()
, gtk_widget_push_visual()
and gtk_widget_pop_visual()
now do nothing. Since the visual always had to match that of the colormap, it is safe to simply delete all references to these functions.
Don't use GtkNotebookPage
The GtkNotebookPage
structure has been removed from the public header files; this was never meant to be a public structure, and all functionality that could be done by accessing the struct fields of this structure should be accessible otherwise.
Switch from GtkCombo to GtkComboBoxEntry
See [1]
Get rid of GtkAction proxy functions
gtk_action_connect_proxy has been deprecated since version 2.16 and should not be used in newly-written code. Use gtk_activatable_set_related_action() instead.