2 * GTK - The GIMP Toolkit
3 * Copyright (C) 2008 Jaap Haitsma <jaap@haitsma.org>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
34 * @screen: screen to show the uri on or %NULL for the default screen
35 * @uri: the uri to show
36 * @timestamp: a timestamp to prevent focus stealing.
37 * @error: a #GError that is returned in case of errors
39 * This is a convenience function for launching the default application
40 * to show the uri. The uri must be of a form understood by GIO. Typical
43 * <member><filename>file:///home/gnome/pict.jpg</filename></member>
44 * <member><filename>http://www.gnome.org</filename></member>
45 * <member><filename>mailto:me@gnome.org</filename></member>
47 * Ideally the timestamp is taken from the event triggering
48 * the gtk_show_uri() call. If timestamp is not known you can take
51 * This function can be used as a replacement for gnome_vfs_url_show()
52 * and gnome_url_show().
54 * Returns: %TRUE on success, %FALSE on error.
59 gtk_show_uri (GdkScreen *screen,
64 GdkAppLaunchContext *context;
67 g_return_val_if_fail (uri != NULL, FALSE);
69 context = gdk_app_launch_context_new ();
70 gdk_app_launch_context_set_screen (context, screen);
71 gdk_app_launch_context_set_timestamp (context, timestamp);
73 ret = g_app_info_launch_default_for_uri (uri, (GAppLaunchContext*)context, error);
74 g_object_unref (context);
80 #define __GTK_SHOW_C__
81 #include "gtkaliasdef.c"