Ë
    ¨eh˜  ã                   óD   — d Z ddlmZ ddlmZ d„ Zd„ Zd	d„Zd	d„Z	d
d„Z
y)z|
========================
Widget testing utilities
========================

See also :mod:`matplotlib.tests.test_widgets`.
é    )ÚmockNc                  óº   — t        j                  dd«      \  } }|j                  ddgddg«       |j                  d«       | j                  j                  «        |S )z"Create a plot and return its Axes.é   r   éÈ   g      ð?)ÚpltÚsubplotsÚplotÚ
set_aspectÚcanvasÚdraw)ÚfigÚaxs     úX/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/matplotlib/testing/widgets.pyÚget_axr      sK   € ä�l‰l˜1˜aÓ �G€CˆØ‡G�GˆQ�ˆH�q˜#�hÔØ‡M�M�#ÔØ‡J�J‡O�OÔØ€Ió    c                   ó   — y ©N© )ÚargsÚkwargss     r   Únoopr      s   € Ør   c                 óD  — t        j                  «       }||_        | j                  j	                  ||f||fg«      d   \  |_        |_        ||c|_        |_        | |_	        | j                  d¬«      j                  |_        ||_        ||_        d|_        d|_        |S )a  
    Create a mock event that can stand in for `.Event` and its subclasses.

    This event is intended to be used in tests where it can be passed into
    event handling functions.

    Parameters
    ----------
    ax : `~matplotlib.axes.Axes`
        The Axes the event will be in.
    xdata : float
        x coord of mouse in data coords.
    ydata : float
        y coord of mouse in data coords.
    button : None or `MouseButton` or {'up', 'down'}
        The mouse button pressed in this event (see also `.MouseEvent`).
    key : None or str
        The key pressed when the mouse event triggered (see also `.KeyEvent`).
    step : int
        Number of scroll steps (positive for 'up', negative for 'down').

    Returns
    -------
    event
        A `.Event`\-like Mock instance.
    r   T)ÚrootNÚCustom)r   ÚMockÚbuttonÚ	transDataÚ	transformÚxÚyÚxdataÚydataÚinaxesÚ
get_figurer   ÚkeyÚstepÚguiEventÚname)r   r   r!   r"   r%   r&   Úevents          r   Ú
mock_eventr*      sŸ   € ô6 �I‰I‹K€EØ€E„LØ—|‘|×-Ñ-°°u¨~Ø05°u¨~ð/?ó @Ø@AñCÑ€E„GˆUŒWà$ eÐ€E„K�”Ø€E„LØ—=‘= d�=Ó+×2Ñ2€E„LØ€E„IØ€E„JØ€E„NØ€E„JØ€Lr   c                 ó`   — t        | j                  |||||«      }t        | |«      } ||«       y)aT  
    Trigger an event on the given tool.

    Parameters
    ----------
    tool : matplotlib.widgets.AxesWidget
    etype : str
        The event to trigger.
    xdata : float
        x coord of mouse in data coords.
    ydata : float
        y coord of mouse in data coords.
    button : None or `MouseButton` or {'up', 'down'}
        The mouse button pressed in this event (see also `.MouseEvent`).
    key : None or str
        The key pressed when the mouse event triggered (see also `.KeyEvent`).
    step : int
        Number of scroll steps (positive for 'up', negative for 'down').
    N)r*   r   Úgetattr)	ÚtoolÚetyper   r!   r"   r%   r&   r)   Úfuncs	            r   Údo_eventr0   D   s/   € ô( �t—w‘w ¨¨u°c¸4Ó@€EÜ�4˜Ó€DÙˆ…Kr   c                 óî   — |�t        | d|d   |d   d|¬«       t        | d|d   |d   d¬«       t        | d|d   |d   d¬«       t        | d	|d   |d   d¬«       |�t        | d
|d   |d   d|¬«       yy)a}  
    Helper to simulate a mouse drag operation.

    Parameters
    ----------
    tool : `~matplotlib.widgets.Widget`
    start : [float, float]
        Starting point in data coordinates.
    end : [float, float]
        End point in data coordinates.
    key : None or str
         An optional key that is pressed during the whole operation
         (see also `.KeyEvent`).
    NÚon_key_pressr   r   )r!   r"   r   r%   Úpress)r!   r"   r   ÚonmoveÚreleaseÚon_key_release)r0   )r-   ÚstartÚendr%   s       r   Úclick_and_dragr9   ]   s˜   € ð €ä��~¨U°1©X¸UÀ1¹XØ˜sõ	$ô ˆT�7 %¨¡(°%¸±(À1ÕEÜˆT�8 3 q¡6°°Q±ÀÕBÜˆT�9 C¨¡F°#°a±&ÀÕCØ
€ä�Ð'¨s°1©v¸SÀ¹VØ˜sö	$ð r   )r   r   r   Nr   r   )Ú__doc__Úunittestr   Úmatplotlib.pyplotÚpyplotr   r   r   r*   r0   r9   r   r   r   ú<module>r>      s,   ðñõ å òò	ó&óRô2$r   