%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__/orca.cpython-312.pyc

�

g
f3G���dZdZdZdZdZdZddlZddlZddlZddl	Z	ddl
Z
ddlZejdd	�ejd
d�ddl
mZdd
l
mZ	ddlmZed��ZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"dd lm#Z#dd!l$m%Z%ejL�Z'd"�Z(d#�Z)d$�Z&d%Z*da+d&�Z,d7d(�Z-d)�Z.d8d*�Z/d8d+�Z0d8d,�Z1d8d-�Z2d'a3d.�Z4d/�Z5d9d0�Z6d8d1�Z7d8d2�Z8da9d3�Z:d4�Z;d5�Z<e=d6k(rej|e<��yy#e$rdZY��wxYw):z+The main module for the Orca screen reader.z$Id$z
$Revision$z$Date$zqCopyright (c) 2004-2009 Sun Microsystems Inc.Copyright (c) 2010-2011 The Orca TeamCopyright (c) 2012 Igalia, S.L.�LGPL�N�Atspiz2.0�Gdkz3.0)r)r)�Settingsz#org.gnome.desktop.a11y.applications)�	schema_id�)�braille)�debug)�
event_manager)�
focus_manager)�logger)�messages)�mouse_review)�orca_modifier_manager)�
orca_state)�
orca_platform)�script_manager)�settings)�settings_manager)�speech)�sound)�AXObjectc�l�	|j|�}|dk(r|st�yyy#t$rYywxYw)Nzscreen-reader-enabled)�get_boolean�	Exception�shutdown)�gsetting�key�enableds   �+/usr/lib/python3/dist-packages/orca/orca.py�onEnabledChangedr!EsE����&�&�s�+���%�%�g��
�/6�%������s�'�	3�3c�*�tj�S�N)r�
getManager��r �getSettingsManagerr'Ns���&�&�(�(r&c��tSr#)�_loggerr%r&r �	getLoggerr*Qs���Nr&�2c��|j�}|tjjk(r$t	j
�j
d�yy)zHandles device-* signals.zKeyboard change detected.N)�
get_sourcer�InputSource�KEYBOARDrr$�refresh_orca_modifiers)�
deviceManager�device�sources   r �deviceChangeHandlerr4ZsA���
�
�
 �F�
����)�)�)��(�(�*�A�A�B]�^�*r&Fc�
�tjtjdd�tj�}|j�t
j
�tj
�tj�j�d}trptj�jd�d}	tj�j|�atj�j|�d}nBtj�j(}	tj�j|�a|s"tj�j+�}tj�j-|�tj�jd�r`d}tjtj|d�	t
j.�|r!|s|j1t2j4�n'd}tjtj|d�tj�jd	�rZd
}tjtj|d�	tj.t7j�j8�n'd}tjtj|d�tj�jd
�r#t=j>�jA�n"t=j>�j�tj�jd�r|j/�tCj�jEd�t7j�jA�tj�jA�tjtjdd�y#t $r'tj"tj�Y���t$$r'tj"tj&�Y��wxYw#t $r'tj"tj�Y��Mt$$r'tj"tj&�Y��{wxYw#t$$r'tj"tj&�Y���wxYw#t$$rNtj"tj:�d}tjtj:|d�Y��swxYw)z�Loads (and reloads) the user settings module, reinitializing
    things such as speech if necessary.

    Returns True to indicate the input event has been consumed.
    zORCA: Loading User SettingsTF�
activeProfiler�enableSpeechzORCA: About to enable speechz'ORCA: Speech is not enabled in settings�
enableBraillezORCA: About to enable braillez1ORCA: Could not initialize connection to braille.z(ORCA: Braille is not enabled in settings�enableMouseReview�enableSoundzLoading user settings.zORCA: User Settings Loaded)#r
�printMessage�
LEVEL_INFOr�	getPlayerrrr	rr$�
deactivate�
_userSettingsr�
getSetting�getGeneralSettings�
setProfile�ImportError�printExceptionr�LEVEL_SEVERE�profile�getDefaultScript�loadAppSettings�init�speakMessager�SETTINGS_RELOADEDr�process_braille_event�
LEVEL_WARNINGr�getReviewer�activaterr0)�script�
inputEvent�skipReloadMessage�player�reloaded�_profile�msgs       r �loadUserSettingsrWas���
���u�'�'�)F��M��_�_�
�F�
�O�O��
�O�O����������*�*�,��H��#�.�.�0�;�;�O�L�Q�O��	5�,�7�7�9�L�L�X�V�M��'�'�)�4�4�X�>��H�$�.�.�0�8�8��	5�,�7�7�9�L�L�X�V�M���*�*�,�=�=�?�����!�1�1�&�9��"�"�$�/�/��?�,��
���5�+�+�S�$�7�	5��K�K�M�� 1��#�#�H�$>�$>�?��8��
���5�+�+�S�$�7��"�"�$�/�/��@�-��
���5�+�+�S�$�7�	?��L�L��1�1�3�I�I�J�9��
���5�+�+�S�$�7��"�"�$�/�/�0C�D�� � �"�+�+�-�� � �"�-�-�/��"�"�$�/�/�
�>����
��$�$�&�=�=�>V�W�����'�'�)�����(�(�*�	���u�'�'�)E�t�L���{�	3�� � ��!1�!1�2��	5�� � ��!3�!3�4�	5���	3�� � ��!1�!1�2��	5�� � ��!3�!3�4�	5���	5�� � ��!3�!3�4�	5���	?�� � ��!4�!4�5�E�C����u�2�2�C��>�	?�sV�AP�+#Q,� 7S
�
1T�,Q)�:+Q)�(Q)�,,S
�+S
�	S
�
,S=�<S=�AU�Uc�"�tjrtjj�y	tjdd�}tjjtjtjdd�}|j|d|�t_tjj!|�tjj�y#t
$r&t
jtj�YywxYw)Nz.orca_gui_prefs�orca�uiz
orca-setup.ui�orcaSetupWindow)r�orcaOS�showGUI�	importlib�
import_modulerr
rDrE�os�path�joinr�datadir�package�OrcaSetupGUIrI)rP�prefs�module�uiFiles    r �_showPreferencesUIri�s���������!�!�#����(�(�):�F�C��
�W�W�\�\�-�/�/�'�/�/��)�+�F�
�+�+�F�4E�u�M�J�������6�"����������
���U�/�/�0���s�C�,D�
Dc���i}tjD](}tj�j	|�||<�*|�"tj�j
�}t||�y)z�Displays the user interface to configure the settings for a
    specific applications within Orca and set up those app-specific
    user preferences using a GUI.

    Returns True to indicate the input event has been consumed.
    T)r�userCustomizableSettingsrr$r@r�getActiveScriptri)rPrQrfrs    r �showAppPreferencesGUIrm�sh��
�E��0�0�C��%�0�0�2�=�=�c�B��c�
�C��~��*�*�,�<�<�>���v�u�%�r&c���tj�jtj�j�}t	j�j�}t
||�y)z�Displays the user interface to configure Orca and set up
    user preferences using a GUI.

    Returns True to indicate the input event has been consumed.
    T)rr$rArFrrGri)rPrQrfs   r �showPreferencesGUIro�sQ��
�'�'�)�<�<�=M�=X�=X�=Z�=b�=b�c�E�
�
&�
&�
(�
9�
9�
;�F��v�u�%�r&c��t�y)z�Quit Orca. Check if the user wants to confirm this action.
    If so, show the confirmation GUI otherwise just shutdown.

    Returns True to indicate the input event has been consumed.
    T)r)rPrQs  r �quitOrcarq�s��
�J�r&c��	tjdd�}|j�y#t$r&t	j
tj�YywxYw)zzDisplays the user interface to perform an Orca Find.

    Returns True to indicate the input event has been consumed.
    z.orca_gui_findrYN)r^r_�
showFindUIrr
rDrE)rPrQrgs   r �showFindGUIrt�sI��1��(�(�)9�6�B��������1�
���U�/�/�0�1�s�&)�,A�Ac���tjtjdd�trHt	j
�j
�r&tjtjdd�ytjrhtjdkDrUtjtjtj�tjtj�t�tjr(tjdkDrtjd�datrtjdt �tjtjdd�y)aBInitialize the orca module, which initializes the speech and braille
    modules.  Also builds up the application list, registers for AT-SPI events,
    and creates scripts for all known applications.

    Returns True if the initialization procedure has run, or False if this
    module has already been initialized.
    zORCA: InitializingTzORCA: Already initializedFr�changedzORCA: Initialized)r
r;r<�_initializedrr$�isScreenReaderServiceEnabledr�timeoutCallback�timeoutTime�signal�SIGALRM�alarmrW�a11yAppSettings�connectr!r%r&r rIrI	s���
���u�'�'�)=�t�D��(�3�3�5�R�R�T�
���5�+�+�-H�$�O�����X�%9�%9�A�%=��
�
�f�n�n�h�&>�&>�?����X�)�)�*������X�%9�%9�A�%=����Q���L�����	�+;�<�	���u�'�'�)<�d�C�r&c�j�tjtjdd�ts
t	�t
jrht
jdkDrUtjtjt
j�tjt
j�t
jr(t
jdkDrtjd�tjj�}|j�}|jdt �|jdt �tj"�d}tjtj|d�tjtjdd�t%j&�y)	zStarts Orca.zORCA: StartingTrzdevice-addedzdevice-removedz(ORCA: Startup complete notification madez$ORCA: Starting Atspi main event loopN)r
r;r<rwrIrryrzr{r|r}r�Display�get_default�get_device_managerrr4�notify_startup_completer�
event_main)�display�
devmanagerrVs   r �startr�0s��
���u�'�'�)9�4�@�������X�%9�%9�A�%=��
�
�f�n�n�h�&>�&>�?����X�)�)�*����X�%9�%9�A�%=����Q���k�k�%�%�'�G��)�)�+�J����~�':�;����'�)<�=����!�
4�C�	���u�'�'��d�3�	���u�'�'�)O�QU�V�	���r&c��tj�}|tk(r%tj|tj
�yt
�tj|�|dkDr%tj|tj�yy)Nr)
r`�getpid�EXIT_CODE_HANG�killr{�SIGKILLr�sys�exit�SIGTERM)�exitCode�pids  r �dier�NsY��
�)�)�+�C��>�!�
����V�^�^�$���J��H�H�X���!�|�
����V�^�^�$�r&c���d}tjtj|d�tjtj�tjd��tt�y)Nz&TIMEOUT: something has hung. Aborting.T)�force)r
r;rE�
printStack�examineProcessesr�r�)�signum�framerVs   r �timeoutr�ZsI��
2�C�	���u�)�)�3��5�	���U�'�'�(�	����&���r&c�6�tjtjdd�tsytj
rhtjdkDrUtjtjtj
�tjtj�tj�j�}|�1|j�|jtj d��t#j�j%ddd�tj�j'�t#j�j'�tj(rt+j,�tj.rt1j,�tj2r$t5j6�}|j-�tj
r(tjdkDrtjd�dat9j�j;d�tjtjdd�t=j>�tjtjdd�y)	z�Exits Orca.  Unregisters any event listeners and cleans up.

    Returns True if the shutdown procedure ran or False if this module
    was never initialized.
    zORCA: Shutting downTFr��resetStyleszShutting down.z$ORCA: Quitting Atspi main event loopzORCA: Shutdown complete) r
r;r<rwrryrzr{r|r}rr$rl�presentationInterrupt�presentMessager�	STOP_ORCAr�pauseQueuingr>r7rrr8r	r:rr=r�unset_orca_modifiersr�
event_quit)rPrQrSs   r rras���
���u�'�'�)>��E������X�%9�%9�A�%=��
�
�f�n�n�h�&>�&>�?����X�)�)�*�
�
&�
&�
(�
8�
8�
:�F�
���$�$�&����h�0�0�e��D�����+�+�D�$�8H�I�����*�*�,�����)�)�+���������������������"���������X�%9�%9�A�%=����Q���L��$�$�&�;�;�<L�M�	���u�'�'�)O�QU�V�	����	���u�'�'�)B�D�I�r&c���dtj|��d�}d|�d|��}tjtj|d�t
rt
|�n	t
dz
atjrhtjdkDrUtjtjtj�tjtj�	trt�ntj�t�d}tjr(tjdkDrtjd�|st
t �yy#t$rd}Y�XwxYw)	N�(�)�.ORCA: Shutting down and exiting due to signal=� TrrF)r{�	strsignalr
r;r<�	exitCountr�rryrzr|r}rwrrrr�)r�r��signalStringrV�	cleanExits     r �shutdownOnSignalr��s���v�'�'��/�0��2�L�:�6�(�!�L�>�
R�C�	���u�'�'��d�3�
��F���Q��	����X�%9�%9�A�%=��
�
�f�n�n�h�&>�&>�?����X�)�)�*����J�

�O�O���J��	����X�%9�%9�A�%=����Q����N����
���	��s�1E�E%�$E%c��dtj|��d�}d|�d|��}tjtj|d�tj
tj�t
j�jd|�d��tj�j�}|�1|j�|jtjd�	�tj d
�y)Nr�r�r�r�TzShutting down: �.Fr�r)r{r�r
r;rEr�rr$r�rrlr�r�rr�r�r�)r�r�r�rVrPs     r �
crashOnSignalr��s����v�'�'��/�0��2�L�:�6�(�!�L�>�
R�C�	���u�)�)�3��5�	���U�'�'�(��$�$�&�;�;�o�l�^�[\�<]�^�
�
&�
&�
(�
8�
8�
:�F�
���$�$�&����h�0�0�e��D��H�H�Q�Kr&c��
�dtj��}tjr|dtj�d�z
}tj�}|d|d�d|d�d|d��z
}t
jjd	�xsd
}t
jjd�xsd
}dj�||fz}|r|d
|��z
}tjtj|d�tjr]t
jjtjj�r&t!j"tjd��nt!j"d��t$t&_t+j*t*j,t.�t+j*t*j0t.�t+j*t*j2t.�t+j*t*j4t.�t+j*t*j6t8�tjtjdd�t;j<�j?�s#t;j<�jAd�tjtjdd�tC�tjtjdd�	tEj<�jG�}|jItJjL�tUj<�jW�}|�rJtUj<�jY��s't[j\|�}tEj<�j_||�}tEj<�ja|d�tUj<�jc||dd��tUj<�je�}|rtUj<�jgd|�tEj<�j_t[j\|�|�}tEj<�ja|d�	d}tjtj|d�ti�y#tN$r'tjPtjR�Y���wxYw#tN$r9d}tjtjR|d�tktl�YywxYw)a1The main entry point for Orca.  The exit codes for Orca will
    loosely be based on signals, where the exit code will be the
    signal used to terminate Orca (if a signal was used).  Otherwise,
    an exit code of 0 means normal completion and an exit code of 50
    means Orca exited because of a hang.zORCA: Launching version z (rev r�z AT-SPI2 version: rr�r��XDG_SESSION_TYPE��XDG_SESSION_DESKTOPz%s %sz
 Session: T)�file�all_threadsF)r�z)ORCA: Enabling accessibility (if needed).zORCA: Initializing.zORCA: Initialized.z
Launching.)�set_window_as_focus�
notify_scriptNzFound focused object.zORCA: Starting ATSPI registry.z(ORCA: Exception starting ATSPI registry.)7r�version�revisionr�get_versionr`�environ�get�stripr
r;r<�	debugFilera�exists�name�faulthandler�enabler�rryr{�SIGHUPr��SIGINTr��SIGQUIT�SIGSEGVr�rr$�isAccessibilityEnabled�setAccessibilityrIrrGr�r�
START_ORCArrDrEr�find_active_window�get_locus_of_focusr�get_application�	getScript�setActiveScript�set_active_window�find_focused_object�set_locus_of_focusr�r�r�)	rV�atspiVersion�sessionType�sessionDesktop�sessionrP�window�app�
focusedObjects	         r �mainr��s���
%�]�%:�%:�$;�
<�C������
�.�.�/�q�1�1���$�$�&�L��
��Q��0��,�q�/�1B�!�L�QR�O�CT�U�U�C��*�*�.�.�!3�4�:��K��Z�Z�^�^�$9�:�@�b�N��m�m�o��n� =�=�G����G�9�%�%��	���u�'�'��d�3����2�7�7�>�>�%�/�/�*>�*>�?�������d�C�����.� '�H���M�M�&�-�-�!1�2�
�M�M�&�-�-�!1�2�
�M�M�&�.�.�"2�3�
�M�M�&�.�.�"2�3�
�M�M�&�.�.�-�0�	���u�'�'�)T�VZ�[��&�&�(�?�?�A��#�#�%�6�6�t�<�	���u�'�'�)>��E��F�	���u�'�'�)=�t�D�1��*�*�,�=�=�?�����h�1�1�2��
%�
%�
'�
:�
:�
<�F�
�m�.�.�0�C�C�E��&�&�v�.�� �*�*�,�6�6�s�F�C���!�!�#�3�3�F�L�I�� � �"�4�4��C�T��	5�	G�&�0�0�2�F�F�H�
���$�$�&�9�9�$�
�N�#�.�.�0�:�:��(�(��7��H�F��%�%�'�7�7��@W�X��.��
���5�+�+�S�$�7�
��

��;�1�
���U�/�/�0�1��2��8��
���5�-�-�s�D�9��N���	�s%�	AS,�:1T�,,T�T�?U!� U!�__main__)NNF)NN)r)?�__doc__�__id__�__version__�__date__�
__copyright__�__license__r��gir^r`r{r��require_version�
gi.repositoryrr�gi.repository.Giorr~rr�r	r
rrr
rrrrrrrrrr�	ax_objectrr*r)r!r'r�r?r4rWrirmrorqrtrwrIr�r�r�rr�r�r�r��__name__r�r%r&r �<module>r�sl��,2�������2�
����	��	�
�
�����7�E�"�����5�%� ����*��)N�O�O��������#���������
�&�
�
�
���)�����
�_�X�t �(�$�	�
1���%�N�<
%��5�n
�	�&�P�M
�^�z���C�H�H�T�V����_���O��s�D<�<E�E

Zerion Mini Shell 1.0