2005-05-04 16:54:24 +00:00
|
|
|
// GLib.Type.cs - GLib GType class implementation
|
|
|
|
//
|
|
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
|
|
//
|
|
|
|
// Copyright (c) 2003 Mike Kestner
|
|
|
|
// Copyright (c) 2003 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;
|
2008-09-08 20:52:27 +00:00
|
|
|
using System.IO;
|
2005-05-04 16:54:24 +00:00
|
|
|
using System.Reflection;
|
|
|
|
using System.Runtime.InteropServices;
|
2008-12-19 18:57:42 +00:00
|
|
|
using System.Text;
|
2005-05-04 16:54:24 +00:00
|
|
|
|
2009-07-12 23:12:29 +00:00
|
|
|
public delegate System.Type TypeResolutionHandler (GLib.GType gtype, string gtype_name);
|
|
|
|
|
2005-05-04 16:54:24 +00:00
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
|
public struct GType {
|
|
|
|
|
|
|
|
IntPtr val;
|
|
|
|
|
2008-12-19 18:57:42 +00:00
|
|
|
struct GTypeInfo {
|
|
|
|
public ushort class_size;
|
2011-03-23 19:05:01 +00:00
|
|
|
public IntPtr base_init;
|
|
|
|
public IntPtr base_finalize;
|
|
|
|
public IntPtr class_init;
|
|
|
|
public IntPtr class_finalize;
|
|
|
|
public IntPtr class_data;
|
2008-12-19 18:57:42 +00:00
|
|
|
public ushort instance_size;
|
2011-03-23 19:05:01 +00:00
|
|
|
public ushort n_preallocs;
|
|
|
|
public IntPtr instance_init;
|
|
|
|
public IntPtr value_table;
|
2008-12-19 18:57:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct GTypeQuery {
|
|
|
|
public IntPtr type;
|
|
|
|
public IntPtr type_name;
|
|
|
|
public uint class_size;
|
|
|
|
public uint instance_size;
|
|
|
|
}
|
|
|
|
|
2005-05-04 16:54:24 +00:00
|
|
|
public GType (IntPtr val)
|
|
|
|
{
|
|
|
|
this.val = val;
|
|
|
|
}
|
|
|
|
|
2008-05-14 16:03:13 +00:00
|
|
|
public static GType FromName (string native_name)
|
|
|
|
{
|
|
|
|
return new GType (g_type_from_name (native_name));
|
|
|
|
}
|
|
|
|
|
2005-05-04 16:54:24 +00:00
|
|
|
public static readonly GType Invalid = new GType ((IntPtr) TypeFundamentals.TypeInvalid);
|
|
|
|
public static readonly GType None = new GType ((IntPtr) TypeFundamentals.TypeNone);
|
|
|
|
public static readonly GType Interface = new GType ((IntPtr) TypeFundamentals.TypeInterface);
|
|
|
|
public static readonly GType Char = new GType ((IntPtr) TypeFundamentals.TypeChar);
|
|
|
|
public static readonly GType UChar = new GType ((IntPtr) TypeFundamentals.TypeUChar);
|
|
|
|
public static readonly GType Boolean = new GType ((IntPtr) TypeFundamentals.TypeBoolean);
|
|
|
|
public static readonly GType Int = new GType ((IntPtr) TypeFundamentals.TypeInt);
|
|
|
|
public static readonly GType UInt = new GType ((IntPtr) TypeFundamentals.TypeUInt);
|
2008-04-28 18:52:49 +00:00
|
|
|
public static readonly GType Long = new GType ((IntPtr) TypeFundamentals.TypeLong);
|
|
|
|
public static readonly GType ULong = new GType ((IntPtr) TypeFundamentals.TypeULong);
|
2005-05-04 16:54:24 +00:00
|
|
|
public static readonly GType Int64 = new GType ((IntPtr) TypeFundamentals.TypeInt64);
|
|
|
|
public static readonly GType UInt64 = new GType ((IntPtr) TypeFundamentals.TypeUInt64);
|
|
|
|
public static readonly GType Enum = new GType ((IntPtr) TypeFundamentals.TypeEnum);
|
|
|
|
public static readonly GType Flags = new GType ((IntPtr) TypeFundamentals.TypeFlags);
|
|
|
|
public static readonly GType Float = new GType ((IntPtr) TypeFundamentals.TypeFloat);
|
|
|
|
public static readonly GType Double = new GType ((IntPtr) TypeFundamentals.TypeDouble);
|
|
|
|
public static readonly GType String = new GType ((IntPtr) TypeFundamentals.TypeString);
|
|
|
|
public static readonly GType Pointer = new GType ((IntPtr) TypeFundamentals.TypePointer);
|
|
|
|
public static readonly GType Boxed = new GType ((IntPtr) TypeFundamentals.TypeBoxed);
|
2008-04-28 18:52:49 +00:00
|
|
|
public static readonly GType Param = new GType ((IntPtr) TypeFundamentals.TypeParam);
|
2005-05-04 16:54:24 +00:00
|
|
|
public static readonly GType Object = new GType ((IntPtr) TypeFundamentals.TypeObject);
|
|
|
|
|
|
|
|
static Hashtable types = new Hashtable ();
|
|
|
|
static Hashtable gtypes = new Hashtable ();
|
|
|
|
|
|
|
|
public static void Register (GType native_type, System.Type type)
|
|
|
|
{
|
2009-08-01 17:20:35 +00:00
|
|
|
lock (types) {
|
|
|
|
if (native_type != GType.Pointer && native_type != GType.Boxed && native_type != ManagedValue.GType)
|
|
|
|
types[native_type.Val] = type;
|
|
|
|
if (type != null)
|
|
|
|
gtypes[type] = native_type;
|
|
|
|
}
|
2005-05-04 16:54:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GType ()
|
|
|
|
{
|
2009-05-05 15:15:46 +00:00
|
|
|
if (!GLib.Thread.Supported)
|
|
|
|
GLib.Thread.Init ();
|
|
|
|
|
2005-06-06 15:09:07 +00:00
|
|
|
g_type_init ();
|
|
|
|
|
2005-05-04 16:54:24 +00:00
|
|
|
Register (GType.Char, typeof (sbyte));
|
|
|
|
Register (GType.UChar, typeof (byte));
|
|
|
|
Register (GType.Boolean, typeof (bool));
|
|
|
|
Register (GType.Int, typeof (int));
|
|
|
|
Register (GType.UInt, typeof (uint));
|
|
|
|
Register (GType.Int64, typeof (long));
|
|
|
|
Register (GType.UInt64, typeof (ulong));
|
|
|
|
Register (GType.Float, typeof (float));
|
|
|
|
Register (GType.Double, typeof (double));
|
|
|
|
Register (GType.String, typeof (string));
|
2008-10-24 22:03:49 +00:00
|
|
|
Register (GType.Pointer, typeof (IntPtr));
|
2005-05-04 16:54:24 +00:00
|
|
|
Register (GType.Object, typeof (GLib.Object));
|
2008-11-04 20:17:00 +00:00
|
|
|
Register (GType.Pointer, typeof (IntPtr));
|
2005-05-04 16:54:24 +00:00
|
|
|
|
|
|
|
// One-way mapping
|
|
|
|
gtypes[typeof (char)] = GType.UInt;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static explicit operator GType (System.Type type)
|
|
|
|
{
|
|
|
|
GType gtype;
|
|
|
|
|
2009-08-01 17:20:35 +00:00
|
|
|
lock (types) {
|
|
|
|
if (gtypes.Contains (type))
|
|
|
|
return (GType)gtypes[type];
|
|
|
|
}
|
2005-05-04 16:54:24 +00:00
|
|
|
|
|
|
|
if (type.IsSubclassOf (typeof (GLib.Object))) {
|
|
|
|
gtype = GLib.Object.LookupGType (type);
|
|
|
|
Register (gtype, type);
|
|
|
|
return gtype;
|
|
|
|
}
|
|
|
|
|
|
|
|
PropertyInfo pi = type.GetProperty ("GType", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy);
|
|
|
|
if (pi != null)
|
|
|
|
gtype = (GType) pi.GetValue (null, null);
|
|
|
|
else if (type.IsDefined (typeof (GTypeAttribute), false)) {
|
|
|
|
GTypeAttribute gattr = (GTypeAttribute)Attribute.GetCustomAttribute (type, typeof (GTypeAttribute), false);
|
|
|
|
pi = gattr.WrapperType.GetProperty ("GType", BindingFlags.Public | BindingFlags.Static);
|
|
|
|
gtype = (GType) pi.GetValue (null, null);
|
|
|
|
} else if (type.IsSubclassOf (typeof (GLib.Opaque)))
|
|
|
|
gtype = GType.Pointer;
|
|
|
|
else
|
|
|
|
gtype = ManagedValue.GType;
|
|
|
|
|
|
|
|
Register (gtype, type);
|
|
|
|
return gtype;
|
|
|
|
}
|
|
|
|
|
|
|
|
static string GetQualifiedName (string cname)
|
|
|
|
{
|
|
|
|
for (int i = 1; i < cname.Length; i++) {
|
|
|
|
if (System.Char.IsUpper (cname[i])) {
|
|
|
|
if (i == 1 && cname [0] == 'G')
|
|
|
|
return "GLib." + cname.Substring (1);
|
|
|
|
else
|
|
|
|
return cname.Substring (0, i) + "." + cname.Substring (i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-07-12 21:34:46 +00:00
|
|
|
return null;
|
2005-05-04 16:54:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static explicit operator Type (GType gtype)
|
|
|
|
{
|
|
|
|
return LookupType (gtype.Val);
|
|
|
|
}
|
|
|
|
|
2008-03-12 16:15:06 +00:00
|
|
|
public static void Init ()
|
|
|
|
{
|
|
|
|
// cctor already calls g_type_init.
|
|
|
|
}
|
|
|
|
|
2009-07-12 23:12:29 +00:00
|
|
|
public static event TypeResolutionHandler ResolveType;
|
|
|
|
|
2005-05-04 16:54:24 +00:00
|
|
|
public static Type LookupType (IntPtr typeid)
|
|
|
|
{
|
2009-08-01 17:20:35 +00:00
|
|
|
lock (types) {
|
|
|
|
if (types.Contains (typeid))
|
|
|
|
return (Type)types[typeid];
|
|
|
|
}
|
2005-05-04 16:54:24 +00:00
|
|
|
|
|
|
|
string native_name = Marshaller.Utf8PtrToString (g_type_name (typeid));
|
2009-07-12 23:12:29 +00:00
|
|
|
|
|
|
|
if (ResolveType != null) {
|
|
|
|
GLib.GType gt = new GLib.GType (typeid);
|
|
|
|
|
|
|
|
Delegate[] invocation_list = ResolveType.GetInvocationList ();
|
|
|
|
foreach (Delegate d in invocation_list) {
|
|
|
|
TypeResolutionHandler handler = (TypeResolutionHandler) d;
|
|
|
|
System.Type tmp = handler (gt, native_name);
|
|
|
|
if (tmp != null) {
|
|
|
|
Register (gt, tmp);
|
|
|
|
return tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-05-04 16:54:24 +00:00
|
|
|
string type_name = GetQualifiedName (native_name);
|
2009-07-12 21:34:46 +00:00
|
|
|
if (type_name == null)
|
|
|
|
return null;
|
2005-05-04 16:54:24 +00:00
|
|
|
Type result = null;
|
2008-06-17 16:36:06 +00:00
|
|
|
Assembly[] assemblies = (Assembly[]) AppDomain.CurrentDomain.GetAssemblies ().Clone ();
|
|
|
|
foreach (Assembly asm in assemblies) {
|
2005-05-04 16:54:24 +00:00
|
|
|
result = asm.GetType (type_name);
|
|
|
|
if (result != null)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-06-17 16:36:06 +00:00
|
|
|
if (result == null) {
|
2008-09-24 20:06:47 +00:00
|
|
|
// Because of lazy loading of references, it's possible the type's assembly
|
|
|
|
// needs to be loaded. We will look for it by name in the references of
|
|
|
|
// the currently loaded assemblies. Hopefully a recursive traversal is
|
|
|
|
// not needed. We avoid one for now because of problems experienced
|
|
|
|
// in a patch from bug #400595, and a desire to keep memory usage low
|
|
|
|
// by avoiding a complete loading of all dependent assemblies.
|
|
|
|
string ns = type_name.Substring (0, type_name.LastIndexOf ('.'));
|
|
|
|
string asm_name = ns.ToLower ().Replace ('.', '-') + "-sharp";
|
2008-06-17 16:36:06 +00:00
|
|
|
foreach (Assembly asm in assemblies) {
|
2008-09-24 20:06:47 +00:00
|
|
|
foreach (AssemblyName ref_name in asm.GetReferencedAssemblies ()) {
|
|
|
|
if (ref_name.Name != asm_name)
|
|
|
|
continue;
|
|
|
|
try {
|
2009-10-31 02:18:21 +00:00
|
|
|
string asm_dir = Path.GetDirectoryName (asm.Location);
|
2008-09-24 20:06:47 +00:00
|
|
|
Assembly ref_asm;
|
|
|
|
if (File.Exists (Path.Combine (asm_dir, ref_name.Name + ".dll")))
|
|
|
|
ref_asm = Assembly.LoadFrom (Path.Combine (asm_dir, ref_name.Name + ".dll"));
|
|
|
|
else
|
|
|
|
ref_asm = Assembly.Load (ref_name);
|
|
|
|
result = ref_asm.GetType (type_name);
|
|
|
|
if (result != null)
|
|
|
|
break;
|
|
|
|
} catch (Exception) {
|
|
|
|
/* Failure to load a referenced assembly is not an error */
|
|
|
|
}
|
|
|
|
}
|
2008-06-17 16:36:06 +00:00
|
|
|
if (result != null)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-05-04 16:54:24 +00:00
|
|
|
Register (new GType (typeid), result);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
public IntPtr Val {
|
2008-12-19 18:57:42 +00:00
|
|
|
get { return val; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public static bool operator == (GType a, GType b)
|
|
|
|
{
|
|
|
|
return a.Val == b.Val;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static bool operator != (GType a, GType b)
|
|
|
|
{
|
|
|
|
return a.Val != b.Val;
|
2005-05-04 16:54:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public override bool Equals (object o)
|
|
|
|
{
|
|
|
|
if (!(o is GType))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return ((GType) o) == this;
|
|
|
|
}
|
|
|
|
|
2008-12-19 18:57:42 +00:00
|
|
|
public override int GetHashCode ()
|
2005-05-04 16:54:24 +00:00
|
|
|
{
|
2008-12-19 18:57:42 +00:00
|
|
|
return val.GetHashCode ();
|
2005-05-04 16:54:24 +00:00
|
|
|
}
|
|
|
|
|
2008-12-19 18:57:42 +00:00
|
|
|
public override string ToString ()
|
2005-05-04 16:54:24 +00:00
|
|
|
{
|
2008-12-19 18:57:42 +00:00
|
|
|
return Marshaller.Utf8PtrToString (g_type_name (val));
|
2005-05-04 16:54:24 +00:00
|
|
|
}
|
|
|
|
|
2009-08-08 23:42:15 +00:00
|
|
|
public IntPtr GetClassPtr ()
|
|
|
|
{
|
|
|
|
IntPtr klass = g_type_class_peek (val);
|
|
|
|
if (klass == IntPtr.Zero)
|
|
|
|
klass = g_type_class_ref (val);
|
|
|
|
return klass;
|
2008-12-19 18:57:42 +00:00
|
|
|
}
|
|
|
|
|
2009-08-08 23:42:15 +00:00
|
|
|
public GType GetBaseType ()
|
|
|
|
{
|
|
|
|
IntPtr parent = g_type_parent (this.Val);
|
|
|
|
return parent == IntPtr.Zero ? GType.None : new GType (parent);
|
2009-04-13 17:44:48 +00:00
|
|
|
}
|
|
|
|
|
2009-08-08 23:42:15 +00:00
|
|
|
public GType GetThresholdType ()
|
|
|
|
{
|
|
|
|
GType curr_type = this;
|
|
|
|
while (curr_type.ToString ().StartsWith ("__gtksharp_"))
|
|
|
|
curr_type = curr_type.GetBaseType ();
|
|
|
|
return curr_type;
|
2009-04-13 17:44:48 +00:00
|
|
|
}
|
|
|
|
|
2009-08-08 23:42:15 +00:00
|
|
|
public uint GetClassSize ()
|
|
|
|
{
|
|
|
|
GTypeQuery query;
|
|
|
|
g_type_query (this.Val, out query);
|
|
|
|
return query.class_size;
|
2009-04-13 17:44:48 +00:00
|
|
|
}
|
|
|
|
|
2008-12-19 18:57:42 +00:00
|
|
|
internal void EnsureClass ()
|
2005-05-04 16:54:24 +00:00
|
|
|
{
|
2008-12-19 18:57:42 +00:00
|
|
|
if (g_type_class_peek (val) == IntPtr.Zero)
|
|
|
|
g_type_class_ref (val);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int type_uid;
|
|
|
|
static string BuildEscapedName (System.Type t)
|
|
|
|
{
|
|
|
|
string qn = t.FullName;
|
|
|
|
// Just a random guess
|
|
|
|
StringBuilder sb = new StringBuilder (20 + qn.Length);
|
|
|
|
sb.Append ("__gtksharp_");
|
|
|
|
sb.Append (type_uid++);
|
|
|
|
sb.Append ("_");
|
|
|
|
foreach (char c in qn) {
|
|
|
|
if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
|
|
|
|
sb.Append (c);
|
|
|
|
else if (c == '.')
|
|
|
|
sb.Append ('_');
|
|
|
|
else if ((uint) c <= byte.MaxValue) {
|
|
|
|
sb.Append ('+');
|
|
|
|
sb.Append (((byte) c).ToString ("x2"));
|
|
|
|
} else {
|
|
|
|
sb.Append ('-');
|
|
|
|
sb.Append (((uint) c).ToString ("x4"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return sb.ToString ();
|
|
|
|
}
|
|
|
|
|
|
|
|
internal static GType RegisterGObjectType (System.Type t)
|
|
|
|
{
|
|
|
|
GType parent_gtype = LookupGObjectType (t.BaseType);
|
|
|
|
string name = BuildEscapedName (t);
|
|
|
|
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
|
|
|
GTypeQuery query;
|
|
|
|
g_type_query (parent_gtype.Val, out query);
|
|
|
|
GTypeInfo info = new GTypeInfo ();
|
|
|
|
info.class_size = (ushort) query.class_size;
|
|
|
|
info.instance_size = (ushort) query.instance_size;
|
|
|
|
GType gtype = new GType (g_type_register_static (parent_gtype.Val, native_name, ref info, 0));
|
|
|
|
GLib.Marshaller.Free (native_name);
|
|
|
|
Register (gtype, t);
|
|
|
|
return gtype;
|
|
|
|
}
|
|
|
|
|
|
|
|
internal static GType LookupGObjectType (System.Type t)
|
|
|
|
{
|
2009-08-01 17:20:35 +00:00
|
|
|
lock (types) {
|
|
|
|
if (gtypes.Contains (t))
|
|
|
|
return (GType) gtypes [t];
|
|
|
|
}
|
2008-12-19 18:57:42 +00:00
|
|
|
|
|
|
|
PropertyInfo pi = t.GetProperty ("GType", BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public);
|
|
|
|
if (pi != null)
|
|
|
|
return (GType) pi.GetValue (null, null);
|
|
|
|
|
|
|
|
return GLib.Object.RegisterGType (t);
|
|
|
|
}
|
|
|
|
|
|
|
|
internal static IntPtr ValFromInstancePtr (IntPtr handle)
|
|
|
|
{
|
|
|
|
if (handle == IntPtr.Zero)
|
|
|
|
return IntPtr.Zero;
|
|
|
|
|
|
|
|
// First field of instance is a GTypeClass*.
|
|
|
|
IntPtr klass = Marshal.ReadIntPtr (handle);
|
|
|
|
// First field of GTypeClass is a GType.
|
|
|
|
return Marshal.ReadIntPtr (klass);
|
2005-05-04 16:54:24 +00:00
|
|
|
}
|
|
|
|
|
2009-01-06 15:27:12 +00:00
|
|
|
internal static bool Is (IntPtr type, GType is_a_type)
|
2008-12-22 17:02:09 +00:00
|
|
|
{
|
2009-01-06 15:27:12 +00:00
|
|
|
return g_type_is_a (type, is_a_type.Val);
|
2008-12-22 17:02:09 +00:00
|
|
|
}
|
|
|
|
|
2008-12-22 17:16:03 +00:00
|
|
|
public bool IsInstance (IntPtr raw)
|
2008-12-22 17:02:09 +00:00
|
|
|
{
|
2009-01-06 15:27:12 +00:00
|
|
|
return GType.Is (ValFromInstancePtr (raw), this);
|
2008-12-22 17:02:09 +00:00
|
|
|
}
|
|
|
|
|
2009-09-03 19:50:53 +00:00
|
|
|
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
2008-12-19 18:57:42 +00:00
|
|
|
static extern IntPtr g_type_class_peek (IntPtr gtype);
|
|
|
|
|
2009-09-03 19:50:53 +00:00
|
|
|
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
2008-12-19 18:57:42 +00:00
|
|
|
static extern IntPtr g_type_class_ref (IntPtr gtype);
|
|
|
|
|
2009-09-03 19:50:53 +00:00
|
|
|
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
2008-12-19 18:57:42 +00:00
|
|
|
static extern IntPtr g_type_from_name (string name);
|
|
|
|
|
2009-09-03 19:50:53 +00:00
|
|
|
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
2008-12-19 18:57:42 +00:00
|
|
|
static extern void g_type_init ();
|
|
|
|
|
2009-09-03 19:50:53 +00:00
|
|
|
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
2005-05-04 16:54:24 +00:00
|
|
|
static extern IntPtr g_type_name (IntPtr raw);
|
2008-05-14 16:03:13 +00:00
|
|
|
|
2009-09-03 19:50:53 +00:00
|
|
|
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
2009-04-13 17:44:48 +00:00
|
|
|
static extern IntPtr g_type_parent (IntPtr type);
|
|
|
|
|
2009-09-03 19:50:53 +00:00
|
|
|
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
2008-12-19 18:57:42 +00:00
|
|
|
static extern void g_type_query (IntPtr type, out GTypeQuery query);
|
2005-05-04 16:54:24 +00:00
|
|
|
|
2009-09-03 19:50:53 +00:00
|
|
|
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
2008-12-19 18:57:42 +00:00
|
|
|
static extern IntPtr g_type_register_static (IntPtr parent, IntPtr name, ref GTypeInfo info, int flags);
|
2008-12-22 17:02:09 +00:00
|
|
|
|
2009-09-03 19:50:53 +00:00
|
|
|
[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
2008-12-22 17:02:09 +00:00
|
|
|
static extern bool g_type_is_a (IntPtr type, IntPtr is_a_type);
|
2005-05-04 16:54:24 +00:00
|
|
|
}
|
|
|
|
}
|