gio: Move all .custom files to partial classes
This commit is contained in:
parent
b79ac26063
commit
c0129f42d5
6 changed files with 122 additions and 101 deletions
|
@ -1,4 +1,4 @@
|
|||
// AppInfoAdapter.custom - customizations to GLib.AppInfoAdapter
|
||||
// AppInfoAdapter.cs - customizations to GLib.AppInfoAdapter
|
||||
//
|
||||
// Authors: Stephane Delcroix <stephane@delcroix.org>
|
||||
//
|
||||
|
@ -18,6 +18,11 @@
|
|||
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
// Boston, MA 02111-1307, USA.
|
||||
|
||||
namespace GLib {
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public partial class AppInfoAdapter {
|
||||
[DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern IntPtr g_app_info_get_all();
|
||||
|
||||
|
@ -26,3 +31,5 @@
|
|||
GLib.AppInfo[] ret = (GLib.AppInfo[]) GLib.Marshaller.ListPtrToArray (raw_ret, typeof(GLib.List), true, false, typeof(GLib.AppInfo));
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// File.custom - customizations to GLib.File
|
||||
// File.cs - customizations to GLib.File
|
||||
//
|
||||
// Authors: Stephane Delcroix <stephane@delcroix.org>
|
||||
//
|
||||
|
@ -18,14 +18,18 @@
|
|||
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
// Boston, MA 02111-1307, USA.
|
||||
|
||||
bool Exists
|
||||
{
|
||||
get;
|
||||
namespace GLib {
|
||||
public partial interface File : GLib.IWrapper {
|
||||
bool Exists
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
System.Uri Uri
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
bool Delete();
|
||||
}
|
||||
}
|
||||
|
||||
System.Uri Uri
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
bool Delete();
|
|
@ -1,4 +1,4 @@
|
|||
// FileEnumerator.custom - customizations to GLib.FileEnumerator
|
||||
// FileAdapter.cs - customizations to GLib.FileAdapter
|
||||
//
|
||||
// Authors: Stephane Delcroix <stephane@delcroix.org>
|
||||
//
|
||||
|
@ -18,42 +18,34 @@
|
|||
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
// Boston, MA 02111-1307, USA.
|
||||
|
||||
public IEnumerator GetEnumerator ()
|
||||
{
|
||||
return new Enumerator (this);
|
||||
}
|
||||
|
||||
public FileInfo NextFile ()
|
||||
{
|
||||
return NextFile ((Cancellable) null);
|
||||
}
|
||||
|
||||
class Enumerator : IEnumerator
|
||||
{
|
||||
FileEnumerator file_enumerator;
|
||||
|
||||
public Enumerator (FileEnumerator file_enumerator)
|
||||
{
|
||||
this.file_enumerator = file_enumerator;
|
||||
}
|
||||
|
||||
FileInfo current=null;
|
||||
public object Current {
|
||||
get {
|
||||
return current;
|
||||
namespace GLib {
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public partial class FileAdapter {
|
||||
public override string ToString ()
|
||||
{
|
||||
return Uri.ToString ();
|
||||
}
|
||||
|
||||
public bool Exists {
|
||||
get { return QueryExists (null); }
|
||||
}
|
||||
|
||||
public bool Delete ()
|
||||
{
|
||||
return Delete (null);
|
||||
}
|
||||
|
||||
[DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern IntPtr g_file_get_uri(IntPtr raw);
|
||||
|
||||
public System.Uri Uri {
|
||||
get {
|
||||
IntPtr raw_ret = g_file_get_uri(Handle);
|
||||
string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
|
||||
return new System.Uri (ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool MoveNext ()
|
||||
{
|
||||
current = file_enumerator.NextFile ();
|
||||
if (current == null)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Reset ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
// FileAdapter.custom - customizations to GLib.FileAdapter
|
||||
//
|
||||
// Authors: Stephane Delcroix <stephane@delcroix.org>
|
||||
//
|
||||
// Copyright (c) 2008 Novell, Inc.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of version 2 of the Lesser GNU General
|
||||
// Public License as published by the Free Software Foundation.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this program; if not, write to the
|
||||
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
// Boston, MA 02111-1307, USA.
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return Uri.ToString ();
|
||||
}
|
||||
|
||||
public bool Exists {
|
||||
get { return QueryExists (null); }
|
||||
}
|
||||
|
||||
public bool Delete ()
|
||||
{
|
||||
return Delete (null);
|
||||
}
|
||||
|
||||
[DllImport ("libgio-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern IntPtr g_file_get_uri(IntPtr raw);
|
||||
|
||||
public System.Uri Uri {
|
||||
get {
|
||||
IntPtr raw_ret = g_file_get_uri(Handle);
|
||||
string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
|
||||
return new System.Uri (ret);
|
||||
}
|
||||
}
|
||||
|
||||
|
66
gio/FileEnumerator.cs
Normal file
66
gio/FileEnumerator.cs
Normal file
|
@ -0,0 +1,66 @@
|
|||
// FileEnumerator.cs - customizations to GLib.FileEnumerator
|
||||
//
|
||||
// Authors: Stephane Delcroix <stephane@delcroix.org>
|
||||
//
|
||||
// Copyright (c) 2008 Novell, Inc.
|
||||
//
|
||||
// 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 GLib {
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
public partial class FileEnumerator {
|
||||
public IEnumerator GetEnumerator ()
|
||||
{
|
||||
return new Enumerator (this);
|
||||
}
|
||||
|
||||
public FileInfo NextFile ()
|
||||
{
|
||||
return NextFile ((Cancellable) null);
|
||||
}
|
||||
|
||||
class Enumerator : IEnumerator
|
||||
{
|
||||
FileEnumerator file_enumerator;
|
||||
|
||||
public Enumerator (FileEnumerator file_enumerator)
|
||||
{
|
||||
this.file_enumerator = file_enumerator;
|
||||
}
|
||||
|
||||
FileInfo current=null;
|
||||
public object Current {
|
||||
get {
|
||||
return current;
|
||||
}
|
||||
}
|
||||
|
||||
public bool MoveNext ()
|
||||
{
|
||||
current = file_enumerator.NextFile ();
|
||||
if (current == null)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Reset ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,15 +12,13 @@ glue_includes = gio/gio.h
|
|||
POLICY_VERSIONS=
|
||||
|
||||
sources = \
|
||||
AppInfoAdapter.cs \
|
||||
File.cs \
|
||||
FileAdapter.cs \
|
||||
FileEnumerator.cs \
|
||||
FileFactory.cs \
|
||||
GioStream.cs
|
||||
|
||||
customs = \
|
||||
AppInfoAdapter.custom \
|
||||
File.custom \
|
||||
FileAdapter.custom \
|
||||
FileEnumerator.custom
|
||||
|
||||
add_dist = gio-sharp-3.0.pc.in
|
||||
|
||||
include ../Makefile.include
|
||||
|
|
Loading…
Add table
Reference in a new issue