a
    §ˆc}  ã                   @   sT   d dl mZmZmZmZmZmZmZmZm	Z	 ddl
mZ eeƒG dd„ deƒƒZdS )é    )	ÚBoolÚEventÚ	HasTraitsÚInstanceÚIntÚPropertyÚStrÚprovidesÚobserveé   )ÚIUndoManagerc                   @   st   e Zd ZdZedƒZeeƒZee	ƒZ
eƒ Zeƒ Zee	ƒZdd„ Zdd„ Zedƒdd	„ ƒZd
d„ Zdd„ Zdd„ ZdS )ÚUndoManagerz[The UndoManager class is the default implementation of the
    IUndoManager interface.
    zpyface.undo.api.ICommandStackc                 C   s   | j dur| j  ¡  dS )z; Redo the last undone command of the active command stack. N)Úactive_stackÚredo©Úself© r   ú[/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pyface/undo/undo_manager.pyr   S   s    
zUndoManager.redoc                 C   s   | j dur| j  ¡  dS )z4 Undo the last command of the active command stack. N)r   Úundor   r   r   r   r   Y   s    
zUndoManager.undor   c                 C   s   |j }|| _dS )z+ Handle a different stack becoming active. N)ÚnewÚstack_updated)r   Úeventr   r   r   r   Ú_update_stack_updatedc   s    z!UndoManager._update_stack_updatedc                 C   s   | j du rd}n| j j}|S )z Get the current clean state. NT)r   Úclean)r   Úactive_stack_cleanr   r   r   Ú_get_active_stack_cleanj   s    
z#UndoManager._get_active_stack_cleanc                 C   s   | j du rd}n| j j}|S )z Get the current redo name. NÚ )r   Ú	redo_name)r   r   r   r   r   Ú_get_redo_namet   s    
zUndoManager._get_redo_namec                 C   s   | j du rd}n| j j}|S )z Get the current undo name. Nr   )r   Ú	undo_name)r   r   r   r   r   Ú_get_undo_name~   s    
zUndoManager._get_undo_nameN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   Zsequence_nrr   r   r   r   r   r
   r   r   r   r    r   r   r   r   r   *   s   



r   N)Z
traits.apir   r   r   r   r   r   r   r	   r
   Zi_undo_managerr   r   r   r   r   r   Ú<module>   s   ,