+
    Qi  c                   s    R t RtRtRtRtRt^ RI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 R4      t]P)                  4        R# )KUtilities for obtaining value-related information about accessible objects.z$Id$z
$Revision$z$Date$zGCopyright (c) 2024 Igalia, S.L.Copyright (c) 2024 GNOME Foundation Inc.ZLGPLNAtspiz2.0)r   )GLib)debug)AXObject)AXUtilitiesc                   sR  a  ] tR t^-t o Rt/ t]P                  ! 4       t]	V 3R lR l4       t
]	V 3R lR l4       t]	V 3R lR l4       t]	V 3R lR	 l4       t]	V 3R
 lR l4       t]	V 3R lR l4       t]	V 3R lR l4       t]	V 3R lR l4       t]	V 3R lR l4       tV 3R ltRtV tR# )AXValuer    c                   < V ^8  d   QhRR/#    returnN Zformat__classdict__   "2/usr/lib/python3.14/site-packages/orca/ax_value.py__annotate__AXValue.__annotate__4   s     - - -    c                 s     \         P                  ! ^<4       Rp \        P                  ! \        P                  V R4       \
        P                  P                  4        K_  )z*Clears any data we have cached for objectsTzAXValue: Clearing local cache.)timeZsleepr   print_message
LEVEL_INFOr   LAST_KNOWN_VALUEZclear)msg    r   _clear_stored_dataZAXValue._clear_stored_data3   sA     JJrN2C 0 0#t<$$**,r   c                r   r   r   r   r   r   r   r   >   s       r   c                 s~    \         P                  ! \        P                  R7      p RV n        V P                  4        R# )z3Starts thread to periodically clear cached details.)ZtargetTN)	threadingZThreadr   r   ZdaemonZstart)Zthreadr   r   start_cache_clearing_threadZ#AXValue.start_cache_clearing_thread=   s*     !!)C)CDr   c                :   < V ^8  d   QhRS[ P                  RS[/# r	   objr
   )r   
AccessibleZboolr   r   r   r   r   F   s!      e.. 4 r   c                s.   \         P                  ! V 4      '       g   R# \        P                  P	                  \        V 4      4      pV\        P                  V 4      8g  pV'       d/   RV RV 2.p\        P                  ! \        P                  VR4       V# )z*Returns True if the current value changed.FzAXValue: Previous value ofzwas T)
r   supports_valuer   r   Zgethash_get_current_valuer   print_tokensr   )r   Z	old_valueresulttokenss   &   r   did_value_changeZAXValue.did_value_changeE   sz     &&s++,,00c;	g88==2C4	{9KLFu//>r   c                r   r   r   r   floatr   r   r   r   r   U   s!       0 0 U r   c                z   \         P                  ! V 4      '       g   R#  \        P                  P	                  V 4      pRT RT 2.p\        P                  ! \        P                  TR4       T#   \
        P                   d7   pRT 2p\        P                  ! \        P                  TR4        Rp?R# Rp?ii ; i)!Returns the current value of obj.        z*AXValue: Exception in _get_current_value: TNAXValue: Current value ofis )r   r    r   Valueget_current_valuer   GErrorr   r   r   r#   r   valueerrorr   r%      &    r   r"   ZAXValue._get_current_valueT   s     &&s++	KK11#6E .sc%MB5++VT: {{ 	>ugFC 0 0#t<	   A/ /B:+B55B:c                r   r   r'   r   r   r   r   r   g   s!      u// E r   c                s    \         P                  ! V 4      '       g   R# \        P                  V 4      pV\        P                  \        V 4      &   V# )r*   r+   )r   r    r   r"   r   r!   )r   r2   s   & r   r/   ZAXValue.get_current_valuef   sA     &&s++**3/.3  c+r   c                r   r   )r   r   strr   r   r   r   r   r   s!     / /E$4$4 / /r   c                s
   \         P                  ! V RR4      ;'       g    RpV'       d2   RV RV R2.p\        P                  ! \        P                  VR4       V# \         P
                  ! V 4      '       g   R#  \        P                  P                  V 4      pR
V RV R2.p\        P                  ! \        P                  VR4       V'       d   V# \        P                  V 4      p\        V4      ^8  d5   V^ 8w  d.   \        V4      p\!        VP#                  R4      ^,          4      pM^ pVRV R2 #   \        P                   d8   pRT 2p\        P                  ! \        P                  TR4       Rp R	p?LR	p?ii ; i)zGReturns the app-provided text-alternative for the current value of obj.Z	valuetextF z AXValue: valuetext attribute forzis 'Z'Tz.AXValue: Exception in get_current_value_text: NzAXValue: Value text ofZ.Zf)r   Zget_attributer   r#   r   r    r   r.   Zget_textr   r0   r   r   r/   Zabsr6   ZlenZsplit)	r   Ztextr%   r2   r3   r   ZcurrentZstr_currentZdecimal_placess	   &        r   get_current_value_textZAXValue.get_current_value_textq   sU    %%c;>DD"8#dV1~NFu//>K&&s++	KK((-E +C4waA5++VT:L++C0w<!1g,K !2!23!7!:;NN!N+1,-.# {{ 	B5'JC 0 0#t<E	s   ;D6 6F-E==Fc                sH   < V ^8  d   QhRS[ P                  RS[R,          /# )r	   r   r
   N)r   r   intr   r   r   r   r      s%      %"2"2 sTz r   c                s
   \         P                  ! V 4      '       g   R# \        P                  V 4      p\        P
                  ! V 4      '       d5   V^ 8:  d.   RV R.p\        P                  ! \        P                  VR4       R# \        P                  V 4      p\        P                  V 4      pW48X  d   R# \        WV,
          ,          ^d,          4      pRV RV 2.p\        P                  ! \        P                  VR4       V# )zJReturns the current value as a percent, or None if that is not applicable.NzAXValue:zhas state indeterminateTr,   zas percent is is )r   r    r   r/   r   Zis_indeterminater   r#   r   get_minimum_valueget_maximum_valuer9   )r   r2   r%   ZminimumZmaximumr$   s   &     r   get_value_as_percentZAXValue.get_value_as_percent   s     &&s++))#.'',,! #'@AFu//>++C0++C0e01S89-s6Gx4PQ5++VT:r   c                r   r   r'   r   r   r   r   r      !      u// E r   c                r)   )z!Returns the minimum value of obj.r+   z)AXValue: Exception in get_minimum_value: TNzAXValue: Minimum value ofr-   )r   r    r   r.   r:   r   r0   r   r   r   r#   r1   r4   r   r:   ZAXValue.get_minimum_value        &&s++	KK11#6E .sc%MB5++VT: {{ 	=eWEC 0 0#t<	r5   c                r   r   r'   r   r   r   r   r      r=   r   c                r)   )z!Returns the maximum value of obj.r+   z)AXValue: Exception in get_maximum_value: TNzAXValue: Maximum value ofr-   )r   r    r   r.   r;   r   r0   r   r   r   r#   r1   r4   r   r;   ZAXValue.get_maximum_value   r>   r5   c                s<   < V ^8  d   Qh/ S[ S[S[3,          ;R&   # )r	   r   )Zdictr9   r(   r   r   r   r   r   -   s      3:&+ r   r   N)Z__name__Z
__module__Z__qualname__Z__firstlineno____doc__r   r   ZLockZ_lockZstaticmethodr   r   r&   r"   r/   r8   r<   r:   r;   Z__annotate_func__Z__static_attributes__Z__classdictcell__)r   s   @r   r   r   -   s     U)+NNE- -      "   / /B  ,  "  a  r   r   )r?   Z__id__Z__version__Z__date__Z__copyright__Z__license__r   r   ZgiZrequire_versionZgi.repositoryr   r   r7   r   Z	ax_objectr   Zax_utilitiesr   r   r   r   r   r   <module>r@      si   0 R;   	   7E "     %_ _B  # # %r   