
    \
j/                         d dl mZ d dl mZ d dl mZ d dl mZ  G d d          Z G d d          Z G d	 d
          Z G d d          ZdS )    )gl)app)window)canvasc                   8    e Zd ZdZdZ	 dZ	 ddZd Zd Zd Z	dS )DisplayzTA display device supporting one or more screens.
    
    .. versionadded:: 1.2
    Nc                 D    t           j                            |            dS )a  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.canvas.Display`

        On platforms other than X11, :attr:`name` and :attr:`x_screen` are 
        ignored; there is only a single display device on these systems.

        :Parameters:
            name : str
                The name of the display to connect to.
            x_screen : int
                The X11 screen number to use.

        N)r   	_displaysadd)selfnamex_screens      L/DATA/AppData/hermes/venv/lib/python3.11/site-packages/pyglet/canvas/base.py__init__zDisplay.__init__<   s!    0 	T"""""    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_screensV   s     "*---r   c                 x    |                                  }|D ]}|j        dk    r|j        dk    r|c S |d         S )zGet the default (primary) screen as specified by the user's operating system
        preferences.

        :rtype: :class:`Screen`
        r   )r   xy)r   screensscreens      r   get_default_screenzDisplay.get_default_screend   sO     ""$$ 	 	Fx1}}Q qzr   c                 4      fdt           j        D             S )zxGet the windows currently attached to this display.

        :rtype: sequence of :class:`~pyglet.window.Window`
        c                 &    g | ]}|j         u |S  display).0r   r   s     r   
<listcomp>z'Display.get_windows.<locals>.<listcomp>w   s%    KKK6FNd4J4J4J4J4Jr   )r   windowsr   s   `r   get_windowszDisplay.get_windowsr   s"    
 LKKKS[KKKKr   )NN)
__name__
__module____qualname____doc__r   r   r   r   r   r&   r    r   r   r   r   *   s|         
 D
 H
# # # #4. . .  L L L L Lr   r   c                   J    e Zd ZdZd Zd ZddZd Zd Zd Z	d	 Z
d
 Zd ZdS )Screena  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.
    c                 T    || _         	 || _        	 || _        	 || _        	 || _        dS )a]  
        
        :parameters:
            `display` : `~pyglet.canvas.Display`
                :attr:`display`
            `x` : int
                Left edge :attr:`x`
            `y` : int
                Top edge :attr:`y`
            `width` : int
                :attr:`width`
            `height` : int
                :attr:`height`
        N)r"   r   r   widthheight)r   r"   r   r   r.   r/   s         r   r   zScreen.__init__   s9     -=<
-..r   c                 R    d| j         j        | j        | j        | j        | j        fz  S )Nz#%s(x=%d, y=%d, width=%d, height=%d))	__class__r'   r   r   r.   r/   r   s    r   __repr__zScreen.__repr__   s,    4'T[QR 	Rr   Nc                 (   d}|]t          j        dd          t          j        dd          dfD ].}	 |                     |          } n# t          j        $ r Y +w xY wn|                     |          }|st          j                    |d         S )aM  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.

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

        :Parameters:
            `template` : `pyglet.gl.Config`
                A configuration with desired attributes filled in.

        :rtype: :class:`~pyglet.gl.Config`
        :return: A configuration supported by the platform that best
            fulfils the needs described by the template.
        NT   )double_buffer
depth_size   r   )r   Configget_matching_configsr   NoSuchConfigException)r   templateconfigstemplate_configs       r   get_best_configzScreen.get_best_config   s    " $&IDR$P$P$P$&IDR$P$P$P$($*  "77HHGE3   D //99G 	1.000qzs   AAA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`.

        :Parameters:
            `template` : `pyglet.gl.Config`
                A configuration with desired attributes filled in.

        :rtype: list of :class:`~pyglet.gl.Config`
        :return: A list of matching configs.
        r   r   )r   r;   s     r   r9   zScreen.get_matching_configs   s      "*---r   c                      t          d          )zGet a list of screen modes supported by this screen.

        :rtype: list of :class:`ScreenMode`

        .. versionadded:: 1.2
        r   r   r   s    r   	get_modeszScreen.get_modes        "*---r   c                      t          d          )zzGet the current display mode for this screen.

        :rtype: :class:`ScreenMode`

        .. versionadded:: 1.2
        r   r   r   s    r   get_modezScreen.get_mode   rB   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 )a  Get 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.

        :Parameters:
            `width` : int
                Requested screen width.
            `height` : int
                Requested screen height.

        :rtype: :class:`ScreenMode`

        .. versionadded:: 1.2
        Nr         )rD   rA   r.   r/   ratedepth)r   r.   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   c                      t          d          )a  Set the display mode for this screen.

        The mode must be one previously returned by :meth:`get_mode` or 
        :meth:`get_modes`.

        :Parameters:
            `mode` : `ScreenMode`
                Screen mode to switch this screen to.

        r   r   )r   rL   s     r   set_modezScreen.set_mode   s     "*---r   c                      t          d          )z7Restore the screen mode to the user's default.
        r   r   r   s    r   restore_modezScreen.restore_mode-  s     "*---r   )N)r'   r(   r)   r*   r   r2   r>   r9   rA   rD   rN   rP   rR   r    r   r   r,   r,   z   s         "/ / /4R R R   B. . .$. . .. . ./ / /b. . .. . . . .r   r,   c                   6    e Zd ZdZdZ	 dZ	 dZ	 dZ	 d Zd Z	dS )
ScreenModea3  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

    Nc                     || _         dS )zG
        
        :parameters:
            `screen` : `Screen`
        N)r   )r   r   s     r   r   zScreenMode.__init__U  s     r   c           
      `    | j         j        d| j        d| j        d| j        d| j        d
S )Nz(width=z	, height=z, depth=z, rate=))r1   r'   r.   r/   rI   rH   r   s    r   r2   zScreenMode.__repr__]  s;    N###JJJTZZZ< 	<r   )
r'   r(   r)   r*   r.   r/   rI   rH   r   r2   r    r   r   rT   rT   3  sl        
 
 E F E D
  < < < < <r   rT   c                       e Zd ZdZ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
    c                     || _         dS )zz
        
        :parameters:
            `display` : `Display`
                :attr:`display`
                
        Nr!   )r   r"   s     r   r   zCanvas.__init__l  s     11r   N)r'   r(   r)   r*   r   r    r   r   rY   rY   c  s-         	2 	2 	2 	2 	2r   rY   N)	pygletr   r   r   r   r   r,   rT   rY   r    r   r   <module>r\      s  H                        ML ML ML ML ML ML ML ML`v. v. v. v. v. v. v. v.r-< -< -< -< -< -< -< -<`2 2 2 2 2 2 2 2 2 2r   