Remove display-posterizing code. It's been dead 3 years.
Signed-off-by: John Hood <cgull@glup.org>
This commit is contained in:
@@ -187,8 +187,6 @@ static bool tick( Terminal::Framebuffer &state, Terminal::Framebuffer &new_frame
|
|||||||
|
|
||||||
if ( (!initialized)
|
if ( (!initialized)
|
||||||
|| (diff >= 0.02) ) {
|
|| (diff >= 0.02) ) {
|
||||||
display.downgrade( new_frame );
|
|
||||||
|
|
||||||
std::string update = display.new_frame( initialized, state, new_frame );
|
std::string update = display.new_frame( initialized, state, new_frame );
|
||||||
swrite( STDOUT_FILENO, update.c_str() );
|
swrite( STDOUT_FILENO, update.c_str() );
|
||||||
state = new_frame;
|
state = new_frame;
|
||||||
|
|||||||
@@ -268,9 +268,6 @@ void STMClient::output_new_frame( void )
|
|||||||
/* apply local overlays */
|
/* apply local overlays */
|
||||||
overlays.apply( new_state );
|
overlays.apply( new_state );
|
||||||
|
|
||||||
/* apply any mutations */
|
|
||||||
display.downgrade( new_state );
|
|
||||||
|
|
||||||
/* calculate minimal difference from where we are */
|
/* calculate minimal difference from where we are */
|
||||||
const string diff( display.new_frame( !repaint_requested,
|
const string diff( display.new_frame( !repaint_requested,
|
||||||
local_framebuffer,
|
local_framebuffer,
|
||||||
|
|||||||
@@ -75,15 +75,11 @@ namespace Terminal {
|
|||||||
|
|
||||||
bool has_title; /* supports window title and icon name */
|
bool has_title; /* supports window title and icon name */
|
||||||
|
|
||||||
int posterize_colors; /* downsample input colors >8 to [0..7] */
|
|
||||||
|
|
||||||
const char *smcup, *rmcup; /* enter and exit alternate screen mode */
|
const char *smcup, *rmcup; /* enter and exit alternate screen mode */
|
||||||
|
|
||||||
bool put_row( bool initialized, FrameState &frame, const Framebuffer &f, int frame_y, const Row &old_row, bool wrap ) const;
|
bool put_row( bool initialized, FrameState &frame, const Framebuffer &f, int frame_y, const Row &old_row, bool wrap ) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void downgrade( Framebuffer &f ) const { if ( posterize_colors ) { f.posterize(); } }
|
|
||||||
|
|
||||||
std::string open() const;
|
std::string open() const;
|
||||||
std::string close() const;
|
std::string close() const;
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ const char *Display::ti_str( const char *capname )
|
|||||||
}
|
}
|
||||||
|
|
||||||
Display::Display( bool use_environment )
|
Display::Display( bool use_environment )
|
||||||
: has_ech( true ), has_bce( true ), has_title( true ), posterize_colors( 0 ), smcup( NULL ), rmcup( NULL )
|
: has_ech( true ), has_bce( true ), has_title( true ), smcup( NULL ), rmcup( NULL )
|
||||||
{
|
{
|
||||||
if ( use_environment ) {
|
if ( use_environment ) {
|
||||||
int errret = -2;
|
int errret = -2;
|
||||||
@@ -141,12 +141,6 @@ Display::Display( bool use_environment )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* posterization disabled because server now only advertises
|
|
||||||
xterm-256color when client has colors = 256 */
|
|
||||||
/*
|
|
||||||
posterize_colors = ti_num( "colors" ) < 256;
|
|
||||||
*/
|
|
||||||
|
|
||||||
if ( !getenv( "MOSH_NO_TERM_INIT" ) ) {
|
if ( !getenv( "MOSH_NO_TERM_INIT" ) ) {
|
||||||
smcup = ti_str("smcup");
|
smcup = ti_str("smcup");
|
||||||
rmcup = ti_str("rmcup");
|
rmcup = ti_str("rmcup");
|
||||||
|
|||||||
@@ -398,19 +398,6 @@ void Framebuffer::soft_reset( void )
|
|||||||
ds.clear_saved_cursor();
|
ds.clear_saved_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Framebuffer::posterize( void )
|
|
||||||
{
|
|
||||||
for ( rows_type::iterator i = rows.begin();
|
|
||||||
i != rows.end();
|
|
||||||
i++ ) {
|
|
||||||
for ( Row::cells_type::iterator j = (*i)->cells.begin();
|
|
||||||
j != (*i)->cells.end();
|
|
||||||
j++ ) {
|
|
||||||
j->renditions.posterize();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Framebuffer::resize( int s_width, int s_height )
|
void Framebuffer::resize( int s_width, int s_height )
|
||||||
{
|
{
|
||||||
assert( s_width > 0 );
|
assert( s_width > 0 );
|
||||||
@@ -571,59 +558,6 @@ std::string Renditions::sgr( void ) const
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reduce 256 "standard" colors to the 8 ANSI colors. */
|
|
||||||
|
|
||||||
/* Terminal emulators generally agree on the (R',G',B') values of the
|
|
||||||
"standard" 256-color palette beyond #15, but for the first 16
|
|
||||||
colors there is disagreement. Most terminal emulators are roughly
|
|
||||||
self-consistent, except on Ubuntu's gnome-terminal where "ANSI
|
|
||||||
blue" (#4) has been replaced with the aubergine system-wide
|
|
||||||
color. See
|
|
||||||
https://lists.ubuntu.com/archives/ubuntu-devel/2011-March/032726.html
|
|
||||||
|
|
||||||
Terminal emulators that advertise "xterm" are inconsistent on the
|
|
||||||
handling of initc to change the contents of a cell in the color
|
|
||||||
palette. On RIS (reset to initial state) or choosing reset from
|
|
||||||
the user interface, xterm resets all entries, but gnome-terminal
|
|
||||||
only resets entries beyond 16. (rxvt doesn't reset any entries,
|
|
||||||
and Terminal.app ignores initc.) On initc, xterm applies changes
|
|
||||||
immediately (but slowly), but gnome-terminal's changes are only
|
|
||||||
prospective unless the user resizes the terminal.
|
|
||||||
|
|
||||||
mosh ignores initc for now, despite advertising xterm-256color. */
|
|
||||||
|
|
||||||
/* Table mapping common color cube for [16 .. 255]
|
|
||||||
to xterm's system colors (0 .. 7) with closest
|
|
||||||
CIE deltaE(2000). */
|
|
||||||
static const char standard_posterization[] = {
|
|
||||||
0, 1, 2, 3, 4, 5, 6, 7, 7, 1, 2, 3, 4, 5, 6, 7,
|
|
||||||
0, 4, 4, 4, 4, 4, 0, 0, 4, 4, 4, 4, 2, 6, 6, 6,
|
|
||||||
6, 4, 2, 2, 6, 6, 6, 6, 2, 2, 2, 6, 6, 6, 2, 2,
|
|
||||||
2, 2, 6, 6, 1, 4, 4, 4, 4, 4, 0, 0, 4, 4, 4, 4,
|
|
||||||
2, 2, 6, 6, 4, 5, 2, 2, 6, 6, 6, 6, 2, 2, 2, 6,
|
|
||||||
6, 6, 2, 2, 2, 2, 6, 6, 1, 5, 5, 4, 4, 4, 1, 1,
|
|
||||||
5, 5, 5, 5, 3, 3, 7, 5, 5, 5, 2, 2, 2, 6, 7, 7,
|
|
||||||
2, 2, 2, 6, 6, 6, 2, 2, 2, 2, 6, 6, 1, 5, 5, 5,
|
|
||||||
5, 5, 1, 1, 5, 5, 5, 5, 3, 1, 7, 5, 5, 5, 3, 3,
|
|
||||||
3, 7, 7, 7, 3, 3, 2, 7, 6, 7, 3, 2, 2, 2, 6, 6,
|
|
||||||
1, 5, 5, 5, 5, 5, 1, 1, 5, 5, 5, 5, 3, 1, 1, 5,
|
|
||||||
5, 5, 3, 3, 7, 7, 7, 7, 3, 3, 3, 7, 7, 7, 3, 3,
|
|
||||||
3, 3, 7, 7, 1, 1, 5, 5, 5, 5, 1, 1, 5, 5, 5, 5,
|
|
||||||
1, 1, 1, 5, 5, 5, 3, 7, 7, 7, 7, 7, 3, 3, 3, 7,
|
|
||||||
7, 7, 3, 3, 3, 3, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 1, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 };
|
|
||||||
|
|
||||||
void Renditions::posterize( void )
|
|
||||||
{
|
|
||||||
if ( foreground_color ) {
|
|
||||||
foreground_color = 30 + standard_posterization[ foreground_color - 30 ];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( background_color ) {
|
|
||||||
background_color = 40 + standard_posterization[ background_color - 40 ];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Row::reset( color_type background_color )
|
void Row::reset( color_type background_color )
|
||||||
{
|
{
|
||||||
gen = get_gen();
|
gen = get_gen();
|
||||||
|
|||||||
@@ -68,8 +68,6 @@ namespace Terminal {
|
|||||||
void set_rendition( color_type num );
|
void set_rendition( color_type num );
|
||||||
std::string sgr( void ) const;
|
std::string sgr( void ) const;
|
||||||
|
|
||||||
void posterize( void );
|
|
||||||
|
|
||||||
bool operator==( const Renditions &x ) const
|
bool operator==( const Renditions &x ) const
|
||||||
{
|
{
|
||||||
return ( attributes == x.attributes )
|
return ( attributes == x.attributes )
|
||||||
@@ -428,8 +426,6 @@ namespace Terminal {
|
|||||||
void reset_cell( Cell *c ) { c->reset( ds.get_background_rendition() ); }
|
void reset_cell( Cell *c ) { c->reset( ds.get_background_rendition() ); }
|
||||||
void reset_row( Row *r ) { r->reset( ds.get_background_rendition() ); }
|
void reset_row( Row *r ) { r->reset( ds.get_background_rendition() ); }
|
||||||
|
|
||||||
void posterize( void );
|
|
||||||
|
|
||||||
void ring_bell( void ) { bell_count++; }
|
void ring_bell( void ) { bell_count++; }
|
||||||
unsigned int get_bell_count( void ) const { return bell_count; }
|
unsigned int get_bell_count( void ) const { return bell_count; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user