Move Emulator::{open,close} to Display
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
committed by
Keith Winstein
parent
ba8d013609
commit
03217ddb5a
@@ -163,17 +163,6 @@ void Emulator::Esc_dispatch( const Parser::Esc_Dispatch *act )
|
||||
}
|
||||
}
|
||||
|
||||
std::string Emulator::open( void )
|
||||
{
|
||||
char appmode[ 6 ] = { 0x1b, '[', '?', '1', 'h', 0 };
|
||||
return std::string( appmode );
|
||||
}
|
||||
|
||||
std::string Emulator::close( void )
|
||||
{
|
||||
return std::string( "\033[?1l\033[0m\033[?25h" );
|
||||
}
|
||||
|
||||
void Emulator::resize( size_t s_width, size_t s_height )
|
||||
{
|
||||
fb.resize( s_width, s_height );
|
||||
|
||||
@@ -78,9 +78,6 @@ namespace Terminal {
|
||||
|
||||
std::string read_octets_to_host( void );
|
||||
|
||||
static std::string open( void ); /* put user cursor keys in application mode */
|
||||
static std::string close( void ); /* restore user cursor keys */
|
||||
|
||||
const Framebuffer & get_fb( void ) const { return fb; }
|
||||
|
||||
bool operator==( Emulator const &x ) const;
|
||||
|
||||
@@ -44,6 +44,16 @@ static const Renditions & initial_rendition( void )
|
||||
return blank;
|
||||
}
|
||||
|
||||
std::string Display::open() const
|
||||
{
|
||||
return std::string( "\033[?1h" );
|
||||
}
|
||||
|
||||
std::string Display::close() const
|
||||
{
|
||||
return std::string( "\033[?1l\033[0m\033[?25h" );
|
||||
}
|
||||
|
||||
std::string Display::new_frame( bool initialized, const Framebuffer &last, const Framebuffer &f ) const
|
||||
{
|
||||
FrameState frame( last );
|
||||
|
||||
@@ -79,6 +79,9 @@ namespace Terminal {
|
||||
public:
|
||||
void downgrade( Framebuffer &f ) const { if ( posterize_colors ) { f.posterize(); } }
|
||||
|
||||
std::string open() const;
|
||||
std::string close() const;
|
||||
|
||||
std::string new_frame( bool initialized, const Framebuffer &last, const Framebuffer &f ) const;
|
||||
|
||||
Display( bool use_environment );
|
||||
|
||||
Reference in New Issue
Block a user