B
    't\                 @   sj   d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	 ddgZ
G dd deeeZG d	d deZd
S )z
Interface for an output.
    )unicode_literals)ABCMetaabstractmethod)with_metaclass)SizeOutputDummyOutputc               @   sf  e Zd Z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 Z
e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 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* Zed+d, Zed-d. Zed/d0 Zed1d2 Zed3d4 Zd5d6 Zd7d8 Zd9d: Z d;d< Z!d=d> Z"d?S )Ar   a  
    Base class defining the output interface for a
    :class:`~prompt_toolkit.renderer.Renderer`.

    Actual implementations are
    :class:`~prompt_toolkit.terminal.vt100_output.Vt100_Output` and
    :class:`~prompt_toolkit.terminal.win32_output.Win32Output`.
    c             C   s   dS )zB Return the file descriptor to which we can write for the output. N )selfr	   r	   9lib/python3.7/site-packages/prompt_toolkit/output/base.pyfileno   s    zOutput.filenoc             C   s   dS )z
        Return the encoding for this output, e.g. 'utf-8'.
        (This is used mainly to know which characters are supported by the
        output the data, so that the UI can provide alternatives, when
        required.)
        Nr	   )r
   r	   r	   r   encoding   s    zOutput.encodingc             C   s   dS )zA Write text (Terminal escape sequences will be removed/escaped.) Nr	   )r
   datar	   r	   r   write%   s    zOutput.writec             C   s   dS )z Write text. Nr	   )r
   r   r	   r	   r   	write_raw)   s    zOutput.write_rawc             C   s   dS )z Set terminal title. Nr	   )r
   titler	   r	   r   	set_title-   s    zOutput.set_titlec             C   s   dS )z1 Clear title again. (or restore previous title.) Nr	   )r
   r	   r	   r   clear_title1   s    zOutput.clear_titlec             C   s   dS )z# Write to output stream and flush. Nr	   )r
   r	   r	   r   flush5   s    zOutput.flushc             C   s   dS )zd
        Erases the screen with the background colour and moves the cursor to
        home.
        Nr	   )r
   r	   r	   r   erase_screen9   s    zOutput.erase_screenc             C   s   dS )zD Go to the alternate screen buffer. (For full screen applications). Nr	   )r
   r	   r	   r   enter_alternate_screen@   s    zOutput.enter_alternate_screenc             C   s   dS )z$ Leave the alternate screen buffer. Nr	   )r
   r	   r	   r   quit_alternate_screenD   s    zOutput.quit_alternate_screenc             C   s   dS )z Enable mouse. Nr	   )r
   r	   r	   r   enable_mouse_supportH   s    zOutput.enable_mouse_supportc             C   s   dS )z Disable mouse. Nr	   )r
   r	   r	   r   disable_mouse_supportL   s    zOutput.disable_mouse_supportc             C   s   dS )zY
        Erases from the current cursor position to the end of the current line.
        Nr	   )r
   r	   r	   r   erase_end_of_lineP   s    zOutput.erase_end_of_linec             C   s   dS )zc
        Erases the screen from the current line down to the bottom of the
        screen.
        Nr	   )r
   r	   r	   r   
erase_downV   s    zOutput.erase_downc             C   s   dS )z% Reset color and styling attributes. Nr	   )r
   r	   r	   r   reset_attributes]   s    zOutput.reset_attributesc             C   s   dS )z' Set new color and styling attributes. Nr	   )r
   attrscolor_depthr	   r	   r   set_attributesa   s    zOutput.set_attributesc             C   s   dS )z Disable auto line wrapping. Nr	   )r
   r	   r	   r   disable_autowrape   s    zOutput.disable_autowrapc             C   s   dS )z Enable auto line wrapping. Nr	   )r
   r	   r	   r   enable_autowrapi   s    zOutput.enable_autowrapr   c             C   s   dS )z Move cursor position. Nr	   )r
   rowcolumnr	   r	   r   cursor_gotom   s    zOutput.cursor_gotoc             C   s   dS )z  Move cursor `amount` place up. Nr	   )r
   amountr	   r	   r   	cursor_upq   s    zOutput.cursor_upc             C   s   dS )z" Move cursor `amount` place down. Nr	   )r
   r%   r	   r	   r   cursor_downu   s    zOutput.cursor_downc             C   s   dS )z% Move cursor `amount` place forward. Nr	   )r
   r%   r	   r	   r   cursor_forwardy   s    zOutput.cursor_forwardc             C   s   dS )z& Move cursor `amount` place backward. Nr	   )r
   r%   r	   r	   r   cursor_backward}   s    zOutput.cursor_backwardc             C   s   dS )z Hide cursor. Nr	   )r
   r	   r	   r   hide_cursor   s    zOutput.hide_cursorc             C   s   dS )z Show cursor. Nr	   )r
   r	   r	   r   show_cursor   s    zOutput.show_cursorc             C   s   dS )zP
        Asks for a cursor position report (CPR).
        (VT100 only.)
        Nr	   )r
   r	   r	   r   ask_for_cpr   s    zOutput.ask_for_cprc             C   s   dS )z Sound bell. Nr	   )r
   r	   r	   r   bell   s    zOutput.bellc             C   s   dS )z For vt100 only. Nr	   )r
   r	   r	   r   enable_bracketed_paste   s    zOutput.enable_bracketed_pastec             C   s   dS )z For vt100 only. Nr	   )r
   r	   r	   r   disable_bracketed_paste   s    zOutput.disable_bracketed_pastec             C   s   dS )z For Win32 only. Nr	   )r
   r	   r	   r   scroll_buffer_to_prompt   s    zOutput.scroll_buffer_to_promptN)r   r   )#__name__
__module____qualname____doc__r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r$   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r	   r	   r	   r   r      s@   	c               @   s  e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zd d! Zd"d# Zd$d% ZdDd'd(Zd)d* Zd+d, Zd-d. Zd/d0 Zd1d2 Zd3d4 Zd5d6 Zd7d8 Zd9d: Zd;d< Z d=d> Z!d?d@ Z"dAdB Z#dCS )Er   zD
    For testing. An output class that doesn't render anything.
    c             C   s   t dS )z, There is no sensible default for fileno(). N)NotImplementedError)r
   r	   r	   r   r      s    zDummyOutput.filenoc             C   s   dS )Nzutf-8r	   )r
   r	   r	   r   r      s    zDummyOutput.encodingc             C   s   d S )Nr	   )r
   r   r	   r	   r   r      s    zDummyOutput.writec             C   s   d S )Nr	   )r
   r   r	   r	   r   r      s    zDummyOutput.write_rawc             C   s   d S )Nr	   )r
   r   r	   r	   r   r      s    zDummyOutput.set_titlec             C   s   d S )Nr	   )r
   r	   r	   r   r      s    zDummyOutput.clear_titlec             C   s   d S )Nr	   )r
   r	   r	   r   r      s    zDummyOutput.flushc             C   s   d S )Nr	   )r
   r	   r	   r   r      s    zDummyOutput.erase_screenc             C   s   d S )Nr	   )r
   r	   r	   r   r      s    z"DummyOutput.enter_alternate_screenc             C   s   d S )Nr	   )r
   r	   r	   r   r      s    z!DummyOutput.quit_alternate_screenc             C   s   d S )Nr	   )r
   r	   r	   r   r      s    z DummyOutput.enable_mouse_supportc             C   s   d S )Nr	   )r
   r	   r	   r   r      s    z!DummyOutput.disable_mouse_supportc             C   s   d S )Nr	   )r
   r	   r	   r   r      s    zDummyOutput.erase_end_of_linec             C   s   d S )Nr	   )r
   r	   r	   r   r      s    zDummyOutput.erase_downc             C   s   d S )Nr	   )r
   r	   r	   r   r      s    zDummyOutput.reset_attributesc             C   s   d S )Nr	   )r
   r   r   r	   r	   r   r      s    zDummyOutput.set_attributesc             C   s   d S )Nr	   )r
   r	   r	   r   r       s    zDummyOutput.disable_autowrapc             C   s   d S )Nr	   )r
   r	   r	   r   r!      s    zDummyOutput.enable_autowrapr   c             C   s   d S )Nr	   )r
   r"   r#   r	   r	   r   r$      s    zDummyOutput.cursor_gotoc             C   s   d S )Nr	   )r
   r%   r	   r	   r   r&      s    zDummyOutput.cursor_upc             C   s   d S )Nr	   )r
   r%   r	   r	   r   r'      s    zDummyOutput.cursor_downc             C   s   d S )Nr	   )r
   r%   r	   r	   r   r(      s    zDummyOutput.cursor_forwardc             C   s   d S )Nr	   )r
   r%   r	   r	   r   r)      s    zDummyOutput.cursor_backwardc             C   s   d S )Nr	   )r
   r	   r	   r   r*      s    zDummyOutput.hide_cursorc             C   s   d S )Nr	   )r
   r	   r	   r   r+      s    zDummyOutput.show_cursorc             C   s   d S )Nr	   )r
   r	   r	   r   r,      s    zDummyOutput.ask_for_cprc             C   s   d S )Nr	   )r
   r	   r	   r   r-      s    zDummyOutput.bellc             C   s   d S )Nr	   )r
   r	   r	   r   r.      s    z"DummyOutput.enable_bracketed_pastec             C   s   d S )Nr	   )r
   r	   r	   r   r/      s    z#DummyOutput.disable_bracketed_pastec             C   s   d S )Nr	   )r
   r	   r	   r   r0      s    z#DummyOutput.scroll_buffer_to_promptc             C   s   t dddS )N(   P   )Zrowscolumns)r   )r
   r	   r	   r   get_size   s    zDummyOutput.get_sizec             C   s   dS )Nr6   r	   )r
   r	   r	   r   get_rows_below_cursor_position   s    z*DummyOutput.get_rows_below_cursor_positionN)r   r   )$r1   r2   r3   r4   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r$   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r9   r:   r	   r	   r	   r   r      sB   
N)r4   Z
__future__r   abcr   r   Zsixr   Zprompt_toolkit.layout.screenr   __all__objectr   r   r	   r	   r	   r   <module>   s    