diff options
author | Javier Jardón <jjardon@gnome.org> | 2010-05-28 18:18:45 +0200 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2010-05-29 19:37:57 +0200 |
commit | e51f02ce67ce2fa58d0f8cc6050a959042e08da0 (patch) | |
tree | a4fdeecffa876eae191e367c72ceeb3470a62645 /docs/reference/gtk/migrating-2to3.xml | |
parent | 9b9945b8e701a32701a2ca152a7059ade85f75c2 (diff) | |
download | gtk+-e51f02ce67ce2fa58d0f8cc6050a959042e08da0.tar.gz |
[docs] Add GTK+3 migration guide
Diffstat (limited to 'docs/reference/gtk/migrating-2to3.xml')
-rw-r--r-- | docs/reference/gtk/migrating-2to3.xml | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/docs/reference/gtk/migrating-2to3.xml b/docs/reference/gtk/migrating-2to3.xml new file mode 100644 index 0000000000..7ef2b3c277 --- /dev/null +++ b/docs/reference/gtk/migrating-2to3.xml @@ -0,0 +1,69 @@ +<?xml version="1.0"?> +<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" + "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ +]> +<chapter id="gtk-migrating-2-to-3"> + <title>Migrating from 2.x to 3.x</title> + + <refsect1> + <title>Only single includes</title> + <para> + Make sure your program only include the toplevel headers: + <programlisting> + make CFLAGS+="-DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES" + </programlisting> + </para> + </refsect1> + + <refsect1> + <title>Do not use deprecated symbols</title> + <para> + Make sure your program doesn't use any deprecated functions: + <programlisting> + make CFLAGS+="-DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" + </programlisting> + </para> + </refsect1> + + <refsect1> + <title>Use accessor funcions instead direc access</title> + <para> + GTK+ 3 removed many implementation details and struct members from + its public headers. To ensure that your application will not have problems + with this, you can define the preprocessor symbol GSEAL_ENABLE. This will + make the compiler catch all uses of direct access to struct fields so that + you can go through them one by one and replace them with a call to an + accessor function instead. + <programlisting> + make CFLAGS+="-DGSEAL_ENABLE" + </programlisting> + </para> + </refsect1> + + <refsect1> + <title>GTK+ Modules</title> + <para> + Some GNOME modules install GTK+ modules. Since GTK+ 3 will be + parallel-installable with GTK+ 2.x, the two have separate locations for + their loadable modules. The location for GTK+ 2.x is $libdir/gtk-2.0 + (and its subdirectories), for GTK+ 3, the location is $libdir/gtk-3.0 + (and its subdirectories). + </para> + <para> + For some kinds of modules, namely im modules and pixbuf loaders, + GTK+ keeps a cache file with extra information about the modules. + These cache files are located in $sysconfdir/gtk-2.0 for GTK+ 2.x. + For GTK+ 3, they have been moved to $libdir/gtk-3.0/3.0.0/. + The commands that create these cache files have been renamed with a -3 + suffix to make them parallel-installable. + </para> + <para> + Note that GTK+ modules often link against libgtk, libgdk-pixbuf, etc. + If that is the case for your module, you have to be careful to link the + GTK+ 2.x version of your module against the 2.x version of the libraries, + and the GTK+ 3 version against hte 3.x versions. Loading a module linked + against libgtk 2.x into an application using GTK+ 3 will lead to + unhappiness and must be avoided. + </para> + </refsect1> +</chapter> |