From 234717712ed494b2f9fbb51a2688f1b0ec5640a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= Date: Tue, 24 Sep 2013 01:02:08 +0200 Subject: [PATCH 1/6] glib: remove unused 'using' statements --- glib/FileUtils.cs | 1 - glib/Global.cs | 1 - glib/InitiallyUnowned.cs | 2 -- glib/KeyFile.cs | 1 - glib/Log.cs | 1 - glib/ManagedValue.cs | 1 - glib/MissingIntPtrCtorException.cs | 1 - glib/Object.cs | 2 -- glib/Opaque.cs | 3 --- glib/Signal.cs | 1 - glib/SignalArgs.cs | 1 - glib/Timeout.cs | 4 ++-- glib/Value.cs | 1 - 13 files changed, 2 insertions(+), 18 deletions(-) diff --git a/glib/FileUtils.cs b/glib/FileUtils.cs index e48ef8288..cdd66f8ac 100644 --- a/glib/FileUtils.cs +++ b/glib/FileUtils.cs @@ -22,7 +22,6 @@ namespace GLib { using System; - using System.Text; using System.Runtime.InteropServices; public class FileUtils diff --git a/glib/Global.cs b/glib/Global.cs index 3dae617bd..9fdde2886 100644 --- a/glib/Global.cs +++ b/glib/Global.cs @@ -23,7 +23,6 @@ namespace GLib { using System; - using System.Text; using System.Runtime.InteropServices; public class Global diff --git a/glib/InitiallyUnowned.cs b/glib/InitiallyUnowned.cs index ddca29262..303d07f2d 100644 --- a/glib/InitiallyUnowned.cs +++ b/glib/InitiallyUnowned.cs @@ -21,8 +21,6 @@ namespace GLib { using System; - using System.Collections; - using System.ComponentModel; using System.Runtime.InteropServices; public class InitiallyUnowned : Object { diff --git a/glib/KeyFile.cs b/glib/KeyFile.cs index d3c1540bc..2df3799b7 100644 --- a/glib/KeyFile.cs +++ b/glib/KeyFile.cs @@ -21,7 +21,6 @@ using System; -using System.Collections; using System.Runtime.InteropServices; namespace GLib { diff --git a/glib/Log.cs b/glib/Log.cs index eeb1d23d8..8464e5665 100644 --- a/glib/Log.cs +++ b/glib/Log.cs @@ -25,7 +25,6 @@ namespace GLib { using System; - using System.Collections; using System.Runtime.InteropServices; public delegate void LogFunc (string log_domain, LogLevelFlags log_level, string message); diff --git a/glib/ManagedValue.cs b/glib/ManagedValue.cs index dc96ad520..5d0c64344 100644 --- a/glib/ManagedValue.cs +++ b/glib/ManagedValue.cs @@ -21,7 +21,6 @@ namespace GLib { using System; - using System.Collections; using System.Runtime.InteropServices; using GLib; diff --git a/glib/MissingIntPtrCtorException.cs b/glib/MissingIntPtrCtorException.cs index f5633430c..8c390fcc4 100644 --- a/glib/MissingIntPtrCtorException.cs +++ b/glib/MissingIntPtrCtorException.cs @@ -22,7 +22,6 @@ namespace GLib { using System; - using System.Runtime.InteropServices; public class MissingIntPtrCtorException : Exception { diff --git a/glib/Object.cs b/glib/Object.cs index b3a3be040..45d965707 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -26,10 +26,8 @@ namespace GLib { using System; using System.Collections.Generic; - using System.ComponentModel; using System.Reflection; using System.Runtime.InteropServices; - using System.Text; public class Object : IWrapper, IDisposable { diff --git a/glib/Opaque.cs b/glib/Opaque.cs index 7d31b035d..5eca7fdd3 100644 --- a/glib/Opaque.cs +++ b/glib/Opaque.cs @@ -27,9 +27,6 @@ namespace GLib { using System; - using System.Collections; - using System.ComponentModel; - using System.Runtime.InteropServices; public class Opaque : IWrapper, IDisposable { diff --git a/glib/Signal.cs b/glib/Signal.cs index f0dadae7d..3ca01cec2 100644 --- a/glib/Signal.cs +++ b/glib/Signal.cs @@ -23,7 +23,6 @@ namespace GLib { using System; - using System.Collections; using System.Runtime.InteropServices; [Flags] diff --git a/glib/SignalArgs.cs b/glib/SignalArgs.cs index 7ef9ad0b8..1761093a5 100644 --- a/glib/SignalArgs.cs +++ b/glib/SignalArgs.cs @@ -22,7 +22,6 @@ namespace GLib { using System; - using System.Collections; public class SignalArgs : EventArgs { diff --git a/glib/Timeout.cs b/glib/Timeout.cs index ccb261e77..99fd9a5d6 100755 --- a/glib/Timeout.cs +++ b/glib/Timeout.cs @@ -129,10 +129,10 @@ namespace GLib { { Source.Remove (id); } - + [DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] static extern bool g_source_remove (uint id); - + public static bool Remove (TimeoutHandler hndlr) { bool result = false; diff --git a/glib/Value.cs b/glib/Value.cs index 32963e516..deb7deb3e 100755 --- a/glib/Value.cs +++ b/glib/Value.cs @@ -23,7 +23,6 @@ namespace GLib { using System; - using System.Collections; using System.Reflection; using System.Runtime.InteropServices; From 0312613c323dab7da53f49771459f1568a6191b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= Date: Tue, 24 Sep 2013 01:02:43 +0200 Subject: [PATCH 2/6] glib: ObjectManager class can be made static --- glib/ObjectManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/ObjectManager.cs b/glib/ObjectManager.cs index 9db8f1660..b55ea3133 100644 --- a/glib/ObjectManager.cs +++ b/glib/ObjectManager.cs @@ -26,7 +26,7 @@ namespace GLib { using System.Runtime.InteropServices; using System.Reflection; - public class ObjectManager { + public static class ObjectManager { static BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.CreateInstance; From 9016c304de7edf382c82139b65361734ee60bdd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= Date: Tue, 24 Sep 2013 01:06:57 +0200 Subject: [PATCH 3/6] MSBuild: change some projects to Library type, not Executable Even though gtk-sharp cannot be built via MSBuild (yet?), it's better to make the .csproj reflect more closely what you get with the normal build. --- atk/atk.csproj | 2 +- cairo/cairo.csproj | 2 +- gdk/gdk.csproj | 2 +- gio/gio.csproj | 2 +- glib/glib.csproj | 2 +- gtk/gtk.csproj | 2 +- pango/pango.csproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/atk/atk.csproj b/atk/atk.csproj index 437a58106..221ac9563 100644 --- a/atk/atk.csproj +++ b/atk/atk.csproj @@ -6,7 +6,7 @@ 9.0.21022 2.0 {42FE871A-D8CF-4B29-9AFF-B02454E6C976} - Exe + Library atk atk v3.5 diff --git a/cairo/cairo.csproj b/cairo/cairo.csproj index a9279ab8e..0d58b7787 100644 --- a/cairo/cairo.csproj +++ b/cairo/cairo.csproj @@ -6,7 +6,7 @@ 9.0.21022 2.0 {364577DB-9728-4951-AC2C-EDF7A6FCC09D} - Exe + Library cairo cairo v3.5 diff --git a/gdk/gdk.csproj b/gdk/gdk.csproj index 9586ca93b..8874c4e91 100644 --- a/gdk/gdk.csproj +++ b/gdk/gdk.csproj @@ -6,7 +6,7 @@ 9.0.21022 2.0 {58346CC6-DE93-45B4-8093-3508BD5DAA12} - Exe + Library gdk gdk v3.5 diff --git a/gio/gio.csproj b/gio/gio.csproj index 04adba2f7..2206d1af9 100644 --- a/gio/gio.csproj +++ b/gio/gio.csproj @@ -6,7 +6,7 @@ 9.0.21022 2.0 {1C3BB17B-336D-432A-8952-4E979BC90867} - Exe + Library gio gio v3.5 diff --git a/glib/glib.csproj b/glib/glib.csproj index b2665bfd5..b4970e407 100644 --- a/glib/glib.csproj +++ b/glib/glib.csproj @@ -6,7 +6,7 @@ 9.0.21022 2.0 {3BF1D531-8840-4F15-8066-A9788D8C398B} - Exe + Library glib glib v3.5 diff --git a/gtk/gtk.csproj b/gtk/gtk.csproj index 516cfdba7..b5279a883 100644 --- a/gtk/gtk.csproj +++ b/gtk/gtk.csproj @@ -6,7 +6,7 @@ 9.0.21022 2.0 {94045F11-4266-40B4-910F-298985AF69D5} - Exe + Library gtk gtk v3.5 diff --git a/pango/pango.csproj b/pango/pango.csproj index b3559eb4b..476be66cb 100644 --- a/pango/pango.csproj +++ b/pango/pango.csproj @@ -6,7 +6,7 @@ 9.0.21022 2.0 {FF422D8C-562F-4EA6-8590-9D1A5CD40AD4} - Exe + Library pango pango v3.5 From 872e0edfdd92afcf324968dd9a2721a490b82cad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= Date: Tue, 24 Sep 2013 01:13:52 +0200 Subject: [PATCH 4/6] MSBuild: remove AssemblyInfo.cs where it's not present The only autogenerated AssemblyInfo files are in cairo and in gtk-sharp's root, not inside other libraries like atk, glib, etc. Removing them will make MonoDevelop stop rendering a red element underneath each project. --- atk/atk.csproj | 1 - gdk/gdk.csproj | 1 - gio/gio.csproj | 1 - glib/glib.csproj | 1 - pango/pango.csproj | 1 - 5 files changed, 5 deletions(-) diff --git a/atk/atk.csproj b/atk/atk.csproj index 221ac9563..cac79a612 100644 --- a/atk/atk.csproj +++ b/atk/atk.csproj @@ -33,7 +33,6 @@ - diff --git a/gdk/gdk.csproj b/gdk/gdk.csproj index 8874c4e91..10cbffb98 100644 --- a/gdk/gdk.csproj +++ b/gdk/gdk.csproj @@ -33,7 +33,6 @@ - diff --git a/gio/gio.csproj b/gio/gio.csproj index 2206d1af9..4c31a9328 100644 --- a/gio/gio.csproj +++ b/gio/gio.csproj @@ -34,7 +34,6 @@ - diff --git a/glib/glib.csproj b/glib/glib.csproj index b4970e407..1a31e1b49 100644 --- a/glib/glib.csproj +++ b/glib/glib.csproj @@ -34,7 +34,6 @@ - diff --git a/pango/pango.csproj b/pango/pango.csproj index 476be66cb..9646ad2f4 100644 --- a/pango/pango.csproj +++ b/pango/pango.csproj @@ -34,7 +34,6 @@ - From bb0aa9a37caaba8996021c3940fbee1ec17643d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= Date: Tue, 24 Sep 2013 01:16:02 +0200 Subject: [PATCH 5/6] glib: mark MSBuild project with AllowUnsafe setting In the same way it is needed for other projects such as gtk.csproj. --- glib/glib.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/glib/glib.csproj b/glib/glib.csproj index 1a31e1b49..c8b70dcbd 100644 --- a/glib/glib.csproj +++ b/glib/glib.csproj @@ -21,6 +21,7 @@ 4 x86 false + true none @@ -30,6 +31,7 @@ 4 x86 false + true From f033de7816fca6b9d7dc5572065bf69360e57611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= Date: Tue, 24 Sep 2013 01:21:28 +0200 Subject: [PATCH 6/6] glib: reference .NET 3.5's System.Core in MSBuild project glib.csproj needs to reference System.Core from .NET 3.5 because glib-sharp now[1] uses System.Action [2] delegate (not to confuse with System.Action) which was not available in .NET 2.0's System reference. This way MonoDevelop stops marking "Action" in red color. [1] https://github.com/mono/gtk-sharp/commit/8e07e7d2257b185866dedfda9cbf32b2e00cd3ee [2] http://msdn.microsoft.com/en-us/library/system.action%28v=vs.90%29.aspx --- glib/glib.csproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glib/glib.csproj b/glib/glib.csproj index c8b70dcbd..0f7bf4384 100644 --- a/glib/glib.csproj +++ b/glib/glib.csproj @@ -88,4 +88,7 @@ + + + \ No newline at end of file