Re: Glib-Perl - GSList in a signal callback?
- From: Brett Kosinski <brettk frodo dyn gno org>
- To: muppet <scott asofyet org>
- Cc: gtk-perl mailing list <gtk-perl-list gnome org>
- Subject: Re: Glib-Perl - GSList in a signal callback?
- Date: Sun, 25 May 2003 22:39:41 -0600 (MDT)
do you have example code?
Well, first, I must say I haven't actually *tested* this to see what
happens. But I'm pretty certain Glib-Perl won't do the right thing.
The code exists in GStreamer and passes a GSList to a callback which
contains a list of strings. I'd provide the actual code, but I'm not sure
how useful that'd be.
If you're curious, it's in gstmultidisksrc.c, involving the NEW_FILE
signal. Basically, the signal parameter type is defined as
G_TYPE_POINTER, and the callbacks are expected to cast that to a GSList to
work with it.
GSList and GList fall under the category of "functionality that overlaps
with perl", so in general, GSList and GList are translated transparently
to perl lists.
that said, there is no special handling for GSList or GList in the
marshalling code (since they don't have GTypes). i don't recall seeing
list pointers in callback parameters, but that doesn't mean that it
can't happen. so, i can't really say anything without some example
code.
Well, like I say, I could show you the code, but it doesn't seem that
useful. The gist is that the parameter type is set to G_TYPE_POINTER in
the signal definition and then a GSList is passed in during the emit call.
But the Glib-Perl marshalling code is unable to determine the contents of
the pointer to figure out what to do with it (not that you can expect it
to... how can it know what a pointer is pointing to?).
Brett.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]