g_signal_lookup for interfaces



Hi:

I guess this one is for you, Tim...

We have defined a number of signals in ATK on interfaces.  We know we 
can't define properties on interfaces now, but we have been using 
signals on interfaces, which is supported.

However in order to intercept these signals we need to register an 
emission hook.  In the bridge to at-spi this is done via a string-based 
register call containing the names of the signal and type.
[where type_name = "AtkText", signal_name = "text-caret-moved"]

GType *type = g_type_from_name(type_name);

However, if we call 

g_signal_lookup (signal_name, type); 

we get an error from g_signal_lookup saying that it cannot lookup 
signals for non-instantiable types.

I have been looking at gsignal.c, it seems that the error is only 
printed if the signal lookup actually fails to return a non-null 
signal_id.  It's not clear to me why the lookup fails, seems like the 
intention was for it to work for interfaces. 

Could you help me diagnose the problem?  If I hard-code a call to 
g_signal_new() just before my lookup, to make sure the new signal is 
registered when I make the call, no diagnostics are printed...

-Bill

------
Bill Haneman x19279
Gnome Accessibility / Batik SVG Toolkit
Sun Microsystems Ireland 




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