+
    Six"                       R t ^ RIHt ^ RIHtHt ^ RIHt ^ RIHt ^ RI	H
t
Ht ^ RIHt ^ RIHt ^ RIHt ]
'       d   ^ R	IHtHt ^ R
IHtHt  ^ RIHt ]! 4       t^t ! R R]R7      tR#   ] d    ^ RIHt ]P6                  t L2i ; i)zXThis is part of the MSS Python's module.
Source: https://github.com/BoboTiG/python-mss.
)annotations)ABCMetaabstractmethod)datetime)Lock)TYPE_CHECKINGAny)ScreenShotError)
ScreenShot)to_png)CallableIterator)MonitorMonitors)UTC)timezonec                  "   ] tR t^"tRt0 R'mtR^RRRRR^ /R R	 lltR
 R ltR R lt]	R R l4       t
]	R R l4       t]	R R l4       tR R ltR R lt]R R l4       tR^ RRRR/R R lltR  R! lt]R" R# l4       t]R(R$ R% ll4       tR&tR# ))MSSBasez7This class will be overloaded by a system specific one.compression_levelwith_cursorFdisplayNmax_displaysc          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
   r   intr   boolr   zbytes | str | Noner   returnNone )formats   "N/Users/mibo/.openclaw/workspace/.venv/lib/python3.14/site-packages/mss/base.py__annotate__MSSBase.__annotate__'   s>     & & 	&
 & $& & 
&    c              	B    \         V n        Wn        W n        . V n        R # N)r
   	cls_imager   r   	_monitors)selfr   r   r   r   s   "$$$$r    __init__MSSBase.__init__'   s     ,6!2&#%r#   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r    r!   r"   7   s      7 r#   c                    V # )'For the cool call `with MSS() as mss:`.r   r(   s   &r    	__enter__MSSBase.__enter__7   s    r#   c                    V ^8  d   QhRRRR/# )r   _objectr   r   r   )r   s   "r    r!   r"   ;   s      6 d r#   c                &    V P                  4        R# )r-   N)close)r(   r2   s   &*r    __exit__MSSBase.__exit__;   s    

r#   c                   V ^8  d   QhRR/# )r   r   zScreenShot | Noner   )r   s   "r    r!   r"   @   s     ? ?/ ?r#   c                    R# )z0Retrieve all cursor data. Pixels have to be RGB.Nr   r.   s   &r    _cursor_implMSSBase._cursor_impl?       r#   c                    V ^8  d   QhRRRR/# )r   monitorr   r   r
   r   )r   s   "r    r!   r"   D   s      '  r#   c                   R# )zmRetrieve all pixels from a monitor. Pixels have to be RGB.
That method has to be run using a threading lock.
Nr   )r(   r>   s   ""r    
_grab_implMSSBase._grab_implC   r<   r#   c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r    r!   r"   J   s       r#   c                    R# )zcGet positions of monitors (has to be run using a threading lock).
It must populate self._monitors.
Nr   r.   s   &r    _monitors_implMSSBase._monitors_implI   r<   r#   c                   V ^8  d   QhRR/# rC   r   )r   s   "r    r!   r"   O   s      t r#   c                    R# )z	Clean-up.Nr   r.   s   &r    r5   MSSBase.closeO   r<   r#   c                    V ^8  d   QhRRRR/# )r   r>   z#Monitor | tuple[int, int, int, int]r   r
   r   )r   s   "r    r!   r"   R   s      ? z r#   c          
        \        V\        4      '       dC   RV^ ,          RV^,          RV^,          V^ ,          ,
          RV^,          V^,          ,
          /p\        ;_uu_ 4        V P                  V4      pV P                  '       d4   V P                  4       ;p'       d   V P                  W#4      uuRRR4       # VuuRRR4       #   + '       g   i     R# ; i)a"  Retrieve screen pixels for a given monitor.

Note: *monitor* can be a tuple like the one PIL.Image.grab() accepts.

:param monitor: The coordinates and size of the box to capture.
                See :meth:`monitors <monitors>` for object details.
:return :class:`ScreenShot <ScreenShot>`.
lefttopwidthheightN)
isinstancetuplelockr@   r   r:   _merge)r(   r>   
screenshotcursors   ""  r    grabMSSBase.grabR   s     gu%%
wqzgaj0'!*wqz1	G T1Jt/@/@/B%BV%B{{:6 T 	 TTTs   ';C
#C
>C

C	c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r    r!   r"   k   s      ( r#   c                    V P                   '       g4   \        ;_uu_ 4        V P                  4        RRR4       V P                   # V P                   #   + '       g   i     T P                   # ; i)a  Get positions of all monitors.
If the monitor has rotation, you have to deal with it
inside this method.

This method has to fill self._monitors with all information
and use it as a cache:
    self._monitors[0] is a dict of all monitors together
    self._monitors[N] is a dict of the monitor N (with N > 0)

Each monitor is a dict with:
{
    'left':   the x-coordinate of the upper-left corner,
    'top':    the y-coordinate of the upper-left corner,
    'width':  the width,
    'height': the height
}
N)r'   rR   rE   r.   s   &r    monitorsMSSBase.monitorsj   sL    & ~~~##%  ~~t~~  ~~s   AA-	monoutputzmonitor-{mon}.pngcallbackc               (    V ^8  d   QhRRRRRRRR/# )	r   r\   r   r]   strr^   zCallable[[str], None] | Noner   zIterator[str]r   )r   s   "r    r!   r"      s4     > > 	>
 > /> 
>r#   c         
   #  V  "   V P                   pV'       g   Rp\        V4      hV^ 8X  d   \        VR,          ^4       F  w  rgVP                  ! R
RTRRV9   d   \        P
                  ! \        4      MR/VB p\        V4      '       d	   V! V4       V P                  V4      p	\        V	P                  V	P                  V P                  VR7       Vx  K  	  R# VR8X  d   ^ MTp WA,          pTP                  ! R
RTRRT9   d   \        P
                  ! \        4      MR/TB p\        T4      '       d	   T! T4       T P                  T4      p	\        T	P                  T	P                  T P                  TR7       Tx  R#   \         d   p
RT: R	2p\        T4      T
hRp
?
ii ; i5i)a  Grab a screenshot and save it to a file.

:param int mon: The monitor to screenshot (default=0).
                -1: grab one screenshot of all monitors
                 0: grab one screenshot by monitor
                N: grab the screenshot of the monitor N

:param str output: The output filename.

    It can take several keywords to customize the filename:
    - `{mon}`: the monitor number
    - `{top}`: the screenshot y-coordinate of the upper-left corner
    - `{left}`: the screenshot x-coordinate of the upper-left corner
    - `{width}`: the screenshot's width
    - `{height}`: the screenshot's height
    - `{date}`: the current date using the default formatter

    As it is using the `format()` function, you can specify
    formatting options like `{date:%Y-%m-%s}`.

:param callable callback: Callback called before saving the
    screenshot to a file.  Take the `output` argument as parameter.

:return generator: Created file(s).
zNo monitor found.:   NNr\   datez{dateN)levelr]   zMonitor z does not exist.r   )rZ   r	   	enumerater   r   nowr   callablerV   r   rgbsizer   
IndexError)r(   r\   r]   r^   rZ   msgidxr>   fnamesctexcs   "$$$       r    saveMSSBase.save   so    B ==%C!#&&!8 )(2, :p#pTZIZHLL4E`dphopH%%UOii(sww0F0FuU !; by!cC4"-
 ]]msmgQWFWc1B]amelmF!! ))G$C377CHHD,B,B6RL  4 '78%c*34s+   C$F)'F /BF)F&F!!F&&F)c                    V ^8  d   QhRRRR/# )r   kwargsr   r   r`   r   )r   s   "r    r!   r"      s     ) ) ) )r#   c               b    VP                  R^4      VR&   \        V P                  ! R/ VB 4      # )zoHelper to save the screenshot of the 1st monitor, by default.
You can pass the same arguments as for ``save``.
r\   r   )getnextrq   )r(   rt   s   ",r    shotMSSBase.shot   s/     

5!,uDII''((r#   c               $    V ^8  d   QhRRRRRR/# )r   rT   r
   rU   r   r   )r   s   "r    r!   r"      s!     * *: *z * *r#   c          	     X   VP                   VP                  uw  r#w  rEV P                   V P                  uw  rgw  rW$,           W5,           rWh,           Wy,           rW,8  ;'       d    W8  ;'       d    W=8  ;'       d    W8  pV'       g   V # V P                  pVP                  pW7,
          ^,          W,
          ^,          rW&,
          ^,          W,
          ^,          rV^ 8  d   V) M^ pV^ 8  d   V) M^ pV^,          \        V^ 4      ,
          pV^,          \        V
^ 4      ,
          p\	        ^4      p\	        VV^4       F  pVV,           V,          V,           pVV,          p\	        VV^4       F  pVV,           pVV,           pVV^,           ,          pV'       g   K/  V\
        8X  d   VVV^,            VVV^,           % KR  V^,          pV FP  p\        VVV,           ,          V,          VVV,           ,          ^V,
          ,          ,           4      VVV,           &   KR  	  K  	  K  	  V # )z?Create composite image by blending screenshot and mouse cursor.)posrj   rawmaxrangeOPAQUEr   )rT   rU   cxcycwchxywhcx2cy2x2y2overlap
screen_raw
cursor_rawstart_count_ystart_count_xstop_count_ystop_count_xri   count_ypos_spos_ccount_xsposcposalphaalpha2is   ""                             r    rS   MSSBase._merge   s    $ZZ(2#7BGSB'==cg=="'==cg^^
ZZ
6Q,QC6Q,QC!Av1!Av1AvC+AvC+Ah]L!<Gr\Q&+EbLE a@ww"4!8,F?2<TD1H2MJtdQh/"S[F /2:dQh3G&3PS]^bef^fSgkloukuSv3v/w
4!8, ! A	 =& r#   c               0    V ^8  d   QhRRRRRRRRR	RR
R/# )r   errcheckzCallable | Noneattrr   funcr`   argtypesz	list[Any]restyper   r   r   )r   s   "r    r!   r"      sD     % % "%%% % 	% 
%r#   c               T    \        W4      pW%n        W5n        V'       d	   WEn        R# R# )zDFactory to create a ctypes function and automatically manage errors.N)getattrr   r   r   )r   r   r   r   r   meths   """"& r    	_cfactoryMSSBase._cfactory   s%     t" $M r#   )r'   r&   r   r   >   r'   r&   r   r   r%   )__name__
__module____qualname____firstlineno____doc__	__slots__r)   r/   r6   r   r:   r@   rE   r5   rV   propertyrZ   rq   rx   staticmethodrS   r   __static_attributes__r   r#   r    r   r   "   s    ANI& "#	&
 "& '+& &  ? ?  
  
0  0> 	>
 *> 26>@) * *X % %r#   r   )	metaclassN)r   
__future__r   abcr   r   r   	threadingr   typingr   r   mss.exceptionr	   mss.screenshotr
   	mss.toolsr   collections.abcr   r   
mss.modelsr   r   r   ImportErrorr   utcrR   r   r   r   r#   r    <module>r      sn    # '   % ) % 2, v	c% c%  !
,,C	s   A- -B	B	