
    ^j'                        d dl mZ d dlZd dlmZmZ d dlmZmZm	Z	m
Z
 erd dlmZ d dlmZ  G d d          Z G d	 d
ej                  Z G d d          Z G d d          ZdS )    )annotationsN)TYPE_CHECKINGLiteral)appdisplayglwindow)Config)
BaseWindowc                  V    e Zd ZU dZdZded<   	 dZded<   	 ddd	ZddZddZ	ddZ
dS )Displayz0A display device supporting one or more screens.Nstrnameintx_screenreturnNonec                D    t           j                            |            dS )al  Create a display connection for the given name and screen.

        On X11, :attr:`name` is of the form ``"hostname:display"``, where the
        default is usually ``":1"``.  On X11, :attr:`x_screen` gives the X 
        screen number to use with this display.  A pyglet display can only be 
        used with one X screen; open multiple display connections to access
        multiple X screens.  
        
        Note that TwinView, Xinerama, xrandr and other extensions present
        multiple monitors on a single X screen; this is usually the preferred
        mechanism for working with multiple monitors under X11 and allows each
        screen to be accessed through a single pyglet`~pyglet.display.Display`

        On platforms other than X11, :attr:`name` and :attr:`x_screen` are 
        ignored; there is only a single display device on these systems.
        N)r   	_displaysadd)selfr   r   s      N/home/agentuser/manim-venv/lib/python3.11/site-packages/pyglet/display/base.py__init__zDisplay.__init__   s!    " 	d#####    list[Screen]c                     t          d          )a  Get the available screens.

        A typical multi-monitor workstation comprises one :class:`Display`
        with multiple :class:`Screen` s.  This method returns a list of 
        screens which can be enumerated to select one for full-screen display.

        For the purposes of creating an OpenGL config, the default screen
        will suffice.

        :rtype: list of :class:`Screen`
        abstractNotImplementedErrorr   s    r   get_screenszDisplay.get_screens)   s     "*---r   Screenc                x    |                                  }|D ]}|j        dk    r|j        dk    r|c S |d         S )zYGet the default (primary) screen as specified by the user's operating system preferences.r   )r!   xy)r   screensscreens      r   get_default_screenzDisplay.get_default_screen7   sM    ""$$ 	 	Fx1}}Q qzr   list[BaseWindow]c                4      fdt           j        D             S )z3Get the windows currently attached to this display.c                &    g | ]}|j         u |S  r   ).0winr   s     r   
<listcomp>z'Display.get_windows.<locals>.<listcomp>C   s%    BBBckT.A.A.A.A.Ar   )r   windowsr    s   `r   get_windowszDisplay.get_windowsA   s    BBBBs{BBBBr   )NN)r   r   r   r   r   r   )r   r   )r   r"   )r   r)   )__name__
__module____qualname____doc__r   __annotations__r   r   r!   r(   r2   r,   r   r   r   r      s         ::D.H?$ $ $ $ $&. . . .   C C C C C Cr   r   c                      e Zd ZdZd#dZd$dZd%d&dZd'dZd(dZd)dZ	d*dZ
d+dZd,dZd Zd-dZej        d.d             Zej        d/d"            ZdS )0r"   a  A virtual monitor that supports fullscreen windows.

    Screens typically map onto a physical display such as a
    monitor, television or projector.  Selecting a screen for a window
    has no effect unless the window is made fullscreen, in which case
    the window will fill only that particular virtual screen.

    The :attr:`width` and :attr:`height` attributes of a screen give the 
    current resolution of the screen.  The :attr:`x` and :attr:`y` attributes 
    give the global location of the top-left corner of the screen.  This is 
    useful for determining if screens are arranged above or next to one 
    another.

    Use :func:`~Display.get_screens` or :func:`~Display.get_default_screen`
    to obtain an instance of this class.
    r   r   r$   r   r%   widthheightr   r   c                T    || _         	 || _        	 || _        	 || _        	 || _        d S N)r   r$   r%   r9   r:   )r   r   r$   r%   r9   r:   s         r   r   zScreen.__init__X   s7    -=<
-..r   r   c           
     `    | j         j         d| j         d| j         d| j         d| j         d
S )Nz(x=z, y=z, width=	, height=))	__class__r3   r$   r%   r9   r:   r    s    r   __repr__zScreen.__repr__d   s@    .)mmdfmm$&mm$*mm_c_jmmmmr   Ntemplater
   c                0   d}|at          j        dddd          t          j        dddd          dfD ].}	 |                     |          } n# t          j        $ r Y +w xY wn|                     |          }|st          j                    |d         S )a  Get the best available GL config.

        Any required attributes can be specified in ``template``.  If
        no configuration matches the template,
        :class:`~pyglet.window.NoSuchConfigException` will be raised.
        A configuration supported by the platform that best fulfils
        the needs described by the template.

        :deprecated: Use :meth:`pyglet.gl.Config.match`.

        Args:
            template:
                A configuration with desired attributes filled in.
        NT      )double_buffer
depth_sizemajor_versionminor_version   r   )r   r
   get_matching_configsr	   NoSuchConfigException)r   rB   configstemplate_configs       r   get_best_configzScreen.get_best_configg   s     $&IDR_`pq$r$r$r$&IDR_`pq$r$r$r$($*  "77HHGE3   D //99G 	1.000qzs   AA"!A"list[Config]c                     t          d          )a  Get a list of configs that match a specification.

        Any attributes specified in `template` will have values equal
        to or greater in each returned config.  If no configs satisfy
        the template, an empty list is returned.

        :deprecated: Use :meth:`pyglet.gl.Config.match`.

        Args:
            template:
                A configuration with desired attributes filled in.
        r   r   )r   rB   s     r   rK   zScreen.get_matching_configs   s     "*---r   list[ScreenMode]c                     t          d          )z\Get a list of screen modes supported by this screen.

        .. versionadded:: 1.2
        r   r   r    s    r   	get_modeszScreen.get_modes       
 "*---r   
ScreenModec                     t          d          )zUGet the current display mode for this screen.

        .. versionadded:: 1.2
        r   r   r    s    r   get_modezScreen.get_mode   rU   r   c                   |                                  }d}|                                 D ]}|j        |k     s|j        |k     r||}|j        |j        k    r2|j        |j        k    r"|j        |j        k     s|j        |j        k     r|}|j        |j        k    rn|j        |j        k    r^d}|j        |j        k    r|dz  }|j        |j        k    r|dz  }|j        |j        k    r|dz  }|j        |j        k    r|dz  }|dk    r|}|S )zGet the screen mode that best matches a given size.

        If no supported mode exactly equals the requested size, a larger one
        is returned; or ``None`` if no mode is large enough.

        .. versionadded:: 1.2
        Nr         )rX   rT   r9   r:   ratedepth)r   r9   r:   currentbestmodepointss          r   get_closest_modezScreen.get_closest_mode   s.    --//NN$$ 	  	 DzE!!T[6%9%9| 
dj((T[DK-G-GZ$*,,dk0I0I zTZ''DK4;,F,F9,,aKF9,,aKF:..aKF:..aKFA::Dr   r`   c                     t          d          )zSet the display mode for this screen.

        The mode must be one previously returned by :meth:`get_mode` or
        :meth:`get_modes`.
        r   r   )r   r`   s     r   set_modezScreen.set_mode   s     "*---r   c                     t          d          )z.Restore the screen mode to the user's default.r   r   r    s    r   restore_modezScreen.restore_mode       !*---r   c                     t          d          )zGet the DPI of the screen.r   r   r    s    r   get_dpizScreen.get_dpi   rg   r   floatc                     t          d          )z(Get the pixel scale ratio of the screen.r   r   r    s    r   	get_scalezScreen.get_scale   rg   r   	str | intc                    dS )zPGet a unique identifier for the screen.

        .. versionadded: 2.1.8
        Nr,   r    s    r   get_display_idzScreen.get_display_id         r   str | Literal['Unknown']c                    dS )a  Get a friendly name for the screen if available.

        Windows and Mac OSX report what the system will see the screen as.

        On Linux, there is no API for retrieving the monitor name, other than manually decoding the EDID information.
        Instead, it will return the connection name.

        If no name can be queried, a default name of Unknown will be returned.

        .. versionadded: 2.1.8
        Nr,   r    s    r   get_monitor_namezScreen.get_monitor_name   rp   r   )r   r   r$   r   r%   r   r9   r   r:   r   r   r   r   r   r<   )rB   r
   r   r
   )rB   r
   r   rP   )r   rR   )r   rV   )r9   r   r:   r   r   rV   )r`   rV   r   r   )r   r   )r   rj   )r   rm   )r   rq   )r3   r4   r5   r6   r   rA   rO   rK   rT   rX   rb   rd   rf   ri   rl   abcabstractmethodro   rs   r,   r   r   r"   r"   F   sG        "
/ 
/ 
/ 
/n n n n    >. . . .. . . .. . . .' ' ' 'R. . . .. . . .. . .. . . . 	    	     r   r"   c                  d    e Zd ZU dZdZded<   	 dZded<   	 dZded<   	 dZded<   	 ddZ	ddZ
dS )rV   a2  Screen resolution and display settings.

    Applications should not construct `ScreenMode` instances themselves; see
    :meth:`Screen.get_modes`.

    The :attr:`depth` and :attr:`rate` variables may be ``None`` if the 
    operating system does not provide relevant data.

    .. versionadded:: 1.2
    Nr   r9   r:   r]   r\   r'   r"   r   r   c                    || _         d S r<   )r'   )r   r'   s     r   r   zScreenMode.__init__  s    r   r   c           
     `    | j         j         d| j        d| j        d| j        d| j         d
S )Nz(width=r>   z, depth=z, rate=r?   )r@   r3   r9   r:   r]   r\   r    s    r   rA   zScreenMode.__repr__  sf    .)  B  B$*  B  B  B  B`d`j  B  Buyu~  B  B  B  	Br   )r'   r"   r   r   rt   )r3   r4   r5   r6   r9   r7   r:   r]   r\   r   rA   r,   r   r   rV   rV      s         	 	 E%F&E/D$   B B B B B Br   rV   c                      e Zd ZdZddZdS )	CanvaszAbstract drawing area.

    Canvases are used internally by pyglet to represent drawing areas --
    either within a window or full-screen.

    .. versionadded:: 1.2
    r   r   r   r   c                    || _         d S r<   r-   )r   r   s     r   r   zCanvas.__init__  s    11r   N)r   r   r   r   )r3   r4   r5   r6   r   r,   r   r   r{   r{     s2         2 2 2 2 2 2r   r{   )
__future__r   ru   typingr   r   pygletr   r   r   r	   	pyglet.glr
   pyglet.windowr   r   ABCr"   rV   r{   r,   r   r   <module>r      sP   " " " " " " 



 ) ) ) ) ) ) ) ) + + + + + + + + + + + + )      ((((((6C 6C 6C 6C 6C 6C 6C 6Crm m m m mSW m m m`B B B B B B B B>2 2 2 2 2 2 2 2 2 2r   