
    g
fT                         d Z dZdZdZdZddlZ ej                  dd       dd	lmZ ddl	m
Z
 ddlmZ dd
lmZ ddlmZ  G d dej"                        Zy)z$Id$z
$Revision$z$Date$zFCopyright (c) 2010 Joanmarie DiggsCopyright (c) 2011-2012 Igalia, S.L.LGPL    NAtspiz2.0)r   )AXObject)AXUtilitiesc                   (    e Zd ZdZd Zd Zd Zd Zy)BrailleGeneratorz3Provides a braille generator specific to WebKitGtk.c                 D    t         j                  j                  | |       y N)braille_generatorr   __init__)selfscripts     S/usr/lib/python3/dist-packages/orca/scripts/toolkits/WebKitGtk/braille_generator.pyr   zBrailleGenerator.__init__0   s    **33D&A    c                     g }| j                   j                  j                  |      }|j                  t        j
                  |z         |S r
   )_script	utilitiesheadingLevelappendobject_propertiesROLE_HEADING_LEVEL_BRAILLE)r   objresultlevels       r   __generateHeadingRolez&BrailleGenerator.__generateHeadingRole3   s>    &&33C8'BBUJKr   c                    t         j                  j                  t         j                  j                  t         j                  j                  g}t        j                  |      s\|j                  t         j                  j                  t         j                  j                  t         j                  j                  g       g }|j                  dt        j                  |            }|t         j                  j                  k(  r"|j                  | j                  |             |S ||vr|j                  t!        j"                  j$                  | |fi |       t        j&                  |      }t        j                  |      t         j                  j                  k(  r |j                  | j                  |             |S )z)Prevents some roles from being displayed.role)r   RoleFORMSECTIONUNKNOWNr   is_focusableextendLIST	LIST_ITEMPANELgetr   get_roleHEADING&_BrailleGenerator__generateHeadingRoler   r   _generateRoleName
get_parent)r   r   argsdoNotDisplayr   r   parents          r   r+   z"BrailleGenerator._generateRoleName:   sI    



**

**, '',!&!5!5!&!1!1!3 4 xx 1 1# 675::%%%MM$44S9:  %MM+<<NNc#!# $((-F  (EJJ,>,>>d88@Ar   c                     | j                   j                  j                  |      rg S t        j                  j
                  | |fi |S )aE  Returns an array of strings (and possibly voice and audio
        specifications) that represent the text of the ancestors for
        the object.  This is typically used to present the context for
        an object (e.g., the names of the window, the panels, etc.,
        that the object is contained in).  If the 'priorObj' attribute
        of the args dictionary is set, only the differences in
        ancestry between the 'priorObj' and the current obj will be
        computed.  The 'priorObj' is typically set by Orca to be the
        previous object with focus.
        )r   r   isWebKitGtkr   r   _generateAncestors)r   r   r-   s      r   r2   z#BrailleGenerator._generateAncestorsR   sG     <<!!--c2I 11DD# 	r   N)__name__
__module____qualname____doc__r   r*   r+   r2    r   r   r   r   -   s    =B0r   r   )__id____version____date____copyright____license__girequire_versiongi.repositoryr   orca.object_propertiesr   orca.braille_generatorr   orca.ax_objectr   orca.ax_utilitiesr   r   r7   r   r   <module>rD      sY   . 7 	   7E "  2 2 # )5(99 5r   