+
    i.                     p    ^ RI HtHtHtHt  ! R R4      t ! R R]4      t ! R R4      t ! R R	4      tR
# )    )_apibackend_toolscbookwidgetsc                   .   a  ] tR t^t o RtRR ltRtV tR# )	ToolEventz)Event for tool manipulation (add/remove).Nc                6    Wn         W n        W0n        W@n        R # N)namesendertooldata)selfr   r   r   r   s   &&&&&{/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/matplotlib/backend_managers.py__init__ToolEvent.__init__   s    			    )r   r   r   r   r
   __name__
__module____qualname____firstlineno____doc__r   __static_attributes____classdictcell____classdict__s   @r   r   r      s     3 r   r   c                   :   a a ] tR t^t oRtRV 3R lltRtVtV ;t# )ToolTriggerEventz/Event to inform that a tool has been triggered.c                4   < \         SV `  WW54       W@n        R # r
   )superr   canvasevent)r   r   r   r   r"   r   	__class__s   &&&&&&r   r   ToolTriggerEvent.__init__   s    t2&r   r"   )NN)	r   r   r   r   r   r   r   r   __classcell__)r#   r   s   @@r   r   r      s     9' 'r   r   c                   *   a  ] tR t^t o RtR tRtV tR# )ToolManagerMessageEventzg
Event carrying messages from toolmanager.

Messages usually get displayed to the user by the toolbar.
c                *    Wn         W n        W0n        R # r
   )r   r   message)r   r   r   r*   s   &&&&r   r    ToolManagerMessageEvent.__init__   s    	r   )r*   r   r   Nr   r   s   @r   r(   r(      s     
 r   r(   c                      a  ] tR t^ t o RtRR lt]R 4       t]R 4       t]P                  R 4       tRR lt
R tR	 tRR
 lt]R 4       tR tR tR tR tR tR tRR ltR t]R 4       tRR ltRtV tR# )ToolManagerav  
Manager for actions triggered by user interactions (key press, toolbar
clicks, ...) on a Figure.

Attributes
----------
figure : `.Figure`
keypresslock : `~matplotlib.widgets.LockDraw`
    `.LockDraw` object to know if the `canvas` key_press_event is locked.
messagelock : `~matplotlib.widgets.LockDraw`
    `.LockDraw` object to know if the message is available to write.
Nc                
   R V n         / V n        / V n        / V n        \        P
                  ! 4       V n        \        P                  ! 4       V n	        \        P                  ! 4       V n
        R V n        V P                  V4       R # r
   )_key_press_handler_id_tools_keys_toggledr   CallbackRegistry
_callbacksr   LockDrawkeypresslockmessagelock_figure
set_figurer   figures   &&r   r   ToolManager.__init__.   sf    %)"
002 $,,."++-r   c                V    V P                   '       g   R# V P                   P                  # )z Canvas managed by FigureManager.N)r8   canvasr   s   &r   r>   ToolManager.canvas>   s      |||||"""r   c                    V P                   # )zFigure that holds the canvas.)r8   r?   s   &r   r;   ToolManager.figureE   s     ||r   c                (    V P                  V4       R # r
   )r9   r:   s   &&r   r;   rB   J   s    r   c                H   V P                   '       d&   V P                  P                  V P                   4       Wn        V'       d,   V P                  P	                  RV P
                  4      V n         V'       d*   V P                  P                  4        F	  pWn        K  	  R# R# )z
Bind the given figure to the tools.

Parameters
----------
figure : `.Figure`
update_tools : bool, default: True
    Force tools to update figure.
key_press_eventN)	r/   r>   mpl_disconnectr8   mpl_connect
_key_pressr0   valuesr;   )r   r;   update_toolsr   s   &&& r   r9   ToolManager.set_figureN   st     %%%KK&&t'A'AB)-)@)@!4??*4D&**,$ - r   c                8    V P                   P                  W4      # )a=  
Connect event with string *s* to *func*.

Parameters
----------
s : str
    The name of the event. The following events are recognized:

    - 'tool_message_event'
    - 'tool_removed_event'
    - 'tool_added_event'

    For every tool added a new event is created

    - 'tool_trigger_TOOLNAME', where TOOLNAME is the id of the tool.

func : callable
    Callback function for the toolmanager event with signature::

        def func(event: ToolEvent) -> Any

Returns
-------
cid
    The callback id for the connection. This can be used in
    `.toolmanager_disconnect`.
)r4   connect)r   sfuncs   &&&r   toolmanager_connectToolManager.toolmanager_connectb   s    8 &&q//r   c                8    V P                   P                  V4      # )z
Disconnect callback id *cid*.

Example usage::

    cid = toolmanager.toolmanager_connect('tool_trigger_zoom', onpress)
    #...later
    toolmanager.toolmanager_disconnect(cid)
)r4   
disconnect)r   cids   &&r   toolmanager_disconnect"ToolManager.toolmanager_disconnect   s     ))#..r   c                d    Vf   T pRp\        W2V4      pV P                  P                  W44       R# )z!Emit a `ToolManagerMessageEvent`.Ntool_message_event)r(   r4   process)r   r*   r   rN   events   &&&  r   message_eventToolManager.message_event   s/    >F '7;)r   c                    V P                   # )zCurrently toggled tools.)r2   r?   s   &r   active_toggleToolManager.active_toggle   s     }}r   c                |    V P                   P                  4        UUu. uF  w  r#W18X  g   K  VNK  	  pppV# u uppi )z
Return the keymap associated with the specified tool.

Parameters
----------
name : str
    Name of the Tool.

Returns
-------
list of str
    List of keys associated with the tool.
)r1   items)r   r   kikeyss   &&   r   get_tool_keymapToolManager.get_tool_keymap   s9     #jj..0>0daAI0> ?s   
88c                P    V P                  V4       F  pV P                  V K  	  R # r
   )re   r1   )r   r   rb   s   && r   _remove_keysToolManager._remove_keys   s"    %%d+A

1 ,r   c           	     F   WP                   9  d   \        V: R24      hV P                  V4       \        V\        4      '       d   V.pV FQ  pW0P
                  9   d1   \        P                  ! RV RV P
                  V,           RV 24       WP
                  V&   KS  	  R# )z
Set the keymap to associate with the specified tool.

Parameters
----------
name : str
    Name of the Tool.
key : str or list of str
    Keys to associate with the tool.
z not in ToolszKey z changed from z to N)r0   KeyErrorrh   
isinstancestrr1   r   warn_external)r   r   keyrb   s   &&& r   update_keymapToolManager.update_keymap   s     {{"dX]344$c3%CAJJ""1#^DJJqM?$tfEG JJqM	 r   c                   V P                  V4      p\        VRR4      '       d   V P                  VR4       V P                  V4       \	        RW4      pV P
                  P                  VP                  V4       V P                  V R# )zS
Remove tool named *name*.

Parameters
----------
name : str
    Name of the tool.
toggledFtoolmanagertool_removed_eventN)	get_toolgetattrtrigger_toolrh   r   r4   rY   r   r0   )r   r   r   rZ   s   &&  r   remove_toolToolManager.remove_tool   sp     }}T"4E**dM2$.;

E2KKr   c                n   \         P                  ! \        V P                  4      V4      pV'       g   \	        R\        V4      ,          4      hWP                  9   d*   \        P                  ! R4       V P                  V,          # V! W.VO5/ VB pW`P                  V&   VP                  e   V P                  WP                  4       \        V\         P                  4      '       d   VP                  f&   V P                  P                  R\!        4       4       M&V P                  P                  VP                  R4       VP"                  '       d   V P%                  VRR4       VP'                  V P(                  4       \+        RW4      pV P,                  P/                  VP0                  V4       V# )a&  
Add *tool* to `ToolManager`.

If successful, adds a new event ``tool_trigger_{name}`` where
``{name}`` is the *name* of the tool; the event is fired every time the
tool is triggered.

Parameters
----------
name : str
    Name of the tool, treated as the ID, has to be unique.
tool : type
    Class of the tool to be added.  A subclass will be used
    instead if one was registered for the current canvas class.
*args, **kwargs
    Passed to the *tool*'s constructor.

See Also
--------
matplotlib.backend_tools.ToolBase : The base class for tools.
zImpossible to find class for %sz;A "Tool class" with the same name already exists, not addedNtool_added_event)r   _find_tool_classtyper>   
ValueErrorrm   r0   r   rn   default_keymaprp   rl   ToolToggleBaseradio_groupr2   
setdefaultsetrs   _handle_toggler9   r;   r   r4   rY   r   )r   r   r   argskwargstool_clstool_objrZ   s   &&&*,   r   add_toolToolManager.add_tool   sR   . !11$t{{2CTJ>TJKK;;  3 4;;t$$D888$D"".t%<%<= h < <== ##+((su5(()=)=tD ##HdD9DKK(,d=

E2r   c                .   VP                   pVf   VP                  V P                  R,          9   d/   V P                  R,          P                  VP                  4       R# V P                  R,          P	                  VP                  4       R# V P                  V,          VP                  8X  d   RpMSV P                  V,          f   VP                  pM1V P                  V P                  V,          V VV4       VP                  pWPP                  V&   R# )z
Toggle tools, need to untoggle prior to using other Toggle tool.
Called from trigger_tool.

Parameters
----------
tool : `.ToolBase`
canvasevent : Event
    Original Canvas event or None.
data : object
    Extra data to pass to the tool when triggering.
N)r   r   r2   removeaddrx   )r   r   r"   r   r   rs   s   &&&&  r   r   ToolManager._handle_toggle  s     && yyDMM$//d#**4995  d#''		2 ==%2G ]];'/iiG dmmK8")"$ iiG &-k"r   c                *   V P                  V4      pVf   R# Vf   T p\        V\        P                  4      '       d   V P	                  WSV4       VP                  W#V4       RV,          p\        WbWSV4      pV P                  P                  Wg4       R# )a)  
Trigger a tool and emit the ``tool_trigger_{name}`` event.

Parameters
----------
name : str
    Name of the tool.
sender : object
    Object that wishes to trigger the tool.
canvasevent : Event
    Original Canvas event or None.
data : object
    Extra data to pass to the tool when triggering.
Nztool_trigger_%s)	rv   rl   r   r   r   triggerr   r4   rY   )r   r   r   r"   r   r   rN   rZ   s   &&&&&   r   rx   ToolManager.trigger_tool;  s     }}T"<>FdM889948V$/$ DtD)r   c                    VP                   e!   V P                  P                  4       '       d   R # V P                  P	                  VP                   R 4      pVf   R # V P                  W!R7       R # )Nr%   )ro   r6   lockedr1   getrx   )r   rZ   r   s   && r   rH   ToolManager._key_pressZ  sT    99 1 1 8 8 : :zz~~eii.<$2r   c                    V P                   # )z,A dict mapping tool name -> controlled tool.)r0   r?   s   &r   toolsToolManager.toolsc  s     {{r   c                
   \        V\        P                  4      '       d   VP                  V P                  9   d   V# WP                  9  d%   V'       d   \
        P                  ! RV: 24       R# V P                  V,          # )a  
Return the tool object with the given name.

For convenience, this passes tool objects through.

Parameters
----------
name : str or `.ToolBase`
    Name of the tool, or the tool itself.
warn : bool, default: True
    Whether a warning should be emitted it no tool with the given name
    exists.

Returns
-------
`.ToolBase` or None
    The tool or None if no tool with the given name exists.
z"ToolManager does not control tool N)rl   r   ToolBaser   r0   r   rn   )r   r   warns   &&&r   rv   ToolManager.get_toolh  sd    & t]3344II,K{{"""8AC{{4  r   )r4   r8   r/   r1   r2   r0   r6   r7   r
   )T)NNN)r   r   r   r   r   r   propertyr>   r;   setterr9   rP   rU   r[   r^   re   rh   rp   ry   r   r   rx   rH   r   rv   r   r   r   s   @r   r-   r-       s        # #   ]]   %(0<
/*  $!,"7r)-V*>3  ! !r   r-   N)	
matplotlibr   r   r   r   r   r   r(   r-    r   r   <module>r      s7    : : 'y '	 	c! c!r   