ó
    OÎhœ   ã                  ó�   • S r SSKJr  SSKJrJr  SSKJr  SSKJ	r	  SSK
Jr  SSKJr  SS	KJr  S
S/r " S S
\S9r " S S\5      rg)z
Interface for an output.
é    )Úannotations)ÚABCMetaÚabstractmethod)ÚTextIO)ÚCursorShape©ÚSize)ÚAttrsé   )Ú
ColorDepthÚOutputÚDummyOutputc                  óÊ  • \ rS rSr% SrSrS\S'   \S,S j5       r\S-S j5       r	\S.S j5       r
\S.S	 j5       r\S/S
 j5       r\S0S j5       r\S0S j5       r\S0S j5       r\S0S j5       r\S0S j5       r\S0S j5       r\S0S j5       r\S0S j5       r\S0S j5       r\S0S j5       r\S1S j5       r\S0S j5       r\S0S j5       r\S2S3S jj5       r\S4S j5       r\S4S j5       r\S4S j5       r\S4S j5       r\S0S j5       r\S0S j5       r \S5S j5       r!\S0S  j5       r"S0S! jr#\$S6S" j5       r%\S7S# j5       r&S0S$ jr'S0S% jr(S0S& jr)S0S' jr*S0S( jr+S,S) jr,\S8S* j5       r-S+r.g)9r   é   zâ
Base class defining the output interface for a
:class:`~prompt_toolkit.renderer.Renderer`.

Actual implementations are
:class:`~prompt_toolkit.output.vt100.Vt100_Output` and
:class:`~prompt_toolkit.output.win32.Win32Output`.
NzTextIO | NoneÚstdoutc                ó   • g)z@Return the file descriptor to which we can write for the output.N© ©Úselfs    ÚW/home/mande/repo/quber/.venv/lib/python3.13/site-packages/prompt_toolkit/output/base.pyÚfilenoÚOutput.fileno"   ó   � ó    c                ó   • g)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   ÚencodingÚOutput.encoding&   r   r   c                ó   • g)z?Write text (Terminal escape sequences will be removed/escaped.)Nr   ©r   Údatas     r   ÚwriteÚOutput.write/   r   r   c                ó   • g)zWrite text.Nr   r   s     r   Ú	write_rawÚOutput.write_raw3   r   r   c                ó   • g)zSet terminal title.Nr   ©r   Útitles     r   Ú	set_titleÚOutput.set_title7   r   r   c                ó   • g)z/Clear title again. (or restore previous title.)Nr   r   s    r   Úclear_titleÚOutput.clear_title;   r   r   c                ó   • g)z!Write to output stream and flush.Nr   r   s    r   ÚflushÚOutput.flush?   r   r   c                ó   • g)zK
Erases the screen with the background color and moves the cursor to
home.
Nr   r   s    r   Úerase_screenÚOutput.erase_screenC   r   r   c                ó   • g)zBGo to the alternate screen buffer. (For full screen applications).Nr   r   s    r   Úenter_alternate_screenÚOutput.enter_alternate_screenJ   r   r   c                ó   • g)z"Leave the alternate screen buffer.Nr   r   s    r   Úquit_alternate_screenÚOutput.quit_alternate_screenN   r   r   c                ó   • g)zEnable mouse.Nr   r   s    r   Úenable_mouse_supportÚOutput.enable_mouse_supportR   r   r   c                ó   • g)zDisable mouse.Nr   r   s    r   Údisable_mouse_supportÚOutput.disable_mouse_supportV   r   r   c                ó   • g)zI
Erases from the current cursor position to the end of the current line.
Nr   r   s    r   Úerase_end_of_lineÚOutput.erase_end_of_lineZ   r   r   c                ó   • g)zK
Erases the screen from the current line down to the bottom of the
screen.
Nr   r   s    r   Ú
erase_downÚOutput.erase_down`   r   r   c                ó   • g)z#Reset color and styling attributes.Nr   r   s    r   Úreset_attributesÚOutput.reset_attributesg   r   r   c                ó   • g)z%Set new color and styling attributes.Nr   ©r   ÚattrsÚcolor_depths      r   Úset_attributesÚOutput.set_attributesk   r   r   c                ó   • g)zDisable auto line wrapping.Nr   r   s    r   Údisable_autowrapÚOutput.disable_autowrapo   r   r   c                ó   • g)zEnable auto line wrapping.Nr   r   s    r   Úenable_autowrapÚOutput.enable_autowraps   r   r   c                ó   • g)zMove cursor position.Nr   ©r   ÚrowÚcolumns      r   Úcursor_gotoÚOutput.cursor_gotow   r   r   c                ó   • g)zMove cursor `amount` place up.Nr   ©r   Úamounts     r   Ú	cursor_upÚOutput.cursor_up{   r   r   c                ó   • g)z Move cursor `amount` place down.Nr   r\   s     r   Úcursor_downÚOutput.cursor_down   r   r   c                ó   • g)z#Move cursor `amount` place forward.Nr   r\   s     r   Úcursor_forwardÚOutput.cursor_forwardƒ   r   r   c                ó   • g)z$Move cursor `amount` place backward.Nr   r\   s     r   Úcursor_backwardÚOutput.cursor_backward‡   r   r   c                ó   • g)zHide cursor.Nr   r   s    r   Úhide_cursorÚOutput.hide_cursor‹   r   r   c                ó   • g)zShow cursor.Nr   r   s    r   Úshow_cursorÚOutput.show_cursor�   r   r   c                ó   • g)z-Set cursor shape to block, beam or underline.Nr   ©r   Úcursor_shapes     r   Úset_cursor_shapeÚOutput.set_cursor_shape“   r   r   c                ó   • g)zReset cursor shape.Nr   r   s    r   Úreset_cursor_shapeÚOutput.reset_cursor_shape—   r   r   c                ó   • g)z8
Asks for a cursor position report (CPR).
(VT100 only.)
Nr   r   s    r   Úask_for_cprÚOutput.ask_for_cpr›   r   r   c                ó   • g)a»  
`True` if the `Application` can expect to receive a CPR response after
calling `ask_for_cpr` (this will come back through the corresponding
`Input`).

This is used to determine the amount of available rows we have below
the cursor position. In the first place, we have this so that the drop
down autocompletion menus are sized according to the available space.

On Windows, we don't need this, there we have
`get_rows_below_cursor_position`.
Fr   r   s    r   Úresponds_to_cprÚOutput.responds_to_cpr¡   s   € ð r   c                ó   • g)z%Return the size of the output window.Nr   r   s    r   Úget_sizeÚOutput.get_size±   r   r   c                ó   • g)zSound bell.Nr   r   s    r   ÚbellÚOutput.bellµ   r   r   c                ó   • g©zFor vt100 only.Nr   r   s    r   Úenable_bracketed_pasteÚOutput.enable_bracketed_paste¸   r   r   c                ó   • gr„   r   r   s    r   Údisable_bracketed_pasteÚOutput.disable_bracketed_paste»   r   r   c                ó   • g)z‹
For vt100 only.
Put the terminal in normal cursor mode (instead of application mode).

See: https://vt100.net/docs/vt100-ug/chapter3.html
Nr   r   s    r   Úreset_cursor_key_modeÚOutput.reset_cursor_key_mode¾   r   r   c                ó   • g)zFor Win32 only.Nr   r   s    r   Úscroll_buffer_to_promptÚOutput.scroll_buffer_to_promptÆ   r   r   c                ó   • [         e)zFor Windows only.©ÚNotImplementedErrorr   s    r   Úget_rows_below_cursor_positionÚ%Output.get_rows_below_cursor_positionÉ   ó   € ä!Ð!r   c                ó   • g)aÅ  
Get default color depth for this output.

This value will be used if no color depth was explicitly passed to the
`Application`.

.. note::

    If the `$PROMPT_TOOLKIT_COLOR_DEPTH` environment variable has been
    set, then `outputs.defaults.create_output` will pass this value to
    the implementation as the default_color_depth, which is returned
    here. (This is not used when the output corresponds to a
    prompt_toolkit SSH/Telnet session.)
Nr   r   s    r   Úget_default_color_depthÚOutput.get_default_color_depthÍ   r   r   r   ©ÚreturnÚint©rš   Ústr©r    r�   rš   ÚNone©r(   r�   rš   rŸ   ©rš   rŸ   ©rK   r
   rL   r   rš   rŸ   ©r   r   ©rW   r›   rX   r›   rš   rŸ   ©r]   r›   rš   rŸ   ©rq   r   rš   rŸ   )rš   Úbool©rš   r	   ©rš   r   )/Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__annotations__r   r   r   r!   r$   r)   r,   r/   r2   r5   r8   r;   r>   rA   rD   rG   rM   rP   rS   rY   r^   ra   rd   rg   rj   rm   rr   ru   rx   Úpropertyr{   r~   r�   r…   rˆ   r‹   rŽ   r“   r—   Ú__static_attributes__r   r   r   r   r      s’  ‡ ñð !€FˆMÓ àóKó ðKð óó ðð óJó ðJð óó ðð óó ðð ó:ó ð:ð ó,ó ð,ð óó ðð óMó ðMð ó-ó ð-ð óó ðð óó ðð óó ðð
 óó ðð ó.ó ð.ð ó0ó ð0ð ó&ó ð&ð ó%ó ð%ð õ ó ð ð ó)ó ð)ð ó+ó ð+ð ó.ó ð.ð ó/ó ð/ð óó ðð óó ðð ó8ó ð8ð óó ðôð óó ðð ó0ó ð0ôôôôôô"ð óó ór   )Ú	metaclassc                  óz  • \ rS rSrSrS(S jrS)S jrS*S jrS*S jrS+S jr	S,S jr
S,S	 jrS,S
 jrS,S jrS,S jrS,S jrS,S jrS,S jrS,S jrS,S jrS-S jrS,S jrS,S jrS.S/S jjrS0S jrS0S jrS0S jrS0S jrS,S jrS,S jrS1S jrS,S jrS,S jr S,S jr!S,S  jr"S,S! jr#S,S" jr$S2S# jr%S(S$ jr&S3S% jr'S&r(g')4r   éß   z<
For testing. An output class that doesn't render anything.
c                ó   • [         e)z*There is no sensible default for fileno().r‘   r   s    r   r   ÚDummyOutput.filenoä   r•   r   c                ó   • g)Nzutf-8r   r   s    r   r   ÚDummyOutput.encodingè   s   € Ør   c                ó   • g ©Nr   r   s     r   r!   ÚDummyOutput.writeë   ó   € Ør   c                ó   • g rº   r   r   s     r   r$   ÚDummyOutput.write_rawî   r¼   r   c                ó   • g rº   r   r'   s     r   r)   ÚDummyOutput.set_titleñ   r¼   r   c                ó   • g rº   r   r   s    r   r,   ÚDummyOutput.clear_titleô   r¼   r   c                ó   • g rº   r   r   s    r   r/   ÚDummyOutput.flush÷   r¼   r   c                ó   • g rº   r   r   s    r   r2   ÚDummyOutput.erase_screenú   r¼   r   c                ó   • g rº   r   r   s    r   r5   Ú"DummyOutput.enter_alternate_screený   r¼   r   c                ó   • g rº   r   r   s    r   r8   Ú!DummyOutput.quit_alternate_screen   r¼   r   c                ó   • g rº   r   r   s    r   r;   Ú DummyOutput.enable_mouse_support  r¼   r   c                ó   • g rº   r   r   s    r   r>   Ú!DummyOutput.disable_mouse_support  r¼   r   c                ó   • g rº   r   r   s    r   rA   ÚDummyOutput.erase_end_of_line	  r¼   r   c                ó   • g rº   r   r   s    r   rD   ÚDummyOutput.erase_down  r¼   r   c                ó   • g rº   r   r   s    r   rG   ÚDummyOutput.reset_attributes  r¼   r   c                ó   • g rº   r   rJ   s      r   rM   ÚDummyOutput.set_attributes  r¼   r   c                ó   • g rº   r   r   s    r   rP   ÚDummyOutput.disable_autowrap  r¼   r   c                ó   • g rº   r   r   s    r   rS   ÚDummyOutput.enable_autowrap  r¼   r   c                ó   • g rº   r   rV   s      r   rY   ÚDummyOutput.cursor_goto  r¼   r   c                ó   • g rº   r   r\   s     r   r^   ÚDummyOutput.cursor_up  r¼   r   c                ó   • g rº   r   r\   s     r   ra   ÚDummyOutput.cursor_down!  r¼   r   c                ó   • g rº   r   r\   s     r   rd   ÚDummyOutput.cursor_forward$  r¼   r   c                ó   • g rº   r   r\   s     r   rg   ÚDummyOutput.cursor_backward'  r¼   r   c                ó   • g rº   r   r   s    r   rj   ÚDummyOutput.hide_cursor*  r¼   r   c                ó   • g rº   r   r   s    r   rm   ÚDummyOutput.show_cursor-  r¼   r   c                ó   • g rº   r   rp   s     r   rr   ÚDummyOutput.set_cursor_shape0  r¼   r   c                ó   • g rº   r   r   s    r   ru   ÚDummyOutput.reset_cursor_shape3  r¼   r   c                ó   • g rº   r   r   s    r   rx   ÚDummyOutput.ask_for_cpr6  r¼   r   c                ó   • g rº   r   r   s    r   r�   ÚDummyOutput.bell9  r¼   r   c                ó   • g rº   r   r   s    r   r…   Ú"DummyOutput.enable_bracketed_paste<  r¼   r   c                ó   • g rº   r   r   s    r   rˆ   Ú#DummyOutput.disable_bracketed_paste?  r¼   r   c                ó   • g rº   r   r   s    r   rŽ   Ú#DummyOutput.scroll_buffer_to_promptB  r¼   r   c                ó   • [        SSS9$ )Né(   éP   )ÚrowsÚcolumnsr   r   s    r   r~   ÚDummyOutput.get_sizeE  s   € Ü˜ RÑ(Ð(r   c                ó   • g)Nrø   r   r   s    r   r“   Ú*DummyOutput.get_rows_below_cursor_positionH  s   € Ør   c                ó"   • [         R                  $ rº   )r   ÚDEPTH_1_BITr   s    r   r—   Ú#DummyOutput.get_default_color_depthK  s   € Ü×%Ñ%Ð%r   r   Nr™   rœ   rž   r    r¡   r¢   r£   r¤   r¥   r¦   r¨   r©   ))rª   r«   r¬   r­   r®   r   r   r!   r$   r)   r,   r/   r2   r5   r8   r;   r>   rA   rD   rG   rM   rP   rS   rY   r^   ra   rd   rg   rj   rm   rr   ru   rx   r�   r…   rˆ   rŽ   r~   r“   r—   r±   r   r   r   r   r   ß   s¶   † ñô"ôôôôôôôôôôôôôôôôôöôôôôôôôôôôôôôô)ô÷&r   N)r®   Ú
__future__r   Úabcr   r   Útypingr   Úprompt_toolkit.cursor_shapesr   Úprompt_toolkit.data_structuresr	   Úprompt_toolkit.stylesr
   rL   r   Ú__all__r   r   r   r   r   Ú<module>r	     sM   ðñõ #ç 'Ý å 4Ý /Ý 'å #ð Øð€ôF�wò FôRm&�&õ m&r   