Re: gobject docs
- From: Owen Taylor <otaylor redhat com>
- To: Matthias Clasen <maclas gmx de>
- Cc: gtk-devel-list gnome org
- Subject: Re: gobject docs
- Date: Tue, 14 Oct 2003 19:21:49 -0400
On Tue, 2003-10-14 at 19:01, Matthias Clasen wrote:
> > ===
> > 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.
The point is that if the closure already has a marshaller - say, because
it's a language-binding closure, then you don't want to override it.
with a C-function marshaller.
> Could you point me to a "full example of a callback done with a
> closure" ?
You can look at gobject/gsourceclosure.c, though that has some
non-essential complications related to the the fact that we are
installing closures for callbacks in libglib.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]