📄 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>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="gio-GContentType.html" title="GContentType"><link rel="next" href="gio-Desktop-file-based-GAppInfo.html" title="Desktop file based GAppInfo"><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="gio-GContentType.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="gio-Desktop-file-based-GAppInfo.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="#id3141408" class="shortcut">Top</a>  |  <a href="#id3210453" class="shortcut">Description</a>  |  <a href="#id3210385" class="shortcut">Object Hierarchy</a>  |  <a href="#id3210409" class="shortcut">Prerequisites</a>  |  <a href="#id3210431" class="shortcut">Known Implementations</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="GAppInfo"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><a name="id3141408"></a><span class="refentrytitle">GAppInfo</span></h2><p>GAppInfo — Application information and launch contexts</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">#include <gio/gio.h>enum <a class="link" href="GAppInfo.html#GAppInfoCreateFlags">GAppInfoCreateFlags</a>; <a class="link" href="GAppInfo.html#GAppInfo-struct">GAppInfo</a>; <a class="link" href="GAppInfo.html#GAppInfoIface">GAppInfoIface</a>; <a class="link" href="GAppInfo.html#GAppLaunchContext">GAppLaunchContext</a>;<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a>* <a class="link" href="GAppInfo.html#g-app-info-create-from-commandline">g_app_info_create_from_commandline</a> (const char *commandline, const char *application_name, <a class="link" href="GAppInfo.html#GAppInfoCreateFlags">GAppInfoCreateFlags</a> flags, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a>* <a class="link" href="GAppInfo.html#g-app-info-dup">g_app_info_dup</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GAppInfo.html#g-app-info-equal">g_app_info_equal</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo1, <a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo2);const char* <a class="link" href="GAppInfo.html#g-app-info-get-id">g_app_info_get_id</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo);const char* <a class="link" href="GAppInfo.html#g-app-info-get-name">g_app_info_get_name</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo);const char* <a class="link" href="GAppInfo.html#g-app-info-get-description">g_app_info_get_description</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo);const char* <a class="link" href="GAppInfo.html#g-app-info-get-executable">g_app_info_get_executable</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo);<a class="link" href="GIcon.html" title="GIcon">GIcon</a>* <a class="link" href="GAppInfo.html#g-app-info-get-icon">g_app_info_get_icon</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GAppInfo.html#g-app-info-launch">g_app_info_launch</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo, <ahref="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList">GList</a> *files, <a class="link" href="GAppInfo.html#GAppLaunchContext">GAppLaunchContext</a> *launch_context, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GAppInfo.html#g-app-info-supports-files">g_app_info_supports_files</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GAppInfo.html#g-app-info-supports-uris">g_app_info_supports_uris</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GAppInfo.html#g-app-info-launch-uris">g_app_info_launch_uris</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo, <ahref="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList">GList</a> *uris, <a class="link" href="GAppInfo.html#GAppLaunchContext">GAppLaunchContext</a> *launch_context, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GAppInfo.html#g-app-info-should-show">g_app_info_should_show</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GAppInfo.html#g-app-info-set-as-default-for-type">g_app_info_set_as_default_for_type</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo, const char *content_type, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GAppInfo.html#g-app-info-set-as-default-for-extension">g_app_info_set_as_default_for_extension</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo, const char *extension, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GAppInfo.html#g-app-info-add-supports-type">g_app_info_add_supports_type</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo, const char *content_type, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GAppInfo.html#g-app-info-can-remove-supports-type">g_app_info_can_remove_supports_type</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GAppInfo.html#g-app-info-remove-supports-type">g_app_info_remove_supports_type</a> (<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *appinfo, const char *content_type, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);<ahref="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList">GList</a>* <a class="link" href="GAppInfo.html#g-app-info-get-all">g_app_info_get_all</a> (void);<ahref="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList">GList</a>* <a class="link" href="GAppInfo.html#g-app-info-get-all-for-type">g_app_info_get_all_for_type</a> (const char *content_type);<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a>* <a class="link" href="GAppInfo.html#g-app-info-get-default-for-type">g_app_info_get_default_for_type</a> (const char *content_type, <ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> must_support_uris);<a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a>* <a class="link" href="GAppInfo.html#g-app-info-get-default-for-uri-scheme">g_app_info_get_default_for_uri_scheme</a> (const char *uri_scheme);<ahref="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="GAppInfo.html#g-app-info-launch-default-for-uri">g_app_info_launch_default_for_uri</a> (const char *uri, <a class="link" href="GAppInfo.html#GAppLaunchContext">GAppLaunchContext</a> *launch_context, <ahref="/usr/share/gtk-doc/html/glib/glib-Error-Reporting.html#GError">GError</a> **error);char* <a class="link" href="GAppInfo.html#g-app-launch-context-get-display">g_app_launch_context_get_display</a> (<a class="link" href="GAppInfo.html#GAppLaunchContext">GAppLaunchContext</a> *context, <a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *info, <ahref="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList">GList</a> *files);char* <a class="link" href="GAppInfo.html#g-app-launch-context-get-startup-notify-id">g_app_launch_context_get_startup_notify_id</a> (<a class="link" href="GAppInfo.html#GAppLaunchContext">GAppLaunchContext</a> *context, <a class="link" href="GAppInfo.html" title="GAppInfo">GAppInfo</a> *info, <ahref="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList">GList</a> *files);void <a class="link" href="GAppInfo.html#g-app-launch-context-launch-failed">g_app_launch_context_launch_failed</a> (<a class="link" href="GAppInfo.html#GAppLaunchContext">GAppLaunchContext</a> *context, const char *startup_notify_id);<a class="link" href="GAppInfo.html#GAppLaunchContext">GAppLaunchContext</a>* <a class="link" href="GAppInfo.html#g-app-launch-context-new">g_app_launch_context_new</a> (void);</pre></div><div class="refsect1" lang="en"><a name="id3210385"></a><h2>Object Hierarchy</h2><pre class="synopsis"> GInterface +----GAppInfo</pre></div><div class="refsect1" lang="en"><a name="id3210409"></a><h2>Prerequisites</h2><p>GAppInfo requires <ahref="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>.</p></div><div class="refsect1" lang="en"><a name="id3210431"></a><h2>Known Implementations</h2><p>GAppInfo is implemented by <a class="link" href="gio-Desktop-file-based-GAppInfo.html#GDesktopAppInfo">GDesktopAppInfo</a>.</p></div><div class="refsect1" lang="en"><a name="id3210453"></a><h2>Description</h2><p><a class="link" href="GAppInfo.html" title="GAppInfo"><span class="type">GAppInfo</span></a> and <a class="link" href="GAppInfo.html#GAppLaunchContext"><span class="type">GAppLaunchContext</span></a> are used for describing and launching applications installed on the system.</p><p></p></div><div class="refsect1" lang="en"><a name="id3210488"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id3210499"></a><h3><a name="GAppInfoCreateFlags"></a>enum GAppInfoCreateFlags</h3><a class="indexterm" name="id3210511"></a><pre class="programlisting">typedef enum { G_APP_INFO_CREATE_NONE = 0, /*< nick=none >*/ G_APP_INFO_CREATE_NEEDS_TERMINAL = (1<<0), /*< nick=needs-terminal >*/ G_APP_INFO_CREATE_SUPPORTS_URIS = (1<<1) /*< nick=supports-uris >*/} GAppInfoCreateFlags;</pre><p>Flags used when creating a <a class="link" href="GAppInfo.html" title="GAppInfo"><span class="type">GAppInfo</span></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a name="G-APP-INFO-CREATE-NONE:CAPS"></a><code class="literal">G_APP_INFO_CREATE_NONE</code></span></p></td><td> No flags.</td></tr><tr><td><p><span class="term"><a name="G-APP-INFO-CREATE-NEEDS-TERMINAL:CAPS"></a><code class="literal">G_APP_INFO_CREATE_NEEDS_TERMINAL</code></span></p></td><td> Application opens in a terminal window.</td></tr><tr><td><p><span class="term"><a name="G-APP-INFO-CREATE-SUPPORTS-URIS:CAPS"></a><code class="literal">G_APP_INFO_CREATE_SUPPORTS_URIS</code></span></p></td><td> Application supports URI arguments.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3210610"></a><h3><a name="GAppInfo-struct"></a>GAppInfo</h3><a class="indexterm" name="id3210622"></a><pre class="programlisting">typedef struct _GAppInfo GAppInfo;</pre><p>Information about an installed application and methods to launchit (with file arguments).</p><p></p></div><hr><div class="refsect2" lang="en"><a name="id3210643"></a><h3><a name="GAppInfoIface"></a>GAppInfoIface</h3><a class="indexterm" name="id3210656"></a><pre class="programlisting">typedef struct { GTypeInterface g_iface; /* Virtual Table */ GAppInfo * (*dup) (GAppInfo *appinfo); gboolean (*equal) (GAppInfo *appinfo1, GAppInfo *appinfo2); const char * (*get_id) (GAppInfo *appinfo); const char * (*get_name) (GAppInfo *appinfo); const char * (*get_description) (GAppInfo *appinfo); const char * (*get_executable) (GAppInfo *appinfo); GIcon * (*get_icon) (GAppInfo *appinfo); gboolean (*launch) (GAppInfo *appinfo,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -