2004-11-04 Jeroen Zwartepoorte <jeroen@xs4all.nl>

* gnomevfs/Directory.cs: Add async GetEntries Uri alias.
	* gtk/FileChooserDialog.custom: Add nice custom properties for Uris.
	ListFilters, ListShortcutFolders and ListShortcutFolderUris.
	* gtk/FileChooserWidget.custom: Idem.
	* gtk/Gtk.metadata: Idem.

svn path=/trunk/gtk-sharp/; revision=35669
This commit is contained in:
Jeroen Zwartepoorte 2004-11-04 20:33:35 +00:00
parent 31b0cf439c
commit fa86814e94
5 changed files with 162 additions and 15 deletions

View file

@ -1,3 +1,11 @@
2004-11-04 Jeroen Zwartepoorte <jeroen@xs4all.nl>
* gnomevfs/Directory.cs: Add async GetEntries Uri alias.
* gtk/FileChooserDialog.custom: Add nice custom properties for Uris.
ListFilters, ListShortcutFolders and ListShortcutFolderUris.
* gtk/FileChooserWidget.custom: Idem.
* gtk/Gtk.metadata: Idem.
2004-11-04 Todd Berman <tberman@off.net> 2004-11-04 Todd Berman <tberman@off.net>
* glib/ListBase.cs: In Empty, call FreeList, not Dispose. * glib/ListBase.cs: In Empty, call FreeList, not Dispose.

View file

@ -49,6 +49,13 @@ namespace Gnome.Vfs {
return entries; return entries;
} }
public static void GetEntries (Uri uri, FileInfoOptions options,
uint itemsPerNotification, int priority,
AsyncDirectoryLoadCallback callback)
{
GetEntries (uri.ToString (), options, itemsPerNotification, priority, callback);
}
[DllImport ("gnomevfs-2")] [DllImport ("gnomevfs-2")]
private static extern void gnome_vfs_async_load_directory (out IntPtr handle, string uri, FileInfoOptions options, uint items_per_notification, int priority, AsyncDirectoryLoadCallbackNative native, IntPtr data); private static extern void gnome_vfs_async_load_directory (out IntPtr handle, string uri, FileInfoOptions options, uint items_per_notification, int priority, AsyncDirectoryLoadCallbackNative native, IntPtr data);

View file

@ -67,3 +67,67 @@
return result; return result;
} }
} }
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_get_uris (IntPtr raw);
public string[] Uris {
get {
IntPtr raw_ret = gtk_file_chooser_get_uris (Handle);
if (raw_ret == IntPtr.Zero)
return new string[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (string));
string[] result = new string [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (string) list [i];
list.Empty ();
return result;
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_list_filters (IntPtr raw);
public FileFilter[] Filters {
get {
IntPtr raw_ret = gtk_file_chooser_list_filters (Handle);
if (raw_ret == IntPtr.Zero)
return new FileFilter[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (FileFilter));
FileFilter[] result = new FileFilter [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (FileFilter) list [i];
list.Dispose ();
return result;
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_list_shortcut_folders (IntPtr raw);
public string[] ShortcutFolders {
get {
IntPtr raw_ret = gtk_file_chooser_list_shortcut_folders (Handle);
if (raw_ret == IntPtr.Zero)
return new string[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (string));
string[] result = new string [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (string) list [i];
list.Empty ();
return result;
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_list_shortcut_folder_uris (IntPtr raw);
public string[] ShortcutFolderUris {
get {
IntPtr raw_ret = gtk_file_chooser_list_shortcut_folder_uris (Handle);
if (raw_ret == IntPtr.Zero)
return new string[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (string));
string[] result = new string [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (string) list [i];
list.Empty ();
return result;
}
}

View file

@ -19,10 +19,10 @@
// Boston, MA 02111-1307, USA. // Boston, MA 02111-1307, USA.
[DllImport ("libgtk-win32-2.0-0.dll")] [DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_get_filenames (IntPtr raw); static extern IntPtr gtk_file_chooser_get_filenames (IntPtr raw);
public string[] Filenames { public string[] Filenames {
get { get {
IntPtr raw_ret = gtk_file_chooser_get_filenames (Handle); IntPtr raw_ret = gtk_file_chooser_get_filenames (Handle);
if (raw_ret == IntPtr.Zero) if (raw_ret == IntPtr.Zero)
@ -34,4 +34,68 @@ public string[] Filenames {
list.Empty (); list.Empty ();
return result; return result;
} }
} }
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_get_uris (IntPtr raw);
public string[] Uris {
get {
IntPtr raw_ret = gtk_file_chooser_get_uris (Handle);
if (raw_ret == IntPtr.Zero)
return new string[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (string));
string[] result = new string [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (string) list [i];
list.Empty ();
return result;
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_list_filters (IntPtr raw);
public FileFilter[] Filters {
get {
IntPtr raw_ret = gtk_file_chooser_list_filters (Handle);
if (raw_ret == IntPtr.Zero)
return new FileFilter[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (FileFilter));
FileFilter[] result = new FileFilter [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (FileFilter) list [i];
list.Dispose ();
return result;
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_list_shortcut_folders (IntPtr raw);
public string[] ShortcutFolders {
get {
IntPtr raw_ret = gtk_file_chooser_list_shortcut_folders (Handle);
if (raw_ret == IntPtr.Zero)
return new string[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (string));
string[] result = new string [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (string) list [i];
list.Empty ();
return result;
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_list_shortcut_folder_uris (IntPtr raw);
public string[] ShortcutFolderUris {
get {
IntPtr raw_ret = gtk_file_chooser_list_shortcut_folder_uris (Handle);
if (raw_ret == IntPtr.Zero)
return new string[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (string));
string[] result = new string [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (string) list [i];
list.Empty ();
return result;
}
}

View file

@ -65,6 +65,10 @@
<attr path="/api/namespace/interface[@cname='GtkEditable']/signal[@name='DeleteText']" name="name">TextDeleted</attr> <attr path="/api/namespace/interface[@cname='GtkEditable']/signal[@name='DeleteText']" name="name">TextDeleted</attr>
<attr path="/api/namespace/interface[@cname='GtkEditable']/signal[@name='InsertText']" name="name">TextInserted</attr> <attr path="/api/namespace/interface[@cname='GtkEditable']/signal[@name='InsertText']" name="name">TextInserted</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetFilenames']" name="hidden">1</attr> <attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetFilenames']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetUris']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='ListFilters']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='ListShortcutFolders']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='ListShortcutFolderUris']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GtkTreeModel']/method[@name='GetIterFirst']/*/*[@name='iter']" name="pass_as">out</attr> <attr path="/api/namespace/interface[@cname='GtkTreeModel']/method[@name='GetIterFirst']/*/*[@name='iter']" name="pass_as">out</attr>
<attr path="/api/namespace/interface[@cname='GtkTreeModel']/method[@name='Get']" name="hidden">1</attr> <attr path="/api/namespace/interface[@cname='GtkTreeModel']/method[@name='Get']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GtkTreeModel']/method[@name='GetIterFromString']/*/*[@name='iter']" name="pass_as">out</attr> <attr path="/api/namespace/interface[@cname='GtkTreeModel']/method[@name='GetIterFromString']/*/*[@name='iter']" name="pass_as">out</attr>