%PDF- %PDF-
Mini Shell

Mini Shell

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

�

g
f~���dZdZdZdZdZddlmZddlmZddlm	Z	dd	l
mZd
dlm
Z
d
dlmZd
d
lmZGd�de	j$�Zy)z$Id$z
$Revision$z$Date$zCopyright (c) 2016 Igalia, S.L.�LGPL�)�debug)�
focus_manager)�default)�AXText���BrailleGenerator��SpeechGenerator��	Utilitiesc�h��eZdZ�fd�Z�fd�Zd�Zd�Zd�Zd�Z�fd�Z	�fd�Z
�fd	�Z�fd
�Z�xZ
S)�Scriptc�2��t�|�|�d|_y)NF)�super�__init__�presentIfInactive)�self�app�	__class__s  ��>/usr/lib/python3/dist-packages/orca/scripts/terminal/script.pyrzScript.__init__'s���
�����!&���c�V��|jj�t�|�
�y)z'Called when this script is deactivated.N)�	utilities�
clearCacher�
deactivate)rrs �rrzScript.deactivate+s ���	
���!�!�#�
���rc��t|�S)z.Returns the braille generator for this script.r	�rs r�getBrailleGeneratorzScript.getBrailleGenerator1s�� ��%�%rc��t|�S)z-Returns the speech generator for this script.rrs r�getSpeechGeneratorzScript.getSpeechGenerator6s���t�$�$rc��t|�S)z&Returns the utilities for this script.r
rs r�getUtilitieszScript.getUtilities;s�����rc�`�tj�j||j�y)z)Callback for focus: accessibility events.N)r�
getManager�set_locus_of_focus�source)r�events  r�onFocuszScript.onFocus@s!��	� � �"�5�5�e�U�\�\�Jrc���|jj|�r(d}tjtj|d�yt
�|�|�y)z=Callback for object:text-changed:delete accessibility events.z*TERMINAL: Deletion is believed to be noiseTN)r�treatEventAsNoiser�printMessage�
LEVEL_INFOr�
onTextDeleted)rr)�msgrs   �rr/zScript.onTextDeletedFsD����>�>�+�+�E�2�>�C����u�/�/��d�;��
���e�$rc�\��|jj|�s7d}tjtj|d�t
�|�|�yd}tjtj|d�|j|j�|jj|�}t|�dk(r|j|�n:|jj|j|��}|j||��|jj!�r(d}tjtj|d�yt#j$|j�}|j'|j|�|jj)|j�y)	z=Callback for object:text-changed:insert accessibility events.z0TERMINAL: Passing along event to default script.TNz=TERMINAL: Insertion is believed to be due to terminal commandr)�obj�string)�voicez=TERMINAL: Flat review presenter is active. Ignoring insertion)r�treatEventAsCommandrr-r.r�onTextInserted�
updateBrailler(�insertedText�len�speakCharacter�speechGeneratorr4�speakMessage�flatReviewPresenter�	is_activer�get_caret_offset�_saveLastCursorPosition�updateCachedTextSelection)rr)r0�	newStringr4�offsetrs      �rr6zScript.onTextInsertedPsC����~�~�1�1�%�8�D�C����u�/�/��d�;��G�"�5�)��M��
���5�+�+�S�$�7����5�<�<�(��N�N�/�/��6�	��y�>�Q�����	�*��(�(�.�.�5�<�<�	�.�R�E����i�u��5��#�#�-�-�/�Q�C����u�/�/��d�;���(�(����6���$�$�U�\�\�6�:����0�0����>rc�D��|j�st�|�	|�S|j�ryd|_|j
j
�|jr |j�s|j�rytj|j��dd\}}tj|j�|dz
�d}|j}||d|fvryd|g}tjtj |d�|j#|�y)NFr�r�spacez#TERMINAL: Presenting keyboard eventT)�isPrintableKeyr�presentKeyboardEvent�isPressedKey�_sayAllIsInterruptedr�clearCachedCommandState�
shouldEcho�isOrcaModified�isCharacterEchoabler�get_character_at_offset�	getObject�event_stringr�printTokensr.�
speakKeyEvent)rr)�char�start�prevCharr3�tokensrs       �rrHzScript.presentKeyboardEventns�����#�#�%��7�/��6�6������$)��!����.�.�0����5�#7�#7�#9�U�=V�=V�=X���4�4�U�_�_�5F�G��!�L���e��1�1�%�/�/�2C�U�Q�Y�O�PQ�R���#�#���(�G�T�2�2��7��@��
���%�*�*�F�D�9����5�!�rc����|jdk(ryd\}}|jdk(r=|jj|�ry|jj	dddg�\}}|�|j
|j
k7rt�|�|�S|j|jk7rydd�t|�jdd���}d	|g}tjtj|d
�y
)Nzobject:text-changed:insertF)Nrzobject:text-changed:deleter�
z           �	z5TERMINAL: Skipping due to more recent event at offsetT)�typer�#isBackSpaceCommandTextDeletionEvent�
eventCache�getr(r�skipObjectEvent�detail1�str�replacerrRr.)rr)�newEvent�newTime�datarWrs      �rr_zScript.skipObjectEvent�s�����:�:�5�5��#���'��:�:�5�5��~�~�A�A�%�H�� $��� 3� 3�4P�SW�YZ�R[� \��H�g���x���%�,�,�>��7�*�5�1�1��=�=�H�,�,�,��-�$�S��]�%:�%:�4��%J�K��I�4�P��
���%�*�*�F�D�9�r)�__name__�
__module__�__qualname__rrr r"r$r*r/r6rHr_�
__classcell__)rs@rrr%s;���'��&�
%�
�
K�%�?�<�2�rrN)�__id__�__version__�__date__�
__copyright__�__license__�orcarr�orca.scriptsr�orca.ax_textr�braille_generatorr
�speech_generatorr�script_utilitiesrr�rr�<module>rvsG��*������1�
����� ��/�-�'�v�W�^�^�vr

Zerion Mini Shell 1.0