mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-10 08:53:17 +02:00
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
This commit is contained in:
parent
6cb03440c1
commit
321181b761
@ -26,9 +26,9 @@ namespace GLib {
|
|||||||
[DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern IntPtr g_app_info_get_all();
|
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();
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,30 +30,30 @@ namespace GLib
|
|||||||
[DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr g_file_new_for_uri (string uri);
|
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)]
|
[DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr g_file_new_for_path (string path);
|
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)]
|
[DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
private static extern IntPtr g_file_new_for_commandline_arg (string arg);
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,14 +53,14 @@ namespace GLib
|
|||||||
{
|
{
|
||||||
this.stream = stream;
|
this.stream = stream;
|
||||||
can_read = true;
|
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)
|
public GioStream (OutputStream stream)
|
||||||
{
|
{
|
||||||
this.stream = stream;
|
this.stream = stream;
|
||||||
can_write = true;
|
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)
|
public GioStream (IOStream stream)
|
||||||
@ -68,7 +68,7 @@ namespace GLib
|
|||||||
this.stream = stream;
|
this.stream = stream;
|
||||||
can_read = true;
|
can_read = true;
|
||||||
can_write = 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 {
|
public override bool CanSeek {
|
||||||
@ -112,7 +112,7 @@ namespace GLib
|
|||||||
throw new NotSupportedException ("This stream doesn't support seeking");
|
throw new NotSupportedException ("This stream doesn't support seeking");
|
||||||
if (is_disposed)
|
if (is_disposed)
|
||||||
throw new ObjectDisposedException ("The stream is closed");
|
throw new ObjectDisposedException ("The stream is closed");
|
||||||
return (stream as Seekable).Position;
|
return (stream as ISeekable).Position;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
Seek (value, System.IO.SeekOrigin.Begin);
|
Seek (value, System.IO.SeekOrigin.Begin);
|
||||||
@ -195,7 +195,7 @@ namespace GLib
|
|||||||
throw new NotSupportedException ("This stream doesn't support seeking");
|
throw new NotSupportedException ("This stream doesn't support seeking");
|
||||||
if (is_disposed)
|
if (is_disposed)
|
||||||
throw new ObjectDisposedException ("The stream is closed");
|
throw new ObjectDisposedException ("The stream is closed");
|
||||||
Seekable seekable = stream as Seekable;
|
var seekable = stream as ISeekable;
|
||||||
|
|
||||||
SeekType seek_type;
|
SeekType seek_type;
|
||||||
switch (origin) {
|
switch (origin) {
|
||||||
@ -219,7 +219,7 @@ namespace GLib
|
|||||||
if (!CanSeek || !CanWrite)
|
if (!CanSeek || !CanWrite)
|
||||||
throw new NotSupportedException ("This stream doesn't support seeking");
|
throw new NotSupportedException ("This stream doesn't support seeking");
|
||||||
|
|
||||||
var seekable = stream as Seekable;
|
var seekable = stream as ISeekable;
|
||||||
|
|
||||||
if (!seekable.CanTruncate ())
|
if (!seekable.CanTruncate ())
|
||||||
throw new NotSupportedException ("This stream doesn't support truncating");
|
throw new NotSupportedException ("This stream doesn't support truncating");
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
// Boston, MA 02111-1307, USA.
|
// Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
namespace GLib {
|
namespace GLib {
|
||||||
public partial interface File : GLib.IWrapper {
|
public partial interface IFile : GLib.IWrapper {
|
||||||
bool Exists
|
bool Exists
|
||||||
{
|
{
|
||||||
get;
|
get;
|
@ -13,11 +13,11 @@ POLICY_VERSIONS=
|
|||||||
|
|
||||||
sources = \
|
sources = \
|
||||||
AppInfoAdapter.cs \
|
AppInfoAdapter.cs \
|
||||||
File.cs \
|
|
||||||
FileAdapter.cs \
|
FileAdapter.cs \
|
||||||
FileEnumerator.cs \
|
FileEnumerator.cs \
|
||||||
FileFactory.cs \
|
FileFactory.cs \
|
||||||
GioStream.cs
|
GioStream.cs \
|
||||||
|
IFile.cs
|
||||||
|
|
||||||
add_dist = gio-sharp-3.0.pc.in
|
add_dist = gio-sharp-3.0.pc.in
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
<Compile Include="AppInfoAdapter.cs" />
|
<Compile Include="AppInfoAdapter.cs" />
|
||||||
<Compile Include="AssemblyInfo.cs" />
|
<Compile Include="AssemblyInfo.cs" />
|
||||||
<Compile Include="DBusInterfaceVTable.cs" />
|
<Compile Include="DBusInterfaceVTable.cs" />
|
||||||
<Compile Include="File.cs" />
|
<Compile Include="IFile.cs" />
|
||||||
<Compile Include="FileAdapter.cs" />
|
<Compile Include="FileAdapter.cs" />
|
||||||
<Compile Include="FileEnumerator.cs" />
|
<Compile Include="FileEnumerator.cs" />
|
||||||
<Compile Include="FileFactory.cs" />
|
<Compile Include="FileFactory.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user