glib,generator: map MainContext type and expose members

This is needed to reference a MainContext from
external bindings, which need to create a
MainContext using a Handle
This commit is contained in:
Stephan Sundermann 2013-10-09 19:44:50 +02:00 committed by Andrés G. Aragoneses
parent 6ab620d689
commit b868b80dee
2 changed files with 3 additions and 2 deletions

View File

@ -133,6 +133,7 @@ namespace GtkSharp.Generation {
AddType (new ManualGen ("GDateTime", "GLib.DateTime")); AddType (new ManualGen ("GDateTime", "GLib.DateTime"));
AddType (new ManualGen ("GDate", "GLib.Date")); AddType (new ManualGen ("GDate", "GLib.Date"));
AddType (new ManualGen ("GSource", "GLib.Source")); AddType (new ManualGen ("GSource", "GLib.Source"));
AddType (new ManualGen ("GMainContext", "GLib.MainContext"));
AddType (new SimpleGen ("GPollFD", "GLib.PollFD", "GLib.PollFD.Zero")); AddType (new SimpleGen ("GPollFD", "GLib.PollFD", "GLib.PollFD.Zero"));
AddType (new MarshalGen ("gunichar", "char", "uint", "GLib.Marshaller.CharToGUnichar ({0})", "GLib.Marshaller.GUnicharToChar ({0})")); AddType (new MarshalGen ("gunichar", "char", "uint", "GLib.Marshaller.CharToGUnichar ({0})", "GLib.Marshaller.GUnicharToChar ({0})"));
AddType (new MarshalGen ("time_t", "System.DateTime", "IntPtr", "GLib.Marshaller.DateTimeTotime_t ({0})", "GLib.Marshaller.time_tToDateTime ({0})")); AddType (new MarshalGen ("time_t", "System.DateTime", "IntPtr", "GLib.Marshaller.DateTimeTotime_t ({0})", "GLib.Marshaller.time_tToDateTime ({0})"));

View File

@ -38,13 +38,13 @@ namespace GLib {
[DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] [DllImport ("libglib-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
static extern void g_main_context_ref (IntPtr raw); static extern void g_main_context_ref (IntPtr raw);
internal MainContext (IntPtr raw) public MainContext (IntPtr raw)
{ {
handle = raw; handle = raw;
g_main_context_ref (handle); g_main_context_ref (handle);
} }
internal IntPtr Handle { public IntPtr Handle {
get { get {
return handle; return handle;
} }