Re: [PATCH] Add GType entries to Glib typemap

you're using gperl_object_type_from_package as the global typemap for
GTypes, but there are two registries for GTypes in the perl bindings
object types, and boxed types.  that is, stuff registered via

Whoops... my mistake.

gperl_register_object and gperl_register_boxed use two distinct private
mappings between GTypes and packages.  with a typemap you can't
guarantee which type you're always getting!

Hrm... that is problematic...

so, i would say that a typemap isn't an appropriate approach.  you'd be better
off minimizing the number of places where a GType is needed in your API, and
handling those manually.  this is how Glib and Gtk2 do it.

having said all that, in what context do you need the GType?

There are a variety of methods in the GStreamer APIs which takes GTypes as
part of their function definition.  For example:

GstPluginFeature *
gst_plugin_find_feature(GstPlugin *plugin, gchar *name, GType type)

And there are others.  For example, there are a couple of factories which
take GType instances as part of their constructor.  There aren't a lot,
but the few are problematic.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]