Re: [g-a-devel]AtkObject Life Cycle



Marc Mulcahy wrote:
> 
> What is the correct way to handle the following scenario?  An app, like
> gnome-volume-control, wants to assign accessible names to the accessibles
> representing some widgets in it.  Obviously, it calls
> gtk_widget_get_accessible and calls atk_object_set_name on the return
> value.  How does it ensure that the AtkObjects get destroyed?  

Hi Marc:

I think that the lifecycle should be the same regardless of whether an
app calls get_accessible or not.  At the moment, our AtkObjects are
cached by their host widgets (in effect) and get de-referenced when the
widget itself is destroyed.  So in the scenario above, the reference
count
of the AtkObjects is unaffected by the application code's call to
gtk_widget_get_accessible, and their lifecycle goes as normal.  Of
course,
the AtkObjects may be created on demand in that scenario if the app code
is the first piece of code to request the AtkObject, but in any case the
AtkObject will persist until the widget dies.

For apps that create AtkObjects directly for some reason (as may happen
with certain kinds of custom widget support) then the app will take on
the responsibility for managing the lifecycle of AtkObjects that are not
obtained via gtk_widget_get_accessible().

In the case of accessibles returned via the ..._ref_accessible sorts of
calls, the caller is already responsible for dereferencing when done.

Hope that answers your question...

-Bill

> Does it need
> to cache copies of all the AtkObjects it creates with
> gtk_widget_get_accessible so it can unref them, or is there some easier
> approach?  Refcounting is more straightforward when the assistive
> technology invokes the creation of accessibles, but seems a bit more merky
> when the applications themselves create them.
> 
> Marc
> 
> _______________________________________________
> Gnome-accessibility-devel mailing list
> Gnome-accessibility-devel gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel



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