From a41f8a611c39ba2289462e671b499de769d739a3 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 6 May 2018 21:41:55 +0200 Subject: [PATCH] Some protected data members in FTerm moved to private --- ChangeLog | 3 ++ include/final/fc.h | 1 + include/final/foptimove.h | 46 +++++++++++----------- include/final/ftcap_map.h | 1 + include/final/fterm.h | 75 ++++++++++++++++++++++++++++-------- src/fbutton.cpp | 4 +- src/flineedit.cpp | 4 +- src/foptiattr.cpp | 3 ++ src/foptimove.cpp | 80 +++++++++++++++++++-------------------- src/fprogressbar.cpp | 4 +- src/fstatusbar.cpp | 6 +-- src/fterm.cpp | 54 +++++++++++++------------- src/ftextview.cpp | 2 +- src/fvterm.cpp | 22 +++++------ src/fwidget.cpp | 6 +-- 15 files changed, 181 insertions(+), 130 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c3f51aa..ebc8d84d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2017-05-06 Markus Gans + * Some protected data members in FTerm moved to private + 2017-05-03 Markus Gans * Fix resetColorMap in FTerm diff --git a/include/final/fc.h b/include/final/fc.h index 253035fd..9d8a63fd 100644 --- a/include/final/fc.h +++ b/include/final/fc.h @@ -1073,6 +1073,7 @@ enum termcaps t_parm_right_cursor, t_save_cursor, t_restore_cursor, + t_cursor_style, t_scroll_forward, t_scroll_reverse, t_enter_ca_mode, diff --git a/include/final/foptimove.h b/include/final/foptimove.h index 2be696e3..d531acfd 100644 --- a/include/final/foptimove.h +++ b/include/final/foptimove.h @@ -63,6 +63,7 @@ #include #include +#include "final/ftypes.h" //---------------------------------------------------------------------- // class FOptiMove @@ -87,26 +88,26 @@ class FOptiMove void setBaudRate (int); void setTabStop (int); void setTermSize (int, int); - int set_cursor_home (char[]); - int set_cursor_to_ll (char[]); - int set_carriage_return (char[]); - int set_tabular (char[]); - int set_back_tab (char[]); - int set_cursor_up (char[]); - int set_cursor_down (char[]); - int set_cursor_left (char[]); - int set_cursor_right (char[]); - int set_cursor_address (char[]); - int set_column_address (char[]); - int set_row_address (char[]); - int set_parm_up_cursor (char[]); - int set_parm_down_cursor (char[]); - int set_parm_left_cursor (char[]); - int set_parm_right_cursor (char[]); - int set_erase_chars (char[]); - int set_repeat_char (char[]); - int set_clr_bol (char[]); - int set_clr_eol (char[]); + uInt set_cursor_home (char[]); + uInt set_cursor_to_ll (char[]); + uInt set_carriage_return (char[]); + uInt set_tabular (char[]); + uInt set_back_tab (char[]); + uInt set_cursor_up (char[]); + uInt set_cursor_down (char[]); + uInt set_cursor_left (char[]); + uInt set_cursor_right (char[]); + uInt set_cursor_address (char[]); + uInt set_column_address (char[]); + uInt set_row_address (char[]); + uInt set_parm_up_cursor (char[]); + uInt set_parm_down_cursor (char[]); + uInt set_parm_left_cursor (char[]); + uInt set_parm_right_cursor (char[]); + uInt set_erase_chars (char[]); + uInt set_repeat_char (char[]); + uInt set_clr_bol (char[]); + uInt set_clr_eol (char[]); void set_auto_left_margin (const bool&); void set_eat_newline_glitch (const bool&); @@ -119,10 +120,7 @@ class FOptiMove // Constant static const std::size_t BUF_SIZE = 512; - // Typedefs - typedef unsigned char uChar; - typedef unsigned int uInt; - + // Typedef typedef struct { char* cap; diff --git a/include/final/ftcap_map.h b/include/final/ftcap_map.h index 7cef41e3..ec86b41e 100644 --- a/include/final/ftcap_map.h +++ b/include/final/ftcap_map.h @@ -81,6 +81,7 @@ static FTermcap::tcap_map term_caps[] = { 0, "RI" }, // parm_right_cursor -> move #1 characters to the right (P*) { 0, "sc" }, // save_cursor -> save current cursor position (P) { 0, "rc" }, // restore_cursor -> restore cursor to save_cursor + { 0, "Ss" }, // set cursor style -> Select the DECSCUSR cursor style { 0, "sf" }, // scroll_forward -> scroll text up (P) { 0, "sr" }, // scroll_reverse -> scroll text down (P) { 0, "ti" }, // enter_ca_mode -> string to start programs using cup diff --git a/include/final/fterm.h b/include/final/fterm.h index 1569407e..5e49cff4 100644 --- a/include/final/fterm.h +++ b/include/final/fterm.h @@ -317,6 +317,19 @@ class FTerm #endif protected: + // Inquiries + static bool hasChangedTermSize(); + static bool hasShadowCharacter(); + static bool hasHalfBlockCharacter(); + static bool hasAlternateScreen(); + + // Accessors + static uInt getEraseCharLength(); + static uInt getRepeatCharLength(); + static uInt getClrBolLength(); + static uInt getClrEolLength(); + static uInt getCursorAddressLengths(); + // Methods #if defined(__linux__) static void initLinuxConsoleCharMap(); @@ -331,7 +344,6 @@ class FTerm static uInt charEncode (uInt, fc::encoding); static char* changeAttribute ( char_data*& , char_data*& ); - static bool hasChangedTermSize(); static void changeTermSizeFinished(); static void xtermMetaSendsESC (bool); static void exitWithMessage (std::string) @@ -340,21 +352,6 @@ class FTerm #endif ; // Data Members - static int erase_ch_length; - static int repeat_char_length; - static int clr_bol_length; - static int clr_eol_length; - static int cursor_addres_lengths; - static bool NewFont; - static bool VGAFont; - static bool no_shadow_character; - static bool no_half_block_character; - static bool cursor_optimisation; - static bool xterm_default_colors; - static bool use_alternate_screen; - static fc::encoding term_encoding; - static char exit_message[8192]; - static struct initializationValues { public: @@ -502,7 +499,13 @@ class FTerm static std::map * vt100_alt_char; static std::map * encoding_set; static FTermcap::tcap_map* tcap; + static fc::encoding term_encoding; + static bool shadow_character; + static bool half_block_character; + static bool cursor_optimisation; + static bool xterm_default_colors; + static bool use_alternate_screen; static bool input_data_pending; static bool non_blocking_stdin; static bool pc_charset_console; @@ -513,10 +516,13 @@ class FTerm static bool force_vt100; static bool vt100_console; static bool ascii_console; + static bool NewFont; + static bool VGAFont; static bool color256; static bool monochron; static char termtype[256]; static char termfilename[256]; + static char exit_message[8192]; static char* locale_name; static char* locale_xterm; static FRect* term; // current terminal geometry @@ -524,6 +530,11 @@ class FTerm static int stdin_status_flags; static int fd_tty; static uInt baudrate; + static uInt erase_char_length; + static uInt repeat_char_length; + static uInt clr_bol_length; + static uInt clr_eol_length; + static uInt cursor_address_lengths; static long key_timeout; static bool resize_term; @@ -786,6 +797,38 @@ inline bool FTerm::unsetNonBlockingInput() inline bool FTerm::hasChangedTermSize() { return resize_term; } +//---------------------------------------------------------------------- +inline bool FTerm::hasShadowCharacter() +{ return shadow_character; } + +//---------------------------------------------------------------------- +inline bool FTerm::hasHalfBlockCharacter() +{ return half_block_character; } + +//---------------------------------------------------------------------- +inline bool FTerm::hasAlternateScreen() +{ return use_alternate_screen; } + +//---------------------------------------------------------------------- +inline uInt FTerm::getEraseCharLength() +{ return erase_char_length; } + +//---------------------------------------------------------------------- +inline uInt FTerm::getRepeatCharLength() +{ return repeat_char_length; } + +//---------------------------------------------------------------------- +inline uInt FTerm::getClrBolLength() +{ return clr_bol_length; } + +//---------------------------------------------------------------------- +inline uInt FTerm::getClrEolLength() +{ return clr_eol_length; } + +//---------------------------------------------------------------------- +inline uInt FTerm::getCursorAddressLengths() +{ return cursor_address_lengths; } + //---------------------------------------------------------------------- inline void FTerm::changeTermSizeFinished() { resize_term = false; } diff --git a/src/fbutton.cpp b/src/fbutton.cpp index 9232a553..0347cdff 100644 --- a/src/fbutton.cpp +++ b/src/fbutton.cpp @@ -220,8 +220,8 @@ bool FButton::setFlat (bool on) bool FButton::setShadow (bool on) { if ( on - && term_encoding != fc::VT100 - && term_encoding != fc::ASCII ) + && getEncoding() != fc::VT100 + && getEncoding() != fc::ASCII ) { flags |= fc::shadow; setShadowSize(1,1); diff --git a/src/flineedit.cpp b/src/flineedit.cpp index b71e2aab..f5fbc3b0 100644 --- a/src/flineedit.cpp +++ b/src/flineedit.cpp @@ -234,8 +234,8 @@ bool FLineEdit::setFocus (bool on) bool FLineEdit::setShadow (bool on) { if ( on - && term_encoding != fc::VT100 - && term_encoding != fc::ASCII ) + && getEncoding() != fc::VT100 + && getEncoding() != fc::ASCII ) { flags |= fc::shadow; setShadowSize(1,1); diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp index 4d771091..56b68957 100644 --- a/src/foptiattr.cpp +++ b/src/foptiattr.cpp @@ -1326,6 +1326,9 @@ inline void FOptiAttr::changeAttributeSGR ( char_data*& term { bool pc_charset_usable = true; + if ( ! (term && next) ) + return; + if ( switchOn() || switchOff() ) setTermAttributes ( term , next->attr.bit.standout diff --git a/src/foptimove.cpp b/src/foptimove.cpp index 68e8fb5c..8aac08d6 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -105,7 +105,7 @@ void FOptiMove::setTermSize (int w, int h) } //---------------------------------------------------------------------- -int FOptiMove::set_cursor_home (char cap[]) +uInt FOptiMove::set_cursor_home (char cap[]) { if ( cap ) { @@ -120,11 +120,11 @@ int FOptiMove::set_cursor_home (char cap[]) F_cursor_home.length = LONG_DURATION; } - return F_cursor_home.length; + return uInt(F_cursor_home.length); } //---------------------------------------------------------------------- -int FOptiMove::set_cursor_to_ll (char cap[]) +uInt FOptiMove::set_cursor_to_ll (char cap[]) { if ( cap ) { @@ -139,11 +139,11 @@ int FOptiMove::set_cursor_to_ll (char cap[]) F_cursor_to_ll.length = LONG_DURATION; } - return F_cursor_to_ll.length; + return uInt(F_cursor_to_ll.length); } //---------------------------------------------------------------------- -int FOptiMove::set_carriage_return (char cap[]) +uInt FOptiMove::set_carriage_return (char cap[]) { if ( cap ) { @@ -158,11 +158,11 @@ int FOptiMove::set_carriage_return (char cap[]) F_carriage_return.length = LONG_DURATION; } - return F_carriage_return.length; + return uInt(F_carriage_return.length); } //---------------------------------------------------------------------- -int FOptiMove::set_tabular (char cap[]) +uInt FOptiMove::set_tabular (char cap[]) { if ( cap ) { @@ -177,11 +177,11 @@ int FOptiMove::set_tabular (char cap[]) F_tab.length = LONG_DURATION; } - return F_tab.length; + return uInt(F_tab.length); } //---------------------------------------------------------------------- -int FOptiMove::set_back_tab (char cap[]) +uInt FOptiMove::set_back_tab (char cap[]) { if ( cap ) { @@ -196,11 +196,11 @@ int FOptiMove::set_back_tab (char cap[]) F_back_tab.length = LONG_DURATION; } - return F_back_tab.length; + return uInt(F_back_tab.length); } //---------------------------------------------------------------------- -int FOptiMove::set_cursor_up (char cap[]) +uInt FOptiMove::set_cursor_up (char cap[]) { if ( cap ) { @@ -215,11 +215,11 @@ int FOptiMove::set_cursor_up (char cap[]) F_cursor_up.length = LONG_DURATION; } - return F_cursor_up.length; + return uInt(F_cursor_up.length); } //---------------------------------------------------------------------- -int FOptiMove::set_cursor_down (char cap[]) +uInt FOptiMove::set_cursor_down (char cap[]) { if ( cap ) { @@ -234,11 +234,11 @@ int FOptiMove::set_cursor_down (char cap[]) F_cursor_down.length = LONG_DURATION; } - return F_cursor_down.length; + return uInt(F_cursor_down.length); } //---------------------------------------------------------------------- -int FOptiMove::set_cursor_left (char cap[]) +uInt FOptiMove::set_cursor_left (char cap[]) { if ( cap ) { @@ -253,11 +253,11 @@ int FOptiMove::set_cursor_left (char cap[]) F_cursor_left.length = LONG_DURATION; } - return F_cursor_left.length; + return uInt(F_cursor_left.length); } //---------------------------------------------------------------------- -int FOptiMove::set_cursor_right (char cap[]) +uInt FOptiMove::set_cursor_right (char cap[]) { if ( cap ) { @@ -272,11 +272,11 @@ int FOptiMove::set_cursor_right (char cap[]) F_cursor_right.length = LONG_DURATION; } - return F_cursor_right.length; + return uInt(F_cursor_right.length); } //---------------------------------------------------------------------- -int FOptiMove::set_cursor_address (char cap[]) +uInt FOptiMove::set_cursor_address (char cap[]) { if ( cap ) { @@ -292,11 +292,11 @@ int FOptiMove::set_cursor_address (char cap[]) F_cursor_address.length = LONG_DURATION; } - return F_cursor_address.length; + return uInt(F_cursor_address.length); } //---------------------------------------------------------------------- -int FOptiMove::set_column_address (char cap[]) +uInt FOptiMove::set_column_address (char cap[]) { if ( cap ) { @@ -312,11 +312,11 @@ int FOptiMove::set_column_address (char cap[]) F_column_address.length = LONG_DURATION; } - return F_column_address.length; + return uInt(F_column_address.length); } //---------------------------------------------------------------------- -int FOptiMove::set_row_address (char cap[]) +uInt FOptiMove::set_row_address (char cap[]) { if ( cap ) { @@ -332,11 +332,11 @@ int FOptiMove::set_row_address (char cap[]) F_row_address.length = LONG_DURATION; } - return F_row_address.length; + return uInt(F_row_address.length); } //---------------------------------------------------------------------- -int FOptiMove::set_parm_up_cursor (char cap[]) +uInt FOptiMove::set_parm_up_cursor (char cap[]) { if ( cap ) { @@ -352,11 +352,11 @@ int FOptiMove::set_parm_up_cursor (char cap[]) F_parm_up_cursor.length = LONG_DURATION; } - return F_parm_up_cursor.length; + return uInt(F_parm_up_cursor.length); } //---------------------------------------------------------------------- -int FOptiMove::set_parm_down_cursor (char cap[]) +uInt FOptiMove::set_parm_down_cursor (char cap[]) { if ( cap ) { @@ -372,11 +372,11 @@ int FOptiMove::set_parm_down_cursor (char cap[]) F_parm_down_cursor.length = LONG_DURATION; } - return F_parm_down_cursor.length; + return uInt(F_parm_down_cursor.length); } //---------------------------------------------------------------------- -int FOptiMove::set_parm_left_cursor (char cap[]) +uInt FOptiMove::set_parm_left_cursor (char cap[]) { if ( cap ) { @@ -392,11 +392,11 @@ int FOptiMove::set_parm_left_cursor (char cap[]) F_parm_left_cursor.length = LONG_DURATION; } - return F_parm_left_cursor.length; + return uInt(F_parm_left_cursor.length); } //---------------------------------------------------------------------- -int FOptiMove::set_parm_right_cursor (char cap[]) +uInt FOptiMove::set_parm_right_cursor (char cap[]) { if ( cap ) { @@ -412,11 +412,11 @@ int FOptiMove::set_parm_right_cursor (char cap[]) F_parm_right_cursor.length = LONG_DURATION; } - return F_parm_right_cursor.length; + return uInt(F_parm_right_cursor.length); } //---------------------------------------------------------------------- -int FOptiMove::set_erase_chars (char cap[]) +uInt FOptiMove::set_erase_chars (char cap[]) { if ( cap ) { @@ -432,11 +432,11 @@ int FOptiMove::set_erase_chars (char cap[]) F_erase_chars.length = LONG_DURATION; } - return F_erase_chars.length; + return uInt(F_erase_chars.length); } //---------------------------------------------------------------------- -int FOptiMove::set_repeat_char (char cap[]) +uInt FOptiMove::set_repeat_char (char cap[]) { if ( cap ) { @@ -452,11 +452,11 @@ int FOptiMove::set_repeat_char (char cap[]) F_repeat_char.length = LONG_DURATION; } - return F_repeat_char.length; + return uInt(F_repeat_char.length); } //---------------------------------------------------------------------- -int FOptiMove::set_clr_bol (char cap[]) +uInt FOptiMove::set_clr_bol (char cap[]) { if ( cap ) { @@ -471,11 +471,11 @@ int FOptiMove::set_clr_bol (char cap[]) F_clr_bol.length = LONG_DURATION; } - return F_clr_bol.length; + return uInt(F_clr_bol.length); } //---------------------------------------------------------------------- -int FOptiMove::set_clr_eol (char cap[]) +uInt FOptiMove::set_clr_eol (char cap[]) { if ( cap ) { @@ -490,7 +490,7 @@ int FOptiMove::set_clr_eol (char cap[]) F_clr_eol.length = LONG_DURATION; } - return F_clr_eol.length; + return uInt(F_clr_eol.length); } //---------------------------------------------------------------------- diff --git a/src/fprogressbar.cpp b/src/fprogressbar.cpp index e34595e8..1af33ac0 100644 --- a/src/fprogressbar.cpp +++ b/src/fprogressbar.cpp @@ -79,8 +79,8 @@ void FProgressbar::setGeometry (int x, int y, int w, int h, bool adjust) bool FProgressbar::setShadow (bool on) { if ( on - && term_encoding != fc::VT100 - && term_encoding != fc::ASCII ) + && getEncoding() != fc::VT100 + && getEncoding() != fc::ASCII ) { flags |= fc::shadow; setShadowSize(1,1); diff --git a/src/fstatusbar.cpp b/src/fstatusbar.cpp index 359641f0..6e276cab 100644 --- a/src/fstatusbar.cpp +++ b/src/fstatusbar.cpp @@ -664,13 +664,13 @@ void FStatusBar::drawKey (keyList::const_iterator iter) if ( isMonochron() ) setReverse(false); - if ( no_half_block_character ) - print (' '); - else + if ( hasHalfBlockCharacter() ) { setColor (wc.statusbar_active_fg, wc.statusbar_active_bg); print (fc::LeftHalfBlock); // ▐ } + else + print (' '); x++; diff --git a/src/fterm.cpp b/src/fterm.cpp index 193c0d68..1d3df6e8 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -48,11 +48,11 @@ int (*FTerm::Fputchar)(int); // static class attributes int FTerm::fd_tty; int FTerm::stdin_status_flags; -int FTerm::erase_ch_length; -int FTerm::repeat_char_length; -int FTerm::clr_bol_length; -int FTerm::clr_eol_length; -int FTerm::cursor_addres_lengths; +uInt FTerm::erase_char_length; +uInt FTerm::repeat_char_length; +uInt FTerm::clr_bol_length; +uInt FTerm::clr_eol_length; +uInt FTerm::cursor_address_lengths; uInt FTerm::baudrate; long FTerm::key_timeout; bool FTerm::resize_term; @@ -71,8 +71,8 @@ bool FTerm::vt100_console; bool FTerm::ascii_console; bool FTerm::NewFont; bool FTerm::VGAFont; -bool FTerm::no_shadow_character; -bool FTerm::no_half_block_character; +bool FTerm::shadow_character; +bool FTerm::half_block_character; bool FTerm::cursor_optimisation; bool FTerm::xterm_default_colors; bool FTerm::use_alternate_screen = true; @@ -824,7 +824,9 @@ void FTerm::setXTermCursorStyle (fc::xtermCursorStyle style) return; #endif - if ( isXTerminal() || isMinttyTerm() + if ( TCAP(fc::t_cursor_style) + || isXTerminal() + || isMinttyTerm() || term_detection->hasSetCursorStyleSupport() ) { putstringf (CSI "%d q", style); @@ -1496,7 +1498,7 @@ void FTerm::initLinuxConsoleCharMap() || charEncode(c2, fc::PC) == charEncode(c2, fc::ASCII) || charEncode(c3, fc::PC) == charEncode(c3, fc::ASCII) ) { - no_shadow_character = true; + shadow_character = false; } c4 = fc::RightHalfBlock; @@ -1505,7 +1507,7 @@ void FTerm::initLinuxConsoleCharMap() if ( charEncode(c4, fc::PC) == charEncode(c4, fc::ASCII) || charEncode(c5, fc::PC) == charEncode(c5, fc::ASCII) ) { - no_half_block_character = true; + half_block_character = false; } } #endif @@ -2198,22 +2200,22 @@ void FTerm::init_global_values() key_timeout = 100000; // 100 ms // Preset to true - cursor_optimisation = true; + shadow_character = \ + half_block_character = \ + cursor_optimisation = true; // Preset to false - utf8_console = \ - utf8_input = \ - utf8_state = \ - utf8_linux_terminal = \ - pc_charset_console = \ - vt100_console = \ - NewFont = \ - VGAFont = \ - no_shadow_character = \ - no_half_block_character = \ - ascii_console = \ - force_vt100 = \ - xterm_default_colors = false; + utf8_console = \ + utf8_input = \ + utf8_state = \ + utf8_linux_terminal = \ + pc_charset_console = \ + vt100_console = \ + NewFont = \ + VGAFont = \ + ascii_console = \ + force_vt100 = \ + xterm_default_colors = false; // Assertion: programm start in cooked mode input_data_pending = \ @@ -2656,7 +2658,7 @@ void FTerm::init_OptiMove() opti_move->set_cursor_down (TCAP(fc::t_cursor_down)); opti_move->set_cursor_left (TCAP(fc::t_cursor_left)); opti_move->set_cursor_right (TCAP(fc::t_cursor_right)); - cursor_addres_lengths = \ + cursor_address_lengths = \ opti_move->set_cursor_address (TCAP(fc::t_cursor_address)); opti_move->set_column_address (TCAP(fc::t_column_address)); opti_move->set_row_address (TCAP(fc::t_row_address)); @@ -2666,7 +2668,7 @@ void FTerm::init_OptiMove() opti_move->set_parm_right_cursor (TCAP(fc::t_parm_right_cursor)); opti_move->set_auto_left_margin (FTermcap::automatic_left_margin); opti_move->set_eat_newline_glitch (FTermcap::eat_nl_glitch); - erase_ch_length = \ + erase_char_length = \ opti_move->set_erase_chars (TCAP(fc::t_erase_chars)); repeat_char_length = \ opti_move->set_repeat_char (TCAP(fc::t_repeat_char)); diff --git a/src/ftextview.cpp b/src/ftextview.cpp index 5ebb0d3b..9a2c3ce2 100644 --- a/src/ftextview.cpp +++ b/src/ftextview.cpp @@ -775,7 +775,7 @@ void FTextView::drawText() for (i = 0; i < len; i++) { wchar_t ch = line_str[i]; - bool utf8 = ( term_encoding == fc::UTF8 ) ? true : false; + bool utf8 = ( getEncoding() == fc::UTF8 ) ? true : false; // only printable and 1 column per character if ( ( (utf8 && std::iswprint(wint_t(ch))) diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 828ad252..2806943c 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -2176,7 +2176,7 @@ void FVTerm::finish() // Clear the terminal setNormal(); - if ( use_alternate_screen ) + if ( hasAlternateScreen() ) clearTerm(); flush_out(); @@ -2413,7 +2413,7 @@ bool FVTerm::canClearToEOL (uInt xmin, uInt y) if ( beginning_whitespace == uInt(vt->width) - xmin && (ut || normal) - && clr_eol_length < int(beginning_whitespace) ) + && getClrEolLength() < beginning_whitespace ) return true; } @@ -2448,7 +2448,7 @@ bool FVTerm::canClearLeadingWS (uInt& xmin, uInt y) if ( leading_whitespace > xmin && (ut || normal) - && clr_bol_length < int(leading_whitespace) ) + && getClrBolLength() < leading_whitespace ) { xmin = leading_whitespace - 1; return true; @@ -2486,7 +2486,7 @@ bool FVTerm::canClearTrailingWS (uInt& xmax, uInt y) if ( trailing_whitespace > uInt(vt->width) - xmax && (ut || normal) - && clr_bol_length < int(trailing_whitespace) ) + && getClrBolLength() < trailing_whitespace ) { xmax = uInt(vt->width) - trailing_whitespace; return true; @@ -2519,7 +2519,7 @@ bool FVTerm::skipUnchangedCharacters(uInt& x, uInt xmax, uInt y) break; } - if ( count > uInt(cursor_addres_lengths) ) + if ( count > getCursorAddressLengths() ) { setTermXY (int(x + count), int(y)); x = x + count - 1; @@ -2604,7 +2604,7 @@ FVTerm::exit_state FVTerm::eraseCharacters ( uInt& x, uInt xmax, uInt y uInt start_pos = x; bool& ut = FTermcap::background_color_erase; - if ( whitespace > uInt(erase_ch_length) + uInt(cursor_addres_lengths) + if ( whitespace > getEraseCharLength() + getCursorAddressLengths() && (ut || normal) ) { appendAttributes (print_char); @@ -2664,7 +2664,7 @@ FVTerm::exit_state FVTerm::repeatCharacter (uInt& x, uInt xmax, uInt y) { uInt start_pos = x; - if ( repetitions > uInt(repeat_char_length) + if ( repetitions > getRepeatCharLength() && print_char->code < 128 ) { newFontChanges (print_char); @@ -2862,7 +2862,7 @@ inline void FVTerm::markAsPrinted (uInt from, uInt to, uInt line) inline void FVTerm::newFontChanges (char_data*& next_char) { // NewFont special cases - if ( NewFont ) + if ( isNewFont() ) { switch ( next_char->code ) { @@ -2902,7 +2902,7 @@ inline void FVTerm::newFontChanges (char_data*& next_char) //---------------------------------------------------------------------- inline void FVTerm::charsetChanges (char_data*& next_char) { - if ( term_encoding == fc::UTF8 ) + if ( getEncoding() == fc::UTF8 ) return; uInt code = uInt(next_char->code); @@ -2919,9 +2919,9 @@ inline void FVTerm::charsetChanges (char_data*& next_char) next_char->code = int(ch_enc); - if ( term_encoding == fc::VT100 ) + if ( getEncoding() == fc::VT100 ) next_char->attr.bit.alt_charset = true; - else if ( term_encoding == fc::PC ) + else if ( getEncoding() == fc::PC ) { next_char->attr.bit.pc_charset = true; diff --git a/src/fwidget.cpp b/src/fwidget.cpp index 49d4368e..93c497aa 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -1360,8 +1360,8 @@ void FWidget::drawShadow() if ( isMonochron() && ! trans_shadow ) return; - if ( (term_encoding == fc::VT100 && ! trans_shadow) - || (term_encoding == fc::ASCII && ! trans_shadow) ) + if ( (getEncoding() == fc::VT100 && ! trans_shadow) + || (getEncoding() == fc::ASCII && ! trans_shadow) ) { clearShadow(); return; @@ -2384,7 +2384,7 @@ void FWidget::drawBlockShadow (int x1, int y1, int x2, int y2) // non-transparent shadow int block; - if ( no_shadow_character ) + if ( ! hasShadowCharacter() ) return; setPrintPos (x2 + 1, y1);