mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-24 16:35:31 +00:00
536c3aca54
* generator/Method.cs: support win32_utf8_variant attribute on methods. * glib/*.cs: support win32 utf8 variant methods. * gtk/*.custom: support win32 utf8 variant methods. * gtk/Gtk.metadata: mark some win32_utf8_variant methods. [Fixes #550961] Adapted from a patch by Tor Lillqvist. svn path=/trunk/gtk-sharp/; revision=147113
79 lines
2.2 KiB
Plaintext
79 lines
2.2 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("libgtk-win32-2.0-0.dll")]
|
|
static extern IntPtr gtk_file_selection_get_selections_utf8 (IntPtr handle);
|
|
|
|
[DllImport("libglib-2.0-0.dll")]
|
|
static extern void g_strfreev (IntPtr handle);
|
|
|
|
public string[] Selections {
|
|
get {
|
|
IntPtr strv;
|
|
|
|
switch (Environment.OSVersion.Platform) {
|
|
case PlatformID.Win32NT:
|
|
case PlatformID.Win32S:
|
|
case PlatformID.Win32Windows:
|
|
case PlatformID.WinCE:
|
|
strv = gtk_file_selection_get_selections_utf8 (Handle);
|
|
break;
|
|
default:
|
|
strv = gtk_file_selection_get_selections (Handle);
|
|
break;
|
|
}
|
|
|
|
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[];
|
|
}
|
|
}
|
|
|