mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 00:13:20 +02:00
![Mike Kestner](/assets/img/avatar_default.png)
* generator/ConstFilenameGen.cs : new generatable for filename encoded const string marshaling * generator/Makefile.am : add new file * generator/SymbolTable.cs : add new gfilename types. * glib/Marshaller.cs : add new filename-encoded string marshalers. * gtk/FileSelection.custom : use FilenamePtrToString to marshal. * gtk/Gtk.metadata : map the FileSelector filename types to my new imaginary gfilename type. [Fixes #74963] svn path=/trunk/gtk-sharp/; revision=45328
64 lines
1.8 KiB
Plaintext
64 lines
1.8 KiB
Plaintext
//
|
|
// Gtk.FileSelection.custom - Gtk FileSelection class customizations
|
|
//
|
|
// Author: Duncan Mak (duncan@ximian.com)
|
|
// Joe Shaw (joe@ximian.com)
|
|
//
|
|
// Copyright (C) 2002 Ximian, Inc.
|
|
//
|
|
// This code is inserted after the automatically generated code.
|
|
//
|
|
//
|
|
// This program is free software; you can redistribute it and/or
|
|
// modify it under the terms of version 2 of the Lesser GNU General
|
|
// Public License as published by the Free Software Foundation.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
// Lesser General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
// License along with this program; if not, write to the
|
|
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
// Boston, MA 02111-1307, USA.
|
|
|
|
|
|
public class FSButton : Gtk.Button {
|
|
FileSelection file_sel;
|
|
|
|
public FileSelection FileSelection {
|
|
get { return file_sel; }
|
|
}
|
|
|
|
internal FSButton (FileSelection fs, IntPtr raw) : base (raw) {
|
|
file_sel = fs;
|
|
}
|
|
}
|
|
|
|
[DllImport("libgtk-win32-2.0-0.dll")]
|
|
static extern IntPtr gtk_file_selection_get_selections (IntPtr handle);
|
|
|
|
[DllImport("libglib-2.0-0.dll")]
|
|
static extern void g_strfreev (IntPtr handle);
|
|
|
|
public string[] Selections {
|
|
get {
|
|
IntPtr strv = gtk_file_selection_get_selections (Handle);
|
|
|
|
System.Collections.ArrayList result = new System.Collections.ArrayList ();
|
|
|
|
int i = 0;
|
|
IntPtr strptr = Marshal.ReadIntPtr (strv, IntPtr.Size * i++);
|
|
while (strptr != IntPtr.Zero) {
|
|
result.Add (GLib.Marshaller.FilenamePtrToString (strptr));
|
|
strptr = Marshal.ReadIntPtr (strv, IntPtr.Size * i++);
|
|
}
|
|
|
|
g_strfreev (strv);
|
|
|
|
return result.ToArray (typeof (string)) as string[];
|
|
}
|
|
}
|
|
|