Skip to content
Browse files

restructuring for gtk-sharp/gnome-sharp split

svn path=/trunk/gnome-sharp/; revision=63086
  • Loading branch information...
1 parent 692bcef commit 3d70fac21e42800f15583f34aa10ce9c46f1dbcb @mkestner mkestner committed Jul 28, 2006
Showing with 14,155 additions and 0 deletions.
  1. +112 −0 gnomevfs/Async.cs
  2. +23 −0 gnomevfs/AsyncCallback.cs
  3. +42 −0 gnomevfs/AsyncCallbackNative.cs
  4. +25 −0 gnomevfs/AsyncDirectoryLoadCallback.cs
  5. +50 −0 gnomevfs/AsyncDirectoryLoadCallbackNative.cs
  6. +25 −0 gnomevfs/AsyncReadCallback.cs
  7. +53 −0 gnomevfs/AsyncReadCallbackNative.cs
  8. +23 −0 gnomevfs/AsyncWriteCallback.cs
  9. +45 −0 gnomevfs/AsyncWriteCallbackNative.cs
  10. +115 −0 gnomevfs/Directory.cs
  11. +359 −0 gnomevfs/FileInfo.cs
  12. +127 −0 gnomevfs/Gnomevfs.metadata
  13. +51 −0 gnomevfs/Makefile.am
  14. +178 −0 gnomevfs/MimeType.cs
  15. +39 −0 gnomevfs/ModuleCallback.cs
  16. +184 −0 gnomevfs/ModuleCallbackAuthentication.cs
  17. +227 −0 gnomevfs/ModuleCallbackFillAuthentication.cs
  18. +287 −0 gnomevfs/ModuleCallbackFullAuthentication.cs
  19. +221 −0 gnomevfs/ModuleCallbackSaveAuthentication.cs
  20. +153 −0 gnomevfs/ModuleCallbackStatusMessage.cs
  21. +124 −0 gnomevfs/Monitor.cs
  22. +156 −0 gnomevfs/Sync.cs
  23. +132 −0 gnomevfs/Uri.custom
  24. +112 −0 gnomevfs/Vfs.cs
  25. +39 −0 gnomevfs/VfsException.cs
  26. +640 −0 gnomevfs/VfsStream.cs
  27. +101 −0 gnomevfs/VfsStreamAsyncResult.cs
  28. +61 −0 gnomevfs/VolumeMonitor.custom
  29. +104 −0 gnomevfs/Xfer.cs
  30. +23 −0 gnomevfs/XferProgressCallback.cs
  31. +42 −0 gnomevfs/XferProgressCallbackNative.cs
  32. +3,448 −0 gnomevfs/gnome-vfs-api-2.10.raw
  33. +3,696 −0 gnomevfs/gnome-vfs-api-2.16.raw
  34. +3,118 −0 gnomevfs/gnome-vfs-api-2.6.raw
  35. +11 −0 gnomevfs/gnome-vfs-sharp-2.0.pc.in
  36. +3 −0 gnomevfs/gnome-vfs-sharp.dll.config.in
  37. +6 −0 gnomevfs/gnomevfs-symbols.xml
View
112 gnomevfs/Async.cs
@@ -0,0 +1,112 @@
+// Async.cs - Bindings for gnome-vfs asynchronized file operations.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+
+namespace Gnome.Vfs {
+ public class Async {
+ public enum Priority {
+ Min = -10,
+ Default = 0,
+ Max = 10
+ }
+
+ private Async () {}
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_cancel (IntPtr handle);
+
+ public static void Cancel (Handle handle)
+ {
+ gnome_vfs_async_cancel (handle.Handle);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_close (IntPtr handle, AsyncCallbackNative callback, IntPtr data);
+
+ public static void Close (Handle handle, AsyncCallback callback)
+ {
+ AsyncCallbackWrapper wrapper = new AsyncCallbackWrapper (callback, null);
+ gnome_vfs_async_close (handle.Handle, wrapper.NativeDelegate, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_create (out IntPtr handle, string uri, OpenMode mode, bool exclusive, uint perm, int priority, AsyncCallbackNative callback, IntPtr data);
+
+ public static Handle Create (string uri, OpenMode mode, bool exclusive, FilePermissions perm, int priority, AsyncCallback callback)
+ {
+ IntPtr handle = IntPtr.Zero;
+ AsyncCallbackWrapper wrapper = new AsyncCallbackWrapper (callback, null);
+ gnome_vfs_async_create (out handle, uri, mode, exclusive, (uint)perm, priority, wrapper.NativeDelegate, IntPtr.Zero);
+ return new Handle (handle);
+ }
+
+ public static Handle Create (Uri uri, OpenMode mode, bool exclusive, FilePermissions perm, int priority, AsyncCallback callback)
+ {
+ return Create (uri.ToString (), mode, exclusive, perm, priority, callback);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_open (out IntPtr handle, string uri, OpenMode mode, int priority, AsyncCallbackNative callback, IntPtr data);
+
+ public static Handle Open (string uri, OpenMode mode, int priority, AsyncCallback callback)
+ {
+ IntPtr handle = IntPtr.Zero;
+ AsyncCallbackWrapper wrapper = new AsyncCallbackWrapper (callback, null);
+ gnome_vfs_async_open (out handle, uri, mode, priority, wrapper.NativeDelegate, IntPtr.Zero);
+ return new Handle (handle);
+ }
+
+ public static Handle Open (Uri uri, OpenMode mode, int priority, AsyncCallback callback)
+ {
+ return Open (uri.ToString (), mode, priority, callback);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_read (IntPtr handle, out byte buffer, uint bytes, AsyncReadCallbackNative callback, IntPtr data);
+
+ public static void Read (Handle handle, out byte buffer, uint bytes, AsyncReadCallback callback)
+ {
+ AsyncReadCallbackWrapper wrapper = new AsyncReadCallbackWrapper (callback, null);
+ gnome_vfs_async_read (handle.Handle, out buffer, bytes, wrapper.NativeDelegate, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_seek (IntPtr handle, SeekPosition whence, long offset, AsyncCallbackNative callback, IntPtr data);
+
+ public static void Seek (Handle handle, SeekPosition whence, long offset, AsyncCallback callback)
+ {
+ AsyncCallbackWrapper wrapper = new AsyncCallbackWrapper (callback, null);
+ gnome_vfs_async_seek (handle.Handle, whence, offset, wrapper.NativeDelegate, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_write (IntPtr handle, out byte buffer, uint bytes, AsyncWriteCallbackNative callback, IntPtr data);
+
+ public static void Write (Handle handle, out byte buffer, uint bytes, AsyncWriteCallback callback)
+ {
+ AsyncWriteCallbackWrapper wrapper = new AsyncWriteCallbackWrapper (callback, null);
+ gnome_vfs_async_write (handle.Handle, out buffer, bytes, wrapper.NativeDelegate, IntPtr.Zero);
+ }
+
+ }
+}
View
23 gnomevfs/AsyncCallback.cs
@@ -0,0 +1,23 @@
+// AsyncCallback.cs - GnomeVFSAsyncCallback delegate.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+namespace Gnome.Vfs {
+ public delegate void AsyncCallback (Handle handle, Result result);
+}
View
42 gnomevfs/AsyncCallbackNative.cs
@@ -0,0 +1,42 @@
+// AsyncCallbackNative.cs - GnomeVFSAsyncCallback native wrapper.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+
+namespace Gnome.Vfs {
+ internal delegate void AsyncCallbackNative (IntPtr handle, Result result, IntPtr data);
+
+ internal class AsyncCallbackWrapper : GLib.DelegateWrapper {
+
+ public void NativeCallback (IntPtr handle, Result result, IntPtr data)
+ {
+ _managed (new Handle (handle), result);
+ }
+
+ internal AsyncCallbackNative NativeDelegate;
+ protected AsyncCallback _managed;
+
+ public AsyncCallbackWrapper (AsyncCallback managed, object o) : base (o)
+ {
+ NativeDelegate = new AsyncCallbackNative (NativeCallback);
+ _managed = managed;
+ }
+ }
+}
View
25 gnomevfs/AsyncDirectoryLoadCallback.cs
@@ -0,0 +1,25 @@
+// AsyncDirectoryLoadCallback.cs - GnomeVFSAsyncDirectoryLoadCallback delegate.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+
+namespace Gnome.Vfs {
+ public delegate void AsyncDirectoryLoadCallback (Result result, FileInfo[] infos, uint entries_read);
+}
View
50 gnomevfs/AsyncDirectoryLoadCallbackNative.cs
@@ -0,0 +1,50 @@
+// AsyncDirectoryLoadCallbackNative.cs - GnomeVFSAsyncDirectoryLoadCallback
+// native wrapper.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Gnome.Vfs {
+ internal delegate void AsyncDirectoryLoadCallbackNative (IntPtr handle, Result result, IntPtr list, uint entries_read, IntPtr data);
+
+ internal class AsyncDirectoryLoadCallbackWrapper : GLib.DelegateWrapper {
+
+ public void NativeCallback (IntPtr handle, Result result, IntPtr list, uint entries_read, IntPtr data)
+ {
+ GLib.List infos = new GLib.List (list, typeof (IntPtr));
+ FileInfo[] entries = new FileInfo [infos.Count];
+ int i = 0;
+ foreach (IntPtr info in infos)
+ entries[i++] = new FileInfo (info);
+
+ _managed (result, entries, entries_read);
+ }
+
+ internal AsyncDirectoryLoadCallbackNative NativeDelegate;
+ protected AsyncDirectoryLoadCallback _managed;
+
+ public AsyncDirectoryLoadCallbackWrapper (AsyncDirectoryLoadCallback managed, object o) : base (o)
+ {
+ NativeDelegate = new AsyncDirectoryLoadCallbackNative (NativeCallback);
+ _managed = managed;
+ }
+ }
+}
View
25 gnomevfs/AsyncReadCallback.cs
@@ -0,0 +1,25 @@
+// AsyncReadCallback.cs - GnomeVFSAsyncReadCallback delegate.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+
+namespace Gnome.Vfs {
+ public delegate void AsyncReadCallback (Handle handle, Result result, byte[] buffer, ulong bytes_requested, ulong bytes_read);
+}
View
53 gnomevfs/AsyncReadCallbackNative.cs
@@ -0,0 +1,53 @@
+// AsyncReadCallbackNative.cs - GnomeVFSAsyncReadCallback native wrapper.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+//
+// VfsAsyncReadCallbackNative.cs: Utility class for accessing gnome-vfs methods.
+//
+// Author:
+// Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// (C) Copyright Jeroen Zwartepoorte 2004
+//
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Gnome.Vfs {
+ internal delegate void AsyncReadCallbackNative (IntPtr handle, Result result, IntPtr buffer, ulong bytes_requested, ulong bytes_read, IntPtr data);
+
+ internal class AsyncReadCallbackWrapper : GLib.DelegateWrapper {
+
+ public void NativeCallback (IntPtr handle, Result result, IntPtr buffer, ulong bytes_requested, ulong bytes_read, IntPtr data)
+ {
+ byte[] bytes = new byte[bytes_read];
+ Marshal.Copy (buffer, bytes, 0, (int)bytes_read);
+ _managed (new Handle (handle), result, bytes, bytes_requested, bytes_read);
+ }
+
+ internal AsyncReadCallbackNative NativeDelegate;
+ protected AsyncReadCallback _managed;
+
+ public AsyncReadCallbackWrapper (AsyncReadCallback managed, object o) : base (o)
+ {
+ NativeDelegate = new AsyncReadCallbackNative (NativeCallback);
+ _managed = managed;
+ }
+ }
+}
View
23 gnomevfs/AsyncWriteCallback.cs
@@ -0,0 +1,23 @@
+// AsyncWriteCallback.cs - GnomeVFSAsyncWriteCallback delegate.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+namespace Gnome.Vfs {
+ public delegate void AsyncWriteCallback (Handle handle, Result result, byte[] buffer, ulong bytes_requested, ulong bytes_written);
+}
View
45 gnomevfs/AsyncWriteCallbackNative.cs
@@ -0,0 +1,45 @@
+// AsyncWriteCallbackNative.cs - Native wrapper for GnomeVFSAsyncWriteCallback.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Gnome.Vfs {
+ internal delegate void AsyncWriteCallbackNative (IntPtr handle, Result result, IntPtr buffer, ulong bytes_requested, ulong bytes_written, IntPtr data);
+
+ internal class AsyncWriteCallbackWrapper : GLib.DelegateWrapper {
+
+ public void NativeCallback (IntPtr handle, Result result, IntPtr buffer, ulong bytes_requested, ulong bytes_written, IntPtr data)
+ {
+ byte[] bytes = new byte[bytes_written];
+ Marshal.Copy (buffer, bytes, 0, (int)bytes_written);
+ _managed (new Handle (handle), result, bytes, bytes_requested, bytes_written);
+ }
+
+ internal AsyncWriteCallbackNative NativeDelegate;
+ protected AsyncWriteCallback _managed;
+
+ public AsyncWriteCallbackWrapper (AsyncWriteCallback managed, object o) : base (o)
+ {
+ NativeDelegate = new AsyncWriteCallbackNative (NativeCallback);
+ _managed = managed;
+ }
+ }
+}
View
115 gnomevfs/Directory.cs
@@ -0,0 +1,115 @@
+// Directory.cs - Bindings for gnome-vfs directory functions calls.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+
+namespace Gnome.Vfs {
+ public class Directory {
+ private Directory () {}
+
+ public static FileInfo[] GetEntries (Uri uri)
+ {
+ return GetEntries (uri.ToString ());
+ }
+
+ public static FileInfo[] GetEntries (Uri uri, FileInfoOptions options)
+ {
+ return GetEntries (uri.ToString (), options);
+ }
+
+ public static FileInfo[] GetEntries (string text_uri)
+ {
+ return GetEntries (text_uri, FileInfoOptions.Default);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern Result gnome_vfs_directory_list_load (out IntPtr list, string uri, FileInfoOptions options);
+
+ public static FileInfo[] GetEntries (string text_uri, FileInfoOptions options)
+ {
+ IntPtr raw_ret;
+ Result result = gnome_vfs_directory_list_load (out raw_ret, text_uri, options);
+ Vfs.ThrowException (text_uri, result);
+
+ GLib.List list = new GLib.List (raw_ret, typeof (IntPtr));
+ list.Managed = true;
+ FileInfo[] entries = new FileInfo [list.Count];
+ int i = 0;
+ foreach (IntPtr info in list)
+ entries[i++] = new FileInfo (info);
+
+ 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")]
+ 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);
+
+ public static void GetEntries (string uri, FileInfoOptions options,
+ uint itemsPerNotification, int priority,
+ AsyncDirectoryLoadCallback callback)
+ {
+ IntPtr handle = IntPtr.Zero;
+ AsyncDirectoryLoadCallbackWrapper wrapper = new AsyncDirectoryLoadCallbackWrapper (callback, null);
+ gnome_vfs_async_load_directory (out handle, uri, options, itemsPerNotification,
+ priority, wrapper.NativeDelegate, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern Result gnome_vfs_make_directory_for_uri (IntPtr raw, uint perm);
+
+ public static Result Create (Uri uri, FilePermissions perm)
+ {
+ return gnome_vfs_make_directory_for_uri (uri.Handle, (uint)perm);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern Result gnome_vfs_make_directory (string uri, uint perm);
+
+ public static Result Create (string uri, FilePermissions perm)
+ {
+ return gnome_vfs_make_directory (uri, (uint)perm);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern Result gnome_vfs_remove_directory_from_uri (IntPtr raw);
+
+ public static Result Delete (Uri uri)
+ {
+ return gnome_vfs_remove_directory_from_uri (uri.Handle);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern Result gnome_vfs_remove_directory (string uri);
+
+ public static Result Delete (string uri)
+ {
+ return gnome_vfs_remove_directory (uri);
+ }
+ }
+}
View
359 gnomevfs/FileInfo.cs
@@ -0,0 +1,359 @@
+// FileInfo.cs - Class wrapping the GnomeVFSFileInfo struct.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Gnome.Vfs {
+ public class FileInfo {
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct FileInfoNative {
+ public IntPtr name;
+ public FileInfoFields valid_fields;
+ public FileType type;
+ public FilePermissions permissions;
+ public FileFlags flags;
+ public long dev_t;
+ public long inode;
+ public uint link_count;
+ public uint uid;
+ public uint gid;
+ public long size;
+ public long block_count;
+ public uint io_block_size;
+ public IntPtr atime;
+ public IntPtr mtime;
+ public IntPtr ctime;
+ public IntPtr symlink_name;
+ public IntPtr mime_type;
+ public uint refcount;
+ public IntPtr reserved1;
+ public IntPtr reserved2;
+ public IntPtr reserved3;
+ public IntPtr reserved4;
+ public IntPtr reserved5;
+ }
+
+ IntPtr handle;
+ bool needs_dispose = false;
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_file_info_unref (IntPtr handle);
+
+ ~FileInfo ()
+ {
+ if (needs_dispose)
+ gnome_vfs_file_info_unref (Handle);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern IntPtr gnome_vfs_file_info_new ();
+
+ public FileInfo ()
+ {
+ needs_dispose = true;
+ handle = gnome_vfs_file_info_new ();
+ }
+
+ public FileInfo (IntPtr handle)
+ {
+ this.handle = handle;
+ }
+
+ public FileInfo (string uri) : this (uri, FileInfoOptions.Default) {}
+
+ public FileInfo (string uri, FileInfoOptions options) : this (new Uri (uri), options) {}
+
+ public FileInfo (Uri uri) : this (uri, FileInfoOptions.Default) {}
+
+ [DllImport ("gnomevfs-2")]
+ private static extern Result gnome_vfs_get_file_info_uri (IntPtr uri, IntPtr info, int options);
+
+ public FileInfo (Uri uri, FileInfoOptions options) : this ()
+ {
+ Result result = gnome_vfs_get_file_info_uri (uri.Handle, Handle, (int) options);
+ Vfs.ThrowException (uri, result);
+ }
+
+ FileInfoNative Native {
+ get {
+ return (FileInfoNative) Marshal.PtrToStructure (handle, typeof (FileInfoNative));
+ }
+ }
+
+ public IntPtr Handle {
+ get {
+ return handle;
+ }
+ }
+
+ public string Name {
+ get {
+ FileInfoNative info = Native;
+ if (info.name != IntPtr.Zero)
+ return GLib.Marshaller.Utf8PtrToString (info.name);
+ else
+ return null;
+ }
+ }
+
+ public FileInfoFields ValidFields {
+ get {
+ return Native.valid_fields;
+ }
+ }
+
+ public FileType Type {
+ get {
+ if ((ValidFields & FileInfoFields.Type) != 0)
+ return Native.type;
+ else
+ throw new ArgumentException ("Type is not set");
+ }
+ }
+
+ public FilePermissions Permissions {
+ get {
+ if ((ValidFields & FileInfoFields.Permissions) != 0)
+ return Native.permissions;
+ else
+ throw new ArgumentException ("Permissions is not set");
+ }
+ }
+
+ public FileFlags Flags {
+ get {
+ if ((ValidFields & FileInfoFields.Flags) != 0)
+ return Native.flags;
+ else
+ throw new ArgumentException ("Flags is not set");
+ }
+ }
+
+ public long Device {
+ get {
+ if ((ValidFields & FileInfoFields.Device) != 0)
+ return Native.dev_t;
+ else
+ throw new ArgumentException ("Device is not set");
+ }
+ }
+
+ public long Inode {
+ get {
+ if ((ValidFields & FileInfoFields.Inode) != 0)
+ return Native.inode;
+ else
+ throw new ArgumentException ("Inode is not set");
+ }
+ }
+
+ public uint LinkCount {
+ get {
+ if ((ValidFields & FileInfoFields.LinkCount) != 0)
+ return Native.link_count;
+ else
+ throw new ArgumentException ("LinkCount is not set");
+ }
+ }
+
+ public uint Uid {
+ get {
+ return Native.uid;
+ }
+ }
+
+ public uint Gid {
+ get {
+ return Native.gid;
+ }
+ }
+
+ public long Size {
+ get {
+ if ((ValidFields & FileInfoFields.Size) != 0)
+ return Native.size;
+ else
+ throw new ArgumentException ("Size is not set");
+ }
+ }
+
+ public long BlockCount {
+ get {
+ if ((ValidFields & FileInfoFields.BlockCount) != 0)
+ return Native.block_count;
+ else
+ throw new ArgumentException ("BlockCount is not set");
+ }
+ }
+
+ public uint IoBlockSize {
+ get {
+ if ((ValidFields & FileInfoFields.IoBlockSize) != 0)
+ return Native.io_block_size;
+ else
+ throw new ArgumentException ("IoBlockSize is not set");
+ }
+ }
+
+ public System.DateTime Atime {
+ get {
+ if ((ValidFields & FileInfoFields.Atime) != 0)
+ return GLib.Marshaller.time_tToDateTime (Native.atime);
+ else
+ throw new ArgumentException ("Atime is not set");
+ }
+ }
+
+ public System.DateTime Mtime {
+ get {
+ if ((ValidFields & FileInfoFields.Mtime) != 0)
+ return GLib.Marshaller.time_tToDateTime (Native.mtime);
+ else
+ throw new ArgumentException ("Mtime is not set");
+ }
+ }
+
+ public System.DateTime Ctime {
+ get {
+ if ((ValidFields & FileInfoFields.Ctime) != 0)
+ return GLib.Marshaller.time_tToDateTime (Native.ctime);
+ else
+ throw new ArgumentException ("Ctime is not set");
+ }
+ }
+
+ public string SymlinkName {
+ get {
+ FileInfoNative info = Native;
+ if ((ValidFields & FileInfoFields.SymlinkName) != 0 &&
+ info.symlink_name != IntPtr.Zero)
+ return GLib.Marshaller.Utf8PtrToString (info.symlink_name);
+ else
+ throw new ArgumentException ("SymlinkName is not set");
+ }
+ }
+
+ public string MimeType {
+ get {
+ FileInfoNative info = Native;
+ if ((ValidFields & FileInfoFields.MimeType) != 0 &&
+ info.mime_type != IntPtr.Zero)
+ return GLib.Marshaller.Utf8PtrToString (info.mime_type);
+ else
+ throw new ArgumentException ("MimeType is not set");
+ }
+ }
+
+ public bool IsSymlink {
+ get {
+ FileFlags flags = Flags;
+ return (flags & FileFlags.Symlink) != 0;
+ }
+ }
+
+ public bool IsLocal {
+ get {
+ FileFlags flags = Flags;
+ return (flags & FileFlags.Local) != 0;
+ }
+ }
+
+ public bool HasSuid {
+ get {
+ FilePermissions perms = Permissions;
+ return (perms & FilePermissions.Suid) != 0;
+ }
+ }
+
+ public bool HasSgid {
+ get {
+ FilePermissions perms = Permissions;
+ return (perms & FilePermissions.Sgid) != 0;
+ }
+ }
+
+ public bool IsSticky {
+ get {
+ FilePermissions perms = Permissions;
+ return (perms & FilePermissions.Sticky) != 0;
+ }
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_file_info_clear (IntPtr info);
+
+ public void Clear ()
+ {
+ gnome_vfs_file_info_clear (Handle);
+ }
+
+ public override String ToString ()
+ {
+ FileInfoNative info = Native;
+ string result = "Name = " + Name + "\n" +
+ "ValidFields = " + info.valid_fields + "\n";
+ if ((ValidFields & FileInfoFields.Type) != 0)
+ result += "Type = " + info.type + "\n";
+ if ((ValidFields & FileInfoFields.Permissions) != 0)
+ result += "Permissions = " + info.permissions + "\n";
+ if ((ValidFields & FileInfoFields.Flags) != 0) {
+ result += "Flags = ";
+ bool flag = false;
+ if (Flags == FileFlags.None) {
+ result += "None";
+ flag = true;
+ }
+ if ((Flags & FileFlags.Symlink) != 0) {
+ result += flag ? ", Symlink" : "Symlink";
+ flag = true;
+ }
+ if ((Flags & FileFlags.Local) != 0)
+ result += flag ? ", Local" : "Local";
+ result += "\n";
+ }
+ if ((ValidFields & FileInfoFields.Device) != 0)
+ result += "Device = " + info.dev_t + "\n";
+ if ((ValidFields & FileInfoFields.Inode) != 0)
+ result += "Inode = " + info.inode + "\n";
+ if ((ValidFields & FileInfoFields.LinkCount) != 0)
+ result += "LinkCount = " + info.link_count + "\n";
+ result += "Uid = " + info.uid + "\n";
+ result += "Gid = " + info.gid + "\n";
+ if ((ValidFields & FileInfoFields.Size) != 0)
+ result += "Size = " + info.size + "\n";
+ if ((ValidFields & FileInfoFields.BlockCount) != 0)
+ result += "BlockCount = " + info.block_count + "\n";
+ if ((ValidFields & FileInfoFields.IoBlockSize) != 0)
+ result += "IoBlockSize = " + info.io_block_size + "\n";
+ if ((ValidFields & FileInfoFields.Atime) != 0)
+ result += "Atime = " + Atime + "\n";
+ if ((ValidFields & FileInfoFields.Mtime) != 0)
+ result += "Mtime = " + Mtime + "\n";
+ if ((ValidFields & FileInfoFields.Ctime) != 0)
+ result += "Ctime = " + Ctime + "\n";
+ if ((ValidFields & FileInfoFields.SymlinkName) != 0)
+ result += "SymlinkName = " + SymlinkName + "\n";
+ if ((ValidFields & FileInfoFields.MimeType) != 0)
+ result += "MimeType = " + MimeType + "\n";
+ return result;
+ }
+ }
+}
View
127 gnomevfs/Gnomevfs.metadata
@@ -0,0 +1,127 @@
+<?xml version="1.0"?>
+<metadata>
+ <attr path="/api/namespace" name="name">Gnome.Vfs</attr>
+ <attr path="/api/namespace/alias[@cname='XdgUchar8T']" name="hidden">1</attr>
+ <attr path="/api/namespace/alias[@cname='XdgUint16T']" name="hidden">1</attr>
+ <attr path="/api/namespace/alias[@cname='XdgUint32T']" name="hidden">1</attr>
+ <attr path="/api/namespace/alias[@cname='XdgUnicharT']" name="hidden">1</attr>
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSAsyncCallback']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSAsyncDirectoryLoadCallback']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSAsyncFileControlCallback']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSAsyncGetFileInfoCallback']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSAsyncModuleCallback']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSAsyncOpenAsChannelCallback']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSAsyncReadCallback']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSAsyncSetFileInfoCallback']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSAsyncWriteCallback']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSAsyncXferProgressCallback']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSDirectoryVisitFunc']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSModuleCallback']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSModuleCallbackResponse']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSMonitorCallback']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSProcessCallback']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSProcessInitFunc']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSSniffBufferReadCall']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSSniffBufferSeekCall']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSSocketCloseFunc']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSSocketReadFunc']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSSocketWriteFunc']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSUnixMountCallback']" />
+ <remove-node path="/api/namespace/callback[@cname='GnomeVFSXferProgressCallback']" />
+ <attr path="/api/namespace/callback[@cname='GnomeVFSVolumeOpCallback']/*/*[@type='char*']" name="type">const-char*</attr>
+ <remove-node path="/api/namespace/class[@cname='GnomeVfsAsync_']" />
+ <remove-node path="/api/namespace/class[@cname='GnomeVfsDirectory_']" />
+ <attr path="/api/namespace/class[@cname='GnomeVfsMime_']/method[@name='GetAllApplications']/return-type" name="element_type">GnomeVFSMimeApplication*</attr>
+ <attr path="/api/namespace/class[@cname='GnomeVfsMime_']/method[@name='GetAllApplications']/return-type" name="owned">true</attr>
+ <attr path="/api/namespace/class[@cname='GnomeVfsMime_']/method[@name='GetAllApplications']/return-type" name="elements_owned">true</attr>
+ <remove-node path="/api/namespace/class[@cname='GnomeVfsMonitor_']" />
+ <remove-node path="/api/namespace/class[@cname='GnomeVfsXfer_']" />
+ <attr path="/api/namespace/enum[@cname='GnomeVFSDirectoryVisitOptions']" name="hidden">1</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='Suid']" name="value">1 &lt;&lt; 11</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='Sgid']" name="value">1 &lt;&lt; 10</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='Sticky']" name="value">1 &lt;&lt; 9</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='UserRead']" name="value">1 &lt;&lt; 8</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='UserWrite']" name="value">1 &lt;&lt; 7</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='UserExec']" name="value">1 &lt;&lt; 6</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='UserAll']" name="value">UserRead | UserWrite | UserExec</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='GroupRead']" name="value">1 &lt;&lt; 5</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='GroupWrite']" name="value">1 &lt;&lt; 4</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='GroupExec']" name="value">1 &lt;&lt; 3</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='GroupAll']" name="value">GroupRead | GroupWrite | GroupExec</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='OtherRead']" name="value">1 &lt;&lt; 2</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='OtherWrite']" name="value">1 &lt;&lt; 1</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='OtherExec']" name="value">1</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFilePermissions']/member[@name='OtherAll']" name="value">OtherRead | OtherWrite | OtherExec</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSFindDirectoryKind']" name="hidden">1</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSMakeURIDirs']" name="hidden">1</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSMonitorEventType']" name="hidden">1</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSProcessOptions']" name="hidden">1</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSProcessResult']" name="hidden">1</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSProcessRunResult']" name="hidden">1</attr>
+ <attr path="/api/namespace/enum[@cname='GnomeVFSURIHideOptions']" name="name">UriHideOptions</attr>
+ <attr path="/api/namespace/enum[@cname='XdgGlobType']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSACE']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSClient']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSClientCall']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSDrive']/method[@name='Ref']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSDrive']/method[@name='Unref']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSMIMEMonitor']" name="name">MimeMonitor</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSVolume']/method[@name='HandlesTrash']" name="name">GetHandlesTrash</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSVolume']/method[@name='Ref']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSVolume']/method[@name='Unref']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSVolumeMonitor']/method[@name='GetConnectedDrives']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSVolumeMonitor']/method[@name='GetMountedVolumes']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSVolumeMonitor']/method[@name='Ref']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSVolumeMonitor']/method[@name='Unref']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSVolumeMonitorClient']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@cname='GnomeVFSVolumeMonitorDaemon']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSCancellation']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSContext']/method[@name='Free']" name="deprecated">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSDirectoryHandle']" name="hidden">1</attr>
+ <remove-node path="/api/namespace/struct[@cname='GnomeVFSFileInfo']" />
+ <attr path="/api/namespace/struct[@cname='GnomeVFSFindDirectoryResult']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSGetFileInfoResult']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSInetConnection']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSMimeAction']/field[@cname='action']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSMimeApplication']/field" name="access">private</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSMimeSniffBuffer']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSModuleCallbackAdditionalHeadersIn']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSModuleCallbackAdditionalHeadersOut']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSModuleCallbackAuthenticationIn']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSModuleCallbackAuthenticationOut']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSModuleCallbackFillAuthenticationIn']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSModuleCallbackFillAuthenticationOut']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSModuleCallbackFullAuthenticationIn']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSModuleCallbackFullAuthenticationOut']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSModuleCallbackReceivedHeadersIn']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSModuleCallbackReceivedHeadersOut']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSModuleCallbackSaveAuthenticationIn']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSModuleCallbackSaveAuthenticationOut']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSModuleCallbackStatusMessageIn']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSModuleCallbackStatusMessageOut']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSMonitorHandle']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSProcess']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSProgressCallbackState']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSSSL']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSSocket']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSSocketBuffer']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSSocketImpl']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSToplevelURI']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSURI']" name="name">Uri</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSURI']/method[@name='Dup']" name="name">Clone</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSURI']/method[@name='Exists']" name="name">GetExists</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSURI']/method[@name='Equal']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSURI']/method[@name='GetToplevel']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSURI']/method[@name='Hash']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSURI']/method[@name='Hequal']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSURI']/method[@name='ListCopy']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSURI']/method[@name='ListFree']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSURI']/method[@name='ListParse']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSURI']/method[@name='ListRef']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSURI']/method[@name='ListUnref']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSUnixMount']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GnomeVFSUnixMountPoint']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='XdgGlobHash']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='XdgMimeMagic']" name="hidden">1</attr>
+ <add-node path="/api"><symbol type="manual" cname="GnomeVFSFileInfo" name="Gnome.Vfs.FileInfo"/></add-node>
+</metadata>
View
51 gnomevfs/Makefile.am
@@ -0,0 +1,51 @@
+SUBDIRS = .
+
+if ENABLE_GNOMEVFS
+pkg = gnome-vfs
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = gnome-vfs-sharp-2.0.pc
+else
+pkg=
+endif
+
+SYMBOLS = gnomevfs-symbols.xml
+METADATA = Gnomevfs.metadata
+references = ../glib/glib-sharp.dll
+
+sources = \
+ Async.cs \
+ AsyncCallback.cs \
+ AsyncCallbackNative.cs \
+ AsyncDirectoryLoadCallback.cs \
+ AsyncDirectoryLoadCallbackNative.cs \
+ AsyncReadCallback.cs \
+ AsyncReadCallbackNative.cs \
+ AsyncWriteCallback.cs \
+ AsyncWriteCallbackNative.cs \
+ Directory.cs \
+ FileInfo.cs \
+ MimeType.cs \
+ ModuleCallback.cs \
+ ModuleCallbackAuthentication.cs \
+ ModuleCallbackFillAuthentication.cs \
+ ModuleCallbackFullAuthentication.cs \
+ ModuleCallbackSaveAuthentication.cs \
+ ModuleCallbackStatusMessage.cs \
+ Monitor.cs \
+ Sync.cs \
+ Vfs.cs \
+ VfsException.cs \
+ VfsStream.cs \
+ VfsStreamAsyncResult.cs \
+ Xfer.cs \
+ XferProgressCallback.cs \
+ XferProgressCallbackNative.cs
+
+customs = \
+ Uri.custom \
+ VolumeMonitor.custom
+
+add_dist = gnome-vfs-sharp-2.0.pc.in
+
+include ../Makefile.include
+
View
178 gnomevfs/MimeType.cs
@@ -0,0 +1,178 @@
+// MimeType.cs - Mime-type bindings.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Gnome.Vfs {
+ public class MimeType {
+ public static readonly string UnknownMimeType = "application/octet-stream";
+ private string mimetype;
+
+ [DllImport ("gnomevfs-2")]
+ static extern IntPtr gnome_vfs_get_mime_type (IntPtr uri);
+
+ public MimeType (Uri uri)
+ {
+ IntPtr uri_native = GLib.Marshaller.StringToPtrGStrdup (uri.ToString ());
+ mimetype = GLib.Marshaller.PtrToStringGFree (gnome_vfs_get_mime_type (uri_native));
+ GLib.Marshaller.Free (uri_native);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ static extern bool gnome_vfs_mime_type_is_known (IntPtr mime_type);
+
+ public MimeType (string mimetype)
+ {
+ IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
+ if (!gnome_vfs_mime_type_is_known (mimetype_native))
+ throw new ArgumentException ("Unknown mimetype");
+ this.mimetype = mimetype;
+ GLib.Marshaller.Free (mimetype_native);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ static extern IntPtr gnome_vfs_get_mime_type_for_data (ref byte data, int size);
+
+ public MimeType (byte[] buffer, int size)
+ {
+ mimetype = GLib.Marshaller.Utf8PtrToString (gnome_vfs_get_mime_type_for_data (ref buffer[0], size));
+ }
+
+ [DllImport ("gnomevfs-2")]
+ static extern MimeActionType gnome_vfs_mime_get_default_action_type (IntPtr mime_type);
+
+ [DllImport ("gnomevfs-2")]
+ static extern Result gnome_vfs_mime_set_default_action_type (IntPtr mime_type, MimeActionType action_type);
+
+ public MimeActionType DefaultActionType {
+ get {
+ IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
+ MimeActionType result = gnome_vfs_mime_get_default_action_type (mimetype_native);
+ GLib.Marshaller.Free (mimetype_native);
+ return result;
+ }
+ set {
+ IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
+ Result result = gnome_vfs_mime_set_default_action_type (mimetype_native, value);
+ GLib.Marshaller.Free (mimetype_native);
+ Vfs.ThrowException (result);
+ }
+ }
+
+ [DllImport ("gnomevfs-2")]
+ static extern MimeAction gnome_vfs_mime_get_default_action (IntPtr mime_type);
+
+ public MimeAction DefaultAction {
+ get {
+ IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
+ MimeAction result = gnome_vfs_mime_get_default_action (mimetype_native);
+ GLib.Marshaller.Free (mimetype_native);
+ return result;
+ }
+ }
+
+ [DllImport ("gnomevfs-2")]
+ static extern IntPtr gnome_vfs_mime_get_description (IntPtr mime_type);
+
+ [DllImport ("gnomevfs-2")]
+ static extern Result gnome_vfs_mime_set_description (IntPtr mime_type, IntPtr description);
+
+ public string Description {
+ get {
+ IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
+ string result = GLib.Marshaller.Utf8PtrToString (gnome_vfs_mime_get_description (mimetype_native));
+ GLib.Marshaller.Free (mimetype_native);
+ return result;
+ }
+ set {
+ IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
+ IntPtr desc_native = GLib.Marshaller.StringToPtrGStrdup (value);
+ Result result = gnome_vfs_mime_set_description (mimetype_native, desc_native);
+ GLib.Marshaller.Free (mimetype_native);
+ GLib.Marshaller.Free (desc_native);
+ Vfs.ThrowException (result);
+ }
+ }
+
+ [DllImport ("gnomevfs-2")]
+ static extern IntPtr gnome_vfs_mime_get_icon (IntPtr mime_type);
+
+ [DllImport ("gnomevfs-2")]
+ static extern Result gnome_vfs_mime_set_icon (IntPtr mime_type, IntPtr filename);
+
+ public string Icon {
+ get {
+ IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
+ string result = GLib.Marshaller.Utf8PtrToString (gnome_vfs_mime_get_icon (mimetype_native));
+ GLib.Marshaller.Free (mimetype_native);
+ return result;
+ }
+ set {
+ IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
+ IntPtr icon_native = GLib.Marshaller.StringToPtrGStrdup (value);
+ Result result = gnome_vfs_mime_set_icon (mimetype_native, icon_native);
+ GLib.Marshaller.Free (mimetype_native);
+ GLib.Marshaller.Free (icon_native);
+ Vfs.ThrowException (result);
+ }
+ }
+
+ [DllImport ("gnomevfs-2")]
+ static extern bool gnome_vfs_mime_can_be_executable (IntPtr mime_type);
+
+ [DllImport ("gnomevfs-2")]
+ static extern Result gnome_vfs_mime_set_can_be_executable (IntPtr mime_type, bool value);
+
+ public bool CanBeExecutable {
+ get {
+ IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
+ bool result = gnome_vfs_mime_can_be_executable (mimetype_native);
+ GLib.Marshaller.Free (mimetype_native);
+ return result;
+ }
+ set {
+ IntPtr mimetype_native = GLib.Marshaller.StringToPtrGStrdup (mimetype);
+ Result result = gnome_vfs_mime_set_can_be_executable (mimetype_native, value);
+ GLib.Marshaller.Free (mimetype_native);
+ Vfs.ThrowException (result);
+ }
+ }
+
+ public string Name {
+ get {
+ return mimetype;
+ }
+ }
+
+ public override string ToString ()
+ {
+ return mimetype;
+ }
+
+ public static string GetMimeTypeForUri (string uri)
+ {
+ IntPtr uri_native = GLib.Marshaller.StringToPtrGStrdup (uri.ToString ());
+ string mimetype = GLib.Marshaller.PtrToStringGFree (gnome_vfs_get_mime_type (uri_native));
+ GLib.Marshaller.Free (uri_native);
+ return mimetype;
+ }
+ }
+}
View
39 gnomevfs/ModuleCallback.cs
@@ -0,0 +1,39 @@
+// ModuleCallback.cs - GnomeVfsModuleCallback* bindings.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+namespace Gnome.Vfs {
+ public delegate void ModuleCallbackHandler (ModuleCallback cb);
+
+ abstract public class ModuleCallback {
+ abstract public event ModuleCallbackHandler Callback;
+
+ abstract public void Push ();
+
+ abstract public void Pop ();
+
+ abstract public void SetDefault ();
+
+ abstract public void PushAsync ();
+
+ abstract public void PopAsync ();
+
+ abstract public void SetDefaultAsync ();
+ }
+}
View
184 gnomevfs/ModuleCallbackAuthentication.cs
@@ -0,0 +1,184 @@
+// ModuleCallbackAuthentication.cs - GnomeVfsModuleCallback* bindings.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Gnome.Vfs {
+ public class ModuleCallbackAuthentication : ModuleCallback {
+ public enum AuthenticationType {
+ Basic,
+ Digest
+ };
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct ModuleCallbackAuthenticationIn {
+ public string Uri;
+ public string Realm;
+ public bool PreviousAttemptFailed;
+ public AuthenticationType AuthType;
+ private IntPtr _reserved1;
+ private IntPtr _reserved2;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct ModuleCallbackAuthenticationOut {
+ public string Username;
+ public string Password;
+ private IntPtr _reserved1;
+ private IntPtr _reserved2;
+ }
+
+ private delegate void ModuleCallbackAuthenticationNative (ref ModuleCallbackAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackAuthenticationOut authOut, int outSize,
+ IntPtr data);
+
+ private delegate void ModuleCallbackAsyncAuthenticationNative (ref ModuleCallbackAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackAuthenticationOut authOut, int outSize,
+ IntPtr data, IntPtr resp, IntPtr resp_data);
+
+ private string uri;
+ private string realm;
+ private bool previousAttemptFailed;
+ private AuthenticationType authType;
+ private string username;
+ private string password;
+
+ public string Uri {
+ get {
+ return uri;
+ }
+ }
+
+ public string Realm {
+ get {
+ return realm;
+ }
+ }
+
+ public bool PreviousAttemptFailed {
+ get {
+ return previousAttemptFailed;
+ }
+ }
+
+ public AuthenticationType AuthType {
+ get {
+ return authType;
+ }
+ }
+
+ public string Username {
+ set {
+ username = value;
+ }
+ }
+
+ public string Password {
+ set {
+ password = value;
+ }
+ }
+
+ public override event ModuleCallbackHandler Callback;
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_push (string callback_name, ModuleCallbackAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void Push ()
+ {
+ gnome_vfs_module_callback_push ("simple-authentication",
+ new ModuleCallbackAuthenticationNative (OnNativeCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_pop (string callback_name);
+
+ public override void Pop ()
+ {
+ gnome_vfs_module_callback_pop ("simple-authentication");
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_set_default (string callback_name, ModuleCallbackAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void SetDefault ()
+ {
+ gnome_vfs_module_callback_set_default ("simple-authentication",
+ new ModuleCallbackAuthenticationNative (OnNativeCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_push (string callback_name, ModuleCallbackAsyncAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void PushAsync ()
+ {
+ gnome_vfs_async_module_callback_push ("simple-authentication",
+ new ModuleCallbackAsyncAuthenticationNative (OnNativeAsyncCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_pop (string callback_name);
+
+ public override void PopAsync ()
+ {
+ gnome_vfs_async_module_callback_pop ("simple-authentication");
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_set_default (string callback_name, ModuleCallbackAsyncAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void SetDefaultAsync ()
+ {
+ gnome_vfs_async_module_callback_set_default ("simple-authentication",
+ new ModuleCallbackAsyncAuthenticationNative (OnNativeAsyncCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ private void OnNativeAsyncCallback (ref ModuleCallbackAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackAuthenticationOut authOut, int outSize,
+ IntPtr data, IntPtr resp, IntPtr resp_data)
+ {
+ OnNativeCallback (ref authIn, inSize, ref authOut, outSize, data);
+ }
+
+ private void OnNativeCallback (ref ModuleCallbackAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackAuthenticationOut authOut, int outSize, IntPtr data)
+ {
+ // Copy the authIn fields.
+ uri = authIn.Uri;
+ realm = authIn.Realm;
+ previousAttemptFailed = authIn.PreviousAttemptFailed;
+ authType = authIn.AuthType;
+
+ // Activate the callback.
+ ModuleCallbackHandler handler = Callback;
+ if (handler != null) {
+ handler (this);
+ // Copy the values back to the authOut.
+ authOut.Username = username;
+ authOut.Password = password;
+ }
+ }
+ }
+}
View
227 gnomevfs/ModuleCallbackFillAuthentication.cs
@@ -0,0 +1,227 @@
+// ModuleCallbackFillAuthentication.cs - GnomeVfsModuleCallback* bindings.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Gnome.Vfs {
+ public class ModuleCallbackFillAuthentication : ModuleCallback {
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct ModuleCallbackFillAuthenticationIn {
+ public string Uri;
+ public string Protocol;
+ public string Server;
+ public string Object;
+ public int Port;
+ public string Authtype;
+ public string Username;
+ public string Domain;
+ private IntPtr _reserved1;
+ private IntPtr _reserved2;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct ModuleCallbackFillAuthenticationOut {
+ public bool Valid;
+ public string Username;
+ public string Domain;
+ public string Password;
+ private IntPtr _reserved1;
+ private IntPtr _reserved2;
+ }
+
+ private delegate void ModuleCallbackFillAuthenticationNative (ref ModuleCallbackFillAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackFillAuthenticationOut authOut, int outSize,
+ IntPtr data);
+
+ private delegate void ModuleCallbackAsyncFillAuthenticationNative (ref ModuleCallbackFillAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackFillAuthenticationOut authOut, int outSize,
+ IntPtr data, IntPtr resp, IntPtr resp_data);
+
+ // ModuleCallbackFillAuthenticationIn fields.
+ private string uri;
+ private string protocol;
+ private string server;
+ private string obj;
+ private int port;
+ private string authtype;
+ private string username;
+ private string domain;
+ // ModuleCallbackFillAuthenticationOut fields.
+ private bool valid;
+ private string password;
+
+ public string Uri {
+ get {
+ return uri;
+ }
+ }
+
+ public string Protocol {
+ get {
+ return protocol;
+ }
+ }
+
+ public string Server {
+ get {
+ return server;
+ }
+ }
+
+ public string Object {
+ get {
+ return obj;
+ }
+ }
+
+ public int Port {
+ get {
+ return port;
+ }
+ }
+
+ public string AuthType {
+ get {
+ return authtype;
+ }
+ }
+
+ public string Username {
+ get {
+ return username;
+ }
+ set {
+ username = value;
+ }
+ }
+
+ public string Domain {
+ get {
+ return domain;
+ }
+ set {
+ domain = value;
+ }
+ }
+
+ public bool Valid {
+ set {
+ valid = value;
+ }
+ }
+
+ public string Password {
+ set {
+ password = value;
+ }
+ }
+
+ public override event ModuleCallbackHandler Callback;
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_push (string callback_name, ModuleCallbackFillAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void Push ()
+ {
+ gnome_vfs_module_callback_push ("fill-authentication",
+ new ModuleCallbackFillAuthenticationNative (OnNativeCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_pop (string callback_name);
+
+ public override void Pop ()
+ {
+ gnome_vfs_module_callback_pop ("fill-authentication");
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_set_default (string callback_name, ModuleCallbackFillAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void SetDefault ()
+ {
+ gnome_vfs_module_callback_set_default ("fill-authentication",
+ new ModuleCallbackFillAuthenticationNative (OnNativeCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_push (string callback_name, ModuleCallbackAsyncFillAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void PushAsync ()
+ {
+ gnome_vfs_async_module_callback_push ("fill-authentication",
+ new ModuleCallbackAsyncFillAuthenticationNative (OnNativeAsyncCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_pop (string callback_name);
+
+ public override void PopAsync ()
+ {
+ gnome_vfs_async_module_callback_pop ("fill-authentication");
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_set_default (string callback_name, ModuleCallbackAsyncFillAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void SetDefaultAsync ()
+ {
+ gnome_vfs_async_module_callback_set_default ("fill-authentication",
+ new ModuleCallbackAsyncFillAuthenticationNative (OnNativeAsyncCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ private void OnNativeAsyncCallback (ref ModuleCallbackFillAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackFillAuthenticationOut authOut, int outSize,
+ IntPtr data, IntPtr resp, IntPtr resp_data)
+ {
+ OnNativeCallback (ref authIn, inSize, ref authOut, outSize, data);
+ }
+
+ private void OnNativeCallback (ref ModuleCallbackFillAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackFillAuthenticationOut authOut, int outSize, IntPtr data)
+ {
+ // Copy the authIn fields.
+ uri = authIn.Uri;
+ protocol = authIn.Protocol;
+ server = authIn.Server;
+ obj = authIn.Object;
+ port = authIn.Port;
+ authtype = authIn.Authtype;
+ username = authIn.Username;
+ domain = authIn.Domain;
+
+ // Activate the callback.
+ ModuleCallbackHandler handler = Callback;
+ if (handler != null) {
+ handler (this);
+ // Copy the values back to the authOut.
+ authOut.Valid = valid;
+ authOut.Username = username;
+ authOut.Domain = domain;
+ authOut.Password = password;
+ }
+ }
+ }
+}
View
287 gnomevfs/ModuleCallbackFullAuthentication.cs
@@ -0,0 +1,287 @@
+// ModuleCallbackFullAuthentication.cs - GnomeVfsModuleCallback* bindings.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Gnome.Vfs {
+ public class ModuleCallbackFullAuthentication : ModuleCallback {
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct ModuleCallbackFullAuthenticationIn {
+ public ModuleCallbackFullAuthenticationFlags Flags;
+ public string Uri;
+ public string Protocol;
+ public string Server;
+ public string Object;
+ public int Port;
+ public string Authtype;
+ public string Username;
+ public string Domain;
+ public string DefaultUser;
+ public string DefaultDomain;
+ private IntPtr _reserved1;
+ private IntPtr _reserved2;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct ModuleCallbackFullAuthenticationOut {
+ public bool AbortAuth;
+ public string Username;
+ public string Domain;
+ public string Password;
+ public bool SavePassword;
+ public string Keyring;
+ private IntPtr _reserved1;
+ private IntPtr _reserved2;
+ }
+
+ private delegate void ModuleCallbackFullAuthenticationNative (ref ModuleCallbackFullAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackFullAuthenticationOut authOut, int outSize,
+ IntPtr data);
+
+ private delegate void ModuleCallbackAsyncFullAuthenticationNative (ref ModuleCallbackFullAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackFullAuthenticationOut authOut, int outSize,
+ IntPtr data, IntPtr resp, IntPtr resp_data);
+
+ // ModuleCallbackFullAuthenticationIn fields.
+ private ModuleCallbackFullAuthenticationFlags flags;
+ private string uri;
+ private string protocol;
+ private string server;
+ private string obj;
+ private int port;
+ private string authtype;
+ private string username;
+ private string domain;
+ private string defaultUser;
+ private string defaultDomain;
+ // ModuleCallbackFullAuthenticationOut fields.
+ private bool abortAuth;
+ private string password;
+ private bool savePassword;
+ private string keyring;
+
+ public ModuleCallbackFullAuthenticationFlags Flags {
+ get {
+ return flags;
+ }
+ }
+
+ public string Uri {
+ get {
+ return uri;
+ }
+ }
+
+ public string Protocol {
+ get {
+ return protocol;
+ }
+ }
+
+ public string Server {
+ get {
+ return server;
+ }
+ }
+
+ public string Object {
+ get {
+ return obj;
+ }
+ }
+
+ public int Port {
+ get {
+ return port;
+ }
+ }
+
+ public string AuthType {
+ get {
+ return authtype;
+ }
+ }
+
+ public string Username {
+ get {
+ return username;
+ }
+ set {
+ username = value;
+ }
+ }
+
+ public string Domain {
+ get {
+ return domain;
+ }
+ set {
+ domain = value;
+ }
+ }
+
+ public string DefaultUser {
+ get {
+ return defaultUser;
+ }
+ }
+
+ public string DefaultDomain {
+ get {
+ return defaultDomain;
+ }
+ }
+
+ public bool AbortAuth {
+ set {
+ abortAuth = value;
+ }
+ }
+
+ public string Password {
+ set {
+ password = value;
+ }
+ }
+
+ public bool SavePassword {
+ set {
+ savePassword = value;
+ }
+ }
+
+ public string Keyring {
+ set {
+ keyring = value;
+ }
+ }
+
+ public override event ModuleCallbackHandler Callback;
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_push (string callback_name, ModuleCallbackFullAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void Push ()
+ {
+ gnome_vfs_module_callback_push ("full-authentication",
+ new ModuleCallbackFullAuthenticationNative (OnNativeCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_pop (string callback_name);
+
+ public override void Pop ()
+ {
+ gnome_vfs_module_callback_pop ("full-authentication");
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_set_default (string callback_name, ModuleCallbackFullAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void SetDefault ()
+ {
+ gnome_vfs_module_callback_set_default ("full-authentication",
+ new ModuleCallbackFullAuthenticationNative (OnNativeCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_push (string callback_name, ModuleCallbackAsyncFullAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void PushAsync ()
+ {
+ gnome_vfs_async_module_callback_push ("full-authentication",
+ new ModuleCallbackAsyncFullAuthenticationNative (OnNativeAsyncCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_pop (string callback_name);
+
+ public override void PopAsync ()
+ {
+ gnome_vfs_async_module_callback_pop ("full-authentication");
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_set_default (string callback_name, ModuleCallbackAsyncFullAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void SetDefaultAsync ()
+ {
+ gnome_vfs_async_module_callback_set_default ("full-authentication",
+ new ModuleCallbackAsyncFullAuthenticationNative (OnNativeAsyncCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ private void OnNativeAsyncCallback (ref ModuleCallbackFullAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackFullAuthenticationOut authOut, int outSize,
+ IntPtr data, IntPtr resp, IntPtr resp_data)
+ {
+ OnNativeCallback (ref authIn, inSize, ref authOut, outSize, data);
+ }
+
+ private void OnNativeCallback (ref ModuleCallbackFullAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackFullAuthenticationOut authOut, int outSize, IntPtr data)
+ {
+ // Copy the authIn fields.
+ flags = authIn.Flags;
+ uri = authIn.Uri;
+ protocol = authIn.Protocol;
+ server = authIn.Server;
+ obj = authIn.Object;
+ port = authIn.Port;
+ authtype = authIn.Authtype;
+ username = authIn.Username;
+ domain = authIn.Domain;
+ defaultUser = authIn.DefaultUser;
+ defaultDomain = authIn.DefaultDomain;
+
+ // Activate the callback.
+ ModuleCallbackHandler handler = Callback;
+ if (handler != null) {
+ handler (this);
+ // Copy the values back to the authOut.
+ authOut.AbortAuth = abortAuth;
+ authOut.Username = username;
+ authOut.Domain = domain;
+ authOut.Password = password;
+ authOut.SavePassword = savePassword;
+ authOut.Keyring = keyring;
+ }
+ }
+
+ private void DumpAuthIn (ref ModuleCallbackFullAuthenticationIn authIn)
+ {
+ Console.WriteLine ("Flags: {0}", authIn.Flags);
+ Console.WriteLine ("Uri: {0}", authIn.Uri);
+ Console.WriteLine ("Protocol: {0}", authIn.Protocol);
+ Console.WriteLine ("Server: {0}", authIn.Server);
+ Console.WriteLine ("Object: {0}", authIn.Object);
+ Console.WriteLine ("Port: {0}", authIn.Port);
+ Console.WriteLine ("Authtype: {0}", authIn.Authtype);
+ Console.WriteLine ("Username: {0}", authIn.Username);
+ Console.WriteLine ("Domain: {0}", authIn.Domain);
+ Console.WriteLine ("DefaultUser: {0}", authIn.DefaultUser);
+ Console.WriteLine ("DefaultDomain: {0}", authIn.DefaultDomain);
+ }
+ }
+}
View
221 gnomevfs/ModuleCallbackSaveAuthentication.cs
@@ -0,0 +1,221 @@
+// ModuleCallbackSaveAuthentication.cs - GnomeVfsModuleCallback* bindings.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Gnome.Vfs {
+ public class ModuleCallbackSaveAuthentication : ModuleCallback {
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct ModuleCallbackSaveAuthenticationIn {
+ public string Keyring;
+ public string Uri;
+ public string Protocol;
+ public string Server;
+ public string Object;
+ public int Port;
+ public string Authtype;
+ public string Username;
+ public string Domain;
+ public string Password;
+ private IntPtr _reserved1;
+ private IntPtr _reserved2;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct ModuleCallbackSaveAuthenticationOut {
+ private IntPtr _reserved1;
+ private IntPtr _reserved2;
+ }
+
+ private delegate void ModuleCallbackSaveAuthenticationNative (ref ModuleCallbackSaveAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackSaveAuthenticationOut authOut, int outSize,
+ IntPtr data);
+
+ private delegate void ModuleCallbackAsyncSaveAuthenticationNative (ref ModuleCallbackSaveAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackSaveAuthenticationOut authOut, int outSize,
+ IntPtr data, IntPtr resp, IntPtr resp_data);
+
+ // ModuleCallbackSaveAuthenticationIn fields.
+ private string keyring;
+ private string uri;
+ private string protocol;
+ private string server;
+ private string obj;
+ private int port;
+ private string authtype;
+ private string username;
+ private string domain;
+ private string password;
+
+ public string Keyring {
+ get {
+ return keyring;
+ }
+ }
+
+ public string Uri {
+ get {
+ return uri;
+ }
+ }
+
+ public string Protocol {
+ get {
+ return protocol;
+ }
+ }
+
+ public string Server {
+ get {
+ return server;
+ }
+ }
+
+ public string Object {
+ get {
+ return obj;
+ }
+ }
+
+ public int Port {
+ get {
+ return port;
+ }
+ }
+
+ public string AuthType {
+ get {
+ return authtype;
+ }
+ }
+
+ public string Username {
+ get {
+ return username;
+ }
+ set {
+ username = value;
+ }
+ }
+
+ public string Domain {
+ get {
+ return domain;
+ }
+ set {
+ domain = value;
+ }
+ }
+
+ public string Password {
+ get {
+ return password;
+ }
+ }
+
+ public override event ModuleCallbackHandler Callback;
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_push (string callback_name, ModuleCallbackSaveAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void Push ()
+ {
+ gnome_vfs_module_callback_push ("save-authentication",
+ new ModuleCallbackSaveAuthenticationNative (OnNativeCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_pop (string callback_name);
+
+ public override void Pop ()
+ {
+ gnome_vfs_module_callback_pop ("save-authentication");
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_set_default (string callback_name, ModuleCallbackSaveAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void SetDefault ()
+ {
+ gnome_vfs_module_callback_set_default ("save-authentication",
+ new ModuleCallbackSaveAuthenticationNative (OnNativeCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_push (string callback_name, ModuleCallbackAsyncSaveAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void PushAsync ()
+ {
+ gnome_vfs_async_module_callback_push ("save-authentication",
+ new ModuleCallbackAsyncSaveAuthenticationNative (OnNativeAsyncCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_pop (string callback_name);
+
+ public override void PopAsync ()
+ {
+ gnome_vfs_async_module_callback_pop ("save-authentication");
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_set_default (string callback_name, ModuleCallbackAsyncSaveAuthenticationNative callback, IntPtr data, IntPtr destroy);
+
+ public override void SetDefaultAsync ()
+ {
+ gnome_vfs_async_module_callback_set_default ("save-authentication",
+ new ModuleCallbackAsyncSaveAuthenticationNative (OnNativeAsyncCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ private void OnNativeAsyncCallback (ref ModuleCallbackSaveAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackSaveAuthenticationOut authOut, int outSize,
+ IntPtr data, IntPtr resp, IntPtr resp_data)
+ {
+ OnNativeCallback (ref authIn, inSize, ref authOut, outSize, data);
+ }
+
+ private void OnNativeCallback (ref ModuleCallbackSaveAuthenticationIn authIn, int inSize,
+ ref ModuleCallbackSaveAuthenticationOut authOut, int outSize, IntPtr data)
+ {
+ // Copy the authIn fields.
+ keyring = authIn.Keyring;
+ uri = authIn.Uri;
+ protocol = authIn.Protocol;
+ server = authIn.Server;
+ obj = authIn.Object;
+ port = authIn.Port;
+ authtype = authIn.Authtype;
+ username = authIn.Username;
+ domain = authIn.Domain;
+ password = authIn.Password;
+
+ // Activate the callback.
+ ModuleCallbackHandler handler = Callback;
+ if (handler != null) {
+ handler (this);
+ }
+ }
+ }
+}
View
153 gnomevfs/ModuleCallbackStatusMessage.cs
@@ -0,0 +1,153 @@
+// ModuleCallbackStatusMessage.cs - GnomeVfsModuleCallback* bindings.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Gnome.Vfs {
+ public class ModuleCallbackStatusMessage : ModuleCallback {
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct ModuleCallbackStatusMessageIn {
+ public string Uri;
+ public string Message;
+ public int Percentage;
+ private IntPtr _reserved1;
+ private IntPtr _reserved2;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal struct ModuleCallbackStatusMessageOut {
+ private int Dummy;
+ private IntPtr _reserved1;
+ private IntPtr _reserved2;
+ }
+
+ private delegate void ModuleCallbackStatusMessageNative (ref ModuleCallbackStatusMessageIn authIn, int inSize,
+ ref ModuleCallbackStatusMessageOut authOut, int outSize,
+ IntPtr data);
+
+ private delegate void ModuleCallbackAsyncStatusMessageNative (ref ModuleCallbackStatusMessageIn authIn, int inSize,
+ ref ModuleCallbackStatusMessageOut authOut, int outSize,
+ IntPtr data, IntPtr resp, IntPtr resp_data);
+
+ // ModuleCallbackStatusMessageIn fields.
+ private string uri;
+ private string message;
+ private int percentage;
+
+ public string Uri {
+ get {
+ return uri;
+ }
+ }
+
+ public string Message {
+ get {
+ return message;
+ }
+ }
+
+ public int Percentage {
+ get {
+ return percentage;
+ }
+ }
+
+ public override event ModuleCallbackHandler Callback;
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_push (string callback_name, ModuleCallbackStatusMessageNative callback, IntPtr data, IntPtr destroy);
+
+ public override void Push ()
+ {
+ gnome_vfs_module_callback_push ("status-message",
+ new ModuleCallbackStatusMessageNative (OnNativeCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_pop (string callback_name);
+
+ public override void Pop ()
+ {
+ gnome_vfs_module_callback_pop ("status-message");
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_module_callback_set_default (string callback_name, ModuleCallbackStatusMessageNative callback, IntPtr data, IntPtr destroy);
+
+ public override void SetDefault ()
+ {
+ gnome_vfs_module_callback_set_default ("status-message",
+ new ModuleCallbackStatusMessageNative (OnNativeCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_push (string callback_name, ModuleCallbackAsyncStatusMessageNative callback, IntPtr data, IntPtr destroy);
+
+ public override void PushAsync ()
+ {
+ gnome_vfs_async_module_callback_push ("status-message",
+ new ModuleCallbackAsyncStatusMessageNative (OnNativeAsyncCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_pop (string callback_name);
+
+ public override void PopAsync ()
+ {
+ gnome_vfs_async_module_callback_pop ("status-message");
+ }
+
+ [DllImport ("gnomevfs-2")]
+ private static extern void gnome_vfs_async_module_callback_set_default (string callback_name, ModuleCallbackAsyncStatusMessageNative callback, IntPtr data, IntPtr destroy);
+
+ public override void SetDefaultAsync ()
+ {
+ gnome_vfs_async_module_callback_set_default ("status-message",
+ new ModuleCallbackAsyncStatusMessageNative (OnNativeAsyncCallback),
+ IntPtr.Zero, IntPtr.Zero);
+ }
+
+ private void OnNativeAsyncCallback (ref ModuleCallbackStatusMessageIn authIn, int inSize,
+ ref ModuleCallbackStatusMessageOut authOut, int outSize,
+ IntPtr data, IntPtr resp, IntPtr resp_data)
+ {
+ OnNativeCallback (ref authIn, inSize, ref authOut, outSize, data);
+ }
+
+ private void OnNativeCallback (ref ModuleCallbackStatusMessageIn authIn, int inSize,
+ ref ModuleCallbackStatusMessageOut authOut, int outSize, IntPtr data)
+ {
+ // Copy the authIn fields.
+ uri = authIn.Uri;
+ message = authIn.Message;
+ percentage = authIn.Percentage;
+
+ // Activate the callback.
+ ModuleCallbackHandler handler = Callback;
+ if (handler != null) {
+ handler (this);
+ }
+ }
+ }
+}
View
124 gnomevfs/Monitor.cs
@@ -0,0 +1,124 @@
+// Monitor.cs - gnome_vfs_monitor_* bindings.
+//
+// Authors: Jeroen Zwartepoorte <jeroen@xs4all.nl>
+//
+// Copyright (c) 2004 Jeroen Zwartepoorte
+//
+// 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.
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace Gnome.Vfs {
+ public delegate void MonitorHandler (string monitor, string uri);
+
+ internal delegate void MonitorCallback (string monitorUri, string uri, MonitorEventType eventType);