forked from AuroraMiddleware/gtk
Remove old migration docs
This information will still be available in the 2.22 docs. For 3.0, we'll do sortof a clean start.
This commit is contained in:
parent
6a8a2f7ef3
commit
d93b99a273
@ -120,28 +120,12 @@ content_files = \
|
||||
version.xml \
|
||||
running.sgml \
|
||||
building.sgml \
|
||||
changes-1.2.sgml \
|
||||
changes-2.0.sgml \
|
||||
compiling.sgml \
|
||||
directfb.sgml \
|
||||
drawing-model.xml \
|
||||
glossary.xml \
|
||||
migrating-2to3.xml \
|
||||
migrating-checklist.sgml \
|
||||
migrating-ClientSideWindows.sgml \
|
||||
migrating-GtkAboutDialog.sgml \
|
||||
migrating-GtkAction.sgml \
|
||||
migrating-GtkAssistant.sgml \
|
||||
migrating-GtkBuilder.sgml \
|
||||
migrating-GtkColorButton.sgml \
|
||||
migrating-GtkComboBox.sgml \
|
||||
migrating-GtkEntry-icons.sgml \
|
||||
migrating-GtkFileChooser.sgml \
|
||||
migrating-GtkIconView.sgml \
|
||||
migrating-GtkLabel-links.sgml \
|
||||
migrating-GtkLinkButton.sgml \
|
||||
migrating-GtkRecentChooser.sgml \
|
||||
migrating-GtkTooltip.sgml \
|
||||
objects_grouped.sgml \
|
||||
osx.sgml \
|
||||
question_index.sgml \
|
||||
|
@ -53,8 +53,8 @@ How to compile GTK+ itself
|
||||
which you unpack into a directory full of the source files as follows:
|
||||
</para>
|
||||
<programlisting>
|
||||
tar xvfz gtk+-2.0.0.tar.gz
|
||||
tar xvfj gtk+-2.0.0.tar.bz2
|
||||
tar xvfz gtk+-3.0.0.tar.gz
|
||||
tar xvfj gtk+-3.0.0.tar.bz2
|
||||
</programlisting>
|
||||
<para>
|
||||
In the toplevel of the directory that is created, there will be
|
||||
@ -139,16 +139,12 @@ How to compile GTK+ itself
|
||||
<listitem>
|
||||
<para>
|
||||
<ulink
|
||||
url="http://www.freedesktop.org/software/pkgconfig">pkg-config</ulink>
|
||||
url="http://pkg-config.freedesktop.org">pkg-config</ulink>
|
||||
is a tool for tracking the compilation flags needed for
|
||||
libraries that are used by the GTK+ libraries. (For each
|
||||
library, a small <literal>.pc</literal> text file is installed
|
||||
in a standard location that contains the compilation flags
|
||||
needed for that library along with version number information.)
|
||||
The version of <command>pkg-config</command> needed to build
|
||||
GTK+ is mirrored in the <filename>dependencies</filename> directory
|
||||
on the <ulink url="ftp://ftp.gtk.org/pub/gtk/">GTK+ FTP
|
||||
site.</ulink>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
@ -216,15 +212,14 @@ How to compile GTK+ itself
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <ulink
|
||||
url="ftp://ftp.uu.net/graphics/jpeg/">JPEG</ulink>,
|
||||
The <ulink url="http://en.wikipedia.org/wiki/Libjpeg">JPEG</ulink>,
|
||||
<ulink url="http://www.libpng.org">PNG</ulink>, and
|
||||
<ulink url="http://www.libtiff.org">TIFF</ulink> image
|
||||
loading libraries are needed to compile GTK+. You probably
|
||||
already have these libraries installed, but if not, the
|
||||
versions you need are available in the
|
||||
<filename>dependencies</filename> directory on the the
|
||||
<ulink url="ftp://ftp.gtk.org/pub/gtk/v2.6/dependencies/">GTK+
|
||||
<ulink url="ftp://ftp.gtk.org/pub/gtk/v2.10/dependencies/">GTK+
|
||||
FTP site.</ulink>. (Before installing these libraries
|
||||
from source, you should check if your operating system
|
||||
vendor has prebuilt packages of these libraries that you
|
||||
@ -369,6 +364,10 @@ How to compile GTK+ itself
|
||||
<arg>--disable-cups</arg>
|
||||
<arg>--enable-cups</arg>
|
||||
</group>
|
||||
<group>
|
||||
<arg>--disable-papi</arg>
|
||||
<arg>--enable-papi</arg>
|
||||
</group>
|
||||
<group>
|
||||
<arg>--with-xinput=[no|yes]</arg>
|
||||
</group>
|
||||
@ -565,18 +564,29 @@ How to compile GTK+ itself
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>--disable-papi</systemitem> and
|
||||
<systemitem>--enable-papi</systemitem></title>
|
||||
|
||||
<para>
|
||||
By default the <command>configure</command> script will try
|
||||
to build the papi print backend if the papi libraries are found.
|
||||
These options can be used to explicitly control whether
|
||||
the papi print backend should be built.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>--with-xinput</systemitem></title>
|
||||
<para>
|
||||
Controls whether GTK+ is built with support for the XInput
|
||||
extension. The XInput extension provides an interface
|
||||
to extended input devices such as graphics tablets.
|
||||
or XInput2 extension. These extensions provide an extended
|
||||
interface to input devices such as graphics tablets.
|
||||
When this support is compiled in, specially written
|
||||
GTK+ programs can get access to subpixel positions,
|
||||
multiple simultaneous input devices, and extra "axes"
|
||||
provided by the device such as pressure and tilt
|
||||
information. This is only known to work well on XFree86
|
||||
systems, though other systems do have this extension.
|
||||
information.
|
||||
</para>
|
||||
</formalpara>
|
||||
<formalpara>
|
||||
|
@ -1,464 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-changes-1-2" revision="1 Jan 2002">
|
||||
<refmeta>
|
||||
<refentrytitle>Changes from 1.0 to 1.2</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
<refmiscinfo>Changes from 1.0 to 1.2</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>Changes from 1.0 to 1.2</refname>
|
||||
<refpurpose>
|
||||
Incompatible changes made between version 1.0 and version 1.2
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
|
||||
<refsect1>
|
||||
<title>Incompatible changes from 1.0 to 1.2</title>
|
||||
|
||||
<itemizedlist>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<structname>GtkAcceleratorTable</structname> has been replaced with
|
||||
<structname>GtkAccelGroup</structname>.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<structname>GtkMenuFactory</structname> has been replaced with
|
||||
<structname>GtkItemFactory</structname>, although
|
||||
a version of <structname>GtkMenuFactory</structname> is currently still
|
||||
provided to ease the migration phase.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
The <structname>GtkTypeInfo</structname> structures used in the
|
||||
<function>gtk_*_type_init()</function> functions have
|
||||
changed a bit, the old format:
|
||||
<programlisting>
|
||||
GtkTypeInfo bin_info =
|
||||
{
|
||||
"GtkBin",
|
||||
sizeof (GtkBin),
|
||||
sizeof (GtkBinClass),
|
||||
(GtkClassInitFunc) gtk_bin_class_init,
|
||||
(GtkObjectInitFunc) gtk_bin_init,
|
||||
(GtkArgSetFunc) NULL,
|
||||
(GtkArgGetFunc) NULL,
|
||||
};
|
||||
</programlisting>
|
||||
|
||||
needs to be converted to:
|
||||
|
||||
<programlisting>
|
||||
static const GtkTypeInfo bin_info =
|
||||
{
|
||||
"GtkBin",
|
||||
sizeof (GtkBin),
|
||||
sizeof (GtkBinClass),
|
||||
(GtkClassInitFunc) gtk_bin_class_init,
|
||||
(GtkObjectInitFunc) gtk_bin_init,
|
||||
/* reserved_1 */ NULL,
|
||||
/* reserved_2 */ NULL,
|
||||
(GtkClassInitFunc) NULL,
|
||||
};
|
||||
</programlisting>
|
||||
|
||||
the <function>GtkArgSetFunc</function> and <function>GtkArgGetFunc</function>
|
||||
functions are not supported from the type system anymore, and you should make
|
||||
sure that your code only fills in these fields with <literal>NULL</literal>
|
||||
and doesn't use the deprecated function typedefs
|
||||
<literal>(GtkArgSetFunc)</literal> and <literal>(GtkArgGetFunc)</literal>
|
||||
anymore.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
A number of GTK+ functions were renamed. For compatibility,
|
||||
<filename>gtkcompat.h</filename> #define's the old 1.0.x function names in
|
||||
terms of the new names. To assure your GTK+ program doesn't rely on outdated
|
||||
function variants, compile your program with
|
||||
<option>-DGTK_DISABLE_COMPAT_H</option> to disable
|
||||
the compatibility aliases.
|
||||
|
||||
Here is the list of the old names and replacements:
|
||||
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row><entry>Old</entry><entry>Replacement</entry></row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row><entry><function>gtk_accel_label_accelerator_width</function></entry><entry><function>gtk_accel_label_get_accel_width</function></entry></row>
|
||||
<row><entry><function>gtk_check_menu_item_set_state</function></entry><entry><function>gtk_check_menu_item_set_active</function></entry></row>
|
||||
<row><entry><function>gtk_container_border_width</function></entry><entry><function>gtk_container_set_border_width</function></entry></row>
|
||||
<row><entry><function>gtk_label_set</function></entry><entry><function>gtk_label_set_text</function></entry></row>
|
||||
<row><entry><function>gtk_notebook_current_page</function></entry><entry><function>gtk_notebook_get_current_page</function></entry></row>
|
||||
<row><entry><function>gtk_packer_configure</function></entry><entry><function>gtk_packer_set_child_packing</function></entry></row>
|
||||
<row><entry><function>gtk_paned_gutter_size</function></entry><entry><function>gtk_paned_set_gutter_size</function></entry></row>
|
||||
<row><entry><function>gtk_paned_handle_size</function></entry><entry><function>gtk_paned_set_handle_size</function></entry></row>
|
||||
<row><entry><function>gtk_scale_value_width</function></entry><entry><function>gtk_scale_get_value_width</function></entry></row>
|
||||
<row><entry><function>gtk_style_apply_default_pixmap</function></entry><entry><function>gtk_style_apply_default_background</function></entry></row>
|
||||
<row><entry><function>gtk_toggle_button_set_state</function></entry><entry><function>gtk_toggle_button_set_active</function></entry></row>
|
||||
<row><entry><function>gtk_window_position</function></entry><entry><function>gtk_window_set_position</function></entry></row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
Note that <function>gtk_style_apply_default_background()</function> has an
|
||||
additional argument, <literal>set_bg</literal>. This parameter should be
|
||||
<literal>FALSE</literal> if the background is being set for a
|
||||
<literal>NO_WINDOW</literal> widget, otherwise <literal>TRUE</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
During the development phase of the 1.1.x line of GTK+ certain functions
|
||||
were deprecated and later removed. Functions affected are:
|
||||
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row><entry>Removed</entry><entry>Replacement</entry></row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row><entry><function>gtk_clist_set_border</function></entry><entry><function>gtk_clist_set_shadow_type</function></entry></row>
|
||||
<row><entry><function>gtk_container_block_resize</function></entry><entry><function>gtk_container_set_resize_mode</function></entry></row>
|
||||
<row><entry><function>gtk_container_unblock_resize</function></entry><entry><function>gtk_container_set_resize_mode</function></entry></row>
|
||||
<row><entry><function>gtk_container_need_resize</function></entry><entry><function>gtk_container_check_resize</function></entry></row>
|
||||
<row><entry><function>gtk_ctree_show_stub</function></entry><entry><function>gtk_ctree_set_show_stub</function></entry></row>
|
||||
<row><entry><function>gtk_ctree_set_reorderable</function></entry><entry><function>gtk_clist_set_reorderable</function></entry></row>
|
||||
<row><entry><function>gtk_ctree_set_use_drag_icons</function></entry><entry><function>gtk_clist_set_use_drag_icons</function></entry></row>
|
||||
<row><entry><function>gtk_entry_adjust_scroll</function></entry><entry><function>-</function></entry></row>
|
||||
<row><entry><function>gtk_object_class_add_user_signal</function></entry><entry><function>gtk_object_class_user_signal_new</function></entry></row>
|
||||
<row><entry><function>gtk_preview_put_row</function></entry><entry><function>gtk_preview_put</function></entry></row>
|
||||
<row><entry><function>gtk_progress_bar_construct</function></entry><entry><function>gtk_progress_set_adjustment</function></entry></row>
|
||||
<row><entry><function>gtk_scrolled_window_construct</function></entry><entry><function>gtk_scrolled_window_set_{h|v}adjustment</function></entry></row>
|
||||
<row><entry><function>gtk_spin_button_construct</function></entry><entry><function>gtk_spin_button_configure</function></entry></row>
|
||||
<row><entry><function>gtk_widget_thaw_accelerators</function></entry><entry><function>gtk_widget_unlock_accelerators</function></entry></row>
|
||||
<row><entry><function>gtk_widget_freeze_accelerators</function></entry><entry><function>gtk_widget_lock_accelerators</function></entry></row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
||||
Note that <function>gtk_entry_adjust_scroll()</function> is no longer needed
|
||||
as <structname>GtkEntry</structname> should automatically keep the scroll
|
||||
adjusted properly.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Additionally, all <function>gtk_*_interp()</function> functions were removed.
|
||||
<function>gtk_*_full()</function> versions were provided as of GTK+ 1.0 and
|
||||
should be used instead.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<structname>GtkButton</structname> has been changed to derive from
|
||||
<structname>GtkBin</structname>.
|
||||
To access a button's child, use <literal>GTK_BIN (button)->child</literal>,
|
||||
instead of the old <literal>GTK_BUTTON (button)->child</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
The selection API has been slightly modified:
|
||||
|
||||
<function>gtk_selection_add_handler()</function> and
|
||||
<function>gtk_selection_add_handler_full()</function>
|
||||
have been removed. To supply the selection, one now registers
|
||||
the targets one is interested in with:
|
||||
|
||||
<programlisting>
|
||||
void gtk_selection_add_target (GtkWidget *widget,
|
||||
GdkAtom selection,
|
||||
GdkAtom target,
|
||||
guint info);
|
||||
</programlisting>
|
||||
|
||||
or:
|
||||
|
||||
<programlisting>
|
||||
void gtk_selection_add_targets (GtkWidget *widget,
|
||||
GdkAtom selection,
|
||||
GtkTargetEntry *targets,
|
||||
guint ntargets);
|
||||
</programlisting>
|
||||
|
||||
When a request for a selection is received, the new "selection_get"
|
||||
signal will be called:
|
||||
|
||||
<programlisting>
|
||||
void "selection_get" (GtkWidget *widget,
|
||||
GtkSelectionData *selection_data,
|
||||
guint info,
|
||||
guint time);
|
||||
</programlisting>
|
||||
|
||||
A "time" parameter has also been added to the "selection_received"
|
||||
signal.
|
||||
|
||||
<programlisting>
|
||||
void "selection_received" (GtkWidget *widget,
|
||||
GtkSelectionData *selection_data,
|
||||
guint time);
|
||||
</programlisting>
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
The old drag and drop API has been completely removed and replaced.
|
||||
See the reference documentation for details on the new API.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Support for Themes has been added. In general, this does
|
||||
not affect application code, however, a few new rules should
|
||||
be observed:
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>To set a shape for a window, you must use
|
||||
<function>gtk_widget_shape_combine_mask()</function> instead of
|
||||
<function>gdk_window_shape_combine_mask()</function>, or the shape will be
|
||||
reset when switching themes.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>It is no longer permissable to draw directly on an arbitrary
|
||||
widget, or to set an arbitrary widget's background pixmap.
|
||||
If you need to do that, use a <structname>GtkDrawingArea</structname> or
|
||||
(for a toplevel) a <structname>GtkWindow</structname> where
|
||||
<function>gtk_widget_set_app_paintable()</function>
|
||||
has been called.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
The <structname>GtkScrolledWindow</structname> widget no longer creates a
|
||||
<structname>GtkViewport</structname> automatically. Instead, it has been
|
||||
generalized to accept any "self-scrolling" widget.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The self-scrolling widgets in the GTK+ core are
|
||||
<structname>GtkViewport</structname>,
|
||||
<structname>GtkCList</structname>, <structname>GtkCTree</structname>,
|
||||
<structname>GtkText</structname>, and <structname>GtkLayout</structname>.
|
||||
All of these widgets can be added to a scrolled window as normal children with
|
||||
<function>gtk_container_add()</function> and scrollbars will be set up
|
||||
automatically.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To add scrollbars to a non self-scrolling widget, (such as a
|
||||
<structname>GtkList</structname>),
|
||||
first add it to a viewport, then add the viewport to a scrolled window.
|
||||
The scrolled window code provides a convenience function to do this:
|
||||
|
||||
<programlisting>
|
||||
void gtk_scrolled_window_add_with_viewport (GtkScrolledWindow *scrollwin,
|
||||
GtkWidget *child);
|
||||
</programlisting>
|
||||
|
||||
This does exactly what it says - it creates a viewport, adds the child
|
||||
widget to it, then adds the viewport to the scrolled window.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The scrollbars have been removed from the <structname>GtkCList</structname>
|
||||
and <structname>GtkCTree</structname>, because they are now scrolled by simply
|
||||
adding them to a scrolled window. The scrollbar policy is set on the scrolled
|
||||
window with <function>gtk_scrolled_window_set_policy()</function> and not on
|
||||
the child widgets (e.g. <structname>GtkCList</structname>'s
|
||||
<function>gtk_clist_set_policy()</function> was removed).
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
The "main loop" of GTK+ has been moved to GLib. This should not
|
||||
affect existing programs, since compatibility functions have
|
||||
been provided. However, you may want to consider migrating
|
||||
your code to use the GLib main loop directly.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
the <literal>GTK_BASIC</literal> flag was removed, and with it the corresponding
|
||||
macro and function <function>GTK_WIDGET_BASIC()</function> and
|
||||
<function>gtk_widget_basic()</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
All freeze/thaw methods are now recursive - that is, if you
|
||||
freeze a widget n times, you must also thaw it n times.
|
||||
|
||||
Therefore, if you have code like:
|
||||
|
||||
<informalexample><programlisting>
|
||||
gboolean frozen;
|
||||
frozen = GTK_CLIST_FROZEN (clist);
|
||||
gtk_clist_freeze (clist);
|
||||
[...]
|
||||
if (!frozen)
|
||||
gtk_clist_thaw (clist);
|
||||
</programlisting></informalexample>
|
||||
|
||||
it will not work anymore. It must be, simply:
|
||||
|
||||
<informalexample><programlisting>
|
||||
gtk_clist_freeze (clist);
|
||||
[...]
|
||||
gtk_clist_thaw (clist);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
The thread safety in GTK+ 1.2 is slightly different than
|
||||
that which appeared in early versions in the 1.1
|
||||
development track. The main difference is that it relies on
|
||||
the thread primitives in GLib, and on the thread-safe
|
||||
GLib main loop.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This means:
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>You must call <function>g_thread_init()</function> before
|
||||
executing any other GTK+ or GDK functions in a threaded GTK+ program.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Idles, timeouts, and input functions are executed outside
|
||||
of the main GTK+ lock. So, if you need to call GTK+
|
||||
inside of such a callback, you must surround the callback
|
||||
with a <function>gdk_threads_enter()</function>/<function>gdk_threads_leave()</function>
|
||||
pair.
|
||||
</para>
|
||||
|
||||
<para>However, signals are still executed within the main
|
||||
GTK+ lock.
|
||||
</para>
|
||||
|
||||
<para>In particular, this means, if you are writing widgets
|
||||
that might be used in threaded programs, you <emphasis>must</emphasis>
|
||||
surround timeouts and idle functions in this matter.
|
||||
</para>
|
||||
|
||||
<para>As always, you must also surround any calls to GTK+
|
||||
not made within a signal handler with a
|
||||
<function>gdk_threads_enter()</function>/<function>gdk_threads_leave()</function>
|
||||
pair.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>There is no longer a special <option>--with-threads</option>
|
||||
<command>configure</command> option for GTK+. To use threads in a GTK+
|
||||
program, you must:
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>If you want to use the native thread implementation,
|
||||
make sure GLib found this in configuration, otherwise,
|
||||
call you must provide a thread implementation to
|
||||
<function>g_thread_init()</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Link with the libraries returned by
|
||||
<command>gtk-config --libs gthread</command>
|
||||
and use the cflags from
|
||||
<command>gtk-config --cflags gthread</command>.
|
||||
You can get these <envar>CFLAGS</envar> and <envar>LIBS</envar> by
|
||||
passing <literal>gthread</literal> as the fourth parameter to the
|
||||
<literal>AM_PATH_GTK</literal> <application>automake</application>
|
||||
macro.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
Prior to GTK+ 1.2, there were two conflicting interpretations
|
||||
of <literal>widget->requisition</literal>. It was either taken to be
|
||||
the size that the widget requested, or that size modified by calls to
|
||||
<function>gtk_widget_set_usize()</function>. In GTK+ 1.2,
|
||||
it is always interpreted the first way.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Container widgets are affected in two ways by this:
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>Container widgets should not pass
|
||||
<literal>widget->requisition</literal> as the second parameter to
|
||||
<function>gtk_widget_size_request()</function>.
|
||||
Instead they should call it like:
|
||||
<programlisting>
|
||||
GtkRequisition child_requisition;
|
||||
gtk_widget_size_request (widget, &child_requisition);
|
||||
</programlisting>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Container widgets should not access
|
||||
<literal>child->requisition</literal> directly. Either they should use
|
||||
the values returned by <function>gtk_widget_size_request()</function>,
|
||||
or they should call the new function:
|
||||
<programlisting>
|
||||
void gtk_widget_get_child_requisition (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
</programlisting>
|
||||
which returns the requisition of the given widget, modified
|
||||
by calls to <function>gtk_widget_set_usize()</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
|
||||
</itemizedlist>
|
||||
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -29,10 +29,10 @@ The following interactive shell session demonstrates how
|
||||
<literal>pkg-config</literal> is used (the actual output on
|
||||
your system may be different):
|
||||
<programlisting>
|
||||
$ pkg-config --cflags gtk+-2.0
|
||||
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/atk-1.0
|
||||
$ pkg-config --libs gtk+-2.0
|
||||
-L/usr/lib -L/usr/X11R6/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lXi -lgdk_pixbuf-2.0 -lm -lpangox -lpangoxft -lXft -lXrender -lXext -lX11 -lfreetype -lpango -latk -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
|
||||
$ pkg-config --cflags gtk+-3.0
|
||||
-pthread -I/usr/include/gtk-3.0 -I/usr/lib64/gtk-3.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
|
||||
$ pkg-config --libs gtk+-3.0
|
||||
-pthread -lgtk-x11-3.0 -lgdk-x11-3.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-3.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
@ -42,7 +42,7 @@ feature of the shell. If you enclose a command in backticks
|
||||
substituted into the command line before execution. So to compile
|
||||
a GTK+ Hello, World, you would type the following:
|
||||
<programlisting>
|
||||
$ cc `pkg-config --cflags --libs gtk+-2.0` hello.c -o hello
|
||||
$ cc `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
@ -88,14 +88,5 @@ The same for <filename>gtkunixprint.h</filename> if you use the non-portable
|
||||
<link linkend="GtkPrintUnixDialog">GtkPrintUnixDialog</link> API.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The next major version, GTK+ 3, will remove 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.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@ -41,6 +41,28 @@ string utilities, file utilities, a main loop abstraction, and so on.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>GObject</term>
|
||||
<listitem><para>A library that provides a type system, a collection of
|
||||
fundamental types including an object type, a signal system.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>GIO</term>
|
||||
<listitem><para>A modern, easy-to-use VFS API including abstractions for
|
||||
files, drives, volumes, stream IO, as well as network programming and
|
||||
DBus communication.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>cairo</term>
|
||||
<listitem><para>Cairo is a 2D graphics library with support for multiple
|
||||
output devices.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>Pango</term>
|
||||
<listitem><para>
|
||||
@ -400,24 +422,8 @@ that is, GUI components such as #GtkButton or #GtkTextView.
|
||||
</para>
|
||||
</partintro>
|
||||
|
||||
<xi:include href="migrating-2to3.xml" />
|
||||
<xi:include href="xml/migrating-checklist.sgml" />
|
||||
<xi:include href="changes-1.2.sgml" />
|
||||
<xi:include href="changes-2.0.sgml" />
|
||||
<xi:include href="xml/migrating-GtkFileChooser.sgml" />
|
||||
<xi:include href="xml/migrating-GtkAction.sgml" />
|
||||
<xi:include href="xml/migrating-GtkComboBox.sgml" />
|
||||
<xi:include href="xml/migrating-GtkIconView.sgml" />
|
||||
<xi:include href="xml/migrating-GtkAboutDialog.sgml" />
|
||||
<xi:include href="xml/migrating-GtkColorButton.sgml" />
|
||||
<xi:include href="xml/migrating-GtkAssistant.sgml" />
|
||||
<xi:include href="xml/migrating-GtkRecentChooser.sgml" />
|
||||
<xi:include href="xml/migrating-GtkLinkButton.sgml" />
|
||||
<xi:include href="xml/migrating-GtkBuilder.sgml" />
|
||||
<xi:include href="xml/migrating-GtkTooltip.sgml" />
|
||||
<xi:include href="xml/migrating-GtkEntry-icons.sgml" />
|
||||
<xi:include href="xml/migrating-GtkLabel-links.sgml" />
|
||||
<xi:include href="xml/migrating-ClientSideWindows.sgml" />
|
||||
<xi:include href="migrating-2to3.xml" />
|
||||
</part>
|
||||
|
||||
<part>
|
||||
@ -437,50 +443,6 @@ that is, GUI components such as #GtkButton or #GtkTextView.
|
||||
<title>Index of deprecated symbols</title>
|
||||
<xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-2" role="2.2">
|
||||
<title>Index of new symbols in 2.2</title>
|
||||
<xi:include href="xml/api-index-2.2.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-4" role="2.4">
|
||||
<title>Index of new symbols in 2.4</title>
|
||||
<xi:include href="xml/api-index-2.4.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-6" role="2.6">
|
||||
<title>Index of new symbols in 2.6</title>
|
||||
<xi:include href="xml/api-index-2.6.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-8" role="2.8">
|
||||
<title>Index of new symbols in 2.8</title>
|
||||
<xi:include href="xml/api-index-2.8.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-10" role="2.10">
|
||||
<title>Index of new symbols in 2.10</title>
|
||||
<xi:include href="xml/api-index-2.10.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-12" role="2.12">
|
||||
<title>Index of new symbols in 2.12</title>
|
||||
<xi:include href="xml/api-index-2.12.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-14" role="2.14">
|
||||
<title>Index of new symbols in 2.14</title>
|
||||
<xi:include href="xml/api-index-2.14.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-16" role="2.16">
|
||||
<title>Index of new symbols in 2.16</title>
|
||||
<xi:include href="xml/api-index-2.16.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-18" role="2.18">
|
||||
<title>Index of new symbols in 2.18</title>
|
||||
<xi:include href="xml/api-index-2.18.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-20" role="2.20">
|
||||
<title>Index of new symbols in 2.20</title>
|
||||
<xi:include href="xml/api-index-2.20.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-22" role="2.22">
|
||||
<title>Index of new symbols in 2.22</title>
|
||||
<xi:include href="xml/api-index-2.22.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-0" role="3.0">
|
||||
<title>Index of new symbols in 3.0</title>
|
||||
<xi:include href="xml/api-index-3.0.xml"><xi:fallback /></xi:include>
|
||||
|
@ -3,9 +3,14 @@
|
||||
"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>
|
||||
<title>Migrating from GTK+ 2.x to GTK+ 3</title>
|
||||
|
||||
<refsect1>
|
||||
<para>
|
||||
There are a number of steps that you can take to prepare your GTK+ 2.x
|
||||
application for the switch to GTK+ 3.
|
||||
</para>
|
||||
|
||||
<section>
|
||||
<title>Only single includes</title>
|
||||
<para>
|
||||
Make sure your program only include the toplevel headers:
|
||||
@ -13,24 +18,25 @@
|
||||
make CFLAGS+="-DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
</section>
|
||||
|
||||
<refsect1>
|
||||
<section>
|
||||
<title>Do not use deprecated symbols</title>
|
||||
<para>
|
||||
Make sure your program doesn't use any deprecated functions:
|
||||
Make sure your program doesn't use any functions that have been
|
||||
deprecated in GTK+ 2.x:
|
||||
<programlisting>
|
||||
make CFLAGS+="-DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
</section>
|
||||
|
||||
<refsect1>
|
||||
<title>Use accessor funcions instead direc access</title>
|
||||
<section>
|
||||
<title>Use accessor functions instead direct 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
|
||||
GTK+ 3 removes many implementation details and struct members from
|
||||
its public headers. To ensure that your application does not have problems
|
||||
with this, you 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.
|
||||
@ -38,22 +44,27 @@
|
||||
make CFLAGS+="-DGSEAL_ENABLE"
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
</section>
|
||||
|
||||
<refsect1>
|
||||
<section>
|
||||
<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
|
||||
Some software packages install loadable GTK+ modules such as theme engines,
|
||||
gdk-pixbuf loaders or input methods. Since GTK+ 3 is parallel-installable
|
||||
with GTK+ 2.x, the two GTK+ versions have separate locations for their
|
||||
loadable modules. The location for GTK+ 2.x is
|
||||
<filename><replaceable>libdir</replaceable>/gtk-2.0</filename>
|
||||
(and its subdirectories), for GTK+ 3 the location is
|
||||
<filename><replaceable>libdir</replaceable>/gtk-3.0</filename>
|
||||
(and its subdirectories).
|
||||
</para>
|
||||
<para>
|
||||
For some kinds of modules, namely im modules and pixbuf loaders,
|
||||
For some kinds of modules, namely input methods 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/.
|
||||
For GTK+ 2.x, these cache files are located in
|
||||
<filename><replaceable>sysconfdir</replaceable>/gtk-2.0</filename>.
|
||||
For GTK+ 3, they have been moved to
|
||||
<filename><replaceable>libdir</replaceable>/gtk-3.0/3.0.0/</filename>.
|
||||
The commands that create these cache files have been renamed with a -3
|
||||
suffix to make them parallel-installable.
|
||||
</para>
|
||||
@ -65,5 +76,5 @@
|
||||
against libgtk 2.x into an application using GTK+ 3 will lead to
|
||||
unhappiness and must be avoided.
|
||||
</para>
|
||||
</refsect1>
|
||||
</section>
|
||||
</chapter>
|
||||
|
@ -154,21 +154,19 @@ my_widget_popup_menu_handler (GtkWidget *widget)
|
||||
<para>
|
||||
The <structfield>region</structfield> field of
|
||||
<structname>GdkEventExpose</structname> allows you to redraw
|
||||
less than the traditional
|
||||
<structfield>GdkEventRegion.area</structfield>.
|
||||
less than the traditional <structfield>GdkEventRegion.area</structfield>.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<para>
|
||||
In GTK+ 1.x, the <structname>GdkEventExpose</structname>
|
||||
In early GTK+ versions, the <structname>GdkEventExpose</structname>
|
||||
structure only had an <structfield>area</structfield> field to
|
||||
let you determine the region that you needed to redraw. In GTK+
|
||||
2.x, this field exists for compatibility and as a simple
|
||||
interface. However, there is also a
|
||||
<structfield>region</structfield> field which contains a
|
||||
fine-grained region. The <structfield>area</structfield> field
|
||||
is simply the bounding rectangle of the
|
||||
<structfield>region</structfield>.
|
||||
let you determine the region that you needed to redraw. In current
|
||||
GTK+, this field still exists for compatibility and as a simple
|
||||
interface. However, there is also a <structfield>region</structfield>
|
||||
field which contains a fine-grained region. The
|
||||
<structfield>area</structfield> field is simply the bounding rectangle
|
||||
of the <structfield>region</structfield>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@ -295,11 +293,10 @@ my_widget_key_press_event_handler (GtkWidget *widget, GdkEventKey *event)
|
||||
</formalpara>
|
||||
|
||||
<para>
|
||||
Since GTK+ 2.6, named icons can be used for window icons (see
|
||||
gtk_window_set_icon_name()) and images (see gtk_image_set_icon_name()).
|
||||
In GTK+ 2.8, you can also use named icons for drag-and-drop (see
|
||||
gtk_drag_source_set_icon_name()) and in treeview cells (see the
|
||||
#GtkCellRendererPixbuf:icon-name property).
|
||||
Named icons can be used for window icons (see gtk_window_set_icon_name())
|
||||
and images (see gtk_image_set_icon_name()). You can also use named icons
|
||||
for drag-and-drop (see gtk_drag_source_set_icon_name()) and in treeview
|
||||
cells (see the #GtkCellRendererPixbuf:icon-name property).
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
|
@ -69,12 +69,7 @@ version to another?</para></question>
|
||||
<answer>
|
||||
|
||||
<para>
|
||||
See the <link linkend="gtk-changes-2-0">list of incompatible changes
|
||||
from 1.2 to 2.0</link>. Also, the <ulink
|
||||
url="http://developer.gnome.org/dotplan/porting/">GNOME 2.0 porting
|
||||
guide</ulink> on <ulink
|
||||
url="http://developer.gnome.org">http://developer.gnome.org</ulink>
|
||||
has some more detailed discussion of porting from 1.2 to 2.0.
|
||||
See <xref linkend="gtk-migrating-2-to-3"/>.
|
||||
You may also find useful information in the documentation for
|
||||
specific widgets and functions.
|
||||
</para>
|
||||
|
Loading…
Reference in New Issue
Block a user