File: FileSelection.custom

package info (click to toggle)
gtk-sharp 1%3A1.0.10-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 18,416 kB
  • ctags: 4,465
  • sloc: xml: 224,361; cs: 17,961; sh: 8,422; ansic: 2,724; makefile: 1,604; perl: 1,089
file content (167 lines) | stat: -rw-r--r-- 6,098 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
//
// 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")]
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")]
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")]
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")]
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")]
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")]
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")]
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")]
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")]
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")]
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")]
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", 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")]
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")]
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")]
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")]
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")]
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[];
	}
}