Further small code improvements
This commit is contained in:
parent
88667f2cbb
commit
803e54d456
|
@ -74,7 +74,7 @@ class ColorChooser final : public finalcut::FWidget
|
|||
ColorChooser::ColorChooser (finalcut::FWidget* parent)
|
||||
: FWidget(parent)
|
||||
{
|
||||
setSize (FSize(8, 12));
|
||||
FWidget::setSize (FSize(8, 12));
|
||||
setFixedSize (FSize(8, 12));
|
||||
unsetFocusable();
|
||||
|
||||
|
@ -228,7 +228,7 @@ class Brushes final : public finalcut::FWidget
|
|||
Brushes::Brushes (finalcut::FWidget* parent)
|
||||
: FWidget(parent)
|
||||
{
|
||||
setSize (FSize(8, 4));
|
||||
FWidget::setSize (FSize(8, 4));
|
||||
setFixedSize (FSize(8, 4));
|
||||
unsetFocusable();
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ void streamingIntoFStringExample()
|
|||
|
||||
// ...from wide string
|
||||
finalcut::FString streamer3;
|
||||
wchar_t* wchar_str{const_cast<wchar_t*>(L"wchar_t*")};
|
||||
const wchar_t* wchar_str{const_cast<wchar_t*>(L"wchar_t*")};
|
||||
streamer3 << wchar_str;
|
||||
std::cout << " stream in: " << streamer3 << std::endl;
|
||||
|
||||
|
@ -133,7 +133,7 @@ void streamingIntoFStringExample()
|
|||
|
||||
// ...from c-string
|
||||
finalcut::FString streamer5;
|
||||
char* char_str{C_STR("char*")};
|
||||
const char* char_str{C_STR("char*")};
|
||||
streamer5 << char_str;
|
||||
std::cout << " stream in: " << streamer5 << std::endl;
|
||||
|
||||
|
|
|
@ -238,13 +238,12 @@ class AttribDemo final : public finalcut::FWidget
|
|||
void draw() override;
|
||||
|
||||
// Data member
|
||||
FColor last_color;
|
||||
FColor last_color{FColor(getMaxColor())};
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
AttribDemo::AttribDemo (finalcut::FWidget* parent)
|
||||
: finalcut::FWidget(parent)
|
||||
, last_color(FColor(getMaxColor()))
|
||||
{
|
||||
if ( isMonochron() )
|
||||
last_color = 1;
|
||||
|
|
|
@ -57,9 +57,6 @@ class Transparent final : public finalcut::FDialog
|
|||
// Disable copy assignment operator (=)
|
||||
Transparent& operator = (const Transparent&) = delete;
|
||||
|
||||
// Mutator
|
||||
void setStatusbarMessage (const finalcut::FString&) override;
|
||||
|
||||
private:
|
||||
// Method
|
||||
void draw() override;
|
||||
|
@ -78,21 +75,15 @@ Transparent::Transparent ( finalcut::FWidget* parent
|
|||
, type(tt)
|
||||
{
|
||||
// Set statusbar text for this window
|
||||
setStatusbarMessage("Press Q to quit");
|
||||
// Avoids calling a virtual function from the constructor
|
||||
// (CERT, OOP50-CPP)
|
||||
FWidget::setStatusbarMessage("Press Q to quit");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
Transparent::~Transparent()
|
||||
{ }
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void Transparent::setStatusbarMessage (const finalcut::FString& msg)
|
||||
{
|
||||
// Avoids calling a virtual function from the constructor
|
||||
// (CERT, OOP50-CPP)
|
||||
FWidget::setStatusbarMessage(msg);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void Transparent::draw()
|
||||
{
|
||||
|
|
|
@ -678,11 +678,8 @@ bool FApplication::processAccelerator (const FWidget* const& widget)
|
|||
auto iter = widget->getAcceleratorList().begin();
|
||||
const auto& last = widget->getAcceleratorList().end();
|
||||
|
||||
while ( iter != last )
|
||||
while ( iter != last && ! quit_now && ! app_exit_loop )
|
||||
{
|
||||
if ( quit_now || app_exit_loop )
|
||||
break;
|
||||
|
||||
if ( iter->key == keyboard->getKey() )
|
||||
{
|
||||
// unset the move/size mode
|
||||
|
|
|
@ -504,7 +504,7 @@ int FFileDialog::readDir()
|
|||
while ( true )
|
||||
{
|
||||
errno = 0;
|
||||
struct dirent* next = readdir(directory_stream);
|
||||
const struct dirent* next = readdir(directory_stream);
|
||||
|
||||
if ( next )
|
||||
{
|
||||
|
|
|
@ -405,13 +405,12 @@ void FLabel::printLine (FString& line)
|
|||
|
||||
for (std::size_t z{0}; z < to_char; z++)
|
||||
{
|
||||
if ( ! std::iswprint(std::wint_t(line[z])) )
|
||||
if ( ! std::iswprint(std::wint_t(line[z]))
|
||||
&& ! isNewFont()
|
||||
&& ( line[z] < fc::NF_rev_left_arrow2
|
||||
|| line[z] > fc::NF_check_mark ) )
|
||||
{
|
||||
if ( ! isNewFont() && ( line[z] < fc::NF_rev_left_arrow2
|
||||
|| line[z] > fc::NF_check_mark ) )
|
||||
{
|
||||
line[z] = L' ';
|
||||
}
|
||||
line[z] = L' ';
|
||||
}
|
||||
|
||||
if ( z == hotkeypos && getFlags().active )
|
||||
|
|
|
@ -317,13 +317,13 @@ void FMenu::onMouseMove (FMouseEvent* ev)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FMenu::cb_menuitemEnabled (FWidget*, const FDataPtr)
|
||||
void FMenu::cb_menuitemEnabled (const FWidget*, const FDataPtr)
|
||||
{
|
||||
setEnable();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FMenu::cb_menuitemDisabled (FWidget*, const FDataPtr)
|
||||
void FMenu::cb_menuitemDisabled (const FWidget*, const FDataPtr)
|
||||
{
|
||||
setDisable();
|
||||
}
|
||||
|
|
|
@ -294,7 +294,7 @@ void FMouse::setEvent()
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool FMouse::isDblclickTimeout (timeval* time)
|
||||
bool FMouse::isDblclickTimeout (const timeval* time)
|
||||
{
|
||||
return FObject::isTimeout (time, dblclick_interval);
|
||||
}
|
||||
|
@ -652,7 +652,7 @@ void FMouseX11::setMoveState (const FPoint& mouse_position, int btn)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FMouseX11::setButtonState (const int btn, struct timeval* time)
|
||||
void FMouseX11::setButtonState (const int btn, const struct timeval* time)
|
||||
{
|
||||
// Get the x11 mouse button state
|
||||
|
||||
|
@ -1132,7 +1132,7 @@ void FMouseUrxvt::setMoveState (const FPoint& mouse_position, int btn)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FMouseUrxvt::setButtonState (const int btn, struct timeval* time)
|
||||
void FMouseUrxvt::setButtonState (const int btn, const struct timeval* time)
|
||||
{
|
||||
// Get the urxvt mouse button state
|
||||
|
||||
|
|
|
@ -956,16 +956,16 @@ bool FOptiAttr::setTermAttributes ( FChar*& term
|
|||
{
|
||||
if ( term && F_set_attributes.cap )
|
||||
{
|
||||
char* sgr = tparm ( F_set_attributes.cap
|
||||
, p1 && ! fake_reverse
|
||||
, p2
|
||||
, p3 && ! fake_reverse
|
||||
, p4
|
||||
, p5
|
||||
, p6
|
||||
, p7
|
||||
, p8
|
||||
, p9 );
|
||||
const char* sgr = tparm ( F_set_attributes.cap
|
||||
, p1 && ! fake_reverse
|
||||
, p2
|
||||
, p3 && ! fake_reverse
|
||||
, p4
|
||||
, p5
|
||||
, p6
|
||||
, p7
|
||||
, p8
|
||||
, p9 );
|
||||
append_sequence (sgr);
|
||||
resetColor(term);
|
||||
term->attr.bit.standout = p1;
|
||||
|
@ -1458,7 +1458,7 @@ inline void FOptiAttr::change_to_default_color ( FChar*& term
|
|||
}
|
||||
else if ( bg == fc::Default && term->bg_color != fc::Default )
|
||||
{
|
||||
char* sgr_49;
|
||||
const char* sgr_49;
|
||||
const auto& op = F_orig_pair.cap;
|
||||
|
||||
if ( op && std::strncmp (op, CSI "39;49;25m", 11) == 0 )
|
||||
|
@ -1482,7 +1482,7 @@ inline void FOptiAttr::change_to_default_color ( FChar*& term
|
|||
inline void FOptiAttr::change_current_color ( const FChar* const& term
|
||||
, FColor fg, FColor bg )
|
||||
{
|
||||
char* color_str{};
|
||||
const char* color_str{};
|
||||
const auto& AF = F_set_a_foreground.cap;
|
||||
const auto& AB = F_set_a_background.cap;
|
||||
const auto& Sf = F_set_foreground.cap;
|
||||
|
|
|
@ -267,7 +267,7 @@ void FOptiMove::set_cursor_address (char cap[])
|
|||
{
|
||||
if ( cap )
|
||||
{
|
||||
char* temp = tgoto(cap, 23, 23);
|
||||
const char* temp = tgoto(cap, 23, 23);
|
||||
F_cursor_address.cap = cap;
|
||||
F_cursor_address.duration = capDuration (temp, 1);
|
||||
F_cursor_address.length = capDurationToLength (F_cursor_address.duration);
|
||||
|
@ -285,7 +285,7 @@ void FOptiMove::set_column_address (char cap[])
|
|||
{
|
||||
if ( cap )
|
||||
{
|
||||
char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
const char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
F_column_address.cap = cap;
|
||||
F_column_address.duration = capDuration (temp, 1);
|
||||
F_column_address.length = capDurationToLength (F_column_address.duration);
|
||||
|
@ -303,7 +303,7 @@ void FOptiMove::set_row_address (char cap[])
|
|||
{
|
||||
if ( cap )
|
||||
{
|
||||
char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
const char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
F_row_address.cap = cap;
|
||||
F_row_address.duration = capDuration (temp, 1);
|
||||
F_row_address.length = capDurationToLength (F_row_address.duration);
|
||||
|
@ -321,7 +321,7 @@ void FOptiMove::set_parm_up_cursor (char cap[])
|
|||
{
|
||||
if ( cap )
|
||||
{
|
||||
char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
const char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
F_parm_up_cursor.cap = cap;
|
||||
F_parm_up_cursor.duration = capDuration (temp, 1);
|
||||
F_parm_up_cursor.length = capDurationToLength (F_parm_up_cursor.duration);
|
||||
|
@ -339,7 +339,7 @@ void FOptiMove::set_parm_down_cursor (char cap[])
|
|||
{
|
||||
if ( cap )
|
||||
{
|
||||
char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
const char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
F_parm_down_cursor.cap = cap;
|
||||
F_parm_down_cursor.duration = capDuration (temp, 1);
|
||||
F_parm_down_cursor.length = capDurationToLength (F_parm_down_cursor.duration);
|
||||
|
@ -357,7 +357,7 @@ void FOptiMove::set_parm_left_cursor (char cap[])
|
|||
{
|
||||
if ( cap )
|
||||
{
|
||||
char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
const char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
F_parm_left_cursor.cap = cap;
|
||||
F_parm_left_cursor.duration = capDuration (temp, 1);
|
||||
F_parm_left_cursor.length = capDurationToLength (F_parm_left_cursor.duration);
|
||||
|
@ -375,7 +375,7 @@ void FOptiMove::set_parm_right_cursor (char cap[])
|
|||
{
|
||||
if ( cap )
|
||||
{
|
||||
char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
const char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
F_parm_right_cursor.cap = cap;
|
||||
F_parm_right_cursor.duration = capDuration (temp, 1);
|
||||
F_parm_right_cursor.length = capDurationToLength (F_parm_right_cursor.duration);
|
||||
|
@ -393,7 +393,7 @@ void FOptiMove::set_erase_chars (char cap[])
|
|||
{
|
||||
if ( cap )
|
||||
{
|
||||
char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
const char* temp = tparm(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0);
|
||||
F_erase_chars.cap = cap;
|
||||
F_erase_chars.duration = capDuration (temp, 1);
|
||||
F_erase_chars.length = capDurationToLength (F_erase_chars.duration);
|
||||
|
@ -411,7 +411,7 @@ void FOptiMove::set_repeat_char (char cap[])
|
|||
{
|
||||
if ( cap )
|
||||
{
|
||||
char* temp = tparm(cap, ' ', 23, 0, 0, 0, 0, 0, 0, 0);
|
||||
const char* temp = tparm(cap, ' ', 23, 0, 0, 0, 0, 0, 0, 0);
|
||||
F_repeat_char.cap = cap;
|
||||
F_repeat_char.duration = capDuration (temp, 1);
|
||||
F_repeat_char.length = capDurationToLength (F_repeat_char.duration);
|
||||
|
|
|
@ -217,35 +217,32 @@ void FStatusBar::drawMessage()
|
|||
if ( isMonochron() )
|
||||
setReverse(true);
|
||||
|
||||
if ( x + space_offset + 3 < int(termWidth) )
|
||||
if ( x + space_offset + 3 < int(termWidth) && text )
|
||||
{
|
||||
if ( text )
|
||||
if ( ! isLastActiveFocus )
|
||||
{
|
||||
if ( ! isLastActiveFocus )
|
||||
{
|
||||
x++;
|
||||
print (' ');
|
||||
}
|
||||
x++;
|
||||
print (' ');
|
||||
}
|
||||
|
||||
if ( hasKeys )
|
||||
{
|
||||
x += 2;
|
||||
print (fc::BoxDrawingsVertical); // │
|
||||
print (' ');
|
||||
}
|
||||
if ( hasKeys )
|
||||
{
|
||||
x += 2;
|
||||
print (fc::BoxDrawingsVertical); // │
|
||||
print (' ');
|
||||
}
|
||||
|
||||
const auto msg_length = getColumnWidth(getMessage());
|
||||
x += int(msg_length);
|
||||
const auto msg_length = getColumnWidth(getMessage());
|
||||
x += int(msg_length);
|
||||
|
||||
if ( x - 1 <= int(termWidth) )
|
||||
print (getMessage());
|
||||
else
|
||||
{
|
||||
// Print ellipsis
|
||||
const std::size_t len = msg_length + termWidth - uInt(x) - 1;
|
||||
print() << getColumnSubString ( getMessage(), 1, len)
|
||||
<< "..";
|
||||
}
|
||||
if ( x - 1 <= int(termWidth) )
|
||||
print (getMessage());
|
||||
else
|
||||
{
|
||||
// Print ellipsis
|
||||
const std::size_t len = msg_length + termWidth - uInt(x) - 1;
|
||||
print() << getColumnSubString ( getMessage(), 1, len)
|
||||
<< "..";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -918,9 +918,7 @@ inline char* FTermDetection::secDA_Analysis_65 (char current_termtype[])
|
|||
{
|
||||
// Terminal ID 65 - DEC VT525
|
||||
|
||||
char* new_termtype = current_termtype;
|
||||
new_termtype = secDA_Analysis_vte(new_termtype);
|
||||
return new_termtype;
|
||||
return secDA_Analysis_1 (current_termtype);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -1886,7 +1886,7 @@ void FWidget::setWindowFocus (bool enable)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
FWidget::FCallbackPtr FWidget::getCallbackPtr (FCallback cb_function)
|
||||
FWidget::FCallbackPtr FWidget::getCallbackPtr (const FCallback& cb_function)
|
||||
{
|
||||
return *cb_function.template target<FCallbackPtr>();
|
||||
}
|
||||
|
|
|
@ -73,6 +73,7 @@ class FMenu : public FWindow, public FMenuList
|
|||
public:
|
||||
// Using-declaration
|
||||
using FMenuList::getItem;
|
||||
using FMenuList::isSelected;
|
||||
|
||||
// Constructor
|
||||
explicit FMenu (FWidget* = nullptr);
|
||||
|
@ -123,8 +124,8 @@ class FMenu : public FWindow, public FMenuList
|
|||
void onAccel (FAccelEvent*) override;
|
||||
|
||||
// Callback method
|
||||
void cb_menuitemEnabled (FWidget*, const FDataPtr);
|
||||
void cb_menuitemDisabled (FWidget*, const FDataPtr);
|
||||
void cb_menuitemEnabled (const FWidget*, const FDataPtr);
|
||||
void cb_menuitemDisabled (const FWidget*, const FDataPtr);
|
||||
void cb_menuitemToggled (FWidget*, const FDataPtr);
|
||||
|
||||
private:
|
||||
|
|
|
@ -176,7 +176,7 @@ class FMouse
|
|||
void resetMousePressedTime();
|
||||
|
||||
// Inquiry
|
||||
bool isDblclickTimeout (timeval*);
|
||||
bool isDblclickTimeout (const timeval*);
|
||||
|
||||
private:
|
||||
// Data members
|
||||
|
@ -312,7 +312,7 @@ class FMouseX11 final : public FMouse
|
|||
// Methods
|
||||
void setKeyState (int);
|
||||
void setMoveState (const FPoint&, int);
|
||||
void setButtonState (const int, struct timeval*);
|
||||
void setButtonState (const int, const struct timeval*);
|
||||
|
||||
// Data member
|
||||
char x11_mouse[MOUSE_BUF_SIZE]{'\0'};
|
||||
|
@ -430,7 +430,7 @@ class FMouseUrxvt final : public FMouse
|
|||
// Methods
|
||||
void setKeyState (int);
|
||||
void setMoveState (const FPoint&, int);
|
||||
void setButtonState (const int, struct timeval*);
|
||||
void setButtonState (const int, const struct timeval*);
|
||||
|
||||
// Data members
|
||||
char urxvt_mouse[MOUSE_BUF_SIZE]{'\0'};
|
||||
|
|
|
@ -155,6 +155,9 @@ class FTermDetection final
|
|||
static void detect();
|
||||
|
||||
private:
|
||||
struct colorEnv; // forward declaration
|
||||
struct secondaryDA; // forward declaration
|
||||
|
||||
// Methods
|
||||
static void deallocation();
|
||||
static void getSystemTermType();
|
||||
|
@ -205,26 +208,36 @@ class FTermDetection final
|
|||
static FTermData* fterm_data;
|
||||
static FSystem* fsystem;
|
||||
static FTerminalType terminal_type;
|
||||
|
||||
static struct colorEnv
|
||||
{
|
||||
char* string1{nullptr};
|
||||
char* string2{nullptr};
|
||||
char* string3{nullptr};
|
||||
char* string4{nullptr};
|
||||
char* string5{nullptr};
|
||||
char* string6{nullptr};
|
||||
char* string7{nullptr};
|
||||
} color_env;
|
||||
|
||||
static struct secondaryDA
|
||||
{
|
||||
int terminal_id_type{-1};
|
||||
int terminal_id_version{-1};
|
||||
int terminal_id_hardware{-1};
|
||||
} secondary_da;
|
||||
static colorEnv color_env;
|
||||
static secondaryDA secondary_da;
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// struct FTermDetection::colorEnv
|
||||
//----------------------------------------------------------------------
|
||||
struct FTermDetection::colorEnv
|
||||
{
|
||||
char* string1{nullptr};
|
||||
char* string2{nullptr};
|
||||
char* string3{nullptr};
|
||||
char* string4{nullptr};
|
||||
char* string5{nullptr};
|
||||
char* string6{nullptr};
|
||||
char* string7{nullptr};
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// struct FTermDetection::secondaryDA
|
||||
//----------------------------------------------------------------------
|
||||
struct FTermDetection::secondaryDA
|
||||
{
|
||||
int terminal_id_type{-1};
|
||||
int terminal_id_version{-1};
|
||||
int terminal_id_hardware{-1};
|
||||
};
|
||||
|
||||
|
||||
// FTermDetection inline functions
|
||||
//----------------------------------------------------------------------
|
||||
inline const FString FTermDetection::getClassName() const
|
||||
|
|
|
@ -131,7 +131,7 @@ class FTermLinux final
|
|||
uChar ctrl : 1; // 0..1
|
||||
uChar alt : 1; // 0..1
|
||||
uChar : 4; // padding bits
|
||||
} mod_key{};
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -197,6 +197,7 @@ class FTermLinux final
|
|||
ColorMap saved_color_map{};
|
||||
ColorMap cmap{};
|
||||
int framebuffer_bpp{-1};
|
||||
modifier_key mod_key{};
|
||||
#endif // defined(__linux__)
|
||||
};
|
||||
|
||||
|
|
|
@ -107,6 +107,36 @@ struct getPrecision
|
|||
|
||||
typedef std::unordered_map<wchar_t, wchar_t> charSubstitution;
|
||||
|
||||
struct FCharAttribute
|
||||
{
|
||||
// Attribute byte #0
|
||||
uInt8 bold : 1; // bold
|
||||
uInt8 dim : 1; // dim
|
||||
uInt8 italic : 1; // italic
|
||||
uInt8 underline : 1; // underline
|
||||
uInt8 blink : 1; // blink
|
||||
uInt8 reverse : 1; // reverse
|
||||
uInt8 standout : 1; // standout
|
||||
uInt8 invisible : 1; // invisible
|
||||
// Attribute byte #1
|
||||
uInt8 protect : 1; // protect mode
|
||||
uInt8 crossed_out : 1; // crossed out
|
||||
uInt8 dbl_underline : 1; // double underline
|
||||
uInt8 alt_charset : 1; // alternate character set (vt100)
|
||||
uInt8 pc_charset : 1; // pc character set (CP437)
|
||||
uInt8 transparent : 1; // transparent
|
||||
uInt8 color_overlay : 1; // color overlay
|
||||
uInt8 inherit_background : 1; // inherit background
|
||||
// Attribute byte #2
|
||||
uInt8 no_changes : 1; // no changes required
|
||||
uInt8 printed : 1; // is printed to VTerm
|
||||
uInt8 fullwidth_padding : 1; // padding char (after a full-width char)
|
||||
uInt8 char_width : 2; // number of character cells on screen
|
||||
uInt8 : 3; // padding bits
|
||||
// Attribute byte #3
|
||||
uInt8 : 8; // padding byte
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
wchar_t ch; // character code
|
||||
|
@ -116,40 +146,12 @@ typedef struct
|
|||
|
||||
union attribute
|
||||
{
|
||||
struct
|
||||
{
|
||||
// Attribute byte #0
|
||||
uInt8 bold : 1; // bold
|
||||
uInt8 dim : 1; // dim
|
||||
uInt8 italic : 1; // italic
|
||||
uInt8 underline : 1; // underline
|
||||
uInt8 blink : 1; // blink
|
||||
uInt8 reverse : 1; // reverse
|
||||
uInt8 standout : 1; // standout
|
||||
uInt8 invisible : 1; // invisible
|
||||
// Attribute byte #1
|
||||
uInt8 protect : 1; // protect mode
|
||||
uInt8 crossed_out : 1; // crossed out
|
||||
uInt8 dbl_underline : 1; // double underline
|
||||
uInt8 alt_charset : 1; // alternate character set (vt100)
|
||||
uInt8 pc_charset : 1; // pc character set (CP437)
|
||||
uInt8 transparent : 1; // transparent
|
||||
uInt8 color_overlay : 1; // color overlay
|
||||
uInt8 inherit_background : 1; // inherit background
|
||||
// Attribute byte #2
|
||||
uInt8 no_changes : 1; // no changes required
|
||||
uInt8 printed : 1; // is printed to VTerm
|
||||
uInt8 fullwidth_padding : 1; // padding char (after a full-width char)
|
||||
uInt8 char_width : 2; // number of character cells on screen
|
||||
uInt8 : 3; // padding bits
|
||||
// Attribute byte #3
|
||||
uInt8 : 8; // padding byte
|
||||
} bit;
|
||||
|
||||
FCharAttribute bit;
|
||||
uInt8 byte[4];
|
||||
} attr;
|
||||
} FChar;
|
||||
|
||||
|
||||
namespace fc
|
||||
{
|
||||
|
||||
|
|
|
@ -396,26 +396,6 @@ class FWidget : public FVTerm, public FObject
|
|||
virtual void onClose (FCloseEvent*);
|
||||
|
||||
private:
|
||||
// Methods
|
||||
void initRootWidget();
|
||||
void finish();
|
||||
void insufficientSpaceAdjust();
|
||||
void KeyPressEvent (FKeyEvent*);
|
||||
void KeyDownEvent (FKeyEvent*);
|
||||
void emitWheelCallback (const FWheelEvent*);
|
||||
void setWindowFocus (bool);
|
||||
FCallbackPtr getCallbackPtr (FCallback);
|
||||
bool changeFocus (FWidget*, FWidget*, fc::FocusTypes);
|
||||
void processDestroy();
|
||||
virtual void draw();
|
||||
void drawWindows();
|
||||
void drawChildren();
|
||||
static void setColorTheme();
|
||||
void setStatusbarText (bool);
|
||||
|
||||
// Data members
|
||||
FPoint widget_cursor_position{-1, -1};
|
||||
|
||||
struct widget_size_hints
|
||||
{
|
||||
widget_size_hints() = default;
|
||||
|
@ -437,7 +417,7 @@ class FWidget : public FVTerm, public FObject
|
|||
std::size_t min_height{0};
|
||||
std::size_t max_width{INT_MAX};
|
||||
std::size_t max_height{INT_MAX};
|
||||
} size_hints{};
|
||||
};
|
||||
|
||||
struct dbl_line_mask
|
||||
{
|
||||
|
@ -448,7 +428,7 @@ class FWidget : public FVTerm, public FObject
|
|||
std::vector<bool> right{};
|
||||
std::vector<bool> bottom{};
|
||||
std::vector<bool> left{};
|
||||
} double_flatline_mask{};
|
||||
};
|
||||
|
||||
struct widget_padding
|
||||
{
|
||||
|
@ -459,9 +439,31 @@ class FWidget : public FVTerm, public FObject
|
|||
int left{0};
|
||||
int bottom{0};
|
||||
int right{0};
|
||||
} padding{};
|
||||
};
|
||||
|
||||
// Methods
|
||||
void initRootWidget();
|
||||
void finish();
|
||||
void insufficientSpaceAdjust();
|
||||
void KeyPressEvent (FKeyEvent*);
|
||||
void KeyDownEvent (FKeyEvent*);
|
||||
void emitWheelCallback (const FWheelEvent*);
|
||||
void setWindowFocus (bool);
|
||||
FCallbackPtr getCallbackPtr (const FCallback&);
|
||||
bool changeFocus (FWidget*, FWidget*, fc::FocusTypes);
|
||||
void processDestroy();
|
||||
virtual void draw();
|
||||
void drawWindows();
|
||||
void drawChildren();
|
||||
static void setColorTheme();
|
||||
void setStatusbarText (bool);
|
||||
|
||||
// Data members
|
||||
struct FWidgetFlags flags{};
|
||||
FPoint widget_cursor_position{-1, -1};
|
||||
widget_size_hints size_hints{};
|
||||
dbl_line_mask double_flatline_mask{};
|
||||
widget_padding padding{};
|
||||
bool ignore_padding{false};
|
||||
|
||||
// widget size
|
||||
|
@ -843,7 +845,11 @@ inline bool FWidget::setDisable()
|
|||
//----------------------------------------------------------------------
|
||||
inline bool FWidget::setVisibleCursor (bool enable)
|
||||
{
|
||||
flags.visible_cursor = ( enable ) ? true : (( hideable ) ? false : true);
|
||||
if ( enable )
|
||||
flags.visible_cursor = true;
|
||||
else
|
||||
flags.visible_cursor = ( hideable ) ? false : true;
|
||||
|
||||
return flags.visible_cursor;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,8 @@ void SGRoptimizer::findParameter()
|
|||
return;
|
||||
|
||||
std::size_t start{NOT_SET};
|
||||
bool esc{false}, csi{false};
|
||||
bool esc{false};
|
||||
bool csi{false};
|
||||
|
||||
// Find SGR parameter
|
||||
for (std::size_t i = 0; i < len; i++)
|
||||
|
|
Loading…
Reference in New Issue