o
    �õ±jI  ã                   @  s�   d dl mZ d dlZejdksJ ‚d dlmZmZ d dlmZ ddl	m
Z
 ddlmZ dd	lmZ dd
lmZ dgZG dd„ dƒZe
 e¡ dS )é    )ÚannotationsNÚwin32)ÚAnyÚTextIO©ÚSizeé   )ÚOutput)Ú
ColorDepth)ÚVt100_Output)ÚWin32OutputÚConEmuOutputc                   @  s6   e Zd ZdZ	ddd	d
„Zeddd„ƒZddd„ZdS )r   a  
    ConEmu (Windows) output abstraction.

    ConEmu is a Windows console application, but it also supports ANSI escape
    sequences. This output class is actually a proxy to both `Win32Output` and
    `Vt100_Output`. It uses `Win32Output` for console sizing and scrolling, but
    all cursor movements and scrolling happens through the `Vt100_Output`.

    This way, we can have 256 colors in ConEmu and Cmder. Rendering will be
    even a little faster as well.

    http://conemu.github.io/
    http://gooseberrycreative.com/cmder/
    NÚstdoutr   Údefault_color_depthúColorDepth | NoneÚreturnÚNonec                 C  s&   t ||d�| _t|dd„ |d�| _d S )N)r   c                   S  s
   t ddƒS )Nr   r   © r   r   ú�/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/prompt_toolkit/output/conemu.pyÚ<lambda>*   s   
 z'ConEmuOutput.__init__.<locals>.<lambda>)r   Úwin32_outputr   Úvt100_output)Úselfr   r   r   r   r   Ú__init__%   s   
ÿzConEmuOutput.__init__Úboolc                 C  s   dS )NFr   )r   r   r   r   Úresponds_to_cpr-   s   zConEmuOutput.responds_to_cprÚnameÚstrr   c                 C  s    |dv r
t | j|ƒS t | j|ƒS )N)Úget_sizeÚget_rows_below_cursor_positionÚenable_mouse_supportÚdisable_mouse_supportÚscroll_buffer_to_promptÚget_win32_screen_buffer_infoÚenable_bracketed_pasteÚdisable_bracketed_paste)Úgetattrr   r   )r   r   r   r   r   Ú__getattr__1   s   
zConEmuOutput.__getattr__)N)r   r   r   r   r   r   )r   r   )r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   r'   r   r   r   r   r      s    ÿ)Ú
__future__r   ÚsysÚplatformÚtypingr   r   Úprompt_toolkit.data_structuresr   Úbaser	   Úcolor_depthr
   Úvt100r   r   r   Ú__all__r   Úregisterr   r   r   r   Ú<module>   s    ÿ,