
    ^j                       d Z ddlmZ ddlZddlZddlZddlZddlmZ ddlm	Z	  e
ed          oej        ZerddlmZ nUedk    r>dd	lmZ dd
lmZ  ej                    dk    rd e            v sej        j        rddlmZ	 nedv rddlmZ nddlmZ  G d de          Z ej                    Z	 dddZddZ e	            Z  e            Z!dS )a  Application-wide functionality.

Applications
------------

Most applications need only call :func:`run` after creating one or more 
windows to begin processing events.  For example, a simple application 
consisting of one window is::

    import pyglet

    win = pyglet.window.Window()
    pyglet.app.run()


Events
======

To handle events on the main event loop, instantiate it manually.  The
following example exits the application as soon as any window is closed (the
default policy is to wait until all windows are closed)::

    event_loop = pyglet.app.EventLoop()

    @event_loop.event
    def on_window_close(window):
        event_loop.exit()

.. versionadded:: 1.1
    )annotationsN)compat_platform)	EventLoopis_pyglet_doc_run)PlatformEventLoopdarwin)CocoaPlatformEventLoop)get_chip_modelarm64M1)CocoaAlternateEventLoop)win32cygwin)Win32EventLoop)XlibEventLoopc                      e Zd ZdS )AppExceptionN)__name__
__module____qualname__     N/home/agentuser/manim-venv/lib/python3.11/site-packages/pyglet/app/__init__.pyr   r   =   s        Dr   r   ?intervalfloat | NonereturnNonec                :    t                               |            dS )zBegin processing events, scheduled functions and window updates.

    This is a convenience function, equivalent to::

        pyglet.app.event_loop.run(interval)

    N)
event_looprun)r   s    r   r!   r!   I   s     NN8r   c                 8    t                                            dS )aZ  Exit the application event loop.

    Causes the application event loop to finish, if an event loop is currently
    running.  The application may not necessarily exit (for example, there may
    be additional code following the ``run`` invocation).

    This is a convenience function, equivalent to::

        pyglet.app.event_loop.exit()

    N)r    exitr   r   r   r#   r#   T   s     OOr   )r   )r   r   r   r   )r   r   )"__doc__
__future__r   sysweakrefplatformpygletr   pyglet.app.baser   hasattrr   _is_pyglet_doc_runr   pyglet.app.cocoar	   "pyglet.libs.darwin.cocoapy.runtimer
   machineoptionsosx_alt_loopr   pyglet.app.win32r   pyglet.app.xlibr   	Exceptionr   WeakSetwindowsr!   r#   r    platform_event_loopr   r   r   <module>r8      s   < # " " " " " 



    " " " " " " % % % % % % WS"566P3;P  G1111111(""PPPPPPEEEEEE H'))dnn6F6F.F.F6>Kf.FMMMMMM	/	/	/HHHHHHHFFFFFF	 	 	 	 	9 	 	 	 '/

       $ Y[[
 ('))   r   