From 74b6340d86cb8976c9dfb1feb821a0dfeaa1e994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= Date: Fri, 23 Aug 2013 22:07:45 +0200 Subject: [PATCH 1/2] MSBuild: update some project files to account for recent changes --- atk/atk.csproj | 39 ++++++++++++++++++++++++++------------- gio/gio.csproj | 35 +++++++++++++++-------------------- gtk/gtk.csproj | 26 ++++++++++---------------- 3 files changed, 51 insertions(+), 49 deletions(-) diff --git a/atk/atk.csproj b/atk/atk.csproj index 0fadfe7f1..437a58106 100644 --- a/atk/atk.csproj +++ b/atk/atk.csproj @@ -42,7 +42,6 @@ - @@ -56,12 +55,9 @@ - - - @@ -71,14 +67,10 @@ - - - - @@ -101,17 +93,13 @@ - - - - @@ -119,7 +107,32 @@ - + + + + + + + + + + + + + + + + + + + + + + + + {3BF1D531-8840-4F15-8066-A9788D8C398B} + glib + \ No newline at end of file diff --git a/gio/gio.csproj b/gio/gio.csproj index 2e5606833..04adba2f7 100644 --- a/gio/gio.csproj +++ b/gio/gio.csproj @@ -42,16 +42,13 @@ - - - @@ -62,10 +59,8 @@ - - @@ -87,7 +82,6 @@ - @@ -145,7 +139,6 @@ - @@ -164,7 +157,6 @@ - @@ -175,7 +167,6 @@ - @@ -240,7 +231,6 @@ - @@ -248,7 +238,6 @@ - @@ -268,16 +257,12 @@ - - - - @@ -286,7 +271,6 @@ - @@ -307,7 +291,6 @@ - @@ -330,14 +313,12 @@ - - @@ -349,7 +330,6 @@ - @@ -366,6 +346,21 @@ + + + + + + + + + + + + + + + diff --git a/gtk/gtk.csproj b/gtk/gtk.csproj index 497e90ae8..516cfdba7 100644 --- a/gtk/gtk.csproj +++ b/gtk/gtk.csproj @@ -161,7 +161,6 @@ - @@ -175,7 +174,6 @@ - @@ -226,10 +224,8 @@ - - @@ -330,7 +326,6 @@ - @@ -348,7 +343,6 @@ - @@ -558,7 +552,6 @@ - @@ -609,7 +602,6 @@ - @@ -642,7 +634,6 @@ - @@ -699,7 +690,6 @@ - @@ -770,7 +760,6 @@ - @@ -855,7 +844,6 @@ - @@ -866,15 +854,12 @@ - - - @@ -888,7 +873,6 @@ - @@ -936,6 +920,12 @@ + + + + + + @@ -949,5 +939,9 @@ {58346CC6-DE93-45B4-8093-3508BD5DAA12} gdk + + {42FE871A-D8CF-4B29-9AFF-B02454E6C976} + atk + From 6f16031661db330e02246b9766704abc8c4f34e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= Date: Sat, 24 Aug 2013 00:11:05 +0200 Subject: [PATCH 2/2] glib: fix NRE regression after interface naming changed ListBase was throwing a NullReferenceException in DataMarshal() due to the fact that Reflection was being used to find the adapter name of the interface generated by the bindings, which has recently changed [1]. [1] https://github.com/mono/gtk-sharp/commit/6cb03440c1a3fb52c23d5d681e44f772d687333c --- glib/ListBase.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/glib/ListBase.cs b/glib/ListBase.cs index 3077b80b9..5f1d63fa0 100644 --- a/glib/ListBase.cs +++ b/glib/ListBase.cs @@ -168,7 +168,7 @@ namespace GLib { else if (element_type.IsValueType) ret = Marshal.PtrToStructure (data, element_type); else if (element_type.IsInterface) { - Type adapter_type = element_type.Assembly.GetType (element_type.FullName + "Adapter"); + Type adapter_type = element_type.Assembly.GetType (InterfaceToAdapterTypeName (element_type)); System.Reflection.MethodInfo method = adapter_type.GetMethod ("GetObject", new Type[] {typeof(IntPtr), typeof(bool)}); ret = method.Invoke (null, new object[] {data, false}); } else @@ -180,6 +180,16 @@ namespace GLib { return ret; } + static string InterfaceToAdapterTypeName (Type type) + { + string fullname = type.Namespace; + if (!String.IsNullOrEmpty (fullname)) { + fullname += "."; + } + fullname += type.Name.Substring (1); // IActivatable -> Activatable + return fullname + "Adapter"; + } + [DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern void g_free (IntPtr item);