Ë
    g
f4  ã                   ó‚   — 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Z ddlmZ  G d„ d«      Zy)aÔ  
Utilities for obtaining information about containers supporting selection.
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$zCopyright (c) 2023 Igalia, S.L.ÚLGPLé    NÚAtspiz2.0)r   é   )Údebug)ÚAXObjectc                   ó@   — e Zd ZdZed„ «       Zed„ «       Zed„ «       Zy)ÚAXSelectionzJUtilities for obtaining information about containers supporting selection.c                 óH  — t        j                  | «      sy	 t        j                  j	                  | «      }d| d|dg}t        j                  t        j                  |d«       |S # t
        $ r3}d|g}t        j                  t        j                  |d«       Y d}~yd}~ww xY w)z'Returns the selected child count of objr   z3AXSelection: Exception in get_selected_child_count:TNúAXSelection:Úreportszselected children)	r   Úsupports_selectionr   Ú	SelectionÚget_n_selected_childrenÚ	Exceptionr   ÚprintTokensÚ
LEVEL_INFO)ÚobjÚcountÚerrorÚtokenss       ú3/usr/lib/python3/dist-packages/orca/ax_selection.pyÚget_selected_child_countz$AXSelection.get_selected_child_count1   s•   € ô ×*Ñ*¨3Ô/Øð	Ü—O‘O×;Ñ;¸CÓ@ˆEð ! # y°%Ð9LÐMˆÜ×Ñœ%×*Ñ*¨F°DÔ9Øˆøô ò 	ØKÈUÐSˆFÜ×Ñœe×.Ñ.°¸Ô=Üûð	ús   ˜A% Á%	B!Á.)BÂB!c                 óæ  — t         j                  | «      }|dk  ry|dk(  r|dz
  }d|cxk  r|k  sy y	 t        j                  j	                  | |«      }|| k(  r+d| dg}t        j                  t        j                  |d«       yd|d	|d
| g}t        j                  t        j                  |d«       |S # t
        $ r3}d|g}t        j                  t        j                  |d«       Y d}~yd}~ww xY w)z&Returns the nth selected child of obj.r   Néÿÿÿÿr   z-AXSelection: Exception in get_selected_child:Tr   ú#claims to be its own selected childzis selected child #Úof)	r	   r   r   r   Úget_selected_childr   r   r   r   )r   ÚindexÚ
n_childrenÚchildr   r   s         r   r   zAXSelection.get_selected_childC   sù   € ô !×9Ñ9¸#Ó>ˆ
Ø˜Š?Øà�BŠ;Ø ‘NˆEà�EÔ&˜JÒ&Øð 'Øð	Ü—O‘O×6Ñ6°s¸EÓBˆEð �CŠ<Ø$ cÐ+PÐQˆFÜ×Ñœe×.Ñ.°¸Ô=Øà  %Ð)>ÀÀtÈSÐQˆÜ×Ñœ%×*Ñ*¨F°DÔ9Øˆøô ò 	ØEÀuÐMˆFÜ×Ñœe×.Ñ.°¸Ô=Üûð	ús   µ B4 Â4	C0Â=)C+Ã+C0c                 ó^  — t         j                  | «      }t        «       }t        |«      D ]7  }	 t        j
                  j                  | |«      }|€Œ'|j                  |«       Œ9 | |v r;d| dg}t        j                  t        j                  |d«       |j                  | «       t        |«      }t        |«      |k7  r-d| d|› �g}t        j                  t        j                  |d«       |S # t        $ r7}d|g}t        j                  t        j                  |d«       g cY d}~c S d}~ww xY w)z3Returns a list of all the selected children of obj.z0AXSelection: Exception in get_selected_children:TNr   r   z$AXSelection: Selected child count ofzis )r	   r   ÚsetÚranger   r   r   r   r   r   r   ÚaddÚremoveÚlistÚlen)r   r   ÚchildrenÚir    r   r   Úresults           r   Úget_selected_childrenz!AXSelection.get_selected_childrena   s  € ô ×4Ñ4°SÓ9ˆÜ“5ˆÜ�u“ò 		$ˆAðÜŸ™×:Ñ:¸3ÀÓB�ð Ñ Ø—‘˜UÕ#ð		$ð �(‰?Ø$ cÐ+PÐQˆFÜ×Ñœe×.Ñ.°¸Ô=Ø�O‰O˜CÔ ä�h“ˆÜˆv‹;˜%ÒØ<¸cÀSÈÈÀ=ÐQˆFÜ×Ñœe×.Ñ.°¸Ô=àˆøô% ò ØLÈeÐT�Ü×!Ñ!¤%×"2Ñ"2°F¸DÔAØ—	ûðús   ¯ C,Ã,	D,Ã5*D'ÄD,Ä'D,N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústaticmethodr   r   r+   © ó    r   r	   r	   .   s?   „ ÙTàñó ðð" ñó ðð: ñó ñr2   r	   )r/   Ú__id__Ú__version__Ú__date__Ú__copyright__Ú__license__ÚgiÚrequire_versionÚgi.repositoryr   Ú r   Ú	ax_objectr   r	   r1   r2   r   ú<module>r=      sO   ðñ*ð €Ø€Ø€Ø1€Ø€ã 	à €× Ñ �7˜EÔ "Ý å Ý ÷Nò Nr2   