Made NativeStructGen more consistent with the way Gdk.Event
and Pango.Attribute are handled. Also increases performance
because reflection is not needed anymore to marshal these
kind of structs.
Don't spam the log with these messages for private structs
(and don't count this in the statistics), as there are too
many. These kind of types are just empty structs marked as
hidden and private.
GSource type was already there (but was not mapped by
the generator yet) so then the autogenerated methods
have been added manually inside the class after the
custom methods.
Other Source-related class are also generated and added
(but not mapped in the SymbolTable) to glib.
This means that we're modifying the generated code that
we checked in, so then we increase the future TODO about
more information about what we need to fix later.
The changes to Cond are a consequence of the changes to
Mutex because the former uses the latter.
Add GDate and GDateTime classes to glib, and map
them in the generator's SymbolTable.
(The types TimeZone and TimeVal are also added because
the Date* types depend on them, but there is no need
to map them in the generator.)
Also move the TODOs of other auto-generated classes
to a single TODO in the Makefile
The pointer from native is stored inside of a class which
wraps the structure. Fields can be accessed by marshalling
from and to the pointer. glib: Value.Update does now invoke
a private Update() method which is needed to update the new
structures.
Unfortunately, gir marks all integers as gint regardless
of its size. We have to check if the value will really
fit into a int, that is why there is an automatic fallback
to long.
The migration to generic collections [1] caused another regression: a
KeyNotFoundException was being thrown (instead of returning null like
HashTable did) when using the Destroyed event of the Gtk.Widget class.
[1] 6850b343ca
A particular example of this problem is Banshee's Import Media feature,
which was generating the following stacktrace:
[1 Debug 23:24:36.898] Starting - Importing Media
Marshaling activate signal
Exception in Gtk# callback delegate
Note: Applications can use GLib.ExceptionManager.UnhandledException
to handle the exception.
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --->
System.Collections.Generic.KeyNotFoundException: The given key was not
present in the dictionary.
at System.Collections.Generic.Dictionary`2[System.IntPtr,System.Delegate].get_Item
(IntPtr key) [0x00000] in <filename unknown>:0
at Gtk.Widget.add_Destroyed (System.EventHandler value) [0x00000] in
/home/knocte/gtk-sharp/gtk/Widget.cs:333
at Hyena.Widgets.AnimatedWidget..ctor (Gtk.Widget widget, UInt32
duration, Easing easing, Blocking blocking, Boolean horizontal)
[0x0004d] in /home/knocte/banshee/src/Hyena/Hyena.Gui/Hyena.Widgets/AnimatedWidget.cs:78
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<T>) which was not available in .NET 2.0's System
reference. This way MonoDevelop stops marking "Action" in red color.
[1] 8e07e7d225
[2] http://msdn.microsoft.com/en-us/library/system.action%28v=vs.90%29.aspx