[Gtk-sharp-list] Upcoming problems.

Mike Kestner mkestner@speakeasy.net
27 May 2003 17:21:53 -0500


On Tue, 2003-05-27 at 16:33, Rachel Hestilow wrote:

> 1) I created a new ConstStringGen class which sets MarshalReturnType to
> IntPtr and outputs a call to PtrToStringAuto in FromNativeReturn.

> Combined with an audit of the glue, glib, and .custom sources, we're
> left with 50 other functions which, on cursory glance, all return new
> strings. So no metadata hacking is required.

Sounds good. No patch was attached, so I'm wondering if you subclassed
SimpleGen?  Seems like that should be doable, since only the one prop
and one method changed. 

If a more-than-cursory-glance at the remaining funcs indicates a
"should-be-static" string, we can always just add const- to the type
instead of going with some new tag.

It doesn't sound like you addressed Paolo's g_free concern though.  We
probably need to add a SringGen class that also uses MarshalReturnType
of IntPtr and PtrToStringAnsi, but additionally calls g_free on the
IntPtr. Then we can map the non-const strings to that IGeneratable.
Sounds like a subclass overriding just the FromNativeReturn method of
your ConstStringGen class.

> All in all, I'm impressed with the generator refactoring, the actual
> generator modifications only took half an hour. Kudos on the great
> design, Mike.

Thanks. :)

> Shall I commit?

Do you have time to incorporate the above too?  Let me know.  If not,
you can commit what you have now and I'll try to get to the rest
tonight.

Thanks for the patch.

Mike