internal static GType RegisterGObjectType(System.Type t) { GType parent_gtype = LookupGObjectType(t.BaseType); string name = BuildEscapedName(t); IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup(name); GTypeQuery query; g_type_query(parent_gtype.Val, out query); GTypeInfo info = new GTypeInfo(); info.class_size = (ushort)query.class_size; info.instance_size = (ushort)query.instance_size; GType gtype = new GType(g_type_register_static(parent_gtype.Val, native_name, ref info, 0)); GLib.Marshaller.Free(native_name); Register(gtype, t); return(gtype); }
internal static GType RegisterGObjectType(Object.ClassInitializer gobject_class_initializer) { GType parent_gtype = LookupGObjectType(gobject_class_initializer.Type.BaseType); string name = BuildEscapedName(gobject_class_initializer.Type); IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup(name); GTypeQuery query; g_type_query(parent_gtype.Val, out query); GTypeInfo info = new GTypeInfo(); info.class_size = (ushort)query.class_size; info.instance_size = (ushort)query.instance_size; info.class_init = gobject_class_initializer.ClassInitManagedDelegate; GType gtype = new GType(g_type_register_static(parent_gtype.Val, native_name, ref info, 0)); GLib.Marshaller.Free(native_name); Register(gtype, gobject_class_initializer.Type); return(gtype); }
static extern IntPtr g_type_register_static(IntPtr parent, IntPtr name, ref GTypeInfo info, int flags);
internal static GType RegisterGObjectType(System.Type t) { GType parent_gtype = LookupGObjectType (t.BaseType); string name = BuildEscapedName (t); IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name); GTypeQuery query; g_type_query (parent_gtype.Val, out query); GTypeInfo info = new GTypeInfo (); info.class_size = (ushort) query.class_size; info.instance_size = (ushort) query.instance_size; GType gtype = new GType (g_type_register_static (parent_gtype.Val, native_name, ref info, 0)); GLib.Marshaller.Free (native_name); Register (gtype, t); return gtype; }
internal static GType RegisterGObjectType(Object.ClassInitializer gobject_class_initializer) { GType parent_gtype = LookupGObjectType (gobject_class_initializer.Type.BaseType); string name = BuildEscapedName (gobject_class_initializer.Type); IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name); GTypeQuery query; g_type_query (parent_gtype.Val, out query); GTypeInfo info = new GTypeInfo (); info.class_size = (ushort) query.class_size; info.instance_size = (ushort) query.instance_size; info.class_init = gobject_class_initializer.ClassInitManagedDelegate; GType gtype = new GType (g_type_register_static (parent_gtype.Val, native_name, ref info, 0)); GLib.Marshaller.Free (native_name); Register (gtype, gobject_class_initializer.Type); return gtype; }
private static GType RegisterGType (System.Type t) { GType parent_gtype = LookupGType (t.BaseType); string name = BuildEscapedName (t); IntPtr native_name = Gst.GLib.Marshaller.StringToPtrGStrdup (name); GTypeQuery query; g_type_query (parent_gtype.Val, out query); GTypeInfo info = new GTypeInfo (); info.class_size = (ushort) query.class_size; info.instance_size = (ushort) query.instance_size; GType gtype = new GType (g_type_register_static (parent_gtype.Val, native_name, ref info, 0)); Gst.GLib.Marshaller.Free (native_name); Gst.GLib.GType.Register (gtype, t); ConnectDefaultHandlers (gtype, t); InvokeClassInitializers (gtype, t); return gtype; }