예제 #1
0
파일: GType.cs 프로젝트: shana/gtk-sharp
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 static extern IntPtr g_type_register_static(IntPtr parent, IntPtr name, ref GTypeInfo info, int flags);
예제 #4
0
 static extern IntPtr g_type_register_static(IntPtr parent, IntPtr name, ref GTypeInfo info, int flags);
예제 #5
0
 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;
 }
예제 #6
0
파일: GType.cs 프로젝트: Zekom/gtk-sharp
        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;
        }
예제 #7
0
파일: MiniObject.cs 프로젝트: jwzl/ossbuild
    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;
    }