
    ^h                     R    S SK r S SKrS rS rS rS rS rS rS r " S	 S
5      r	g)    Nc            	      $   [         R                  " [         R                  [         R                  -  [         R                  5      n U  Vs/ s H:  o[         R
                     < SUR                  [         R                  S5      < 3PM<     sn$ s  snf )zHReturns a list of strings of window titles for all visible windows.
      QuartzCGWindowListCopyWindowInfo#kCGWindowListExcludeDesktopElementskCGWindowListOptionOnScreenOnlykCGNullWindowIDkCGWindowOwnerNamegetkCGWindowNamewindowswins     P/var/www/html/env/lib/python3.13/site-packages/pygetwindow/_pygetwindow_macos.pygetAllTitlesr      s    
 //0Z0Z]c  ^D  ^D  1D  FL  F\  F\  ]Gelmel^a6445swwv?S?SUW7XYelmmms   	ABc                  8   [         R                  " [         R                  [         R                  -  [         R                  5      n U  HF  nUS   S:X  d  M  U[         R
                     < SUR                  [         R                  S5      < 3s  $    [        S5      e)z7Returns a Window object of the currently active Window.kCGWindowLayerr   r   r   z Could not find an active window.)	r   r   r	   r
   r   r   r   r   	Exceptionr   s     r   getActiveWindowr      s     //0Z0Z]c  ^D  ^D  1D  FL  F\  F\  ]G A%!&";";<cggfFZFZ\^>_``  6
77    c           
         [         R                  " [         R                  [         R                  -  [         R                  5      n/ nU H|  nUS   n[
        R                  " XUS   US   US   US   5      (       d  M5  UR                  U[         R                     < SUR                  [         R                  S5      < 35        M~     U$ )NkCGWindowBoundsXYWidthHeightr   r   )r   r   r	   r
   r   pygetwindowpointInRectappendr   r   r   )xyr   matchesr   ws         r   getWindowsAtr&      s    //0Z0Z]c  ^D  ^D  1D  FL  F\  F\  ]GG!"""1337Qx[QQNNc&*C*C&DcggfNbNbdfFghi  Nr   c                      g N r)   r   r   activater*   $   s    
 	r   c                 F   [         R                  " [         R                  [         R                  -  [         R                  5      nU HW  nX[         R
                     < SUR                  [         R                  S5      < 3;   d  M@  US   nUS   US   US   US   4s  $    g )Nr   r   r   r   r   r   r   r   )titler   r   r%   s       r   getWindowGeometryr-   ,   s    //0Z0Z]c  ^D  ^D  1D  FL  F\  F\  ]G6#<#<=swwvG[G[]_?`aa%&AcFAcFAgJ(<< r   c                 (   [         R                  " [         R                  [         R                  -  [         R                  5      nU HH  nX[         R
                     < SUR                  [         R                  S5      < 3;   d  M@  US   S:g  s  $    g )Nr   r   kCGWindowAlphag        r   )r,   r   r   s      r   	isVisibler0   5   s    //0Z0Z]c  ^D  ^D  1D  FL  F\  F\  ]G6#<#<=swwvG[G[]_?`aa'(C// r   c                      g r(   r)   r)   r   r   isMinimizedr2   <   s     	r   c                       \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rS rS rS rS r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       rSrg)MacOSWindowF   c           	        ^  UT l         U 4S jnU 4S jnT R                  [         5      n[        R                  UR                  UR
                  UR                  UR                  -
  UR                  UR
                  -
  X2S9T l        g )Nc                 <  > TR                  [        5      nUR                  TR                  l        UR
                  TR                  l        UR                  UR                  -
  TR                  l        UR                  UR
                  -
  TR                  l
        g r(   )_getWindowRect_hWndleft_rect_lefttop_topright_widthbottom_height)attrNamerselfs     r   _onRead%MacOSWindow.__init__.<locals>._onReadJ   sd    ##E*A vvDJJeeDJJO !!&& 0DJJ!"AEE!1DJJr   c                    > TR                  UR                  UR                  5        TR                  UR                  UR
                  5        g r(   )moveTor:   r=   resizeTowidthheight)oldBoxnewBoxrE   s     r   	_onChange'MacOSWindow.__init__.<locals>._onChangeQ   s/    KKVZZ0MM&,,6r   )onChangeonRead)	r9   r8   pyrectRectr:   r=   r?   rA   r;   )rE   hWndrF   rO   rD   s   `    r   __init__MacOSWindow.__init__G   sc    
	2	7 &[[!&&0@!((QUUBR]f[w
r   c                 *   U R                  [        5      nUR                  UR                  -
  nUR                  UR
                  -
  nSU R                  R                  < SUR                  < SUR
                  < SU< SU< SU R                  < S3$ )N<z left="z", top="z
", width="z", height="z
", title="z">)	r8   r9   r?   r:   rA   r=   	__class____name__r,   )rE   rD   rK   rL   s       r   __str__MacOSWindow.__str__X   s    &!&& AEE!RVR`R`RiRiklkqkqstsxsxz  BH  JN  JT  JT  U  	Ur   c                 R    U R                   R                  < SU R                  < S3$ )Nz(hWnd=))rZ   r[   r9   rE   s    r   __repr__MacOSWindow.__repr___   s     $ 7 7DDr   c                 b    [        U[        5      =(       a    U R                  UR                  :H  $ r(   )
isinstancer4   r9   )rE   others     r   __eq__MacOSWindow.__eq__c   s!    %-K$**2KKr   c                     [         e)zCloses this window. This may trigger "Are you sure you want to
quit?" dialogs or other actions that prevent the window from
actually closing. This is identical to clicking the X button on the
window.NotImplementedErrorr`   s    r   closeMacOSWindow.closeg   s
    
 "!r   c                     [         e)zMinimizes this window.ri   r`   s    r   minimizeMacOSWindow.minimizen       !!r   c                     [         e)zMaximizes this window.ri   r`   s    r   maximizeMacOSWindow.maximizes   rp   r   c                     [         e)zCIf maximized or minimized, restores the window to it's normal size.ri   r`   s    r   restoreMacOSWindow.restorex   rp   r   c                     [         e)z7Activate this window and make it the foreground window.ri   r`   s    r   r*   MacOSWindow.activate}   rp   r   c                     [         e)z0Resizes the window relative to its current size.ri   )rE   widthOffsetheightOffsets      r   	resizeRelMacOSWindow.resizeRel   rp   r   c                     [         e)z-Resizes the window to a new width and height.ri   )rE   newWidth	newHeights      r   rJ   MacOSWindow.resizeTo   rp   r   c                     [         e)z2Moves the window relative to its current position.ri   )rE   xOffsetyOffsets      r   moveRelMacOSWindow.moveRel   rp   r   c                     [         e)z2Moves the window to new coordinates on the screen.ri   )rE   newLeftnewTops      r   rI   MacOSWindow.moveTo   rp   r   c                     [         e)z2Returns True if the window is currently minimized.ri   r`   s    r   r2   MacOSWindow.isMinimized   
     "!r   c                     [         e)z2Returns True if the window is currently maximized.ri   r`   s    r   isMaximizedMacOSWindow.isMaximized   r   r   c                     [         e)zFReturns True if the window is currently the active, foreground window.ri   r`   s    r   isActiveMacOSWindow.isActive   r   r   c                     [         e)z%Returns the window title as a string.ri   r`   s    r   r,   MacOSWindow.title   r   r   c                     [         er(   ri   r`   s    r   visibleMacOSWindow.visible   rp   r   )r9   r;   N)r[   
__module____qualname____firstlineno__rV   r\   ra   rf   rk   rn   rr   ru   r*   r|   rJ   r   rI   propertyr2   r   r   r,   r   __static_attributes__r)   r   r   r4   r4   F   s    x"UEL""
"
"
"
"
"
"
"
 " " " " " " " " " "r   r4   )
r   r   r   r   r&   r*   r-   r0   r2   r4   r)   r   r   <module>r      s;     n8	=0	f" f"r   