📄 gio-desktop-file-based-gappinfo.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><title>Desktop file based GAppInfo</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="GIO Reference Manual"><link rel="up" href="types.html" title="File types and applications"><link rel="prev" href="GAppInfo.html" title="GAppInfo"><link rel="next" href="volume_mon.html" title="Volumes and Drives"><meta name="generator" content="GTK-Doc V1.9 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="part" href="pt01.html" title="Part I. GIO Overview"><link rel="chapter" href="ch01.html" title="Introduction"><link rel="chapter" href="ch02.html" title="Compiling GIO applications"><link rel="chapter" href="ch03.html" title="Running GIO applications"><link rel="chapter" href="gio-extension-points.html" title="Extending GIO"><link rel="part" href="pt02.html" title="Part II. API Reference"><link rel="chapter" href="file_ops.html" title="File Operations"><link rel="chapter" href="file_mon.html" title="File System Monitoring"><link rel="chapter" href="async.html" title="Asynchronous I/O"><link rel="chapter" href="streaming.html" title="Streaming I/O"><link rel="chapter" href="types.html" title="File types and applications"><link rel="chapter" href="volume_mon.html" title="Volumes and Drives"><link rel="chapter" href="icons.html" title="Icons"><link rel="chapter" href="utils.html" title="Utilities"><link rel="chapter" href="extending.html" title="Extending GIO"><link rel="part" href="migrating.html" title="Part III. Migrating to GIO"><link rel="chapter" href="ch14.html" title="Migrating from POSIX to GIO"><link rel="chapter" href="ch15.html" title="Migrating from GnomeVFS to GIO"><link rel="chapter" href="gio-hierarchy.html" title="Object Hierarchy"><link rel="index" href="ix01.html" title="Index"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="GAppInfo.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="types.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GIO Reference Manual</th><td><a accesskey="n" href="volume_mon.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr><tr><td colspan="5" class="shortcuts"><nobr><a href="#id3091814" class="shortcut">Top</a>  |  <a href="#id3209216" class="shortcut">Description</a>  |  <a href="#id3209172" class="shortcut">Object Hierarchy</a>  |  <a href="#id3209195" class="shortcut">Implemented Interfaces</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="gio-Desktop-file-based-GAppInfo"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><a name="id3091814"></a><span class="refentrytitle">Desktop file based GAppInfo</span></h2><p>Desktop file based GAppInfo — Application information from desktop files</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><h2>Synopsis</h2><a name="GDesktopAppInfo"></a><pre class="synopsis">#include <gio/gdesktopappinfo.h> <a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfo-struct">GDesktopAppInfo</a>;<a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfo">GDesktopAppInfo</a>* <a class="link" href="gio-Desktop-file-based-GAppInfo.html#g-desktop-app-info-new-from-filename">g_desktop_app_info_new_from_filename</a> (const char *filename);<a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfo">GDesktopAppInfo</a>* <a class="link" href="gio-Desktop-file-based-GAppInfo.html#g-desktop-app-info-new">g_desktop_app_info_new</a> (const char *desktop_id);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="gio-Desktop-file-based-GAppInfo.html#g-desktop-app-info-get-is-hidden">g_desktop_app_info_get_is_hidden</a> (<a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfo">GDesktopAppInfo</a> *info);void <a class="link" href="gio-Desktop-file-based-GAppInfo.html#g-desktop-app-info-set-desktop-env">g_desktop_app_info_set_desktop_env</a> (const char *desktop_env); <a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfoLookup">GDesktopAppInfoLookup</a>;#define <a class="link" href="gio-Desktop-file-based-GAppInfo.html#G-DESKTOP-APP-INFO-LOOKUP-EXTENSION-POINT-NAME:CAPS">G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME</a><a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a>* <a class="link" href="gio-Desktop-file-based-GAppInfo.html#g-desktop-app-info-lookup-get-default-for-uri-scheme">g_desktop_app_info_lookup_get_default_for_uri_scheme</a> (<a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfoLookup">GDesktopAppInfoLookup</a> *lookup, const char *uri_scheme);</pre></div><div class="refsect1" lang="en"><a name="id3209172"></a><h2>Object Hierarchy</h2><pre class="synopsis"> <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a> +----GDesktopAppInfo</pre></div><div class="refsect1" lang="en"><a name="id3209195"></a><h2>Implemented Interfaces</h2><p>GDesktopAppInfo implements <a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a>.</p></div><div class="refsect1" lang="en"><a name="id3209216"></a><h2>Description</h2><p><a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfo"><span class="type">GDesktopAppInfo</span></a> is an implementation of <a class="link" href="GAppInfo.html" title="GAppInfo"><span class="type">GAppInfo</span></a> based ondesktop files.</p><p></p></div><div class="refsect1" lang="en"><a name="id3209250"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id3209261"></a><h3><a name="GDesktopAppInfo-struct"></a>GDesktopAppInfo</h3><a class="indexterm" name="id3212605"></a><pre class="programlisting">typedef struct _GDesktopAppInfo GDesktopAppInfo;</pre><p>Information about an installed application from a desktop file.</p><p></p></div><hr><div class="refsect2" lang="en"><a name="id3212626"></a><h3><a name="g-desktop-app-info-new-from-filename"></a>g_desktop_app_info_new_from_filename ()</h3><a class="indexterm" name="id3212637"></a><pre class="programlisting"><a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfo">GDesktopAppInfo</a>* g_desktop_app_info_new_from_filename (const char *filename);</pre><p>Creates a new <a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfo"><span class="type">GDesktopAppInfo</span></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td><td> a string containing a file name.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a new <a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfo"><span class="type">GDesktopAppInfo</span></a> or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3212723"></a><h3><a name="g-desktop-app-info-new"></a>g_desktop_app_info_new ()</h3><a class="indexterm" name="id3212734"></a><pre class="programlisting"><a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfo">GDesktopAppInfo</a>* g_desktop_app_info_new (const char *desktop_id);</pre><p>Creates a new <a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfo"><span class="type">GDesktopAppInfo</span></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>desktop_id</code></em> :</span></p></td><td> the desktop file id</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> a new <a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfo"><span class="type">GDesktopAppInfo</span></a>, or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> if no desktop file with that id</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3204824"></a><h3><a name="g-desktop-app-info-get-is-hidden"></a>g_desktop_app_info_get_is_hidden ()</h3><a class="indexterm" name="id3204835"></a><pre class="programlisting"><ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> g_desktop_app_info_get_is_hidden (<a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfo">GDesktopAppInfo</a> *info);</pre><p>A desktop file is hidden if the Hidden key in it isset to True.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>info</code></em> :</span></p></td><td> a <a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfo"><span class="type">GDesktopAppInfo</span></a>.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if hidden, <ahref="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise. </td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3204922"></a><h3><a name="g-desktop-app-info-set-desktop-env"></a>g_desktop_app_info_set_desktop_env ()</h3><a class="indexterm" name="id3204934"></a><pre class="programlisting">void g_desktop_app_info_set_desktop_env (const char *desktop_env);</pre><p>Sets the name of the desktop that the application is running in.This is used by <a class="link" href="GAppInfo.html#g-app-info-should-show"><code class="function">g_app_info_should_show()</code></a> to evaluate the<code class="literal">OnlyShowIn</code> and <code class="literal">NotShowIn</code>desktop entry fields.</p><p>The <a class="ulink" href="http://standards.freedesktop.org/menu-spec/latest/" target="_top">Desktop Menu specification</a> recognizes the following:</p><table class="simplelist" border="0" summary="Simple list"><tr><td>GNOME</td></tr><tr><td>KDE</td></tr><tr><td>ROX</td></tr><tr><td>XFCE</td></tr><tr><td>Old</td></tr></table><p></p><p>Should be called only once; subsequent calls are ignored.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>desktop_env</code></em> :</span></p></td><td> a string specifying what desktop this is</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3205044"></a><h3><a name="GDesktopAppInfoLookup"></a>GDesktopAppInfoLookup</h3><a class="indexterm" name="id3205055"></a><pre class="programlisting">typedef struct _GDesktopAppInfoLookup GDesktopAppInfoLookup;</pre><p>Interface that is used by backends to associate default handlers with URI schemes.</p><p></p></div><hr><div class="refsect2" lang="en"><a name="id3205076"></a><h3><a name="G-DESKTOP-APP-INFO-LOOKUP-EXTENSION-POINT-NAME:CAPS"></a>G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME</h3><a class="indexterm" name="id3205090"></a><pre class="programlisting">#define G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME "gio-desktop-app-info-lookup"</pre><p>Extension point for default handler to URI association. SeeExtending GIO.</p><p></p></div><hr><div class="refsect2" lang="en"><a name="id3205119"></a><h3><a name="g-desktop-app-info-lookup-get-default-for-uri-scheme"></a>g_desktop_app_info_lookup_get_default_for_uri_scheme ()</h3><a class="indexterm" name="id3205133"></a><pre class="programlisting"><a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a>* g_desktop_app_info_lookup_get_default_for_uri_scheme (<a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfoLookup">GDesktopAppInfoLookup</a> *lookup, const char *uri_scheme);</pre><p>Gets the default application for launching applications using this URI scheme for a particular GDesktopAppInfoLookupimplementation.</p><p>The GDesktopAppInfoLookup interface and this function is usedto implement <a class="link" href="GAppInfo.html#g-app-info-get-default-for-uri-scheme"><code class="function">g_app_info_get_default_for_uri_scheme()</code></a> backendsin a GIO module. There is no reason for applications to use itdirectly. Applications should use <a class="link" href="GAppInfo.html#g-app-info-get-default-for-uri-scheme"><code class="function">g_app_info_get_default_for_uri_scheme()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>lookup</code></em> :</span></p></td><td> a <a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfoLookup"><span class="type">GDesktopAppInfoLookup</span></a></td></tr><tr><td><p><span class="term"><em class="parameter"><code>uri_scheme</code></em> :</span></p></td><td> a string containing a URI scheme.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> <a class="link" href="GAppInfo.html" title="GAppInfo"><span class="type">GAppInfo</span></a> for given <em class="parameter"><code>uri_scheme</code></em> or <ahref="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.</td></tr></tbody></table></div></div></div><div class="refsect1" lang="en"><a name="id3209574"></a><div class="refsect2" lang="en"><a name="id3209575"></a></div><hr><div class="refsect2" lang="en"><a name="id3209576"></a></div></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -