Mini Shell

Direktori : /lib/python3.6/site-packages/orca/scripts/apps/Eclipse/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/orca/scripts/apps/Eclipse/__pycache__/script.cpython-36.pyc

3

�2[��@sNdZdZdZdZdZdZddljZddlj	j
jZddlZGdd	�d	ej
�Z
dS)
zCustom script for Eclipse.z$Id$z
$Revision$z$Date$z-Copyright (c) 2010 Informal Informatica LTDA.ZLGPL�NcsNeZdZdd�Zddd�Z�fdd�Zdd	�Zd
d�Zdd
�Zdd�Z	�Z
S)�ScriptcCs(tjj||�ddddddddg|_d	S)
z/Creates a new script for the given application.ZUpZDownZLeftZRightZPage_UpZ	Page_DownZHomeZEndN)�GAILr�__init__�movementKeys)�selfZapp�r�/usr/lib/python3.6/script.pyr's
zScript.__init__Nc
Cs�tjj|||�|jj�\}}||jkr,dS|p4|j}|j�jt	j
�rJdSd}|dkrp|jj|�\}}}	|	dk}|r�|j|||	�n
|j
|�|j|�dS)z�Updates braille and outputs speech for the event.source or the
        otherObj. Overridden here so that we can give more feedback to user.
        NF�Tab�ISO_Left_Tabr)r	r
)rr�_presentTextAtNewCaretPosition�	utilitiesZlastKeyAndModifiersr�source�getState�contains�pyatspiZSTATE_SINGLE_LINEZselectedTextZ	sayPhraseZsayLine�_saveLastTextPosition)
r�eventZotherObjZlastKeyZmods�objZhasSelection�textZstartOffsetZ	endOffsetrrrr-s


z%Script._presentTextAtNewCaretPositioncsd|jj�}tjtjtjtjg}||kr8tj||j�dS|tj	krTtj||j�dSt
�j|�dS)z)Callback for focus: accessibility events.N)r
�getRolerZROLE_CHECK_MENU_ITEMZ	ROLE_MENUZROLE_MENU_ITEMZROLE_RADIO_MENU_ITEM�orcaZsetLocusOfFocusZ
ROLE_PANEL�super�onFocus)rrZroleZ	menuItems)�	__class__rrrOs

zScript.onFocuscCsP|jj|j�rL|jj�j}|jdkr2|j|kr2dStjj	||�|j
|j�dS)z�Called whenever text is inserted into an object. Overridden here
        so that we can avoid speaking text when caret moves after new text
        is inserted.

        Arguments:
        - event: the Event
        rN)r�
isTextArear
�	queryTextZcharacterCountZdetail1Zdetail2rr�onTextInsertedr)rrZlengthrrrres	zScript.onTextInsertedcCstjj||�|j|j�dS)z�Called whenever text is deleted from an object.  Overridden here
        so that we can avoid speaking text when caret moves after new text
        is deleted.

        Arguments:
        - event: the Event
        N)rr�
onTextDeletedrr
)rrrrrryszScript.onTextDeletedcCs"|jj|�r|j||j�j�dS)N)rrZ_saveLastCursorPositionrZcaretOffset)rrrrrr�szScript._saveLastTextPositioncCs>|j}|j�}|jtj�s,|j�tjkr,dStjj	||�dS)z;Callback for object:selection-changed accessibility events.N)
r
rrrZ
STATE_FOCUSEDrZ
ROLE_MENU_BARrr�onSelectionChanged)rrr�staterrrr�szScript.onSelectionChanged)N)�__name__�
__module__�__qualname__rrrrrrr�
__classcell__rr)rrr%s
"r)�__doc__Z__id__�__version__Z__date__Z
__copyright__Z__license__Z	orca.orcarZorca.scripts.toolkits.GAIL�scriptsZtoolkitsrrrrrrr�<module>s