Update Gio to 2.27 and get it building.

* gio/DBusInterfaceVTable.cs: unbuilt stab at a connection api.
* gio/Gio.metadata: some build tweaks and workarounds.
* gio/gio-api.raw: parse for 2.27.90.
This commit is contained in:
Mike Kestner 2011-01-30 17:08:55 -06:00
parent a1f9eef0b8
commit e77ee7f5b1
3 changed files with 7633 additions and 158 deletions

117
gio/DBusInterfaceVTable.cs Normal file
View file

@ -0,0 +1,117 @@
// Copyright (c) 2011 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.
using System;
using System.Collections;
using System.Runtime.InteropServices;
namespace GLib {
public partial class DBusInterfaceVTable {
[StructLayout(LayoutKind.Sequential)]
struct NativeStruct {
public GLibSharp.DBusInterfaceMethodCallFuncNative method_call;
public GLibSharp.DBusInterfaceGetPropertyFuncNative get_property;
public GLibSharp.DBusInterfaceSetPropertyFuncNative set_property;
[MarshalAs (UnmanagedType.ByValArray, SizeConst=8)]
private IntPtr[] Padding;
}
IntPtr handle;
NativeStruct native_cbs;
~DBusInterfaceVTable ()
{
Marshaller.Free (handle);
}
public DBusInterfaceVTable (DBusInterfaceMethodCallFunc method_call, DBusInterfaceGetPropertyFunc get_property, DBusInterfaceSetPropertyFunc set_property)
{
this.method_call = method_call;
this.get_property = get_property;
this.set_property = set_property;
native_cbs.method_call = OnMethodCall;
native_cbs.get_property = OnGetProperty;
native_cbs.set_property = OnSetProperty;
handle = Marshaller.StructureToPtrAlloc (native_cbs);
}
public IntPtr OnGetProperty (IntPtr connection, IntPtr sender, IntPtr object_path, IntPtr interface_name, IntPtr property_name, out IntPtr error, IntPtr user_data)
{
error = IntPtr.Zero;
try {
if (get_property == null)
return IntPtr.Zero;
GLib.Variant __ret = get_property (GLib.Object.GetObject(connection) as GLib.DBusConnection, GLib.Marshaller.Utf8PtrToString (sender), GLib.Marshaller.Utf8PtrToString (object_path), GLib.Marshaller.Utf8PtrToString (interface_name), GLib.Marshaller.Utf8PtrToString (property_name));
return __ret == null ? IntPtr.Zero : __ret.Handle;
} catch (Exception e) {
GLib.ExceptionManager.RaiseUnhandledException (e, true);
// NOTREACHED: Above call does not return.
throw e;
}
}
public void OnMethodCall (IntPtr connection, IntPtr sender, IntPtr object_path, IntPtr interface_name, IntPtr method_name, IntPtr parameters, IntPtr invocation, IntPtr user_data)
{
try {
if (method_call == null)
return;
method_call (GLib.Object.GetObject(connection) as GLib.DBusConnection, GLib.Marshaller.Utf8PtrToString (sender), GLib.Marshaller.Utf8PtrToString (object_path), GLib.Marshaller.Utf8PtrToString (interface_name), GLib.Marshaller.Utf8PtrToString (method_name), new GLib.Variant(parameters), GLib.Object.GetObject(invocation) as GLib.DBusMethodInvocation);
} catch (Exception e) {
GLib.ExceptionManager.RaiseUnhandledException (e, false);
}
}
public bool OnSetProperty (IntPtr connection, IntPtr sender, IntPtr object_path, IntPtr interface_name, IntPtr property_name, IntPtr value, out IntPtr error, IntPtr user_data)
{
error = IntPtr.Zero;
try {
if (set_property == null)
return false;
return set_property (GLib.Object.GetObject(connection) as GLib.DBusConnection, GLib.Marshaller.Utf8PtrToString (sender), GLib.Marshaller.Utf8PtrToString (object_path), GLib.Marshaller.Utf8PtrToString (interface_name), GLib.Marshaller.Utf8PtrToString (property_name), new GLib.Variant(value));
} catch (Exception e) {
GLib.ExceptionManager.RaiseUnhandledException (e, false);
return false;
}
}
DBusInterfaceMethodCallFunc method_call;
public GLib.DBusInterfaceMethodCallFunc MethodCall {
get { return method_call; }
set { method_call = value; }
}
GLib.DBusInterfaceGetPropertyFunc get_property;
public GLib.DBusInterfaceGetPropertyFunc GetProperty {
get { return get_property; }
set { get_property = value; }
}
GLib.DBusInterfaceSetPropertyFunc set_property;
public GLib.DBusInterfaceSetPropertyFunc SetProperty {
get { return set_property; }
set { set_property = value; }
}
}
}

View file

@ -2,6 +2,7 @@
<metadata> <metadata>
<add-node path="/api"><symbol type="simple" cname="GSeekType" name="GLib.SeekType"/></add-node> <add-node path="/api"><symbol type="simple" cname="GSeekType" name="GLib.SeekType"/></add-node>
<attr path="/api/namespace" name="name">GLib</attr> <attr path="/api/namespace" name="name">GLib</attr>
<attr path="/api/namespace/interface/method/*/*[@type='GAsyncReadyCallback']" name="scope">async</attr>
<attr path="/api/namespace/interface[@cname='GAppInfo']" name="consume_only">1</attr> <attr path="/api/namespace/interface[@cname='GAppInfo']" name="consume_only">1</attr>
<attr path="/api/namespace/interface[@cname='GAppInfo']/method[@name='CanRemoveSupportsType']" name="name">GetCanRemoveSupportsType</attr> <attr path="/api/namespace/interface[@cname='GAppInfo']/method[@name='CanRemoveSupportsType']" name="name">GetCanRemoveSupportsType</attr>
<attr path="/api/namespace/interface[@cname='GAppInfo']/method[@name='GetAll']" name="hidden">1</attr> <attr path="/api/namespace/interface[@cname='GAppInfo']/method[@name='GetAll']" name="hidden">1</attr>
@ -22,6 +23,11 @@
<attr path="/api/namespace/interface[@cname='GVolume']/method[@name='GetMount']" name="name">GetMountInstance</attr> <attr path="/api/namespace/interface[@cname='GVolume']/method[@name='GetMount']" name="name">GetMountInstance</attr>
<attr path="/api/namespace/object/method/*/*[@type='GAsyncReadyCallback']" name="scope">async</attr> <attr path="/api/namespace/object/method/*/*[@type='GAsyncReadyCallback']" name="scope">async</attr>
<add-node path="/api/namespace/object[@cname='GFileEnumerator']"><implements><interface name="IEnumerable" /></implements></add-node> <add-node path="/api/namespace/object[@cname='GFileEnumerator']"><implements><interface name="IEnumerable" /></implements></add-node>
<attr path="/api/namespace/object[@cname='GApplication']/signal[@cname='activate']" name="name">Activated</attr>
<attr path="/api/namespace/object[@cname='GApplication']/signal[@cname='open']" name="name">Opened</attr>
<attr path="/api/namespace/object[@cname='GDBusAuthObserver']/signal[@cname='authorize-authenticated-peer']" name="name">AuthenticatedPeerAuthorized</attr>
<attr path="/api/namespace/object[@cname='GDBusConnection']/property[@cname='closed']" name="name">IsClosed</attr>
<attr path="/api/namespace/object[@cname='GDBusConnection']/method[@cname='g_dbus_connection_is_closed']" name="name">GetIsClosed</attr>
<attr path="/api/namespace/object[@cname='GFileInfo']/method[@cname='g_file_info_get_attribute_int64']" name="name">GetAttributeLong</attr> <attr path="/api/namespace/object[@cname='GFileInfo']/method[@cname='g_file_info_get_attribute_int64']" name="name">GetAttributeLong</attr>
<attr path="/api/namespace/object[@cname='GFileInfo']/method[@cname='g_file_info_set_attribute_int64']" name="name">SetAttributeLong</attr> <attr path="/api/namespace/object[@cname='GFileInfo']/method[@cname='g_file_info_set_attribute_int64']" name="name">SetAttributeLong</attr>
<attr path="/api/namespace/object[@cname='GFileInfo']/method[@cname='g_file_info_get_attribute_uint64']" name="name">GetAttributeULong</attr> <attr path="/api/namespace/object[@cname='GFileInfo']/method[@cname='g_file_info_get_attribute_uint64']" name="name">GetAttributeULong</attr>
@ -44,6 +50,7 @@
<attr path="/api/namespace/object[@cname='GOutputStream']/method[@cname='g_output_stream_write_all']/parameters/parameter[@name='buffer']" name="array">1</attr> <attr path="/api/namespace/object[@cname='GOutputStream']/method[@cname='g_output_stream_write_all']/parameters/parameter[@name='buffer']" name="array">1</attr>
<attr path="/api/namespace/object[@cname='GOutputStream']/method[@cname='g_output_stream_write_async']/parameters/parameter[@name='buffer']" name="type">guchar*</attr> <attr path="/api/namespace/object[@cname='GOutputStream']/method[@cname='g_output_stream_write_async']/parameters/parameter[@name='buffer']" name="type">guchar*</attr>
<attr path="/api/namespace/object[@cname='GOutputStream']/method[@cname='g_output_stream_write_async']/parameters/parameter[@name='buffer']" name="array">1</attr> <attr path="/api/namespace/object[@cname='GOutputStream']/method[@cname='g_output_stream_write_async']/parameters/parameter[@name='buffer']" name="array">1</attr>
<attr path="/api/namespace/object[@cname='GSimpleAction']/signal[@cname='activate']" name="name">Activated</attr>
<attr path="/api/namespace/object[@cname='GSimpleAsyncResult']/constructor[@cname='g_simple_async_result_new_error']" name="hidden">1</attr> <attr path="/api/namespace/object[@cname='GSimpleAsyncResult']/constructor[@cname='g_simple_async_result_new_error']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GSimpleAsyncResult']/method[@name='SetError']" name="hidden">1</attr> <attr path="/api/namespace/object[@cname='GSimpleAsyncResult']/method[@name='SetError']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GThemedIcon']/method[@name='GetNames']/return-type" name="null_term_array">1</attr> <attr path="/api/namespace/object[@cname='GThemedIcon']/method[@name='GetNames']/return-type" name="null_term_array">1</attr>
@ -55,4 +62,9 @@
<attr path="/api/namespace/object[@cname='GVolumeMonitor']/method[@name='GetConnectedDrives']/return-type" name="element_type">GDrive*</attr> <attr path="/api/namespace/object[@cname='GVolumeMonitor']/method[@name='GetConnectedDrives']/return-type" name="element_type">GDrive*</attr>
<attr path="/api/namespace/object[@cname='GVolumeMonitor']/method[@name='GetConnectedDrives']/return-type" name="owned">true</attr> <attr path="/api/namespace/object[@cname='GVolumeMonitor']/method[@name='GetConnectedDrives']/return-type" name="owned">true</attr>
<attr path="/api/namespace/struct[@cname='GFileAttributeInfoList']/field[@name='Infos']" name="array">1</attr> <attr path="/api/namespace/struct[@cname='GFileAttributeInfoList']/field[@name='Infos']" name="array">1</attr>
<remove-node path="/api/namespace/class[@cname='GDbus_']/method[@name='ErrorSetDbusErrorValist']" />
<remove-node path="/api/namespace/enum[@cname='GSocketFamily']" />
<remove-node path="/api/namespace/enum[@cname='GSocketMsgFlags']" />
<remove-node path="/api/namespace/interface[@cname='GDesktopAppInfoLookup']" />
<remove-node path="/api/namespace/interface[@cname='GTlsBackend']" />
</metadata> </metadata>

File diff suppressed because it is too large Load diff