给开发者的惊喜
The following changes are important for developers using the GNOME 2.24 developer platform. If you're not interested in changes for developers, you can skip forward to 第5节 ― 移动领域的创新.
- 4.1. 为 GLib/GTK+ 3.0 准备
- 4.2. GLib 2.18
- 4.3. GTK+ 2.14
- 4.4. 即时消息工具库
- 4.5. 桌面栏
4.1. 为 GLib/GTK+ 3.0 准备
In order to begin preparing developers for GLib and GTK+ 3.0, upcoming releases of both libraries will include flags to enforce stricter compatibility.
GLib, GTK+ and ATK 3.0 will require that only top-level headers (e.g. glib.h, gobject.h, gio.h) are included in applications. This change is important to allow individual headers to be removed, renamed and rearranged without affecting source code compatibility for applications.
To allow developers to test their applications for compatibility now, new compile-time options have been provided: G_DISABLE_SINGLE_INCLUDES for GLib, GTK_DISABLE_SINGLE_INCLUDES for GTK+ and ATK_DISABLE_SINGLE_INCLUDES for ATK.
Simply pass these as compile-time flags when building your application (e.g. -DG_DISABLE_SINGLE_INCLUDES) to ensure that your application is correct.
GLib,GTK+ 和相关的库文件同时也提供其他编译时选项使您可以使用它们以测试与 GTK+ 3.0 的兼容性。
您可以分别禁用不建议使用的符号和将要因定义以下内容而将在 3.0 版本中删除的类:ATK_DISABLE_DEPRECATED, PANGO_DISABLE_DEPRECATED, G_DISABLE_DEPRECATED, GDK_PIXBUF_DISABLE_DEPRECATED, GDK_DISABLE_DEPRECATED and GTK_DISABLE_DEPRECATED for ATK, Pango, GLib, GdkPixbuf, GDK and GTK+。
You can test that your program only uses functions that properly support multihead (multiple monitor) systems by defining GDK_MULTIHEAD_SAFE and GTK_MULTIHEAD_SAFE.
4.2. GLib 2.18
GNOME 2.24 是第一个基于 GLib 2.18 的 GNOME 版本。
GLib 2.18 提供了在附加 API 和 GIO 中对字符串翻译更好支持的 C_() 和 NC_() 宏。
4.3. GTK+ 2.14
GNOME 2.24 是第一个基于 GTK+ 2.14 的 GNOME 版本。
An important change in this version of GTK+ is that all widgets that inherit from GtkAdjustment (e.g. spinbuttons and sliders) now strictly enforce their range as [lower, upper - page size], as per the documentation. If you want to ensure a range of [lower, upper], set page_size to 0.
All versions of Glade (including 3.4.1) currently create GtkSpinButton, GtkHScale and GtkVScale with a page_size of 10 by default. Developers should check any Glade files they have created to ensure the page size is a value that makes sense.
一个新的类,GtkMountOperation 因用于传递给 g_volume_mount 而被提供. GtkMountOperation 是一个 GMountOperation,可以在需要的时候显示认证对话。
A portable method for opening files and other URIs using the default application is now available using the function gtk_show_uri(), rather than having to depend on libgnome. GDK now provides an implementation of GAppLaunchContext for handling graphical applications (including startup notification and focus stealing prevention), GdkAppLaunchContext.
Also new in GTK+ 2.14 is a GFile-based API for GtkFileChooser and the ability for GtkBuilder to build fragments of an XML tree.
A complete list of new symbols is available for一个完整的新符号列表可以在 GTK+ 和 GDK.获得。
4.4. 即时消息工具库
Along with its new instant messaging client (see 第2.1节 ― 保持联系), GNOME 2.24 includes the libraries libempathy, libempathy-gtk and telepathy-glib that can be used to integrate instant messaging features into any GNOME application.
4.5. 桌面栏
The Match interface now includes two new methods: set_snippet and get_snippet. If a snippet is set it will be displayed in a new line underneath the match's get_verb value.
The Action interface has gained a new method get_tooltip. Overriding this method allows a tooltip to be shown when the user hovers the mouse over a match or action.