403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.156
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/orca/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/orca/__pycache__/caret_navigation.cpython-310.pyc
o

S�b�6�@srdZdZdZdZdZdZddlmZddlmZdd	lm	Z	dd
lm
Z
ddlmZddlmZGd
d�d�Z
dS)z3Provides an Orca-controlled caret for text content.z$Id$z
$Revision$z$Date$z$Copyright (c) 2013-2015 Igalia, S.L.�LGPL�)�cmdnames)�debug)�input_event)�keybindings)�messages)�settings_managerc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	e
dd��Ze
dd��Ze
dd��Z
e
dd��Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
d d!��Ze
d"d#��Zd$S)%�CaretNavigationz=Implements the caret navigation support available to scripts.cCs:|r|jsd}t�tj|�||_|��|_|��|_dS)Nz1INFO: Caret navigation requires a script and app.)	�appr�println�
LEVEL_INFO�_script�_setup_handlers�	_handlers�_setup_bindings�	_bindings)�self�script�msg�r�7/usr/lib/python3/dist-packages/orca/caret_navigation.py�__init__(s

zCaretNavigation.__init__cCs&||j��vr	dS|j|jkrdSdS)z0Returns True if handler is a navigation command.FT)r�values�function�_toggle_enabled)r�handlerrrr�handles_navigation1s
z"CaretNavigation.handles_navigationcC�|jS)z)Returns the caret-navigation keybindings.)r�rrrr�get_bindings<�zCaretNavigation.get_bindingscCr)z&Returns the caret-navigation handlers.)rrrrr�get_handlersAr zCaretNavigation.get_handlerscCs�i}|jr	|jjs|St�|jtj�|d<t�|jtj�|d<t�|j	tj
�|d<t�|jtj�|d<t�|j
tj�|d<t�|jtj�|d<t�|jtj�|d<t�|jtj�|d<t�|jtj�|d	<t�|jtj�|d
<t�|jtj�|d<|S)z>Sets up and returns the caret-navigation input event handlers.�toggle_enabled�next_character�previous_character�	next_word�
previous_word�	next_line�
previous_line�
start_of_file�end_of_file�
start_of_line�end_of_line)r
r
r�InputEventHandlerrr�CARET_NAVIGATION_TOGGLE�_next_character�CARET_NAVIGATION_NEXT_CHAR�_previous_character�CARET_NAVIGATION_PREV_CHAR�
_next_word�CARET_NAVIGATION_NEXT_WORD�_previous_word�CARET_NAVIGATION_PREV_WORD�
_next_line�CARET_NAVIGATION_NEXT_LINE�_previous_line�CARET_NAVIGATION_PREV_LINE�_start_of_file�CARET_NAVIGATION_FILE_START�_end_of_file�CARET_NAVIGATION_FILE_END�_start_of_line�CARET_NAVIGATION_LINE_START�_end_of_line�CARET_NAVIGATION_LINE_END)r�handlersrrrrFsv����������������������zCaretNavigation._setup_handlersc
Cs�t��}|jr|jjs
|S|�t�dtjtj|j�	d���|�t�dtjtj
|j�	d���|�t�dtjtj
|j�	d���|�t�dtjtj|j�	d���|�t�dtjtj|j�	d���|�t�d	tjtj
|j�	d
���|�t�dtjtj
|j�	d���|�t�d
tjtj
|j�	d���|�t�dtjtj
|j�	d���|�t�d
tjtj|j�	d���|�t�dtjtj|j�	d���|S)z6Sets up and returns the caret-navigation key bindings.�F12r"�Rightr#�Leftr$r%r&�Downr'�Upr(�Endr,�Homer+r*r))r�KeyBindingsr
r
�add�
KeyBinding�defaultModifierMask�ORCA_MODIFIER_MASKr�get�NO_MODIFIER_MASK�CTRL_MODIFIER_MASK)r�bindingsrrrr�s�
��
��
��
��
��
��
��
��
��
��
��zCaretNavigation._setup_bindingscCsH|sdSt��}|�d�}|rtj}ntj}|�|�|�d|�dS)zToggles caret navigation.F�caretNavigationEnabledT)r�
getManager�
getSettingr�CARET_CONTROL_ORCA�CARET_CONTROL_APP�presentMessage�
setSetting)r�event�_settings_manager�enabled�stringrrrr�s
zCaretNavigation._toggle_enabledcC�D|sdS|j��\}}|sdS|j�||�|�|�|�|�dS)zMoves to the next character.FT)�	utilities�nextContext�setCaretPosition�
updateBraille�sayCharacter�rr[�obj�offsetrrrr/��

zCaretNavigation._next_charactercCr_)z Moves to the previous character.FT)r`�previousContextrbrcrdrerrrr1rhz#CaretNavigation._previous_charactercCs�|sdS|jjdd�\}}|j�||�}|sdS|dd|dd|dd}}}|r8|d��r8|d8}|j�||�|�|�|�|�dS)	zMoves to the next word.FT��	skipSpace������r)r`ra�getWordContentsAtOffset�isspacerbrc�sayWord)rr[rfrg�contents�endr^rrrr3s(

zCaretNavigation._next_wordcCsp|sdS|jjdd�\}}|j�||�}|sdS|dd|dd}}|j�||�|�|�|�|�dS)zMoves to the previous word.FTrjrmr)r`rirprbrcrr)rr[rfrgrs�startrrrr5%s

zCaretNavigation._previous_wordc	Cs�|sdS|��rt��}|�d�rd}t�tj|�dS|j��\}}|j�	||�}|r0|ds2dS|j�
�}|s;dS|dd|dd}}|j�||�|j||ddd�|�
|�dS)	zMoves to the next line.F�rewindAndFastForwardInSayAll�:INFO: inSayAll and rewindAndFastforwardInSayAll is enabledTrmrrl)�priorObj)�inSayAllrrUrVrrrr`�getCaretContext�getLineContentsAtOffset�getNextLineContentsrb�
speakContents�displayContents)	rr[r\rrfrg�linersrurrrr77s(


zCaretNavigation._next_linecCs�|sdS|��rt��}|�d�rd}t�tj|�dS|j��}|s%dS|dd|dd}}|j�	||�|�
|�|�|�dS)zMoves to the previous line.FrvrwTrmr)ryrrUrVrrrr`�getPreviousLineContentsrbr}r~)rr[r\rrsrfrurrrr9Ts 



zCaretNavigation._previous_linecCst|sdS|j��\}}|j�||�}|r|dsdS|dd|dd}}|j�||�|�|�|�|�dS)zMoves to the start of the line.FrmrT)r`rzr{rbrdr~)rr[rfrgrrurrrr?ms

zCaretNavigation._start_of_linecCs�|sdS|j��\}}|j�||�}|r|dsdS|dd|dd|dd}}}|��r<|d��r<|d8}|j�||�|�|�|�|�dS)zMoves to the end of the line.FrmrlrnrorT)r`rzr{�striprqrbrdr~)rr[rfrgrrtr^rrrrAs(

zCaretNavigation._end_of_linecCsz|sdS|j��}|j�|d�\}}|j�||�}|sdS|dd|dd}}|j�||�|�|�|�|�dS)zMoves to the start of the file.FrmrT)r`�
documentFrame�findFirstCaretContextr{rbr}r~)rr[�documentrfrgrsrrrr;�s


zCaretNavigation._start_of_filec	Cs�|sdS|j��}|j�|�}d}|j�|�}|r|jd}|r3|j�||�\}}|s,n||}}|s |j�||�}|s>dS|dd|dd}}|j�||�|�|�|�	|�dS)zMoves to the end of the file.FrmrrlrnT)
r`r��getLastObjectInDocument�queryNonEmptyText�characterCountrar{rbr}r~)	rr[r�rfrg�text�lastobj�
lastoffsetrsrrrr=�s,


�

zCaretNavigation._end_of_fileN)�__name__�
__module__�__qualname__�__doc__rrrr!rr�staticmethodrr/r1r3r5r7r9r?rAr;r=rrrrr	%s<	AW









r	N)r��__id__�__version__�__date__�
__copyright__�__license__�rrrrrrr	rrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit