Re: [g-a-devel]Gnome-speech and the callbacks



Hi Draghi:

Just a quick note about the message below...

I think SPI_main enters the mainloop correctly and integrates the bonobo
event loop, so you should not need to call bonobo_main in your code.

Also, passing pointers or opaque data is not usually done with IDL
interfaces (it's technically problematic/unfeasible).  I suggest that
the object which implements the callback interface be the subject of
your enhancement, since it will normally be in-process with your
gnome-speech client and therefore can have additional native API.

So instead of using Marc's example 'callback.c', you would write a class
that allowed attaching multiple native-code callback routines.  This is
how the CSPI callback wrappers work, for instance; but in this case you
would write the equivalent code yourself.

The best approach is probably to write a callback.c that implements
GNOME_Speech_SpeechCallback, which is itself a GType/GObject class. 
That class can have an associated signal, and your native 'callback'
methods would be registered using the standard GObject signal handling
mechanisms.  You could of course write whatever wrappers around that
signal handling API you wished, if you preferred only to deal directly
with g_signal and/or g_closure once in your codebase.

regards,

-Bill

On Thu, 2003-01-16 at 14:50, Draghi Puterity wrote:
> Hi Marc,
> 
> I'm working to introduce the speech callbacks in Gnopernicus. From your GS
> test program I saw that you are making a bonobo_main() call after
> registering the SpeechCallback object in order to receive the speech events.
> When you call this you stay in this function until you call
> bonobo_main_quit() inside the callback function. Well, I can't do this in
> Gnopernicus, because we already have a "main loop"; it is the AT-SPI loop
> (entered by SPI_event_main()). So I need to somehow be able to instruct the
> AT-SPI loop (or something below it ?) to also fire the GS events. I don't
> know how to do that, and the available bonobo docs are kind of sparse ;), so
> please help me.
> 
> I also have two more observations:
> 
> - could you provide a second parameter to registerSpeechCallback named
> user_data of type gpointer? This would be an opaque pointer for you, that
> you just pass me back in each callback. The ideea is to simplify my client
> code when I want to associate more data to a callback.
> 
> - don't we need also an unregisterSpeechCallback? I saw two bonobo objects
> leaked in your demo code, and thought this might be the reason.
> 
> Best regards,
> Draghi
> 
> _______________________________________________
> Gnome-accessibility-devel mailing list
> Gnome-accessibility-devel gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel
-- 
Bill Haneman <bill haneman sun com>




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