Re: Comments on GTK+ patches from Atk tarball

Hi Folks:

I have been thinking about Owen's observation regarding class 
initialization overhead.

I do not see a good way around our need for multiple factories, 
associated with widget classes.  (Note that we expect perhaps 30-40 
AtkAccessibleFactory instances to provide coverage for the whole GTK+ 
widget set, so there will not be one AtkAccessibleFactory per widget 
class since some classes can inherit their factory instance, and some 
widget classes that are not direct descendants may nonetheless share a 

However we may be able to implement our multiple factory model in a way 
that doesn't force widget class initialization for each widget class 
which is associated with a particular AtkAccessibleFactory.  

Probably this would require some kind of registry which stores 
AtkAccessibleFactory instances keyed on GtkWidget class names.  Then 

(1) the registry would be used whenever the factory create_accessible 
method is needed, by doing a classname lookup (instead of having an 
accessible_factory pointer in the GtkWidget class struct), or

(2) the accessible_factory pointer would be initialized only when a 
widget's class initialization code is called.

(1) would be perhaps simpler but less efficient,
(2) would be ideal but I'm not sure how we could implement it.  Remember 
that we don't want to hard-code the accessible factory associations 
inside GTK+, they should happen when the accessibility support module is 
loaded, and they need to be runtime-changeable.

Any ideas?



>> * The overhead of initializing every class in GTK+ is quite 
>>   large and we intentionally delay initialization until an
>>   instance of the class is created. So, I don't think
>>    gtk_widget_class_set_accessibility_factory()
>>   is a good idea; better to have a global factory.
>There isn't a global factory, there are many factories.  Different 
>factory instances must be associated with different classes, and 
>changeable at runtime, thus the method above is required.

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]