More direct access to the static FTerm functions

This commit is contained in:
Markus Gans 2020-05-16 22:24:36 +02:00
parent 379c45efb5
commit 5a60794b85
57 changed files with 491 additions and 590 deletions

View File

@ -1,3 +1,6 @@
2020-05-16 Markus Gans <guru.mail@muenster.de>
* More direct access to the static FTerm functions
2020-05-13 Markus Gans <guru.mail@muenster.de> 2020-05-13 Markus Gans <guru.mail@muenster.de>
* The new class FLogger for logging, which can be redirected * The new class FLogger for logging, which can be redirected
to different I/O channels to different I/O channels

View File

@ -278,7 +278,7 @@ Calc::Calc (FWidget* parent)
btn->setDoubleFlatLine(fc::top); btn->setDoubleFlatLine(fc::top);
btn->setDoubleFlatLine(fc::bottom); btn->setDoubleFlatLine(fc::bottom);
if ( isNewFont() ) if ( finalcut::FTerm::isNewFont() )
btn->unsetClickAnimation(); btn->unsetClickAnimation();
btn->addCallback btn->addCallback
@ -421,7 +421,7 @@ void Calc::drawDispay()
if ( error ) if ( error )
display = " Error "; display = " Error ";
if ( isMonochron() ) if ( finalcut::FTerm::isMonochron() )
setReverse(false); setReverse(false);
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
@ -429,10 +429,10 @@ void Calc::drawDispay()
<< FPoint{3, 3} << display << ' ' << FPoint{3, 3} << display << ' '
<< FColorPair{wc.dialog_fg, wc.dialog_bg}; << FColorPair{wc.dialog_fg, wc.dialog_bg};
if ( isMonochron() ) if ( finalcut::FTerm::isMonochron() )
setReverse(true); setReverse(true);
if ( isNewFont() ) if ( finalcut::FTerm::isNewFont() )
{ {
const wchar_t bottom_line {fc::NF_border_line_bottom}; const wchar_t bottom_line {fc::NF_border_line_bottom};
const wchar_t top_bottom_line {fc::NF_border_line_up_and_down}; const wchar_t top_bottom_line {fc::NF_border_line_up_and_down};

View File

@ -79,7 +79,7 @@ CheckList::CheckList (finalcut::FWidget* parent)
// Avoids calling a virtual function from the constructor // Avoids calling a virtual function from the constructor
// (CERT, OOP50-CPP) // (CERT, OOP50-CPP)
FDialog::setText (L"Shopping list"); FDialog::setText (L"Shopping list");
const std::size_t nf_offset = ( isNewFont() ) ? 1 : 0; const std::size_t nf_offset = ( finalcut::FTerm::isNewFont() ) ? 1 : 0;
FDialog::setGeometry ( FPoint{int(1 + (parent->getWidth() - 28) / 2), 5} FDialog::setGeometry ( FPoint{int(1 + (parent->getWidth() - 28) / 2), 5}
, FSize{28 + nf_offset, 13} ); , FSize{28 + nf_offset, 13} );
setShadow(); setShadow();

View File

@ -160,7 +160,7 @@ void EventDialog::onTimer (finalcut::FTimerEvent*)
void EventDialog::onKeyPress (finalcut::FKeyEvent* ev) void EventDialog::onKeyPress (finalcut::FKeyEvent* ev)
{ {
const FKey key_id = ev->key(); const FKey key_id = ev->key();
finalcut::FString key_name = getKeyName(key_id); finalcut::FString key_name = finalcut::FTerm::getKeyName(key_id);
if ( key_name.isEmpty() ) if ( key_name.isEmpty() )
key_name = wchar_t(key_id); key_name = wchar_t(key_id);

View File

@ -54,7 +54,7 @@ Keyboard::Keyboard (finalcut::FWidget* parent)
void Keyboard::onKeyPress (finalcut::FKeyEvent* ev) void Keyboard::onKeyPress (finalcut::FKeyEvent* ev)
{ {
const FKey key_id = ev->key(); const FKey key_id = ev->key();
finalcut::FString key_name = getKeyName(key_id); finalcut::FString key_name = finalcut::FTerm::getKeyName(key_id);
bool is_last_line{false}; bool is_last_line{false};
if ( key_name.isEmpty() ) if ( key_name.isEmpty() )

View File

@ -447,7 +447,7 @@ void MouseDraw::draw()
finalcut::FDialog::draw(); finalcut::FDialog::draw();
setColor(); setColor();
if ( isNewFont() ) if ( finalcut::FTerm::isNewFont() )
{ {
for (int y{2}; y < y_max; y++) for (int y{2}; y < y_max; y++)
{ {

View File

@ -157,7 +157,7 @@ int main (int argc, char* argv[])
TermApp.clearArea(); TermApp.clearArea();
// Show the determined terminal name and text resolution // Show the determined terminal name and text resolution
std::cout << "Terminal: " << TermApp.getTermType() << "\r\n"; std::cout << "Terminal: " << finalcut::FTerm::getTermType() << "\r\n";
std::cout << " Columns: 0.." << xmax << "\r\n"; std::cout << " Columns: 0.." << xmax << "\r\n";
std::cout << " Lines: 0.." << ymax << "\r\n"; std::cout << " Lines: 0.." << ymax << "\r\n";

View File

@ -179,7 +179,7 @@ void RotoZoomer::rotozoomer (double cx, double cy, double r, double a)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void RotoZoomer::generateReport() void RotoZoomer::generateReport()
{ {
finalcut::FString term_type = getTermType(); finalcut::FString term_type = finalcut::FTerm::getTermType();
finalcut::FString dimension_str{}; finalcut::FString dimension_str{};
finalcut::FString time_str{}; finalcut::FString time_str{};
finalcut::FString fps_str{}; finalcut::FString fps_str{};

View File

@ -128,7 +128,7 @@ void Scrollview::setScrollSize (const FSize& size)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void Scrollview::draw() void Scrollview::draw()
{ {
if ( isMonochron() ) if ( finalcut::FTerm::isMonochron() )
setReverse(true); setReverse(true);
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
@ -143,7 +143,7 @@ void Scrollview::draw()
print (32 + ((x + y) % 0x5f)); print (32 + ((x + y) % 0x5f));
} }
if ( isMonochron() ) if ( finalcut::FTerm::isMonochron() )
setReverse(false); setReverse(false);
FScrollView::draw(); FScrollView::draw();

View File

@ -76,7 +76,7 @@ AttribDlg::AttribDlg (finalcut::FWidget* parent)
: finalcut::FDialog(parent) : finalcut::FDialog(parent)
{ {
FDialog::setText ( "A terminal attributes test (" FDialog::setText ( "A terminal attributes test ("
+ finalcut::FString{getTermType()} + finalcut::FString{finalcut::FTerm::getTermType()}
+ ")"); + ")");
next_button.setGeometry ( FPoint{int(getWidth()) - 13, int(getHeight()) - 4} next_button.setGeometry ( FPoint{int(getWidth()) - 13, int(getHeight()) - 4}
@ -145,10 +145,10 @@ void AttribDlg::onClose (finalcut::FCloseEvent* ev)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void AttribDlg::cb_next (const finalcut::FWidget*, const FDataPtr) void AttribDlg::cb_next (const finalcut::FWidget*, const FDataPtr)
{ {
if ( isMonochron() ) if ( finalcut::FTerm::isMonochron() )
return; return;
if ( bgcolor == FColor(getMaxColor() - 1) ) if ( bgcolor == FColor(finalcut::FTerm::getMaxColor() - 1) )
bgcolor = fc::Default; bgcolor = fc::Default;
else if ( bgcolor == fc::Default ) else if ( bgcolor == fc::Default )
bgcolor = 0; bgcolor = 0;
@ -161,13 +161,13 @@ void AttribDlg::cb_next (const finalcut::FWidget*, const FDataPtr)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void AttribDlg::cb_back (const finalcut::FWidget*, const FDataPtr) void AttribDlg::cb_back (const finalcut::FWidget*, const FDataPtr)
{ {
if ( isMonochron() ) if ( finalcut::FTerm::isMonochron() )
return; return;
if ( bgcolor == 0 ) if ( bgcolor == 0 )
bgcolor = fc::Default; bgcolor = fc::Default;
else if ( bgcolor == fc::Default ) else if ( bgcolor == fc::Default )
bgcolor = FColor(getMaxColor() - 1); bgcolor = FColor(finalcut::FTerm::getMaxColor() - 1);
else else
bgcolor--; bgcolor--;
@ -238,14 +238,14 @@ class AttribDemo final : public finalcut::FWidget
void draw() override; void draw() override;
// Data member // Data member
FColor last_color{FColor(getMaxColor())}; FColor last_color{FColor(finalcut::FTerm::getMaxColor())};
}; };
//---------------------------------------------------------------------- //----------------------------------------------------------------------
AttribDemo::AttribDemo (finalcut::FWidget* parent) AttribDemo::AttribDemo (finalcut::FWidget* parent)
: finalcut::FWidget(parent) : finalcut::FWidget(parent)
{ {
if ( isMonochron() ) if ( finalcut::FTerm::isMonochron() )
last_color = 1; last_color = 1;
else if ( last_color > 16 ) else if ( last_color > 16 )
last_color = 16; last_color = 16;
@ -270,7 +270,7 @@ void AttribDemo::printAltCharset()
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
const auto& parent = static_cast<AttribDlg*>(getParent()); const auto& parent = static_cast<AttribDlg*>(getParent());
if ( ! isMonochron() ) if ( ! finalcut::FTerm::isMonochron() )
setColor (wc.label_fg, wc.label_bg); setColor (wc.label_fg, wc.label_bg);
print() << FPoint{1, 1} << "alternate charset: "; print() << FPoint{1, 1} << "alternate charset: ";
@ -441,14 +441,14 @@ void AttribDemo::draw()
{ {
print() << FPoint{1, 2 + int(y)}; print() << FPoint{1, 2 + int(y)};
if ( ! isMonochron() ) if ( ! finalcut::FTerm::isMonochron() )
setColor (wc.label_fg, wc.label_bg); setColor (wc.label_fg, wc.label_bg);
if ( y < effect.size() ) if ( y < effect.size() )
effect[y](); effect[y]();
} }
if ( ! isMonochron() ) if ( ! finalcut::FTerm::isMonochron() )
setColor(wc.label_fg, wc.label_bg); setColor(wc.label_fg, wc.label_bg);
print() << FPoint{1, 15}; print() << FPoint{1, 15};

View File

@ -300,7 +300,7 @@ int main (int argc, char* argv[])
finalcut::FApplication TermApp {argc, argv, disable_alt_screen}; finalcut::FApplication TermApp {argc, argv, disable_alt_screen};
std::cout << "--------\r\nFTermcap\r\n--------\r\n\n"; std::cout << "--------\r\nFTermcap\r\n--------\r\n\n";
std::cout << "Terminal: " << TermApp.getTermType() << "\r\n"; std::cout << "Terminal: " << finalcut::FTerm::getTermType() << "\r\n";
debug (TermApp); debug (TermApp);

View File

@ -89,7 +89,7 @@ void Transparent::draw()
{ {
finalcut::FDialog::draw(); finalcut::FDialog::draw();
if ( isMonochron() ) if ( finalcut::FTerm::isMonochron() )
setReverse(true); setReverse(true);
if ( type == shadow ) if ( type == shadow )
@ -100,7 +100,7 @@ void Transparent::draw()
} }
else if ( type == inherit_background ) else if ( type == inherit_background )
{ {
if ( getMaxColor() > 8 ) if ( finalcut::FTerm::getMaxColor() > 8 )
print() << FColorPair {fc::Blue, fc::Black}; print() << FColorPair {fc::Blue, fc::Black};
else else
print() << FColorPair {fc::Green, fc::Black}; print() << FColorPair {fc::Green, fc::Black};
@ -228,14 +228,14 @@ void MainWindow::draw()
{ {
finalcut::FDialog::draw(); finalcut::FDialog::draw();
if ( isMonochron() ) if ( finalcut::FTerm::isMonochron() )
setReverse(true); setReverse(true);
setColor(); setColor();
print() << FPoint{2, 4} << line1; print() << FPoint{2, 4} << line1;
print() << FPoint{2, 5} << line2; print() << FPoint{2, 5} << line2;
if ( isMonochron() ) if ( finalcut::FTerm::isMonochron() )
setReverse(false); setReverse(false);
updateTerminal(); updateTerminal();

View File

@ -810,12 +810,12 @@ void MyDialog::cb_terminfo (const finalcut::FWidget*, const FDataPtr)
( (
"Environment" "Environment"
, finalcut::FString{} , finalcut::FString{}
<< " Type: " << getTermType() << "\n" << " Type: " << finalcut::FTerm::getTermType() << "\n"
<< " Name: " << getTermFileName() << "\n" << " Name: " << finalcut::FTerm::getTermFileName() << "\n"
<< " Mode: " << getEncodingString() << "\n" << " Mode: " << finalcut::FTerm::getEncodingString() << "\n"
<< " Size: " << x << fc::Times << " Size: " << x << fc::Times
<< y << "\n" << y << "\n"
<< "Colors: " << getMaxColor() << "Colors: " << finalcut::FTerm::getMaxColor()
, finalcut::FMessageBox::Ok, 0, 0, this , finalcut::FMessageBox::Ok, 0, 0, this
); );
info1.setHeadline("Terminal:"); info1.setHeadline("Terminal:");
@ -834,7 +834,7 @@ void MyDialog::cb_drives (const finalcut::FWidget*, const FDataPtr)
, finalcut::FMessageBox::Ok, 0, 0, this , finalcut::FMessageBox::Ok, 0, 0, this
); );
if ( isNewFont() ) if ( finalcut::FTerm::isNewFont() )
{ {
finalcut::FLabel drive {finalcut::NF_Drive, &info2}; finalcut::FLabel drive {finalcut::NF_Drive, &info2};
drive.setGeometry (FPoint{11, 2}, FSize{4, 1}); drive.setGeometry (FPoint{11, 2}, FSize{4, 1});
@ -853,7 +853,7 @@ void MyDialog::cb_drives (const finalcut::FWidget*, const FDataPtr)
finalcut::FLabel cd {" CD ", &info2}; finalcut::FLabel cd {" CD ", &info2};
cd.setGeometry (FPoint{11, 6}, FSize{4, 1}); cd.setGeometry (FPoint{11, 6}, FSize{4, 1});
if ( isMonochron() ) if ( finalcut::FTerm::isMonochron() )
{ {
net.setReverseMode(); net.setReverseMode();
drive.setReverseMode(); drive.setReverseMode();
@ -917,7 +917,7 @@ void MyDialog::cb_setTitlebar (finalcut::FWidget* widget, const FDataPtr)
auto& lineedit = *(static_cast<finalcut::FLineEdit*>(widget)); auto& lineedit = *(static_cast<finalcut::FLineEdit*>(widget));
finalcut::FString title{}; finalcut::FString title{};
lineedit >> title; lineedit >> title;
setTermTitle (title); finalcut::FTerm::setTermTitle (title);
setText (title); setText (title);
redraw(); redraw();
} }
@ -1021,17 +1021,17 @@ int main (int argc, char* argv[])
// Create the application object app // Create the application object app
finalcut::FApplication app{argc, argv}; finalcut::FApplication app{argc, argv};
app.setNonBlockingRead(); app.setNonBlockingRead();
app.redefineDefaultColors(true); finalcut::FTerm::redefineDefaultColors(true);
app.setTermTitle (title); finalcut::FTerm::setTermTitle (title);
// Force vt100 encoding // Force vt100 encoding
//app.setEncoding(finalcut::fc::VT100); //finalcut::FTerm::setEncoding(finalcut::fc::VT100);
// Sets the terminal size to 94×30 // Sets the terminal size to 94×30
//finalcut::FTerm::setTermSize(FSize{94, 30}); //finalcut::FTerm::setTermSize(FSize{94, 30});
// Enable the final cut graphical font // Enable the final cut graphical font
//app.setNewFont(); //finalcut::FTerm::setNewFont();
// Create main dialog object d // Create main dialog object d
MyDialog d{&app}; MyDialog d{&app};

View File

@ -338,7 +338,7 @@ void FApplication::closeConfirmationDialog (FWidget* w, FCloseEvent* ev)
void FApplication::init (uInt64 key_time, uInt64 dblclick_time) void FApplication::init (uInt64 key_time, uInt64 dblclick_time)
{ {
// Initialize keyboard // Initialize keyboard
keyboard = FVTerm::getFKeyboard(); keyboard = FTerm::getFKeyboard();
// Set the keyboard keypress timeout // Set the keyboard keypress timeout
if ( keyboard ) if ( keyboard )
@ -356,7 +356,7 @@ void FApplication::init (uInt64 key_time, uInt64 dblclick_time)
} }
// Initialize mouse control // Initialize mouse control
mouse = FVTerm::getFMouseControl(); mouse = FTerm::getFMouseControl();
// Set stdin number for a gpm-mouse // Set stdin number for a gpm-mouse
if ( mouse ) if ( mouse )
@ -424,8 +424,8 @@ void FApplication::cmd_options (const int& argc, char* argv[])
else if ( encoding.includes("help") ) else if ( encoding.includes("help") )
showParameterUsage(); showParameterUsage();
else else
exitWithMessage ( "Unknown encoding " FTerm::exitWithMessage ( "Unknown encoding "
+ std::string(encoding.c_str()) ); + std::string(encoding.c_str()) );
} }
if ( std::strcmp(long_options[idx].name, "no-mouse") == 0 ) if ( std::strcmp(long_options[idx].name, "no-mouse") == 0 )
@ -1004,7 +1004,7 @@ void FApplication::sendMouseMiddleClickEvent ( const FPoint& widgetMousePos
sendEvent (clicked, &m_down_ev); sendEvent (clicked, &m_down_ev);
// gnome-terminal sends no released on middle click // gnome-terminal sends no released on middle click
if ( isGnomeTerminal() ) if ( FTerm::isGnomeTerminal() )
setClickedWidget(nullptr); setClickedWidget(nullptr);
} }
else if ( mouse->isMiddleButtonReleased() ) else if ( mouse->isMiddleButtonReleased() )
@ -1076,7 +1076,7 @@ void FApplication::processMouseEvent()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FApplication::processResizeEvent() void FApplication::processResizeEvent()
{ {
if ( ! hasChangedTermSize() ) if ( ! FTerm::hasChangedTermSize() )
return; return;
if ( mouse ) if ( mouse )
@ -1089,7 +1089,7 @@ void FApplication::processResizeEvent()
sendEvent(app_object, &r_ev); sendEvent(app_object, &r_ev);
if ( r_ev.isAccepted() ) if ( r_ev.isAccepted() )
changeTermSizeFinished(); FTerm::changeTermSizeFinished();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -165,8 +165,8 @@ bool FButton::setFlat (bool enable)
bool FButton::setShadow (bool enable) bool FButton::setShadow (bool enable)
{ {
if ( enable if ( enable
&& getEncoding() != fc::VT100 && FTerm::getEncoding() != fc::VT100
&& getEncoding() != fc::ASCII ) && FTerm::getEncoding() != fc::ASCII )
{ {
setFlags().shadow = true; setFlags().shadow = true;
setShadowSize(FSize{1, 1}); setShadowSize(FSize{1, 1});
@ -439,7 +439,7 @@ inline std::size_t FButton::clickAnimationIndent (const FWidget* parent_widget)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FButton::clearRightMargin (const FWidget* parent_widget) inline void FButton::clearRightMargin (const FWidget* parent_widget)
{ {
if ( button_down || isNewFont() ) if ( button_down || FTerm::isNewFont() )
return; return;
// Restore the right background after button down // Restore the right background after button down
@ -449,12 +449,12 @@ inline void FButton::clearRightMargin (const FWidget* parent_widget)
for (int y{1}; y <= int(getHeight()); y++) for (int y{1}; y <= int(getHeight()); y++)
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); // Light background setReverse(true); // Light background
print() << FPoint{1 + int(getWidth()), y} << ' '; // clear right print() << FPoint{1 + int(getWidth()), y} << ' '; // clear right
if ( getFlags().active && isMonochron() ) if ( getFlags().active && FTerm::isMonochron() )
setReverse(false); // Dark background setReverse(false); // Dark background
} }
} }
@ -470,7 +470,7 @@ inline void FButton::drawMarginLeft()
{ {
print() << FPoint{1 + int(indent), 1 + int(y)}; print() << FPoint{1 + int(indent), 1 + int(y)};
if ( isMonochron() && active_focus && y == vcenter_offset ) if ( FTerm::isMonochron() && active_focus && y == vcenter_offset )
print (fc::BlackRightPointingPointer); // ► print (fc::BlackRightPointingPointer); // ►
else else
print (space_char); // full block █ print (space_char); // full block █
@ -486,7 +486,7 @@ inline void FButton::drawMarginRight()
{ {
print() << FPoint{int(getWidth() + indent), 1 + int(y)}; print() << FPoint{int(getWidth() + indent), 1 + int(y)};
if ( isMonochron() && active_focus && y == vcenter_offset ) if ( FTerm::isMonochron() && active_focus && y == vcenter_offset )
print (fc::BlackLeftPointingPointer); // ◄ print (fc::BlackLeftPointingPointer); // ◄
else else
print (space_char); // full block █ print (space_char); // full block █
@ -543,10 +543,10 @@ inline void FButton::drawButtonTextLine (const FString& button_text)
setCursorPos ({ 2 + int(center_offset + hotkeypos) setCursorPos ({ 2 + int(center_offset + hotkeypos)
, 1 + int(vcenter_offset) }); // hotkey , 1 + int(vcenter_offset) }); // hotkey
if ( ! getFlags().active && isMonochron() ) if ( ! getFlags().active && FTerm::isMonochron() )
setReverse(true); // Light background setReverse(true); // Light background
if ( active_focus && (isMonochron() || getMaxColor() < 16) ) if ( active_focus && (FTerm::isMonochron() || FTerm::getMaxColor() < 16) )
setBold(); setBold();
while ( pos < center_offset + column_width && columns + 2 < getWidth() ) while ( pos < center_offset + column_width && columns + 2 < getWidth() )
@ -555,7 +555,7 @@ inline void FButton::drawButtonTextLine (const FString& button_text)
{ {
setColor (button_hotkey_fg, button_bg); setColor (button_hotkey_fg, button_bg);
if ( ! active_focus && getMaxColor() < 16 ) if ( ! active_focus && FTerm::getMaxColor() < 16 )
setBold(); setBold();
if ( ! getFlags().no_underline ) if ( ! getFlags().no_underline )
@ -563,7 +563,7 @@ inline void FButton::drawButtonTextLine (const FString& button_text)
print (button_text[z]); print (button_text[z]);
if ( ! active_focus && getMaxColor() < 16 ) if ( ! active_focus && FTerm::getMaxColor() < 16 )
unsetBold(); unsetBold();
if ( ! getFlags().no_underline ) if ( ! getFlags().no_underline )
@ -588,7 +588,7 @@ inline void FButton::drawButtonTextLine (const FString& button_text)
print() << FPoint{int(getWidth() + indent) - 2, 1} << ".."; print() << FPoint{int(getWidth() + indent) - 2, 1} << "..";
} }
if ( active_focus && (isMonochron() || getMaxColor() < 16) ) if ( active_focus && (FTerm::isMonochron() || FTerm::getMaxColor() < 16) )
unsetBold(); unsetBold();
for (pos = center_offset + column_width; pos < getWidth() - 2; pos++) for (pos = center_offset + column_width; pos < getWidth() - 2; pos++)
@ -604,7 +604,7 @@ void FButton::draw()
space_char = int(' '); space_char = int(' ');
active_focus = getFlags().active && getFlags().focus; active_focus = getFlags().active && getFlags().focus;
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); // Light background setReverse(true); // Light background
// Click animation preprocessing // Click animation preprocessing
@ -613,10 +613,10 @@ void FButton::draw()
// Clear right margin after animation // Clear right margin after animation
clearRightMargin (parent_widget); clearRightMargin (parent_widget);
if ( ! getFlags().active && isMonochron() ) if ( ! getFlags().active && FTerm::isMonochron() )
space_char = fc::MediumShade; // ▒ simulates greyed out at Monochron space_char = fc::MediumShade; // ▒ simulates greyed out at Monochron
if ( isMonochron() && (getFlags().active || getFlags().focus) ) if ( FTerm::isMonochron() && (getFlags().active || getFlags().focus) )
setReverse(false); // Dark background setReverse(false); // Dark background
if ( getFlags().flat && ! button_down ) if ( getFlags().flat && ! button_down )
@ -648,7 +648,7 @@ void FButton::draw()
if ( ! getFlags().flat && getFlags().shadow && ! button_down ) if ( ! getFlags().flat && getFlags().shadow && ! button_down )
drawShadow(this); drawShadow(this);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); // Dark background setReverse(false); // Dark background
updateStatusBar(); updateStatusBar();

View File

@ -380,13 +380,13 @@ void FButtonGroup::setHotkeyAccelerator()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FButtonGroup::draw() void FButtonGroup::draw()
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
setColor(); setColor();
clearArea(); clearArea();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
FScrollView::draw(); FScrollView::draw();
@ -451,7 +451,7 @@ void FButtonGroup::drawText ( const FString& label_text
ellipsis = true; ellipsis = true;
} }
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
if ( isEnabled() ) if ( isEnabled() )
@ -482,7 +482,7 @@ void FButtonGroup::drawText ( const FString& label_text
if ( ellipsis ) // Print ellipsis if ( ellipsis ) // Print ellipsis
print() << FColorPair {wc.label_ellipsis_fg, wc.label_bg} << ".."; print() << FColorPair {wc.label_ellipsis_fg, wc.label_bg} << "..";
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
} }

View File

@ -76,7 +76,7 @@ void FCheckBox::drawCheckButton()
print() << FPoint{1, 1}; print() << FPoint{1, 1};
setColor(); setColor();
if ( isMonochron() ) if ( FTerm::isMonochron() )
{ {
if ( hasFocus() ) if ( hasFocus() )
setReverse(false); setReverse(false);
@ -89,14 +89,14 @@ void FCheckBox::drawCheckButton()
else else
drawUnchecked(); drawUnchecked();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FCheckBox::drawChecked() inline void FCheckBox::drawChecked()
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
print (CHECKBOX_ON); print (CHECKBOX_ON);
else else
{ {
@ -109,7 +109,7 @@ inline void FCheckBox::drawChecked()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FCheckBox::drawUnchecked() inline void FCheckBox::drawUnchecked()
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
print (CHECKBOX); print (CHECKBOX);
else else
{ {

View File

@ -72,7 +72,7 @@ void FDropDownListBox::setGeometry ( const FPoint& pos, const FSize& size
{ {
FWindow::setGeometry (pos, size, adjust); FWindow::setGeometry (pos, size, adjust);
if ( isNewFont() ) if ( FTerm::isNewFont() )
{ {
FSize new_size{size}; FSize new_size{size};
new_size.scaleBy(-1, 0); new_size.scaleBy(-1, 0);
@ -127,13 +127,13 @@ void FDropDownListBox::draw()
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
setColor (wc.menu_active_fg, wc.menu_active_bg); setColor (wc.menu_active_fg, wc.menu_active_bg);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
clearArea(); clearArea();
drawShadow(); drawShadow();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
@ -219,8 +219,8 @@ bool FComboBox::setFocus (bool enable)
bool FComboBox::setShadow (bool enable) bool FComboBox::setShadow (bool enable)
{ {
if ( enable if ( enable
&& getEncoding() != fc::VT100 && FTerm::getEncoding() != fc::VT100
&& getEncoding() != fc::ASCII ) && FTerm::getEncoding() != fc::ASCII )
{ {
setFlags().shadow = true; setFlags().shadow = true;
setShadowSize(FSize{1, 1}); setShadowSize(FSize{1, 1});
@ -495,7 +495,7 @@ void FComboBox::init()
adjustSize(); adjustSize();
initCallbacks(); initCallbacks();
if ( isNewFont() ) if ( FTerm::isNewFont() )
nf = 1; nf = 1;
} }
@ -548,7 +548,7 @@ void FComboBox::draw()
print() << FPoint{int(getWidth()) - nf, 1} print() << FPoint{int(getWidth()) - nf, 1}
<< button_color; << button_color;
if ( isNewFont() ) if ( FTerm::isNewFont() )
print() << NF_button_arrow_down; print() << NF_button_arrow_down;
else else
print() << fc::BlackDownPointingTriangle; // ▼ print() << fc::BlackDownPointingTriangle; // ▼
@ -644,7 +644,7 @@ void FComboBox::cb_closeComboBox (const FWidget*, const FDataPtr)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FComboBox::cb_inputFieldSwitch (const FWidget*, const FDataPtr) void FComboBox::cb_inputFieldSwitch (const FWidget*, const FDataPtr)
{ {
const auto& mouse = getFMouseControl(); const auto& mouse = FTerm::getFMouseControl();
if ( mouse && ! mouse->isLeftButtonPressed() ) if ( mouse && ! mouse->isLeftButtonPressed() )
return; return;
@ -676,7 +676,7 @@ void FComboBox::cb_inputFieldSwitch (const FWidget*, const FDataPtr)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FComboBox::cb_inputFieldHandOver (const FWidget*, const FDataPtr) void FComboBox::cb_inputFieldHandOver (const FWidget*, const FDataPtr)
{ {
const auto& mouse = getFMouseControl(); const auto& mouse = FTerm::getFMouseControl();
if ( ! mouse || list_window.isHidden() ) if ( ! mouse || list_window.isHidden() )
return; return;

View File

@ -99,7 +99,7 @@ bool FDialog::setModal (bool enable)
if ( enable ) if ( enable )
{ {
setModalDialogCounter()++; setModalDialogCounter()++;
getFKeyboard()->clearKeyBuffer(); FTerm::getFKeyboard()->clearKeyBuffer();
} }
else else
setModalDialogCounter()--; setModalDialogCounter()--;
@ -752,7 +752,7 @@ void FDialog::draw()
// Fill the background // Fill the background
setColor(); setColor();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
clearArea(); clearArea();
@ -763,14 +763,14 @@ void FDialog::draw()
if ( getFlags().shadow ) if ( getFlags().shadow )
drawDialogShadow(); drawDialogShadow();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FDialog::drawDialogShadow() void FDialog::drawDialogShadow()
{ {
if ( isMonochron() && ! getFlags().trans_shadow ) if ( FTerm::isMonochron() && ! getFlags().trans_shadow )
return; return;
drawShadow(this); drawShadow(this);
@ -930,7 +930,7 @@ void FDialog::drawBorder()
else else
setColor(); setColor();
if ( isNewFont() ) // Draw a newfont U-shaped frame if ( FTerm::isNewFont() ) // Draw a newfont U-shaped frame
{ {
const FRect r{FPoint{1, 1}, getSize()}; const FRect r{FPoint{1, 1}, getSize()};
@ -965,7 +965,7 @@ void FDialog::drawTitleBar()
// Draw the zoom/unzoom button // Draw the zoom/unzoom button
drawZoomButton(); drawZoomButton();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
#if DEBUG #if DEBUG
@ -990,7 +990,7 @@ void FDialog::drawBarButton()
else else
setColor (wc.titlebar_button_fg, wc.titlebar_button_bg); setColor (wc.titlebar_button_fg, wc.titlebar_button_bg);
if ( isMonochron() ) if ( FTerm::isMonochron() )
{ {
if ( isWindowActive() ) if ( isWindowActive() )
setReverse(false); setReverse(false);
@ -998,11 +998,11 @@ void FDialog::drawBarButton()
setReverse(true); setReverse(true);
} }
if ( isNewFont() ) if ( FTerm::isNewFont() )
{ {
print (finalcut::NF_menu_button); print (finalcut::NF_menu_button);
} }
else if ( isMonochron() ) else if ( FTerm::isMonochron() )
{ {
print ('['); print ('[');
@ -1050,13 +1050,13 @@ void FDialog::drawZoomButton()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FDialog::drawRestoreSizeButton() inline void FDialog::drawRestoreSizeButton()
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
{ {
print (finalcut::NF_button_down); print (finalcut::NF_button_down);
} }
else else
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
{ {
print ('['); print ('[');
print (fc::BlackDownPointingTriangle); // ▼ print (fc::BlackDownPointingTriangle); // ▼
@ -1074,13 +1074,13 @@ inline void FDialog::drawRestoreSizeButton()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FDialog::drawZoomedButton() inline void FDialog::drawZoomedButton()
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
{ {
print (finalcut::NF_button_up); print (finalcut::NF_button_up);
} }
else else
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
{ {
print ('['); print ('[');
print (fc::BlackUpPointingTriangle); // ▲ print (fc::BlackUpPointingTriangle); // ▲
@ -1103,7 +1103,7 @@ void FDialog::drawTextBar()
std::size_t x{1}; std::size_t x{1};
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
if ( getMaxColor() < 16 ) if ( FTerm::getMaxColor() < 16 )
setBold(); setBold();
if ( isWindowActive() || (dialog_menu && dialog_menu->isShown()) ) if ( isWindowActive() || (dialog_menu && dialog_menu->isShown()) )
@ -1138,7 +1138,7 @@ void FDialog::drawTextBar()
for ( ; x + 1 + length < width - zoom_btn - 1; x++) for ( ; x + 1 + length < width - zoom_btn - 1; x++)
print (' '); print (' ');
if ( getMaxColor() < 16 ) if ( FTerm::getMaxColor() < 16 )
unsetBold(); unsetBold();
} }
@ -1267,7 +1267,7 @@ inline std::size_t FDialog::getZoomButtonWidth()
{ {
if ( ! isResizeable() ) if ( ! isResizeable() )
return 0; return 0;
else if ( isNewFont() ) else if ( FTerm::isNewFont() )
return 2; return 2;
else else
return 3; return 3;
@ -1632,12 +1632,12 @@ void FDialog::cb_move (const FWidget*, const FDataPtr)
setMoveSizeWidget(this); setMoveSizeWidget(this);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
drawBorder(); drawBorder();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
save_geometry = getGeometry(); save_geometry = getGeometry();
@ -1654,7 +1654,7 @@ void FDialog::cb_move (const FWidget*, const FDataPtr)
if ( isResizeable() ) if ( isResizeable() )
{ {
if ( isLinuxTerm() ) if ( FTerm::isLinuxTerm() )
tooltip->setText ( " Arrow keys: Move\n" tooltip->setText ( " Arrow keys: Move\n"
"Shift + Arrow keys: Resize\n" "Shift + Arrow keys: Resize\n"
" Enter: Done\n" " Enter: Done\n"

View File

@ -303,7 +303,7 @@ void FLabel::draw()
if ( text.isEmpty() ) if ( text.isEmpty() )
return; return;
if ( isMonochron() ) if ( FTerm::isMonochron() )
{ {
setReverse(true); setReverse(true);
@ -322,7 +322,7 @@ void FLabel::draw()
else else
drawSingleLine(); drawSingleLine();
if ( isMonochron() ) if ( FTerm::isMonochron() )
{ {
setReverse(false); setReverse(false);
@ -407,7 +407,7 @@ void FLabel::printLine (FString& line)
for (std::size_t z{0}; z < to_char; z++) 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() && ! FTerm::isNewFont()
&& ( line[z] < fc::NF_rev_left_arrow2 && ( line[z] < fc::NF_rev_left_arrow2
|| line[z] > fc::NF_check_mark ) ) || line[z] > fc::NF_check_mark ) )
{ {

View File

@ -62,7 +62,7 @@ FLineEdit::FLineEdit (const FString& txt, FWidget* parent)
FLineEdit::~FLineEdit() // destructor FLineEdit::~FLineEdit() // destructor
{ {
if ( ! insert_mode ) if ( ! insert_mode )
setInsertCursor(); FTerm::setInsertCursor();
} }
// FLineEdit operators // FLineEdit operators
@ -152,8 +152,8 @@ bool FLineEdit::setFocus (bool enable)
bool FLineEdit::setShadow (bool enable) bool FLineEdit::setShadow (bool enable)
{ {
if ( enable if ( enable
&& getEncoding() != fc::VT100 && FTerm::getEncoding() != fc::VT100
&& getEncoding() != fc::ASCII ) && FTerm::getEncoding() != fc::ASCII )
{ {
setFlags().shadow = true; setFlags().shadow = true;
setShadowSize(FSize{1, 1}); setShadowSize(FSize{1, 1});
@ -576,7 +576,7 @@ void FLineEdit::onAccel (FAccelEvent* ev)
void FLineEdit::onHide (FHideEvent*) void FLineEdit::onHide (FHideEvent*)
{ {
if ( ! insert_mode && ! isReadOnly() ) if ( ! insert_mode && ! isReadOnly() )
setInsertCursor(); FTerm::setInsertCursor();
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -585,9 +585,9 @@ void FLineEdit::onFocusIn (FFocusEvent*)
if ( ! isReadOnly() ) if ( ! isReadOnly() )
{ {
if ( insert_mode ) if ( insert_mode )
setInsertCursor(); FTerm::setInsertCursor();
else else
unsetInsertCursor(); FTerm::unsetInsertCursor();
} }
if ( getStatusBar() ) if ( getStatusBar() )
@ -608,7 +608,7 @@ void FLineEdit::onFocusOut (FFocusEvent*)
} }
if ( ! insert_mode && ! isReadOnly() ) if ( ! insert_mode && ! isReadOnly() )
setInsertCursor(); FTerm::setInsertCursor();
} }
@ -724,7 +724,7 @@ void FLineEdit::drawInputField()
const bool isActiveFocus = getFlags().active && getFlags().focus; const bool isActiveFocus = getFlags().active && getFlags().focus;
print() << FPoint{1, 1}; print() << FPoint{1, 1};
if ( isMonochron() ) if ( FTerm::isMonochron() )
{ {
setReverse(true); setReverse(true);
print (' '); print (' ');
@ -740,7 +740,7 @@ void FLineEdit::drawInputField()
print (' '); print (' ');
} }
if ( isActiveFocus && getMaxColor() < 16 ) if ( isActiveFocus && FTerm::getMaxColor() < 16 )
setBold(); setBold();
const std::size_t text_offset_column = [this] () const std::size_t text_offset_column = [this] ()
@ -766,10 +766,10 @@ void FLineEdit::drawInputField()
x_pos++; x_pos++;
} }
if ( isActiveFocus && getMaxColor() < 16 ) if ( isActiveFocus && FTerm::getMaxColor() < 16 )
unsetBold(); unsetBold();
if ( isMonochron() ) if ( FTerm::isMonochron() )
{ {
setReverse(false); setReverse(false);
setUnderline(false); setUnderline(false);
@ -1082,9 +1082,9 @@ inline void FLineEdit::switchInsertMode()
insert_mode = ! insert_mode; insert_mode = ! insert_mode;
if ( insert_mode ) if ( insert_mode )
setInsertCursor(); // Insert mode FTerm::setInsertCursor(); // Insert mode
else else
unsetInsertCursor(); // Overtype mode FTerm::unsetInsertCursor(); // Overtype mode
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -1098,7 +1098,7 @@ inline bool FLineEdit::keyInput (FKey key)
{ {
if ( text.getLength() >= max_length ) if ( text.getLength() >= max_length )
{ {
beep(); FTerm::beep();
return true; return true;
} }

View File

@ -658,7 +658,7 @@ void FListBox::init()
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
setForegroundColor (wc.dialog_fg); setForegroundColor (wc.dialog_fg);
setBackgroundColor (wc.dialog_bg); setBackgroundColor (wc.dialog_bg);
nf_offset = isNewFont() ? 1 : 0; nf_offset = FTerm::isNewFont() ? 1 : 0;
setTopPadding(1); setTopPadding(1);
setLeftPadding(1); setLeftPadding(1);
setBottomPadding(1); setBottomPadding(1);
@ -724,12 +724,12 @@ void FListBox::draw()
setColor(); setColor();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
drawBorder(); drawBorder();
if ( isNewFont() && ! vbar->isShown() ) if ( FTerm::isNewFont() && ! vbar->isShown() )
{ {
setColor(); setColor();
@ -742,7 +742,7 @@ void FListBox::draw()
drawHeadline(); drawHeadline();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
drawScrollbars(); drawScrollbars();
@ -877,7 +877,7 @@ inline void FListBox::drawListLine ( int y
const FString element(getColumnSubString (getString(iter), first, max_width)); const FString element(getColumnSubString (getString(iter), first, max_width));
std::size_t column_width = getColumnWidth(element); std::size_t column_width = getColumnWidth(element);
if ( isMonochron() && isCurrentLine && getFlags().focus ) if ( FTerm::isMonochron() && isCurrentLine && getFlags().focus )
print (fc::BlackRightPointingPointer); // ► print (fc::BlackRightPointingPointer); // ►
else else
print (' '); print (' ');
@ -895,7 +895,7 @@ inline void FListBox::drawListLine ( int y
print (element[i]); print (element[i]);
} }
if ( isMonochron() && isCurrentLine && getFlags().focus ) if ( FTerm::isMonochron() && isCurrentLine && getFlags().focus )
{ {
print (fc::BlackLeftPointingPointer); // ◄ print (fc::BlackLeftPointingPointer); // ◄
column_width++; column_width++;
@ -928,7 +928,7 @@ inline void FListBox::drawListBracketsLine ( int y
const std::size_t inc_len = inc_search.getLength(); const std::size_t inc_len = inc_search.getLength();
const bool isCurrentLine( y + yoffset + 1 == int(current) ); const bool isCurrentLine( y + yoffset + 1 == int(current) );
if ( isMonochron() && isCurrentLine && getFlags().focus ) if ( FTerm::isMonochron() && isCurrentLine && getFlags().focus )
print (fc::BlackRightPointingPointer); // ► print (fc::BlackRightPointingPointer); // ►
else else
print (' '); print (' ');
@ -971,7 +971,7 @@ inline void FListBox::drawListBracketsLine ( int y
column_width++; column_width++;
} }
if ( isMonochron() && isCurrentLine && getFlags().focus ) if ( FTerm::isMonochron() && isCurrentLine && getFlags().focus )
{ {
print (fc::BlackLeftPointingPointer); // ◄ print (fc::BlackLeftPointingPointer); // ◄
column_width++; column_width++;
@ -995,14 +995,14 @@ inline void FListBox::setLineAttributes ( int y
if ( isLineSelected ) if ( isLineSelected )
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
setBold(); setBold();
else else
setColor (wc.selected_list_fg, wc.selected_list_bg); setColor (wc.selected_list_fg, wc.selected_list_bg);
} }
else else
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
unsetBold(); unsetBold();
else else
setColor (wc.list_fg, wc.list_bg); setColor (wc.list_fg, wc.list_bg);
@ -1010,12 +1010,12 @@ inline void FListBox::setLineAttributes ( int y
if ( isCurrentLine ) if ( isCurrentLine )
{ {
if ( getFlags().focus && getMaxColor() < 16 ) if ( getFlags().focus && FTerm::getMaxColor() < 16 )
setBold(); setBold();
if ( isLineSelected ) if ( isLineSelected )
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
setBold(); setBold();
else if ( getFlags().focus ) else if ( getFlags().focus )
setColor ( wc.selected_current_element_focus_fg setColor ( wc.selected_current_element_focus_fg
@ -1028,7 +1028,7 @@ inline void FListBox::setLineAttributes ( int y
} }
else else
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
unsetBold(); unsetBold();
if ( getFlags().focus ) if ( getFlags().focus )
@ -1051,14 +1051,14 @@ inline void FListBox::setLineAttributes ( int y
, wc.current_element_bg ); , wc.current_element_bg );
} }
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
else else
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
else if ( getFlags().focus && getMaxColor() < 16 ) else if ( getFlags().focus && FTerm::getMaxColor() < 16 )
unsetBold(); unsetBold();
} }
} }
@ -1066,7 +1066,7 @@ inline void FListBox::setLineAttributes ( int y
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FListBox::unsetAttributes() inline void FListBox::unsetAttributes()
{ {
if ( isMonochron() ) // unset for the last element if ( FTerm::isMonochron() ) // unset for the last element
setReverse(false); setReverse(false);
unsetBold(); unsetBold();
@ -1719,7 +1719,7 @@ void FListBox::processChanged()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FListBox::changeOnResize() void FListBox::changeOnResize()
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
{ {
vbar->setGeometry (FPoint{int(getWidth()), 2}, FSize{2, getHeight() - 2}); vbar->setGeometry (FPoint{int(getWidth()), 2}, FSize{2, getHeight() - 2});
hbar->setGeometry (FPoint{1, int(getHeight())}, FSize{getWidth() - 2, 1}); hbar->setGeometry (FPoint{1, int(getHeight())}, FSize{getWidth() - 2, 1});

View File

@ -1526,7 +1526,7 @@ void FListView::init()
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
setForegroundColor (wc.dialog_fg); setForegroundColor (wc.dialog_fg);
setBackgroundColor (wc.dialog_bg); setBackgroundColor (wc.dialog_bg);
nf_offset = isNewFont() ? 1 : 0; nf_offset = FTerm::isNewFont() ? 1 : 0;
setTopPadding(1); setTopPadding(1);
setLeftPadding(1); setLeftPadding(1);
setBottomPadding(1); setBottomPadding(1);
@ -1639,12 +1639,12 @@ void FListView::draw()
setColor(); setColor();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
drawBorder(); drawBorder();
if ( isNewFont() && ! vbar->isShown() ) if ( FTerm::isNewFont() && ! vbar->isShown() )
{ {
setColor(); setColor();
@ -1657,7 +1657,7 @@ void FListView::draw()
drawHeadlines(); drawHeadlines();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
drawScrollbars(); drawScrollbars();
@ -1773,7 +1773,7 @@ void FListView::drawList()
// Reset color // Reset color
setColor(); setColor();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
// Clean empty space after last element // Clean empty space after last element
@ -1902,10 +1902,10 @@ inline void FListView::setLineAttributes ( bool is_current
if ( is_current ) if ( is_current )
{ {
if ( is_focus && getMaxColor() < 16 ) if ( is_focus && FTerm::getMaxColor() < 16 )
setBold(); setBold();
if ( isMonochron() ) if ( FTerm::isMonochron() )
unsetBold(); unsetBold();
if ( is_focus ) if ( is_focus )
@ -1917,14 +1917,14 @@ inline void FListView::setLineAttributes ( bool is_current
setColor ( wc.current_element_fg setColor ( wc.current_element_fg
, wc.current_element_bg ); , wc.current_element_bg );
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
else else
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
else if ( is_focus && getMaxColor() < 16 ) else if ( is_focus && FTerm::getMaxColor() < 16 )
unsetBold(); unsetBold();
} }
} }
@ -1934,7 +1934,7 @@ inline FString FListView::getCheckBox (const FListViewItem* item)
{ {
FString checkbox{""}; FString checkbox{""};
if ( isNewFont() ) if ( FTerm::isNewFont() )
{ {
checkbox = ( item->isChecked() ) ? CHECKBOX_ON : CHECKBOX; checkbox = ( item->isChecked() ) ? CHECKBOX_ON : CHECKBOX;
checkbox += L' '; checkbox += L' ';
@ -2516,7 +2516,7 @@ void FListView::processChanged()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FListView::changeOnResize() void FListView::changeOnResize()
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
{ {
vbar->setGeometry (FPoint{int(getWidth()), 2}, FSize{2, getHeight() - 2}); vbar->setGeometry (FPoint{int(getWidth()), 2}, FSize{2, getHeight() - 2});
hbar->setGeometry (FPoint{1, int(getHeight())}, FSize{getWidth() - 2, 1}); hbar->setGeometry (FPoint{1, int(getHeight())}, FSize{getWidth() - 2, 1});

View File

@ -45,6 +45,7 @@ FLog::~FLog() // destructor
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FLog& FLog::operator << (LogLevel l) FLog& FLog::operator << (LogLevel l)
{ {
using namespace std::placeholders;
sync(); sync();
switch ( l ) switch ( l )

View File

@ -72,11 +72,11 @@ const std::string FLogger::getTimeString()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const std::string FLogger::getEOL() const std::string FLogger::getEOL()
{ {
if ( end_of_line == FLog::LF ) if ( getEnding() == FLog::LF )
return "\n"; return "\n";
else if ( end_of_line == FLog::CR ) else if ( getEnding() == FLog::CR )
return "\r"; return "\r";
else if ( end_of_line == FLog::CRLF ) else if ( getEnding() == FLog::CRLF )
return "\r\n"; return "\r\n";
return ""; return "";
@ -87,7 +87,7 @@ void FLogger::printLogLine (const std::string& msg)
{ {
const std::string& log_level = [this] () const std::string& log_level = [this] ()
{ {
switch ( level ) switch ( getLevel() )
{ {
case Info: case Info:
return "INFO"; return "INFO";

View File

@ -518,7 +518,7 @@ void FMenu::calculateDimensions()
} }
else if ( accel_key ) else if ( accel_key )
{ {
const std::size_t accel_len = getKeyName(accel_key).getLength(); const std::size_t accel_len = FTerm::getKeyName(accel_key).getLength();
item_width += accel_len + 2; item_width += accel_len + 2;
} }
@ -1212,7 +1212,7 @@ void FMenu::draw()
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
setColor (wc.menu_active_fg, wc.menu_active_bg); setColor (wc.menu_active_fg, wc.menu_active_bg);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
clearArea(); clearArea();
@ -1220,7 +1220,7 @@ void FMenu::draw()
drawItems(); drawItems();
drawShadow(this); drawShadow(this);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
@ -1247,10 +1247,10 @@ inline void FMenu::drawSeparator (int y)
print() << FPoint{1, 2 + y} print() << FPoint{1, 2 + y}
<< FColorPair{wc.menu_active_fg, wc.menu_active_bg}; << FColorPair{wc.menu_active_fg, wc.menu_active_bg};
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
if ( isNewFont() ) if ( FTerm::isNewFont() )
{ {
print (fc::NF_border_line_vertical_right); print (fc::NF_border_line_vertical_right);
FString line { std::size_t(getWidth()) - 2 FString line { std::size_t(getWidth()) - 2
@ -1267,7 +1267,7 @@ inline void FMenu::drawSeparator (int y)
print (fc::BoxDrawingsVerticalAndLeft); print (fc::BoxDrawingsVerticalAndLeft);
} }
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
@ -1314,7 +1314,7 @@ inline void FMenu::drawMenuLine (FMenuItem* m_item, int y)
if ( is_selected ) if ( is_selected )
drawTrailingSpaces (column_width); drawTrailingSpaces (column_width);
if ( isMonochron() && is_enabled && is_selected ) if ( FTerm::isMonochron() && is_enabled && is_selected )
setReverse(true); setReverse(true);
} }
@ -1334,14 +1334,14 @@ inline void FMenu::drawCheckMarkPrefix (const FMenuItem* m_item)
{ {
if ( is_radio_btn ) if ( is_radio_btn )
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
print (fc::NF_Bullet); // NF_Bullet ● print (fc::NF_Bullet); // NF_Bullet ●
else else
print (fc::BlackCircle); // BlackCircle ● print (fc::BlackCircle); // BlackCircle ●
} }
else else
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
print (fc::NF_check_mark); // NF_check_mark ✓ print (fc::NF_check_mark); // NF_check_mark ✓
else else
print (fc::SquareRoot); // SquareRoot √ print (fc::SquareRoot); // SquareRoot √
@ -1352,7 +1352,7 @@ inline void FMenu::drawCheckMarkPrefix (const FMenuItem* m_item)
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
setColor (wc.menu_inactive_fg, getBackgroundColor()); setColor (wc.menu_inactive_fg, getBackgroundColor());
if ( getEncoding() == fc::ASCII ) if ( FTerm::getEncoding() == fc::ASCII )
print ('-'); print ('-');
else else
print (fc::SmallBullet); // · print (fc::SmallBullet); // ·
@ -1372,10 +1372,10 @@ inline void FMenu::drawMenuText (menuText& data)
for (std::size_t z{0}; z < data.text.getLength(); z++) for (std::size_t z{0}; z < data.text.getLength(); z++)
{ {
if ( ! std::iswprint(std::wint_t(data.text[z])) if ( ! std::iswprint(std::wint_t(data.text[z]))
&& ! isNewFont() && ! FTerm::isNewFont()
&& ( data.text[z] < fc::NF_rev_left_arrow2 && ( data.text[z] < fc::NF_rev_left_arrow2
|| data.text[z] > fc::NF_check_mark ) || data.text[z] > fc::NF_check_mark )
&& ! charEncodable(wchar_t(data.text[z])) ) && ! FTerm::charEncodable(wchar_t(data.text[z])) )
{ {
data.text[z] = L' '; data.text[z] = L' ';
} }
@ -1419,7 +1419,7 @@ inline void FMenu::drawSubMenuIndicator (std::size_t& startpos)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FMenu::drawAcceleratorKey (std::size_t& startpos, FKey accel_key) inline void FMenu::drawAcceleratorKey (std::size_t& startpos, FKey accel_key)
{ {
const FString accel_name {getKeyName(accel_key)}; const FString accel_name {FTerm::getKeyName(accel_key)};
const std::size_t c = ( has_checkable_items ) ? 1 : 0; const std::size_t c = ( has_checkable_items ) ? 1 : 0;
const std::size_t accel_len = accel_name.getLength(); const std::size_t accel_len = accel_name.getLength();
const std::size_t len = max_item_width - (startpos + accel_len + c + 2); const std::size_t len = max_item_width - (startpos + accel_len + c + 2);
@ -1457,7 +1457,7 @@ inline void FMenu::setLineAttributes (const FMenuItem* m_item, int y)
setForegroundColor (wc.menu_active_focus_fg); setForegroundColor (wc.menu_active_focus_fg);
setBackgroundColor (wc.menu_active_focus_bg); setBackgroundColor (wc.menu_active_focus_bg);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
else else
@ -1465,7 +1465,7 @@ inline void FMenu::setLineAttributes (const FMenuItem* m_item, int y)
setForegroundColor (wc.menu_active_fg); setForegroundColor (wc.menu_active_fg);
setBackgroundColor (wc.menu_active_bg); setBackgroundColor (wc.menu_active_bg);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
} }
} }
@ -1474,7 +1474,7 @@ inline void FMenu::setLineAttributes (const FMenuItem* m_item, int y)
setForegroundColor (wc.menu_inactive_fg); setForegroundColor (wc.menu_inactive_fg);
setBackgroundColor (wc.menu_inactive_bg); setBackgroundColor (wc.menu_inactive_bg);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
} }

View File

@ -478,7 +478,7 @@ void FMenuBar::drawItems()
print() << FPoint{1, 1}; print() << FPoint{1, 1};
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
std::size_t x{1}; std::size_t x{1};
@ -490,7 +490,7 @@ void FMenuBar::drawItems()
for (; x <= getDesktopWidth(); x++) for (; x <= getDesktopWidth(); x++)
print (' '); print (' ');
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
@ -532,7 +532,7 @@ inline void FMenuBar::drawItem (FMenuItem* menuitem, std::size_t& x)
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
setColor (wc.menu_active_fg, wc.menu_active_bg); setColor (wc.menu_active_fg, wc.menu_active_bg);
if ( isMonochron() && is_enabled && is_selected ) if ( FTerm::isMonochron() && is_enabled && is_selected )
setReverse(true); setReverse(true);
} }
@ -547,7 +547,7 @@ inline void FMenuBar::setLineAttributes (const FMenuItem* menuitem)
{ {
if ( is_selected ) if ( is_selected )
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
setForegroundColor (wc.menu_active_focus_fg); setForegroundColor (wc.menu_active_focus_fg);
@ -598,7 +598,7 @@ inline void FMenuBar::drawMenuText (menuText& data)
break; break;
if ( ! std::iswprint(std::wint_t(data.text[z])) if ( ! std::iswprint(std::wint_t(data.text[z]))
&& ! isNewFont() && ! FTerm::isNewFont()
&& ( data.text[z] < fc::NF_rev_left_arrow2 && ( data.text[z] < fc::NF_rev_left_arrow2
|| data.text[z] > fc::NF_check_mark ) ) || data.text[z] > fc::NF_check_mark ) )
{ {

View File

@ -348,7 +348,7 @@ void FMessageBox::draw()
// center the whole block // center the whole block
const int msg_x = int((getWidth() - max_line_width) / 2); const int msg_x = int((getWidth() - max_line_width) / 2);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
if ( ! headline_text.isEmpty() ) if ( ! headline_text.isEmpty() )
@ -377,7 +377,7 @@ void FMessageBox::draw()
y++; y++;
} }
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }

View File

@ -194,16 +194,15 @@ bool FObject::event (FEvent* ev)
if ( ev->type() == fc::Timer_Event ) if ( ev->type() == fc::Timer_Event )
{ {
onTimer ( static_cast<FTimerEvent*>(ev) ); onTimer ( static_cast<FTimerEvent*>(ev) );
return true;
} }
else if ( ev->type() == fc::User_Event )
if ( ev->type() == fc::User_Event )
{ {
onUserEvent ( static_cast<FUserEvent*>(ev) ); onUserEvent ( static_cast<FUserEvent*>(ev) );
return true;
} }
else
return false;
return false; return true;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -92,8 +92,8 @@ void FProgressbar::setGeometry ( const FPoint& pos, const FSize& size
bool FProgressbar::setShadow (bool enable) bool FProgressbar::setShadow (bool enable)
{ {
if ( enable if ( enable
&& getEncoding() != fc::VT100 && FTerm::getEncoding() != fc::VT100
&& getEncoding() != fc::ASCII ) && FTerm::getEncoding() != fc::ASCII )
{ {
setFlags().shadow = true; setFlags().shadow = true;
setShadowSize(FSize{1, 1}); setShadowSize(FSize{1, 1});
@ -159,7 +159,7 @@ void FProgressbar::drawProgressLabel()
setColor (wc.dialog_fg, wc.dialog_bg); setColor (wc.dialog_fg, wc.dialog_bg);
} }
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
print() << FPoint{int(getWidth()) - 3, 0}; print() << FPoint{int(getWidth()) - 3, 0};
@ -169,7 +169,7 @@ void FProgressbar::drawProgressLabel()
else else
printf ("%3zu %%", percentage); printf ("%3zu %%", percentage);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
@ -184,7 +184,7 @@ void FProgressbar::drawProgressBar()
drawProgressBackground(len); drawProgressBackground(len);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
updateTerminal(); updateTerminal();
@ -196,7 +196,7 @@ std::size_t FProgressbar::drawProgressIndicator()
{ {
// Draw the progress indicator // Draw the progress indicator
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
@ -208,14 +208,14 @@ std::size_t FProgressbar::drawProgressIndicator()
if ( len >= bar_length ) if ( len >= bar_length )
return len; return len;
if ( round(length) > len || getMaxColor() < 16 ) if ( round(length) > len || FTerm::getMaxColor() < 16 )
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
print(' '); print(' ');
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
} }
else else
@ -237,7 +237,7 @@ void FProgressbar::drawProgressBackground (std::size_t len)
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
setColor (wc.progressbar_fg, wc.progressbar_bg); setColor (wc.progressbar_fg, wc.progressbar_bg);
if ( getMaxColor() < 16 ) if ( FTerm::getMaxColor() < 16 )
print() << FString {bg_len, fc::MediumShade}; // ▒ print() << FString {bg_len, fc::MediumShade}; // ▒
else else
print() << FString {bg_len, L' '}; print() << FString {bg_len, L' '};

View File

@ -76,7 +76,7 @@ void FRadioButton::drawRadioButton()
print() << FPoint{1, 1}; print() << FPoint{1, 1};
setColor(); setColor();
if ( isMonochron() ) if ( FTerm::isMonochron() )
{ {
if ( hasFocus() ) if ( hasFocus() )
setReverse(false); setReverse(false);
@ -89,14 +89,14 @@ void FRadioButton::drawRadioButton()
else else
drawUnchecked(); drawUnchecked();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FRadioButton::drawChecked() inline void FRadioButton::drawChecked()
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
print (CHECKED_RADIO_BUTTON); print (CHECKED_RADIO_BUTTON);
else else
{ {
@ -109,7 +109,7 @@ inline void FRadioButton::drawChecked()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FRadioButton::drawUnchecked() inline void FRadioButton::drawUnchecked()
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
print (RADIO_BUTTON); print (RADIO_BUTTON);
else else
{ {

View File

@ -184,7 +184,7 @@ void FScrollbar::redraw()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FScrollbar::calculateSliderValues() void FScrollbar::calculateSliderValues()
{ {
if ( isNewFont() && bar_orientation == fc::horizontal ) if ( FTerm::isNewFont() && bar_orientation == fc::horizontal )
bar_length = ( length > 2 ) ? length - 4 : 1; bar_length = ( length > 2 ) ? length - 4 : 1;
else else
bar_length = ( length > 2 ) ? length - 2 : 1; bar_length = ( length > 2 ) ? length - 2 : 1;
@ -276,7 +276,7 @@ void FScrollbar::onMouseDown (FMouseEvent* ev)
slider_click_stop_pos = mouse_y - 2; slider_click_stop_pos = mouse_y - 2;
else else
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
slider_click_stop_pos = mouse_x - 3; slider_click_stop_pos = mouse_x - 3;
else else
slider_click_stop_pos = mouse_x - 2; slider_click_stop_pos = mouse_x - 2;
@ -470,20 +470,20 @@ void FScrollbar::drawVerticalBar()
setColor (wc.scrollbar_bg, wc.scrollbar_fg); setColor (wc.scrollbar_bg, wc.scrollbar_fg);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
for (int z{1}; z <= int(slider_length); z++) // Draw slider for (int z{1}; z <= int(slider_length); z++) // Draw slider
{ {
print() << FPoint{1, 1 + slider_pos + z}; print() << FPoint{1, 1 + slider_pos + z};
if ( isNewFont() ) if ( FTerm::isNewFont() )
print (' '); print (' ');
print (' '); print (' ');
} }
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
setColor (wc.scrollbar_fg, wc.scrollbar_bg); setColor (wc.scrollbar_fg, wc.scrollbar_bg);
@ -494,24 +494,24 @@ void FScrollbar::drawVerticalBar()
drawVerticalBackgroundLine(); drawVerticalBackgroundLine();
} }
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FScrollbar::drawVerticalBackgroundLine() inline void FScrollbar::drawVerticalBackgroundLine()
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
{ {
if ( isMonochron() || max_color < 16 ) if ( FTerm::isMonochron() || max_color < 16 )
print (fc::MediumShade); // ▒ print (fc::MediumShade); // ▒
else else
print (fc::NF_border_line_left); // ⎸ print (fc::NF_border_line_left); // ⎸
} }
if ( isMonochron() || max_color < 16 ) if ( FTerm::isMonochron() || max_color < 16 )
print (fc::MediumShade); // ▒ print (fc::MediumShade); // ▒
else if ( isNewFont() ) else if ( FTerm::isNewFont() )
print (fc::NF_rev_border_line_right); // ⎹ print (fc::NF_rev_border_line_right); // ⎹
else else
print (' '); print (' ');
@ -523,7 +523,7 @@ void FScrollbar::drawHorizontalBar()
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
setColor (wc.scrollbar_fg, wc.scrollbar_bg); setColor (wc.scrollbar_fg, wc.scrollbar_bg);
if ( isNewFont() ) if ( FTerm::isNewFont() )
print() << FPoint{3, 1}; print() << FPoint{3, 1};
else else
print() << FPoint{2, 1}; print() << FPoint{2, 1};
@ -533,13 +533,13 @@ void FScrollbar::drawHorizontalBar()
setColor (wc.scrollbar_bg, wc.scrollbar_fg); setColor (wc.scrollbar_bg, wc.scrollbar_fg);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
for (int z{0}; z < int(slider_length); z++) // Draw slider for (int z{0}; z < int(slider_length); z++) // Draw slider
print (' '); print (' ');
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
setColor (wc.scrollbar_fg, wc.scrollbar_bg); setColor (wc.scrollbar_fg, wc.scrollbar_bg);
@ -548,16 +548,16 @@ void FScrollbar::drawHorizontalBar()
for (; z <= int(bar_length); z++) for (; z <= int(bar_length); z++)
drawHorizontalBackgroundColumn(); drawHorizontalBackgroundColumn();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FScrollbar::drawHorizontalBackgroundColumn() inline void FScrollbar::drawHorizontalBackgroundColumn()
{ {
if ( isNewFont() && max_color > 8 ) if ( FTerm::isNewFont() && max_color > 8 )
print (fc::NF_border_line_up_and_down); // ニ print (fc::NF_border_line_up_and_down); // ニ
else if ( isMonochron() || max_color < 16 ) else if ( FTerm::isMonochron() || max_color < 16 )
print (fc::MediumShade); // ▒ print (fc::MediumShade); // ▒
else else
print (' '); print (' ');
@ -569,7 +569,7 @@ void FScrollbar::drawButtons()
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
setColor (wc.scrollbar_button_fg, wc.scrollbar_button_bg); setColor (wc.scrollbar_button_fg, wc.scrollbar_button_bg);
if ( isNewFont() ) if ( FTerm::isNewFont() )
{ {
print() << FPoint{1, 1}; print() << FPoint{1, 1};
@ -590,7 +590,7 @@ void FScrollbar::drawButtons()
{ {
print() << FPoint{1, 1}; print() << FPoint{1, 1};
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
if ( bar_orientation == fc::vertical ) if ( bar_orientation == fc::vertical )
@ -606,7 +606,7 @@ void FScrollbar::drawButtons()
<< fc::BlackRightPointingPointer; // ► << fc::BlackRightPointingPointer; // ►
} }
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
} }
@ -650,7 +650,7 @@ FScrollbar::sType FScrollbar::getVerticalClickedScrollType (int y)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
FScrollbar::sType FScrollbar::getHorizontalClickedScrollType (int x) FScrollbar::sType FScrollbar::getHorizontalClickedScrollType (int x)
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
{ {
if ( x == 1 || x == 2 ) if ( x == 1 || x == 2 )
{ {
@ -707,7 +707,7 @@ int FScrollbar::getSliderClickPos (int mouse_x, int mouse_y)
} }
else // horizontal bar orientation else // horizontal bar orientation
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
{ {
if ( mouse_x > slider_pos + 2 if ( mouse_x > slider_pos + 2
&& mouse_x <= slider_pos + int(slider_length) + 2 ) && mouse_x <= slider_pos + int(slider_length) + 2 )
@ -741,7 +741,7 @@ void FScrollbar::jumpToClickPos (int x, int y)
} }
else // horizontal else // horizontal
{ {
const int nf = isNewFont() ? 1 : 0; const int nf = FTerm::isNewFont() ? 1 : 0;
if ( x > 1 + nf && x < int(getWidth()) - nf ) if ( x > 1 + nf && x < int(getWidth()) - nf )
{ {
@ -769,7 +769,7 @@ void FScrollbar::jumpToClickPos (int pos)
jumpToClickPos (0, pos + 2); jumpToClickPos (0, pos + 2);
else else
{ {
if ( isNewFont() ) if ( FTerm::isNewFont() )
jumpToClickPos (pos + 3, 0); jumpToClickPos (pos + 3, 0);
else else
jumpToClickPos (pos + 2, 0); jumpToClickPos (pos + 2, 0);
@ -807,7 +807,7 @@ void FScrollbar::changeOnResize()
if ( bar_orientation == fc::vertical ) if ( bar_orientation == fc::vertical )
{ {
setWidth(isNewFont() ? 2 : 1); setWidth(FTerm::isNewFont() ? 2 : 1);
setHeight(length); setHeight(length);
} }
else // horizontal else // horizontal

View File

@ -416,7 +416,7 @@ void FScrollView::draw()
{ {
unsetViewportPrint(); unsetViewportPrint();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
if ( const auto& p = getParentWidget() ) if ( const auto& p = getParentWidget() )
@ -427,7 +427,7 @@ void FScrollView::draw()
if ( hasBorder() ) if ( hasBorder() )
drawBorder(); drawBorder();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
setViewportPrint(); setViewportPrint();
@ -719,7 +719,7 @@ void FScrollView::init (const FWidget* parent)
setMinimumSize (FSize{4, 4}); setMinimumSize (FSize{4, 4});
const int xoffset_end = int(getScrollWidth() - getViewportWidth()); const int xoffset_end = int(getScrollWidth() - getViewportWidth());
const int yoffset_end = int(getScrollHeight() - getViewportHeight()); const int yoffset_end = int(getScrollHeight() - getViewportHeight());
nf_offset = isNewFont() ? 1 : 0; nf_offset = FTerm::isNewFont() ? 1 : 0;
setTopPadding (1 - getScrollY()); setTopPadding (1 - getScrollY());
setLeftPadding (1 - getScrollX()); setLeftPadding (1 - getScrollX());
setBottomPadding (1 - (yoffset_end - getScrollY())); setBottomPadding (1 - (yoffset_end - getScrollY()));
@ -769,7 +769,7 @@ void FScrollView::calculateScrollbarPos()
const std::size_t width = getWidth(); const std::size_t width = getWidth();
const std::size_t height = getHeight(); const std::size_t height = getHeight();
if ( isNewFont() ) if ( FTerm::isNewFont() )
{ {
vbar->setGeometry (FPoint{int(width), 2}, FSize{2, height - 2}); vbar->setGeometry (FPoint{int(width), 2}, FSize{2, height - 2});
hbar->setGeometry (FPoint{1, int(height)}, FSize{width - 2, 1}); hbar->setGeometry (FPoint{1, int(height)}, FSize{width - 2, 1});

View File

@ -92,8 +92,8 @@ bool FSpinBox::setFocus (bool enable)
bool FSpinBox::setShadow (bool enable) bool FSpinBox::setShadow (bool enable)
{ {
if ( enable if ( enable
&& getEncoding() != fc::VT100 && FTerm::getEncoding() != fc::VT100
&& getEncoding() != fc::ASCII ) && FTerm::getEncoding() != fc::ASCII )
{ {
setFlags().shadow = true; setFlags().shadow = true;
setShadowSize(FSize{1, 1}); setShadowSize(FSize{1, 1});

View File

@ -214,7 +214,7 @@ void FStatusBar::drawMessage()
setColor (wc.statusbar_fg, wc.statusbar_bg); setColor (wc.statusbar_fg, wc.statusbar_bg);
setPrintPos ({x, 1}); setPrintPos ({x, 1});
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
if ( x + space_offset + 3 < int(termWidth) && text ) if ( x + space_offset + 3 < int(termWidth) && text )
@ -249,7 +249,7 @@ void FStatusBar::drawMessage()
for (int i = x; i <= int(termWidth); i++) for (int i = x; i <= int(termWidth); i++)
print (' '); print (' ');
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
@ -522,7 +522,7 @@ void FStatusBar::init()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int FStatusBar::getKeyNameWidth (const FStatusKey* key) int FStatusBar::getKeyNameWidth (const FStatusKey* key)
{ {
const FString& key_name = getKeyName(key->getKey()); const FString& key_name = FTerm::getKeyName(key->getKey());
return int(getColumnWidth(key_name)); return int(getColumnWidth(key_name));
} }
@ -554,7 +554,7 @@ void FStatusBar::drawKeys()
print() << FPoint{1, 1}; print() << FPoint{1, 1};
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
auto iter = key_list.begin(); auto iter = key_list.begin();
@ -583,7 +583,7 @@ void FStatusBar::drawKeys()
++iter; ++iter;
} }
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
x_msg = x; x_msg = x;
@ -600,7 +600,7 @@ void FStatusBar::drawKey (keyList::const_iterator iter)
x++; x++;
print (' '); print (' ');
x += keyname_len; x += keyname_len;
print (getKeyName(item->getKey())); print (FTerm::getKeyName(item->getKey()));
setColor (wc.statusbar_fg, wc.statusbar_bg); setColor (wc.statusbar_fg, wc.statusbar_bg);
x++; x++;
print ('-'); print ('-');
@ -622,10 +622,10 @@ void FStatusBar::drawKey (keyList::const_iterator iter)
&& x + getKeyNameWidth(*(iter + 1)) + 3 < int(screenWidth) ) && x + getKeyNameWidth(*(iter + 1)) + 3 < int(screenWidth) )
{ {
// Next element is active // Next element is active
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
if ( hasHalfBlockCharacter() ) if ( FTerm::hasHalfBlockCharacter() )
{ {
setColor (wc.statusbar_active_fg, wc.statusbar_active_bg); setColor (wc.statusbar_active_fg, wc.statusbar_active_bg);
print (fc::LeftHalfBlock); // ▐ print (fc::LeftHalfBlock); // ▐
@ -635,7 +635,7 @@ void FStatusBar::drawKey (keyList::const_iterator iter)
x++; x++;
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
} }
else if ( iter + 1 != key_list.end() && x < int(screenWidth) ) else if ( iter + 1 != key_list.end() && x < int(screenWidth) )
@ -654,7 +654,7 @@ void FStatusBar::drawActiveKey (keyList::const_iterator iter)
const auto& item = *iter; const auto& item = *iter;
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
@ -663,7 +663,7 @@ void FStatusBar::drawActiveKey (keyList::const_iterator iter)
x++; x++;
print (' '); print (' ');
x += keyname_len; x += keyname_len;
print (getKeyName(item->getKey())); print (FTerm::getKeyName(item->getKey()));
setColor (wc.statusbar_active_fg, wc.statusbar_active_bg); setColor (wc.statusbar_active_fg, wc.statusbar_active_bg);
x++; x++;
print ('-'); print ('-');
@ -684,7 +684,7 @@ void FStatusBar::drawActiveKey (keyList::const_iterator iter)
<< ".."; << "..";
} }
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
} }

View File

@ -147,12 +147,12 @@ inline void FSwitch::drawChecked()
if ( hasFocus() && ! button_pressed ) if ( hasFocus() && ! button_pressed )
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
{ {
std::wcsncpy (on, L" <On>", 6); std::wcsncpy (on, L" <On>", 6);
setBold(true); setBold(true);
} }
else if ( getMaxColor() < 16 ) else if ( FTerm::getMaxColor() < 16 )
{ {
setBold(true); setBold(true);
setColor (wc.button_active_focus_fg, wc.button_active_focus_bg); setColor (wc.button_active_focus_fg, wc.button_active_focus_bg);
@ -162,27 +162,27 @@ inline void FSwitch::drawChecked()
} }
else else
{ {
if ( isMonochron() || getMaxColor() < 16 ) if ( FTerm::isMonochron() || FTerm::getMaxColor() < 16 )
setColor (wc.button_active_focus_fg, wc.button_active_bg); setColor (wc.button_active_focus_fg, wc.button_active_bg);
else else
setColor (wc.button_hotkey_fg, wc.button_active_bg); setColor (wc.button_hotkey_fg, wc.button_active_bg);
} }
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
print (on); print (on);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
if ( isMonochron() || getMaxColor() < 16 ) if ( FTerm::isMonochron() || FTerm::getMaxColor() < 16 )
setBold(false); setBold(false);
print() << FColorPair{wc.button_inactive_fg, wc.button_inactive_bg} print() << FColorPair{wc.button_inactive_fg, wc.button_inactive_bg}
<< off; << off;
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
setCursorPos ({3 + int(switch_offset_pos), 1}); setCursorPos ({3 + int(switch_offset_pos), 1});
@ -197,19 +197,19 @@ inline void FSwitch::drawUnchecked()
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
setColor (wc.button_inactive_fg, wc.button_inactive_bg); setColor (wc.button_inactive_fg, wc.button_inactive_bg);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
print (on); print (on);
if ( hasFocus() && ! button_pressed ) if ( hasFocus() && ! button_pressed )
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
{ {
std::wcsncpy (off, L"<Off>", 6); std::wcsncpy (off, L"<Off>", 6);
setBold(true); setBold(true);
} }
else if ( getMaxColor() < 16 ) else if ( FTerm::getMaxColor() < 16 )
{ {
setBold(true); setBold(true);
setColor (wc.button_active_focus_fg, wc.button_active_focus_bg); setColor (wc.button_active_focus_fg, wc.button_active_focus_bg);
@ -219,18 +219,18 @@ inline void FSwitch::drawUnchecked()
} }
else else
{ {
if ( isMonochron() || getMaxColor() < 16 ) if ( FTerm::isMonochron() || FTerm::getMaxColor() < 16 )
setColor (wc.button_active_focus_fg, wc.button_active_bg); setColor (wc.button_active_focus_fg, wc.button_active_bg);
else else
setColor (wc.button_hotkey_fg, wc.button_active_bg); setColor (wc.button_hotkey_fg, wc.button_active_bg);
} }
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
print (off); print (off);
if ( isMonochron() || getMaxColor() < 16 ) if ( FTerm::isMonochron() || FTerm::getMaxColor() < 16 )
setBold(false); setBold(false);
setCursorPos ({7 + int(switch_offset_pos), 1}); setCursorPos ({7 + int(switch_offset_pos), 1});

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2018-2019 Markus Gans * * Copyright 2018-2020 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -20,13 +20,22 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/fapplication.h"
#include "final/fcharmap.h" #include "final/fcharmap.h"
#include "final/flog.h"
#include "final/fsystem.h" #include "final/fsystem.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/ftermdata.h" #include "final/ftermdata.h"
#include "final/ftermfreebsd.h" #include "final/ftermfreebsd.h"
#include "final/ftypes.h" #include "final/ftypes.h"
#define initCheck(ret_value) \
if ( ! isInitialized() ) \
{ \
warnNotInitialized(); \
return ret_value; \
}
namespace finalcut namespace finalcut
{ {
@ -58,12 +67,14 @@ bool FTermFreeBSD::setCursorStyle (CursorStyle style)
{ {
// Set cursor style in a BSD console // Set cursor style in a BSD console
if ( ! fsystem || ! isFreeBSDConsole() || ! change_cursorstyle )
return false;
if ( ! fterm_data ) if ( ! fterm_data )
fterm_data = FTerm::getFTermData(); fterm_data = FTerm::getFTermData();
initCheck(false);
if ( ! fsystem || ! isFreeBSDConsole() || ! change_cursorstyle )
return false;
cursor_style = style; cursor_style = style;
if ( fterm_data->isCursorHidden() ) if ( fterm_data->isCursorHidden() )
@ -177,6 +188,16 @@ void FTermFreeBSD::finish()
// private methods of FTermFreeBSD // private methods of FTermFreeBSD
//----------------------------------------------------------------------
void FTermFreeBSD::warnNotInitialized()
{
*FApplication::getLog() << FLog::Warn
<< "The FTermFreeBSD object has "
<< "not yet been initialized! "
<< "Please call the init() method first."
<< std::endl;
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FTermFreeBSD::saveFreeBSDAltKey() bool FTermFreeBSD::saveFreeBSDAltKey()
{ {
@ -185,9 +206,8 @@ bool FTermFreeBSD::saveFreeBSDAltKey()
static constexpr int left_alt = 0x38; static constexpr int left_alt = 0x38;
int ret{-1}; int ret{-1};
keymap_t keymap{}; keymap_t keymap{};
initCheck(false);
if ( fsystem ) ret = fsystem->ioctl (0, GIO_KEYMAP, &keymap);
ret = fsystem->ioctl (0, GIO_KEYMAP, &keymap);
if ( ret < 0 ) if ( ret < 0 )
return false; return false;
@ -205,9 +225,8 @@ bool FTermFreeBSD::setFreeBSDAltKey (uInt key)
static constexpr int left_alt = 0x38; static constexpr int left_alt = 0x38;
int ret{-1}; int ret{-1};
keymap_t keymap{}; keymap_t keymap{};
initCheck(false);
if ( fsystem ) ret = fsystem->ioctl (0, GIO_KEYMAP, &keymap);
ret = fsystem->ioctl (0, GIO_KEYMAP, &keymap);
if ( ret < 0 ) if ( ret < 0 )
return false; return false;
@ -241,6 +260,8 @@ bool FTermFreeBSD::resetFreeBSDAlt2Meta()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FTermFreeBSD::setFreeBSDCursorStyle (CursorStyle style) bool FTermFreeBSD::setFreeBSDCursorStyle (CursorStyle style)
{ {
initCheck(false);
if ( fsystem->ioctl(0, CONS_CURSORTYPE, &style) == 0 ) if ( fsystem->ioctl(0, CONS_CURSORTYPE, &style) == 0 )
return true; return true;
else else

View File

@ -292,6 +292,9 @@ bool FTermLinux::loadVGAFont()
if ( vga_font ) if ( vga_font )
{ {
if ( ! fterm_data )
fterm_data = FTerm::getFTermData();
fterm_data->supportShadowCharacter (true); fterm_data->supportShadowCharacter (true);
fterm_data->supportHalfBlockCharacter (true); fterm_data->supportHalfBlockCharacter (true);
} }
@ -338,6 +341,9 @@ bool FTermLinux::loadNewFont()
if ( new_font ) if ( new_font )
{ {
if ( ! fterm_data )
fterm_data = FTerm::getFTermData();
fterm_data->supportShadowCharacter (true); fterm_data->supportShadowCharacter (true);
fterm_data->supportHalfBlockCharacter (true); fterm_data->supportHalfBlockCharacter (true);
} }
@ -1288,6 +1294,9 @@ inline void FTermLinux::initSpecialCharacter()
const wchar_t c2 = fc::LowerHalfBlock; const wchar_t c2 = fc::LowerHalfBlock;
const wchar_t c3 = fc::FullBlock; const wchar_t c3 = fc::FullBlock;
if ( ! fterm_data )
fterm_data = FTerm::getFTermData();
if ( FTerm::charEncode(c1, fc::PC) == FTerm::charEncode(c1, fc::ASCII) if ( FTerm::charEncode(c1, fc::PC) == FTerm::charEncode(c1, fc::ASCII)
|| FTerm::charEncode(c2, fc::PC) == FTerm::charEncode(c2, fc::ASCII) || FTerm::charEncode(c2, fc::PC) == FTerm::charEncode(c2, fc::ASCII)
|| FTerm::charEncode(c3, fc::PC) == FTerm::charEncode(c3, fc::ASCII) ) || FTerm::charEncode(c3, fc::PC) == FTerm::charEncode(c3, fc::ASCII) )
@ -1324,6 +1333,10 @@ void FTermLinux::characterFallback ( wchar_t ucs
, std::vector<wchar_t> fallback ) , std::vector<wchar_t> fallback )
{ {
constexpr sInt16 NOT_FOUND = -1; constexpr sInt16 NOT_FOUND = -1;
if ( ! fterm_data )
fterm_data = FTerm::getFTermData();
charSubstitution& sub_map = fterm_data->getCharSubstitutionMap(); charSubstitution& sub_map = fterm_data->getCharSubstitutionMap();
if ( fallback.size() < 2 || ucs != fallback[0] ) if ( fallback.size() < 2 || ucs != fallback[0] )

View File

@ -3,7 +3,7 @@
* * * *
* This file is part of the Final Cut widget toolkit * * This file is part of the Final Cut widget toolkit *
* * * *
* Copyright 2018-2019 Markus Gans * * Copyright 2018-2020 Markus Gans *
* * * *
* The Final Cut is free software; you can redistribute it and/or * * The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License * * modify it under the terms of the GNU Lesser General Public License *
@ -20,10 +20,19 @@
* <http://www.gnu.org/licenses/>. * * <http://www.gnu.org/licenses/>. *
***********************************************************************/ ***********************************************************************/
#include "final/fapplication.h"
#include "final/flog.h"
#include "final/fsystem.h" #include "final/fsystem.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/ftermopenbsd.h" #include "final/ftermopenbsd.h"
#define initCheck(ret_value) \
if ( ! isInitialized() ) \
{ \
warnNotInitialized(); \
return ret_value; \
}
namespace finalcut namespace finalcut
{ {
@ -86,6 +95,8 @@ void FTermOpenBSD::init()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermOpenBSD::finish() void FTermOpenBSD::finish()
{ {
initCheck();
if ( ! isBSDConsole() ) if ( ! isBSDConsole() )
return; return;
@ -96,6 +107,8 @@ void FTermOpenBSD::finish()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FTermOpenBSD::setBeep (int Hz, int ms) bool FTermOpenBSD::setBeep (int Hz, int ms)
{ {
initCheck(false);
if ( ! isBSDConsole() ) if ( ! isBSDConsole() )
return false; return false;
@ -122,6 +135,7 @@ bool FTermOpenBSD::setBeep (int Hz, int ms)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FTermOpenBSD::resetBeep() bool FTermOpenBSD::resetBeep()
{ {
initCheck(false);
wskbd_bell_data default_bell; wskbd_bell_data default_bell;
// Gets the default setting for the bell // Gets the default setting for the bell
@ -141,6 +155,16 @@ bool FTermOpenBSD::resetBeep()
// private methods of FTermOpenBSD // private methods of FTermOpenBSD
//----------------------------------------------------------------------
void FTermOpenBSD::warnNotInitialized()
{
*FApplication::getLog() << FLog::Warn
<< "The FTermOpenBSD object has "
<< "not yet been initialized! "
<< "Please call the init() method first."
<< std::endl;
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FTermOpenBSD::saveBSDConsoleEncoding() bool FTermOpenBSD::saveBSDConsoleEncoding()
{ {

View File

@ -24,7 +24,9 @@
#include "final/fconfig.h" // includes _GNU_SOURCE for fd_set #include "final/fconfig.h" // includes _GNU_SOURCE for fd_set
#endif #endif
#include "final/fapplication.h"
#include "final/fc.h" #include "final/fc.h"
#include "final/flog.h"
#include "final/fstring.h" #include "final/fstring.h"
#include "final/fterm.h" #include "final/fterm.h"
#include "final/ftermcap.h" #include "final/ftermcap.h"
@ -34,6 +36,13 @@
#include "final/ftermxterminal.h" #include "final/ftermxterminal.h"
#include "final/fsize.h" #include "final/fsize.h"
#define initCheck(ret_value) \
if ( ! isInitialized() ) \
{ \
warnNotInitialized(); \
return ret_value; \
}
namespace finalcut namespace finalcut
{ {
@ -256,6 +265,8 @@ void FTermXTerminal::resetHighlightBackground()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermXTerminal::resetDefaults() void FTermXTerminal::resetDefaults()
{ {
initCheck();
if ( term_detection->isPuttyTerminal() ) if ( term_detection->isPuttyTerminal() )
return; return;
@ -280,6 +291,8 @@ void FTermXTerminal::resetDefaults()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermXTerminal::captureFontAndTitle() void FTermXTerminal::captureFontAndTitle()
{ {
initCheck();
if ( ( term_detection->isXTerminal() if ( ( term_detection->isXTerminal()
|| term_detection->isUrxvtTerminal() ) || term_detection->isUrxvtTerminal() )
&& ! term_detection->isRxvtTerminal() ) && ! term_detection->isRxvtTerminal() )
@ -293,6 +306,16 @@ void FTermXTerminal::captureFontAndTitle()
// private methods of FTermXTerminal // private methods of FTermXTerminal
//----------------------------------------------------------------------
void FTermXTerminal::warnNotInitialized()
{
*FApplication::getLog() << FLog::Warn
<< "The FTermXTerminal object has "
<< "not yet been initialized! "
<< "Please call the init() method first."
<< std::endl;
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermXTerminal::setXTermCursorStyle() void FTermXTerminal::setXTermCursorStyle()
{ {
@ -303,6 +326,8 @@ void FTermXTerminal::setXTermCursorStyle()
return; return;
#endif #endif
initCheck();
if ( term_detection->isGnomeTerminal() if ( term_detection->isGnomeTerminal()
&& ! term_detection->hasSetCursorStyleSupport() ) && ! term_detection->hasSetCursorStyleSupport() )
return; return;
@ -325,6 +350,7 @@ void FTermXTerminal::setXTermCursorStyle()
void FTermXTerminal::setXTermTitle() void FTermXTerminal::setXTermTitle()
{ {
// Set the xterm title // Set the xterm title
initCheck();
if ( term_detection->isXTerminal() if ( term_detection->isXTerminal()
|| term_detection->isScreenTerm() || term_detection->isScreenTerm()
@ -343,6 +369,8 @@ void FTermXTerminal::setXTermTitle()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermXTerminal::setXTermSize() void FTermXTerminal::setXTermSize()
{ {
initCheck();
if ( term_detection->isXTerminal() ) if ( term_detection->isXTerminal() )
{ {
FTerm::putstringf ( CSI "8;%lu;%lut" FTerm::putstringf ( CSI "8;%lu;%lut"
@ -357,6 +385,8 @@ void FTermXTerminal::setXTermFont()
{ {
// Change the XTerm font (needs the allowFontOps resource) // Change the XTerm font (needs the allowFontOps resource)
initCheck();
if ( term_detection->isXTerminal() if ( term_detection->isXTerminal()
|| term_detection->isScreenTerm() || term_detection->isScreenTerm()
|| term_detection->isUrxvtTerminal() || term_detection->isUrxvtTerminal()
@ -373,6 +403,8 @@ void FTermXTerminal::setXTermForeground()
{ {
// Set the XTerm text foreground color // Set the XTerm text foreground color
initCheck();
if ( term_detection->isXTerminal() if ( term_detection->isXTerminal()
|| term_detection->isScreenTerm() || term_detection->isScreenTerm()
|| term_detection->isMinttyTerm() || term_detection->isMinttyTerm()
@ -391,6 +423,8 @@ void FTermXTerminal::setXTermBackground()
{ {
// Set the XTerm text background color // Set the XTerm text background color
initCheck();
if ( term_detection->isXTerminal() if ( term_detection->isXTerminal()
|| term_detection->isScreenTerm() || term_detection->isScreenTerm()
|| term_detection->isMinttyTerm() || term_detection->isMinttyTerm()
@ -409,6 +443,8 @@ void FTermXTerminal::setXTermCursorColor()
{ {
// Set the text cursor color // Set the text cursor color
initCheck();
if ( term_detection->isXTerminal() if ( term_detection->isXTerminal()
|| term_detection->isScreenTerm() || term_detection->isScreenTerm()
|| term_detection->isMinttyTerm() || term_detection->isMinttyTerm()
@ -427,6 +463,8 @@ void FTermXTerminal::setXTermMouseForeground()
{ {
// Set the mouse foreground color // Set the mouse foreground color
initCheck();
if ( term_detection->isXTerminal() if ( term_detection->isXTerminal()
|| term_detection->isScreenTerm() || term_detection->isScreenTerm()
|| term_detection->isUrxvtTerminal() || term_detection->isUrxvtTerminal()
@ -444,6 +482,8 @@ void FTermXTerminal::setXTermMouseBackground()
{ {
// Set the mouse background color // Set the mouse background color
initCheck();
if ( term_detection->isXTerminal() if ( term_detection->isXTerminal()
|| term_detection->isScreenTerm() || term_detection->isScreenTerm()
|| FTermcap::osc_support ) || FTermcap::osc_support )
@ -460,6 +500,8 @@ void FTermXTerminal::setXTermHighlightBackground()
{ {
// Set the highlight background color // Set the highlight background color
initCheck();
if ( term_detection->isXTerminal() if ( term_detection->isXTerminal()
|| term_detection->isScreenTerm() || term_detection->isScreenTerm()
|| term_detection->isUrxvtTerminal() || term_detection->isUrxvtTerminal()
@ -478,6 +520,8 @@ void FTermXTerminal::setXTerm8ColorDefaults()
// Redefinition of the XTerm default colors // Redefinition of the XTerm default colors
// for the final cut 8 color theme // for the final cut 8 color theme
initCheck();
if ( term_detection->isPuttyTerminal() ) if ( term_detection->isPuttyTerminal() )
return; return;
@ -498,6 +542,8 @@ void FTermXTerminal::setXTerm16ColorDefaults()
// Redefinition of the XTerm default colors // Redefinition of the XTerm default colors
// for the final cut 16 color theme // for the final cut 16 color theme
initCheck();
if ( term_detection->isPuttyTerminal() ) if ( term_detection->isPuttyTerminal() )
return; return;
@ -518,6 +564,8 @@ inline void FTermXTerminal::setXTermDefaultsMouseCursor()
setMouseBackground("rgb:ffff/ffff/ffff"); // white setMouseBackground("rgb:ffff/ffff/ffff"); // white
setMouseForeground ("rgb:0000/0000/0000"); // black setMouseForeground ("rgb:0000/0000/0000"); // black
initCheck();
if ( ! term_detection->isGnomeTerminal() ) if ( ! term_detection->isGnomeTerminal() )
setCursorColor("rgb:ffff/ffff/ffff"); // white setCursorColor("rgb:ffff/ffff/ffff"); // white
} }
@ -525,6 +573,8 @@ inline void FTermXTerminal::setXTermDefaultsMouseCursor()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FTermXTerminal::canSetXTermBackground() inline bool FTermXTerminal::canSetXTermBackground()
{ {
initCheck(false);
if ( xterm_default_colors if ( xterm_default_colors
&& ! (term_detection->isMinttyTerm() && ! (term_detection->isMinttyTerm()
|| term_detection->isMltermTerminal() || term_detection->isMltermTerminal()
@ -540,6 +590,8 @@ void FTermXTerminal::resetXTermColorMap()
{ {
// Reset the entire color table // Reset the entire color table
initCheck();
if ( term_detection->isMinttyTerm() ) if ( term_detection->isMinttyTerm() )
{ {
FTerm::putstring (ESC "c"); // Full Reset (RIS) FTerm::putstring (ESC "c"); // Full Reset (RIS)
@ -640,6 +692,8 @@ void FTermXTerminal::resetXTermHighlightBackground()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FTermXTerminal::canResetColor() bool FTermXTerminal::canResetColor()
{ {
initCheck(false);
if ( term_detection->isGnomeTerminal() if ( term_detection->isGnomeTerminal()
&& term_detection->getGnomeTerminalID() < 3502 ) && term_detection->getGnomeTerminalID() < 3502 )
return false; return false;
@ -659,6 +713,8 @@ bool FTermXTerminal::canResetColor()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermXTerminal::oscPrefix() void FTermXTerminal::oscPrefix()
{ {
initCheck();
if ( term_detection->isTmuxTerm() ) if ( term_detection->isTmuxTerm() )
{ {
// tmux device control string // tmux device control string
@ -674,6 +730,8 @@ void FTermXTerminal::oscPrefix()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FTermXTerminal::oscPostfix() void FTermXTerminal::oscPostfix()
{ {
initCheck();
if ( term_detection->isScreenTerm() if ( term_detection->isScreenTerm()
|| term_detection->isTmuxTerm() ) || term_detection->isTmuxTerm() )
{ {
@ -685,6 +743,8 @@ void FTermXTerminal::oscPostfix()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FTermXTerminal::captureXTermFont() const FString FTermXTerminal::captureXTermFont()
{ {
initCheck(FString{});
if ( term_detection->isXTerminal() if ( term_detection->isXTerminal()
|| term_detection->isScreenTerm() || term_detection->isScreenTerm()
|| FTermcap::osc_support ) || FTermcap::osc_support )
@ -727,6 +787,8 @@ const FString FTermXTerminal::captureXTermFont()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString FTermXTerminal::captureXTermTitle() const FString FTermXTerminal::captureXTermTitle()
{ {
initCheck(FString{});
if ( term_detection->isKdeTerminal() ) if ( term_detection->isKdeTerminal() )
return FString{}; return FString{};

View File

@ -214,7 +214,7 @@ void FTextView::insert (const FString& str, int pos)
if ( str.isEmpty() ) if ( str.isEmpty() )
s = "\n"; s = "\n";
else else
s = FString{str}.rtrim().expandTabs(getTabstop()); s = FString{str}.rtrim().expandTabs(FTerm::getTabstop());
auto text_split = s.split("\r\n"); auto text_split = s.split("\r\n");
@ -572,7 +572,7 @@ void FTextView::init()
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
setForegroundColor (wc.dialog_fg); setForegroundColor (wc.dialog_fg);
setBackgroundColor (wc.dialog_bg); setBackgroundColor (wc.dialog_bg);
nf_offset = isNewFont() ? 1 : 0; nf_offset = FTerm::isNewFont() ? 1 : 0;
setTopPadding(1); setTopPadding(1);
setLeftPadding(1); setLeftPadding(1);
setBottomPadding(1); setBottomPadding(1);
@ -623,13 +623,13 @@ void FTextView::drawBorder()
{ {
if ( ! useFDialogBorder() ) if ( ! useFDialogBorder() )
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
const FRect box{FPoint{1, 1}, getSize()}; const FRect box{FPoint{1, 1}, getSize()};
finalcut::drawListBorder (this, box); finalcut::drawListBorder (this, box);
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
} }
@ -661,7 +661,7 @@ void FTextView::drawText()
setColor(); setColor();
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
for (std::size_t y{0}; y < num; y++) // Line loop for (std::size_t y{0}; y < num; y++) // Line loop
@ -690,7 +690,7 @@ void FTextView::drawText()
print() << FString{trailing_whitespace, L' '}; print() << FString{trailing_whitespace, L' '};
} }
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }
@ -719,7 +719,7 @@ inline bool FTextView::isPrintable (wchar_t ch)
{ {
// Check for printable characters // Check for printable characters
const bool utf8 = ( getEncoding() == fc::UTF8 ) ? true : false; const bool utf8 = ( FTerm::getEncoding() == fc::UTF8 ) ? true : false;
if ( (utf8 && std::iswprint(std::wint_t(ch))) if ( (utf8 && std::iswprint(std::wint_t(ch)))
|| (!utf8 && std::isprint(ch)) ) || (!utf8 && std::isprint(ch)) )
@ -740,7 +740,7 @@ void FTextView::changeOnResize()
const std::size_t width = getWidth(); const std::size_t width = getWidth();
const std::size_t height = getHeight(); const std::size_t height = getHeight();
if ( isNewFont() ) if ( FTerm::isNewFont() )
{ {
vbar->setGeometry (FPoint{int(width), 1}, FSize{2, height - 1}); vbar->setGeometry (FPoint{int(width), 1}, FSize{2, height - 1});
hbar->setGeometry (FPoint{1, int(height)}, FSize{width - 2, 1}); hbar->setGeometry (FPoint{1, int(height)}, FSize{width - 2, 1});

View File

@ -522,7 +522,7 @@ void FToggleButton::init()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FToggleButton::drawText (const FString& label_text, std::size_t hotkeypos) void FToggleButton::drawText (const FString& label_text, std::size_t hotkeypos)
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(true); setReverse(true);
const auto& wc = getFWidgetColors(); const auto& wc = getFWidgetColors();
@ -552,7 +552,7 @@ void FToggleButton::drawText (const FString& label_text, std::size_t hotkeypos)
print (label_text[z]); print (label_text[z]);
} }
if ( isMonochron() ) if ( FTerm::isMonochron() )
setReverse(false); setReverse(false);
} }

View File

@ -123,8 +123,8 @@ void FVTerm::setTermXY (int x, int y)
if ( term_pos->getX() == x && term_pos->getY() == y ) if ( term_pos->getX() == x && term_pos->getY() == y )
return; return;
const int term_width = int(getColumnNumber()); const int term_width = int(FTerm::getColumnNumber());
const int term_height = int(getLineNumber()); const int term_height = int(FTerm::getLineNumber());
if ( x >= term_width && term_width > 0 ) if ( x >= term_width && term_width > 0 )
{ {
@ -413,7 +413,7 @@ int FVTerm::print (const std::vector<FChar>& term_string)
int FVTerm::print (FTermArea* area, const std::vector<FChar>& term_string) int FVTerm::print (FTermArea* area, const std::vector<FChar>& term_string)
{ {
int len{0}; int len{0};
const uInt tabstop = uInt(getTabstop()); const uInt tabstop = uInt(FTerm::getTabstop());
if ( ! area ) if ( ! area )
return -1; return -1;
@ -447,7 +447,7 @@ int FVTerm::print (FTermArea* area, const std::vector<FChar>& term_string)
break; break;
case '\a': case '\a':
beep(); FTerm::beep();
break; break;
default: default:
@ -1929,7 +1929,7 @@ void FVTerm::init (bool disable_alt_screen)
std::memcpy (&next_attribute, &term_attribute, sizeof(next_attribute)); std::memcpy (&next_attribute, &term_attribute, sizeof(next_attribute));
// Create virtual terminal // Create virtual terminal
FRect term_geometry {0, 0, getColumnNumber(), getLineNumber()}; FRect term_geometry {0, 0, FTerm::getColumnNumber(), FTerm::getLineNumber()};
createVTerm (term_geometry.getSize()); createVTerm (term_geometry.getSize());
// Create virtual desktop area // Create virtual desktop area
@ -2121,7 +2121,7 @@ bool FVTerm::clearTerm (int fillchar)
{ {
term_pos->setPoint(-1, -1); term_pos->setPoint(-1, -1);
for (int i{0}; i < int(getLineNumber()); i++) for (int i{0}; i < int(FTerm::getLineNumber()); i++)
{ {
setTermXY (0, i); setTermXY (0, i);
appendOutputBuffer (cb); appendOutputBuffer (cb);
@ -2754,7 +2754,7 @@ void FVTerm::printPaddingCharacter (FTermArea* area, const FChar& term_char)
// Copy character to padding character // Copy character to padding character
std::memcpy (&pc, &term_char, sizeof(pc)); std::memcpy (&pc, &term_char, sizeof(pc));
if ( getEncoding() == fc::UTF8 ) if ( FTerm::getEncoding() == fc::UTF8 )
{ {
pc.ch = 0; pc.ch = 0;
pc.attr.bit.fullwidth_padding = true; pc.attr.bit.fullwidth_padding = true;
@ -2863,7 +2863,7 @@ bool FVTerm::isInsideTerminal (const FPoint& pos)
{ {
// Check whether the coordinates are within the virtual terminal // Check whether the coordinates are within the virtual terminal
const FRect term_geometry {0, 0, getColumnNumber(), getLineNumber()}; const FRect term_geometry {0, 0, FTerm::getColumnNumber(), FTerm::getLineNumber()};
if ( term_geometry.contains(pos) ) if ( term_geometry.contains(pos) )
return true; return true;
@ -2911,7 +2911,7 @@ inline void FVTerm::markAsPrinted (uInt from, uInt to, uInt line)
inline void FVTerm::newFontChanges (FChar*& next_char) inline void FVTerm::newFontChanges (FChar*& next_char)
{ {
// NewFont special cases // NewFont special cases
if ( ! isNewFont() ) if ( ! FTerm::isNewFont() )
return; return;
if ( next_char->ch == fc::LowerHalfBlock ) if ( next_char->ch == fc::LowerHalfBlock )
@ -2929,7 +2929,7 @@ inline void FVTerm::charsetChanges (FChar*& next_char)
const wchar_t& ch = next_char->ch; const wchar_t& ch = next_char->ch;
next_char->encoded_char = ch; next_char->encoded_char = ch;
if ( getEncoding() == fc::UTF8 ) if ( FTerm::getEncoding() == fc::UTF8 )
return; return;
const wchar_t ch_enc = FTerm::charEncode(ch); const wchar_t ch_enc = FTerm::charEncode(ch);
@ -2945,18 +2945,18 @@ inline void FVTerm::charsetChanges (FChar*& next_char)
next_char->encoded_char = ch_enc; next_char->encoded_char = ch_enc;
if ( getEncoding() == fc::VT100 ) if ( FTerm::getEncoding() == fc::VT100 )
next_char->attr.bit.alt_charset = true; next_char->attr.bit.alt_charset = true;
else if ( getEncoding() == fc::PC ) else if ( FTerm::getEncoding() == fc::PC )
{ {
next_char->attr.bit.pc_charset = true; next_char->attr.bit.pc_charset = true;
if ( isPuttyTerminal() ) if ( FTerm::isPuttyTerminal() )
return; return;
if ( isXTerminal() && ch_enc < 0x20 ) // Character 0x00..0x1f if ( FTerm::isXTerminal() && ch_enc < 0x20 ) // Character 0x00..0x1f
{ {
if ( hasUTF8() ) if ( FTerm::hasUTF8() )
next_char->encoded_char = int(FTerm::charEncode(ch, fc::ASCII)); next_char->encoded_char = int(FTerm::charEncode(ch, fc::ASCII));
else else
{ {
@ -3028,8 +3028,8 @@ int FVTerm::appendLowerRight (FChar*& screen_char)
const auto& ip = TCAP(fc::t_insert_padding); const auto& ip = TCAP(fc::t_insert_padding);
const auto& ic = TCAP(fc::t_insert_character); const auto& ic = TCAP(fc::t_insert_character);
const int x = int(getColumnNumber()) - 2; const int x = int(FTerm::getColumnNumber()) - 2;
const int y = int(getLineNumber()) - 1; const int y = int(FTerm::getLineNumber()) - 1;
setTermXY (x, y); setTermXY (x, y);
appendChar (screen_char); appendChar (screen_char);
term_pos->x_ref()++; term_pos->x_ref()++;

View File

@ -538,7 +538,7 @@ void FWidget::setTermSize (const FSize& size)
{ {
// Set xterm size to width x height // Set xterm size to width x height
if ( isXTerminal() ) if ( FTerm::isXTerminal() )
{ {
root_widget->wsize.setRect(FPoint{1, 1}, size); root_widget->wsize.setRect(FPoint{1, 1}, size);
root_widget->adjust_wsize = root_widget->wsize; root_widget->adjust_wsize = root_widget->wsize;
@ -1001,7 +1001,7 @@ void FWidget::show()
if ( ! init_desktop ) if ( ! init_desktop )
{ {
// Sets the initial screen settings // Sets the initial screen settings
initScreenSettings(); FTerm::initScreenSettings();
// Initializing vdesktop // Initializing vdesktop
const auto& r = getRootWidget(); const auto& r = getRootWidget();
setColor(r->getForegroundColor(), r->getBackgroundColor()); setColor(r->getForegroundColor(), r->getBackgroundColor());
@ -1591,12 +1591,8 @@ bool FWidget::event (FEvent* ev)
onClose (static_cast<FCloseEvent*>(ev)); onClose (static_cast<FCloseEvent*>(ev));
break; break;
case fc::Timer_Event:
onTimer (static_cast<FTimerEvent*>(ev));
break;
default: default:
return false; return FObject::event(ev);
} }
return true; return true;
@ -1696,7 +1692,7 @@ void FWidget::initRootWidget()
return; return;
} }
hideable = isCursorHideable(); hideable = FTerm::isCursorHideable();
flags.visible_cursor = ! hideable; flags.visible_cursor = ! hideable;
// Determine width and height of the terminal // Determine width and height of the terminal
@ -1992,7 +1988,7 @@ void FWidget::setColorTheme()
{ {
// Sets the default color theme // Sets the default color theme
if ( getMaxColor() < 16 ) // for 8 color mode if ( FTerm::getMaxColor() < 16 ) // for 8 color mode
wcolors.set8ColorTheme(); wcolors.set8ColorTheme();
else else
wcolors.set16ColorTheme(); wcolors.set16ColorTheme();

View File

@ -138,11 +138,11 @@ void setHotkeyViaString (FWidget* w, const FString& text)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void drawShadow (FWidget* w) void drawShadow (FWidget* w)
{ {
if ( w->isMonochron() && ! w->flags.trans_shadow ) if ( FTerm::isMonochron() && ! w->flags.trans_shadow )
return; return;
if ( (w->getEncoding() == fc::VT100 && ! w->flags.trans_shadow) if ( (FTerm::getEncoding() == fc::VT100 && ! w->flags.trans_shadow)
|| (w->getEncoding() == fc::ASCII && ! w->flags.trans_shadow) ) || (FTerm::getEncoding() == fc::ASCII && ! w->flags.trans_shadow) )
{ {
clearShadow(w); clearShadow(w);
return; return;
@ -183,7 +183,7 @@ void drawTransparentShadow (FWidget* w)
<< FString {width, L' '} << FString {width, L' '}
<< FStyle {fc::Reset}; << FStyle {fc::Reset};
if ( w->isMonochron() ) if ( FTerm::isMonochron() )
w->setReverse(false); w->setReverse(false);
} }
@ -192,7 +192,7 @@ void drawBlockShadow (FWidget* w)
{ {
// non-transparent shadow // non-transparent shadow
if ( ! w->hasShadowCharacter() ) if ( ! FTerm::hasShadowCharacter() )
return; return;
const std::size_t width = w->getWidth(); const std::size_t width = w->getWidth();
@ -233,7 +233,7 @@ void drawBlockShadow (FWidget* w)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void clearShadow (FWidget* w) void clearShadow (FWidget* w)
{ {
if ( w->isMonochron() ) if ( FTerm::isMonochron() )
return; return;
const std::size_t width = w->getWidth(); const std::size_t width = w->getWidth();
@ -270,7 +270,7 @@ void clearShadow (FWidget* w)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void drawFlatBorder (FWidget* w) void drawFlatBorder (FWidget* w)
{ {
if ( ! w->isNewFont() ) if ( ! FTerm::isNewFont() )
return; return;
const std::size_t width = w->getWidth(); const std::size_t width = w->getWidth();
@ -331,7 +331,7 @@ void drawFlatBorder (FWidget* w)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void clearFlatBorder (FWidget* w) void clearFlatBorder (FWidget* w)
{ {
if ( ! w->isNewFont() ) if ( ! FTerm::isNewFont() )
return; return;
const std::size_t width = w->getWidth(); const std::size_t width = w->getWidth();
@ -413,7 +413,7 @@ void drawBorder (FWidget* w, const FRect& r)
FRect rect = r; FRect rect = r;
checkBorder (w, rect); checkBorder (w, rect);
if ( w->isNewFont() ) if ( FTerm::isNewFont() )
drawNewFontBox (w, rect); drawNewFontBox (w, rect);
else else
drawBox (w, rect); drawBox (w, rect);
@ -425,7 +425,7 @@ void drawListBorder (FWidget* w, const FRect& r)
FRect rect = r; FRect rect = r;
checkBorder (w, rect); checkBorder (w, rect);
if ( w->isNewFont() ) if ( FTerm::isNewFont() )
drawNewFontListBox (w, rect); drawNewFontListBox (w, rect);
else else
drawBox (w, rect); drawBox (w, rect);

View File

@ -184,7 +184,7 @@ bool FWindow::setTransparentShadow (bool enable)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool FWindow::setShadow (bool enable) bool FWindow::setShadow (bool enable)
{ {
if ( isMonochron() ) if ( FTerm::isMonochron() )
return false; return false;
if ( enable ) if ( enable )
@ -239,7 +239,7 @@ bool FWindow::isWindowHidden() const
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void FWindow::drawBorder() void FWindow::drawBorder()
{ {
if ( isNewFont() ) // Draw a newfont outer frame if ( FTerm::isNewFont() ) // Draw a newfont outer frame
{ {
const FRect r{FPoint{1, 1}, getSize()}; const FRect r{FPoint{1, 1}, getSize()};
print() << r.getUpperLeftPos() print() << r.getUpperLeftPos()

View File

@ -46,8 +46,6 @@
namespace finalcut namespace finalcut
{ {
using namespace std::placeholders;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FLog // class FLog
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -57,6 +55,7 @@ class FLog : public std::stringbuf
public: public:
// Using-declaration // Using-declaration
using FLogPrint = std::function<void(const std::string&)>; using FLogPrint = std::function<void(const std::string&)>;
using IOManip = std::ostream& (*)(std::ostream&);
// Enumerations // Enumerations
enum LogLevel enum LogLevel
@ -78,7 +77,7 @@ class FLog : public std::stringbuf
template <typename T> template <typename T>
FLog& operator << (const T& s); FLog& operator << (const T& s);
FLog& operator << (std::ostream&(*)(std::ostream&)); FLog& operator << (IOManip);
FLog& operator << (LogLevel); FLog& operator << (LogLevel);
virtual const FString getClassName() const; virtual const FString getClassName() const;
@ -92,15 +91,17 @@ class FLog : public std::stringbuf
virtual void disableTimestamp() = 0; virtual void disableTimestamp() = 0;
protected: protected:
int sync() override; int sync() override;
const LogLevel& getLevel();
// Data member LogLevel& setLevel();
LogLevel level{Info}; const LineEnding& getEnding();
LineEnding end_of_line{CRLF}; LineEnding& setEnding();
private: private:
// Data member // Data member
FLogPrint current_log{std::bind(&FLog::info, this, _1)}; LogLevel level{Info};
LineEnding end_of_line{CRLF};
FLogPrint current_log{std::bind(&FLog::info, this, std::placeholders::_1)};
std::ostream stream{this}; std::ostream stream{this};
}; };
@ -114,7 +115,7 @@ inline FLog& FLog::operator << (const T& s)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FLog& FLog::operator << (std::ostream&(*pf)(std::ostream&)) inline FLog& FLog::operator << (IOManip pf)
{ {
pf(stream); pf(stream);
return *this; return *this;
@ -124,6 +125,23 @@ inline FLog& FLog::operator << (std::ostream&(*pf)(std::ostream&))
inline const FString FLog::getClassName() const inline const FString FLog::getClassName() const
{ return "FLog"; } { return "FLog"; }
//----------------------------------------------------------------------
inline const FLog::LogLevel& FLog::getLevel()
{ return level; }
//----------------------------------------------------------------------
inline FLog::LogLevel& FLog::setLevel()
{ return level; }
//----------------------------------------------------------------------
inline const FLog::LineEnding& FLog::getEnding()
{ return end_of_line; }
//----------------------------------------------------------------------
inline FLog::LineEnding& FLog::setEnding()
{ return end_of_line; }
} // namespace finalcut } // namespace finalcut
#endif // FLOG_H #endif // FLOG_H

View File

@ -92,28 +92,28 @@ inline const FString FLogger::getClassName() const
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FLogger::info (const std::string& msg) inline void FLogger::info (const std::string& msg)
{ {
level = Info; setLevel() = Info;
printLogLine (msg); printLogLine (msg);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FLogger::warn (const std::string& msg) inline void FLogger::warn (const std::string& msg)
{ {
level = Warn; setLevel() = Warn;
printLogLine (msg); printLogLine (msg);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FLogger::error (const std::string& msg) inline void FLogger::error (const std::string& msg)
{ {
level = Error; setLevel() = Error;
printLogLine (msg); printLogLine (msg);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FLogger::debug (const std::string& msg) inline void FLogger::debug (const std::string& msg)
{ {
level = Debug; setLevel() = Debug;
printLogLine (msg); printLogLine (msg);
} }
@ -123,7 +123,7 @@ inline void FLogger::setOutputStream (const std::ostream& os)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FLogger::setLineEnding (LineEnding eol) inline void FLogger::setLineEnding (LineEnding eol)
{ end_of_line = eol; } { setEnding() = eol; }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FLogger::enableTimestamp() inline void FLogger::enableTimestamp()

View File

@ -228,7 +228,7 @@ int FMessageBox::error ( FWidget* parent
, FString() << message , FString() << message
, button0, button1, button2 , button0, button1, button2
, parent ); , parent );
mbox.beep(); FTerm::beep();
mbox.setHeadline("Warning:"); mbox.setHeadline("Warning:");
mbox.setCenterText(); mbox.setCenterText();
const auto& wc = mbox.getFWidgetColors(); const auto& wc = mbox.getFWidgetColors();

View File

@ -152,7 +152,7 @@ class FScrollbar : public FWidget
sType scroll_type{FScrollbar::noScroll}; sType scroll_type{FScrollbar::noScroll};
bool threshold_reached{false}; bool threshold_reached{false};
int threshold_time{500}; int threshold_time{500};
int repeat_time{10}; int repeat_time{80};
int slider_click_pos{-1}; int slider_click_pos{-1};
int slider_click_stop_pos{-1}; int slider_click_stop_pos{-1};
int current_slider_pos{-1}; int current_slider_pos{-1};
@ -166,7 +166,7 @@ class FScrollbar : public FWidget
double steps{1}; double steps{1};
std::size_t length{20}; std::size_t length{20};
fc::orientation bar_orientation{fc::vertical}; fc::orientation bar_orientation{fc::vertical};
int max_color{getMaxColor()}; int max_color{FTerm::getMaxColor()};
}; };

View File

@ -151,7 +151,7 @@ class FSpinBox : public FWidget
spiningState spining_state{FSpinBox::noSpin}; spiningState spining_state{FSpinBox::noSpin};
bool threshold_reached{false}; bool threshold_reached{false};
int threshold_time{500}; int threshold_time{500};
int repeat_time{10}; int repeat_time{80};
}; };

View File

@ -247,6 +247,8 @@ class FTerm final
static void setFSystem (FSystem*); static void setFSystem (FSystem*);
static void setTermType (const char[]); static void setTermType (const char[]);
static void setInsertCursor (bool); static void setInsertCursor (bool);
static void setInsertCursor();
static void unsetInsertCursor();
static void redefineDefaultColors (bool); static void redefineDefaultColors (bool);
static void setDblclickInterval (const uInt64); static void setDblclickInterval (const uInt64);
static bool setUTF8 (bool); static bool setUTF8 (bool);
@ -412,6 +414,14 @@ inline const FString FTerm::getClassName()
inline void FTerm::setFSystem (FSystem* fsystem) inline void FTerm::setFSystem (FSystem* fsystem)
{ fsys = fsystem; } { fsys = fsystem; }
//----------------------------------------------------------------------
inline void FTerm::setInsertCursor()
{ return setInsertCursor(true); }
//----------------------------------------------------------------------
inline void FTerm::unsetInsertCursor()
{ return setInsertCursor(false); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FTerm::setUTF8() inline bool FTerm::setUTF8()
{ return setUTF8(true); } { return setUTF8(true); }

View File

@ -117,11 +117,13 @@ class FTermFreeBSD final
private: private:
// Methods // Methods
static void warnNotInitialized();
static bool saveFreeBSDAltKey(); static bool saveFreeBSDAltKey();
static bool setFreeBSDAltKey (uInt); static bool setFreeBSDAltKey (uInt);
static bool setFreeBSDAlt2Meta(); static bool setFreeBSDAlt2Meta();
static bool resetFreeBSDAlt2Meta(); static bool resetFreeBSDAlt2Meta();
static bool setFreeBSDCursorStyle (CursorStyle); static bool setFreeBSDCursorStyle (CursorStyle);
static bool isInitialized();
// Data members // Data members
static uInt bsd_alt_keymap; static uInt bsd_alt_keymap;
@ -154,6 +156,10 @@ inline void FTermFreeBSD::enableMetaSendsEscape()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FTermFreeBSD::disableMetaSendsEscape() inline void FTermFreeBSD::disableMetaSendsEscape()
{ meta_sends_escape = false; } { meta_sends_escape = false; }
//----------------------------------------------------------------------
inline bool FTermFreeBSD::isInitialized()
{ return bool(fsystem && fterm_data); }
#endif // defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST) #endif // defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST)
} // namespace finalcut } // namespace finalcut

View File

@ -105,10 +105,12 @@ class FTermOpenBSD final
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST) #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST)
private: private:
// Methods // Methods
static void warnNotInitialized();
static bool saveBSDConsoleEncoding(); static bool saveBSDConsoleEncoding();
static bool setBSDConsoleEncoding (kbd_t); static bool setBSDConsoleEncoding (kbd_t);
static bool setBSDConsoleMetaEsc(); static bool setBSDConsoleMetaEsc();
static bool resetBSDConsoleEncoding(); static bool resetBSDConsoleEncoding();
static bool isInitialized();
// Data members // Data members
static kbd_t bsd_keyboard_encoding; static kbd_t bsd_keyboard_encoding;
@ -131,6 +133,10 @@ inline void FTermOpenBSD::enableMetaSendsEscape()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FTermOpenBSD::disableMetaSendsEscape() inline void FTermOpenBSD::disableMetaSendsEscape()
{ meta_sends_escape = false; } { meta_sends_escape = false; }
//----------------------------------------------------------------------
inline bool FTermOpenBSD::isInitialized()
{ return bool(fsystem); }
#endif // defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST) #endif // defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST)
} // namespace finalcut } // namespace finalcut

View File

@ -110,6 +110,7 @@ class FTermXTerminal final
private: private:
// Methods // Methods
void warnNotInitialized();
void setXTermCursorStyle(); void setXTermCursorStyle();
void setXTermFont(); void setXTermFont();
void setXTermTitle(); void setXTermTitle();
@ -131,6 +132,7 @@ class FTermXTerminal final
void resetXTermMouseForeground(); void resetXTermMouseForeground();
void resetXTermMouseBackground(); void resetXTermMouseBackground();
void resetXTermHighlightBackground(); void resetXTermHighlightBackground();
bool isInitialized();
bool canResetColor(); bool canResetColor();
void oscPrefix(); void oscPrefix();
void oscPostfix(); void oscPostfix();
@ -222,6 +224,10 @@ inline void FTermXTerminal::setMouseSupport()
inline void FTermXTerminal::unsetMouseSupport() inline void FTermXTerminal::unsetMouseSupport()
{ setMouseSupport (false); } { setMouseSupport (false); }
//----------------------------------------------------------------------
inline bool FTermXTerminal::isInitialized()
{ return bool(fsystem && term_detection); }
} // namespace finalcut } // namespace finalcut
#endif // FTERMXTERMINAL_H #endif // FTERMXTERMINAL_H

View File

@ -148,13 +148,6 @@ class FVTerm
const FTermArea* getVWin() const; const FTermArea* getVWin() const;
const FPoint getPrintCursor(); const FPoint getPrintCursor();
static const FChar getAttribute(); static const FChar getAttribute();
static int getMaxColor();
static int getTabstop();
static fc::encoding getEncoding();
static std::string getEncodingString();
static const FString getKeyName (FKey);
static const char* getTermType();
static const char* getTermFileName();
FTerm& getFTerm(); FTerm& getFTerm();
// Mutators // Mutators
@ -237,12 +230,6 @@ class FVTerm
static void setNonBlockingRead(); static void setNonBlockingRead();
static void unsetNonBlockingRead(); static void unsetNonBlockingRead();
static void setTermTitle (const FString&);
static void setEncoding (fc::encoding);
static bool setVGAFont();
static bool setNewFont();
static bool setOldFont();
// Inquiries // Inquiries
static bool isBold(); static bool isBold();
static bool isDim(); static bool isDim();
@ -260,30 +247,6 @@ class FVTerm
static bool isTransparent(); static bool isTransparent();
static bool isTransShadow(); static bool isTransShadow();
static bool isInheritBackground(); static bool isInheritBackground();
static bool isMonochron();
static bool isXTerminal();
static bool isAnsiTerminal();
static bool isRxvtTerminal();
static bool isUrxvtTerminal();
static bool isMltermTerminal();
static bool isPuttyTerminal();
static bool isKdeTerminal();
static bool isGnomeTerminal();
static bool isKtermTerminal();
static bool isTeraTerm();
static bool isSunTerminal();
static bool isCygwinTerminal();
static bool isMinttyTerm();
static bool isLinuxTerm();
static bool isFreeBSDTerm();
static bool isNetBSDTerm();
static bool isOpenBSDTerm();
static bool isScreenTerm();
static bool isTmuxTerm();
static bool isNewFont();
static bool isCursorHideable();
static bool hasChangedTermSize();
static bool hasUTF8();
// Methods // Methods
virtual void clearArea (int = ' '); virtual void clearArea (int = ' ');
@ -312,8 +275,6 @@ class FVTerm
virtual void print (const FColorPair&); virtual void print (const FColorPair&);
virtual FVTerm& print(); virtual FVTerm& print();
static void flush(); static void flush();
static void beep();
static void redefineDefaultColors (bool);
protected: protected:
// Accessor // Accessor
@ -322,26 +283,16 @@ class FVTerm
FTermArea* getCurrentPrintArea() const; FTermArea* getCurrentPrintArea() const;
FTermArea* getVirtualDesktop() const; FTermArea* getVirtualDesktop() const;
FTermArea* getVirtualTerminal() const; FTermArea* getVirtualTerminal() const;
std::size_t getLineNumber();
std::size_t getColumnNumber();
static bool charEncodable (wchar_t);
static FKeyboard* getFKeyboard();
static FMouseControl* getFMouseControl();
// Mutators // Mutators
void setPrintArea (FTermArea*); void setPrintArea (FTermArea*);
void setChildPrintArea (FTermArea*); void setChildPrintArea (FTermArea*);
void setActiveArea (FTermArea*); void setActiveArea (FTermArea*);
static void setInsertCursor (bool);
static void setInsertCursor();
static void unsetInsertCursor();
// Inquiries // Inquiries
bool hasPrintArea() const; bool hasPrintArea() const;
bool hasChildPrintArea() const; bool hasChildPrintArea() const;
bool isVirtualWindow() const; bool isVirtualWindow() const;
static bool hasHalfBlockCharacter();
static bool hasShadowCharacter();
// Methods // Methods
@ -366,13 +317,7 @@ class FVTerm
void processTerminalUpdate(); void processTerminalUpdate();
static void startTerminalUpdate(); static void startTerminalUpdate();
static void finishTerminalUpdate(); static void finishTerminalUpdate();
static void initScreenSettings();
static void changeTermSizeFinished();
static void exitWithMessage (const FString&)
#if defined(__clang__) || defined(__GNUC__)
__attribute__((noreturn))
#endif
;
private: private:
// Enumerations // Enumerations
enum character_type enum character_type
@ -677,40 +622,6 @@ inline const FVTerm::FTermArea* FVTerm::getVWin() const
inline const FChar FVTerm::getAttribute() inline const FChar FVTerm::getAttribute()
{ return next_attribute; } { return next_attribute; }
//----------------------------------------------------------------------
inline int FVTerm::getMaxColor()
{ return FTerm::getMaxColor(); }
//----------------------------------------------------------------------
inline int FVTerm::getTabstop()
{ return FTerm::getTabstop(); }
//----------------------------------------------------------------------
inline fc::encoding FVTerm::getEncoding()
{ return FTerm::getEncoding(); }
//----------------------------------------------------------------------
inline std::string FVTerm::getEncodingString()
{
const std::string& enc_str = FTerm::getEncodingString(); // init enc_str
return enc_str;
}
//----------------------------------------------------------------------
inline const FString FVTerm::getKeyName (FKey keynum)
{
const FString& name = FTerm::getKeyName(keynum); // initialize name
return name;
}
//----------------------------------------------------------------------
inline const char* FVTerm::getTermType()
{ return FTerm::getTermType(); }
//----------------------------------------------------------------------
inline const char* FVTerm::getTermFileName()
{ return FTerm::getTermFileName(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FTerm& FVTerm::getFTerm() inline FTerm& FVTerm::getFTerm()
{ return *fterm; } { return *fterm; }
@ -942,26 +853,6 @@ inline void FVTerm::setNonBlockingRead()
inline void FVTerm::unsetNonBlockingRead() inline void FVTerm::unsetNonBlockingRead()
{ setNonBlockingRead(false); } { setNonBlockingRead(false); }
//----------------------------------------------------------------------
inline void FVTerm::setTermTitle (const FString& title)
{ FTerm::setTermTitle(title); }
//----------------------------------------------------------------------
inline void FVTerm::setEncoding (fc::encoding enc)
{ FTerm::setEncoding(enc); }
//----------------------------------------------------------------------
inline bool FVTerm::setVGAFont()
{ return FTerm::setVGAFont(); }
//----------------------------------------------------------------------
inline bool FVTerm::setNewFont()
{ return FTerm::setNewFont(); }
//----------------------------------------------------------------------
inline bool FVTerm::setOldFont()
{ return FTerm::setOldFont(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::isBold() inline bool FVTerm::isBold()
{ return next_attribute.attr.bit.bold; } { return next_attribute.attr.bit.bold; }
@ -1026,102 +917,6 @@ inline bool FVTerm::isTransShadow()
inline bool FVTerm::isInheritBackground() inline bool FVTerm::isInheritBackground()
{ return next_attribute.attr.bit.inherit_background; } { return next_attribute.attr.bit.inherit_background; }
//----------------------------------------------------------------------
inline bool FVTerm::isMonochron()
{ return FTerm::isMonochron(); }
//----------------------------------------------------------------------
inline bool FVTerm::isXTerminal()
{ return FTerm::isXTerminal(); }
//----------------------------------------------------------------------
inline bool FVTerm::isAnsiTerminal()
{ return FTerm::isAnsiTerminal(); }
//----------------------------------------------------------------------
inline bool FVTerm::isRxvtTerminal()
{ return FTerm::isRxvtTerminal(); }
//----------------------------------------------------------------------
inline bool FVTerm::isUrxvtTerminal()
{ return FTerm::isUrxvtTerminal(); }
//----------------------------------------------------------------------
inline bool FVTerm::isMltermTerminal()
{ return FTerm::isMltermTerminal(); }
//----------------------------------------------------------------------
inline bool FVTerm::isPuttyTerminal()
{ return FTerm::isPuttyTerminal(); }
//----------------------------------------------------------------------
inline bool FVTerm::isKdeTerminal()
{ return FTerm::isKdeTerminal(); }
//----------------------------------------------------------------------
inline bool FVTerm::isGnomeTerminal()
{ return FTerm::isGnomeTerminal(); }
//----------------------------------------------------------------------
inline bool FVTerm::isKtermTerminal()
{ return FTerm::isKtermTerminal(); }
//----------------------------------------------------------------------
inline bool FVTerm::isTeraTerm()
{ return FTerm::isTeraTerm(); }
//----------------------------------------------------------------------
inline bool FVTerm::isSunTerminal()
{ return FTerm::isSunTerminal(); }
//----------------------------------------------------------------------
inline bool FVTerm::isCygwinTerminal()
{ return FTerm::isCygwinTerminal(); }
//----------------------------------------------------------------------
inline bool FVTerm::isMinttyTerm()
{ return FTerm::isMinttyTerm(); }
//----------------------------------------------------------------------
inline bool FVTerm::isLinuxTerm()
{ return FTerm::isLinuxTerm(); }
//----------------------------------------------------------------------
inline bool FVTerm::isFreeBSDTerm()
{ return FTerm::isFreeBSDTerm(); }
//----------------------------------------------------------------------
inline bool FVTerm::isNetBSDTerm()
{ return FTerm::isNetBSDTerm(); }
//----------------------------------------------------------------------
inline bool FVTerm::isOpenBSDTerm()
{ return FTerm::isOpenBSDTerm(); }
//----------------------------------------------------------------------
inline bool FVTerm::isScreenTerm()
{ return FTerm::isScreenTerm(); }
//----------------------------------------------------------------------
inline bool FVTerm::isTmuxTerm()
{ return FTerm::isTmuxTerm(); }
//----------------------------------------------------------------------
inline bool FVTerm::isNewFont()
{ return FTerm::isNewFont(); }
//----------------------------------------------------------------------
inline bool FVTerm::isCursorHideable()
{ return FTerm::isCursorHideable(); }
//----------------------------------------------------------------------
inline bool FVTerm::hasChangedTermSize()
{ return FTerm::hasChangedTermSize(); }
//----------------------------------------------------------------------
inline bool FVTerm::hasUTF8()
{ return FTerm::hasUTF8(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
template<typename... Args> template<typename... Args>
inline int FVTerm::printf (const FString& format, Args&&... args) inline int FVTerm::printf (const FString& format, Args&&... args)
@ -1135,14 +930,6 @@ inline int FVTerm::printf (const FString& format, Args&&... args)
inline FVTerm& FVTerm::print() inline FVTerm& FVTerm::print()
{ return *this; } { return *this; }
//----------------------------------------------------------------------
inline void FVTerm::beep()
{ FTerm::beep(); }
//----------------------------------------------------------------------
inline void FVTerm::redefineDefaultColors (bool enable)
{ FTerm::redefineDefaultColors(enable); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline FVTerm::FTermArea* FVTerm::getChildPrintArea() const inline FVTerm::FTermArea* FVTerm::getChildPrintArea() const
{ return child_print_area; } { return child_print_area; }
@ -1159,26 +946,6 @@ inline FVTerm::FTermArea* FVTerm::getVirtualDesktop() const
inline FVTerm::FTermArea* FVTerm::getVirtualTerminal() const inline FVTerm::FTermArea* FVTerm::getVirtualTerminal() const
{ return vterm; } { return vterm; }
//----------------------------------------------------------------------
inline std::size_t FVTerm::getLineNumber()
{ return FTerm::getLineNumber(); }
//----------------------------------------------------------------------
inline std::size_t FVTerm::getColumnNumber()
{ return FTerm::getColumnNumber(); }
//----------------------------------------------------------------------
inline bool FVTerm::charEncodable (wchar_t c)
{ return FTerm::charEncodable(c); }
//----------------------------------------------------------------------
inline FKeyboard* FVTerm::getFKeyboard()
{ return FTerm::getFKeyboard(); }
//----------------------------------------------------------------------
inline FMouseControl* FVTerm::getFMouseControl()
{ return FTerm::getFMouseControl(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline void FVTerm::setPrintArea (FTermArea* area) inline void FVTerm::setPrintArea (FTermArea* area)
{ print_area = area; } { print_area = area; }
@ -1191,18 +958,6 @@ inline void FVTerm::setChildPrintArea (FTermArea* area)
inline void FVTerm::setActiveArea (FTermArea* area) inline void FVTerm::setActiveArea (FTermArea* area)
{ active_area = area; } { active_area = area; }
//----------------------------------------------------------------------
inline void FVTerm::setInsertCursor (bool enable)
{ return FTerm::setInsertCursor(enable); }
//----------------------------------------------------------------------
inline void FVTerm::setInsertCursor()
{ return FTerm::setInsertCursor(true); }
//----------------------------------------------------------------------
inline void FVTerm::unsetInsertCursor()
{ return FTerm::setInsertCursor(false); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FVTerm::hasPrintArea() const inline bool FVTerm::hasPrintArea() const
{ return print_area; } { return print_area; }
@ -1215,25 +970,6 @@ inline bool FVTerm::hasChildPrintArea() const
inline bool FVTerm::isVirtualWindow() const inline bool FVTerm::isVirtualWindow() const
{ return vwin; } { return vwin; }
//----------------------------------------------------------------------
inline bool FVTerm::hasHalfBlockCharacter()
{ return FTerm::hasHalfBlockCharacter(); }
//----------------------------------------------------------------------
inline bool FVTerm::hasShadowCharacter()
{ return FTerm::hasShadowCharacter(); }
//----------------------------------------------------------------------
inline void FVTerm::initScreenSettings()
{ FTerm::initScreenSettings(); }
//----------------------------------------------------------------------
inline void FVTerm::changeTermSizeFinished()
{ FTerm::changeTermSizeFinished(); }
//----------------------------------------------------------------------
inline void FVTerm::exitWithMessage (const FString& message)
{ FTerm::exitWithMessage(message); }
} // namespace finalcut } // namespace finalcut

View File

@ -798,11 +798,11 @@ inline const FRect& FWidget::getTermGeometryWithShadow()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline std::size_t FWidget::getDesktopWidth() inline std::size_t FWidget::getDesktopWidth()
{ return getColumnNumber(); } { return FTerm::getColumnNumber(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline std::size_t FWidget::getDesktopHeight() inline std::size_t FWidget::getDesktopHeight()
{ return getLineNumber(); } { return FTerm::getLineNumber(); }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline const FWidget::FWidgetFlags& FWidget::getFlags() const inline const FWidget::FWidgetFlags& FWidget::getFlags() const