Re: [g-a-devel]Atktext for GtkHex Custom Widget.



>
>Hello,
>
>I am looking at providing accessibility for Ghex. This application has
>the following custom widget,
>
>Custom Widget : gtkhex
>Parent Class : GtkFixedClass
>
>gtkhex is the widget that is rendered on the main screen of the
>application when a file is opened. The hierarchy is as follows,
>
>   -> GtkHex
>          |---->GtkDrawingArea
>          |---->GtkDrawingArea
>          |---->GtkDrawingArea
>          |---->GtkVScrollbar
>
>The address offset, the Hex dump & the ASCII format of the selected file
>is loaded into the three drawing areas. The Hex dump & ASCII format form
>the editor.
>
>Apart from providing ATK relation between the drawing areas, I think
>AtkText & AtkEditableText needs to be implemented here.
>
>I am not clear at what level in the hierarchy I need to implement these
>interfaces.
>
>I thought I could do that at the GtkDrawing area level. But, from Bill's
>response to Stock Ticker applet accessibility, I have the following
>doubts:
>
>1. One approach is to implement AtkText on the GtkDrawingArea using a
>new subclass. But this would mean substantial changes to the application
>code where we need to provide separate initialization functions
>(class_init, get_type etc) for the new subclass.
>
>2. The other approach possibly is to override the get_accesible() method
>of the GtkDrawingArea? In this case too, a new subclass and a factory
>would be required. Am I right or is there a way to do this without using
>a new subclass and also not affecting other GtkDrawingAreas?

You can only override a virtual method at the class level, thus the same issues 
apply to overriding get_accessible for the GtkDrawingAreas.

At some point you must use a custom widget here.  GtkHex is itself a custom 
widget, is it not?  If so, then you can create a factory for GtkHex, or override 
get_accessible for GtkHexClass.

The GtkHexAccessible (which is an AtkObject subtype) would have special 
implementations for get_n_children and ref_child which returned appropriate 
AtkObject (subtype) instances for the various GtkDrawingAreas.

Creating subclasses for the GtkDrawingAreas (as mentioned above) is also an option 
and I think it is not as much work as your email seems to imply.

The simplest approach is probably to override get_accessible for the GtkHex custom 
widget, provide a special GtkAccessible subtype for GtkHex with special 
implementations for get_n_children and ref_child, and provide special AtkObject 
types for the drawing areas.  That assumes that GtkHex is a custom widget; if not, 
you will need to subclass the toplevel widget used by the GtkHex application to be 
one (to enable overriding of the virtual function get_accessible without replacing 
get_accessible for other toplevel widgets of the same type).

Best regards,

Bill


>Or is there another method I am unaware of? Please help me out on this.
>
>Regards,
>Hema.

------
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]