From ff096ac998175a3261693290540e63c8d36bd28a Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Thu, 2 Jun 2005 16:16:28 +0000 Subject: [PATCH] 2005-06-02 Mike Kestner * glib/ListBase.cs : add a nested class to support filename encoded string element marshaling. * gtk/Gtk.metadata : mark the filenames and folders as filename encoded. * gtk/FileChooserDialog.custom : use new ListBase.FilenameString type for list element type of filenames and folders. * gtk/FileChooserWidget.custom : use new ListBase.FilenameString type for list element type of filenames and folders. [Fixes #72701] svn path=/trunk/gtk-sharp/; revision=45334 --- ChangeLog | 12 ++++++++++++ doc/en/GLib/ListBase+FilenameString.xml | 18 ++++++++++++++++++ doc/en/index.xml | 1 + glib/ListBase.cs | 11 +++++++++-- gtk/FileChooserDialog.custom | 4 ++-- gtk/FileChooserWidget.custom | 4 ++-- gtk/Gtk.metadata | 5 +++++ 7 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 doc/en/GLib/ListBase+FilenameString.xml diff --git a/ChangeLog b/ChangeLog index 7124ef03d..fd5bba9c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-06-02 Mike Kestner + + * glib/ListBase.cs : add a nested class to support filename encoded + string element marshaling. + * gtk/Gtk.metadata : mark the filenames and folders as filename + encoded. + * gtk/FileChooserDialog.custom : use new ListBase.FilenameString type + for list element type of filenames and folders. + * gtk/FileChooserWidget.custom : use new ListBase.FilenameString type + for list element type of filenames and folders. + [Fixes #72701] + 2005-06-02 Mike Kestner * generator/ConstFilenameGen.cs : new generatable for filename encoded diff --git a/doc/en/GLib/ListBase+FilenameString.xml b/doc/en/GLib/ListBase+FilenameString.xml new file mode 100644 index 000000000..c627625b6 --- /dev/null +++ b/doc/en/GLib/ListBase+FilenameString.xml @@ -0,0 +1,18 @@ + + + + glib-sharp + 2.0.0.0 + + + System.Object + + + + + + + Type for Filename encoded string element marshaling. + Use this type as a List constructor element_type parameter to use filename-encoded string marshaling. + + diff --git a/doc/en/index.xml b/doc/en/index.xml index 767c263fc..db0195678 100644 --- a/doc/en/index.xml +++ b/doc/en/index.xml @@ -71,6 +71,7 @@ + diff --git a/glib/ListBase.cs b/glib/ListBase.cs index 6d390986b..303c5466b 100644 --- a/glib/ListBase.cs +++ b/glib/ListBase.cs @@ -1,8 +1,9 @@ -// SList.cs - GSList class wrapper implementation +// ListBase.cs - List base class implementation // -// Authors: Mike Kestner +// Authors: Mike Kestner // // Copyright (c) 2002 Mike Kestner +// Copyright (c) 2005 Novell, Inc. // // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General @@ -134,12 +135,18 @@ namespace GLib { orig.CopyTo (array, index); } + public class FilenameString { + private FilenameString () {} + } + internal object DataMarshal (IntPtr data) { object ret = null; if (element_type != null) { if (element_type == typeof (string)) ret = Marshaller.Utf8PtrToString (data); + else if (element_type == typeof (FilenameString)) + ret = Marshaller.FilenamePtrToString (data); else if (element_type == typeof (int)) ret = (int) data; else if (element_type.IsValueType) diff --git a/gtk/FileChooserDialog.custom b/gtk/FileChooserDialog.custom index 15cf83fa7..cf987555b 100644 --- a/gtk/FileChooserDialog.custom +++ b/gtk/FileChooserDialog.custom @@ -71,7 +71,7 @@ IntPtr raw_ret = gtk_file_chooser_get_filenames (Handle); if (raw_ret == IntPtr.Zero) return new string[0]; - GLib.SList list = new GLib.SList (raw_ret, typeof (string)); + GLib.SList list = new GLib.SList (raw_ret, typeof (GLib.ListBase.FilenameString)); string[] result = new string [list.Count]; for (int i = 0; i < list.Count; i++) result [i] = (string) list [i]; @@ -119,7 +119,7 @@ IntPtr raw_ret = gtk_file_chooser_list_shortcut_folders (Handle); if (raw_ret == IntPtr.Zero) return new string[0]; - GLib.SList list = new GLib.SList (raw_ret, typeof (string)); + GLib.SList list = new GLib.SList (raw_ret, typeof (GLib.ListBase.FilenameString)); string[] result = new string [list.Count]; for (int i = 0; i < list.Count; i++) result [i] = (string) list [i]; diff --git a/gtk/FileChooserWidget.custom b/gtk/FileChooserWidget.custom index 4e825a993..920c1fe06 100644 --- a/gtk/FileChooserWidget.custom +++ b/gtk/FileChooserWidget.custom @@ -27,7 +27,7 @@ IntPtr raw_ret = gtk_file_chooser_get_filenames (Handle); if (raw_ret == IntPtr.Zero) return new string[0]; - GLib.SList list = new GLib.SList (raw_ret, typeof (string)); + GLib.SList list = new GLib.SList (raw_ret, typeof (GLib.ListBase.FilenameString)); string[] result = new string [list.Count]; for (int i = 0; i < list.Count; i++) result [i] = (string) list [i]; @@ -75,7 +75,7 @@ IntPtr raw_ret = gtk_file_chooser_list_shortcut_folders (Handle); if (raw_ret == IntPtr.Zero) return new string[0]; - GLib.SList list = new GLib.SList (raw_ret, typeof (string)); + GLib.SList list = new GLib.SList (raw_ret, typeof (GLib.ListBase.FilenameString)); string[] result = new string [list.Count]; for (int i = 0; i < list.Count; i++) result [i] = (string) list [i]; diff --git a/gtk/Gtk.metadata b/gtk/Gtk.metadata index a81f24693..488aca0e4 100644 --- a/gtk/Gtk.metadata +++ b/gtk/Gtk.metadata @@ -87,7 +87,12 @@ TextDeleted ref TextInserted + gfilename* + gfilename* + gfilename* 1 + const-gfilename* + const-gfilename* 1 1 1