+
     ]i  c                   sL    R t ^ RIHt ^ RIHt R tR tRR ltRR lt	R	R lt
R# )
z|
========================
Widget testing utilities
========================

See also :mod:`matplotlib.tests.test_widgets`.
)mockNc                 s    \         P                  ! ^^4      w  rVP                  ^ ^.^ ^.4       VP                  R4       V P                  P                  4        V# )z"Create a plot and return its Axes.g      ?)pltZsubplotsZplotZ
set_aspectcanvasZdraw)Zfigaxs     A/usr/lib64/python3.14/site-packages/matplotlib/testing/widgets.pyget_axr      sI    ll1a GCGGQHq#hMM#JJOOI    c                  s    R # N )ZargsZkwargss   *,r   noopr	      s    r   c                s@   \         P                  ! 4       pWn        V P                  P	                  W#3W#3.4      ^ ,          w  Vn        Vn        W#uVn        Vn        Wn	        V P                  RR7      P                  Vn        WFn        WVn        RVn        RVn        V# )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.
T)ZrootNZCustom)r    ZMockbuttonZ	transDataZ	transformZxZyxdataydataZinaxesZ
get_figurer   keystepZguiEventZname)r   r
   r   r   r   r   events   &&&&&& r   
mock_eventr      s    6 IIKEL||--~05~/? @@ACEGUW$EKL==d=+22ELIJENEJLr   c                s\    \        V P                  W#WEV4      p\        W4      pV! V4       R# )a  
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   Zgetattr)	toolZetyper
   r   r   r   r   r   Zfuncs	   &&&&&&&  r   do_eventr   D   s)    ( twwu4@E4DKr   c           	     sJ   Ve    \        V RV^ ,          V^,          ^VR7       \        V RV^ ,          V^,          ^R7       \        V RV^ ,          V^,          ^R7       \        V RV^ ,          V^,          ^R7       Ve"   \        V RV^ ,          V^,          ^VR7       R# R# )	aM  
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`).
NZon_key_press)r   r   r
   r   Zpress)r   r   r
   ZonmoveZreleaseZon_key_release)r   )r   ZstartZendr   s   &&&&r   click_and_dragr   ]   s     ~U1XU1Xs	$ T7%(%(1ET83q6QBT9CF#a&C
's1vSVs	$ r   )       r   Nr   r   )Z__doc__Zunittestr    Zmatplotlib.pyplotZpyplotr   r   r	   r   r   r   r   r   r   <module>r      s,     	&R2$r   