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>
* The new class FLogger for logging, which can be redirected
to different I/O channels

View File

@ -278,7 +278,7 @@ Calc::Calc (FWidget* parent)
btn->setDoubleFlatLine(fc::top);
btn->setDoubleFlatLine(fc::bottom);
if ( isNewFont() )
if ( finalcut::FTerm::isNewFont() )
btn->unsetClickAnimation();
btn->addCallback
@ -421,7 +421,7 @@ void Calc::drawDispay()
if ( error )
display = " Error ";
if ( isMonochron() )
if ( finalcut::FTerm::isMonochron() )
setReverse(false);
const auto& wc = getFWidgetColors();
@ -429,10 +429,10 @@ void Calc::drawDispay()
<< FPoint{3, 3} << display << ' '
<< FColorPair{wc.dialog_fg, wc.dialog_bg};
if ( isMonochron() )
if ( finalcut::FTerm::isMonochron() )
setReverse(true);
if ( isNewFont() )
if ( finalcut::FTerm::isNewFont() )
{
const wchar_t bottom_line {fc::NF_border_line_bottom};
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
// (CERT, OOP50-CPP)
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}
, FSize{28 + nf_offset, 13} );
setShadow();

View File

@ -160,7 +160,7 @@ void EventDialog::onTimer (finalcut::FTimerEvent*)
void EventDialog::onKeyPress (finalcut::FKeyEvent* ev)
{
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() )
key_name = wchar_t(key_id);

View File

@ -54,7 +54,7 @@ Keyboard::Keyboard (finalcut::FWidget* parent)
void Keyboard::onKeyPress (finalcut::FKeyEvent* ev)
{
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};
if ( key_name.isEmpty() )

View File

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

View File

@ -157,7 +157,7 @@ int main (int argc, char* argv[])
TermApp.clearArea();
// 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 << " 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()
{
finalcut::FString term_type = getTermType();
finalcut::FString term_type = finalcut::FTerm::getTermType();
finalcut::FString dimension_str{};
finalcut::FString time_str{};
finalcut::FString fps_str{};

View File

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

View File

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

View File

@ -300,7 +300,7 @@ int main (int argc, char* argv[])
finalcut::FApplication TermApp {argc, argv, disable_alt_screen};
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);

View File

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

View File

@ -810,12 +810,12 @@ void MyDialog::cb_terminfo (const finalcut::FWidget*, const FDataPtr)
(
"Environment"
, finalcut::FString{}
<< " Type: " << getTermType() << "\n"
<< " Name: " << getTermFileName() << "\n"
<< " Mode: " << getEncodingString() << "\n"
<< " Type: " << finalcut::FTerm::getTermType() << "\n"
<< " Name: " << finalcut::FTerm::getTermFileName() << "\n"
<< " Mode: " << finalcut::FTerm::getEncodingString() << "\n"
<< " Size: " << x << fc::Times
<< y << "\n"
<< "Colors: " << getMaxColor()
<< "Colors: " << finalcut::FTerm::getMaxColor()
, finalcut::FMessageBox::Ok, 0, 0, this
);
info1.setHeadline("Terminal:");
@ -834,7 +834,7 @@ void MyDialog::cb_drives (const finalcut::FWidget*, const FDataPtr)
, finalcut::FMessageBox::Ok, 0, 0, this
);
if ( isNewFont() )
if ( finalcut::FTerm::isNewFont() )
{
finalcut::FLabel drive {finalcut::NF_Drive, &info2};
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};
cd.setGeometry (FPoint{11, 6}, FSize{4, 1});
if ( isMonochron() )
if ( finalcut::FTerm::isMonochron() )
{
net.setReverseMode();
drive.setReverseMode();
@ -917,7 +917,7 @@ void MyDialog::cb_setTitlebar (finalcut::FWidget* widget, const FDataPtr)
auto& lineedit = *(static_cast<finalcut::FLineEdit*>(widget));
finalcut::FString title{};
lineedit >> title;
setTermTitle (title);
finalcut::FTerm::setTermTitle (title);
setText (title);
redraw();
}
@ -1021,17 +1021,17 @@ int main (int argc, char* argv[])
// Create the application object app
finalcut::FApplication app{argc, argv};
app.setNonBlockingRead();
app.redefineDefaultColors(true);
app.setTermTitle (title);
finalcut::FTerm::redefineDefaultColors(true);
finalcut::FTerm::setTermTitle (title);
// Force vt100 encoding
//app.setEncoding(finalcut::fc::VT100);
//finalcut::FTerm::setEncoding(finalcut::fc::VT100);
// Sets the terminal size to 94×30
//finalcut::FTerm::setTermSize(FSize{94, 30});
// Enable the final cut graphical font
//app.setNewFont();
//finalcut::FTerm::setNewFont();
// Create main dialog object d
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)
{
// Initialize keyboard
keyboard = FVTerm::getFKeyboard();
keyboard = FTerm::getFKeyboard();
// Set the keyboard keypress timeout
if ( keyboard )
@ -356,7 +356,7 @@ void FApplication::init (uInt64 key_time, uInt64 dblclick_time)
}
// Initialize mouse control
mouse = FVTerm::getFMouseControl();
mouse = FTerm::getFMouseControl();
// Set stdin number for a gpm-mouse
if ( mouse )
@ -424,8 +424,8 @@ void FApplication::cmd_options (const int& argc, char* argv[])
else if ( encoding.includes("help") )
showParameterUsage();
else
exitWithMessage ( "Unknown encoding "
+ std::string(encoding.c_str()) );
FTerm::exitWithMessage ( "Unknown encoding "
+ std::string(encoding.c_str()) );
}
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);
// gnome-terminal sends no released on middle click
if ( isGnomeTerminal() )
if ( FTerm::isGnomeTerminal() )
setClickedWidget(nullptr);
}
else if ( mouse->isMiddleButtonReleased() )
@ -1076,7 +1076,7 @@ void FApplication::processMouseEvent()
//----------------------------------------------------------------------
void FApplication::processResizeEvent()
{
if ( ! hasChangedTermSize() )
if ( ! FTerm::hasChangedTermSize() )
return;
if ( mouse )
@ -1089,7 +1089,7 @@ void FApplication::processResizeEvent()
sendEvent(app_object, &r_ev);
if ( r_ev.isAccepted() )
changeTermSizeFinished();
FTerm::changeTermSizeFinished();
}
//----------------------------------------------------------------------

View File

@ -165,8 +165,8 @@ bool FButton::setFlat (bool enable)
bool FButton::setShadow (bool enable)
{
if ( enable
&& getEncoding() != fc::VT100
&& getEncoding() != fc::ASCII )
&& FTerm::getEncoding() != fc::VT100
&& FTerm::getEncoding() != fc::ASCII )
{
setFlags().shadow = true;
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)
{
if ( button_down || isNewFont() )
if ( button_down || FTerm::isNewFont() )
return;
// 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++)
{
if ( isMonochron() )
if ( FTerm::isMonochron() )
setReverse(true); // Light background
print() << FPoint{1 + int(getWidth()), y} << ' '; // clear right
if ( getFlags().active && isMonochron() )
if ( getFlags().active && FTerm::isMonochron() )
setReverse(false); // Dark background
}
}
@ -470,7 +470,7 @@ inline void FButton::drawMarginLeft()
{
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); // ►
else
print (space_char); // full block █
@ -486,7 +486,7 @@ inline void FButton::drawMarginRight()
{
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); // ◄
else
print (space_char); // full block █
@ -543,10 +543,10 @@ inline void FButton::drawButtonTextLine (const FString& button_text)
setCursorPos ({ 2 + int(center_offset + hotkeypos)
, 1 + int(vcenter_offset) }); // hotkey
if ( ! getFlags().active && isMonochron() )
if ( ! getFlags().active && FTerm::isMonochron() )
setReverse(true); // Light background
if ( active_focus && (isMonochron() || getMaxColor() < 16) )
if ( active_focus && (FTerm::isMonochron() || FTerm::getMaxColor() < 16) )
setBold();
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);
if ( ! active_focus && getMaxColor() < 16 )
if ( ! active_focus && FTerm::getMaxColor() < 16 )
setBold();
if ( ! getFlags().no_underline )
@ -563,7 +563,7 @@ inline void FButton::drawButtonTextLine (const FString& button_text)
print (button_text[z]);
if ( ! active_focus && getMaxColor() < 16 )
if ( ! active_focus && FTerm::getMaxColor() < 16 )
unsetBold();
if ( ! getFlags().no_underline )
@ -588,7 +588,7 @@ inline void FButton::drawButtonTextLine (const FString& button_text)
print() << FPoint{int(getWidth() + indent) - 2, 1} << "..";
}
if ( active_focus && (isMonochron() || getMaxColor() < 16) )
if ( active_focus && (FTerm::isMonochron() || FTerm::getMaxColor() < 16) )
unsetBold();
for (pos = center_offset + column_width; pos < getWidth() - 2; pos++)
@ -604,7 +604,7 @@ void FButton::draw()
space_char = int(' ');
active_focus = getFlags().active && getFlags().focus;
if ( isMonochron() )
if ( FTerm::isMonochron() )
setReverse(true); // Light background
// Click animation preprocessing
@ -613,10 +613,10 @@ void FButton::draw()
// Clear right margin after animation
clearRightMargin (parent_widget);
if ( ! getFlags().active && isMonochron() )
if ( ! getFlags().active && FTerm::isMonochron() )
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
if ( getFlags().flat && ! button_down )
@ -648,7 +648,7 @@ void FButton::draw()
if ( ! getFlags().flat && getFlags().shadow && ! button_down )
drawShadow(this);
if ( isMonochron() )
if ( FTerm::isMonochron() )
setReverse(false); // Dark background
updateStatusBar();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
* *
* 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 *
* modify it under the terms of the GNU Lesser General Public License *
@ -20,13 +20,22 @@
* <http://www.gnu.org/licenses/>. *
***********************************************************************/
#include "final/fapplication.h"
#include "final/fcharmap.h"
#include "final/flog.h"
#include "final/fsystem.h"
#include "final/fterm.h"
#include "final/ftermdata.h"
#include "final/ftermfreebsd.h"
#include "final/ftypes.h"
#define initCheck(ret_value) \
if ( ! isInitialized() ) \
{ \
warnNotInitialized(); \
return ret_value; \
}
namespace finalcut
{
@ -58,12 +67,14 @@ bool FTermFreeBSD::setCursorStyle (CursorStyle style)
{
// Set cursor style in a BSD console
if ( ! fsystem || ! isFreeBSDConsole() || ! change_cursorstyle )
return false;
if ( ! fterm_data )
fterm_data = FTerm::getFTermData();
initCheck(false);
if ( ! fsystem || ! isFreeBSDConsole() || ! change_cursorstyle )
return false;
cursor_style = style;
if ( fterm_data->isCursorHidden() )
@ -177,6 +188,16 @@ void FTermFreeBSD::finish()
// 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()
{
@ -185,9 +206,8 @@ bool FTermFreeBSD::saveFreeBSDAltKey()
static constexpr int left_alt = 0x38;
int ret{-1};
keymap_t keymap{};
if ( fsystem )
ret = fsystem->ioctl (0, GIO_KEYMAP, &keymap);
initCheck(false);
ret = fsystem->ioctl (0, GIO_KEYMAP, &keymap);
if ( ret < 0 )
return false;
@ -205,9 +225,8 @@ bool FTermFreeBSD::setFreeBSDAltKey (uInt key)
static constexpr int left_alt = 0x38;
int ret{-1};
keymap_t keymap{};
if ( fsystem )
ret = fsystem->ioctl (0, GIO_KEYMAP, &keymap);
initCheck(false);
ret = fsystem->ioctl (0, GIO_KEYMAP, &keymap);
if ( ret < 0 )
return false;
@ -241,6 +260,8 @@ bool FTermFreeBSD::resetFreeBSDAlt2Meta()
//----------------------------------------------------------------------
bool FTermFreeBSD::setFreeBSDCursorStyle (CursorStyle style)
{
initCheck(false);
if ( fsystem->ioctl(0, CONS_CURSORTYPE, &style) == 0 )
return true;
else

View File

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

View File

@ -3,7 +3,7 @@
* *
* 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 *
* modify it under the terms of the GNU Lesser General Public License *
@ -20,10 +20,19 @@
* <http://www.gnu.org/licenses/>. *
***********************************************************************/
#include "final/fapplication.h"
#include "final/flog.h"
#include "final/fsystem.h"
#include "final/fterm.h"
#include "final/ftermopenbsd.h"
#define initCheck(ret_value) \
if ( ! isInitialized() ) \
{ \
warnNotInitialized(); \
return ret_value; \
}
namespace finalcut
{
@ -86,6 +95,8 @@ void FTermOpenBSD::init()
//----------------------------------------------------------------------
void FTermOpenBSD::finish()
{
initCheck();
if ( ! isBSDConsole() )
return;
@ -96,6 +107,8 @@ void FTermOpenBSD::finish()
//----------------------------------------------------------------------
bool FTermOpenBSD::setBeep (int Hz, int ms)
{
initCheck(false);
if ( ! isBSDConsole() )
return false;
@ -122,6 +135,7 @@ bool FTermOpenBSD::setBeep (int Hz, int ms)
//----------------------------------------------------------------------
bool FTermOpenBSD::resetBeep()
{
initCheck(false);
wskbd_bell_data default_bell;
// Gets the default setting for the bell
@ -141,6 +155,16 @@ bool FTermOpenBSD::resetBeep()
// 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()
{

View File

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

View File

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

View File

@ -123,8 +123,8 @@ void FVTerm::setTermXY (int x, int y)
if ( term_pos->getX() == x && term_pos->getY() == y )
return;
const int term_width = int(getColumnNumber());
const int term_height = int(getLineNumber());
const int term_width = int(FTerm::getColumnNumber());
const int term_height = int(FTerm::getLineNumber());
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 len{0};
const uInt tabstop = uInt(getTabstop());
const uInt tabstop = uInt(FTerm::getTabstop());
if ( ! area )
return -1;
@ -447,7 +447,7 @@ int FVTerm::print (FTermArea* area, const std::vector<FChar>& term_string)
break;
case '\a':
beep();
FTerm::beep();
break;
default:
@ -1929,7 +1929,7 @@ void FVTerm::init (bool disable_alt_screen)
std::memcpy (&next_attribute, &term_attribute, sizeof(next_attribute));
// Create virtual terminal
FRect term_geometry {0, 0, getColumnNumber(), getLineNumber()};
FRect term_geometry {0, 0, FTerm::getColumnNumber(), FTerm::getLineNumber()};
createVTerm (term_geometry.getSize());
// Create virtual desktop area
@ -2121,7 +2121,7 @@ bool FVTerm::clearTerm (int fillchar)
{
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);
appendOutputBuffer (cb);
@ -2754,7 +2754,7 @@ void FVTerm::printPaddingCharacter (FTermArea* area, const FChar& term_char)
// Copy character to padding character
std::memcpy (&pc, &term_char, sizeof(pc));
if ( getEncoding() == fc::UTF8 )
if ( FTerm::getEncoding() == fc::UTF8 )
{
pc.ch = 0;
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
const FRect term_geometry {0, 0, getColumnNumber(), getLineNumber()};
const FRect term_geometry {0, 0, FTerm::getColumnNumber(), FTerm::getLineNumber()};
if ( term_geometry.contains(pos) )
return true;
@ -2911,7 +2911,7 @@ inline void FVTerm::markAsPrinted (uInt from, uInt to, uInt line)
inline void FVTerm::newFontChanges (FChar*& next_char)
{
// NewFont special cases
if ( ! isNewFont() )
if ( ! FTerm::isNewFont() )
return;
if ( next_char->ch == fc::LowerHalfBlock )
@ -2929,7 +2929,7 @@ inline void FVTerm::charsetChanges (FChar*& next_char)
const wchar_t& ch = next_char->ch;
next_char->encoded_char = ch;
if ( getEncoding() == fc::UTF8 )
if ( FTerm::getEncoding() == fc::UTF8 )
return;
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;
if ( getEncoding() == fc::VT100 )
if ( FTerm::getEncoding() == fc::VT100 )
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;
if ( isPuttyTerminal() )
if ( FTerm::isPuttyTerminal() )
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));
else
{
@ -3028,8 +3028,8 @@ int FVTerm::appendLowerRight (FChar*& screen_char)
const auto& ip = TCAP(fc::t_insert_padding);
const auto& ic = TCAP(fc::t_insert_character);
const int x = int(getColumnNumber()) - 2;
const int y = int(getLineNumber()) - 1;
const int x = int(FTerm::getColumnNumber()) - 2;
const int y = int(FTerm::getLineNumber()) - 1;
setTermXY (x, y);
appendChar (screen_char);
term_pos->x_ref()++;

View File

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

View File

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

View File

@ -184,7 +184,7 @@ bool FWindow::setTransparentShadow (bool enable)
//----------------------------------------------------------------------
bool FWindow::setShadow (bool enable)
{
if ( isMonochron() )
if ( FTerm::isMonochron() )
return false;
if ( enable )
@ -239,7 +239,7 @@ bool FWindow::isWindowHidden() const
//----------------------------------------------------------------------
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()};
print() << r.getUpperLeftPos()

View File

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

View File

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

View File

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

View File

@ -152,7 +152,7 @@ class FScrollbar : public FWidget
sType scroll_type{FScrollbar::noScroll};
bool threshold_reached{false};
int threshold_time{500};
int repeat_time{10};
int repeat_time{80};
int slider_click_pos{-1};
int slider_click_stop_pos{-1};
int current_slider_pos{-1};
@ -166,7 +166,7 @@ class FScrollbar : public FWidget
double steps{1};
std::size_t length{20};
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};
bool threshold_reached{false};
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 setTermType (const char[]);
static void setInsertCursor (bool);
static void setInsertCursor();
static void unsetInsertCursor();
static void redefineDefaultColors (bool);
static void setDblclickInterval (const uInt64);
static bool setUTF8 (bool);
@ -412,6 +414,14 @@ inline const FString FTerm::getClassName()
inline void FTerm::setFSystem (FSystem* fsystem)
{ fsys = fsystem; }
//----------------------------------------------------------------------
inline void FTerm::setInsertCursor()
{ return setInsertCursor(true); }
//----------------------------------------------------------------------
inline void FTerm::unsetInsertCursor()
{ return setInsertCursor(false); }
//----------------------------------------------------------------------
inline bool FTerm::setUTF8()
{ return setUTF8(true); }

View File

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

View File

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

View File

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

View File

@ -148,13 +148,6 @@ class FVTerm
const FTermArea* getVWin() const;
const FPoint getPrintCursor();
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();
// Mutators
@ -237,12 +230,6 @@ class FVTerm
static void setNonBlockingRead();
static void unsetNonBlockingRead();
static void setTermTitle (const FString&);
static void setEncoding (fc::encoding);
static bool setVGAFont();
static bool setNewFont();
static bool setOldFont();
// Inquiries
static bool isBold();
static bool isDim();
@ -260,30 +247,6 @@ class FVTerm
static bool isTransparent();
static bool isTransShadow();
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
virtual void clearArea (int = ' ');
@ -312,8 +275,6 @@ class FVTerm
virtual void print (const FColorPair&);
virtual FVTerm& print();
static void flush();
static void beep();
static void redefineDefaultColors (bool);
protected:
// Accessor
@ -322,26 +283,16 @@ class FVTerm
FTermArea* getCurrentPrintArea() const;
FTermArea* getVirtualDesktop() const;
FTermArea* getVirtualTerminal() const;
std::size_t getLineNumber();
std::size_t getColumnNumber();
static bool charEncodable (wchar_t);
static FKeyboard* getFKeyboard();
static FMouseControl* getFMouseControl();
// Mutators
void setPrintArea (FTermArea*);
void setChildPrintArea (FTermArea*);
void setActiveArea (FTermArea*);
static void setInsertCursor (bool);
static void setInsertCursor();
static void unsetInsertCursor();
// Inquiries
bool hasPrintArea() const;
bool hasChildPrintArea() const;
bool isVirtualWindow() const;
static bool hasHalfBlockCharacter();
static bool hasShadowCharacter();
// Methods
@ -366,13 +317,7 @@ class FVTerm
void processTerminalUpdate();
static void startTerminalUpdate();
static void finishTerminalUpdate();
static void initScreenSettings();
static void changeTermSizeFinished();
static void exitWithMessage (const FString&)
#if defined(__clang__) || defined(__GNUC__)
__attribute__((noreturn))
#endif
;
private:
// Enumerations
enum character_type
@ -677,40 +622,6 @@ inline const FVTerm::FTermArea* FVTerm::getVWin() const
inline const FChar FVTerm::getAttribute()
{ 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()
{ return *fterm; }
@ -942,26 +853,6 @@ inline void FVTerm::setNonBlockingRead()
inline void FVTerm::unsetNonBlockingRead()
{ 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()
{ return next_attribute.attr.bit.bold; }
@ -1026,102 +917,6 @@ inline bool FVTerm::isTransShadow()
inline bool FVTerm::isInheritBackground()
{ 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>
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()
{ return *this; }
//----------------------------------------------------------------------
inline void FVTerm::beep()
{ FTerm::beep(); }
//----------------------------------------------------------------------
inline void FVTerm::redefineDefaultColors (bool enable)
{ FTerm::redefineDefaultColors(enable); }
//----------------------------------------------------------------------
inline FVTerm::FTermArea* FVTerm::getChildPrintArea() const
{ return child_print_area; }
@ -1159,26 +946,6 @@ inline FVTerm::FTermArea* FVTerm::getVirtualDesktop() const
inline FVTerm::FTermArea* FVTerm::getVirtualTerminal() const
{ 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)
{ print_area = area; }
@ -1191,18 +958,6 @@ inline void FVTerm::setChildPrintArea (FTermArea* area)
inline void FVTerm::setActiveArea (FTermArea* 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
{ return print_area; }
@ -1215,25 +970,6 @@ inline bool FVTerm::hasChildPrintArea() const
inline bool FVTerm::isVirtualWindow() const
{ 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

View File

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