
    ^j	                         d dl Z d dlZd dl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)PlatformEventLoopc                        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    J/home/agentuser/manim-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.select   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__#   s+    68gii3d3o''r   c                     | j         S r   )r   r   s    r   r   zNotificationDevice.fileno'   s    ##r   c                 l    | j                                          t          j        | j        d           d S )N   1)r"   setr   writer   r   s    r   r'   zNotificationDevice.set*   s/    
&-----r   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.select.   sF    
$a(((6688888r   c                 4    | j                                         S r   )r"   is_setr   s    r   r   zNotificationDevice.poll3   s    {!!###r   N)r   r   r   r#   r   r'   r   r   r   r   r   r   r   "   s_        ( ( ($ $ $. . .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	                      | _        | j                            | j                   d S r   )superr#   r   _notification_devicer'   select_devicesadd)r   	__class__s    r   r#   zXlibEventLoop.__init__8   sS    $6$8$8!!ee 9:::::r   c                 8    | j                                          d S r   )r5   r'   r   s    r   notifyzXlibEventLoop.notify>   s    !%%'''''r   Nc                     g }| j         D ]+}|                                r|                    |           ,|s t          j        | j         dd|          \  }}}|sdS |D ]}|                                 dS )Nr   FT)r6   r   appendr   )r   timeoutpending_devicesdevice_s        r   stepzXlibEventLoop.stepA   s    
 ) 	/ 	/F{{}} /&&v...  	X$*M$2Er2w$W$W!OQ 	5 & 	 	FMMOOOO tr   r   )r   r   r   r#   r:   rA   __classcell__)r8   s   @r   r2   r2   7   s[        ; ; ; ; ;( ( (       r   r2   )
r   r   r    pygletr   pyglet.app.baser   r   r   r2   r   r   r   <module>rE      s    				            - - - - - -       2$ $ $ $ $) $ $ $*! ! ! ! !% ! ! ! ! !r   