Re: gobject docs

Am Di, den 14.10.2003 schrieb Owen Taylor um 07:23:
> On Mon, 2003-10-13 at 20:41, Matthias Clasen wrote:
> > Hi all,
> > 
> > I've finally taken the time to fill in the api docs on closures. Since
> > most of the information has been obtained by staring at the source, I'd
> > be grateful for a little review. 
> Probably more than you wanted, but here's what I came up with reading
> through it :-) My suggested additions/replacements below were written
> rather quickly, so I definitely wouldn't use them without giving them
> a careful readthrough.

Thanks, Owen. I've incorporated most of your improvements

> ===
> The intro needs to go into more detail about how C marshallers are
> used in GObject and also link to glib-genmarshal.
> I don't think there is sufficient information here to really explain
> when/why you would call g_closure_set_marshal() yourself when writing
> a C library. I think a full example of a callback done with a closure
> would be a good idea, especially to show things like checking 
> if (G_CLOSURE_NEEDS_MARSHAL (closure)) {} before setting your own
> marshaller.

...except for this, as I'm not sure I understand it. Can you actually
use a closure without calling g_closure_set_marshal() on it ? I notice
that g_closure_invoke() has g_return_if_fail (closure->marshal ||
closure->meta_marshal); but the meta marshallers in gclosure.c all call
closure->marshal after doing their thing, so you end up needing
closure->marshal even if you have a meta marshaller.

Could you point me to a "full example of a callback done with a 
closure" ?


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