2002-06-24 22:12:32 +00:00
|
|
|
//
|
2002-06-24 20:38:48 +00:00
|
|
|
// Gtk.FileSelection.custom - Gtk FileSelection class customizations
|
|
|
|
//
|
|
|
|
// Author: Duncan Mak (duncan@ximian.com)
|
2002-08-13 14:01:14 +00:00
|
|
|
// Joe Shaw (joe@ximian.com)
|
2002-06-24 20:38:48 +00:00
|
|
|
//
|
|
|
|
// Copyright (C) 2002 Ximian, Inc.
|
|
|
|
//
|
|
|
|
// This code is inserted after the automatically generated code.
|
|
|
|
//
|
2004-06-25 18:42:19 +00:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
|
2002-06-24 20:38:48 +00:00
|
|
|
|
2003-02-20 04:03:15 +00:00
|
|
|
public class FSButton : Gtk.Button {
|
|
|
|
FileSelection file_sel;
|
2002-08-13 14:01:14 +00:00
|
|
|
|
2003-02-20 04:03:15 +00:00
|
|
|
public FileSelection FileSelection {
|
2002-08-13 14:01:14 +00:00
|
|
|
get { return file_sel; }
|
|
|
|
}
|
|
|
|
|
2003-07-22 04:38:13 +00:00
|
|
|
internal FSButton (FileSelection fs, IntPtr raw) : base (raw) {
|
2002-08-13 14:01:14 +00:00
|
|
|
file_sel = fs;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-10-10 21:34:34 +00:00
|
|
|
[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) {
|
2005-03-08 21:28:08 +00:00
|
|
|
result.Add (GLib.Marshaller.Utf8PtrToString (strptr));
|
2003-10-10 21:34:34 +00:00
|
|
|
strptr = Marshal.ReadIntPtr (strv, IntPtr.Size * i++);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_strfreev (strv);
|
|
|
|
|
|
|
|
return result.ToArray (typeof (string)) as string[];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|