GtkSharp/gtk/FileSelection.custom
Mike Kestner 993d91fa31 2004-12-07 Mike Kestner <mkestner@novell.com>
* */*.cs : s/glue-2.0/glue-2 so that dllimport works on win32.
	* */*.custom : s/glue-2.0/glue-2
	* */glue/makefile.win32 : s/glue-2.0/glue-2
	* */glue/Makefile.am : s/glue-2.0/glue-2

svn path=/trunk/gtk-sharp/; revision=37324
2004-12-07 19:03:55 +00:00

167 lines
6 KiB
Text

//
// 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("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_dir_list (IntPtr i);
public Gtk.TreeView DirList {
get { return GLib.Object.GetObject (gtksharp_file_selection_get_dir_list (this.Handle), false) as Gtk.TreeView; }
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_file_list (IntPtr i);
public Gtk.TreeView FileList {
get { return GLib.Object.GetObject (gtksharp_file_selection_get_file_list (this.Handle), false) as Gtk.TreeView; }
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_selection_entry (IntPtr i);
public Gtk.Entry SelectionEntry {
get { return GLib.Object.GetObject (gtksharp_file_selection_get_selection_entry (this.Handle), false) as Gtk.Entry; }
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_selection_text (IntPtr i);
public Gtk.Label SelectionText {
get { return GLib.Object.GetObject (gtksharp_file_selection_get_selection_text (this.Handle), false) as Gtk.Label; }
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_ok_button (IntPtr i);
public Gtk.Button OkButton {
get { return new FSButton (this, gtksharp_file_selection_get_ok_button (this.Handle)); }
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_cancel_button (IntPtr i);
public Gtk.Button CancelButton {
get { return new FSButton (this, gtksharp_file_selection_get_cancel_button (this.Handle)); }
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_help_button (IntPtr i);
public Gtk.Button HelpButton {
get { return new FSButton (this, gtksharp_file_selection_get_help_button (this.Handle)); }
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_history_pulldown (IntPtr i);
public Gtk.OptionMenu HistoryPulldown {
get { return GLib.Object.GetObject (gtksharp_file_selection_get_history_pulldown (this.Handle), false) as Gtk.OptionMenu; }
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_history_menu (IntPtr i);
public Gtk.Menu HistoryMenu {
get { return GLib.Object.GetObject (gtksharp_file_selection_get_history_menu (this.Handle), false) as Gtk.Menu; }
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_fileop_dialog (IntPtr i);
public Gtk.MessageDialog FileopDialog {
get { return GLib.Object.GetObject (gtksharp_file_selection_get_fileop_dialog (this.Handle), false) as Gtk.MessageDialog; }
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_fileop_entry (IntPtr i);
public Gtk.Entry FileopEntry {
get { return GLib.Object.GetObject (gtksharp_file_selection_get_fileop_entry (this.Handle), false) as Gtk.Entry; }
}
[DllImport("gtksharpglue-2", CallingConvention=CallingConvention.Cdecl)]
static extern IntPtr gtksharp_file_selection_get_fileop_file (IntPtr i);
public string FileopFile {
get {
return Marshal.PtrToStringAnsi (gtksharp_file_selection_get_fileop_file (this.Handle));
}
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_fileop_c_dir (IntPtr i);
public Gtk.Button FileopCDir {
get { return new FSButton (this, gtksharp_file_selection_get_fileop_c_dir(this.Handle)); }
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_fileop_del_file (IntPtr i);
public Gtk.Button FileopDelFile {
get { return new FSButton (this, gtksharp_file_selection_get_fileop_del_file (this.Handle)); }
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_fileop_ren_file (IntPtr i);
public Gtk.Button FileopRenFile {
get { return new FSButton (this, gtksharp_file_selection_get_fileop_ren_file (this.Handle)); }
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_button_area (IntPtr i);
public Gtk.HButtonBox ButtonArea {
get { return GLib.Object.GetObject (gtksharp_file_selection_get_button_area (this.Handle), false) as Gtk.HButtonBox; }
}
[DllImport("gtksharpglue-2")]
static extern IntPtr gtksharp_file_selection_get_action_area (IntPtr i);
public new Gtk.HButtonBox ActionArea {
get { return GLib.Object.GetObject (gtksharp_file_selection_get_action_area (this.Handle), false) as Gtk.HButtonBox; }
}
[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 (Marshal.PtrToStringAnsi (strptr));
strptr = Marshal.ReadIntPtr (strv, IntPtr.Size * i++);
}
g_strfreev (strv);
return result.ToArray (typeof (string)) as string[];
}
}