Using namespace aliases finalcut::fc in some exemple programs

This commit is contained in:
Markus Gans 2019-04-26 21:06:04 +02:00
parent e3b226b10d
commit 7f206e88f0
18 changed files with 273 additions and 258 deletions

View File

@ -1,5 +1,6 @@
#include <final/final.h>
namespace fc = finalcut::fc;
using finalcut::FColorPair;
using finalcut::FPoint;
using finalcut::FSize;
@ -169,12 +170,12 @@ void SegmentView::draw()
finalcut::FTermBuffer left_space{};
FDialog::draw();
setColor(finalcut::fc::LightGray, finalcut::fc::Black);
setColor(fc::LightGray, fc::Black);
FWidget::drawBorder(3, 6, 40, 11);
for (auto&& ch : Input.getText().toUpper())
{
FColorPair color(finalcut::fc::LightRed, finalcut::fc::Black);
FColorPair color(fc::LightRed, fc::Black);
get7Segment(ch);
for (std::size_t i = 0; i < 3; i++)

View File

@ -30,6 +30,7 @@
#include <final/final.h>
namespace fc = finalcut::fc;
using finalcut::FPoint;
using finalcut::FSize;
using finalcut::FColorPair;
@ -77,9 +78,9 @@ void Button::setChecked (bool enable)
if ( checked )
{
setBackgroundColor(finalcut::fc::Cyan);
setFocusForegroundColor(finalcut::fc::White);
setFocusBackgroundColor(finalcut::fc::Cyan);
setBackgroundColor(fc::Cyan);
setFocusForegroundColor(fc::White);
setFocusBackgroundColor(fc::Cyan);
}
else
{
@ -97,8 +98,7 @@ void Button::onKeyPress (finalcut::FKeyEvent* ev)
FKey key = ev->key();
// catch the enter key
if ( key == finalcut::fc::Fkey_return
|| key == finalcut::fc::Fkey_enter )
if ( key == fc::Fkey_return || key == fc::Fkey_enter )
return;
finalcut::FButton::onKeyPress(ev);
@ -275,8 +275,8 @@ Calc::Calc (FWidget* parent)
btn->setFlat();
btn->setNoUnderline();
btn->setText(getButtonText(key));
btn->setDoubleFlatLine(finalcut::fc::top);
btn->setDoubleFlatLine(finalcut::fc::bottom);
btn->setDoubleFlatLine(fc::top);
btn->setDoubleFlatLine(fc::bottom);
if ( isNewFont() )
btn->unsetClickAnimation();
@ -291,7 +291,7 @@ Calc::Calc (FWidget* parent)
calculator_buttons[button(key)] = btn;
}
calculator_buttons[On]->addAccelerator(finalcut::fc::Fkey_dc); // Del key
calculator_buttons[On]->addAccelerator(fc::Fkey_dc); // Del key
calculator_buttons[On]->setFocus();
calculator_buttons[Pi]->addAccelerator('p');
calculator_buttons[Power]->addAccelerator('^');
@ -300,8 +300,8 @@ Calc::Calc (FWidget* parent)
calculator_buttons[Multiply]->addAccelerator('*');
calculator_buttons[Decimal_point]->addAccelerator(',');
calculator_buttons[Change_sign]->addAccelerator('#');
calculator_buttons[Equals]->addAccelerator(finalcut::fc::Fkey_return);
calculator_buttons[Equals]->addAccelerator(finalcut::fc::Fkey_enter);
calculator_buttons[Equals]->addAccelerator(fc::Fkey_return);
calculator_buttons[Equals]->addAccelerator(fc::Fkey_enter);
}
//----------------------------------------------------------------------
@ -337,7 +337,7 @@ void Calc::drawDispay()
if ( isMonochron() )
setReverse(false);
print() << FColorPair(finalcut::fc::Black, finalcut::fc::LightGray)
print() << FColorPair(fc::Black, fc::LightGray)
<< FPoint(3, 3) << display << ' '
<< FColorPair(wc.dialog_fg, wc.dialog_bg);
@ -346,11 +346,11 @@ void Calc::drawDispay()
if ( isNewFont() )
{
wchar_t bottom_line = finalcut::fc::NF_border_line_bottom;
wchar_t top_bottom_line = finalcut::fc::NF_border_line_up_and_down;
wchar_t top_line = finalcut::fc::NF_border_line_upper;
wchar_t right_line = finalcut::fc::NF_rev_border_line_right;
wchar_t left_line = finalcut::fc::NF_border_line_left;
wchar_t bottom_line = fc::NF_border_line_bottom;
wchar_t top_bottom_line = fc::NF_border_line_up_and_down;
wchar_t top_line = fc::NF_border_line_upper;
wchar_t right_line = fc::NF_rev_border_line_right;
wchar_t left_line = fc::NF_border_line_left;
print() << FPoint(3, 2) << finalcut::FString(33, bottom_line);
print() << FPoint(2, 3) << right_line;
print() << FPoint(36, 3) << left_line;
@ -365,9 +365,9 @@ void Calc::drawDispay()
}
else
{
wchar_t vertical_and_right = finalcut::fc::BoxDrawingsVerticalAndRight;
wchar_t horizontal = finalcut::fc::BoxDrawingsHorizontal;
wchar_t vertical_and_left = finalcut::fc::BoxDrawingsVerticalAndLeft;
wchar_t vertical_and_right = fc::BoxDrawingsVerticalAndRight;
wchar_t horizontal = fc::BoxDrawingsHorizontal;
wchar_t vertical_and_left = fc::BoxDrawingsVerticalAndLeft;
finalcut::FString separator = finalcut::FString(vertical_and_right)
+ finalcut::FString(35, horizontal)
+ finalcut::FString(vertical_and_left);
@ -838,8 +838,8 @@ void Calc::tangent (lDouble& x)
void Calc::draw()
{
setBold();
setColor (finalcut::fc::Blue, finalcut::fc::Cyan);
clearArea (vdesktop, finalcut::fc::MediumShade);
setColor (fc::Blue, fc::Cyan);
clearArea (vdesktop, fc::MediumShade);
unsetBold();
finalcut::FDialog::draw();
drawDispay();
@ -995,8 +995,8 @@ void Calc::onKeyPress (finalcut::FKeyEvent* ev)
switch ( key )
{
case finalcut::fc::Fkey_erase:
case finalcut::fc::Fkey_backspace:
case fc::Fkey_erase:
case fc::Fkey_backspace:
if ( len > 0 )
{
lDouble& x = getValue();
@ -1019,10 +1019,10 @@ void Calc::onKeyPress (finalcut::FKeyEvent* ev)
ev->accept();
break;
case finalcut::fc::Fkey_escape:
case finalcut::fc::Fkey_escape_mintty:
case fc::Fkey_escape:
case fc::Fkey_escape_mintty:
{
finalcut::FAccelEvent a_ev( finalcut::fc::Accelerator_Event
finalcut::FAccelEvent a_ev( fc::Accelerator_Event
, getFocusWidget() );
calculator_buttons[On]->onAccel(&a_ev);
}

View File

@ -27,6 +27,7 @@
#include <final/final.h>
namespace fc = finalcut::fc;
using finalcut::FPoint;
using finalcut::FSize;
@ -86,12 +87,12 @@ CheckList::CheckList (finalcut::FWidget* parent)
listView.addColumn ("Priority", 12);
// Set the type of sorting
listView.setColumnSortType (1, finalcut::fc::by_name);
listView.setColumnSortType (2, finalcut::fc::by_name);
listView.setColumnSortType (1, fc::by_name);
listView.setColumnSortType (2, fc::by_name);
// Statusbar at the bottom
finalcut::FString separator;
separator << ' ' << finalcut::fc::BoxDrawingsVertical << ' ';
separator << ' ' << fc::BoxDrawingsVertical << ' ';
listView.setStatusbarMessage ( finalcut::FString()
<< "<Q> exit" << separator
<< "<Space> select an item" << separator
@ -147,8 +148,8 @@ void CheckList::onKeyPress (finalcut::FKeyEvent* ev)
return;
if ( ev->key() == 'q'
|| ev->key() == finalcut::fc::Fkey_escape
|| ev->key() == finalcut::fc::Fkey_escape_mintty )
|| ev->key() == fc::Fkey_escape
|| ev->key() == fc::Fkey_escape_mintty )
{
close();
ev->accept();
@ -174,7 +175,7 @@ void CheckList::cb_showList (finalcut::FWidget*, FDataPtr)
const auto item = static_cast<finalcut::FListViewItem*>(*iter);
if ( item->isChecked() )
shopping_list << finalcut::fc::Bullet << ' '
shopping_list << fc::Bullet << ' '
<< item->getText(1) << '\n';
++iter;

View File

@ -27,6 +27,7 @@
#include <final/final.h>
namespace fc = finalcut::fc;
using finalcut::FPoint;
using finalcut::FSize;
@ -84,19 +85,19 @@ Listview::Listview (finalcut::FWidget* parent)
listView.addColumn ("Pressure", 10);
// Set right alignment for the third, fourth, and fifth column
listView.setColumnAlignment (3, finalcut::fc::alignRight);
listView.setColumnAlignment (4, finalcut::fc::alignRight);
listView.setColumnAlignment (5, finalcut::fc::alignRight);
listView.setColumnAlignment (3, fc::alignRight);
listView.setColumnAlignment (4, fc::alignRight);
listView.setColumnAlignment (5, fc::alignRight);
// Set the type of sorting
listView.setColumnSortType (1, finalcut::fc::by_name);
listView.setColumnSortType (2, finalcut::fc::by_name);
listView.setColumnSortType (3, finalcut::fc::by_number);
listView.setColumnSortType (4, finalcut::fc::by_number);
listView.setColumnSortType (5, finalcut::fc::by_number);
listView.setColumnSortType (1, fc::by_name);
listView.setColumnSortType (2, fc::by_name);
listView.setColumnSortType (3, fc::by_number);
listView.setColumnSortType (4, fc::by_number);
listView.setColumnSortType (5, fc::by_number);
// Sort in ascending order by the 1st column
listView.setColumnSort (1, finalcut::fc::ascending);
listView.setColumnSort (1, fc::ascending);
// Sorting follows later automatically on insert().
// Otherwise you could start the sorting directly with sort()

View File

@ -22,6 +22,7 @@
#include <final/final.h>
namespace fc = finalcut::fc;
using finalcut::FPoint;
using finalcut::FSize;
@ -109,9 +110,9 @@ void Mandelbrot::draw()
}
if ( iter < max_iter )
setColor(finalcut::fc::Black, iter % 16);
setColor(fc::Black, iter % 16);
else
setColor(finalcut::fc::Black, 0);
setColor(fc::Black, 0);
print(' ');
}

View File

@ -22,6 +22,7 @@
#include <final/final.h>
namespace fc = finalcut::fc;
using finalcut::FPoint;
using finalcut::FSize;
@ -66,7 +67,7 @@ class Menu : public finalcut::FDialog
void cb_message (finalcut::FWidget*, FDataPtr);
// Data Members
finalcut::FString line{13, finalcut::fc::BoxDrawingsHorizontal};
finalcut::FString line{13, fc::BoxDrawingsHorizontal};
finalcut::FMenuBar Menubar{this};
finalcut::FMenu File{"&File", &Menubar};
finalcut::FMenu Edit{"&Edit", &Menubar};
@ -82,17 +83,17 @@ class Menu : public finalcut::FDialog
finalcut::FMenuItem Print{"&Print", &File};
finalcut::FMenuItem Line2{&File};
finalcut::FMenuItem Quit{"&Quit", &File};
finalcut::FMenuItem Undo{finalcut::fc::Fckey_z, "&Undo", &Edit};
finalcut::FMenuItem Redo{finalcut::fc::Fckey_y, "&Redo", &Edit};
finalcut::FMenuItem Undo{fc::Fckey_z, "&Undo", &Edit};
finalcut::FMenuItem Redo{fc::Fckey_y, "&Redo", &Edit};
finalcut::FMenuItem Line3{&Edit};
finalcut::FMenuItem Cut{finalcut::fc::Fckey_x, "Cu&t", &Edit};
finalcut::FMenuItem Copy{finalcut::fc::Fckey_c, "&Copy", &Edit};
finalcut::FMenuItem Paste{finalcut::fc::Fckey_v, "&Paste", &Edit};
finalcut::FMenuItem Cut{fc::Fckey_x, "Cu&t", &Edit};
finalcut::FMenuItem Copy{fc::Fckey_c, "&Copy", &Edit};
finalcut::FMenuItem Paste{fc::Fckey_v, "&Paste", &Edit};
finalcut::FMenuItem Line4{&Edit};
finalcut::FMenuItem Search{finalcut::fc::Fckey_f, "&Search", &Edit};
finalcut::FMenuItem Next{finalcut::fc::Fkey_f3, "Search &next", &Edit};
finalcut::FMenuItem Search{fc::Fckey_f, "&Search", &Edit};
finalcut::FMenuItem Next{fc::Fkey_f3, "Search &next", &Edit};
finalcut::FMenuItem Line5{&Edit};
finalcut::FMenuItem SelectAll{finalcut::fc::Fckey_a, "Select &all", &Edit};
finalcut::FMenuItem SelectAll{fc::Fckey_a, "Select &all", &Edit};
finalcut::FMenu Color{"&Color", &Choice};
finalcut::FMenu Style{"&Style", &Choice};
finalcut::FMenu Border{"&Border", &Choice};
@ -166,20 +167,20 @@ Menu::~Menu()
void Menu::configureFileMenuItems()
{
// "File" menu items
New.addAccelerator (finalcut::fc::Fckey_n); // Ctrl + N
New.addAccelerator (fc::Fckey_n); // Ctrl + N
New.setStatusbarMessage ("Create a new file");
Open.addAccelerator (finalcut::fc::Fckey_o); // Ctrl + O
Open.addAccelerator (fc::Fckey_o); // Ctrl + O
Open.setStatusbarMessage ("Locate and open a text file");
Save.addAccelerator (finalcut::fc::Fckey_s); // Ctrl + S
Save.addAccelerator (fc::Fckey_s); // Ctrl + S
Save.setStatusbarMessage ("Save the file");
SaveAs.setStatusbarMessage ("Save the current file under a different name");
Close.addAccelerator (finalcut::fc::Fckey_w); // Ctrl + W
Close.addAccelerator (fc::Fckey_w); // Ctrl + W
Close.setStatusbarMessage ("Close the current file");
Line1.setSeparator();
Print.addAccelerator (finalcut::fc::Fckey_p); // Ctrl + P
Print.addAccelerator (fc::Fckey_p); // Ctrl + P
Print.setStatusbarMessage ("Print the current file");
Line2.setSeparator();
Quit.addAccelerator (finalcut::fc::Fmkey_x); // Meta/Alt + X
Quit.addAccelerator (fc::Fmkey_x); // Meta/Alt + X
Quit.setStatusbarMessage ("Exit the program");
// Add quit menu item callback

View File

@ -22,6 +22,7 @@
#include <final/final.h>
namespace fc = finalcut::fc;
using finalcut::FPoint;
using finalcut::FSize;
using finalcut::FColorPair;
@ -61,8 +62,8 @@ class ColorChooser : public finalcut::FWidget
virtual void onMouseDown (finalcut::FMouseEvent*) override;
// Data Members
FColor fg_color{finalcut::fc::White};
FColor bg_color{finalcut::fc::Black};
FColor fg_color{fc::White};
FColor bg_color{fc::Black};
finalcut::FLabel headline{this};
};
#pragma pack(pop)
@ -88,7 +89,7 @@ ColorChooser::ColorChooser (finalcut::FWidget* parent)
// Text label
headline.setGeometry (FPoint(1, 1), FSize(8, 1));
headline.setEmphasis();
headline.setAlignment (finalcut::fc::alignCenter);
headline.setAlignment (fc::alignCenter);
headline << "Color";
}
@ -102,7 +103,7 @@ void ColorChooser::onMouseDown (finalcut::FMouseEvent* ev)
int mouse_x = ev->getX();
int mouse_y = ev->getY();
if ( ev->getButton() == finalcut::fc::MiddleButton )
if ( ev->getButton() == fc::MiddleButton )
return;
for (int c = 0; c < 16; c++)
@ -113,9 +114,9 @@ void ColorChooser::onMouseDown (finalcut::FMouseEvent* ev)
if ( mouse_x >= xmin && mouse_x <= xmax && mouse_y == y )
{
if ( ev->getButton() == finalcut::fc::LeftButton )
if ( ev->getButton() == fc::LeftButton )
bg_color = FColor(c);
else if ( ev->getButton() == finalcut::fc::RightButton )
else if ( ev->getButton() == fc::RightButton )
fg_color = FColor(c);
redraw();
@ -135,15 +136,15 @@ void ColorChooser::draw()
print() << FPoint(2 + (c / 8) * 3, 3 + c % 8);
if ( c < 6 )
setColor (finalcut::fc::LightGray, c);
setColor (fc::LightGray, c);
else if ( c > 8 )
setColor (finalcut::fc::DarkGray, c);
setColor (fc::DarkGray, c);
else
setColor (finalcut::fc::White, c);
setColor (fc::White, c);
if ( c == bg_color )
{
print() << ' ' << finalcut::fc::Times << ' ';
print() << ' ' << fc::Times << ' ';
}
else
print (" ");
@ -201,8 +202,8 @@ class Brushes : public finalcut::FWidget
// Data Members
wchar_t brush{L' '};
FColor fg_color{finalcut::fc::White};
FColor bg_color{finalcut::fc::Black};
FColor fg_color{fc::White};
FColor bg_color{fc::Black};
finalcut::FLabel headline{this};
};
#pragma pack(pop)
@ -228,7 +229,7 @@ Brushes::Brushes (finalcut::FWidget* parent)
// Text label
headline.setGeometry(FPoint(1, 1), FSize(8, 1));
headline.setEmphasis();
headline.setAlignment (finalcut::fc::alignCenter);
headline.setAlignment (fc::alignCenter);
headline << "Brush";
}
@ -245,7 +246,7 @@ void Brushes::draw()
finalcut::FWidget::drawBorder (1, 2, 8, 4);
print() << FPoint(2, 3)
<< FColorPair(fg_color, bg_color) << " "
<< finalcut::FString(3, finalcut::fc::MediumShade);
<< finalcut::FString(3, fc::MediumShade);
if ( brush == L' ' )
pos = 0;
@ -254,9 +255,9 @@ void Brushes::draw()
setColor();
print() << FPoint(3 + pos, 2)
<< finalcut::fc::BlackDownPointingTriangle
<< fc::BlackDownPointingTriangle
<< FPoint(3 + pos, 4)
<< finalcut::fc::BlackUpPointingTriangle;
<< fc::BlackUpPointingTriangle;
}
//----------------------------------------------------------------------
@ -265,7 +266,7 @@ void Brushes::onMouseDown (finalcut::FMouseEvent* ev)
int mouse_x = ev->getX();
int mouse_y = ev->getY();
if ( ev->getButton() != finalcut::fc::LeftButton )
if ( ev->getButton() != fc::LeftButton )
return;
if ( mouse_x >= 2 && mouse_x <= 4 && mouse_y == 3 )
@ -275,7 +276,7 @@ void Brushes::onMouseDown (finalcut::FMouseEvent* ev)
}
else if ( mouse_x >= 5 && mouse_x <= 7 && mouse_y == 3 )
{
brush = finalcut::fc::MediumShade;
brush = fc::MediumShade;
redraw();
}
}
@ -427,24 +428,24 @@ void MouseDraw::draw()
for (int y = 2; y < y_max; y++)
{
print() << FPoint(10, y)
<< finalcut::fc::NF_rev_border_line_right;
<< fc::NF_rev_border_line_right;
}
print() << FPoint(10, y_max)
<< finalcut::fc::NF_rev_border_corner_lower_right;
<< fc::NF_rev_border_corner_lower_right;
}
else
{
print() << FPoint(10, 2)
<< finalcut::fc::BoxDrawingsDownAndHorizontal;
<< fc::BoxDrawingsDownAndHorizontal;
for (int y = 3; y < y_max; y++)
{
print() << FPoint(10, y) << finalcut::fc::BoxDrawingsVertical;
print() << FPoint(10, y) << fc::BoxDrawingsVertical;
}
print() << FPoint(10, y_max)
<< finalcut::fc::BoxDrawingsUpAndHorizontal;
<< fc::BoxDrawingsUpAndHorizontal;
}
drawCanvas();
@ -521,13 +522,13 @@ void MouseDraw::onMouseDown (finalcut::FMouseEvent* ev)
{
finalcut::FDialog::onMouseDown(ev);
if ( ev->getButton() != finalcut::fc::LeftButton
&& ev->getButton() != finalcut::fc::RightButton )
if ( ev->getButton() != fc::LeftButton
&& ev->getButton() != fc::RightButton )
return;
drawBrush ( ev->getX()
, ev->getY()
, ev->getButton() == finalcut::fc::RightButton );
, ev->getButton() == fc::RightButton );
}
//----------------------------------------------------------------------
@ -535,13 +536,13 @@ void MouseDraw::onMouseMove (finalcut::FMouseEvent* ev)
{
FDialog::onMouseMove(ev);
if ( ev->getButton() != finalcut::fc::LeftButton
&& ev->getButton() != finalcut::fc::RightButton )
if ( ev->getButton() != fc::LeftButton
&& ev->getButton() != fc::RightButton )
return;
drawBrush ( ev->getX()
, ev->getY()
, ev->getButton() == finalcut::fc::RightButton);
, ev->getButton() == fc::RightButton);
}
//----------------------------------------------------------------------

View File

@ -22,6 +22,7 @@
#include <final/final.h>
namespace fc = finalcut::fc;
using finalcut::FPoint;
using finalcut::FSize;
@ -62,10 +63,10 @@ class Scrollview : public finalcut::FScrollView
void cb_go_north (finalcut::FWidget*, FDataPtr);
// Data Members
wchar_t pointer_right{finalcut::fc::BlackRightPointingPointer};
wchar_t pointer_down{finalcut::fc::BlackDownPointingTriangle};
wchar_t pointer_left{finalcut::fc::BlackLeftPointingPointer};
wchar_t pointer_up{finalcut::fc::BlackUpPointingTriangle};
wchar_t pointer_right{fc::BlackRightPointingPointer};
wchar_t pointer_down{fc::BlackDownPointingTriangle};
wchar_t pointer_left{fc::BlackLeftPointingPointer};
wchar_t pointer_up{fc::BlackUpPointingTriangle};
finalcut::FButton go_east{pointer_right, this};
finalcut::FButton go_south{pointer_down, this};
finalcut::FButton go_west{pointer_left, this};

View File

@ -534,7 +534,7 @@ void convertNumberToStringExample()
{
// Test: convert integer and double value to a string
finalcut::FString num1, num2, num3;
num1.setNumber(137);
num1.setNumber(137u);
num2.setNumber(-512);
num3.setNumber(3.141592653589793238L, 12);
std::cout << " setNumber: "
@ -553,11 +553,11 @@ void formatedNumberExample()
finalcut::FString fnum1, fnum2;
#if defined(__LP64__) || defined(_LP64)
// 64-bit architecture
fnum1.setFormatedNumber(0xffffffffffffffff, '\'');
fnum1.setFormatedNumber(0xffffffffffffffffu, '\'');
fnum2.setFormatedNumber(-9223372036854775807);
#else
// 32-bit architecture
fnum1.setFormatedNumber(0xffffffff, '\'');
fnum1.setFormatedNumber(0xffffffffu, '\'');
fnum2.setFormatedNumber(-2147483647);
#endif
std::cout << "setFormatedNumber: "

View File

@ -23,6 +23,7 @@
#include <functional>
#include <final/final.h>
namespace fc = finalcut::fc;
using finalcut::FPoint;
using finalcut::FSize;
using finalcut::FColorPair;
@ -83,10 +84,10 @@ AttribDlg::AttribDlg (finalcut::FWidget* parent)
next_button.setGeometry ( FPoint(int(getWidth()) - 13, int(getHeight()) - 4)
, FSize(10, 1) );
next_button.addAccelerator (finalcut::fc::Fkey_right);
next_button.addAccelerator (fc::Fkey_right);
back_button.setGeometry ( FPoint(int(getWidth()) - 25, int(getHeight()) - 4)
, FSize(10, 1) );
back_button.addAccelerator (finalcut::fc::Fkey_left);
back_button.addAccelerator (fc::Fkey_left);
// Add function callbacks
next_button.addCallback
@ -126,9 +127,9 @@ void AttribDlg::onWheel (finalcut::FWheelEvent* ev)
{
int wheel = ev->getWheel();
if ( wheel == finalcut::fc::WheelUp )
if ( wheel == fc::WheelUp )
cb_next();
else if ( wheel == finalcut::fc::WheelDown )
else if ( wheel == fc::WheelDown )
cb_back();
}
@ -145,8 +146,8 @@ void AttribDlg::cb_next (finalcut::FWidget*, FDataPtr)
return;
if ( bgcolor == FColor(getMaxColor() - 1) )
bgcolor = finalcut::fc::Default;
else if ( bgcolor == finalcut::fc::Default )
bgcolor = fc::Default;
else if ( bgcolor == fc::Default )
bgcolor = 0;
else
bgcolor++;
@ -161,8 +162,8 @@ void AttribDlg::cb_back (finalcut::FWidget*, FDataPtr)
return;
if ( bgcolor == 0 )
bgcolor = finalcut::fc::Default;
else if ( bgcolor == finalcut::fc::Default )
bgcolor = fc::Default;
else if ( bgcolor == fc::Default )
bgcolor = FColor(getMaxColor() - 1);
else
bgcolor--;
@ -275,9 +276,9 @@ void AttribDemo::printAltCharset()
print() << FPoint(1, 1) << "alternate charset: ";
if ( parent->bgcolor == finalcut::fc::Default )
if ( parent->bgcolor == fc::Default )
{
setColor (finalcut::fc::Default, finalcut::fc::Default);
setColor (fc::Default, fc::Default);
}
else
{
@ -285,9 +286,9 @@ void AttribDemo::printAltCharset()
|| (parent->bgcolor >= 16 && parent->bgcolor <= 231
&& (parent->bgcolor - 16) % 36 <= 17)
|| (parent->bgcolor >= 232 && parent->bgcolor <= 243) )
setColor (finalcut::fc::White, parent->bgcolor);
setColor (fc::White, parent->bgcolor);
else
setColor (finalcut::fc::Black, parent->bgcolor);
setColor (fc::Black, parent->bgcolor);
}
setAltCharset();
@ -455,7 +456,7 @@ void AttribDemo::draw()
FColor bg = static_cast<AttribDlg*>(getParent())->bgcolor;
print (" Background color:");
if ( bg == finalcut::fc::Default )
if ( bg == fc::Default )
print (" default");
else
printf ( " %d", bg);

View File

@ -26,6 +26,7 @@
#include <final/final.h>
namespace fc = finalcut::fc;
// Global FVTerm object
static finalcut::FVTerm* terminal;
@ -54,7 +55,7 @@ struct data
struct termcap_string
{
const std::string name;
const finalcut::fc::termcaps cap;
const fc::termcaps cap;
};
static termcap_string strings[];
@ -66,88 +67,88 @@ struct data
//----------------------------------------------------------------------
data::termcap_string data::strings[] =
{
{ "t_bell", finalcut::fc::t_bell },
{ "t_erase_chars", finalcut::fc::t_erase_chars },
{ "t_clear_screen", finalcut::fc::t_clear_screen },
{ "t_clr_eos", finalcut::fc::t_clr_eos },
{ "t_clr_eol", finalcut::fc::t_clr_eol },
{ "t_clr_bol", finalcut::fc::t_clr_bol },
{ "t_cursor_home", finalcut::fc::t_cursor_home },
{ "t_cursor_to_ll", finalcut::fc::t_cursor_to_ll },
{ "t_carriage_return", finalcut::fc::t_carriage_return },
{ "t_tab", finalcut::fc::t_tab },
{ "t_back_tab", finalcut::fc::t_back_tab },
{ "t_insert_padding", finalcut::fc::t_insert_padding },
{ "t_insert_character", finalcut::fc::t_insert_character },
{ "t_parm_ich", finalcut::fc::t_parm_ich },
{ "t_repeat_char", finalcut::fc::t_repeat_char },
{ "t_initialize_color", finalcut::fc::t_initialize_color },
{ "t_initialize_pair", finalcut::fc::t_initialize_pair },
{ "t_set_a_foreground", finalcut::fc::t_set_a_foreground },
{ "t_set_a_background", finalcut::fc::t_set_a_background },
{ "t_set_foreground", finalcut::fc::t_set_foreground },
{ "t_set_background", finalcut::fc::t_set_background },
{ "t_set_color_pair", finalcut::fc::t_set_color_pair },
{ "t_orig_pair", finalcut::fc::t_orig_pair },
{ "t_orig_colors", finalcut::fc::t_orig_colors },
{ "t_no_color_video", finalcut::fc::t_no_color_video },
{ "t_cursor_address", finalcut::fc::t_cursor_address },
{ "t_column_address", finalcut::fc::t_column_address },
{ "t_row_address", finalcut::fc::t_row_address },
{ "t_cursor_visible", finalcut::fc::t_cursor_visible },
{ "t_cursor_invisible", finalcut::fc::t_cursor_invisible },
{ "t_cursor_normal", finalcut::fc::t_cursor_normal },
{ "t_cursor_up", finalcut::fc::t_cursor_up },
{ "t_cursor_down", finalcut::fc::t_cursor_down },
{ "t_cursor_left", finalcut::fc::t_cursor_left },
{ "t_cursor_right", finalcut::fc::t_cursor_right },
{ "t_parm_up_cursor", finalcut::fc::t_parm_up_cursor },
{ "t_parm_down_cursor", finalcut::fc::t_parm_down_cursor },
{ "t_parm_left_cursor", finalcut::fc::t_parm_left_cursor },
{ "t_parm_right_cursor", finalcut::fc::t_parm_right_cursor },
{ "t_save_cursor", finalcut::fc::t_save_cursor },
{ "t_restore_cursor", finalcut::fc::t_restore_cursor },
{ "t_scroll_forward", finalcut::fc::t_scroll_forward },
{ "t_scroll_reverse", finalcut::fc::t_scroll_reverse },
{ "t_enter_ca_mode", finalcut::fc::t_enter_ca_mode },
{ "t_exit_ca_mode", finalcut::fc::t_exit_ca_mode },
{ "t_enable_acs", finalcut::fc::t_enable_acs },
{ "t_enter_bold_mode", finalcut::fc::t_enter_bold_mode },
{ "t_exit_bold_mode", finalcut::fc::t_exit_bold_mode },
{ "t_enter_dim_mode", finalcut::fc::t_enter_dim_mode },
{ "t_exit_dim_mode", finalcut::fc::t_exit_dim_mode },
{ "t_enter_italics_mode", finalcut::fc::t_enter_italics_mode },
{ "t_exit_italics_mode", finalcut::fc::t_exit_italics_mode },
{ "t_enter_underline_mode", finalcut::fc::t_enter_underline_mode },
{ "t_exit_underline_mode", finalcut::fc::t_exit_underline_mode },
{ "t_enter_blink_mode", finalcut::fc::t_enter_blink_mode },
{ "t_exit_blink_mode", finalcut::fc::t_exit_blink_mode },
{ "t_enter_reverse_mode", finalcut::fc::t_enter_reverse_mode },
{ "t_exit_reverse_mode", finalcut::fc::t_exit_reverse_mode },
{ "t_enter_standout_mode", finalcut::fc::t_enter_standout_mode },
{ "t_exit_standout_mode", finalcut::fc::t_exit_standout_mode },
{ "t_enter_secure_mode", finalcut::fc::t_enter_secure_mode },
{ "t_exit_secure_mode", finalcut::fc::t_exit_secure_mode },
{ "t_enter_protected_mode", finalcut::fc::t_enter_protected_mode },
{ "t_exit_protected_mode", finalcut::fc::t_exit_protected_mode },
{ "t_enter_crossed_out_mode", finalcut::fc::t_enter_crossed_out_mode },
{ "t_exit_crossed_out_mode", finalcut::fc::t_exit_crossed_out_mode },
{ "t_enter_dbl_underline_mode", finalcut::fc::t_enter_dbl_underline_mode },
{ "t_exit_dbl_underline_mode", finalcut::fc::t_exit_dbl_underline_mode },
{ "t_set_attributes", finalcut::fc::t_set_attributes },
{ "t_exit_attribute_mode", finalcut::fc::t_exit_attribute_mode },
{ "t_enter_alt_charset_mode", finalcut::fc::t_enter_alt_charset_mode },
{ "t_exit_alt_charset_mode", finalcut::fc::t_exit_alt_charset_mode },
{ "t_enter_pc_charset_mode", finalcut::fc::t_enter_pc_charset_mode },
{ "t_exit_pc_charset_mode", finalcut::fc::t_exit_pc_charset_mode },
{ "t_enter_insert_mode", finalcut::fc::t_enter_insert_mode },
{ "t_exit_insert_mode", finalcut::fc::t_exit_insert_mode },
{ "t_enter_am_mode", finalcut::fc::t_enter_am_mode },
{ "t_exit_am_mode", finalcut::fc::t_exit_am_mode },
{ "t_acs_chars", finalcut::fc::t_acs_chars },
{ "t_keypad_xmit", finalcut::fc::t_keypad_xmit },
{ "t_keypad_local", finalcut::fc::t_keypad_local },
{ "t_key_mouse", finalcut::fc::t_key_mouse }
{ "t_bell", fc::t_bell },
{ "t_erase_chars", fc::t_erase_chars },
{ "t_clear_screen", fc::t_clear_screen },
{ "t_clr_eos", fc::t_clr_eos },
{ "t_clr_eol", fc::t_clr_eol },
{ "t_clr_bol", fc::t_clr_bol },
{ "t_cursor_home", fc::t_cursor_home },
{ "t_cursor_to_ll", fc::t_cursor_to_ll },
{ "t_carriage_return", fc::t_carriage_return },
{ "t_tab", fc::t_tab },
{ "t_back_tab", fc::t_back_tab },
{ "t_insert_padding", fc::t_insert_padding },
{ "t_insert_character", fc::t_insert_character },
{ "t_parm_ich", fc::t_parm_ich },
{ "t_repeat_char", fc::t_repeat_char },
{ "t_initialize_color", fc::t_initialize_color },
{ "t_initialize_pair", fc::t_initialize_pair },
{ "t_set_a_foreground", fc::t_set_a_foreground },
{ "t_set_a_background", fc::t_set_a_background },
{ "t_set_foreground", fc::t_set_foreground },
{ "t_set_background", fc::t_set_background },
{ "t_set_color_pair", fc::t_set_color_pair },
{ "t_orig_pair", fc::t_orig_pair },
{ "t_orig_colors", fc::t_orig_colors },
{ "t_no_color_video", fc::t_no_color_video },
{ "t_cursor_address", fc::t_cursor_address },
{ "t_column_address", fc::t_column_address },
{ "t_row_address", fc::t_row_address },
{ "t_cursor_visible", fc::t_cursor_visible },
{ "t_cursor_invisible", fc::t_cursor_invisible },
{ "t_cursor_normal", fc::t_cursor_normal },
{ "t_cursor_up", fc::t_cursor_up },
{ "t_cursor_down", fc::t_cursor_down },
{ "t_cursor_left", fc::t_cursor_left },
{ "t_cursor_right", fc::t_cursor_right },
{ "t_parm_up_cursor", fc::t_parm_up_cursor },
{ "t_parm_down_cursor", fc::t_parm_down_cursor },
{ "t_parm_left_cursor", fc::t_parm_left_cursor },
{ "t_parm_right_cursor", fc::t_parm_right_cursor },
{ "t_save_cursor", fc::t_save_cursor },
{ "t_restore_cursor", fc::t_restore_cursor },
{ "t_scroll_forward", fc::t_scroll_forward },
{ "t_scroll_reverse", fc::t_scroll_reverse },
{ "t_enter_ca_mode", fc::t_enter_ca_mode },
{ "t_exit_ca_mode", fc::t_exit_ca_mode },
{ "t_enable_acs", fc::t_enable_acs },
{ "t_enter_bold_mode", fc::t_enter_bold_mode },
{ "t_exit_bold_mode", fc::t_exit_bold_mode },
{ "t_enter_dim_mode", fc::t_enter_dim_mode },
{ "t_exit_dim_mode", fc::t_exit_dim_mode },
{ "t_enter_italics_mode", fc::t_enter_italics_mode },
{ "t_exit_italics_mode", fc::t_exit_italics_mode },
{ "t_enter_underline_mode", fc::t_enter_underline_mode },
{ "t_exit_underline_mode", fc::t_exit_underline_mode },
{ "t_enter_blink_mode", fc::t_enter_blink_mode },
{ "t_exit_blink_mode", fc::t_exit_blink_mode },
{ "t_enter_reverse_mode", fc::t_enter_reverse_mode },
{ "t_exit_reverse_mode", fc::t_exit_reverse_mode },
{ "t_enter_standout_mode", fc::t_enter_standout_mode },
{ "t_exit_standout_mode", fc::t_exit_standout_mode },
{ "t_enter_secure_mode", fc::t_enter_secure_mode },
{ "t_exit_secure_mode", fc::t_exit_secure_mode },
{ "t_enter_protected_mode", fc::t_enter_protected_mode },
{ "t_exit_protected_mode", fc::t_exit_protected_mode },
{ "t_enter_crossed_out_mode", fc::t_enter_crossed_out_mode },
{ "t_exit_crossed_out_mode", fc::t_exit_crossed_out_mode },
{ "t_enter_dbl_underline_mode", fc::t_enter_dbl_underline_mode },
{ "t_exit_dbl_underline_mode", fc::t_exit_dbl_underline_mode },
{ "t_set_attributes", fc::t_set_attributes },
{ "t_exit_attribute_mode", fc::t_exit_attribute_mode },
{ "t_enter_alt_charset_mode", fc::t_enter_alt_charset_mode },
{ "t_exit_alt_charset_mode", fc::t_exit_alt_charset_mode },
{ "t_enter_pc_charset_mode", fc::t_enter_pc_charset_mode },
{ "t_exit_pc_charset_mode", fc::t_exit_pc_charset_mode },
{ "t_enter_insert_mode", fc::t_enter_insert_mode },
{ "t_exit_insert_mode", fc::t_exit_insert_mode },
{ "t_enter_am_mode", fc::t_enter_am_mode },
{ "t_exit_am_mode", fc::t_exit_am_mode },
{ "t_acs_chars", fc::t_acs_chars },
{ "t_keypad_xmit", fc::t_keypad_xmit },
{ "t_keypad_local", fc::t_keypad_local },
{ "t_key_mouse", fc::t_key_mouse }
};
// data inline functions
@ -297,7 +298,7 @@ void string(finalcut::FTermcap::tcap_map*& tcap)
for (int n = 0; n <= data::getNumberOfItems(); n++ )
{
const std::string name = data::strings[n].name;
const finalcut::fc::termcaps cap = data::strings[n].cap;
const fc::termcaps cap = data::strings[n].cap;
tcapString (name, tcap[cap].string);
}
}

View File

@ -22,6 +22,8 @@
#include <final/final.h>
namespace fc = finalcut::fc;
//----------------------------------------------------------------------
// class Timer
@ -52,8 +54,8 @@ Timer::Timer (finalcut::FWidget* parent)
delTimer (id);
addTimer (250); // 250-millisecond timer
wc.term_fg = finalcut::fc::Default;
wc.term_bg = finalcut::fc::Default;
wc.term_fg = fc::Default;
wc.term_bg = fc::Default;
}
//----------------------------------------------------------------------
@ -100,8 +102,8 @@ int main (int argc, char* argv[])
{
// Create the application object
finalcut::FApplication app(argc, argv);
app.setForegroundColor(finalcut::fc::Default);
app.setBackgroundColor(finalcut::fc::Default);
app.setForegroundColor(fc::Default);
app.setBackgroundColor(fc::Default);
// Create a timer object t
Timer t(&app);

View File

@ -22,6 +22,7 @@
#include <final/final.h>
namespace fc = finalcut::fc;
using finalcut::FPoint;
using finalcut::FSize;
@ -98,9 +99,9 @@ void Transparent::draw()
else if ( type == inherit_background )
{
if ( getMaxColor() > 8 )
setColor(finalcut::fc::Blue, finalcut::fc::Black);
setColor(fc::Blue, fc::Black);
else
setColor(finalcut::fc::Green, finalcut::fc::Black);
setColor(fc::Green, fc::Black);
setInheritBackground();
}

View File

@ -27,6 +27,7 @@
#include <final/final.h>
namespace fc = finalcut::fc;
using finalcut::FPoint;
using finalcut::FSize;
@ -314,13 +315,13 @@ Treeview::Treeview (finalcut::FWidget* parent)
listView.addColumn ("Density/km²");
// Set right alignment for the second and third column
listView.setColumnAlignment (2, finalcut::fc::alignRight);
listView.setColumnAlignment (3, finalcut::fc::alignRight);
listView.setColumnAlignment (2, fc::alignRight);
listView.setColumnAlignment (3, fc::alignRight);
// Set the type of sorting
listView.setColumnSortType (1, finalcut::fc::by_name);
listView.setColumnSortType (2, finalcut::fc::user_defined);
listView.setColumnSortType (3, finalcut::fc::user_defined);
listView.setColumnSortType (1, fc::by_name);
listView.setColumnSortType (2, fc::user_defined);
listView.setColumnSortType (3, fc::user_defined);
listView.setUserAscendingCompare(sortAscending);
listView.setUserDescendingCompare(sortDescending);

View File

@ -26,6 +26,7 @@
#include <final/final.h>
namespace fc = finalcut::fc;
using finalcut::FPoint;
using finalcut::FSize;
@ -325,21 +326,21 @@ class MyDialog : public finalcut::FDialog
finalcut::FMenuItem File2{"/etc/fstab", &Recent};
finalcut::FMenuItem File3{"/etc/passwd", &Recent};
// "Edit" menu items
finalcut::FMenuItem Undo{finalcut::fc::Fckey_z, "Undo", &Edit};
finalcut::FMenuItem Redo{finalcut::fc::Fckey_y, "Redo", &Edit};
finalcut::FMenuItem Undo{fc::Fckey_z, "Undo", &Edit};
finalcut::FMenuItem Redo{fc::Fckey_y, "Redo", &Edit};
finalcut::FMenuItem Line2{&Edit};
finalcut::FMenuItem Cut{finalcut::fc::Fckey_x, "Cu&t", &Edit};
finalcut::FMenuItem Copy{finalcut::fc::Fckey_c, "&Copy", &Edit};
finalcut::FMenuItem Paste{finalcut::fc::Fckey_v, "&Paste", &Edit};
finalcut::FMenuItem Clear{finalcut::fc::Fkey_dc, "C&lear", &Edit};
finalcut::FMenuItem Cut{fc::Fckey_x, "Cu&t", &Edit};
finalcut::FMenuItem Copy{fc::Fckey_c, "&Copy", &Edit};
finalcut::FMenuItem Paste{fc::Fckey_v, "&Paste", &Edit};
finalcut::FMenuItem Clear{fc::Fkey_dc, "C&lear", &Edit};
// "View" menu items
finalcut::FMenuItem Env{"&Terminal...", &View};
finalcut::FMenuItem Drive{"&Drive symbols...", &View};
// Statusbar
finalcut::FStatusBar Statusbar{this};
finalcut::FStatusKey key_F1{finalcut::fc::Fkey_f1, "About", &Statusbar};
finalcut::FStatusKey key_F2{finalcut::fc::Fkey_f2, "View", &Statusbar};
finalcut::FStatusKey key_F3{finalcut::fc::Fkey_f3, "Quit", &Statusbar};
finalcut::FStatusKey key_F1{fc::Fkey_f1, "About", &Statusbar};
finalcut::FStatusKey key_F2{fc::Fkey_f2, "View", &Statusbar};
finalcut::FStatusKey key_F3{fc::Fkey_f3, "Quit", &Statusbar};
// Dialog widgets
finalcut::FButton MyButton1{this};
finalcut::FButton MyButton2{this};
@ -393,11 +394,11 @@ void MyDialog::initMenu()
Help.setStatusbarMessage ("Show version and copyright information");
// "File" menu items
Open.addAccelerator (finalcut::fc::Fckey_o); // Ctrl + O
Open.addAccelerator (fc::Fckey_o); // Ctrl + O
Open.setStatusbarMessage ("Locate and open a text file");
Recent.setStatusbarMessage ("View text file");
Line1.setSeparator();
Quit.addAccelerator (finalcut::fc::Fmkey_x); // Meta/Alt + X
Quit.addAccelerator (fc::Fmkey_x); // Meta/Alt + X
Quit.setStatusbarMessage ("Exit the program");
// "Edit" menu items
@ -584,14 +585,14 @@ void MyDialog::initFlatButtons()
MyButton1.setStatusbarMessage ("Sine function");
MyButton1.setNoUnderline();
MyButton1.setFlat();
MyButton1.setDoubleFlatLine (finalcut::fc::bottom);
MyButton1.setDoubleFlatLine (fc::bottom);
MyButton2.setGeometry(FPoint(3, 5), FSize(5, 1));
MyButton2.setText (L"&COS");
MyButton2.setStatusbarMessage ("Cosine function");
MyButton2.setNoUnderline();
MyButton2.setFlat();
MyButton2.setDoubleFlatLine (finalcut::fc::top);
MyButton2.setDoubleFlatLine (fc::top);
MyButton3.setGeometry(FPoint(10, 3), FSize(5, 3));
MyButton3.setText (L"&=");
@ -692,7 +693,7 @@ void MyDialog::initLabels()
// Text labels
headline.setGeometry(FPoint(21, 3), FSize(10, 1));
headline.setEmphasis();
headline.setAlignment (finalcut::fc::alignCenter);
headline.setAlignment (fc::alignCenter);
headline = L"List items";
tagged.setGeometry(FPoint(21, 4), FSize(7, 1));
@ -701,7 +702,7 @@ void MyDialog::initLabels()
tagged_count << 0;
sum.setGeometry(FPoint(21, 5), FSize(7, 3));
sum.setAlignment (finalcut::fc::alignRight);
sum.setAlignment (fc::alignRight);
sum_count.setGeometry(FPoint(29, 5), FSize(5, 3));
sum_count << myList.getCount();
@ -779,7 +780,7 @@ void MyDialog::cb_noFunctionMsg (finalcut::FWidget* widget, FDataPtr)
void MyDialog::cb_about (finalcut::FWidget*, FDataPtr)
{
constexpr char libver[] = F_VERSION;
const finalcut::FString line(2, finalcut::fc::BoxDrawingsHorizontal);
const finalcut::FString line(2, fc::BoxDrawingsHorizontal);
finalcut::FMessageBox info ( "About"
, line + L" The Final Cut " + line + "\n\n"
@ -802,7 +803,7 @@ void MyDialog::cb_terminfo (finalcut::FWidget*, FDataPtr)
<< " Type: " << getTermType() << "\n"
<< " Name: " << getTermFileName() << "\n"
<< " Mode: " << getEncodingString() << "\n"
<< " Size: " << x << finalcut::fc::Times
<< " Size: " << x << fc::Times
<< y << "\n"
<< "Colors: " << getMaxColor()
, finalcut::FMessageBox::Ok, 0, 0, this
@ -850,12 +851,12 @@ void MyDialog::cb_drives (finalcut::FWidget*, FDataPtr)
}
else
{
net.setForegroundColor (finalcut::fc::White);
net.setBackgroundColor (finalcut::fc::DarkGray);
drive.setForegroundColor (finalcut::fc::White);
drive.setBackgroundColor (finalcut::fc::DarkGray);
cd.setForegroundColor (finalcut::fc::White);
cd.setBackgroundColor (finalcut::fc::DarkGray);
net.setForegroundColor (fc::White);
net.setBackgroundColor (fc::DarkGray);
drive.setForegroundColor (fc::White);
drive.setBackgroundColor (fc::DarkGray);
cd.setForegroundColor (fc::White);
cd.setBackgroundColor (fc::DarkGray);
}
info2.exec();

View File

@ -23,6 +23,7 @@
#include <vector>
#include <final/final.h>
namespace fc = finalcut::fc;
using finalcut::FPoint;
using finalcut::FSize;
@ -71,8 +72,8 @@ SmallWindow::SmallWindow (finalcut::FWidget* parent)
: finalcut::FDialog(parent)
{
wchar_t arrow_up, arrow_down;
arrow_up = finalcut::fc::BlackUpPointingTriangle;
arrow_down = finalcut::fc::BlackDownPointingTriangle;
arrow_up = fc::BlackUpPointingTriangle;
arrow_down = fc::BlackDownPointingTriangle;
left_arrow = arrow_up;
left_arrow.setForegroundColor (wc.label_inactive_fg);
@ -92,7 +93,7 @@ SmallWindow::SmallWindow (finalcut::FWidget* parent)
top_left_label.setGeometry (FPoint(1, 1), FSize(6, 1));
top_right_label = "zoom";
top_right_label.setAlignment (finalcut::fc::alignRight);
top_right_label.setAlignment (fc::alignRight);
top_right_label.setForegroundColor (wc.label_inactive_fg);
top_right_label.setEmphasis();
top_right_label.setGeometry (FPoint(int(getClientWidth()) - 5, 1), FSize(6, 1));
@ -101,7 +102,7 @@ SmallWindow::SmallWindow (finalcut::FWidget* parent)
"corner\n";
bottom_label_text += arrow_down;
bottom_label = bottom_label_text;
bottom_label.setAlignment (finalcut::fc::alignRight);
bottom_label.setAlignment (fc::alignRight);
bottom_label.setForegroundColor (wc.label_inactive_fg);
bottom_label.setEmphasis();
bottom_label.setGeometry (FPoint(13, 3), FSize(6, 3));
@ -224,7 +225,7 @@ class Window : public finalcut::FDialog
// Data Members
std::vector<win_data*> windows{};
finalcut::FString drop_down_symbol{finalcut::fc::BlackDownPointingTriangle};
finalcut::FString drop_down_symbol{fc::BlackDownPointingTriangle};
finalcut::FMenuBar Menubar{this};
finalcut::FMenu File{"&File", &Menubar};
finalcut::FDialogListMenu DglList{drop_down_symbol, &Menubar};
@ -295,12 +296,12 @@ void Window::configureFileMenuItems()
New.setStatusbarMessage ("Create the windows");
Close.setStatusbarMessage ("Close the windows");
Line1.setSeparator();
Next.addAccelerator (finalcut::fc::Fmkey_npage); // Meta/Alt + PgDn
Next.addAccelerator (fc::Fmkey_npage); // Meta/Alt + PgDn
Next.setStatusbarMessage ("Switch to the next window");
Previous.addAccelerator (finalcut::fc::Fmkey_ppage); // Meta/Alt + PgUp
Previous.addAccelerator (fc::Fmkey_ppage); // Meta/Alt + PgUp
Previous.setStatusbarMessage ("Switch to the previous window");
Line2.setSeparator();
Quit.addAccelerator (finalcut::fc::Fmkey_x); // Meta/Alt + X
Quit.addAccelerator (fc::Fmkey_x); // Meta/Alt + X
Quit.setStatusbarMessage ("Exit the program");
// Add menu item callback

View File

@ -600,7 +600,7 @@ FTermLinux::modifier_key& FTermLinux::getModifierKey()
// fill bit field with 0
std::memset (&mod_key, 0x00, sizeof(mod_key));
// TIOCLINUX, subcode = 6
// TIOCLINUX, subcode = 6 (TIOCL_GETSHIFTSTATE)
if ( ioctl(0, TIOCLINUX, &subcode) >= 0 )
{
if ( subcode & (1 << KG_SHIFT) )
@ -728,8 +728,8 @@ inline uInt16 FTermLinux::getInputStatusRegisterOne()
// Miscellaneous output (read port)
static constexpr uInt16 misc_read = 0x3cc;
const uInt16 io_base = ( inb(misc_read) & 0x01 ) ? 0x3d0 : 0x3b0;
// 0x3ba : Input status 1 MDA (read port)
// 0x3da : Input status 1 CGA (read port)
// 0x3ba : Input status 1 mono/MDA (read port)
// 0x3da : Input status 1 color/CGA (read port)
return io_base + 0x0a;
}

View File

@ -855,7 +855,7 @@ void FStringTest::streamInsertionTest()
CPPUNIT_ASSERT ( out == L"-1234567" );
out.clear();
out << uInt(12345678);
out << uInt(12345678u);
CPPUNIT_ASSERT ( out == L"12345678" );
out.clear();
@ -863,7 +863,7 @@ void FStringTest::streamInsertionTest()
CPPUNIT_ASSERT ( out == L"-34721053343141" );
out.clear();
out << uLong(4670148723459);
out << uLong(4670148723459u);
CPPUNIT_ASSERT ( out == L"4670148723459" );
out.clear();
@ -1048,7 +1048,7 @@ void FStringTest::formatTest()
#if defined(__LP64__) || defined(_LP64)
// 64-bit architecture
fnum1.setFormatedNumber(0xffffffffffffffff, '\'');
fnum1.setFormatedNumber(0xffffffffffffffffu, '\'');
CPPUNIT_ASSERT ( fnum1 == "18'446'744'073'709'551'615" );
fnum2.setFormatedNumber(-9223372036854775807);
@ -1057,17 +1057,17 @@ void FStringTest::formatTest()
fnum2.setFormatedNumber(long(9223372036854775807), '\0');
CPPUNIT_ASSERT ( fnum2 == "9 223 372 036 854 775 807" );
fnum2.setFormatedNumber(uLong(9223372036854775807), '\0');
fnum2.setFormatedNumber(uLong(9223372036854775807u), '\0');
CPPUNIT_ASSERT ( fnum2 == "9 223 372 036 854 775 807" );
fnum2.setFormatedNumber(sInt64(9223372036854775807), '\0');
CPPUNIT_ASSERT ( fnum2 == "9 223 372 036 854 775 807" );
fnum2.setFormatedNumber(uInt64(9223372036854775807), '\0');
fnum2.setFormatedNumber(uInt64(9223372036854775807u), '\0');
CPPUNIT_ASSERT ( fnum2 == "9 223 372 036 854 775 807" );
#else
// 32-bit architecture
fnum1.setFormatedNumber(0xffffffff, '\'');
fnum1.setFormatedNumber(0xffffffffu, '\'');
CPPUNIT_ASSERT ( fnum1 == "4'294'967'295" );
fnum2.setFormatedNumber(-2147483647);
@ -1076,26 +1076,26 @@ void FStringTest::formatTest()
fnum2.setFormatedNumber(long(2147483647), '\0');
CPPUNIT_ASSERT ( fnum2 == "2 147 483 647" );
fnum2.setFormatedNumber(uLong(2147483647), '\0');
fnum2.setFormatedNumber(uLong(2147483647u), '\0');
CPPUNIT_ASSERT ( fnum2 == "2 147 483 647" );
fnum2.setFormatedNumber(sInt32(2147483647), '\0');
CPPUNIT_ASSERT ( fnum2 == "2 147 483 647" );
fnum2.setFormatedNumber(uInt32(2147483647), '\0');
fnum2.setFormatedNumber(uInt32(2147483647u), '\0');
CPPUNIT_ASSERT ( fnum2 == "2 147 483 647" );
#endif
fnum1.setFormatedNumber(sInt16(-2048), '_');
CPPUNIT_ASSERT ( fnum1 == "-2_048" );
fnum2.setFormatedNumber(uInt16(65535));
fnum2.setFormatedNumber(uInt16(65535u));
CPPUNIT_ASSERT ( fnum2 == "65 535" );
fnum1.setFormatedNumber(sInt8(-123), '*');
CPPUNIT_ASSERT ( fnum1 == "-123" );
fnum2.setFormatedNumber(uInt8(255));
fnum2.setFormatedNumber(uInt8(255u));
CPPUNIT_ASSERT ( fnum2 == "255" );
}
@ -1106,13 +1106,13 @@ void FStringTest::convertToNumberTest()
CPPUNIT_ASSERT ( str.toShort() == -127 );
str = "255";
CPPUNIT_ASSERT ( str.toUShort() == 255 );
CPPUNIT_ASSERT ( str.toUShort() == 255u );
str = "-32768";
CPPUNIT_ASSERT ( str.toInt() == -32768 );
str = "65535";
CPPUNIT_ASSERT ( str.toUInt() == 65535 );
CPPUNIT_ASSERT ( str.toUInt() == 65535u );
str = "-2147483647";
CPPUNIT_ASSERT ( str.toLong() == -2147483647 );
@ -1121,10 +1121,10 @@ void FStringTest::convertToNumberTest()
CPPUNIT_ASSERT ( str.toLong() == 987654321 );
str = "4294967295";
CPPUNIT_ASSERT ( str.toULong() == 4294967295 );
CPPUNIT_ASSERT ( str.toULong() == 4294967295u );
str = "+1234567890";
CPPUNIT_ASSERT ( str.toULong() == 1234567890 );
CPPUNIT_ASSERT ( str.toULong() == 1234567890u );
str = "3.14159";
CPPUNIT_ASSERT ( str.toFloat() == 3.14159f );
@ -1143,17 +1143,17 @@ void FStringTest::convertToNumberTest()
void FStringTest::convertFromNumberTest()
{
constexpr sInt8 n1 = -12;
constexpr uInt8 n2 = 12;
constexpr uInt8 n2 = 12u;
constexpr sInt16 n3 = -1234;
constexpr uInt16 n4 = 1234;
constexpr uInt16 n4 = 1234u;
constexpr int n5 = -12345;
constexpr uInt n6 = 12345;
constexpr uInt n6 = 12345u;
constexpr sInt32 n7 = -12345;
constexpr uInt32 n8 = 12345;
constexpr uInt32 n8 = 12345u;
constexpr long n9 = -12345678;
constexpr uLong n10 = 12345678;
constexpr uLong n10 = 12345678u;
constexpr sInt64 n11 = -12345678;
constexpr uInt64 n12 = 12345678;
constexpr uInt64 n12 = 12345678u;
constexpr float n13 = 1234.56f;
constexpr double n14 = 1234.5678;
constexpr lDouble n15 = 12345.67890L;