[Gtk-sharp-list] Re: GTypeInstances other than GObject (needed forgst-sharp work I'm doing)

Eric Moret eric.moret at gmail.com
Mon Apr 24 03:10:25 EDT 2006


Hi Pete,

I was wondering if you had made any progress on your effort to create 
gstreamer 0.10 bindings for mono?

Regards,
__
Eric

"Peter Johanson" <latexer at gentoo.org> wrote in message 
news:20060305192027.GG11443 at butchest.cubesearch.com...
> hey folks,
>
> So unbeknownst to me before, about a week and half ago, libgobject
> actually provides a mechanism for folks to create their own base object
> types other than GObject, via GTypeInstance:
>
> <snip from gtype.h>
> typedef struct _GTypeClass              GTypeClass;
> typedef struct _GTypeInstance           GTypeInstance;
> .
> .
> .
> /* Basic Type Structures
> */
> struct _GTypeClass
> {
>  /*< private >*/
>  GType g_type;
> };
> struct _GTypeInstance
> {
>  /*< private >*/
>  GTypeClass *g_class;
> };
> </snip>
>
> And lo and behold, both GObject, and gstreamer's recently discovered
> "GstMiniObject" are GTypeInstances. GstMiniObject is used as a
> lightweight object base for a few types in gstreamer, GstMessage,
> GstBuffer, GstEvent, and GstQuery (so far).
>
> Why should gtk-sharp-list care? Well, GAPI2 needs some changes in order
> to properly generate code for classes with base GTypeInstance *other*
> than GObject. Mainly, there are places where "GLib.Object.GetObject (raw)"
> really needs to be "Gst.MiniObject.GetObject (raw)" as I've had to
> duplicate a lot of the GLib.Object logic for object instantiation,
> ref-ing, etc in Gst.MiniObject.
>
> The attached patch is the *wrong* way to do this in GAPI2, but I needed
> something to get to the 'is this actually gonna work' stage with my
> gst-sharp work.
>
> With that patch applied, my current work so far on gst-sharp (found in
> a bazaar branch for now, that's not going to be the final development
> home for this hopefully) found here:
> http://www.peterjohanson.com/bazaar/gst-sharp/gst-sharp--dev--0.10/ will
> compile, and the small sample runs with no issues. Folks without bazaar
> can get a snapshot tarball here:
> http://www.peterjohanson.com/files/gst-sharp-0.9.5.99.tar.gz
>
> So, after a long and drawn out email:
>
> What is the best way to go about providing this functionality in GAPI2?
> Is this beyond what should be offered? Some ideas from me where a
> "IGTypeInstance" interface in glib-sharp that both GObject and other
> GTypeInstances would implement, but one can't specify the static
> "GetObject" method there, so that's not perfect.
>
> Thoughts?
>
> -pete
>
> -- 
> Peter Johanson
> <latexer at gentoo.org>
>


--------------------------------------------------------------------------------


> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
> 





More information about the Gtk-sharp-list mailing list