47
47
<span class="returnvalue">void</span> <a class="link" href="gdk-Application-launching.html#gdk-app-launch-context-set-screen" title="gdk_app_launch_context_set_screen ()">gdk_app_launch_context_set_screen</a> (<em class="parameter"><code><a class="link" href="gdk-Application-launching.html#GdkAppLaunchContext" title="GdkAppLaunchContext"><span class="type">GdkAppLaunchContext</span></a> *context</code></em>,
48
48
<em class="parameter"><code><a class="link" href="GdkScreen.html" title="GdkScreen"><span class="type">GdkScreen</span></a> *screen</code></em>);
49
49
<span class="returnvalue">void</span> <a class="link" href="gdk-Application-launching.html#gdk-app-launch-context-set-desktop" title="gdk_app_launch_context_set_desktop ()">gdk_app_launch_context_set_desktop</a> (<em class="parameter"><code><a class="link" href="gdk-Application-launching.html#GdkAppLaunchContext" title="GdkAppLaunchContext"><span class="type">GdkAppLaunchContext</span></a> *context</code></em>,
50
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> desktop</code></em>);
50
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> desktop</code></em>);
51
51
<span class="returnvalue">void</span> <a class="link" href="gdk-Application-launching.html#gdk-app-launch-context-set-timestamp" title="gdk_app_launch_context_set_timestamp ()">gdk_app_launch_context_set_timestamp</a>
52
52
(<em class="parameter"><code><a class="link" href="gdk-Application-launching.html#GdkAppLaunchContext" title="GdkAppLaunchContext"><span class="type">GdkAppLaunchContext</span></a> *context</code></em>,
53
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> timestamp</code></em>);
53
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> timestamp</code></em>);
54
54
<span class="returnvalue">void</span> <a class="link" href="gdk-Application-launching.html#gdk-app-launch-context-set-icon" title="gdk_app_launch_context_set_icon ()">gdk_app_launch_context_set_icon</a> (<em class="parameter"><code><a class="link" href="gdk-Application-launching.html#GdkAppLaunchContext" title="GdkAppLaunchContext"><span class="type">GdkAppLaunchContext</span></a> *context</code></em>,
55
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gio/GIcon.html"><span class="type">GIcon</span></a> *icon</code></em>);
55
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GIcon.html"><span class="type">GIcon</span></a> *icon</code></em>);
56
56
<span class="returnvalue">void</span> <a class="link" href="gdk-Application-launching.html#gdk-app-launch-context-set-icon-name" title="gdk_app_launch_context_set_icon_name ()">gdk_app_launch_context_set_icon_name</a>
57
57
(<em class="parameter"><code><a class="link" href="gdk-Application-launching.html#GdkAppLaunchContext" title="GdkAppLaunchContext"><span class="type">GdkAppLaunchContext</span></a> *context</code></em>,
58
58
<em class="parameter"><code>const <span class="type">char</span> *icon_name</code></em>);
61
61
<div class="refsect1" title="Description">
62
62
<a name="gdk-Application-launching.description"></a><h2>Description</h2>
64
GdkAppLaunchContext is an implementation of <a href="/usr/share/gtk-doc/html/gio/GAppInfo.html#GAppLaunchContext"><span class="type">GAppLaunchContext</span></a> that
64
GdkAppLaunchContext is an implementation of <a href="http://library.gnome.org/devel/gio/unstable/GAppInfo.html#GAppLaunchContext"><span class="type">GAppLaunchContext</span></a> that
65
65
handles launching an application in a graphical context. It provides
66
66
startup notification and allows to launch applications on a specific
67
67
screen or workspace.
69
69
<div class="example">
70
<a name="id682265"></a><p class="title"><b>Example 9. Launching an application</b></p>
70
<a name="id743498"></a><p class="title"><b>Example 9. Launching an application</b></p>
71
71
<div class="example-contents">
72
72
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
82
<td class="listing_code"><pre class="programlisting"><span class="normal"><a href="gdk-Application-launching.html#GdkAppLaunchContext">GdkAppLaunchContext</a> </span><span class="symbol">*</span><span class="normal">context</span><span class="symbol">;</span>
82
<td class="listing_code"><pre class="programlisting"><span class="usertype">GdkAppLaunchContext</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">context</span><span class="symbol">;</span>
83
83
<span class="normal">context </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gdk-Application-launching.html#gdk-app-launch-context-new">gdk_app_launch_context_new</a></span><span class="normal"> </span><span class="symbol">();</span>
84
84
<span class="function"><a href="gdk-Application-launching.html#gdk-app-launch-context-set-screen">gdk_app_launch_context_set_screen</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">my_screen</span><span class="symbol">);</span>
85
85
<span class="function"><a href="gdk-Application-launching.html#gdk-app-launch-context-set-timestamp">gdk_app_launch_context_set_timestamp</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">event</span><span class="symbol">-></span><span class="normal">time</span><span class="symbol">);</span>
86
<span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!</span><span class="function"><a href="/usr/share/gtk-doc/html/gio/GAppInfo.html#g-app-info-launch-default-for-uri">g_app_info_launch_default_for_uri</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"http://www.gtk.org"</span><span class="symbol">,</span><span class="normal"> context</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">error</span><span class="symbol">))</span>
87
<span class="normal"> </span><span class="function"><a href="/usr/share/gtk-doc/html/glib/glib-Message-Logging.html#g-warning">g_warning</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Launching failed: %s</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> error</span><span class="symbol">-></span><span class="normal">message</span><span class="symbol">);</span>
88
<span class="function"><a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">context</span><span class="symbol">);</span></pre></td>
86
<span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!</span><span class="function"><a href="http://library.gnome.org/devel/gio/unstable/GAppInfo.html#g-app-info-launch-default-for-uri">g_app_info_launch_default_for_uri</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"http://www.gtk.org"</span><span class="symbol">,</span><span class="normal"> context</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">error</span><span class="symbol">))</span>
87
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Message-Logging.html#g-warning">g_warning</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Launching failed: %s</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> error</span><span class="symbol">-></span><span class="normal">message</span><span class="symbol">);</span>
88
<span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">context</span><span class="symbol">);</span></pre></td>
183
183
<div class="refsect2" title="gdk_app_launch_context_set_desktop ()">
184
184
<a name="gdk-app-launch-context-set-desktop"></a><h3>gdk_app_launch_context_set_desktop ()</h3>
185
185
<pre class="programlisting"><span class="returnvalue">void</span> gdk_app_launch_context_set_desktop (<em class="parameter"><code><a class="link" href="gdk-Application-launching.html#GdkAppLaunchContext" title="GdkAppLaunchContext"><span class="type">GdkAppLaunchContext</span></a> *context</code></em>,
186
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> desktop</code></em>);</pre>
186
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> desktop</code></em>);</pre>
188
188
Sets the workspace on which applications will be launched when
189
189
using this context when running under a window manager that
218
218
<a name="gdk-app-launch-context-set-timestamp"></a><h3>gdk_app_launch_context_set_timestamp ()</h3>
219
219
<pre class="programlisting"><span class="returnvalue">void</span> gdk_app_launch_context_set_timestamp
220
220
(<em class="parameter"><code><a class="link" href="gdk-Application-launching.html#GdkAppLaunchContext" title="GdkAppLaunchContext"><span class="type">GdkAppLaunchContext</span></a> *context</code></em>,
221
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> timestamp</code></em>);</pre>
221
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> timestamp</code></em>);</pre>
223
223
Sets the timestamp of <em class="parameter"><code>context</code></em>. The timestamp should ideally
224
224
be taken from the event that triggered the launch.
250
250
<div class="refsect2" title="gdk_app_launch_context_set_icon ()">
251
251
<a name="gdk-app-launch-context-set-icon"></a><h3>gdk_app_launch_context_set_icon ()</h3>
252
252
<pre class="programlisting"><span class="returnvalue">void</span> gdk_app_launch_context_set_icon (<em class="parameter"><code><a class="link" href="gdk-Application-launching.html#GdkAppLaunchContext" title="GdkAppLaunchContext"><span class="type">GdkAppLaunchContext</span></a> *context</code></em>,
253
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gio/GIcon.html"><span class="type">GIcon</span></a> *icon</code></em>);</pre>
253
<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GIcon.html"><span class="type">GIcon</span></a> *icon</code></em>);</pre>
255
255
Sets the icon for applications that are launched with this
274
274
<td><p><span class="term"><em class="parameter"><code>icon</code></em> :</span></p></td>
275
<td> a <a href="/usr/share/gtk-doc/html/gio/GIcon.html"><span class="type">GIcon</span></a>, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
275
<td> a <a href="http://library.gnome.org/devel/gio/unstable/GIcon.html"><span class="type">GIcon</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
294
294
If both <em class="parameter"><code>icon</code></em> and <em class="parameter"><code>icon_name</code></em> are set, the <em class="parameter"><code>icon_name</code></em> takes priority.
295
295
If neither <em class="parameter"><code>icon</code></em> or <em class="parameter"><code>icon_name</code></em> is set, the icon is taken from either
296
the file that is passed to launched application or from the <a href="/usr/share/gtk-doc/html/gio/GAppInfo.html"><span class="type">GAppInfo</span></a>
296
the file that is passed to launched application or from the <a href="http://library.gnome.org/devel/gio/unstable/GAppInfo.html"><span class="type">GAppInfo</span></a>
297
297
for the launched application itself.
299
299
<div class="variablelist"><table border="0">
308
308
<td><p><span class="term"><em class="parameter"><code>icon_name</code></em> :</span></p></td>
309
<td> an icon name, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
309
<td> an icon name, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>