From 3d6b4f728155a65d379059e2fb8c7f2c36eb63cd Mon Sep 17 00:00:00 2001 From: Christian Hoff Date: Mon, 15 Jun 2009 19:48:08 +0000 Subject: [PATCH] 2009-06-15 Christian Hoff * 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 --- ChangeLog | 5 +++++ gtk/Widget.custom | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d2d337b4..e1d36290f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-15 Christian Hoff + + * gtk/Widget.custom: Don't use [MarshalAs] for struct fields since + that is not supported in the .net framework + 2009-06-08 Christian Hoff * generator/Signal.cs: Fix indexing of the signal arguments array for diff --git a/gtk/Widget.custom b/gtk/Widget.custom index 0020e29d5..94eefd5ec 100644 --- a/gtk/Widget.custom +++ b/gtk/Widget.custom @@ -363,9 +363,9 @@ struct GtkBindingArg { [StructLayout(LayoutKind.Explicit)] struct GtkBindingArgData { #if WIN64LONGS - [FieldOffset (0)] [MarshalAs (UnmanagedType.I4)] public int long_data; + [FieldOffset (0)] public int long_data; #else - [FieldOffset (0)] [MarshalAs (UnmanagedType.SysInt)] public int long_data; + [FieldOffset (0)] public IntPtr long_data; #endif [FieldOffset (0)] public double double_data; [FieldOffset (0)] public IntPtr string_data; @@ -390,7 +390,12 @@ static void ClassInit (GLib.GType gtype, Type t) GtkBindingArg arg = new GtkBindingArg (); 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); gtk_binding_entry_add_signall (gtk_binding_set_by_class (gtype.ClassPtr), (uint) attr.Key, attr.Mod, native_signame, binding_args.Handle);