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="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> desktop</code></em>);
50
<em class="parameter"><code><span class="type">gint</span> 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="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> timestamp</code></em>);
53
<em class="parameter"><code><span class="type">guint32</span> 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="http://library.gnome.org/devel/gio/unstable/GIcon.html"><span class="type">GIcon</span></a> *icon</code></em>);
55
<em class="parameter"><code><span class="type">GIcon</span> *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">
62
62
<a name="gdk-Application-launching.description"></a><h2>Description</h2>
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
64
GdkAppLaunchContext is an implementation of <span class="type">GAppLaunchContext</span> 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="id587849"></a><p class="title"><b>Example 9. Launching an application</b></p>
70
<a name="id481388"></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">
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="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>
86
<span class="keyword">if</span><span class="normal"> </span><span class="symbol">(!</span><span class="function">g_app_info_launch_default_for_uri</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">g_warning</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">g_object_unref</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">context</span><span class="symbol">);</span></pre></td>
182
182
<div class="refsect2">
183
183
<a name="gdk-app-launch-context-set-desktop"></a><h3>gdk_app_launch_context_set_desktop ()</h3>
184
184
<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>,
185
<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>
185
<em class="parameter"><code><span class="type">gint</span> desktop</code></em>);</pre>
187
187
Sets the workspace on which applications will be launched when
188
188
using this context when running under a window manager that
216
216
<a name="gdk-app-launch-context-set-timestamp"></a><h3>gdk_app_launch_context_set_timestamp ()</h3>
217
217
<pre class="programlisting"><span class="returnvalue">void</span> gdk_app_launch_context_set_timestamp
218
218
(<em class="parameter"><code><a class="link" href="gdk-Application-launching.html#GdkAppLaunchContext" title="GdkAppLaunchContext"><span class="type">GdkAppLaunchContext</span></a> *context</code></em>,
219
<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>
219
<em class="parameter"><code><span class="type">guint32</span> timestamp</code></em>);</pre>
221
221
Sets the timestamp of <em class="parameter"><code>context</code></em>. The timestamp should ideally
222
222
be taken from the event that triggered the launch.
247
247
<div class="refsect2">
248
248
<a name="gdk-app-launch-context-set-icon"></a><h3>gdk_app_launch_context_set_icon ()</h3>
249
249
<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>,
250
<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>
250
<em class="parameter"><code><span class="type">GIcon</span> *icon</code></em>);</pre>
252
252
Sets the icon for applications that are launched with this
271
271
<td><p><span class="term"><em class="parameter"><code>icon</code></em> :</span></p></td>
272
<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>
272
<td>a <span class="type">GIcon</span>, or <a href="/home/mclasen/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.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>
291
291
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.
292
292
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
293
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>
293
the file that is passed to launched application or from the <span class="type">GAppInfo</span>
294
294
for the launched application itself.
296
296
<div class="variablelist"><table border="0">
305
305
<td><p><span class="term"><em class="parameter"><code>icon_name</code></em> :</span></p></td>
306
<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>
306
<td>an icon name, or <a href="/home/mclasen/gnome/share/gtk-doc/html/liboil/liboil-liboiljunk.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>