給開發者的新功能

下列的變更對於使用 GNOME 3.2 開發平臺的開發者而言很重要。如果您對這些關於開發平臺的變更不感興趣,可以直接跳到 第 5 節 ― 國際化

包含在 GNOME 3.2 中的是最新釋出 GNOME 開發者平臺,並提供了依 GNU LGPL 授權的 API 和 ABI 穩定版程式庫,可供開發跨平台的應用程式。

For information on developing with GNOME please visit the GNOME Developer Center.

4.1. GLib 2.30

GNOME 的低階軟體公用程式庫 GLib 已可見到許多改進:

  • GApplication 現在可以用於非特定的應用程式。
  • GLib 現在會為 Unix 指定的 API 安裝個別的標頭:glib-unix.h。除此之外,它為 Unix 信號提供了主迴圈來源。
  • GDBus 支援 'object manager' 模式,具有許多新的介面。
  • GDBus 現在也有程式碼產生器:gdbus-codegen
  • Atomic operations have been rewritten to use gcc builtins; calls with explicit casts may be problematic.
  • Atomic operations on pointers have been added, including bit-locks on pointer-size locations.
  • The units policy has been changed to prefer SI units; g_format_size_for_display has been deprecated in favor of g_format_size.
  • 支援 HMAC 數字已經加入:GHmac
  • 加入了對憑證與金鑰查詢的介面:GTlsDatabase。這個實作是由 glib-networking 所提供。

4.2. GTK+ 3.2

GTK+ 3.2 是最新的 GTK+ 工具組,也是 GNOME. GTK+ 3.2 的核心,加入了給開發者的新功能,以及廣泛的臭蟲修正。

  • 項目現在可以包含提示。請查閱 gtk_entry_set_placeholder_text
  • Many more widgets support height-for-width geometry management. It is important to set reasonable sizes on labels and check window sizes.
  • New widgets:
    • GtkLockButton 用於管理者權限的操作,如同某些在 control-center 面板中所見到的。
    • GtkOverlay 用來控制在內容區域中的浮動,如同在網頁瀏覽器中所見。
    • GtkFontChooserDialog,一個新的字型選擇對話盒。
  • 對 CSS 布景的支援有多項改進,包含對主要和行內工具列的樣式類別。
  • HTML 後端 Broadway (使用 websockets 在瀏覽器中呈現) 有了進步,但仍處於實驗階段。這可能讓您可以在自己的伺服器上執行自己的程式然後在任何地方存取它;或是將它放在公開伺服器上,為每個使用者產生新的應用程式實體。注意這項功能需要在編譯 GTK+ 時加上 --enable-x11-backend --enable-broadway-backend,並且在執行階段加上 GDK_BACKEND 環境變數。
  • Support for reftests has been added to make it easier to write test cases.
  • Various GTK+ performance improvements have taken place in the areas of caching size requests, reading CSS styling information, and widget size computation.

4.3. Clutter 1.8

GNOME 的硬體加速使用者介面圖形程式庫 Clutter 提供了下列改進:

  • 新的動作,像是 ClutterGestureAction 手勢辨識程式、ClutterSwipeAction 用來偵測輕劃手勢、ClutterDropAction 為當使用 ClutterDragAction 時使用者拖放目標時的動作、以及 ClutterClickAction 用來支援長按的動作。
  • ClutterState transitions can be bound to object signals when creating a scene in ClutterScript.
  • 強化的 Cairo 繪製整合
  • Cogl,Clutter 使用的 GPU 程式化介面,已分離為個別的程式庫。

4.4. Use of Deprecated Libraries

未來的方向已定為持續努力將過時的技術替換為更好的功能。

  • GConf 現在預設使用D-Bus 因此不再需要 ORBit2。也因為如此廢棄的程式庫 ORBit2libIDL 已從 GNOME 移除。
  • GNOME 核心模組現在只相依於以 introspection 為基礎的 Python 綁定 (pygobject-3) ,因此 pygtkgnome-pythongnome-python-desktop 都不再需要了。
  • 許多應用程式 (例如 AccerciserDasherGHex、圖形化偵錯工具 Nemiver 和密碼與加密金鑰管理工具 Seahorse) 現在使用 GSettings 取代 GConf 做為儲存的後端程式。
  • 許多套件,像是 Epiphany 網頁瀏覽器,已經從使用 dbus-glib 轉換為GDBus 並且從 libunique 改成 G(tk)Application

4.5. 更輕鬆的使用 JHBuild 編譯 GNOME

GNOME 的組建工具 JHBuild 只要您系統上安裝的模組夠新就不會再重新編譯它。這是由組態選項 partial_build 來控制並且是預設啟用的。指令 jhbuild sysdeps 可以列出已找到哪些系統模組以及需要編譯的模組。

如果您使用最近的發行版來從頭組建 GNOME,這樣可以輕鬆的減少要編譯的模組清單中的 50 個模組。

4.6. Miscellaneous Developer Updates

其他 GNOME 平台在 GNOME 3.2 中的改進包括:

  • The classic (static) Python bindings were removed for PyGObject 3.0 and only dynamic Python bindings are provided (via introspection). PyGObject 2 and 3 are parallel-installable as introspection is turned off by default in the PyGObject 2 packages. Information on how to port applications from PyGObject 2 to PyGObject 3 is available.
  • Tracker 0.12 版提供了對 Firefox ≥ 4.0, Thunderbird ≥ 5.0, MeeGoTouch, 許多額外的 SPARQL 參數、從 EPub 檔案匯出和桌面檔案的本地 XDG 目錄的支援。
  • NetworkManager version 0.9 provides introspection support and a simplified D-Bus API. Information how to port applications from NetworkManager 0.8 to 0.9 is available.
  • As part of the aforementioned effort to use and promote PKCS#11 as glue between encryption libraries, various parts of gnome-keyring have been split into desktop-independent libraries.
  • GtkSourceView 現在支援對 Markdown 和 Standard ML 檔案的語法突顯。
  • Evolution-Data-Server received many introspection support fixes.
  • libfolks 現在已成為 Evolution-Data-Server 的後端程式,用於新的 Contacts 應用程式。
  • 用來處理文件的工具,gnome-doc-utilsxml2po 正緩慢的替換為 yelp-toolsitstoolyelp-xsl 包含了一些實驗性的 Mallard 擴充功能,像是條件處理和動態術語。