%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/orca/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/orca/__pycache__/ax_object.cpython-312.pyc

�

g
f�����dZdZdZdZdZdZddlZddlZddlZddl	Z	e	jdd	�dd
lmZddl
mZGd
�d�Zej!�y)a�
Utilities for obtaining information about accessible objects.
These utilities are app-type- and toolkit-agnostic. Utilities that might have
different implementations or results depending on the type of app (e.g. terminal,
chat, web) or toolkit (e.g. Qt, Gtk) should be in script_utilities.py file(s).

N.B. There are currently utilities that should never have custom implementations
that live in script_utilities.py files. These will be moved over time.
z$Id$z
$Revision$z$Date$zCopyright (c) 2023 Igalia, S.L.�LGPL�N�Atspiz2.0)r�)�debugc�t�eZdZdZiZiZiZiZej�Z
ed��ZedUd��Z
edUd��Zed��Zed��Zed��Zed��Zed	��Zed
��Zed��Zed��Zed
��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Zed��Z ed��Z!ed��Z"ed��Z#ed��Z$ed��Z%ed��Z&ed��Z'ed��Z(ed��Z)ed ��Z*ed!��Z+ed"��Z,ed#��Z-ed$��Z.ed%��Z/edVd'��Z0ed(��Z1ed)��Z2ed*��Z3ed+��Z4ed,��Z5ed-��Z6ed.��Z7ed/��Z8ed0��Z9edWd1��Z:ed2��Z;ed3��Z<ed4��Z=ed5��Z>ed6��Z?ed7��Z@ed8��ZAed9��ZBed:��ZCed;��ZDedWd<��ZEed=��ZFedWd>��ZGed?��ZHed@��ZIedA��ZJedB��ZKedXdC��ZLedD��ZMedE��ZNedYdF��ZOedYdG��ZPedH��ZQedI��ZRedJ��ZSedK��ZTedL��ZUedM��ZVedN��ZWedO��ZXedP��ZYedQ��ZZedR��Z[edS��Z\edT��Z]y&)Z�AXObjectz=Utilities for obtaining information about accessible objects.c�X�	tjd�tj��*)z*Clears any data we have cached for objects�<)�time�sleepr�_clear_all_dictionaries���0/usr/lib/python3/dist-packages/orca/ax_object.py�_clear_stored_datazAXObject._clear_stored_data:s#����J�J�r�N��,�,�.�rc��d}|r|d|��z
}tjtj|d�tj5dttj�dg}tjtj|d�tjj�dttj�dg}tjtj|d�tjj�dttj�dg}tjtj|d�tjj�d	ttj�dg}tjtj|d�tjj�ddd�y#1swYyxYw)
NzAXObject: Clearing local cache.�	 Reason: Tz0AXObject: Clearing known dead-or-alive state for�objectszAXObject: Clearingzreal apps for mutter frameszreal frames for mutter framesz/AXObject: Clearing cached object attributes for)r�printMessage�
LEVEL_INFOr�_lock�len�
KNOWN_DEAD�printTokens�clear�REAL_APP_FOR_MUTTER_FRAME�REAL_FRAME_FOR_MUTTER_FRAME�OBJECT_ATTRIBUTES)�reason�msg�tokenss   rr
z AXObject._clear_all_dictionariesBs`��/����Y�v�h�'�'�C�
���5�+�+�S�$�7�
�^�^�	/�H��H�/�/�0�)�=�F����e�.�.���=����%�%�'�*�C��0R�0R�,S�5�7�F����e�.�.���=��.�.�4�4�6�*�C��0T�0T�,U�7�9�F����e�.�.���=��0�0�6�6�8�G��H�6�6�7��D�F����e�.�.���=��&�&�,�,�.�'	/�	/�	/�s
�E=G�Gc�.�tj|�y)z*Clears all cached information immediately.N)rr
)rs r�clear_cache_nowzAXObject.clear_cache_now^s��	�(�(��0rc�z�tjtj��}d|_|j�y)z3Starts thread to periodically clear cached details.)�targetTN)�	threading�Threadrr�daemon�start)�threads r�start_cache_clearing_threadz$AXObject.start_cache_clearing_threadds*���!�!��)D�)D�E����
����rc��tj|�tjjk(r�tjtj|��tjjk(r\tjj|�j�dk(r,d|dg}tjtj|dd�yy)z<Hack to ignore certain objects. All entries must have a bug.�gecko�	AXObject:z"is bogus. See mozilla bug 1879750.TF)
r�get_roler�Role�SECTION�
get_parent�FRAME�
Accessible�get_toolkit_name�lowerrrr)�objr!s  r�is_boguszAXObject.is_bogusls������S�!�U�Z�Z�%7�%7�7�� � ��!4�!4�S�!9�:�e�j�j�>N�>N�N����0�0��5�;�;�=��H�!�3�(L�M�F����e�.�.���d�C��rc�:�|duxstj|�S)z;Returns False if we know for certain this object is invalidN)r�object_is_known_dead�r7s r�is_validzAXObject.is_valid}s!���4�K�E�8�#@�#@��#E�F�Frc�^�|xr*tjjt|��duS)z@Returns True if we know for certain this object no longer existsT)rr�get�hashr;s rr:zAXObject.object_is_known_dead�s)���A�x�*�*�.�.�t�C�y�9�T�A�Arc�N�|�ytjjt|��}||k(ry|tjt|�<|r)d}t	j
tj|dd�y|r+d|dg}t	jtj|d�yy)z$Updates the known-dead status of objNz&AXObject: Adding to known dead objectsTzAXObject: Removingzfrom known-dead objects)rrr>r?rrrr)r7�is_dead�current_statusr r!s     r�_set_known_dead_statuszAXObject._set_known_dead_status�s����;��!�,�,�0�0��c��;���W�$��)0����D��I�&��:�C����u�/�/��d�D�A���*�C�1J�K�F����e�.�.���=�rc� �t|�}tjd|�r8|j|d�}t	j
tj|d�nttjd|�r8|j|d�}t	j
tj|d�n&t	j
tj|d�ytjjt|��durtj|d�yy)z?Parses the exception and potentially updates our status for objzaccessible/\d+ does not existzobject no longer existsTz The application no longer existszapp no longer existsNF)�str�re�search�replacerrrrrr>r?rC�r7�errorr s   r�handle_errorzAXObject.handle_error�s����E�
��
�9�9�5�u�=��+�+�e�%>�?�C����u�/�/��d�;�
�Y�Y�:�E�
B��+�+�e�%;�<�C����u�/�/��d�;����u�/�/��d�;�����"�"�4��9�-��6��+�+�C��6�7rc���tj|�sy	tjj	|�}|duS#t
$r)}d|�d|��}tj
|||�Yd}~yd}~wwxYw)z8Returns True if the action interface is supported on objFz0AXObject: Exception calling get_action_iface on �: N)rr<rr4�get_action_iface�	ExceptionrK�r7�ifacerJr s    r�supports_actionzAXObject.supports_action�sv��� � ��%��	��$�$�5�5�c�:�E��D� � ���	�D�S�E��E�7�S�C��!�!�#�u�c�2���	���;�	A-�A(�(A-c��tj|�sytjtj|��}|dvr+d|dg}t	j
tj|d�y	tjj|�}|duS#t$r)}d|�d|��}tj|||�Yd}~yd}~wwxYw)	z<Returns True if the collection interface is supported on objF)�sofficezAXObject: Treatingzas not supporting collection.Tz4AXObject: Exception calling get_collection_iface on rMN)rr<�get_name�get_applicationrrrrr4�get_collection_ifacerOrK)r7�app_namer!rQrJr s      r�supports_collectionzAXObject.supports_collection�s���� � ��%���$�$�X�%=�%=�c�%B�C���{�"�*�H�6U�V�F����e�.�.���=��	��$�$�9�9�#�>�E��D� � ���	�H���R�PU�w�W�C��!�!�#�u�c�2���	�s�/B�	C�B?�?Cc���tj|�sy	tjj	|�}|duS#t
$r)}d|�d|��}tj
|||�Yd}~yd}~wwxYw)z;Returns True if the component interface is supported on objFz3AXObject: Exception calling get_component_iface on rMN)rr<rr4�get_component_ifacerOrKrPs    r�supports_componentzAXObject.supports_component��v��� � ��%��	��$�$�8�8��=�E��D� � ���	�G��u�B�u�g�V�C��!�!�#�u�c�2���	�rSc���tj|�sy	tjj	|�}|duS#t
$r)}d|�d|��}tj
|||�Yd}~yd}~wwxYw)z:Returns True if the document interface is supported on objFz2AXObject: Exception calling get_document_iface on rMN)rr<rr4�get_document_ifacerOrKrPs    r�supports_documentzAXObject.supports_document�sv��� � ��%��	��$�$�7�7��<�E��D� � ���	�F�s�e�2�e�W�U�C��!�!�#�u�c�2���	�rSc���tj|�sy	tjj	|�}|duS#t
$r)}d|�d|��}tj
|||�Yd}~yd}~wwxYw)z?Returns True if the editable-text interface is supported on objFz7AXObject: Exception calling get_editable_text_iface on rMN)rr<rr4�get_editable_text_ifacerOrKrPs    r�supports_editable_textzAXObject.supports_editable_text�sy��� � ��%��	��$�$�<�<�S�A�E��D� � ���	�K�C�5�PR�SX�RY�Z�C��!�!�#�u�c�2���	�rSc���tj|�sy	tjj	|�}|duS#t
$r)}d|�d|��}tj
|||�Yd}~yd}~wwxYw)z;Returns True if the hyperlink interface is supported on objFz-AXObject: Exception calling get_hyperlink on rMN)rr<rr4�
get_hyperlinkrOrKrPs    r�supports_hyperlinkzAXObject.supports_hyperlinksv��� � ��%��	��$�$�2�2�3�7�E��D� � ���	�A�#��b���P�C��!�!�#�u�c�2���	�rSc���tj|�sy	tjj	|�}|duS#t
$r)}d|�d|��}tj
|||�Yd}~yd}~wwxYw)z;Returns True if the hypertext interface is supported on objFz3AXObject: Exception calling get_hypertext_iface on rMN)rr<rr4�get_hypertext_ifacerOrKrPs    r�supports_hypertextzAXObject.supports_hypertextr^rSc���tj|�sy	tjj	|�}|duS#t
$r)}d|�d|��}tj
|||�Yd}~yd}~wwxYw)z7Returns True if the image interface is supported on objFz/AXObject: Exception calling get_image_iface on rMN)rr<rr4�get_image_ifacerOrKrPs    r�supports_imagezAXObject.supports_image'�v��� � ��%��	��$�$�4�4�S�9�E��D� � ���	�C�C�5��5�'�R�C��!�!�#�u�c�2���	�rSc���tj|�sy	tjj	|�}|duS#t
$r)}d|�d|��}tj
|||�Yd}~yd}~wwxYw)z;Returns True if the selection interface is supported on objFz3AXObject: Exception calling get_selection_iface on rMN)rr<rr4�get_selection_ifacerOrKrPs    r�supports_selectionzAXObject.supports_selection7r^rSc���tj|�sy	tjj	|�}|duS#t
$r)}d|�d|��}tj
|||�Yd}~yd}~wwxYw)z7Returns True if the table interface is supported on objFz/AXObject: Exception calling get_table_iface on rMN)rr<rr4�get_table_ifacerOrKrPs    r�supports_tablezAXObject.supports_tableGrnrSc���tj|�sy	tjj	|�}|duS#t
$r)}d|�d|��}tj
|||�Yd}~yd}~wwxYw)z<Returns True if the table cell interface is supported on objFz.AXObject: Exception calling get_table_cell on rMN)rr<rr4�get_table_cellrOrKrPs    r�supports_table_cellzAXObject.supports_table_cellWsv��� � ��%��	��$�$�3�3�C�8�E��D� � ���	�B�3�%�r�%��Q�C��!�!�#�u�c�2���	�rSc���tj|�sy	tjj	|�}|duS#t
$r)}d|�d|��}tj
|||�Yd}~yd}~wwxYw)z6Returns True if the text interface is supported on objFz.AXObject: Exception calling get_text_iface on rMN)rr<rr4�get_text_ifacerOrKrPs    r�
supports_textzAXObject.supports_textgsv��� � ��%��	��$�$�3�3�C�8�E�
�D� � ��	�	�B�3�%�r�%��Q�C��!�!�#�u�c�2���	�rSc���tj|�sy	tjj	|�}|duS#t
$r)}d|�d|��}tj
|||�Yd}~yd}~wwxYw)z7Returns True if the value interface is supported on objFz/AXObject: Exception calling get_value_iface on rMN)rr<rr4�get_value_ifacerOrKrPs    r�supports_valuezAXObject.supports_valuevrnrSc�T�tj|�sytjdftjdftjdftj
dftjdftjdftjdftjd	ftjd
ftjdftjdftjd
ftjdfg
}|D��cgc]\}}||�s�|��}}}dj|�Scc}}w)z3Returns the supported interfaces of obj as a string��Action�
Collection�	Component�Document�EditableText�	Hyperlink�	Hypertext�Image�	Selection�Table�	TableCell�Text�Value�, )rr<rRrZr]rardrgrjrmrqrtrwrzr}�join)r7�iface_checks�checkrQ�ifacess     r�supported_interfaces_as_stringz'AXObject.supported_interfaces_as_string�s��� � ��%���
%�
%�x�0�
�
)�
)�<�8�
�
(�
(�+�6�
�
'�
'��4�
�
,�
,�n�=�
�
(�
(�+�6�
�
(�
(�+�6�
�
$�
$�g�.�
�
(�
(�+�6�
�
$�
$�g�.�
�
)�
)�;�7�
�
#�
#�V�,�
�
$�
$�g�.�
�� -9�G�L�E�5�E�#�J�%�G��G��y�y�� � ��Hs�;D$�D$c�\�tj|�sgSg}|}|rG	|jtjj|��tj|�}|r�G|j�|S#t$r+}d|�d|��}tj|||�gcYd}~Sd}~wwxYw)zAReturns the path from application to obj as list of child indicesz0AXObject: Exception getting index in parent for rMN)
rr<�appendrr4�get_index_in_parentrOrK�get_parent_checked�reverse)r7�path�accrJr s     r�get_pathzAXObject.get_path�s���� � ��%��I������
����E�,�,�@�@��E�F�
�-�-�c�2�C��	
��������
�H���R�PU�w�W���%�%�c�5�#�6��	��
�s�.A7�7	B+� B&� B+�&B+c���tj|�sy	tjj	|�}|S#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)z0Returns the child index of obj within its parent���z,AXObject: Exception in get_index_in_parent: N)rr<rr4r�rOrK)r7�indexrJr s    rr�zAXObject.get_index_in_parent�sj��� � ��%��	��$�$�8�8��=�E�����	�@���H�C��!�!�#�u�c�2���	���9�	A(�A#�#A(c� �tj|�sy	tjj	|�}||k(r+d|dg}tjtj|d�y|�stj|�tjjtjjfvr*d|dg}tjtj|d�|S#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)zBReturns the accessible parent of obj. See also get_parent_checked.Nz#AXObject: Exception in get_parent: r.zclaims to be its own parentTzclaims to have no parent)rr<rr4r2rOrKrrrr/r0�INVALID�
DESKTOP_FRAME)r7�parentrJr r!s     rr2zAXObject.get_parent�s���� � ��%��	��%�%�0�0��5�F��S�=�!�3�(E�F�F����e�.�.���=���>�� � ��%�e�j�j�.@�.@�%�*�*�BZ�BZ�-[�[�!�3�(B�C�F����e�.�.���=��
���	�7��w�?�C��!�!�#�u�c�2���	�s�C�	D
�'D�D
c	�f�tj|�sytj|�}|tjj
tjjfvrytj|�}|�ytjtjkr|Stj|�r|Stj|�}tj|�}|dks||k\r2d|d|d|d|dg	}tjtj|d�|Stj||�|S)	z9Returns the parent of obj, doing checks for tree validityNrr.z	has indexz; parent�has�childrenT)rr<r/rr0r��APPLICATIONr2rr�
debugLevelrAr��get_child_countr�get_active_descendant_checked)r7�roler�r��
n_childrenr!s      rr�zAXObject.get_parent_checked�s��� � ��%��� � ��%���E�J�J�&�&��
�
�(>�(>�?�?���$�$�S�)���>�����e�.�.�.��M����C� ��M��,�,�S�1���-�-�f�5�
��1�9���+�!�3��U� �&�%��Z�I�F����e�.�.���=��M�	�.�.�v�s�;��
rc�*�tj|�sy|g}tj|�}|rc||vr,d|d|g}tjtj
|d�y||�r|S|j
|�tj|�}|r�cy)z8Returns the ancestor of obj if the function pred is trueNz4AXObject: Circular tree suspected in find_ancestor. zalready in: T)rr<r�rrrr�)r7�predrr�r!s     r�
find_ancestorzAXObject.find_ancestors���� � ��%���%���,�,�S�1����� �P� �.�'�;���!�!�%�"2�"2�F�D�A���F�|��
��N�N�6�"��0�0��8�F��rc���tj|�sytj��sytj|�fd��duS)z.Returns true if ancestor is an ancestor of objFc���|�k(S�Nr)�x�ancestors �r�<lambda>z&AXObject.is_ancestor.<locals>.<lambda>#s���Q�(�]�rN)rr<r�)r7r�s `r�is_ancestorzAXObject.is_ancestors@���� � ��%��� � ��*���%�%�c�+B�C�4�O�Orc��tj|�sytj|�}|dkry|dk(r|dz
}d|cxkr|ksyy	tjj||�}||k(r+d|dg}tjtj|d�y|S#t$r&}d|��}tj|||�Yd}~yd}~wwxYw)	z9Returns the nth child of obj. See also get_child_checked.Nrr�rz"AXObject: Exception in get_child: r.zclaims to be its own childT)rr<r�rr4�get_child_at_indexrOrKrrr)r7r�r��childrJr r!s       r�	get_childzAXObject.get_child%s���� � ��%���-�-�c�2�
���?���B�;���N�E��E�&�J�&��'��	��$�$�7�7��U�C�E��C�<�!�3�(D�E�F����e�.�.���=������	�6�u�g�>�C��!�!�#�u�c�2���	�s� B�	C�&C�Cc�2�tj|�sytj||�}tjtj
kr|Stj
|�}||k7r-d|d|d|g}tjtj|d�|S)z<Returns the nth child of obj, doing checks for tree validityNr.�claimszas child; child's parent isT)rr<r�rrr�r2r)r7r�r�r�r!s     r�get_child_checkedzAXObject.get_child_checkedDs���� � ��%���"�"�3��.�����e�.�.�.��L��$�$�U�+���&�=�!�3��%�9V�X^�_�F����e�.�.���=��rc��tj|tjj�s|Stj|�}	tjj||�}||k7r1d|d|�d�|d|g}tjtj|d�|S#t$r(}d|��}tj|||�|cYd}~Sd}~wwxYw)zDChecks the reported active descendant and return the real/valid one.z6AXObject: Exception in get_active_descendant_checked: N�
AXObject: z's child at z is z; not reported childT)
r�	has_stater�	StateType�MANAGES_DESCENDANTSr�r4r�rOrKrrr)�	container�reported_childr��
real_childrJr r!s       rr�z&AXObject.get_active_descendant_checkedVs����!�!�)�U�_�_�-P�-P�Q�!�!��,�,�^�<��	"��)�)�<�<�Y��N�J���'�"�I��e�W�D�/I�:�,�n�>�F����e�.�.���=�����	"�J�5�'�R�C��!�!�)�U�C�8�!�!��	"�s� B�	C�(C�C�Cc��tj|�syttj|��D]K}tj	||�}|r||�r|cStj||�}|s�@||�s�I|cSy)�:Returns the descendant of obj if the function pred is trueN)rr<�ranger�r��_find_descendant)r7r��ir�s    rr�zAXObject._find_descendantlsy��� � ��%���x�/�/��4�5�	�A��.�.�s�A�6�E���e�����-�-�e�T�:�E���e����	�rc���tj�}tj||�}d|dtj�|z
d�d�g}tjtj
|d�|S)r�z AXObject: find_descendant: foundzin �.4f�sT)rrr�rrr)r7r�r)�resultr!s     r�find_descendantzAXObject.find_descendant~sd���	�	����*�*�3��5��4�f��D�I�I�K�RW�DW�X[�C\�\]�>^�_��
���%�*�*�F�D�9��
rc��tj|�sytj|tj|�dz
�}|�|Stj	|�S)z%Returns the deepest descendant of objNr)rr<r�r��find_deepest_descendant)r7�
last_childs  rr�z AXObject.find_deepest_descendant�sS��� � ��%���'�'��X�-E�-E�c�-J�Q�-N�O�
����J��/�/�
�;�;rc�"�tj|�sytj|�}t|�D]V}tj	||�}|r	||�r�$|r||�r|j|�tj
||||��Xy)�IReturns all descendants which match the specified inclusion and exclusionN)rr<r�r�r�r��_find_all_descendants)r7�
include_if�
exclude_if�matches�child_countr�r�s       rr�zAXObject._find_all_descendants�s���� � ��%���.�.�s�3���{�#�	S�A��&�&�s�A�.�E��j��/���j��/����u�%��*�*�5�*�j�'�R�
	SrNc��tj�}g}tj||||�dt|��dtj�|z
d�d�}t	j
tj|d�|S)r�z AXObject: find_all_descendants: z matches found in r�r�T)rrr�rrrr)�rootr�r�r)r�r s      r�find_all_descendantszAXObject.find_all_descendants�sv���	�	������&�&�t�Z��W�M�.�s�7�|�n�= � $�	�	��e� 3�C�8��
;�	�	���5�+�+�S�$�7��rc�h�tj|�stjjS	tj
j
|�}tj|d�|S#t$r@}d|��}tj|||�tjjcYd}~Sd}~wwxYw)z"Returns the accessible role of objz!AXObject: Exception in get_role: NF)
rr<rr0r�r4r/rOrKrC)r7r�rJr s    rr/zAXObject.get_role�s���� � ��%��:�:�%�%�%�	&��#�#�,�,�S�1�D�	�'�'��U�3����
�	&�5�e�W�=�C��!�!�#�u�c�2��:�:�%�%�%��	&�s�A(�(	B1�15B,�&B1�,B1c���tj|�sy	tjj	|�}|S#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)z'Returns the accessible role name of objrz&AXObject: Exception in get_role_name: N)rr<rr4�
get_role_namerOrK)r7�	role_namerJr s    rr�zAXObject.get_role_name�sk��� � ��%��	��(�(�6�6�s�;�I�����	�:�5�'�B�C��!�!�#�u�c�2���	�r�c��tj|�sy	tjj	|�}tj|d�|S#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)z"Returns the accessible name of objrz!AXObject: Exception in get_name: NF�rr<rr4rVrOrKrC)r7�namerJr s    rrVzAXObject.get_name�sz��� � ��%��	��#�#�,�,�S�1�D�	�'�'��U�3����
�	�5�e�W�=�C��!�!�#�u�c�2���	���A�	A>�A9�9A>c�b�tj|�}|sy|tj|�k(S)z;Returns true if obj1 and obj2 share the same non-empty nameF)rrV)�obj1�obj2�name1s   r�has_same_non_empty_namez AXObject.has_same_non_empty_name�s0���!�!�$�'������)�)�$�/�/�/rc���tj|�sy	tjj	|�}|S#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)z)Returns the accessible description of objrz(AXObject: Exception in get_description: N)rr<rr4�get_descriptionrOrK�r7�descriptionrJr s    rr�zAXObject.get_description�sk��� � ��%��	��*�*�:�:�3�?�K�����	�<�U�G�D�C��!�!�#�u�c�2���	�r�c���tj|�sy	tjj	|�}|S#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)z/Returns the accessible image description of objrz.AXObject: Exception in get_image_description: N)rrmrr��get_image_descriptionrOrKr�s    rr�zAXObject.get_image_description�si���&�&�s�+��	��+�+�;�;�C�@�K�����	�B�5�'�J�C��!�!�#�u�c�2���	�r�c��tj|�sy	tjj	|�}|j|jfS#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)z3Returns a (width, height) tuple of the image in obj)rrz'AXObject: Exception in get_image_size: N)	rrmrr��get_image_sizerOrKr��y)r7r�rJr s    rr�zAXObject.get_image_sizesv���&�&�s�+��	��[�[�/�/��4�F��x�x����!�!��
�	�;�E�7�C�C��!�!�#�u�c�2���	�r�c���tj|�sy	tjj	|�}|S#t
$rtj
|d�xsd}Y|SwxYw)z'Returns the accessible help text of objr�helptext)rr<rr4�
get_help_textrO�
get_attribute)r7�texts  rr�zAXObject.get_help_text sg��� � ��%��	A��#�#�1�1�#�6�D�
���	�	A��)�)�#�z�:�@�b�D���		A�s�9�#A �A c���tj|�sy	tjj	|�}|S#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)zReturns the child count of objrz(AXObject: Exception in get_child_count: N)rr<rr4r�rOrK�r7�countrJr s    rr�zAXObject.get_child_count0sj��� � ��%��	��$�$�4�4�S�9�E�����	�<�U�G�D�C��!�!�#�u�c�2���	�r�c#��K�tj|�sytj|�}t|�D]*}tj	||�}|��|�	||�s�'|���,y�w)z�Generator to iterate through obj's children. If the function pred is
        specified, children for which pred is False will be skipped.N)rr<r�r�r�)r7r�r�r�r�s     r�
iter_childrenzAXObject.iter_children@sd����
� � ��%���.�.�s�3���;�'�	�E��&�&�s�E�2�E�� �d�l�d�5�k���	�s�AA'�
A'� A'c�*�tj|�sytj|�}|�ytj|�}|dkrytj	||dz
�}||k(r+d|dg}tjt
j|d�y|S)z;Returns the previous sibling of obj, based on child indicesNrrr.�claims to be its own siblingT�rr<r2r�r�rrr�r7r�r��siblingr!s     r�get_previous_siblingzAXObject.get_previous_siblingNs���� � ��%���$�$�S�)���>���,�,�S�1���A�:���$�$�V�U�Q�Y�7���c�>�!�3�(F�G�F����e�.�.���=���rc�*�tj|�sytj|�}|�ytj|�}|dkrytj	||dz�}||k(r+d|dg}tjt
j|d�y|S)z7Returns the next sibling of obj, based on child indicesNrrr.r�Tr�r�s     r�get_next_siblingzAXObject.get_next_siblinges���� � ��%���$�$�S�)���>���,�,�S�1���1�9���$�$�V�U�Q�Y�7���c�>�!�3�(F�G�F����e�.�.���=���rc��tj|�sytj|�dz}tj|�}|rsd|cxkrtj	|�ksUn|}tj|�dz}tj|�}|r"d|cxkrtj	|�ks�Pn�S|�ytj||�}||k(r+d|dg}t
jtj|d�y|S)z?Returns the next object (depth first) in the accessibility treeNrrr.z claims to be its own next objectT�	rr<r�r2r�r�rrr)r7r�r��next_objectr!s     r�get_next_objectzAXObject.get_next_object|s���� � ��%���,�,�S�1�A�5���$�$�S�)���Q��I��)A�)A�&�)I�I��C��0�0��5��9�E��(�(��-�F��Q��I��)A�)A�&�)I�I�
�>���(�(���7���#��!�3�(J�K�F����e�.�.���=���rc��tj|�sytj|�dz
}tj|�}|ryd|cxkrtj	|�dz
ksXn|}tj|�dz
}tj|�}|r%d|cxkrtj	|�dz
ks�Sn�V|�ytj||�}||k(r+d|dg}t
jtj|d�y|S)zCReturns the previous object (depth first) in the accessibility treeNrrr.z$claims to be its own previous objectTr)r7r�r��previous_objectr!s     r�get_previous_objectzAXObject.get_previous_object�s���� � ��%���,�,�S�1�A�5���$�$�S�)���Q�%�N�(�*B�*B�6�*J�Q�*N�N��C��0�0��5��9�E��(�(��-�F��Q�%�N�(�*B�*B�6�*J�Q�*N�N�
�>��"�,�,�V�U�;���c�!�!�3�(N�O�F����e�.�.���=���rc�P�tj|�stj�S	tjj|�}tj|d�|S#t$r:}d|��}tj|||�tj�cYd}~Sd}~wwxYw)z)Returns the state set associated with objz&AXObject: Exception in get_state_set: NF)	rr<r�StateSetr4�
get_state_setrOrKrC)r7�	state_setrJr s    rr
zAXObject.get_state_set�s���� � ��%��>�>�#�#�	$��(�(�6�6�s�;�I�	�'�'��U�3����
�	$�:�5�'�B�C��!�!�#�u�c�2��>�>�#�#��	$�s�A"�"	B%�+/B �B%� B%c�v�tj|�sytj|�j|�S)z+Returns true if obj has the specified stateF)rr<r
�contains)r7�states  rr�zAXObject.has_state�s1��� � ��%���%�%�c�*�3�3�E�:�:rc��tj|�syd�}djt|tj	|�j���S)z5Returns the state set associated with obj as a stringrc�\�|jddjdd�j�S)N��_�-��
value_namerHr6)rs r�	as_stringz/AXObject.state_set_as_string.<locals>.as_string�s+���#�#�B�C�(�0�0��c�:�@�@�B�Brr�)rr<r��mapr
�
get_states�r7rs  r�state_set_as_stringzAXObject.state_set_as_string�sG��� � ��%��	C��y�y��Y��(>�(>�s�(C�(N�(N�(P�Q�R�Rrc���tj|�sgS	tjj	|�}|S#t
$r(}d|��}tj
|||�gcYd}~Sd}~wwxYw)z>Returns the list of Atspi.Relation objects associated with objz&AXObject: Exception in get_relations: N)rr<rr4�get_relation_setrOrK)r7�	relationsrJr s    r�
get_relationszAXObject.get_relations�so��� � ��%��I�	��(�(�9�9�#�>�I�����	�:�5�'�B�C��!�!�#�u�c�2��I��	�s�:�	A+�A&� A+�&A+c��tj|�sytj|�D]}|s�|j�|k(s�|cSy)z,Returns the specified Atspi.Relation for objN)rr<r!�get_relation_type)r7�
relation_type�relations   r�get_relationzAXObject.get_relation�sL��� � ��%�� �.�.�s�3�	 �H��H�6�6�8�M�I���	 �rc�^�tj|�sytj||�duS)z3Returns true if obj has the specified relation typeFN)rr<r&)r7r$s  r�has_relationzAXObject.has_relation�s-��� � ��%���$�$�S�-�8��D�Drc���tj|�sgStj||�}|�gSt�}t	|j��D]/}|j
|�}|�	||�s�|j|��1tjjg}||vrA||vr=d|d|dg}tjtj|d�|j|�t|�S)z�Returns the list of targets with the specified relation type to obj.
        If pred is provided, a target will only be included if pred is true.r�z
is in its ownztarget listT)rr<r&�setr��
get_n_targets�
get_target�addr�RelationType�	MEMBER_OFrrr�remove�list)	r7r$r�r%�targetsr�r%�type_includes_objectr!s	         r�get_relation_targetszAXObject.get_relation_targets�s���
� � ��%��I��(�(��m�<�����I��%���x�-�-�/�0�	$�A��(�(��+�F��|�t�F�|����F�#�	$�!&� 2� 2� <� <�=��� 4�4����"�C��-��W�F����e�.�.���=��N�N�3���G�}�rc�p��tj��syd�}�fd�}g}tj��D]m}||j��}tj	�|j��}djt
||��}|j|�d|����odj|�S)z5Returns the relations associated with obj as a stringrc�\�|jddjdd�j�S)N�rrr)r s rrz/AXObject.relations_as_string.<locals>.as_strings+���'�'���,�4�4�S�#�>�D�D�F�Frc���tj��}tj��}|r	|d|�d�z
}|sd}d|�d�S)Nz: '�'�DEAD�[�])rr�rV)r�r�r�r7s   �r�
obj_as_stringz3AXObject.relations_as_string.<locals>.obj_as_stringsN����+�+�C�0�F��$�$�S�)�D���C��v�Q�-�'������v�h�a�=� r�,rM�; )rr<r!r#r4r�rr�)r7rr=�results�rel�type_stringr2�
target_strings`       r�relations_as_stringzAXObject.relations_as_strings����� � ��%��	G�	!����)�)�#�.�	>�C�#�C�$9�$9�$;�<�K��3�3�C��9N�9N�9P�Q�G��H�H�S���%@�A�M��N�N�k�]�"�]�O�<�=�		>��y�y��!�!rc��|� 	tjj|�}tj
|�dk7r||fStjjt|��}tjjt|��}|�|�||fSd|d|g}tjtj|d�	tjd	�}tj
|�}tj|�D]R}	tj
|	�dk(r�tj|	�D]}
|tj
|
�k(s�|	}|
}�!�Td|d|g}tjtj|d�||k7r'd}tj tj|d�|tjt|�<|tjt|�<||fS#t$r)}d|�d|��}tj|||�Yd}~yd}~wwxYw#t$r3}d
|g}tjtj|d�Yd}~yd}~wwxYw)
z<Work around for window events coming from mutter-x11-frames.Nz+AXObject: Exception getting application of rM�NN�mutter-x11-framesr.zis not valid app forTrz/AXObject: Exception getting desktop from Atspi:zis real app forz.AXObject: Updated frame to frame from real app)rr4rWrOrrKrVrr>r?rrrr�get_desktopr�r)r7�apprJr �real_app�
real_framer!�desktopr��desktop_app�frames           r�find_real_app_and_window_forz%AXObject.find_real_app_and_window_for2s4���;�
"��&�&�6�6�s�;�����S�!�%8�8���8�O��5�5�9�9�$�s�)�D���9�9�=�=�d�3�i�H�
���J�$:��Z�'�'��s�$:�C�@��
���%�*�*�F�D�9�	��'�'��*�G�� � ��%��#�1�1�'�:�	'�K�� � ��-�1D�D��!�/�/��<�
'���8�,�,�U�3�3�*�H�!&�J�
'�	'��x�):�C�@��
���%�*�*�F�D�9����B�C����u�/�/��d�;�8@��*�*�4��9�5�:D��,�,�T�#�Y�7���#�#��S�
"�C�C�5��5�'�R���%�%�c�5�#�6�!��
"��$�	�G��O�F����e�.�.���=���	�s/�G*�H�*	H�3H�H�	I�()I�Ic��tj|�sytjjt	|��}|�|S	t
jj|�}tj|�dk7r|Stj||�d}|�|}|S#t$r&}d|��}tj|||�Yd}~yd}~wwxYw)z6Returns the accessible application associated with objNz(AXObject: Exception in get_application: rGr)rr<rr>r?rr4rWrOrKrVrO)r7rIrJr rJs     rrWzAXObject.get_applicationds���� � ��%���0�0�4�4�T�#�Y�?���?��J�	��"�"�2�2�3�7�C����S�!�%8�8��J��8�8��c�B�1�E�����C��
���	�<�U�G�D�C��!�!�#�u�c�2���	�s�B�	C�%C�Cc� �tj|�sytj|�}|�y	tjj|�}|S#t$r3}d|g}tjtj|d�Yd}~yd}~wwxYw)z8Returns the toolkit name reported for obj's application.rNz4AXObject: Exception in get_application_toolkit_name:T)
rr<rWrr4r5rOrrr)r7rIr�rJr!s     r�get_application_toolkit_namez%AXObject.get_application_toolkit_names���� � ��%���&�&�s�+���;��	��#�#�4�4�S�9�D�����	�L�e�T�F����e�.�.���=���	���A�	B
�)B�B
c� �tj|�sytj|�}|�y	tjj|�}|S#t$r3}d|g}tjtj|d�Yd}~yd}~wwxYw)z;Returns the toolkit version reported for obj's application.rNz7AXObject: Exception in get_application_toolkit_version:T)
rr<rWrr4�get_toolkit_versionrOrrr)r7rI�versionrJr!s     r�get_application_toolkit_versionz(AXObject.get_application_toolkit_version�s���� � ��%���&�&�s�+���;��	��&�&�:�:�3�?�G�����	�O�QV�W�F����e�.�.���=���	�rSc���tj|�sytj|�}|�ytj|��dtj	|��dtj|��d�}|S)z3Returns the application details of obj as a string.r� (� �))rr<rWrVrRrW)r7rI�strings   r�application_as_stringzAXObject.application_as_string�s}��� � ��%���&�&�s�+���;��� � ��%�&�'��5�5�c�:�;�1��7�7��<�=�Q�
@�	�
�
rc��|�yd|d|�d�g}|r|jd|���tjtj|d�|s!	tj
j
|�y	tj
j|�y#t$r4}d|��}tjtj|d�Yd}~yd}~wwxYw#t$r&}d|��}tj|||�Yd}~yd}~wwxYw)	z7Clears the Atspi cached information associated with objNz"AXObject: Clearing AT-SPI cache onzRecursive: �.rTz+AXObject: Exception in clear_cache_single: z$AXObject: Exception in clear_cache: )r�rrrrr4�clear_cache_singlerOr�clear_cacherrK)r7�	recursiverr!rJr s      rrazAXObject.clear_cache�s����;��6��{�9�+�UV�=W�X����M�M�I�f�X�.�/�
���%�*�*�F�D�9��
@�� � �3�3�C�8�
�	3����(�(��-��
�
@�C�E�7�K���"�"�5�#3�#3�S�$�?�?���
@���	3�8���@�C��!�!�#�u�c�2�2��	3�s0�B�,C�	C	�*C�C	�	C;�C6�6C;c���tj|�sy	tjj	|�}|S#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)z*Returns the process id associated with objr�z'AXObject: Exception in get_process_id: N)rr<rr4�get_process_idrOrK)r7�pidrJr s    rrdzAXObject.get_process_id�sj��� � ��%��	��"�"�1�1�#�6�C��
���	�;�E�7�C�C��!�!�#�u�c�2���	�r�c��|�ytj|�sy	tjj	|�tj|d�y#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)z6Returns true of obj exists but is believed to be dead.NFTzAXObject: Accessible is dead: r�rIs   rrAzAXObject.is_dead�s����;��� � ��%��	�
���%�%�c�*�	�'�'��U�3���
�	�2�5�'�:�C��!�!�#�u�c�2���	�s�A�	B�A;�;Bc�x�tj|�siS|r,tjjt	|��}|r|S	t
jj|�}|�iS|tjt	|�<|S#t$r(}d|��}tj|||�icYd}~Sd}~wwxYw)z5Returns the object attributes of obj as a dictionary.z,AXObject: Exception in get_attributes_dict: N)
rr<rr>r?rr4�get_attributesrOrK)r7�	use_cache�
attributesrJr s     r�get_attributes_dictzAXObject.get_attributes_dict�s���� � ��%��I��!�3�3�7�7��S�	�B�J��!�!�	��)�)�8�8��=�J����I�0:��"�"�4��9�-�����	�@���H�C��!�!�#�u�c�2��I��	�s�B�	B9�B4�.B9�4B9c�~�tj|�sytj||�}|j|d�S)z9Returns the value of the specified attribute as a string.r)rr<rkr>)r7�attribute_namerirjs    rr�zAXObject.get_attributes8��� � ��%���1�1�#�y�A�
��~�~�n�b�1�1rc��tj|�syd�}djt|tj	|�j���S)z1Returns the object attributes of obj as a string.rc��|d�d|d��S)Nr�:rr)�	attributes rrz0AXObject.attributes_as_string.<locals>.as_string#s����l�^�1�Y�q�\�N�3�3rr�)rr<r�rrk�itemsrs  r�attributes_as_stringzAXObject.attributes_as_stringsF��� � ��%��	4��y�y��Y��(D�(D�S�(I�(O�(O�(Q�R�S�Src���tj|�sy	tjj	|�}|S#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)z/Returns the number of actions supported on obj.rz&AXObject: Exception in get_n_actions: N)rrRrr��
get_n_actionsrOrKr�s    rruzAXObject.get_n_actions(sh���'�'��,��	��L�L�.�.�s�3�E�����	�:�5�'�B�C��!�!�#�u�c�2���	�r�c��|sytjdd|�j�}tjdd|�}|S)z?Adjusts the name to account for differences in implementations.rz(?<=[a-z])([A-Z])z-\1z"[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]r)rF�subr6)�action_namer�s  r�_normalize_action_namezAXObject._normalize_action_name8s>�����v�v�*�F�K�@�F�F�H���v�v�=�s�D�I���rc��d|cxkrtj|�ksyy	tjj	||�}tj|�S#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)z,Returns the name of obj's action at index i.rrz(AXObject: Exception in get_action_name: N)rrurr��get_action_namerOrKry)r7r�r�rJr s     rr{zAXObject.get_action_nameCs����A�3��.�.�s�3�3��4��	��<�<�/�/��Q�7�D��.�.�t�4�4���	�<�U�G�D�C��!�!�#�u�c�2���	�s� A�	B�!B�Bc��g}ttj|��D],}tj||�}|s�|j	|��.|S)z-Returns the list of actions supported on obj.)r�rrur{r�)r7r@r�r�s    r�get_action_nameszAXObject.get_action_namesSsP�����x�-�-�c�2�3�	%�A��+�+�C��3�D�����t�$�	%��rc���d|cxkrtj|�ksyy	tjj	||�}|S#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)z3Returns the description of obj's action at index i.rrz/AXObject: Exception in get_action_description: N)rrurr��get_action_descriptionrOrK)r7r�r�rJr s     rrzAXObject.get_action_description^s}���A�3��.�.�s�3�3��4��	��,�,�=�=�c�1�E�K�����	�C�E�7�K�C��!�!�#�u�c�2���	��� A�	A4�A/�/A4c���d|cxkrtj|�ksyy	tjj	||�}|S#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)z:Returns the key binding string of obj's action at index i.rrz/AXObject: Exception in get_action_key_binding: N)rrurr��get_key_bindingrOrK)r7r��
keybindingrJr s     r�get_action_key_bindingzAXObject.get_action_key_bindingns}���A�3��.�.�s�3�3��4��	����5�5�c�1�=�J�����	�C�E�7�K�C��!�!�#�u�c�2���	�r�c�4�tj||�dk\S)z5Returns true if the named action is supported on obj.r)r�get_action_index)r7rxs  r�
has_actionzAXObject.has_action~s���(�(��k�:�a�?�?rc��tj|�}ttj|��D]}|tj	||�k(s�|cSy)z;Returns the index of the named action or -1 if unsupported.r�)rryr�rur{)r7rxr�s   rr�zAXObject.get_action_index�sR���5�5�k�B���x�-�-�c�2�3�	�A��h�6�6�s�A�>�>���	�rc���d|cxkrtj|�ksyy	tjj	||�}|S#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)z�Invokes obj's action at index i. The return value, if true, may be
        meaningless because most implementors return true without knowing if
        the action was successfully performed.rFz"AXObject: Exception in do_action: N)rrurr��	do_actionrOrK)r7r�r�rJr s     rr�zAXObject.do_action�s|���A�3��.�.�s�3�3��4��	��\�\�+�+�C��3�F��
���	�6�u�g�>�C��!�!�#�u�c�2���	�r�c��tj||�}|dk(r,d|d|g}tjtj|d�ytj||�S)z�Invokes the named action on obj. The return value, if true, may be
        meaningless because most implementors return true without knowing if
        the action was successfully performed.r�zINFO:znot an available action forTF)rr�rrrr�)r7rxr�r!s    r�do_named_actionzAXObject.do_named_action�sZ���)�)�#�{�;���B�;��{�,I�3�O�F����e�.�.���=���!�!�#�u�-�-rc��g}ttj|��D]J}tj||�}tj	||�}|r	|d|�d�z
}|j|��Ldj
|�S)z2Returns information about the actions as a string.rYr[r?)r�rrur{r�r�r�)r7r@r�r�r�s     r�actions_as_stringzAXObject.actions_as_string�s�����x�-�-�c�2�3�	#�A��-�-�c�1�5�F�!�8�8��a�@�J���B�z�l�!�,�,���N�N�6�"�	#��y�y��!�!rc���tj|�sy	tjj	|�}tjtjkr|S|rXtj|tjj�s*d|dg}tjtj|d�|S#t
$r&}d|��}tj
|||�Yd}~yd}~wwxYw)z:Attempts to grab focus on obj. Returns true if successful.Fz#AXObject: Exception in grab_focus: Nr.z$lacks focused state after focus grabT)rr]rr��
grab_focusrOrKrrr�r�r��FOCUSEDr)r7r�rJr r!s     rr�zAXObject.grab_focus�s����*�*�3�/��	��_�_�/�/��4�F����e�.�.�.��M��(�,�,�S�%�/�/�2I�2I�J�!�3�(N�O�F����e�.�.���=��
���	�7��w�?�C��!�!�#�u�c�2���	�s�B6�6	C%�?C � C%)rrFr�)Fr)T)^�__name__�
__module__�__qualname__�__doc__rrrrr&�Lockr�staticmethodrr
r#r+r8r<r:rCrKrRrZr]rardrgrjrmrqrtrwrzr}r�r�r�r2r�r�r�r�r�r�r�r�r�r�r�r/r�rVr�r�r�r�r�r�r�rrrr
r
r�rr!r&r(r4rDrOrWrRrWr]rardrArkr�rsruryr{r}rr�r�r�r�r�r�r�rrrrr0s���G��J� "��"$�����I�N�N��E��/��/��/��/�6�1��1�
�������� �G��G�
�B��B�
�>��>�(�7��7�"�
!��
!��!��!�*�
!��
!� �
!��
!��
!��
!��
!��
!��
!��
!��
!��
!��
!��
!��
!��
!��
!��
!��!��!��
!��
!��!��!�2����(�
��
�����2����@����0�	P��	P�����<����"����*����"�����
<��
<��
S��
S��������� �
��
����� �0��0��
��
��
��
��"��"� �
��
��
��
���������,����,����0����0���� �;��;��	S��	S��
��
��
��
��E��E�����4�"��"�8�/$��/$�b����4����&����&����"�3��3�2�
��
�����*����0�2��2��	T��	T��
��
������
5��
5������
��
��
��
��@��@�
��������"�.��.��"��"����rr)r��__id__�__version__�__date__�
__copyright__�__license__rFr&r�gi�require_version�
gi.repositoryrrrrr+rrr�<module>r�sd��*�������1�
���	���	�����7�E�"���b�b�H-	�$�$�&r

Zerion Mini Shell 1.0