Some protected data members in FTerm moved to private
This commit is contained in:
parent
746f3733e0
commit
a41f8a611c
|
@ -1,3 +1,6 @@
|
||||||
|
2017-05-06 Markus Gans <guru.mail@muenster.de>
|
||||||
|
* Some protected data members in FTerm moved to private
|
||||||
|
|
||||||
2017-05-03 Markus Gans <guru.mail@muenster.de>
|
2017-05-03 Markus Gans <guru.mail@muenster.de>
|
||||||
* Fix resetColorMap in FTerm
|
* Fix resetColorMap in FTerm
|
||||||
|
|
||||||
|
|
|
@ -1073,6 +1073,7 @@ enum termcaps
|
||||||
t_parm_right_cursor,
|
t_parm_right_cursor,
|
||||||
t_save_cursor,
|
t_save_cursor,
|
||||||
t_restore_cursor,
|
t_restore_cursor,
|
||||||
|
t_cursor_style,
|
||||||
t_scroll_forward,
|
t_scroll_forward,
|
||||||
t_scroll_reverse,
|
t_scroll_reverse,
|
||||||
t_enter_ca_mode,
|
t_enter_ca_mode,
|
||||||
|
|
|
@ -63,6 +63,7 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "final/ftypes.h"
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class FOptiMove
|
// class FOptiMove
|
||||||
|
@ -87,26 +88,26 @@ class FOptiMove
|
||||||
void setBaudRate (int);
|
void setBaudRate (int);
|
||||||
void setTabStop (int);
|
void setTabStop (int);
|
||||||
void setTermSize (int, int);
|
void setTermSize (int, int);
|
||||||
int set_cursor_home (char[]);
|
uInt set_cursor_home (char[]);
|
||||||
int set_cursor_to_ll (char[]);
|
uInt set_cursor_to_ll (char[]);
|
||||||
int set_carriage_return (char[]);
|
uInt set_carriage_return (char[]);
|
||||||
int set_tabular (char[]);
|
uInt set_tabular (char[]);
|
||||||
int set_back_tab (char[]);
|
uInt set_back_tab (char[]);
|
||||||
int set_cursor_up (char[]);
|
uInt set_cursor_up (char[]);
|
||||||
int set_cursor_down (char[]);
|
uInt set_cursor_down (char[]);
|
||||||
int set_cursor_left (char[]);
|
uInt set_cursor_left (char[]);
|
||||||
int set_cursor_right (char[]);
|
uInt set_cursor_right (char[]);
|
||||||
int set_cursor_address (char[]);
|
uInt set_cursor_address (char[]);
|
||||||
int set_column_address (char[]);
|
uInt set_column_address (char[]);
|
||||||
int set_row_address (char[]);
|
uInt set_row_address (char[]);
|
||||||
int set_parm_up_cursor (char[]);
|
uInt set_parm_up_cursor (char[]);
|
||||||
int set_parm_down_cursor (char[]);
|
uInt set_parm_down_cursor (char[]);
|
||||||
int set_parm_left_cursor (char[]);
|
uInt set_parm_left_cursor (char[]);
|
||||||
int set_parm_right_cursor (char[]);
|
uInt set_parm_right_cursor (char[]);
|
||||||
int set_erase_chars (char[]);
|
uInt set_erase_chars (char[]);
|
||||||
int set_repeat_char (char[]);
|
uInt set_repeat_char (char[]);
|
||||||
int set_clr_bol (char[]);
|
uInt set_clr_bol (char[]);
|
||||||
int set_clr_eol (char[]);
|
uInt set_clr_eol (char[]);
|
||||||
void set_auto_left_margin (const bool&);
|
void set_auto_left_margin (const bool&);
|
||||||
void set_eat_newline_glitch (const bool&);
|
void set_eat_newline_glitch (const bool&);
|
||||||
|
|
||||||
|
@ -119,10 +120,7 @@ class FOptiMove
|
||||||
// Constant
|
// Constant
|
||||||
static const std::size_t BUF_SIZE = 512;
|
static const std::size_t BUF_SIZE = 512;
|
||||||
|
|
||||||
// Typedefs
|
// Typedef
|
||||||
typedef unsigned char uChar;
|
|
||||||
typedef unsigned int uInt;
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char* cap;
|
char* cap;
|
||||||
|
|
|
@ -81,6 +81,7 @@ static FTermcap::tcap_map term_caps[] =
|
||||||
{ 0, "RI" }, // parm_right_cursor -> move #1 characters to the right (P*)
|
{ 0, "RI" }, // parm_right_cursor -> move #1 characters to the right (P*)
|
||||||
{ 0, "sc" }, // save_cursor -> save current cursor position (P)
|
{ 0, "sc" }, // save_cursor -> save current cursor position (P)
|
||||||
{ 0, "rc" }, // restore_cursor -> restore cursor to save_cursor
|
{ 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, "sf" }, // scroll_forward -> scroll text up (P)
|
||||||
{ 0, "sr" }, // scroll_reverse -> scroll text down (P)
|
{ 0, "sr" }, // scroll_reverse -> scroll text down (P)
|
||||||
{ 0, "ti" }, // enter_ca_mode -> string to start programs using cup
|
{ 0, "ti" }, // enter_ca_mode -> string to start programs using cup
|
||||||
|
|
|
@ -317,6 +317,19 @@ class FTerm
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
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
|
// Methods
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
static void initLinuxConsoleCharMap();
|
static void initLinuxConsoleCharMap();
|
||||||
|
@ -331,7 +344,6 @@ class FTerm
|
||||||
static uInt charEncode (uInt, fc::encoding);
|
static uInt charEncode (uInt, fc::encoding);
|
||||||
static char* changeAttribute ( char_data*&
|
static char* changeAttribute ( char_data*&
|
||||||
, char_data*& );
|
, char_data*& );
|
||||||
static bool hasChangedTermSize();
|
|
||||||
static void changeTermSizeFinished();
|
static void changeTermSizeFinished();
|
||||||
static void xtermMetaSendsESC (bool);
|
static void xtermMetaSendsESC (bool);
|
||||||
static void exitWithMessage (std::string)
|
static void exitWithMessage (std::string)
|
||||||
|
@ -340,21 +352,6 @@ class FTerm
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
// Data Members
|
// 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
|
static struct initializationValues
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -502,7 +499,13 @@ class FTerm
|
||||||
static std::map <uChar,uChar>* vt100_alt_char;
|
static std::map <uChar,uChar>* vt100_alt_char;
|
||||||
static std::map <std::string,fc::encoding>* encoding_set;
|
static std::map <std::string,fc::encoding>* encoding_set;
|
||||||
static FTermcap::tcap_map* tcap;
|
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 input_data_pending;
|
||||||
static bool non_blocking_stdin;
|
static bool non_blocking_stdin;
|
||||||
static bool pc_charset_console;
|
static bool pc_charset_console;
|
||||||
|
@ -513,10 +516,13 @@ class FTerm
|
||||||
static bool force_vt100;
|
static bool force_vt100;
|
||||||
static bool vt100_console;
|
static bool vt100_console;
|
||||||
static bool ascii_console;
|
static bool ascii_console;
|
||||||
|
static bool NewFont;
|
||||||
|
static bool VGAFont;
|
||||||
static bool color256;
|
static bool color256;
|
||||||
static bool monochron;
|
static bool monochron;
|
||||||
static char termtype[256];
|
static char termtype[256];
|
||||||
static char termfilename[256];
|
static char termfilename[256];
|
||||||
|
static char exit_message[8192];
|
||||||
static char* locale_name;
|
static char* locale_name;
|
||||||
static char* locale_xterm;
|
static char* locale_xterm;
|
||||||
static FRect* term; // current terminal geometry
|
static FRect* term; // current terminal geometry
|
||||||
|
@ -524,6 +530,11 @@ class FTerm
|
||||||
static int stdin_status_flags;
|
static int stdin_status_flags;
|
||||||
static int fd_tty;
|
static int fd_tty;
|
||||||
static uInt baudrate;
|
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 long key_timeout;
|
||||||
static bool resize_term;
|
static bool resize_term;
|
||||||
|
|
||||||
|
@ -786,6 +797,38 @@ inline bool FTerm::unsetNonBlockingInput()
|
||||||
inline bool FTerm::hasChangedTermSize()
|
inline bool FTerm::hasChangedTermSize()
|
||||||
{ return resize_term; }
|
{ 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()
|
inline void FTerm::changeTermSizeFinished()
|
||||||
{ resize_term = false; }
|
{ resize_term = false; }
|
||||||
|
|
|
@ -220,8 +220,8 @@ bool FButton::setFlat (bool on)
|
||||||
bool FButton::setShadow (bool on)
|
bool FButton::setShadow (bool on)
|
||||||
{
|
{
|
||||||
if ( on
|
if ( on
|
||||||
&& term_encoding != fc::VT100
|
&& getEncoding() != fc::VT100
|
||||||
&& term_encoding != fc::ASCII )
|
&& getEncoding() != fc::ASCII )
|
||||||
{
|
{
|
||||||
flags |= fc::shadow;
|
flags |= fc::shadow;
|
||||||
setShadowSize(1,1);
|
setShadowSize(1,1);
|
||||||
|
|
|
@ -234,8 +234,8 @@ bool FLineEdit::setFocus (bool on)
|
||||||
bool FLineEdit::setShadow (bool on)
|
bool FLineEdit::setShadow (bool on)
|
||||||
{
|
{
|
||||||
if ( on
|
if ( on
|
||||||
&& term_encoding != fc::VT100
|
&& getEncoding() != fc::VT100
|
||||||
&& term_encoding != fc::ASCII )
|
&& getEncoding() != fc::ASCII )
|
||||||
{
|
{
|
||||||
flags |= fc::shadow;
|
flags |= fc::shadow;
|
||||||
setShadowSize(1,1);
|
setShadowSize(1,1);
|
||||||
|
|
|
@ -1326,6 +1326,9 @@ inline void FOptiAttr::changeAttributeSGR ( char_data*& term
|
||||||
{
|
{
|
||||||
bool pc_charset_usable = true;
|
bool pc_charset_usable = true;
|
||||||
|
|
||||||
|
if ( ! (term && next) )
|
||||||
|
return;
|
||||||
|
|
||||||
if ( switchOn() || switchOff() )
|
if ( switchOn() || switchOff() )
|
||||||
setTermAttributes ( term
|
setTermAttributes ( term
|
||||||
, next->attr.bit.standout
|
, next->attr.bit.standout
|
||||||
|
|
|
@ -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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -120,11 +120,11 @@ int FOptiMove::set_cursor_home (char cap[])
|
||||||
F_cursor_home.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -139,11 +139,11 @@ int FOptiMove::set_cursor_to_ll (char cap[])
|
||||||
F_cursor_to_ll.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -158,11 +158,11 @@ int FOptiMove::set_carriage_return (char cap[])
|
||||||
F_carriage_return.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -177,11 +177,11 @@ int FOptiMove::set_tabular (char cap[])
|
||||||
F_tab.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -196,11 +196,11 @@ int FOptiMove::set_back_tab (char cap[])
|
||||||
F_back_tab.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -215,11 +215,11 @@ int FOptiMove::set_cursor_up (char cap[])
|
||||||
F_cursor_up.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -234,11 +234,11 @@ int FOptiMove::set_cursor_down (char cap[])
|
||||||
F_cursor_down.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -253,11 +253,11 @@ int FOptiMove::set_cursor_left (char cap[])
|
||||||
F_cursor_left.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -272,11 +272,11 @@ int FOptiMove::set_cursor_right (char cap[])
|
||||||
F_cursor_right.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -292,11 +292,11 @@ int FOptiMove::set_cursor_address (char cap[])
|
||||||
F_cursor_address.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -312,11 +312,11 @@ int FOptiMove::set_column_address (char cap[])
|
||||||
F_column_address.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -332,11 +332,11 @@ int FOptiMove::set_row_address (char cap[])
|
||||||
F_row_address.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -352,11 +352,11 @@ int FOptiMove::set_parm_up_cursor (char cap[])
|
||||||
F_parm_up_cursor.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -372,11 +372,11 @@ int FOptiMove::set_parm_down_cursor (char cap[])
|
||||||
F_parm_down_cursor.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -392,11 +392,11 @@ int FOptiMove::set_parm_left_cursor (char cap[])
|
||||||
F_parm_left_cursor.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -412,11 +412,11 @@ int FOptiMove::set_parm_right_cursor (char cap[])
|
||||||
F_parm_right_cursor.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -432,11 +432,11 @@ int FOptiMove::set_erase_chars (char cap[])
|
||||||
F_erase_chars.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -452,11 +452,11 @@ int FOptiMove::set_repeat_char (char cap[])
|
||||||
F_repeat_char.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -471,11 +471,11 @@ int FOptiMove::set_clr_bol (char cap[])
|
||||||
F_clr_bol.length = LONG_DURATION;
|
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 )
|
if ( cap )
|
||||||
{
|
{
|
||||||
|
@ -490,7 +490,7 @@ int FOptiMove::set_clr_eol (char cap[])
|
||||||
F_clr_eol.length = LONG_DURATION;
|
F_clr_eol.length = LONG_DURATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
return F_clr_eol.length;
|
return uInt(F_clr_eol.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -79,8 +79,8 @@ void FProgressbar::setGeometry (int x, int y, int w, int h, bool adjust)
|
||||||
bool FProgressbar::setShadow (bool on)
|
bool FProgressbar::setShadow (bool on)
|
||||||
{
|
{
|
||||||
if ( on
|
if ( on
|
||||||
&& term_encoding != fc::VT100
|
&& getEncoding() != fc::VT100
|
||||||
&& term_encoding != fc::ASCII )
|
&& getEncoding() != fc::ASCII )
|
||||||
{
|
{
|
||||||
flags |= fc::shadow;
|
flags |= fc::shadow;
|
||||||
setShadowSize(1,1);
|
setShadowSize(1,1);
|
||||||
|
|
|
@ -664,13 +664,13 @@ void FStatusBar::drawKey (keyList::const_iterator iter)
|
||||||
if ( isMonochron() )
|
if ( isMonochron() )
|
||||||
setReverse(false);
|
setReverse(false);
|
||||||
|
|
||||||
if ( no_half_block_character )
|
if ( hasHalfBlockCharacter() )
|
||||||
print (' ');
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
setColor (wc.statusbar_active_fg, wc.statusbar_active_bg);
|
setColor (wc.statusbar_active_fg, wc.statusbar_active_bg);
|
||||||
print (fc::LeftHalfBlock); // ▐
|
print (fc::LeftHalfBlock); // ▐
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
print (' ');
|
||||||
|
|
||||||
x++;
|
x++;
|
||||||
|
|
||||||
|
|
|
@ -48,11 +48,11 @@ int (*FTerm::Fputchar)(int);
|
||||||
// static class attributes
|
// static class attributes
|
||||||
int FTerm::fd_tty;
|
int FTerm::fd_tty;
|
||||||
int FTerm::stdin_status_flags;
|
int FTerm::stdin_status_flags;
|
||||||
int FTerm::erase_ch_length;
|
uInt FTerm::erase_char_length;
|
||||||
int FTerm::repeat_char_length;
|
uInt FTerm::repeat_char_length;
|
||||||
int FTerm::clr_bol_length;
|
uInt FTerm::clr_bol_length;
|
||||||
int FTerm::clr_eol_length;
|
uInt FTerm::clr_eol_length;
|
||||||
int FTerm::cursor_addres_lengths;
|
uInt FTerm::cursor_address_lengths;
|
||||||
uInt FTerm::baudrate;
|
uInt FTerm::baudrate;
|
||||||
long FTerm::key_timeout;
|
long FTerm::key_timeout;
|
||||||
bool FTerm::resize_term;
|
bool FTerm::resize_term;
|
||||||
|
@ -71,8 +71,8 @@ bool FTerm::vt100_console;
|
||||||
bool FTerm::ascii_console;
|
bool FTerm::ascii_console;
|
||||||
bool FTerm::NewFont;
|
bool FTerm::NewFont;
|
||||||
bool FTerm::VGAFont;
|
bool FTerm::VGAFont;
|
||||||
bool FTerm::no_shadow_character;
|
bool FTerm::shadow_character;
|
||||||
bool FTerm::no_half_block_character;
|
bool FTerm::half_block_character;
|
||||||
bool FTerm::cursor_optimisation;
|
bool FTerm::cursor_optimisation;
|
||||||
bool FTerm::xterm_default_colors;
|
bool FTerm::xterm_default_colors;
|
||||||
bool FTerm::use_alternate_screen = true;
|
bool FTerm::use_alternate_screen = true;
|
||||||
|
@ -824,7 +824,9 @@ void FTerm::setXTermCursorStyle (fc::xtermCursorStyle style)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( isXTerminal() || isMinttyTerm()
|
if ( TCAP(fc::t_cursor_style)
|
||||||
|
|| isXTerminal()
|
||||||
|
|| isMinttyTerm()
|
||||||
|| term_detection->hasSetCursorStyleSupport() )
|
|| term_detection->hasSetCursorStyleSupport() )
|
||||||
{
|
{
|
||||||
putstringf (CSI "%d q", style);
|
putstringf (CSI "%d q", style);
|
||||||
|
@ -1496,7 +1498,7 @@ void FTerm::initLinuxConsoleCharMap()
|
||||||
|| charEncode(c2, fc::PC) == charEncode(c2, fc::ASCII)
|
|| charEncode(c2, fc::PC) == charEncode(c2, fc::ASCII)
|
||||||
|| charEncode(c3, fc::PC) == charEncode(c3, fc::ASCII) )
|
|| charEncode(c3, fc::PC) == charEncode(c3, fc::ASCII) )
|
||||||
{
|
{
|
||||||
no_shadow_character = true;
|
shadow_character = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
c4 = fc::RightHalfBlock;
|
c4 = fc::RightHalfBlock;
|
||||||
|
@ -1505,7 +1507,7 @@ void FTerm::initLinuxConsoleCharMap()
|
||||||
if ( charEncode(c4, fc::PC) == charEncode(c4, fc::ASCII)
|
if ( charEncode(c4, fc::PC) == charEncode(c4, fc::ASCII)
|
||||||
|| charEncode(c5, fc::PC) == charEncode(c5, fc::ASCII) )
|
|| charEncode(c5, fc::PC) == charEncode(c5, fc::ASCII) )
|
||||||
{
|
{
|
||||||
no_half_block_character = true;
|
half_block_character = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -2198,22 +2200,22 @@ void FTerm::init_global_values()
|
||||||
key_timeout = 100000; // 100 ms
|
key_timeout = 100000; // 100 ms
|
||||||
|
|
||||||
// Preset to true
|
// Preset to true
|
||||||
cursor_optimisation = true;
|
shadow_character = \
|
||||||
|
half_block_character = \
|
||||||
|
cursor_optimisation = true;
|
||||||
|
|
||||||
// Preset to false
|
// Preset to false
|
||||||
utf8_console = \
|
utf8_console = \
|
||||||
utf8_input = \
|
utf8_input = \
|
||||||
utf8_state = \
|
utf8_state = \
|
||||||
utf8_linux_terminal = \
|
utf8_linux_terminal = \
|
||||||
pc_charset_console = \
|
pc_charset_console = \
|
||||||
vt100_console = \
|
vt100_console = \
|
||||||
NewFont = \
|
NewFont = \
|
||||||
VGAFont = \
|
VGAFont = \
|
||||||
no_shadow_character = \
|
ascii_console = \
|
||||||
no_half_block_character = \
|
force_vt100 = \
|
||||||
ascii_console = \
|
xterm_default_colors = false;
|
||||||
force_vt100 = \
|
|
||||||
xterm_default_colors = false;
|
|
||||||
|
|
||||||
// Assertion: programm start in cooked mode
|
// Assertion: programm start in cooked mode
|
||||||
input_data_pending = \
|
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_down (TCAP(fc::t_cursor_down));
|
||||||
opti_move->set_cursor_left (TCAP(fc::t_cursor_left));
|
opti_move->set_cursor_left (TCAP(fc::t_cursor_left));
|
||||||
opti_move->set_cursor_right (TCAP(fc::t_cursor_right));
|
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_cursor_address (TCAP(fc::t_cursor_address));
|
||||||
opti_move->set_column_address (TCAP(fc::t_column_address));
|
opti_move->set_column_address (TCAP(fc::t_column_address));
|
||||||
opti_move->set_row_address (TCAP(fc::t_row_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_parm_right_cursor (TCAP(fc::t_parm_right_cursor));
|
||||||
opti_move->set_auto_left_margin (FTermcap::automatic_left_margin);
|
opti_move->set_auto_left_margin (FTermcap::automatic_left_margin);
|
||||||
opti_move->set_eat_newline_glitch (FTermcap::eat_nl_glitch);
|
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));
|
opti_move->set_erase_chars (TCAP(fc::t_erase_chars));
|
||||||
repeat_char_length = \
|
repeat_char_length = \
|
||||||
opti_move->set_repeat_char (TCAP(fc::t_repeat_char));
|
opti_move->set_repeat_char (TCAP(fc::t_repeat_char));
|
||||||
|
|
|
@ -775,7 +775,7 @@ void FTextView::drawText()
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
wchar_t ch = line_str[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
|
// only printable and 1 column per character
|
||||||
if ( ( (utf8 && std::iswprint(wint_t(ch)))
|
if ( ( (utf8 && std::iswprint(wint_t(ch)))
|
||||||
|
|
|
@ -2176,7 +2176,7 @@ void FVTerm::finish()
|
||||||
// Clear the terminal
|
// Clear the terminal
|
||||||
setNormal();
|
setNormal();
|
||||||
|
|
||||||
if ( use_alternate_screen )
|
if ( hasAlternateScreen() )
|
||||||
clearTerm();
|
clearTerm();
|
||||||
|
|
||||||
flush_out();
|
flush_out();
|
||||||
|
@ -2413,7 +2413,7 @@ bool FVTerm::canClearToEOL (uInt xmin, uInt y)
|
||||||
|
|
||||||
if ( beginning_whitespace == uInt(vt->width) - xmin
|
if ( beginning_whitespace == uInt(vt->width) - xmin
|
||||||
&& (ut || normal)
|
&& (ut || normal)
|
||||||
&& clr_eol_length < int(beginning_whitespace) )
|
&& getClrEolLength() < beginning_whitespace )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2448,7 +2448,7 @@ bool FVTerm::canClearLeadingWS (uInt& xmin, uInt y)
|
||||||
|
|
||||||
if ( leading_whitespace > xmin
|
if ( leading_whitespace > xmin
|
||||||
&& (ut || normal)
|
&& (ut || normal)
|
||||||
&& clr_bol_length < int(leading_whitespace) )
|
&& getClrBolLength() < leading_whitespace )
|
||||||
{
|
{
|
||||||
xmin = leading_whitespace - 1;
|
xmin = leading_whitespace - 1;
|
||||||
return true;
|
return true;
|
||||||
|
@ -2486,7 +2486,7 @@ bool FVTerm::canClearTrailingWS (uInt& xmax, uInt y)
|
||||||
|
|
||||||
if ( trailing_whitespace > uInt(vt->width) - xmax
|
if ( trailing_whitespace > uInt(vt->width) - xmax
|
||||||
&& (ut || normal)
|
&& (ut || normal)
|
||||||
&& clr_bol_length < int(trailing_whitespace) )
|
&& getClrBolLength() < trailing_whitespace )
|
||||||
{
|
{
|
||||||
xmax = uInt(vt->width) - trailing_whitespace;
|
xmax = uInt(vt->width) - trailing_whitespace;
|
||||||
return true;
|
return true;
|
||||||
|
@ -2519,7 +2519,7 @@ bool FVTerm::skipUnchangedCharacters(uInt& x, uInt xmax, uInt y)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( count > uInt(cursor_addres_lengths) )
|
if ( count > getCursorAddressLengths() )
|
||||||
{
|
{
|
||||||
setTermXY (int(x + count), int(y));
|
setTermXY (int(x + count), int(y));
|
||||||
x = x + count - 1;
|
x = x + count - 1;
|
||||||
|
@ -2604,7 +2604,7 @@ FVTerm::exit_state FVTerm::eraseCharacters ( uInt& x, uInt xmax, uInt y
|
||||||
uInt start_pos = x;
|
uInt start_pos = x;
|
||||||
bool& ut = FTermcap::background_color_erase;
|
bool& ut = FTermcap::background_color_erase;
|
||||||
|
|
||||||
if ( whitespace > uInt(erase_ch_length) + uInt(cursor_addres_lengths)
|
if ( whitespace > getEraseCharLength() + getCursorAddressLengths()
|
||||||
&& (ut || normal) )
|
&& (ut || normal) )
|
||||||
{
|
{
|
||||||
appendAttributes (print_char);
|
appendAttributes (print_char);
|
||||||
|
@ -2664,7 +2664,7 @@ FVTerm::exit_state FVTerm::repeatCharacter (uInt& x, uInt xmax, uInt y)
|
||||||
{
|
{
|
||||||
uInt start_pos = x;
|
uInt start_pos = x;
|
||||||
|
|
||||||
if ( repetitions > uInt(repeat_char_length)
|
if ( repetitions > getRepeatCharLength()
|
||||||
&& print_char->code < 128 )
|
&& print_char->code < 128 )
|
||||||
{
|
{
|
||||||
newFontChanges (print_char);
|
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)
|
inline void FVTerm::newFontChanges (char_data*& next_char)
|
||||||
{
|
{
|
||||||
// NewFont special cases
|
// NewFont special cases
|
||||||
if ( NewFont )
|
if ( isNewFont() )
|
||||||
{
|
{
|
||||||
switch ( next_char->code )
|
switch ( next_char->code )
|
||||||
{
|
{
|
||||||
|
@ -2902,7 +2902,7 @@ inline void FVTerm::newFontChanges (char_data*& next_char)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FVTerm::charsetChanges (char_data*& next_char)
|
inline void FVTerm::charsetChanges (char_data*& next_char)
|
||||||
{
|
{
|
||||||
if ( term_encoding == fc::UTF8 )
|
if ( getEncoding() == fc::UTF8 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uInt code = uInt(next_char->code);
|
uInt code = uInt(next_char->code);
|
||||||
|
@ -2919,9 +2919,9 @@ inline void FVTerm::charsetChanges (char_data*& next_char)
|
||||||
|
|
||||||
next_char->code = int(ch_enc);
|
next_char->code = int(ch_enc);
|
||||||
|
|
||||||
if ( term_encoding == fc::VT100 )
|
if ( getEncoding() == fc::VT100 )
|
||||||
next_char->attr.bit.alt_charset = true;
|
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;
|
next_char->attr.bit.pc_charset = true;
|
||||||
|
|
||||||
|
|
|
@ -1360,8 +1360,8 @@ void FWidget::drawShadow()
|
||||||
if ( isMonochron() && ! trans_shadow )
|
if ( isMonochron() && ! trans_shadow )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( (term_encoding == fc::VT100 && ! trans_shadow)
|
if ( (getEncoding() == fc::VT100 && ! trans_shadow)
|
||||||
|| (term_encoding == fc::ASCII && ! trans_shadow) )
|
|| (getEncoding() == fc::ASCII && ! trans_shadow) )
|
||||||
{
|
{
|
||||||
clearShadow();
|
clearShadow();
|
||||||
return;
|
return;
|
||||||
|
@ -2384,7 +2384,7 @@ void FWidget::drawBlockShadow (int x1, int y1, int x2, int y2)
|
||||||
// non-transparent shadow
|
// non-transparent shadow
|
||||||
int block;
|
int block;
|
||||||
|
|
||||||
if ( no_shadow_character )
|
if ( ! hasShadowCharacter() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
setPrintPos (x2 + 1, y1);
|
setPrintPos (x2 + 1, y1);
|
||||||
|
|
Loading…
Reference in New Issue