Re: Interface signals



Hi,

Bill Haneman <bill haneman sun com> writes:

> Hi folks:
> 
> You may recall that you can't look up signals for interface types that
> haven't got any live implementors yet.  However we need to do just this
> in the at-spi code, when registering emission hooks for those signals.
> 
> Revisiting this issue, the workaround that i've been using, which is
> calling the type init code:
> 
> GType t = ATK_TYPE_TEXT;
> 
> has stopped working.
> 
> Does anyone know why this is, and what the current workaround should
> be?  For various reasons it is not feasible to instantiate an instance
> of an implementing class since those classes are private and not know to
> the emission hook listener.

there might be other reasons, but since most _get_type() functions are
declared G_GNUC_CONST, the compiler is allowed to optimize your code 
away completely. You should do something like the following instead.

  GType type;

  type = FOO_GET_TYPE;
  g_type_class_ref (type);


Salut, Sven



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