%PDF- %PDF-
Mini Shell

Mini Shell

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

�

g
f�@��\�dZdZdZdZdZdZddlmZddlmZdd	lm	Z	dd
lm
Z
ddlmZddlmZdd
lm
Z
ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z Gd �d!�Z!y")#a$Each script maintains a set of key bindings, braille bindings, and
AT-SPI event listeners.  The key bindings are an instance of
KeyBindings.  The braille bindings are also a dictionary where the
keys are BrlTTY command integers and the values are instances of
InputEventHandler.  The listeners field is a dictionary where the keys
are AT-SPI event names and the values are function pointers.

Instances of scripts are intended to be created solely by the
script manager.

This Script class is not intended to be instantiated directly.
Instead, it is expected that subclasses of the Script class will be
created in their own module.  The module defining the Script subclass
is also required to have a 'getScript(app)' method that returns an
instance of the Script subclass.  See default.py for an example.z$Id$z
$Revision$z$Date$z-Copyright (c) 2005-2009 Sun Microsystems Inc.�LGPL�)�ax_event_synthesizer)�action_presenter)�braille_generator)�debug)�
event_manager)�flat_review_presenter)�
formatting)�keybindings)�label_inference)�learn_mode_presenter)�mouse_review)�notification_presenter)�object_navigator)�script_utilities)�settings_manager)�sleep_mode_manager)�sound_generator)�speech_and_verbosity_manager)�speech_generator)�structural_navigation)�system_information_presenter)�table_navigator)�	bookmarks)�where_am_i_presenter)�AXObjectc�(�eZdZdZd�Zd�Zd�Zd�Zd1d�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%d$�Z&d%�Z'd&�Z(d'�Z)d2d)�Z*d*�Z+d+�Z,d,�Z-d-�Z.d.�Z/d/�Z0d0�Z1y()3�Scriptz:The specific focus tracking scripts for applications.
    c��||_|r)tj|j�xsd|_nd|_|xjd|jzdzz
c_|j�|_d|_|j�|_	|j�|_|j�|_
|j�|_|j!�|_|j%�|_|j)�|_|j-�|_|j1�|_|j5�|_|j9�|_|j=�|_|jA�|_!|jE�|_#|jI�|_%|jM�|_'|jQ�|_)|jU�|_+|jY�|_-i|_.i|_/|ja�tcjd�|_3|ji�|_5|jm�|_7|jq�|_9|ju�|_;|jy�|_=i|_>i|_?|j��|_Ad|_Bd|j�d�}t�j�t�j�|d�y)	z�Creates a script for the given application, if necessary.
        This method should not be called by anyone except the
        script manager.

        Arguments:
        - app: the Python Accessible application to create a script for
        �defaultz	 (module=�)TFzSCRIPT: z initializedN)F�appr�get_name�name�
__module__�getListeners�	listeners�presentIfInactive�getUtilities�	utilities�getLabelInference�labelInference�getStructuralNavigation�structuralNavigation�getCaretNavigation�caretNavigation�getBookmarksr�getLiveRegionManager�liveRegionManager�getNotificationPresenter�notificationPresenter�getFlatReviewPresenter�flatReviewPresenter�getSpeechAndVerbosityManager�speechAndVerbosityManager�getSystemInformationPresenter�systemInformationPresenter�getObjectNavigator�objectNavigator�getTableNavigator�tableNavigator�getWhereAmIPresenter�whereAmIPresenter�getLearnModePresenter�learnModePresenter�getMouseReviewer�
mouseReviewer�getEventSynthesizer�eventSynthesizer�getActionPresenter�actionPresenter�getSleepModeManager�sleepModeManager�getChat�chat�inputEventHandlers�pointOfReference�setupInputEventHandlersr�KeyBindings�keyBindings�getBrailleBindings�brailleBindings�
getFormattingr
�getBrailleGenerator�brailleGenerator�getSoundGenerator�soundGenerator�getSpeechGenerator�speechGenerator�generatorCache�
eventCache�
getSpellCheck�
spellcheck�findCommandRunr�printMessage�
LEVEL_INFO)�selfr"�msgs   �-/usr/lib/python3/dist-packages/orca/script.py�__init__zScript.__init__Isu������ �)�)�$�(�(�3�@�y�D�I�!�D�I��	�	�[�4�?�?�2�S�8�8�	��*�*�,���"&����*�*�,���"�4�4�6���$(�$@�$@�$B��!�#�6�6�8����*�*�,���!%�!:�!:�!<���%)�%B�%B�%D��"�#'�#>�#>�#@�� �)-�)J�)J�)L��&�*.�*L�*L�*N��'�#�6�6�8���"�4�4�6���!%�!:�!:�!<���"&�"<�"<�">���!�2�2�4��� $� 8� 8� :���#�6�6�8��� $� 8� 8� :����L�L�N��	�"$��� "����$�$�&�&�2�2�4���#�6�6�8����,�,�.��� $� 8� 8� :���"�4�4�6���#�6�6�8��� �������,�,�.���#��������<�0��
���5�+�+�S�$�7�c��|j�S�N)r$�rcs re�__str__zScript.__str__�s���)�)��rgc��iS)z�Sets up the AT-SPI event listeners for this script.

        Returns a dictionary where the keys are AT-SPI event names
        and the values are script methods.
        �rjs rer&zScript.getListeners��	���	rgc��y)zlDefines InputEventHandler fields for this script that can be
        called by the key and braille bindings.Nrmrjs rerPzScript.setupInputEventHandlers�s��	
rgc�*�tj�S)zkDefines the key bindings for this script.

        Returns an instance of keybindings.KeyBindings.
        �rrQ)rc�enabledOnlys  re�getKeyBindingszScript.getKeyBindings�s��
�&�&�(�(rgc�*�tj�S)z9Returns the toolkit-specific keybindings for this script.rqrjs re�getToolkitKeyBindingszScript.getToolkitKeyBindings�����&�&�(�(rgc�*�tj�S)z=Returns the application-specific keybindings for this script.rqrjs re�getAppKeyBindingszScript.getAppKeyBindings�rvrgc��iS)z�Defines the braille bindings for this script.

        Returns a dictionary where the keys are BrlTTY commands and the
        values are InputEventHandler instances.
        rmrjs rerSzScript.getBrailleBindings�rnrgc�,�tj|�S)z/Returns the formatting strings for this script.)r
�
Formattingrjs rerUzScript.getFormatting�s���$�$�T�*�*rgc�,�tj|�S)z7Returns the braille generator for this script.
        )r�BrailleGeneratorrjs rerVzScript.getBrailleGenerator�s��!�1�1�$�7�7rgc�,�tj|�S)z,Returns the sound generator for this script.)r�SoundGeneratorrjs rerXzScript.getSoundGenerator�����-�-�d�3�3rgc�,�tj|�S)z6Returns the speech generator for this script.
        )r�SpeechGeneratorrjs rerZzScript.getSpeechGenerator�s�� �/�/��5�5rgc��y)z2Returns the 'chat' class for this script.
        Nrmrjs rerLzScript.getChat�s��rgc��y)z/Returns the spellcheck support for this script.Nrmrjs rer^zScript.getSpellCheck����rgc��y)z5Returns the caret navigation support for this script.Nrmrjs rer/zScript.getCaretNavigation�r�rgc�,�tj|�S)z&Returns the utilities for this script.)r�	Utilitiesrjs rer)zScript.getUtilities�s���)�)�$�/�/rgc�,�tj|�S)z:Returns the label inference functionality for this script.)r�LabelInferencerjs rer+zScript.getLabelInference�r�rgc��gS)zaReturns a list of the structural navigation object types
        enabled in this script.
        rmrjs re�#getEnabledStructuralNavigationTypesz*Script.getEnabledStructuralNavigationTypes�s	���	rgc��|j�}tj�jd�}t	j
|||�S)z:Returns the 'structural navigation' class for this script.�structuralNavigationEnabled)r�r�
getManager�
getSettingr�StructuralNavigation)rc�types�enables   rer-zScript.getStructuralNavigation�s?���8�8�:��!�,�,�.�9�9�:W�X��$�9�9�$��v�N�Nrgc��y)z0Returns the live region support for this script.Nrmrjs rer2zScript.getLiveRegionManager�r�rgc�*�tj�Sri)r�getPresenterrjs rer4zScript.getNotificationPresenter�s��%�2�2�4�4rgc�*�tj�Sri)r	r�rjs rer6zScript.getFlatReviewPresenter�s��$�1�1�3�3rgc�*�tj�Sri)rr�rjs rer:z$Script.getSystemInformationPresenter�s��+�8�8�:�:rgc�*�tj�Sri)r�getNavigatorrjs rer<zScript.getObjectNavigator�����,�,�.�.rgc�*�tj�Sri)rr�rjs rer>zScript.getTableNavigator�s���+�+�-�-rgc�*�tj�Sri)rr�rjs rer8z#Script.getSpeechAndVerbosityManager�s��+�6�6�8�8rgc�*�tj�Sri)rr�rjs rer@zScript.getWhereAmIPresenter����#�0�0�2�2rgc�*�tj�Sri)r
r�rjs rerBzScript.getLearnModePresenter�r�rgc�*�tj�Sri)rr�rjs rerHzScript.getActionPresenter�r�rgc�*�tj�Sri)rr�rjs rerJzScript.getSleepModeManagers��!�,�,�.�.rgc�*�tj�Sri)r�getReviewerrjs rerDzScript.getMouseReviewers���'�'�)�)rgc�*�tj�Sri)r�getSynthesizerrjs rerFzScript.getEventSynthesizers��#�2�2�4�4rgc��	|jS#t$r)tj|�|_|jcYSwxYw)z7Returns the "bookmarks" class for this script.
        )r�AttributeError�	Bookmarksrjs rer1zScript.getBookmarkss<��	"��>�>�!���	"�&�0�0��6�D�N��>�>�!�	"�s��/A�Ac��y)zxReturn a GtkGrid containing the application unique configuration
        GUI items for the current application.
        Nrmrjs re�getAppPreferencesGUIzScript.getAppPreferencesGUIs��rgc��iS)z7Returns a dictionary with the app-specific preferences.rmrjs re�getPreferencesFromGUIzScript.getPreferencesFromGUIs	���	rgc�J�tj�j|�y)z�Tells the event manager to start listening for all the event types
        of interest to the script.

        Arguments:
        - script: the script.
        N)rr��registerScriptListenersrjs re�registerEventListenerszScript.registerEventListenerss��	� � �"�:�:�4�@rgc�J�tj�j|�y)z�Tells the event manager to stop listening for all the event types
        of interest to the script.

        Arguments:
        - script: the script.
        N)rr��deregisterScriptListenersrjs re�deregisterEventListenerszScript.deregisterEventListeners)s��	� � �"�<�<�T�Brgc���|j|�ryi|_|jj�D]3}|jj|�s�|j||��5y)a{Processes all AT-SPI object events of interest to this
        script.  The interest in events is specified via the
        'listeners' field that was defined during the construction of
        this script.

        Note that this script may be passed events it doesn't care
        about, so it needs to react accordingly.

        Arguments:
        - event: the Event
        N)�skipObjectEventr\r'�keys�type�
startswith)rc�event�keys   re�processObjectEventzScript.processObjectEvent3sb������&��!����>�>�&�&�(�	+�C��z�z�$�$�S�)�#����s�#�E�*�	+rgNc��|jj|ddg�\}}|s*d|g}tjtj|d�y|�E||j
k7r6d|j
d|g}tjtj|d�y|�E||jk7r6d|jd|g}tjtj|d�y|�E||jk7r6d|jd|g}tjtj|d�yd|g}tjtj|d�|S)	N�zSCRIPT: No queued event of typeTz SCRIPT: Queued event's detail1 (z) doesn't matchz SCRIPT: Queued event's detail2 (z!SCRIPT: Queued event's any_data (z$SCRIPT: Found matching queued event:)r]�getr�printTokensrb�detail1�detail2�any_data)rc�	eventTyper�r�r��cachedEvent�	eventTime�tokenss        re�_getQueuedEventzScript._getQueuedEventUsB��!%���!4�!4�Y��q�	�!J���Y��7��C�F����e�.�.���=����7�k�.A�.A�#A�8�+�:M�:M�'��2�F����e�.�.���=����7�k�.A�.A�#A�8�+�:M�:M�'��2�F����e�.�.���=����H��0D�0D�$D�9�!�*�*�,=�x�I�F����e�.�.���=��8�+�F��
���%�*�*�F�D�9��rgc�V�|jj|jddg�\}}|r||k(rydg}ddg}gd�}d}|j|vs|j|vr|j|jk(rd}d	}�n|j|vrP|j|jk7r7|j|jk(r|j|jk(rd}d
}n�|jjd�r|j|jk(rd}d}nj|jj
d
�rO|j|jk(r6|j|jk(r|j|jk(rd}d}|r*d|g}	tjtj|	d�|S)aGives us, and scripts, the ability to decide an event isn't
        worth taking the time to process under the current circumstances.

        Arguments:
        - event: the Event

        Returns True if we shouldn't bother processing this object event.
        Nr�Fzobject:state-changed:focusedzobject:text-changed:insertzobject:text-changed:delete)zobject:text-caret-movedzobject:text-selection-changedzobject:selection-changedz object:active-descendant-changedTz5more recent event of the same type in the same objectz8more recent event of the same type in a different object�systemz+more recent system event in the same objectzobject:state-changedz+appears to be duplicate state-changed eventzSCRIPT: Skipping object event:)
r]r�r��sourcer��endswithr�rr�rb)
rcr�r�r��focus�typing�arrowing�skip�reasonr�s
          rer�zScript.skipObjectEventrs���"&���!4�!4�U�Z�Z�$���!K���Y��k�U�2��2�3��0�2N�O��T�����J�J�(�"�e�j�j�F�&:��|�|�{�1�1�1��D�L�F�
�Z�Z�5�
 �U�\�\�[�5G�5G�%G����{�/�/�/����+�"5�"5�5��D�O�F�
�Z�Z�
 �
 ��
*�u�|�|�{�?Q�?Q�/Q��D�B�F�
�Z�Z�
"�
"�#9�
:����{�/�/�/�����!3�!3�3����+�"5�"5�5��D�B�F��6���L�F����e�.�.���=��rgc��y)a�Updates state and presents changes to the user in response to a
        notification from the FocusManager. Do not call this method outside
        of the FocusManager.

        Arguments:
        - event: if not None, the Event that caused the change
        - oldLocusOfFocus: Accessible that is the old locus of focus
        - newLocusOfFocus: Accessible that is the new locus of focus
        Nrm)rcr��oldLocusOfFocus�newLocusOfFocuss    re�locusOfFocusChangedzScript.locusOfFocusChanged�s��	
rgc��y)a�Returns True if the given event is one that should cause this
        script to become the active script.  This is only a hint to
        the focus tracking manager and it is not guaranteed this
        request will be honored.  Note that by the time the focus
        tracking manager calls this method, it thinks the script
        should become active.  This is an opportunity for the script
        to say it shouldn't.
        Trm�rcr�s  re�isActivatableEventzScript.isActivatableEvent�s��rgc��y)z8Allows scripts to insist that they should become active.Frmr�s  re�forceScriptActivationzScript.forceScriptActivation�s��rgc��y)z%Called when this script is activated.Nrmrjs re�activatezScript.activate����rgc��y)z'Called when this script is deactivated.Nrmrjs re�
deactivatezScript.deactivate�r�rgc��iSrirmrjs re�getTransferableAttributesz Script.getTransferableAttributes�s���	rg)T)NNN)2�__name__r%�__qualname__�__doc__rfrkr&rPrsrurxrSrUrVrXrZrLr^r/r)r+r�r-r2r4r6r:r<r>r8r@rBrHrJrDrFr1r�r�r�r�r�r�r�r�r�r�r�r�r�rmrgrerrEs����<8�|��
�
)�)�
)�
�+�8�
4�6�
�
��0�4��O��5�4�;�/�.�9�3�3�/�/�*�5�"���
A�C� +�D�:+�Z

�	��

�
�rgrN)"r��__id__�__version__�__date__�
__copyright__�__license__�rrrrrr	r
rrr
rrrrrrrrrrrrrr�	ax_objectrrrmrgre�<module>r�s}��(D� ������?�
���"�����#����"��$���� ��*��#�*���"���rg

Zerion Mini Shell 1.0