<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="GAppInfo">
<refmeta>
<refentrytitle role="top_of_page" id="GAppInfo.top_of_page">GAppInfo</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GIO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GAppInfo</refname>
<refpurpose>Application information and launch contexts</refpurpose>
</refnamediv>

<refsynopsisdiv id="GAppInfo.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>
<anchor id="GAppLaunchContext"/>
<synopsis>

#include &lt;gio/gio.h&gt;

enum                <link linkend="GAppInfoCreateFlags">GAppInfoCreateFlags</link>;
                    <link linkend="GAppInfo-struct">GAppInfo</link>;
                    <link linkend="GAppInfoIface">GAppInfoIface</link>;
                    <link linkend="GAppLaunchContext-struct">GAppLaunchContext</link>;
<link linkend="GAppInfo">GAppInfo</link> *          <link linkend="g-app-info-create-from-commandline">g_app_info_create_from_commandline</link>  (const <link linkend="char">char</link> *commandline,
                                                         const <link linkend="char">char</link> *application_name,
                                                         <link linkend="GAppInfoCreateFlags">GAppInfoCreateFlags</link> flags,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="GAppInfo">GAppInfo</link> *          <link linkend="g-app-info-dup">g_app_info_dup</link>                      (<link linkend="GAppInfo">GAppInfo</link> *appinfo);
<link linkend="gboolean">gboolean</link>            <link linkend="g-app-info-equal">g_app_info_equal</link>                    (<link linkend="GAppInfo">GAppInfo</link> *appinfo1,
                                                         <link linkend="GAppInfo">GAppInfo</link> *appinfo2);
const <link linkend="char">char</link> *        <link linkend="g-app-info-get-id">g_app_info_get_id</link>                   (<link linkend="GAppInfo">GAppInfo</link> *appinfo);
const <link linkend="char">char</link> *        <link linkend="g-app-info-get-name">g_app_info_get_name</link>                 (<link linkend="GAppInfo">GAppInfo</link> *appinfo);
const <link linkend="char">char</link> *        <link linkend="g-app-info-get-description">g_app_info_get_description</link>          (<link linkend="GAppInfo">GAppInfo</link> *appinfo);
const <link linkend="char">char</link> *        <link linkend="g-app-info-get-executable">g_app_info_get_executable</link>           (<link linkend="GAppInfo">GAppInfo</link> *appinfo);
const <link linkend="char">char</link> *        <link linkend="g-app-info-get-commandline">g_app_info_get_commandline</link>          (<link linkend="GAppInfo">GAppInfo</link> *appinfo);
<link linkend="GIcon">GIcon</link> *             <link linkend="g-app-info-get-icon">g_app_info_get_icon</link>                 (<link linkend="GAppInfo">GAppInfo</link> *appinfo);
<link linkend="gboolean">gboolean</link>            <link linkend="g-app-info-launch">g_app_info_launch</link>                   (<link linkend="GAppInfo">GAppInfo</link> *appinfo,
                                                         <link linkend="GList">GList</link> *files,
                                                         <link linkend="GAppLaunchContext">GAppLaunchContext</link> *launch_context,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="g-app-info-supports-files">g_app_info_supports_files</link>           (<link linkend="GAppInfo">GAppInfo</link> *appinfo);
<link linkend="gboolean">gboolean</link>            <link linkend="g-app-info-supports-uris">g_app_info_supports_uris</link>            (<link linkend="GAppInfo">GAppInfo</link> *appinfo);
<link linkend="gboolean">gboolean</link>            <link linkend="g-app-info-launch-uris">g_app_info_launch_uris</link>              (<link linkend="GAppInfo">GAppInfo</link> *appinfo,
                                                         <link linkend="GList">GList</link> *uris,
                                                         <link linkend="GAppLaunchContext">GAppLaunchContext</link> *launch_context,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="g-app-info-should-show">g_app_info_should_show</link>              (<link linkend="GAppInfo">GAppInfo</link> *appinfo);
<link linkend="gboolean">gboolean</link>            <link linkend="g-app-info-can-delete">g_app_info_can_delete</link>               (<link linkend="GAppInfo">GAppInfo</link> *appinfo);
<link linkend="gboolean">gboolean</link>            <link linkend="g-app-info-delete">g_app_info_delete</link>                   (<link linkend="GAppInfo">GAppInfo</link> *appinfo);
<link linkend="void">void</link>                <link linkend="g-app-info-reset-type-associations">g_app_info_reset_type_associations</link>  (const <link linkend="char">char</link> *content_type);
<link linkend="gboolean">gboolean</link>            <link linkend="g-app-info-set-as-default-for-type">g_app_info_set_as_default_for_type</link>  (<link linkend="GAppInfo">GAppInfo</link> *appinfo,
                                                         const <link linkend="char">char</link> *content_type,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="g-app-info-set-as-default-for-extension">g_app_info_set_as_default_for_extension</link>
                                                        (<link linkend="GAppInfo">GAppInfo</link> *appinfo,
                                                         const <link linkend="char">char</link> *extension,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="g-app-info-add-supports-type">g_app_info_add_supports_type</link>        (<link linkend="GAppInfo">GAppInfo</link> *appinfo,
                                                         const <link linkend="char">char</link> *content_type,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="gboolean">gboolean</link>            <link linkend="g-app-info-can-remove-supports-type">g_app_info_can_remove_supports_type</link> (<link linkend="GAppInfo">GAppInfo</link> *appinfo);
<link linkend="gboolean">gboolean</link>            <link linkend="g-app-info-remove-supports-type">g_app_info_remove_supports_type</link>     (<link linkend="GAppInfo">GAppInfo</link> *appinfo,
                                                         const <link linkend="char">char</link> *content_type,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="GList">GList</link> *             <link linkend="g-app-info-get-all">g_app_info_get_all</link>                  (void);
<link linkend="GList">GList</link> *             <link linkend="g-app-info-get-all-for-type">g_app_info_get_all_for_type</link>         (const <link linkend="char">char</link> *content_type);
<link linkend="GAppInfo">GAppInfo</link> *          <link linkend="g-app-info-get-default-for-type">g_app_info_get_default_for_type</link>     (const <link linkend="char">char</link> *content_type,
                                                         <link linkend="gboolean">gboolean</link> must_support_uris);
<link linkend="GAppInfo">GAppInfo</link> *          <link linkend="g-app-info-get-default-for-uri-scheme">g_app_info_get_default_for_uri_scheme</link>
                                                        (const <link linkend="char">char</link> *uri_scheme);
<link linkend="gboolean">gboolean</link>            <link linkend="g-app-info-launch-default-for-uri">g_app_info_launch_default_for_uri</link>   (const <link linkend="char">char</link> *uri,
                                                         <link linkend="GAppLaunchContext">GAppLaunchContext</link> *launch_context,
                                                         <link linkend="GError">GError</link> **error);
<link linkend="char">char</link> *              <link linkend="g-app-launch-context-get-display">g_app_launch_context_get_display</link>    (<link linkend="GAppLaunchContext">GAppLaunchContext</link> *context,
                                                         <link linkend="GAppInfo">GAppInfo</link> *info,
                                                         <link linkend="GList">GList</link> *files);
<link linkend="char">char</link> *              <link linkend="g-app-launch-context-get-startup-notify-id">g_app_launch_context_get_startup_notify_id</link>
                                                        (<link linkend="GAppLaunchContext">GAppLaunchContext</link> *context,
                                                         <link linkend="GAppInfo">GAppInfo</link> *info,
                                                         <link linkend="GList">GList</link> *files);
<link linkend="void">void</link>                <link linkend="g-app-launch-context-launch-failed">g_app_launch_context_launch_failed</link>  (<link linkend="GAppLaunchContext">GAppLaunchContext</link> *context,
                                                         const <link linkend="char">char</link> *startup_notify_id);
<link linkend="GAppLaunchContext">GAppLaunchContext</link> * <link linkend="g-app-launch-context-new">g_app_launch_context_new</link>            (void);
</synopsis>
</refsynopsisdiv>

<refsect1 id="GAppInfo.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GInterface">GInterface</link>
   +----GAppInfo
</synopsis>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GAppLaunchContext
</synopsis>
</refsect1>

<refsect1 id="GAppInfo.prerequisites" role="prerequisites">
<title role="prerequisites.title">Prerequisites</title>
<para>
GAppInfo requires
 <link linkend="GObject">GObject</link>.</para>
</refsect1>



<refsect1 id="GAppInfo.implementations" role="implementations">
<title role="implementations.title">Known Implementations</title>
<para>
GAppInfo is implemented by
 <link linkend="GDesktopAppInfo">GDesktopAppInfo</link>.</para>
</refsect1>




<refsect1 id="GAppInfo.description" role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="GAppInfo"><type>GAppInfo</type></link> and <link linkend="GAppLaunchContext"><type>GAppLaunchContext</type></link> are used for describing and launching 
applications installed on the system.
</para>
<para>
As of GLib 2.20, URIs will always be converted to POSIX paths
(using <link linkend="g-file-get-path"><function>g_file_get_path()</function></link>) when using <link linkend="g-app-info-launch"><function>g_app_info_launch()</function></link> even if
the application requested an URI and not a POSIX path. For example
for an desktop-file based application with Exec key <literal>totem
%<link linkend="U--CAPS"><literal>U</literal></link></literal> and a single URI,
<literal>sftp://foo/file.avi</literal>, then
<literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
passed. This will only work if a set of suitable GIO extensions
(such as gvfs 2.26 compiled with FUSE support), is available and
operational; if this is not the case, the URI will be passed
unmodified to the application. Some URIs, such as
<literal>mailto:</literal>, of course cannot be mapped to a POSIX
path (in gvfs there's no FUSE mount for it); such URIs will be
passed unmodified to the application.
</para>
<para>
Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
back to the GIO URI in the <link linkend="GFile"><type>GFile</type></link> constructors (since gvfs
implements the <link linkend="GVfs"><type>GVfs</type></link> extension point). As such, if the application
needs to examine the URI, it needs to use <link linkend="g-file-get-uri"><function>g_file_get_uri()</function></link> or
similar on <link linkend="GFile"><type>GFile</type></link>. In other words, an application cannot assume
that the URI passed to e.g. <link linkend="g-file-new-for-commandline-arg"><function>g_file_new_for_commandline_arg()</function></link> is
equal to the result of <link linkend="g-file-get-uri"><function>g_file_get_uri()</function></link>. The following snippet
illustrates this:
</para>
<para>
<programlisting>
GFile *f;
char *uri;

file = g_file_new_for_commandline_arg (uri_from_commandline);

uri = g_file_get_uri (file);
strcmp (uri, uri_from_commandline) == 0; // FALSE
g_free (uri);

if (g_file_has_uri_scheme (file, "cdda"))
  {
    // do something special with uri
  }
g_object_unref (file);
</programlisting>
</para>
<para>
This code will work when both <literal>cdda://sr0/Track
1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
1.wav</literal> is passed to the application. It should be noted
that it's generally not safe for applications to rely on the format
of a particular URIs. Different launcher applications (e.g. file
managers) may have different ideas of what a given URI means.</para>
<para>
</para>
</refsect1>

<refsect1 id="GAppInfo.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GAppInfoCreateFlags" role="enum">
<title>enum GAppInfoCreateFlags</title>
<indexterm zone="GAppInfoCreateFlags"><primary sortas="AppInfoCreateFlags">GAppInfoCreateFlags</primary></indexterm><programlisting>typedef enum {
  G_APP_INFO_CREATE_NONE           = 0,         /*&lt; nick=none &gt;*/
  G_APP_INFO_CREATE_NEEDS_TERMINAL = (1 &lt;&lt; 0),  /*&lt; nick=needs-terminal &gt;*/
  G_APP_INFO_CREATE_SUPPORTS_URIS  = (1 &lt;&lt; 1)   /*&lt; nick=supports-uris &gt;*/
} GAppInfoCreateFlags;
</programlisting>
<para>
Flags used when creating a <link linkend="GAppInfo"><type>GAppInfo</type></link>.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-APP-INFO-CREATE-NONE--CAPS" role="constant">
<term><literal>G_APP_INFO_CREATE_NONE</literal></term>
<listitem><simpara> No flags.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-APP-INFO-CREATE-NEEDS-TERMINAL--CAPS" role="constant">
<term><literal>G_APP_INFO_CREATE_NEEDS_TERMINAL</literal></term>
<listitem><simpara> Application opens in a terminal window.
</simpara></listitem>
</varlistentry>
<varlistentry id="G-APP-INFO-CREATE-SUPPORTS-URIS--CAPS" role="constant">
<term><literal>G_APP_INFO_CREATE_SUPPORTS_URIS</literal></term>
<listitem><simpara> Application supports URI arguments.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GAppInfo-struct" role="struct">
<title>GAppInfo</title>
<indexterm zone="GAppInfo-struct"><primary sortas="AppInfo">GAppInfo</primary></indexterm><programlisting>typedef struct _GAppInfo GAppInfo;</programlisting>
<para>
Information about an installed application and methods to launch
it (with file arguments).</para>
<para>
</para></refsect2>
<refsect2 id="GAppInfoIface" role="struct">
<title>GAppInfoIface</title>
<indexterm zone="GAppInfoIface"><primary sortas="AppInfoIface">GAppInfoIface</primary></indexterm><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,
                                                 GList              *filenames,
                                                 GAppLaunchContext  *launch_context,
                                                 GError            **error);
  gboolean     (* supports_uris)                (GAppInfo           *appinfo);
  gboolean     (* supports_files)               (GAppInfo           *appinfo);
  gboolean     (* launch_uris)                  (GAppInfo           *appinfo,
                                                 GList              *uris,
                                                 GAppLaunchContext  *launch_context,
                                                 GError            **error);
  gboolean     (* should_show)                  (GAppInfo           *appinfo);

  /* For changing associations */
  gboolean     (* set_as_default_for_type)      (GAppInfo           *appinfo,
                                                 const char         *content_type,
                                                 GError            **error);
  gboolean     (* set_as_default_for_extension) (GAppInfo           *appinfo,
                                                 const char         *extension,
                                                 GError            **error);
  gboolean     (* add_supports_type)            (GAppInfo           *appinfo,
                                                 const char         *content_type,
                                                 GError            **error);
  gboolean     (* can_remove_supports_type)     (GAppInfo           *appinfo);
  gboolean     (* remove_supports_type)         (GAppInfo           *appinfo,
                                                 const char         *content_type,
                                                 GError            **error);
  gboolean     (* can_delete)                   (GAppInfo           *appinfo);
  gboolean     (* do_delete)                    (GAppInfo           *appinfo);
  const char * (* get_commandline)              (GAppInfo           *appinfo);
} GAppInfoIface;
</programlisting>
<para>
Application Information interface, for operating system portability.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="GTypeInterface">GTypeInterface</link>&#160;<structfield>g_iface</structfield>;</term>
<listitem><simpara> The parent interface.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>dup</structfield>&#160;()</term>
<listitem><simpara> Copies a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>equal</structfield>&#160;()</term>
<listitem><simpara> Checks two <link linkend="GAppInfo"><type>GAppInfo</type></link><!-- -->s for equality.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_id</structfield>&#160;()</term>
<listitem><simpara> Gets a string identifier for a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_name</structfield>&#160;()</term>
<listitem><simpara> Gets the name of the application for a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_description</structfield>&#160;()</term>
<listitem><simpara> Gets a short description for the application described by the <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_executable</structfield>&#160;()</term>
<listitem><simpara> Gets the execuable name for the <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_icon</structfield>&#160;()</term>
<listitem><simpara> Gets the <link linkend="GIcon"><type>GIcon</type></link> for the <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>launch</structfield>&#160;()</term>
<listitem><simpara> Launches an application specified by the <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>supports_uris</structfield>&#160;()</term>
<listitem><simpara> Indicates whether the application specified supports launching URIs.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>supports_files</structfield>&#160;()</term>
<listitem><simpara> Indicates whether the application specified accepts filename arguments.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>launch_uris</structfield>&#160;()</term>
<listitem><simpara> Launches an application with a list of URIs.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>should_show</structfield>&#160;()</term>
<listitem><simpara> Returns whether an application should be shown (e.g. when getting a list of installed applications).
<ulink url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
<citetitle>FreeDesktop.Org Startup Notification Specification</citetitle></ulink>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>set_as_default_for_type</structfield>&#160;()</term>
<listitem><simpara> Sets an application as default for a given content type.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>set_as_default_for_extension</structfield>&#160;()</term>
<listitem><simpara> Sets an application as default for a given file extention.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>add_supports_type</structfield>&#160;()</term>
<listitem><simpara> Adds to the <link linkend="GAppInfo"><type>GAppInfo</type></link> information about supported file types.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>can_remove_supports_type</structfield>&#160;()</term>
<listitem><simpara> Checks for support for removing supported file types from a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>remove_supports_type</structfield>&#160;()</term>
<listitem><simpara> Removes a supported application type from a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>can_delete</structfield>&#160;()</term>
<listitem><simpara> Checks if a <link linkend="GAppInfo"><type>GAppInfo</type></link> can be deleted. Since 2.20
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>do_delete</structfield>&#160;()</term>
<listitem><simpara> Deletes a <link linkend="GAppInfo"><type>GAppInfo</type></link>. Since 2.20
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_commandline</structfield>&#160;()</term>
<listitem><simpara> Gets the commandline for the <link linkend="GAppInfo"><type>GAppInfo</type></link>. Since 2.20
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GAppLaunchContext-struct" role="struct">
<title>GAppLaunchContext</title>
<indexterm zone="GAppLaunchContext-struct"><primary sortas="AppLaunchContext">GAppLaunchContext</primary></indexterm><programlisting>typedef struct _GAppLaunchContext GAppLaunchContext;</programlisting>
<para>
Integrating the launch with the launching application. This is used to
handle for instance startup notification and launching the new application
on the same screen as the launching window.</para>
<para>
</para><variablelist role="struct">
</variablelist></refsect2>
<refsect2 id="g-app-info-create-from-commandline" role="function">
<title>g_app_info_create_from_commandline ()</title>
<indexterm zone="g-app-info-create-from-commandline"><primary sortas="app_info_create_from_commandline">g_app_info_create_from_commandline</primary></indexterm><programlisting><link linkend="GAppInfo">GAppInfo</link> *          g_app_info_create_from_commandline  (const <link linkend="char">char</link> *commandline,
                                                         const <link linkend="char">char</link> *application_name,
                                                         <link linkend="GAppInfoCreateFlags">GAppInfoCreateFlags</link> flags,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Creates a new <link linkend="GAppInfo"><type>GAppInfo</type></link> from the given information.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>commandline</parameter>&#160;:</term>
<listitem><simpara> the commandline to use
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>application_name</parameter>&#160;:</term>
<listitem><simpara> the application name, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> to use <parameter>commandline</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> flags that can specify details of the created <link linkend="GAppInfo"><type>GAppInfo</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link> location to store the error occuring, <link linkend="NULL--CAPS"><literal>NULL</literal></link> to ignore.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> new <link linkend="GAppInfo"><type>GAppInfo</type></link> for given command.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-dup" role="function">
<title>g_app_info_dup ()</title>
<indexterm zone="g-app-info-dup"><primary sortas="app_info_dup">g_app_info_dup</primary></indexterm><programlisting><link linkend="GAppInfo">GAppInfo</link> *          g_app_info_dup                      (<link linkend="GAppInfo">GAppInfo</link> *appinfo);</programlisting>
<para>
Creates a duplicate of a <link linkend="GAppInfo"><type>GAppInfo</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a duplicate of <parameter>appinfo</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-equal" role="function">
<title>g_app_info_equal ()</title>
<indexterm zone="g-app-info-equal"><primary sortas="app_info_equal">g_app_info_equal</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_app_info_equal                    (<link linkend="GAppInfo">GAppInfo</link> *appinfo1,
                                                         <link linkend="GAppInfo">GAppInfo</link> *appinfo2);</programlisting>
<para>
Checks if two <link linkend="GAppInfos"><type>GAppInfos</type></link> are equal.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo1</parameter>&#160;:</term>
<listitem><simpara> the first <link linkend="GAppInfo"><type>GAppInfo</type></link>.  
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>appinfo2</parameter>&#160;:</term>
<listitem><simpara> the second <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if <parameter>appinfo1</parameter> is equal to <parameter>appinfo2</parameter>. <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-get-id" role="function">
<title>g_app_info_get_id ()</title>
<indexterm zone="g-app-info-get-id"><primary sortas="app_info_get_id">g_app_info_get_id</primary></indexterm><programlisting>const <link linkend="char">char</link> *        g_app_info_get_id                   (<link linkend="GAppInfo">GAppInfo</link> *appinfo);</programlisting>
<para>
Gets the ID of an application. An id is a string that
identifies the application. The exact format of the id is
platform dependent. For instance, on Unix this is the
desktop file id from the xdg menu specification.
</para>
<para>
Note that the returned ID may be <link linkend="NULL--CAPS"><literal>NULL</literal></link>, depending on how
the <parameter>appinfo</parameter> has been constructed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a string containing the application's ID.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-get-name" role="function">
<title>g_app_info_get_name ()</title>
<indexterm zone="g-app-info-get-name"><primary sortas="app_info_get_name">g_app_info_get_name</primary></indexterm><programlisting>const <link linkend="char">char</link> *        g_app_info_get_name                 (<link linkend="GAppInfo">GAppInfo</link> *appinfo);</programlisting>
<para>
Gets the installed name of the application.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the name of the application for <parameter>appinfo</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-get-description" role="function">
<title>g_app_info_get_description ()</title>
<indexterm zone="g-app-info-get-description"><primary sortas="app_info_get_description">g_app_info_get_description</primary></indexterm><programlisting>const <link linkend="char">char</link> *        g_app_info_get_description          (<link linkend="GAppInfo">GAppInfo</link> *appinfo);</programlisting>
<para>
Gets a human-readable description of an installed application.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a string containing a description of the 
application <parameter>appinfo</parameter>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if none. 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-get-executable" role="function">
<title>g_app_info_get_executable ()</title>
<indexterm zone="g-app-info-get-executable"><primary sortas="app_info_get_executable">g_app_info_get_executable</primary></indexterm><programlisting>const <link linkend="char">char</link> *        g_app_info_get_executable           (<link linkend="GAppInfo">GAppInfo</link> *appinfo);</programlisting>
<para>
Gets the executable's name for the installed application.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a string containing the <parameter>appinfo</parameter>'s application 
binary's name
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-get-commandline" role="function" condition="since:2.20">
<title>g_app_info_get_commandline ()</title>
<indexterm zone="g-app-info-get-commandline" role="2.20"><primary sortas="app_info_get_commandline">g_app_info_get_commandline</primary></indexterm><programlisting>const <link linkend="char">char</link> *        g_app_info_get_commandline          (<link linkend="GAppInfo">GAppInfo</link> *appinfo);</programlisting>
<para>
Gets the commandline with which the application will be
started.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a string containing the <parameter>appinfo</parameter>'s commandline, 
    or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if this information is not available

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.20</para></refsect2>
<refsect2 id="g-app-info-get-icon" role="function">
<title>g_app_info_get_icon ()</title>
<indexterm zone="g-app-info-get-icon"><primary sortas="app_info_get_icon">g_app_info_get_icon</primary></indexterm><programlisting><link linkend="GIcon">GIcon</link> *             g_app_info_get_icon                 (<link linkend="GAppInfo">GAppInfo</link> *appinfo);</programlisting>
<para>
Gets the icon for the application.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the default <link linkend="GIcon"><type>GIcon</type></link> for <parameter>appinfo</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-launch" role="function">
<title>g_app_info_launch ()</title>
<indexterm zone="g-app-info-launch"><primary sortas="app_info_launch">g_app_info_launch</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_app_info_launch                   (<link linkend="GAppInfo">GAppInfo</link> *appinfo,
                                                         <link linkend="GList">GList</link> *files,
                                                         <link linkend="GAppLaunchContext">GAppLaunchContext</link> *launch_context,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Launches the application. Passes <parameter>files</parameter> to the launched application 
as arguments, using the optional <parameter>launch_context</parameter> to get information
about the details of the launcher (like what screen it is on).
On error, <parameter>error</parameter> will be set accordingly.
</para>
<para>
To lauch the application without arguments pass a <link linkend="NULL--CAPS"><literal>NULL</literal></link> <parameter>files</parameter> list.
</para>
<para>
Note that even if the launch is successful the application launched
can fail to start if it runs into problems during startup. There is
no way to detect this.
</para>
<para>
Some URIs can be changed when passed through a GFile (for instance
unsupported uris with strange formats like mailto:), so if you have
a textual uri you want to pass in as argument, consider using
<link linkend="g-app-info-launch-uris"><function>g_app_info_launch_uris()</function></link> instead.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>files</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GList"><type>GList</type></link> of <link linkend="GFile"><type>GFile</type></link> objects
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>launch_context</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppLaunchContext"><type>GAppLaunchContext</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> on successful launch, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise. 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-supports-files" role="function">
<title>g_app_info_supports_files ()</title>
<indexterm zone="g-app-info-supports-files"><primary sortas="app_info_supports_files">g_app_info_supports_files</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_app_info_supports_files           (<link linkend="GAppInfo">GAppInfo</link> *appinfo);</programlisting>
<para>
Checks if the application accepts files as arguments.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <parameter>appinfo</parameter> supports files.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-supports-uris" role="function">
<title>g_app_info_supports_uris ()</title>
<indexterm zone="g-app-info-supports-uris"><primary sortas="app_info_supports_uris">g_app_info_supports_uris</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_app_info_supports_uris            (<link linkend="GAppInfo">GAppInfo</link> *appinfo);</programlisting>
<para>
Checks if the application supports reading files and directories from URIs.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <parameter>appinfo</parameter> supports URIs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-launch-uris" role="function">
<title>g_app_info_launch_uris ()</title>
<indexterm zone="g-app-info-launch-uris"><primary sortas="app_info_launch_uris">g_app_info_launch_uris</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_app_info_launch_uris              (<link linkend="GAppInfo">GAppInfo</link> *appinfo,
                                                         <link linkend="GList">GList</link> *uris,
                                                         <link linkend="GAppLaunchContext">GAppLaunchContext</link> *launch_context,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Launches the application. Passes <parameter>uris</parameter> to the launched application 
as arguments, using the optional <parameter>launch_context</parameter> to get information
about the details of the launcher (like what screen it is on).
On error, <parameter>error</parameter> will be set accordingly.
</para>
<para>
To lauch the application without arguments pass a <link linkend="NULL--CAPS"><literal>NULL</literal></link> <parameter>uris</parameter> list.
</para>
<para>
Note that even if the launch is successful the application launched
can fail to start if it runs into problems during startup. There is
no way to detect this.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>uris</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GList"><type>GList</type></link> containing URIs to launch. 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>launch_context</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppLaunchContext"><type>GAppLaunchContext</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> on successful launch, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise. 
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-should-show" role="function">
<title>g_app_info_should_show ()</title>
<indexterm zone="g-app-info-should-show"><primary sortas="app_info_should_show">g_app_info_should_show</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_app_info_should_show              (<link linkend="GAppInfo">GAppInfo</link> *appinfo);</programlisting>
<para>
Checks if the application info should be shown in menus that 
list available applications.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the <parameter>appinfo</parameter> should be shown, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-can-delete" role="function" condition="since:2.20">
<title>g_app_info_can_delete ()</title>
<indexterm zone="g-app-info-can-delete" role="2.20"><primary sortas="app_info_can_delete">g_app_info_can_delete</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_app_info_can_delete               (<link linkend="GAppInfo">GAppInfo</link> *appinfo);</programlisting>
<para>
Obtains the information whether the GAppInfo can be deleted.
See <link linkend="g-app-info-delete"><function>g_app_info_delete()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if <parameter>appinfo</parameter> can be deleted

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.20</para></refsect2>
<refsect2 id="g-app-info-delete" role="function" condition="since:2.20">
<title>g_app_info_delete ()</title>
<indexterm zone="g-app-info-delete" role="2.20"><primary sortas="app_info_delete">g_app_info_delete</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_app_info_delete                   (<link linkend="GAppInfo">GAppInfo</link> *appinfo);</programlisting>
<para>
Tries to delete an <link linkend="GAppInfo"><type>GAppInfo</type></link>. 
</para>
<para>
On some platforms, there may be a difference between user-defined
<link linkend="GAppInfo"><type>GAppInfo</type></link><!-- -->s which can be deleted, and system-wide ones which
cannot. See <link linkend="g-app-info-can-delete"><function>g_app_info_can_delete()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if <parameter>appinfo</parameter> has been deleted

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.20</para></refsect2>
<refsect2 id="g-app-info-reset-type-associations" role="function" condition="since:2.20">
<title>g_app_info_reset_type_associations ()</title>
<indexterm zone="g-app-info-reset-type-associations" role="2.20"><primary sortas="app_info_reset_type_associations">g_app_info_reset_type_associations</primary></indexterm><programlisting><link linkend="void">void</link>                g_app_info_reset_type_associations  (const <link linkend="char">char</link> *content_type);</programlisting>
<para>
Removes all changes to the type associations done by
<link linkend="g-app-info-set-as-default-for-type"><function>g_app_info_set_as_default_for_type()</function></link>, 
<link linkend="g-app-info-set-as-default-for-extension"><function>g_app_info_set_as_default_for_extension()</function></link>, 
<link linkend="g-app-info-add-supports-type"><function>g_app_info_add_supports_type()</function></link> of <link linkend="g-app-info-remove-supports-type"><function>g_app_info_remove_supports_type()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>content_type</parameter>&#160;:</term>
<listitem><simpara> a content type 
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.20</para></refsect2>
<refsect2 id="g-app-info-set-as-default-for-type" role="function">
<title>g_app_info_set_as_default_for_type ()</title>
<indexterm zone="g-app-info-set-as-default-for-type"><primary sortas="app_info_set_as_default_for_type">g_app_info_set_as_default_for_type</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_app_info_set_as_default_for_type  (<link linkend="GAppInfo">GAppInfo</link> *appinfo,
                                                         const <link linkend="char">char</link> *content_type,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Sets the application as the default handler for a given type.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>content_type</parameter>&#160;:</term>
<listitem><simpara> the content type.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> on success, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-set-as-default-for-extension" role="function">
<title>g_app_info_set_as_default_for_extension ()</title>
<indexterm zone="g-app-info-set-as-default-for-extension"><primary sortas="app_info_set_as_default_for_extension">g_app_info_set_as_default_for_extension</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_app_info_set_as_default_for_extension
                                                        (<link linkend="GAppInfo">GAppInfo</link> *appinfo,
                                                         const <link linkend="char">char</link> *extension,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Sets the application as the default handler for the given file extention.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>extension</parameter>&#160;:</term>
<listitem><simpara> a string containing the file extension (without the dot).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> on success, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-add-supports-type" role="function">
<title>g_app_info_add_supports_type ()</title>
<indexterm zone="g-app-info-add-supports-type"><primary sortas="app_info_add_supports_type">g_app_info_add_supports_type</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_app_info_add_supports_type        (<link linkend="GAppInfo">GAppInfo</link> *appinfo,
                                                         const <link linkend="char">char</link> *content_type,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Adds a content type to the application information to indicate the 
application is capable of opening files with the given content type.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>content_type</parameter>&#160;:</term>
<listitem><simpara> a string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> on success, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-can-remove-supports-type" role="function">
<title>g_app_info_can_remove_supports_type ()</title>
<indexterm zone="g-app-info-can-remove-supports-type"><primary sortas="app_info_can_remove_supports_type">g_app_info_can_remove_supports_type</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_app_info_can_remove_supports_type (<link linkend="GAppInfo">GAppInfo</link> *appinfo);</programlisting>
<para>
Checks if a supported content type can be removed from an application.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if it is possible to remove supported 
    content types from a given <parameter>appinfo</parameter>, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> if not.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-remove-supports-type" role="function">
<title>g_app_info_remove_supports_type ()</title>
<indexterm zone="g-app-info-remove-supports-type"><primary sortas="app_info_remove_supports_type">g_app_info_remove_supports_type</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_app_info_remove_supports_type     (<link linkend="GAppInfo">GAppInfo</link> *appinfo,
                                                         const <link linkend="char">char</link> *content_type,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Removes a supported type from an application, if possible.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>appinfo</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>content_type</parameter>&#160;:</term>
<listitem><simpara> a string.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> on success, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-get-all" role="function">
<title>g_app_info_get_all ()</title>
<indexterm zone="g-app-info-get-all"><primary sortas="app_info_get_all">g_app_info_get_all</primary></indexterm><programlisting><link linkend="GList">GList</link> *             g_app_info_get_all                  (void);</programlisting>
<para>
Gets a list of all of the applications currently registered 
on this system.
</para>
<para>
For desktop files, this includes applications that have 
<literal>NoDisplay=true</literal> set or are excluded from 
display by means of <literal>OnlyShowIn</literal> or
<literal>NotShowIn</literal>. See <link linkend="g-app-info-should-show"><function>g_app_info_should_show()</function></link>.
The returned list does not include applications which have
the <literal>Hidden</literal> key set.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a newly allocated <link linkend="GList"><type>GList</type></link> of references to <link linkend="GAppInfo"><type>GAppInfo</type></link><!---->s.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-get-all-for-type" role="function">
<title>g_app_info_get_all_for_type ()</title>
<indexterm zone="g-app-info-get-all-for-type"><primary sortas="app_info_get_all_for_type">g_app_info_get_all_for_type</primary></indexterm><programlisting><link linkend="GList">GList</link> *             g_app_info_get_all_for_type         (const <link linkend="char">char</link> *content_type);</programlisting>
<para>
Gets a list of all <link linkend="GAppInfo"><type>GAppInfo</type></link> s for a given content type.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>content_type</parameter>&#160;:</term>
<listitem><simpara> the content type to find a <link linkend="GAppInfo"><type>GAppInfo</type></link> for
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="GList"><type>GList</type></link> of <link linkend="GAppInfo"><type>GAppInfo</type></link> s for given <parameter>content_type</parameter>
   or <link linkend="NULL--CAPS"><literal>NULL</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-get-default-for-type" role="function">
<title>g_app_info_get_default_for_type ()</title>
<indexterm zone="g-app-info-get-default-for-type"><primary sortas="app_info_get_default_for_type">g_app_info_get_default_for_type</primary></indexterm><programlisting><link linkend="GAppInfo">GAppInfo</link> *          g_app_info_get_default_for_type     (const <link linkend="char">char</link> *content_type,
                                                         <link linkend="gboolean">gboolean</link> must_support_uris);</programlisting>
<para>
Gets the <link linkend="GAppInfo"><type>GAppInfo</type></link> that correspond to a given content type.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>content_type</parameter>&#160;:</term>
<listitem><simpara> the content type to find a <link linkend="GAppInfo"><type>GAppInfo</type></link> for
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>must_support_uris</parameter>&#160;:</term>
<listitem><simpara> if <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, the <link linkend="GAppInfo"><type>GAppInfo</type></link> is expected to
    support URIs
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="GAppInfo"><type>GAppInfo</type></link> for given <parameter>content_type</parameter> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-get-default-for-uri-scheme" role="function">
<title>g_app_info_get_default_for_uri_scheme ()</title>
<indexterm zone="g-app-info-get-default-for-uri-scheme"><primary sortas="app_info_get_default_for_uri_scheme">g_app_info_get_default_for_uri_scheme</primary></indexterm><programlisting><link linkend="GAppInfo">GAppInfo</link> *          g_app_info_get_default_for_uri_scheme
                                                        (const <link linkend="char">char</link> *uri_scheme);</programlisting>
<para>
Gets the default application for launching applications 
using this URI scheme. A URI scheme is the initial part 
of the URI, up to but not including the ':', e.g. "http", 
"ftp" or "sip".</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>uri_scheme</parameter>&#160;:</term>
<listitem><simpara> a string containing a URI scheme.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="GAppInfo"><type>GAppInfo</type></link> for given <parameter>uri_scheme</parameter> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-info-launch-default-for-uri" role="function">
<title>g_app_info_launch_default_for_uri ()</title>
<indexterm zone="g-app-info-launch-default-for-uri"><primary sortas="app_info_launch_default_for_uri">g_app_info_launch_default_for_uri</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_app_info_launch_default_for_uri   (const <link linkend="char">char</link> *uri,
                                                         <link linkend="GAppLaunchContext">GAppLaunchContext</link> *launch_context,
                                                         <link linkend="GError">GError</link> **error);</programlisting>
<para>
Utility function that launches the default application 
registered to handle the specified uri. Synchronous I/O
is done on the uri to detect the type of the file if
required.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>uri</parameter>&#160;:</term>
<listitem><simpara> the uri to show
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>launch_context</parameter>&#160;:</term>
<listitem><simpara> an optional <link linkend="GAppLaunchContext"><type>GAppLaunchContext</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GError"><type>GError</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> on success, <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> on error.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-launch-context-get-display" role="function">
<title>g_app_launch_context_get_display ()</title>
<indexterm zone="g-app-launch-context-get-display"><primary sortas="app_launch_context_get_display">g_app_launch_context_get_display</primary></indexterm><programlisting><link linkend="char">char</link> *              g_app_launch_context_get_display    (<link linkend="GAppLaunchContext">GAppLaunchContext</link> *context,
                                                         <link linkend="GAppInfo">GAppInfo</link> *info,
                                                         <link linkend="GList">GList</link> *files);</programlisting>
<para>
Gets the display string for the display. This is used to ensure new
applications are started on the same display as the launching 
application.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppLaunchContext"><type>GAppLaunchContext</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>info</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>files</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GList"><type>GList</type></link> of <link linkend="GFile"><type>GFile</type></link> objects
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a display string for the display.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-launch-context-get-startup-notify-id" role="function">
<title>g_app_launch_context_get_startup_notify_id ()</title>
<indexterm zone="g-app-launch-context-get-startup-notify-id"><primary sortas="app_launch_context_get_startup_notify_id">g_app_launch_context_get_startup_notify_id</primary></indexterm><programlisting><link linkend="char">char</link> *              g_app_launch_context_get_startup_notify_id
                                                        (<link linkend="GAppLaunchContext">GAppLaunchContext</link> *context,
                                                         <link linkend="GAppInfo">GAppInfo</link> *info,
                                                         <link linkend="GList">GList</link> *files);</programlisting>
<para>
Initiates startup notification for the application and returns the
DESKTOP_STARTUP_ID for the launched operation, if supported.
</para>
<para>
Startup notification IDs are defined in the <ulink
url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
FreeDesktop.Org Startup Notifications standard</ulink>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppLaunchContext"><type>GAppLaunchContext</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>info</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppInfo"><type>GAppInfo</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>files</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GList"><type>GList</type></link> of of <link linkend="GFile"><type>GFile</type></link> objects
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a startup notification ID for the application, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if 
    not supported.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-launch-context-launch-failed" role="function">
<title>g_app_launch_context_launch_failed ()</title>
<indexterm zone="g-app-launch-context-launch-failed"><primary sortas="app_launch_context_launch_failed">g_app_launch_context_launch_failed</primary></indexterm><programlisting><link linkend="void">void</link>                g_app_launch_context_launch_failed  (<link linkend="GAppLaunchContext">GAppLaunchContext</link> *context,
                                                         const <link linkend="char">char</link> *startup_notify_id);</programlisting>
<para>
Called when an application has failed to launch, so that it can cancel
the application startup notification started in <link linkend="g-app-launch-context-get-startup-notify-id"><function>g_app_launch_context_get_startup_notify_id()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GAppLaunchContext"><type>GAppLaunchContext</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>startup_notify_id</parameter>&#160;:</term>
<listitem><simpara> the startup notification id that was returned by <link linkend="g-app-launch-context-get-startup-notify-id"><function>g_app_launch_context_get_startup_notify_id()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-app-launch-context-new" role="function">
<title>g_app_launch_context_new ()</title>
<indexterm zone="g-app-launch-context-new"><primary sortas="app_launch_context_new">g_app_launch_context_new</primary></indexterm><programlisting><link linkend="GAppLaunchContext">GAppLaunchContext</link> * g_app_launch_context_new            (void);</programlisting>
<para>
Creates a new application launch context. This is not normally used,
instead you instantiate a subclass of this, such as <link linkend="GdkAppLaunchContext"><type>GdkAppLaunchContext</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GAppLaunchContext"><type>GAppLaunchContext</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
