From 1d63a0e3e7fc5039faf28aacb03d2ef0600200df Mon Sep 17 00:00:00 2001 From: Stephane Delcroix Date: Fri, 21 Nov 2008 16:54:10 +0000 Subject: [PATCH] Global.ApplicationName property 2008-11-21 Stephane Delcroix * glib/Global.cs: implement Global.ApplicationName for localized application name. svn path=/trunk/gtk-sharp/; revision=119633 --- ChangeLog | 5 +++++ glib/Global.cs | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7329c2128..e25287f0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-11-21 Stephane Delcroix + + * glib/Global.cs: implement Global.ApplicationName for localized + application name. + 2008-11-21 Stephane Delcroix * Makefile.am: diff --git a/glib/Global.cs b/glib/Global.cs index 0f3e85371..fb7f3eb0e 100644 --- a/glib/Global.cs +++ b/glib/Global.cs @@ -47,5 +47,22 @@ namespace GLib { [DllImport("libglib-2.0-0.dll")] static extern IntPtr g_get_prgname (); + + public static string ApplicationName { + get { + return GLib.Marshaller.PtrToStringGFree(g_get_application_name()); + } + set { + IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (value); + g_set_application_name (native_name); + GLib.Marshaller.Free (native_name); + } + } + + [DllImport("libglib-2.0-0.dll")] + static extern void g_set_application_name (IntPtr name); + + [DllImport("libglib-2.0-0.dll")] + static extern IntPtr g_get_application_name (); } }