2009-09-12 41 views

回答

1

有使用MIME類型爲你(在頭如<libgnomevfs/gnome-vfs-mime-handlers.h>申報)處理侏儒API,但我認爲,瞭解什麼是幕後發生的事情也很有用。

特定的功能,本質上閱讀,分析和目前某些配置文件的內容給你,here是文件的明確解釋,即GNOME使用到MIME類型與文件相關聯,即:

extension .mime in the $gnome/share/mime-info directory or from the ~/.gnome/mime-info directory.

The file $gnome/share/mime-info/gnome.mime is special, as it contains the defaults for gnome, and is read first. In addition, the file ~/.gnome/mime-info/user.mime is read last.

正如在這個URL的「默認鍵」一節中所解釋的那樣,諸如open,view等鍵是給你用於各種通用動作(以及通過「標籤」,用於特定命名動作)的命令。

有關使用API​​的C代碼示例,請參閱this thread的結尾。

+0

我無法獲得提到的線程中編譯的程序。它包含一個文件config.h,它不存在於我的/ usr/include /中。 此外,我在包含的頭文件中收到了很多編譯器錯誤。如何解決這個問題? 像這些: /usr/include/glib/gconvert.h:108:錯誤:預期聲明說明符或'...'在'gssize'之前 另一個錯誤: /usr/include/glib/gi18n-lib。 h:27:2:error:#error在包含gi18n-lib.h之前,您必須定義GETTEXT_PACKAGE。 – 2009-09-12 17:41:14

相關問題