[banshee] [GtkUtilities] bind gtk_show_uri (bgo#587320)
- From: Aaron Bockover <abock src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee] [GtkUtilities] bind gtk_show_uri (bgo#587320)
- Date: Sat, 6 Feb 2010 06:06:10 +0000 (UTC)
commit 34d1363c54b021a34fd879e8006be1fe499849c6
Author: Aaron Bockover <abockover novell com>
Date: Sat Feb 6 00:56:33 2010 -0500
[GtkUtilities] bind gtk_show_uri (bgo#587320)
This replaces Gnome.Url.Show. Hooray.
src/Libraries/Hyena.Gui/Hyena.Gui/GtkUtilities.cs | 31 ++++++++++++++++++++-
1 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/src/Libraries/Hyena.Gui/Hyena.Gui/GtkUtilities.cs b/src/Libraries/Hyena.Gui/Hyena.Gui/GtkUtilities.cs
index 1fc246a..3443d62 100644
--- a/src/Libraries/Hyena.Gui/Hyena.Gui/GtkUtilities.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Gui/GtkUtilities.cs
@@ -4,7 +4,7 @@
// Author:
// Aaron Bockover <abockover novell com>
//
-// Copyright (C) 2007 Novell, Inc.
+// Copyright 2007-2010 Novell, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -164,5 +164,34 @@ namespace Hyena.Gui
}
}
}
+
+ public static bool ShowUri (string uri)
+ {
+ return ShowUri (null, uri);
+ }
+
+ public static bool ShowUri (Gdk.Screen screen, string uri)
+ {
+ return ShowUri (screen, uri, Gtk.Global.CurrentEventTime);
+ }
+
+ [System.Runtime.InteropServices.DllImport ("libgtk-win32-2.0-0.dll")]
+ private static extern unsafe bool gtk_show_uri (IntPtr screen, IntPtr uri, uint timestamp, out IntPtr error);
+
+ public static bool ShowUri (Gdk.Screen screen, string uri, uint timestamp)
+ {
+ var native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
+ var native_error = IntPtr.Zero;
+
+ try {
+ return gtk_show_uri (screen == null ? IntPtr.Zero : screen.Handle,
+ native_uri, timestamp, out native_error);
+ } finally {
+ GLib.Marshaller.Free (native_uri);
+ if (native_error != IntPtr.Zero) {
+ throw new GLib.GException (native_error);
+ }
+ }
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]