
    \
j                         d dl mZmZmZ d dl mZ d dl mZ d dl mZmZ d dl mZ d dl m	Z	 ddl
mZ  ed	          Z ed
          Z G d d          Z ed          ZdS )    )	ObjCClassObjCSubclassObjCInstance) NSApplicationDidHideNotification)"NSApplicationDidUnhideNotification)
send_superget_selector)PyObjectEncoding)quartz   )SystemCursorNSNotificationCenterNSApplicationc                   8   e Zd Z edd          Ze                    dez             d             Ze                    d          d             Ze                    d          d             Z	e                    d          d	             Z
e                    d
          d             Ze                    d          d             Ze                    d          d             Ze                    d          d             Ze                    d          d             Ze                    d          d             Ze                    d          d             Ze                    d          d             Ze                    d
          d             ZdS )PygletDelegate_ImplementationNSObjectPygletDelegate   @c                 r   t          t          | d                    } | sd S || _        |j                            |            t
                                          }|                    | t          d          t          d            |                    | t          d          t          d            d| _        | S )NinitzapplicationDidHide:zapplicationDidUnhide:F)r   r   _window	_nswindowsetDelegate_r   defaultCenter!addObserver_selector_name_object_r	   r   r   did_pause_exclusive_mouse)selfwindownotificationCenters      ]/DATA/AppData/hermes/venv/lib/python3.11/site-packages/pyglet/window/cocoa/pyglet_delegate.pyinitWithWindow_z-PygletDelegate_Implementation.initWithWindow_3   s    JtV4455 	4 %%d+++ 2??AA<<,455,d	4 	4 	4 	<<,677.	6 	6 	6
 */&    vc                     t                                           }|                    |            d | _        t	          | d           d S )Ndealloc)r   r   removeObserver_r   r   )r   r   s     r    r%   z%PygletDelegate_Implementation.deallocN   sG     2??AA**40004#####r"   zv@c                 :    | j                             d           d S Non_hider   dispatch_eventr   notifications     r    applicationDidHide_z1PygletDelegate_Implementation.applicationDidHide_V       ##I.....r"   c                     | j         j        r:t          j                    r't	          j                     t	          j                     	 | j                             d           d S Non_showr   _is_mouse_exclusiver   CGCursorIsVisibler   unhidehider+   r,   s     r    applicationDidUnhide_z3PygletDelegate_Implementation.applicationDidUnhide_Z   ^    <+ 	0H0J0J 	 !!!##I.....r"   zB@c                 :    | j                             d           dS )Non_closeFr*   r,   s     r    windowShouldClose_z0PygletDelegate_Implementation.windowShouldClose_d   s     	##J///ur"   c                 v    | j                                         \  }}| j                             d||           d S )Non_move)r   get_locationr+   )r   r-   xys       r    windowDidMove_z,PygletDelegate_Implementation.windowDidMove_j   s9    |((**1##Iq!44444r"   c                     | j         r@| j                            d           d| _         | j        j                            d           | j                                         | j                            d           d S )NTFon_activate)r   r   set_exclusive_mouser   setMovable_set_mouse_platform_visibler+   r,   s     r    windowDidBecomeKey_z1PygletDelegate_Implementation.windowDidBecomeKey_o   sv     * 
6\--d333.3T+\#//555		0	0	2	2	2		$	$]	3	3	3	3	3r"   c                    | j         j        r@| j                             d           d| _        | j         j                            d           | j                             d           | j                             d           d S )NFTon_deactivate)r   r4   rE   r   r   rF   rG   r+   r,   s     r    windowDidResignKey_z1PygletDelegate_Implementation.windowDidResignKey_z   s|     <+ 	6L,,U333-1D* L"..u555//555##O44444r"   c                 :    | j                             d           d S r(   r*   r,   s     r    windowDidMiniaturize_z3PygletDelegate_Implementation.windowDidMiniaturize_   r/   r"   c                     | j         j        r:t          j                    r't	          j                     t	          j                     	 | j                             d           d S r1   r3   r,   s     r    windowDidDeminiaturize_z5PygletDelegate_Implementation.windowDidDeminiaturize_   r9   r"   c                 :    | j                             d           d S )N	on_exposer*   r,   s     r    windowDidExpose_z.PygletDelegate_Implementation.windowDidExpose_   s    ##K00000r"   c                 b    t                                           }|                    |            d S )N)r   sharedApplication
terminate_)r   senderNSApps      r    rU   z(PygletDelegate_Implementation.terminate_   s-    //11r"   c                 j    |                                 t          d          k    r| j        j         S dS )Nz
terminate:T)actionr	   r   _is_keyboard_exclusive)r   menuitems     r    validateMenuItem_z/PygletDelegate_Implementation.validateMenuItem_   s4     ??\ : :::|:::tr"   N)__name__
__module____qualname__r   r   methodr
   r!   r%   r.   r8   r<   rB   rH   rK   rM   rO   rR   rU   r\    r"   r    r   r   0   sL       !\*.>??N4 0011  214 3$ $  $ 4  / / ! / 4  / / ! / 4    ! 
 4  5 5 ! 5 4  4 4 ! 4 4  5 5 ! 5 4  / / ! / 4  / / ! / 4  1 1 ! 1 4    !  4    !   r"   r   r   N)pyglet.libs.darwin.cocoapyr   r   r   r   r   r   r	   r
   r   systemcursorr   r   r   r   r   ra   r"   r    <module>rd      s   H M L L L L L L L L L G G G G G G I I I I I I ? ? ? ? ? ? ? ? 7 7 7 7 7 7 - - - - - - & & & & & & y!788 	/**t t t t t t t tn +,,r"   