+
    Qi#  c                  s   R t ^ RIHt RtRtRtRtRt^ RIt^ RI	t	]	P                  ! RR	4       ^ R
IHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt  ! R R4      t ! R R4      t ! R R4      t ! R R]4      t ! R R]4      t  ! R R ]4      t! ! R! R"4      t" ! R# R$4      t#R# )%z=Provides the default implementation for flat review for Orca.)annotationsz$Id$z
$Revision$z$Date$zQCopyright (c) 2005-2008 Sun Microsystems Inc.Copyright (c) 2016-2025 Igalia, S.L.ZLGPLNAtspiz2.0)r   )braille)debug)focus_manager)script_manager)settings_manager)settings)AXComponent)AXObject)AXText)AXUtilitiesc                  sV    ] tR t^7tRtR R ltR R ltR R ltR R	 ltR
 R lt	Rt
R# )Charz/A character's worth of presentable information.c               $    V ^8  d   QhRRRRRR/# )   wordz'Word'start_offsetintstringstr Zformat   "5/usr/lib/python3.14/site-packages/orca/flat_review.py__annotate__Char.__annotate__:   s!     - -V -3 - -    c                s8    Wn         W n        W0n        RV n        R# )zCreates a new char.

Arguments:
- word: the Word instance this belongs to
- start_offset: the start offset with respect to the accessible object
- string: the char string
N)_word_start_offset_string_rect)selfr   r   r      &&&&r   __init__ZChar.__init__:   s     "
"."(,
r   c                   V ^8  d   QhRR/# r   returnr   r   r   r   r   r   r   H        
 
 
r   c           	     	s   V P                   P                  R R4      pV P                  4       pRVP                   RVP                   RVP
                   RVP                   R2	pRV RV P                   RV P                  ^,            RV 2# )	
\n(, )zCHAR: '' (-) rect: )r   replaceget_rectxywidthheightr   r   textrectZrect_string   &   r   __str__ZChar.__str__H   s    ||##D%0}}$&&DFF82djj\DKK=JdV3t112!D4F4F4J3K L M#	
r   c               r"   r#   r   r   r   r   r   r   Q         C r   c                    V P                   # )z1Returns the string being displayed for this Char.r   r      &r   
get_stringZChar.get_stringQ        ||r   c               r"   r   r$   r   r   r   r   r   r   r   V        " "# "r   c                r:   )zLReturns the start offset of this Char with respect to the accessible object.r   r<   r=   r   get_start_offsetZChar.get_start_offsetV        !!!r   c               r"   r   r$   
Atspi.Rectr   r   r   r   r   r   [   s      * r   c                s    V P                   f@   V P                  P                  4       p\        P                  ! WP
                  4      V n         V P                   # )zFReturns the Atspi.Rect instance representing the extents of this Char.)r   r   
get_objectr
   Zget_character_rectr   )r   obj   & r   r/   ZChar.get_rect[   sB     ::**'')C2238J8JKDJzzr   )r   r   r   r   N)__name__
__module____qualname____firstlineno____doc__r!   r8   r>   rC   r/   __static_attributes__r   r   r   r   r   7   s#    9-

"
 r   r   c                  s    ] tR t^dtRtR R ltR R ltR R ltR R	 ltR
 R lt	R R lt
R R ltR R ltR R ltR R ltRtR# )Wordz;A single chunk (word or object) of presentable information.c               r   )r   zone'Zone'r   r   r   r   r   r   r   r   r   Word.__annotate__g   s!     / /V /3 / /r   c                sF    Wn         W n        W0n        RV n        / V n        R# )zCreates a new Word.

Arguments:
- zone: the Zone instance this belongs to
- start_offset: the start offset with respect to the accessible object
- string: the word string
N)_zoner   r   r   _characters)r   rQ   r   r   r    r   r!   ZWord.__init__g   s#     "
"."(,
,.r   c               r"   r#   r   r   r   r   r   rS   v   r%   r   c           	     	s@   V P                   P                  R R4      pV P                  4       pRVP                   RVP                   RVP
                   RVP                   R2	pRV RV P                   RV P                  \        V P                   4      ,            RV 2# )	r&   r'   r(   r)   r*   zWORD: 'r+   r,   r-   )	r   r.   r/   r0   r1   r2   r3   r   lenr4   r7   r   r8   ZWord.__str__v   s    ||##D%0}}$&&DFF82djj\DKK=JdV3t112!D4F4FT\\IZ4Z3[ \ M#	
r   c                    V ^8  d   QhRRRR/# )r   otherZobjectr$   boolr   r   r   r   r   rS      s     ] ]F ]t ]r   c                	s   \        V\        4      '       g   R # V P                  VP                  8w  g7   V P                  VP                  8w  g   V P                  VP                  8w  d   R # V P                  4       pVP                  4       pVP                  VP                  8H  ;'       d\    VP                  VP                  8H  ;'       d;    VP                  VP                  8H  ;'       d    VP                  VP                  8H  # F)

isinstancerP   rT   r   r   r/   r0   r1   r2   r3   )r   rX   	this_rectZ
other_rect   &&  r   __eq__ZWord.__eq__   s    %&&::$(:(:e>Q>Q(Q<<5==(MMO	^^%
{{jll* ] ]y{{jll/J ] ]*"2"22] ]7@7G7G:K\K\7\	]r   c               r"   )r   r$   z
list[Char]r   r   r   r   r   rS      s     G G
 Gr   c                s>   \        V P                  4       FB  w  rWP                  9  g   K  WP                  ,           p\	        WV4      V P                  V&   KD  	  \        \        V P                  4      4       Uu. uF  qP                  V,          NK  	  up# u upi )z/Returns a list of Char instances for this Word.)	enumerater   rU   r   r   rangerV   )r   ichar_strstartr7   r   get_charactersZWord.get_characters   s     %T\\2KA(((...&*4&A  # 3
 .33t||3D-EF-E  ##-EFFFs   <Bc               rW   )r   indexr   r$   zChar | Noner   r   r   r   r   rS      s     ' 'C 'K 'r   c                s   ^ Tu;8:  d   \        V P                  4      8  g    R#  R# WP                  9  d?   V P                  V,          pWP                  ,           p\	        WV4      V P                  V&   V P                  V,          # )zBReturns the Char at the specified index with respect to this Word.N)rV   r   rU   r   r   )r   re   rb   rc   r]   r   get_character_at_indexZWord.get_character_at_index   su     E-C-- .(((||E*H...E&*4&ADU#&&r   c               r"   r@   r   r   r   r   r   rS      rA   r   c                r:   )zLReturns the start offset of this Word with respect to the accessible object.rB   r<   r=   r   rC   ZWord.get_start_offset   rD   r   c                    V ^8  d   QhRRRR/# )r   offsetr   r$   r   r   r   r   r   rS      s      # # r   c                s    V P                   Tu;8:  d,   V P                   \        V P                  4      ,           8  d   M R# WP                   ,
          # R# )z8Returns the char offset with respect to this word or -1.)r   rV   r   )r   rh      &&r   get_relative_offsetZWord.get_relative_offset   sH     P$*<*<s4<<?P*PP 	 ....	r   c               r"   r#   r   r   r   r   r   rS      r9   r   c                r:   )z1Returns the string being displayed for this Word.r;   r<   r=   r   r>   ZWord.get_string   r?   r   c               r"   rE   r   r   r   r   r   rS      s      * r   c                s    V P                   f6   V P                  P                  V P                  V P                  4      V n         V P                   # )zFReturns the Atspi.Rect instance representing the extents of this Word.)r   rT   get_word_rectr   r   r<   r=   r   r/   ZWord.get_rect   s:     ::11$2D2DdllSDJzzr   c               r"   r   r$   Atspi.Accessibler   r   r   r   r   rS      s     ' ', 'r   c                s6    V P                   P                  4       # )z?Returns the accessible object associated with this Word's zone.)rT   rG   r<   r=   r   rG   ZWord.get_object   s     zz$$&&r   )rU   r   r   r   rT   N)rJ   rK   rL   rM   rN   r!   r8   r^   rd   rf   rC   rk   r>   r/   rG   rO   r   r   r   rP   rP   d   s>    E/
]G'"

' 'r   rP   c                  s   ] tR t^tRt]P                  ! R4      tR R ltR R lt	R R lt
R	 R
 ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR%R R lltR R ltR R ltR R  ltR! R" ltR#tR$# )&Zonez>Represents text that is a portion of a single horizontal line.z(\S+\s*)c               s(    V ^8  d   QhRRRRRRRR/# )	r   rH   rn   r   r   r6   rF   r$   Noner   r   r   r   r   Zone.__annotate__   s*     > >, >c > >PT >r   c                s~    Wn         ^ V n        W n        W0n        . V n        RV n        RV n        / V n        / V n        R# )zCreates a new Zone.

Arguments:
- obj: the Accessible associated with this Zone
- string: the string being displayed for this Zone
- rect: an Atspi.Rect instance representing the extents of this Zone
N)	_objr   r   r   _wordsline_braille_region_word_rect_cache_word_index_map)r   rH   r   r6   r    r   r!   ZZone.__init__   sA     '*	"#"!%
"$#'	6:CE;=r   c               r"   r#   r   r   r   r   r   rq      s     E E Er   c                	    V P                   P                  R R4      pRV R\        P                  ! V P                  4       2# )r&   r'   zZONE: '' r   r.   r	   get_role_namerr   r   r5   rI   r   r8   ZZone.__str__   s;    ||##D%0b!7!7		!B CDDr   c               r"   r   r$   rY   r   r   r   r   r   rq           	 	4 	r   c                s    \         P                  ! V P                  4      '       d   R# \        P                  ! V P                  4      '       d   R# R# >Returns True if we can cache the braille region for this Zone.FT)r   is_editablerr   r	   supports_valuer<   r=   r   _can_cache_braille_regionZZone._can_cache_braille_region   s7     ""499--""499--r   c               r"   r   r$   zbraille.Region | Noner   r   r   r   r   rq      s     	 	$9 	r   c                s    V P                   e   V P                   # \        P                  ! V P                  V P                  ^ V 4      pV P                  4       '       d   Wn         V# )Returns the braille region for this Zone.)ru   r   ReviewComponentrr   r   r   r   regionrI   r   get_braille_regionZZone.get_braille_region   sT     +'''((DLL!TJ))++#) r   c               r"   r#   r   r   r   r   r   rq      r9   r   c                r:   1Returns the string being displayed for this Zone.r;   r<   r=   r   r>   ZZone.get_string   r?   r   c               r"   r   r$   z
list[Word]r   r   r   r   r   rq      s      : r   c                s   V P                   '       d   V P                   # \        \        P                  ! V P                  V P
                  4      4       Fv  w  r\        WP                  4       VP                  4       4      pV P                   P                  V4       VP                  4       VP                  4       3pWP                  V&   Kx  	  V P                   # z'Returns the list of Words in this Zone.)rs   r_   refinditerWORDS_REr   rP   rc   groupappendrC   r>   rw   )r   ra   r   word_objkey   &    r   	get_wordsZZone.get_words   s     ;;;;; !T]]DLL!IJGAD**,

=HKKx(,,.0C0C0EFC()  %	 K {{r   c               rW   )r   re   r   r$   zWord | Noner   r   r   r   r   rq     s      s { r   c                sn    V P                  4       p^ Tu;8:  d   \        V4      8  d    W!,          #  R# R# )zBReturns the Word at the specified index with respect to this Zone.N)r   rV   )r   re   words   && r   get_word_at_indexZZone.get_word_at_index  s3      "E
"< # r   c               rW   )r   r   rP   r$   r   r   r   r   r   r   rq     s     1 1d 1s 1r   c                s    V P                  4        VP                  4       VP                  4       3pV P                  P	                  VR4      # )zBReturns the index of the specified Word with respect to this Zone.ri   )r   rC   r>   rw   get)r   r   r   r   r   get_index_of_wordZZone.get_index_of_word  sA     	$$&(9:##''R00r   c               r"   rm   r   r   r   r   r   rq     s      , r   c                r:   )z8Returns the accessible object associated with this Zone.)rr   r<   r=   r   rG   ZZone.get_object  s     yyr   c               r"   rE   r   r   r   r   r   rq     s      * r   c                r:   )zFReturns the Atspi.Rect instance representing the extents of this Zone.)r   r<   r=   r   r/   ZZone.get_rect  s     zzr   c               r   r   r   r   r   r   r$   rF   r   r   r   r   r   rq   #  s!      # s z r   c                s    V\        V4      3pW0P                  9   d   V P                  V,          # V P                  pW@P                  V&   V# )z2Returns the rectangle for a word within this zone.)rV   rv   r   )r   r   r   	cache_keyr6      &&&  r   rl   ZZone.get_word_rect#  sM     "3v;/	---((33 zz+/i(r   c               r   )r   rQ   rR   pixel_deltar   r$   rY   r   r   r   r   r   rq   0  s!     = = =c =$ =r   c                s<   \         P                  ! V P                  4      '       g+   \         P                  ! VP                  4       4      '       d   V P                  VP                  4       8H  # \        P
                  ! V P                  4      p\        P
                  ! VP                  4       4      p\         P                  ! V4      '       g   \         P                  ! V4      '       d   W48H  # V P                  pVP                  4       pVP                  ^ 8X  dW   VP                  ^ 8X  dF   VP                  VP                  u;8*  ;'       d!    VP                  VP                  ,           8*  # u # VP                  ^ 8X  dW   VP                  ^ 8X  dF   VP                  VP                  u;8*  ;'       d!    VP                  VP                  ,           8*  # u # \        VP                  VP                  ,           VP                  VP                  ,           4      p\        VP                  VP                  4      pW8  d   R# VP                  VP                  ^,          ,           p	VP                  VP                  ^,          ,           p
\        W,
          4      V8*  # )zAReturns True if we treat this Zone and zone as being on one line.F)r   Zis_scroll_barrr   rG   r	   
get_parentis_menur   r/   r2   r3   r1   ZminmaxZabs)r   rQ   r   Zthis_parentZzone_parentr\   Z	zone_rectZhighest_bottomZ
lowest_topZthis_middleZzone_middles   &&&        r   on_same_lineZZone.on_same_line0  s    $$TYY//;3L3LT__M^3_3_99 111))$))4))$//*;<{++{/B/B;/O/O--JJ	MMO	??aI$4$4$9;;)++OOy?O?O1OOOOO??aI$4$4$9;;)++OOy?O?O1OOOOOY[[9+;+;;Y[[9K[K[=[\ikk2
'kkI$4$4q$88kkI$4$4q$88;,-<<r   c               r"   r@   r   r   r   r   r   rq   L  rA   r   c                r:   )zLReturns the start offset of this Zone with respect to the accessible object.rB   r<   r=   r   rC   ZZone.get_start_offsetL  rD   r   c               rW   )r   char_offsetr   r$   tuple[Word | None, int]r   r   r   r   r   rq   Q  s      c 6M r   c                s   RV 2p\         P                  ! \         P                  VR4       V P                  4       pV FJ  pRV.p\         P                  ! \         P                  VR4       VP                  V4      pV^ 8  g   KG  WF3u # 	  \        V P                  4      V8X  d-   V'       d%   VR,          pV\        VP                  4       4      3# R# )zOReturns the Word at the specified offset with respect to the accessible object.z*FLAT REVIEW: Searching for word at offset TzFLAT REVIEW: Checkingri   Nri   )	r   print_message
LEVEL_INFOr   print_tokensrk   rV   r   r>   )r   r   msgr   r   tokensrh   Z	last_word   &&      r   get_word_at_offsetZZone.get_word_at_offsetQ  s     ;;-HE,,c48 D-t4Fu//>--k:F{|#  t||+b	Ic)"6"6"8999r   c               r"   r}   r   r   r   r   r   rq   f  s      4 r   c                    R# )-Returns True if this Zone contains the caret.Fr   r<   r=   r   	has_caretZZone.has_caretf       r   c               r"   r   r$   r   r   r   r   r   r   rq   k  s      !8 r   c                r   z4Returns the Word and relative offset with the caret.r   r   r<   r=   r   word_with_caretZZone.word_with_caretk  s	     r   )	ru   rr   r   r   r   rw   rv   rs   rt   N)i   )rJ   rK   rL   rM   rN   r   Zcompiler   r!   r8   r   r   r>   r   r   r   rG   r/   rl   r   rC   r   r   r   rO   r   r   r   ro   ro      si    Hzz+&H>&E		
 1

=8"
*
 r   ro   c                  s   a  ] tR tRtRtR V 3R lltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltR R ltR R ltRtV ;t# )TextZoneip  z5A Zone whose purpose is to display text of an object.c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   rH   rn   r   r   r   r   r6   rF   r$   rp   r   r   r   r   r   TextZone.__annotate__s  sC     F FF F 	F
 F 
Fr   c                sB   < \         SV `  WV4       W n        / V n        R# )zCreates a new TextZone.

Arguments:
- obj: the Accessible associated with this Zone
- string: the string being displayed for this Zone
- rect: an Atspi.Rect instance representing the extents of this Zone
N)superr!   r   rv   )r   rH   r   r   r6   	__class__s   &&&&&r   r!   ZTextZone.__init__s  s"     	d+".CEr   c               r"   r#   r   r   r   r   r   r     s     J J Jr   c                	rx   )r&   r'   zTEXT ZONE: 'ry   rz   r|   rI   r   r8   ZTextZone.__str__  s;    ||##D%0dV2h&<&<TYY&G%HIIr   c               r"   r}   r   r   r   r   r   r     r~   r   c                s    \         P                  ! V P                  4      '       g'   \         P                  ! V P                  4      '       d   R# \         P                  ! V P                  4      '       d   R# R# r   )r   r   rr   Zis_terminalZis_labelr<   r=   r   r   Z"TextZone._can_cache_braille_region  sK     ""499--1H1H1S1S		**r   c               r"   r   r   r   r   r   r   r     s     
 
$9 
r   c                s    V P                   e   V P                   # \        P                  ! V P                  V P                  V P
                  V 4      pV P                  4       '       d   Wn         V# r   )ru   r   Z
ReviewTextrr   r   r   r   r   rI   r   r   ZTextZone.get_braille_region  s[     +'''##DIIt||T=O=OQUV))++#) r   c               r"   r#   r   r   r   r   r   r     s      C r   c                s    V P                   \        V P                  4      ,           p\        P                  ! V P
                  V P                   V4      V n        V P                  # r   )r   rV   r   r
   Zget_substringrr   r   
end_offsetrI   r   r>   ZTextZone.get_string  sG     ''#dll*;;
++DIIt7I7I:V||r   c               r"   r   r   r   r   r   r   r     s      : r   c                s   . pV P                   P                  4        \        \        P                  ! V P
                  V P                  4       4      4       F  w  r#VP                  4       V P                  ,           p\        WVP                  4       4      pVP                  V4       VP                  4       VP                  4       3pW P                   V&   K  	  Wn        V P                  # r   )rw   Zclearr_   r   r   r   r>   rc   r   rP   r   r   rC   rs   )r   r   ra   r   rc   r   r      &      r   r   ZTextZone.get_words  s     ""$ T]]DOO<M!NOGAJJL4#5#55ED6HLL",,.0C0C0EFC()  % P {{r   c               r   r   r   r   r   r   r   r     s!     
 
# 
s 
z 
r   c                s    V\        V4      3pW0P                  9   d   V P                  V,          # V\        V4      ,           p\        P                  ! V P                  W4      pWPP                  V&   V# )z>Returns the precise rectangle for a word within this TextZone.)rV   rv   r
   get_range_rectrr   )r   r   r   r   r   r6      &&&   r   rl   ZTextZone.get_word_rect  sf     "3v;/	---((33!CK/
$$TYYI+/i(r   c               r"   r}   r   r   r   r   r   r     s     C C4 Cr   c                s
   V P                   \        V P                  4      ,           pV P                   \        P                  ! V P
                  4      u;8:  d
   V8  d    R#  V\        P                  ! V P
                  4      8H  # )r   T)r   rV   r   r
   get_caret_offsetrr   Zget_character_countr   rI   r   r   ZTextZone.has_caret  sd     ''#dll*;;
!8!8!CPjP Q V77		BBBr   c               r"   r   r   r   r   r   r   r     s     K K!8 Kr   c                s    V P                  4       '       g   R# V P                  \        P                  ! V P                  4      4      # r   )r   r   r
   r   rr   r<   r=   r   r   ZTextZone.word_with_caret  s6     ~~O&&v'>'>tyy'IJJr   )ru   r   r   rv   rs   )rJ   rK   rL   rM   rN   r!   r8   r   r   r>   r   rl   r   r   rO   __classcell__r      @r   r   r   p  sC    ?F F&J	

CK Kr   r   c                  b   a  ] tR tRtRtR V 3R lltR R ltR R ltR	 R
 ltR R lt	Rt
V ;t# )	StateZonei  z:A Zone whose purpose is to display the state of an object.c               r   r   rH   rn   r6   rF   r$   rp   r   r   r   r   r   StateZone.__annotate__  "     ( (, (J (4 (r   c                	*   < \         SV `  VR V4       R#  Nr   r!   r   rH   r6   r      &&&r   r!   ZStateZone.__init__      b$'r   c               r"   r#   r   r   r   r   r   r          K K Kr   c                	    V P                  4       P                  R R4      pRV R\        P                  ! V P                  4       2# )r&   r'   zSTATE ZONE: 'ry   r>   r.   r	   r{   rr   r|   rI   r   r8   ZStateZone.__str__  >     ((u5tfBx'='=dii'H&IJJr   c               r"   r}   r   r   r   r   r   r           4 r   c                r   r   Fr   r<   r=   r   r   Z#StateZone._can_cache_braille_region  r   r   c               r"   r   r   r   r   r   r   r           $9 r   c                sp   \         P                  ! 4       P                  4       pVf   R# VP                  P	                  V P
                  4      pV'       d`   V^ ,          '       dQ   \        V^ ,          \        4      '       d+   \        P                  ! V P
                  V^ ,          ^ V 4      # V^ ,          # R# )r   N)
r   get_managerget_active_scriptbraille_generatorget_state_indicatorrr   r[   r   r   r   )r   scriptresult   &  r   r   ZStateZone.get_braille_region  s      ++-??A>))==diiHfQii&)S))..tyy&)QMM!9r   c               r"   r#   r   r   r   r   r   r     s     C CC Cr   c           	     s   \         P                  ! 4       P                  4       pVf   R# VP                  P	                  V P
                  4      pRP                  V Uu. uF  p\        V\        4      '       g   K  VNK  	  up4      # u upi r   r    )	r   r   r   speech_generatorr   rr   joinr[   r   )r   r   r   Zrr7   r   r>   ZStateZone.get_string  si      ++-??A>((<<TYYGxxFAFqjC.@FABBAs   B;Br   rJ   rK   rL   rM   rN   r!   r8   r   r   r>   rO   r   r   r   r   r   r     s,    D( (K
C Cr   r   c                  r   )	ValueZonei  z:A Zone whose purpose is to display the value of an object.c               r   r   r   r   r   r   r   ValueZone.__annotate__  r   r   c                	r   r   r   r   r   r   r!   ZValueZone.__init__  r   r   c               r"   r#   r   r   r   r   r   r     r   r   c                	r   )r&   r'   zVALUE ZONE: 'ry   r   r|   rI   r   r8   ZValueZone.__str__  r   r   c               r"   r}   r   r   r   r   r   r     r   r   c                r   r   r   r<   r=   r   r   Z#ValueZone._can_cache_braille_region  r   r   c               r"   r   r   r   r   r   r   r   
  r   r   c                sn   \         P                  ! 4       P                  4       pVf   R# VP                  P	                  V P
                  4      pVP                  P                  V P
                  4      pV'       d:   V'       d2   V RV^ ,           2p\        P                  ! V P
                  V^ V 4      # R# )r   Nr   )	r   r   r   r   get_localized_role_namerr   	get_valuer   r   r   r   ZrolenameZvaluer   r   r   r   ZValueZone.get_braille_region
  s      ++-??A>++CCDIIN((22499= z58*-F**499faFFr   c               r"   r#   r   r   r   r   r   r     s      C r   c                s,   \         P                  ! 4       P                  4       pVf   R# VP                  P	                  V P
                  4      pVP                  P                  V P
                  4      pRpV'       d   V'       d   V RV^ ,           2pV# r   )r   r   r   r   r   rr   r   r   r   r   r>   ZValueZone.get_string  sz      ++-??A>**BB499M''11$))< z58*-Fr   r   r   r   r   r   r   r     s*    D( (K
 r   r   c                  sn    ] tR tRtRtR R ltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltRtR# )Linei'  zAA Line is a single line across a window and is composed of Zones.c               r   )r   line_numberr   zones
list[Zone]r$   rp   r   r   r   r   r   Line.__annotate__*  s&     
Z 
ZC 
Z
 
Zt 
Zr   c                sr    Wn         W n        \        V4       UUu/ uF  w  r4WCbK	  	  uppV n        R# u uppi )zCreates a new Line, which is a horizontal region of text.

Arguments:
- line_number: the line number of this Line in the window
- zones: the Zones that make up this line
N)_line_number_zonesr_   _zone_index_map)r   r   r   ra   rQ   r   r   r!   ZLine.__init__*  s5     "-"'HQRWHX0YHXWQHX0Y0Ys   3c               r"   r@   r   r   r   r   r   r   6  s     ! ! !r   c                r:   )z-Returns the index of this Line in the window.)r   r<   r=   r   get_line_numberZLine.get_line_number6  s        r   c               r"   )r   r$   r   r   r   r   r   r   r   ;  s      : r   c                r:   )z'Returns the list of Zones in this Line.)r   r<   r=   r   	get_zonesZLine.get_zones;  s     {{r   c               rW   )r   re   r   r$   Zone | Noner   r   r   r   r   r   @  s      s { r   c                sx    ^ Tu;8:  d   \        V P                  4      8  d   M R# V P                  V,          # R# )zBReturns the Zone at the specified index with respect to this Line.N)rV   r   )r   re   rj   r   get_zone_at_indexZLine.get_zone_at_index@  s3     (DKK((  ;;u%%r   c               rW   )r   rQ   ro   r$   r   r   r   r   r   r   r   H  s     2 2d 2s 2r   c                s:    V P                   P                  VR4      # )zBReturns the index of the specified Zone with respect to this Line.ri   )r   r   r   rQ   rj   r   get_index_of_zoneZLine.get_index_of_zoneH  s     ##''b11r   c               r"   r#   r   r   r   r   r   r   M  s     E EC Er   c                s|    RP                  V P                   Uu. uF  qP                  4       NK  	  up4      # u upi )zIReturns the string of this Line, which is the concatenation of all Zones.r   )r   r   r>   r   rI   r   r>   ZLine.get_stringM  s.     xxt{{C{t*{CDDCs   9c               r"   )r   r$   zlist[braille.Region]r   r   r   r   r   r   R  s      %9 r   c                s   . pV P                    FW  pVP                  4       pVf   K  V'       d&   VP                  \        P                  ! R4      4       VP                  V4       KY  	  \
        P                  '       gS   V'       d&   VP                  \        P                  ! R4      4       VP                  \        P                  ! R4      4       V# )z0Returns a list of braille regions for this Line.r   z$l)r   r   r   r   ZRegionr   ZdisableBrailleEOL)r   regionsrQ   r   r7   r   get_braille_regionsZLine.get_braille_regionsR  s     )+KKD,,.F!NN7>>##67v&   )))w~~c23NN7>>$/0r   )r   r   r   N)rJ   rK   rL   rM   rN   r!   r   r   r   r   r>   r   rO   r   r   r   r   r   '  s/    K
Z!

2
E
 r   r   c                  s   ] tR tRtRt^ t^t^t^t^t	RER R llt
R R ltR R	 ltR
 R ltR R ltR R ltRER R lltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR  R! ltRFR" R# lltR$ R% ltR& R' ltR( R) ltR* R+ lt]	3R, R- llt]	3R. R/ lltRGR0 R1 llt RGR2 R3 llt!R4 R5 lt"R6 R7 lt#R8 R9 lt$R: R; lt%R< R= lt&R> R? lt'R@ RA lt(RB RC lt)RDt*R# )HContextid  zBContains the flat review regions for the current top-level object.Nc               rW   )r   rootAtspi.Accessible | Noner$   rp   r   r   r   r   r   Context.__annotate__m  s     =9 =9%< =9 =9r   c                s   Wn         . V n        . V n        ^ V n        ^ V n        ^ V n        ^ V n        RV n        RV n        / V n	        \        P                  ! 4       P                  4       V n        RV n        \        P                   ! 4       V n        VP$                  P'                  V P                  4      w  r4Ve2   W n        RV.p\(        P*                  ! \(        P,                  VR4       MT;'       g    TV n        RVRVRV P                  .p\(        P*                  ! \(        P,                  VR4       \.        P0                  ! V P                  4      V n        \2        P4                  ! V P                  \6        P8                  4      pT;'       g    V P                  V n        V P;                  V P                  4      V n        V P                   FT  pVP=                  4       pWP                  9  d   . V P                  V&   V P                  V,          P?                  V4       KV  	  V PA                  V P                  4      V n        V PC                  V P                  4      V n        V P                  '       d   V P                  '       g   R# \E        V P                  4       F  w  rV
PG                  V P                  4      pV^ 8  d   K)  Wn        Wn        V P                  PI                  4       w  rV'       d'   V P                  PK                  V4      V n        Wn         M	  RV P                   RV P                   R	V P
                   R
V P                   2p\(        PL                  ! \(        P,                  VR4       R# )z Create a new Context for script.Nz'FLAT REVIEW: Restricting flat review toTzFLAT REVIEW: Frame:zDialog:z. Top level:zFLAT REVIEW: On line z, zone z word z, char )'_scriptr   _lines_line_index_zone_index_word_index_char_index_focus_zone
_container_object_to_zone_mapr   r   Zget_locus_of_focus
_focus_obj
_top_levelr   Rectr   	utilitiesZframe_and_dialogr   r   r   r   r/   r	   Zfind_ancestor_inclusiver   r   _get_showing_zonesrG   r   _find_zone_with_object_cluster_zones_by_liner_   r   r   r   r   )r   r   r   ZframeZdialogr   	containerrQ   rH   ra   rt   re   r   rh   r   s   &&&            r   r!   ZContext.__init__m  s    "$"$ ! ! ! !(,37GI %%'::< 	37!&
((99$//J"O?FFu//>$ooDO'	6>SWSbSbc5++VT: ))$//:
44T__kFYFYZ	#66t--doo>KKD//#C22202((-$$S)006	  
  66tG11$++> 0 0 0 -GA**4+;+;<Eqy $++;;=LD#'#3#3#E#Ed#K #)  . $D$4$4#5WT=M=M<N O$$%WT-=-=,>@ 	 	E,,c48r   c          
     r   )r   rH   rn   r   r   r   r   cliprectrF   r$   list[TextZone]r   r   r   r   r   r     s<        	
  
r   c           	     s  a . p\         P                  ! RV4       Uu. uF'  p. VP                  4       OVP                  ^ 4      N5NK)  	  pp\	        \        V3R lV4      4      pV Fl  w  rp
\        P                  ! WV	4      p\        P                  ! W4      p\        P                  ! V4      '       d   KQ  VP                  \        WW4      4       Kn  	  V# u upi )zDReturns a list of TextZones with embedded object characters removed.z
[^\ufffc]+c                sT   < V ^ ,          S,           V ^,          S,           V ^,          3# i    r   )r0   r   s   &r   <lambda>Z0Context._split_text_into_zones.<locals>.<lambda>  s#    QqTL%8!A$:MqQRt$Tr   )r   r   Zspanr   listZmapr
   r   r   get_rect_intersectionZis_empty_rectr   r   )r   rH   r   r   r  r   ZmZrangesrc   ZendZ	substringr6   intersections   &&&f&        r   _split_text_into_zonesZContext._split_text_into_zones  s     !#35;;}f3UV3Ua)AFFH)aggaj)3UVcTV\]^'-#U((S9D&<<TLL,,\::Xc)JK	 (.  Ws   -Cc               r   )r   rH   rn   r  rF   r$   r  r   r   r   r   r   r     s#     % %(8 %J %Sa %r   c           	     s   \         P                  ! V4      '       g   . # . pR R lp\        P                  ! W4      pV'       dy   \        P
                  ! V4      p\        P                  ! Wb4      p\        P                  ! Wg4      '       d1   RVRVRV.p\        P                  ! \        P                  VR4       Tp\        P                  ! V4      '       dV   \        P                  ! V4      '       d:   \        P
                  ! V4      p\        V^ \         P                  ! V4      V4      .# RV.p\        P                  ! \        P                  VR4       \         P                   ! W4      p	\"        P$                  ! 4       P'                  R4      '       gA   V	 U
u. uF4  q^ ,          '       g   K  V
^ ,          P)                  4       '       g   K2  V
NK6  	  p	p
R	\+        V	4      R
V.p\        P                  ! \        P                  VR4       V	 F'  w  rpVP-                  V P/                  WW4      4       K)  	  V# u up
i )z1Returns a list of TextZones for the given object.c               rW   )r   r0   rn   r$   rY   r   r   r   r   r   Z2Context._get_zones_from_text.<locals>.__annotate__  s     	O 	O- 	O$ 	Or   c                sj    \         P                  ! V 4      ;'       g    \         P                  ! V 4      # N)r   Zis_scroll_paneZis_document)r0   r=   r   _is_containerZ3Context._get_zones_from_text.<locals>._is_container  s&    --a0NNK4K4KA4NNr   zFLAT REVIEW: Cliprectz->ZfromTzFLAT REVIEW: Getting lines forZspeakBlankLinesFLAT REVIEW:zlines found for)r
   Zhas_presentable_textr	   Zfind_ancestorr   r/   r  Zis_same_rectr   r   r   Zsupports_editable_textr   Zis_single_liner   Zget_all_textZget_visible_linesr   r   Zget_settingZstriprV   extendr  )r   rH   r  r   r  r  r6   r  r   linesZtr   r   Z_end_offsets   &&&           r   _get_zones_from_textZContext._get_zones_from_text  s    **3//I "	O **3>	''	2D&<<TLL'';;18T4QZ[""5#3#3VTB**3//K4N4Ns4S4S'',DS!V%8%8%=tDEE2C85++VT:((7++-99:KLL %?11Q!A$**,QQE? #e*.?E5++VT:16-F+LL44S,YZ 27  @s   H<1H<H<c               r   )r   rH   rn   r  rF   r$   r   r   r   r   r   r   r     s#      *: j U_ r   c                st   \         P                  ! V4      p\        V P                  W4      4      pV'       g   \        P
                  ! V4      '       d   VP                  \        W4      4       MRp\        P                  ! V4      '       g(   V P                  P                  P                  VRR7      pV'       g&   V P                  P                  P                  V4      pV'       d   VP                  \        WV4      4       \        W4      pVP!                  4       '       d   VP#                  ^ V4       V# )z-Returns a list of Zones for the given object.r   T)ZinFlatReview)r   r/   r  r  r	   r   r   r   r   Zis_table_rowr   r   Zget_namer{   ro   r   r>   Zinsert)r   rH   r  r6   r   r   rQ   s   &&&    r   _get_zones_from_objectZContext._get_zones_from_object  s     ##C( !:!:3!IJ&&s++Ys12"//44!\\::CCCVZC[F!\\::HHMFLLc4!89#??LLD!r   c               rW   )r   rH   rn   r$   rY   r   r   r   r   r   r     s     % %3C % %r   c                s   RV P                  4       RV P                   RV P                   R2RV P                   RV P                   R2.p\
        P                  ! \
        P                  VR4       V P                  V4      pR	VR
V.p\
        P                  ! \
        P                  VR4       Vf   R# \        V P                  4       F  w  rEVP                  V4      pV^ 8  d   K  W@n        W`n        VP                  4       w  rxV'       d   VP                  V4      V n        Wn        Rp	\
        P                  ! \
        P                  V	R4        M,	  Rp	\
        P                  ! \
        P                  V	R4       R# RV P                  4       RV P                   RV P                   R2RV P                   RV P                   R2.p\
        P                  ! \
        P                  VR4       R# )zJAttempts to set the current zone to obj, if obj is in the current context.zFLAT REVIEW: Currentzline: z, zone: Z,zword: z, char: r*   TzFLAT REVIEW: Zone withZisFz"FLAT REVIEW: Updated current zone.z+FLAT REVIEW: Failed to update current zone.zFLAT REVIEW: Updated)get_current_objectr   r   r   r  r   r   r   r
  r_   r   r   r   r   r   )
r   rH   r   rQ   ra   rt   re   r   rh   r   
   &&        r   set_current_to_zone_with_objectZ'Context.set_current_to_zone_with_object  s    )$*A*A*C4++,HT5E5E4FaH4++,HT5E5E4FaHJ 	5++VT:**3/*Ct<5++VT:< -GA**40Eqy $//1LD#'#9#9$#? #) 6C 0 0#t< . @C 0 0#t<($*A*A*C4++,HT5E5E4FaH4++,HT5E5E4FaHJ 	5++VT:r   c               rW   )r   rH   r   r$   r   r   r   r   r   r   r   %  s      *A k r   c                s   Vf   R# V P                   P                  V. 4      ;p'       d-   V F  pVP                  4       '       g   K  Vu # 	  V^ ,          # \        P                  ! V4      ;p'       d.   V P                   P                  V. 4      ;p'       d
   V^ ,          # \        P
                  ! V4       F2  pV P                   P                  V. 4      ;p'       g   K)  V^ ,          u # 	  R# )z-Returns the existing zone which contains obj.N)r  r   r   r	   r   Ziter_children)r   rH   Zmatching_zonesrQ   ZparentZparent_zonesZchildZchild_zonesr   r   r
  ZContext._find_zone_with_object%  s     ;!5599#rBB>B&>>##K ' "!$$ ((--6-#77;;FBGG|G#A&++C0E"66::5"EE{EE"1~% 1 r   c               r   )r   r   rn   boundingboxzAtspi.Rect | Noner$   r   r   r   r   r   r   r   =  s(       ' 
	r   c                s|   Vf   V P                   p\        P                  ! W4      pR\        V4      RV.p\        P
                  ! \        P                  VR4       . p\        V4      pV F  pVP                  \        P                  ! V4      4      '       d   K0  V P                  Wr4      pV'       g?   V P                  P                  P                  V4      p	V	'       d   V P                  W4      pVP                  V4       K  	  R\        V4      RV.p\        P
                  ! \        P                  VR4       V# )z5Returns an unsorted list of all the zones under root.r  zon-screen objects found forTzzones found for)r   r   Zget_on_screen_objectsrV   r   r   r   Zsetr  Zget_is_label_forr  r   r  Zactive_descendantr  )
r   r   r  Zobjsr   Z	all_zonesZobj_setZor   Z
descendants
   &&&       r   r	  ZContext._get_showing_zones=  s    **K00C #d)-JDQ5++VT: "	d)A##K$@$@$CDD//?E!\\33EEaH
 77
PEU#  !#i.2CTJ5++VT:r   c               rW   )r   r   r   r$   z
list[Line]r   r   r   r   r   r   \  s      J : r   c                sj   V'       g   . # VP                  R R7       . pV^ ,          .pVR,           F[  pVP                  VR	,          4      '       d   VP                  V4       K4  VP                  R R7       VP                  V4       V.pK]  	  V'       d%   VP                  R R7       VP                  V4       . p\        V4       F0  w  rg\	        Wg4      pVP                  V4       V F	  pWn        K  	  K2  	  R\        V4      R.p	\        P                  ! \        P                  V	R4       V# )
z?Returns a sorted list of Line clusters containing sorted Zones.c                6    V P                  4       P                  # r  )r/   r1   )rQ   r=   r   r  0Context._cluster_zones_by_line.<locals>.<lambda>b  s    DMMO$5$5r   )r   :i   NNc                r   r  r/   r0   Zzr=   r   r  r!  i  s    1::<>>r   c                r   r  r"  r#  r=   r   r  r!  n  s    qzz|~~r   z!FLAT REVIEW: Zones clustered intor  Tri   )
Zsortr   r   r_   r   rt   rV   r   r   r   )
r   r   Zline_clustersZcurrent_clusterrQ   r  Z
line_indexZzones_in_linert   r   r  r   r  ZContext._cluster_zones_by_line\  s    I

5
6*, 8*"IID  !455&&t,$$)A$B$$_5#'&    %= >  1)2=)A%J
2DLL% 	 & *B 6s5z7K5++VT:r   c               r"   r#   r   r   r   r   r   r   |  s       r   c                s    V P                  4       ;p'       d-   VP                  '       d   VP                  P                  4       # R# )z'Returns the string of the current line.r   )_get_current_zonert   r>   r   rI   r   get_current_line_stringZContext.get_current_line_string|  s7     ))++4+yyyyy++--r   c               r"   r#   r   r   r   r   r   r     s       r   c                sV    V P                  4       ;p'       d   VP                  4       # R# )z'Returns the string of the current zone.r   )r$  r>   r   rI   r   get_current_zone_stringZContext.get_current_zone_string  s(     ))++4+??$$r   c               r"   r#   r   r   r   r   r   r     s     
! 
! 
!r   c                s    V P                  4       pV'       g   R# VP                  4       ;p'       d!   W P                  ,          P                  4       # VP                  4       # )z'Returns the string of the current word.r   )r$  r   r   r>   r   rQ   r   r   r   get_current_word_stringZContext.get_current_word_string  sO     %%'NN$$5$))*5577  r   c               r"   r#   r   r   r   r   r   r     s      c r   c                s    V P                  4       pV'       g   R# VP                  4       pV'       g   R# W P                  ,          pVP                  V P                  4      ;p'       d   VP                  4       # R# )z,Returns the string of the current character.r   )r$  r   r   rf   r  r>   r   rQ   r   r   Zcharr   r   get_current_character_stringZ$Context.get_current_character_string  sd     %%' %%&..t/?/?@@4@??$$r   c               r"   rE   r   r   r   r   r   r     s      Z r   c                sj   V P                  4       pV'       g   \        P                  ! 4       # VP                  4       pV'       g   \        P                  ! 4       # W P                  ,          pVP                  V P                  4      ;p'       d   VP                  4       # \        P                  ! 4       # )z-Returns the extents of the current character.)r$  r   r  r   r   rf   r  r/   r)  r   r   _get_current_character_rectZ#Context._get_current_character_rect  s~     %%'::< ::<%%&..t/?/?@@4@==?"zz|r   c               r"   )r   r$   tuple[int, int, int, int]r   r   r   r   r   r     s     V V&? Vr   c                s^    V P                   V P                  V P                  V P                  3# )zMReturns the location as a (lineIndex, zoneIndex, wordIndex, charIndex) tuple.r   r   r   r  r<   r=   r   get_current_locationZContext.get_current_location  s+     !1!143C3CTEUEUUUr   c               rW   )r   locationr,  r$   rp   r   r   r   r   r   r     s     Z Z-F Z4 Zr   c                s<    Vw  V n         V n        V n        V n        R# )zPSets the location to the specified (lineIndex, zoneIndex, wordIndex, charIndex).Nr-  )r   r/  rj   r   set_current_locationZContext.set_current_location  s      RZN$*D,<d>Nr   c               r   )r   rQ   ro   offset_in_zoner   r$   rp   r   r   r   r   r   r     s!     0 0T 03 0t 0r   c                s   Ve   VP                   f   R# VP                   P                  4       V n        V P                  V P                  ,          P	                  V4      V n        ^ V n        ^ V n        VP                  4       pVP                  W2,           4      w  rEV'       d   VP                  V4      V n        WPn        R# R# )zSets zone as the current zone.N)rt   r   r   r   r   r   r   r  rC   r   r   )r   rQ   r1  Ztext_offsetr   Zcharacter_offsetr   r   set_current_zoneZContext.set_current_zone  s     <499,99446;;t'7'78JJ4P++-!%!8!89U!V#55d;D/ r   c               r"   )r   r$   r   r   r   r   r   r   r     s     ' '; 'r   c                sh   V P                   '       d1   ^ V P                  u;8:  d   \        V P                   4      8  g    R#  R# V P                   V P                  ,          pVP                  4       pV'       d'   ^ V P                  u;8:  d   \        V4      8  g    R#  R# W P                  ,          # )zReturns the current Zone.N)r   r   rV   r   r   )r   rt   r   r   r   r$  ZContext._get_current_zone  s     T%5%5 HDKK8H H !I{{4++, d..;U; <%%&&r   c               r"   r@   r   r   r   r   r   r     s       r   c                s    V P                  4       pVf   R# VP                  4       pV'       g   R# W P                  ,          pVP                  V P                  4      ;p'       d   VP                  4       # R# )z6Returns the current text offset in the current object.ri   )r$  r   r   rf   r  rC   r)  r   r   get_current_text_offsetZContext.get_current_text_offset  sn     %%'<I I%%&..t/?/?@@4@((**	r   c               r"   )r   r$   r   r   r   r   r   r   r     s     ! !$; !r   c                sV    V P                  4       pV'       g   R# VP                  4       # )zReturns the current object.N)r$  rG   r   rI   r   r  ZContext.get_current_object  s%     %%'  r   c               r"   )r   r$   z2tuple[list[braille.Region], braille.Region | None]r   r   r   r   r   r     s     ' '-_ 'r   c                s   V P                   '       g   . R3# RpV P                   V P                  ,          pVP                  4       pV P                  4       pVf   VR3# VP	                  4       pVf   VR3# ^ Vn        VP                  4       ;p'       d   V;P
                  V^ ,          P                  4       VP                  4       ,
          ,          un        \        V P                  4       F9  pV;P
                  \        WV,          P                  4       4      ,          un        K;  	  V;P
                  V P                  ,          un        VP                  4        W13# )z*Returns a (regions, focused-region) tuple.N)r   r   r   r$  r   Zcursor_offsetr   rC   r`   r   rV   r>   r  Zreposition_cursor)r   Zfocused_regionrt   r   rQ   r   Z
word_indexr   r   get_current_braille_regionsZ#Context.get_current_braille_regions  s!    {{{t8O{{4++,**,%%'<D= 002!D= '($NN$$5$((E!H,E,E,G$J_J_Ja,aa(#D$4$45
,,E4E4P4P4R0SS, 6$$(8(88$((*&&r   c               rW   r   review_typer   r$   rY   r   r   r   r   r   r     s     b b# b4 br   c                sZ   V P                   V P                  V P                  V P                  .p^ V n        ^ V n        V\        P
                  8X  d   ^ V n        ^ V n         MV\        P                  8X  d   ^ V n        W P                   V P                  V P                  V P                  .8g  # )zDReturns True if moving to the start of the specified type succeeded.)r   r   r   r  r   WINDOWLINE)r   r6  beforer   r   go_to_start_ofZContext.go_to_start_of  s     ""D$4$4d6F6FHXHXY'..( D DGLL( D**D,<,<d>N>NPTP`P`aaar   c               rW   r5  r   r   r   r   r   r   !  s     b b b br   c                s,   V P                   '       g   R# V P                  V P                  V P                  V P                  .pV\
        P                  8X  d#   \        V P                   4      ^,
          V n        MUV\
        P                  8X  dA   \        V P                   V P                  ,          P                  4       4      ^,
          V n        V P                  4       pVf   R# VP                  4       ;p'       d\   \        V4      ^,
          V n        W@P                  ,          pVP                  4       p\        \        V4      ^,
          ^ 4      V n        M^ V n        ^ V n        W P                  V P                  V P                  V P                  .8g  # )zBReturns True if moving to the end of the specified type succeeded.F)r   r   r   r   r  r   r7  rV   r8  r   r$  r   rd   r   )r   r6  r9  rQ   r   r   charss   &&     r   go_to_end_ofZContext.go_to_end_of!  s5    {{{""D$4$4d6F6FHXHXY'..("4;;/!3DGLL("4;;t/?/?#@#J#J#LMPQQD%%'<NN$$5$"5zA~D))*D'')E"3u:>15D D D**D,<,<d>N>NPTP`P`aaar   c               rg   r   wraprY   r$   r   r   r   r   r   r   ;  s      T d r   c                s   V P                   ^ 8  d1   V ;P                   ^,          un         ^ V n        ^ V n        ^ V n        R# V'       g   R# \	        ^ \        V P                  4      ^,
          4      V n         ^ V n        ^ V n        ^ V n        R# )z6Returns True if moving to the previous line succeeded.TF)r   r   r   r  r   rV   r   r   r>  rj   r   go_previous_lineZContext.go_previous_line;  s|     a! D D Dq#dkk"2Q"67r   c               rg   r=  r   r   r   r   r   r   N  s       $ r   c                s   V P                   \        V P                  4      ^,
          8  d1   V ;P                   ^,          un         ^ V n        ^ V n        ^ V n        R# V'       g   R# ^ V n         ^ V n        ^ V n        ^ V n        R# )z2Returns True if moving to the next line succeeded.TF)r   rV   r   r   r   r  r?  rj   r   go_next_lineZContext.go_next_lineN  su     s4;;/!34! D D Dr   c               r"   r}   r   r   r   r   r   r   a  s      $ r   c                s^   V P                   ^ 8  d*   V ;P                   ^,          un         ^ V n        ^ V n        R# V P                  4       '       g   R# V P                  V P
                  ,          P                  4       p\        \        V4      ^,
          ^ 4      V n         ^ V n        ^ V n        R# )z6Returns True if moving to the previous zone succeeded.TF)	r   r   r  r@  r   r   r   r   rV   r   r   rI   r   go_previous_zoneZContext.go_previous_zonea  s     a! D D$$&&D,,-779s5zA~q1r   c               r"   r}   r   r   r   r   r   r   s  s     
# 
#d 
#r   c                s   V P                   V P                  ,          P                  4       pV P                  \	        V4      ^,
          8  d*   V ;P                  ^,          un        ^ V n        ^ V n        R# V P                  4       # )z2Returns True if moving to the next zone succeeded.T)r   r   r   r   rV   r   r  rA  rB  rI   r   go_next_zoneZContext.go_next_zones  sj     D,,-779c%j1n,! D D  ""r   c               r"   r}   r   r   r   r   r   r     s      $ r   c                s    V P                   ^ 8  d#   V ;P                   ^,          un         ^ V n        R# V P                  4       '       g   R# V P                  \        P
                  4       R# )z6Returns True if moving to the previous word succeeded.TF)r   r  rC  r<  r   ZONEr<   r=   r   go_previous_wordZContext.go_previous_word  sU     a! D$$&&',,'r   c               r"   r}   r   r   r   r   r   r     s     # #d #r   c                s    V P                  4       pVf   R# VP                  4       pV P                  \        V4      ^,
          8  d#   V ;P                  ^,          un        ^ V n        R# V P                  4       # )z2Returns True if moving to the next word succeeded.FT)r$  r   r   rV   r  rD  r'  r   r   go_next_wordZContext.go_next_word  sg     %%'< c%j1n,! D  ""r   c               r"   r}   r   r   r   r   r   r     s      t r   c                s~   V P                   ^ 8  d   V ;P                   ^,          un         R# V P                  4       '       g   R# V P                  4       pVf   R# VP                  4       ;p'       dD   W P                  ,          P                  4       p\        \        V4      ^,
          ^ 4      V n         R# ^ V n         R# )z;Returns True if moving to the previous character succeeded.TF)r  rF  r$  r   r   rd   r   rV   r   rQ   r   r;  r7   r   go_previous_characterZContext.go_previous_character  s     a!$$&&%%'<NN$$5$**+::<E"3u:>15D   !Dr   c               r"   r}   r   r   r   r   r   r     s     # #4 #r   c                s6   V P                  4       pVf   R# VP                  4       ;p'       d]   W P                  ,          P                  4       pV P                  \        V4      ^,
          8  d   V ;P                  ^,          un        R# V P                  4       # )z7Returns True if moving to the next character succeeded.FT)r$  r   r   rd   r  rV   rG  rH  r7   r   go_next_characterZContext.go_next_character  s|     %%'<NN$$5$**+::<E3u:>2  A%   ""r   c               r"   r}   r   r   r   r   r   r     s      t r   c                   V P                  4       pVP                  VP                  ^,          ,           pV P                  4       '       g   R# V P                  4       pVP                  VP                  ,           V8  d   R# V P	                  4       '       d8   V P                  4       pVP                  VP                  ,           V8  g   KJ   R# R# )z$Returns True if moving up succeeded.FT)r+  r0   r2   r@  rJ  r   r6   Ztarget_xr   r   go_upZContext.go_up  s     //166TZZ!^,$$&&//166DJJ(*$$&&335Dvv

"h.r   c               r"   r}   r   r   r   r   r   r     s       r   c                rK  )z&Returns True if moving down succeeded.FT)r+  r0   r2   rA  rJ  rL  r   r   go_downZContext.go_down  s     //166TZZ!^,  ""//166DJJ(*$$&&224Dvv

"h.r   )r  r  r  r  r   r   r  r   r   r  r   r   r   r  r  rZ   )+rJ   rK   rL   rM   rN   ZCHARZWORDrE  r8  r7  r!   r  r  r  r  r
  r	  r  r%  r&  r(  r*  r+  r.  r0  r2  r$  r3  r  r4  r:  r<  r@  rA  rC  rD  rF  rG  rI  rJ  rM  rN  rO   r   r   r   r   r   d  s    LDDDDF=9~(%N.%N0>@
! "V
Z
0"'!'8 17 b /5 b4&&$
##(#& r   r   )$rN   Z
__future__r    Z__id__Z__version__Z__date__Z__copyright__Z__license__r   ZgiZrequire_versionZgi.repositoryr   r   r   r   r   r   r   r   Zax_componentr   Z	ax_objectr	   Zax_textr
   Zax_utilitiesr   r   rP   ro   r   r   r   r   r   r   r   r   <module>rO     s   4 D #7 	 	   7E "        %   %+ +Z[' ['zm m^bKt bKJ%C %CL) )X; ;z}	 }	r   