
    g
f                         d Z 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c mc mZ ddlmZ ddlmZ ddlmZ  G d dej(                        Zy)zCommonly-required utility methods needed by -- and potentially
   customized by -- application and toolkit scripts. They have
   been pulled out from the scripts because certain scripts had
   gotten way too large as a result of including these methods.z$Id$z
$Revision$z$Date$z#Copyright (c) 2010 Joanmarie Diggs.LGPL    NAtspiz2.0)r   )AXObject)AXTable)AXUtilitiesc                   .     e Zd Zd Z fdZ fdZ xZS )	Utilitiesc                 Z   | j                   j                  j                  |      sy t        j                  |      r|S t        j
                  |      sy t        j                  |      }t        j
                  |      r|}t        j                  |      }t        j                  |      r|S y N)	_scriptchatisInBuddyListr   is_expandableis_table_cellr   
get_parentget_previous_sibling)selfobjparent	candidates       K/usr/lib/python3/dist-packages/orca/scripts/apps/pidgin/script_utilities.pygetExpanderCellForzUtilities.getExpanderCellFor*   s    ||  ..s3$$S)J((-$$S)$$V,C11#6	$$Y/    c                    | j                   j                  j                  |      st        |   |      S t        j                  |      sg S t        j                  |      }|g S g }t        j                  |      \  }}|dz  }| j                  |      }t        |dz   t        j                  |d            D ]  }t        j                  |||      }t        j                  |      }	t        j                   |	t"        j$                  j&                        }
|
s`|
j)                  d      }| j+                  ||      r|j-                  |       | j                  |      |k  s |S  |S )ad  Gets all of the children that have RELATION_NODE_CHILD_OF pointing
        to this expanded table cell. Overridden here because the object
        which contains the relation is in a hidden column and thus doesn't
        have a column number.

        Arguments:
        -obj: the Accessible Object

        Returns: a list of all the child nodes
           F)prefer_attributer   )r   r   r   super
childNodesr   is_expandedr   	get_tableget_cell_coordinates	nodeLevelrangeget_row_countget_cell_atr   r   get_relationr   RelationTypeNODE_CHILD_OF
get_targetisSameObjectappend)r   r   r   nodesrowcolr"   icellnodeCellrelationnodeOf	__class__s               r   r   zUtilities.childNodes>   sI    ||  ..s37%c**&&s+I""3'>I//4S 	qNN3'	 sQw 5 5fu UV 	A&&vq#6D44T:H,,Xu7I7I7W7WXH((+F  f-T"'94	 r   c                     | j                   j                  j                  |      st        |   |      S t        |   t        j                  |            S r   )r   r   r   r   r"   r   r   )r   r   r4   s     r   r"   zUtilities.nodeLevelo   sF    ||  ..s37$S))w !>!>s!CDDr   )__name__
__module____qualname__r   r   r"   __classcell__)r4   s   @r   r	   r	   (   s    (/bE Er   r	   )__doc____id____version____date____copyright____license__girequire_versiongi.repositoryr   orca.scripts.toolkits.gtkscriptstoolkitsgtkorca.ax_objectr   orca.ax_tabler   orca.ax_utilitiesr   r	    r   r   <module>rK      sa   (C
 
5 	   7E "  ' ' # ! )KE KEr   