From 321181b7618b91e99ce10f745e8045cfc81b15ee Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Mon, 1 Apr 2013 23:53:50 +0100 Subject: [PATCH] gio: Track API changes (I- interface prefixes) This includes changes to fix the build, and changes to custom code that gets added to the generated code. I.e. File.cs now becomes IFile.cs --- gio/AppInfoAdapter.cs | 6 +++--- gio/FileFactory.cs | 16 ++++++++-------- gio/GioStream.cs | 12 ++++++------ gio/{File.cs => IFile.cs} | 2 +- gio/Makefile.am | 4 ++-- gio/gio.csproj | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) rename gio/{File.cs => IFile.cs} (94%) diff --git a/gio/AppInfoAdapter.cs b/gio/AppInfoAdapter.cs index 0a1414ebb..13d57b6b8 100644 --- a/gio/AppInfoAdapter.cs +++ b/gio/AppInfoAdapter.cs @@ -26,10 +26,10 @@ namespace GLib { [DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr g_app_info_get_all(); - public static GLib.AppInfo[] GetAll() { + public static GLib.IAppInfo[] GetAll () { IntPtr raw_ret = g_app_info_get_all(); - GLib.AppInfo[] ret = (GLib.AppInfo[]) GLib.Marshaller.ListPtrToArray (raw_ret, typeof(GLib.List), true, false, typeof(GLib.AppInfo)); + GLib.IAppInfo[] ret = (GLib.IAppInfo[]) GLib.Marshaller.ListPtrToArray (raw_ret, typeof (GLib.List), true, false, typeof (GLib.IAppInfo)); return ret; } } -} \ No newline at end of file +} diff --git a/gio/FileFactory.cs b/gio/FileFactory.cs index 163fa4265..bc0bb2127 100644 --- a/gio/FileFactory.cs +++ b/gio/FileFactory.cs @@ -30,30 +30,30 @@ namespace GLib [DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr g_file_new_for_uri (string uri); - public static File NewForUri (string uri) + public static IFile NewForUri (string uri) { - return GLib.FileAdapter.GetObject (g_file_new_for_uri (uri), false) as File; + return GLib.FileAdapter.GetObject (g_file_new_for_uri (uri), false) as IFile; } - public static File NewForUri (Uri uri) + public static IFile NewForUri (Uri uri) { - return GLib.FileAdapter.GetObject (g_file_new_for_uri (uri.ToString ()), false) as File; + return GLib.FileAdapter.GetObject (g_file_new_for_uri (uri.ToString ()), false) as IFile; } [DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr g_file_new_for_path (string path); - public static File NewForPath (string path) + public static IFile NewForPath (string path) { - return GLib.FileAdapter.GetObject (g_file_new_for_path (path), false) as File; + return GLib.FileAdapter.GetObject (g_file_new_for_path (path), false) as IFile; } [DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr g_file_new_for_commandline_arg (string arg); - public static File NewFromCommandlineArg (string arg) + public static IFile NewFromCommandlineArg (string arg) { - return GLib.FileAdapter.GetObject (g_file_new_for_commandline_arg (arg), false) as File; + return GLib.FileAdapter.GetObject (g_file_new_for_commandline_arg (arg), false) as IFile; } } } diff --git a/gio/GioStream.cs b/gio/GioStream.cs index 631549244..b27ee946f 100644 --- a/gio/GioStream.cs +++ b/gio/GioStream.cs @@ -53,14 +53,14 @@ namespace GLib { this.stream = stream; can_read = true; - can_seek = stream is Seekable && (stream as Seekable).CanSeek; + can_seek = stream is ISeekable && (stream as ISeekable).CanSeek; } public GioStream (OutputStream stream) { this.stream = stream; can_write = true; - can_seek = stream is Seekable && (stream as Seekable).CanSeek; + can_seek = stream is ISeekable && (stream as ISeekable).CanSeek; } public GioStream (IOStream stream) @@ -68,7 +68,7 @@ namespace GLib this.stream = stream; can_read = true; can_write = true; - can_seek = stream is Seekable && (stream as Seekable).CanSeek; + can_seek = stream is ISeekable && (stream as ISeekable).CanSeek; } public override bool CanSeek { @@ -112,7 +112,7 @@ namespace GLib throw new NotSupportedException ("This stream doesn't support seeking"); if (is_disposed) throw new ObjectDisposedException ("The stream is closed"); - return (stream as Seekable).Position; + return (stream as ISeekable).Position; } set { Seek (value, System.IO.SeekOrigin.Begin); @@ -195,7 +195,7 @@ namespace GLib throw new NotSupportedException ("This stream doesn't support seeking"); if (is_disposed) throw new ObjectDisposedException ("The stream is closed"); - Seekable seekable = stream as Seekable; + var seekable = stream as ISeekable; SeekType seek_type; switch (origin) { @@ -219,7 +219,7 @@ namespace GLib if (!CanSeek || !CanWrite) throw new NotSupportedException ("This stream doesn't support seeking"); - var seekable = stream as Seekable; + var seekable = stream as ISeekable; if (!seekable.CanTruncate ()) throw new NotSupportedException ("This stream doesn't support truncating"); diff --git a/gio/File.cs b/gio/IFile.cs similarity index 94% rename from gio/File.cs rename to gio/IFile.cs index 87aaa0cb4..344c9e4ad 100644 --- a/gio/File.cs +++ b/gio/IFile.cs @@ -19,7 +19,7 @@ // Boston, MA 02111-1307, USA. namespace GLib { - public partial interface File : GLib.IWrapper { + public partial interface IFile : GLib.IWrapper { bool Exists { get; diff --git a/gio/Makefile.am b/gio/Makefile.am index b7afdeaa3..86e5be4a9 100644 --- a/gio/Makefile.am +++ b/gio/Makefile.am @@ -13,11 +13,11 @@ POLICY_VERSIONS= sources = \ AppInfoAdapter.cs \ - File.cs \ FileAdapter.cs \ FileEnumerator.cs \ FileFactory.cs \ - GioStream.cs + GioStream.cs \ + IFile.cs add_dist = gio-sharp-3.0.pc.in diff --git a/gio/gio.csproj b/gio/gio.csproj index abef3cfaf..2e5606833 100644 --- a/gio/gio.csproj +++ b/gio/gio.csproj @@ -36,7 +36,7 @@ - +