Re: Passing in GTypes as parameters...



On Sunday, July 20, 2003, at 06:46  PM, muppet wrote:


On Sunday, July 20, 2003, at 06:17  PM, Brett Kosinski wrote:

Thus, unfortunately, I can think of no way to wrap this except to pass in
GType's into the functions somehow.

in many cases it's your only option, so you do what you gotta do. a typemap for GType does not belong in Glib itself because the cases in which you need to interface with GTypes should be handled directly. a single typemap isn't appropriate, because the package-to-gtype bindings are not universal. there are no typemaps for GEnums or GFlags, for example.

So... any ideas on how to deal with this? :)

you just pass the package name in the spots where you can't do without a GType. narrow things down as much as possible, so you can do the best error checking possible. for example, if you are working with a factory that creates GBoxed objects, then use gperl_boxed_type_from_package, but if you are using a GObject factory, use gperl_object_type_from_package.





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