diff --git a/ChangeLog b/ChangeLog index bb214e70..377131bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2018-09-20 Markus Gans * Added pkg-config file finalcut.pc + * The entire library source code is now encapsulated under + the namespace finalcut. All examples and tests have been + modified to fit the namespace. 2018-09-16 Markus Gans * Implement a ttytype test for the FTermDetection unit test diff --git a/doc/class_template.cpp b/doc/class_template.cpp index 39de0ef7..0c1fc132 100644 --- a/doc/class_template.cpp +++ b/doc/class_template.cpp @@ -22,6 +22,9 @@ #include "final/fclassname.h" +namespace finalcut +{ + // static class attributes @@ -49,3 +52,5 @@ FClassName::~FClassName() // destructor // private methods of FClassName //---------------------------------------------------------------------- +} // namespace finalcut + diff --git a/doc/class_template.h b/doc/class_template.h index 7a3372a2..6af407b9 100644 --- a/doc/class_template.h +++ b/doc/class_template.h @@ -37,6 +37,8 @@ //#include ... +namespace finalcut +{ //---------------------------------------------------------------------- // class FClassName @@ -124,6 +126,7 @@ class FClassName // FClassName inline functions //---------------------------------------------------------------------- +} // namespace finalcut #endif // FCLASSNAME_H diff --git a/examples/calculator.cpp b/examples/calculator.cpp index 146a2f8d..da16205f 100644 --- a/examples/calculator.cpp +++ b/examples/calculator.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2016-2017 Markus Gans * +* Copyright 2016-2018 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 * @@ -39,7 +39,7 @@ const lDouble PI = 3.141592653589793238L; #pragma pack(push) #pragma pack(1) -class Button : public FButton +class Button : public finalcut::FButton { public: // Constructor @@ -49,7 +49,7 @@ class Button : public FButton void setChecked(bool); // Event handler - void onKeyPress (FKeyEvent*); + void onKeyPress (finalcut::FKeyEvent*); private: // Data Member @@ -58,8 +58,8 @@ class Button : public FButton #pragma pack(pop) //---------------------------------------------------------------------- -Button::Button (FWidget* parent) - : FButton(parent) +Button::Button (finalcut::FWidget* parent) + : finalcut::FButton(parent) , checked(false) { } @@ -73,9 +73,9 @@ void Button::setChecked (bool on) if ( checked ) { - setBackgroundColor(fc::Cyan); - setFocusForegroundColor(fc::White); - setFocusBackgroundColor(fc::Cyan); + setBackgroundColor(finalcut::fc::Cyan); + setFocusForegroundColor(finalcut::fc::White); + setFocusBackgroundColor(finalcut::fc::Cyan); } else { @@ -88,15 +88,16 @@ void Button::setChecked (bool on) } //---------------------------------------------------------------------- -void Button::onKeyPress (FKeyEvent* ev) +void Button::onKeyPress (finalcut::FKeyEvent* ev) { int key = ev->key(); // catch the enter key - if ( key == fc::Fkey_return || key == fc::Fkey_enter ) + if ( key == finalcut::fc::Fkey_return + || key == finalcut::fc::Fkey_enter ) return; - FButton::onKeyPress(ev); + finalcut::FButton::onKeyPress(ev); } @@ -107,22 +108,22 @@ void Button::onKeyPress (FKeyEvent* ev) #pragma pack(push) #pragma pack(1) -class Calc : public FDialog +class Calc : public finalcut::FDialog { public: // Constructor - explicit Calc (FWidget* parent = 0); + explicit Calc (finalcut::FWidget* parent = 0); // Destructor ~Calc(); // Event handlers - void onKeyPress (FKeyEvent*); - void onAccel (FAccelEvent*); - void onClose (FCloseEvent*); + void onKeyPress (finalcut::FKeyEvent*); + void onAccel (finalcut::FAccelEvent*); + void onClose (finalcut::FCloseEvent*); // Callback method - void cb_buttonClicked (FWidget*, data_ptr); + void cb_buttonClicked (finalcut::FWidget*, data_ptr); private: // Typedef and Enumeration @@ -216,18 +217,17 @@ class Calc : public FDialog void mapKeyFunctions(); // Data Members - bool error; - bool arcus_mode; - bool hyperbolic_mode; - - lDouble a, b; - lDouble infinity; - uInt max_char; - int last_key; - char infix_operator; - char last_infix_operator; - FString input; - int button_no[Calc::NUM_OF_BUTTONS]; + bool error; + bool arcus_mode; + bool hyperbolic_mode; + lDouble a, b; + lDouble infinity; + uInt max_char; + int last_key; + char infix_operator; + char last_infix_operator; + finalcut::FString input; + int button_no[Calc::NUM_OF_BUTTONS]; struct stack_data { @@ -243,7 +243,7 @@ class Calc : public FDialog //---------------------------------------------------------------------- Calc::Calc (FWidget* parent) - : FDialog(parent) + : finalcut::FDialog(parent) , error(false) , arcus_mode(false) , hyperbolic_mode(false) @@ -285,8 +285,8 @@ Calc::Calc (FWidget* parent) btn->setFlat(); btn->setNoUnderline(); btn->setText(getButtonText(key)); - btn->setDoubleFlatLine(fc::top); - btn->setDoubleFlatLine(fc::bottom); + btn->setDoubleFlatLine(finalcut::fc::top); + btn->setDoubleFlatLine(finalcut::fc::bottom); if ( isNewFont() ) btn->unsetClickAnimation(); @@ -301,7 +301,7 @@ Calc::Calc (FWidget* parent) calculator_buttons[button(key)] = btn; } - calculator_buttons[On]->addAccelerator(fc::Fkey_dc); // Del key + calculator_buttons[On]->addAccelerator(finalcut::fc::Fkey_dc); // Del key calculator_buttons[On]->setFocus(); calculator_buttons[Pi]->addAccelerator('p'); calculator_buttons[Power]->addAccelerator('^'); @@ -310,8 +310,8 @@ Calc::Calc (FWidget* parent) calculator_buttons[Multiply]->addAccelerator('*'); calculator_buttons[Decimal_point]->addAccelerator(','); calculator_buttons[Change_sign]->addAccelerator('#'); - calculator_buttons[Equals]->addAccelerator(fc::Fkey_return); - calculator_buttons[Equals]->addAccelerator(fc::Fkey_enter); + calculator_buttons[Equals]->addAccelerator(finalcut::fc::Fkey_return); + calculator_buttons[Equals]->addAccelerator(finalcut::fc::Fkey_enter); } //---------------------------------------------------------------------- @@ -322,7 +322,7 @@ Calc::~Calc() //---------------------------------------------------------------------- void Calc::drawDispay() { - FString display = input; + finalcut::FString display = input; if ( display.isNull() || display.isEmpty() ) display = L'0'; @@ -334,7 +334,7 @@ void Calc::drawDispay() display = display.left(display.getLength() - 1); if ( ! display.isEmpty() && display.getLength() < max_char ) - display.insert(FString(max_char - display.getLength(), L' '), 0); + display.insert(finalcut::FString(max_char - display.getLength(), L' '), 0); if ( display.getLength() > max_char ) display = display.left(max_char); @@ -345,7 +345,7 @@ void Calc::drawDispay() if ( error ) display = " Error "; - setColor(fc::Black, fc::LightGray); + setColor(finalcut::fc::Black, finalcut::fc::LightGray); if ( isMonochron() ) setReverse(false); @@ -360,27 +360,34 @@ void Calc::drawDispay() if ( isNewFont() ) { - FString bottom_line (33, wchar_t(fc::NF_border_line_bottom)); + wchar_t bottom_line = wchar_t(finalcut::fc::NF_border_line_bottom); + wchar_t top_bottom_line = wchar_t(finalcut::fc::NF_border_line_up_and_down); + wchar_t top_line = wchar_t(finalcut::fc::NF_border_line_upper); + wchar_t right_line = wchar_t(finalcut::fc::NF_rev_border_line_right); + wchar_t left_line = wchar_t(finalcut::fc::NF_border_line_left); setPrintPos (3, 2); - print (bottom_line); + print (finalcut::FString(33, bottom_line)); setPrintPos (2, 3); - print (wchar_t(fc::NF_rev_border_line_right)); + print (right_line); setPrintPos (36, 3); - print (wchar_t(fc::NF_border_line_left)); - FString top_bottom_line_5 (5, wchar_t(fc::NF_border_line_up_and_down)); - FString top_line_2 (2, wchar_t(fc::NF_border_line_upper)); + print (left_line); setPrintPos (3, 4); + finalcut::FString top_bottom_line_5 (5, top_bottom_line); + finalcut::FString top_line_2 (2, top_line); print ( top_bottom_line_5 + top_line_2 + top_bottom_line_5 + top_line_2 + top_bottom_line_5 + top_line_2 + top_bottom_line_5 + top_line_2 - + top_bottom_line_5); + + top_bottom_line_5 ); } else { - FString separator = FString(wchar_t(fc::BoxDrawingsVerticalAndRight)) - + FString(35, wchar_t(fc::BoxDrawingsHorizontal)) - + FString(wchar_t(fc::BoxDrawingsVerticalAndLeft)); + wchar_t vertical_and_right = wchar_t(finalcut::fc::BoxDrawingsVerticalAndRight); + wchar_t horizontal = wchar_t(finalcut::fc::BoxDrawingsHorizontal); + wchar_t vertical_and_left = wchar_t(finalcut::fc::BoxDrawingsVerticalAndLeft); + finalcut::FString separator = finalcut::FString(vertical_and_right) + + finalcut::FString(35, horizontal) + + finalcut::FString(vertical_and_left); setPrintPos (1, 4); print(separator); } @@ -848,10 +855,10 @@ void Calc::tangent (lDouble& x) void Calc::draw() { setBold(); - setColor (fc::Blue, fc::Cyan); - clearArea (vdesktop, fc::MediumShade); + setColor (finalcut::fc::Blue, finalcut::fc::Cyan); + clearArea (vdesktop, finalcut::fc::MediumShade); unsetBold(); - FDialog::draw(); + finalcut::FDialog::draw(); drawDispay(); } @@ -998,15 +1005,15 @@ void Calc::calcInfixOperator() } //---------------------------------------------------------------------- -void Calc::onKeyPress (FKeyEvent* ev) +void Calc::onKeyPress (finalcut::FKeyEvent* ev) { int len = int(input.getLength()); int key = ev->key(); switch ( key ) { - case fc::Fkey_erase: - case fc::Fkey_backspace: + case finalcut::fc::Fkey_erase: + case finalcut::fc::Fkey_backspace: if ( len > 0 ) { lDouble& x = getValue(); @@ -1029,36 +1036,37 @@ void Calc::onKeyPress (FKeyEvent* ev) ev->accept(); break; - case fc::Fkey_escape: - case fc::Fkey_escape_mintty: + case finalcut::fc::Fkey_escape: + case finalcut::fc::Fkey_escape_mintty: { - FAccelEvent a_ev(fc::Accelerator_Event, getFocusWidget()); + finalcut::FAccelEvent a_ev( finalcut::fc::Accelerator_Event + , getFocusWidget() ); calculator_buttons[On]->onAccel(&a_ev); } ev->accept(); break; default: - FDialog::onKeyPress(ev); + finalcut::FDialog::onKeyPress(ev); break; } } //---------------------------------------------------------------------- -void Calc::onAccel (FAccelEvent* ev) +void Calc::onAccel (finalcut::FAccelEvent* ev) { close(); ev->accept(); } //---------------------------------------------------------------------- -void Calc::onClose (FCloseEvent* ev) +void Calc::onClose (finalcut::FCloseEvent* ev) { - FApplication::closeConfirmationDialog (this, ev); + finalcut::FApplication::closeConfirmationDialog (this, ev); } //---------------------------------------------------------------------- -void Calc::cb_buttonClicked (FWidget*, data_ptr data) +void Calc::cb_buttonClicked (finalcut::FWidget*, data_ptr data) { lDouble& x = getValue(); Calc::button key = *(static_cast(data)); @@ -1096,7 +1104,7 @@ void Calc::adjustSize() int ph = getParentWidget()->getHeight(); setX (1 + (pw - getWidth()) / 2, false); setY (1 + (ph - getHeight()) / 2, false); - FDialog::adjustSize(); + finalcut::FDialog::adjustSize(); } //---------------------------------------------------------------------- @@ -1189,7 +1197,7 @@ void Calc::mapKeyFunctions() int main (int argc, char* argv[]) { // Create the application object - FApplication app(argc, argv); + finalcut::FApplication app(argc, argv); // Create a calculator object Calc calculator(&app); diff --git a/examples/choice.cpp b/examples/choice.cpp index 26ddb3d3..a22eae48 100644 --- a/examples/choice.cpp +++ b/examples/choice.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2017 Markus Gans * +* Copyright 2017-2018 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 * @@ -24,35 +24,36 @@ // function prototypes -void cb_quit (FWidget*, FWidget::data_ptr); -void populateChoice (std::vector&, FButtonGroup*); -void preset (std::vector&); +void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr); +void populateChoice (std::vector&, finalcut::FButtonGroup*); +void preset (std::vector&); //---------------------------------------------------------------------- // callback functions //---------------------------------------------------------------------- -void cb_quit (FWidget*, FWidget::data_ptr data) +void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data) { - FDialog* dlg = static_cast(data); + finalcut::FDialog* dlg = static_cast(data); dlg->close(); } //---------------------------------------------------------------------- -void populateChoice (std::vector& os, FButtonGroup* group) +void populateChoice ( std::vector& os + , finalcut::FButtonGroup* group ) { - os[0] = new FRadioButton("AIX", group); - os[1] = new FRadioButton("Cygwin", group); - os[2] = new FRadioButton("FreeBSD", group); - os[3] = new FRadioButton("HP-UX", group); - os[4] = new FRadioButton("Linux", group); - os[5] = new FRadioButton("Mac OS X", group); - os[6] = new FRadioButton("NetBSD", group); - os[7] = new FRadioButton("OpenBSD", group); - os[8] = new FRadioButton("Solaris", group); + os[0] = new finalcut::FRadioButton("AIX", group); + os[1] = new finalcut::FRadioButton("Cygwin", group); + os[2] = new finalcut::FRadioButton("FreeBSD", group); + os[3] = new finalcut::FRadioButton("HP-UX", group); + os[4] = new finalcut::FRadioButton("Linux", group); + os[5] = new finalcut::FRadioButton("Mac OS X", group); + os[6] = new finalcut::FRadioButton("NetBSD", group); + os[7] = new finalcut::FRadioButton("OpenBSD", group); + os[8] = new finalcut::FRadioButton("Solaris", group); } //---------------------------------------------------------------------- -void preset (std::vector& os) +void preset (std::vector& os) { #if defined(_AIX) os[0]->setChecked(); @@ -90,13 +91,13 @@ void preset (std::vector& os) int main (int argc, char* argv[]) { int x, y, w, h; - FString label_text = "no OS"; + finalcut::FString label_text = "no OS"; // Create the application object - FApplication app(argc, argv); + finalcut::FApplication app(argc, argv); // Create a simple modal dialog box - FDialog* dgl = new FDialog(&app); + finalcut::FDialog* dgl = new finalcut::FDialog(&app); dgl->setModal(); dgl->setText ("UNIX select"); w = 20; @@ -106,11 +107,11 @@ int main (int argc, char* argv[]) dgl->setGeometry (x, y, w, h); // Create a button group - FButtonGroup* checkButtonGroup = new FButtonGroup("choice", dgl); + finalcut::FButtonGroup* checkButtonGroup = new finalcut::FButtonGroup("choice", dgl); checkButtonGroup->setGeometry (2, 1, 16, 7); // Create radio buttons - std::vector os (9); + std::vector os (9); populateChoice (os, checkButtonGroup); // Set the radio button geometry @@ -122,11 +123,11 @@ int main (int argc, char* argv[]) preset(os); // Scroll to the focused child element - FFocusEvent cfi (fc::ChildFocusIn_Event); - FApplication::sendEvent(checkButtonGroup, &cfi); + finalcut::FFocusEvent cfi (finalcut::fc::ChildFocusIn_Event); + finalcut::FApplication::sendEvent(checkButtonGroup, &cfi); // Create a OK button - FButton* ok = new FButton("&OK", dgl); + finalcut::FButton* ok = new finalcut::FButton("&OK", dgl); ok->setGeometry (10, 9, 8, 1); // Connect the button signal "clicked" with the callback function @@ -154,7 +155,7 @@ int main (int argc, char* argv[]) delete dgl; // Create and show tooltip for two seconds - FToolTip* tooltip = new FToolTip(&app); + finalcut::FToolTip* tooltip = new finalcut::FToolTip(&app); tooltip->setText ("You have chosen " + label_text); tooltip->show(); sleep(2); diff --git a/examples/dialog.cpp b/examples/dialog.cpp index a9899225..545c9bec 100644 --- a/examples/dialog.cpp +++ b/examples/dialog.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2017 Markus Gans * +* Copyright 2015-2018 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 * @@ -23,15 +23,15 @@ #include // function prototype -void cb_quit (FWidget*, FWidget::data_ptr); +void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr); //---------------------------------------------------------------------- // callback function //---------------------------------------------------------------------- -void cb_quit (FWidget*, FWidget::data_ptr data) +void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data) { - FApplication* app = static_cast(data); + finalcut::FApplication* app = static_cast(data); app->quit(); } @@ -42,21 +42,21 @@ void cb_quit (FWidget*, FWidget::data_ptr data) int main (int argc, char* argv[]) { // Create the application object - FApplication app(argc, argv); + finalcut::FApplication app(argc, argv); // Create a simple dialog box - FDialog dgl(&app); + finalcut::FDialog dgl(&app); dgl.setText ("FDialog"); dgl.setGeometry (4, 3, 41, 11); // Create text labels - FLabel label_1(&dgl); - FLabel label_2(&dgl); + finalcut::FLabel label_1(&dgl); + finalcut::FLabel label_2(&dgl); - label_1 << wchar_t(fc::BlackUpPointingTriangle) + label_1 << wchar_t(finalcut::fc::BlackUpPointingTriangle) << std::wstring(L"\n") - << wchar_t(fc::BoxDrawingsUpAndRight) - << FString(2, wchar_t(fc::BoxDrawingsHorizontal)) + << wchar_t(finalcut::fc::BoxDrawingsUpAndRight) + << finalcut::FString(2, wchar_t(finalcut::fc::BoxDrawingsHorizontal)) << " Double click the title bar button,"; label_2 << "press Q on the keyboard,\n" << "or push the button below to exit\n" @@ -66,7 +66,7 @@ int main (int argc, char* argv[]) label_2.setGeometry (5, 3, 34, 3); // Create the quit button - FButton btn("&Quit", &dgl); + finalcut::FButton btn("&Quit", &dgl); btn.setGeometry (16, 7, 9, 1); // Connect the button signal "clicked" with the callback function diff --git a/examples/hello.cpp b/examples/hello.cpp index 34d0d5f9..1d8e546c 100644 --- a/examples/hello.cpp +++ b/examples/hello.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2017 Markus Gans * +* Copyright 2015-2018 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 * @@ -26,10 +26,10 @@ int main (int argc, char* argv[]) { // Create the application object - FApplication app(argc, argv); + finalcut::FApplication app(argc, argv); // Create a simple dialog box - FMessageBox mbox(&app); + finalcut::FMessageBox mbox(&app); mbox.setText("Hello world"); // Start the application diff --git a/examples/input-dialog.cpp b/examples/input-dialog.cpp index 4049db50..25a5ec92 100644 --- a/examples/input-dialog.cpp +++ b/examples/input-dialog.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2017 Markus Gans * +* Copyright 2015-2018 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 * @@ -24,22 +24,22 @@ // function prototypes -void cb_quit (FWidget*, FWidget::data_ptr); -void cb_publish (FWidget*, FWidget::data_ptr); +void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr); +void cb_publish (finalcut::FWidget*, finalcut::FWidget::data_ptr); //---------------------------------------------------------------------- // callback functions //---------------------------------------------------------------------- -void cb_quit (FWidget*, FWidget::data_ptr data) +void cb_quit (finalcut::FWidget*, finalcut::FWidget::data_ptr data) { - FApplication* app = static_cast(data); + finalcut::FApplication* app = static_cast(data); app->quit(); } -void cb_publish (FWidget* widget, FWidget::data_ptr data) +void cb_publish (finalcut::FWidget* widget, finalcut::FWidget::data_ptr data) { - FCheckBox* cbox1 = static_cast(widget); - FCheckBox* cbox2 = static_cast(data); + finalcut::FCheckBox* cbox1 = static_cast(widget); + finalcut::FCheckBox* cbox2 = static_cast(data); if ( cbox1->isChecked() ) cbox2->setEnable(); @@ -57,21 +57,21 @@ void cb_publish (FWidget* widget, FWidget::data_ptr data) int main (int argc, char* argv[]) { // Create the application object - FApplication app(argc, argv); + finalcut::FApplication app(argc, argv); // Create a simple dialog box - FDialog dgl(&app); + finalcut::FDialog dgl(&app); dgl.setText ("Data input"); dgl.setGeometry (4, 2, 37, 22); dgl.setShadow(); // Create input fields - FLineEdit* name_field = new FLineEdit(&dgl); - FLineEdit* email_field = new FLineEdit(&dgl); - FLineEdit* org_field = new FLineEdit(&dgl); - FLineEdit* city_field = new FLineEdit(&dgl); - FLineEdit* st_field = new FLineEdit(&dgl); - FLineEdit* c_field = new FLineEdit(&dgl); + finalcut::FLineEdit* name_field = new finalcut::FLineEdit(&dgl); + finalcut::FLineEdit* email_field = new finalcut::FLineEdit(&dgl); + finalcut::FLineEdit* org_field = new finalcut::FLineEdit(&dgl); + finalcut::FLineEdit* city_field = new finalcut::FLineEdit(&dgl); + finalcut::FLineEdit* st_field = new finalcut::FLineEdit(&dgl); + finalcut::FLineEdit* c_field = new finalcut::FLineEdit(&dgl); name_field->setLabelText(L"&Name"); email_field->setLabelText(L"&Email"); @@ -88,28 +88,34 @@ int main (int argc, char* argv[]) c_field->setGeometry(15, 11, 4, 1); // Create the button group - FButtonGroup* radioButtonGroup = new FButtonGroup("Sex", &dgl); + finalcut::FButtonGroup* radioButtonGroup = \ + new finalcut::FButtonGroup("Sex", &dgl); radioButtonGroup->setGeometry(2, 13, 13, 4); // Create radio buttons - FRadioButton* male = new FRadioButton("&Male", radioButtonGroup); - FRadioButton* female = new FRadioButton("&Female", radioButtonGroup); + finalcut::FRadioButton* male = \ + new finalcut::FRadioButton("&Male", radioButtonGroup); + finalcut::FRadioButton* female = \ + new finalcut::FRadioButton("&Female", radioButtonGroup); male->setGeometry(1, 1, 8, 1); female->setGeometry(1, 2, 10, 1); // Create another button group - FButtonGroup* checkButtonGroup = new FButtonGroup("&Data options", &dgl); + finalcut::FButtonGroup* checkButtonGroup = \ + new finalcut::FButtonGroup("&Data options", &dgl); checkButtonGroup->setGeometry(16, 13, 19, 4); // Create checkbox buttons - FCheckBox* check1 = new FCheckBox("Save data", checkButtonGroup); - FCheckBox* check2 = new FCheckBox("Encrypt data", checkButtonGroup); + finalcut::FCheckBox* check1 = \ + new finalcut::FCheckBox("Save data", checkButtonGroup); + finalcut::FCheckBox* check2 = \ + new finalcut::FCheckBox("Encrypt data", checkButtonGroup); check1->setGeometry(1, 1, 13, 1); check2->setGeometry(1, 2, 16, 1); check2->setDisable(); // Create a OK button - FButton btn("&OK", &dgl); + finalcut::FButton btn("&OK", &dgl); btn.setGeometry (24, 18, 10, 1); // Connect checkbox signal "clicked" with a callback function diff --git a/examples/keyboard.cpp b/examples/keyboard.cpp index 6caa57da..c5fc5fa5 100644 --- a/examples/keyboard.cpp +++ b/examples/keyboard.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2017 Markus Gans * +* Copyright 2015-2018 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 * @@ -26,30 +26,30 @@ // class Keyboard //---------------------------------------------------------------------- -class Keyboard : public FWidget +class Keyboard : public finalcut::FWidget { public: // Constructor - explicit Keyboard (FWidget* = 0); + explicit Keyboard (finalcut::FWidget* = 0); protected: // Event handlers - void onKeyPress (FKeyEvent*); - void onAccel (FAccelEvent*); + void onKeyPress (finalcut::FKeyEvent*); + void onAccel (finalcut::FAccelEvent*); void draw(); }; //---------------------------------------------------------------------- -Keyboard::Keyboard (FWidget* parent) - : FWidget(parent) +Keyboard::Keyboard (finalcut::FWidget* parent) + : finalcut::FWidget(parent) { - wc.term_fg = fc::Default; - wc.term_bg = fc::Default; + wc.term_fg = finalcut::fc::Default; + wc.term_bg = finalcut::fc::Default; } //---------------------------------------------------------------------- -void Keyboard::onKeyPress (FKeyEvent* ev) +void Keyboard::onKeyPress (finalcut::FKeyEvent* ev) { int key_id = ev->key(); bool is_last_line = false; @@ -67,7 +67,7 @@ void Keyboard::onKeyPress (FKeyEvent* ev) } //---------------------------------------------------------------------- -void Keyboard::onAccel (FAccelEvent* ev) +void Keyboard::onAccel (finalcut::FAccelEvent* ev) { quit(); ev->accept(); @@ -89,9 +89,9 @@ void Keyboard::draw() int main (int argc, char* argv[]) { // Create the application object - FApplication app(argc, argv); - app.setForegroundColor(fc::Default); - app.setBackgroundColor(fc::Default); + finalcut::FApplication app(argc, argv); + app.setForegroundColor(finalcut::fc::Default); + app.setBackgroundColor(finalcut::fc::Default); // Create a keyboard object Keyboard key(&app); diff --git a/examples/listbox.cpp b/examples/listbox.cpp index d825c94b..23a731c1 100644 --- a/examples/listbox.cpp +++ b/examples/listbox.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2017 Markus Gans * +* Copyright 2017-2018 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 * @@ -29,31 +29,38 @@ // Global application object -static FString* temp_str = 0; +static finalcut::FString* temp_str = 0; + // Function prototypes -void doubleToItem (FListBoxItem&, FWidget::data_ptr container, int index); -FString& doubleToString (std::list::const_iterator iter); -FString& mapToString (std::map::const_iterator iter); +void doubleToItem ( finalcut::FListBoxItem& + , finalcut::FWidget::data_ptr container + , int index) ; +finalcut::FString& doubleToString (std::list::const_iterator iter); +finalcut::FString& mapToString ( std::map::const_iterator iter ); + // Lazy conversion import function -void doubleToItem (FListBoxItem& item, FWidget::data_ptr container, int index) +void doubleToItem ( finalcut::FListBoxItem& item + , finalcut::FWidget::data_ptr container, int index) { typedef std::list* double_list_ptr; double_list_ptr dbllist = static_cast(container); std::list::iterator iter = dbllist->begin(); std::advance (iter, index); - item.setText (FString() << *iter); - item.setData (FWidget::data_ptr(&(*iter))); + item.setText (finalcut::FString() << *iter); + item.setData (finalcut::FWidget::data_ptr(&(*iter))); } // Import converter functions -FString& doubleToString (std::list::const_iterator iter) +finalcut::FString& doubleToString (std::list::const_iterator iter) { return temp_str->setNumber(*iter); } -FString& mapToString (std::map::const_iterator iter) +finalcut::FString& mapToString ( std::map::const_iterator iter ) { return *temp_str = iter->first + ": " + iter->second; } @@ -66,7 +73,7 @@ FString& mapToString (std::map::const_iterator iter) #pragma pack(push) #pragma pack(1) -class Listbox : public FDialog +class Listbox : public finalcut::FDialog { public: // Constructor @@ -81,7 +88,7 @@ class Listbox : public FDialog Listbox& operator = (const Listbox&); // Event handlers - void onClose (FCloseEvent*); + void onClose (finalcut::FCloseEvent*); // Data Member std::list* double_list; @@ -89,19 +96,19 @@ class Listbox : public FDialog #pragma pack(pop) //---------------------------------------------------------------------- -Listbox::Listbox (FWidget* parent) - : FDialog(parent) +Listbox::Listbox (finalcut::FWidget* parent) + : finalcut::FDialog(parent) , double_list() { - temp_str = new FString; + temp_str = new finalcut::FString; // listbox 1 - FListBox* list1 = new FListBox (this); + finalcut::FListBox* list1 = new finalcut::FListBox (this); list1->setGeometry(2, 1, 18, 10); list1->setText ("FListBoxItem"); for (int i = 1; i < 30; i++) - list1->insert (L"----- " + (FString() << i) + L" -----"); + list1->insert (L"----- " + (finalcut::FString() << i) + L" -----"); // listbox 2 double_list = new std::list; @@ -109,7 +116,7 @@ Listbox::Listbox (FWidget* parent) for (double i = 1; i<=15; i++) double_list->push_back(2 * i + (i / 100)); - FListBox* list2 = new FListBox (this); + finalcut::FListBox* list2 = new finalcut::FListBox (this); list2->setGeometry(21, 1, 10, 10); list2->setText ("double"); @@ -124,20 +131,20 @@ Listbox::Listbox (FWidget* parent) //list2->insert (double_list->begin(), double_list->end(), doubleToString); // listbox 3 - std::map TLD; + std::map TLD; TLD["com"] = "Commercial"; TLD["org"] = "Organization"; TLD["net"] = "Network"; TLD["edu"] = "Education"; TLD["gov"] = "Government"; - FListBox* list3; - list3 = new FListBox (TLD.begin(), TLD.end(), mapToString, this); + finalcut::FListBox* list3; + list3 = new finalcut::FListBox (TLD.begin(), TLD.end(), mapToString, this); list3->setGeometry(32, 1, 21, 10); list3->setText ("key: value"); // Quit button - FButton* Quit = new FButton (this); + finalcut::FButton* Quit = new finalcut::FButton (this); Quit->setGeometry(42, 12, 10, 1); Quit->setText (L"&Quit"); @@ -145,7 +152,7 @@ Listbox::Listbox (FWidget* parent) Quit->addCallback ( "clicked", - F_METHOD_CALLBACK (this, &FApplication::cb_exitApp) + F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) ); } @@ -157,9 +164,9 @@ Listbox::~Listbox() // destructor } //---------------------------------------------------------------------- -void Listbox::onClose (FCloseEvent* ev) +void Listbox::onClose (finalcut::FCloseEvent* ev) { - FApplication::closeConfirmationDialog (this, ev); + finalcut::FApplication::closeConfirmationDialog (this, ev); } @@ -170,7 +177,7 @@ void Listbox::onClose (FCloseEvent* ev) int main (int argc, char* argv[]) { // Create the application object - FApplication app(argc, argv); + finalcut::FApplication app(argc, argv); // Create main dialog object Listbox d(&app); diff --git a/examples/listview.cpp b/examples/listview.cpp index f00eb211..7c9f0137 100644 --- a/examples/listview.cpp +++ b/examples/listview.cpp @@ -35,11 +35,11 @@ #pragma pack(push) #pragma pack(1) -class Listview : public FDialog +class Listview : public finalcut::FDialog { public: // Constructor - explicit Listview (FWidget* = 0); + explicit Listview (finalcut::FWidget* = 0); // Destructor ~Listview(); @@ -50,22 +50,22 @@ class Listview : public FDialog Listview& operator = (const Listview&); // Method - void populate (FListView*); + void populate (finalcut::FListView*); // Event handlers - void onClose (FCloseEvent*); + void onClose (finalcut::FCloseEvent*); // Callback method - void cb_showInMessagebox (FWidget*, data_ptr); + void cb_showInMessagebox (finalcut::FWidget*, data_ptr); }; #pragma pack(pop) //---------------------------------------------------------------------- -Listview::Listview (FWidget* parent) - : FDialog(parent) +Listview::Listview (finalcut::FWidget* parent) + : finalcut::FDialog(parent) { // Create FListView object - FListView* listView = new FListView (this); + finalcut::FListView* listView = new finalcut::FListView (this); listView->setGeometry(2, 1, 33, 14); // Add columns to the view @@ -76,15 +76,15 @@ Listview::Listview (FWidget* parent) listView->addColumn ("Pressure", 10); // Set right alignment for the third, fourth, and fifth column - listView->setColumnAlignment (3, fc::alignRight); - listView->setColumnAlignment (4, fc::alignRight); - listView->setColumnAlignment (5, fc::alignRight); + listView->setColumnAlignment (3, finalcut::fc::alignRight); + listView->setColumnAlignment (4, finalcut::fc::alignRight); + listView->setColumnAlignment (5, finalcut::fc::alignRight); // Populate FListView with a list of items populate (listView); // Quit button - FButton* Quit = new FButton (this); + finalcut::FButton* Quit = new finalcut::FButton (this); Quit->setGeometry(24, 16, 10, 1); Quit->setText (L"&Quit"); @@ -92,7 +92,7 @@ Listview::Listview (FWidget* parent) Quit->addCallback ( "clicked", - F_METHOD_CALLBACK (this, &FApplication::cb_exitApp) + F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) ); listView->addCallback @@ -107,7 +107,7 @@ Listview::~Listview() // destructor { } //---------------------------------------------------------------------- -void Listview::populate (FListView* listView) +void Listview::populate (finalcut::FListView* listView) { std::string weather[][5] = { @@ -158,31 +158,32 @@ void Listview::populate (FListView* listView) for (int i = 0; i <= lastItem; i++) { - FStringList line (&weather[i][0], &weather[i][0] + 5); + finalcut::FStringList line (&weather[i][0], &weather[i][0] + 5); listView->insert (line); } } //---------------------------------------------------------------------- -void Listview::onClose (FCloseEvent* ev) +void Listview::onClose (finalcut::FCloseEvent* ev) { - FApplication::closeConfirmationDialog (this, ev); + finalcut::FApplication::closeConfirmationDialog (this, ev); } //---------------------------------------------------------------------- -void Listview::cb_showInMessagebox (FWidget* widget, data_ptr) +void Listview::cb_showInMessagebox (finalcut::FWidget* widget, data_ptr) { - FListView* listView = static_cast(widget); - FListViewItem* item = listView->getCurrentItem(); - FMessageBox info ( "Weather in " + item->getText(1) - , " Condition: " + item->getText(2) + "\n" - "Temperature: " + item->getText(3) + "\n" - " Humidity: " + item->getText(4) + "\n" - " Pressure: " + item->getText(5) - , FMessageBox::Ok, 0, 0, this ); + finalcut::FListView* listView = static_cast(widget); + finalcut::FListViewItem* item = listView->getCurrentItem(); + finalcut::FMessageBox info ( "Weather in " + item->getText(1) + , " Condition: " + item->getText(2) + "\n" + "Temperature: " + item->getText(3) + "\n" + " Humidity: " + item->getText(4) + "\n" + " Pressure: " + item->getText(5) + , finalcut::FMessageBox::Ok, 0, 0, this ); info.show(); } + //---------------------------------------------------------------------- // main part //---------------------------------------------------------------------- @@ -190,7 +191,7 @@ void Listview::cb_showInMessagebox (FWidget* widget, data_ptr) int main (int argc, char* argv[]) { // Create the application object - FApplication app(argc, argv); + finalcut::FApplication app(argc, argv); // Create main dialog object Listview d(&app); diff --git a/examples/mandelbrot.cpp b/examples/mandelbrot.cpp index 766b356f..a854898c 100644 --- a/examples/mandelbrot.cpp +++ b/examples/mandelbrot.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2017 Markus Gans * +* Copyright 2015-2018 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 * @@ -30,18 +30,18 @@ #pragma pack(push) #pragma pack(1) -class Mandelbrot : public FDialog +class Mandelbrot : public finalcut::FDialog { public: // Constructor - explicit Mandelbrot (FWidget* = 0); + explicit Mandelbrot (finalcut::FWidget* = 0); // Destructor ~Mandelbrot(); // Event handlers - void onAccel (FAccelEvent*); - void onClose (FCloseEvent*); + void onAccel (finalcut::FAccelEvent*); + void onClose (finalcut::FCloseEvent*); private: // Methods @@ -51,8 +51,8 @@ class Mandelbrot : public FDialog #pragma pack(pop) //---------------------------------------------------------------------- -Mandelbrot::Mandelbrot (FWidget* parent) - : FDialog(parent) +Mandelbrot::Mandelbrot (finalcut::FWidget* parent) + : finalcut::FDialog(parent) { setText ("Mandelbrot set"); } @@ -69,7 +69,7 @@ void Mandelbrot::draw() double x, y, xtemp, x0, y0, dX, dY; double x_min, x_max, y_min, y_max; - FDialog::draw(); + finalcut::FDialog::draw(); x_min = -2.20; x_max = 1.00; @@ -106,9 +106,9 @@ void Mandelbrot::draw() } if ( iter < max_iter ) - setColor(fc::Black, iter % 16); + setColor(finalcut::fc::Black, iter % 16); else - setColor(fc::Black, 0); + setColor(finalcut::fc::Black, 0); print(' '); } @@ -116,16 +116,16 @@ void Mandelbrot::draw() } //---------------------------------------------------------------------- -void Mandelbrot::onAccel (FAccelEvent* ev) +void Mandelbrot::onAccel (finalcut::FAccelEvent* ev) { close(); ev->accept(); } //---------------------------------------------------------------------- -void Mandelbrot::onClose (FCloseEvent* ev) +void Mandelbrot::onClose (finalcut::FCloseEvent* ev) { - FApplication::closeConfirmationDialog (this, ev); + finalcut::FApplication::closeConfirmationDialog (this, ev); } //---------------------------------------------------------------------- @@ -134,7 +134,7 @@ void Mandelbrot::adjustSize() int h = getParentWidget()->getHeight() - 1; int w = getParentWidget()->getWidth() - 10; setGeometry(6, 1, w, h, false); - FDialog::adjustSize(); + finalcut::FDialog::adjustSize(); } //---------------------------------------------------------------------- @@ -143,7 +143,7 @@ void Mandelbrot::adjustSize() int main (int argc, char* argv[]) { // Create the application object - FApplication app(argc, argv); + finalcut::FApplication app(argc, argv); // Create a simple dialog box Mandelbrot mb(&app); diff --git a/examples/menu.cpp b/examples/menu.cpp index 68cd77bb..1aaf7eaf 100644 --- a/examples/menu.cpp +++ b/examples/menu.cpp @@ -30,11 +30,11 @@ #pragma pack(push) #pragma pack(1) -class Menu : public FDialog +class Menu : public finalcut::FDialog { public: // Constructor - explicit Menu (FWidget* = 0); + explicit Menu (finalcut::FWidget* = 0); // Destructor ~Menu(); @@ -47,42 +47,47 @@ class Menu : public FDialog Menu& operator = (const Menu&); // Methods - void createFileMenuItems (FMenu*); - void createEditMenuItems (FMenu*); - void createChoiceMenuItems (FMenu*); - void createColorMenuItems (FMenu*); - void createStyleMenuItems (FMenu*); - void createBorderMenuItems (FMenu*); - void createBorderColorMenuItems (FMenu*); - void createBorderStyleMenuItems (FMenu*); - void defaultCallback (FMenuList*); + void createFileMenuItems (finalcut::FMenu*); + void createEditMenuItems (finalcut::FMenu*); + void createChoiceMenuItems (finalcut::FMenu*); + void createColorMenuItems (finalcut::FMenu*); + void createStyleMenuItems (finalcut::FMenu*); + void createBorderMenuItems (finalcut::FMenu*); + void createBorderColorMenuItems (finalcut::FMenu*); + void createBorderStyleMenuItems (finalcut::FMenu*); + void defaultCallback (finalcut::FMenuList*); void adjustSize(); // Event handler - void onClose (FCloseEvent*); + void onClose (finalcut::FCloseEvent*); // Callback method - void cb_message (FWidget*, data_ptr); + void cb_message (finalcut::FWidget*, data_ptr); }; #pragma pack(pop) //---------------------------------------------------------------------- -Menu::Menu (FWidget* parent) - : FDialog(parent) +Menu::Menu (finalcut::FWidget* parent) + : finalcut::FDialog(parent) { // Menu bar - FMenuBar* Menubar = new FMenuBar (this); + finalcut::FMenuBar* Menubar = new finalcut::FMenuBar(this); // Menu bar items - FMenu* File = new FMenu ("&File", Menubar); + finalcut::FMenu* File = \ + new finalcut::FMenu ("&File", Menubar); File->setStatusbarMessage ("File management commands"); - FMenu* Edit = new FMenu ("&Edit", Menubar); + finalcut::FMenu* Edit = \ + new finalcut::FMenu ("&Edit", Menubar); Edit->setStatusbarMessage ("Cut-and-paste editing commands"); - FMenu* Choice = new FMenu ("&Choice", Menubar); + finalcut::FMenu* Choice = \ + new finalcut::FMenu ("&Choice", Menubar); Choice->setStatusbarMessage ("Choice menu"); - FMenuItem* Window = new FMenuItem ("&Window", Menubar); + finalcut::FMenuItem* Window = \ + new finalcut::FMenuItem ("&Window", Menubar); Window->setDisable(); - FMenuItem* Help = new FMenuItem ("&Help", Menubar); + finalcut::FMenuItem* Help = \ + new finalcut::FMenuItem ("&Help", Menubar); Help->setStatusbarMessage ("Show version and copyright information"); // Menu items @@ -94,24 +99,28 @@ Menu::Menu (FWidget* parent) defaultCallback (Menubar); // Statusbar at the bottom - FStatusBar* Statusbar = new FStatusBar (this); + finalcut::FStatusBar* Statusbar = \ + new finalcut::FStatusBar (this); Statusbar->setMessage("Status bar message"); // Headline labels - FLabel* Headline1 = new FLabel(" Key ", this); + finalcut::FLabel* Headline1 = \ + new finalcut::FLabel(" Key ", this); Headline1->ignorePadding(); Headline1->setGeometry(3, 2, 5, 1); Headline1->setEmphasis(); - FLabel* Headline2 = new FLabel(" Function ", this); + finalcut::FLabel* Headline2 = \ + new finalcut::FLabel(" Function ", this); Headline2->ignorePadding(); Headline2->setGeometry(19, 2, 10, 1); Headline2->setEmphasis(); // Info label - FLabel* Info = new FLabel(" Activate menu bar\n" + finalcut::FLabel* Info = \ + new finalcut::FLabel( " Activate menu bar\n" "+ Activate menu bar\n" - "+ Exit", this); + "+ Exit", this ); Info->setGeometry(2, 1, 36, 3); } @@ -120,80 +129,100 @@ Menu::~Menu() { } //---------------------------------------------------------------------- -void Menu::createFileMenuItems (FMenu* File) +void Menu::createFileMenuItems (finalcut::FMenu* File) { // "File" menu items - FMenuItem* New = new FMenuItem ("&New", File); - New->addAccelerator (fc::Fckey_n); // Ctrl + N + finalcut::FMenuItem* New = \ + new finalcut::FMenuItem ("&New", File); + New->addAccelerator (finalcut::fc::Fckey_n); // Ctrl + N New->setStatusbarMessage ("Create a new file"); - FMenuItem* Open = new FMenuItem ("&Open...", File); - Open->addAccelerator (fc::Fckey_o); // Ctrl + O + finalcut::FMenuItem* Open = \ + new finalcut::FMenuItem ("&Open...", File); + Open->addAccelerator (finalcut::fc::Fckey_o); // Ctrl + O Open->setStatusbarMessage ("Locate and open a text file"); - FMenuItem* Save = new FMenuItem ("&Save", File); - Save->addAccelerator (fc::Fckey_s); // Ctrl + S + finalcut::FMenuItem* Save = \ + new finalcut::FMenuItem ("&Save", File); + Save->addAccelerator (finalcut::fc::Fckey_s); // Ctrl + S Save->setStatusbarMessage ("Save the file"); - FMenuItem* SaveAs = new FMenuItem ("&Save as...", File); + finalcut::FMenuItem* SaveAs = \ + new finalcut::FMenuItem ("&Save as...", File); SaveAs->setStatusbarMessage ("Save the current file under a different name"); - FMenuItem* Close = new FMenuItem ("&Close", File); - Close->addAccelerator (fc::Fckey_w); // Ctrl + W + finalcut::FMenuItem* Close = \ + new finalcut::FMenuItem ("&Close", File); + Close->addAccelerator (finalcut::fc::Fckey_w); // Ctrl + W Close->setStatusbarMessage ("Close the current file"); - FMenuItem* Line1 = new FMenuItem (File); + finalcut::FMenuItem* Line1 = \ + new finalcut::FMenuItem (File); Line1->setSeparator(); - FMenuItem* Print = new FMenuItem ("&Print", File); - Print->addAccelerator (fc::Fckey_p); // Ctrl + P + finalcut::FMenuItem* Print = \ + new finalcut::FMenuItem ("&Print", File); + Print->addAccelerator (finalcut::fc::Fckey_p); // Ctrl + P Print->setStatusbarMessage ("Print the current file"); - FMenuItem* Line2 = new FMenuItem (File); + finalcut::FMenuItem* Line2 = \ + new finalcut::FMenuItem (File); Line2->setSeparator(); - FMenuItem* Quit = new FMenuItem ("&Quit", File); - Quit->addAccelerator (fc::Fmkey_x); // Meta/Alt + X + finalcut::FMenuItem* Quit = \ + new finalcut::FMenuItem ("&Quit", File); + Quit->addAccelerator (finalcut::fc::Fmkey_x); // Meta/Alt + X Quit->setStatusbarMessage ("Exit the program"); // Add quit menu item callback Quit->addCallback ( "clicked", - F_METHOD_CALLBACK (this, &FApplication::cb_exitApp) + F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) ); } //---------------------------------------------------------------------- -void Menu::createEditMenuItems (FMenu* Edit) +void Menu::createEditMenuItems (finalcut::FMenu* Edit) { // "Edit" menu items - FMenuItem* Undo = new FMenuItem (fc::Fckey_z, "&Undo", Edit); + finalcut::FMenuItem* Undo = \ + new finalcut::FMenuItem (finalcut::fc::Fckey_z, "&Undo", Edit); Undo->setStatusbarMessage ("Undo the previous operation"); - FMenuItem* Redo = new FMenuItem (fc::Fckey_y, "&Redo", Edit); + finalcut::FMenuItem* Redo = \ + new finalcut::FMenuItem (finalcut::fc::Fckey_y, "&Redo", Edit); Redo->setDisable(); - FMenuItem* Line3 = new FMenuItem (Edit); + finalcut::FMenuItem* Line3 = \ + new finalcut::FMenuItem (Edit); Line3->setSeparator(); - FMenuItem* Cut = new FMenuItem (fc::Fckey_x, "Cu&t", Edit); + finalcut::FMenuItem* Cut = \ + new finalcut::FMenuItem (finalcut::fc::Fckey_x, "Cu&t", Edit); Cut->setStatusbarMessage ( "Remove the input text " "and put it in the clipboard" ); - FMenuItem* Copy = new FMenuItem (fc::Fckey_c, "&Copy", Edit); + finalcut::FMenuItem* Copy = \ + new finalcut::FMenuItem (finalcut::fc::Fckey_c, "&Copy", Edit); Copy->setStatusbarMessage ("Copy the input text into the clipboad"); - FMenuItem* Paste = new FMenuItem (fc::Fckey_v, "&Paste", Edit); + finalcut::FMenuItem* Paste = \ + new finalcut::FMenuItem (finalcut::fc::Fckey_v, "&Paste", Edit); Paste->setStatusbarMessage ("Insert text form clipboard"); - FMenuItem* Line4 = new FMenuItem (Edit); + finalcut::FMenuItem* Line4 = \ + new finalcut::FMenuItem (Edit); Line4->setSeparator(); - FMenuItem* Search = new FMenuItem (fc::Fckey_f, "&Search", Edit); + finalcut::FMenuItem* Search = \ + new finalcut::FMenuItem (finalcut::fc::Fckey_f, "&Search", Edit); Search->setStatusbarMessage ("Search for text"); - FMenuItem* Next = new FMenuItem (fc::Fkey_f3, "Search &next", Edit); + finalcut::FMenuItem* Next = \ + new finalcut::FMenuItem (finalcut::fc::Fkey_f3, "Search &next", Edit); Next->setStatusbarMessage ("Repeat the last search command"); - FMenuItem* Line5 = new FMenuItem (Edit); + finalcut::FMenuItem* Line5 = \ + new finalcut::FMenuItem (Edit); Line5->setSeparator(); - FMenuItem* SelectAll = new FMenuItem (fc::Fckey_a, "Select &all", Edit); + finalcut::FMenuItem* SelectAll = \ + new finalcut::FMenuItem (finalcut::fc::Fckey_a, "Select &all", Edit); SelectAll->setStatusbarMessage ("Select the whole text"); } //---------------------------------------------------------------------- -void Menu::createChoiceMenuItems (FMenu* Choice) +void Menu::createChoiceMenuItems (finalcut::FMenu* Choice) { // "Choice" menu items - FMenu* Color = new FMenu ("&Color", Choice); + finalcut::FMenu* Color = new finalcut::FMenu ("&Color", Choice); Color->setStatusbarMessage ("Choose a color"); - FMenu* Style = new FMenu ("&Style", Choice); + finalcut::FMenu* Style = new finalcut::FMenu ("&Style", Choice); Style->setStatusbarMessage ("Choose a Style"); - FMenu* Border = new FMenu ("&Border", Choice); + finalcut::FMenu* Border = new finalcut::FMenu ("&Border", Choice); Border->setStatusbarMessage ("Choose Border"); createColorMenuItems (Color); @@ -202,39 +231,46 @@ void Menu::createChoiceMenuItems (FMenu* Choice) } //---------------------------------------------------------------------- -void Menu::createColorMenuItems (FMenu* Color) +void Menu::createColorMenuItems (finalcut::FMenu* Color) { // "Color" menu items - FRadioMenuItem* Color1 = new FRadioMenuItem ("Red", Color); + finalcut::FRadioMenuItem* Color1 = \ + new finalcut::FRadioMenuItem ("Red", Color); Color1->setStatusbarMessage ("Set text red"); - FRadioMenuItem* Color2 = new FRadioMenuItem ("Green", Color); + finalcut::FRadioMenuItem* Color2 = \ + new finalcut::FRadioMenuItem ("Green", Color); Color2->setStatusbarMessage ("Set text green"); - FRadioMenuItem* Color3 = new FRadioMenuItem ("Yellow", Color); + finalcut::FRadioMenuItem* Color3 = \ + new finalcut::FRadioMenuItem ("Yellow", Color); Color3->setStatusbarMessage ("Set text yellow"); - FRadioMenuItem* Color4 = new FRadioMenuItem ("Brue", Color); + finalcut::FRadioMenuItem* Color4 = \ + new finalcut::FRadioMenuItem ("Brue", Color); Color4->setStatusbarMessage ("Set text brue"); - FRadioMenuItem* Color5 = new FRadioMenuItem ("Black", Color); + finalcut::FRadioMenuItem* Color5 = \ + new finalcut::FRadioMenuItem ("Black", Color); Color5->setStatusbarMessage ("Set text black"); Color5->setChecked(); } //---------------------------------------------------------------------- -void Menu::createStyleMenuItems (FMenu* Style) +void Menu::createStyleMenuItems (finalcut::FMenu* Style) { // "Style" menu items - FCheckMenuItem* Bold = new FCheckMenuItem ("Bold", Style); + finalcut::FCheckMenuItem* Bold = \ + new finalcut::FCheckMenuItem ("Bold", Style); Bold->setStatusbarMessage ("Set text bold"); - FCheckMenuItem* Italic = new FCheckMenuItem ("Italic", Style); + finalcut::FCheckMenuItem* Italic = \ + new finalcut::FCheckMenuItem ("Italic", Style); Italic->setStatusbarMessage ("Set text italic"); } //---------------------------------------------------------------------- -void Menu::createBorderMenuItems (FMenu* Border) +void Menu::createBorderMenuItems (finalcut::FMenu* Border) { // "Border" menu items - FMenu* BColor = new FMenu ("&Color", Border); + finalcut::FMenu* BColor = new finalcut::FMenu ("&Color", Border); BColor->setStatusbarMessage ("Choose the border color"); - FMenu* BStyle = new FMenu ("&Style", Border); + finalcut::FMenu* BStyle = new finalcut::FMenu ("&Style", Border); BStyle->setStatusbarMessage ("Choose the border Style"); createBorderColorMenuItems (BColor); @@ -242,37 +278,43 @@ void Menu::createBorderMenuItems (FMenu* Border) } //---------------------------------------------------------------------- -void Menu::createBorderColorMenuItems (FMenu* BColor) +void Menu::createBorderColorMenuItems (finalcut::FMenu* BColor) { // "BColor" menu items - FRadioMenuItem* BColor1 = new FRadioMenuItem ("Red", BColor); + finalcut::FRadioMenuItem* BColor1 = \ + new finalcut::FRadioMenuItem ("Red", BColor); BColor1->setStatusbarMessage ("Set red border"); - FRadioMenuItem* BColor2 = new FRadioMenuItem ("Blue", BColor); + finalcut::FRadioMenuItem* BColor2 = \ + new finalcut::FRadioMenuItem ("Blue", BColor); BColor2->setStatusbarMessage ("Set blue border"); } //---------------------------------------------------------------------- -void Menu::createBorderStyleMenuItems (FMenu* BStyle) +void Menu::createBorderStyleMenuItems (finalcut::FMenu* BStyle) { // "BStyle" menu items - FString line(13, wchar_t(fc::BoxDrawingsHorizontal)); - FRadioMenuItem* BStyle1 = new FRadioMenuItem (line, BStyle); + finalcut::FString line(13, wchar_t(finalcut::fc::BoxDrawingsHorizontal)); + finalcut::FRadioMenuItem* BStyle1 = \ + new finalcut::FRadioMenuItem (line, BStyle); BStyle1->setChecked(); BStyle1->setStatusbarMessage ("Set border 1"); - FRadioMenuItem* BStyle2 = new FRadioMenuItem ("-------------", BStyle); + finalcut::FRadioMenuItem* BStyle2 = \ + new finalcut::FRadioMenuItem ("-------------", BStyle); BStyle2->setStatusbarMessage ("Set border 2"); - FRadioMenuItem* BStyle3 = new FRadioMenuItem ("- - - - - - -", BStyle); + finalcut::FRadioMenuItem* BStyle3 = \ + new finalcut::FRadioMenuItem ("- - - - - - -", BStyle); BStyle3->setStatusbarMessage ("Set border 3"); - FRadioMenuItem* BStyle4 = new FRadioMenuItem ("- - - - -", BStyle); + finalcut::FRadioMenuItem* BStyle4 = \ + new finalcut::FRadioMenuItem ("- - - - -", BStyle); BStyle4->setStatusbarMessage ("Set border 4"); } //---------------------------------------------------------------------- -void Menu::defaultCallback (FMenuList* mb) +void Menu::defaultCallback (finalcut::FMenuList* mb) { for (uInt i = 1; i <= mb->getCount(); i++) { - FMenuItem* item = mb->getItem(int(i)); + finalcut::FMenuItem* item = mb->getItem(int(i)); if ( item && item->isEnabled() @@ -302,22 +344,25 @@ void Menu::adjustSize() int ph = getParentWidget()->getHeight(); setX (1 + (pw - getWidth()) / 2, false); setY (1 + (ph - getHeight()) / 4, false); - FDialog::adjustSize(); + finalcut::FDialog::adjustSize(); } //---------------------------------------------------------------------- -void Menu::onClose (FCloseEvent* ev) +void Menu::onClose (finalcut::FCloseEvent* ev) { - FApplication::closeConfirmationDialog (this, ev); + finalcut::FApplication::closeConfirmationDialog (this, ev); } //---------------------------------------------------------------------- -void Menu::cb_message (FWidget* widget, data_ptr) +void Menu::cb_message (finalcut::FWidget* widget, data_ptr) { - FMenuItem* menuitem = static_cast(widget); - FString text = menuitem->getText(); + finalcut::FMenuItem* menuitem = \ + static_cast(widget); + finalcut::FString text = menuitem->getText(); text = text.replace('&', ""); - FMessageBox::info (this, "Info", "You have chosen \"" + text + "\""); + finalcut::FMessageBox::info ( this + , "Info" + , "You have chosen \"" + text + "\"" ); } @@ -328,7 +373,7 @@ void Menu::cb_message (FWidget* widget, data_ptr) int main (int argc, char* argv[]) { // Create the application object - FApplication app (argc, argv); + finalcut::FApplication app (argc, argv); // Create main dialog object Menu main_dlg (&app); diff --git a/examples/mouse.cpp b/examples/mouse.cpp index ebd13e8e..e22fb230 100644 --- a/examples/mouse.cpp +++ b/examples/mouse.cpp @@ -30,11 +30,11 @@ #pragma pack(push) #pragma pack(1) -class ColorChooser : public FWidget +class ColorChooser : public finalcut::FWidget { public: // Constructor - explicit ColorChooser (FWidget* = 0); + explicit ColorChooser (finalcut::FWidget* = 0); // Destructor ~ColorChooser(); @@ -53,7 +53,7 @@ class ColorChooser : public FWidget void draw(); // Event handler - void onMouseDown (FMouseEvent*); + void onMouseDown (finalcut::FMouseEvent*); // Data Members short fg_color; @@ -62,10 +62,10 @@ class ColorChooser : public FWidget #pragma pack(pop) //---------------------------------------------------------------------- -ColorChooser::ColorChooser (FWidget* parent) +ColorChooser::ColorChooser (finalcut::FWidget* parent) : FWidget(parent) - , fg_color(fc::White) - , bg_color(fc::Black) + , fg_color(finalcut::fc::White) + , bg_color(finalcut::fc::Black) { setSize (8, 12); setFixedSize (8, 12); @@ -78,10 +78,10 @@ ColorChooser::ColorChooser (FWidget* parent) } // Text label - FLabel* headline = new FLabel (this); + finalcut::FLabel* headline = new finalcut::FLabel (this); headline->setGeometry(1, 1, 8, 1); headline->setEmphasis(); - headline->setAlignment (fc::alignCenter); + headline->setAlignment (finalcut::fc::alignCenter); *headline << "Color"; } @@ -90,12 +90,12 @@ ColorChooser::~ColorChooser() { } //---------------------------------------------------------------------- -void ColorChooser::onMouseDown (FMouseEvent* ev) +void ColorChooser::onMouseDown (finalcut::FMouseEvent* ev) { int mouse_x = ev->getX(); int mouse_y = ev->getY(); - if ( ev->getButton() == fc::MiddleButton ) + if ( ev->getButton() == finalcut::fc::MiddleButton ) return; for (int c = 0; c < 16; c++) @@ -106,9 +106,9 @@ void ColorChooser::onMouseDown (FMouseEvent* ev) if ( mouse_x >= xmin && mouse_x <= xmax && mouse_y == y ) { - if ( ev->getButton() == fc::LeftButton ) + if ( ev->getButton() == finalcut::fc::LeftButton ) bg_color = short(c); - else if ( ev->getButton() == fc::RightButton ) + else if ( ev->getButton() == finalcut::fc::RightButton ) fg_color = short(c); redraw(); @@ -121,23 +121,23 @@ void ColorChooser::onMouseDown (FMouseEvent* ev) void ColorChooser::draw() { setColor(); - FWidget::drawBorder (1, 2, 8, 11); + finalcut::FWidget::drawBorder (1, 2, 8, 11); for (short c = 0; c < 16; c++) { setPrintPos (2 + (c / 8) * 3, 3 + c % 8); if ( c < 6 ) - setColor (fc::LightGray, c); + setColor (finalcut::fc::LightGray, c); else if ( c > 8 ) - setColor (fc::DarkGray, c); + setColor (finalcut::fc::DarkGray, c); else - setColor (fc::White, c); + setColor (finalcut::fc::White, c); if ( c == bg_color ) { print (' '); - print (fc::Times); + print (finalcut::fc::Times); print (' '); } else @@ -165,11 +165,11 @@ inline short ColorChooser::getBackground() #pragma pack(push) #pragma pack(1) -class Brushes : public FWidget +class Brushes : public finalcut::FWidget { public: // Constructor - explicit Brushes (FWidget* = 0); + explicit Brushes (finalcut::FWidget* = 0); // Destructor ~Brushes(); @@ -191,7 +191,7 @@ class Brushes : public FWidget void draw(); // Event handler - void onMouseDown (FMouseEvent*); + void onMouseDown (finalcut::FMouseEvent*); // Data Members wchar_t brush; @@ -201,11 +201,11 @@ class Brushes : public FWidget #pragma pack(pop) //---------------------------------------------------------------------- -Brushes::Brushes (FWidget* parent) +Brushes::Brushes (finalcut::FWidget* parent) : FWidget(parent) , brush(L' ') - , fg_color(fc::White) - , bg_color(fc::Black) + , fg_color(finalcut::fc::White) + , bg_color(finalcut::fc::Black) { setSize (8, 4); setFixedSize (8, 4); @@ -218,10 +218,10 @@ Brushes::Brushes (FWidget* parent) } // Text label - FLabel* headline = new FLabel (this); + finalcut::FLabel* headline = new finalcut::FLabel (this); headline->setGeometry(1, 1, 8, 1); headline->setEmphasis(); - headline->setAlignment (fc::alignCenter); + headline->setAlignment (finalcut::fc::alignCenter); *headline << "Brush"; } @@ -235,11 +235,11 @@ void Brushes::draw() { int pos; setColor(); - FWidget::drawBorder (1, 2, 8, 4); + finalcut::FWidget::drawBorder (1, 2, 8, 4); setColor (fg_color, bg_color); setPrintPos (2, 3); print(" "); - print(FString(3, wchar_t(fc::MediumShade))); + print(finalcut::FString(3, wchar_t(finalcut::fc::MediumShade))); if ( brush == L' ' ) pos = 0; @@ -248,18 +248,18 @@ void Brushes::draw() setColor(); setPrintPos (3 + pos, 2); - print(wchar_t(fc::BlackDownPointingTriangle)); + print(wchar_t(finalcut::fc::BlackDownPointingTriangle)); setPrintPos (3 + pos, 4); - print(wchar_t(fc::BlackUpPointingTriangle)); + print(wchar_t(finalcut::fc::BlackUpPointingTriangle)); } //---------------------------------------------------------------------- -void Brushes::onMouseDown (FMouseEvent* ev) +void Brushes::onMouseDown (finalcut::FMouseEvent* ev) { int mouse_x = ev->getX(); int mouse_y = ev->getY(); - if ( ev->getButton() != fc::LeftButton ) + if ( ev->getButton() != finalcut::fc::LeftButton ) return; if ( mouse_x >= 2 && mouse_x <= 4 && mouse_y == 3 ) @@ -269,7 +269,7 @@ void Brushes::onMouseDown (FMouseEvent* ev) } else if ( mouse_x >= 5 && mouse_x <= 7 && mouse_y == 3 ) { - brush = wchar_t(fc::MediumShade); + brush = wchar_t(finalcut::fc::MediumShade); redraw(); } } @@ -300,14 +300,14 @@ inline void Brushes::setBackground (short color) #pragma pack(push) #pragma pack(1) -class MouseDraw : public FDialog +class MouseDraw : public finalcut::FDialog { public: // Using-declaration using FWidget::setGeometry; // Constructor - explicit MouseDraw (FWidget* = 0); + explicit MouseDraw (finalcut::FWidget* = 0); // Destructor ~MouseDraw(); @@ -316,8 +316,8 @@ class MouseDraw : public FDialog void setGeometry (int, int, int, int, bool = true); // Event handlers - void onAccel (FAccelEvent*); - void onClose (FCloseEvent*); + void onAccel (finalcut::FAccelEvent*); + void onClose (finalcut::FCloseEvent*); private: // Disable copy constructor @@ -332,11 +332,11 @@ class MouseDraw : public FDialog void adjustSize(); // Event handler - void onMouseDown (FMouseEvent*); - void onMouseMove (FMouseEvent*); + void onMouseDown (finalcut::FMouseEvent*); + void onMouseMove (finalcut::FMouseEvent*); // Callback methods - void cb_colorChanged (FWidget*, data_ptr); + void cb_colorChanged (finalcut::FWidget*, data_ptr); // Data Members term_area* canvas; @@ -346,8 +346,8 @@ class MouseDraw : public FDialog #pragma pack(pop) //---------------------------------------------------------------------- -MouseDraw::MouseDraw (FWidget* parent) - : FDialog(parent) +MouseDraw::MouseDraw (finalcut::FWidget* parent) + : finalcut::FDialog(parent) , canvas(0) , c_chooser() , brush() @@ -364,8 +364,8 @@ MouseDraw::MouseDraw (FWidget* parent) brush = new Brushes(this); brush->setPos (1, 12); - FPoint no_shadow(0,0); - FRect scroll_geometry(0, 0, 1, 1); + finalcut::FPoint no_shadow(0,0); + finalcut::FRect scroll_geometry(0, 0, 1, 1); createArea (scroll_geometry, no_shadow, canvas); } @@ -377,10 +377,10 @@ MouseDraw::~MouseDraw() void MouseDraw::setGeometry (int x, int y, int w, int h, bool adjust) { int old_w, old_h; - FDialog::setGeometry (x, y, w, h, adjust); + finalcut::FDialog::setGeometry (x, y, w, h, adjust); - FPoint no_shadow(0,0); - FRect scroll_geometry (0, 0, w - 11, h - 3); + finalcut::FPoint no_shadow(0,0); + finalcut::FRect scroll_geometry (0, 0, w - 11, h - 3); old_w = canvas->width; old_h = canvas->height; resizeArea (scroll_geometry, no_shadow, canvas); @@ -393,23 +393,23 @@ void MouseDraw::setGeometry (int x, int y, int w, int h, bool adjust) } //---------------------------------------------------------------------- -void MouseDraw::onAccel (FAccelEvent* ev) +void MouseDraw::onAccel (finalcut::FAccelEvent* ev) { close(); ev->accept(); } //---------------------------------------------------------------------- -void MouseDraw::onClose (FCloseEvent* ev) +void MouseDraw::onClose (finalcut::FCloseEvent* ev) { - FApplication::closeConfirmationDialog (this, ev); + finalcut::FApplication::closeConfirmationDialog (this, ev); } //---------------------------------------------------------------------- void MouseDraw::draw() { int y_max = getHeight(); - FDialog::draw(); + finalcut::FDialog::draw(); setColor(); if ( isNewFont() ) @@ -417,25 +417,25 @@ void MouseDraw::draw() for (int y = 2; y < y_max; y++) { setPrintPos (10, y); - print (wchar_t(fc::NF_rev_border_line_right)); + print (wchar_t(finalcut::fc::NF_rev_border_line_right)); } setPrintPos (10, y_max); - print (wchar_t(fc::NF_rev_border_corner_lower_right)); + print (wchar_t(finalcut::fc::NF_rev_border_corner_lower_right)); } else { setPrintPos (10, 2); - print (wchar_t(fc::BoxDrawingsDownAndHorizontal)); + print (wchar_t(finalcut::fc::BoxDrawingsDownAndHorizontal)); for (int y = 3; y < y_max; y++) { setPrintPos (10, y); - print (wchar_t(fc::BoxDrawingsVertical)); + print (wchar_t(finalcut::fc::BoxDrawingsVertical)); } setPrintPos (10, y_max); - print (wchar_t(fc::BoxDrawingsUpAndHorizontal)); + print (wchar_t(finalcut::fc::BoxDrawingsUpAndHorizontal)); } drawCanvas(); @@ -468,7 +468,7 @@ void MouseDraw::drawBrush (int x, int y, bool swap_color) void MouseDraw::drawCanvas() { if ( ! hasPrintArea() ) - FVTerm::getPrintArea(); + finalcut::FVTerm::getPrintArea(); if ( ! (hasPrintArea() && canvas) ) return; @@ -505,35 +505,39 @@ void MouseDraw::adjustSize() , x = 1 + (getParentWidget()->getWidth() - w) / 2 , y = 1 + (getParentWidget()->getHeight() - h) / 2; setGeometry (x, y, w, h, false); - FDialog::adjustSize(); + finalcut::FDialog::adjustSize(); } //---------------------------------------------------------------------- -void MouseDraw::onMouseDown (FMouseEvent* ev) +void MouseDraw::onMouseDown (finalcut::FMouseEvent* ev) { - FDialog::onMouseDown(ev); + finalcut::FDialog::onMouseDown(ev); - if ( ev->getButton() != fc::LeftButton - && ev->getButton() != fc::RightButton ) + if ( ev->getButton() != finalcut::fc::LeftButton + && ev->getButton() != finalcut::fc::RightButton ) return; - drawBrush (ev->getX(), ev->getY(), ev->getButton() == fc::RightButton); + drawBrush ( ev->getX() + , ev->getY() + , ev->getButton() == finalcut::fc::RightButton ); } //---------------------------------------------------------------------- -void MouseDraw::onMouseMove (FMouseEvent* ev) +void MouseDraw::onMouseMove (finalcut::FMouseEvent* ev) { FDialog::onMouseMove(ev); - if ( ev->getButton() != fc::LeftButton - && ev->getButton() != fc::RightButton ) + if ( ev->getButton() != finalcut::fc::LeftButton + && ev->getButton() != finalcut::fc::RightButton ) return; - drawBrush (ev->getX(), ev->getY(), ev->getButton() == fc::RightButton); + drawBrush ( ev->getX() + , ev->getY() + , ev->getButton() == finalcut::fc::RightButton); } //---------------------------------------------------------------------- -void MouseDraw::cb_colorChanged (FWidget*, data_ptr) +void MouseDraw::cb_colorChanged (finalcut::FWidget*, data_ptr) { brush->setForeground (c_chooser->getForeground()); brush->setBackground (c_chooser->getBackground()); @@ -547,7 +551,7 @@ void MouseDraw::cb_colorChanged (FWidget*, data_ptr) int main (int argc, char* argv[]) { // Create the application object - FApplication app(argc, argv); + finalcut::FApplication app(argc, argv); // Create a simple dialog box MouseDraw mouse_draw(&app); diff --git a/examples/opti-move.cpp b/examples/opti-move.cpp index e81cdb62..90cf38ef 100644 --- a/examples/opti-move.cpp +++ b/examples/opti-move.cpp @@ -27,10 +27,10 @@ // Global FVTerm object -static FVTerm* terminal; +static finalcut::FVTerm* terminal; // Global FApplication object -static FApplication* app; +static finalcut::FApplication* app; // function prototype bool keyPressed(); @@ -145,16 +145,16 @@ int main (int argc, char* argv[]) int xmax, ymax; // Create the application object - FApplication TermApp(argc, argv); + finalcut::FApplication TermApp(argc, argv); // Pointer to the global virtual terminal object - terminal = static_cast(&TermApp); + terminal = static_cast(&TermApp); app = &TermApp; // Get screen dimension xmax = TermApp.getDesktopWidth() - 1; ymax = TermApp.getDesktopHeight() - 1; - FString line(xmax + 1, '-'); + finalcut::FString line(xmax + 1, '-'); // Place the cursor in the upper left corner TermApp.setTermXY(0,0); diff --git a/examples/scrollview.cpp b/examples/scrollview.cpp index 28737e69..76edb6bb 100644 --- a/examples/scrollview.cpp +++ b/examples/scrollview.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2017 Markus Gans * +* Copyright 2017-2018 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 * @@ -30,11 +30,11 @@ #pragma pack(push) #pragma pack(1) -class Scrollview : public FScrollView +class Scrollview : public finalcut::FScrollView { public: // Constructor - explicit Scrollview (FWidget* = 0); + explicit Scrollview (finalcut::FWidget* = 0); // Destructor ~Scrollview (); @@ -52,38 +52,42 @@ class Scrollview : public FScrollView void draw(); // Callback methods - void cb_go_east (FWidget*, data_ptr); - void cb_go_south (FWidget*, data_ptr); - void cb_go_west (FWidget*, data_ptr); - void cb_go_north (FWidget*, data_ptr); + void cb_go_east (finalcut::FWidget*, data_ptr); + void cb_go_south (finalcut::FWidget*, data_ptr); + void cb_go_west (finalcut::FWidget*, data_ptr); + void cb_go_north (finalcut::FWidget*, data_ptr); // Data Members - FButton* go_east; - FButton* go_south; - FButton* go_west; - FButton* go_north; + finalcut::FButton* go_east; + finalcut::FButton* go_south; + finalcut::FButton* go_west; + finalcut::FButton* go_north; }; #pragma pack(pop) //---------------------------------------------------------------------- -Scrollview::Scrollview (FWidget* parent) - : FScrollView(parent) +Scrollview::Scrollview (finalcut::FWidget* parent) + : finalcut::FScrollView(parent) , go_east() , go_south() , go_west() , go_north() { // Create the four navigation buttons - go_east = new FButton(wchar_t(fc::BlackRightPointingPointer), this); + wchar_t pointer_right = wchar_t(finalcut::fc::BlackRightPointingPointer); + go_east = new finalcut::FButton(pointer_right, this); go_east->setGeometry (1, 1, 5, 1); - go_south = new FButton(wchar_t(fc::BlackDownPointingTriangle), this); + wchar_t pointer_down = wchar_t(finalcut::fc::BlackDownPointingTriangle); + go_south = new finalcut::FButton(pointer_down, this); go_south->setGeometry (getScrollWidth() - 5, 1, 5, 1); - go_west = new FButton(wchar_t(fc::BlackLeftPointingPointer), this); + wchar_t pointer_left = wchar_t(finalcut::fc::BlackLeftPointingPointer); + go_west = new finalcut::FButton(pointer_left, this); go_west->setGeometry (getScrollWidth() - 5, getScrollHeight() - 2, 5, 1); - go_north = new FButton(wchar_t(fc::BlackUpPointingTriangle), this); + wchar_t pointer_up = wchar_t(finalcut::fc::BlackUpPointingTriangle); + go_north = new finalcut::FButton(pointer_up, this); go_north->setGeometry (1, getScrollHeight() - 2, 5, 1); // Add scroll function callbacks to the buttons @@ -149,7 +153,7 @@ void Scrollview::draw() } //---------------------------------------------------------------------- -void Scrollview::cb_go_east (FWidget*, data_ptr) +void Scrollview::cb_go_east (finalcut::FWidget*, data_ptr) { scrollToX (getScrollWidth() - getViewportWidth() + 1); go_south->setFocus(); @@ -158,7 +162,7 @@ void Scrollview::cb_go_east (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Scrollview::cb_go_south (FWidget*, data_ptr) +void Scrollview::cb_go_south (finalcut::FWidget*, data_ptr) { scrollToY (getScrollHeight() - getViewportHeight() + 1); go_west->setFocus(); @@ -167,7 +171,7 @@ void Scrollview::cb_go_south (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Scrollview::cb_go_west (FWidget*, data_ptr) +void Scrollview::cb_go_west (finalcut::FWidget*, data_ptr) { scrollToX (1); go_north->setFocus(); @@ -176,7 +180,7 @@ void Scrollview::cb_go_west (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Scrollview::cb_go_north (FWidget*, data_ptr) +void Scrollview::cb_go_north (finalcut::FWidget*, data_ptr) { scrollToY (1); go_east->setFocus(); @@ -192,27 +196,27 @@ void Scrollview::cb_go_north (FWidget*, data_ptr) #pragma pack(push) #pragma pack(1) -class Scrollviewdemo : public FDialog +class Scrollviewdemo : public finalcut::FDialog { public: // Constructor - explicit Scrollviewdemo (FWidget* = 0); + explicit Scrollviewdemo (finalcut::FWidget* = 0); // Destructor ~Scrollviewdemo(); // Event handler - void onClose (FCloseEvent*); + void onClose (finalcut::FCloseEvent*); // Callback method - void cb_quit (FWidget* = 0, data_ptr = 0); + void cb_quit (finalcut::FWidget* = 0, data_ptr = 0); }; #pragma pack(pop) //---------------------------------------------------------------------- -Scrollviewdemo::Scrollviewdemo (FWidget* parent) - : FDialog(parent) +Scrollviewdemo::Scrollviewdemo (finalcut::FWidget* parent) + : finalcut::FDialog(parent) { setGeometry (16, 3, 50, 19); setText ("Scrolling viewport example"); @@ -223,7 +227,7 @@ Scrollviewdemo::Scrollviewdemo (FWidget* parent) sview->setScrollSize(188, 124); // Quit button - FButton* button = new FButton("&Quit", this); + finalcut::FButton* button = new finalcut::FButton("&Quit", this); button->setGeometry(37, 15, 10, 1); // Add function callback @@ -234,7 +238,7 @@ Scrollviewdemo::Scrollviewdemo (FWidget* parent) ); // Text label - FLabel* label = new FLabel (this); + finalcut::FLabel* label = new finalcut::FLabel (this); label->setGeometry(2, 1, 46, 1); label->setEmphasis(); *label << L"Use scrollbars to change the viewport position"; @@ -245,15 +249,15 @@ Scrollviewdemo::~Scrollviewdemo() { } //---------------------------------------------------------------------- -void Scrollviewdemo::cb_quit (FWidget*, data_ptr) +void Scrollviewdemo::cb_quit (finalcut::FWidget*, data_ptr) { close(); } //---------------------------------------------------------------------- -void Scrollviewdemo::onClose (FCloseEvent* ev) +void Scrollviewdemo::onClose (finalcut::FCloseEvent* ev) { - FApplication::closeConfirmationDialog (this, ev); + finalcut::FApplication::closeConfirmationDialog (this, ev); } @@ -263,7 +267,7 @@ void Scrollviewdemo::onClose (FCloseEvent* ev) int main (int argc, char* argv[]) { // Create the application object - FApplication app(argc, argv); + finalcut::FApplication app(argc, argv); // Create a simple dialog box Scrollviewdemo svdemo(&app); diff --git a/examples/string-operations.cpp b/examples/string-operations.cpp index 03c2ad7f..6708b460 100644 --- a/examples/string-operations.cpp +++ b/examples/string-operations.cpp @@ -91,7 +91,7 @@ void init() void inputStreamExample() { // Test: input stream (operator >>) - FString in; + finalcut::FString in; std::cout << " Input: "; std::cin >> in; std::cout << " instream >> " << in << std::endl; @@ -101,7 +101,7 @@ void inputStreamExample() void outputStreamExample() { // Test: output stream (operator <<) - const FString& out = L"A test string for 0 \x20ac"; + const finalcut::FString& out = L"A test string for 0 \x20ac"; std::cout << " outstream << " << out << std::endl; } @@ -111,62 +111,62 @@ void streamingIntoFStringExample() // Test: Streaming into a FString (operator <<)... // ...from FStrings - FString streamer1; - streamer1 << FString("FStr") << FString("ing"); + finalcut::FString streamer1; + streamer1 << finalcut::FString("FStr") << finalcut::FString("ing"); std::cout << " stream in: " << streamer1 << std::endl; // ...from c++ wide string - FString streamer2; + finalcut::FString streamer2; streamer2 << std::wstring(L"std::wstring"); std::cout << " stream in: " << streamer2 << std::endl; // ...from wide string - FString streamer3; + finalcut::FString streamer3; streamer3 << const_cast(L"wchar_t*"); std::cout << " stream in: " << streamer3 << std::endl; // ...from c++ string - FString streamer4; + finalcut::FString streamer4; streamer4 << std::string("std::string"); std::cout << " stream in: " << streamer4 << std::endl; // ...from c-string - FString streamer5; + finalcut::FString streamer5; streamer5 << const_cast("char*"); std::cout << " stream in: " << streamer5 << std::endl; // ...from wide character - FString streamer6; + finalcut::FString streamer6; streamer6 << wchar_t(L'w'); std::cout << " stream in: " << streamer6 << std::endl; // ...from character - FString streamer7; + finalcut::FString streamer7; streamer7 << char('c'); std::cout << " stream in: " << streamer7 << std::endl; // ...from interger - FString streamer8; + finalcut::FString streamer8; streamer8 << int(-12345); std::cout << " stream in: " << streamer8 << std::endl; // ...from unsigned interger - FString streamer9; + finalcut::FString streamer9; streamer9 << uInt(54321); std::cout << " stream in: " << streamer9 << std::endl; // ...from long double - FString streamer10; + finalcut::FString streamer10; streamer10 << lDouble(0.333333333333333333L); std::cout << " stream in: " << streamer10 << std::endl; // ...from double - FString streamer11; + finalcut::FString streamer11; streamer11 << double(0.11111111111); std::cout << " stream in: " << streamer11 << std::endl; // ...from float - FString streamer12; + finalcut::FString streamer12; streamer12 << float(0.22222222); std::cout << " stream in: " << streamer12 << std::endl; } @@ -177,23 +177,23 @@ void streamingFromFStringExample() // Test: Streaming from a FString (operator >>)... // ...to FStrings - FString stream_fstring; - FString("FString") >> stream_fstring; + finalcut::FString stream_fstring; + finalcut::FString("FString") >> stream_fstring; std::cout << "stream out: " << stream_fstring << std::endl; // ...to c++ wide string std::wstring stream_wstring; - FString("std::wstring") >> stream_wstring; + finalcut::FString("std::wstring") >> stream_wstring; std::wcout << "stream out: " << stream_wstring << std::endl; // ...to wide character wchar_t stream_wchar_t = 0; - FString("w") >> stream_wchar_t; + finalcut::FString("w") >> stream_wchar_t; std::wcout << "stream out: " << stream_wchar_t << std::endl; // ...to character char stream_char; - FString('c') >> stream_char; + finalcut::FString('c') >> stream_char; std::cout << "stream out: " << stream_char << std::endl; // ...to interger @@ -217,7 +217,7 @@ void streamToInterger() try { int stream_int; - FString("-321") >> stream_int; + finalcut::FString("-321") >> stream_int; std::cout << "stream out: " << stream_int << std::endl; } catch (const std::invalid_argument& ex) @@ -241,7 +241,7 @@ void streamToUnsignedInterger() try { uInt stream_uint; - FString("123") >> stream_uint; + finalcut::FString("123") >> stream_uint; std::cout << "stream out: " << stream_uint << std::endl; } catch (const std::invalid_argument& ex) @@ -265,7 +265,7 @@ void streamToDouble() try { double stream_double; - FString("0.123456e+2") >> stream_double; + finalcut::FString("0.123456e+2") >> stream_double; std::cout << "stream out: " << stream_double << std::endl; } catch (const std::invalid_argument& ex) @@ -285,7 +285,7 @@ void streamToFloat() try { float stream_float; - FString("0.123e-3") >> stream_float; + finalcut::FString("0.123e-3") >> stream_float; std::cout << "stream out: " << stream_float << std::endl; } catch (const std::invalid_argument& ex) @@ -302,7 +302,7 @@ void streamToFloat() void CStringOutputExample() { // Test: c-string output - const FString& out = L"A test string for 0 \x20ac"; + const finalcut::FString& out = L"A test string for 0 \x20ac"; printf (" c_str: \"%s\"\n", out.c_str()); } @@ -310,15 +310,15 @@ void CStringOutputExample() void copyIntoFString() { // Test: copy a c++ string - const FString& cpp_str( std::string("c++ String") ); + const finalcut::FString& cpp_str( std::string("c++ String") ); std::cout << " cpp_str: \"" << cpp_str << "\"" << std::endl; // Test: copy a character - const FString ch('c'); + const finalcut::FString ch('c'); std::cout << " char: '" << ch << "'" << std::endl; // Test: copy a wide character - const FString wch(L'w'); + const finalcut::FString wch(L'w'); std::cout << " wchar_t: '" << wch << "'" << std::endl; } @@ -326,7 +326,7 @@ void copyIntoFString() void utf8StringOutputExample() { // Test: utf-8 string - const FString& len = "длина́"; + const finalcut::FString& len = "длина́"; std::cout << " length: \"" << len << "\" has " << len.getLength() << " characters" << std::endl; } @@ -335,11 +335,11 @@ void utf8StringOutputExample() void letterCaseExample() { // Test: convert uppercase letter to lowercase - const FString& lower = FString(L"InPut").toLower(); + const finalcut::FString& lower = finalcut::FString(L"InPut").toLower(); std::wcout << L" toLower: " << lower << std::endl; // Test: convert lowercase letter to uppercase - const FString& upper = FString("inPut").toUpper(); + const finalcut::FString& upper = finalcut::FString("inPut").toUpper(); std::cout << " toUpper: " << upper << std::endl; } @@ -347,63 +347,66 @@ void letterCaseExample() void stringConcatenationExample() { // Test: concatenate two FStrings (operator +) - const FString& add1 = FString("FString + ") + FString("FString"); + const finalcut::FString& add1 = finalcut::FString("FString + ") + + finalcut::FString("FString"); std::cout << " add: " << add1 << std::endl; // Test: concatenate a FString and a c++ wide string (operator +) - const FString& add2 = FString("FString + ") - + std::wstring(L"std::wstring"); + const finalcut::FString& add2 = finalcut::FString("FString + ") + + std::wstring(L"std::wstring"); std::cout << " add: " << add2 << std::endl; // Test: concatenate a FString and a wide string (operator +) - const FString& add3 = FString("FString + ") - + const_cast(L"wchar_t*"); + const finalcut::FString& add3 = finalcut::FString("FString + ") + + const_cast(L"wchar_t*"); std::cout << " add: " << add3 << std::endl; // Test: concatenate a FString and a c++ string (operator +) - const FString& add4 = FString("FString + ") - + std::string("std::string"); + const finalcut::FString& add4 = finalcut::FString("FString + ") + + std::string("std::string"); std::cout << " add: " << add4 << std::endl; // Test: concatenate a FString and a c-string (operator +) - const FString& add5 = FString("FString + ") - + const_cast("char*"); + const finalcut::FString& add5 = finalcut::FString("FString + ") + + const_cast("char*"); std::cout << " add: " << add5 << std::endl; // Test: concatenate a FString and a wide character (operator +) - const FString& add6 = FString("FString + ") + wchar_t(L'w'); + const finalcut::FString& add6 = finalcut::FString("FString + ") + + wchar_t(L'w'); std::cout << " add: " << add6 << std::endl; // Test: concatenate a FString and a character (operator +) - const FString& add7 = FString("FString + ") + char('c'); + const finalcut::FString& add7 = finalcut::FString("FString + ") + + char('c'); std::cout << " add: " << add7 << std::endl; // Test: concatenate a character and a FString (operator +) - const FString& add8 = 'c' + FString(" + FString"); + const finalcut::FString& add8 = 'c' + finalcut::FString(" + FString"); std::cout << " add: " << add8 << std::endl; // Test: concatenate a wide character and a FString (operator +) - const FString& add9 = L'w' + FString(" + FString"); + const finalcut::FString& add9 = L'w' + finalcut::FString(" + FString"); std::cout << " add: " << add9 << std::endl; // Test: concatenate a c-string and a FString (operator +) - const FString& add10 = const_cast("char*") - + FString(" + FString"); + const finalcut::FString& add10 = const_cast("char*") + + finalcut::FString(" + FString"); std::cout << " add: " << add10 << std::endl; // Test: concatenate a c++ string and a FString (operator +) - const FString& add11 = std::string("std::string") - + FString(" + FString"); + const finalcut::FString& add11 = std::string("std::string") + + finalcut::FString(" + FString"); std::cout << " add: " << add11 << std::endl; // Test: concatenate a wide string and a FString (operator +) - const FString& add12 = const_cast(L"wchar_t*") - + FString(" + FString"); + const finalcut::FString& add12 = const_cast(L"wchar_t*") + + finalcut::FString(" + FString"); std::cout << " add: " << add12 << std::endl; // Test: concatenate a c++ wide string and a FString (operator +) - const FString& add13 = std::wstring(L"std::wstring") - + FString(" + FString"); + const finalcut::FString& add13 = std::wstring(L"std::wstring") + + finalcut::FString(" + FString"); std::cout << " add: " << add13 << std::endl; } @@ -411,34 +414,34 @@ void stringConcatenationExample() void stringCompareExample() { // Test: compare operators ==, <=, <, >=, >, != - const FString& cmp = "compare"; + const finalcut::FString& cmp = "compare"; - if ( cmp == FString("compare") ) + if ( cmp == finalcut::FString("compare") ) std::cout << " cmp: == Ok" << std::endl; else std::cout << " cmp: == Not Ok" << std::endl; - if ( cmp <= FString("d_compare") ) + if ( cmp <= finalcut::FString("d_compare") ) std::cout << " cmp: <= Ok" << std::endl; else std::cout << " cmp: <= Not Ok" << std::endl; - if ( cmp < FString("e_compare") ) + if ( cmp < finalcut::FString("e_compare") ) std::cout << " cmp: < Ok" << std::endl; else std::cout << " cmp: < Not Ok" << std::endl; - if ( cmp >= FString("b_compare") ) + if ( cmp >= finalcut::FString("b_compare") ) std::cout << " cmp: >= Ok" << std::endl; else std::cout << " cmp: >= Not Ok" << std::endl; - if ( cmp > FString("a_compare") ) + if ( cmp > finalcut::FString("a_compare") ) std::cout << " cmp: > Ok" << std::endl; else std::cout << " cmp: > Not Ok" << std::endl; - if ( cmp != FString("equal") ) + if ( cmp != finalcut::FString("equal") ) std::cout << " cmp: != Ok" << std::endl; else std::cout << " cmp: != Not Ok" << std::endl; @@ -448,11 +451,11 @@ void stringCompareExample() void stringSplittingExample() { // Test: split a string with a delimiter and returns a vector (array) - FString split_str = "a,b,c,d"; + finalcut::FString split_str = "a,b,c,d"; std::cout << " split: \"" << split_str << "\" into substrings ->"; - FStringList parts = split_str.split(","); - FStringList::iterator it, end; + finalcut::FStringList parts = split_str.split(","); + finalcut::FStringList::iterator it, end; end = parts.end(); for (it = parts.begin(); it != end; ++it) @@ -465,7 +468,7 @@ void stringSplittingExample() void fromatStringExample() { // Test: format a string with sprintf - FString formatStr = ""; + finalcut::FString formatStr = ""; std::cout << " formatted: " << formatStr.sprintf("sqrt(%d) = %d", 16, 4) << std::endl; @@ -477,7 +480,7 @@ void convertToNumberExample() // Test: convert a string to a unsigned long interger try { - const uLong ulong_num = FString("123456789").toULong(); + const uLong ulong_num = finalcut::FString("123456789").toULong(); std::cout << " toULong: " << ulong_num << std::endl; } catch (const std::invalid_argument& ex) @@ -492,7 +495,7 @@ void convertToNumberExample() // Test: convert a string to a signed long interger try { - const long long_num = FString("-9876543210").toLong(); + const long long_num = finalcut::FString("-9876543210").toLong(); std::cout << " toLong: " << long_num << std::endl; } catch (const std::invalid_argument& ex) @@ -509,7 +512,7 @@ void convertToNumberExample() try { - const double double_num = FString("2.7182818284590452353").toDouble(); + const double double_num = finalcut::FString("2.7182818284590452353").toDouble(); std::ios_base::fmtflags save_flags = std::cout.flags(); std::cout << " toDouble: " << std::setprecision(11) << double_num << std::endl; @@ -529,7 +532,7 @@ void convertToNumberExample() void convertNumberToStringExample() { // Test: convert integer and double value to a string - FString num1, num2, num3; + finalcut::FString num1, num2, num3; num1.setNumber(137); num2.setNumber(-512); num3.setNumber(3.141592653589793238L, 12); @@ -546,7 +549,7 @@ void formatedNumberExample() { // Test: convert and format a integer number with thousand separator std::setlocale (LC_NUMERIC, ""); - FString fnum1, fnum2; + finalcut::FString fnum1, fnum2; #if defined(__LP64__) || defined(_LP64) // 64-bit architecture fnum1.setFormatedNumber(0xffffffffffffffff, '\''); @@ -566,7 +569,7 @@ void formatedNumberExample() void trimExample() { // Test: remove whitespace from the end of a string - const FString& trim_str = " A string \t"; + const finalcut::FString& trim_str = " A string \t"; std::wcout << " rtrim: \"" << trim_str.rtrim() << "\"" << std::endl; @@ -583,8 +586,8 @@ void trimExample() void substringExample() { // Test: 11 characters from the left of the string - const FString& alphabet = "a b c d e f g h i j k l m " - "n o p q r s t u v w x y z"; + const finalcut::FString& alphabet = "a b c d e f g h i j k l m " + "n o p q r s t u v w x y z"; std::cout << " left: \"" << alphabet.left(11) << "\"" << std::endl; @@ -601,7 +604,7 @@ void substringExample() void insertExample() { // Test: insert a string at index position 7 - FString insert_str = "I am a string"; + finalcut::FString insert_str = "I am a string"; try { @@ -618,7 +621,7 @@ void insertExample() void indexExample() { // Test: get character access at a specified index position - FString index(5); // string with five characters + finalcut::FString index(5); // string with five characters index = "index"; try @@ -638,8 +641,8 @@ void indexExample() void iteratorExample() { // Test: character access with std::iterator - const FString& stringIterator = "iterator"; - FString::iterator iter; + const finalcut::FString& stringIterator = "iterator"; + finalcut::FString::iterator iter; iter = stringIterator.begin(); std::cout << " " << stringIterator << ": "; @@ -658,7 +661,7 @@ void iteratorExample() void overwriteExample() { // Test: overwrite string at position 10 with "for t" - FString overwrite_std = "Overwrite the rest"; + finalcut::FString overwrite_std = "Overwrite the rest"; std::cout << "overwrite: " << overwrite_std.overwrite("for t", 10) << std::endl; } @@ -667,7 +670,7 @@ void overwriteExample() void removeExample() { // Test: remove 2 characters at position 7 - FString remove_std = "A fast remove"; + finalcut::FString remove_std = "A fast remove"; std::cout << " remove: " << remove_std.remove(7, 2) << std::endl; } @@ -676,7 +679,7 @@ void removeExample() void substringIncludeExample() { // Test: includes a substring (positive test) - FString include_std = "string"; + finalcut::FString include_std = "string"; if ( include_std.includes("ring") ) std::cout << " includes: \"" @@ -702,8 +705,9 @@ void substringIncludeExample() void replaceExample() { // Test: find and replace a substring - FString source_str = "computer and software"; - const FString& replace_str = source_str.replace("computer", "hard-"); + finalcut::FString source_str = "computer and software"; + const finalcut::FString& replace_str = \ + source_str.replace("computer", "hard-"); std::cout << " replace: " << replace_str << std::endl; } @@ -712,7 +716,7 @@ void replaceExample() void tabToSpaceExample() { // Test: convert tabs to spaces - const FString& tab_str = "1234\t5678"; + const finalcut::FString& tab_str = "1234\t5678"; std::cout << " tab: " << tab_str.expandTabs() << std::endl; } @@ -721,7 +725,7 @@ void tabToSpaceExample() void backspaceControlCharacterExample() { // Test: backspaces remove characters in the string - const FString& bs_str = "t\b\bTesT\bt"; + const finalcut::FString& bs_str = "t\b\bTesT\bt"; std::cout << "backspace: " << bs_str.removeBackspaces() << std::endl; } @@ -730,7 +734,7 @@ void backspaceControlCharacterExample() void deleteControlCharacterExample() { // Test: delete characters remove characters in the string - const FString& del_str = "apple \177\177\177pietree"; + const finalcut::FString& del_str = "apple \177\177\177pietree"; std::cout << " delete: " << del_str.removeDel() << std::endl; } diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp index 2aee1669..234ae58a 100644 --- a/examples/term-attributes.cpp +++ b/examples/term-attributes.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2017 Markus Gans * +* Copyright 2015-2018 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 * @@ -30,23 +30,23 @@ #pragma pack(push) #pragma pack(1) -class AttribDlg : public FDialog +class AttribDlg : public finalcut::FDialog { public: // Constructor - explicit AttribDlg (FWidget* = 0); + explicit AttribDlg (finalcut::FWidget* = 0); // Destructor ~AttribDlg(); // Event handlers - void onAccel (FAccelEvent*); - void onWheel (FWheelEvent*); - void onClose (FCloseEvent*); + void onAccel (finalcut::FAccelEvent*); + void onWheel (finalcut::FWheelEvent*); + void onClose (finalcut::FCloseEvent*); // Callback methods - void cb_next (FWidget* = 0, data_ptr = 0); - void cb_back (FWidget* = 0, data_ptr = 0); + void cb_next (finalcut::FWidget* = 0, data_ptr = 0); + void cb_back (finalcut::FWidget* = 0, data_ptr = 0); // Data Members short bgcolor; @@ -61,28 +61,28 @@ class AttribDlg : public FDialog void adjustSize(); // Data Members - FButton* next_button; - FButton* back_button; + finalcut::FButton* next_button; + finalcut::FButton* back_button; }; #pragma pack(pop) //---------------------------------------------------------------------- -AttribDlg::AttribDlg (FWidget* parent) - : FDialog(parent) +AttribDlg::AttribDlg (finalcut::FWidget* parent) + : finalcut::FDialog(parent) , bgcolor(wc.label_bg) , next_button() , back_button() { setText ( "A terminal attributes test (" - + FString(getTermType()) + + finalcut::FString(getTermType()) + ")"); - next_button = new FButton("&Next >", this); + next_button = new finalcut::FButton("&Next >", this); next_button->setGeometry(getWidth() - 13, getHeight() - 4, 10, 1); - next_button->addAccelerator(fc::Fkey_right); - back_button = new FButton("< &Back", this); + next_button->addAccelerator(finalcut::fc::Fkey_right); + back_button = new finalcut::FButton("< &Back", this); back_button->setGeometry(getWidth() - 25, getHeight() - 4, 10, 1); - back_button->addAccelerator(fc::Fkey_left); + back_button->addAccelerator(finalcut::fc::Fkey_left); // Add function callbacks next_button->addCallback @@ -103,31 +103,31 @@ AttribDlg::~AttribDlg() { } //---------------------------------------------------------------------- -void AttribDlg::onAccel (FAccelEvent* ev) +void AttribDlg::onAccel (finalcut::FAccelEvent* ev) { close(); ev->accept(); } //---------------------------------------------------------------------- -void AttribDlg::onWheel (FWheelEvent* ev) +void AttribDlg::onWheel (finalcut::FWheelEvent* ev) { int wheel = ev->getWheel(); - if ( wheel == fc::WheelUp ) + if ( wheel == finalcut::fc::WheelUp ) cb_next(); - else if ( wheel == fc::WheelDown ) + else if ( wheel == finalcut::fc::WheelDown ) cb_back(); } //---------------------------------------------------------------------- -void AttribDlg::onClose (FCloseEvent* ev) +void AttribDlg::onClose (finalcut::FCloseEvent* ev) { - FApplication::closeConfirmationDialog (this, ev); + finalcut::FApplication::closeConfirmationDialog (this, ev); } //---------------------------------------------------------------------- -void AttribDlg::cb_next (FWidget*, data_ptr) +void AttribDlg::cb_next (finalcut::FWidget*, data_ptr) { if ( isMonochron() ) return; @@ -135,20 +135,20 @@ void AttribDlg::cb_next (FWidget*, data_ptr) bgcolor++; if ( bgcolor >= getMaxColor() ) - bgcolor = fc::Default; + bgcolor = finalcut::fc::Default; redraw(); } //---------------------------------------------------------------------- -void AttribDlg::cb_back (FWidget*, data_ptr) +void AttribDlg::cb_back (finalcut::FWidget*, data_ptr) { if ( isMonochron() ) return; bgcolor--; - if ( bgcolor < fc::Default ) + if ( bgcolor < finalcut::fc::Default ) bgcolor = short(getMaxColor() - 1); redraw(); @@ -169,7 +169,7 @@ void AttribDlg::adjustSize() setGeometry(x, y, 69, 21, false); next_button->setGeometry(getWidth() - 13, getHeight() - 4, 10, 1, false); back_button->setGeometry(getWidth() - 25, getHeight() - 4, 10, 1, false); - FDialog::adjustSize(); + finalcut::FDialog::adjustSize(); } @@ -180,7 +180,7 @@ void AttribDlg::adjustSize() #pragma pack(push) #pragma pack(1) -class AttribDemo : public FWidget +class AttribDemo : public finalcut::FWidget { public: // Constructor @@ -191,7 +191,7 @@ class AttribDemo : public FWidget { } // Event handler - void onWheel (FWheelEvent* ev) + void onWheel (finalcut::FWheelEvent* ev) { AttribDlg* p = static_cast(getParentWidget()); @@ -224,8 +224,8 @@ class AttribDemo : public FWidget #pragma pack(pop) //---------------------------------------------------------------------- -AttribDemo::AttribDemo (FWidget* parent) - : FWidget(parent) +AttribDemo::AttribDemo (finalcut::FWidget* parent) + : finalcut::FWidget(parent) , colors(getMaxColor()) { if ( isMonochron() ) @@ -259,16 +259,16 @@ void AttribDemo::printAltCharset() setPrintPos (1,1); print("alternate charset: "); - if ( parent->bgcolor == fc::Default ) + if ( parent->bgcolor == finalcut::fc::Default ) { - setColor (fc::Default, fc::Default); + setColor (finalcut::fc::Default, finalcut::fc::Default); } else { if ( parent->bgcolor == 0 || parent->bgcolor == 16 ) - setColor (fc::White, parent->bgcolor); + setColor (finalcut::fc::White, parent->bgcolor); else - setColor (fc::Black, parent->bgcolor); + setColor (finalcut::fc::Black, parent->bgcolor); } setAltCharset(); @@ -471,7 +471,7 @@ void AttribDemo::draw() short bg = static_cast(getParent())->bgcolor; print (" Background color:"); - if ( bg == fc::Default ) + if ( bg == finalcut::fc::Default ) print (" default"); else printf ( " %d", bg); @@ -487,7 +487,7 @@ void AttribDemo::draw() int main (int argc, char* argv[]) { // Create the application object - FApplication app (argc, argv); + finalcut::FApplication app (argc, argv); // Create a dialog box object. // This object will be automatically deleted by diff --git a/examples/termcap.cpp b/examples/termcap.cpp index 01113269..479decb5 100644 --- a/examples/termcap.cpp +++ b/examples/termcap.cpp @@ -28,16 +28,16 @@ // Global FVTerm object -static FVTerm* terminal; +static finalcut::FVTerm* terminal; // Function prototype void tcapBoolean (const std::string&, bool); void tcapNumeric (const std::string&, int); void tcapString (const std::string&, const char[]); -void debug (FApplication&); +void debug (finalcut::FApplication&); void booleans(); void numeric(); -void string(FTermcap::tcap_map*&); +void string(finalcut::FTermcap::tcap_map*&); #pragma pack(push) #pragma pack(1) @@ -45,95 +45,95 @@ void string(FTermcap::tcap_map*&); struct termcap_string { const std::string name; - const fc::termcaps cap; + const finalcut::fc::termcaps cap; }; #pragma pack(pop) // String data array static const termcap_string strings[] = { - { "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 } + { "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 } }; const int last_item = int ( sizeof(strings) / sizeof(strings[0]) ) - 1; @@ -204,10 +204,10 @@ void tcapString (const std::string& name, const char cap_str[]) //---------------------------------------------------------------------- #if DEBUG -void debug (FApplication& TermApp) +void debug (finalcut::FApplication& TermApp) { - const FString& ab_s = TermApp.getAnswerbackString(); - const FString& sec_da = TermApp.getSecDAString(); + const finalcut::FString& ab_s = TermApp.getAnswerbackString(); + const finalcut::FString& sec_da = TermApp.getSecDAString(); std::cout << "\n.------------------- debug -------------------\r\n"; #if defined(__linux__) std::cout << "| Framebuffer bpp: " @@ -231,7 +231,7 @@ void debug (FApplication& TermApp) } #else -void debug (FApplication&) +void debug (finalcut::FApplication&) { } #endif @@ -240,19 +240,19 @@ void booleans() { std::cout << "\r\n[Booleans]\r\n"; tcapBoolean ( "background_color_erase" - , FTermcap::background_color_erase ); + , finalcut::FTermcap::background_color_erase ); tcapBoolean ( "automatic_left_margin" - , FTermcap::automatic_left_margin ); + , finalcut::FTermcap::automatic_left_margin ); tcapBoolean ( "automatic_right_margin" - , FTermcap::automatic_right_margin ); + , finalcut::FTermcap::automatic_right_margin ); tcapBoolean ( "eat_nl_glitch" - , FTermcap::eat_nl_glitch ); + , finalcut::FTermcap::eat_nl_glitch ); tcapBoolean ( "ansi_default_color" - , FTermcap::ansi_default_color ); + , finalcut::FTermcap::ansi_default_color ); tcapBoolean ( "osc_support" - , FTermcap::osc_support ); + , finalcut::FTermcap::osc_support ); tcapBoolean ( "no_utf8_acs_chars" - , FTermcap::no_utf8_acs_chars ); + , finalcut::FTermcap::no_utf8_acs_chars ); } //---------------------------------------------------------------------- @@ -260,22 +260,22 @@ void numeric() { std::cout << "\r\n[Numeric]\r\n"; tcapNumeric ("max_color" - , FTermcap::max_color); + , finalcut::FTermcap::max_color); tcapNumeric ("tabstop" - , FTermcap::tabstop); + , finalcut::FTermcap::tabstop); tcapNumeric ("attr_without_color" - , FTermcap::attr_without_color); + , finalcut::FTermcap::attr_without_color); } //---------------------------------------------------------------------- -void string(FTermcap::tcap_map*& tcap) +void string(finalcut::FTermcap::tcap_map*& tcap) { std::cout << "\r\n[String]\r\n"; for (int n = 0; n <= last_item; n++ ) { const std::string name = strings[n].name; - const fc::termcaps cap = strings[n].cap; + const finalcut::fc::termcaps cap = strings[n].cap; tcapString (name, tcap[cap].string); } } @@ -286,13 +286,13 @@ void string(FTermcap::tcap_map*& tcap) int main (int argc, char* argv[]) { bool disable_alt_screen = true; - FApplication TermApp (argc, argv, disable_alt_screen); + finalcut::FApplication TermApp (argc, argv, disable_alt_screen); // Pointer to the global virtual terminal object - terminal = static_cast(&TermApp); + terminal = static_cast(&TermApp); - FTermcap::tcap_map* tcap = 0; - tcap = FTermcap::getTermcapMap(); + finalcut::FTermcap::tcap_map* tcap = 0; + tcap = finalcut::FTermcap::getTermcapMap(); std::cout << "--------\r\nFTermcap\r\n--------\r\n\n"; std::cout << "Terminal: " << TermApp.getTermType() << "\r\n"; diff --git a/examples/timer.cpp b/examples/timer.cpp index fc2ef822..3765f53d 100644 --- a/examples/timer.cpp +++ b/examples/timer.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2017 Markus Gans * +* Copyright 2014-2018 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 * @@ -27,24 +27,24 @@ // class Timer //---------------------------------------------------------------------- -class Timer : public FWidget +class Timer : public finalcut::FWidget { public: // Constructor - explicit Timer (FWidget* = 0); + explicit Timer (finalcut::FWidget* = 0); protected: // Method void draw(); // Event handlers - void onTimer (FTimerEvent*); - void onAccel (FAccelEvent*); + void onTimer (finalcut::FTimerEvent*); + void onAccel (finalcut::FAccelEvent*); }; //---------------------------------------------------------------------- -Timer::Timer (FWidget* parent) - : FWidget(parent) +Timer::Timer (finalcut::FWidget* parent) + : finalcut::FWidget(parent) { addTimer (60000); // 1-minute timer int id = addTimer (50); // 50-millisecond timer @@ -52,8 +52,8 @@ Timer::Timer (FWidget* parent) delTimer (id); addTimer (250); // 250-millisecond timer - wc.term_fg = fc::Default; - wc.term_bg = fc::Default; + wc.term_fg = finalcut::fc::Default; + wc.term_bg = finalcut::fc::Default; } //---------------------------------------------------------------------- @@ -67,7 +67,7 @@ void Timer::draw() } //---------------------------------------------------------------------- -void Timer::onTimer (FTimerEvent* ev) +void Timer::onTimer (finalcut::FTimerEvent* ev) { bool is_last_line = false; int timer_id = ev->timerId(); @@ -75,7 +75,7 @@ void Timer::onTimer (FTimerEvent* ev) if ( getPrintPos().getY() == getDesktopHeight() ) is_last_line = true; - setColor (short(1 + timer_id), fc::Default); + setColor (short(1 + timer_id), finalcut::fc::Default); print() << "Timer event, id " << timer_id << '\n'; if ( is_last_line ) @@ -85,7 +85,7 @@ void Timer::onTimer (FTimerEvent* ev) } //---------------------------------------------------------------------- -void Timer::onAccel (FAccelEvent* ev) +void Timer::onAccel (finalcut::FAccelEvent* ev) { quit(); ev->accept(); @@ -98,9 +98,9 @@ void Timer::onAccel (FAccelEvent* ev) int main (int argc, char* argv[]) { // Create the application object - FApplication app(argc, argv); - app.setForegroundColor(fc::Default); - app.setBackgroundColor(fc::Default); + finalcut::FApplication app(argc, argv); + app.setForegroundColor(finalcut::fc::Default); + app.setBackgroundColor(finalcut::fc::Default); // Create a timer object t Timer t(&app); diff --git a/examples/transparent.cpp b/examples/transparent.cpp index cdcc3b81..6a5cb78a 100644 --- a/examples/transparent.cpp +++ b/examples/transparent.cpp @@ -30,7 +30,7 @@ #pragma pack(push) #pragma pack(1) -class Transparent : public FDialog +class Transparent : public finalcut::FDialog { public: // Typedef and Enumeration @@ -43,7 +43,7 @@ class Transparent : public FDialog public: // Constructor - explicit Transparent (FWidget* = 0, trans_type = transparent); + explicit Transparent (finalcut::FWidget* = 0, trans_type = transparent); // Destructor ~Transparent(); @@ -59,7 +59,7 @@ class Transparent : public FDialog void draw(); // Event handlers - void onKeyPress (FKeyEvent* ev); + void onKeyPress (finalcut::FKeyEvent* ev); // Data Members trans_type type; @@ -67,8 +67,9 @@ class Transparent : public FDialog #pragma pack(pop) //---------------------------------------------------------------------- -Transparent::Transparent (FWidget* parent, Transparent::trans_type tt) - : FDialog(parent) +Transparent::Transparent ( finalcut::FWidget* parent + , Transparent::trans_type tt ) + : finalcut::FDialog(parent) , type(tt) { setStatusbarMessage("Press Q to quit"); @@ -81,7 +82,7 @@ Transparent::~Transparent() //---------------------------------------------------------------------- void Transparent::draw() { - FDialog::draw(); + finalcut::FDialog::draw(); if ( isMonochron() ) setReverse(true); @@ -94,16 +95,16 @@ void Transparent::draw() else if ( type == inherit_background ) { if ( getMaxColor() > 8 ) - setColor(fc::Blue, fc::Black); + setColor(finalcut::fc::Blue, finalcut::fc::Black); else - setColor(fc::Green, fc::Black); + setColor(finalcut::fc::Green, finalcut::fc::Black); setInheritBackground(); } else setTransparent(); - FString line(getClientWidth(), wchar_t('.')); + finalcut::FString line(getClientWidth(), wchar_t('.')); for (int n = 1; n <= getClientHeight(); n++) { @@ -123,7 +124,7 @@ void Transparent::draw() } //---------------------------------------------------------------------- -void Transparent::onKeyPress (FKeyEvent* ev) +void Transparent::onKeyPress (finalcut::FKeyEvent* ev) { if ( ! ev ) return; @@ -136,7 +137,7 @@ void Transparent::onKeyPress (FKeyEvent* ev) ev->ignore(); } else - FDialog::onKeyPress(ev); + finalcut::FDialog::onKeyPress(ev); } @@ -147,11 +148,11 @@ void Transparent::onKeyPress (FKeyEvent* ev) #pragma pack(push) #pragma pack(1) -class MainWindow : public FDialog +class MainWindow : public finalcut::FDialog { private: - FString line1; - FString line2; + finalcut::FString line1; + finalcut::FString line2; private: // Disable copy constructor @@ -162,10 +163,10 @@ class MainWindow : public FDialog void draw(); // Event handlers - void onClose (FCloseEvent*); - void onShow (FShowEvent*); - void onTimer (FTimerEvent*); - void onKeyPress (FKeyEvent* ev) + void onClose (finalcut::FCloseEvent*); + void onShow (finalcut::FShowEvent*); + void onTimer (finalcut::FTimerEvent*); + void onKeyPress (finalcut::FKeyEvent* ev) { if ( ! ev ) return; @@ -176,19 +177,19 @@ class MainWindow : public FDialog ev->accept(); } else - FDialog::onKeyPress(ev); + finalcut::FDialog::onKeyPress(ev); } public: // Constructor - explicit MainWindow (FWidget* = 0); + explicit MainWindow (finalcut::FWidget* = 0); // Destructor ~MainWindow(); }; #pragma pack(pop) //---------------------------------------------------------------------- -MainWindow::MainWindow (FWidget* parent) +MainWindow::MainWindow (finalcut::FWidget* parent) : FDialog(parent) , line1() , line2() @@ -212,7 +213,7 @@ MainWindow::MainWindow (FWidget* parent) ibg->unsetTransparentShadow(); // Statusbar at the bottom - FStatusBar* status_bar = new FStatusBar (this); + finalcut::FStatusBar* status_bar = new finalcut::FStatusBar (this); status_bar->setMessage("Press Q to quit"); addAccelerator('q'); @@ -227,7 +228,7 @@ MainWindow::~MainWindow() //---------------------------------------------------------------------- void MainWindow::draw() { - FDialog::draw(); + finalcut::FDialog::draw(); if ( isMonochron() ) setReverse(true); @@ -245,19 +246,19 @@ void MainWindow::draw() } //---------------------------------------------------------------------- -void MainWindow::onClose (FCloseEvent* ev) +void MainWindow::onClose (finalcut::FCloseEvent* ev) { - FApplication::closeConfirmationDialog (this, ev); + finalcut::FApplication::closeConfirmationDialog (this, ev); } //---------------------------------------------------------------------- -void MainWindow::onShow (FShowEvent*) +void MainWindow::onShow (finalcut::FShowEvent*) { addTimer(100); } //---------------------------------------------------------------------- -void MainWindow::onTimer (FTimerEvent*) +void MainWindow::onTimer (finalcut::FTimerEvent*) { wchar_t first_Char[2]; uInt length = line1.getLength(); @@ -276,7 +277,7 @@ void MainWindow::onTimer (FTimerEvent*) int main (int argc, char* argv[]) { // Create the application object - FApplication app (argc, argv); + finalcut::FApplication app (argc, argv); // Create main dialog object MainWindow main_dlg (&app); diff --git a/examples/treeview.cpp b/examples/treeview.cpp index 0bfcc255..ceeba2c7 100644 --- a/examples/treeview.cpp +++ b/examples/treeview.cpp @@ -35,11 +35,11 @@ #pragma pack(push) #pragma pack(1) -class Treeview : public FDialog +class Treeview : public finalcut::FDialog { public: // Constructor - explicit Treeview (FWidget* = 0); + explicit Treeview (finalcut::FWidget* = 0); // Destructor ~Treeview(); @@ -62,11 +62,11 @@ class Treeview : public FDialog TreeItem* getOceania(); // Event handlers - void onClose (FCloseEvent*); + void onClose (finalcut::FCloseEvent*); // Data Members - FListView* listView; - FButton* Quit; + finalcut::FListView* listView; + finalcut::FButton* Quit; }; #pragma pack(pop) @@ -251,13 +251,13 @@ Treeview::TreeItem* Treeview::getOceania() } //---------------------------------------------------------------------- -Treeview::Treeview (FWidget* parent) - : FDialog(parent) +Treeview::Treeview (finalcut::FWidget* parent) + : finalcut::FDialog(parent) , listView() , Quit() { // Create FListView object - listView = new FListView (this); + listView = new finalcut::FListView (this); listView->setGeometry(2, 1, 53, 14); // Add columns to the view @@ -266,8 +266,8 @@ Treeview::Treeview (FWidget* parent) listView->addColumn ("Density/km²"); // Set right alignment for the second and third column - listView->setColumnAlignment (2, fc::alignRight); - listView->setColumnAlignment (3, fc::alignRight); + listView->setColumnAlignment (2, finalcut::fc::alignRight); + listView->setColumnAlignment (3, finalcut::fc::alignRight); // Activate tree view listView->setTreeView(); @@ -297,12 +297,15 @@ Treeview::Treeview (FWidget* parent) while ( continent_list->name ) { TreeItem* country_list = continent_list->child_element; - FStringList continent_line (continent_list->begin(), continent_list->end()); - FObjectIterator iter = listView->insert (continent_line); + finalcut::FStringList continent_line ( continent_list->begin() + , continent_list->end() ); + finalcut::FListViewIterator::FObjectIterator iter = \ + listView->insert (continent_line); while ( country_list && country_list->name ) { - FStringList country_line (country_list->begin(), country_list->end()); + finalcut::FStringList country_line ( country_list->begin() + , country_list->end() ); listView->insert (country_line, iter); country_list++; } @@ -311,7 +314,7 @@ Treeview::Treeview (FWidget* parent) } // Quit button - Quit = new FButton (this); + Quit = new finalcut::FButton (this); Quit->setGeometry(24, 16, 10, 1); Quit->setText (L"&Quit"); @@ -319,7 +322,7 @@ Treeview::Treeview (FWidget* parent) Quit->addCallback ( "clicked", - F_METHOD_CALLBACK (this, &FApplication::cb_exitApp) + F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) ); } @@ -345,13 +348,13 @@ void Treeview::adjustSize() if ( Quit ) Quit->setY(getHeight() - 4); - FDialog::adjustSize(); + finalcut::FDialog::adjustSize(); } //---------------------------------------------------------------------- -void Treeview::onClose (FCloseEvent* ev) +void Treeview::onClose (finalcut::FCloseEvent* ev) { - FApplication::closeConfirmationDialog (this, ev); + finalcut::FApplication::closeConfirmationDialog (this, ev); } @@ -362,7 +365,7 @@ void Treeview::onClose (FCloseEvent* ev) int main (int argc, char* argv[]) { // Create the application object - FApplication app(argc, argv); + finalcut::FApplication app(argc, argv); // Create main dialog object Treeview d(&app); diff --git a/examples/ui.cpp b/examples/ui.cpp index 6f455207..7810402d 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -34,11 +34,11 @@ #pragma pack(push) #pragma pack(1) -class ProgressDialog : public FDialog +class ProgressDialog : public finalcut::FDialog { public: // Constructor - explicit ProgressDialog (FWidget* = 0); + explicit ProgressDialog (finalcut::FWidget* = 0); // Destructor ~ProgressDialog(); @@ -50,25 +50,25 @@ class ProgressDialog : public FDialog ProgressDialog& operator = (const ProgressDialog&); // Event handlers - void onShow (FShowEvent*); - void onTimer (FTimerEvent*); + void onShow (finalcut::FShowEvent*); + void onTimer (finalcut::FTimerEvent*); // Callback methods - void cb_reset_bar (FWidget*, data_ptr); - void cb_more_bar (FWidget*, data_ptr); - void cb_exit_bar (FWidget*, data_ptr); + void cb_reset_bar (finalcut::FWidget*, data_ptr); + void cb_more_bar (finalcut::FWidget*, data_ptr); + void cb_exit_bar (finalcut::FWidget*, data_ptr); // Data Members - FProgressbar* progressBar; - FButton* reset; - FButton* more; - FButton* quit; + finalcut::FProgressbar* progressBar; + finalcut::FButton* reset; + finalcut::FButton* more; + finalcut::FButton* quit; }; #pragma pack(pop) //---------------------------------------------------------------------- -ProgressDialog::ProgressDialog (FWidget* parent) - : FDialog(parent) +ProgressDialog::ProgressDialog (finalcut::FWidget* parent) + : finalcut::FDialog(parent) , progressBar() , reset() , more() @@ -78,24 +78,24 @@ ProgressDialog::ProgressDialog (FWidget* parent) setText("Progress bar"); //setModal(); - reset = new FButton(this); + reset = new finalcut::FButton(this); reset->setText("&Reset"); reset->setStatusbarMessage ("Reset the progress bar"); reset->setGeometry(2, 6, 8, 1, false); reset->setDisable(); - more = new FButton(this); + more = new finalcut::FButton(this); more->setText("&More"); more->setStatusbarMessage ("Increases the progress bar position"); more->setGeometry(15, 6, 8, 1, false); more->setDisable(); - quit = new FButton(this); + quit = new finalcut::FButton(this); quit->setText("E&xit"); quit->setGeometry(28, 6, 8, 1, false); quit->setDisable(); - progressBar = new FProgressbar(this); + progressBar = new finalcut::FProgressbar(this); progressBar->setGeometry(2, 3, 34, 1, false); //progressBar->setPercentage(78); @@ -132,13 +132,13 @@ ProgressDialog::~ProgressDialog() // destructor } //---------------------------------------------------------------------- -void ProgressDialog::onShow (FShowEvent*) +void ProgressDialog::onShow (finalcut::FShowEvent*) { addTimer(15); } //---------------------------------------------------------------------- -void ProgressDialog::onTimer (FTimerEvent*) +void ProgressDialog::onTimer (finalcut::FTimerEvent*) { int p = progressBar->getPercentage(); progressBar->setPercentage(++p); @@ -164,20 +164,20 @@ void ProgressDialog::onTimer (FTimerEvent*) } //---------------------------------------------------------------------- -void ProgressDialog::cb_reset_bar (FWidget*, data_ptr) +void ProgressDialog::cb_reset_bar (finalcut::FWidget*, data_ptr) { progressBar->reset(); } //---------------------------------------------------------------------- -void ProgressDialog::cb_more_bar (FWidget*, data_ptr) +void ProgressDialog::cb_more_bar (finalcut::FWidget*, data_ptr) { int p = progressBar->getPercentage(); progressBar->setPercentage(++p); } //---------------------------------------------------------------------- -void ProgressDialog::cb_exit_bar (FWidget*, data_ptr) +void ProgressDialog::cb_exit_bar (finalcut::FWidget*, data_ptr) { close(); } @@ -190,16 +190,16 @@ void ProgressDialog::cb_exit_bar (FWidget*, data_ptr) #pragma pack(push) #pragma pack(1) -class TextWindow : public FDialog +class TextWindow : public finalcut::FDialog { public: // Constructor - explicit TextWindow (FWidget* = 0); + explicit TextWindow (finalcut::FWidget* = 0); // Destructor ~TextWindow(); - void append (const FString&); + void append (const finalcut::FString&); private: // Disable copy constructor @@ -211,16 +211,16 @@ class TextWindow : public FDialog void adjustSize(); // Data Members - FTextView* scrollText; + finalcut::FTextView* scrollText; }; #pragma pack(pop) //---------------------------------------------------------------------- -TextWindow::TextWindow (FWidget* parent) - : FDialog(parent) +TextWindow::TextWindow (finalcut::FWidget* parent) + : finalcut::FDialog(parent) , scrollText() { - scrollText = new FTextView(this); + scrollText = new finalcut::FTextView(this); scrollText->ignorePadding(); scrollText->setGeometry (1, 2, getWidth(), getHeight() - 1); setMinimumSize (51, 6); @@ -240,7 +240,7 @@ TextWindow::~TextWindow() // destructor { } //---------------------------------------------------------------------- -void TextWindow::append (const FString& str) +void TextWindow::append (const finalcut::FString& str) { scrollText->append(str); } @@ -248,7 +248,7 @@ void TextWindow::append (const FString& str) //---------------------------------------------------------------------- void TextWindow::adjustSize() { - FDialog::adjustSize(); + finalcut::FDialog::adjustSize(); scrollText->setGeometry (1, 2, getWidth(), getHeight() - 1); } @@ -260,11 +260,11 @@ void TextWindow::adjustSize() #pragma pack(push) #pragma pack(1) -class MyDialog : public FDialog +class MyDialog : public finalcut::FDialog { public: // Constructor - explicit MyDialog (FWidget* = 0); + explicit MyDialog (finalcut::FWidget* = 0); // Destructor ~MyDialog(); @@ -292,58 +292,58 @@ class MyDialog : public FDialog void adjustSize(); // Event handlers - void onClose (FCloseEvent*); + void onClose (finalcut::FCloseEvent*); // Callback methods - void cb_noFunctionMsg (FWidget*, data_ptr); - void cb_about (FWidget*, data_ptr); - void cb_terminfo (FWidget*, data_ptr); - void cb_drives (FWidget*, data_ptr); - void cb_cutClipboard (FWidget*, data_ptr); - void cb_copyClipboard (FWidget*, data_ptr); - void cb_pasteClipboard (FWidget*, data_ptr); - void cb_clearInput (FWidget*, data_ptr); - void cb_input2buttonText (FWidget*, data_ptr); - void cb_setTitlebar (FWidget*, data_ptr); - void cb_ProgressBar (FWidget*, data_ptr); - void cb_updateNumber (FWidget*, data_ptr); - void cb_activateButton (FWidget*, data_ptr); - void cb_view (FWidget*, data_ptr); - void cb_setInput (FWidget*, data_ptr); + void cb_noFunctionMsg (finalcut::FWidget*, data_ptr); + void cb_about (finalcut::FWidget*, data_ptr); + void cb_terminfo (finalcut::FWidget*, data_ptr); + void cb_drives (finalcut::FWidget*, data_ptr); + void cb_cutClipboard (finalcut::FWidget*, data_ptr); + void cb_copyClipboard (finalcut::FWidget*, data_ptr); + void cb_pasteClipboard (finalcut::FWidget*, data_ptr); + void cb_clearInput (finalcut::FWidget*, data_ptr); + void cb_input2buttonText (finalcut::FWidget*, data_ptr); + void cb_setTitlebar (finalcut::FWidget*, data_ptr); + void cb_ProgressBar (finalcut::FWidget*, data_ptr); + void cb_updateNumber (finalcut::FWidget*, data_ptr); + void cb_activateButton (finalcut::FWidget*, data_ptr); + void cb_view (finalcut::FWidget*, data_ptr); + void cb_setInput (finalcut::FWidget*, data_ptr); // Data Members - FMenuItem* Open; - FMenuItem* Quit; - FMenuItem* File1; - FMenuItem* File2; - FMenuItem* File3; - FMenuItem* Cut; - FMenuItem* Copy; - FMenuItem* Paste; - FMenuItem* Clear; - FMenuItem* Env; - FMenuItem* Drive; - FMenuItem* Help; - FStatusKey* key_F1; - FStatusKey* key_F2; - FStatusKey* key_F3; - FButton* MyButton1; - FButton* MyButton2; - FButton* MyButton3; - FButton* MyButton4; - FButton* MyButton5; - FButton* MyButton6; - FRadioButton* radio1; - FLabel* tagged_count; - FLineEdit* myLineEdit; - FListBox* myList; - FString clipboard; + finalcut::FMenuItem* Open; + finalcut::FMenuItem* Quit; + finalcut::FMenuItem* File1; + finalcut::FMenuItem* File2; + finalcut::FMenuItem* File3; + finalcut::FMenuItem* Cut; + finalcut::FMenuItem* Copy; + finalcut::FMenuItem* Paste; + finalcut::FMenuItem* Clear; + finalcut::FMenuItem* Env; + finalcut::FMenuItem* Drive; + finalcut::FMenuItem* Help; + finalcut::FStatusKey* key_F1; + finalcut::FStatusKey* key_F2; + finalcut::FStatusKey* key_F3; + finalcut::FButton* MyButton1; + finalcut::FButton* MyButton2; + finalcut::FButton* MyButton3; + finalcut::FButton* MyButton4; + finalcut::FButton* MyButton5; + finalcut::FButton* MyButton6; + finalcut::FRadioButton* radio1; + finalcut::FLabel* tagged_count; + finalcut::FLineEdit* myLineEdit; + finalcut::FListBox* myList; + finalcut::FString clipboard; }; #pragma pack(pop) //---------------------------------------------------------------------- -MyDialog::MyDialog (FWidget* parent) - : FDialog(parent) +MyDialog::MyDialog (finalcut::FWidget* parent) + : finalcut::FDialog(parent) , Open() , Quit() , File1() @@ -387,62 +387,67 @@ MyDialog::~MyDialog() // destructor void MyDialog::initMenu() { // Menu bar - FMenuBar* Menubar = new FMenuBar (this); + finalcut::FMenuBar* Menubar = new finalcut::FMenuBar (this); // Menu bar items - FMenu* File = new FMenu ("&File", Menubar); + finalcut::FMenu* File = new finalcut::FMenu ("&File", Menubar); File->setStatusbarMessage ("File management commands"); - FMenu* Edit = new FMenu ("&Edit", Menubar); + finalcut::FMenu* Edit = new finalcut::FMenu ("&Edit", Menubar); Edit->setStatusbarMessage ("Cut-and-paste editing commands"); - FMenu* View = new FMenu ("&View", Menubar); + finalcut::FMenu* View = new finalcut::FMenu ("&View", Menubar); View->setStatusbarMessage ("Show internal informations"); - FMenuItem* Options = new FMenuItem ("&Options", Menubar); + finalcut::FMenuItem* Options = \ + new finalcut::FMenuItem ("&Options", Menubar); Options->setStatusbarMessage ("Set program defaults"); Options->setDisable(); - FDialogListMenu* Window = new FDialogListMenu ("&Window", Menubar); + finalcut::FDialogListMenu* Window = \ + new finalcut::FDialogListMenu ("&Window", Menubar); Window->setStatusbarMessage ("List of all the active dialogs"); - Help = new FMenuItem ("&Help", Menubar); + Help = new finalcut::FMenuItem ("&Help", Menubar); Help->setStatusbarMessage ("Show version and copyright information"); // "File" menu items - Open = new FMenuItem ("&Open...", File); - Open->addAccelerator (fc::Fckey_o); // Ctrl + O + Open = new finalcut::FMenuItem ("&Open...", File); + Open->addAccelerator (finalcut::fc::Fckey_o); // Ctrl + O Open->setStatusbarMessage ("Locate and open a text file"); - FMenu* Recent = new FMenu ("&System files", File); + finalcut::FMenu* Recent = new finalcut::FMenu ("&System files", File); Recent->setStatusbarMessage ("View text file"); - FMenuItem* Line1 = new FMenuItem (File); + finalcut::FMenuItem* Line1 = new finalcut::FMenuItem (File); Line1->setSeparator(); - Quit = new FMenuItem ("&Quit", File); - Quit->addAccelerator (fc::Fmkey_x); // Meta/Alt + X + Quit = new finalcut::FMenuItem ("&Quit", File); + Quit->addAccelerator (finalcut::fc::Fmkey_x); // Meta/Alt + X Quit->setStatusbarMessage ("Exit the program"); // "Recent" menu items - File1 = new FMenuItem ("/etc/services", Recent); - File2 = new FMenuItem ("/etc/fstab", Recent); - File3 = new FMenuItem ("/etc/passwd", Recent); + File1 = new finalcut::FMenuItem ("/etc/services", Recent); + File2 = new finalcut::FMenuItem ("/etc/fstab", Recent); + File3 = new finalcut::FMenuItem ("/etc/passwd", Recent); // "Edit" menu items - FMenuItem* Undo = new FMenuItem (fc::Fckey_z, "Undo", Edit); + finalcut::FMenuItem* Undo = \ + new finalcut::FMenuItem (finalcut::fc::Fckey_z, "Undo", Edit); Undo->setDisable(); - FMenuItem* Redo = new FMenuItem (fc::Fckey_y, "Redo", Edit); + finalcut::FMenuItem* Redo = \ + new finalcut::FMenuItem (finalcut::fc::Fckey_y, "Redo", Edit); Redo->setDisable(); - FMenuItem* Line2 = new FMenuItem (Edit); + finalcut::FMenuItem* Line2 = \ + new finalcut::FMenuItem (Edit); Line2->setSeparator(); - Cut = new FMenuItem (fc::Fckey_x, "Cu&t", Edit); + Cut = new finalcut::FMenuItem (finalcut::fc::Fckey_x, "Cu&t", Edit); Cut->setStatusbarMessage ( "Remove the input text" " and put it in the clipboard" ); - Copy= new FMenuItem (fc::Fckey_c, "&Copy", Edit); + Copy= new finalcut::FMenuItem (finalcut::fc::Fckey_c, "&Copy", Edit); Copy->setStatusbarMessage ("Copy the input text into the clipboad"); - Paste = new FMenuItem (fc::Fckey_v, "&Paste", Edit); + Paste = new finalcut::FMenuItem (finalcut::fc::Fckey_v, "&Paste", Edit); Paste->setStatusbarMessage ("Insert text form clipboard"); - Clear = new FMenuItem (fc::Fkey_dc, "C&lear", Edit); + Clear = new finalcut::FMenuItem (finalcut::fc::Fkey_dc, "C&lear", Edit); Clear->setStatusbarMessage ("Delete input text"); // "View" menu items - Env = new FMenuItem ("&Terminal...", View); + Env = new finalcut::FMenuItem ("&Terminal...", View); Env->setStatusbarMessage ("Informations about this terminal"); - Drive = new FMenuItem ("&Drive symbols...", View); + Drive = new finalcut::FMenuItem ("&Drive symbols...", View); Drive->setStatusbarMessage ("Show drive symbols"); } @@ -469,7 +474,7 @@ void MyDialog::initFileMenuCallbacks() Quit->addCallback ( "clicked", - F_METHOD_CALLBACK (this, &FApplication::cb_exitApp) + F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) ); // System files submenu @@ -477,21 +482,21 @@ void MyDialog::initFileMenuCallbacks() ( "clicked", F_METHOD_CALLBACK (this, &MyDialog::cb_view), - static_cast(File1) + static_cast(File1) ); File2->addCallback ( "clicked", F_METHOD_CALLBACK (this, &MyDialog::cb_view), - static_cast(File2) + static_cast(File2) ); File3->addCallback ( "clicked", F_METHOD_CALLBACK (this, &MyDialog::cb_view), - static_cast(File3) + static_cast(File3) ); } @@ -555,12 +560,12 @@ void MyDialog::initHelpMenuCallback() void MyDialog::initStatusBar() { // Statusbar at the bottom - FStatusBar* Statusbar = new FStatusBar (this); + finalcut::FStatusBar* Statusbar = new finalcut::FStatusBar (this); // Statusbar keys - key_F1 = new FStatusKey (fc::Fkey_f1, "About", Statusbar); - key_F2 = new FStatusKey (fc::Fkey_f2, "View", Statusbar); - key_F3 = new FStatusKey (fc::Fkey_f3, "Quit", Statusbar); + key_F1 = new finalcut::FStatusKey (finalcut::fc::Fkey_f1, "About", Statusbar); + key_F2 = new finalcut::FStatusKey (finalcut::fc::Fkey_f2, "View", Statusbar); + key_F3 = new finalcut::FStatusKey (finalcut::fc::Fkey_f3, "Quit", Statusbar); } //---------------------------------------------------------------------- @@ -583,7 +588,7 @@ void MyDialog::initStatusBarCallbacks() key_F3->addCallback ( "activate", - F_METHOD_CALLBACK (this, &FApplication::cb_exitApp) + F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) ); } @@ -597,24 +602,24 @@ void MyDialog::initWidgets() initToggleButtons(); // A text input field - myLineEdit = new FLineEdit (this); + myLineEdit = new finalcut::FLineEdit (this); myLineEdit->setGeometry(22, 1, 10, 1); myLineEdit->setLabelText (L"&Input"); myLineEdit->setStatusbarMessage ("Press Enter to set the title"); - *myLineEdit << FString("EnTry").toLower(); + *myLineEdit << finalcut::FString("EnTry").toLower(); // Buttons initButtons(); // A multiple selection listbox - myList = new FListBox (this); + myList = new finalcut::FListBox (this); myList->setGeometry(38, 1, 14, 17); myList->setText ("Items"); myList->setStatusbarMessage ("99 items in a list"); myList->setMultiSelection(); for (int z = 1; z < 100; z++) - myList->insert (FString() << z << L" placeholder"); + myList->insert (finalcut::FString() << z << L" placeholder"); // Text labels initLabels(); @@ -624,23 +629,23 @@ void MyDialog::initWidgets() void MyDialog::initFlatButtons() { // Flat buttons - MyButton1 = new FButton (this); + MyButton1 = new finalcut::FButton (this); MyButton1->setGeometry(3, 3, 5, 1); MyButton1->setText (L"&SIN"); MyButton1->setStatusbarMessage ("Sine function"); MyButton1->setNoUnderline(); MyButton1->setFlat(); - MyButton1->setDoubleFlatLine (fc::bottom); + MyButton1->setDoubleFlatLine (finalcut::fc::bottom); - MyButton2 = new FButton (this); + MyButton2 = new finalcut::FButton (this); MyButton2->setGeometry(3, 5, 5, 1); MyButton2->setText (L"&COS"); MyButton2->setStatusbarMessage ("Cosine function"); MyButton2->setNoUnderline(); MyButton2->setFlat(); - MyButton2->setDoubleFlatLine (fc::top); + MyButton2->setDoubleFlatLine (finalcut::fc::top); - MyButton3 = new FButton (this); + MyButton3 = new finalcut::FButton (this); MyButton3->setGeometry(10, 3, 5, 3); MyButton3->setText (L"&="); MyButton3->setStatusbarMessage ("Equal"); @@ -671,15 +676,17 @@ void MyDialog::initFlatButtons() void MyDialog::initToggleButtons() { // Radio buttons in a group - FButtonGroup* radioButtonGroup = new FButtonGroup ("Button", this); + finalcut::FButtonGroup* radioButtonGroup = \ + new finalcut::FButtonGroup ("Button", this); radioButtonGroup->setGeometry(3, 8, 14, 4); //radioButtonGroup->unsetBorder(); - radio1 = new FRadioButton ("E&nable", radioButtonGroup); + radio1 = new finalcut::FRadioButton ("E&nable", radioButtonGroup); radio1->setGeometry(1, 1, 10, 1); radio1->setStatusbarMessage ("Enable button Test"); - FRadioButton* radio2 = new FRadioButton (radioButtonGroup); + finalcut::FRadioButton* radio2 = \ + new finalcut::FRadioButton (radioButtonGroup); radio2->setGeometry(1, 2, 11, 1); radio2->setText ("&Disable"); radio2->setStatusbarMessage ("Disable button Test"); @@ -687,14 +694,17 @@ void MyDialog::initToggleButtons() //radio2->setDisable(); // Checkboxes in a group - FButtonGroup* checkButtonGroup = new FButtonGroup ("Options", this); + finalcut::FButtonGroup* checkButtonGroup = \ + new finalcut::FButtonGroup ("Options", this); checkButtonGroup->setGeometry(3, 12, 14, 4); - FCheckBox* check1 = new FCheckBox ("&Bitmode", checkButtonGroup); + finalcut::FCheckBox* check1 = \ + new finalcut::FCheckBox ("&Bitmode", checkButtonGroup); check1->setGeometry(1, 1, 11, 1); check1->setNoUnderline(); - FCheckBox* check2 = new FCheckBox ("&8-Bit", checkButtonGroup); + finalcut::FCheckBox* check2 = \ + new finalcut::FCheckBox ("&8-Bit", checkButtonGroup); check2->setGeometry(1, 2, 9, 1); check2->setChecked(); check2->setNoUnderline(); @@ -704,19 +714,19 @@ void MyDialog::initToggleButtons() void MyDialog::initButtons() { // Buttons - MyButton4 = new FButton (this); + MyButton4 = new finalcut::FButton (this); MyButton4->setGeometry(20, 8, 12, 1); MyButton4->setText (L"&Get input"); MyButton4->setStatusbarMessage ("Take text from input field"); MyButton4->setFocus(); - MyButton5 = new FButton (this); + MyButton5 = new finalcut::FButton (this); MyButton5->setGeometry(20, 11, 12, 1); MyButton5->setText (L"&Test"); MyButton5->setStatusbarMessage ("Progressbar testing dialog"); MyButton5->setDisable(); - MyButton6 = new FButton (this); + MyButton6 = new finalcut::FButton (this); MyButton6->setGeometry(20, 14, 12, 1); MyButton6->setText (L"&Quit"); MyButton6->setStatusbarMessage ("Exit the program"); @@ -727,7 +737,7 @@ void MyDialog::initButtons() ( "clicked", F_METHOD_CALLBACK (this, &MyDialog::cb_input2buttonText), - static_cast(myLineEdit) + static_cast(myLineEdit) ); MyButton5->addCallback @@ -739,7 +749,7 @@ void MyDialog::initButtons() MyButton6->addCallback ( "clicked", - F_METHOD_CALLBACK (this, &FApplication::cb_exitApp) + F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) ); } @@ -747,24 +757,24 @@ void MyDialog::initButtons() void MyDialog::initLabels() { // Text labels - FLabel* headline = new FLabel (this); + finalcut::FLabel* headline = new finalcut::FLabel (this); headline->setGeometry(21, 3, 10, 1); headline->setEmphasis(); - headline->setAlignment (fc::alignCenter); + headline->setAlignment (finalcut::fc::alignCenter); *headline = L"List items"; - FLabel* tagged = new FLabel (L"Tagged:", this); + finalcut::FLabel* tagged = new finalcut::FLabel (L"Tagged:", this); tagged->setGeometry(21, 4, 7, 1); - tagged_count = new FLabel(this); + tagged_count = new finalcut::FLabel(this); tagged_count->setGeometry(29, 4, 5, 1); *tagged_count << 0; - FLabel* sum = new FLabel (L"Sum:", this); + finalcut::FLabel* sum = new finalcut::FLabel (L"Sum:", this); sum->setGeometry(21, 5, 7, 3); - sum->setAlignment (fc::alignRight); + sum->setAlignment (finalcut::fc::alignRight); - FLabel* sum_count = new FLabel (this); + finalcut::FLabel* sum_count = new finalcut::FLabel (this); sum_count->setGeometry(29, 5, 5, 3); *sum_count << myList->getCount(); } @@ -784,21 +794,21 @@ void MyDialog::initWidgetsCallbacks() ( "toggled", F_METHOD_CALLBACK (this, &MyDialog::cb_activateButton), - static_cast(MyButton5) + static_cast(MyButton5) ); myList->addCallback ( "clicked", F_METHOD_CALLBACK (this, &MyDialog::cb_setInput), - static_cast(myLineEdit) + static_cast(myLineEdit) ); myList->addCallback ( "row-selected", F_METHOD_CALLBACK (this, &MyDialog::cb_updateNumber), - static_cast(tagged_count) + static_cast(tagged_count) ); } @@ -817,83 +827,91 @@ void MyDialog::adjustSize() if ( myList ) myList->setHeight (getHeight() - 3, false); - FDialog::adjustSize(); + finalcut::FDialog::adjustSize(); } //---------------------------------------------------------------------- -void MyDialog::onClose (FCloseEvent* ev) +void MyDialog::onClose (finalcut::FCloseEvent* ev) { - FApplication::closeConfirmationDialog (this, ev); + finalcut::FApplication::closeConfirmationDialog (this, ev); } //---------------------------------------------------------------------- -void MyDialog::cb_noFunctionMsg (FWidget* widget, data_ptr) +void MyDialog::cb_noFunctionMsg (finalcut::FWidget* widget, data_ptr) { - FButton* button = static_cast(widget); - FString text = button->getText(); + finalcut::FButton* button = static_cast(widget); + finalcut::FString text = button->getText(); text = text.replace('&', ""); - FMessageBox::error (this, "The \"" + text + "\" button has\n" - "no function"); + finalcut::FMessageBox::error ( this + , "The \"" + text + "\" button has\n" + "no function"); } //---------------------------------------------------------------------- -void MyDialog::cb_about (FWidget*, data_ptr) +void MyDialog::cb_about (finalcut::FWidget*, data_ptr) { const char libver[] = F_VERSION; - FString line(2, wchar_t(fc::BoxDrawingsHorizontal)); + finalcut::FString line(2, wchar_t(finalcut::fc::BoxDrawingsHorizontal)); - FMessageBox info ( "About" - , line + L" The Final Cut " + line + "\n\n" - L"Version " + libver + "\n\n" - L"(c) 2018 by Markus Gans" - , FMessageBox::Ok, 0, 0, this ); + finalcut::FMessageBox info ( "About" + , line + L" The Final Cut " + line + "\n\n" + L"Version " + libver + "\n\n" + L"(c) 2018 by Markus Gans" + , finalcut::FMessageBox::Ok, 0, 0, this ); info.setCenterText(); info.show(); } //---------------------------------------------------------------------- -void MyDialog::cb_terminfo (FWidget*, data_ptr) +void MyDialog::cb_terminfo (finalcut::FWidget*, data_ptr) { int x = getDesktopWidth(); int y = getDesktopHeight(); - FMessageBox info1 ( "Environment" - , FString() - << " Type: " << getTermType() << "\n" - << " Name: " << getTermFileName() << "\n" - << " Mode: " << getEncodingString() << "\n" - << " Size: " << x << wchar_t(fc::Times) - << y << "\n" - << "Colors: " << getMaxColor() - , FMessageBox::Ok, 0, 0, this ); + finalcut::FMessageBox info1 \ + ( + "Environment" + , finalcut::FString() + << " Type: " << getTermType() << "\n" + << " Name: " << getTermFileName() << "\n" + << " Mode: " << getEncodingString() << "\n" + << " Size: " << x << wchar_t(finalcut::fc::Times) + << y << "\n" + << "Colors: " << getMaxColor() + , finalcut::FMessageBox::Ok, 0, 0, this + ); info1.setHeadline("Terminal:"); info1.exec(); } //---------------------------------------------------------------------- -void MyDialog::cb_drives (FWidget*, data_ptr) +void MyDialog::cb_drives (finalcut::FWidget*, data_ptr) { - FMessageBox info2 ( "Drive symbols" - , "Generic: \n\n" - "Network: \n\n" - " CD:" - , FMessageBox::Ok, 0, 0, this ); + finalcut::FMessageBox info2 \ + ( + "Drive symbols" + , "Generic: \n\n" + "Network: \n\n" + " CD:" + , finalcut::FMessageBox::Ok, 0, 0, this + ); + if ( isNewFont() ) { - FLabel drive (NF_Drive, &info2); + finalcut::FLabel drive (finalcut::NF_Drive, &info2); drive.setGeometry (11, 2, 4, 1); - FLabel net (NF_Net_Drive, &info2); + finalcut::FLabel net (finalcut::NF_Net_Drive, &info2); net.setGeometry (11, 4, 4, 1); - FLabel cd (NF_CD_ROM, &info2); + finalcut::FLabel cd (finalcut::NF_CD_ROM, &info2); cd.setGeometry (11, 6, 4, 1); info2.exec(); } else { - FLabel drive (" - ", &info2); + finalcut::FLabel drive (" - ", &info2); drive.setGeometry (11, 2, 4, 1); - FLabel net (" N ", &info2); + finalcut::FLabel net (" N ", &info2); net.setGeometry (11, 4, 4, 1); - FLabel cd (" CD ", &info2); + finalcut::FLabel cd (" CD ", &info2); cd.setGeometry (11, 6, 4, 1); if ( isMonochron() ) @@ -904,12 +922,12 @@ void MyDialog::cb_drives (FWidget*, data_ptr) } else { - net.setForegroundColor (fc::White); - net.setBackgroundColor (fc::DarkGray); - drive.setForegroundColor (fc::White); - drive.setBackgroundColor (fc::DarkGray); - cd.setForegroundColor (fc::White); - cd.setBackgroundColor (fc::DarkGray); + 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); } info2.exec(); @@ -917,7 +935,7 @@ void MyDialog::cb_drives (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void MyDialog::cb_cutClipboard (FWidget*, data_ptr) +void MyDialog::cb_cutClipboard (finalcut::FWidget*, data_ptr) { if ( ! myLineEdit ) return; @@ -928,7 +946,7 @@ void MyDialog::cb_cutClipboard (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void MyDialog::cb_copyClipboard (FWidget*, data_ptr) +void MyDialog::cb_copyClipboard (finalcut::FWidget*, data_ptr) { if ( ! myLineEdit ) return; @@ -937,7 +955,7 @@ void MyDialog::cb_copyClipboard (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void MyDialog::cb_pasteClipboard (FWidget*, data_ptr) +void MyDialog::cb_pasteClipboard (finalcut::FWidget*, data_ptr) { if ( ! myLineEdit ) return; @@ -947,7 +965,7 @@ void MyDialog::cb_pasteClipboard (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void MyDialog::cb_clearInput (FWidget*, data_ptr) +void MyDialog::cb_clearInput (finalcut::FWidget*, data_ptr) { if ( ! myLineEdit ) return; @@ -958,19 +976,19 @@ void MyDialog::cb_clearInput (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void MyDialog::cb_input2buttonText (FWidget* widget, data_ptr data) +void MyDialog::cb_input2buttonText (finalcut::FWidget* widget, data_ptr data) { - FButton* button = static_cast(widget); - FLineEdit* lineedit = static_cast(data); + finalcut::FButton* button = static_cast(widget); + finalcut::FLineEdit* lineedit = static_cast(data); button->setText( lineedit->getText() ); button->redraw(); } //---------------------------------------------------------------------- -void MyDialog::cb_setTitlebar (FWidget* widget, data_ptr) +void MyDialog::cb_setTitlebar (finalcut::FWidget* widget, data_ptr) { - FLineEdit* lineedit = static_cast(widget); - FString title; + finalcut::FLineEdit* lineedit = static_cast(widget); + finalcut::FString title; *lineedit >> title; setTermTitle (title); setText (title); @@ -978,17 +996,17 @@ void MyDialog::cb_setTitlebar (FWidget* widget, data_ptr) } //---------------------------------------------------------------------- -void MyDialog::cb_ProgressBar (FWidget*, data_ptr) +void MyDialog::cb_ProgressBar (finalcut::FWidget*, data_ptr) { ProgressDialog* p_dgl = new ProgressDialog(this); p_dgl->show(); } //---------------------------------------------------------------------- -void MyDialog::cb_updateNumber (FWidget* widget, data_ptr data) +void MyDialog::cb_updateNumber (finalcut::FWidget* widget, data_ptr data) { - FListBox* list = static_cast(widget); - FLabel* num = static_cast(data); + finalcut::FListBox* list = static_cast(widget); + finalcut::FLabel* num = static_cast(data); int select_num = 0; uInt count = list->getCount(); @@ -1002,10 +1020,10 @@ void MyDialog::cb_updateNumber (FWidget* widget, data_ptr data) } //---------------------------------------------------------------------- -void MyDialog::cb_activateButton (FWidget* widget, data_ptr data) +void MyDialog::cb_activateButton (finalcut::FWidget* widget, data_ptr data) { - FRadioButton* rb = static_cast(widget); - FButton* button = static_cast(data); + finalcut::FRadioButton* rb = static_cast(widget); + finalcut::FButton* button = static_cast(data); if ( rb->isChecked() ) button->setEnable(); @@ -1016,26 +1034,26 @@ void MyDialog::cb_activateButton (FWidget* widget, data_ptr data) } //---------------------------------------------------------------------- -void MyDialog::cb_view (FWidget*, data_ptr data) +void MyDialog::cb_view (finalcut::FWidget*, data_ptr data) { - FString file; - FMenuItem* item = static_cast(data); + finalcut::FString file; + finalcut::FMenuItem* item = static_cast(data); if ( item && ! item->getText().isEmpty() ) file = item->getText(); else - file = FFileDialog::fileOpenChooser (this); + file = finalcut::FFileDialog::fileOpenChooser (this); if ( file.isNull() ) return; TextWindow* view = new TextWindow(this); - FString filename(basename(const_cast(file.c_str()))); + finalcut::FString filename(basename(const_cast(file.c_str()))); view->setText ("Viewer: " + filename); - view->setGeometry (1 + int((getRootWidget()->getWidth() - 60) / 2), - int(getRootWidget()->getHeight() / 6), - 60, - int(getRootWidget()->getHeight() * 3 / 4)); + view->setGeometry ( 1 + int((getRootWidget()->getWidth() - 60) / 2), + int(getRootWidget()->getHeight() / 6), + 60, + int(getRootWidget()->getHeight() * 3 / 4) ); view->setResizeable(); std::string line = ""; @@ -1055,10 +1073,10 @@ void MyDialog::cb_view (FWidget*, data_ptr data) } //---------------------------------------------------------------------- -void MyDialog::cb_setInput (FWidget* widget, data_ptr data) +void MyDialog::cb_setInput (finalcut::FWidget* widget, data_ptr data) { - FListBox* ListBox = static_cast(widget); - FLineEdit* lineedit = static_cast(data); + finalcut::FListBox* ListBox = static_cast(widget); + finalcut::FLineEdit* lineedit = static_cast(data); *lineedit = ListBox->getItem(ListBox->currentItem()).getText(); lineedit->redraw(); } @@ -1070,11 +1088,13 @@ void MyDialog::cb_setInput (FWidget* widget, data_ptr data) int main (int argc, char* argv[]) { - FString ver = F_VERSION; // Library version - FString title = "The FINAL CUT " + ver + " (C) 2018 by Markus Gans"; + finalcut::FString ver = F_VERSION; // Library version + finalcut::FString title = "The FINAL CUT " + + ver + + " (C) 2018 by Markus Gans"; // Create the application object app - FApplication app(argc, argv); + finalcut::FApplication app(argc, argv); app.redefineDefaultColors(true); app.setTermTitle (title); diff --git a/examples/watch.cpp b/examples/watch.cpp index ad45e39e..da31c27a 100644 --- a/examples/watch.cpp +++ b/examples/watch.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2017 Markus Gans * +* Copyright 2015-2018 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 * @@ -31,11 +31,11 @@ #pragma pack(push) #pragma pack(1) -class Watch : public FDialog +class Watch : public finalcut::FDialog { public: // Constructor - explicit Watch (FWidget* = 0); + explicit Watch (finalcut::FWidget* = 0); // Destructor ~Watch(); @@ -44,12 +44,12 @@ class Watch : public FDialog void printTime(); // Event handlers - void onTimer (FTimerEvent*); - void onClose (FCloseEvent*); + void onTimer (finalcut::FTimerEvent*); + void onClose (finalcut::FCloseEvent*); // Callback methods - void cb_clock (FWidget*, data_ptr); - void cb_seconds (FWidget*, data_ptr); + void cb_clock (finalcut::FWidget*, data_ptr); + void cb_seconds (finalcut::FWidget*, data_ptr); protected: // Method @@ -63,17 +63,17 @@ class Watch : public FDialog Watch& operator = (const Watch&); // Data Members - bool sec; - FLabel* time_label; - FLabel* time_str; - FSwitch* clock_sw; - FSwitch* seconds_sw; + bool sec; + finalcut::FLabel* time_label; + finalcut::FLabel* time_str; + finalcut::FSwitch* clock_sw; + finalcut::FSwitch* seconds_sw; }; #pragma pack(pop) //---------------------------------------------------------------------- Watch::Watch (FWidget* parent) - : FDialog(parent) + : finalcut::FDialog(parent) , sec(true) , time_label(0) , time_str(0) @@ -85,21 +85,21 @@ Watch::Watch (FWidget* parent) setGeometry (1 + (pw - 22) / 2, 3, 22, 13); // Create labels - time_label = new FLabel(L"Time", this); + time_label = new finalcut::FLabel(L"Time", this); time_label->setGeometry(5, 2, 5, 1); time_label->setEmphasis(); - time_str = new FLabel(L"--:--:--", this); + time_str = new finalcut::FLabel(L"--:--:--", this); time_str->setGeometry(10, 2, 8, 1); // Create checkbox buttons - clock_sw = new FSwitch(L"Clock", this); - seconds_sw = new FSwitch(L"Seconds", this); + clock_sw = new finalcut::FSwitch(L"Clock", this); + seconds_sw = new finalcut::FSwitch(L"Seconds", this); clock_sw->setGeometry(4, 4, 9, 1); seconds_sw->setGeometry(2, 6, 11, 1); sec = seconds_sw->setChecked(); // Create button - FButton* quit_btn = new FButton(L"&Quit", this); + finalcut::FButton* quit_btn = new finalcut::FButton(L"&Quit", this); quit_btn->setGeometry(6, 9, 9, 1); // Connect switch signal "toggled" with a callback member function @@ -120,7 +120,7 @@ Watch::Watch (FWidget* parent) quit_btn->addCallback ( "clicked", - F_METHOD_CALLBACK (this, &FApplication::cb_exitApp) + F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) ); } @@ -133,7 +133,7 @@ Watch::~Watch() //---------------------------------------------------------------------- void Watch::printTime() { - FString str; + finalcut::FString str; std::tm now; std::time_t t; @@ -150,19 +150,19 @@ void Watch::printTime() } //---------------------------------------------------------------------- -void Watch::onTimer (FTimerEvent*) +void Watch::onTimer (finalcut::FTimerEvent*) { printTime(); } //---------------------------------------------------------------------- -void Watch::onClose (FCloseEvent* ev) +void Watch::onClose (finalcut::FCloseEvent* ev) { - FApplication::closeConfirmationDialog (this, ev); + finalcut::FApplication::closeConfirmationDialog (this, ev); } //---------------------------------------------------------------------- -void Watch::cb_clock (FWidget*, data_ptr) +void Watch::cb_clock (finalcut::FWidget*, data_ptr) { if ( clock_sw->isChecked() ) { @@ -178,7 +178,7 @@ void Watch::cb_clock (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Watch::cb_seconds (FWidget*, data_ptr) +void Watch::cb_seconds (finalcut::FWidget*, data_ptr) { if ( seconds_sw->isChecked() ) sec = true; @@ -203,7 +203,7 @@ void Watch::adjustSize() { int pw = getParentWidget()->getWidth(); setX (1 + (pw - 22) / 2, false); - FDialog::adjustSize(); + finalcut::FDialog::adjustSize(); } //---------------------------------------------------------------------- @@ -212,7 +212,7 @@ void Watch::adjustSize() int main (int argc, char* argv[]) { // Create the application object - FApplication app(argc, argv); + finalcut::FApplication app(argc, argv); // Create a simple dialog box Watch w(&app); diff --git a/examples/windows.cpp b/examples/windows.cpp index 0c6cb4cb..8396faf7 100644 --- a/examples/windows.cpp +++ b/examples/windows.cpp @@ -31,11 +31,11 @@ #pragma pack(push) #pragma pack(1) -class SmallWindow : public FDialog +class SmallWindow : public finalcut::FDialog { public: // Constructor - explicit SmallWindow (FWidget* = 0); + explicit SmallWindow (finalcut::FWidget* = 0); // Destructor ~SmallWindow(); @@ -51,21 +51,21 @@ class SmallWindow : public FDialog void adjustSize(); // Event handlers - void onShow (FShowEvent*); - void onTimer (FTimerEvent*); + void onShow (finalcut::FShowEvent*); + void onTimer (finalcut::FTimerEvent*); // Data Members - FLabel* left_arrow; - FLabel* right_arrow; - FLabel* top_left_label; - FLabel* top_right_label; - FLabel* bottom_label; + finalcut::FLabel* left_arrow; + finalcut::FLabel* right_arrow; + finalcut::FLabel* top_left_label; + finalcut::FLabel* top_right_label; + finalcut::FLabel* bottom_label; }; #pragma pack(pop) //---------------------------------------------------------------------- -SmallWindow::SmallWindow (FWidget* parent) - : FDialog(parent) +SmallWindow::SmallWindow (finalcut::FWidget* parent) + : finalcut::FDialog(parent) , left_arrow() , right_arrow() , top_left_label() @@ -74,39 +74,39 @@ SmallWindow::SmallWindow (FWidget* parent) { wchar_t arrow_up, arrow_down; - arrow_up = fc::BlackUpPointingTriangle; - arrow_down = fc::BlackDownPointingTriangle; + arrow_up = finalcut::fc::BlackUpPointingTriangle; + arrow_down = finalcut::fc::BlackDownPointingTriangle; - left_arrow = new FLabel (arrow_up, this); + left_arrow = new finalcut::FLabel (arrow_up, this); left_arrow->setForegroundColor (wc.label_inactive_fg); left_arrow->setEmphasis(); left_arrow->ignorePadding(); left_arrow->setGeometry (2, 2, 1, 1); - right_arrow = new FLabel (arrow_up, this); + right_arrow = new finalcut::FLabel (arrow_up, this); right_arrow->setForegroundColor (wc.label_inactive_fg); right_arrow->setEmphasis(); right_arrow->ignorePadding(); right_arrow->setGeometry (getWidth() - 1, 2, 1, 1); - const FString& top_left_label_text = "menu"; - top_left_label = new FLabel (top_left_label_text, this); + const finalcut::FString& top_left_label_text = "menu"; + top_left_label = new finalcut::FLabel (top_left_label_text, this); top_left_label->setForegroundColor (wc.label_inactive_fg); top_left_label->setEmphasis(); top_left_label->setGeometry (1, 1, 6, 1); - const FString& top_right_label_text = "zoom"; - top_right_label = new FLabel (top_right_label_text, this); - top_right_label->setAlignment (fc::alignRight); + const finalcut::FString& top_right_label_text = "zoom"; + top_right_label = new finalcut::FLabel (top_right_label_text, this); + top_right_label->setAlignment (finalcut::fc::alignRight); top_right_label->setForegroundColor (wc.label_inactive_fg); top_right_label->setEmphasis(); top_right_label->setGeometry (getClientWidth() - 5, 1, 6, 1); - FString bottom_label_text = "resize\n" - "corner\n"; + finalcut::FString bottom_label_text = "resize\n" + "corner\n"; bottom_label_text += arrow_down; - bottom_label = new FLabel (bottom_label_text, this); - bottom_label->setAlignment (fc::alignRight); + bottom_label = new finalcut::FLabel (bottom_label_text, this); + bottom_label->setAlignment (finalcut::fc::alignRight); bottom_label->setForegroundColor (wc.label_inactive_fg); bottom_label->setEmphasis(); bottom_label->setGeometry (13, 3, 6, 3); @@ -133,20 +133,20 @@ void SmallWindow::adjustSize() bottom_label->setVisible(); } - FDialog::adjustSize(); + finalcut::FDialog::adjustSize(); right_arrow->setGeometry (getWidth() - 1, 2, 1, 1); top_right_label->setGeometry (getClientWidth() - 5, 1, 6, 1); bottom_label->setGeometry (1, getClientHeight() - 2, getClientWidth(), 3); } //---------------------------------------------------------------------- -void SmallWindow::onShow (FShowEvent*) +void SmallWindow::onShow (finalcut::FShowEvent*) { addTimer(1000); } //---------------------------------------------------------------------- -void SmallWindow::onTimer (FTimerEvent*) +void SmallWindow::onTimer (finalcut::FTimerEvent*) { left_arrow->unsetEmphasis(); left_arrow->redraw(); @@ -170,23 +170,23 @@ void SmallWindow::onTimer (FTimerEvent*) #pragma pack(push) #pragma pack(1) -class Window : public FDialog +class Window : public finalcut::FDialog { public: // Constructor - explicit Window (FWidget* = 0); + explicit Window (finalcut::FWidget* = 0); // Destructor ~Window(); private: // Typedefs - typedef void (Window::*WindowCallback)(FWidget*, data_ptr); - typedef void (FApplication::*FAppCallback)(FWidget*, data_ptr); + typedef void (Window::*WindowCallback)(finalcut::FWidget*, data_ptr); + typedef void (finalcut::FApplication::*FAppCallback)(finalcut::FWidget*, data_ptr); typedef struct { bool is_open; - FString* title; + finalcut::FString* title; SmallWindow* dgl; } win_data; @@ -198,22 +198,22 @@ class Window : public FDialog Window& operator = (const Window&); // Method - void createFileMenuItems (FMenu*); + void createFileMenuItems (finalcut::FMenu*); void createDialogButtons(); - void activateWindow (FDialog*); + void activateWindow (finalcut::FDialog*); void adjustSize(); - void addClickedCallback (FWidget*, WindowCallback); - void addClickedCallback (FWidget*, FAppCallback); + void addClickedCallback (finalcut::FWidget*, WindowCallback); + void addClickedCallback (finalcut::FWidget*, FAppCallback); // Event handlers - void onClose (FCloseEvent*); + void onClose (finalcut::FCloseEvent*); // Callback methods - void cb_createWindows (FWidget*, data_ptr); - void cb_closeWindows (FWidget*, data_ptr); - void cb_next (FWidget*, data_ptr); - void cb_previous (FWidget*, data_ptr); - void cb_destroyWindow (FWidget*, data_ptr); + void cb_createWindows (finalcut::FWidget*, data_ptr); + void cb_closeWindows (finalcut::FWidget*, data_ptr); + void cb_next (finalcut::FWidget*, data_ptr); + void cb_previous (finalcut::FWidget*, data_ptr); + void cb_destroyWindow (finalcut::FWidget*, data_ptr); // Data Members std::vector windows; @@ -221,26 +221,26 @@ class Window : public FDialog #pragma pack(pop) //---------------------------------------------------------------------- -Window::Window (FWidget* parent) - : FDialog(parent) +Window::Window (finalcut::FWidget* parent) + : finalcut::FDialog(parent) , windows() { - FMenu* File; - FDialogListMenu* DglList; - FString drop_down_symbol; - FMenuBar* Menubar; - FStatusBar* Statusbar; + finalcut::FMenu* File; + finalcut::FDialogListMenu* DglList; + finalcut::FString drop_down_symbol; + finalcut::FMenuBar* Menubar; + finalcut::FStatusBar* Statusbar; // Menu bar - Menubar = new FMenuBar (this); + Menubar = new finalcut::FMenuBar (this); // Menu bar item - File = new FMenu ("&File", Menubar); + File = new finalcut::FMenu ("&File", Menubar); File->setStatusbarMessage ("File management commands"); // Dialog list menu item - drop_down_symbol = wchar_t(fc::BlackDownPointingTriangle); - DglList = new FDialogListMenu (drop_down_symbol, Menubar); + drop_down_symbol = wchar_t(finalcut::fc::BlackDownPointingTriangle); + DglList = new finalcut::FDialogListMenu (drop_down_symbol, Menubar); DglList->setStatusbarMessage ("List of all the active dialogs"); // File menu items @@ -250,7 +250,7 @@ Window::Window (FWidget* parent) createDialogButtons(); // Statusbar at the bottom - Statusbar = new FStatusBar (this); + Statusbar = new finalcut::FStatusBar (this); Statusbar->setMessage("Status bar message"); // Generate data vector for the windows @@ -258,7 +258,7 @@ Window::Window (FWidget* parent) { win_data* win_dat = new win_data; win_dat->is_open = false; - win_dat->title = new FString(); + win_dat->title = new finalcut::FString(); win_dat->title->sprintf("Window %d", n); windows.push_back(win_dat); } @@ -285,31 +285,31 @@ Window::~Window() } //---------------------------------------------------------------------- -void Window::createFileMenuItems (FMenu* File) +void Window::createFileMenuItems (finalcut::FMenu* File) { // "File" menu item - FMenuItem* New = new FMenuItem ("&New", File); + finalcut::FMenuItem* New = new finalcut::FMenuItem ("&New", File); New->setStatusbarMessage ("Create the windows"); - FMenuItem* Close = new FMenuItem ("&Close", File); + finalcut::FMenuItem* Close = new finalcut::FMenuItem ("&Close", File); Close->setStatusbarMessage ("Close the windows"); - FMenuItem* Line1 = new FMenuItem (File); + finalcut::FMenuItem* Line1 = new finalcut::FMenuItem (File); Line1->setSeparator(); - FMenuItem* Next = new FMenuItem ("Ne&xt window", File); - Next->addAccelerator (fc::Fmkey_npage); // Meta/Alt + PgDn + finalcut::FMenuItem* Next = new finalcut::FMenuItem ("Ne&xt window", File); + Next->addAccelerator (finalcut::fc::Fmkey_npage); // Meta/Alt + PgDn Next->setStatusbarMessage ("Switch to the next window"); - FMenuItem* Previous = new FMenuItem ("&Previous window", File); - Previous->addAccelerator (fc::Fmkey_ppage); // Meta/Alt + PgUp + finalcut::FMenuItem* Previous = new finalcut::FMenuItem ("&Previous window", File); + Previous->addAccelerator (finalcut::fc::Fmkey_ppage); // Meta/Alt + PgUp Previous->setStatusbarMessage ("Switch to the previous window"); - FMenuItem* Line2 = new FMenuItem (File); + finalcut::FMenuItem* Line2 = new finalcut::FMenuItem (File); Line2->setSeparator(); - FMenuItem* Quit = new FMenuItem ("&Quit", File); - Quit->addAccelerator (fc::Fmkey_x); // Meta/Alt + X + finalcut::FMenuItem* Quit = new finalcut::FMenuItem ("&Quit", File); + Quit->addAccelerator (finalcut::fc::Fmkey_x); // Meta/Alt + X Quit->setStatusbarMessage ("Exit the program"); // Add menu item callback @@ -317,38 +317,38 @@ void Window::createFileMenuItems (FMenu* File) addClickedCallback (Close, &Window::cb_closeWindows); addClickedCallback (Next, &Window::cb_next); addClickedCallback (Previous, &Window::cb_previous); - addClickedCallback (Quit, &FApplication::cb_exitApp); + addClickedCallback (Quit, &finalcut::FApplication::cb_exitApp); } //---------------------------------------------------------------------- void Window::createDialogButtons() { // Dialog buttons - FButton* CreateButton = new FButton (this); + finalcut::FButton* CreateButton = new finalcut::FButton (this); CreateButton->setGeometry(2, 2, 9, 1); CreateButton->setText (L"&Create"); - FButton* CloseButton = new FButton (this); + finalcut::FButton* CloseButton = new finalcut::FButton (this); CloseButton->setGeometry(15, 2, 9, 1); CloseButton->setText (L"C&lose"); - FButton* QuitButton = new FButton (this); + finalcut::FButton* QuitButton = new finalcut::FButton (this); QuitButton->setGeometry(28, 2, 9, 1); QuitButton->setText (L"&Quit"); // Add button callback addClickedCallback (CreateButton, &Window::cb_createWindows); addClickedCallback (CloseButton, &Window::cb_closeWindows); - addClickedCallback (QuitButton, &FApplication::cb_exitApp); + addClickedCallback (QuitButton, &finalcut::FApplication::cb_exitApp); } //---------------------------------------------------------------------- -void Window::activateWindow (FDialog* win) +void Window::activateWindow (finalcut::FDialog* win) { if ( ! win || win->isWindowHidden() || win->isWindowActive() ) return; - bool has_raised = FWindow::raiseWindow(win); + bool has_raised = finalcut::FWindow::raiseWindow(win); win->activateDialog(); if ( has_raised ) @@ -387,14 +387,15 @@ void Window::adjustSize() ++iter; } - FDialog::adjustSize(); + finalcut::FDialog::adjustSize(); } //---------------------------------------------------------------------- -void Window::addClickedCallback (FWidget* widget, WindowCallback call) +void Window::addClickedCallback ( finalcut::FWidget* widget + , WindowCallback call ) { FMemberCallback callback - = reinterpret_cast(call); + = reinterpret_cast(call); widget->addCallback ( @@ -404,10 +405,11 @@ void Window::addClickedCallback (FWidget* widget, WindowCallback call) } //---------------------------------------------------------------------- -void Window::addClickedCallback (FWidget* widget, FAppCallback call) +void Window::addClickedCallback ( finalcut::FWidget* widget + , FAppCallback call ) { FMemberCallback callback - = reinterpret_cast(call); + = reinterpret_cast(call); widget->addCallback ( @@ -417,13 +419,13 @@ void Window::addClickedCallback (FWidget* widget, FAppCallback call) } //---------------------------------------------------------------------- -void Window::onClose (FCloseEvent* ev) +void Window::onClose (finalcut::FCloseEvent* ev) { - FApplication::closeConfirmationDialog (this, ev); + finalcut::FApplication::closeConfirmationDialog (this, ev); } //---------------------------------------------------------------------- -void Window::cb_createWindows (FWidget*, data_ptr) +void Window::cb_createWindows (finalcut::FWidget*, data_ptr) { std::vector::const_iterator iter, first; iter = first = windows.begin(); @@ -453,7 +455,7 @@ void Window::cb_createWindows (FWidget*, data_ptr) ( "destroy", F_METHOD_CALLBACK (this, &Window::cb_destroyWindow), - static_cast(win_dat) + static_cast(win_dat) ); } @@ -464,12 +466,12 @@ void Window::cb_createWindows (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Window::cb_closeWindows (FWidget*, data_ptr) +void Window::cb_closeWindows (finalcut::FWidget*, data_ptr) { if ( ! dialog_list || dialog_list->empty() ) return; - widgetList::const_iterator iter, first; + finalcut::FWidget::widgetList::const_iterator iter, first; iter = dialog_list->end(); first = dialog_list->begin(); activateWindow(this); @@ -485,20 +487,20 @@ void Window::cb_closeWindows (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Window::cb_next (FWidget*, data_ptr) +void Window::cb_next (finalcut::FWidget*, data_ptr) { if ( ! dialog_list || dialog_list->empty() ) return; - widgetList::const_iterator iter; + finalcut::FWidget::widgetList::const_iterator iter; iter = dialog_list->begin(); while ( iter != dialog_list->end() ) { - if ( static_cast(*iter)->isWindowActive() ) + if ( static_cast(*iter)->isWindowActive() ) { - FDialog* next; - widgetList::const_iterator next_element; + finalcut::FDialog* next; + finalcut::FWidget::widgetList::const_iterator next_element; next_element = iter; do @@ -508,7 +510,7 @@ void Window::cb_next (FWidget*, data_ptr) if ( next_element == dialog_list->end() ) next_element = dialog_list->begin(); - next = static_cast(*next_element); + next = static_cast(*next_element); } while ( ! next->isEnabled() || ! next->acceptFocus() || ! next->isVisible() @@ -523,12 +525,12 @@ void Window::cb_next (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Window::cb_previous (FWidget*, data_ptr) +void Window::cb_previous (finalcut::FWidget*, data_ptr) { if ( ! dialog_list || dialog_list->empty() ) return; - widgetList::const_iterator iter; + finalcut::FWidget::widgetList::const_iterator iter; iter = dialog_list->end(); do @@ -536,10 +538,10 @@ void Window::cb_previous (FWidget*, data_ptr) --iter; if ( (*iter)->isDialogWidget() - && static_cast(*iter)->isWindowActive() ) + && static_cast(*iter)->isWindowActive() ) { - FDialog* prev; - widgetList::const_iterator prev_element; + finalcut::FDialog* prev; + finalcut::FWidget::widgetList::const_iterator prev_element; prev_element = iter; do @@ -548,7 +550,7 @@ void Window::cb_previous (FWidget*, data_ptr) prev_element = dialog_list->end(); --prev_element; - prev = static_cast(*prev_element); + prev = static_cast(*prev_element); } while ( ! prev->isEnabled() || ! prev->acceptFocus() || ! prev->isVisible() @@ -562,7 +564,7 @@ void Window::cb_previous (FWidget*, data_ptr) } //---------------------------------------------------------------------- -void Window::cb_destroyWindow (FWidget*, data_ptr data) +void Window::cb_destroyWindow (finalcut::FWidget*, data_ptr data) { win_data* win_dat = static_cast(data); @@ -581,7 +583,7 @@ void Window::cb_destroyWindow (FWidget*, data_ptr data) int main (int argc, char* argv[]) { // Create the application object - FApplication app (argc, argv); + finalcut::FApplication app (argc, argv); // Create main dialog object Window main_dlg (&app); diff --git a/fonts/bdf2c.sh b/fonts/bdf2c.sh index 0f5051f3..11b9479d 100755 --- a/fonts/bdf2c.sh +++ b/fonts/bdf2c.sh @@ -8,8 +8,9 @@ FONTFILE="8x16graph.bdf" echo -e "// newfont.h\\n" echo -e "#ifndef FNEWFONT_H" echo -e "#define FNEWFONT_H\\n" - echo -e "namespace fc\\n{" - echo -e "\\nstatic unsigned char __8x16graph[] =\\n{" + echo -e "namespace finalcut\\n{\\n" + echo -e "namespace fc\\n{\\n" + echo -e "static unsigned char __8x16graph[] =\\n{" grep -A${HEIGHT} ^BITMAP "$FONTFILE" \ | tr '\n' ',' \ @@ -28,6 +29,7 @@ FONTFILE="8x16graph.bdf" echo -e "};" echo -e "\\n} // namespace fc" + echo -e "\\n} // namespace finalcut" echo -e "\\n#endif // FNEWFONT_H" ) > newfont.h diff --git a/fonts/font2c.sh b/fonts/font2c.sh index c32ae714..500ee612 100755 --- a/fonts/font2c.sh +++ b/fonts/font2c.sh @@ -8,6 +8,7 @@ FONTFILE="8x16std" echo -e "// vgafont.h\\n" echo -e "#ifndef FVGAFONT_H" echo -e "#define FVGAFONT_H\\n" + echo -e "namespace finalcut\\n{\\n" echo -e "namespace fc\\n{\\n" xxd -g 1 -i -c $HEIGHT $FONTFILE \ @@ -26,5 +27,6 @@ FONTFILE="8x16std" done echo -e "\\n} // namespace fc" + echo -e "\\n} // namespace finalcut" echo -e "\\n#endif // FVGAFONT_H" ) > vgafont.h diff --git a/fonts/newfont.h b/fonts/newfont.h index d1992deb..2a5f7142 100644 --- a/fonts/newfont.h +++ b/fonts/newfont.h @@ -3,6 +3,9 @@ #ifndef FNEWFONT_H #define FNEWFONT_H +namespace finalcut +{ + namespace fc { @@ -268,4 +271,6 @@ static unsigned char __8x16graph[] = } // namespace fc +} // namespace finalcut + #endif // FNEWFONT_H diff --git a/fonts/unicodemap.h b/fonts/unicodemap.h index b7bbfe1c..92a13901 100644 --- a/fonts/unicodemap.h +++ b/fonts/unicodemap.h @@ -3,6 +3,9 @@ #ifndef FUNICODEMAP_H #define FUNICODEMAP_H +namespace finalcut +{ + namespace fc { @@ -318,4 +321,6 @@ static struct unipair unicode_cp437_pairs[] = } // namespace fc +} // namespace finalcut + #endif // FUNICODEMAP_H diff --git a/fonts/vgafont.h b/fonts/vgafont.h index dd2062a0..5d0998fd 100644 --- a/fonts/vgafont.h +++ b/fonts/vgafont.h @@ -3,6 +3,9 @@ #ifndef FVGAFONT_H #define FVGAFONT_H +namespace finalcut +{ + namespace fc { @@ -268,4 +271,6 @@ static unsigned char __8x16std[] = } // namespace fc +} // namespace finalcut + #endif // FVGAFONT_H diff --git a/include/final/emptyfstring.h b/include/final/emptyfstring.h index ddb90f4c..5e941879 100644 --- a/include/final/emptyfstring.h +++ b/include/final/emptyfstring.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2017 Markus Gans * +* Copyright 2015-2018 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 * @@ -29,6 +29,9 @@ #include "final/fstring.h" +namespace finalcut +{ + namespace fc { @@ -90,4 +93,6 @@ inline void emptyFString::clear() } // namespace fc +} // namespace finalcut + #endif // EMPTYFSTRING_H diff --git a/include/final/fapplication.h b/include/final/fapplication.h index fcb4df4b..58f8bbf7 100644 --- a/include/final/fapplication.h +++ b/include/final/fapplication.h @@ -69,6 +69,8 @@ #include "final/fwidget.h" #include "final/fwindow.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FApplication @@ -241,5 +243,6 @@ inline FWidget* FApplication::getFocusWidget() const inline void FApplication::cb_exitApp (FWidget*, data_ptr) { close(); } +} // namespace finalcut #endif // FAPPLICATION_H diff --git a/include/final/fbutton.h b/include/final/fbutton.h index 637d5244..d5c0c2bd 100644 --- a/include/final/fbutton.h +++ b/include/final/fbutton.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2012-2017 Markus Gans * +* Copyright 2012-2018 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 * @@ -54,6 +54,8 @@ #include "final/fwidget.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FButton @@ -274,4 +276,6 @@ inline bool FButton::hasShadow() const inline bool FButton::hasClickAnimation() { return click_animation; } +} // namespace finalcut + #endif // FBUTTON_H diff --git a/include/final/fbuttongroup.h b/include/final/fbuttongroup.h index 21117ecc..633a0357 100644 --- a/include/final/fbuttongroup.h +++ b/include/final/fbuttongroup.h @@ -55,6 +55,8 @@ #include "final/fscrollview.h" +namespace finalcut +{ // class forward declaration class FToggleButton; @@ -170,4 +172,6 @@ inline uInt FButtonGroup::getCount() const inline FString& FButtonGroup::getText() { return text; } +} // namespace finalcut + #endif // FBUTTONGROUP_H diff --git a/include/final/fc.h b/include/final/fc.h index 77f44dd7..b3b5ef18 100644 --- a/include/final/fc.h +++ b/include/final/fc.h @@ -41,6 +41,8 @@ #define OSC ESC "]" // Operating system command (7-bit) #define SECDA ESC "[>c" // Secondary Device Attributes +namespace finalcut +{ //---------------------------------------------------------------------- // Global constants and enumerations @@ -1135,4 +1137,6 @@ enum termcaps } // namespace fc +} // namespace finalcut + #endif // FC_H diff --git a/include/final/fcharmap.h b/include/final/fcharmap.h index e863216e..d203e853 100644 --- a/include/final/fcharmap.h +++ b/include/final/fcharmap.h @@ -30,6 +30,9 @@ #include "final/fc.h" #include "final/ftypes.h" +namespace finalcut +{ + namespace fc { @@ -327,4 +330,6 @@ const uInt lastCP437Item = uInt ( sizeof(cp437_to_ucs) / sizeof(cp437_to_ucs[0]) ) - 1; } // namespace fc +} // namespace finalcut + #endif // FCHARMAP_H diff --git a/include/final/fcheckbox.h b/include/final/fcheckbox.h index 81b17f0f..ef854a89 100644 --- a/include/final/fcheckbox.h +++ b/include/final/fcheckbox.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2017 Markus Gans * +* Copyright 2014-2018 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 * @@ -59,6 +59,8 @@ #include "final/ftogglebutton.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FCheckBox @@ -100,4 +102,6 @@ class FCheckBox : public FToggleButton inline const char* FCheckBox::getClassName() const { return "FCheckBox"; } +} // namespace finalcut + #endif // FCHECKBOX_H diff --git a/include/final/fcheckmenuitem.h b/include/final/fcheckmenuitem.h index f2dfc5b1..6a53326b 100644 --- a/include/final/fcheckmenuitem.h +++ b/include/final/fcheckmenuitem.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2017 Markus Gans * +* Copyright 2015-2018 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 * @@ -59,6 +59,8 @@ #include "final/fmenuitem.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FCheckMenuItem @@ -100,4 +102,6 @@ class FCheckMenuItem : public FMenuItem inline const char* FCheckMenuItem::getClassName() const { return "FCheckMenuItem"; } +} // namespace finalcut + #endif // FCHECKMENUITEM_H diff --git a/include/final/fcolorpalette.h b/include/final/fcolorpalette.h index 4582a667..9701d662 100644 --- a/include/final/fcolorpalette.h +++ b/include/final/fcolorpalette.h @@ -31,8 +31,14 @@ #ifndef FCOLORPALETTE_H #define FCOLORPALETTE_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fc.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FColorPalette @@ -69,4 +75,6 @@ class FColorPalette inline const char* FColorPalette::getClassName() const { return "FColorPalette"; } +} // namespace finalcut + #endif // FCOLORPALETTE_H diff --git a/include/final/fdialog.h b/include/final/fdialog.h index ae825b41..91f003e6 100644 --- a/include/final/fdialog.h +++ b/include/final/fdialog.h @@ -61,6 +61,8 @@ #include "final/ftooltip.h" #include "final/fwindow.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FDialog @@ -285,6 +287,6 @@ inline bool FDialog::isModal() inline bool FDialog::isScrollable() { return ((flags & fc::scrollable) != 0); } - +} // namespace finalcut #endif // FDIALOG_H diff --git a/include/final/fdialoglistmenu.h b/include/final/fdialoglistmenu.h index a9f01bad..61f465b4 100644 --- a/include/final/fdialoglistmenu.h +++ b/include/final/fdialoglistmenu.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2016-2017 Markus Gans * +* Copyright 2016-2018 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 * @@ -65,6 +65,8 @@ #include "final/fmenu.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FDialogListMenu @@ -104,4 +106,6 @@ class FDialogListMenu : public FMenu inline const char* FDialogListMenu::getClassName() const { return "FDialogListMenu"; } +} // namespace finalcut + #endif // FDIALOGLISTMENU_H diff --git a/include/final/fevent.h b/include/final/fevent.h index 8e441fba..ed2ca040 100644 --- a/include/final/fevent.h +++ b/include/final/fevent.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2017 Markus Gans * +* Copyright 2014-2018 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 * @@ -79,6 +79,8 @@ #include "final/fc.h" #include "final/fpoint.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FEvent @@ -336,4 +338,6 @@ class FTimerEvent : public FEvent // timer event #pragma pack(pop) +} // namespace finalcut + #endif // FEVENT_H diff --git a/include/final/ffiledialog.h b/include/final/ffiledialog.h index b003cf3e..1c0412ab 100644 --- a/include/final/ffiledialog.h +++ b/include/final/ffiledialog.h @@ -81,6 +81,8 @@ #include "final/fstatusbar.h" #include "final/fterm.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FFileDialog @@ -231,4 +233,6 @@ inline bool FFileDialog::unsetShowHiddenFiles() inline bool FFileDialog::getShowHiddenFiles() { return show_hidden; } +} // namespace finalcut + #endif // FFILEDIALOG_H diff --git a/include/final/fkey_map.h b/include/final/fkey_map.h index 0d357f5f..8407c652 100644 --- a/include/final/fkey_map.h +++ b/include/final/fkey_map.h @@ -30,6 +30,9 @@ #include #include "final/ftypes.h" +namespace finalcut +{ + namespace fc { @@ -39,4 +42,6 @@ extern keyname FkeyName[]; } // namespace fc +} // namespace finalcut + #endif // FKEYMAP_H diff --git a/include/final/fkeyboard.h b/include/final/fkeyboard.h index e1be7517..495752ec 100644 --- a/include/final/fkeyboard.h +++ b/include/final/fkeyboard.h @@ -42,6 +42,9 @@ #include "final/ftermlinux.h" #endif +namespace finalcut +{ + // class forward declaration class FApplication; @@ -252,4 +255,6 @@ inline bool FKeyboard::setNonBlockingInput() inline bool FKeyboard::unsetNonBlockingInput() { return setNonBlockingInput(false); } +} // namespace finalcut + #endif // FKEYBOARD_H diff --git a/include/final/flabel.h b/include/final/flabel.h index e36beada..17ee55f5 100644 --- a/include/final/flabel.h +++ b/include/final/flabel.h @@ -56,6 +56,8 @@ #include "final/fwidget.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FLabel @@ -225,4 +227,6 @@ inline bool FLabel::hasReverseMode() inline void FLabel::clear() { text.clear(); } +} // namespace finalcut + #endif // FLABEL_H diff --git a/include/final/flineedit.h b/include/final/flineedit.h index 77a4a94c..02f38fb0 100644 --- a/include/final/flineedit.h +++ b/include/final/flineedit.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2012-2017 Markus Gans * +* Copyright 2012-2018 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 * @@ -55,6 +55,8 @@ #include "final/fwidget.h" #include "final/flabel.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FLineEdit @@ -227,4 +229,6 @@ inline bool FLineEdit::unsetShadow() inline bool FLineEdit::hasShadow() { return ((flags & fc::shadow) != 0); } +} // namespace finalcut + #endif // FLINEEDIT_H diff --git a/include/final/flistbox.h b/include/final/flistbox.h index 5fc44899..2ba95a76 100644 --- a/include/final/flistbox.h +++ b/include/final/flistbox.h @@ -59,6 +59,8 @@ #include "final/fstring.h" #include "final/fwidget.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FListBoxItem @@ -532,4 +534,6 @@ inline FListBox::listBoxItems::iterator FListBox::index2iterator (int index) return iter; } +} // namespace finalcut + #endif // FLISTBOX_H diff --git a/include/final/flistview.h b/include/final/flistview.h index b6425267..709afe24 100644 --- a/include/final/flistview.h +++ b/include/final/flistview.h @@ -60,6 +60,9 @@ #include "final/ftermbuffer.h" #include "final/fwidget.h" +namespace finalcut +{ + // class forward declaration class FListView; @@ -473,4 +476,6 @@ inline FObject::FObjectIterator FListView::endOfList() inline void FListView::scrollTo (const FPoint& pos) { scrollTo(pos.getX(), pos.getY()); } +} // namespace finalcut + #endif // FLISTVIEW_H diff --git a/include/final/fmenu.h b/include/final/fmenu.h index 5e3c8101..7f79d4ac 100644 --- a/include/final/fmenu.h +++ b/include/final/fmenu.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2017 Markus Gans * +* Copyright 2015-2018 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 * @@ -64,6 +64,8 @@ #include "final/fmenulist.h" #include "final/fmenuitem.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FMenu @@ -327,5 +329,6 @@ inline FMenu* FMenu::superMenuAt (const FPoint& p) inline void FMenu::onAccel (FAccelEvent* ev) { item->onAccel(ev); } +} // namespace finalcut #endif // FMENU_H diff --git a/include/final/fmenubar.h b/include/final/fmenubar.h index 7acc5254..5ca9ba73 100644 --- a/include/final/fmenubar.h +++ b/include/final/fmenubar.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2017 Markus Gans * +* Copyright 2015-2018 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 * @@ -63,6 +63,8 @@ #include "final/fmenulist.h" #include "final/fwindow.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FMenuBar @@ -166,4 +168,6 @@ inline const char* FMenuBar::getClassName() const inline bool FMenuBar::isMenu (FMenuItem* mi) const { return mi->hasMenu(); } +} // namespace finalcut + #endif // FMENUBAR_H diff --git a/include/final/fmenuitem.h b/include/final/fmenuitem.h index ffd50069..8e6a31e7 100644 --- a/include/final/fmenuitem.h +++ b/include/final/fmenuitem.h @@ -58,6 +58,9 @@ #include "final/fwidget.h" +namespace finalcut +{ + // class forward declaration class FDialog; class FMenu; @@ -270,4 +273,6 @@ inline FWidget* FMenuItem::getSuperMenu() const inline void FMenuItem::setSuperMenu (FWidget* smenu) { super_menu = smenu; } +} // namespace finalcut + #endif // FMENUITEM_H diff --git a/include/final/fmenulist.h b/include/final/fmenulist.h index e5e366af..5703311d 100644 --- a/include/final/fmenulist.h +++ b/include/final/fmenulist.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2017 Markus Gans * +* Copyright 2015-2018 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 * @@ -48,6 +48,8 @@ #include "final/fmenuitem.h" #include "final/fwidget.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FMenuList @@ -139,4 +141,6 @@ inline bool FMenuList::isSelected(int index) const inline bool FMenuList::hasSelectedItem() const { return selected_item; } +} // namespace finalcut + #endif // FMENULIST_H diff --git a/include/final/fmessagebox.h b/include/final/fmessagebox.h index 0774be4d..95f8e86f 100644 --- a/include/final/fmessagebox.h +++ b/include/final/fmessagebox.h @@ -68,6 +68,8 @@ #include "final/fdialog.h" #include "final/fterm.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FMessageBox @@ -205,4 +207,6 @@ inline bool FMessageBox::setCenterText() inline bool FMessageBox::unsetCenterText() { return setCenterText(false); } +} // namespace finalcut + #endif // FMESSAGEBOX_H diff --git a/include/final/fmouse.h b/include/final/fmouse.h index ab088c5a..3a8194ac 100644 --- a/include/final/fmouse.h +++ b/include/final/fmouse.h @@ -76,6 +76,8 @@ #undef buttons // from term.h #endif +namespace finalcut +{ //---------------------------------------------------------------------- // class FMouse @@ -249,7 +251,7 @@ inline bool FMouseGPM::disableGpmMouse() //---------------------------------------------------------------------- inline bool FMouseGPM::isGpmMouseEnabled() { return gpm_mouse_enabled; } -#endif +#endif // F_HAVE_LIBGPM //---------------------------------------------------------------------- @@ -528,4 +530,6 @@ inline void FMouseControl::enableXTermMouse() inline void FMouseControl::disableXTermMouse() { xtermMouse(false); } +} // namespace finalcut + #endif // FMOUSE_H diff --git a/include/final/fobject.h b/include/final/fobject.h index 397e6a93..9d0d919b 100644 --- a/include/final/fobject.h +++ b/include/final/fobject.h @@ -46,7 +46,8 @@ #include "final/fevent.h" #include "final/ftypes.h" - +namespace finalcut +{ //---------------------------------------------------------------------- // class FObject @@ -194,6 +195,8 @@ inline bool FObject::isInstanceOf (const char classname[]) const inline bool FObject::isTimerInUpdating() const { return timer_modify_lock; } +} // namespace finalcut + //---------------------------------------------------------------------- // Operator functions for timeval diff --git a/include/final/foptiattr.h b/include/final/foptiattr.h index 805c4299..ccf34f97 100644 --- a/include/final/foptiattr.h +++ b/include/final/foptiattr.h @@ -61,6 +61,8 @@ #include "final/fc.h" #include "final/ftypes.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FOptiAttr @@ -413,4 +415,6 @@ inline void FOptiAttr::setDefaultColorSupport() inline void FOptiAttr::unsetDefaultColorSupport() { ansi_default_color = false; } +} // namespace finalcut + #endif // FOPTIATTR_H diff --git a/include/final/foptimove.h b/include/final/foptimove.h index cd1df634..11345618 100644 --- a/include/final/foptimove.h +++ b/include/final/foptimove.h @@ -49,12 +49,12 @@ typedef unsigned int chtype; #else typedef unsigned long chtype; - #endif + #endif // _LP64 #include // need for tparm #else #include // need for tparm -#endif +#endif // defined(__sun) && defined(__SVR4) #include #include @@ -65,6 +65,9 @@ #include "final/ftypes.h" +namespace finalcut +{ + //---------------------------------------------------------------------- // class FOptiMove //---------------------------------------------------------------------- @@ -333,4 +336,6 @@ inline void FOptiMove::set_auto_left_margin (const bool& bcap) inline void FOptiMove::set_eat_newline_glitch (const bool& bcap) { eat_nl_glitch = bcap; } +} // namespace finalcut + #endif // FOPTIMOVE_H diff --git a/include/final/fpoint.h b/include/final/fpoint.h index 08c06b1c..9e4fc746 100644 --- a/include/final/fpoint.h +++ b/include/final/fpoint.h @@ -37,6 +37,8 @@ #include +namespace finalcut +{ //---------------------------------------------------------------------- // class FPoint @@ -151,4 +153,6 @@ inline short& FPoint::x_ref() inline short& FPoint::y_ref() { return ypos; } +} // namespace finalcut + #endif // FPOINT_H diff --git a/include/final/fprogressbar.h b/include/final/fprogressbar.h index 48a573fd..07fa5dd8 100644 --- a/include/final/fprogressbar.h +++ b/include/final/fprogressbar.h @@ -54,6 +54,8 @@ #include "final/fwidget.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FProgressbar @@ -126,5 +128,6 @@ inline bool FProgressbar::unsetShadow() inline bool FProgressbar::hasShadow() { return ((flags & fc::shadow) != 0); } +} // namespace finalcut #endif // FPROGRESSBAR_H diff --git a/include/final/fradiobutton.h b/include/final/fradiobutton.h index ba51a461..71d66a7b 100644 --- a/include/final/fradiobutton.h +++ b/include/final/fradiobutton.h @@ -59,6 +59,8 @@ #include "final/ftogglebutton.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FRadioButton @@ -100,4 +102,6 @@ class FRadioButton : public FToggleButton inline const char* FRadioButton::getClassName() const { return "FRadioButton"; } +} // namespace finalcut + #endif // FRADIOBUTTON_H diff --git a/include/final/fradiomenuitem.h b/include/final/fradiomenuitem.h index 5f1aeb7c..002835ce 100644 --- a/include/final/fradiomenuitem.h +++ b/include/final/fradiomenuitem.h @@ -59,6 +59,8 @@ #include "final/fmenuitem.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FRadioMenuItem @@ -100,4 +102,6 @@ class FRadioMenuItem : public FMenuItem inline const char* FRadioMenuItem::getClassName() const { return "FRadioMenuItem"; } +} // namespace finalcut + #endif // FRADIOMENUITEM_H diff --git a/include/final/frect.h b/include/final/frect.h index 89a64c01..b6bbaed6 100644 --- a/include/final/frect.h +++ b/include/final/frect.h @@ -38,6 +38,8 @@ #include #include "final/fpoint.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FRect @@ -227,4 +229,6 @@ inline short& FRect::x2_ref() inline short& FRect::y2_ref() { return Y2; } +} // namespace finalcut + #endif // FRECT_H diff --git a/include/final/fscrollbar.h b/include/final/fscrollbar.h index 4effcddf..08082a35 100644 --- a/include/final/fscrollbar.h +++ b/include/final/fscrollbar.h @@ -54,6 +54,8 @@ #include "final/fwidget.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FScrollbar @@ -174,4 +176,6 @@ inline int FScrollbar::getValue() const inline FScrollbar::sType FScrollbar::getScrollType() const { return scroll_type; } +} // namespace finalcut + #endif // FSCROLLBAR_H diff --git a/include/final/fscrollview.h b/include/final/fscrollview.h index 20622719..31af25d0 100644 --- a/include/final/fscrollview.h +++ b/include/final/fscrollview.h @@ -56,6 +56,8 @@ #include "final/fscrollbar.h" #include "final/fwidget.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FScrollView @@ -248,5 +250,6 @@ inline bool FScrollView::isViewportPrint() inline void FScrollView::scrollTo (const FPoint& pos) { scrollTo(pos.getX(), pos.getY()); } +} // namespace finalcut #endif // FSCROLLVIEW_H diff --git a/include/final/fstatusbar.h b/include/final/fstatusbar.h index a11af87a..a9e9278d 100644 --- a/include/final/fstatusbar.h +++ b/include/final/fstatusbar.h @@ -63,6 +63,8 @@ #include "final/fwindow.h" +namespace finalcut +{ // class forward declaration class FStatusBar; @@ -295,4 +297,6 @@ inline FString FStatusBar::getMessage() const inline void FStatusBar::clearMessage() { text.clear(); } +} // namespace finalcut + #endif // FSTATUSBAR_H diff --git a/include/final/fstring.h b/include/final/fstring.h index fa637b59..4d6b8338 100644 --- a/include/final/fstring.h +++ b/include/final/fstring.h @@ -57,6 +57,9 @@ #include "final/ftypes.h" +namespace finalcut +{ + // class forward declaration class FString; @@ -496,5 +499,6 @@ inline FString& FString::setFormatedNumber (int num, char separator) inline FString& FString::setFormatedNumber (uInt num, char separator) { return setFormatedNumber (uLong(num), separator); } +} // namespace finalcut #endif // FSTRING_H diff --git a/include/final/fswitch.h b/include/final/fswitch.h index 40de5186..7abfd1c2 100644 --- a/include/final/fswitch.h +++ b/include/final/fswitch.h @@ -59,6 +59,8 @@ #include "final/ftogglebutton.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FSwitch @@ -113,4 +115,6 @@ class FSwitch : public FToggleButton inline const char* FSwitch::getClassName() const { return "FSwitch"; } +} // namespace finalcut + #endif // FSWITCH_H diff --git a/include/final/ftcap_map.h b/include/final/ftcap_map.h index ec86b41e..1b43b71d 100644 --- a/include/final/ftcap_map.h +++ b/include/final/ftcap_map.h @@ -29,6 +29,9 @@ #include "final/ftermcap.h" +namespace finalcut +{ + namespace fc { @@ -139,4 +142,6 @@ static FTermcap::tcap_map term_caps[] = } // namespace fc +} // namespace finalcut + #endif // FTCAPMAP_H diff --git a/include/final/fterm.h b/include/final/fterm.h index c7503445..09a7b7d9 100644 --- a/include/final/fterm.h +++ b/include/final/fterm.h @@ -112,12 +112,12 @@ typedef unsigned int chtype; #else typedef unsigned long chtype; - #endif + #endif // _LP64 #include // termcap #else #include // termcap -#endif +#endif // defined(__sun) && defined(__SVR4) #ifdef F_HAVE_LIBGPM #undef buttons // from term.h @@ -164,6 +164,8 @@ #include "final/ftermios.h" #include "final/ftermxterminal.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FTerm @@ -205,7 +207,7 @@ class FTerm static const char* getTermType_Answerback(); static const char* getTermType_SecDA(); static int getFramebufferBpp(); -#endif +#endif // DEBUG // Inquiries static bool isCursorHidden(); @@ -551,7 +553,7 @@ inline const char* FTerm::getTermType_SecDA() //---------------------------------------------------------------------- inline int FTerm::getFramebufferBpp() { return framebuffer_bpp; } -#endif +#endif // DEBUG //---------------------------------------------------------------------- inline bool FTerm::isCursorHidden() @@ -710,4 +712,6 @@ inline void FTerm::changeTermSizeFinished() { resize_term = false; } +} // namespace finalcut + #endif // FTERM_H diff --git a/include/final/ftermbuffer.h b/include/final/ftermbuffer.h index d46a13bf..6ea9f762 100644 --- a/include/final/ftermbuffer.h +++ b/include/final/ftermbuffer.h @@ -42,6 +42,8 @@ #include "final/fvterm.h" #include "final/fstring.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FTermBuffer @@ -135,4 +137,6 @@ inline FTermBuffer& FTermBuffer::write() inline std::vector FTermBuffer::getBuffer() { return data; } +} // namespace finalcut + #endif // FTERMBUFFER_H diff --git a/include/final/ftermcap.h b/include/final/ftermcap.h index ac3504ba..eb619c0d 100644 --- a/include/final/ftermcap.h +++ b/include/final/ftermcap.h @@ -40,6 +40,8 @@ #include +namespace finalcut +{ //---------------------------------------------------------------------- // class FTermcap @@ -103,4 +105,6 @@ class FTermcap inline const char* FTermcap::getClassName() const { return "FTermcap"; } +} // namespace finalcut + #endif // FTERMCAP_H diff --git a/include/final/ftermcapquirks.h b/include/final/ftermcapquirks.h index 4232e4ad..3ff65dcf 100644 --- a/include/final/ftermcapquirks.h +++ b/include/final/ftermcapquirks.h @@ -40,6 +40,8 @@ #include "final/ftermcap.h" #include "final/ftermdetection.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FTermcapsQuirks @@ -96,4 +98,6 @@ class FTermcapQuirks inline const char* FTermcapQuirks::getClassName() const { return "FTermcapQuirks"; } +} // namespace finalcut + #endif // FTERMCAPQUIRKS_H diff --git a/include/final/ftermdetection.h b/include/final/ftermdetection.h index e16c44da..57069b6f 100644 --- a/include/final/ftermdetection.h +++ b/include/final/ftermdetection.h @@ -46,6 +46,8 @@ #include "final/ftermios.h" #include "final/ftypes.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FTermDetection @@ -456,4 +458,6 @@ inline void FTermDetection::setTmuxTerm (bool on) inline void FTermDetection::setTerminalDetection (bool on) { terminal_detection = on; } +} // namespace finalcut + #endif // FTERMDETECTION_H diff --git a/include/final/ftermfreebsd.h b/include/final/ftermfreebsd.h index 6a19b04c..79fca3b8 100644 --- a/include/final/ftermfreebsd.h +++ b/include/final/ftermfreebsd.h @@ -46,6 +46,9 @@ #include #endif +namespace finalcut +{ + //---------------------------------------------------------------------- // class FTermFreeBSD //---------------------------------------------------------------------- @@ -129,4 +132,6 @@ inline void FTermFreeBSD::disableMetaSendsEscape() { meta_sends_escape = false; } #endif // defined(__FreeBSD__) || defined(__DragonFly__) +} // namespace finalcut + #endif // FTERMFREEBSD_H diff --git a/include/final/ftermios.h b/include/final/ftermios.h index bfc6e702..5b532264 100644 --- a/include/final/ftermios.h +++ b/include/final/ftermios.h @@ -40,6 +40,8 @@ #include "final/ftypes.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FTermios @@ -125,5 +127,6 @@ inline bool FTermios::unsetRawMode() inline bool FTermios::setCookedMode() { return setRawMode(false); } +} // namespace finalcut #endif // FTERMIOS_H diff --git a/include/final/ftermlinux.h b/include/final/ftermlinux.h index 86752010..8e6f1e64 100644 --- a/include/final/ftermlinux.h +++ b/include/final/ftermlinux.h @@ -40,10 +40,10 @@ #if defined(__x86_64__) || defined(__i386) || defined(__arm__) #include // is deprecated - #endif + #endif // defined(__x86_64__) || defined(__i386) || defined(__arm__) #include -#endif +#endif // defined(__linux__) #include #include @@ -56,6 +56,8 @@ #include "final/ftermdetection.h" #include "final/ftypes.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FTermLinux @@ -156,7 +158,7 @@ class FTermLinux static bool setVGAPalette (short, int, int, int); static bool saveVGAPalette(); static bool resetVGAPalette(); -#endif +#endif // defined(__x86_64__) || defined(__i386) || defined(__arm__) static int shiftKeyCorrection (const int&); static int ctrlKeyCorrection (const int&); static int altKeyCorrection (const int&); @@ -215,4 +217,6 @@ inline bool FTermLinux::isNewFontUsed() { return NewFont; } #endif // defined(__linux__) +} // namespace finalcut + #endif // FTERMLINUX_H diff --git a/include/final/ftermopenbsd.h b/include/final/ftermopenbsd.h index 5d7a6efa..4f0aaa36 100644 --- a/include/final/ftermopenbsd.h +++ b/include/final/ftermopenbsd.h @@ -42,6 +42,9 @@ #include #endif +namespace finalcut +{ + //---------------------------------------------------------------------- // class FTermOpenBSD //---------------------------------------------------------------------- @@ -89,7 +92,7 @@ class FTermOpenBSD // Data Members static kbd_t bsd_keyboard_encoding; static bool meta_sends_escape; -#endif +#endif // defined(__NetBSD__) || defined(__OpenBSD__) }; #pragma pack(pop) @@ -108,4 +111,6 @@ inline void FTermOpenBSD::disableMetaSendsEscape() { meta_sends_escape = false; } #endif // defined(__NetBSD__) || defined(__OpenBSD__) +} // namespace finalcut + #endif // FTERMOPENBSD_H diff --git a/include/final/ftermxterminal.h b/include/final/ftermxterminal.h index 92455ca6..a6215014 100644 --- a/include/final/ftermxterminal.h +++ b/include/final/ftermxterminal.h @@ -40,6 +40,8 @@ #include "final/ftermcap.h" #include "final/ftermdetection.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FTermXTerminal @@ -219,5 +221,6 @@ inline void FTermXTerminal::setMouseSupport() inline void FTermXTerminal::unsetMouseSupport() { setMouseSupport (false); } +} // namespace finalcut #endif // FTERMXTERMINAL_H diff --git a/include/final/ftextview.h b/include/final/ftextview.h index 680862ed..bd160c63 100644 --- a/include/final/ftextview.h +++ b/include/final/ftextview.h @@ -60,6 +60,8 @@ #include "final/fstring.h" #include "final/fwidget.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FTextView @@ -183,4 +185,6 @@ inline void FTextView::deleteRange (int from, int to) inline void FTextView::deleteLine (int pos) { deleteRange (pos, pos); } +} // namespace finalcut + #endif // FTEXTVIEW_H diff --git a/include/final/ftogglebutton.h b/include/final/ftogglebutton.h index 924e56e2..953b9b0e 100644 --- a/include/final/ftogglebutton.h +++ b/include/final/ftogglebutton.h @@ -54,6 +54,8 @@ #include "final/fwidget.h" +namespace finalcut +{ // class forward declaration class FButtonGroup; @@ -223,4 +225,6 @@ inline FButtonGroup* FToggleButton::getGroup() const inline bool FToggleButton::hasGroup() const { return button_group; } +} // namespace finalcut + #endif // FTOGGLEBUTTON_H diff --git a/include/final/ftooltip.h b/include/final/ftooltip.h index 60535ed3..405dba37 100644 --- a/include/final/ftooltip.h +++ b/include/final/ftooltip.h @@ -61,6 +61,8 @@ #include "final/fwindow.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FToolTip @@ -121,5 +123,6 @@ class FToolTip : public FWindow inline const char* FToolTip::getClassName() const { return "FToolTip"; } +} // namespace finalcut #endif // FTOOLTIP_H diff --git a/include/final/ftypes.h b/include/final/ftypes.h index a9a8ba93..01901437 100644 --- a/include/final/ftypes.h +++ b/include/final/ftypes.h @@ -32,6 +32,9 @@ #define null NULL +namespace +{ + typedef unsigned char uChar; typedef unsigned int uInt; typedef unsigned long uLong; @@ -49,6 +52,12 @@ typedef int64_t sInt64; typedef long double lDouble; +} // namespace + + +namespace finalcut +{ + namespace fc { #pragma pack(push) @@ -75,7 +84,10 @@ typedef struct } keyname; #pragma pack(pop) + } // namespace fc +} // namespace finalcut + #endif // FTYPES_H diff --git a/include/final/fvterm.h b/include/final/fvterm.h index c7fa717f..4fe61e88 100644 --- a/include/final/fvterm.h +++ b/include/final/fvterm.h @@ -61,6 +61,9 @@ static_cast((i)) \ , reinterpret_cast((h)) +namespace finalcut +{ + // class forward declaration class FWidget; @@ -858,4 +861,6 @@ inline bool FVTerm::isVirtualWindow() const inline void FVTerm::setPrintArea (term_area* area) { print_area = area; } +} // namespace finalcut + #endif // FVTERM_H diff --git a/include/final/fwidget.h b/include/final/fwidget.h index 73096507..545f8e7c 100644 --- a/include/final/fwidget.h +++ b/include/final/fwidget.h @@ -103,11 +103,14 @@ // Callback macros #define F_FUNCTION_CALLBACK(h) \ - reinterpret_cast((h)) + reinterpret_cast((h)) #define F_METHOD_CALLBACK(i,h) \ - reinterpret_cast((i)) \ - , reinterpret_cast((h)) + reinterpret_cast((i)) \ + , reinterpret_cast((h)) + +namespace finalcut +{ // class forward declaration class FStatusBar; @@ -929,4 +932,6 @@ const wchar_t CHECKED_RADIO_BUTTON[4] = '\0' }; +} // namespace finalcut + #endif // FWIDGET_H diff --git a/include/final/fwidgetcolors.h b/include/final/fwidgetcolors.h index 649f95c2..139901ac 100644 --- a/include/final/fwidgetcolors.h +++ b/include/final/fwidgetcolors.h @@ -31,8 +31,14 @@ #ifndef FWIDGETCOLORS_H #define FWIDGETCOLORS_H +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + #include "final/fc.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FWidgetColors @@ -136,5 +142,6 @@ class FWidgetColors }; #pragma pack(pop) +} // namespace finalcut #endif // FWIDGETCOLORS_H diff --git a/include/final/fwindow.h b/include/final/fwindow.h index a341479b..f1b55cee 100644 --- a/include/final/fwindow.h +++ b/include/final/fwindow.h @@ -62,6 +62,8 @@ #include "final/fwidget.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FWindow @@ -273,4 +275,6 @@ inline bool FWindow::raiseWindow() inline bool FWindow::lowerWindow() { return lowerWindow(this); } +} // namespace finalcut + #endif // FWINDOW_H diff --git a/src/fapplication.cpp b/src/fapplication.cpp index 3ef372ec..9a3b7769 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -28,6 +28,9 @@ #include "final/fstatusbar.h" #include "final/fwindow.h" +namespace finalcut +{ + // global application object static FApplication* rootObj = 0; @@ -1229,3 +1232,5 @@ bool FApplication::processNextEvent() return ( num_events > 0 ); } + +} // namespace finalcut diff --git a/src/fbutton.cpp b/src/fbutton.cpp index ae347166..4a93ea78 100644 --- a/src/fbutton.cpp +++ b/src/fbutton.cpp @@ -24,6 +24,8 @@ #include "final/fbutton.h" #include "final/fstatusbar.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FButton @@ -855,3 +857,5 @@ void FButton::processClick() { emitCallback("clicked"); } + +} // namespace finalcut diff --git a/src/fbuttongroup.cpp b/src/fbuttongroup.cpp index 7ea40735..77b2a505 100644 --- a/src/fbuttongroup.cpp +++ b/src/fbuttongroup.cpp @@ -26,6 +26,8 @@ #include "final/fstatusbar.h" #include "final/ftogglebutton.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FButtonGroup @@ -692,3 +694,5 @@ void FButtonGroup::directFocus() flush_out(); } } + +} // namespace finalcut diff --git a/src/fcheckbox.cpp b/src/fcheckbox.cpp index 80efac93..2361391d 100644 --- a/src/fcheckbox.cpp +++ b/src/fcheckbox.cpp @@ -22,6 +22,8 @@ #include "final/fcheckbox.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FCheckBox @@ -107,3 +109,5 @@ void FCheckBox::drawCheckButton() if ( isMonochron() ) setReverse(false); } + +} // namespace finalcut diff --git a/src/fcheckmenuitem.cpp b/src/fcheckmenuitem.cpp index a520caed..d508bb21 100644 --- a/src/fcheckmenuitem.cpp +++ b/src/fcheckmenuitem.cpp @@ -23,6 +23,8 @@ #include "final/fcheckmenuitem.h" #include "final/fmenu.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FCheckMenuItem @@ -77,3 +79,5 @@ void FCheckMenuItem::processClicked() processToggle(); emitCallback("clicked"); } + +} // namespace finalcut diff --git a/src/fcolorpalette.cpp b/src/fcolorpalette.cpp index e50a9945..92ae900d 100644 --- a/src/fcolorpalette.cpp +++ b/src/fcolorpalette.cpp @@ -22,6 +22,8 @@ #include "final/fcolorpalette.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FColorPalette @@ -122,3 +124,5 @@ void FColorPalette::reset16ColorPalette (funcp setPalette) setPalette (fc::Yellow, 0xff, 0xff, 0x55); setPalette (fc::White, 0xff, 0xff, 0xff); } + +} // namespace finalcut diff --git a/src/fdialog.cpp b/src/fdialog.cpp index 7c753528..2813e0a3 100644 --- a/src/fdialog.cpp +++ b/src/fdialog.cpp @@ -24,6 +24,8 @@ #include "final/fdialog.h" #include "final/fstatusbar.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FDialog @@ -1066,7 +1068,7 @@ void FDialog::drawTitleBar() setPrintPos (getWidth() - 2, 1); printf ("(%d)", getWindowLayer(this)); } -#endif +#endif // DEBUG } //---------------------------------------------------------------------- @@ -1765,3 +1767,5 @@ void FDialog::cb_close (FWidget*, data_ptr) drawTitleBar(); close(); } + +} // namespace finalcut diff --git a/src/fdialoglistmenu.cpp b/src/fdialoglistmenu.cpp index 15878cc6..c7ebff1c 100644 --- a/src/fdialoglistmenu.cpp +++ b/src/fdialoglistmenu.cpp @@ -22,6 +22,8 @@ #include "final/fdialoglistmenu.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FDialogListMenu @@ -56,3 +58,5 @@ void FDialogListMenu::init() if ( menuitem ) menuitem->dialog_index = true; } + +} // namespace finalcut diff --git a/src/fevent.cpp b/src/fevent.cpp index ff86cbf7..c9c58f80 100644 --- a/src/fevent.cpp +++ b/src/fevent.cpp @@ -24,6 +24,8 @@ #include "final/fevent.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FEvent @@ -357,3 +359,5 @@ FTimerEvent::~FTimerEvent() // destructor //---------------------------------------------------------------------- int FTimerEvent::timerId() const { return id; } + +} // namespace finalcut diff --git a/src/ffiledialog.cpp b/src/ffiledialog.cpp index 442afbc6..3e196224 100644 --- a/src/ffiledialog.cpp +++ b/src/ffiledialog.cpp @@ -24,6 +24,8 @@ #include "final/ffiledialog.h" +namespace finalcut +{ // non-member functions //---------------------------------------------------------------------- @@ -939,3 +941,5 @@ void FFileDialog::cb_processShowHidden (FWidget*, data_ptr) { setShowHiddenFiles(not show_hidden); } + +} // namespace finalcut diff --git a/src/fkey_map.cpp b/src/fkey_map.cpp index 8e28bc7f..61f69b98 100644 --- a/src/fkey_map.cpp +++ b/src/fkey_map.cpp @@ -23,6 +23,9 @@ #include #include +namespace finalcut +{ + namespace fc { @@ -826,3 +829,5 @@ keyname FkeyName[] = }; } // namespace fc + +} // namespace finalcut diff --git a/src/fkeyboard.cpp b/src/fkeyboard.cpp index 1d33dc9b..d78c7dd6 100644 --- a/src/fkeyboard.cpp +++ b/src/fkeyboard.cpp @@ -26,6 +26,9 @@ #include "final/fkey_map.h" #include "final/ftermios.h" +namespace finalcut +{ + // static class attributes long FKeyboard::key_timeout = 100000; // 100 ms (default timeout for keypress) struct timeval FKeyboard::time_keypressed; @@ -567,3 +570,5 @@ void FKeyboard::escapeKeyPressed() { escape_key_cmd.execute(); } + +} // namespace finalcut diff --git a/src/flabel.cpp b/src/flabel.cpp index 29afa303..fc80a391 100644 --- a/src/flabel.cpp +++ b/src/flabel.cpp @@ -24,6 +24,8 @@ #include "final/flabel.h" #include "final/fstatusbar.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FLabel @@ -666,3 +668,5 @@ void FLabel::printLine ( wchar_t line[] if ( hasReverseMode() ) setReverse(false); } + +} // namespace finalcut diff --git a/src/flineedit.cpp b/src/flineedit.cpp index 2f854d9c..af17fea6 100644 --- a/src/flineedit.cpp +++ b/src/flineedit.cpp @@ -24,6 +24,8 @@ #include "final/flineedit.h" #include "final/fstatusbar.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FLineEdit @@ -939,3 +941,5 @@ void FLineEdit::processChanged() { emitCallback("changed"); } + +} // namespace finalcut diff --git a/src/flistbox.cpp b/src/flistbox.cpp index 49ee6635..0cd7bf19 100644 --- a/src/flistbox.cpp +++ b/src/flistbox.cpp @@ -27,6 +27,8 @@ #include "final/fscrollbar.h" #include "final/fstatusbar.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FListBoxItem @@ -2065,3 +2067,5 @@ void FListBox::cb_HBarChange (FWidget*, data_ptr) flush_out(); } } + +} // namespace finalcut diff --git a/src/flistview.cpp b/src/flistview.cpp index 457a693f..f62e4e5a 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -28,6 +28,9 @@ #include "final/fstatusbar.h" #include "final/ftermbuffer.h" +namespace finalcut +{ + // Static class attribute FObject::FObjectIterator FListView::null_iter; @@ -2185,3 +2188,5 @@ void FListView::cb_HBarChange (FWidget*, data_ptr) flush_out(); } } + +} // namespace finalcut diff --git a/src/fmenu.cpp b/src/fmenu.cpp index 1bec754c..df9f829f 100644 --- a/src/fmenu.cpp +++ b/src/fmenu.cpp @@ -27,6 +27,9 @@ #include "final/fmenu.h" #include "final/fstatusbar.h" +namespace finalcut +{ + //---------------------------------------------------------------------- // class FMenu //---------------------------------------------------------------------- @@ -1687,3 +1690,5 @@ void FMenu::processActivate() { emitCallback("activate"); } + +} // namespace finalcut diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp index 0c7ef529..88be543e 100644 --- a/src/fmenubar.cpp +++ b/src/fmenubar.cpp @@ -26,6 +26,8 @@ #include "final/fmenubar.h" #include "final/fstatusbar.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FMenuBar @@ -1064,3 +1066,5 @@ void FMenuBar::leaveMenuBar() flush_out(); mouse_down = false; } + +} // namespace finalcut diff --git a/src/fmenuitem.cpp b/src/fmenuitem.cpp index 3e9d1377..725d3451 100644 --- a/src/fmenuitem.cpp +++ b/src/fmenuitem.cpp @@ -28,6 +28,8 @@ #include "final/fmenuitem.h" #include "final/fstatusbar.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FMenuItem @@ -771,3 +773,5 @@ void FMenuItem::processClicked() { emitCallback("clicked"); } + +} // namespace finalcut diff --git a/src/fmenulist.cpp b/src/fmenulist.cpp index d7171af0..def14d91 100644 --- a/src/fmenulist.cpp +++ b/src/fmenulist.cpp @@ -24,6 +24,8 @@ #include "final/fmenulist.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FMenuList @@ -134,3 +136,5 @@ void FMenuList::unselectItem() setSelectedItem(0); } + +} // namespace finalcut diff --git a/src/fmessagebox.cpp b/src/fmessagebox.cpp index 37b26352..a8e660a7 100644 --- a/src/fmessagebox.cpp +++ b/src/fmessagebox.cpp @@ -25,6 +25,8 @@ #include "final/fapplication.h" #include "final/fmessagebox.h" +namespace finalcut +{ static const char* const button_text[] = { @@ -568,3 +570,5 @@ void FMessageBox::adjustButtons() } } } + +} // namespace finalcut diff --git a/src/fmouse.cpp b/src/fmouse.cpp index d2270064..805333bf 100644 --- a/src/fmouse.cpp +++ b/src/fmouse.cpp @@ -30,6 +30,8 @@ #include "final/fterm.h" #include "final/ftermxterminal.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FMouse @@ -452,7 +454,7 @@ int FMouseGPM::gpmEvent (bool clear) else return no_event; } -#endif +#endif // F_HAVE_LIBGPM //---------------------------------------------------------------------- @@ -1257,7 +1259,7 @@ void FMouseControl::setStdinNo (int file_descriptor) #else void FMouseControl::setStdinNo (int) { } -#endif +#endif // F_HAVE_LIBGPM //---------------------------------------------------------------------- void FMouseControl::setMaxWidth (short x_max) @@ -1492,7 +1494,7 @@ bool FMouseControl::isGpmMouseEnabled() if ( gpm_mouse ) return gpm_mouse->isGpmMouseEnabled(); -#endif +#endif // F_HAVE_LIBGPM return false; } @@ -1500,16 +1502,16 @@ bool FMouseControl::isGpmMouseEnabled() //---------------------------------------------------------------------- void FMouseControl::enable() { +#ifdef F_HAVE_LIBGPM if ( use_gpm_mouse ) { -#ifdef F_HAVE_LIBGPM FMouse* mouse = mouse_protocol[FMouse::gpm]; FMouseGPM* gpm_mouse = static_cast(mouse); if ( gpm_mouse ) use_gpm_mouse = gpm_mouse->enableGpmMouse(); -#endif } +#endif // F_HAVE_LIBGPM if ( use_xterm_mouse ) enableXTermMouse(); @@ -1518,16 +1520,16 @@ void FMouseControl::enable() //---------------------------------------------------------------------- void FMouseControl::disable() { +#ifdef F_HAVE_LIBGPM if ( use_gpm_mouse ) { -#ifdef F_HAVE_LIBGPM FMouse* mouse = mouse_protocol[FMouse::gpm]; FMouseGPM* gpm_mouse = static_cast(mouse); if ( gpm_mouse ) gpm_mouse->disableGpmMouse(); -#endif } +#endif // F_HAVE_LIBGPM if ( use_xterm_mouse ) disableXTermMouse(); @@ -1562,7 +1564,7 @@ bool FMouseControl::getGpmKeyPressed (bool pending) #else bool FMouseControl::getGpmKeyPressed (bool) -#endif +#endif // F_HAVE_LIBGPM { if ( mouse_protocol.empty() ) return false; @@ -1573,7 +1575,7 @@ bool FMouseControl::getGpmKeyPressed (bool) if ( gpm_mouse ) return gpm_mouse->getGpmKeyPressed(pending); -#endif +#endif // F_HAVE_LIBGPM return false; } @@ -1592,7 +1594,7 @@ void FMouseControl::drawGpmPointer() if ( gpm_mouse ) gpm_mouse->drawGpmPointer(); -#endif +#endif // F_HAVE_LIBGPM } @@ -1645,3 +1647,5 @@ void FMouseControl::putstring (const char s[], int affcnt) { FTerm::putstring (s, affcnt); } + +} // namespace finalcut diff --git a/src/fobject.cpp b/src/fobject.cpp index 0a1bb96f..897cb893 100644 --- a/src/fobject.cpp +++ b/src/fobject.cpp @@ -22,6 +22,9 @@ #include "final/fobject.h" +namespace finalcut +{ + // static class attributes bool FObject::timer_modify_lock; FObject::TimerList* FObject::timer_list = 0; @@ -385,3 +388,5 @@ bool FObject::event (FEvent* ev) //---------------------------------------------------------------------- void FObject::onTimer (FTimerEvent*) { } + +} // namespace finalcut diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp index 50c8a73d..11f1dbf3 100644 --- a/src/foptiattr.cpp +++ b/src/foptiattr.cpp @@ -24,6 +24,9 @@ #include "final/foptiattr.h" +namespace finalcut +{ + //---------------------------------------------------------------------- // class FOptiAttr //---------------------------------------------------------------------- @@ -1701,3 +1704,5 @@ inline bool FOptiAttr::append_sequence (char seq[]) else return false; } + +} // namespace finalcut diff --git a/src/foptimove.cpp b/src/foptimove.cpp index 11b83c01..95541d8e 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -25,6 +25,8 @@ #include "final/fc.h" #include "final/foptimove.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FOptiMove @@ -1162,3 +1164,5 @@ void FOptiMove::moveByMethod ( int method break; } } + +} // namespace finalcut diff --git a/src/fpoint.cpp b/src/fpoint.cpp index d3b66aa4..d28c0a08 100644 --- a/src/fpoint.cpp +++ b/src/fpoint.cpp @@ -22,6 +22,8 @@ #include "final/fpoint.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FPoint @@ -96,3 +98,5 @@ std::istream& operator >> (std::istream& instr, FPoint& p) p.setPoint (x, y); return instr; } + +} // namespace finalcut diff --git a/src/fprogressbar.cpp b/src/fprogressbar.cpp index 722063ff..a2653f82 100644 --- a/src/fprogressbar.cpp +++ b/src/fprogressbar.cpp @@ -22,6 +22,8 @@ #include "final/fprogressbar.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FProgressbar @@ -258,3 +260,5 @@ void FProgressbar::drawBar() updateTerminal(); flush_out(); } + +} // namespace finalcut diff --git a/src/fradiobutton.cpp b/src/fradiobutton.cpp index 1f05cdb1..0e1e4421 100644 --- a/src/fradiobutton.cpp +++ b/src/fradiobutton.cpp @@ -23,6 +23,8 @@ #include "final/fapplication.h" #include "final/fradiobutton.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FRadioButton @@ -108,3 +110,5 @@ void FRadioButton::drawRadioButton() if ( isMonochron() ) setReverse(false); } + +} // namespace finalcut diff --git a/src/fradiomenuitem.cpp b/src/fradiomenuitem.cpp index 9611012a..0199a427 100644 --- a/src/fradiomenuitem.cpp +++ b/src/fradiomenuitem.cpp @@ -23,6 +23,8 @@ #include "final/fradiomenuitem.h" #include "final/fmenu.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FRadioMenuItem @@ -88,3 +90,5 @@ void FRadioMenuItem::processClicked() emitCallback("clicked"); } + +} // namespace finalcut diff --git a/src/frect.cpp b/src/frect.cpp index 34d3a72c..1a4b7f16 100644 --- a/src/frect.cpp +++ b/src/frect.cpp @@ -24,6 +24,9 @@ #include "final/frect.h" +namespace finalcut +{ + //---------------------------------------------------------------------- // class FRect //---------------------------------------------------------------------- @@ -297,3 +300,5 @@ std::istream& operator >> (std::istream& instr, FRect& r) r.setCoordinates (x1, y1, x2, y2); return instr; } + +} // namespace finalcut diff --git a/src/fscrollbar.cpp b/src/fscrollbar.cpp index bf8b0955..8648c0f4 100644 --- a/src/fscrollbar.cpp +++ b/src/fscrollbar.cpp @@ -24,6 +24,8 @@ #include "final/fscrollbar.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FScrollbar @@ -831,3 +833,5 @@ void FScrollbar::processScroll() emitCallback("change-value"); avoidScrollOvershoot(); } + +} // namespace finalcut diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp index e93bd385..5da218f7 100644 --- a/src/fscrollview.cpp +++ b/src/fscrollview.cpp @@ -24,6 +24,8 @@ #include "final/fscrollview.h" #include "final/fwindow.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FScrollView @@ -1029,3 +1031,5 @@ inline void FScrollView::drawVBar() child_print_area = viewport; } + +} // namespace finalcut diff --git a/src/fstatusbar.cpp b/src/fstatusbar.cpp index 80578559..79112831 100644 --- a/src/fstatusbar.cpp +++ b/src/fstatusbar.cpp @@ -24,6 +24,8 @@ #include "final/fstatusbar.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FStatusKey @@ -727,3 +729,4 @@ void FStatusBar::drawActiveKey (keyList::const_iterator iter) setReverse(true); } +} // namespace finalcut diff --git a/src/fstring.cpp b/src/fstring.cpp index 08f49acf..eb0a31f5 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp @@ -25,6 +25,9 @@ #include "final/fstring.h" +namespace finalcut +{ + // static class constant const char* const FString::bad_alloc_str = "not enough memory " \ "to alloc a new string"; @@ -3072,3 +3075,5 @@ std::wistream& operator >> (std::wistream& instr, FString& s) s._assign (buf); return instr; } + +} // namespace finalcut diff --git a/src/fswitch.cpp b/src/fswitch.cpp index cb83c748..0724ae74 100644 --- a/src/fswitch.cpp +++ b/src/fswitch.cpp @@ -22,6 +22,8 @@ #include "final/fswitch.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FSwitch @@ -232,3 +234,5 @@ void FSwitch::drawUnchecked() setCursorPos (7 + switch_offset_pos, 1); } + +} // namespace finalcut diff --git a/src/fterm.cpp b/src/fterm.cpp index 6fef158f..82af5598 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -29,6 +29,9 @@ #include "final/fcharmap.h" #include "final/ftcap_map.h" +namespace finalcut +{ + // global FTerm object static FTerm* init_term_object = 0; @@ -249,7 +252,7 @@ bool FTerm::setVGAFont() term_encoding = fc::PC; Fputchar = &FTerm::putchar_ASCII; } -#endif +#endif // defined(__linux__) else VGAFont = false; @@ -295,7 +298,7 @@ bool FTerm::setNewFont() term_encoding = fc::PC; Fputchar = &FTerm::putchar_ASCII; // function pointer } -#endif +#endif // defined(__linux__) else NewFont = false; @@ -344,7 +347,7 @@ bool FTerm::setOldFont() half_block_character = linux->hasHalfBlockCharacter(); } } -#endif +#endif // defined(__linux__) if ( retval ) VGAFont = NewFont = false; @@ -462,7 +465,7 @@ char* FTerm::enableCursor() cstyle = linux->restoreCursorStyle(); std::strncat (enable_str, cstyle, SIZE - std::strlen(enable_str)); } -#endif +#endif // defined(__linux__) enable_str[SIZE - 1] = '\0'; @@ -472,7 +475,7 @@ char* FTerm::enableCursor() // Restore the last used FreeBSD console cursor style freebsd->restoreCursorStyle(); } -#endif +#endif // defined(__FreeBSD__) || defined(__DragonFly__) return enable_str; } @@ -635,7 +638,7 @@ void FTerm::setBeep (int Hz, int ms) #else void FTerm::setBeep (int, int) { } -#endif +#endif // defined(__linux__) //---------------------------------------------------------------------- void FTerm::resetBeep() @@ -806,7 +809,7 @@ int FTerm::putchar_ASCII (char c) else return 1; } -#endif +#endif // defined(__sun) && defined(__SVR4) //---------------------------------------------------------------------- int FTerm::putchar_ASCII (int c) @@ -1786,7 +1789,7 @@ void FTerm::enableMouse() closeConsole(); } -#endif +#endif // defined(__linux__) if ( TCAP(fc::t_key_mouse) && ! isLinuxTerm() ) xterm_mouse = true; @@ -2068,7 +2071,7 @@ void FTerm::initOSspecifics() framebuffer_bpp = linux->getFramebufferBpp(); #endif -#endif +#endif // defined(__linux__) #if defined(__FreeBSD__) || defined(__DragonFly__) if ( init_values.meta_sends_escape ) @@ -2082,7 +2085,7 @@ void FTerm::initOSspecifics() freebsd->disableChangeCursorStyle(); freebsd->init(); // Initialize BSD console -#endif +#endif // defined(__FreeBSD__) || defined(__DragonFly__) #if defined(__NetBSD__) || defined(__OpenBSD__) if ( init_values.meta_sends_escape ) @@ -2263,3 +2266,5 @@ void FTerm::signal_handler (int signum) std::terminate(); } } + +} // namespace finalcut diff --git a/src/ftermbuffer.cpp b/src/ftermbuffer.cpp index 910d584d..62972e12 100644 --- a/src/ftermbuffer.cpp +++ b/src/ftermbuffer.cpp @@ -25,6 +25,8 @@ #include "final/ftermbuffer.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FTermBuffer @@ -179,3 +181,5 @@ std::vector& operator << \ return termString; } + +} // namespace finalcut diff --git a/src/ftermcapquirks.cpp b/src/ftermcapquirks.cpp index 3c36eecc..b58b5833 100644 --- a/src/ftermcapquirks.cpp +++ b/src/ftermcapquirks.cpp @@ -22,6 +22,9 @@ #include "final/ftermcapquirks.h" +namespace finalcut +{ + // static class attributes char FTermcapQuirks::termtype[256] = { }; FTermcap::tcap_map* FTermcapQuirks::tcap = 0; @@ -106,7 +109,7 @@ void FTermcapQuirks::terminalFixup() { init_termcap_freebsd_quirks(); } -#endif +#endif // defined(__FreeBSD__) || defined(__DragonFly__) // xterm and compatible terminals if ( td->isXTerminal() && ! td->isPuttyTerminal() ) @@ -141,7 +144,7 @@ void FTermcapQuirks::init_termcap_freebsd_quirks() FTermcap::attr_without_color = 18; } -#endif +#endif // defined(__FreeBSD__) || defined(__DragonFly__) //---------------------------------------------------------------------- void FTermcapQuirks::init_termcap_cygwin_quirks() @@ -498,3 +501,5 @@ void FTermcapQuirks::init_termcap_general_quirks() C_STR(CSI "29m"); } } + +} // namespace finalcut diff --git a/src/ftermdetection.cpp b/src/ftermdetection.cpp index 6fa9764c..84803c26 100644 --- a/src/ftermdetection.cpp +++ b/src/ftermdetection.cpp @@ -23,6 +23,9 @@ #include "final/fterm.h" #include "final/ftermdetection.h" +namespace finalcut +{ + // static class attributes FTermDetection::terminalType FTermDetection::terminal_type = \ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -42,7 +45,7 @@ int FTermDetection::gnome_terminal_id; char FTermDetection::termtype_256color[256] = { }; char FTermDetection::termtype_Answerback[256] = { }; char FTermDetection::termtype_SecDA[256] = { }; -#endif +#endif // DEBUG //---------------------------------------------------------------------- @@ -245,7 +248,7 @@ bool FTermDetection::getTTYSFileEntry() endttyent(); return false; } -#endif +#endif // F_HAVE_GETTTYNAM //---------------------------------------------------------------------- void FTermDetection::termtypeAnalysis() @@ -375,7 +378,7 @@ char* FTermDetection::init_256colorTerminal() , sizeof(termtype_256color) ); termtype_256color[sizeof(termtype_256color) - 1] = '\0'; } -#endif +#endif // DEBUG return new_termtype; } @@ -579,7 +582,7 @@ char* FTermDetection::parseAnswerbackMsg (char current_termtype[]) , sizeof(termtype_Answerback) ); termtype_Answerback[sizeof(termtype_Answerback) - 1] = '\0'; } -#endif +#endif // DEBUG return new_termtype; } @@ -667,7 +670,7 @@ char* FTermDetection::parseSecDA (char current_termtype[]) std::strncpy (termtype_SecDA, new_termtype, sizeof(termtype_SecDA)); termtype_SecDA[sizeof(termtype_SecDA) - 1] = '\0'; } -#endif +#endif // DEBUG return new_termtype; } @@ -852,7 +855,7 @@ inline char* FTermDetection::secDA_Analysis_24 (char current_termtype[]) } } -#endif +#endif // defined(__NetBSD__) || defined(__OpenBSD__) return new_termtype; } @@ -952,3 +955,5 @@ inline char* FTermDetection::secDA_Analysis_85 (char current_termtype[]) return new_termtype; } + +} // namespace finalcut diff --git a/src/ftermfreebsd.cpp b/src/ftermfreebsd.cpp index 90ea7dcb..c6b96c18 100644 --- a/src/ftermfreebsd.cpp +++ b/src/ftermfreebsd.cpp @@ -31,6 +31,8 @@ bool FTermFreeBSD::meta_sends_escape = true; #endif +namespace finalcut +{ //---------------------------------------------------------------------- // class FTermFreeBSD @@ -202,5 +204,6 @@ bool FTermFreeBSD::resetFreeBSDAlt2Meta() return setFreeBSDAltKey (bsd_alt_keymap); } +#endif // defined(__FreeBSD__) || defined(__DragonFly__) -#endif +} // namespace finalcut diff --git a/src/ftermios.cpp b/src/ftermios.cpp index 49dc463b..ff0ca2ac 100644 --- a/src/ftermios.cpp +++ b/src/ftermios.cpp @@ -23,6 +23,9 @@ #include "final/ftermios.h" #include "final/fterm.h" +namespace finalcut +{ + // static class attributes int FTermios::stdin_no; int FTermios::stdout_no; @@ -224,3 +227,5 @@ uInt FTermios::getBaudRate() return outspeed[cfgetospeed(&term_init)]; } + +} // namespace finalcut diff --git a/src/ftermlinux.cpp b/src/ftermlinux.cpp index feae48e1..845c2833 100644 --- a/src/ftermlinux.cpp +++ b/src/ftermlinux.cpp @@ -29,6 +29,9 @@ #include "../fonts/vgafont.h" #endif +namespace finalcut +{ + // static class attributes #if defined(__linux__) FTermLinux::modifier_key FTermLinux::mod_key; @@ -67,7 +70,7 @@ FTermLinux::~FTermLinux() // destructor if ( screen_unicode_map.entries ) delete[] screen_unicode_map.entries; -#endif +#endif // defined(__linux__) } // public methods of FTermLinux @@ -1190,5 +1193,6 @@ int FTermLinux::shiftCtrlAltKeyCorrection (const int& key_id) return key_id; } } - #endif // defined(__linux__) + +} // namespace finalcut diff --git a/src/ftermopenbsd.cpp b/src/ftermopenbsd.cpp index 0ca1734f..26143672 100644 --- a/src/ftermopenbsd.cpp +++ b/src/ftermopenbsd.cpp @@ -28,6 +28,8 @@ bool FTermOpenBSD::meta_sends_escape = true; #endif +namespace finalcut +{ //---------------------------------------------------------------------- // class FTermOpenBSD @@ -123,5 +125,6 @@ bool FTermOpenBSD::resetBSDConsoleEncoding() { return setBSDConsoleEncoding (bsd_keyboard_encoding); } +#endif // defined(__NetBSD__) || defined(__OpenBSD__) -#endif +} // namespace finalcut diff --git a/src/ftermxterminal.cpp b/src/ftermxterminal.cpp index f43fe417..0b4d07e9 100644 --- a/src/ftermxterminal.cpp +++ b/src/ftermxterminal.cpp @@ -24,6 +24,9 @@ #include "final/ftermfreebsd.h" #include "final/ftermxterminal.h" +namespace finalcut +{ + // static class attributes bool FTermXTerminal::mouse_support; bool FTermXTerminal::meta_sends_esc; @@ -930,3 +933,5 @@ void FTermXTerminal::disableXTermMetaSendsESC() std::fflush(stdout); meta_sends_esc = false; } + +} // namespace finalcut diff --git a/src/ftextview.cpp b/src/ftextview.cpp index cebf83bf..8da1d863 100644 --- a/src/ftextview.cpp +++ b/src/ftextview.cpp @@ -24,6 +24,8 @@ #include "final/fstatusbar.h" #include "final/ftextview.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FTextView @@ -923,3 +925,5 @@ void FTextView::cb_HBarChange (FWidget*, data_ptr) update_scrollbar = true; } + +} // namespace finalcut diff --git a/src/ftogglebutton.cpp b/src/ftogglebutton.cpp index 8b7ec392..59b1ba8d 100644 --- a/src/ftogglebutton.cpp +++ b/src/ftogglebutton.cpp @@ -25,6 +25,8 @@ #include "final/fstatusbar.h" #include "final/ftogglebutton.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FToggleButton @@ -695,3 +697,5 @@ void FToggleButton::drawText (wchar_t LabelText[], int hotkeypos, uInt length) if ( isMonochron() ) setReverse(false);; } + +} // namespace finalcut diff --git a/src/ftooltip.cpp b/src/ftooltip.cpp index 481cab2e..2fb648e0 100644 --- a/src/ftooltip.cpp +++ b/src/ftooltip.cpp @@ -23,6 +23,8 @@ #include "final/fapplication.h" #include "final/ftooltip.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FToolTip @@ -176,3 +178,5 @@ void FToolTip::adjustSize() calculateDimensions(); FWindow::adjustSize(); } + +} // namespace finalcut diff --git a/src/fvterm.cpp b/src/fvterm.cpp index c63a6ba4..6e2c09bc 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -29,6 +29,9 @@ #include "final/fwidget.h" #include "final/fwindow.h" +namespace finalcut +{ + // global FVTerm object static FVTerm* init_object = 0; @@ -3047,7 +3050,7 @@ int FVTerm::appendOutputBuffer (char ch) return ch; } -#endif +#endif // defined(__sun) && defined(__SVR4) //---------------------------------------------------------------------- int FVTerm::appendOutputBuffer (int ch) @@ -3061,3 +3064,4 @@ int FVTerm::appendOutputBuffer (int ch) return ch; } +} // namespace finalcut diff --git a/src/fwidget.cpp b/src/fwidget.cpp index 42ab68b9..040f1134 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -27,6 +27,8 @@ #include "final/fstatusbar.h" #include "final/fwidget.h" +namespace finalcut +{ // global FWidget object static FWidget* rootObject = 0; @@ -2493,3 +2495,5 @@ void FWidget::setColorTheme() wc.term_bg = fc::SteelBlue3; } } + +} // namespace finalcut diff --git a/src/fwidgetcolors.cpp b/src/fwidgetcolors.cpp index a1fa0bf2..f7bf5cf7 100644 --- a/src/fwidgetcolors.cpp +++ b/src/fwidgetcolors.cpp @@ -22,6 +22,8 @@ #include "final/fwidgetcolors.h" +namespace finalcut +{ //---------------------------------------------------------------------- // class FWidgetColors @@ -206,3 +208,4 @@ void FWidgetColors::set16ColorTheme() progressbar_bg = fc::LightBlue; } +} // namespace finalcut diff --git a/src/fwindow.cpp b/src/fwindow.cpp index b607575d..f59decf1 100644 --- a/src/fwindow.cpp +++ b/src/fwindow.cpp @@ -25,6 +25,9 @@ #include "final/fstatusbar.h" #include "final/fwindow.h" +namespace finalcut +{ + // static attributes FWindow* FWindow::previous_window = 0; @@ -925,3 +928,5 @@ void FWindow::processAlwaysOnTop() ++iter; } } + +} // namespace finalcut diff --git a/src/test/fkeyboard-test.cpp b/src/test/fkeyboard-test.cpp index 70b42660..e2a8f584 100644 --- a/src/test/fkeyboard-test.cpp +++ b/src/test/fkeyboard-test.cpp @@ -46,175 +46,175 @@ fkeymap; fkeymap Fkey[] = { - { fc::Fkey_backspace , C_STR("\177") , "kb" }, // backspace key - { fc::Fkey_catab , 0 , "ka" }, // clear-all-tabs key - { fc::Fkey_clear , 0 , "kC" }, // clear-screen or erase key - { fc::Fkey_ctab , C_STR(CSI "3~") , "kt" }, // clear-tab key - { fc::Fkey_dc , 0 , "kD" }, // delete-character key - { fc::Fkey_dl , 0 , "kL" }, // delete-line key - { fc::Fkey_down , C_STR(ESC "OB") , "kd" }, // down-arrow key - { fc::Fkey_down , C_STR(CSI "B") , "kdx"}, // down-arrow key - { fc::Fkey_eic , 0 , "kM" }, // sent by rmir or smir in insert mode - { fc::Fkey_eol , 0 , "kE" }, // clear-to-end-of-line key - { fc::Fkey_eos , 0 , "kS" }, // clear-to-end-of-screen key - { fc::Fkey_f0 , 0 , "k0" }, // F0 function key - { fc::Fkey_f1 , C_STR(ESC "OP") , "k1" }, // F1 function key - { fc::Fkey_f1 , C_STR(CSI "11~") , "k1x"}, // F1 function key - { fc::Fkey_f1 , C_STR(ESC "OP") , "k1X"}, // F1 function key - { fc::Fkey_f2 , C_STR(ESC "OQ") , "k2" }, // F2 function key - { fc::Fkey_f2 , C_STR(CSI "12~") , "k2x"}, // F2 function key - { fc::Fkey_f2 , C_STR(CSI "OQ") , "k2X"}, // F2 function key - { fc::Fkey_f3 , C_STR(ESC "OR") , "k3" }, // F3 function key - { fc::Fkey_f3 , C_STR(CSI "13~") , "k3x"}, // F3 function key - { fc::Fkey_f3 , C_STR(ESC "OR") , "k3X"}, // F3 function key - { fc::Fkey_f4 , C_STR(ESC "OS") , "k4" }, // F4 function key - { fc::Fkey_f4 , C_STR(CSI "14~") , "k4x"}, // F4 function key - { fc::Fkey_f4 , C_STR(ESC "OS") , "k4X"}, // F4 function key - { fc::Fkey_f5 , C_STR(CSI "15~") , "k5" }, // F5 function key - { fc::Fkey_f6 , C_STR(CSI "17~") , "k6" }, // F6 function key - { fc::Fkey_f7 , C_STR(CSI "18~") , "k7" }, // F7 function key - { fc::Fkey_f8 , C_STR(CSI "19~") , "k8" }, // F8 fucntion key - { fc::Fkey_f9 , C_STR(CSI "20~") , "k9" }, // F9 function key - { fc::Fkey_f10 , C_STR(CSI "21~") , "k;" }, // F10 function key - { fc::Fkey_home , C_STR(ESC "OH") , "kh" }, // home key - { fc::Fkey_home , C_STR(CSI "7~") , "khx"}, // home key - { fc::Fkey_ic , C_STR(CSI "2~") , "kI" }, // insert-character key - { fc::Fkey_il , 0 , "kA" }, // insert-line key - { fc::Fkey_left , C_STR(ESC "OD") , "kl" }, // left-arrow key - { fc::Fkey_left , C_STR(CSI "D") , "klx"}, // left-arrow key - { fc::Fkey_ll , 0 , "kH" }, // last-line key - { fc::Fkey_npage , C_STR(CSI "6~") , "kN" }, // next-page key - { fc::Fkey_ppage , C_STR(CSI "5~") , "kP" }, // prev-page key - { fc::Fkey_right , C_STR(ESC "OC") , "kr" }, // right-arrow key - { fc::Fkey_right , C_STR(CSI "C") , "krx"}, // right-arrow key - { fc::Fkey_sf , C_STR(CSI "1;2B") , "kF" }, // scroll-forward key (shift-up) - { fc::Fkey_sr , C_STR(CSI "1;2A") , "kR" }, // scroll-backward key (shift-down) - { fc::Fkey_stab , 0 , "kT" }, // set-tab key - { fc::Fkey_up , C_STR(ESC "OA") , "ku" }, // up-arrow key - { fc::Fkey_up , C_STR(CSI "A") , "kux"}, // up-arrow key - { fc::Fkey_a1 , 0 , "K1" }, // upper left of keypad - { fc::Fkey_a3 , 0 , "K3" }, // upper right of keypad - { fc::Fkey_b2 , C_STR(CSI "E") , "K2" }, // center of keypad - { fc::Fkey_c1 , 0 , "K4" }, // lower left of keypad - { fc::Fkey_c3 , 0 , "K5" }, // lower right of keypad - { fc::Fkey_btab , C_STR(CSI "Z") , "kB" }, // back-tab key - { fc::Fkey_beg , 0 , "@1" }, // begin key - { fc::Fkey_cancel , 0 , "@2" }, // cancel key - { fc::Fkey_close , 0 , "@3" }, // close key - { fc::Fkey_command , 0 , "@4" }, // command key - { fc::Fkey_copy , 0 , "@5" }, // copy key - { fc::Fkey_create , 0 , "@6" }, // create key - { fc::Fkey_end , C_STR(ESC "OF") , "@7" }, // end key - { fc::Fkey_end , C_STR(CSI "8~") , "@7x"}, // end key - { fc::Fkey_end , C_STR(CSI "K") , "@7X"}, // end key - { fc::Fkey_enter , 0 , "@8" }, // enter/send key - { fc::Fkey_enter , C_STR(ESC "OM") , "@8x"}, // enter/send key - { fc::Fkey_exit , 0 , "@9" }, // exit key - { fc::Fkey_find , C_STR(CSI "1~") , "@0" }, // find key - { fc::Fkey_slash , C_STR(ESC "Oo") , "KP1"}, // keypad slash - { fc::Fkey_asterisk , C_STR(ESC "Oj") , "KP2"}, // keypad asterisk - { fc::Fkey_minus_sign, C_STR(ESC "Om") , "KP3"}, // keypad minus sign - { fc::Fkey_plus_sign , C_STR(ESC "Ok") , "KP4"}, // keypad plus sign - { fc::Fkey_help , 0 , "%1" }, // help key - { fc::Fkey_mark , 0 , "%2" }, // mark key - { fc::Fkey_message , 0 , "%3" }, // message key - { fc::Fkey_move , 0 , "%4" }, // move key - { fc::Fkey_next , 0 , "%5" }, // next key - { fc::Fkey_open , 0 , "%6" }, // open key - { fc::Fkey_options , 0 , "%7" }, // options key - { fc::Fkey_previous , 0 , "%8" }, // previous key - { fc::Fkey_print , 0 , "%9" }, // print key - { fc::Fkey_redo , 0 , "%0" }, // redo key - { fc::Fkey_reference , 0 , "&1" }, // reference key - { fc::Fkey_refresh , 0 , "&2" }, // refresh key - { fc::Fkey_replace , 0 , "&3" }, // replace key - { fc::Fkey_restart , 0 , "&4" }, // restart key - { fc::Fkey_resume , 0 , "&5" }, // resume key - { fc::Fkey_save , 0 , "&6" }, // save key - { fc::Fkey_suspend , 0 , "&7" }, // suspend key - { fc::Fkey_undo , 0 , "&8" }, // undo key - { fc::Fkey_sbeg , 0 , "&9" }, // shifted begin key - { fc::Fkey_scancel , 0 , "&0" }, // shifted cancel key - { fc::Fkey_scommand , 0 , "*1" }, // shifted command key - { fc::Fkey_scopy , 0 , "*2" }, // shifted copy key - { fc::Fkey_screate , 0 , "*3" }, // shifted create key - { fc::Fkey_sdc , C_STR(CSI "3;2~") , "*4" }, // shifted delete-character key - { fc::Fkey_sdl , 0 , "*5" }, // shifted delete-line key - { fc::Fkey_select , C_STR(CSI "4~") , "*6" }, // select key - { fc::Fkey_send , C_STR(CSI "1;2F") , "*7" }, // shifted end key - { fc::Fkey_seol , 0 , "*8" }, // shifted clear-to-end-of-line key - { fc::Fkey_sexit , 0 , "*9" }, // shifted exit key - { fc::Fkey_sfind , 0 , "*0" }, // shifted find key - { fc::Fkey_shelp , 0 , "#1" }, // shifted help key - { fc::Fkey_shome , C_STR(CSI "1;2H") , "#2" }, // shifted home key - { fc::Fkey_sic , C_STR(CSI "2;2~") , "#3" }, // shifted insert-character key - { fc::Fkey_sleft , C_STR(CSI "1;2D") , "#4" }, // shifted left-arrow key - { fc::Fkey_smessage , 0 , "%a" }, // shifted message key - { fc::Fkey_smove , 0 , "%b" }, // shifted move key - { fc::Fkey_snext , C_STR(CSI "6;2~") , "%c" }, // shifted next key - { fc::Fkey_soptions , 0 , "%d" }, // shifted options key - { fc::Fkey_sprevious , C_STR(CSI "5;2~") , "%e" }, // shifted previous key - { fc::Fkey_sprint , 0 , "%f" }, // shifted print key - { fc::Fkey_sredo , 0 , "%g" }, // shifted redo key - { fc::Fkey_sreplace , 0 , "%h" }, // shifted replace key - { fc::Fkey_sright , C_STR(CSI "1;2C") , "%i" }, // shifted right-arrow key - { fc::Fkey_srsume , 0 , "%j" }, // shifted resume key - { fc::Fkey_ssave , 0 , "!1" }, // shifted save key - { fc::Fkey_ssuspend , 0 , "!2" }, // shifted suspend key - { fc::Fkey_sundo , 0 , "!3" }, // shifted undo key - { fc::Fkey_f11 , C_STR(CSI "23~") , "F1" }, // F11 function key - { fc::Fkey_f12 , C_STR(CSI "24~") , "F2" }, // F12 function key - { fc::Fkey_f13 , C_STR(ESC "O1;2P"), "F3" }, // F13 function key - { fc::Fkey_f14 , C_STR(ESC "O1;2Q"), "F4" }, // F14 function key - { fc::Fkey_f15 , C_STR(ESC "O1;2R"), "F5" }, // F15 function key - { fc::Fkey_f16 , C_STR(ESC "O1;2S"), "F6" }, // F16 function key - { fc::Fkey_f17 , C_STR(CSI "15;2~"), "F7" }, // F17 function key - { fc::Fkey_f18 , C_STR(CSI "17;2~"), "F8" }, // F18 function key - { fc::Fkey_f19 , C_STR(CSI "18;2~"), "F9" }, // F19 function key - { fc::Fkey_f20 , C_STR(CSI "19;2~"), "FA" }, // F20 function key - { fc::Fkey_f21 , C_STR(CSI "20;2~"), "FB" }, // F21 function key - { fc::Fkey_f22 , C_STR(CSI "21;2~"), "FC" }, // F22 function key - { fc::Fkey_f23 , C_STR(CSI "23;2~"), "FD" }, // F23 function key - { fc::Fkey_f24 , C_STR(CSI "24;2~"), "FE" }, // F24 function key - { fc::Fkey_f25 , C_STR(ESC "O1;5P"), "FF" }, // F25 function key - { fc::Fkey_f26 , C_STR(ESC "O1;5Q"), "FG" }, // F26 function key - { fc::Fkey_f27 , C_STR(ESC "O1;5R"), "FH" }, // F27 function key - { fc::Fkey_f28 , C_STR(ESC "O1;5S"), "FI" }, // F28 function key - { fc::Fkey_f29 , C_STR(CSI "15;5~"), "FJ" }, // F29 function key - { fc::Fkey_f30 , C_STR(CSI "17;5~"), "FK" }, // F30 function key - { fc::Fkey_f31 , C_STR(CSI "18;5~"), "FL" }, // F31 function key - { fc::Fkey_f32 , C_STR(CSI "19;5~"), "FM" }, // F32 function key - { fc::Fkey_f33 , C_STR(CSI "20;5~"), "FN" }, // F33 function key - { fc::Fkey_f34 , C_STR(CSI "21;5~"), "FO" }, // F34 function key - { fc::Fkey_f35 , C_STR(CSI "23;5~"), "FP" }, // F35 function key - { fc::Fkey_f36 , C_STR(CSI "24;5~"), "FQ" }, // F36 function key - { fc::Fkey_f37 , C_STR(ESC "O1;6P"), "FR" }, // F37 function key - { fc::Fkey_f38 , C_STR(ESC "O1;6Q"), "FS" }, // F38 function key - { fc::Fkey_f39 , C_STR(ESC "O1;6R"), "FT" }, // F39 function key - { fc::Fkey_f40 , C_STR(ESC "O1;6S"), "FU" }, // F40 function key - { fc::Fkey_f41 , C_STR(CSI "15;6~"), "FV" }, // F41 function key - { fc::Fkey_f42 , C_STR(CSI "17;6~"), "FW" }, // F42 function key - { fc::Fkey_f43 , C_STR(CSI "18;6~"), "FX" }, // F43 function key - { fc::Fkey_f44 , C_STR(CSI "19;6~"), "FY" }, // F44 function key - { fc::Fkey_f45 , C_STR(CSI "20;6~"), "FZ" }, // F45 function key - { fc::Fkey_f46 , C_STR(CSI "21;6~"), "Fa" }, // F46 function key - { fc::Fkey_f47 , C_STR(CSI "23;6~"), "Fb" }, // F47 function key - { fc::Fkey_f48 , C_STR(CSI "24;6~"), "Fc" }, // F48 function key - { fc::Fkey_f49 , C_STR(ESC "O1;3P"), "Fd" }, // F49 function key - { fc::Fkey_f50 , C_STR(ESC "O1;3Q"), "Fe" }, // F50 function key - { fc::Fkey_f51 , C_STR(ESC "O1;3R"), "Ff" }, // F51 function key - { fc::Fkey_f52 , C_STR(ESC "O1;3S"), "Fg" }, // F52 function key - { fc::Fkey_f53 , C_STR(CSI "15;3~"), "Fh" }, // F53 function key - { fc::Fkey_f54 , C_STR(CSI "17;3~"), "Fi" }, // F54 function key - { fc::Fkey_f55 , C_STR(CSI "18;3~"), "Fj" }, // F55 function key - { fc::Fkey_f56 , C_STR(CSI "19;3~"), "Fk" }, // F56 function key - { fc::Fkey_f57 , C_STR(CSI "20;3~"), "Fl" }, // F57 function key - { fc::Fkey_f58 , C_STR(CSI "21;3~"), "Fm" }, // F58 function key - { fc::Fkey_f59 , C_STR(CSI "23;3~"), "Fn" }, // F59 function key - { fc::Fkey_f60 , C_STR(CSI "24;3~"), "Fo" }, // F60 function key - { fc::Fkey_f61 , C_STR(ESC "O1;4P"), "Fp" }, // F61 function key - { fc::Fkey_f62 , C_STR(ESC "O1;4Q"), "Fq" }, // F62 function key - { fc::Fkey_f63 , C_STR(ESC "O1;4R"), "Fr" }, // F63 function key + { finalcut::fc::Fkey_backspace , C_STR("\177") , "kb" }, // backspace key + { finalcut::fc::Fkey_catab , 0 , "ka" }, // clear-all-tabs key + { finalcut::fc::Fkey_clear , 0 , "kC" }, // clear-screen or erase key + { finalcut::fc::Fkey_ctab , C_STR(CSI "3~") , "kt" }, // clear-tab key + { finalcut::fc::Fkey_dc , 0 , "kD" }, // delete-character key + { finalcut::fc::Fkey_dl , 0 , "kL" }, // delete-line key + { finalcut::fc::Fkey_down , C_STR(ESC "OB") , "kd" }, // down-arrow key + { finalcut::fc::Fkey_down , C_STR(CSI "B") , "kdx"}, // down-arrow key + { finalcut::fc::Fkey_eic , 0 , "kM" }, // sent by rmir or smir in insert mode + { finalcut::fc::Fkey_eol , 0 , "kE" }, // clear-to-end-of-line key + { finalcut::fc::Fkey_eos , 0 , "kS" }, // clear-to-end-of-screen key + { finalcut::fc::Fkey_f0 , 0 , "k0" }, // F0 function key + { finalcut::fc::Fkey_f1 , C_STR(ESC "OP") , "k1" }, // F1 function key + { finalcut::fc::Fkey_f1 , C_STR(CSI "11~") , "k1x"}, // F1 function key + { finalcut::fc::Fkey_f1 , C_STR(ESC "OP") , "k1X"}, // F1 function key + { finalcut::fc::Fkey_f2 , C_STR(ESC "OQ") , "k2" }, // F2 function key + { finalcut::fc::Fkey_f2 , C_STR(CSI "12~") , "k2x"}, // F2 function key + { finalcut::fc::Fkey_f2 , C_STR(CSI "OQ") , "k2X"}, // F2 function key + { finalcut::fc::Fkey_f3 , C_STR(ESC "OR") , "k3" }, // F3 function key + { finalcut::fc::Fkey_f3 , C_STR(CSI "13~") , "k3x"}, // F3 function key + { finalcut::fc::Fkey_f3 , C_STR(ESC "OR") , "k3X"}, // F3 function key + { finalcut::fc::Fkey_f4 , C_STR(ESC "OS") , "k4" }, // F4 function key + { finalcut::fc::Fkey_f4 , C_STR(CSI "14~") , "k4x"}, // F4 function key + { finalcut::fc::Fkey_f4 , C_STR(ESC "OS") , "k4X"}, // F4 function key + { finalcut::fc::Fkey_f5 , C_STR(CSI "15~") , "k5" }, // F5 function key + { finalcut::fc::Fkey_f6 , C_STR(CSI "17~") , "k6" }, // F6 function key + { finalcut::fc::Fkey_f7 , C_STR(CSI "18~") , "k7" }, // F7 function key + { finalcut::fc::Fkey_f8 , C_STR(CSI "19~") , "k8" }, // F8 fucntion key + { finalcut::fc::Fkey_f9 , C_STR(CSI "20~") , "k9" }, // F9 function key + { finalcut::fc::Fkey_f10 , C_STR(CSI "21~") , "k;" }, // F10 function key + { finalcut::fc::Fkey_home , C_STR(ESC "OH") , "kh" }, // home key + { finalcut::fc::Fkey_home , C_STR(CSI "7~") , "khx"}, // home key + { finalcut::fc::Fkey_ic , C_STR(CSI "2~") , "kI" }, // insert-character key + { finalcut::fc::Fkey_il , 0 , "kA" }, // insert-line key + { finalcut::fc::Fkey_left , C_STR(ESC "OD") , "kl" }, // left-arrow key + { finalcut::fc::Fkey_left , C_STR(CSI "D") , "klx"}, // left-arrow key + { finalcut::fc::Fkey_ll , 0 , "kH" }, // last-line key + { finalcut::fc::Fkey_npage , C_STR(CSI "6~") , "kN" }, // next-page key + { finalcut::fc::Fkey_ppage , C_STR(CSI "5~") , "kP" }, // prev-page key + { finalcut::fc::Fkey_right , C_STR(ESC "OC") , "kr" }, // right-arrow key + { finalcut::fc::Fkey_right , C_STR(CSI "C") , "krx"}, // right-arrow key + { finalcut::fc::Fkey_sf , C_STR(CSI "1;2B") , "kF" }, // scroll-forward key (shift-up) + { finalcut::fc::Fkey_sr , C_STR(CSI "1;2A") , "kR" }, // scroll-backward key (shift-down) + { finalcut::fc::Fkey_stab , 0 , "kT" }, // set-tab key + { finalcut::fc::Fkey_up , C_STR(ESC "OA") , "ku" }, // up-arrow key + { finalcut::fc::Fkey_up , C_STR(CSI "A") , "kux"}, // up-arrow key + { finalcut::fc::Fkey_a1 , 0 , "K1" }, // upper left of keypad + { finalcut::fc::Fkey_a3 , 0 , "K3" }, // upper right of keypad + { finalcut::fc::Fkey_b2 , C_STR(CSI "E") , "K2" }, // center of keypad + { finalcut::fc::Fkey_c1 , 0 , "K4" }, // lower left of keypad + { finalcut::fc::Fkey_c3 , 0 , "K5" }, // lower right of keypad + { finalcut::fc::Fkey_btab , C_STR(CSI "Z") , "kB" }, // back-tab key + { finalcut::fc::Fkey_beg , 0 , "@1" }, // begin key + { finalcut::fc::Fkey_cancel , 0 , "@2" }, // cancel key + { finalcut::fc::Fkey_close , 0 , "@3" }, // close key + { finalcut::fc::Fkey_command , 0 , "@4" }, // command key + { finalcut::fc::Fkey_copy , 0 , "@5" }, // copy key + { finalcut::fc::Fkey_create , 0 , "@6" }, // create key + { finalcut::fc::Fkey_end , C_STR(ESC "OF") , "@7" }, // end key + { finalcut::fc::Fkey_end , C_STR(CSI "8~") , "@7x"}, // end key + { finalcut::fc::Fkey_end , C_STR(CSI "K") , "@7X"}, // end key + { finalcut::fc::Fkey_enter , 0 , "@8" }, // enter/send key + { finalcut::fc::Fkey_enter , C_STR(ESC "OM") , "@8x"}, // enter/send key + { finalcut::fc::Fkey_exit , 0 , "@9" }, // exit key + { finalcut::fc::Fkey_find , C_STR(CSI "1~") , "@0" }, // find key + { finalcut::fc::Fkey_slash , C_STR(ESC "Oo") , "KP1"}, // keypad slash + { finalcut::fc::Fkey_asterisk , C_STR(ESC "Oj") , "KP2"}, // keypad asterisk + { finalcut::fc::Fkey_minus_sign, C_STR(ESC "Om") , "KP3"}, // keypad minus sign + { finalcut::fc::Fkey_plus_sign , C_STR(ESC "Ok") , "KP4"}, // keypad plus sign + { finalcut::fc::Fkey_help , 0 , "%1" }, // help key + { finalcut::fc::Fkey_mark , 0 , "%2" }, // mark key + { finalcut::fc::Fkey_message , 0 , "%3" }, // message key + { finalcut::fc::Fkey_move , 0 , "%4" }, // move key + { finalcut::fc::Fkey_next , 0 , "%5" }, // next key + { finalcut::fc::Fkey_open , 0 , "%6" }, // open key + { finalcut::fc::Fkey_options , 0 , "%7" }, // options key + { finalcut::fc::Fkey_previous , 0 , "%8" }, // previous key + { finalcut::fc::Fkey_print , 0 , "%9" }, // print key + { finalcut::fc::Fkey_redo , 0 , "%0" }, // redo key + { finalcut::fc::Fkey_reference , 0 , "&1" }, // reference key + { finalcut::fc::Fkey_refresh , 0 , "&2" }, // refresh key + { finalcut::fc::Fkey_replace , 0 , "&3" }, // replace key + { finalcut::fc::Fkey_restart , 0 , "&4" }, // restart key + { finalcut::fc::Fkey_resume , 0 , "&5" }, // resume key + { finalcut::fc::Fkey_save , 0 , "&6" }, // save key + { finalcut::fc::Fkey_suspend , 0 , "&7" }, // suspend key + { finalcut::fc::Fkey_undo , 0 , "&8" }, // undo key + { finalcut::fc::Fkey_sbeg , 0 , "&9" }, // shifted begin key + { finalcut::fc::Fkey_scancel , 0 , "&0" }, // shifted cancel key + { finalcut::fc::Fkey_scommand , 0 , "*1" }, // shifted command key + { finalcut::fc::Fkey_scopy , 0 , "*2" }, // shifted copy key + { finalcut::fc::Fkey_screate , 0 , "*3" }, // shifted create key + { finalcut::fc::Fkey_sdc , C_STR(CSI "3;2~") , "*4" }, // shifted delete-character key + { finalcut::fc::Fkey_sdl , 0 , "*5" }, // shifted delete-line key + { finalcut::fc::Fkey_select , C_STR(CSI "4~") , "*6" }, // select key + { finalcut::fc::Fkey_send , C_STR(CSI "1;2F") , "*7" }, // shifted end key + { finalcut::fc::Fkey_seol , 0 , "*8" }, // shifted clear-to-end-of-line key + { finalcut::fc::Fkey_sexit , 0 , "*9" }, // shifted exit key + { finalcut::fc::Fkey_sfind , 0 , "*0" }, // shifted find key + { finalcut::fc::Fkey_shelp , 0 , "#1" }, // shifted help key + { finalcut::fc::Fkey_shome , C_STR(CSI "1;2H") , "#2" }, // shifted home key + { finalcut::fc::Fkey_sic , C_STR(CSI "2;2~") , "#3" }, // shifted insert-character key + { finalcut::fc::Fkey_sleft , C_STR(CSI "1;2D") , "#4" }, // shifted left-arrow key + { finalcut::fc::Fkey_smessage , 0 , "%a" }, // shifted message key + { finalcut::fc::Fkey_smove , 0 , "%b" }, // shifted move key + { finalcut::fc::Fkey_snext , C_STR(CSI "6;2~") , "%c" }, // shifted next key + { finalcut::fc::Fkey_soptions , 0 , "%d" }, // shifted options key + { finalcut::fc::Fkey_sprevious , C_STR(CSI "5;2~") , "%e" }, // shifted previous key + { finalcut::fc::Fkey_sprint , 0 , "%f" }, // shifted print key + { finalcut::fc::Fkey_sredo , 0 , "%g" }, // shifted redo key + { finalcut::fc::Fkey_sreplace , 0 , "%h" }, // shifted replace key + { finalcut::fc::Fkey_sright , C_STR(CSI "1;2C") , "%i" }, // shifted right-arrow key + { finalcut::fc::Fkey_srsume , 0 , "%j" }, // shifted resume key + { finalcut::fc::Fkey_ssave , 0 , "!1" }, // shifted save key + { finalcut::fc::Fkey_ssuspend , 0 , "!2" }, // shifted suspend key + { finalcut::fc::Fkey_sundo , 0 , "!3" }, // shifted undo key + { finalcut::fc::Fkey_f11 , C_STR(CSI "23~") , "F1" }, // F11 function key + { finalcut::fc::Fkey_f12 , C_STR(CSI "24~") , "F2" }, // F12 function key + { finalcut::fc::Fkey_f13 , C_STR(ESC "O1;2P"), "F3" }, // F13 function key + { finalcut::fc::Fkey_f14 , C_STR(ESC "O1;2Q"), "F4" }, // F14 function key + { finalcut::fc::Fkey_f15 , C_STR(ESC "O1;2R"), "F5" }, // F15 function key + { finalcut::fc::Fkey_f16 , C_STR(ESC "O1;2S"), "F6" }, // F16 function key + { finalcut::fc::Fkey_f17 , C_STR(CSI "15;2~"), "F7" }, // F17 function key + { finalcut::fc::Fkey_f18 , C_STR(CSI "17;2~"), "F8" }, // F18 function key + { finalcut::fc::Fkey_f19 , C_STR(CSI "18;2~"), "F9" }, // F19 function key + { finalcut::fc::Fkey_f20 , C_STR(CSI "19;2~"), "FA" }, // F20 function key + { finalcut::fc::Fkey_f21 , C_STR(CSI "20;2~"), "FB" }, // F21 function key + { finalcut::fc::Fkey_f22 , C_STR(CSI "21;2~"), "FC" }, // F22 function key + { finalcut::fc::Fkey_f23 , C_STR(CSI "23;2~"), "FD" }, // F23 function key + { finalcut::fc::Fkey_f24 , C_STR(CSI "24;2~"), "FE" }, // F24 function key + { finalcut::fc::Fkey_f25 , C_STR(ESC "O1;5P"), "FF" }, // F25 function key + { finalcut::fc::Fkey_f26 , C_STR(ESC "O1;5Q"), "FG" }, // F26 function key + { finalcut::fc::Fkey_f27 , C_STR(ESC "O1;5R"), "FH" }, // F27 function key + { finalcut::fc::Fkey_f28 , C_STR(ESC "O1;5S"), "FI" }, // F28 function key + { finalcut::fc::Fkey_f29 , C_STR(CSI "15;5~"), "FJ" }, // F29 function key + { finalcut::fc::Fkey_f30 , C_STR(CSI "17;5~"), "FK" }, // F30 function key + { finalcut::fc::Fkey_f31 , C_STR(CSI "18;5~"), "FL" }, // F31 function key + { finalcut::fc::Fkey_f32 , C_STR(CSI "19;5~"), "FM" }, // F32 function key + { finalcut::fc::Fkey_f33 , C_STR(CSI "20;5~"), "FN" }, // F33 function key + { finalcut::fc::Fkey_f34 , C_STR(CSI "21;5~"), "FO" }, // F34 function key + { finalcut::fc::Fkey_f35 , C_STR(CSI "23;5~"), "FP" }, // F35 function key + { finalcut::fc::Fkey_f36 , C_STR(CSI "24;5~"), "FQ" }, // F36 function key + { finalcut::fc::Fkey_f37 , C_STR(ESC "O1;6P"), "FR" }, // F37 function key + { finalcut::fc::Fkey_f38 , C_STR(ESC "O1;6Q"), "FS" }, // F38 function key + { finalcut::fc::Fkey_f39 , C_STR(ESC "O1;6R"), "FT" }, // F39 function key + { finalcut::fc::Fkey_f40 , C_STR(ESC "O1;6S"), "FU" }, // F40 function key + { finalcut::fc::Fkey_f41 , C_STR(CSI "15;6~"), "FV" }, // F41 function key + { finalcut::fc::Fkey_f42 , C_STR(CSI "17;6~"), "FW" }, // F42 function key + { finalcut::fc::Fkey_f43 , C_STR(CSI "18;6~"), "FX" }, // F43 function key + { finalcut::fc::Fkey_f44 , C_STR(CSI "19;6~"), "FY" }, // F44 function key + { finalcut::fc::Fkey_f45 , C_STR(CSI "20;6~"), "FZ" }, // F45 function key + { finalcut::fc::Fkey_f46 , C_STR(CSI "21;6~"), "Fa" }, // F46 function key + { finalcut::fc::Fkey_f47 , C_STR(CSI "23;6~"), "Fb" }, // F47 function key + { finalcut::fc::Fkey_f48 , C_STR(CSI "24;6~"), "Fc" }, // F48 function key + { finalcut::fc::Fkey_f49 , C_STR(ESC "O1;3P"), "Fd" }, // F49 function key + { finalcut::fc::Fkey_f50 , C_STR(ESC "O1;3Q"), "Fe" }, // F50 function key + { finalcut::fc::Fkey_f51 , C_STR(ESC "O1;3R"), "Ff" }, // F51 function key + { finalcut::fc::Fkey_f52 , C_STR(ESC "O1;3S"), "Fg" }, // F52 function key + { finalcut::fc::Fkey_f53 , C_STR(CSI "15;3~"), "Fh" }, // F53 function key + { finalcut::fc::Fkey_f54 , C_STR(CSI "17;3~"), "Fi" }, // F54 function key + { finalcut::fc::Fkey_f55 , C_STR(CSI "18;3~"), "Fj" }, // F55 function key + { finalcut::fc::Fkey_f56 , C_STR(CSI "19;3~"), "Fk" }, // F56 function key + { finalcut::fc::Fkey_f57 , C_STR(CSI "20;3~"), "Fl" }, // F57 function key + { finalcut::fc::Fkey_f58 , C_STR(CSI "21;3~"), "Fm" }, // F58 function key + { finalcut::fc::Fkey_f59 , C_STR(CSI "23;3~"), "Fn" }, // F59 function key + { finalcut::fc::Fkey_f60 , C_STR(CSI "24;3~"), "Fo" }, // F60 function key + { finalcut::fc::Fkey_f61 , C_STR(ESC "O1;4P"), "Fp" }, // F61 function key + { finalcut::fc::Fkey_f62 , C_STR(ESC "O1;4Q"), "Fq" }, // F62 function key + { finalcut::fc::Fkey_f63 , C_STR(ESC "O1;4R"), "Fr" }, // F63 function key { 0 , 0 , "\0" } }; @@ -278,7 +278,7 @@ class FKeyboardTest : public CPPUNIT_NS::TestFixture int key_pressed; int key_released; int number_of_keys; - FKeyboard* keyboard; + finalcut::FKeyboard* keyboard; }; #pragma pack(pop) @@ -301,7 +301,7 @@ FKeyboardTest::~FKeyboardTest() //---------------------------------------------------------------------- void FKeyboardTest::classNameTest() { - FKeyboard k; + finalcut::FKeyboard k; const char* const classname = k.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname, "FKeyboard") == 0 ); } @@ -350,7 +350,7 @@ void FKeyboardTest::escapeKeyTest() input("\033O["); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_escape_mintty ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_escape_mintty ); clear(); // Normal escape (needs a timeout) @@ -359,7 +359,7 @@ void FKeyboardTest::escapeKeyTest() usleep(100000); keyboard->escapeKeyHandling(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_escape ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_escape ); keyboard->clearKeyBufferOnTimeout(); clear(); } @@ -378,7 +378,7 @@ void FKeyboardTest::characterwiseInputTest() processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; CPPUNIT_ASSERT ( number_of_keys == 1 ); - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_down ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_down ); clear(); } @@ -402,8 +402,8 @@ void FKeyboardTest::severalKeysTest() processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; CPPUNIT_ASSERT ( number_of_keys == 3 ); - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f3 ); - CPPUNIT_ASSERT ( key_released == fc::Fkey_f3 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f3 ); + CPPUNIT_ASSERT ( key_released == finalcut::fc::Fkey_f3 ); clear(); } @@ -414,469 +414,469 @@ void FKeyboardTest::functionKeyTest() input("\033[2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_ic ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_ic ); clear(); // Function key F1 input("\033[11~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f1 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f1 ); clear(); // Function key F2 (numeric keypad PF2) input("\033OQ"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f2 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f2 ); clear(); // Function key F2 input("\033[12~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f2 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f2 ); clear(); // Function key F3 (numeric keypad PF3) input("\033OR"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f3 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f3 ); clear(); // Function key F3 input("\033[13~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f3 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f3 ); clear(); // Function key F4 (numeric keypad PF3) input("\033OS"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f4 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f4 ); clear(); // Function key F4 input("\033[14~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f4 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f4 ); clear(); // Function key F5 input("\033[15~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f5 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f5 ); clear(); // Function key F6 input("\033[17~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f6 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f6 ); clear(); // Function key F7 input("\033[18~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f7 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f7 ); clear(); // Function key F8 input("\033[19~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f8 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f8 ); clear(); // Function key F9 input("\033[20~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f9 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f9 ); clear(); // Function key F10 input("\033[21~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f10 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f10 ); clear(); // Function key F11 input("\033[23~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f11 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f11 ); clear(); // Function key F12 input("\033[24~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f12 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f12 ); clear(); // Function key F13 (shift + F1) input("\033O1;2P"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f13 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f13 ); clear(); // Function key F14 (shift + F2) input("\033O1;2Q"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f14 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f14 ); clear(); // Function key F15 (shift + F3) input("\033O1;2R"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f15 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f15 ); clear(); // Function key F16 (shift + F4) input("\033O1;2S"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f16 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f16 ); clear(); // Function key F17 (shift + F5) input("\033[15;2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f17 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f17 ); clear(); // Function key F18 (shift + F6) input("\033[17;2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f18 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f18 ); clear(); // Function key F19 (shift + F7) input("\033[18;2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f19 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f19 ); clear(); // Function key F20 (shift + F8) input("\033[19;2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f20 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f20 ); clear(); // Function key F21 (shift + F9) input("\033[20;2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f21 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f21 ); clear(); // Function key F22 (shift + F10) input("\033[21;2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f22 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f22 ); clear(); // Function key F23 (shift + F11) input("\033[23;2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f23 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f23 ); clear(); // Function key F24 (shift + F12) input("\033[24;2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f24 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f24 ); clear(); // Function key F25 (ctrl + F1) input("\033O1;5P"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f25 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f25 ); clear(); // Function key F26 (ctrl + F2) input("\033O1;5Q"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f26 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f26 ); clear(); // Function key F27 (ctrl + F3) input("\033O1;5R"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f27 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f27 ); clear(); // Function key F28 (ctrl + F4) input("\033O1;5S"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f28 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f28 ); clear(); // Function key F29 (ctrl + F5) input("\033[15;5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f29 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f29 ); clear(); // Function key F30 (ctrl + F6) input("\033[17;5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f30 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f30 ); clear(); // Function key F31 (ctrl + F7) input("\033[18;5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f31 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f31 ); clear(); // Function key F32 (ctrl + F8) input("\033[19;5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f32 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f32 ); clear(); // Function key F33 (ctrl + F9) input("\033[20;5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f33 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f33 ); clear(); // Function key F34 (ctrl + F10) input("\033[21;5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f34 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f34 ); clear(); // Function key F35 (ctrl + F11) input("\033[23;5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f35 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f35 ); clear(); // Function key F36 (ctrl + F12) input("\033[24;5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f36 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f36 ); clear(); // Function key F37 (shift + ctrl + F1) input("\033O1;6P"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f37 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f37 ); clear(); // Function key F38 (shift + ctrl + F2) input("\033O1;6Q"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f38 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f38 ); clear(); // Function key F39 (shift + ctrl + F3) input("\033O1;6R"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f39 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f39 ); clear(); // Function key F40 (shift + ctrl + F4) input("\033O1;6S"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f40 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f40 ); clear(); // Function key F41 (shift + ctrl + F5) input("\033[15;6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f41 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f41 ); clear(); // Function key F42 (shift + ctrl + F6) input("\033[17;6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f42 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f42 ); clear(); // Function key F43 (shift + ctrl + F7) input("\033[18;6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f43 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f43 ); clear(); // Function key F44 (shift + ctrl + F8) input("\033[19;6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f44 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f44 ); clear(); // Function key F45 (shift + ctrl + F9) input("\033[20;6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f45 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f45 ); clear(); // Function key F46 (shift + ctrl + F10) input("\033[21;6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f46 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f46 ); clear(); // Function key F47 (shift + ctrl + F11) input("\033[23;6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f47 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f47 ); clear(); // Function key F48 (shift + ctrl + F12) input("\033[24;6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f48 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f48 ); clear(); // Function key F49 (meta + F1) input("\033O1;3P"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f49 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f49 ); clear(); // Function key F50 (meta + F2) input("\033O1;3Q"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f50 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f50 ); clear(); // Function key F51 (meta + F3) input("\033O1;3R"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f51 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f51 ); clear(); // Function key F52 (meta + F4) input("\033O1;3S"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f52 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f52 ); clear(); // Function key F53 (meta + F5) input("\033[15;3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f53 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f53 ); clear(); // Function key F54 (meta + F6) input("\033[17;3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f54 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f54 ); clear(); // Function key F55 (meta + F7) input("\033[18;3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f55 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f55 ); clear(); // Function key F56 (meta + F8) input("\033[19;3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f56 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f56 ); clear(); // Function key F57 (meta + F9) input("\033[20;3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f57 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f57 ); clear(); // Function key F58 (meta + F10) input("\033[21;3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f58 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f58 ); clear(); // Function key F59 (meta + F11) input("\033[23;3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f59 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f59 ); clear(); // Function key F60 (meta + F12) input("\033[24;3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f60 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f60 ); clear(); // Function key F61 (shift + meta + F1) input("\033O1;4P"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f61 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f61 ); clear(); // Function key F62 (shift + meta + F2) input("\033O1;4Q"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f62 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f62 ); clear(); // Function key F63 (shift + meta + F3) input("\033O1;4R"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_f63 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_f63 ); clear(); } @@ -889,1197 +889,1197 @@ void FKeyboardTest::metaKeyTest() input("\033[2;3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_ic ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_ic ); clear(); // meta-insert input("\033\033[2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_ic ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_ic ); clear(); // meta-delete input("\033[3;3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_dc ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_dc ); clear(); // meta-delete input("\033\033[3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_dc ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_dc ); clear(); // meta-home input("\033[1;3H"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_home ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_home ); clear(); // meta-home input("\033\033[1~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_home ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_home ); clear(); // meta-end input("\033[1;3F"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_end ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_end ); clear(); // meta-end input("\033\033[4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_end ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_end ); clear(); // meta-prev-page input("\033[5;3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_ppage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_ppage ); clear(); // meta-prev-page input("\033\033[5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_ppage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_ppage ); clear(); // meta-next-page input("\033[6;3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_npage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_npage ); clear(); // meta-next-page input("\033\033[6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_npage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_npage ); clear(); // meta-f1 input("\033[1;3P"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f1 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f1 ); clear(); // meta-f1 input("\033\033[11~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f1 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f1 ); clear(); // meta-f2 input("\033[1;3Q"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f2 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f2 ); clear(); // meta-f2 input("\033\033[12~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f2 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f2 ); clear(); // meta-f3 input("\033[1;3R"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f3 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f3 ); clear(); // meta-f3 input("\033\033[13~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f3 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f3 ); clear(); // meta-f4 input("\033[1;3S"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f4 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f4 ); clear(); // meta-f4 input("\033\033[14~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f4 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f4 ); clear(); // meta-f5 input("\033\033[15~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f5 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f5 ); clear(); // meta-f6 input("\033\033[17~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f6 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f6 ); clear(); // meta-f7 input("\033\033[18~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f7 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f7 ); clear(); // meta-f8 input("\033\033[19~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f8 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f8 ); clear(); // meta-f9 input("\033\033[20~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f9 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f9 ); clear(); // meta-f10 input("\033\033[21~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f10 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f10 ); clear(); // meta-f11 input("\033\033[23~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f11 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f11 ); clear(); // meta-f12 input("\033\033[24~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f12 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f12 ); clear(); // meta-up input("\033[1;3A"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_up ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_up ); clear(); // meta-up input("\033\033[A"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_up ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_up ); clear(); // meta-down input("\033[1;3B"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_down ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_down ); clear(); // meta-down input("\033\033[B"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_down ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_down ); clear(); // meta-right input("\033[1;3C"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_right ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_right ); clear(); // meta-right input("\033\033[C"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_right ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_right ); clear(); // meta-left input("\033[1;3D"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_left ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_left ); clear(); // meta-left input("\033\033[D"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_left ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_left ); clear(); // shift-meta-insert input("\033[2;4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sic ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sic ); clear(); // shift-meta-delete input("\033[3;4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sdc ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sdc ); clear(); // shift-meta-home input("\033[1;4H"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_shome ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_shome ); clear(); // shift-meta-end input("\033[1;4F"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_send ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_send ); clear(); // shift-meta-prev-page input("\033[5;4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sppage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sppage ); clear(); // shift-meta-next-page input("\033[6;4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_snpage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_snpage ); clear(); // shift-meta-f1 input("\033[1;4P"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sf1 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf1 ); clear(); // shift-meta-f2 input("\033[1;4Q"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sf2 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf2 ); clear(); // shift-meta-f3 input("\033[1;4R"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sf3 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf3 ); clear(); // shift-meta-f4 input("\033[1;4S"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sf4 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf4 ); clear(); // shift-meta-f5 input("\033[15;4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sf5 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf5 ); clear(); // shift-meta-f6 input("\033[17;4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sf6 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf6 ); clear(); // shift-meta-f7 input("\033[18;4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sf7 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf7 ); clear(); // shift-meta-f8 input("\033[19;4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sf8 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf8 ); clear(); // shift-meta-f9 input("\033[20;4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sf9 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf9 ); clear(); // shift-meta-f10 input("\033[21;4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sf10 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf10 ); clear(); // shift-meta-f11 input("\033[23;4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sf11 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf11 ); clear(); // shift-meta-f12 input("\033[24;4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sf12 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sf12 ); clear(); // shift-meta-up input("\033[1;4A"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sup ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sup ); clear(); // shift-meta-down input("\033[1;4B"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sdown ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sdown ); clear(); // shift-meta-right input("\033[1;4C"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sright ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sright ); clear(); // shift-meta-left input("\033[1;4D"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_sleft ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_sleft ); clear(); // ctrl-insert input("\033[2;5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_ic ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_ic ); clear(); // ctrl-delete input("\033[3;5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_dc ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_dc ); clear(); // ctrl-home input("\033[1;5H"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_home ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_home ); clear(); // ctrl-end input("\033[1;5F"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_end ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_end ); clear(); // ctrl-prev-page input("\033[5;5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_ppage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_ppage ); clear(); // ctrl-next-page input("\033[6;5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_npage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_npage ); clear(); // ctrl-up input("\033[1;5A"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_up ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_up ); clear(); // ctrl-down input("\033[1;5B"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_down ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_down ); clear(); // ctrl-right input("\033[1;5C"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_right ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_right ); clear(); // ctrl-left input("\033[1;5D"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_left ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_left ); clear(); // shift-ctrl-meta-insert input("\033[2;6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_sic ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_sic ); clear(); // shift-ctrl-meta-delete input("\033[3;6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_sdc ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_sdc ); clear(); // shift-ctrl-meta-home input("\033[1;6H"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_shome ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_shome ); clear(); // shift-ctrl-meta-end input("\033[1;6F"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_send ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_send ); clear(); // shift-ctrl-meta-prev-page input("\033[5;6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_sppage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_sppage ); clear(); // shift-ctrl-meta-next-page input("\033[6;6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_snpage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_snpage ); clear(); // shift-ctrl-meta-up input("\033[1;6A"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_sup ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_sup ); clear(); // shift-ctrl-meta-down input("\033[1;6B"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_sdown ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_sdown ); clear(); // shift-ctrl-meta-right input("\033[1;6C"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_sright ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_sright ); clear(); // shift-ctrl-meta-left input("\033[1;6D"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_sleft ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_sleft ); clear(); // ctrl-meta-insert input("\033[2;7~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_ic ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_ic ); clear(); // ctrl-meta-delete input("\033[3;7~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_dc ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_dc ); clear(); // ctrl-meta-home input("\033[1;7H"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_home ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_home ); clear(); // ctrl-meta-end input("\033[1;7F"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_end ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_end ); clear(); // ctrl-meta-prev-page input("\033[5;7~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_ppage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_ppage ); clear(); // ctrl-meta-next-page input("\033[6;7~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_npage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_npage ); clear(); // ctrl-meta-up input("\033[1;7A"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_up ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_up ); clear(); // ctrl-meta-down input("\033[1;7B"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_down ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_down ); clear(); // ctrl-meta-right input("\033[1;7C"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_right ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_right ); clear(); // ctrl-meta-left input("\033[1;7D"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_left ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_left ); clear(); // shift-ctrl-meta-insert input("\033[2;8~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sic ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sic ); clear(); // shift-ctrl-meta-delete input("\033[3;8~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sdc ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sdc ); clear(); // shift-ctrl-meta-home input("\033[1;8H"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_shome ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_shome ); clear(); // shift-ctrl-meta-end input("\033[1;8F"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_send ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_send ); clear(); // shift-ctrl-meta-prev-page input("\033[5;8~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sppage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sppage ); clear(); // shift-ctrl-meta-next-page input("\033[6;8~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_snpage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_snpage ); clear(); // shift-ctrl-meta-f1 input("\033[1;8P"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sf1 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf1 ); clear(); // shift-ctrl-meta-f2 input("\033[1;8Q"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sf2 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf2 ); clear(); // shift-ctrl-meta-f3 input("\033[1;8R"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sf3 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf3 ); clear(); // shift-ctrl-meta-f4 input("\033[1;8S"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sf4 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf4 ); clear(); // shift-ctrl-meta-f5 input("\033[15;8~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sf5 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf5 ); clear(); // shift-ctrl-meta-f6 input("\033[17;8~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sf6 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf6 ); clear(); // shift-ctrl-meta-f7 input("\033[18;8~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sf7 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf7 ); clear(); // shift-ctrl-meta-f8 input("\033[19;8~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sf8 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf8 ); clear(); // shift-ctrl-meta-f9 input("\033[20;8~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sf9 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf9 ); clear(); // shift-ctrl-meta-f10 input("\033[21;8~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sf10 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf10 ); clear(); // shift-ctrl-meta-f11 input("\033[23;8~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sf11 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf11 ); clear(); // shift-ctrl-meta-f12 input("\033[24;8~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sf12 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sf12 ); clear(); // shift-ctrl-meta-up input("\033[1;8A"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sup ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sup ); clear(); // shift-ctrl-meta-down input("\033[1;8B"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sdown ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sdown ); clear(); // shift-ctrl-meta-right input("\033[1;8C"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sright ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sright ); clear(); // shift-ctrl-meta-left input("\033[1;8D"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_sleft ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_sleft ); clear(); // menu input("\033[29~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_menu ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_menu ); clear(); // shift-menu input("\033[29$"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_smenu ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_smenu ); clear(); // shift-menu input("\033[29;2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_smenu ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_smenu ); clear(); // ctrl-menu input("\033[29^"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_menu ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_menu ); clear(); // ctrl-menu input("\033[29;5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_menu ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_menu ); clear(); // shift-ctrl-menu input("\033[29@"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_smenu ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_smenu ); clear(); // shift-ctrl-menu input("\033[29;6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fckey_smenu ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fckey_smenu ); clear(); // meta-menu input("\033[29;3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_menu ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_menu ); clear(); // shift-meta-menu input("\033[29;4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_smenu ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_smenu ); clear(); // ctrl-meta-menu input("\033[29;7~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_menu ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_menu ); clear(); // shift-ctrl-meta-menu input("\033[29;8~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fcmkey_smenu ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fcmkey_smenu ); clear(); // meta-tab input("\033\t"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_tab ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_tab ); clear(); // meta-enter input("\033\n"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_enter ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_enter ); clear(); // meta-enter input("\033\r"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_enter ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_enter ); clear(); // meta-' ' input("\033 "); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_space ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_space ); clear(); // meta-! input("\033!"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_bang ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_bang ); clear(); // meta-" input("\033\""); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_quotes ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_quotes ); clear(); // meta-# input("\033#"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_hash ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_hash ); clear(); // meta-$ input("\033$"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_dollar ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_dollar ); clear(); // meta-% input("\033%"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_percent ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_percent ); clear(); // meta-& input("\033&"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_ampersand ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_ampersand ); clear(); // meta-' input("\033'"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_apostrophe ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_apostrophe ); clear(); // meta-( input("\033("); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_left_parenthesis ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_left_parenthesis ); clear(); // meta-) input("\033)"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_right_parenthesis ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_right_parenthesis ); clear(); // meta-* input("\033*"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_asterisk ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_asterisk ); clear(); // meta-+ input("\033+"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_plus ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_plus ); clear(); // meta-, input("\033,"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_comma ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_comma ); clear(); // meta-'-' input("\033-"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_minus ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_minus ); clear(); // meta-. input("\033."); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_full_stop ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_full_stop ); clear(); // meta-/ input("\033/"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_slash ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_slash ); clear(); // meta-0 input("\0330"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_0 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_0 ); clear(); // meta-1 input("\0331"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_1 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_1 ); clear(); // meta-2 input("\0332"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_2 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_2 ); clear(); // meta-3 input("\0333"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_3 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_3 ); clear(); // meta-4 input("\0334"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_4 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_4 ); clear(); // meta-5 input("\0335"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_5 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_5 ); clear(); // meta-6 input("\0336"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_6 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_6 ); clear(); // meta-7 input("\0337"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_7 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_7 ); clear(); // meta-8 input("\0338"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_8 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_8 ); clear(); // meta-9 input("\0339"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_9 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_9 ); clear(); // meta-: input("\033:"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_colon ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_colon ); clear(); // meta-; input("\033;"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_semicolon ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_semicolon ); clear(); // meta-< input("\033<"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_less_than ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_less_than ); clear(); // meta-= input("\033="); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_equals ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_equals ); clear(); // meta-> input("\033>"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_greater_than ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_greater_than ); clear(); // meta-? input("\033?"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_question_mark ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_question_mark ); clear(); // meta-@ input("\033@"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_at ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_at ); clear(); // shifted meta-A input("\033A"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_A ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_A ); clear(); // shifted meta-B input("\033B"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_B ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_B ); clear(); // shifted meta-C input("\033C"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_C ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_C ); clear(); // shifted meta-D input("\033D"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_D ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_D ); clear(); // shifted meta-E input("\033E"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_E ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_E ); clear(); // shifted meta-F input("\033F"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_F ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_F ); clear(); // shifted meta-G input("\033G"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_G ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_G ); clear(); // shifted meta-H input("\033H"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_H ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_H ); clear(); // shifted meta-I input("\033I"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_I ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_I ); clear(); // shifted meta-J input("\033J"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_J ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_J ); clear(); // shifted meta-K input("\033K"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_K ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_K ); clear(); // shifted meta-L input("\033L"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_L ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_L ); clear(); // shifted meta-M input("\033M"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_M ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_M ); clear(); // shifted meta-N input("\033N"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_N ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_N ); clear(); // shifted meta-O @@ -2088,84 +2088,84 @@ void FKeyboardTest::metaKeyTest() usleep(100000); // Substring keys needs a timeout keyboard->escapeKeyHandling(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_O ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_O ); clear(); // shifted meta-P input("\033P"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_P ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_P ); clear(); // shifted meta-Q input("\033Q"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_Q ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_Q ); clear(); // shifted meta-R input("\033R"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_R ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_R ); clear(); // shifted meta-S input("\033S"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_S ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_S ); clear(); // shifted meta-T input("\033T"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_T ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_T ); clear(); // shifted meta-U input("\033U"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_U ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_U ); clear(); // shifted meta-V input("\033V"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_V ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_V ); clear(); // shifted meta-W input("\033W"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_W ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_W ); clear(); // shifted meta-X input("\033X"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_X ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_X ); clear(); // shifted meta-Y input("\033Y"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_Y ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_Y ); clear(); // shifted meta-Z input("\033Z"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_Z ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_Z ); clear(); // meta-[ @@ -2174,14 +2174,14 @@ void FKeyboardTest::metaKeyTest() usleep(100000); // Substring keys needs a timeout keyboard->escapeKeyHandling(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_left_square_bracket ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_left_square_bracket ); clear(); // meta-'\' input("\033\\"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_backslash ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_backslash ); clear(); // meta-] @@ -2190,238 +2190,238 @@ void FKeyboardTest::metaKeyTest() usleep(100000); // Substring keys needs a timeout keyboard->escapeKeyHandling(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_right_square_bracket ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_right_square_bracket ); clear(); // meta-^ input("\033^"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_caret ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_caret ); clear(); // meta-_ input("\033_"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_underscore ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_underscore ); clear(); // meta-` input("\033`"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_grave_accent ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_grave_accent ); clear(); // meta-a input("\033a"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_a ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_a ); clear(); // meta-b input("\033b"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_b ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_b ); clear(); // meta-c input("\033c"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_c ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_c ); clear(); // meta-d input("\033d"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_d ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_d ); clear(); // meta-e input("\033e"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_e ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_e ); clear(); // meta-f input("\033f"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_f ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_f ); clear(); // meta-g input("\033g"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_g ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_g ); clear(); // meta-h input("\033h"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_h ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_h ); clear(); // meta-i input("\033i"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_i ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_i ); clear(); // meta-j input("\033j"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_j ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_j ); clear(); // meta-k input("\033k"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_k ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_k ); clear(); // meta-l input("\033l"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_l ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_l ); clear(); // meta-m input("\033m"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_m ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_m ); clear(); // meta-n input("\033n"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_n ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_n ); clear(); // meta-o input("\033o"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_o ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_o ); clear(); // meta-p input("\033p"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_p ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_p ); clear(); // meta-q input("\033q"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_q ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_q ); clear(); // meta-r input("\033r"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_r ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_r ); clear(); // meta-s input("\033s"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_s ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_s ); clear(); // meta-t input("\033t"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_t ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_t ); clear(); // meta-u input("\033u"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_u ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_u ); clear(); // meta-v input("\033v"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_v ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_v ); clear(); // meta-w input("\033w"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_w ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_w ); clear(); // meta-x input("\033x"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_x ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_x ); clear(); // meta-y input("\033y"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_y ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_y ); clear(); // meta-z input("\033z"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_z ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_z ); clear(); // meta-{ input("\033{"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_left_curly_bracket ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_left_curly_bracket ); clear(); // meta-| input("\033|"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_vertical_bar ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_vertical_bar ); clear(); // meta-} input("\033}"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_right_curly_bracket ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_right_curly_bracket ); clear(); // meta-~ input("\033~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fmkey_tilde ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fmkey_tilde ); clear(); } @@ -2434,245 +2434,245 @@ void FKeyboardTest::sequencesTest() input("\033[3~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_ctab ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_ctab ); clear(); // Cursor up key in applications mode input("\033OA"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_up ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_up ); clear(); // Cursor up key in positioning mode input("\033[A"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_up ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_up ); clear(); // Cursor down key in applications mode input("\033OB"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_down ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_down ); clear(); // Cursor down key in positioning mode input("\033[B"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_down ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_down ); clear(); // Cursor right key in applications mode input("\033OC"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_right ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_right ); clear(); // Cursor right key in positioning mode input("\033[C"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_right ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_right ); clear(); // Cursor left key in applications mode input("\033OD"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_left ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_left ); clear(); // Cursor left key in applications mode input("\033OD"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_left ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_left ); clear(); // Home key in positioning mode input("\033[7~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_home ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_home ); clear(); // Home key in applications mode input("\033OH"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_home ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_home ); clear(); // End key in positioning mode input("\033[8~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_end ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_end ); clear(); // End key in applications mode input("\033OF"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_end ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_end ); clear(); // End key (ANSI terminal) input("\033[K"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_end ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_end ); clear(); // Next-page key (Page down) input("\033[6~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_npage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_npage ); clear(); // Previous-page key (Page up) input("\033[5~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_ppage ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_ppage ); clear(); // Insert key input("\033[2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_ic ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_ic ); clear(); // Scroll-forward key (shift + up-arrow) input("\033[1;2B"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_sf ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_sf ); clear(); // Scroll-backward key (shift + down-arrow) input("\033[1;2A"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_sr ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_sr ); clear(); // Center of keypad input("\033[E"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_b2 ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_b2 ); clear(); // back-tab key input("\033[Z"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_btab ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_btab ); clear(); // find key input("\033[1~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_find ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_find ); clear(); // select key input("\033[4~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_select ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_select ); clear(); // shifted delete-character key input("\033[3;2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_sdc ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_sdc ); clear(); // shifted end key input("\033[1;2F"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_send ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_send ); clear(); // shifted home key input("\033[1;2H"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_shome ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_shome ); clear(); // shifted insert-character key input("\033[2;2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_sic ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_sic ); clear(); // shifted left-arrow key input("\033[1;2D"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_sleft ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_sleft ); clear(); // shifted next key input("\033[6;2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_snext ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_snext ); clear(); // shifted previous key input("\033[5;2~"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_sprevious ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_sprevious ); clear(); // shifted right-arrow key input("\033[1;2C"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_sright ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_sright ); clear(); // Keypad slash (numlock off) input("\033Oo"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_slash ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_slash ); clear(); // Keypad asterisk (numlock off) input("\033Oj"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_asterisk ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_asterisk ); clear(); // Keypad minus sign (numlock off) input("\033Om"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_minus_sign ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_minus_sign ); clear(); // Keypad plus sign (numlock off) input("\033Ok"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_plus_sign ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_plus_sign ); clear(); } @@ -2685,36 +2685,36 @@ void FKeyboardTest::mouseTest() input("\033[M Z2"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_mouse ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_mouse ); clear(); // SGR mouse input("\033[<0;11;7M"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_extended_mouse ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_extended_mouse ); clear(); // URXVT mouse input("\033[32;11;7M"); processInput(); std::cout << " - Key: " << keyboard->getKeyName(key_pressed) << std::endl; - CPPUNIT_ASSERT ( key_pressed == fc::Fkey_urxvt_mouse ); + CPPUNIT_ASSERT ( key_pressed == finalcut::fc::Fkey_urxvt_mouse ); clear(); // Without mouse support keyboard->disableMouseSequences(); input("\033[M Z2"); processInput(); - CPPUNIT_ASSERT ( key_pressed != fc::Fkey_mouse ); + CPPUNIT_ASSERT ( key_pressed != finalcut::fc::Fkey_mouse ); clear(); input("\033[<0;11;7M"); processInput(); - CPPUNIT_ASSERT ( key_pressed != fc::Fkey_extended_mouse ); + CPPUNIT_ASSERT ( key_pressed != finalcut::fc::Fkey_extended_mouse ); clear(); input("\033[32;11;7M"); processInput(); - CPPUNIT_ASSERT ( key_pressed != fc::Fkey_urxvt_mouse ); + CPPUNIT_ASSERT ( key_pressed != finalcut::fc::Fkey_urxvt_mouse ); clear(); } @@ -2781,17 +2781,18 @@ void FKeyboardTest::unknownKeyTest() //---------------------------------------------------------------------- void FKeyboardTest::init() { - keyboard = new FKeyboard(); - FApplication* object = reinterpret_cast(this); - void (FApplication::*method1)() - = reinterpret_cast(&FKeyboardTest::keyPressed); - void (FApplication::*method2)() - = reinterpret_cast(&FKeyboardTest::keyReleased); - void (FApplication::*method3)() - = reinterpret_cast(&FKeyboardTest::escapeKeyPressed); - FKeyboardCommand key_cmd1 (object, method1); - FKeyboardCommand key_cmd2 (object, method2); - FKeyboardCommand key_cmd3 (object, method3); + keyboard = new finalcut::FKeyboard(); + finalcut::FApplication* object = \ + reinterpret_cast(this); + void (finalcut::FApplication::*method1)() + = reinterpret_cast(&FKeyboardTest::keyPressed); + void (finalcut::FApplication::*method2)() + = reinterpret_cast(&FKeyboardTest::keyReleased); + void (finalcut::FApplication::*method3)() + = reinterpret_cast(&FKeyboardTest::escapeKeyPressed); + finalcut::FKeyboardCommand key_cmd1 (object, method1); + finalcut::FKeyboardCommand key_cmd2 (object, method2); + finalcut::FKeyboardCommand key_cmd3 (object, method3); keyboard->setPressCommand (key_cmd1); keyboard->setReleaseCommand (key_cmd2); keyboard->setEscPressedCommand (key_cmd3); @@ -2800,7 +2801,7 @@ void FKeyboardTest::init() CPPUNIT_ASSERT ( key_pressed == 0 ); keyboard->enableUTF8(); keyboard->enableMouseSequences(); - keyboard->setTermcapMap (reinterpret_cast(test::Fkey)); + keyboard->setTermcapMap (reinterpret_cast(test::Fkey)); } //---------------------------------------------------------------------- @@ -2817,13 +2818,13 @@ void FKeyboardTest::input (std::string s) { char c = *iter; - if ( ioctl (FTermios::getStdIn(), TIOCSTI, &c) < 0 ) + if ( ioctl (finalcut::FTermios::getStdIn(), TIOCSTI, &c) < 0 ) break; ++iter; } - if ( ioctl (FTermios::getStdIn(), TIOCSTI, &EOT) < 0 ) + if ( ioctl (finalcut::FTermios::getStdIn(), TIOCSTI, &EOT) < 0 ) return; } @@ -2864,8 +2865,8 @@ void FKeyboardTest::keyReleased() //---------------------------------------------------------------------- void FKeyboardTest::escapeKeyPressed() { - key_pressed = fc::Fkey_escape; - key_released = fc::Fkey_escape; + key_pressed = finalcut::fc::Fkey_escape; + key_released = finalcut::fc::Fkey_escape; number_of_keys++; } diff --git a/src/test/fmouse-test.cpp b/src/test/fmouse-test.cpp index a9add5fa..d2f86991 100644 --- a/src/test/fmouse-test.cpp +++ b/src/test/fmouse-test.cpp @@ -1,5 +1,5 @@ /*********************************************************************** -* fmouse-test.cpp - FMouse unit tests * +* fmouse-test.cpp - finalcut::FMouse unit tests * * * * This file is part of the Final Cut widget toolkit * * * @@ -38,7 +38,7 @@ #pragma pack(push) #pragma pack(1) -class FMouse_protected : public FMouse +class FMouse_protected : public finalcut::FMouse { public: virtual bool hasData() @@ -60,7 +60,7 @@ class FMouse_protected : public FMouse return max_height; } - FPoint& getNewMousePosition() + finalcut::FPoint& getNewMousePosition() { return new_mouse_position; } @@ -72,14 +72,14 @@ class FMouse_protected : public FMouse bool isDblclickTimeout (timeval* t) { - return FMouse::isDblclickTimeout(t); + return finalcut::FMouse::isDblclickTimeout(t); } }; #pragma pack(pop) //---------------------------------------------------------------------- -// class FMouseTest +// class finalcut::FMouseTest //---------------------------------------------------------------------- #pragma pack(push) @@ -134,24 +134,24 @@ void FMouseTest::classNameTest() CPPUNIT_ASSERT ( std::strcmp(classname1, "FMouse") == 0 ); #ifdef F_HAVE_LIBGPM - FMouseGPM gpm_mouse; + finalcut::FMouseGPM gpm_mouse; const char* const classname2 = gpm_mouse.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname2, "FMouseGPM") == 0 ); #endif - FMouseX11 x11_mouse; + finalcut::FMouseX11 x11_mouse; const char* const classname3 = x11_mouse.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname3, "FMouseX11") == 0 ); - FMouseSGR sgr_mouse; + finalcut::FMouseSGR sgr_mouse; const char* const classname4 = sgr_mouse.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname4, "FMouseSGR") == 0 ); - FMouseUrxvt urxvt_mouse; + finalcut::FMouseUrxvt urxvt_mouse; const char* const classname5 = urxvt_mouse.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname5, "FMouseUrxvt") == 0 ); - FMouseControl mouse_control; + finalcut::FMouseControl mouse_control; const char* const classname6 = mouse_control.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname6, "FMouseControl") == 0 ); } @@ -160,8 +160,8 @@ void FMouseTest::classNameTest() void FMouseTest::noArgumentTest() { FMouse_protected mouse; - CPPUNIT_ASSERT ( mouse.getPos() == FPoint(0, 0) ); - CPPUNIT_ASSERT ( mouse.getNewMousePosition() == FPoint(0, 0) ); + CPPUNIT_ASSERT ( mouse.getPos() == finalcut::FPoint(0, 0) ); + CPPUNIT_ASSERT ( mouse.getNewMousePosition() == finalcut::FPoint(0, 0) ); CPPUNIT_ASSERT ( ! mouse.hasEvent() ); CPPUNIT_ASSERT ( ! mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! mouse.isLeftButtonReleased() ); @@ -179,20 +179,20 @@ void FMouseTest::noArgumentTest() CPPUNIT_ASSERT ( ! mouse.isInputDataPending() ); #ifdef F_HAVE_LIBGPM - FMouseGPM gpm_mouse; + finalcut::FMouseGPM gpm_mouse; CPPUNIT_ASSERT ( ! gpm_mouse.hasData() ); #endif - FMouseX11 x11_mouse; + finalcut::FMouseX11 x11_mouse; CPPUNIT_ASSERT ( ! x11_mouse.hasData() ); - FMouseSGR sgr_mouse; + finalcut::FMouseSGR sgr_mouse; CPPUNIT_ASSERT ( ! sgr_mouse.hasData() ); - FMouseUrxvt urxvt_mouse; + finalcut::FMouseUrxvt urxvt_mouse; CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() ); - FMouseControl mouse_control; + finalcut::FMouseControl mouse_control; CPPUNIT_ASSERT ( ! mouse_control.hasData() ); } @@ -204,14 +204,14 @@ void FMouseTest::doubleClickTest() timeval tv = { 0, 0 }; CPPUNIT_ASSERT ( mouse.isDblclickTimeout(&tv) ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); CPPUNIT_ASSERT ( ! mouse.isDblclickTimeout(&tv) ); tv.tv_sec--; // Minus one second CPPUNIT_ASSERT ( mouse.isDblclickTimeout(&tv) ); mouse.setDblclickInterval(1000000); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); CPPUNIT_ASSERT ( ! mouse.isDblclickTimeout(&tv) ); timeval tv_delta = { 0, 500000 }; @@ -238,7 +238,7 @@ void FMouseTest::workspaceSizeTest() //---------------------------------------------------------------------- void FMouseTest::gpmMouseTest() { - FMouseGPM gpm_mouse; + finalcut::FMouseGPM gpm_mouse; gpm_mouse.setStdinNo(fileno(stdin)); CPPUNIT_ASSERT ( ! gpm_mouse.isGpmMouseEnabled() ); @@ -258,7 +258,7 @@ void FMouseTest::gpmMouseTest() //---------------------------------------------------------------------- void FMouseTest::x11MouseTest() { - FMouseX11 x11_mouse; + finalcut::FMouseX11 x11_mouse; CPPUNIT_ASSERT ( ! x11_mouse.hasData() ); char rawdata1[] = { 0x1b, '[', 'M', 0x23, 0x50, 0x32, 0x40, 0x40 }; @@ -268,10 +268,10 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( std::strcmp(rawdata1, "@@") == 0 ); timeval tv; - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); x11_mouse.processEvent (&tv); - CPPUNIT_ASSERT ( x11_mouse.getPos() == FPoint(48, 18) ); + CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(48, 18) ); CPPUNIT_ASSERT ( x11_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! x11_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isLeftButtonReleased() ); @@ -300,7 +300,7 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( ! x11_mouse.isInputDataPending() ); x11_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! x11_mouse.hasData() ); - CPPUNIT_ASSERT ( x11_mouse.getPos() == FPoint(1, 1) ); + CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(1, 1) ); CPPUNIT_ASSERT ( x11_mouse.hasEvent() ); CPPUNIT_ASSERT ( x11_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isLeftButtonReleased() ); @@ -324,7 +324,7 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( ! x11_mouse.isInputDataPending() ); x11_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! x11_mouse.hasData() ); - CPPUNIT_ASSERT ( x11_mouse.getPos() == FPoint(1, 1) ); + CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(1, 1) ); CPPUNIT_ASSERT ( x11_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! x11_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( x11_mouse.isLeftButtonReleased() ); @@ -346,10 +346,10 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( x11_mouse.hasData() ); CPPUNIT_ASSERT ( ! x11_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); x11_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! x11_mouse.hasData() ); - CPPUNIT_ASSERT ( x11_mouse.getPos() == FPoint(1, 1) ); + CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(1, 1) ); CPPUNIT_ASSERT ( x11_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! x11_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isLeftButtonReleased() ); @@ -373,10 +373,10 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( x11_mouse.hasData() ); CPPUNIT_ASSERT ( x11_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); x11_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! x11_mouse.hasData() ); - CPPUNIT_ASSERT ( x11_mouse.getPos() == FPoint(1, 1) ); + CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(1, 1) ); CPPUNIT_ASSERT ( x11_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! x11_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isLeftButtonReleased() ); @@ -405,10 +405,10 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( x11_mouse.hasData() ); CPPUNIT_ASSERT ( x11_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); x11_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! x11_mouse.hasData() ); - CPPUNIT_ASSERT ( x11_mouse.getPos() == FPoint(1, 1) ); + CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(1, 1) ); CPPUNIT_ASSERT ( x11_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! x11_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isLeftButtonReleased() ); @@ -437,10 +437,10 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( x11_mouse.hasData() ); CPPUNIT_ASSERT ( x11_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); x11_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! x11_mouse.hasData() ); - CPPUNIT_ASSERT ( x11_mouse.getPos() == FPoint(80, 25) ); + CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(80, 25) ); CPPUNIT_ASSERT ( x11_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! x11_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isLeftButtonReleased() ); @@ -469,10 +469,10 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( x11_mouse.hasData() ); CPPUNIT_ASSERT ( x11_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); x11_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! x11_mouse.hasData() ); - CPPUNIT_ASSERT ( x11_mouse.getPos() == FPoint(1, 1) ); + CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(1, 1) ); CPPUNIT_ASSERT ( x11_mouse.hasEvent() ); CPPUNIT_ASSERT ( x11_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isLeftButtonReleased() ); @@ -490,12 +490,12 @@ void FMouseTest::x11MouseTest() x11_mouse.setRawData (rawdata8, sizeof(rawdata8)); x11_mouse.processEvent (&tv); - CPPUNIT_ASSERT ( x11_mouse.getPos() == FPoint(3, 5) ); + CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(3, 5) ); CPPUNIT_ASSERT ( x11_mouse.isMoved() ); x11_mouse.setRawData (rawdata8, sizeof(rawdata8)); x11_mouse.processEvent (&tv); - CPPUNIT_ASSERT ( x11_mouse.getPos() == FPoint(3, 5) ); + CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(3, 5) ); CPPUNIT_ASSERT ( ! x11_mouse.isMoved() ); // Mouse + keyboard modifier key @@ -507,10 +507,10 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( x11_mouse.hasData() ); CPPUNIT_ASSERT ( x11_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); x11_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! x11_mouse.hasData() ); - CPPUNIT_ASSERT ( x11_mouse.getPos() == FPoint(16, 32) ); + CPPUNIT_ASSERT ( x11_mouse.getPos() == finalcut::FPoint(16, 32) ); CPPUNIT_ASSERT ( x11_mouse.hasEvent() ); CPPUNIT_ASSERT ( x11_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isLeftButtonReleased() ); @@ -560,7 +560,7 @@ void FMouseTest::x11MouseTest() //---------------------------------------------------------------------- void FMouseTest::sgrMouseTest() { - FMouseSGR sgr_mouse; + finalcut::FMouseSGR sgr_mouse; CPPUNIT_ASSERT ( ! sgr_mouse.hasData() ); // Left mouse button pressed @@ -572,10 +572,10 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( std::strcmp(rawdata1, "@@") == 0 ); timeval tv; - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); sgr_mouse.processEvent (&tv); - CPPUNIT_ASSERT ( sgr_mouse.getPos() == FPoint(73, 4) ); + CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(73, 4) ); CPPUNIT_ASSERT ( sgr_mouse.hasEvent() ); CPPUNIT_ASSERT ( sgr_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! sgr_mouse.isLeftButtonReleased() ); @@ -605,7 +605,7 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( ! sgr_mouse.isInputDataPending() ); sgr_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! sgr_mouse.hasData() ); - CPPUNIT_ASSERT ( sgr_mouse.getPos() == FPoint(73, 4) ); + CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(73, 4) ); CPPUNIT_ASSERT ( sgr_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! sgr_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( sgr_mouse.isLeftButtonReleased() ); @@ -627,10 +627,10 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( sgr_mouse.hasData() ); CPPUNIT_ASSERT ( ! sgr_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); sgr_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! sgr_mouse.hasData() ); - CPPUNIT_ASSERT ( sgr_mouse.getPos() == FPoint(73, 4) ); + CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(73, 4) ); CPPUNIT_ASSERT ( sgr_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! sgr_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! sgr_mouse.isLeftButtonReleased() ); @@ -653,10 +653,10 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( sgr_mouse.hasData() ); CPPUNIT_ASSERT ( sgr_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); sgr_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! sgr_mouse.hasData() ); - CPPUNIT_ASSERT ( sgr_mouse.getPos() == FPoint(1, 1) ); + CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(1, 1) ); CPPUNIT_ASSERT ( sgr_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! sgr_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! sgr_mouse.isLeftButtonReleased() ); @@ -685,10 +685,10 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( sgr_mouse.hasData() ); CPPUNIT_ASSERT ( sgr_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); sgr_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! sgr_mouse.hasData() ); - CPPUNIT_ASSERT ( sgr_mouse.getPos() == FPoint(3, 3) ); + CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(3, 3) ); CPPUNIT_ASSERT ( sgr_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! sgr_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! sgr_mouse.isLeftButtonReleased() ); @@ -706,7 +706,7 @@ void FMouseTest::sgrMouseTest() sgr_mouse.setRawData (rawdata6, sizeof(rawdata6)); sgr_mouse.processEvent (&tv); - CPPUNIT_ASSERT ( sgr_mouse.getPos() == FPoint(3, 4) ); + CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(3, 4) ); CPPUNIT_ASSERT ( ! sgr_mouse.isInputDataPending() ); CPPUNIT_ASSERT ( ! sgr_mouse.isRightButtonPressed() ); CPPUNIT_ASSERT ( sgr_mouse.isRightButtonReleased() ); @@ -718,10 +718,10 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( sgr_mouse.hasData() ); CPPUNIT_ASSERT ( sgr_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); sgr_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! sgr_mouse.hasData() ); - CPPUNIT_ASSERT ( sgr_mouse.getPos() == FPoint(4, 9) ); + CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(4, 9) ); CPPUNIT_ASSERT ( sgr_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! sgr_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! sgr_mouse.isLeftButtonReleased() ); @@ -750,10 +750,10 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( sgr_mouse.hasData() ); CPPUNIT_ASSERT ( sgr_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); sgr_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! sgr_mouse.hasData() ); - CPPUNIT_ASSERT ( sgr_mouse.getPos() == FPoint(1, 2) ); + CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(1, 2) ); CPPUNIT_ASSERT ( sgr_mouse.hasEvent() ); CPPUNIT_ASSERT ( sgr_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! sgr_mouse.isLeftButtonReleased() ); @@ -771,12 +771,12 @@ void FMouseTest::sgrMouseTest() sgr_mouse.setRawData (rawdata8, sizeof(rawdata8)); sgr_mouse.processEvent (&tv); - CPPUNIT_ASSERT ( sgr_mouse.getPos() == FPoint(2, 3) ); + CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(2, 3) ); CPPUNIT_ASSERT ( sgr_mouse.isMoved() ); sgr_mouse.setRawData (rawdata8, sizeof(rawdata8)); sgr_mouse.processEvent (&tv); - CPPUNIT_ASSERT ( sgr_mouse.getPos() == FPoint(3, 4) ); + CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(3, 4) ); CPPUNIT_ASSERT ( ! sgr_mouse.isMoved() ); // Mouse + keyboard modifier key @@ -788,10 +788,10 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( sgr_mouse.hasData() ); CPPUNIT_ASSERT ( sgr_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); sgr_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! sgr_mouse.hasData() ); - CPPUNIT_ASSERT ( sgr_mouse.getPos() == FPoint(5, 5) ); + CPPUNIT_ASSERT ( sgr_mouse.getPos() == finalcut::FPoint(5, 5) ); CPPUNIT_ASSERT ( sgr_mouse.hasEvent() ); CPPUNIT_ASSERT ( sgr_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! sgr_mouse.isLeftButtonReleased() ); @@ -863,7 +863,7 @@ void FMouseTest::sgrMouseTest() //---------------------------------------------------------------------- void FMouseTest::urxvtMouseTest() { - FMouseUrxvt urxvt_mouse; + finalcut::FMouseUrxvt urxvt_mouse; CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() ); // Left mouse button pressed @@ -875,9 +875,9 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( std::strcmp(rawdata1, "@@") == 0 ); timeval tv; - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); urxvt_mouse.processEvent (&tv); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() == FPoint(49, 6) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(49, 6) ); CPPUNIT_ASSERT ( urxvt_mouse.hasEvent() ); CPPUNIT_ASSERT ( urxvt_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isLeftButtonReleased() ); @@ -907,7 +907,7 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( ! urxvt_mouse.isInputDataPending() ); urxvt_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() ); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() == FPoint(49, 6) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(49, 6) ); CPPUNIT_ASSERT ( urxvt_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( urxvt_mouse.isLeftButtonReleased() ); @@ -929,10 +929,10 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( urxvt_mouse.hasData() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); urxvt_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() ); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() == FPoint(49, 6) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(49, 6) ); CPPUNIT_ASSERT ( urxvt_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isLeftButtonReleased() ); @@ -955,10 +955,10 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( urxvt_mouse.hasData() ); CPPUNIT_ASSERT ( urxvt_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); urxvt_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() ); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() == FPoint(1, 1) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(1, 1) ); CPPUNIT_ASSERT ( urxvt_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isLeftButtonReleased() ); @@ -987,10 +987,10 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( urxvt_mouse.hasData() ); CPPUNIT_ASSERT ( urxvt_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); urxvt_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() ); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() == FPoint(3, 3) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(3, 3) ); CPPUNIT_ASSERT ( urxvt_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isLeftButtonReleased() ); @@ -1008,7 +1008,7 @@ void FMouseTest::urxvtMouseTest() urxvt_mouse.setRawData (rawdata6, sizeof(rawdata6)); urxvt_mouse.processEvent (&tv); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() == FPoint(3, 4) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(3, 4) ); CPPUNIT_ASSERT ( ! urxvt_mouse.isInputDataPending() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isRightButtonPressed() ); CPPUNIT_ASSERT ( urxvt_mouse.isRightButtonReleased() ); @@ -1020,10 +1020,10 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( urxvt_mouse.hasData() ); CPPUNIT_ASSERT ( urxvt_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); urxvt_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() ); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() == FPoint(4, 9) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(4, 9) ); CPPUNIT_ASSERT ( urxvt_mouse.hasEvent() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isLeftButtonReleased() ); @@ -1052,10 +1052,10 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( urxvt_mouse.hasData() ); CPPUNIT_ASSERT ( urxvt_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); urxvt_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() ); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() == FPoint(1, 2) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(1, 2) ); CPPUNIT_ASSERT ( urxvt_mouse.hasEvent() ); CPPUNIT_ASSERT ( urxvt_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isLeftButtonReleased() ); @@ -1073,12 +1073,12 @@ void FMouseTest::urxvtMouseTest() urxvt_mouse.setRawData (rawdata8, sizeof(rawdata8)); urxvt_mouse.processEvent (&tv); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() == FPoint(2, 3) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(2, 3) ); CPPUNIT_ASSERT ( urxvt_mouse.isMoved() ); urxvt_mouse.setRawData (rawdata8, sizeof(rawdata8)); urxvt_mouse.processEvent (&tv); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() == FPoint(3, 4) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(3, 4) ); CPPUNIT_ASSERT ( ! urxvt_mouse.isMoved() ); // Mouse + keyboard modifier key @@ -1090,10 +1090,10 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( urxvt_mouse.hasData() ); CPPUNIT_ASSERT ( urxvt_mouse.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); urxvt_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() ); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() == FPoint(5, 5) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(5, 5) ); CPPUNIT_ASSERT ( urxvt_mouse.hasEvent() ); CPPUNIT_ASSERT ( urxvt_mouse.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isLeftButtonReleased() ); @@ -1169,16 +1169,16 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( urxvt_mouse.isInputDataPending() ); urxvt_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() ); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() != FPoint(-5, 5) ); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() == FPoint(1, 5) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() != finalcut::FPoint(-5, 5) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(1, 5) ); CPPUNIT_ASSERT ( urxvt_mouse.hasEvent() ); urxvt_mouse.setRawData (rawdata12, sizeof(rawdata12)); CPPUNIT_ASSERT ( urxvt_mouse.hasData() ); urxvt_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() ); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() != FPoint(3, -3) ); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() == FPoint(3, 1) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() != finalcut::FPoint(3, -3) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(3, 1) ); CPPUNIT_ASSERT ( urxvt_mouse.hasEvent() ); // Oversize values @@ -1189,14 +1189,14 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( urxvt_mouse.hasData() ); urxvt_mouse.processEvent (&tv); CPPUNIT_ASSERT ( ! urxvt_mouse.hasData() ); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() != FPoint(70, 25) ); - CPPUNIT_ASSERT ( urxvt_mouse.getPos() == FPoint(40, 20) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() != finalcut::FPoint(70, 25) ); + CPPUNIT_ASSERT ( urxvt_mouse.getPos() == finalcut::FPoint(40, 20) ); } //---------------------------------------------------------------------- void FMouseTest::mouseControlTest() { - FMouseControl mouse_control; + finalcut::FMouseControl mouse_control; mouse_control.setStdinNo(fileno(stdin)); mouse_control.setMaxWidth(100); mouse_control.setMaxHeight(40); @@ -1207,7 +1207,7 @@ void FMouseTest::mouseControlTest() mouse_control.enable(); CPPUNIT_ASSERT ( ! mouse_control.hasData() ); - CPPUNIT_ASSERT ( mouse_control.getPos() == FPoint(0, 0) ); + CPPUNIT_ASSERT ( mouse_control.getPos() == finalcut::FPoint(0, 0) ); CPPUNIT_ASSERT ( ! mouse_control.hasEvent() ); CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonReleased() ); @@ -1233,15 +1233,15 @@ void FMouseTest::mouseControlTest() // Left mouse button pressed on an X11 mouse char rawdata1[] = { 0x1b, '[', 'M', 0x20, 0x25, 0x28 , 0x1b, '[', 'M', 0x23, 0x25, 0x28 }; - mouse_control.setRawData (FMouse::x11, rawdata1, sizeof(rawdata1)); + mouse_control.setRawData (finalcut::FMouse::x11, rawdata1, sizeof(rawdata1)); CPPUNIT_ASSERT ( mouse_control.hasData() ); CPPUNIT_ASSERT ( mouse_control.isInputDataPending() ); timeval tv; - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); mouse_control.processEvent (&tv); CPPUNIT_ASSERT ( ! mouse_control.hasData() ); - CPPUNIT_ASSERT ( mouse_control.getPos() == FPoint(5, 8) ); + CPPUNIT_ASSERT ( mouse_control.getPos() == finalcut::FPoint(5, 8) ); CPPUNIT_ASSERT ( mouse_control.hasEvent() ); CPPUNIT_ASSERT ( mouse_control.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonReleased() ); @@ -1258,7 +1258,7 @@ void FMouseTest::mouseControlTest() CPPUNIT_ASSERT ( ! mouse_control.isMoved() ); CPPUNIT_ASSERT ( mouse_control.isInputDataPending() ); - mouse_control.setRawData (FMouse::x11, rawdata1, sizeof(rawdata1)); + mouse_control.setRawData (finalcut::FMouse::x11, rawdata1, sizeof(rawdata1)); mouse_control.processEvent (&tv); CPPUNIT_ASSERT ( ! mouse_control.isInputDataPending() ); CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonPressed() ); @@ -1268,13 +1268,13 @@ void FMouseTest::mouseControlTest() // Middle mouse button on an SGR mouse char rawdata2[] = { 0x1b, '[', '<', '1', ';', '1', ';', '1', 'M' , 0x1b, '[', '<', '1', ';', '1', ';', '1', 'm' }; - mouse_control.setRawData (FMouse::sgr, rawdata2, sizeof(rawdata2)); + mouse_control.setRawData (finalcut::FMouse::sgr, rawdata2, sizeof(rawdata2)); CPPUNIT_ASSERT ( mouse_control.hasData() ); CPPUNIT_ASSERT ( mouse_control.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); mouse_control.processEvent (&tv); CPPUNIT_ASSERT ( ! mouse_control.hasData() ); - CPPUNIT_ASSERT ( mouse_control.getPos() == FPoint(1, 1) ); + CPPUNIT_ASSERT ( mouse_control.getPos() == finalcut::FPoint(1, 1) ); CPPUNIT_ASSERT ( mouse_control.hasEvent() ); CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonReleased() ); @@ -1290,7 +1290,7 @@ void FMouseTest::mouseControlTest() CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() ); CPPUNIT_ASSERT ( ! mouse_control.isMoved() ); - mouse_control.setRawData (FMouse::sgr, rawdata2, sizeof(rawdata2)); + mouse_control.setRawData (finalcut::FMouse::sgr, rawdata2, sizeof(rawdata2)); mouse_control.processEvent (&tv); CPPUNIT_ASSERT ( ! mouse_control.isInputDataPending() ); CPPUNIT_ASSERT ( ! mouse_control.isMiddleButtonPressed() ); @@ -1299,13 +1299,13 @@ void FMouseTest::mouseControlTest() // Right mouse button on a urxvt mouse char rawdata3[] = { 0x1b, '[', '3', '4', ';', '3', ';', '3', 'M' , 0x1b, '[', '3', '5', ';', '3', ';', '4', 'M' }; - mouse_control.setRawData (FMouse::urxvt, rawdata3, sizeof(rawdata3)); + mouse_control.setRawData (finalcut::FMouse::urxvt, rawdata3, sizeof(rawdata3)); CPPUNIT_ASSERT ( mouse_control.hasData() ); CPPUNIT_ASSERT ( mouse_control.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); mouse_control.processEvent (&tv); CPPUNIT_ASSERT ( ! mouse_control.hasData() ); - CPPUNIT_ASSERT ( mouse_control.getPos() == FPoint(3, 3) ); + CPPUNIT_ASSERT ( mouse_control.getPos() == finalcut::FPoint(3, 3) ); CPPUNIT_ASSERT ( mouse_control.hasEvent() ); CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonReleased() ); @@ -1321,9 +1321,9 @@ void FMouseTest::mouseControlTest() CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() ); CPPUNIT_ASSERT ( ! mouse_control.isMoved() ); - mouse_control.setRawData (FMouse::urxvt, rawdata3, sizeof(rawdata3)); + mouse_control.setRawData (finalcut::FMouse::urxvt, rawdata3, sizeof(rawdata3)); mouse_control.processEvent (&tv); - CPPUNIT_ASSERT ( mouse_control.getPos() == FPoint(3, 4) ); + CPPUNIT_ASSERT ( mouse_control.getPos() == finalcut::FPoint(3, 4) ); CPPUNIT_ASSERT ( ! mouse_control.isInputDataPending() ); CPPUNIT_ASSERT ( ! mouse_control.isRightButtonPressed() ); CPPUNIT_ASSERT ( mouse_control.isRightButtonReleased() ); @@ -1331,13 +1331,13 @@ void FMouseTest::mouseControlTest() // Mouse wheel on an X11 mouse char rawdata4[] = { 0x1b, '[', 'M', 0x60, 0x70, 0x39 , 0x1b, '[', 'M', 0x61, 0x70, 0x39 }; - mouse_control.setRawData (FMouse::x11, rawdata4, sizeof(rawdata4)); + mouse_control.setRawData (finalcut::FMouse::x11, rawdata4, sizeof(rawdata4)); CPPUNIT_ASSERT ( mouse_control.hasData() ); CPPUNIT_ASSERT ( mouse_control.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); mouse_control.processEvent (&tv); CPPUNIT_ASSERT ( ! mouse_control.hasData() ); - CPPUNIT_ASSERT ( mouse_control.getPos() == FPoint(80, 25) ); + CPPUNIT_ASSERT ( mouse_control.getPos() == finalcut::FPoint(80, 25) ); CPPUNIT_ASSERT ( mouse_control.hasEvent() ); CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonReleased() ); @@ -1353,7 +1353,7 @@ void FMouseTest::mouseControlTest() CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() ); CPPUNIT_ASSERT ( ! mouse_control.isMoved() ); - mouse_control.setRawData (FMouse::x11, rawdata4, sizeof(rawdata4)); + mouse_control.setRawData (finalcut::FMouse::x11, rawdata4, sizeof(rawdata4)); mouse_control.processEvent (&tv); CPPUNIT_ASSERT ( ! mouse_control.isInputDataPending() ); CPPUNIT_ASSERT ( mouse_control.isWheelDown() ); @@ -1362,13 +1362,13 @@ void FMouseTest::mouseControlTest() char rawdata5[] = { 0x1b, '[', '<', '0', ';', '1', ';', '2', 'M' , 0x1b, '[', '<', '3', '2', ';', '2', ';', '3', 'M' , 0x1b, '[', '<', '0', ';', '3', ';', '4', 'm' }; - mouse_control.setRawData (FMouse::sgr, rawdata5, sizeof(rawdata5)); + mouse_control.setRawData (finalcut::FMouse::sgr, rawdata5, sizeof(rawdata5)); CPPUNIT_ASSERT ( mouse_control.hasData() ); CPPUNIT_ASSERT ( mouse_control.isInputDataPending() ); - FObject::getCurrentTime(&tv); + finalcut::FObject::getCurrentTime(&tv); mouse_control.processEvent (&tv); CPPUNIT_ASSERT ( ! mouse_control.hasData() ); - CPPUNIT_ASSERT ( mouse_control.getPos() == FPoint(1, 2) ); + CPPUNIT_ASSERT ( mouse_control.getPos() == finalcut::FPoint(1, 2) ); CPPUNIT_ASSERT ( mouse_control.hasEvent() ); CPPUNIT_ASSERT ( mouse_control.isLeftButtonPressed() ); CPPUNIT_ASSERT ( ! mouse_control.isLeftButtonReleased() ); @@ -1384,14 +1384,14 @@ void FMouseTest::mouseControlTest() CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() ); CPPUNIT_ASSERT ( ! mouse_control.isMoved() ); - mouse_control.setRawData (FMouse::sgr, rawdata5, sizeof(rawdata5)); + mouse_control.setRawData (finalcut::FMouse::sgr, rawdata5, sizeof(rawdata5)); mouse_control.processEvent (&tv); - CPPUNIT_ASSERT ( mouse_control.getPos() == FPoint(2, 3) ); + CPPUNIT_ASSERT ( mouse_control.getPos() == finalcut::FPoint(2, 3) ); CPPUNIT_ASSERT ( mouse_control.isMoved() ); - mouse_control.setRawData (FMouse::sgr, rawdata5, sizeof(rawdata5)); + mouse_control.setRawData (finalcut::FMouse::sgr, rawdata5, sizeof(rawdata5)); mouse_control.processEvent (&tv); - CPPUNIT_ASSERT ( mouse_control.getPos() == FPoint(3, 4) ); + CPPUNIT_ASSERT ( mouse_control.getPos() == finalcut::FPoint(3, 4) ); CPPUNIT_ASSERT ( ! mouse_control.isMoved() ); mouse_control.disable(); diff --git a/src/test/fobject-test.cpp b/src/test/fobject-test.cpp index c8baf633..151fc35d 100644 --- a/src/test/fobject-test.cpp +++ b/src/test/fobject-test.cpp @@ -38,15 +38,15 @@ #pragma pack(push) #pragma pack(1) -class FObject_protected : public FObject +class FObject_protected : public finalcut::FObject { public: - bool event (FEvent* ev) + bool event (finalcut::FEvent* ev) { - return FObject::event(ev); + return finalcut::FObject::event(ev); } - FObject::TimerList* getTimerList() const + finalcut::FObject::TimerList* getTimerList() const { return timer_list; } @@ -101,7 +101,7 @@ class FObjectTest : public CPPUNIT_NS::TestFixture //---------------------------------------------------------------------- void FObjectTest::classNameTest() { - FObject o; + finalcut::FObject o; const char* const classname = o.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname, "FObject") == 0 ); } @@ -109,14 +109,14 @@ void FObjectTest::classNameTest() //---------------------------------------------------------------------- void FObjectTest::noArgumentTest() { - FObject o1; + finalcut::FObject o1; CPPUNIT_ASSERT ( ! o1.hasParent() ); CPPUNIT_ASSERT ( o1.getParent() == 0 ); CPPUNIT_ASSERT ( ! o1.hasChildren() ); CPPUNIT_ASSERT ( o1.getChild(0) == 0 ); CPPUNIT_ASSERT ( o1.getChild(1) == 0 ); CPPUNIT_ASSERT ( o1.numOfChildren() == 0 ); - const FObject::FObjectList& children_list = o1.getChildren(); + const finalcut::FObject::FObjectList& children_list = o1.getChildren(); CPPUNIT_ASSERT ( children_list.begin() == o1.begin() ); CPPUNIT_ASSERT ( children_list.begin() == o1.end() ); CPPUNIT_ASSERT ( children_list.end() == o1.begin() ); @@ -128,16 +128,16 @@ void FObjectTest::noArgumentTest() CPPUNIT_ASSERT ( ! o1.isTimerInUpdating() ); FObject_protected t; - FEvent* ev = new FEvent(fc::None_Event); + finalcut::FEvent* ev = new finalcut::FEvent(finalcut::fc::None_Event); CPPUNIT_ASSERT ( ! t.event(ev) ); delete ev; - ev = new FEvent(fc::Timer_Event); + ev = new finalcut::FEvent(finalcut::fc::Timer_Event); CPPUNIT_ASSERT ( t.event(ev) ); delete ev; - CPPUNIT_ASSERT ( ! fc::emptyFString::get().isNull() ); - CPPUNIT_ASSERT ( fc::emptyFString::get().isEmpty() ); + CPPUNIT_ASSERT ( ! finalcut::fc::emptyFString::get().isNull() ); + CPPUNIT_ASSERT ( finalcut::fc::emptyFString::get().isEmpty() ); } //---------------------------------------------------------------------- @@ -148,13 +148,13 @@ void FObjectTest::childObjectTest() * -> c3 * -> c4 */ - FObject obj; - FObject* c1 = new FObject(&obj); - FObject* c2 = new FObject(&obj); - FObject* c3 = new FObject(&obj); - FObject* c4 = new FObject(&obj); - FObject* c5 = new FObject(c1); - FObject* c6 = new FObject(c5); + finalcut::FObject obj; + finalcut::FObject* c1 = new finalcut::FObject(&obj); + finalcut::FObject* c2 = new finalcut::FObject(&obj); + finalcut::FObject* c3 = new finalcut::FObject(&obj); + finalcut::FObject* c4 = new finalcut::FObject(&obj); + finalcut::FObject* c5 = new finalcut::FObject(c1); + finalcut::FObject* c6 = new finalcut::FObject(c5); CPPUNIT_ASSERT ( obj.hasChildren() ); CPPUNIT_ASSERT ( obj.getChild(0) == 0 ); @@ -187,7 +187,7 @@ void FObjectTest::childObjectTest() CPPUNIT_ASSERT ( c2->getChild(1) == 0 ); CPPUNIT_ASSERT ( c1->numOfChildren() == 1 ); CPPUNIT_ASSERT ( c2->numOfChildren() == 0 ); - const FObject::FObjectList& children_list2 = c1->getChildren(); + const finalcut::FObject::FObjectList& children_list2 = c1->getChildren(); CPPUNIT_ASSERT ( children_list2.begin() == c1->begin() ); CPPUNIT_ASSERT ( children_list2.begin() != c1->end() ); CPPUNIT_ASSERT ( children_list2.end() != c1->begin() ); @@ -203,8 +203,8 @@ void FObjectTest::removeParentTest() {/* * obj -> child */ - FObject* obj = new FObject(); - FObject* child = new FObject(obj); + finalcut::FObject* obj = new finalcut::FObject(); + finalcut::FObject* child = new finalcut::FObject(obj); CPPUNIT_ASSERT ( obj->hasChildren() ); CPPUNIT_ASSERT ( obj->numOfChildren() == 1 ); @@ -230,8 +230,8 @@ void FObjectTest::addTest() {/* * obj -> child */ - FObject* obj = new FObject(); - FObject* child = new FObject(); + finalcut::FObject* obj = new finalcut::FObject(); + finalcut::FObject* child = new finalcut::FObject(); CPPUNIT_ASSERT ( ! obj->hasChildren() ); CPPUNIT_ASSERT ( obj->numOfChildren() == 0 ); @@ -256,8 +256,8 @@ void FObjectTest::delTest() {/* * obj -> child */ - FObject* obj = new FObject(); - FObject* child = new FObject(obj); + finalcut::FObject* obj = new finalcut::FObject(); + finalcut::FObject* child = new finalcut::FObject(obj); CPPUNIT_ASSERT ( obj->hasChildren() ); CPPUNIT_ASSERT ( obj->numOfChildren() == 1 ); CPPUNIT_ASSERT ( obj->isChild(child) ); @@ -284,16 +284,16 @@ void FObjectTest::iteratorTest() * -> child2 * -> child3 */ - FObject* obj = new FObject(); - FObject* child1 = new FObject(obj); - FObject* child2 = new FObject(obj); - FObject* child3 = new FObject(obj); + finalcut::FObject* obj = new finalcut::FObject(); + finalcut::FObject* child1 = new finalcut::FObject(obj); + finalcut::FObject* child2 = new finalcut::FObject(obj); + finalcut::FObject* child3 = new finalcut::FObject(obj); CPPUNIT_ASSERT ( child1->getParent() == obj ); CPPUNIT_ASSERT ( child2->getParent() == obj ); CPPUNIT_ASSERT ( child3->getParent() == obj ); - FObject::constFObjectIterator c_iter, c_last; + finalcut::FObject::constFObjectIterator c_iter, c_last; c_iter = obj->begin(); c_last = obj->end(); int i = 0; @@ -307,7 +307,7 @@ void FObjectTest::iteratorTest() CPPUNIT_ASSERT ( obj->numOfChildren() == i ); CPPUNIT_ASSERT ( i == 3 ); - FObject::FObjectIterator iter, last; + finalcut::FObject::FObjectIterator iter, last; iter = obj->begin(); last = obj->end(); i = 0; @@ -329,10 +329,10 @@ void FObjectTest::timeTest() { struct timeval time1; long timeout = 750000; // 750 ms - FObject::getCurrentTime(&time1); - CPPUNIT_ASSERT ( ! FObject::isTimeout (&time1, timeout) ); + finalcut::FObject::getCurrentTime(&time1); + CPPUNIT_ASSERT ( ! finalcut::FObject::isTimeout (&time1, timeout) ); sleep(1); - CPPUNIT_ASSERT ( FObject::isTimeout (&time1, timeout) ); + CPPUNIT_ASSERT ( finalcut::FObject::isTimeout (&time1, timeout) ); } //---------------------------------------------------------------------- diff --git a/src/test/foptiattr-test.cpp b/src/test/foptiattr-test.cpp index aa4c210a..09aeb471 100644 --- a/src/test/foptiattr-test.cpp +++ b/src/test/foptiattr-test.cpp @@ -1,5 +1,5 @@ /*********************************************************************** -* foptiattr_test.cpp - FOptiAttr unit tests * +* foptiattr_test.cpp - finalcut::FOptiAttr unit tests * * * * This file is part of the Final Cut widget toolkit * * * @@ -113,7 +113,7 @@ class FOptiAttrTest : public CPPUNIT_NS::TestFixture //---------------------------------------------------------------------- void FOptiAttrTest::classNameTest() { - FOptiAttr opti_attr; + finalcut::FOptiAttr opti_attr; const char* const classname = opti_attr.getClassName(); CPPUNIT_ASSERT_CSTRING ( classname, "FOptiAttr"); } @@ -121,19 +121,19 @@ void FOptiAttrTest::classNameTest() //---------------------------------------------------------------------- void FOptiAttrTest::noArgumentTest() { - FOptiAttr::charData* ch = new FOptiAttr::charData(); - FOptiAttr oa; + finalcut::FOptiAttr::charData* ch = new finalcut::FOptiAttr::charData(); + finalcut::FOptiAttr oa; oa.initialize(); // isNormal test CPPUNIT_ASSERT ( ! oa.isNormal(ch) ); - ch->fg_color = fc::Default; + ch->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( ! oa.isNormal(ch) ); - ch->bg_color = fc::Default; + ch->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( oa.isNormal(ch) ); // Null test - FOptiAttr::charData* ch_null = 0; + finalcut::FOptiAttr::charData* ch_null = 0; CPPUNIT_ASSERT ( oa.changeAttribute(ch, ch) == 0 ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(ch, ch_null), C_STR("") ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(ch_null, ch), C_STR("") ); @@ -144,7 +144,7 @@ void FOptiAttrTest::noArgumentTest() //---------------------------------------------------------------------- void FOptiAttrTest::vga2ansiTest() { - FOptiAttr oa; + finalcut::FOptiAttr oa; CPPUNIT_ASSERT (oa.vga2ansi(0) == 0); CPPUNIT_ASSERT (oa.vga2ansi(1) == 4); CPPUNIT_ASSERT (oa.vga2ansi(2) == 2); @@ -166,7 +166,7 @@ void FOptiAttrTest::vga2ansiTest() //---------------------------------------------------------------------- void FOptiAttrTest::fakeReverseTest() { - FOptiAttr oa; + finalcut::FOptiAttr oa; oa.setDefaultColorSupport(); // ANSI default color oa.setMaxColor (8); oa.setNoColorVideo (4); // Avoid reverse (4) @@ -207,13 +207,15 @@ void FOptiAttrTest::fakeReverseTest() oa.set_orig_orig_colors (0); oa.initialize(); - FOptiAttr::charData* from = new FOptiAttr::charData(); - FOptiAttr::charData* to = new FOptiAttr::charData(); + finalcut::FOptiAttr::charData* from = \ + new finalcut::FOptiAttr::charData(); + finalcut::FOptiAttr::charData* to = \ + new finalcut::FOptiAttr::charData(); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Gray text on blue background - to->fg_color = fc::LightGray; - to->bg_color = fc::Blue; + to->fg_color = finalcut::fc::LightGray; + to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "37m" CSI "44m") ); @@ -225,12 +227,12 @@ void FOptiAttrTest::fakeReverseTest() CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "34m" CSI "47m") ); - CPPUNIT_ASSERT ( from->fg_color == fc::LightGray ); - CPPUNIT_ASSERT ( from->bg_color == fc::Blue ); + CPPUNIT_ASSERT ( from->fg_color == finalcut::fc::LightGray ); + CPPUNIT_ASSERT ( from->bg_color == finalcut::fc::Blue ); CPPUNIT_ASSERT ( *from == *to ); // Gray text on red background - to->bg_color = fc::Red; + to->bg_color = finalcut::fc::Red; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "31m" CSI "47m") ); @@ -254,7 +256,7 @@ void FOptiAttrTest::ansiTest() { // Simulate an ansi terminal - FOptiAttr oa; + finalcut::FOptiAttr oa; oa.setDefaultColorSupport(); // ANSI default color oa.setMaxColor (8); oa.setNoColorVideo (3); // Avoid standout (1) + underline mode (2) @@ -302,16 +304,16 @@ void FOptiAttrTest::ansiTest() oa.set_orig_orig_colors (0); oa.initialize(); - FOptiAttr::charData* from = new FOptiAttr::charData(); - FOptiAttr::charData* to = new FOptiAttr::charData(); + finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); + finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default color + bold - from->fg_color = fc::Default; - from->bg_color = fc::Default; + from->fg_color = finalcut::fc::Default; + from->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "0;10;1m") ); @@ -319,8 +321,8 @@ void FOptiAttrTest::ansiTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Blue text on white background + dim + italic - to->fg_color = fc::Blue; - to->bg_color = fc::White; + to->fg_color = finalcut::fc::Blue; + to->bg_color = finalcut::fc::White; to->attr.bit.dim = true; to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); @@ -333,7 +335,7 @@ void FOptiAttrTest::ansiTest() to->attr.bit.bold = false; to->attr.bit.dim = false; to->attr.bit.italic = false; - to->bg_color = fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "0m" CSI "34m") ); @@ -341,8 +343,8 @@ void FOptiAttrTest::ansiTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Red text on black background - to->fg_color = fc::Red; - to->bg_color = fc::Black; + to->fg_color = finalcut::fc::Red; + to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "31m" CSI "40m") ); @@ -350,8 +352,8 @@ void FOptiAttrTest::ansiTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // 256 color text and background - to->fg_color = fc::SpringGreen3; - to->bg_color = fc::NavyBlue; + to->fg_color = finalcut::fc::SpringGreen3; + to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "32m" CSI "44m") ); @@ -359,8 +361,8 @@ void FOptiAttrTest::ansiTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Bold on (with default colors) - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) @@ -590,8 +592,8 @@ void FOptiAttrTest::ansiTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Cyan text on blue background - to->fg_color = fc::Cyan; - to->bg_color = fc::Blue; + to->fg_color = finalcut::fc::Cyan; + to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "36m" CSI "44m") ); @@ -698,14 +700,14 @@ void FOptiAttrTest::ansiTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color - to->fg_color = fc::Green; + to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR(CSI "32m") ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default text color - to->fg_color = fc::Default; + to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( printSequence(oa.changeAttribute(from, to)).c_str() , C_STR("Esc [ 3 9 m ") ); @@ -721,7 +723,7 @@ void FOptiAttrTest::vt100Test() { // Simulate a vt100 terminal - FOptiAttr oa; + finalcut::FOptiAttr oa; oa.unsetDefaultColorSupport(); // No ANSI default color oa.setMaxColor (1); oa.setNoColorVideo (0); @@ -767,16 +769,16 @@ void FOptiAttrTest::vt100Test() oa.set_orig_orig_colors (0); oa.initialize(); - FOptiAttr::charData* from = new FOptiAttr::charData(); - FOptiAttr::charData* to = new FOptiAttr::charData(); + finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); + finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default color + bold - from->fg_color = fc::Default; - from->bg_color = fc::Default; + from->fg_color = finalcut::fc::Default; + from->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "0;1m\017$<2>") ); @@ -784,8 +786,8 @@ void FOptiAttrTest::vt100Test() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Blue text on white background + dim + italic - to->fg_color = fc::Blue; - to->bg_color = fc::White; + to->fg_color = finalcut::fc::Blue; + to->bg_color = finalcut::fc::White; to->attr.bit.dim = true; to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); @@ -798,28 +800,28 @@ void FOptiAttrTest::vt100Test() to->attr.bit.bold = false; to->attr.bit.dim = false; to->attr.bit.italic = false; - to->bg_color = fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "0m$<2>" ) ); // Red text on black background - to->fg_color = fc::Red; - to->bg_color = fc::Black; + to->fg_color = finalcut::fc::Red; + to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR("") ); // 256 color text and background - to->fg_color = fc::SpringGreen3; - to->bg_color = fc::NavyBlue; + to->fg_color = finalcut::fc::SpringGreen3; + to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); // Bold on (with default colors) - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) @@ -1051,8 +1053,8 @@ void FOptiAttrTest::vt100Test() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Cyan text on blue background - to->fg_color = fc::Cyan; - to->bg_color = fc::Blue; + to->fg_color = finalcut::fc::Cyan; + to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); @@ -1163,14 +1165,14 @@ void FOptiAttrTest::vt100Test() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color - to->fg_color = fc::Green; + to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default text color - to->fg_color = fc::Default; + to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); @@ -1183,7 +1185,7 @@ void FOptiAttrTest::xtermTest() { // Simulate an xterm-256color terminal - FOptiAttr oa; + finalcut::FOptiAttr oa; oa.setDefaultColorSupport(); // ANSI default color oa.setMaxColor (256); oa.setNoColorVideo (0); @@ -1239,16 +1241,16 @@ void FOptiAttrTest::xtermTest() oa.set_orig_orig_colors (0); oa.initialize(); - FOptiAttr::charData* from = new FOptiAttr::charData(); - FOptiAttr::charData* to = new FOptiAttr::charData(); + finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); + finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default color + bold - from->fg_color = fc::Default; - from->bg_color = fc::Default; + from->fg_color = finalcut::fc::Default; + from->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(ESC "(B" CSI "0;1m") ); @@ -1256,8 +1258,8 @@ void FOptiAttrTest::xtermTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Blue text on white background + dim + italic - to->fg_color = fc::Blue; - to->bg_color = fc::White; + to->fg_color = finalcut::fc::Blue; + to->bg_color = finalcut::fc::White; to->attr.bit.dim = true; to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); @@ -1271,7 +1273,7 @@ void FOptiAttrTest::xtermTest() to->attr.bit.bold = false; to->attr.bit.dim = false; to->attr.bit.italic = false; - to->bg_color = fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "0m" CSI "34m") ); @@ -1279,8 +1281,8 @@ void FOptiAttrTest::xtermTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Red text on black background - to->fg_color = fc::Red; - to->bg_color = fc::Black; + to->fg_color = finalcut::fc::Red; + to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "31m" CSI "40m") ); @@ -1288,8 +1290,8 @@ void FOptiAttrTest::xtermTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // 256 color text and background - to->fg_color = fc::SpringGreen3; - to->bg_color = fc::NavyBlue; + to->fg_color = finalcut::fc::SpringGreen3; + to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "38;5;42m" CSI "48;5;17m") ); @@ -1297,8 +1299,8 @@ void FOptiAttrTest::xtermTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Bold on (with default colors) - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) @@ -1529,8 +1531,8 @@ void FOptiAttrTest::xtermTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Cyan text on blue background - to->fg_color = fc::Cyan; - to->bg_color = fc::Blue; + to->fg_color = finalcut::fc::Cyan; + to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "36m" CSI "44m") ); @@ -1641,14 +1643,14 @@ void FOptiAttrTest::xtermTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color - to->fg_color = fc::Green; + to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR(CSI "32m") ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default text color - to->fg_color = fc::Default; + to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( printSequence(oa.changeAttribute(from, to)).c_str() , C_STR("Esc [ 3 9 m ") ); @@ -1664,7 +1666,7 @@ void FOptiAttrTest::rxvtTest() { // Simulate an rxvt terminal - FOptiAttr oa; + finalcut::FOptiAttr oa; oa.setDefaultColorSupport(); // ANSI default color oa.setMaxColor (8); oa.setNoColorVideo (0); @@ -1710,16 +1712,16 @@ void FOptiAttrTest::rxvtTest() oa.set_orig_orig_colors (0); oa.initialize(); - FOptiAttr::charData* from = new FOptiAttr::charData(); - FOptiAttr::charData* to = new FOptiAttr::charData(); + finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); + finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default color + bold - from->fg_color = fc::Default; - from->bg_color = fc::Default; + from->fg_color = finalcut::fc::Default; + from->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "0;1m\017") ); @@ -1727,8 +1729,8 @@ void FOptiAttrTest::rxvtTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Blue text on white background + dim + italic - to->fg_color = fc::Blue; - to->bg_color = fc::White; + to->fg_color = finalcut::fc::Blue; + to->bg_color = finalcut::fc::White; to->attr.bit.dim = true; to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); @@ -1741,7 +1743,7 @@ void FOptiAttrTest::rxvtTest() to->attr.bit.bold = false; to->attr.bit.dim = false; to->attr.bit.italic = false; - to->bg_color = fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "0m" CSI "34m") ); @@ -1749,8 +1751,8 @@ void FOptiAttrTest::rxvtTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Red text on black background - to->fg_color = fc::Red; - to->bg_color = fc::Black; + to->fg_color = finalcut::fc::Red; + to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "31m" CSI "40m") ); @@ -1758,8 +1760,8 @@ void FOptiAttrTest::rxvtTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // 256 color text and background - to->fg_color = fc::SpringGreen3; - to->bg_color = fc::NavyBlue; + to->fg_color = finalcut::fc::SpringGreen3; + to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "32m" CSI "44m") ); @@ -1767,8 +1769,8 @@ void FOptiAttrTest::rxvtTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Bold on (with default colors) - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) @@ -2001,8 +2003,8 @@ void FOptiAttrTest::rxvtTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Cyan text on blue background - to->fg_color = fc::Cyan; - to->bg_color = fc::Blue; + to->fg_color = finalcut::fc::Cyan; + to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "36m" CSI "44m") ); @@ -2113,14 +2115,14 @@ void FOptiAttrTest::rxvtTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color - to->fg_color = fc::Green; + to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR(CSI "32m") ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default text color - to->fg_color = fc::Default; + to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( printSequence(oa.changeAttribute(from, to)).c_str() , C_STR("Esc [ 3 9 m ") ); @@ -2136,7 +2138,7 @@ void FOptiAttrTest::linuxTest() { // Simulate a Linux terminal with 16 colors - FOptiAttr oa; + finalcut::FOptiAttr oa; oa.setDefaultColorSupport(); // ANSI default color oa.setMaxColor (16); oa.setNoColorVideo (18); @@ -2183,16 +2185,16 @@ void FOptiAttrTest::linuxTest() oa.set_orig_orig_colors (C_STR(OSC "R")); oa.initialize(); - FOptiAttr::charData* from = new FOptiAttr::charData(); - FOptiAttr::charData* to = new FOptiAttr::charData(); + finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); + finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default color + bold - from->fg_color = fc::Default; - from->bg_color = fc::Default; + from->fg_color = finalcut::fc::Default; + from->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "0;1m\017") ); @@ -2200,8 +2202,8 @@ void FOptiAttrTest::linuxTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Blue text on white background + dim + italic - to->fg_color = fc::Blue; - to->bg_color = fc::White; + to->fg_color = finalcut::fc::Blue; + to->bg_color = finalcut::fc::White; to->attr.bit.dim = true; to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); @@ -2214,7 +2216,7 @@ void FOptiAttrTest::linuxTest() to->attr.bit.bold = false; to->attr.bit.dim = false; to->attr.bit.italic = false; - to->bg_color = fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "0m\017" CSI "34;22m") ); @@ -2222,8 +2224,8 @@ void FOptiAttrTest::linuxTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Red text on black background - to->fg_color = fc::Red; - to->bg_color = fc::Black; + to->fg_color = finalcut::fc::Red; + to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "31;22m" CSI "40;25m") ); @@ -2231,8 +2233,8 @@ void FOptiAttrTest::linuxTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // 256 color text and background - to->fg_color = fc::SpringGreen3; - to->bg_color = fc::NavyBlue; + to->fg_color = finalcut::fc::SpringGreen3; + to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "32;1m" CSI "44;25m") ); @@ -2240,8 +2242,8 @@ void FOptiAttrTest::linuxTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Bold on (with default colors) - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) @@ -2474,8 +2476,8 @@ void FOptiAttrTest::linuxTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Cyan text on blue background - to->fg_color = fc::Cyan; - to->bg_color = fc::Blue; + to->fg_color = finalcut::fc::Cyan; + to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "36;22m" CSI "44;25m") ); @@ -2580,14 +2582,14 @@ void FOptiAttrTest::linuxTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color - to->fg_color = fc::Green; + to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR(CSI "32;22m") ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default text color - to->fg_color = fc::Default; + to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( printSequence(oa.changeAttribute(from, to)).c_str() , C_STR("Esc [ 3 9 m ") ); @@ -2611,7 +2613,7 @@ void FOptiAttrTest::puttyTest() { // Simulate a putty-256color terminal - FOptiAttr oa; + finalcut::FOptiAttr oa; oa.unsetDefaultColorSupport(); // No ANSI default color oa.setMaxColor (256); oa.setNoColorVideo (0); @@ -2667,16 +2669,16 @@ void FOptiAttrTest::puttyTest() oa.initialize(); - FOptiAttr::charData* from = new FOptiAttr::charData(); - FOptiAttr::charData* to = new FOptiAttr::charData(); + finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); + finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default color + bold - from->fg_color = fc::Default; - from->bg_color = fc::Default; + from->fg_color = finalcut::fc::Default; + from->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "0;1m\017") ); @@ -2684,8 +2686,8 @@ void FOptiAttrTest::puttyTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Blue text on white background + dim + italic - to->fg_color = fc::Blue; - to->bg_color = fc::White; + to->fg_color = finalcut::fc::Blue; + to->bg_color = finalcut::fc::White; to->attr.bit.dim = true; to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); @@ -2699,7 +2701,7 @@ void FOptiAttrTest::puttyTest() to->attr.bit.bold = false; to->attr.bit.dim = false; to->attr.bit.italic = false; - to->bg_color = fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "0m" CSI "39;49m" CSI "34m") ); @@ -2707,8 +2709,8 @@ void FOptiAttrTest::puttyTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Red text on black background - to->fg_color = fc::Red; - to->bg_color = fc::Black; + to->fg_color = finalcut::fc::Red; + to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "31m" CSI "40m") ); @@ -2716,8 +2718,8 @@ void FOptiAttrTest::puttyTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // 256 color text and background - to->fg_color = fc::SpringGreen3; - to->bg_color = fc::NavyBlue; + to->fg_color = finalcut::fc::SpringGreen3; + to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "38;5;42m" CSI "48;5;17m") ); @@ -2725,8 +2727,8 @@ void FOptiAttrTest::puttyTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Bold on (with default colors) - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) @@ -2959,8 +2961,8 @@ void FOptiAttrTest::puttyTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Cyan text on blue background - to->fg_color = fc::Cyan; - to->bg_color = fc::Blue; + to->fg_color = finalcut::fc::Cyan; + to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "36m" CSI "44m") ); @@ -3071,14 +3073,14 @@ void FOptiAttrTest::puttyTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color - to->fg_color = fc::Green; + to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR(CSI "32m") ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default text color - to->fg_color = fc::Default; + to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( printSequence(oa.changeAttribute(from, to)).c_str() , C_STR("Esc [ 3 9 ; 4 9 m Esc [ 4 4 m ") ); @@ -3094,7 +3096,7 @@ void FOptiAttrTest::teratermTest() { // Simulate a Tera Term terminal - FOptiAttr oa; + finalcut::FOptiAttr oa; oa.unsetDefaultColorSupport(); // No ANSI default color oa.setMaxColor (16); oa.setNoColorVideo (41); // Avoid standout (1) + blink (8) + bold (32) @@ -3141,16 +3143,16 @@ void FOptiAttrTest::teratermTest() oa.initialize(); - FOptiAttr::charData* from = new FOptiAttr::charData(); - FOptiAttr::charData* to = new FOptiAttr::charData(); + finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); + finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default color + bold - from->fg_color = fc::Default; - from->bg_color = fc::Default; + from->fg_color = finalcut::fc::Default; + from->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "0;1m\017$<2>") ); @@ -3158,8 +3160,8 @@ void FOptiAttrTest::teratermTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Blue text on white background + dim + italic - to->fg_color = fc::Blue; - to->bg_color = fc::White; + to->fg_color = finalcut::fc::Blue; + to->bg_color = finalcut::fc::White; to->attr.bit.dim = true; to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); @@ -3173,7 +3175,7 @@ void FOptiAttrTest::teratermTest() to->attr.bit.bold = false; to->attr.bit.dim = false; to->attr.bit.italic = false; - to->bg_color = fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "0m$<2>" CSI "39;49m" @@ -3182,8 +3184,8 @@ void FOptiAttrTest::teratermTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Red text on black background - to->fg_color = fc::Red; - to->bg_color = fc::Black; + to->fg_color = finalcut::fc::Red; + to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "38;5;1m" CSI "48;5;0m") ); @@ -3191,8 +3193,8 @@ void FOptiAttrTest::teratermTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // 256 color text and background - to->fg_color = fc::SpringGreen3; - to->bg_color = fc::NavyBlue; + to->fg_color = finalcut::fc::SpringGreen3; + to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "38;5;10m" CSI "48;5;4m") ); @@ -3200,8 +3202,8 @@ void FOptiAttrTest::teratermTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Bold on (with default colors) - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) @@ -3434,8 +3436,8 @@ void FOptiAttrTest::teratermTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Cyan text on blue background - to->fg_color = fc::Cyan; - to->bg_color = fc::Blue; + to->fg_color = finalcut::fc::Cyan; + to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "38;5;6m" CSI "48;5;4m") ); @@ -3538,14 +3540,14 @@ void FOptiAttrTest::teratermTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color - to->fg_color = fc::Green; + to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR(CSI "38;5;2m") ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default text color - to->fg_color = fc::Default; + to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( printSequence(oa.changeAttribute(from, to)).c_str() , C_STR("Esc [ 3 9 ; 4 9 m Esc [ 4 8 ; 5 ; 4 m ") ); @@ -3561,7 +3563,7 @@ void FOptiAttrTest::ibmColorTest() { // Simulate IBM color definitions - FOptiAttr oa; + finalcut::FOptiAttr oa; oa.unsetDefaultColorSupport(); // No ANSI default color oa.setMaxColor (8); oa.setNoColorVideo (3); // Avoid standout (1) + underline mode (2) @@ -3617,24 +3619,24 @@ void FOptiAttrTest::ibmColorTest() oa.initialize(); - FOptiAttr::charData* from = new FOptiAttr::charData(); - FOptiAttr::charData* to = new FOptiAttr::charData(); + finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); + finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default color + bold - from->fg_color = fc::Default; - from->bg_color = fc::Default; + from->fg_color = finalcut::fc::Default; + from->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Blue text on white background + dim + italic - to->fg_color = fc::Blue; - to->bg_color = fc::White; + to->fg_color = finalcut::fc::Blue; + to->bg_color = finalcut::fc::White; to->attr.bit.dim = true; to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); @@ -3647,7 +3649,7 @@ void FOptiAttrTest::ibmColorTest() to->attr.bit.bold = false; to->attr.bit.dim = false; to->attr.bit.italic = false; - to->bg_color = fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "32;40m" CSI "31m") ); @@ -3655,8 +3657,8 @@ void FOptiAttrTest::ibmColorTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Red text on black background - to->fg_color = fc::Red; - to->bg_color = fc::Black; + to->fg_color = finalcut::fc::Red; + to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "34m" CSI "40m") ); @@ -3664,8 +3666,8 @@ void FOptiAttrTest::ibmColorTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // 256 color text and background - to->fg_color = fc::SpringGreen3; - to->bg_color = fc::NavyBlue; + to->fg_color = finalcut::fc::SpringGreen3; + to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "32m" CSI "41m") ); @@ -3673,8 +3675,8 @@ void FOptiAttrTest::ibmColorTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Bold on (with default colors) - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) @@ -3880,8 +3882,8 @@ void FOptiAttrTest::ibmColorTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Cyan text on blue background - to->fg_color = fc::Cyan; - to->bg_color = fc::Blue; + to->fg_color = finalcut::fc::Cyan; + to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "33m" CSI "41m") ); @@ -3976,7 +3978,7 @@ void FOptiAttrTest::ibmColorTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color - to->fg_color = fc::Green; + to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(CSI "32m") ); @@ -3984,7 +3986,7 @@ void FOptiAttrTest::ibmColorTest() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default text color - to->fg_color = fc::Default; + to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( printSequence(oa.changeAttribute(from, to)).c_str() , C_STR("Esc [ 3 2 ; 4 0 m Esc [ 4 1 m ") ); @@ -4000,8 +4002,8 @@ void FOptiAttrTest::wyse50Test() { // Simulate an Wyse-50 terminal - FOptiAttr oa; - FOptiAttr::termEnv optiattr_env = + finalcut::FOptiAttr oa; + finalcut::FOptiAttr::termEnv optiattr_env = { false, // No ANSI default color 1, // Max color @@ -4059,16 +4061,16 @@ void FOptiAttrTest::wyse50Test() oa.setTermEnvironment(optiattr_env); - FOptiAttr::charData* from = new FOptiAttr::charData(); - FOptiAttr::charData* to = new FOptiAttr::charData(); + finalcut::FOptiAttr::charData* from = new finalcut::FOptiAttr::charData(); + finalcut::FOptiAttr::charData* to = new finalcut::FOptiAttr::charData(); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default color + bold - from->fg_color = fc::Default; - from->bg_color = fc::Default; + from->fg_color = finalcut::fc::Default; + from->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(ESC "(" ESC "cD" ESC "G4") ); @@ -4076,8 +4078,8 @@ void FOptiAttrTest::wyse50Test() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Blue text on white background + dim + italic - to->fg_color = fc::Blue; - to->bg_color = fc::White; + to->fg_color = finalcut::fc::Blue; + to->bg_color = finalcut::fc::White; to->attr.bit.dim = true; to->attr.bit.italic = true; CPPUNIT_ASSERT ( *from != *to ); @@ -4090,7 +4092,7 @@ void FOptiAttrTest::wyse50Test() to->attr.bit.bold = false; to->attr.bit.dim = false; to->attr.bit.italic = false; - to->bg_color = fc::Default; + to->bg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) , C_STR(ESC "(" ESC "H\003" ESC "G0" ESC "cD") ); @@ -4098,24 +4100,24 @@ void FOptiAttrTest::wyse50Test() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Red text on black background - to->fg_color = fc::Red; - to->bg_color = fc::Black; + to->fg_color = finalcut::fc::Red; + to->bg_color = finalcut::fc::Black; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // 256 color text and background - to->fg_color = fc::SpringGreen3; - to->bg_color = fc::NavyBlue; + to->fg_color = finalcut::fc::SpringGreen3; + to->bg_color = finalcut::fc::NavyBlue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Bold on (with default colors) - to->fg_color = fc::Default; - to->bg_color = fc::Default; + to->fg_color = finalcut::fc::Default; + to->bg_color = finalcut::fc::Default; to->attr.bit.bold = true; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to) @@ -4346,8 +4348,8 @@ void FOptiAttrTest::wyse50Test() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Cyan text on blue background - to->fg_color = fc::Cyan; - to->bg_color = fc::Blue; + to->fg_color = finalcut::fc::Cyan; + to->bg_color = finalcut::fc::Blue; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); CPPUNIT_ASSERT ( *from == *to ); @@ -4467,14 +4469,14 @@ void FOptiAttrTest::wyse50Test() CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Green text color - to->fg_color = fc::Green; + to->fg_color = finalcut::fc::Green; CPPUNIT_ASSERT ( *from != *to ); CPPUNIT_ASSERT_CSTRING ( oa.changeAttribute(from, to), C_STR("") ); CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); // Default text color - to->fg_color = fc::Default; + to->fg_color = finalcut::fc::Default; CPPUNIT_ASSERT ( *from == *to ); CPPUNIT_ASSERT ( oa.changeAttribute(from, to) == 0 ); diff --git a/src/test/foptimove-test.cpp b/src/test/foptimove-test.cpp index 5c78a2a5..a6ddd2af 100644 --- a/src/test/foptimove-test.cpp +++ b/src/test/foptimove-test.cpp @@ -1,5 +1,5 @@ /*********************************************************************** -* foptimove-test.cpp - FOptiMove unit tests * +* foptimove-test.cpp - finalcut::FOptiMove unit tests * * * * This file is part of the Final Cut widget toolkit * * * @@ -111,7 +111,7 @@ class FOptiMoveTest : public CPPUNIT_NS::TestFixture //---------------------------------------------------------------------- void FOptiMoveTest::classNameTest() { - FOptiMove opti_move; + finalcut::FOptiMove opti_move; const char* const classname = opti_move.getClassName(); CPPUNIT_ASSERT_CSTRING ( classname, "FOptiMove"); } @@ -119,7 +119,7 @@ void FOptiMoveTest::classNameTest() //---------------------------------------------------------------------- void FOptiMoveTest::noArgumentTest() { - FOptiMove om; + finalcut::FOptiMove om; CPPUNIT_ASSERT_CSTRING (om.moveCursor (1, 1, 5, 5), C_STR(CSI "6;6H")); CPPUNIT_ASSERT_CSTRING (om.moveCursor (5, 5, 9, 9), C_STR(CSI "10;10H")); @@ -148,7 +148,7 @@ void FOptiMoveTest::noArgumentTest() void FOptiMoveTest::homeTest() { int baud = 4800; - FOptiMove om(baud); + finalcut::FOptiMove om(baud); om.setTermSize (80, 24); om.set_cursor_home (C_STR(CSI "H")); om.set_cursor_to_ll (C_STR(CSI "X")); @@ -172,7 +172,7 @@ void FOptiMoveTest::homeTest() void FOptiMoveTest::fromLeftToRightTest() { int baud = 38400; - FOptiMove om(baud); + finalcut::FOptiMove om(baud); om.setTermSize (80, 24); om.setTabStop (8); om.set_auto_left_margin (true); @@ -197,7 +197,7 @@ void FOptiMoveTest::fromLeftToRightTest() //---------------------------------------------------------------------- void FOptiMoveTest::ansiTest() { - FOptiMove om; + finalcut::FOptiMove om; om.setTermSize (80, 25); om.setBaudRate (19200); om.setTabStop (8); @@ -255,7 +255,7 @@ void FOptiMoveTest::ansiTest() //---------------------------------------------------------------------- void FOptiMoveTest::vt100Test() { - FOptiMove om; + finalcut::FOptiMove om; om.setTermSize (80, 24); om.setBaudRate (1200); om.setTabStop (8); @@ -311,7 +311,7 @@ void FOptiMoveTest::vt100Test() //---------------------------------------------------------------------- void FOptiMoveTest::xtermTest() { - FOptiMove om; + finalcut::FOptiMove om; om.setTermSize (80, 25); om.setBaudRate (38400); om.setTabStop (8); @@ -370,7 +370,7 @@ void FOptiMoveTest::xtermTest() //---------------------------------------------------------------------- void FOptiMoveTest::rxvtTest() { - FOptiMove om; + finalcut::FOptiMove om; om.setTermSize (80, 25); om.setBaudRate (38400); om.setTabStop (8); @@ -428,7 +428,7 @@ void FOptiMoveTest::rxvtTest() //---------------------------------------------------------------------- void FOptiMoveTest::linuxTest() { - FOptiMove om; + finalcut::FOptiMove om; om.setTermSize (80, 25); om.setBaudRate (38400); om.setTabStop (8); @@ -487,7 +487,7 @@ void FOptiMoveTest::linuxTest() //---------------------------------------------------------------------- void FOptiMoveTest::cygwinTest() { - FOptiMove om; + finalcut::FOptiMove om; om.setTermSize (80, 25); om.setBaudRate (38400); om.setTabStop (8); @@ -547,7 +547,7 @@ void FOptiMoveTest::cygwinTest() //---------------------------------------------------------------------- void FOptiMoveTest::puttyTest() { - FOptiMove om; + finalcut::FOptiMove om; om.setTermSize (80, 25); om.setBaudRate (38400); om.setTabStop (8); @@ -607,11 +607,11 @@ void FOptiMoveTest::puttyTest() //---------------------------------------------------------------------- void FOptiMoveTest::teratermTest() { - FOptiMove om; + finalcut::FOptiMove om; om.setTermSize (80, 25); om.setBaudRate (38400); - FOptiMove::termEnv optimove_env = + finalcut::FOptiMove::termEnv optimove_env = { false, // Automatic left margin true, // Eat newline glitch @@ -679,7 +679,7 @@ void FOptiMoveTest::teratermTest() //---------------------------------------------------------------------- void FOptiMoveTest::wyse50Test() { - FOptiMove om; + finalcut::FOptiMove om; om.setTermSize (80, 25); om.setBaudRate (38400); om.set_auto_left_margin (true); diff --git a/src/test/fpoint-test.cpp b/src/test/fpoint-test.cpp index 4f9295b8..c7a9c736 100644 --- a/src/test/fpoint-test.cpp +++ b/src/test/fpoint-test.cpp @@ -1,5 +1,5 @@ /*********************************************************************** -* fpoint-test.cpp - FPoint unit tests * +* fpoint-test.cpp - finalcut::FPoint unit tests * * * * This file is part of the Final Cut widget toolkit * * * @@ -85,7 +85,7 @@ class FPointTest : public CPPUNIT_NS::TestFixture //---------------------------------------------------------------------- void FPointTest::classNameTest() { - FPoint p; + finalcut::FPoint p; const char* const classname = p.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname, "FPoint") == 0 ); } @@ -93,7 +93,7 @@ void FPointTest::classNameTest() //---------------------------------------------------------------------- void FPointTest::noArgumentTest() { - const FPoint point; + const finalcut::FPoint point; CPPUNIT_ASSERT ( point.getX() == 0 ); CPPUNIT_ASSERT ( point.getY() == 0 ); CPPUNIT_ASSERT ( point.isNull() ); @@ -102,8 +102,8 @@ void FPointTest::noArgumentTest() //---------------------------------------------------------------------- void FPointTest::copyConstructorTest() { - const FPoint p1 (15,10); - const FPoint p2 (p1); + const finalcut::FPoint p1 (15,10); + const finalcut::FPoint p2 (p1); CPPUNIT_ASSERT ( p2.getX() == 15 ); CPPUNIT_ASSERT ( p2.getY() == 10 ); } @@ -111,11 +111,11 @@ void FPointTest::copyConstructorTest() //---------------------------------------------------------------------- void FPointTest::assignmentTest() { - const FPoint p1 (-99,100); + const finalcut::FPoint p1 (-99,100); CPPUNIT_ASSERT ( p1.getX() == -99 ); CPPUNIT_ASSERT ( p1.getY() == 100 ); - FPoint p2; + finalcut::FPoint p2; p2 = p1; CPPUNIT_ASSERT ( p2.getX() == -99 ); CPPUNIT_ASSERT ( p2.getY() == 100 ); @@ -137,7 +137,7 @@ void FPointTest::assignmentTest() CPPUNIT_ASSERT ( p2.getY() == 12 ); // Value limit exceeded - const FPoint p3 (-999999,1000000); + const finalcut::FPoint p3 (-999999,1000000); CPPUNIT_ASSERT ( p3.getX() != -999999 ); CPPUNIT_ASSERT ( p3.getY() != 1000000 ); } @@ -145,21 +145,21 @@ void FPointTest::assignmentTest() //---------------------------------------------------------------------- void FPointTest::additionAssignmentTest() { - FPoint p1 (1,2); - p1 += FPoint (3,1); + finalcut::FPoint p1 (1,2); + p1 += finalcut::FPoint (3,1); CPPUNIT_ASSERT ( p1.getX() == 4 ); CPPUNIT_ASSERT ( p1.getY() == 3 ); - p1 += FPoint (-4,-3); + p1 += finalcut::FPoint (-4,-3); CPPUNIT_ASSERT ( p1.getX() == 0 ); CPPUNIT_ASSERT ( p1.getY() == 0 ); CPPUNIT_ASSERT ( p1.isNull() ); // Value limit exceeded - FPoint p2 (18000,-18000); + finalcut::FPoint p2 (18000,-18000); CPPUNIT_ASSERT ( p2.getX() == 18000 ); CPPUNIT_ASSERT ( p2.getY() == -18000 ); - p2 += FPoint (18000,-18000); + p2 += finalcut::FPoint (18000,-18000); CPPUNIT_ASSERT ( p2.getX() != 36000 ); CPPUNIT_ASSERT ( p2.getY() != -36000 ); } @@ -167,46 +167,46 @@ void FPointTest::additionAssignmentTest() //---------------------------------------------------------------------- void FPointTest::subtractionAssignmentTest() { - FPoint p1 (10,20); - p1 -= FPoint (5,5); + finalcut::FPoint p1 (10,20); + p1 -= finalcut::FPoint (5,5); CPPUNIT_ASSERT ( p1.getX() == 5 ); CPPUNIT_ASSERT ( p1.getY() == 15 ); - p1 -= FPoint (-5,20); + p1 -= finalcut::FPoint (-5,20); CPPUNIT_ASSERT ( p1.getX() == 10 ); CPPUNIT_ASSERT ( p1.getY() == -5 ); CPPUNIT_ASSERT ( ! p1.isNull() ); - p1 -= FPoint (-10,0); + p1 -= finalcut::FPoint (-10,0); CPPUNIT_ASSERT ( p1.getX() == 20 ); CPPUNIT_ASSERT ( p1.getY() == -5 ); CPPUNIT_ASSERT ( ! p1.isNull() ); - p1 -= FPoint (20,0); + p1 -= finalcut::FPoint (20,0); CPPUNIT_ASSERT ( p1.getX() == 0 ); CPPUNIT_ASSERT ( p1.getY() == -5 ); CPPUNIT_ASSERT ( ! p1.isNull() ); - p1 -= FPoint (0,-6); + p1 -= finalcut::FPoint (0,-6); CPPUNIT_ASSERT ( p1.getX() == 0 ); CPPUNIT_ASSERT ( p1.getY() == 1 ); CPPUNIT_ASSERT ( ! p1.isNull() ); - p1 -= FPoint (1,0); + p1 -= finalcut::FPoint (1,0); CPPUNIT_ASSERT ( p1.getX() == -1 ); CPPUNIT_ASSERT ( p1.getY() == 1 ); CPPUNIT_ASSERT ( ! p1.isNull() ); - p1 -= (FPoint (0,1) + FPoint (-1,0)); + p1 -= (finalcut::FPoint (0,1) + finalcut::FPoint (-1,0)); CPPUNIT_ASSERT ( p1.getX() == 0 ); CPPUNIT_ASSERT ( p1.getY() == 0 ); CPPUNIT_ASSERT ( p1.isNull() ); // Value limit exceeded - FPoint p2 (18000,-18000); + finalcut::FPoint p2 (18000,-18000); CPPUNIT_ASSERT ( p2.getX() == 18000 ); CPPUNIT_ASSERT ( p2.getY() == -18000 ); - p2 += FPoint (18000,-18000); + p2 += finalcut::FPoint (18000,-18000); CPPUNIT_ASSERT ( p2.getX() != 36000 ); CPPUNIT_ASSERT ( p2.getY() != -36000 ); } @@ -214,58 +214,58 @@ void FPointTest::subtractionAssignmentTest() //---------------------------------------------------------------------- void FPointTest::equalTest() { - const FPoint p1 (1,2); - const FPoint p2 (1,2); + const finalcut::FPoint p1 (1,2); + const finalcut::FPoint p2 (1,2); CPPUNIT_ASSERT ( p1 == p2 ); - CPPUNIT_ASSERT ( FPoint(1,2) == p2 ); - CPPUNIT_ASSERT ( p1 == FPoint(1,2) ); - CPPUNIT_ASSERT ( FPoint() == FPoint() ); - CPPUNIT_ASSERT ( FPoint() == -FPoint() ); + CPPUNIT_ASSERT ( finalcut::FPoint(1,2) == p2 ); + CPPUNIT_ASSERT ( p1 == finalcut::FPoint(1,2) ); + CPPUNIT_ASSERT ( finalcut::FPoint() == finalcut::FPoint() ); + CPPUNIT_ASSERT ( finalcut::FPoint() == -finalcut::FPoint() ); } //---------------------------------------------------------------------- void FPointTest::notEqualTest() { - const FPoint p1 (1,2); - const FPoint p2 (2,4); + const finalcut::FPoint p1 (1,2); + const finalcut::FPoint p2 (2,4); CPPUNIT_ASSERT ( p1 != p2 ); - CPPUNIT_ASSERT ( FPoint(1,2) != p2 ); - CPPUNIT_ASSERT ( p1 != FPoint(2,4) ); - CPPUNIT_ASSERT ( FPoint() != p2 ); - CPPUNIT_ASSERT ( p1 != FPoint() ); + CPPUNIT_ASSERT ( finalcut::FPoint(1,2) != p2 ); + CPPUNIT_ASSERT ( p1 != finalcut::FPoint(2,4) ); + CPPUNIT_ASSERT ( finalcut::FPoint() != p2 ); + CPPUNIT_ASSERT ( p1 != finalcut::FPoint() ); } //---------------------------------------------------------------------- void FPointTest::additionTest() { - const FPoint p1 (1,2); - const FPoint p2 (5,8); - const FPoint p3 = p1 + p2; + const finalcut::FPoint p1 (1,2); + const finalcut::FPoint p2 (5,8); + const finalcut::FPoint p3 = p1 + p2; CPPUNIT_ASSERT ( p3.getX() == 6 ); CPPUNIT_ASSERT ( p3.getY() == 10 ); - CPPUNIT_ASSERT ( p1 + p2 == FPoint(6,10) ); - CPPUNIT_ASSERT ( p1 + FPoint() == p1 ); - CPPUNIT_ASSERT ( FPoint() + p2 == p2 ); - CPPUNIT_ASSERT ( FPoint() + FPoint() == FPoint() ); + CPPUNIT_ASSERT ( p1 + p2 == finalcut::FPoint(6,10) ); + CPPUNIT_ASSERT ( p1 + finalcut::FPoint() == p1 ); + CPPUNIT_ASSERT ( finalcut::FPoint() + p2 == p2 ); + CPPUNIT_ASSERT ( finalcut::FPoint() + finalcut::FPoint() == finalcut::FPoint() ); } //---------------------------------------------------------------------- void FPointTest::subtractionTest() { - const FPoint p1 (-5,-20); - const FPoint p2 (0,-30); - const FPoint p3 = p1 - p2; + const finalcut::FPoint p1 (-5,-20); + const finalcut::FPoint p2 (0,-30); + const finalcut::FPoint p3 = p1 - p2; CPPUNIT_ASSERT ( p3.getX() == -5 ); CPPUNIT_ASSERT ( p3.getY() == 10 ); - CPPUNIT_ASSERT ( p1 - p2 == FPoint(-5,10) ); - CPPUNIT_ASSERT ( p1 - FPoint() == p1 ); - CPPUNIT_ASSERT ( FPoint() - FPoint() == FPoint() ); + CPPUNIT_ASSERT ( p1 - p2 == finalcut::FPoint(-5,10) ); + CPPUNIT_ASSERT ( p1 - finalcut::FPoint() == p1 ); + CPPUNIT_ASSERT ( finalcut::FPoint() - finalcut::FPoint() == finalcut::FPoint() ); } //---------------------------------------------------------------------- void FPointTest::referenceTest() { - FPoint p1 (1,1); + finalcut::FPoint p1 (1,1); CPPUNIT_ASSERT ( p1.getX() == 1 ); CPPUNIT_ASSERT ( p1.getY() == 1 ); @@ -285,7 +285,7 @@ void FPointTest::referenceTest() //---------------------------------------------------------------------- void FPointTest::streamInsertionTest() { - FPoint out; + finalcut::FPoint out; std::stringstream stream; stream.str("10 5"); stream >> out; @@ -302,7 +302,7 @@ void FPointTest::streamInsertionTest() //---------------------------------------------------------------------- void FPointTest::streamExtractionTest() { - FPoint in; + finalcut::FPoint in; in.setPoint (-7, 5); std::stringstream stream; stream << in; diff --git a/src/test/frect-test.cpp b/src/test/frect-test.cpp index 157e90a7..d5cbb316 100644 --- a/src/test/frect-test.cpp +++ b/src/test/frect-test.cpp @@ -1,5 +1,5 @@ /*********************************************************************** -* frect-test.cpp - FRect unit tests * +* frect-test.cpp - finalcut::FRect unit tests * * * * This file is part of the Final Cut widget toolkit * * * @@ -91,7 +91,7 @@ class FRectTest : public CPPUNIT_NS::TestFixture //---------------------------------------------------------------------- void FRectTest::classNameTest() { - FRect r; + finalcut::FRect r; const char* const classname = r.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname, "FRect") == 0 ); } @@ -99,7 +99,7 @@ void FRectTest::classNameTest() //---------------------------------------------------------------------- void FRectTest::noArgumentTest() { - const FRect rectangle; + const finalcut::FRect rectangle; CPPUNIT_ASSERT ( rectangle.getX1() == 0 ); CPPUNIT_ASSERT ( rectangle.getY1() == 0 ); CPPUNIT_ASSERT ( rectangle.getX2() == -1 ); @@ -107,18 +107,18 @@ void FRectTest::noArgumentTest() CPPUNIT_ASSERT ( rectangle.isNull() ); CPPUNIT_ASSERT ( rectangle.getWidth() == 0 ); CPPUNIT_ASSERT ( rectangle.getHeight() == 0 ); - CPPUNIT_ASSERT ( rectangle.getPos() == FPoint(0, 0) ); - CPPUNIT_ASSERT ( rectangle.getUpperLeftPos() == FPoint(0, 0) ); - CPPUNIT_ASSERT ( rectangle.getUpperRightPos() == FPoint(-1, 0) ); - CPPUNIT_ASSERT ( rectangle.getLowerLeftPos() == FPoint(0, -1) ); - CPPUNIT_ASSERT ( rectangle.getLowerRightPos() == FPoint(-1, -1) ); + CPPUNIT_ASSERT ( rectangle.getPos() == finalcut::FPoint(0, 0) ); + CPPUNIT_ASSERT ( rectangle.getUpperLeftPos() == finalcut::FPoint(0, 0) ); + CPPUNIT_ASSERT ( rectangle.getUpperRightPos() == finalcut::FPoint(-1, 0) ); + CPPUNIT_ASSERT ( rectangle.getLowerLeftPos() == finalcut::FPoint(0, -1) ); + CPPUNIT_ASSERT ( rectangle.getLowerRightPos() == finalcut::FPoint(-1, -1) ); } //---------------------------------------------------------------------- void FRectTest::copyConstructorTest() { - const FRect r1(1, 1, 20, 10); - const FRect r2 (r1); + const finalcut::FRect r1(1, 1, 20, 10); + const finalcut::FRect r2 (r1); CPPUNIT_ASSERT ( r2.getX() == 1 ); CPPUNIT_ASSERT ( r2.getY() == 1 ); CPPUNIT_ASSERT ( ! r2.isNull() ); @@ -129,7 +129,7 @@ void FRectTest::copyConstructorTest() //---------------------------------------------------------------------- void FRectTest::assignmentTest() { - const FRect r1(3, 5, 45, 14); + const finalcut::FRect r1(3, 5, 45, 14); CPPUNIT_ASSERT ( r1.getX1() == 3 ); CPPUNIT_ASSERT ( r1.getY1() == 5 ); CPPUNIT_ASSERT ( r1.getX2() == 47 ); @@ -137,7 +137,7 @@ void FRectTest::assignmentTest() CPPUNIT_ASSERT ( r1.getWidth() == 45 ); CPPUNIT_ASSERT ( r1.getHeight() == 14 ); - FRect r2 (r1); + finalcut::FRect r2 (r1); CPPUNIT_ASSERT ( r2 == r1 ); CPPUNIT_ASSERT ( r2.getX1() == 3 ); CPPUNIT_ASSERT ( r2.getY1() == 5 ); @@ -146,7 +146,7 @@ void FRectTest::assignmentTest() CPPUNIT_ASSERT ( r2.getWidth() == 45 ); CPPUNIT_ASSERT ( r2.getHeight() == 14 ); - FRect r3(3, 3, 10, 10); + finalcut::FRect r3(3, 3, 10, 10); r3 = r2; CPPUNIT_ASSERT ( r3 == r2 ); CPPUNIT_ASSERT ( r3.getX1() == 3 ); @@ -156,7 +156,7 @@ void FRectTest::assignmentTest() CPPUNIT_ASSERT ( r3.getWidth() == 45 ); CPPUNIT_ASSERT ( r3.getHeight() == 14 ); - r3.setPos(FPoint(1, 1)); + r3.setPos(finalcut::FPoint(1, 1)); CPPUNIT_ASSERT ( r3 != r2 ); CPPUNIT_ASSERT ( r3.getX1() == 1 ); CPPUNIT_ASSERT ( r3.getY1() == 1 ); @@ -264,8 +264,8 @@ void FRectTest::assignmentTest() CPPUNIT_ASSERT ( r3.getWidth() == 5 ); CPPUNIT_ASSERT ( r3.getHeight() == 5 ); - const FPoint p1(3, 3); - const FPoint p2(30, 10); + const finalcut::FPoint p1(3, 3); + const finalcut::FPoint p2(30, 10); r3.setCoordinates (p1, p2); CPPUNIT_ASSERT ( r3.getX1() == 3 ); CPPUNIT_ASSERT ( r3.getY1() == 3 ); @@ -282,7 +282,7 @@ void FRectTest::assignmentTest() CPPUNIT_ASSERT ( r3.getWidth() == 31 ); CPPUNIT_ASSERT ( r3.getHeight() == 39 ); - FRect r4(p1, p2); + finalcut::FRect r4(p1, p2); CPPUNIT_ASSERT ( r4.getX1() == 3 ); CPPUNIT_ASSERT ( r4.getY1() == 3 ); CPPUNIT_ASSERT ( r4.getX2() == 30 ); @@ -294,32 +294,32 @@ void FRectTest::assignmentTest() //---------------------------------------------------------------------- void FRectTest::equalTest() { - const FRect r1 (1, 2, 10, 20); - const FRect r2 (1, 2, 10, 20); + const finalcut::FRect r1 (1, 2, 10, 20); + const finalcut::FRect r2 (1, 2, 10, 20); CPPUNIT_ASSERT ( r1 == r2 ); - CPPUNIT_ASSERT ( FRect(1, 2, 10, 20) == r2 ); - CPPUNIT_ASSERT ( r1 == FRect(1, 2, 10, 20) ); - CPPUNIT_ASSERT ( FRect() == FRect() ); + CPPUNIT_ASSERT ( finalcut::FRect(1, 2, 10, 20) == r2 ); + CPPUNIT_ASSERT ( r1 == finalcut::FRect(1, 2, 10, 20) ); + CPPUNIT_ASSERT ( finalcut::FRect() == finalcut::FRect() ); } //---------------------------------------------------------------------- void FRectTest::notEqualTest() { - const FRect r1 (1, 2, 10, 20); - const FRect r2 (1, 2, 15, 25); + const finalcut::FRect r1 (1, 2, 10, 20); + const finalcut::FRect r2 (1, 2, 15, 25); CPPUNIT_ASSERT ( r1 != r2 ); - CPPUNIT_ASSERT ( FRect(1, 2, 10, 20) != r2 ); - CPPUNIT_ASSERT ( r1 != FRect(3, 4, 10, 20) ); - CPPUNIT_ASSERT ( FRect() != r2 ); - CPPUNIT_ASSERT ( r1 != FRect() ); + CPPUNIT_ASSERT ( finalcut::FRect(1, 2, 10, 20) != r2 ); + CPPUNIT_ASSERT ( r1 != finalcut::FRect(3, 4, 10, 20) ); + CPPUNIT_ASSERT ( finalcut::FRect() != r2 ); + CPPUNIT_ASSERT ( r1 != finalcut::FRect() ); } //---------------------------------------------------------------------- void FRectTest::additionTest() { - const FRect r1 (1, 2, 10, 10); - const FPoint p (3, 5); - const FRect r2 = r1 + p; + const finalcut::FRect r1 (1, 2, 10, 10); + const finalcut::FPoint p (3, 5); + const finalcut::FRect r2 = r1 + p; CPPUNIT_ASSERT ( r2.getX1() == 1 ); CPPUNIT_ASSERT ( r2.getY1() == 2 ); CPPUNIT_ASSERT ( r2.getX2() == 13 ); @@ -331,9 +331,9 @@ void FRectTest::additionTest() //---------------------------------------------------------------------- void FRectTest::subtractionTest() { - const FRect r1 (2, 2, 12, 12); - const FPoint p (5, 5); - const FRect r2 = r1 - p; + const finalcut::FRect r1 (2, 2, 12, 12); + const finalcut::FPoint p (5, 5); + const finalcut::FRect r2 = r1 - p; CPPUNIT_ASSERT ( r2.getX1() == 2 ); CPPUNIT_ASSERT ( r2.getY1() == 2 ); CPPUNIT_ASSERT ( r2.getX2() == 8 ); @@ -345,7 +345,7 @@ void FRectTest::subtractionTest() //---------------------------------------------------------------------- void FRectTest::referenceTest() { - FRect r1 (1, 1, 10, 20); + finalcut::FRect r1 (1, 1, 10, 20); CPPUNIT_ASSERT ( r1.getX1() == 1 ); CPPUNIT_ASSERT ( r1.getY1() == 1 ); CPPUNIT_ASSERT ( r1.getX2() == 10 ); @@ -378,7 +378,7 @@ void FRectTest::referenceTest() //---------------------------------------------------------------------- void FRectTest::moveTest() { - FRect r1 (1, 2, 10, 20); + finalcut::FRect r1 (1, 2, 10, 20); CPPUNIT_ASSERT ( r1.getX() == 1 ); CPPUNIT_ASSERT ( r1.getY() == 2 ); CPPUNIT_ASSERT ( r1.getWidth() == 10 ); @@ -386,7 +386,7 @@ void FRectTest::moveTest() CPPUNIT_ASSERT ( r1.getX2() == 10 ); CPPUNIT_ASSERT ( r1.getY2() == 21 ); - const FPoint p1 (2,3); + const finalcut::FPoint p1 (2,3); r1.move(p1); CPPUNIT_ASSERT ( r1.getX() == 3 ); CPPUNIT_ASSERT ( r1.getY() == 5 ); @@ -407,17 +407,17 @@ void FRectTest::moveTest() //---------------------------------------------------------------------- void FRectTest::containsTest() { - const FRect r1 (1, 2, 10, 20); + const finalcut::FRect r1 (1, 2, 10, 20); CPPUNIT_ASSERT ( r1.contains(5, 5) ); CPPUNIT_ASSERT ( ! r1.contains(0, 1) ); - const FPoint p1 (3, 4); - const FPoint p2 (3, 25); + const finalcut::FPoint p1 (3, 4); + const finalcut::FPoint p2 (3, 25); CPPUNIT_ASSERT ( r1.contains(p1) ); CPPUNIT_ASSERT ( ! r1.contains(p2) ); - const FRect r2 (5, 5, 10, 20); - const FRect r3 (2, 3, 9, 19); + const finalcut::FRect r2 (5, 5, 10, 20); + const finalcut::FRect r3 (2, 3, 9, 19); CPPUNIT_ASSERT ( !r1.contains(r2) ); CPPUNIT_ASSERT ( r1.contains(r3) ); } @@ -425,12 +425,12 @@ void FRectTest::containsTest() //---------------------------------------------------------------------- void FRectTest::overlapTest() { - const FRect r1 (1, 2, 10, 20); - const FRect r2 (5, 5, 10, 20); - const FRect r3 (2, 3, 9, 19); - const FRect r4 (10, 20, 10, 20); - const FRect r5 (11, 21, 10, 20); - const FRect r6 (-5, -3, 2, 3); + const finalcut::FRect r1 (1, 2, 10, 20); + const finalcut::FRect r2 (5, 5, 10, 20); + const finalcut::FRect r3 (2, 3, 9, 19); + const finalcut::FRect r4 (10, 20, 10, 20); + const finalcut::FRect r5 (11, 21, 10, 20); + const finalcut::FRect r6 (-5, -3, 2, 3); CPPUNIT_ASSERT ( r1.overlap(r2) ); CPPUNIT_ASSERT ( r1.overlap(r3) ); CPPUNIT_ASSERT ( r1.overlap(r4) ); @@ -441,9 +441,9 @@ void FRectTest::overlapTest() //---------------------------------------------------------------------- void FRectTest::intersectTest() { - const FRect r1 (1, 2, 5, 5); - const FRect r2 (1, 2, 5, 5); - FRect r3 = r1.intersect(r2); + const finalcut::FRect r1 (1, 2, 5, 5); + const finalcut::FRect r2 (1, 2, 5, 5); + finalcut::FRect r3 = r1.intersect(r2); CPPUNIT_ASSERT ( r3.getX() == 1 ); CPPUNIT_ASSERT ( r3.getY() == 2 ); CPPUNIT_ASSERT ( r3.getWidth() == 5 ); @@ -451,7 +451,7 @@ void FRectTest::intersectTest() CPPUNIT_ASSERT ( r3.getX2() == 5 ); CPPUNIT_ASSERT ( r3.getY2() == 6 ); - const FRect r4 (4, 2, 5, 6); + const finalcut::FRect r4 (4, 2, 5, 6); r3 = r1.intersect(r4); CPPUNIT_ASSERT ( r3.getX() == 4 ); CPPUNIT_ASSERT ( r3.getY() == 2 ); @@ -464,9 +464,9 @@ void FRectTest::intersectTest() //---------------------------------------------------------------------- void FRectTest::combinedTest() { - const FRect r1 (1, 2, 5, 5); - const FRect r2 (1, 2, 5, 5); - FRect r3 = r1.combined(r2); + const finalcut::FRect r1 (1, 2, 5, 5); + const finalcut::FRect r2 (1, 2, 5, 5); + finalcut::FRect r3 = r1.combined(r2); CPPUNIT_ASSERT ( r3.getX() == 1 ); CPPUNIT_ASSERT ( r3.getY() == 2 ); CPPUNIT_ASSERT ( r3.getWidth() == 5 ); @@ -474,7 +474,7 @@ void FRectTest::combinedTest() CPPUNIT_ASSERT ( r3.getX2() == 5 ); CPPUNIT_ASSERT ( r3.getY2() == 6 ); - const FRect r4 (4, 2, 5, 6); + const finalcut::FRect r4 (4, 2, 5, 6); r3 = r1.combined(r4); CPPUNIT_ASSERT ( r3.getX() == 1 ); CPPUNIT_ASSERT ( r3.getY() == 2 ); @@ -487,7 +487,7 @@ void FRectTest::combinedTest() //---------------------------------------------------------------------- void FRectTest::streamInsertionTest() { - FRect out; + finalcut::FRect out; std::stringstream stream; stream.str("10 5 60 20"); stream >> out; @@ -508,7 +508,7 @@ void FRectTest::streamInsertionTest() //---------------------------------------------------------------------- void FRectTest::streamExtractionTest() { - FRect in; + finalcut::FRect in; in.setCoordinates (-7, 5, -1, 10); std::stringstream stream; stream << in; diff --git a/src/test/fstring-test.cpp b/src/test/fstring-test.cpp index 71e358ee..1881b216 100644 --- a/src/test/fstring-test.cpp +++ b/src/test/fstring-test.cpp @@ -1,5 +1,5 @@ /*********************************************************************** -* fstring-test.cpp - FString unit tests * +* fstring-test.cpp - finalcut::FString unit tests * * * * This file is part of the Final Cut widget toolkit * * * @@ -91,7 +91,7 @@ class FStringTest : public CPPUNIT_NS::TestFixture void controlCodesTest(); private: - FString* s; + finalcut::FString* s; // Adds code needed to register the test suite CPPUNIT_TEST_SUITE (FStringTest); @@ -138,7 +138,7 @@ class FStringTest : public CPPUNIT_NS::TestFixture void FStringTest::setUp() { std::setlocale(LC_CTYPE, ""); - s = new FString('c'); + s = new finalcut::FString('c'); } //---------------------------------------------------------------------- @@ -150,7 +150,7 @@ void FStringTest::tearDown() //---------------------------------------------------------------------- void FStringTest::classNameTest() { - FString str; + finalcut::FString str; const char* const classname = str.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname, "FString") == 0 ); } @@ -158,7 +158,7 @@ void FStringTest::classNameTest() //---------------------------------------------------------------------- void FStringTest::noArgumentTest() { - FString empty; + finalcut::FString empty; CPPUNIT_ASSERT ( empty.isNull() ); CPPUNIT_ASSERT ( empty.isEmpty() ); CPPUNIT_ASSERT ( empty.getLength() == 0 ); @@ -166,10 +166,10 @@ void FStringTest::noArgumentTest() CPPUNIT_ASSERT ( empty.wc_str() == 0 ); CPPUNIT_ASSERT ( empty.c_str() == 0 ); CPPUNIT_ASSERT_EQUAL ( empty.toString(), std::string() ); - CPPUNIT_ASSERT ( strlen(FString(99).c_str()) == 0 ); - CPPUNIT_ASSERT ( wcslen(FString(99).wc_str()) == 0 ); - CPPUNIT_ASSERT ( strlen(FString("").c_str()) == 0 ); - CPPUNIT_ASSERT ( wcslen(FString("").wc_str()) == 0 ); + CPPUNIT_ASSERT ( strlen(finalcut::FString(99).c_str()) == 0 ); + CPPUNIT_ASSERT ( wcslen(finalcut::FString(99).wc_str()) == 0 ); + CPPUNIT_ASSERT ( strlen(finalcut::FString("").c_str()) == 0 ); + CPPUNIT_ASSERT ( wcslen(finalcut::FString("").wc_str()) == 0 ); char* cstr = empty.c_str(); CPPUNIT_ASSERT ( cstr == 0 ); @@ -179,18 +179,18 @@ void FStringTest::noArgumentTest() CPPUNIT_ASSERT ( str.length() == 0 ); CPPUNIT_ASSERT ( str.size() == 0 ); CPPUNIT_ASSERT ( str.empty() ); - const FString fstr = str; + const finalcut::FString fstr = str; CPPUNIT_ASSERT ( ! fstr.isNull() ); CPPUNIT_ASSERT ( fstr.isEmpty() ); cstr = 0; CPPUNIT_ASSERT ( empty == cstr ); - CPPUNIT_ASSERT ( FString(std::string()).isEmpty() ); - CPPUNIT_ASSERT ( FString(char(0)).isEmpty() ); + CPPUNIT_ASSERT ( finalcut::FString(std::string()).isEmpty() ); + CPPUNIT_ASSERT ( finalcut::FString(char(0)).isEmpty() ); wcstr = 0; CPPUNIT_ASSERT ( empty == wcstr ); - CPPUNIT_ASSERT ( FString(std::wstring()).isEmpty() ); - CPPUNIT_ASSERT ( FString(wchar_t(0)).isEmpty() ); + CPPUNIT_ASSERT ( finalcut::FString(std::wstring()).isEmpty() ); + CPPUNIT_ASSERT ( finalcut::FString(wchar_t(0)).isEmpty() ); CPPUNIT_ASSERT ( ! empty.includes('A') ); CPPUNIT_ASSERT ( ! empty.includes(L'A') ); @@ -198,7 +198,7 @@ void FStringTest::noArgumentTest() CPPUNIT_ASSERT ( ! empty.includes(L"123") ); CPPUNIT_ASSERT ( ! empty.includes(std::string("123")) ); CPPUNIT_ASSERT ( ! empty.includes(std::wstring(L"123")) ); - CPPUNIT_ASSERT ( ! empty.includes(FString("123")) ); + CPPUNIT_ASSERT ( ! empty.includes(finalcut::FString("123")) ); std::ostringstream out; out << empty; @@ -206,7 +206,7 @@ void FStringTest::noArgumentTest() // Fill the empty string with "123" empty << "123"; - CPPUNIT_ASSERT_EQUAL ( empty, FString(L"123") ); + CPPUNIT_ASSERT_EQUAL ( empty, finalcut::FString(L"123") ); empty.clear(); CPPUNIT_ASSERT ( empty.isNull() ); @@ -215,59 +215,59 @@ void FStringTest::noArgumentTest() //---------------------------------------------------------------------- void FStringTest::initLengthTest() { - const FString s1(0); + const finalcut::FString s1(0); CPPUNIT_ASSERT ( s1.getLength() == 0 ); CPPUNIT_ASSERT ( s1.isNull() ); CPPUNIT_ASSERT ( s1.isEmpty() ); const int x1 = 10; const uInt x2 = 10; - const FString s2(x1); + const finalcut::FString s2(x1); CPPUNIT_ASSERT ( s2.getLength() == 10 ); CPPUNIT_ASSERT ( ! s2.isNull() ); CPPUNIT_ASSERT ( s2.isEmpty() ); - const FString s3(x2); + const finalcut::FString s3(x2); CPPUNIT_ASSERT ( s3.getLength() == 10 ); CPPUNIT_ASSERT ( ! s3.isNull() ); CPPUNIT_ASSERT ( s3.isEmpty() ); - const FString s4(0, L'-'); + const finalcut::FString s4(0, L'-'); CPPUNIT_ASSERT ( s4.getLength() == 0 ); CPPUNIT_ASSERT ( s4.isNull() ); CPPUNIT_ASSERT ( s4.isEmpty() ); - const FString s5(0, '-'); + const finalcut::FString s5(0, '-'); CPPUNIT_ASSERT ( s5.getLength() == 0 ); CPPUNIT_ASSERT ( s5.isNull() ); CPPUNIT_ASSERT ( s5.isEmpty() ); - const FString s6(0, char(0)); + const finalcut::FString s6(0, char(0)); CPPUNIT_ASSERT ( s6.getLength() == 0 ); CPPUNIT_ASSERT ( s6.isNull() ); CPPUNIT_ASSERT ( s6.isEmpty() ); - const FString s7(x1, '-'); + const finalcut::FString s7(x1, '-'); CPPUNIT_ASSERT ( s7.getLength() == 10 ); CPPUNIT_ASSERT ( ! s7.isNull() ); CPPUNIT_ASSERT ( ! s7.isEmpty() ); - const FString s8(x2, '-'); + const finalcut::FString s8(x2, '-'); CPPUNIT_ASSERT ( s8.getLength() == 10 ); CPPUNIT_ASSERT ( ! s8.isNull() ); CPPUNIT_ASSERT ( ! s8.isEmpty() ); - const FString s9(x1, L'-'); + const finalcut::FString s9(x1, L'-'); CPPUNIT_ASSERT ( s9.getLength() == 10 ); CPPUNIT_ASSERT ( ! s9.isNull() ); CPPUNIT_ASSERT ( ! s9.isEmpty() ); - const FString s10(x2, L'-'); + const finalcut::FString s10(x2, L'-'); CPPUNIT_ASSERT ( s10.getLength() == 10 ); CPPUNIT_ASSERT ( ! s10.isNull() ); CPPUNIT_ASSERT ( ! s10.isEmpty() ); - const FString s11(x2, wchar_t(0)); + const finalcut::FString s11(x2, wchar_t(0)); CPPUNIT_ASSERT ( s11.getLength() == 10 ); CPPUNIT_ASSERT ( ! s11.isNull() ); CPPUNIT_ASSERT ( s11.isEmpty() ); @@ -276,8 +276,8 @@ void FStringTest::initLengthTest() //---------------------------------------------------------------------- void FStringTest::copyConstructorTest() { - const FString s1("abc"); - const FString s2(s1); + const finalcut::FString s1("abc"); + const finalcut::FString s2(s1); CPPUNIT_ASSERT ( s2 == L"abc" ); CPPUNIT_ASSERT ( s2.getLength() == 3 ); } @@ -285,8 +285,8 @@ void FStringTest::copyConstructorTest() //---------------------------------------------------------------------- void FStringTest::assignmentTest() { - FString s1; - s1 = static_cast(0); + finalcut::FString s1; + s1 = static_cast(0); CPPUNIT_ASSERT ( ! s1 ); CPPUNIT_ASSERT ( s1.isNull() ); CPPUNIT_ASSERT ( s1.isEmpty() ); @@ -321,7 +321,7 @@ void FStringTest::assignmentTest() CPPUNIT_ASSERT ( s1.isNull() ); CPPUNIT_ASSERT ( s1.isEmpty() ); - const FString s2("abc"); + const finalcut::FString s2("abc"); s1 = s2; CPPUNIT_ASSERT ( s1 ); CPPUNIT_ASSERT ( s1 == L"abc" ); @@ -414,14 +414,14 @@ void FStringTest::assignmentTest() //---------------------------------------------------------------------- void FStringTest::additionAssignmentTest() { - FString s1; - s1 += FString("abc"); + finalcut::FString s1; + s1 += finalcut::FString("abc"); CPPUNIT_ASSERT ( s1 == L"abc" ); - s1 += FString("def"); + s1 += finalcut::FString("def"); CPPUNIT_ASSERT ( s1 == L"abcdef" ); - s1 += FString(); + s1 += finalcut::FString(); CPPUNIT_ASSERT ( s1 == L"abcdef" ); - s1 += FString(""); + s1 += finalcut::FString(""); CPPUNIT_ASSERT ( s1 == L"abcdef" ); s1.clear(); @@ -466,9 +466,9 @@ void FStringTest::additionAssignmentTest() //---------------------------------------------------------------------- void FStringTest::additionTest() { - // FString member operator - const FString s1("abc"); - CPPUNIT_ASSERT ( s1 + FString("def") == L"abcdef" ); + // finalcut::FString member operator + const finalcut::FString s1("abc"); + CPPUNIT_ASSERT ( s1 + finalcut::FString("def") == L"abcdef" ); CPPUNIT_ASSERT ( s1 + std::wstring(L"def") == L"abcdef" ); CPPUNIT_ASSERT ( s1 + const_cast(L"def") == L"abcdef" ); CPPUNIT_ASSERT ( s1 + std::string("def") == L"abcdef" ); @@ -476,9 +476,9 @@ void FStringTest::additionTest() CPPUNIT_ASSERT ( s1 + wchar_t(L'd') == L"abcd" ); CPPUNIT_ASSERT ( s1 + char('d') == L"abcd" ); - // FString non-member operator - FString s2("abc"); - CPPUNIT_ASSERT ( s2 + FString("def") == L"abcdef" ); + // finalcut::FString non-member operator + finalcut::FString s2("abc"); + CPPUNIT_ASSERT ( s2 + finalcut::FString("def") == L"abcdef" ); CPPUNIT_ASSERT ( s2 + std::wstring(L"def") == L"abcdef" ); CPPUNIT_ASSERT ( s2 + const_cast(L"def") == L"abcdef" ); CPPUNIT_ASSERT ( s2 + std::string("def") == L"abcdef" ); @@ -487,52 +487,52 @@ void FStringTest::additionTest() CPPUNIT_ASSERT ( s2 + char('d') == L"abcd" ); const std::wstring& s3 = L"abc"; - CPPUNIT_ASSERT ( s3 + FString("def") == L"abcdef" ); + CPPUNIT_ASSERT ( s3 + finalcut::FString("def") == L"abcdef" ); const wchar_t s4[] = L"abc"; - CPPUNIT_ASSERT ( s4 + FString("def") == L"abcdef" ); + CPPUNIT_ASSERT ( s4 + finalcut::FString("def") == L"abcdef" ); const std::string& s5 = "abc"; - CPPUNIT_ASSERT ( s5 + FString("def") == L"abcdef" ); + CPPUNIT_ASSERT ( s5 + finalcut::FString("def") == L"abcdef" ); const char s6[] = "abc"; - CPPUNIT_ASSERT ( s6 + FString("def") == L"abcdef" ); + CPPUNIT_ASSERT ( s6 + finalcut::FString("def") == L"abcdef" ); const wchar_t c1 = L'a'; CPPUNIT_ASSERT ( c1 + s3 == L"aabc" ); - CPPUNIT_ASSERT ( c1 + FString("def") == L"adef" ); + CPPUNIT_ASSERT ( c1 + finalcut::FString("def") == L"adef" ); const char c2 = 'a'; CPPUNIT_ASSERT ( c2 + s5 == "aabc" ); - CPPUNIT_ASSERT ( c2 + FString("def") == L"adef" ); + CPPUNIT_ASSERT ( c2 + finalcut::FString("def") == L"adef" ); } //---------------------------------------------------------------------- void FStringTest::caseTest() { - const FString str1("abc"); + const finalcut::FString str1("abc"); CPPUNIT_ASSERT ( str1.toUpper() == "ABC" ); - const FString str2("XYZ"); + const finalcut::FString str2("XYZ"); CPPUNIT_ASSERT ( str2.toLower() == "xyz" ); } //---------------------------------------------------------------------- void FStringTest::equalTest() { - // std::string -> FString -> std::string + // std::string -> finalcut::FString -> std::string const std::string s1 = "string"; - FString fs = s1; + finalcut::FString fs = s1; const std::string s2 = fs.toString(); CPPUNIT_ASSERT ( s1 == s2 ); - // std::wstring -> FString -> std::wstring + // std::wstring -> finalcut::FString -> std::wstring const std::wstring ws1 = L"wide string"; fs = ws1; std::wstring ws2 = fs.wc_str(); CPPUNIT_ASSERT ( ws1 == ws2 ); - const FString one_char('a'); + const finalcut::FString one_char('a'); const char ch = 'a'; CPPUNIT_ASSERT ( one_char == ch ); CPPUNIT_ASSERT ( ch == one_char.c_str()[0] ); @@ -542,8 +542,8 @@ void FStringTest::equalTest() CPPUNIT_ASSERT ( one_char == wch ); CPPUNIT_ASSERT ( wch == one_char.wc_str()[0] ); - const FString str(L"abc"); - const FString str2(L"abc"); + const finalcut::FString str(L"abc"); + const finalcut::FString str2(L"abc"); CPPUNIT_ASSERT ( str == str2 ); const char cstr[] = "abc"; @@ -562,8 +562,8 @@ void FStringTest::equalTest() const std::wstring wst = L"abc"; CPPUNIT_ASSERT ( str == wst ); - const FString null_str1; - const FString null_str2; + const finalcut::FString null_str1; + const finalcut::FString null_str2; CPPUNIT_ASSERT ( ! (str == null_str2) ); CPPUNIT_ASSERT ( ! (null_str1 == str) ); CPPUNIT_ASSERT ( null_str1 == null_str2 ); @@ -575,7 +575,7 @@ void FStringTest::equalTest() //---------------------------------------------------------------------- void FStringTest::notEqualTest() { - const FString one_char('@'); + const finalcut::FString one_char('@'); const char ch = '!'; CPPUNIT_ASSERT ( one_char != ch ); CPPUNIT_ASSERT ( ch != one_char.c_str()[0] ); @@ -585,8 +585,8 @@ void FStringTest::notEqualTest() CPPUNIT_ASSERT ( one_char != wch ); CPPUNIT_ASSERT ( wch != one_char.wc_str()[0] ); - const FString s1 = L"ABC"; // latin letter - const FString s2 = L"АВС"; // cyrillic letters + const finalcut::FString s1 = L"ABC"; // latin letter + const finalcut::FString s2 = L"АВС"; // cyrillic letters CPPUNIT_ASSERT ( s1 != s2 ); const char cstr[] = "abc"; @@ -609,8 +609,8 @@ void FStringTest::notEqualTest() const std::wstring wst = L"abc"; CPPUNIT_ASSERT ( s1 != wst ); - const FString null_str1; - const FString null_str2; + const finalcut::FString null_str1; + const finalcut::FString null_str2; CPPUNIT_ASSERT ( s1 != null_str2 ); CPPUNIT_ASSERT ( null_str1 != s1 ); CPPUNIT_ASSERT ( ! (null_str1 != null_str2) ); @@ -621,16 +621,16 @@ void FStringTest::notEqualTest() //---------------------------------------------------------------------- void FStringTest::lessEqualTest() { - const FString one_char('x'); + const finalcut::FString one_char('x'); const char ch = 'z'; CPPUNIT_ASSERT ( one_char <= ch ); const wchar_t wch = L'z'; CPPUNIT_ASSERT ( one_char <= wch ); - const FString s1 = L"xyz"; - const FString s2 = L"xyz"; - const FString s3 = L"xzz"; + const finalcut::FString s1 = L"xyz"; + const finalcut::FString s2 = L"xyz"; + const finalcut::FString s3 = L"xzz"; CPPUNIT_ASSERT ( s1 <= s2 && s1 == s2 ); CPPUNIT_ASSERT ( s1 <= s3 && s1 != s3 ); @@ -654,9 +654,9 @@ void FStringTest::lessEqualTest() CPPUNIT_ASSERT ( s1 <= wst1 && s1 == wst1 ); CPPUNIT_ASSERT ( s1 <= wst2 && s1 != wst2 ); - const FString null_str1; - const FString null_str2; - const FString empty(""); + const finalcut::FString null_str1; + const finalcut::FString null_str2; + const finalcut::FString empty(""); CPPUNIT_ASSERT ( ! (s1 <= null_str2) ); CPPUNIT_ASSERT ( null_str1 <= s2 ); CPPUNIT_ASSERT ( null_str1 <= null_str2 ); @@ -666,15 +666,15 @@ void FStringTest::lessEqualTest() //---------------------------------------------------------------------- void FStringTest::lessTest() { - const FString one_char('x'); + const finalcut::FString one_char('x'); const char ch = 'z'; CPPUNIT_ASSERT ( one_char < ch ); const wchar_t wch = L'z'; CPPUNIT_ASSERT ( one_char < wch ); - const FString s1 = L"xyz"; - const FString s2 = L"xzz"; + const finalcut::FString s1 = L"xyz"; + const finalcut::FString s2 = L"xzz"; CPPUNIT_ASSERT ( s1 < s2 ); const char cstr[] = "xzz"; @@ -689,8 +689,8 @@ void FStringTest::lessTest() const std::wstring wst = L"xzz"; CPPUNIT_ASSERT ( s1 < wst ); - const FString null_str1; - const FString null_str2; + const finalcut::FString null_str1; + const finalcut::FString null_str2; CPPUNIT_ASSERT ( ! (s1 < null_str2) ); CPPUNIT_ASSERT ( null_str1 < s2 ); CPPUNIT_ASSERT ( ! (null_str1 < null_str2) ); @@ -699,16 +699,16 @@ void FStringTest::lessTest() //---------------------------------------------------------------------- void FStringTest::greaterEqualTest() { - const FString one_char('x'); + const finalcut::FString one_char('x'); const char ch = 'x'; CPPUNIT_ASSERT ( one_char >= ch ); const wchar_t wch = L'x'; CPPUNIT_ASSERT ( one_char >= wch ); - const FString s1 = L"xyz"; - const FString s2 = L"xyz"; - const FString s3 = L"xxz"; + const finalcut::FString s1 = L"xyz"; + const finalcut::FString s2 = L"xyz"; + const finalcut::FString s3 = L"xxz"; CPPUNIT_ASSERT ( s1 >= s2 && s1 == s2 ); CPPUNIT_ASSERT ( s1 >= s3 && s1 != s3 ); @@ -732,9 +732,9 @@ void FStringTest::greaterEqualTest() CPPUNIT_ASSERT ( s1 >= wst1 && s1 == wst1 ); CPPUNIT_ASSERT ( s1 >= wst2 && s1 != wst2 ); - const FString null_str1; - const FString null_str2; - const FString empty(""); + const finalcut::FString null_str1; + const finalcut::FString null_str2; + const finalcut::FString empty(""); CPPUNIT_ASSERT ( s1 >= null_str2 ); CPPUNIT_ASSERT ( ! (null_str1 >= s2) ); CPPUNIT_ASSERT ( null_str1 >= null_str2 ); @@ -744,15 +744,15 @@ void FStringTest::greaterEqualTest() //---------------------------------------------------------------------- void FStringTest::greaterTest() { - const FString one_char('x'); + const finalcut::FString one_char('x'); const char ch = 'w'; CPPUNIT_ASSERT ( one_char > ch ); const wchar_t wch = L'w'; CPPUNIT_ASSERT ( one_char > wch ); - const FString s1 = L"xyz"; - const FString s2 = L"xww"; + const finalcut::FString s1 = L"xyz"; + const finalcut::FString s2 = L"xww"; CPPUNIT_ASSERT ( s1 > s2 ); const char cstr[] = "xww"; @@ -767,8 +767,8 @@ void FStringTest::greaterTest() const std::wstring wst = L"xww"; CPPUNIT_ASSERT ( s1 > wst ); - const FString null_str1; - const FString null_str2; + const finalcut::FString null_str1; + const finalcut::FString null_str2; CPPUNIT_ASSERT ( s1 > null_str2 ); CPPUNIT_ASSERT ( ! (null_str1 > s2) ); CPPUNIT_ASSERT ( ! (null_str1 > null_str2) ); @@ -777,8 +777,8 @@ void FStringTest::greaterTest() //---------------------------------------------------------------------- void FStringTest::streamInsertionTest() { - FString out; - out << FString("ABC"); + finalcut::FString out; + out << finalcut::FString("ABC"); CPPUNIT_ASSERT ( out == L"ABC" ); out.clear(); @@ -862,59 +862,59 @@ void FStringTest::streamInsertionTest() //---------------------------------------------------------------------- void FStringTest::streamExtractionTest() { - FString in_1; - FString("ABC") >> in_1; + finalcut::FString in_1; + finalcut::FString("ABC") >> in_1; CPPUNIT_ASSERT ( in_1 == "ABC" ); std::wstring in_2; - FString("ABC") >> in_2; + finalcut::FString("ABC") >> in_2; CPPUNIT_ASSERT ( in_2 == L"ABC" ); std::string in_3; - FString("ABC") >> in_3; + finalcut::FString("ABC") >> in_3; CPPUNIT_ASSERT ( in_3 == "ABC" ); wchar_t in_4; - FString("A") >> in_4; + finalcut::FString("A") >> in_4; CPPUNIT_ASSERT ( in_4 == L'A' ); char in_5; - FString("A") >> in_5; + finalcut::FString("A") >> in_5; CPPUNIT_ASSERT ( in_5 == L'A' ); sInt16 in_6; - FString("-12345") >> in_6; + finalcut::FString("-12345") >> in_6; CPPUNIT_ASSERT ( in_6 == -12345 ); uInt16 in_7; - FString("33333") >> in_7; + finalcut::FString("33333") >> in_7; CPPUNIT_ASSERT ( in_7 == 33333 ); int in_8; - FString("-12345678") >> in_8; + finalcut::FString("-12345678") >> in_8; CPPUNIT_ASSERT ( in_8 == -12345678 ); uInt in_9; - FString("99999999") >> in_9; + finalcut::FString("99999999") >> in_9; CPPUNIT_ASSERT ( in_9 == 99999999 ); long in_10; - FString("-1234567890") >> in_10; + finalcut::FString("-1234567890") >> in_10; CPPUNIT_ASSERT ( in_10 == -1234567890 ); uLong in_11; - FString("9999999999999") >> in_11; + finalcut::FString("9999999999999") >> in_11; CPPUNIT_ASSERT ( in_11 == 9999999999999 ); float in_12; - FString("2.71828") >> in_12; + finalcut::FString("2.71828") >> in_12; CPPUNIT_ASSERT ( in_12 == 2.71828f ); double in_13; - FString("2.7182818284590452353") >> in_13; + finalcut::FString("2.7182818284590452353") >> in_13; CPPUNIT_ASSERT ( in_13 == 2.7182818284590452353 ); - FString in; + finalcut::FString in; std::istringstream istream("abc"); istream >> in; CPPUNIT_ASSERT ( in == "abc" ); @@ -927,7 +927,7 @@ void FStringTest::streamExtractionTest() //---------------------------------------------------------------------- void FStringTest::subscriptOperatorTest() { - FString s(3); + finalcut::FString s(3); CPPUNIT_ASSERT ( s[0] == L'\0' ); CPPUNIT_ASSERT ( s[1] == L'\0' ); CPPUNIT_ASSERT ( s[2] == L'\0' ); @@ -943,11 +943,11 @@ void FStringTest::subscriptOperatorTest() //---------------------------------------------------------------------- void FStringTest::iteratorTest() { - const FString& str = "123456789"; + const finalcut::FString& str = "123456789"; CPPUNIT_ASSERT ( str.front() == L'1' ); CPPUNIT_ASSERT ( str.back() == L'9' ); - FString::iterator iter = str.begin(); + finalcut::FString::iterator iter = str.begin(); CPPUNIT_ASSERT ( (*iter) == L'1' ); ++iter; CPPUNIT_ASSERT ( (*iter) == L'2' ); @@ -972,10 +972,10 @@ void FStringTest::iteratorTest() //---------------------------------------------------------------------- void FStringTest::functionCallOperatorTest() { - FString str = L"test"; + finalcut::FString str = L"test"; CPPUNIT_ASSERT_EQUAL ( str, str() ); - FString copy = str(); + finalcut::FString copy = str(); copy << L"string"; CPPUNIT_ASSERT ( str() == "test" ); CPPUNIT_ASSERT ( copy == "teststring" ); @@ -984,25 +984,25 @@ void FStringTest::functionCallOperatorTest() //---------------------------------------------------------------------- void FStringTest::formatTest() { - FString str1; + finalcut::FString str1; int num = 3; char location[] = "zoo"; str1.sprintf ("There are %d lions in the %s", num, location); CPPUNIT_ASSERT ( str1 == "There are 3 lions in the zoo" ); - str1.sprintf (FString("%d times"), 42); + str1.sprintf (finalcut::FString("%d times"), 42); CPPUNIT_ASSERT ( str1 == "42 times" ); - FString str2; + finalcut::FString str2; str2.sprintf (L"It costs only %d cent", 50); CPPUNIT_ASSERT ( str2 == "It costs only 50 cent" ); - str2.sprintf ( L"Add a looo" + FString(2048, 'o') + "ooong %S" + str2.sprintf ( L"Add a looo" + finalcut::FString(2048, 'o') + "ooong %S" , L"string" ); - CPPUNIT_ASSERT ( str2 == "Add a looo" + FString(2048, 'o') + CPPUNIT_ASSERT ( str2 == "Add a looo" + finalcut::FString(2048, 'o') + "ooong string" ); - const FString null_fstring; + const finalcut::FString null_fstring; str2.sprintf (null_fstring, 0); CPPUNIT_ASSERT ( str2.isNull() ); @@ -1015,7 +1015,7 @@ void FStringTest::formatTest() CPPUNIT_ASSERT ( str2.isNull() ); std::setlocale (LC_NUMERIC, "C"); - FString fnum1, fnum2; + finalcut::FString fnum1, fnum2; #if defined(__LP64__) || defined(_LP64) // 64-bit architecture @@ -1049,7 +1049,7 @@ void FStringTest::formatTest() //---------------------------------------------------------------------- void FStringTest::convertToNumberTest() { - FString str = "-127"; + finalcut::FString str = "-127"; CPPUNIT_ASSERT ( str.toShort() == -127 ); str = "255"; @@ -1098,141 +1098,141 @@ void FStringTest::convertFromNumberTest() const float n7 = 1234.56f; const double n8 = 1234.5678; const lDouble n9 = 12345.67890L; - CPPUNIT_ASSERT ( FString().setNumber(n1) == "-1234" ); - CPPUNIT_ASSERT ( FString().setNumber(n2) == "1234" ); - CPPUNIT_ASSERT ( FString().setNumber(n3) == "-12345" ); - CPPUNIT_ASSERT ( FString().setNumber(n4) == "12345" ); - CPPUNIT_ASSERT ( FString().setNumber(n5) == "-12345678" ); - CPPUNIT_ASSERT ( FString().setNumber(n6) == "12345678" ); - CPPUNIT_ASSERT ( FString().setNumber(n7) == "1234.56" ); - CPPUNIT_ASSERT ( FString().setNumber(n8) == "1234.5678" ); - CPPUNIT_ASSERT ( FString().setNumber(n9) == "12345.6789" ); - CPPUNIT_ASSERT ( FString().setNumber(n7, 0) == "1e+03" ); - CPPUNIT_ASSERT ( FString().setNumber(n8, 0) == "1e+03" ); - CPPUNIT_ASSERT ( FString().setNumber(n9, 0) == "1e+04" ); - CPPUNIT_ASSERT ( FString().setNumber(n7, 100) + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n1) == "-1234" ); + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n2) == "1234" ); + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n3) == "-12345" ); + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n4) == "12345" ); + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n5) == "-12345678" ); + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n6) == "12345678" ); + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n7) == "1234.56" ); + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n8) == "1234.5678" ); + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n9) == "12345.6789" ); + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n7, 0) == "1e+03" ); + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n8, 0) == "1e+03" ); + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n9, 0) == "1e+04" ); + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n7, 100) == "1234.56005859375" ); - CPPUNIT_ASSERT ( FString().setNumber(n8, 100) + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n8, 100) == "1234.567800000000033833202905952930450439453125" ); - CPPUNIT_ASSERT ( FString().setNumber(n9, 100) + CPPUNIT_ASSERT ( finalcut::FString().setNumber(n9, 100) == "12345.67889999999999961488583721802569925785064697265625" ); } //---------------------------------------------------------------------- void FStringTest::exceptionTest() { - CPPUNIT_ASSERT_THROW ( FString("abc").toULong() + CPPUNIT_ASSERT_THROW ( finalcut::FString("abc").toULong() , std::invalid_argument ); - CPPUNIT_ASSERT_THROW ( FString("abc")[3] + CPPUNIT_ASSERT_THROW ( finalcut::FString("abc")[3] , std::out_of_range ); - CPPUNIT_ASSERT_THROW ( FString("abc")[-1] + CPPUNIT_ASSERT_THROW ( finalcut::FString("abc")[-1] , std::out_of_range ); - CPPUNIT_ASSERT_THROW ( FString("99999").toShort() + CPPUNIT_ASSERT_THROW ( finalcut::FString("99999").toShort() , std::overflow_error ); - CPPUNIT_ASSERT_THROW ( FString("-99999").toShort() + CPPUNIT_ASSERT_THROW ( finalcut::FString("-99999").toShort() , std::underflow_error ); - CPPUNIT_ASSERT_THROW ( FString("99999").toUShort() + CPPUNIT_ASSERT_THROW ( finalcut::FString("99999").toUShort() , std::overflow_error ); - CPPUNIT_ASSERT_THROW ( FString("-1").toUShort() + CPPUNIT_ASSERT_THROW ( finalcut::FString("-1").toUShort() , std::underflow_error ); - CPPUNIT_ASSERT_THROW ( FString("9999999999").toInt() + CPPUNIT_ASSERT_THROW ( finalcut::FString("9999999999").toInt() , std::overflow_error ); - CPPUNIT_ASSERT_THROW ( FString("-9999999999").toInt() + CPPUNIT_ASSERT_THROW ( finalcut::FString("-9999999999").toInt() , std::underflow_error ); - CPPUNIT_ASSERT_THROW ( FString("9999999999").toUInt() + CPPUNIT_ASSERT_THROW ( finalcut::FString("9999999999").toUInt() , std::overflow_error ); - CPPUNIT_ASSERT_THROW ( FString("-1").toUInt() + CPPUNIT_ASSERT_THROW ( finalcut::FString("-1").toUInt() , std::underflow_error ); - CPPUNIT_ASSERT_THROW ( FString("9999999999999999999").toLong() + CPPUNIT_ASSERT_THROW ( finalcut::FString("9999999999999999999").toLong() , std::overflow_error ); - CPPUNIT_ASSERT_THROW ( FString("-9999999999999999999").toLong() + CPPUNIT_ASSERT_THROW ( finalcut::FString("-9999999999999999999").toLong() , std::underflow_error ); - CPPUNIT_ASSERT_THROW ( FString("99999999999999999999").toULong() + CPPUNIT_ASSERT_THROW ( finalcut::FString("99999999999999999999").toULong() , std::overflow_error ); - CPPUNIT_ASSERT_THROW ( FString("-1").toULong() + CPPUNIT_ASSERT_THROW ( finalcut::FString("-1").toULong() , std::underflow_error ); - CPPUNIT_ASSERT_THROW ( FString().toLong() + CPPUNIT_ASSERT_THROW ( finalcut::FString().toLong() , std::invalid_argument ); - CPPUNIT_ASSERT_THROW ( FString("").toLong() + CPPUNIT_ASSERT_THROW ( finalcut::FString("").toLong() , std::invalid_argument ); - CPPUNIT_ASSERT_THROW ( FString("one").toLong() + CPPUNIT_ASSERT_THROW ( finalcut::FString("one").toLong() , std::invalid_argument ); - CPPUNIT_ASSERT_THROW ( FString().toULong() + CPPUNIT_ASSERT_THROW ( finalcut::FString().toULong() , std::invalid_argument ); - CPPUNIT_ASSERT_THROW ( FString("").toULong() + CPPUNIT_ASSERT_THROW ( finalcut::FString("").toULong() , std::invalid_argument ); - CPPUNIT_ASSERT_THROW ( FString("one").toULong() + CPPUNIT_ASSERT_THROW ( finalcut::FString("one").toULong() , std::invalid_argument ); - CPPUNIT_ASSERT_THROW ( FString("1E+42").toFloat() + CPPUNIT_ASSERT_THROW ( finalcut::FString("1E+42").toFloat() , std::overflow_error ); - CPPUNIT_ASSERT_THROW ( FString("-1E+42").toFloat() + CPPUNIT_ASSERT_THROW ( finalcut::FString("-1E+42").toFloat() , std::overflow_error ); - CPPUNIT_ASSERT_THROW ( FString("1.19209290E-08").toFloat() + CPPUNIT_ASSERT_THROW ( finalcut::FString("1.19209290E-08").toFloat() , std::underflow_error ); - CPPUNIT_ASSERT_THROW ( FString("1.7976931348623157E+309").toDouble() + CPPUNIT_ASSERT_THROW ( finalcut::FString("1.7976931348623157E+309").toDouble() , std::overflow_error ); - CPPUNIT_ASSERT_THROW ( FString("-1.7976931348623157E+309").toDouble() + CPPUNIT_ASSERT_THROW ( finalcut::FString("-1.7976931348623157E+309").toDouble() , std::overflow_error ); - CPPUNIT_ASSERT_THROW ( FString("2.225074e-310").toDouble() + CPPUNIT_ASSERT_THROW ( finalcut::FString("2.225074e-310").toDouble() , std::underflow_error ); - CPPUNIT_ASSERT_THROW ( FString().toDouble() + CPPUNIT_ASSERT_THROW ( finalcut::FString().toDouble() , std::invalid_argument ); - CPPUNIT_ASSERT_THROW ( FString("").toDouble() + CPPUNIT_ASSERT_THROW ( finalcut::FString("").toDouble() , std::invalid_argument ); - CPPUNIT_ASSERT_THROW ( FString("one").toDouble() + CPPUNIT_ASSERT_THROW ( finalcut::FString("one").toDouble() , std::invalid_argument ); - CPPUNIT_ASSERT_THROW ( FString("ABC").insert(FString("abc"), 4) + CPPUNIT_ASSERT_THROW ( finalcut::FString("ABC").insert(finalcut::FString("abc"), 4) , std::out_of_range ); - CPPUNIT_ASSERT_THROW ( FString("ABC").insert(FString("abc"), -1) + CPPUNIT_ASSERT_THROW ( finalcut::FString("ABC").insert(finalcut::FString("abc"), -1) , std::out_of_range ); - CPPUNIT_ASSERT_THROW ( FString("ABC").insert(L"abc", 4) + CPPUNIT_ASSERT_THROW ( finalcut::FString("ABC").insert(L"abc", 4) , std::out_of_range ); - CPPUNIT_ASSERT_THROW ( FString("ABC").insert(L"abc", -1) + CPPUNIT_ASSERT_THROW ( finalcut::FString("ABC").insert(L"abc", -1) , std::out_of_range ); } //---------------------------------------------------------------------- void FStringTest::trimTest() { - const FString& trim_str1 = L"\r\n\t A string \n\t"; + const finalcut::FString& trim_str1 = L"\r\n\t A string \n\t"; CPPUNIT_ASSERT ( trim_str1.rtrim() == L"\r\n\t A string" ); CPPUNIT_ASSERT ( trim_str1.ltrim() == L"A string \n\t" ); CPPUNIT_ASSERT ( trim_str1.trim() == L"A string" ); - const FString& trim_str2 = L"\n \n\n"; + const finalcut::FString& trim_str2 = L"\n \n\n"; CPPUNIT_ASSERT ( trim_str2.rtrim().isEmpty() ); CPPUNIT_ASSERT ( ! trim_str2.rtrim().isNull() ); CPPUNIT_ASSERT ( trim_str2.rtrim().getLength() == 0 ); @@ -1241,7 +1241,7 @@ void FStringTest::trimTest() CPPUNIT_ASSERT ( ! trim_str2.ltrim().isNull() ); CPPUNIT_ASSERT ( trim_str2.ltrim().getLength() == 0 ); - const FString trim_str3; + const finalcut::FString trim_str3; CPPUNIT_ASSERT ( trim_str3.ltrim().isEmpty() ); CPPUNIT_ASSERT ( trim_str3.ltrim().isEmpty() ); CPPUNIT_ASSERT ( trim_str3.ltrim().getLength() == 0 ); @@ -1256,7 +1256,7 @@ void FStringTest::trimTest() //---------------------------------------------------------------------- void FStringTest::subStringTest() { - FString str1("Look behind you, a three-headed monkey!"); + finalcut::FString str1("Look behind you, a three-headed monkey!"); CPPUNIT_ASSERT ( str1.left(uInt(11)) == L"Look behind" ); CPPUNIT_ASSERT ( str1.left(int(11)) == L"Look behind" ); CPPUNIT_ASSERT ( str1.left(999) @@ -1265,9 +1265,9 @@ void FStringTest::subStringTest() CPPUNIT_ASSERT ( str1.left(0) == L"" ); CPPUNIT_ASSERT ( str1.left(0).isEmpty() ); CPPUNIT_ASSERT ( ! str1.left(0).isNull() ); - CPPUNIT_ASSERT ( FString().left(5).isNull() ); - CPPUNIT_ASSERT ( ! FString("").left(5).isNull() ); - CPPUNIT_ASSERT ( FString("").left(5).isEmpty() ); + CPPUNIT_ASSERT ( finalcut::FString().left(5).isNull() ); + CPPUNIT_ASSERT ( ! finalcut::FString("").left(5).isNull() ); + CPPUNIT_ASSERT ( finalcut::FString("").left(5).isEmpty() ); CPPUNIT_ASSERT ( str1.right(uInt(7)) == L"monkey!" ); CPPUNIT_ASSERT ( str1.right(int(7)) == L"monkey!" ); @@ -1277,9 +1277,9 @@ void FStringTest::subStringTest() CPPUNIT_ASSERT ( str1.right(0) == L"" ); CPPUNIT_ASSERT ( str1.right(0).isEmpty() ); CPPUNIT_ASSERT ( ! str1.right(0).isNull() ); - CPPUNIT_ASSERT ( FString().right(5).isNull() ); - CPPUNIT_ASSERT ( ! FString("").right(5).isNull() ); - CPPUNIT_ASSERT ( FString("").right(5).isEmpty() ); + CPPUNIT_ASSERT ( finalcut::FString().right(5).isNull() ); + CPPUNIT_ASSERT ( ! finalcut::FString("").right(5).isNull() ); + CPPUNIT_ASSERT ( finalcut::FString("").right(5).isEmpty() ); CPPUNIT_ASSERT ( str1.mid(uInt(18), uInt(21)) == L"a three-headed monkey" ); @@ -1293,12 +1293,12 @@ void FStringTest::subStringTest() CPPUNIT_ASSERT ( str1.mid(0, 5) == L"" ); CPPUNIT_ASSERT ( str1.mid(0, 0).isEmpty() ); CPPUNIT_ASSERT ( ! str1.mid(0, 0).isNull() ); - CPPUNIT_ASSERT ( FString().mid(5, 0).isNull() ); - CPPUNIT_ASSERT ( ! FString("").mid(5, 0).isNull() ); - CPPUNIT_ASSERT ( FString("").mid(5, 0).isEmpty() ); + CPPUNIT_ASSERT ( finalcut::FString().mid(5, 0).isNull() ); + CPPUNIT_ASSERT ( ! finalcut::FString("").mid(5, 0).isNull() ); + CPPUNIT_ASSERT ( finalcut::FString("").mid(5, 0).isEmpty() ); - FStringList string_parts = str1.split(" "); - FStringList string_list; + finalcut::FStringList string_parts = str1.split(" "); + finalcut::FStringList string_list; string_list.push_back("Look"); string_list.push_back("behind"); string_list.push_back("you,"); @@ -1316,7 +1316,7 @@ void FStringTest::subStringTest() string_parts = str1.split(','); CPPUNIT_ASSERT ( string_parts == string_list ); - string_parts = FString().split(':'); + string_parts = finalcut::FString().split(':'); CPPUNIT_ASSERT ( string_parts.empty() ); CPPUNIT_ASSERT ( string_parts.size() == 0 ); } @@ -1324,8 +1324,8 @@ void FStringTest::subStringTest() //---------------------------------------------------------------------- void FStringTest::insertTest() { - FString str1 = "ABC"; - const FString str2 = "xyz"; + finalcut::FString str1 = "ABC"; + const finalcut::FString str2 = "xyz"; CPPUNIT_ASSERT ( str1.insert(str2, 0) == "xyzABC" ); str1 = "ABC"; CPPUNIT_ASSERT ( str1.insert(str2, 1) == "AxyzBC" ); @@ -1378,16 +1378,16 @@ void FStringTest::insertTest() //---------------------------------------------------------------------- void FStringTest::replaceTest() { - const FString str = "Look behind you, a three-headed monkey!"; - FString s1 = str; - const FString from1 = "three"; + const finalcut::FString str = "Look behind you, a three-headed monkey!"; + finalcut::FString s1 = str; + const finalcut::FString from1 = "three"; const std::wstring from2 = L"three"; const wchar_t from3[] = L"three"; const std::string from4 = "three"; const char from5[] = "three"; const wchar_t from6 = L','; const char from7 = ','; - const FString to1 = L'3'; + const finalcut::FString to1 = L'3'; const std::wstring to2 = L"3"; const wchar_t to3[] = L"3"; const std::string to4 = "3"; @@ -1547,7 +1547,7 @@ void FStringTest::replaceTest() == "A big globe and a small globe" ); s1 = "ABC"; - FString empty; + finalcut::FString empty; CPPUNIT_ASSERT ( s1.replace('B', "") == "AC" ); CPPUNIT_ASSERT ( s1.replace(L'B', "") == "AC" ); CPPUNIT_ASSERT ( s1.replace(from1, empty) == "ABC" ); @@ -1578,8 +1578,8 @@ void FStringTest::replaceTest() //---------------------------------------------------------------------- void FStringTest::overwriteTest() { - // FString - FString str = "abcdefghijklm"; + // finalcut::FString + finalcut::FString str = "abcdefghijklm"; CPPUNIT_ASSERT ( str.overwrite("+++++++", 3) == "abc+++++++klm" ); CPPUNIT_ASSERT ( str.overwrite(".............") == "............." ); CPPUNIT_ASSERT ( str.overwrite(",,,,,,,,,,,,,,,") == ",,,,,,,,,,,,,,," ); @@ -1613,7 +1613,7 @@ void FStringTest::overwriteTest() //---------------------------------------------------------------------- void FStringTest::removeTest() { - FString str = "ABCDE"; + finalcut::FString str = "ABCDE"; CPPUNIT_ASSERT ( str.remove(2, 2) == "ABE" ); CPPUNIT_ASSERT ( str.remove(2, 1) == "AB" ); CPPUNIT_ASSERT ( str.remove(2, 1) == "AB" ); @@ -1626,12 +1626,12 @@ void FStringTest::removeTest() //---------------------------------------------------------------------- void FStringTest::includesTest() { - const FString str = "Look behind you, a three-headed monkey!"; - const FString empty1; + const finalcut::FString str = "Look behind you, a three-headed monkey!"; + const finalcut::FString empty1; const wchar_t empty2[] = L""; const char empty3[] = ""; - const FString search1 = "you"; - const FString search2 = "me"; + const finalcut::FString search1 = "you"; + const finalcut::FString search2 = "me"; const wchar_t search3[] = L"you"; const wchar_t search4[] = L"me"; const char search5[] = "you"; @@ -1641,7 +1641,7 @@ void FStringTest::includesTest() const char search9 = 'y'; const char search10 = '&'; - CPPUNIT_ASSERT ( ! str.includes(static_cast(0)) ); + CPPUNIT_ASSERT ( ! str.includes(static_cast(0)) ); CPPUNIT_ASSERT ( ! str.includes(empty1) ); CPPUNIT_ASSERT ( str.includes(search1) ); CPPUNIT_ASSERT ( ! str.includes(search2) ); @@ -1673,19 +1673,19 @@ void FStringTest::includesTest() //---------------------------------------------------------------------- void FStringTest::controlCodesTest() { - FString bs_str = "t\b\bTesT\bt"; + finalcut::FString bs_str = "t\b\bTesT\bt"; CPPUNIT_ASSERT ( bs_str.removeBackspaces() == "Test" ); bs_str = "ABC\b\b\b\b"; CPPUNIT_ASSERT ( bs_str.removeBackspaces() == "" ); CPPUNIT_ASSERT ( bs_str.removeBackspaces().isEmpty() ); - FString del_str = "apple \177\177\177pietree"; + finalcut::FString del_str = "apple \177\177\177pietree"; CPPUNIT_ASSERT ( del_str.removeDel() == "apple tree" ); del_str = "\177\177\177\177ABC"; CPPUNIT_ASSERT ( del_str.removeDel() == "" ); CPPUNIT_ASSERT ( del_str.removeDel().isEmpty() ); - FString tab_str = "one line"; + finalcut::FString tab_str = "one line"; CPPUNIT_ASSERT ( tab_str.expandTabs() == "one line" ); CPPUNIT_ASSERT ( tab_str.expandTabs(4) == "one line" ); CPPUNIT_ASSERT ( tab_str.expandTabs(2) == "one line" ); @@ -1738,7 +1738,7 @@ void FStringTest::controlCodesTest() CPPUNIT_ASSERT ( tab_str.expandTabs(2) == "12345678 2" ); CPPUNIT_ASSERT ( tab_str.expandTabs(0) == "12345678\t2" ); CPPUNIT_ASSERT ( tab_str.expandTabs(-1) == "12345678\t2" ); - FString cc(0x20); + finalcut::FString cc(0x20); for (int i = 0; i < 0x1f; i++) cc[i] = i + 1; @@ -1749,7 +1749,7 @@ void FStringTest::controlCodesTest() for (int i = 0; i <= 0x1f; i++) cc[i] = i + 0x80; - CPPUNIT_ASSERT ( cc.replaceControlCodes() == FString(32, L' ') ); + CPPUNIT_ASSERT ( cc.replaceControlCodes() == finalcut::FString(32, L' ') ); cc = "t\b\bTes\177Tt"; CPPUNIT_ASSERT ( cc.replaceControlCodes() == "t␈␈Tes␡Tt" ); diff --git a/src/test/ftermcapquirks-test.cpp b/src/test/ftermcapquirks-test.cpp index d0c5213d..f805f9af 100644 --- a/src/test/ftermcapquirks-test.cpp +++ b/src/test/ftermcapquirks-test.cpp @@ -1,5 +1,5 @@ /*********************************************************************** -* ftermcapquirks-test.cpp - FTermcapQuirks unit tests * +* ftermcapquirks-test.cpp - finalcut::FTermcapQuirks unit tests * * * * This file is part of the Final Cut widget toolkit * * * @@ -219,7 +219,7 @@ FTermcapQuirksTest::~FTermcapQuirksTest() //---------------------------------------------------------------------- void FTermcapQuirksTest::classNameTest() { - FTermcapQuirks q; + finalcut::FTermcapQuirks q; const char* const classname = q.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname, "FTermcapQuirks") == 0 ); } @@ -233,58 +233,58 @@ void FTermcapQuirksTest::generalTest() for (int i = 0; i < last_item; i++) memcpy(&caps[i], &test::tcap[i], sizeof(test::tcap[0])); - FTermcap::tabstop = -1; - FTermcap::attr_without_color = -1; - FTermcapQuirks quirks; - FTermDetection detect; - quirks.setTermcapMap (reinterpret_cast(caps)); + finalcut::FTermcap::tabstop = -1; + finalcut::FTermcap::attr_without_color = -1; + finalcut::FTermcapQuirks quirks; + finalcut::FTermDetection detect; + quirks.setTermcapMap (reinterpret_cast(caps)); quirks.setFTermDetection (&detect); quirks.terminalFixup(); - CPPUNIT_ASSERT ( FTermcap::tabstop == 8 ); - CPPUNIT_ASSERT ( FTermcap::attr_without_color == 0 ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_a_foreground].string + CPPUNIT_ASSERT ( finalcut::FTermcap::tabstop == 8 ); + CPPUNIT_ASSERT ( finalcut::FTermcap::attr_without_color == 0 ); + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_foreground].string , C_STR(CSI "3%p1%dm") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_a_background].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_background].string , C_STR(CSI "4%p1%dm") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_initialize_color].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_initialize_color].string , C_STR(OSC "P%p1%x" "%p2%{255}%*%{1000}%/%02x" "%p3%{255}%*%{1000}%/%02x" "%p4%{255}%*%{1000}%/%02x") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_enter_ca_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_ca_mode].string , C_STR(ESC "7" CSI "?47h" ) ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_ca_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_ca_mode].string , C_STR(CSI "?47l" ESC "8" CSI "m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_cursor_address].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_cursor_address].string , C_STR(CSI "%i%p1%d;%p2%dH") ); // Non standard ECMA-48 (ANSI X3.64) terminal - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_enter_dbl_underline_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_dbl_underline_mode].string , 0 ); - caps[fc::t_exit_underline_mode].string = C_STR(CSI "24m"); + caps[finalcut::fc::t_exit_underline_mode].string = C_STR(CSI "24m"); quirks.terminalFixup(); // Standard ECMA-48 (ANSI X3.64) terminal - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_enter_dbl_underline_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_dbl_underline_mode].string , C_STR(CSI "21m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_dbl_underline_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_dbl_underline_mode].string , C_STR(CSI "24m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_bold_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_bold_mode].string , C_STR(CSI "22m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_dim_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_dim_mode].string , C_STR(CSI "22m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_underline_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_underline_mode].string , C_STR(CSI "24m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_blink_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_blink_mode].string , C_STR(CSI "25m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_reverse_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_reverse_mode].string , C_STR(CSI "27m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_secure_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_secure_mode].string , C_STR(CSI "28m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_enter_crossed_out_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_crossed_out_mode].string , C_STR(CSI "9m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_crossed_out_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_crossed_out_mode].string , C_STR(CSI "29m") ); - CPPUNIT_ASSERT_CSTRING ( printSequence(caps[fc::t_enter_ca_mode].string).c_str() + CPPUNIT_ASSERT_CSTRING ( printSequence(caps[finalcut::fc::t_enter_ca_mode].string).c_str() , C_STR("Esc 7 Esc [ ? 4 7 h ") ); delete[] caps; } @@ -298,22 +298,22 @@ void FTermcapQuirksTest::xtermTest() for (int i = 0; i < last_item; i++) memcpy(&caps[i], &test::tcap[i], sizeof(test::tcap[0])); - FTermcapQuirks quirks; - FTermDetection detect; + finalcut::FTermcapQuirks quirks; + finalcut::FTermDetection detect; detect.setXTerminal (true); quirks.setTerminalType ("xterm"); - quirks.setTermcapMap (reinterpret_cast(caps)); + quirks.setTermcapMap (reinterpret_cast(caps)); quirks.setFTermDetection (&detect); quirks.terminalFixup(); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_initialize_color].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_initialize_color].string , C_STR(OSC "4;%p1%d;rgb:" "%p2%{255}%*%{1000}%/%2.2X/" "%p3%{255}%*%{1000}%/%2.2X/" "%p4%{255}%*%{1000}%/%2.2X" ESC "\\") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_cursor_invisible].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_cursor_invisible].string , C_STR(CSI "?25l") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_cursor_normal].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_cursor_normal].string , C_STR(CSI "?12l" CSI "?25h") ); detect.setXTerminal (false); delete[] caps; @@ -329,17 +329,17 @@ void FTermcapQuirksTest::freebsdTest() for (int i = 0; i < last_item; i++) memcpy(&caps[i], &test::tcap[i], sizeof(test::tcap[0])); - FTermcap::attr_without_color = -1; - FTermcapQuirks quirks; - FTermDetection detect; + finalcut::FTermcap::attr_without_color = -1; + finalcut::FTermcapQuirks quirks; + finalcut::FTermDetection detect; detect.setFreeBSDTerm (true); quirks.setTerminalType ("xterm-16color"); quirks.setTermcapMap (reinterpret_cast(caps)); quirks.setFTermDetection (&detect); quirks.terminalFixup(); - CPPUNIT_ASSERT ( FTermcap::attr_without_color == 18 ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_acs_chars].string + CPPUNIT_ASSERT ( finalcut::FTermcap::attr_without_color == 18 ); + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_acs_chars].string , C_STR("-\036.\0370\333" "a\260f\370g\361" "h\261j\331k\277" @@ -347,7 +347,7 @@ void FTermcapQuirksTest::freebsdTest() "q\304t\303u\264" "v\301w\302x\263" "y\363z\362~\371") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_attributes].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_attributes].string , C_STR(CSI "0" "%?%p1%p6%|%t;1%;" "%?%p2%t;4%;" @@ -368,19 +368,19 @@ void FTermcapQuirksTest::cygwinTest() for (int i = 0; i < last_item; i++) memcpy(&caps[i], &test::tcap[i], sizeof(test::tcap[0])); - FTermcap::background_color_erase = false; - FTermcapQuirks quirks; - FTermDetection detect; + finalcut::FTermcap::background_color_erase = false; + finalcut::FTermcapQuirks quirks; + finalcut::FTermDetection detect; detect.setCygwinTerminal (true); quirks.setTerminalType ("cygwin"); - quirks.setTermcapMap (reinterpret_cast(caps)); + quirks.setTermcapMap (reinterpret_cast(caps)); quirks.setFTermDetection (&detect); quirks.terminalFixup(); - CPPUNIT_ASSERT ( FTermcap::background_color_erase == true ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_cursor_invisible].string + CPPUNIT_ASSERT ( finalcut::FTermcap::background_color_erase == true ); + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_cursor_invisible].string , C_STR(CSI "?25l") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_cursor_visible].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_cursor_visible].string , C_STR(CSI "?25h") ); detect.setCygwinTerminal (false); delete[] caps; @@ -395,66 +395,66 @@ void FTermcapQuirksTest::linuxTest() for (int i = 0; i < last_item; i++) memcpy(&caps[i], &test::tcap[i], sizeof(test::tcap[0])); - FTermcap::max_color = 8; - FTermcap::attr_without_color = -1; - FTermcapQuirks quirks; - FTermDetection detect; + finalcut::FTermcap::max_color = 8; + finalcut::FTermcap::attr_without_color = -1; + finalcut::FTermcapQuirks quirks; + finalcut::FTermDetection detect; detect.setLinuxTerm (true); quirks.setTerminalType ("linux"); - quirks.setTermcapMap (reinterpret_cast(caps)); + quirks.setTermcapMap (reinterpret_cast(caps)); quirks.setFTermDetection (&detect); quirks.terminalFixup(); // 8 colors - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_a_foreground].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_foreground].string , C_STR(CSI "3%p1%dm") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_a_background].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_background].string , C_STR(CSI "4%p1%dm") ); - CPPUNIT_ASSERT ( FTermcap::attr_without_color == 18 ); + CPPUNIT_ASSERT ( finalcut::FTermcap::attr_without_color == 18 ); // 16 colors - FTermcap::max_color = 16; + finalcut::FTermcap::max_color = 16; quirks.terminalFixup(); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_a_foreground].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_foreground].string , C_STR(CSI "3%p1%{8}%m%d%?%p1%{7}%>%t;1%e;22%;m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_a_background].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_background].string , C_STR(CSI "4%p1%{8}%m%d%?%p1%{7}%>%t;5%e;25%;m") ); - CPPUNIT_ASSERT ( FTermcap::attr_without_color == 26 ); + CPPUNIT_ASSERT ( finalcut::FTermcap::attr_without_color == 26 ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_attributes].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_attributes].string , C_STR(CSI "0" "%?%p6%t;1%;" "%?%p1%p3%|%t;7%;" "%?%p4%t;5%;m" "%?%p9%t\016%e\017%;") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_enter_alt_charset_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_alt_charset_mode].string , C_STR("\016") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_alt_charset_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_alt_charset_mode].string , C_STR("\017") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_attribute_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_attribute_mode].string , C_STR(CSI "0m\017") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_bold_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_bold_mode].string , C_STR(CSI "22m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_blink_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_blink_mode].string , C_STR(CSI "25m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_reverse_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_reverse_mode].string , C_STR(CSI "27m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_secure_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_secure_mode].string , 0 ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_protected_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_protected_mode].string , 0 ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_crossed_out_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_crossed_out_mode].string , 0 ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_orig_pair].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_orig_pair].string , C_STR(CSI "39;49;25m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_enter_dim_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_dim_mode].string , 0 ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_dim_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_dim_mode].string , 0 ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_enter_underline_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_underline_mode].string , 0 ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_underline_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_underline_mode].string , 0 ); detect.setLinuxTerm (false); delete[] caps; @@ -469,33 +469,33 @@ void FTermcapQuirksTest::rxvtTest() for (int i = 0; i < last_item; i++) memcpy(&caps[i], &test::tcap[i], sizeof(test::tcap[0])); - FTermcapQuirks quirks; - FTermDetection detect; + finalcut::FTermcapQuirks quirks; + finalcut::FTermDetection detect; detect.setRxvtTerminal (true); quirks.setTerminalType ("rxvt"); - quirks.setTermcapMap (reinterpret_cast(caps)); + quirks.setTermcapMap (reinterpret_cast(caps)); quirks.setFTermDetection (&detect); quirks.terminalFixup(); // rxvt - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_enter_alt_charset_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_alt_charset_mode].string , 0 ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_alt_charset_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_alt_charset_mode].string , 0 ); // rxvt-16color quirks.setTerminalType ("rxvt-16color"); quirks.terminalFixup(); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_enter_alt_charset_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_alt_charset_mode].string , C_STR(ESC "(0") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_alt_charset_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_alt_charset_mode].string , C_STR(ESC "(B") ); // urxvt detect.setUrxvtTerminal (true); quirks.terminalFixup(); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_a_foreground].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_foreground].string , C_STR(CSI "%?%p1%{8}%<%t%p1%{30}%+%e%p1%'R'%+%;%dm") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_a_background].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_background].string , C_STR(CSI "%?%p1%{8}%<%t%p1%'('%+%e%p1%{92}%+%;%dm") ); detect.setUrxvtTerminal (false); @@ -512,17 +512,17 @@ void FTermcapQuirksTest::vteTest() for (int i = 0; i < last_item; i++) memcpy(&caps[i], &test::tcap[i], sizeof(test::tcap[0])); - FTermcap::attr_without_color = -1; - FTermcapQuirks quirks; - FTermDetection detect; + finalcut::FTermcap::attr_without_color = -1; + finalcut::FTermcapQuirks quirks; + finalcut::FTermDetection detect; detect.setGnomeTerminal (true); quirks.setTerminalType ("gnome-256color"); - quirks.setTermcapMap (reinterpret_cast(caps)); + quirks.setTermcapMap (reinterpret_cast(caps)); quirks.setFTermDetection (&detect); quirks.terminalFixup(); - CPPUNIT_ASSERT ( FTermcap::attr_without_color == 0 ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_underline_mode].string + CPPUNIT_ASSERT ( finalcut::FTermcap::attr_without_color == 0 ); + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_underline_mode].string , C_STR(CSI "24m") ); detect.setGnomeTerminal (false); @@ -538,33 +538,33 @@ void FTermcapQuirksTest::puttyTest() for (int i = 0; i < last_item; i++) memcpy(&caps[i], &test::tcap[i], sizeof(test::tcap[0])); - FTermcap::background_color_erase = false; - FTermcap::osc_support = false; - FTermcap::attr_without_color = -1; - FTermcapQuirks quirks; - FTermDetection detect; + finalcut::FTermcap::background_color_erase = false; + finalcut::FTermcap::osc_support = false; + finalcut::FTermcap::attr_without_color = -1; + finalcut::FTermcapQuirks quirks; + finalcut::FTermDetection detect; detect.setPuttyTerminal (true); quirks.setTerminalType ("putty"); - quirks.setTermcapMap (reinterpret_cast(caps)); + quirks.setTermcapMap (reinterpret_cast(caps)); quirks.setFTermDetection (&detect); quirks.terminalFixup(); - CPPUNIT_ASSERT ( FTermcap::background_color_erase == true ); - CPPUNIT_ASSERT ( FTermcap::osc_support == true ); - CPPUNIT_ASSERT ( FTermcap::attr_without_color == 0 ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_a_foreground].string + CPPUNIT_ASSERT ( finalcut::FTermcap::background_color_erase == true ); + CPPUNIT_ASSERT ( finalcut::FTermcap::osc_support == true ); + CPPUNIT_ASSERT ( finalcut::FTermcap::attr_without_color == 0 ); + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_foreground].string , C_STR(CSI "%?%p1%{8}%<" "%t3%p1%d" "%e%p1%{16}%<" "%t9%p1%{8}%-%d" "%e38;5;%p1%d%;m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_a_background].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_background].string , C_STR(CSI "%?%p1%{8}%<" "%t4%p1%d" "%e%p1%{16}%<" "%t10%p1%{8}%-%d" "%e48;5;%p1%d%;m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_attributes].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_attributes].string , C_STR(CSI "0" "%?%p1%p6%|%t;1%;" "%?%p5%t;2%;" @@ -572,42 +572,42 @@ void FTermcapQuirksTest::puttyTest() "%?%p1%p3%|%t;7%;" "%?%p4%t;5%;m" "%?%p9%t\016%e\017%;") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_enter_dim_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_dim_mode].string , C_STR(CSI "2m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_dim_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_dim_mode].string , C_STR(CSI "22m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_clr_bol].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_clr_bol].string , C_STR(CSI "1K") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_orig_pair].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_orig_pair].string , C_STR(CSI "39;49m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_orig_colors].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_orig_colors].string , C_STR(OSC "R") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_column_address].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_column_address].string , C_STR(CSI "%i%p1%dG") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_row_address].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_row_address].string , C_STR(CSI "%i%p1%dd") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_enable_acs].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enable_acs].string , C_STR(ESC "(B" ESC ")0") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_enter_am_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_am_mode].string , C_STR(CSI "?7h") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_am_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_am_mode].string , C_STR(CSI "?7l") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_enter_pc_charset_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_enter_pc_charset_mode].string , C_STR(CSI "11m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_pc_charset_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_pc_charset_mode].string , C_STR(CSI "10m") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_key_mouse].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_key_mouse].string , C_STR(CSI "M") ); detect.setPuttyTerminal (false); @@ -623,23 +623,23 @@ void FTermcapQuirksTest::teratermTest() for (int i = 0; i < last_item; i++) memcpy(&caps[i], &test::tcap[i], sizeof(test::tcap[0])); - FTermcap::eat_nl_glitch = false; - FTermcapQuirks quirks; - FTermDetection detect; + finalcut::FTermcap::eat_nl_glitch = false; + finalcut::FTermcapQuirks quirks; + finalcut::FTermDetection detect; detect.setTeraTerm (true); quirks.setTerminalType ("teraterm"); - quirks.setTermcapMap (reinterpret_cast(caps)); + quirks.setTermcapMap (reinterpret_cast(caps)); quirks.setFTermDetection (&detect); quirks.terminalFixup(); - CPPUNIT_ASSERT ( FTermcap::eat_nl_glitch == true ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_a_foreground].string + CPPUNIT_ASSERT ( finalcut::FTermcap::eat_nl_glitch == true ); + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_foreground].string , C_STR(CSI "38;5;%p1%dm") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_set_a_background].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_set_a_background].string , C_STR(CSI "48;5;%p1%dm") ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_exit_attribute_mode].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_exit_attribute_mode].string , C_STR(CSI "0m" SI) ); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_orig_pair].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_orig_pair].string , C_STR(CSI "39;49m") ); detect.setTeraTerm (false); @@ -655,16 +655,16 @@ void FTermcapQuirksTest::sunTest() for (int i = 0; i < last_item; i++) memcpy(&caps[i], &test::tcap[i], sizeof(test::tcap[0])); - FTermcap::eat_nl_glitch = false; - FTermcapQuirks quirks; - FTermDetection detect; + finalcut::FTermcap::eat_nl_glitch = false; + finalcut::FTermcapQuirks quirks; + finalcut::FTermDetection detect; detect.setSunTerminal (true); quirks.setTerminalType ("sun-color"); - quirks.setTermcapMap (reinterpret_cast(caps)); + quirks.setTermcapMap (reinterpret_cast(caps)); quirks.setFTermDetection (&detect); quirks.terminalFixup(); - CPPUNIT_ASSERT ( FTermcap::eat_nl_glitch == true ); + CPPUNIT_ASSERT ( finalcut::FTermcap::eat_nl_glitch == true ); detect.setSunTerminal (false); delete[] caps; @@ -679,25 +679,25 @@ void FTermcapQuirksTest::screenTest() for (int i = 0; i < last_item; i++) memcpy(&caps[i], &test::tcap[i], sizeof(test::tcap[0])); - FTermcapQuirks quirks; - FTermDetection detect; + finalcut::FTermcapQuirks quirks; + finalcut::FTermDetection detect; detect.setScreenTerm (true); quirks.setTerminalType ("screen-256color"); - quirks.setTermcapMap (reinterpret_cast(caps)); + quirks.setTermcapMap (reinterpret_cast(caps)); quirks.setFTermDetection (&detect); quirks.terminalFixup(); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_initialize_color].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_initialize_color].string , C_STR(ESC "P" OSC "4;%p1%d;rgb:" "%p2%{255}%*%{1000}%/%2.2X/" "%p3%{255}%*%{1000}%/%2.2X/" "%p4%{255}%*%{1000}%/%2.2X" BEL ESC "\\") ); detect.setTmuxTerm (true); - caps[fc::t_initialize_color].string = 0; + caps[finalcut::fc::t_initialize_color].string = 0; quirks.terminalFixup(); - CPPUNIT_ASSERT_CSTRING ( caps[fc::t_initialize_color].string + CPPUNIT_ASSERT_CSTRING ( caps[finalcut::fc::t_initialize_color].string , C_STR(ESC "Ptmux;" ESC OSC "4;%p1%d;rgb:" "%p2%{255}%*%{1000}%/%2.2X/" "%p3%{255}%*%{1000}%/%2.2X/" diff --git a/src/test/ftermdetection-test.cpp b/src/test/ftermdetection-test.cpp index beff55aa..c29b2e88 100644 --- a/src/test/ftermdetection-test.cpp +++ b/src/test/ftermdetection-test.cpp @@ -1,5 +1,5 @@ /*********************************************************************** -* ftermdetection-test.cpp - FTermDetection unit tests * +* ftermdetection-test.cpp - finalcut::FTermDetection unit tests * * * * This file is part of the Final Cut widget toolkit * * * @@ -465,7 +465,7 @@ FTermDetectionTest::~FTermDetectionTest() //---------------------------------------------------------------------- void FTermDetectionTest::classNameTest() { - FTermDetection d; + finalcut::FTermDetection d; const char* const classname = d.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname, "FTermDetection") == 0 ); } @@ -474,7 +474,7 @@ void FTermDetectionTest::classNameTest() void FTermDetectionTest::ansiTest() { setenv ("TERM", "ansi", 1); - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("ansi")); pid_t pid = forkProcess(); @@ -541,7 +541,7 @@ void FTermDetectionTest::ansiTest() //---------------------------------------------------------------------- void FTermDetectionTest::xtermTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("xterm")); detect.setTerminalDetection(true); @@ -601,7 +601,7 @@ void FTermDetectionTest::xtermTest() //---------------------------------------------------------------------- void FTermDetectionTest::rxvtTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("rxvt-cygwin-native")); detect.setTerminalDetection(true); @@ -662,7 +662,7 @@ void FTermDetectionTest::rxvtTest() //---------------------------------------------------------------------- void FTermDetectionTest::urxvtTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("rxvt-unicode-256color")); detect.setTerminalDetection(true); @@ -723,7 +723,7 @@ void FTermDetectionTest::urxvtTest() //---------------------------------------------------------------------- void FTermDetectionTest::mltermTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("mlterm")); detect.setTerminalDetection(true); @@ -791,7 +791,7 @@ void FTermDetectionTest::mltermTest() //---------------------------------------------------------------------- void FTermDetectionTest::puttyTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("xterm")); detect.setTerminalDetection(true); @@ -852,7 +852,7 @@ void FTermDetectionTest::puttyTest() //---------------------------------------------------------------------- void FTermDetectionTest::kdeKonsoleTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("xterm-256color")); detect.setTerminalDetection(true); @@ -912,7 +912,7 @@ void FTermDetectionTest::kdeKonsoleTest() //---------------------------------------------------------------------- void FTermDetectionTest::gnomeTerminalTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("xterm-256color")); detect.setTerminalDetection(true); @@ -973,7 +973,7 @@ void FTermDetectionTest::gnomeTerminalTest() //---------------------------------------------------------------------- void FTermDetectionTest::ktermTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("kterm")); detect.setTerminalDetection(true); @@ -1041,7 +1041,7 @@ void FTermDetectionTest::ktermTest() //---------------------------------------------------------------------- void FTermDetectionTest::teraTermTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("xterm")); detect.setTerminalDetection(true); @@ -1102,7 +1102,7 @@ void FTermDetectionTest::teraTermTest() //---------------------------------------------------------------------- void FTermDetectionTest::cygwinTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("cygwin")); detect.setTerminalDetection(true); @@ -1163,7 +1163,7 @@ void FTermDetectionTest::cygwinTest() //---------------------------------------------------------------------- void FTermDetectionTest::minttyTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("xterm-256color")); detect.setTerminalDetection(true); @@ -1224,7 +1224,7 @@ void FTermDetectionTest::minttyTest() //---------------------------------------------------------------------- void FTermDetectionTest::linuxTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("linux")); detect.setTerminalDetection(true); @@ -1292,7 +1292,7 @@ void FTermDetectionTest::linuxTest() //---------------------------------------------------------------------- void FTermDetectionTest::freebsdTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("xterm")); detect.setTerminalDetection(true); @@ -1363,7 +1363,7 @@ void FTermDetectionTest::freebsdTest() //---------------------------------------------------------------------- void FTermDetectionTest::netbsdTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("wsvt25")); detect.setTerminalDetection(true); @@ -1432,7 +1432,7 @@ void FTermDetectionTest::netbsdTest() //---------------------------------------------------------------------- void FTermDetectionTest::openbsdTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("vt220")); detect.setTerminalDetection(true); @@ -1501,7 +1501,7 @@ void FTermDetectionTest::openbsdTest() //---------------------------------------------------------------------- void FTermDetectionTest::sunTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("sun-color")); pid_t pid = forkProcess(); @@ -1568,7 +1568,7 @@ void FTermDetectionTest::sunTest() //---------------------------------------------------------------------- void FTermDetectionTest::screenTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("screen")); detect.setTerminalDetection(true); @@ -1635,7 +1635,7 @@ void FTermDetectionTest::screenTest() //---------------------------------------------------------------------- void FTermDetectionTest::tmuxTest() { - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTermFileName(C_STR("screen")); detect.setTerminalDetection(true); @@ -1738,7 +1738,7 @@ void FTermDetectionTest::ttytypeTest() ttytype << "vt100" << "\t" << "ttyp6" << std::endl; ttytype.close(); - FTermDetection detect; + finalcut::FTermDetection detect; detect.setTerminalDetection(true); detect.setTtyTypeFileName(C_STR("new-root-dir/etc/ttytype")); @@ -1987,7 +1987,7 @@ void FTermDetectionTest::debugOutput() setenv ("GO_MIDDLE", "\\033[80D\\033[15C", 1); setenv ("GO_RIGHT", "\\033[79D\\033[40C", 1); - FString line (69, '-'); + finalcut::FString line (69, '-'); std::cout << std::endl << line << std::endl; std::cout << "Probe Escape sequence Reply"; std::cout << std::endl << line << std::endl;