
    \
j                         d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ  G d d          Z	 G d de	          Z
 G d	 d
e          ZdS )    N)app)PlatformEventLoop)asbytesc                        e Zd Zd Zd Zd ZdS )XlibSelectDevicec                      t          d          )zSGet the file handle for ``select()`` for this device.

        :rtype: int
        abstractNotImplementedErrorselfs    I/DATA/AppData/hermes/venv/lib/python3.11/site-packages/pyglet/app/xlib.pyfilenozXlibSelectDevice.fileno.   s    
 "*---    c                      t          d          )zPerform event processing on the device.

        Called when ``select()`` returns this device in its list of active
        files.
        r	   r
   r   s    r   selectzXlibSelectDevice.select5   s     "*---r   c                     dS )zCheck if the device has events ready to process.

        :rtype: bool
        :return: True if there are events to process, False otherwise.
        F r   s    r   pollzXlibSelectDevice.poll=   s	     ur   N)__name__
__module____qualname__r   r   r   r   r   r   r   r   -   sA        . . .. . .    r   r   c                   ,    e Zd Zd Zd Zd Zd Zd ZdS )NotificationDevicec                 v    t          j                    \  | _        | _        t	          j                    | _        d S N)ospipe_sync_file_read_sync_file_write	threadingEvent_eventr   s    r   __init__zNotificationDevice.__init__G   s+    68gii3d3o''r   c                     | j         S r   )r   r   s    r   r   zNotificationDevice.filenoK   s    ##r   c                     | j                                          t          j        | j        t          d                     d S )N1)r#   setr   writer    r   r   s    r   r(   zNotificationDevice.setN   s5    
&55555r   c                     | j                                          t          j        | j        d           t
          j                                         d S )N   )r#   clearr   readr   r   platform_event_loopdispatch_posted_eventsr   s    r   r   zNotificationDevice.selectR   sF    
$a(((6688888r   c                 4    | j                                         S r   )r#   is_setr   s    r   r   zNotificationDevice.pollW   s    {!!###r   N)r   r   r   r$   r   r(   r   r   r   r   r   r   r   F   s_        ( ( ($ $ $6 6 69 9 9
$ $ $ $ $r   r   c                   ,     e Zd Z fdZd ZddZ xZS )XlibEventLoopc                     t          t          |                                            t                      | _        t                      | _        | j                            | j                   d S r   )superr3   r$   r   _notification_devicer(   _select_devicesadd)r   	__class__s    r   r$   zXlibEventLoop.__init__\   sY    mT""++---$6$8$8!"uu  !:;;;;;r   c                 8    | j                                          d S r   )r6   r(   r   s    r   notifyzXlibEventLoop.notifyb   s    !%%'''''r   Nc                     g }| j         D ]+}|                                r|                    |           ,|s t          j        | j         dd|          \  }}}|sdS |D ]}|                                 dS )Nr   FT)r7   r   appendr   )r   timeoutpending_devicesdevice_s        r   stepzXlibEventLoop.stepe   s    
 * 	/ 	/F{{}} /&&v...  	Y$*M$2FBPW$X$X!OQ 	5 & 	 	FMMOOOO tr   r   )r   r   r   r$   r;   rB   __classcell__)r9   s   @r   r3   r3   [   s[        < < < < <( ( (       r   r3   )r   r   r!   pygletr   pyglet.app.baser   pyglet.utilr   r   r   r3   r   r   r   <module>rG      s   H 
			            - - - - - -             2$ $ $ $ $) $ $ $*! ! ! ! !% ! ! ! ! !r   