
                         z    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Z
 G d d eee            Z G d	 d
e      Zy)z
Interface for an output.
    )unicode_literals)ABCMetaabstractmethod)with_metaclassSize)Outputc                      e Zd ZdZed        Zed        Zed        Zed        Zed        Z	ed        Z
ed        Zed	        Zed
        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed d       Zed        Zed        Zed        Zed        Zed        Zed        Zd Zd Zd Z d Z!y)!r	   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                      y)zB Return the file descriptor to which we can write for the output. N selfs    (lib/third_party/prompt_toolkit/output.pyfilenozOutput.fileno           c                      y)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   s    r   encodingzOutput.encoding   r   r   c                      y)zA Write text (Terminal escape sequences will be removed/escaped.) Nr   r   datas     r   writezOutput.write$   r   r   c                      y)z Write text. Nr   r   s     r   	write_rawzOutput.write_raw(   r   r   c                      y)z Set terminal title. Nr   r   titles     r   	set_titlezOutput.set_title,   r   r   c                      y)z1 Clear title again. (or restore previous title.) Nr   r   s    r   clear_titlezOutput.clear_title0   r   r   c                      y)z# Write to output stream and flush. Nr   r   s    r   flushzOutput.flush4   r   r   c                      y)zd
        Erases the screen with the background colour and moves the cursor to
        home.
        Nr   r   s    r   erase_screenzOutput.erase_screen8   r   r   c                      y)zD Go to the alternate screen buffer. (For full screen applications). Nr   r   s    r   enter_alternate_screenzOutput.enter_alternate_screen?   r   r   c                      y)z$ Leave the alternate screen buffer. Nr   r   s    r   quit_alternate_screenzOutput.quit_alternate_screenC   r   r   c                      y)z Enable mouse. Nr   r   s    r   enable_mouse_supportzOutput.enable_mouse_supportG   r   r   c                      y)z Disable mouse. Nr   r   s    r   disable_mouse_supportzOutput.disable_mouse_supportK   r   r   c                      y)zY
        Erases from the current cursor position to the end of the current line.
        Nr   r   s    r   erase_end_of_linezOutput.erase_end_of_lineO   r   r   c                      y)zc
        Erases the screen from the current line down to the bottom of the
        screen.
        Nr   r   s    r   
erase_downzOutput.erase_downU   r   r   c                      y)z% Reset color and styling attributes. Nr   r   s    r   reset_attributeszOutput.reset_attributes\   r   r   c                      y)z' Set new color and styling attributes. Nr   r   attrss     r   set_attributeszOutput.set_attributes`   r   r   c                      y)z Disable auto line wrapping. Nr   r   s    r   disable_autowrapzOutput.disable_autowrapd   r   r   c                      y)z Enable auto line wrapping. Nr   r   s    r   enable_autowrapzOutput.enable_autowraph   r   r   c                      y)z Move cursor position. Nr   r   rowcolumns      r   cursor_gotozOutput.cursor_gotol   r   r   c                      y)z  Move cursor `amount` place up. Nr   r   amounts     r   	cursor_upzOutput.cursor_upp   r   r   c                      y)z" Move cursor `amount` place down. Nr   rA   s     r   cursor_downzOutput.cursor_downt   r   r   c                      y)z% Move cursor `amount` place forward. Nr   rA   s     r   cursor_forwardzOutput.cursor_forwardx   r   r   c                      y)z& Move cursor `amount` place backward. Nr   rA   s     r   cursor_backwardzOutput.cursor_backward|   r   r   c                      y)z Hide cursor. Nr   r   s    r   hide_cursorzOutput.hide_cursor   r   r   c                      y)z Show cursor. Nr   r   s    r   show_cursorzOutput.show_cursor   r   r   c                      y)zP
        Asks for a cursor position report (CPR).
        (VT100 only.)
        Nr   r   s    r   ask_for_cprzOutput.ask_for_cpr   r   r   c                      y)z Sound bell. Nr   r   s    r   bellzOutput.bell   r   r   c                      yz For vt100 only. Nr   r   s    r   enable_bracketed_pastezOutput.enable_bracketed_paste   r   r   c                      yrS   r   r   s    r   disable_bracketed_pastezOutput.disable_bracketed_paste   r   r   Nr   r   )"__name__
__module____qualname____doc__r   r   r   r   r   r   r    r"   r$   r&   r(   r*   r,   r.   r0   r2   r6   r8   r:   r?   rC   rE   rG   rI   rK   rM   rO   rQ   rT   rV   r   r   r   r	   r	      s    M M   L L       < < . .   O O / /      
   0 0 2 2 ( ( ' ' " " + + - - 0 0 1 1    r   r	   c                       e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd!dZd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!y )"DummyOutputzD
    For testing. An output class that doesn't render anything.
    c                     t         )z, There is no sensible default for fileno(). )NotImplementedErrorr   s    r   r   zDummyOutput.fileno   s    !!r   c                      y)Nzutf-8r   r   s    r   r   zDummyOutput.encoding   s    r   c                      y Nr   r   s     r   r   zDummyOutput.write       4r   c                      y rb   r   r   s     r   r   zDummyOutput.write_raw       tr   c                      y rb   r   r   s     r   r   zDummyOutput.set_title       r   c                      y rb   r   r   s    r   r    zDummyOutput.clear_title   rc   r   c                      y rb   r   r   s    r   r"   zDummyOutput.flush   s    Tr   c                      y rb   r   r   s    r   r$   zDummyOutput.erase_screen   s    Dr   c                      y rb   r   r   s    r   r&   z"DummyOutput.enter_alternate_screen       dr   c                      y rb   r   r   s    r   r(   z!DummyOutput.quit_alternate_screen       Tr   c                      y rb   r   r   s    r   r*   z DummyOutput.enable_mouse_support   s    Dr   c                      y rb   r   r   s    r   r,   z!DummyOutput.disable_mouse_support   rn   r   c                      y rb   r   r   s    r   r.   zDummyOutput.erase_end_of_line       r   c                      y rb   r   r   s    r   r0   zDummyOutput.erase_down   s    $r   c                      y rb   r   r   s    r   r2   zDummyOutput.reset_attributes   rg   r   c                      y rb   r   r4   s     r   r6   zDummyOutput.set_attributes   rn   r   c                      y rb   r   r   s    r   r8   zDummyOutput.disable_autowrap   rg   r   c                      y rb   r   r   s    r   r:   zDummyOutput.enable_autowrap   re   r   c                      y rb   r   r<   s      r   r?   zDummyOutput.cursor_goto   s    Dr   c                      y rb   r   rA   s     r   rC   zDummyOutput.cursor_up   rr   r   c                      y rb   r   rA   s     r   rE   zDummyOutput.cursor_down   s    4r   c                      y rb   r   rA   s     r   rG   zDummyOutput.cursor_forward   rl   r   c                      y rb   r   rA   s     r   rI   zDummyOutput.cursor_backward       tr   c                      y rb   r   r   s    r   rK   zDummyOutput.hide_cursor   rc   r   c                      y rb   r   r   s    r   rM   zDummyOutput.show_cursor   rc   r   c                      y rb   r   r   s    r   rO   zDummyOutput.ask_for_cpr   rc   r   c                      y rb   r   r   s    r   rQ   zDummyOutput.bell   s    Dr   c                      y rb   r   r   s    r   rT   z"DummyOutput.enable_bracketed_paste   rl   r   c                      y rb   r   r   s    r   rV   z#DummyOutput.disable_bracketed_paste   r}   r   c                     t        dd      S )N(   P   )rowscolumnsr   r   s    r   get_sizezDummyOutput.get_size   s    R((r   NrW   )"rX   rY   rZ   r[   r   r   r   r   r   r    r"   r$   r&   r(   r*   r,   r.   r0   r2   r6   r8   r:   r?   rC   rE   rG   rI   rK   rM   rO   rQ   rT   rV   r   r   r   r   r]   r]      si    "  #$ *)()%$)$#0%'*+*+)r   r]   N)r[   
__future__r   abcr   r   sixr   prompt_toolkit.layout.screenr   __all__objectr	   r]   r   r   r   <module>r      sA    ( '  -
G^GV, GT()& ()r   