2009-06-15 Christian Hoff <christian_hoff@gmx.net>

* gtk/Widget.custom: Don't use [MarshalAs] for struct fields since
	that is not supported in the .net framework

svn path=/trunk/gtk-sharp/; revision=136157
This commit is contained in:
Christian Hoff 2009-06-15 19:48:08 +00:00
parent 2332db49a2
commit 3d6b4f7281
2 changed files with 13 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2009-06-15 Christian Hoff <christian_hoff@gmx.net>
* gtk/Widget.custom: Don't use [MarshalAs] for struct fields since
that is not supported in the .net framework
2009-06-08 Christian Hoff <christian_hoff@gmx.net> 2009-06-08 Christian Hoff <christian_hoff@gmx.net>
* generator/Signal.cs: Fix indexing of the signal arguments array for * generator/Signal.cs: Fix indexing of the signal arguments array for

View file

@ -363,9 +363,9 @@ struct GtkBindingArg {
[StructLayout(LayoutKind.Explicit)] [StructLayout(LayoutKind.Explicit)]
struct GtkBindingArgData { struct GtkBindingArgData {
#if WIN64LONGS #if WIN64LONGS
[FieldOffset (0)] [MarshalAs (UnmanagedType.I4)] public int long_data; [FieldOffset (0)] public int long_data;
#else #else
[FieldOffset (0)] [MarshalAs (UnmanagedType.SysInt)] public int long_data; [FieldOffset (0)] public IntPtr long_data;
#endif #endif
[FieldOffset (0)] public double double_data; [FieldOffset (0)] public double double_data;
[FieldOffset (0)] public IntPtr string_data; [FieldOffset (0)] public IntPtr string_data;
@ -390,7 +390,12 @@ static void ClassInit (GLib.GType gtype, Type t)
GtkBindingArg arg = new GtkBindingArg (); GtkBindingArg arg = new GtkBindingArg ();
arg.arg_type = GLib.GType.Long.Val; arg.arg_type = GLib.GType.Long.Val;
arg.data.long_data = binding_invokers.Add (new BindingInvoker (mi, attr.Parms)); int binding_invoker_idx = binding_invokers.Add (new BindingInvoker (mi, attr.Parms));
#if WIN64LONGS
arg.data.long_data = binding_invoker_idx;
#else
arg.data.long_data = new IntPtr (binding_invoker_idx);
#endif
GLib.SList binding_args = new GLib.SList (new object[] {arg}, typeof (GtkBindingArg), false, false); GLib.SList binding_args = new GLib.SList (new object[] {arg}, typeof (GtkBindingArg), false, false);
gtk_binding_entry_add_signall (gtk_binding_set_by_class (gtype.ClassPtr), (uint) attr.Key, attr.Mod, native_signame, binding_args.Handle); gtk_binding_entry_add_signall (gtk_binding_set_by_class (gtype.ClassPtr), (uint) attr.Key, attr.Mod, native_signame, binding_args.Handle);