Re: g_signal_lookup for interfaces
- From: James Henstridge <james daa com au>
- To: Bill Haneman <Bill Haneman Sun COM>
- Cc: gtk-devel-list gnome org
- Subject: Re: g_signal_lookup for interfaces
- Date: Thu, 18 Oct 2001 12:26:31 +1000
Bill Haneman wrote:
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);
Calling the atk_text_get_type() function for your interface doesn't
guarantee your atk_text_base_init() function will be called (this is
delayed til the first time the interface is used (ie. getting the class
pointer for a type implementing the interface). Not sure how best to
force the interface to initialise though. For GObject subclasses, it is
as simple as:
class = g_type_class_ref(type);
id = g_signal_lookup(name, type);
...
g_type_class_unref(class);
James.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]