3
<Ad]ì  ã               @   sb   d Z ddlZddlZddlmZ ddlmZmZmZ ej	e
ƒZG dd„ deƒZG dd„ deƒZdS )	z  The interface of a pyface GUI. é    N)Ú	ETSConfig)ÚBoolÚ	InterfaceÚUnicodec               @   s–   e Zd ZdZedƒZedƒZeZddd„Z	e
dd„ ƒZedd	„ ƒZed
d„ ƒZedd„ ƒZedd„ ƒZe
ddd„ƒZe
ddd„ƒZdd„ Zdd„ ZdS )ÚIGUIz  The interface of a pyface GUI. FNc             C   s   dS )zç Initialise a new GUI.

        Parameters
        ----------
        splash_screen : ISplashScreen instance or None
            An optional splash screen that will be displayed until the event
            loop is started.
        N© )ÚselfZsplash_screenr   r   úf/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.6/site-packages/pyface-6.1.2-py3.6.egg/pyface/i_gui.pyÚ__init__3   s    zIGUI.__init__c               C   s   dS )aS   Override SIGINT to prevent swallowing KeyboardInterrupt

        Override the SIGINT handler to ensure the process can be
        interrupted. This prevents GUI toolkits from swallowing
        KeyboardInterrupt exceptions.

        Warning: do not call this method if you intend your application to be
        run interactively.
        Nr   r   r   r   r	   Úallow_interruptA   s    zIGUI.allow_interruptc             O   s   dS )aU   Call a callable after a specific delay in the main GUI thread.

        Parameters
        ----------
        millisecs : float
            Delay in milliseconds
        callable : callable
            Callable to be called after the delay
        args, kwargs :
            Arguments and keyword arguments to be used when calling.
        Nr   )ÚclsÚ	millisecsÚcallableÚargsÚkwr   r   r	   Úinvoke_afterM   s    zIGUI.invoke_afterc             O   s   dS )a   Call a callable in the main GUI thread.

        Parameters
        ----------
        callable : callable
            Callable to be called after the delay
        args, kwargs :
            Arguments and keyword arguments to be used when calling.
        Nr   )r   r   r   r   r   r   r	   Úinvoke_later[   s    zIGUI.invoke_laterc             C   s   dS )an   Sets a trait after a specific delay in the main GUI thread.

        Parameters
        ----------
        millisecs : float
            Delay in milliseconds
        obj : HasTraits instance
            Object on which the trait is to be set
        trait_name : str
            The name of the trait to set
        new : any
            The value to set.
        Nr   )r   r   ÚobjÚ
trait_nameÚnewr   r   r	   Úset_trait_afterg   s    zIGUI.set_trait_afterc             C   s   dS )a   Sets a trait in the main GUI thread.

        Parameters
        ----------
        obj : HasTraits instance
            Object on which the trait is to be set
        trait_name : str
            The name of the trait to set
        new : any
            The value to set.
        Nr   )r   r   r   r   r   r   r	   Úset_trait_laterw   s    zIGUI.set_trait_laterTc             C   s   dS )zÙ Process any pending GUI events.

        Parameters
        ----------
        allow_user_events : bool
            If allow_user_events is ``False`` then user generated events are not
            processed.
        Nr   )Zallow_user_eventsr   r   r	   Úprocess_events…   s    zIGUI.process_eventsc             C   s   dS )zìSpecify if the GUI is busy.

        Parameters
        ----------
        busy : bool
            If ``True`` is passed, the cursor is set to a 'busy' cursor.
            Passing ``False`` will reset the cursor to the default.
        Nr   )Úbusyr   r   r	   Úset_busy�   s    zIGUI.set_busyc             C   s   dS )z Start the GUI event loop. Nr   )r   r   r   r	   Ústart_event_loopŸ   s    zIGUI.start_event_loopc             C   s   dS )z Stop the GUI event loop. Nr   )r   r   r   r	   Ústop_event_loop¢   s    zIGUI.stop_event_loop)N)T)T)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ústartedr   Ústate_locationr
   Ústaticmethodr   Úclassmethodr   r   r   r   r   r   r   r   r   r   r   r	   r      s    

r   c               @   s$   e Zd ZdZedd„ ƒZdd„ ZdS )ÚMGUIzš The mixin class that contains common code for toolkit specific
    implementations of the IGUI interface.

    Implements: _default_state_location()
    c              C   s   ddl } | j | j| jƒ dS )aS   Override SIGINT to prevent swallowing KeyboardInterrupt

        Override the SIGINT handler to ensure the process can be
        interrupted. This prevents GUI toolkits from swallowing
        KeyboardInterrupt exceptions.

        Warning: do not call this method if you intend your application to be
        run interactively.
        r   N)ÚsignalÚSIGINTÚSIG_DFL)r&   r   r   r	   r   ­   s    zMGUI.allow_interruptc             C   s:   t jjtjdtjƒ}t jj|ƒs*t j|ƒ tj	d|ƒ |S )z$ Return the default state location. ÚpyfacezGUI state location is <%s>)
ÚosÚpathÚjoinr   Zapplication_homeZtoolkitÚexistsÚmakedirsÚloggerÚdebug)r   r"   r   r   r	   Ú_default_state_location»   s
    
zMGUI._default_state_locationN)r   r   r   r    r#   r   r1   r   r   r   r	   r%   ¦   s   r%   )r    Úloggingr*   Ztraits.etsconfig.apir   Z
traits.apir   r   r   Ú	getLoggerr   r/   r   Úobjectr%   r   r   r   r	   Ú<module>   s   
 	