From 3d2a0c6dd20b24cc38968a085ae8fcf3a62fdb59 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sat, 6 Jun 2020 21:10:06 +0200 Subject: [PATCH 01/28] Lazy terminal initialization on show() --- ChangeLog | 4 + doc/first-steps.md | 12 +- examples/background-color.cpp | 5 + examples/keyboard.cpp | 3 + examples/mouse.cpp | 46 ++++---- examples/opti-move.cpp | 73 +++++++++--- examples/term-attributes.cpp | 46 ++++++-- examples/termcap.cpp | 21 +++- examples/timer.cpp | 3 + examples/ui.cpp | 23 ++-- src/fapplication.cpp | 189 +++++++++++++++++-------------- src/fbutton.cpp | 5 +- src/fcheckbox.cpp | 2 +- src/fcolorpalette.cpp | 2 +- src/fcombobox.cpp | 5 +- src/fdialog.cpp | 2 +- src/flabel.cpp | 12 +- src/flistbox.cpp | 1 - src/foptimove.cpp | 18 +-- src/fradiobutton.cpp | 2 +- src/fscrollbar.cpp | 1 + src/fterm.cpp | 156 +++++++++++++++---------- src/ftermfreebsd.cpp | 11 +- src/ftermopenbsd.cpp | 11 +- src/ftermxterminal.cpp | 11 +- src/ftogglebutton.cpp | 40 +------ src/fvterm.cpp | 55 ++++++--- src/fwidget.cpp | 123 ++++++++++++-------- src/include/final/fapplication.h | 17 ++- src/include/final/fbutton.h | 14 +-- src/include/final/flabel.h | 5 +- src/include/final/fterm.h | 24 ++-- src/include/final/ftermcap.h | 10 ++ src/include/final/ftermdata.h | 11 ++ src/include/final/fvterm.h | 12 +- src/include/final/fwidget.h | 16 +-- test/conemu.h | 10 ++ test/foptimove-test.cpp | 8 +- test/ftermdata-test.cpp | 6 + 39 files changed, 626 insertions(+), 389 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0701d49..43fb315a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2020-06-06 Markus Gans + * Now, the terminal is not initialized before the method show() + is called. Or you force it explicitly via the FApplication object. + 2020-05-30 Markus Gans * With the two new methods FApplication::setDarkTheme() and FApplication::setDefaultTheme() you can now change the theme diff --git a/doc/first-steps.md b/doc/first-steps.md index f184b0dd..f352f815 100644 --- a/doc/first-steps.md +++ b/doc/first-steps.md @@ -1135,12 +1135,13 @@ class dialogWidget : public FDialog setGeometry (FPoint{28, 2}, FSize{24, 21}); scrollview.setGeometry(FPoint{1, 1}, FSize{22, 11}); scrollview.setScrollSize(FSize{60, 27}); - const auto& wc = getFWidgetColors(); - setColor (wc.label_inactive_fg, wc.dialog_bg); + // Attention: getColorTheme() requires an initialized terminal + const auto& wc = getColorTheme(); + setColor (wc->label_inactive_fg, wc->dialog_bg); scrollview.clearArea(); - FColorPair red (fc::LightRed, wc.dialog_bg); - FColorPair black (fc::Black, wc.dialog_bg); - FColorPair cyan (fc::Cyan, wc.dialog_bg); + FColorPair red (fc::LightRed, wc->dialog_bg); + FColorPair black (fc::Black, wc->dialog_bg); + FColorPair cyan (fc::Cyan, wc->dialog_bg); static std::vector d { @@ -1188,6 +1189,7 @@ class dialogWidget : public FDialog int main (int argc, char* argv[]) { FApplication app(argc, argv); + app.initTerminal(); // Terminal initialization dialogWidget dialog(&app); FWidget::setMainWidget(&dialog); dialog.show(); diff --git a/examples/background-color.cpp b/examples/background-color.cpp index 60938a7e..fe14f5f7 100644 --- a/examples/background-color.cpp +++ b/examples/background-color.cpp @@ -217,8 +217,13 @@ void Background::cb_choice (const finalcut::FWidget*, const FDataPtr) int main (int argc, char* argv[]) { + // Create the application object finalcut::FApplication app(argc, argv); + // Force terminal initialization without calling show() + app.initTerminal(); + + // The following lines require an initialized terminal if ( finalcut::FTerm::canChangeColorPalette() ) app.setBackgroundColor(finalcut::fc::LightMagenta); diff --git a/examples/keyboard.cpp b/examples/keyboard.cpp index a92330fc..c3e06279 100644 --- a/examples/keyboard.cpp +++ b/examples/keyboard.cpp @@ -95,6 +95,9 @@ int main (int argc, char* argv[]) { // Create the application object finalcut::FApplication app{argc, argv}; + + // Force terminal initialization without calling show() + app.initTerminal(); app.setForegroundColor(finalcut::fc::Default); app.setBackgroundColor(finalcut::fc::Default); diff --git a/examples/mouse.cpp b/examples/mouse.cpp index f9dc68f2..7f4614e2 100644 --- a/examples/mouse.cpp +++ b/examples/mouse.cpp @@ -78,16 +78,6 @@ ColorChooser::ColorChooser (finalcut::FWidget* parent) setFixedSize (FSize{8, 12}); unsetFocusable(); - if ( parent ) - { - const FColor fg = parent->getForegroundColor(); - const FColor bg = parent->getBackgroundColor(); - FWidget::setForegroundColor(fg); - FWidget::setBackgroundColor(bg); - headline.setForegroundColor(fg); - headline.setBackgroundColor(bg); - } - // Text label headline.setGeometry (FPoint{1, 1}, FSize{8, 1}); headline.setEmphasis(); @@ -122,6 +112,8 @@ void ColorChooser::setSize (const FSize& size, bool adjust) //---------------------------------------------------------------------- void ColorChooser::draw() { + useParentWidgetColor(); + headline.setBackgroundColor(getBackgroundColor()); setColor(); drawBorder(); @@ -232,16 +224,6 @@ Brushes::Brushes (finalcut::FWidget* parent) setFixedSize (FSize{8, 4}); unsetFocusable(); - if ( parent ) - { - const FColor fg = parent->getForegroundColor(); - const FColor bg = parent->getBackgroundColor(); - FWidget::setForegroundColor(fg); - FWidget::setBackgroundColor(bg); - headline.setForegroundColor(fg); - headline.setBackgroundColor(bg); - } - // Text label headline.setGeometry(FPoint{1, 1}, FSize{8, 1}); headline.setEmphasis(); @@ -265,6 +247,8 @@ void Brushes::setSize (const FSize& size, bool adjust) void Brushes::draw() { int pos{0}; + useParentWidgetColor(); + headline.setBackgroundColor(getBackgroundColor()); setColor(); drawBorder(); print() << FPoint{2, 3} @@ -361,6 +345,7 @@ class MouseDraw final : public finalcut::FDialog void draw() override; void drawBrush (int, int, bool = false); void drawCanvas(); + void createCanvas(); void adjustSize() override; // Event handler @@ -390,10 +375,6 @@ MouseDraw::MouseDraw (finalcut::FWidget* parent) ); brush.setPos (FPoint{1, 12}); - - FSize no_shadow{0, 0}; - finalcut::FRect scroll_geometry{0, 0, 1, 1}; - createArea (scroll_geometry, no_shadow, canvas); } //---------------------------------------------------------------------- @@ -407,6 +388,10 @@ void MouseDraw::setGeometry ( const FPoint& p, const FSize& s, bool adjust) const std::size_t w = s.getWidth(); const std::size_t h = s.getHeight(); const finalcut::FRect scroll_geometry (FPoint{0, 0}, FSize{w - 11, h - 3}); + + if ( ! canvas ) + return; + const FSize no_shadow{0, 0}; const int old_w = canvas->width; const int old_h = canvas->height; @@ -504,6 +489,10 @@ void MouseDraw::drawCanvas() if ( ! hasPrintArea() ) finalcut::FVTerm::getPrintArea(); + // Create canvas after initializing the desktop and color theme + if ( ! canvas ) + createCanvas(); + if ( ! (hasPrintArea() && canvas) ) return; @@ -534,6 +523,15 @@ void MouseDraw::drawCanvas() printarea->has_changes = true; } +//---------------------------------------------------------------------- +void MouseDraw::createCanvas() +{ + FSize no_shadow{0, 0}; + finalcut::FRect scroll_geometry{0, 0, 1, 1}; + createArea (scroll_geometry, no_shadow, canvas); + adjustSize(); +} + //---------------------------------------------------------------------- void MouseDraw::adjustSize() { diff --git a/examples/opti-move.cpp b/examples/opti-move.cpp index ed6061a1..f6d4d56e 100644 --- a/examples/opti-move.cpp +++ b/examples/opti-move.cpp @@ -133,62 +133,103 @@ void move (int xold, int yold, int xnew, int ynew) } //---------------------------------------------------------------------- -class DirectLogger : public finalcut::FLog +class DirectLogger final : public finalcut::FLog { public: + // Constructor + DirectLogger(); + + // Destructor + ~DirectLogger() override; + void info (const std::string& entry) override { output << entry << "\r" << std::endl; } void warn (const std::string&) override - { } + { + // An implementation is not required in this context + } void error (const std::string&) override - { } + { + // An implementation is not required in this context + } + void debug (const std::string&) override - { } + { + // An implementation is not required in this context + } + void setOutputStream (const std::ostream& os) override { output.rdbuf(os.rdbuf()); } void setLineEnding (LineEnding) override - { } + { + // An implementation is not required in this context + } + void enableTimestamp() override - { } + { + // An implementation is not required in this context + } + void disableTimestamp() override - { } + { + // An implementation is not required in this context + } + private: // Data member std::ostream output{std::cerr.rdbuf()}; }; +//---------------------------------------------------------------------- +DirectLogger::DirectLogger() // constructor +{ } + +//---------------------------------------------------------------------- +DirectLogger::~DirectLogger() // destructor +{ } + + //---------------------------------------------------------------------- // main part //---------------------------------------------------------------------- int main (int argc, char* argv[]) { + // Disable mouse + finalcut::FStartOptions::getFStartOptions().mouse_support = false; + // Create the application object - finalcut::FApplication TermApp{argc, argv}; + finalcut::FApplication term_app{argc, argv}; + + // Force terminal initialization without calling show() + term_app.initTerminal(); // Pointer to the global virtual terminal object - app = &TermApp; + app = &term_app; + + if ( app->isQuit() ) + return 0; // Get screen dimension - int xmax = int(TermApp.getDesktopWidth() - 1); - int ymax = int(TermApp.getDesktopHeight() - 1); + int xmax = int(term_app.getDesktopWidth() - 1); + int ymax = int(term_app.getDesktopHeight() - 1); finalcut::FString line{std::size_t(xmax) + 1, '-'}; // Place the cursor in the upper left corner - TermApp.setTermXY(0, 0); + term_app.setTermXY(0, 0); // Reset all terminal attributes - TermApp.setNormal(); + term_app.setNormal(); // Clear the screen - TermApp.clearArea(); + term_app.clearArea(); // Show the determined terminal name and text resolution std::cout << "Terminal: " << finalcut::FTerm::getTermType() << "\r\n"; @@ -230,8 +271,10 @@ int main (int argc, char* argv[]) std::shared_ptr log = finalcut::FApplication::getLog(); const finalcut::FOptiMove& opti_move = *finalcut::FTerm::getFOptiMove(); finalcut::printDurations(opti_move); + delete &log; // Waiting for keypress keyPressed(); - app = nullptr; // End of TermApp object scope + app = nullptr; // End of term_app object scope + return 0; } diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp index c8528bba..f11a2249 100644 --- a/examples/term-attributes.cpp +++ b/examples/term-attributes.cpp @@ -62,11 +62,15 @@ class AttribDlg final : public finalcut::FDialog void cb_back (const finalcut::FWidget* = nullptr, const FDataPtr = nullptr); private: + // Constants + static constexpr FColor UNDEFINED = static_cast(-2); + // Method void adjustSize() override; + void draw() override; // Data members - FColor bgcolor{getColorTheme()->label_bg}; + FColor bgcolor{UNDEFINED}; finalcut::FButton next_button{"&Next >", this}; finalcut::FButton back_button{"< &Back", this}; }; @@ -75,10 +79,6 @@ class AttribDlg final : public finalcut::FDialog AttribDlg::AttribDlg (finalcut::FWidget* parent) : finalcut::FDialog{parent} { - FDialog::setText ( "A terminal attributes test (" - + finalcut::FString{finalcut::FTerm::getTermType()} - + ")"); - next_button.setGeometry ( FPoint{int(getWidth()) - 13, int(getHeight()) - 4} , FSize{10, 1} ); next_button.addAccelerator (fc::Fkey_right); @@ -194,6 +194,26 @@ void AttribDlg::adjustSize() finalcut::FDialog::adjustSize(); } +//---------------------------------------------------------------------- +void AttribDlg::draw() +{ + if ( bgcolor == UNDEFINED ) + { + // Get the color after initializing the color theme in show() + if ( finalcut::FTerm::isMonochron() ) + bgcolor = fc::Default; + else + bgcolor = getColorTheme()->label_bg; + + // Get the terminal type after the terminal detection in show() + FDialog::setText ( "A terminal attributes test (" + + finalcut::FString{finalcut::FTerm::getTermType()} + + ")"); + } + + FDialog::draw(); +} + //---------------------------------------------------------------------- // class AttribDemo @@ -238,18 +258,13 @@ class AttribDemo final : public finalcut::FWidget void draw() override; // Data member - FColor last_color{FColor(finalcut::FTerm::getMaxColor())}; + FColor last_color{1}; }; //---------------------------------------------------------------------- AttribDemo::AttribDemo (finalcut::FWidget* parent) : finalcut::FWidget{parent} { - if ( finalcut::FTerm::isMonochron() ) - last_color = 1; - else if ( last_color > 16 ) - last_color = 16; - unsetFocusable(); } @@ -417,8 +432,15 @@ void AttribDemo::printProtected() //---------------------------------------------------------------------- void AttribDemo::draw() { - // test alternate character set const auto& wc = getColorTheme(); + last_color = FColor(finalcut::FTerm::getMaxColor()); + + if ( finalcut::FTerm::isMonochron() ) + last_color = 1; + else if ( last_color > 16 ) + last_color = 16; + + // test alternate character set printAltCharset(); const std::vector > effect diff --git a/examples/termcap.cpp b/examples/termcap.cpp index f7532212..6f2c1675 100644 --- a/examples/termcap.cpp +++ b/examples/termcap.cpp @@ -296,15 +296,30 @@ void string() //---------------------------------------------------------------------- int main (int argc, char* argv[]) { - const bool disable_alt_screen{true}; - finalcut::FApplication TermApp {argc, argv, disable_alt_screen}; + // Disabling the switch to the alternative screen + finalcut::FTerm::useAlternateScreen(false); + + // Disable color palette changes and terminal data requests + auto& start_options = finalcut::FStartOptions::getFStartOptions(); + start_options.color_change = false; + start_options.terminal_data_request = false; + + // Create the application object as root widget + finalcut::FApplication term_app {argc, argv}; + + // Force terminal initialization without calling show() + term_app.initTerminal(); + + if ( term_app.isQuit() ) + return 0; std::cout << "--------\r\nFTermcap\r\n--------\r\n\n"; std::cout << "Terminal: " << finalcut::FTerm::getTermType() << "\r\n"; - debug (TermApp); + debug (term_app); booleans(); numeric(); string(); + return 0; } diff --git a/examples/timer.cpp b/examples/timer.cpp index 81a94fbf..3b444c8c 100644 --- a/examples/timer.cpp +++ b/examples/timer.cpp @@ -101,6 +101,9 @@ int main (int argc, char* argv[]) { // Create the application object finalcut::FApplication app{argc, argv}; + + // Force terminal initialization without calling show() + app.initTerminal(); app.setForegroundColor(fc::Default); app.setBackgroundColor(fc::Default); diff --git a/examples/ui.cpp b/examples/ui.cpp index 9e696d09..a9a14a6b 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -1049,17 +1049,6 @@ int main (int argc, char* argv[]) // Create the application object app finalcut::FApplication app{argc, argv}; app.setNonBlockingRead(); - finalcut::FTerm::redefineDefaultColors(true); - finalcut::FTerm::setTermTitle (title); - - // Force vt100 encoding - //finalcut::FTerm::setEncoding(finalcut::fc::VT100); - - // Sets the terminal size to 94×30 - //finalcut::FTerm::setTermSize(FSize{94, 30}); - - // Enable the final cut graphical font - //finalcut::FTerm::setNewFont(); // Create main dialog object d MyDialog d{&app}; @@ -1075,6 +1064,18 @@ int main (int argc, char* argv[]) // Show the dialog d d.show(); + finalcut::FTerm::redefineDefaultColors(true); + finalcut::FTerm::setTermTitle (title); + + // Force vt100 encoding + //finalcut::FTerm::setEncoding(finalcut::fc::VT100); + + // Sets the terminal size to 94×30 + //finalcut::FTerm::setTermSize(FSize{94, 30}); + + // Enable the final cut graphical font + //finalcut::FTerm::setNewFont(); + // Start the application // and return the result to the operating system return app.exec(); diff --git a/src/fapplication.cpp b/src/fapplication.cpp index 1278b856..130cc68e 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -58,7 +58,7 @@ FWidget* FApplication::keyboard_widget {nullptr}; // has the keyboard foc FKeyboard* FApplication::keyboard {nullptr}; // keyboard access FMouseControl* FApplication::mouse {nullptr}; // mouse control int FApplication::loop_level {0}; // event loop level -int FApplication::quit_code {0}; +int FApplication::quit_code {EXIT_SUCCESS}; bool FApplication::quit_now {false}; @@ -68,13 +68,14 @@ bool FApplication::quit_now {false}; // constructors and destructor //---------------------------------------------------------------------- -FApplication::FApplication ( const int& _argc - , char* _argv[] - , bool disable_alt_screen ) - : FWidget{processParameters(_argc, _argv), disable_alt_screen} +FApplication::FApplication (const int& _argc, char* _argv[]) + : FWidget{processParameters(_argc, _argv)} , app_argc{_argc} , app_argv{_argv} { + if ( quit_now ) + return; + if ( app_object ) { auto ftermdata = FTerm::getFTermData(); @@ -84,6 +85,7 @@ FApplication::FApplication ( const int& _argc return; } + // First define the application object app_object = this; if ( ! (_argc && _argv) ) @@ -145,10 +147,10 @@ int FApplication::exec() // run if ( quit_now ) { quit_now = false; - return EXIT_FAILURE; + return quit_code; } - quit_code = 0; + quit_code = EXIT_SUCCESS; enterLoop(); return quit_code; } @@ -263,23 +265,10 @@ bool FApplication::removeQueuedEvent (const FObject* receiver) } //---------------------------------------------------------------------- -void FApplication::processExternalUserEvent() +void FApplication::initTerminal() { - // This method can be overloaded and replaced by own code -} - -//---------------------------------------------------------------------- -FWidget* FApplication::processParameters (const int& argc, char* argv[]) -{ - if ( argc > 0 && argv[1] && ( std::strcmp(argv[1], "--help") == 0 - || std::strcmp(argv[1], "-h") == 0 ) ) - { - showParameterUsage(); - } - - getStartOptions().setDefault(); - cmd_options (argc, argv); - return nullptr; + if ( ! isQuit() ) + FWidget::initTerminal(); } //---------------------------------------------------------------------- @@ -313,56 +302,6 @@ void FApplication::setDarkTheme() setColorTheme(); } -//---------------------------------------------------------------------- -void FApplication::showParameterUsage() -{ - std::cout \ - << "Generic options:\n" - << " -h, --help " - << " Display this help and exit\n" - << "\n" - << "The Final Cut options:\n" - << " --encoding " - << " Sets the character encoding mode\n" - << " " - << " {utf8, vt100, pc, ascii}\n" - << " --no-mouse " - << " Disable mouse support\n" - << " --no-optimized-cursor " - << " Disable cursor optimization\n" - << " --no-terminal-detection " - << " Disable terminal detection\n" - << " --no-terminal-data-request" - << " Do not determine terminal font and title\n" - << " --no-color-change " - << " Do not redefine the color palette\n" - << " --no-sgr-optimizer " - << " Do not optimize SGR sequences\n" - << " --vgafont " - << " Set the standard vga 8x16 font\n" - << " --newfont " - << " Enables the graphical font\n" - << " --dark-theme " - << " Enables the dark theme\n" - -#if defined(__FreeBSD__) || defined(__DragonFly__) - << "\n" - << "FreeBSD console options:\n" - << " --no-esc-for-alt-meta " - << " Do not send a ESC prefix for the alt/meta key\n" - << " --no-cursorstyle-change " - << " Do not change the current cursor style\n" -#elif defined(__NetBSD__) || defined(__OpenBSD__) - << "\n" - << "NetBSD/OpenBSD console options:\n" - << " --no-esc-for-alt-meta " - << " Do not send a ESC prefix for the alt/meta key\n" -#endif - - << std::endl; // newline character + flushes the output stream - std::exit(EXIT_SUCCESS); -} - //---------------------------------------------------------------------- void FApplication::closeConfirmationDialog (FWidget* w, FCloseEvent* ev) { @@ -384,6 +323,15 @@ void FApplication::closeConfirmationDialog (FWidget* w, FCloseEvent* ev) } } + +// protected methods of FApplication +//---------------------------------------------------------------------- +void FApplication::processExternalUserEvent() +{ + // This method can be overloaded and replaced by own code +} + + // private methods of FApplication //---------------------------------------------------------------------- void FApplication::init (uInt64 key_time, uInt64 dblclick_time) @@ -476,45 +424,49 @@ void FApplication::cmd_options (const int& argc, char* argv[]) else if ( encoding.includes("help") ) showParameterUsage(); else - FTerm::exitWithMessage ( "Unknown encoding " - + std::string(encoding.c_str()) ); + { + auto ftermdata = FTerm::getFTermData(); + ftermdata->setExitMessage ( "Unknown encoding " + + std::string(encoding.c_str()) ); + exit(EXIT_FAILURE); + } } - if ( std::strcmp(long_options[idx].name, "no-mouse") == 0 ) + if ( std::strcmp(long_options[idx].name, "no-mouse") == 0 ) getStartOptions().mouse_support = false; - if ( std::strcmp(long_options[idx].name, "no-optimized-cursor") == 0 ) + if ( std::strcmp(long_options[idx].name, "no-optimized-cursor") == 0 ) getStartOptions().cursor_optimisation = false; - if ( std::strcmp(long_options[idx].name, "no-terminal-detection") == 0 ) + if ( std::strcmp(long_options[idx].name, "no-terminal-detection") == 0 ) getStartOptions().terminal_detection = false; - if ( std::strcmp(long_options[idx].name, "no-terminal-data-request") == 0 ) + if ( std::strcmp(long_options[idx].name, "no-terminal-data-request") == 0 ) getStartOptions().terminal_data_request = false; - if ( std::strcmp(long_options[idx].name, "no-color-change") == 0 ) + if ( std::strcmp(long_options[idx].name, "no-color-change") == 0 ) getStartOptions().color_change = false; - if ( std::strcmp(long_options[idx].name, "no-sgr-optimizer") == 0 ) + if ( std::strcmp(long_options[idx].name, "no-sgr-optimizer") == 0 ) getStartOptions().sgr_optimizer = false; - if ( std::strcmp(long_options[idx].name, "vgafont") == 0 ) + if ( std::strcmp(long_options[idx].name, "vgafont") == 0 ) getStartOptions().vgafont = true; - if ( std::strcmp(long_options[idx].name, "newfont") == 0 ) + if ( std::strcmp(long_options[idx].name, "newfont") == 0 ) getStartOptions().newfont = true; - if ( std::strcmp(long_options[idx].name, "dark-theme") == 0 ) + if ( std::strcmp(long_options[idx].name, "dark-theme") == 0 ) getStartOptions().dark_theme = true; #if defined(__FreeBSD__) || defined(__DragonFly__) - if ( std::strcmp(long_options[idx].name, "no-esc-for-alt-meta") == 0 ) + if ( std::strcmp(long_options[idx].name, "no-esc-for-alt-meta") == 0 ) getStartOptions().meta_sends_escape = false; - if ( std::strcmp(long_options[idx].name, "no-cursorstyle-change") == 0 ) + if ( std::strcmp(long_options[idx].name, "no-cursorstyle-change") == 0 ) getStartOptions().change_cursorstyle = false; #elif defined(__NetBSD__) || defined(__OpenBSD__) - if ( std::strcmp(long_options[idx].name, "no-esc-for-alt-meta") == 0 ) + if ( std::strcmp(long_options[idx].name, "no-esc-for-alt-meta") == 0 ) getStartOptions().meta_sends_escape = false; #endif } @@ -527,6 +479,55 @@ inline FStartOptions& FApplication::getStartOptions() return FStartOptions::getFStartOptions(); } +//---------------------------------------------------------------------- +void FApplication::showParameterUsage() +{ + std::cout \ + << "Generic options:\n" + << " -h, --help " + << " Display this help and exit\n" + << "\n" + << "The Final Cut options:\n" + << " --encoding " + << " Sets the character encoding mode\n" + << " " + << " {utf8, vt100, pc, ascii}\n" + << " --no-mouse " + << " Disable mouse support\n" + << " --no-optimized-cursor " + << " Disable cursor optimization\n" + << " --no-terminal-detection " + << " Disable terminal detection\n" + << " --no-terminal-data-request" + << " Do not determine terminal font and title\n" + << " --no-color-change " + << " Do not redefine the color palette\n" + << " --no-sgr-optimizer " + << " Do not optimize SGR sequences\n" + << " --vgafont " + << " Set the standard vga 8x16 font\n" + << " --newfont " + << " Enables the graphical font\n" + << " --dark-theme " + << " Enables the dark theme\n" + +#if defined(__FreeBSD__) || defined(__DragonFly__) + << "\n" + << "FreeBSD console options:\n" + << " --no-esc-for-alt-meta " + << " Do not send a ESC prefix for the alt/meta key\n" + << " --no-cursorstyle-change " + << " Do not change the current cursor style\n" +#elif defined(__NetBSD__) || defined(__OpenBSD__) + << "\n" + << "NetBSD/OpenBSD console options:\n" + << " --no-esc-for-alt-meta " + << " Do not send a ESC prefix for the alt/meta key\n" +#endif + + << std::endl; // newline character + flushes the output stream +} + //---------------------------------------------------------------------- inline void FApplication::destroyLog() { @@ -1119,6 +1120,20 @@ void FApplication::sendWheelEvent ( const FPoint& widgetMousePos } } +//---------------------------------------------------------------------- +FWidget* FApplication::processParameters (const int& argc, char* argv[]) +{ + if ( argc > 0 && argv[1] && ( std::strcmp(argv[1], "--help") == 0 + || std::strcmp(argv[1], "-h") == 0 ) ) + { + showParameterUsage(); + FApplication::exit(EXIT_SUCCESS); + } + + cmd_options (argc, argv); + return nullptr; +} + //---------------------------------------------------------------------- void FApplication::processMouseEvent() { diff --git a/src/fbutton.cpp b/src/fbutton.cpp index f970fa0a..9e321441 100644 --- a/src/fbutton.cpp +++ b/src/fbutton.cpp @@ -402,8 +402,9 @@ void FButton::onFocusOut (FFocusEvent*) void FButton::init() { const auto& wc = getColorTheme(); - setForegroundColor (wc->button_active_fg); - setBackgroundColor (wc->button_active_bg); + button_fg = wc->button_active_fg; + button_bg = wc->button_active_bg; + resetColors(); setShadow(); if ( ! text.isEmpty() ) diff --git a/src/fcheckbox.cpp b/src/fcheckbox.cpp index 1e6f6c27..44ba8b57 100644 --- a/src/fcheckbox.cpp +++ b/src/fcheckbox.cpp @@ -74,7 +74,7 @@ void FCheckBox::draw() void FCheckBox::drawCheckButton() { print() << FPoint{1, 1}; - useParentWidgetColor(); + setColor(); if ( FTerm::isMonochron() ) { diff --git a/src/fcolorpalette.cpp b/src/fcolorpalette.cpp index ab003a40..d061d767 100644 --- a/src/fcolorpalette.cpp +++ b/src/fcolorpalette.cpp @@ -180,7 +180,7 @@ void default16DarkColorPalette::setColorPalette() setPalette (fc::Red, 0xa5, 0x40, 0x40); setPalette (fc::Magenta, 0xb2, 0x18, 0xb2); setPalette (fc::Brown, 0xe8, 0x87, 0x1f); - setPalette (fc::LightGray, 0xd2, 0xd2, 0xd2); + setPalette (fc::LightGray, 0xdc, 0xdc, 0xdc); setPalette (fc::DarkGray, 0x27, 0x33, 0x39); setPalette (fc::LightBlue, 0xb0, 0xb0, 0xb8); setPalette (fc::LightGreen, 0x5e, 0xeb, 0x5c); diff --git a/src/fcombobox.cpp b/src/fcombobox.cpp index c3471847..c08ffc1e 100644 --- a/src/fcombobox.cpp +++ b/src/fcombobox.cpp @@ -124,8 +124,11 @@ void FDropDownListBox::init() void FDropDownListBox::draw() { // Fill the background + const auto& wc = getColorTheme(); - setColor (wc->menu_active_fg, wc->menu_active_bg); + setForegroundColor (wc->list_fg); + setBackgroundColor (wc->list_bg); + setColor(); if ( FTerm::isMonochron() ) setReverse(true); diff --git a/src/fdialog.cpp b/src/fdialog.cpp index c34a3d5c..2ea2a16a 100644 --- a/src/fdialog.cpp +++ b/src/fdialog.cpp @@ -166,7 +166,7 @@ void FDialog::show() FWindow::show(); - if ( isModal() ) + if ( isModal() && ! FApplication::isQuit() ) { auto fapp = FApplication::getApplicationObject(); fapp->enterLoop(); diff --git a/src/flabel.cpp b/src/flabel.cpp index 51d5881a..1ad9fa9a 100644 --- a/src/flabel.cpp +++ b/src/flabel.cpp @@ -115,6 +115,15 @@ void FLabel::setAlignment (fc::text_alignment align) alignment = align; } +//---------------------------------------------------------------------- +void FLabel::resetColors() +{ + useParentWidgetColor(); + const auto& wc = getColorTheme(); + emphasis_color = wc->label_emphasis_fg; + ellipsis_color = wc->label_ellipsis_fg; +} + //---------------------------------------------------------------------- bool FLabel::setEnable (bool enable) { @@ -247,6 +256,7 @@ void FLabel::cb_accelWidgetDestroyed (const FWidget*, const FDataPtr) void FLabel::init() { unsetFocusable(); + useParentWidgetColor(); } //---------------------------------------------------------------------- @@ -290,7 +300,7 @@ void FLabel::draw() if ( text.isEmpty() ) return; - useParentWidgetColor(); + if ( FTerm::isMonochron() ) { diff --git a/src/flistbox.cpp b/src/flistbox.cpp index 8211a6a1..6f990743 100644 --- a/src/flistbox.cpp +++ b/src/flistbox.cpp @@ -721,7 +721,6 @@ void FListBox::draw() useParentWidgetColor(); - if ( FTerm::isMonochron() ) setReverse(true); diff --git a/src/foptimove.cpp b/src/foptimove.cpp index dcafbcf0..8bef544c 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -268,7 +268,7 @@ void FOptiMove::set_cursor_right (const char cap[]) //---------------------------------------------------------------------- void FOptiMove::set_cursor_address (const char cap[]) { - if ( cap ) + if ( cap && FTermcap::isInitialized() ) { const char* temp = FTermcap::encodeMotionParameter(cap, 23, 23); F_cursor_address.cap = cap; @@ -286,7 +286,7 @@ void FOptiMove::set_cursor_address (const char cap[]) //---------------------------------------------------------------------- void FOptiMove::set_column_address (const char cap[]) { - if ( cap ) + if ( cap && FTermcap::isInitialized() ) { const char* temp = FTermcap::encodeParameter(cap, 23); F_column_address.cap = cap; @@ -304,7 +304,7 @@ void FOptiMove::set_column_address (const char cap[]) //---------------------------------------------------------------------- void FOptiMove::set_row_address (const char cap[]) { - if ( cap ) + if ( cap && FTermcap::isInitialized() ) { const char* temp = FTermcap::encodeParameter(cap, 23); F_row_address.cap = cap; @@ -322,7 +322,7 @@ void FOptiMove::set_row_address (const char cap[]) //---------------------------------------------------------------------- void FOptiMove::set_parm_up_cursor (const char cap[]) { - if ( cap ) + if ( cap && FTermcap::isInitialized() ) { const char* temp = FTermcap::encodeParameter(cap, 23); F_parm_up_cursor.cap = cap; @@ -340,7 +340,7 @@ void FOptiMove::set_parm_up_cursor (const char cap[]) //---------------------------------------------------------------------- void FOptiMove::set_parm_down_cursor (const char cap[]) { - if ( cap ) + if ( cap && FTermcap::isInitialized() ) { const char* temp = FTermcap::encodeParameter(cap, 23); F_parm_down_cursor.cap = cap; @@ -358,7 +358,7 @@ void FOptiMove::set_parm_down_cursor (const char cap[]) //---------------------------------------------------------------------- void FOptiMove::set_parm_left_cursor (const char cap[]) { - if ( cap ) + if ( cap && FTermcap::isInitialized() ) { const char* temp = FTermcap::encodeParameter(cap, 23); F_parm_left_cursor.cap = cap; @@ -376,7 +376,7 @@ void FOptiMove::set_parm_left_cursor (const char cap[]) //---------------------------------------------------------------------- void FOptiMove::set_parm_right_cursor (const char cap[]) { - if ( cap ) + if ( cap && FTermcap::isInitialized() ) { const char* temp = FTermcap::encodeParameter(cap, 23); F_parm_right_cursor.cap = cap; @@ -394,7 +394,7 @@ void FOptiMove::set_parm_right_cursor (const char cap[]) //---------------------------------------------------------------------- void FOptiMove::set_erase_chars (const char cap[]) { - if ( cap ) + if ( cap && FTermcap::isInitialized() ) { const char* temp = FTermcap::encodeParameter(cap, 23); F_erase_chars.cap = cap; @@ -412,7 +412,7 @@ void FOptiMove::set_erase_chars (const char cap[]) //---------------------------------------------------------------------- void FOptiMove::set_repeat_char (const char cap[]) { - if ( cap ) + if ( cap && FTermcap::isInitialized() ) { const char* temp = FTermcap::encodeParameter(cap, ' ', 23); F_repeat_char.cap = cap; diff --git a/src/fradiobutton.cpp b/src/fradiobutton.cpp index 08707354..5f511b6b 100644 --- a/src/fradiobutton.cpp +++ b/src/fradiobutton.cpp @@ -74,7 +74,7 @@ void FRadioButton::draw() void FRadioButton::drawRadioButton() { print() << FPoint{1, 1}; - useParentWidgetColor(); + setColor(); if ( FTerm::isMonochron() ) { diff --git a/src/fscrollbar.cpp b/src/fscrollbar.cpp index c8e6c7e8..257aeca9 100644 --- a/src/fscrollbar.cpp +++ b/src/fscrollbar.cpp @@ -453,6 +453,7 @@ void FScrollbar::draw() drawButtons(); current_slider_pos = -1; + max_color = FTerm::getMaxColor(); drawBar(); } diff --git a/src/fterm.cpp b/src/fterm.cpp index 663a5dad..4fd68cce 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -62,13 +62,16 @@ namespace finalcut { -// global FTerm object +// Global FTerm object static FTerm* init_term_object{nullptr}; -// global init state +// Global init state static bool term_initialized{false}; -// static class attributes +// Counts the number of object instances +static uInt object_counter{0}; + +// Static class attributes FTermData* FTerm::data {nullptr}; FSystem* FTerm::fsys {nullptr}; FOptiMove* FTerm::opti_move {nullptr}; @@ -101,10 +104,12 @@ FMouseControl* FTerm::mouse {nullptr}; // constructors and destructor //---------------------------------------------------------------------- -FTerm::FTerm (bool disable_alt_screen) +FTerm::FTerm() { - if ( ! term_initialized ) - init (disable_alt_screen); + if ( object_counter == 0 ) + allocationValues(); // Allocation of global objects + + object_counter++; } //---------------------------------------------------------------------- @@ -112,6 +117,14 @@ FTerm::~FTerm() // destructor { if ( init_term_object == this ) finish(); // Resetting console settings + + object_counter--; + + if ( object_counter == 0 ) + { + printExitMessage(); + deallocationValues(); // Deallocation of global objects + } } @@ -119,6 +132,9 @@ FTerm::~FTerm() // destructor //---------------------------------------------------------------------- std::size_t FTerm::getLineNumber() { + if ( ! data ) + data = FTerm::getFTermData(); + const auto& term_geometry = data->getTermGeometry(); if ( term_geometry.getHeight() == 0 ) @@ -130,6 +146,9 @@ std::size_t FTerm::getLineNumber() //---------------------------------------------------------------------- std::size_t FTerm::getColumnNumber() { + if ( ! data ) + data = FTerm::getFTermData(); + const auto& term_geometry = data->getTermGeometry(); if ( term_geometry.getWidth() == 0 ) @@ -217,7 +236,7 @@ FSystem* FTerm::getFSystem() } catch (const std::bad_alloc&) { - badAllocOutput ("FTermData"); + badAllocOutput ("FSystemImpl"); std::abort(); } } @@ -640,6 +659,14 @@ void FTerm::setDblclickInterval (const uInt64 timeout) mouse->setDblclickInterval(timeout); } +//---------------------------------------------------------------------- +void FTerm::useAlternateScreen (bool enable) +{ + // Sets alternate screen usage + + getFTermData()->useAlternateScreen(enable); +} + //---------------------------------------------------------------------- bool FTerm::setUTF8 (bool enable) // UTF-8 (Unicode) { @@ -1293,22 +1320,6 @@ void FTerm::changeTermSizeFinished() data->setTermResized(false); } -//---------------------------------------------------------------------- -void FTerm::exitWithMessage (const FString& message) -{ - // Exit the programm - if ( init_term_object ) - init_term_object->finish(); - - std::fflush (stderr); - std::fflush (stdout); - - if ( ! message.isEmpty() ) - FApplication::getLog()->warn(message.c_str()); - - std::exit (EXIT_FAILURE); -} - // private methods of FTerm //---------------------------------------------------------------------- @@ -1318,16 +1329,13 @@ inline FStartOptions& FTerm::getStartOptions() } //---------------------------------------------------------------------- -void FTerm::init_global_values (bool disable_alt_screen) +void FTerm::init_global_values() { // Initialize global values // Preset to false data->setNewFont(false); - // Sets alternate screen usage - data->useAlternateScreen(! disable_alt_screen); - // Initialize xterm object getFTermXTerminal()->init(); @@ -1653,13 +1661,21 @@ void FTerm::init_optiAttr() } //---------------------------------------------------------------------- -void FTerm::init_font() +bool FTerm::init_font() { if ( getStartOptions().vgafont && ! setVGAFont() ) - exitWithMessage ("VGAfont is not supported by this terminal"); + { + data->setExitMessage("VGAfont is not supported by this terminal"); + FApplication::exit(EXIT_FAILURE); + } if ( getStartOptions().newfont && ! setNewFont() ) - exitWithMessage ("Newfont is not supported by this terminal"); + { + data->setExitMessage("Newfont is not supported by this terminal"); + FApplication::exit(EXIT_FAILURE); + } + + return ( ! FApplication::isQuit() ); } //---------------------------------------------------------------------- @@ -2112,6 +2128,7 @@ void FTerm::useAlternateScreenBuffer() { putstring (TCAP(fc::t_enter_ca_mode)); std::fflush(stdout); + getFTermData()->setAlternateScreenInUse(true); } } @@ -2128,6 +2145,7 @@ void FTerm::useNormalScreenBuffer() { putstring (TCAP(fc::t_exit_ca_mode)); std::fflush(stdout); + getFTermData()->setAlternateScreenInUse(false); } // restore cursor to position of last save_cursor @@ -2209,17 +2227,17 @@ inline void FTerm::deallocationValues() const defaultPutChar* putchar_ptr = &(putchar()); delete putchar_ptr; + destroyColorPaletteTheme(); FStartOptions::destroyObject(); } //---------------------------------------------------------------------- -void FTerm::init (bool disable_alt_screen) +void FTerm::init() { init_term_object = this; // Initialize global values for all objects - allocationValues(); - init_global_values(disable_alt_screen); + init_global_values(); // Initialize the terminal if ( ! init_terminal() ) @@ -2294,7 +2312,8 @@ void FTerm::init (bool disable_alt_screen) // Activate the VGA or the new graphic font // (depending on the initialization values) - init_font(); + if ( ! init_font() ) + return; // Turn off hardware echo FTermios::unsetHardwareEcho(); @@ -2474,14 +2493,6 @@ void FTerm::finish() if ( data->isNewFont() || data->isVGAFont() ) setOldFont(); - - // Print exit message - const auto& exit_message = data->getExitMessage(); - - if ( ! exit_message.isEmpty() ) - FApplication::getLog()->info(exit_message.c_str()); - - deallocationValues(); } //---------------------------------------------------------------------- @@ -2512,6 +2523,48 @@ void FTerm::destroyColorPaletteTheme() delete theme; } +//---------------------------------------------------------------------- +void FTerm::printExitMessage() +{ + // Print exit message + const auto& exit_message = data->getExitMessage(); + + if ( ! exit_message.isEmpty() ) + std::cerr << "Exit: " << exit_message << std::endl; +} + +//---------------------------------------------------------------------- +void FTerm::terminalSizeChange() +{ + if ( ! data ) + return; + + if ( data->hasTermResized() ) + return; + + // Initialize a resize event to the root element + data->setTermResized(true); +} + +//---------------------------------------------------------------------- +void FTerm::processTermination (int signum) +{ + init_term_object->finish(); + std::fflush (stderr); + std::fflush (stdout); + + if ( data ) + { + FStringStream msg{}; + msg << "Program stopped: signal " << signum + << " (" << strsignal(signum) << ")"; + data->setExitMessage(msg.str()); + printExitMessage(); + } + + std::terminate(); +} + //---------------------------------------------------------------------- void FTerm::setSignalHandler() { @@ -2542,14 +2595,7 @@ void FTerm::signal_handler (int signum) switch (signum) { case SIGWINCH: - if ( ! data ) - break; - - if ( data->hasTermResized() ) - break; - - // initialize a resize event to the root element - data->setTermResized(true); + terminalSizeChange(); break; case SIGTERM: @@ -2558,15 +2604,7 @@ void FTerm::signal_handler (int signum) case SIGABRT: case SIGILL: case SIGSEGV: - init_term_object->finish(); - std::fflush (stderr); - std::fflush (stdout); - *FApplication::getLog() << FLog::Error - << "\nProgram stopped: signal " - << signum - << " (" << strsignal(signum) << ")" - << std::endl; - std::terminate(); + processTermination(signum); default: break; diff --git a/src/ftermfreebsd.cpp b/src/ftermfreebsd.cpp index 324af019..99359ba1 100644 --- a/src/ftermfreebsd.cpp +++ b/src/ftermfreebsd.cpp @@ -30,11 +30,12 @@ #include "final/ftypes.h" #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST) -#define initCheck(ret_value) \ - if ( ! isInitialized() ) \ - { \ - warnNotInitialized(); \ - return ret_value; \ +#define initCheck(ret_value) \ + if ( ! isInitialized() ) \ + { \ + if ( ! FApplication::isQuit() ) \ + warnNotInitialized(); \ + return ret_value; \ } #endif diff --git a/src/ftermopenbsd.cpp b/src/ftermopenbsd.cpp index e8e2499a..e962d470 100644 --- a/src/ftermopenbsd.cpp +++ b/src/ftermopenbsd.cpp @@ -27,11 +27,12 @@ #include "final/ftermopenbsd.h" #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(UNIT_TEST) -#define initCheck(ret_value) \ - if ( ! isInitialized() ) \ - { \ - warnNotInitialized(); \ - return ret_value; \ +#define initCheck(ret_value) \ + if ( ! isInitialized() ) \ + { \ + if ( ! FApplication::isQuit() ) \ + warnNotInitialized(); \ + return ret_value; \ } #endif diff --git a/src/ftermxterminal.cpp b/src/ftermxterminal.cpp index 14569b33..c120e63a 100644 --- a/src/ftermxterminal.cpp +++ b/src/ftermxterminal.cpp @@ -36,11 +36,12 @@ #include "final/ftermxterminal.h" #include "final/fsize.h" -#define initCheck(ret_value) \ - if ( ! isInitialized() ) \ - { \ - warnNotInitialized(); \ - return ret_value; \ +#define initCheck(ret_value) \ + if ( ! isInitialized() ) \ + { \ + if ( ! FApplication::isQuit() ) \ + warnNotInitialized(); \ + return ret_value; \ } namespace finalcut diff --git a/src/ftogglebutton.cpp b/src/ftogglebutton.cpp index 6f665eb4..7da98051 100644 --- a/src/ftogglebutton.cpp +++ b/src/ftogglebutton.cpp @@ -148,29 +148,12 @@ bool FToggleButton::setNoUnderline (bool enable) bool FToggleButton::setEnable (bool enable) { FWidget::setEnable(enable); - const auto& wc = getColorTheme(); + resetColors(); if ( enable ) - { setHotkeyAccelerator(); - - if ( hasFocus() ) - { - setForegroundColor (wc->toggle_button_active_focus_fg); - setBackgroundColor (wc->toggle_button_active_focus_bg); - } - else - { - setForegroundColor (wc->toggle_button_active_fg); - setBackgroundColor (wc->toggle_button_active_bg); - } - } else - { delAccelerator(); - setForegroundColor (wc->toggle_button_inactive_fg); - setBackgroundColor (wc->toggle_button_inactive_bg); - } return enable; } @@ -179,25 +162,10 @@ bool FToggleButton::setEnable (bool enable) bool FToggleButton::setFocus (bool enable) { FWidget::setFocus(enable); + resetColors(); - if ( isEnabled() ) - { - const auto& wc = getColorTheme(); - - if ( enable ) - { - if ( isRadioButton() ) - focus_inside_group = false; - - setForegroundColor (wc->toggle_button_active_focus_fg); - setBackgroundColor (wc->toggle_button_active_focus_bg); - } - else - { - setForegroundColor (wc->toggle_button_active_fg); - setBackgroundColor (wc->toggle_button_active_bg); - } - } + if ( isEnabled() && hasFocus() && isRadioButton() ) + focus_inside_group = false; return enable; } diff --git a/src/fvterm.cpp b/src/fvterm.cpp index b5ea316e..aaf33999 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -54,6 +54,7 @@ bool FVTerm::terminal_update_complete{false}; bool FVTerm::terminal_update_pending{false}; bool FVTerm::force_terminal_update{false}; bool FVTerm::no_terminal_updates{false}; +bool FVTerm::cursor_hideable{false}; int FVTerm::skipped_terminal_update{}; uInt FVTerm::erase_char_length{}; uInt FVTerm::repeat_char_length{}; @@ -80,10 +81,10 @@ FChar FVTerm::i_ch{}; // constructors and destructor //---------------------------------------------------------------------- -FVTerm::FVTerm (bool initialize, bool disable_alt_screen) +FVTerm::FVTerm() { - if ( initialize ) - init (disable_alt_screen); + if ( ! init_object ) + init(); } //---------------------------------------------------------------------- @@ -171,6 +172,9 @@ void FVTerm::hideCursor (bool enable) { // Hides or shows the input cursor on the terminal + if ( ! cursor_hideable ) + return; + const char* visibility_str = FTerm::cursorsVisibilityString (enable); if ( visibility_str ) @@ -644,6 +648,9 @@ void FVTerm::flush() { // Flush the output buffer + if ( ! output_buffer ) + return; + while ( ! output_buffer->empty() ) { const static FTerm::defaultPutChar& FTermPutchar = FTerm::putchar(); @@ -798,6 +805,9 @@ void FVTerm::removeArea (FTermArea*& area) //---------------------------------------------------------------------- void FVTerm::restoreVTerm (const FRect& box) { + if ( ! vterm ) + return; + int x = box.getX() - 1; int y = box.getY() - 1; int w = int(box.getWidth()); @@ -1339,6 +1349,23 @@ void FVTerm::finishTerminalUpdate() terminal_update_complete = true; } +//---------------------------------------------------------------------- +void FVTerm::initTerminal() +{ + if ( fterm ) + fterm->initTerminal(); + + // Get FKeyboard object + keyboard = FTerm::getFKeyboard(); + + // Hide the input cursor + cursor_hideable = FTerm::isCursorHideable(); + hideCursor(); + + // Initialize character lengths + init_characterLengths(FTerm::getFOptiMove()); +} + // private methods of FVTerm //---------------------------------------------------------------------- @@ -1897,7 +1924,7 @@ const FChar FVTerm::getOverlappedCharacter (const FPoint& pos, FVTerm* obj) } //---------------------------------------------------------------------- -void FVTerm::init (bool disable_alt_screen) +void FVTerm::init() { init_object = this; vterm = nullptr; @@ -1906,16 +1933,20 @@ void FVTerm::init (bool disable_alt_screen) try { - fterm = new FTerm (disable_alt_screen); + fterm = new FTerm(); term_pos = new FPoint(-1, -1); output_buffer = new std::queue; } catch (const std::bad_alloc&) { badAllocOutput ("FTerm, FPoint, or std::queue"); - std::abort(); + return; } + // Presetting of the current locale for full-width character support. + // The final setting is made later in FTerm::init_locale(). + std::setlocale (LC_ALL, ""); + // term_attribute stores the current state of the terminal term_attribute.ch = '\0'; term_attribute.fg_color = fc::Default; @@ -1937,15 +1968,6 @@ void FVTerm::init (bool disable_alt_screen) createArea (term_geometry, shadow_size, vdesktop); vdesktop->visible = true; active_area = vdesktop; - - // Get FKeyboard object - keyboard = FTerm::getFKeyboard(); - - // Hide the input cursor - hideCursor(); - - // Initialize character lengths - init_characterLengths (FTerm::getFOptiMove()); } //---------------------------------------------------------------------- @@ -1978,7 +2000,8 @@ void FVTerm::finish() // Clear the terminal setNormal(); - if ( FTerm::hasAlternateScreen() ) + if ( FTerm::hasAlternateScreen() + && FTerm::getFTermData()->isInAlternateScreen() ) clearTerm(); flush(); diff --git a/src/fwidget.cpp b/src/fwidget.cpp index 22bbf124..fdbbcc66 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -49,8 +49,8 @@ FWidget::FWidgetList* FWidget::window_list{nullptr}; FWidget::FWidgetList* FWidget::dialog_list{nullptr}; FWidget::FWidgetList* FWidget::always_on_top_list{nullptr}; FWidget::FWidgetList* FWidget::close_widget{nullptr}; +bool FWidget::init_terminal{false}; bool FWidget::init_desktop{false}; -bool FWidget::hideable{false}; uInt FWidget::modal_dialog_counter{}; //---------------------------------------------------------------------- @@ -59,8 +59,8 @@ uInt FWidget::modal_dialog_counter{}; // constructors and destructor //---------------------------------------------------------------------- -FWidget::FWidget (FWidget* parent, bool disable_alt_screen) - : FVTerm{ ! (bool(parent) || root_widget), disable_alt_screen} +FWidget::FWidget (FWidget* parent) + : FVTerm{} , FObject{parent} { // init bit field with 0 @@ -83,22 +83,18 @@ FWidget::FWidget (FWidget* parent, bool disable_alt_screen) return; } - root_widget = this; - show_root_widget = nullptr; - redraw_root_widget = nullptr; - modal_dialog_counter = 0; - statusbar = nullptr; initRootWidget(); } else { - flags.visible_cursor = ! hideable; woffset = parent->wclient_offset; - double_flatline_mask.top.resize (getWidth(), false); - double_flatline_mask.right.resize (getHeight(), false); - double_flatline_mask.bottom.resize (getWidth(), false); - double_flatline_mask.left.resize (getHeight(), false); } + + flags.visible_cursor = false; + double_flatline_mask.top.resize (getWidth(), false); + double_flatline_mask.right.resize (getHeight(), false); + double_flatline_mask.bottom.resize (getWidth(), false); + double_flatline_mask.left.resize (getHeight(), false); } //---------------------------------------------------------------------- @@ -658,9 +654,10 @@ bool FWidget::setCursorPos (const FPoint& pos) woffsetY += (1 - area->widget->getTopPadding()); } + bool visible = ! isCursorHideable() || flags.visible_cursor; setAreaCursor ( { woffsetX + pos.getX() , woffsetY + pos.getY() } - , flags.visible_cursor + , visible , area ); return true; } @@ -1032,20 +1029,12 @@ void FWidget::show() { // Make the widget visible and draw it - if ( ! isVisible() ) + if ( ! isVisible() || FApplication::isQuit() ) return; - if ( ! init_desktop ) - { - // Sets the initial screen settings - FTerm::initScreenSettings(); - // Initializing vdesktop - const auto& r = getRootWidget(); - setColor(r->getForegroundColor(), r->getBackgroundColor()); - clearArea (getVirtualDesktop()); - // Destop is now initialized - init_desktop = true; - } + // Initialize desktop on first call + if ( ! init_desktop && root_widget ) + root_widget->initDesktop(); if ( ! show_root_widget ) { @@ -1320,6 +1309,49 @@ void FWidget::setTermOffsetWithPadding() , int(r->getHeight()) - 1 - r->getBottomPadding() ); } +//---------------------------------------------------------------------- +void FWidget::initTerminal() +{ + if ( hasParent() || init_terminal ) + return; + + // Initialize the physical and virtual terminal + FVTerm::initTerminal(); + + // Initialize default widget colors (after terminal detection) + initColorTheme(); + + // Set default foreground and background color of the desktop/terminal + auto color_theme = getColorTheme(); + root_widget->foreground_color = color_theme->term_fg; + root_widget->background_color = color_theme->term_bg; + resetColors(); + + // The terminal is now initialized + init_terminal = true; +} + +//---------------------------------------------------------------------- +void FWidget::initDesktop() +{ + if ( hasParent() || init_desktop ) + return; + + if ( ! init_terminal ) + initTerminal(); + + // Sets the initial screen settings + FTerm::initScreenSettings(); + + // Initializing vdesktop + const auto& r = getRootWidget(); + setColor(r->getForegroundColor(), r->getBackgroundColor()); + clearArea (getVirtualDesktop()); + + // Destop is now initialized + init_desktop = true; +} + //---------------------------------------------------------------------- void FWidget::adjustSize() { @@ -1713,6 +1745,18 @@ void FWidget::onClose (FCloseEvent* ev) // private methods of FWidget +//---------------------------------------------------------------------- +void FWidget::determineDesktopSize() +{ + // Determine width and height of the terminal + + detectTermSize(); + wsize.setRect(1, 1, getDesktopWidth(), getDesktopHeight()); + adjust_wsize = wsize; + woffset.setRect(0, 0, getDesktopWidth(), getDesktopHeight()); + wclient_offset = woffset; +} + //---------------------------------------------------------------------- void FWidget::initRootWidget() { @@ -1730,29 +1774,18 @@ void FWidget::initRootWidget() return; } - hideable = FTerm::isCursorHideable(); - flags.visible_cursor = ! hideable; + // Root widget basic initialization + root_widget = this; + show_root_widget = nullptr; + redraw_root_widget = nullptr; + modal_dialog_counter = 0; + statusbar = nullptr; // Determine width and height of the terminal - detectTermSize(); - wsize.setRect(1, 1, getDesktopWidth(), getDesktopHeight()); - adjust_wsize = wsize; - woffset.setRect(0, 0, getDesktopWidth(), getDesktopHeight()); - wclient_offset = woffset; + determineDesktopSize(); - double_flatline_mask.top.resize (getWidth(), false); - double_flatline_mask.right.resize (getHeight(), false); - double_flatline_mask.bottom.resize (getWidth(), false); - double_flatline_mask.left.resize (getHeight(), false); - - // Initialize default widget colors + // Initialize default widget colors (before terminal detection) initColorTheme(); - - // Default foreground and background color of the desktop/terminal - auto color_theme = getColorTheme(); - foreground_color = color_theme->term_fg; - background_color = color_theme->term_bg; - init_desktop = false; } //---------------------------------------------------------------------- diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index aeeadb68..875a17eb 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -94,7 +94,7 @@ class FApplication : public FWidget typedef std::shared_ptr FLogPtr; // Constructor - FApplication (const int&, char*[], bool = false); + FApplication (const int&, char*[]); // Disable copy constructor FApplication (const FApplication&) = delete; @@ -122,27 +122,24 @@ class FApplication : public FWidget int exec(); // run int enterLoop(); void exitLoop(); - static void exit (int = 0); + static void exit (int = EXIT_SUCCESS); void quit(); static bool sendEvent (FObject*, FEvent*); void queueEvent (FObject*, FEvent*); void sendQueuedEvents(); bool eventInQueue(); bool removeQueuedEvent (const FObject*); - virtual void processExternalUserEvent(); - static FWidget* processParameters (const int&, char*[]); + void initTerminal(); static void setDefaultTheme(); static void setDarkTheme(); - static void showParameterUsage () - #if defined(__clang__) || defined(__GNUC__) - __attribute__((noreturn)) - #endif - ; static void closeConfirmationDialog (FWidget*, FCloseEvent*); // Callback method void cb_exitApp (const FWidget*, const FDataPtr); + protected: + virtual void processExternalUserEvent(); + private: // Typedefs typedef std::pair EventPair; @@ -152,6 +149,7 @@ class FApplication : public FWidget void init (uInt64, uInt64); static void cmd_options (const int&, char*[]); static FStartOptions& getStartOptions(); + static void showParameterUsage(); void destroyLog(); void findKeyboardWidget(); bool isKeyPressed() const; @@ -186,6 +184,7 @@ class FApplication : public FWidget , const FPoint& , int ); void sendWheelEvent (const FPoint&, const FPoint&); + static FWidget* processParameters (const int&, char*[]); void processMouseEvent(); void processResizeEvent(); void processCloseWidget(); diff --git a/src/include/final/fbutton.h b/src/include/final/fbutton.h index 16d60716..0fef4af5 100644 --- a/src/include/final/fbutton.h +++ b/src/include/final/fbutton.h @@ -158,13 +158,13 @@ class FButton : public FWidget bool click_animation{true}; int click_time{150}; int space_char{int(' ')}; - FColor button_fg{getColorTheme()->button_active_fg}; - FColor button_bg{getColorTheme()->button_active_bg}; - FColor button_hotkey_fg{getColorTheme()->button_hotkey_fg}; - FColor button_focus_fg{getColorTheme()->button_active_focus_fg}; - FColor button_focus_bg{getColorTheme()->button_active_focus_bg}; - FColor button_inactive_fg{getColorTheme()->button_inactive_fg}; - FColor button_inactive_bg{getColorTheme()->button_inactive_bg}; + FColor button_fg{fc::Default}; + FColor button_bg{fc::Default}; + FColor button_hotkey_fg{fc::Default}; + FColor button_focus_fg{fc::Default}; + FColor button_focus_bg{fc::Default}; + FColor button_inactive_fg{fc::Default}; + FColor button_inactive_bg{fc::Default}; std::size_t hotkeypos{NOT_SET}; std::size_t indent{0}; std::size_t center_offset{0}; diff --git a/src/include/final/flabel.h b/src/include/final/flabel.h index 20d55bbc..f6ad464f 100644 --- a/src/include/final/flabel.h +++ b/src/include/final/flabel.h @@ -98,6 +98,7 @@ class FLabel : public FWidget bool setEmphasis (bool); bool setEmphasis(); bool unsetEmphasis(); + void resetColors() override; bool setReverseMode (bool); bool setReverseMode(); bool unsetReverseMode(); @@ -145,8 +146,8 @@ class FLabel : public FWidget std::size_t align_offset{0}; std::size_t hotkeypos{NOT_SET}; std::size_t column_width{0}; - FColor emphasis_color{getColorTheme()->label_emphasis_fg}; - FColor ellipsis_color{getColorTheme()->label_ellipsis_fg}; + FColor emphasis_color{fc::Default}; + FColor ellipsis_color{fc::Default}; bool multiline{false}; bool emphasis{false}; bool reverse_mode{false}; diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h index ff8fd129..d35e8b7e 100644 --- a/src/include/final/fterm.h +++ b/src/include/final/fterm.h @@ -166,7 +166,7 @@ class FTerm final typedef FColorPalette::FSetPalette FSetPalette; // Constructor - explicit FTerm (bool = false); + explicit FTerm(); // Disable copy constructor FTerm (const FTerm&) = delete; @@ -189,7 +189,6 @@ class FTerm final static int getMaxColor(); static FColorPalettePtr& getColorPaletteTheme(); charSubstitution& getCharSubstitutionMap(); - static FTermData* getFTermData(); static FSystem* getFSystem(); static FOptiMove* getFOptiMove(); @@ -257,6 +256,7 @@ class FTerm final static void unsetInsertCursor(); static void redefineDefaultColors (bool); static void setDblclickInterval (const uInt64); + static void useAlternateScreen (bool); static bool setUTF8 (bool); static bool setUTF8(); static bool unsetUTF8(); @@ -299,18 +299,15 @@ class FTerm final static int putchar_ASCII (int); static int putchar_UTF8 (int); + void initTerminal(); static void initScreenSettings(); static const char* changeAttribute (FChar*&, FChar*&); static void changeTermSizeFinished(); - static void exitWithMessage (const FString&) - #if defined(__clang__) || defined(__GNUC__) - __attribute__((noreturn)) - #endif - ; + private: // Methods static FStartOptions& getStartOptions(); - static void init_global_values (bool); + static void init_global_values(); static void init_terminal_device_path(); static void oscPrefix(); static void oscPostfix(); @@ -324,7 +321,7 @@ class FTerm final static void init_quirks(); static void init_optiMove(); static void init_optiAttr(); - static void init_font(); + static bool init_font(); static void init_locale(); static void init_encoding(); static void init_encoding_set(); @@ -352,7 +349,7 @@ class FTerm final static void useNormalScreenBuffer(); void allocationValues(); void deallocationValues(); - void init (bool); + void init(); bool init_terminal(); void initOSspecifics(); void initTermspecifics(); @@ -361,6 +358,9 @@ class FTerm final void finishOSspecifics1(); void finish_encoding(); void destroyColorPaletteTheme(); + static void printExitMessage(); + static void terminalSizeChange(); + [[noreturn]] static void processTermination (int); static void setSignalHandler(); static void resetSignalHandler(); static void signal_handler (int); @@ -467,6 +467,10 @@ inline void FTerm::putstringf (const char format[], Args&&... args) fsys->tputs (&buf[0], 1, FTerm::putchar_ASCII); } +//---------------------------------------------------------------------- +inline void FTerm::initTerminal() +{ init(); } + } // namespace finalcut diff --git a/src/include/final/ftermcap.h b/src/include/final/ftermcap.h index 3d26e3ac..59523473 100644 --- a/src/include/final/ftermcap.h +++ b/src/include/final/ftermcap.h @@ -108,6 +108,9 @@ class FTermcap final template static int paddingPrint (const CharT&, int, fn_putc); + // Inquiry + static bool isInitialized(); + // Methods static void init(); @@ -129,6 +132,7 @@ class FTermcap final // Constant static constexpr std::size_t BUF_SIZE{2048}; + // Methods static void termcap(); static void termcapError (int); @@ -194,6 +198,12 @@ int FTermcap::paddingPrint (const CharT& str, int affcnt, fn_putc putc) return _tputs (C_STR(str), affcnt, putc); } +//---------------------------------------------------------------------- +inline bool FTermcap::isInitialized() +{ + return bool(fsystem && fterm_data && term_detection); +} + } // namespace finalcut diff --git a/src/include/final/ftermdata.h b/src/include/final/ftermdata.h index d14e3d52..cf1124ab 100644 --- a/src/include/final/ftermdata.h +++ b/src/include/final/ftermdata.h @@ -93,6 +93,7 @@ class FTermData final bool hasCursorOptimisation() const; bool isCursorHidden() const; bool hasAlternateScreen() const; + bool isInAlternateScreen() const; bool hasASCIIConsole() const; bool hasVT100Console() const; bool hasUTF8Console() const; @@ -111,6 +112,7 @@ class FTermData final void supportCursorOptimisation (bool); void setCursorHidden (bool); void useAlternateScreen (bool); + void setAlternateScreenInUse (bool); void setASCIIConsole (bool); void setVT100Console (bool); void setUTF8Console (bool); @@ -151,6 +153,7 @@ class FTermData final bool cursor_optimisation{true}; bool hidden_cursor{false}; // Global cursor hidden state bool use_alternate_screen{true}; + bool alternate_screen{false}; bool ascii_console{false}; bool vt100_console{false}; bool utf8_console{false}; @@ -236,6 +239,10 @@ inline bool FTermData::isCursorHidden() const inline bool FTermData::hasAlternateScreen() const { return use_alternate_screen; } +//---------------------------------------------------------------------- +inline bool FTermData::isInAlternateScreen() const +{ return alternate_screen; } + //---------------------------------------------------------------------- inline bool FTermData::hasASCIIConsole() const { return ascii_console; } @@ -300,6 +307,10 @@ inline void FTermData::setCursorHidden (bool hidden_state) inline void FTermData::useAlternateScreen (bool use) { use_alternate_screen = use; } +//---------------------------------------------------------------------- +inline void FTermData::setAlternateScreenInUse (bool in_use) +{ alternate_screen = in_use; } + //---------------------------------------------------------------------- inline void FTermData::setASCIIConsole (bool ascii) { ascii_console = ascii; } diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 497d3d11..a6082c29 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -118,7 +118,7 @@ class FVTerm }; // Constructor - explicit FVTerm (bool, bool = false); + explicit FVTerm(); // Disable copy constructor FVTerm (const FVTerm&) = delete; @@ -293,9 +293,9 @@ class FVTerm bool hasPrintArea() const; bool hasChildPrintArea() const; bool isVirtualWindow() const; + bool isCursorHideable() const; // Methods - void createArea ( const FRect& , const FSize& , FTermArea*& ); @@ -317,6 +317,7 @@ class FVTerm void processTerminalUpdate(); static void startTerminalUpdate(); static void finishTerminalUpdate(); + void initTerminal(); private: // Enumerations @@ -373,7 +374,7 @@ class FVTerm , FVTerm* ); static const FChar getCoveredCharacter (const FPoint&, FVTerm*); static const FChar getOverlappedCharacter (const FPoint&, FVTerm*); - void init (bool); + void init(); static void init_characterLengths (const FOptiMove*); void finish(); static void putAreaLine (const FChar*, FChar*, int); @@ -445,6 +446,7 @@ class FVTerm static uInt clr_bol_length; static uInt clr_eol_length; static uInt cursor_address_length; + static bool cursor_hideable; }; @@ -970,6 +972,10 @@ inline bool FVTerm::hasChildPrintArea() const inline bool FVTerm::isVirtualWindow() const { return vwin; } +//---------------------------------------------------------------------- +inline bool FVTerm::isCursorHideable() const +{ return cursor_hideable; } + } // namespace finalcut diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index fcc6fdfd..d89f331b 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -173,7 +173,7 @@ class FWidget : public FVTerm, public FObject }; // Constructor - explicit FWidget (FWidget* = nullptr, bool = false); + explicit FWidget (FWidget* = nullptr); // Disable copy constructor FWidget (const FWidget&) = delete; @@ -374,6 +374,8 @@ class FWidget : public FVTerm, public FObject void setTermOffsetWithPadding(); // Methods + void initTerminal(); + void initDesktop(); virtual void adjustSize(); void adjustSizeGlobal(); void hideArea (const FSize&); @@ -447,6 +449,7 @@ class FWidget : public FVTerm, public FObject }; // Methods + void determineDesktopSize(); void initRootWidget(); void finish(); void insufficientSpaceAdjust(); @@ -507,8 +510,8 @@ class FWidget : public FVTerm, public FObject static FWidgetList* always_on_top_list; static FWidgetList* close_widget; static uInt modal_dialog_counter; + static bool init_terminal; static bool init_desktop; - static bool hideable; // Friend classes friend class FToggleButton; @@ -876,14 +879,7 @@ inline bool FWidget::setDisable() //---------------------------------------------------------------------- inline bool FWidget::setVisibleCursor (bool enable) -{ - if ( enable ) - flags.visible_cursor = true; - else - flags.visible_cursor = ( hideable ) ? false : true; - - return flags.visible_cursor; -} +{ return (flags.visible_cursor = enable); } //---------------------------------------------------------------------- inline bool FWidget::setVisibleCursor() diff --git a/test/conemu.h b/test/conemu.h index 8c92f4a2..1105e4e8 100644 --- a/test/conemu.h +++ b/test/conemu.h @@ -80,6 +80,16 @@ class ConEmu , PROT_READ | PROT_WRITE , MAP_SHARED | MAP_ANONYMOUS, -1 , 0 ); + + if ( ptr == MAP_FAILED ) + { + std::cerr << "mmap error: " + << strerror(errno) + << " (" << errno << ")" + << std::endl; + return; + } + shared_state = static_cast(ptr); *shared_state = false; } diff --git a/test/foptimove-test.cpp b/test/foptimove-test.cpp index deaed59e..750e1479 100644 --- a/test/foptimove-test.cpp +++ b/test/foptimove-test.cpp @@ -61,8 +61,7 @@ void check_c_string ( const char* s1 class FOptiMoveTest : public CPPUNIT_NS::TestFixture { public: - FOptiMoveTest() - { } + FOptiMoveTest(); protected: void classNameTest(); @@ -104,6 +103,11 @@ class FOptiMoveTest : public CPPUNIT_NS::TestFixture CPPUNIT_TEST_SUITE_END(); }; +//---------------------------------------------------------------------- +FOptiMoveTest::FOptiMoveTest() +{ + finalcut::FTermcap::init(); +} //---------------------------------------------------------------------- void FOptiMoveTest::classNameTest() diff --git a/test/ftermdata-test.cpp b/test/ftermdata-test.cpp index 0991896c..e8f1b3f1 100644 --- a/test/ftermdata-test.cpp +++ b/test/ftermdata-test.cpp @@ -108,6 +108,7 @@ void FTermDataTest::defaultDataTest() CPPUNIT_ASSERT ( data.hasCursorOptimisation() == true ); CPPUNIT_ASSERT ( data.isCursorHidden() == false ); CPPUNIT_ASSERT ( data.hasAlternateScreen() == true ); + CPPUNIT_ASSERT ( data.isInAlternateScreen() == false ); CPPUNIT_ASSERT ( data.hasASCIIConsole() == false ); CPPUNIT_ASSERT ( data.hasVT100Console() == false ); CPPUNIT_ASSERT ( data.hasUTF8Console() == false ); @@ -223,6 +224,11 @@ void FTermDataTest::dataTest() data.useAlternateScreen (false); CPPUNIT_ASSERT ( data.hasAlternateScreen() == false ); + CPPUNIT_ASSERT ( data.isInAlternateScreen() == false ); + data.setAlternateScreenInUse (true); + CPPUNIT_ASSERT ( data.isInAlternateScreen() == true ); + + CPPUNIT_ASSERT ( data.hasASCIIConsole() == false ); data.setASCIIConsole (true); CPPUNIT_ASSERT ( data.hasASCIIConsole() == true ); From c1b2699e5379a8e8a26069b3499a96f6cf61e1dd Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sat, 6 Jun 2020 22:22:01 +0200 Subject: [PATCH 02/28] Simplification of FMouse::createMouseObject() --- ChangeLog | 1 + examples/opti-move.cpp | 6 ++--- src/fmouse.cpp | 42 +++----------------------------- src/fterm.cpp | 7 +++++- src/include/final/fapplication.h | 2 +- src/include/final/fmouse.h | 10 +++++++- src/include/final/fvterm.h | 2 +- src/include/final/fwidget.h | 2 +- 8 files changed, 25 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index 43fb315a..a63619fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2020-06-06 Markus Gans * Now, the terminal is not initialized before the method show() is called. Or you force it explicitly via the FApplication object. + * Simplification of FMouse::createMouseObject() 2020-05-30 Markus Gans * With the two new methods FApplication::setDarkTheme() and diff --git a/examples/opti-move.cpp b/examples/opti-move.cpp index f6d4d56e..5e931ace 100644 --- a/examples/opti-move.cpp +++ b/examples/opti-move.cpp @@ -216,7 +216,7 @@ int main (int argc, char* argv[]) // Pointer to the global virtual terminal object app = &term_app; - if ( app->isQuit() ) + if ( finalcut::FApplication::isQuit() ) return 0; // Get screen dimension @@ -267,14 +267,12 @@ int main (int argc, char* argv[]) std::cout << "\r" << line << std::flush; // Generation of a logger in a shared_ptr via a pointer finalcut::FApplication::setLog(std::make_shared()); - // Get the shared_ptr with the base class - std::shared_ptr log = finalcut::FApplication::getLog(); const finalcut::FOptiMove& opti_move = *finalcut::FTerm::getFOptiMove(); finalcut::printDurations(opti_move); - delete &log; // Waiting for keypress keyPressed(); app = nullptr; // End of term_app object scope + return 0; } diff --git a/src/fmouse.cpp b/src/fmouse.cpp index 3cd8f6f2..996c2268 100644 --- a/src/fmouse.cpp +++ b/src/fmouse.cpp @@ -177,40 +177,6 @@ inline bool FMouse::isInputDataPending() return input_data_pending; } -//---------------------------------------------------------------------- -inline FMouse* FMouse::createMouseObject (const mouse_type mt) -{ - assert ( mt == FMouse::none - || mt == FMouse::gpm - || mt == FMouse::x11 - || mt == FMouse::sgr - || mt == FMouse::urxvt ); - - switch ( mt ) - { - case none: - return nullptr; - - case gpm: -#ifdef F_HAVE_LIBGPM - return new FMouseGPM; -#else - return nullptr; -#endif - - case x11: - return new FMouseX11; - - case sgr: - return new FMouseSGR; - - case urxvt: - return new FMouseUrxvt; - } - - return nullptr; -} - //---------------------------------------------------------------------- void FMouse::clearButtonState() { @@ -1216,12 +1182,12 @@ void FMouseUrxvt::setButtonState (const int btn, const struct timeval* time) FMouseControl::FMouseControl() { #ifdef F_HAVE_LIBGPM - mouse_protocol[FMouse::gpm] = FMouse::createMouseObject(FMouse::gpm); + mouse_protocol[FMouse::gpm] = FMouse::createMouseObject(); #endif - mouse_protocol[FMouse::x11] = FMouse::createMouseObject(FMouse::x11); - mouse_protocol[FMouse::sgr] = FMouse::createMouseObject(FMouse::sgr); - mouse_protocol[FMouse::urxvt] = FMouse::createMouseObject(FMouse::urxvt); + mouse_protocol[FMouse::x11] = FMouse::createMouseObject(); + mouse_protocol[FMouse::sgr] = FMouse::createMouseObject(); + mouse_protocol[FMouse::urxvt] = FMouse::createMouseObject(); } //---------------------------------------------------------------------- diff --git a/src/fterm.cpp b/src/fterm.cpp index 4fd68cce..931d2463 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -2549,7 +2549,9 @@ void FTerm::terminalSizeChange() //---------------------------------------------------------------------- void FTerm::processTermination (int signum) { - init_term_object->finish(); + if ( init_term_object ) + init_term_object->finish(); + std::fflush (stderr); std::fflush (stdout); @@ -2562,6 +2564,9 @@ void FTerm::processTermination (int signum) printExitMessage(); } + if ( init_term_object ) + init_term_object->deallocationValues(); + std::terminate(); } diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index 875a17eb..521ad2fa 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -129,7 +129,7 @@ class FApplication : public FWidget void sendQueuedEvents(); bool eventInQueue(); bool removeQueuedEvent (const FObject*); - void initTerminal(); + void initTerminal() override; static void setDefaultTheme(); static void setDarkTheme(); static void closeConfirmationDialog (FWidget*, FCloseEvent*); diff --git a/src/include/final/fmouse.h b/src/include/final/fmouse.h index e51cac00..8a747be0 100644 --- a/src/include/final/fmouse.h +++ b/src/include/final/fmouse.h @@ -130,7 +130,8 @@ class FMouse bool isInputDataPending(); // Methods - static FMouse* createMouseObject (const mouse_type); + template + static FMouse* createMouseObject (); void clearButtonState(); virtual void setRawData (FKeyboard::keybuffer&) = 0; virtual void processEvent (struct timeval*) = 0; @@ -191,6 +192,13 @@ class FMouse FPoint new_mouse_position{}; }; +//---------------------------------------------------------------------- +template +inline FMouse* FMouse::createMouseObject() +{ + return new ClassT; +} + #ifdef F_HAVE_LIBGPM //---------------------------------------------------------------------- diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index a6082c29..3d73c7eb 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -317,7 +317,7 @@ class FVTerm void processTerminalUpdate(); static void startTerminalUpdate(); static void finishTerminalUpdate(); - void initTerminal(); + virtual void initTerminal(); private: // Enumerations diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index d89f331b..f167405a 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -374,7 +374,7 @@ class FWidget : public FVTerm, public FObject void setTermOffsetWithPadding(); // Methods - void initTerminal(); + void initTerminal() override; void initDesktop(); virtual void adjustSize(); void adjustSizeGlobal(); From 0ff67da077ec9216b1c1a9e60612c73828e22ff7 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 7 Jun 2020 18:21:59 +0200 Subject: [PATCH 03/28] Parameter to specify a logging file --- ChangeLog | 4 ++ examples/opti-move.cpp | 4 ++ examples/termcap.cpp | 2 +- examples/ui.cpp | 3 -- examples/windows.cpp | 4 +- src/fapplication.cpp | 83 ++++++++++++++++++++++--------- src/include/final/fapplication.h | 2 + src/include/final/flog.h | 1 + src/include/final/flogger.h | 5 ++ src/include/final/fstartoptions.h | 7 ++- test/flogger-test.cpp | 17 +++++-- 11 files changed, 98 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index a63619fb..73d27379 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2020-06-07 Markus Gans + * The --log-file parameter stores log output to any file. The file + can be viewed directly on another terminal with "tail -f". + 2020-06-06 Markus Gans * Now, the terminal is not initialized before the method show() is called. Or you force it explicitly via the FApplication object. diff --git a/examples/opti-move.cpp b/examples/opti-move.cpp index 5e931ace..72b8a3d0 100644 --- a/examples/opti-move.cpp +++ b/examples/opti-move.cpp @@ -163,6 +163,10 @@ class DirectLogger final : public finalcut::FLog // An implementation is not required in this context } + void flush() override + { + output.flush(); + } void setOutputStream (const std::ostream& os) override { output.rdbuf(os.rdbuf()); } diff --git a/examples/termcap.cpp b/examples/termcap.cpp index 6f2c1675..e5e52dda 100644 --- a/examples/termcap.cpp +++ b/examples/termcap.cpp @@ -310,7 +310,7 @@ int main (int argc, char* argv[]) // Force terminal initialization without calling show() term_app.initTerminal(); - if ( term_app.isQuit() ) + if ( finalcut::FApplication::isQuit() ) return 0; std::cout << "--------\r\nFTermcap\r\n--------\r\n\n"; diff --git a/examples/ui.cpp b/examples/ui.cpp index a9a14a6b..c65d0ff1 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -1067,9 +1067,6 @@ int main (int argc, char* argv[]) finalcut::FTerm::redefineDefaultColors(true); finalcut::FTerm::setTermTitle (title); - // Force vt100 encoding - //finalcut::FTerm::setEncoding(finalcut::fc::VT100); - // Sets the terminal size to 94×30 //finalcut::FTerm::setTermSize(FSize{94, 30}); diff --git a/examples/windows.cpp b/examples/windows.cpp index f53a7f77..c9264857 100644 --- a/examples/windows.cpp +++ b/examples/windows.cpp @@ -84,12 +84,12 @@ SmallWindow::SmallWindow (finalcut::FWidget* parent) right_arrow.ignorePadding(); right_arrow.setGeometry (FPoint{int(getWidth()) - 1, 2}, FSize{1, 1}); - top_left_label = "menu"; + top_left_label.setText("menu"); top_left_label.setForegroundColor (wc->label_inactive_fg); top_left_label.setEmphasis(); top_left_label.setGeometry (FPoint{1, 1}, FSize{6, 1}); - top_right_label = "zoom"; + top_right_label.setText("zoom"); top_right_label.setAlignment (fc::alignRight); top_right_label.setForegroundColor (wc->label_inactive_fg); top_right_label.setEmphasis(); diff --git a/src/fapplication.cpp b/src/fapplication.cpp index 130cc68e..d68ef3e0 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -20,6 +20,7 @@ * . * ***********************************************************************/ +#include #include #include @@ -366,7 +367,56 @@ void FApplication::init (uInt64 key_time, uInt64 dblclick_time) mouse->setDblclickInterval (dblclick_time); // Initialize logging - getLog()->setLineEnding(FLog::CRLF); + if ( ! getStartOptions().logfile_stream.is_open() ) + getLog()->setLineEnding(FLog::CRLF); +} + +//---------------------------------------------------------------------- +void FApplication::setTerminalEncoding (const FString& enc_str) +{ + const FString& enc = enc_str.toLower(); + + if ( enc.includes("utf8") ) + getStartOptions().encoding = fc::UTF8; + else if ( enc.includes("vt100") ) + getStartOptions().encoding = fc::VT100; + else if ( enc.includes("pc") ) + getStartOptions().encoding = fc::PC; + else if ( enc.includes("ascii") ) + getStartOptions().encoding = fc::ASCII; + else if ( enc.includes("help") ) + showParameterUsage(); + else + { + auto ftermdata = FTerm::getFTermData(); + ftermdata->setExitMessage ( "Unknown encoding \"" + enc_str + + "\"\n(Valid encodings are utf8, " + + "vt100, pc and ascii)" ); + exit(EXIT_FAILURE); + } +} + +//---------------------------------------------------------------------- +void FApplication::setLogFile (const FString& filename) +{ + // Get the global logger object + FLog& log = *FApplication::getLog(); + auto& log_stream = getStartOptions().logfile_stream; + log_stream.open(filename, std::ofstream::out); + + if ( log_stream.is_open() ) + { + log.setOutputStream(log_stream); + log.enableTimestamp(); + log.setLineEnding (finalcut::FLog::LF); + } + else + { + auto ftermdata = FTerm::getFTermData(); + ftermdata->setExitMessage ( "Could not open log file \"" + + FString(optarg) + "\"" ); + exit(EXIT_FAILURE); + } } //---------------------------------------------------------------------- @@ -379,6 +429,7 @@ void FApplication::cmd_options (const int& argc, char* argv[]) static struct option long_options[] = { {"encoding", required_argument, nullptr, 0 }, + {"log-file", required_argument, nullptr, 0 }, {"no-mouse", no_argument, nullptr, 0 }, {"no-optimized-cursor", no_argument, nullptr, 0 }, {"no-terminal-detection", no_argument, nullptr, 0 }, @@ -409,28 +460,10 @@ void FApplication::cmd_options (const int& argc, char* argv[]) if ( c == 0 ) { if ( std::strcmp(long_options[idx].name, "encoding") == 0 ) - { - FString encoding{optarg}; - encoding = encoding.toLower(); + setTerminalEncoding(FString(optarg)); - if ( encoding.includes("utf8") ) - getStartOptions().encoding = fc::UTF8; - else if ( encoding.includes("vt100") ) - getStartOptions().encoding = fc::VT100; - else if ( encoding.includes("pc") ) - getStartOptions().encoding = fc::PC; - else if ( encoding.includes("ascii") ) - getStartOptions().encoding = fc::ASCII; - else if ( encoding.includes("help") ) - showParameterUsage(); - else - { - auto ftermdata = FTerm::getFTermData(); - ftermdata->setExitMessage ( "Unknown encoding " - + std::string(encoding.c_str()) ); - exit(EXIT_FAILURE); - } - } + if ( std::strcmp(long_options[idx].name, "log-file") == 0 ) + setLogFile(FString(optarg)); if ( std::strcmp(long_options[idx].name, "no-mouse") == 0 ) getStartOptions().mouse_support = false; @@ -488,10 +521,12 @@ void FApplication::showParameterUsage() << " Display this help and exit\n" << "\n" << "The Final Cut options:\n" - << " --encoding " + << " --encoding= " << " Sets the character encoding mode\n" << " " << " {utf8, vt100, pc, ascii}\n" + << " --log-file= " + << " Writes log output to FILE\n" << " --no-mouse " << " Disable mouse support\n" << " --no-optimized-cursor " @@ -1199,6 +1234,8 @@ void FApplication::processLogger() if ( ! logger->str().empty() ) logger->pubsync(); + + logger->flush(); } //---------------------------------------------------------------------- diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index 521ad2fa..a808fa77 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -147,6 +147,8 @@ class FApplication : public FWidget // Methods void init (uInt64, uInt64); + static void setTerminalEncoding (const FString&); + static void setLogFile (const FString&); static void cmd_options (const int&, char*[]); static FStartOptions& getStartOptions(); static void showParameterUsage(); diff --git a/src/include/final/flog.h b/src/include/final/flog.h index ef5d372c..9ff759dc 100644 --- a/src/include/final/flog.h +++ b/src/include/final/flog.h @@ -89,6 +89,7 @@ class FLog : public std::stringbuf virtual void warn (const std::string&) = 0; virtual void error (const std::string&) = 0; virtual void debug (const std::string&) = 0; + virtual void flush() = 0; virtual void setOutputStream (const std::ostream&) = 0; virtual void setLineEnding (LineEnding) = 0; virtual void enableTimestamp() = 0; diff --git a/src/include/final/flogger.h b/src/include/final/flogger.h index cdba1192..a7fcd17f 100644 --- a/src/include/final/flogger.h +++ b/src/include/final/flogger.h @@ -77,6 +77,7 @@ class FLogger : public FLog void warn (const std::string&) override; void error (const std::string&) override; void debug (const std::string&) override; + void flush() override; void setOutputStream (const std::ostream&) override; void setLineEnding (LineEnding) override; void enableTimestamp() override; @@ -127,6 +128,10 @@ inline void FLogger::debug (const std::string& msg) printLogLine (msg); } +//---------------------------------------------------------------------- +inline void FLogger::flush() +{ output.flush(); } + //---------------------------------------------------------------------- inline void FLogger::setOutputStream (const std::ostream& os) { output.rdbuf(os.rdbuf()); } diff --git a/src/include/final/fstartoptions.h b/src/include/final/fstartoptions.h index c541559e..3c164130 100644 --- a/src/include/final/fstartoptions.h +++ b/src/include/final/fstartoptions.h @@ -35,7 +35,8 @@ #error "Only can be included directly." #endif -#include +#include +#include #include "final/fc.h" #include "final/fstring.h" @@ -82,7 +83,6 @@ class FStartOptions final uInt8 sgr_optimizer : 1; uInt8 vgafont : 1; uInt8 newfont : 1; - fc::encoding encoding{fc::UNKNOWN}; #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST) uInt8 meta_sends_escape : 1; @@ -95,6 +95,9 @@ class FStartOptions final uInt16 dark_theme : 1; uInt16 : 15; // padding bits + + fc::encoding encoding{fc::UNKNOWN}; + std::ofstream logfile_stream; static FStartOptions* start_options; }; diff --git a/test/flogger-test.cpp b/test/flogger-test.cpp index 176f6e89..b14a3183 100644 --- a/test/flogger-test.cpp +++ b/test/flogger-test.cpp @@ -59,17 +59,28 @@ class myLogger : public finalcut::FLog output << "Debug: " << entry << std::endl; } + void flush() override + { + // An implementation is not required in this context + } + void setOutputStream (const std::ostream& os) override { output.rdbuf(os.rdbuf()); } void setLineEnding (LineEnding) override - { } + { + // An implementation is not required in this context + } void enableTimestamp() override - { } + { + // An implementation is not required in this context + } void disableTimestamp() override - { } + { + // An implementation is not required in this context + } private: // Data member From ccb7eeb3c6ec1b20deec9223159eab45d6284812 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Thu, 11 Jun 2020 21:38:33 +0200 Subject: [PATCH 04/28] New widget FBusyIndicator --- ChangeLog | 4 + README.md | 26 ++-- doc/class-diagram.txt | 26 ++-- doc/class_template.cpp | 2 +- examples/Makefile.am | 2 + examples/busy | 210 +++++++++++++++++++++++++++++ examples/busy.cpp | 128 ++++++++++++++++++ examples/ui.cpp | 3 +- src/Makefile.am | 2 + src/Makefile.clang | 2 + src/Makefile.gcc | 2 + src/fapplication.cpp | 6 +- src/fbusyindicator.cpp | 120 +++++++++++++++++ src/fspinbox.cpp | 17 +++ src/fwindow.cpp | 2 + src/include/final/fapplication.h | 10 +- src/include/final/fbusyindicator.h | 128 ++++++++++++++++++ src/include/final/fcolorpalette.h | 12 ++ src/include/final/final.h | 1 + src/include/final/fspinbox.h | 2 + src/include/final/ftooltip.h | 2 +- src/include/final/fwidget.h | 4 + 22 files changed, 675 insertions(+), 36 deletions(-) create mode 100755 examples/busy create mode 100644 examples/busy.cpp create mode 100644 src/fbusyindicator.cpp create mode 100644 src/include/final/fbusyindicator.h diff --git a/ChangeLog b/ChangeLog index 73d27379..d7dde9c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2020-06-11 Markus Gans + * New widget FBusyIndicator to indicate background activity + * Added example/busy to demonstrate the functionality of this widget + 2020-06-07 Markus Gans * The --log-file parameter stores log output to any file. The file can be viewed directly on another terminal with "tail -f". diff --git a/README.md b/README.md index 20edef44..fdf8f635 100644 --- a/README.md +++ b/README.md @@ -177,11 +177,11 @@ Class digramm : 1┌───────────────┐ │ ┌─────────────┐ ┌-----------┤ FMouseControl │ ├────┤ FTimerEvent │ : └───────────────┘ │ └─────────────┘ - : 1┌─────────┐ │ - ┌-----------┤ FSystem │ │ - : └─────────┘ │ - : *┌─────────┐ │ - : ┌--------┤ FString │ │ ┌──────────────┐ + : 1┌─────────┐ │ ┌──────┐ ┌─────────┐ + ┌-----------┤ FSystem │ │ │ FLog │◄──┤ FLogger │ + : └─────────┘ │ └──┬───┘ └─────────┘ + : *┌─────────┐ │ :1 + : ┌--------┤ FString │ │ ┌──┴───────────┐ : : └─────────┘ │ ┌────┤ FApplication │ : : *┌────────┐ │ │ └──────────────┘ : ┌--------┤ FPoint │ │ │ ┌────────┐ @@ -201,11 +201,11 @@ Class digramm │ FVTerm │◄──┐ :1 │ └──────────────┘ │ └──────────────┘ └────────┘ │ ┌────┴────┐ │ ┌───────────────┐ │ ┌───────────┐ ├────┤ FWidget │◄───────┼────┤ FToggleButton │◄─┼──┤ FCheckBox │ -┌─────────┐ │ └─────────┘ │ └───────────────┘ │ └───────────┘ -│ FObject │◄──┘ │ ┌──────────────┐ │ ┌─────────┐ -└─────────┘ ├────┤ FProgressbar │ └──┤ FSwitch │ - │ └──────────────┘ └─────────┘ - │ ┌────────────┐ +┌─────────┐ │ └────┬────┘ │ └───────────────┘ │ └───────────┘ +│ FObject │◄──┘ :1 │ ┌──────────────┐ │ ┌─────────┐ +└─────────┘ ┌──────┴────────┐ ├────┤ FProgressbar │ └──┤ FSwitch │ + │ FWidgetColors │ │ └──────────────┘ └─────────┘ + └───────────────┘ │ ┌────────────┐ ├────┤ FScrollbar │ │ └────────────┘ │ ┌───────────┐ @@ -233,9 +233,9 @@ Class digramm └──┬──┬───┘ └─────────┘ │ ┌─────────────┐ ▲ ▲ └──┤ FMessageBox │ │ │ └─────────────┘ - │ │ ┌──────────┐ - │ └──────┤ FToolTip │ - │ └──────────┘ + │ │ ┌──────────┐ ┌────────────────┐ + │ └──────┤ FToolTip │◄─┤ FBusyIndicator │ + │ └──────────┘ └────────────────┘ └───────────────┐ ┌──────────┐ │ ┌───┤ FMenuBar │ ┌───────────┐ └──────┤ └──────────┘ diff --git a/doc/class-diagram.txt b/doc/class-diagram.txt index 56bca269..a34f10e0 100644 --- a/doc/class-diagram.txt +++ b/doc/class-diagram.txt @@ -37,11 +37,11 @@ : 1┌───────────────┐ │ ┌─────────────┐ ┌-----------┤ FMouseControl │ ├────┤ FTimerEvent │ : └───────────────┘ │ └─────────────┘ - : 1┌─────────┐ │ - ┌-----------┤ FSystem │ │ - : └─────────┘ │ - : *┌─────────┐ │ - : ┌--------┤ FString │ │ ┌──────────────┐ + : 1┌─────────┐ │ ┌──────┐ ┌─────────┐ + ┌-----------┤ FSystem │ │ │ FLog │◄──┤ FLogger │ + : └─────────┘ │ └──┬───┘ └─────────┘ + : *┌─────────┐ │ :1 + : ┌--------┤ FString │ │ ┌──┴───────────┐ : : └─────────┘ │ ┌────┤ FApplication │ : : *┌────────┐ │ │ └──────────────┘ : ┌--------┤ FPoint │ │ │ ┌────────┐ @@ -61,11 +61,11 @@ │ FVTerm │◄──┐ :1 │ └──────────────┘ │ └──────────────┘ └────────┘ │ ┌────┴────┐ │ ┌───────────────┐ │ ┌───────────┐ ├────┤ FWidget │◄───────┼────┤ FToggleButton │◄─┼──┤ FCheckBox │ -┌─────────┐ │ └─────────┘ │ └───────────────┘ │ └───────────┘ -│ FObject │◄──┘ │ ┌──────────────┐ │ ┌─────────┐ -└─────────┘ ├────┤ FProgressbar │ └──┤ FSwitch │ - │ └──────────────┘ └─────────┘ - │ ┌────────────┐ +┌─────────┐ │ └────┬────┘ │ └───────────────┘ │ └───────────┘ +│ FObject │◄──┘ :1 │ ┌──────────────┐ │ ┌─────────┐ +└─────────┘ ┌──────┴────────┐ ├────┤ FProgressbar │ └──┤ FSwitch │ + │ FWidgetColors │ │ └──────────────┘ └─────────┘ + └───────────────┘ │ ┌────────────┐ ├────┤ FScrollbar │ │ └────────────┘ │ ┌───────────┐ @@ -93,9 +93,9 @@ └──┬──┬───┘ └─────────┘ │ ┌─────────────┐ ▲ ▲ └──┤ FMessageBox │ │ │ └─────────────┘ - │ │ ┌──────────┐ - │ └──────┤ FToolTip │ - │ └──────────┘ + │ │ ┌──────────┐ ┌────────────────┐ + │ └──────┤ FToolTip │◄─┤ FBusyIndicator │ + │ └──────────┘ └────────────────┘ └───────────────┐ ┌──────────┐ │ ┌───┤ FMenuBar │ ┌───────────┐ └──────┤ └──────────┘ diff --git a/doc/class_template.cpp b/doc/class_template.cpp index 0c1fc132..f06e8d20 100644 --- a/doc/class_template.cpp +++ b/doc/class_template.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright [year] [Maintainer] * +* Copyright [year] [Maintainer] * * * * The Final Cut is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public License * diff --git a/examples/Makefile.am b/examples/Makefile.am index 9514ec2b..6c46137f 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -15,6 +15,7 @@ noinst_PROGRAMS = \ fullwidth-character \ 7segment \ choice \ + busy \ listbox \ listview \ checklist \ @@ -44,6 +45,7 @@ event_log_SOURCES = event-log.cpp fullwidth_character_SOURCES = fullwidth-character.cpp 7segment_SOURCES = 7segment.cpp choice_SOURCES = choice.cpp +busy_SOURCES = busy.cpp listbox_SOURCES = listbox.cpp listview_SOURCES = listview.cpp checklist_SOURCES = checklist.cpp diff --git a/examples/busy b/examples/busy new file mode 100755 index 00000000..f53abfea --- /dev/null +++ b/examples/busy @@ -0,0 +1,210 @@ +#! /bin/bash + +# busy - temporary wrapper script for .libs/busy +# Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-2 +# +# The busy program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command="" + +# This environment variable determines our operation mode. +if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then + # install mode needs the following variables: + generated_by_libtool_version='2.4.6' + notinst_deplibs=' /usr/local/src/MyProgs/finalcut/src/.libs/libfinal.la' +else + # When we are sourced in execute mode, $file and $ECHO are already set. + if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then + file="$0" + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + ECHO="printf %s\\n" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ that is used only on +# windows platforms, and (c) all begin with the string --lt- +# (application programs are unlikely to have options that match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's ../libtool value, followed by no. +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=$0 + shift + for lt_opt + do + case "$lt_opt" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` + test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. + lt_dump_F=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%^.*/%%'` + cat "$lt_dump_D/$lt_dump_F" + exit 0 + ;; + --lt-*) + $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n "$lt_option_debug"; then + echo "busy:busy:$LINENO: libtool wrapper (GNU libtool) 2.4.6 Debian-2.4.6-2" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + $ECHO "busy:busy:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" + lt_dump_args_N=`expr $lt_dump_args_N + 1` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ + + if test -n "$lt_option_debug"; then + $ECHO "busy:busy:$LINENO: newargv[0]: $progdir/$program" 1>&2 + func_lt_dump_args ${1+"$@"} 1>&2 + fi + exec "$progdir/$program" ${1+"$@"} + + $ECHO "$0: cannot exec $program $*" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from $@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case " $* " in + *\ --lt-*) + for lt_wr_arg + do + case $lt_wr_arg in + --lt-*) ;; + *) set x "$@" "$lt_wr_arg"; shift;; + esac + shift + done ;; + esac + func_exec_program_core ${1+"$@"} +} + + # Parse options + func_parse_lt_options "$0" ${1+"$@"} + + # Find the directory that this script lives in. + thisdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'` + test "x$thisdir" = "x$file" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'` + while test -n "$file"; do + destdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'` + + # If there was a directory component, then change thisdir. + if test "x$destdir" != "x$file"; then + case "$destdir" in + [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; + *) thisdir="$thisdir/$destdir" ;; + esac + fi + + file=`$ECHO "$file" | /bin/sed 's%^.*/%%'` + file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no + if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then + # special case for '.' + if test "$thisdir" = "."; then + thisdir=`pwd` + fi + # remove .libs from thisdir + case "$thisdir" in + *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /bin/sed 's%[\\/][^\\/]*$%%'` ;; + .libs ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=`cd "$thisdir" && pwd` + test -n "$absdir" && thisdir="$absdir" + + program='busy' + progdir="$thisdir/.libs" + + + if test -f "$progdir/$program"; then + # Add our own library path to LD_LIBRARY_PATH + LD_LIBRARY_PATH="/usr/local/src/MyProgs/finalcut/src/.libs:$LD_LIBRARY_PATH" + + # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH + # The second colon is a workaround for a bug in BeOS R4 sed + LD_LIBRARY_PATH=`$ECHO "$LD_LIBRARY_PATH" | /bin/sed 's/::*$//'` + + export LD_LIBRARY_PATH + + if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then + # Run the actual program with our arguments. + func_exec_program ${1+"$@"} + fi + else + # The program doesn't exist. + $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 + $ECHO "This script is just a wrapper for $program." 1>&2 + $ECHO "See the libtool documentation for more information." 1>&2 + exit 1 + fi +fi diff --git a/examples/busy.cpp b/examples/busy.cpp new file mode 100644 index 00000000..c564a3c4 --- /dev/null +++ b/examples/busy.cpp @@ -0,0 +1,128 @@ +/*********************************************************************** +* busy.cpp - Shows the use of the FBusyIndicator * +* * +* This file is part of the Final Cut widget toolkit * +* * +* Copyright 2020 Markus Gans * +* * +* The Final Cut is free software; you can redistribute it and/or * +* modify it under the terms of the GNU Lesser General Public License * +* as published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* The Final Cut is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#include +using finalcut::FPoint; +using finalcut::FRect; +using finalcut::FSize; + +//---------------------------------------------------------------------- +// class Dialog +//---------------------------------------------------------------------- + +class Dialog final : public finalcut::FDialog +{ + public: + explicit Dialog (FWidget* parent = nullptr); + + private: + void adjustSize() override; + + // Event handler + void onTimer (finalcut::FTimerEvent*) override; + + // Callback method + void cb_start (const finalcut::FWidget*, const FDataPtr); + + // Data members + finalcut::FSpinBox seconds{this}; + finalcut::FButton start{"&Start", this}; + finalcut::FButton quit{"&Quit", this}; + finalcut::FBusyIndicator busy_indicator{this}; +}; + +//---------------------------------------------------------------------- +Dialog::Dialog (FWidget* parent) + : finalcut::FDialog{parent} +{ + setText ("Dialog"); + finalcut::FDialog::setGeometry (FPoint{26, 5}, FSize{28, 10}); + seconds.setGeometry (FPoint{10, 2}, FSize{10, 1}); + seconds.setLabelText ("Seconds"); + seconds.setRange (0, 60); + seconds.setValue (3); + start.setGeometry (FPoint{2, 6}, FSize{10, 1}); + quit.setGeometry (FPoint{15, 6}, FSize{10, 1}); + + // Add button callbacks + seconds.addCallback + ( + "activate", + F_METHOD_CALLBACK (this, &Dialog::cb_start) + ); + + start.addCallback + ( + "clicked", + F_METHOD_CALLBACK (this, &Dialog::cb_start) + ); + + quit.addCallback + ( + "clicked", + F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) + ); + +} + +//---------------------------------------------------------------------- +void Dialog::adjustSize() +{ + int X = int((getDesktopWidth() - getWidth()) / 2); + const int Y = 5; + + if ( X < 1 ) + X = 1; + + setPos ({X, Y}, false); + finalcut::FDialog::adjustSize(); +} + +//---------------------------------------------------------------------- +void Dialog::onTimer (finalcut::FTimerEvent*) +{ + delOwnTimer(); + busy_indicator.stop(); +} + +//---------------------------------------------------------------------- +void Dialog::cb_start (const finalcut::FWidget*, const FDataPtr) +{ + if ( seconds.getValue() < 1 ) + return; + + busy_indicator.start(); + addTimer(seconds.getValue() * 1000); +} + +//---------------------------------------------------------------------- +// main part +//---------------------------------------------------------------------- + +int main (int argc, char* argv[]) +{ + finalcut::FApplication app(argc, argv); + Dialog dialog(&app); + finalcut::FWidget::setMainWidget(&dialog); + dialog.show(); + return app.exec(); +} diff --git a/examples/ui.cpp b/examples/ui.cpp index c65d0ff1..a116ed00 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -1042,8 +1042,7 @@ void MyDialog::cb_setInput (finalcut::FWidget* widget, FDataPtr data) int main (int argc, char* argv[]) { const finalcut::FString ver{F_VERSION}; // Library version - const finalcut::FString title { "The FINAL CUT " - + ver + const finalcut::FString title { "The FINAL CUT " + ver + " (C) 2020 by Markus Gans" }; // Create the application object app diff --git a/src/Makefile.am b/src/Makefile.am index 098d9dbf..97549dd2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -44,6 +44,7 @@ libfinal_la_SOURCES = \ fwindow.cpp \ fmessagebox.cpp \ ftooltip.cpp \ + fbusyindicator.cpp \ ffiledialog.cpp \ fkey_map.cpp \ fcharmap.cpp \ @@ -115,6 +116,7 @@ finalcutinclude_HEADERS = \ include/final/fmenulist.h \ include/final/fmessagebox.h \ include/final/ftooltip.h \ + include/final/fbusyindicator.h \ include/final/fobject.h \ include/final/fpoint.h \ include/final/fsize.h \ diff --git a/src/Makefile.clang b/src/Makefile.clang index e5ce296d..c83f2636 100644 --- a/src/Makefile.clang +++ b/src/Makefile.clang @@ -34,6 +34,7 @@ INCLUDE_HEADERS = \ fcheckmenuitem.h \ fmessagebox.h \ ftooltip.h \ + fbusyindicator.h \ sgr_optimizer.h \ foptiattr.h \ foptimove.h \ @@ -118,6 +119,7 @@ OBJS = \ fcombobox.o \ fmessagebox.o \ ftooltip.o \ + fbusyindicator.o \ ffiledialog.o \ fkey_map.o \ fcharmap.o \ diff --git a/src/Makefile.gcc b/src/Makefile.gcc index e40bad84..47ce8473 100644 --- a/src/Makefile.gcc +++ b/src/Makefile.gcc @@ -34,6 +34,7 @@ INCLUDE_HEADERS = \ fcheckmenuitem.h \ fmessagebox.h \ ftooltip.h \ + fbusyindicator.h \ sgr_optimizer.h \ foptiattr.h \ foptimove.h \ @@ -118,6 +119,7 @@ OBJS = \ fcombobox.o \ fmessagebox.o \ ftooltip.o \ + fbusyindicator.o \ ffiledialog.o \ fkey_map.o \ fcharmap.o \ diff --git a/src/fapplication.cpp b/src/fapplication.cpp index d68ef3e0..efade18f 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -399,13 +399,13 @@ void FApplication::setTerminalEncoding (const FString& enc_str) //---------------------------------------------------------------------- void FApplication::setLogFile (const FString& filename) { - // Get the global logger object - FLog& log = *FApplication::getLog(); auto& log_stream = getStartOptions().logfile_stream; log_stream.open(filename, std::ofstream::out); if ( log_stream.is_open() ) { + // Get the global logger object + FLog& log = *FApplication::getLog(); log.setOutputStream(log_stream); log.enableTimestamp(); log.setLineEnding (finalcut::FLog::LF); @@ -414,7 +414,7 @@ void FApplication::setLogFile (const FString& filename) { auto ftermdata = FTerm::getFTermData(); ftermdata->setExitMessage ( "Could not open log file \"" - + FString(optarg) + "\"" ); + + filename + "\"" ); exit(EXIT_FAILURE); } } diff --git a/src/fbusyindicator.cpp b/src/fbusyindicator.cpp new file mode 100644 index 00000000..0b7ce8ee --- /dev/null +++ b/src/fbusyindicator.cpp @@ -0,0 +1,120 @@ +/*********************************************************************** +* fbusyindicator.cpp - Shows background activity * +* * +* This file is part of the Final Cut widget toolkit * +* * +* Copyright 2020 Markus Gans * +* * +* The Final Cut is free software; you can redistribute it and/or * +* modify it under the terms of the GNU Lesser General Public License * +* as published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* The Final Cut is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#include "final/fbusyindicator.h" + +namespace finalcut +{ + +//---------------------------------------------------------------------- +// class FBusyIndicator +//---------------------------------------------------------------------- + +// constructors and destructor +//---------------------------------------------------------------------- +FBusyIndicator::FBusyIndicator (FWidget* parent) + : FToolTip{parent} +{ + FToolTip::hide(); + createIndicatorText(); +} + +//---------------------------------------------------------------------- +FBusyIndicator::~FBusyIndicator() // destructor +{ } + + +// public methods of FBusyIndicator +//---------------------------------------------------------------------- +void FBusyIndicator::start() +{ + running = true; + show(); + updateTerminal(); + flush(); + addTimer(TIMER); +} + +//---------------------------------------------------------------------- +void FBusyIndicator::stop() +{ + delOwnTimer(); + running = false; + hide(); + updateTerminal(); + flush(); +} + + +// private methods of FBusyIndicator +//---------------------------------------------------------------------- +void FBusyIndicator::createIndicatorText() +{ + FString line[4]{}; + + if ( FTerm::getEncoding() == fc::UTF8 ) + { + const wchar_t (&p)[8] = uni_pattern; + line[0] << " " << p[7] << " " << p[0] << " \n"; + line[1] << " " << p[6] << " " << p[1] << " \n"; + line[2] << " " << p[5] << " " << p[2] << " \n"; + line[3] << " " << p[4] << " " << p[3] << " "; + } + else + { + const char (&p)[8] = pattern; + line[0] << " " << p[7] << " " << p[0] << " \n"; + line[1] << " " << p[6] << " " << p[1] << " \n"; + line[2] << " " << p[5] << " " << p[2] << " \n"; + line[3] << " " << p[4] << " " << p[3] << " "; + } + + FString txt{line[0] + line[1] + line[2] + line[3]}; + FToolTip::setText(txt); +} + +//---------------------------------------------------------------------- +void FBusyIndicator::onTimer (finalcut::FTimerEvent*) +{ + // Rotate pattern + if ( FTerm::getEncoding() == fc::UTF8 ) + { + const wchar_t last = uni_pattern[7]; + std::memmove(uni_pattern + 1, uni_pattern , sizeof(wchar_t) * 7); + uni_pattern[0] = last; + } + else + { + const char last = pattern[7]; + std::memmove(pattern + 1, pattern , sizeof(char) * 7); + pattern[0] = last; + } + + // Redraw the rotated pattern + createIndicatorText(); + redraw(); + updateTerminal(); + flush(); +} + +} // namespace finalcut + diff --git a/src/fspinbox.cpp b/src/fspinbox.cpp index 6b12e0c8..a1636757 100644 --- a/src/fspinbox.cpp +++ b/src/fspinbox.cpp @@ -317,6 +317,11 @@ void FSpinBox::init() input_field.unsetShadow(); input_field << value; input_field.addCallback + ( + "activate", + F_METHOD_CALLBACK (this, &FSpinBox::cb_inputFieldActivate) + ); + input_field.addCallback ( "changed", F_METHOD_CALLBACK (this, &FSpinBox::cb_inputFieldChange) @@ -392,6 +397,12 @@ inline void FSpinBox::decreaseValue() delOwnTimer(); } +//---------------------------------------------------------------------- +void FSpinBox::processActivate() +{ + emitCallback("activate"); +} + //---------------------------------------------------------------------- void FSpinBox::processChanged() { @@ -416,6 +427,12 @@ void FSpinBox::forceFocus() getStatusBar()->drawMessage(); } +//---------------------------------------------------------------------- +void FSpinBox::cb_inputFieldActivate (finalcut::FWidget*, const FDataPtr) +{ + processActivate(); +} + //---------------------------------------------------------------------- void FSpinBox::cb_inputFieldChange (finalcut::FWidget* w, const FDataPtr) { diff --git a/src/fwindow.cpp b/src/fwindow.cpp index 3d01dfe0..be668f88 100644 --- a/src/fwindow.cpp +++ b/src/fwindow.cpp @@ -282,6 +282,8 @@ void FWindow::hide() getVWin()->visible = false; FWidget::hide(); + const auto& t_geometry = getTermGeometryWithShadow(); + restoreVTerm (t_geometry); } //---------------------------------------------------------------------- diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index a808fa77..11a8d648 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -35,9 +35,13 @@ * ▕▁▁▁▁▁▁▁▁▁▏ * ▲ * │ - * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏1 *▕▔▔▔▔▔▔▔▔▏ - * ▕ FApplication ▏-┬- - - -▕ FEvent ▏ - * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ : ▕▁▁▁▁▁▁▁▁▏ + * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏1 1▕▔▔▔▔▔▔▏ + * ▕ FApplication ▏-┬- - - -▕ FLog ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ : ▕▁▁▁▁▁▁▏ + * : + * : *▕▔▔▔▔▔▔▔▔▏ + * :- - - -▕ FEvent ▏ + * : ▕▁▁▁▁▁▁▁▁▏ * : * : *▕▔▔▔▔▔▔▔▔▏ * :- - - -▕ FPoint ▏ diff --git a/src/include/final/fbusyindicator.h b/src/include/final/fbusyindicator.h new file mode 100644 index 00000000..42cd9359 --- /dev/null +++ b/src/include/final/fbusyindicator.h @@ -0,0 +1,128 @@ +/*********************************************************************** +* fbusyindicator.h - Shows background activity * +* * +* This file is part of the Final Cut widget toolkit * +* * +* Copyright 2020 Markus Gans * +* * +* The Final Cut is free software; you can redistribute it and/or * +* modify it under the terms of the GNU Lesser General Public License * +* as published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* The Final Cut is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +/* Inheritance diagram + * ═══════════════════ + * + * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ + * ▕ FVTerm ▏ ▕ FObject ▏ + * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ + * ▲ ▲ + * │ │ + * └─────┬─────┘ + * │ + * ▕▔▔▔▔▔▔▔▔▔▏ + * ▕ FWidget ▏ + * ▕▁▁▁▁▁▁▁▁▁▏ + * ▲ + * │ + * ▕▔▔▔▔▔▔▔▔▔▏ + * ▕ FWindow ▏ + * ▕▁▁▁▁▁▁▁▁▁▏ + * ▲ + * │ + * ▕▔▔▔▔▔▔▔▔▔▔▏ + * ▕ FToolTip ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▏ + * ▲ + * │ + * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏ + * ▕ FBusyIndicator ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ + */ + +#ifndef FBUSYINDICATOR_H +#define FBUSYINDICATOR_H + +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + +#include "final/ftooltip.h" + +namespace finalcut +{ + +//---------------------------------------------------------------------- +// class FBusyIndicator +//---------------------------------------------------------------------- + +class FBusyIndicator : public FToolTip +{ + public: + // Constructor + explicit FBusyIndicator (FWidget* = nullptr); + + // Disable copy constructor + FBusyIndicator (const FBusyIndicator&) = delete; + + // Destructor + ~FBusyIndicator(); + + // Disable copy assignment operator (=) + FBusyIndicator& operator = (const FBusyIndicator&) = delete; + + // Accessors + const FString getClassName() const override; + + // Inquiries + bool isRunning(); + + // Methods + void start(); + void stop(); + + private: + // Constants + static constexpr std::size_t TIMER = 200; + + // Methods + void createIndicatorText(); + + // Event handler + void onTimer (finalcut::FTimerEvent*) override; + + // Callback methods + + // Data members + wchar_t uni_pattern[8]{L' ', L' ', L'·', L'·', L'•', L'•', L'●', L'●'}; + char pattern[8]{L' ', L' ', L'.', L'.', L'+', L'+', L'#', L'#'}; + bool running{false}; +}; + + +// FBusyIndicator inline functions +//---------------------------------------------------------------------- +inline const FString FBusyIndicator::getClassName() const +{ return "FBusyIndicator"; } + +//---------------------------------------------------------------------- +inline bool FBusyIndicator::isRunning() +{ + return running; +} + +} // namespace finalcut + +#endif // FBUSYINDICATOR_H + + diff --git a/src/include/final/fcolorpalette.h b/src/include/final/fcolorpalette.h index c9940841..b3ba52a8 100644 --- a/src/include/final/fcolorpalette.h +++ b/src/include/final/fcolorpalette.h @@ -159,6 +159,18 @@ class default16ColorPalette final : public FColorPalette inline const FString default16ColorPalette::getClassName() const { return "default16ColorPalette"; } +/* Inheritance diagram + * ═══════════════════ + * + * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏ + * ▕ FColorPalette ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ + * ▲ + * │ + * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏ + * ▕ default16DarkColorPalette ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ + */ //---------------------------------------------------------------------- // class default16DarkColorPalette diff --git a/src/include/final/final.h b/src/include/final/final.h index fe235835..9a985919 100644 --- a/src/include/final/final.h +++ b/src/include/final/final.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/src/include/final/fspinbox.h b/src/include/final/fspinbox.h index 58d26506..65a67858 100644 --- a/src/include/final/fspinbox.h +++ b/src/include/final/fspinbox.h @@ -135,10 +135,12 @@ class FSpinBox : public FWidget void updateInputField(); void increaseValue(); void decreaseValue(); + void processActivate(); void processChanged(); void forceFocus(); // Callback methods + void cb_inputFieldActivate (finalcut::FWidget*, const FDataPtr); void cb_inputFieldChange (finalcut::FWidget*, const FDataPtr); // Data members diff --git a/src/include/final/ftooltip.h b/src/include/final/ftooltip.h index 605f0a7a..2a73a0ba 100644 --- a/src/include/final/ftooltip.h +++ b/src/include/final/ftooltip.h @@ -66,7 +66,7 @@ namespace finalcut class FToolTip : public FWindow { public: - // Constructor + // Constructors explicit FToolTip (FWidget* = nullptr); explicit FToolTip (const FString&, FWidget* = nullptr); diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index f167405a..f78273bc 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -37,6 +37,10 @@ * : 1▕▔▔▔▔▔▔▔▔▔▔▏ * :- - - -▕ FMenuBar ▏ * : ▕▁▁▁▁▁▁▁▁▁▁▏ + * + * : 1▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏ + * :- - - -▕ FWidgetColors ▏ + * : ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ * : * : *▕▔▔▔▔▔▔▔▔▔▏ * :- - - -▕ FString ▏ From 9845a022a3565a00a481b54f66a1c91f8791e04d Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Thu, 11 Jun 2020 23:00:18 +0200 Subject: [PATCH 05/28] Fixed some minor bugs --- examples/busy.cpp | 8 ++++---- src/fprogressbar.cpp | 2 +- src/fscrollbar.cpp | 6 +++--- src/fspinbox.cpp | 2 +- src/include/final/fbusyindicator.h | 4 ++-- src/include/final/fspinbox.h | 2 +- src/include/final/fstartoptions.h | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/busy.cpp b/examples/busy.cpp index c564a3c4..2bc2716b 100644 --- a/examples/busy.cpp +++ b/examples/busy.cpp @@ -54,7 +54,7 @@ class Dialog final : public finalcut::FDialog Dialog::Dialog (FWidget* parent) : finalcut::FDialog{parent} { - setText ("Dialog"); + FDialog::setText ("Dialog"); finalcut::FDialog::setGeometry (FPoint{26, 5}, FSize{28, 10}); seconds.setGeometry (FPoint{10, 2}, FSize{10, 1}); seconds.setLabelText ("Seconds"); @@ -87,14 +87,14 @@ Dialog::Dialog (FWidget* parent) //---------------------------------------------------------------------- void Dialog::adjustSize() { + finalcut::FDialog::adjustSize(); int X = int((getDesktopWidth() - getWidth()) / 2); const int Y = 5; if ( X < 1 ) X = 1; - setPos ({X, Y}, false); - finalcut::FDialog::adjustSize(); + setPos (FPoint{X, Y}, false); } //---------------------------------------------------------------------- @@ -111,7 +111,7 @@ void Dialog::cb_start (const finalcut::FWidget*, const FDataPtr) return; busy_indicator.start(); - addTimer(seconds.getValue() * 1000); + addTimer(int(seconds.getValue() * 1000)); } //---------------------------------------------------------------------- diff --git a/src/fprogressbar.cpp b/src/fprogressbar.cpp index b006546a..829b8af9 100644 --- a/src/fprogressbar.cpp +++ b/src/fprogressbar.cpp @@ -198,7 +198,7 @@ std::size_t FProgressbar::drawProgressIndicator() if ( len >= bar_length ) return len; - if ( round(length) > len || FTerm::getMaxColor() < 16 ) + if ( std::size_t(round(length)) > len || FTerm::getMaxColor() < 16 ) { if ( FTerm::isMonochron() ) setReverse(false); diff --git a/src/fscrollbar.cpp b/src/fscrollbar.cpp index 257aeca9..9dd0491f 100644 --- a/src/fscrollbar.cpp +++ b/src/fscrollbar.cpp @@ -732,9 +732,9 @@ void FScrollbar::jumpToClickPos (int x, int y) if ( bar_orientation == fc::vertical ) { - if ( y >1 && y < int(getHeight()) ) + if ( y > 1 && y < int(getHeight()) ) { - new_val = int( round ( double(max - min) * (y - 2.0 - (slider_length/2)) + new_val = int( round ( double(max - min) * (y - 2.0 - double(slider_length/2)) / double(bar_length - slider_length) ) ); } else @@ -746,7 +746,7 @@ void FScrollbar::jumpToClickPos (int x, int y) if ( x > 1 + nf && x < int(getWidth()) - nf ) { - new_val = int( round ( double(max - min) * (x - 2.0 - nf - (slider_length/2)) + new_val = int( round ( double(max - min) * (x - 2.0 - nf - double(slider_length/2)) / double(bar_length - slider_length) ) ); } else diff --git a/src/fspinbox.cpp b/src/fspinbox.cpp index a1636757..c477b40d 100644 --- a/src/fspinbox.cpp +++ b/src/fspinbox.cpp @@ -428,7 +428,7 @@ void FSpinBox::forceFocus() } //---------------------------------------------------------------------- -void FSpinBox::cb_inputFieldActivate (finalcut::FWidget*, const FDataPtr) +void FSpinBox::cb_inputFieldActivate (const finalcut::FWidget*, const FDataPtr) { processActivate(); } diff --git a/src/include/final/fbusyindicator.h b/src/include/final/fbusyindicator.h index 42cd9359..9fb39bf8 100644 --- a/src/include/final/fbusyindicator.h +++ b/src/include/final/fbusyindicator.h @@ -85,7 +85,7 @@ class FBusyIndicator : public FToolTip const FString getClassName() const override; // Inquiries - bool isRunning(); + bool isRunning() const; // Methods void start(); @@ -116,7 +116,7 @@ inline const FString FBusyIndicator::getClassName() const { return "FBusyIndicator"; } //---------------------------------------------------------------------- -inline bool FBusyIndicator::isRunning() +inline bool FBusyIndicator::isRunning() const { return running; } diff --git a/src/include/final/fspinbox.h b/src/include/final/fspinbox.h index 65a67858..0b9f5b36 100644 --- a/src/include/final/fspinbox.h +++ b/src/include/final/fspinbox.h @@ -140,7 +140,7 @@ class FSpinBox : public FWidget void forceFocus(); // Callback methods - void cb_inputFieldActivate (finalcut::FWidget*, const FDataPtr); + void cb_inputFieldActivate (const finalcut::FWidget*, const FDataPtr); void cb_inputFieldChange (finalcut::FWidget*, const FDataPtr); // Data members diff --git a/src/include/final/fstartoptions.h b/src/include/final/fstartoptions.h index 3c164130..6a0d1ad6 100644 --- a/src/include/final/fstartoptions.h +++ b/src/include/final/fstartoptions.h @@ -97,7 +97,7 @@ class FStartOptions final uInt16 : 15; // padding bits fc::encoding encoding{fc::UNKNOWN}; - std::ofstream logfile_stream; + std::ofstream logfile_stream{}; static FStartOptions* start_options; }; From 7749d28b92a32d0f9b1922d1ee994edea96fd2a6 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sat, 13 Jun 2020 20:35:27 +0200 Subject: [PATCH 06/28] Add a "user event" chapter to the first steps document --- .gitignore | 1 + doc/first-steps.md | 159 +++++++++++++++++++--- doc/first-steps_user-event.cpp.png | Bin 0 -> 586 bytes examples/busy | 210 ----------------------------- 4 files changed, 140 insertions(+), 230 deletions(-) create mode 100644 doc/first-steps_user-event.cpp.png delete mode 100755 examples/busy diff --git a/.gitignore b/.gitignore index b8aa0e2a..a4813f98 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ examples/.deps/ examples/.libs/ examples/calculator examples/dialog +examples/busy examples/event-log examples/string-operations examples/background-color diff --git a/doc/first-steps.md b/doc/first-steps.md index f352f815..e4edfbf8 100644 --- a/doc/first-steps.md +++ b/doc/first-steps.md @@ -245,16 +245,16 @@ Event Processing ---------------- Calling `FApplication::exec()` starts the FINAL CUT main event loop. -While the event loop is running, the system constantly checks whether +While the event loop is running, the system checks all the time whether an event has occurred and sends it to the application's currently focused -object. The events of the terminal such as keystrokes, mouse actions or -resizing the terminal are translated into `FEvent` objects and sent it to +object. The events of the terminal, such as keystrokes, mouse actions, or +terminal size changing, are translated into `FEvent` objects, and sent them to the active `FObject`. It is also possible to use `FApplication::sendEvent()` -or `FApplication::queueEvent()` to send your own events to an object. +or `FApplication::queueEvent()` to send a specific event to an object. `FObject`-derived objects process incoming events by reimplementing the -virtual method `event()`. The `FObject` itself calls only -`onTimer()` or `onUserEvent()` and ignores all other events. The +virtual method `event()`. The `FObject` itself can only call its own events +`onTimer()` and `onUserEvent()` and ignores all other events. The `FObject`-derived class `FWidget` also reimplements the `event()` method to handle further events. `FWidget` calls the `FWidget::onKeyPress` method when you press a key, or the `FWidget::onMouseDown` method when you click @@ -269,15 +269,15 @@ For example, the method `FEvent::type()` returns the type `fc::MouseDown_Event` when you press down a mouse button. Some event types have data that cannot store in an `FEvent` object. -For example, a click event of the mouse must store which button it -triggered where the mouse pointer was at that time. In classes derived +For example, a click event of the mouse must store which button is +triggered and where the mouse pointer was at that time. In classes derived from `FEvent`, such as `FMouseEvent()`, we store this data. Widgets get their events from the `event()` method inherited from FObject. The implementation of `event()` in `FWidget` forwards the most common event types to specific event handlers such as `FMouseEvent()`, `FKeyEvent()` or -`FResizeEvent()`. There are many other event types. It is also possible to -create own event types and send them to other objects. +`FResizeEvent()`. There are many other event types. You can create own event +types and send them to other objects and widgets. **The FINAL CUT event types:** @@ -312,6 +312,12 @@ enum events ``` +**Using a timer event** + +The following example starts a periodic timer that triggers an `FTimerEvent()` +every 100 ms. The virtual method `onTimer()` is then called each time in the +same dialog object. + **File:** *timer.cpp* ```cpp #include @@ -375,6 +381,119 @@ g++ -O2 -lfinal -std=c++11 timer.cpp -o timer ``` +**Using a user event** + +You can use the FUserEvent() to create a individual event and send it to a +specific object. If you want to create more than one user event, you can +specify an identification number (0 in the example below) to identify the +different events. This number can get later with getUserId(). + +User events should be generated in the main event loop. For this purpose, the +class FApplication provides the virtual method processExternalUserEvent(). +This method can be overwritten in a derived class and filled with user code. + +The following example reads the average system load and creates a user event +when a value changes. This event sends the current values to an FLabel widget +and displays them in the terminal. + + +**File:** *user-event.cpp* +```cpp +#include +#include +#define _BSD_SOURCE 1 +#define _DEFAULT_SOURCE 1 + +using LoadAvg = double[3]; +using namespace finalcut; + +class extendedApplication : public FApplication +{ + public: + extendedApplication (const int& argc, char* argv[]) + : FApplication(argc, argv) + { } + + private: + void processExternalUserEvent() override + { + if ( getMainWidget() ) + { + if ( getloadavg(load_avg, 3) < 0 ) + FApplication::getLog()->error("Can't get load average values"); + + if ( last_avg[0] != load_avg[0] + || last_avg[1] != load_avg[1] + || last_avg[2] != load_avg[2] ) + { + FUserEvent user_event(fc::User_Event, 0); + user_event.setData (FDataPtr(&load_avg)); + FApplication::sendEvent (getMainWidget(), &user_event); + } + + for (std::size_t i = 0; i < 3; i++) + last_avg[i] = load_avg[i]; + } + } + + // Data member + LoadAvg load_avg{}, last_avg{}; +}; + + +class dialogWidget final : public FDialog +{ + public: + explicit dialogWidget (FWidget* parent = nullptr) + : FDialog{"User event", parent} + { + FDialog::setGeometry (FPoint{25, 5}, FSize{40, 6}); + loadavg_label.setGeometry (FPoint{2, 2}, FSize{36, 1}); + } + + private: + void onUserEvent (FUserEvent* ev) override + { + FDataPtr dataPtr = ev->getData(); + auto& lavg = *(reinterpret_cast(dataPtr)); + std::setlocale(LC_NUMERIC, "C"); + loadavg_label.clear(); + loadavg_label << "Load average: " << lavg[0] << ", " + << lavg[1] << ", " + << lavg[2] << " "; + loadavg_label.redraw(); + } + + FLabel loadavg_label{this}; +}; + + +int main (int argc, char* argv[]) +{ + extendedApplication app(argc, argv); + dialogWidget dialog(&app); + FWidget::setMainWidget(&dialog); + dialog.show(); + return app.exec(); +} +``` +
+ user-event.cpp +
Figure 5. User event generation
+
+

+ +*(Note: You can close the window with the mouse, +Shift+F10 or Ctrl+^)* + + +After entering the source code in *user-event.cpp* you can compile +the above program with gcc: +```cpp +g++ -O2 -lfinal -std=c++11 user-event.cpp -o user-event +``` + + Signals and Callbacks --------------------- @@ -524,7 +643,7 @@ int main (int argc, char* argv[]) ```
callback-function.cpp -
Figure 5. Button with a callback function
+
Figure 6. Button with a callback function


@@ -588,7 +707,7 @@ int main (int argc, char* argv[]) ```
callback-lambda.cpp -
Figure 6. Button with lambda expression callback.
+
Figure 7. Button with lambda expression callback.


@@ -646,7 +765,7 @@ int main (int argc, char* argv[]) ```
callback-method.cpp -
Figure 7. Button with a callback method
+
Figure 8. Button with a callback method


@@ -790,7 +909,7 @@ int main (int argc, char* argv[]) ```
emit-signal.cpp -
Figure 8. Callbacks with custom signals
+
Figure 9. Callbacks with custom signals


@@ -831,7 +950,7 @@ If you want to ignore padding spaces, you must force this with the
widget coordinates -
Figure 9. Widget coordinates
+
Figure 10. Widget coordinates


@@ -881,7 +1000,7 @@ methods.
widget lengths -
Figure 10. Width and height of a widget
+
Figure 11. Width and height of a widget


@@ -934,7 +1053,7 @@ absolute geometry values as a `FRect` object, you can call the method
widget geometry -
Figure 11. Geometry of widgets
+
Figure 12. Geometry of widgets


@@ -994,7 +1113,7 @@ class dialogWidget : public FDialog button.setGeometry (FPoint{1, 1}, FSize{12, 1}, false); input.setGeometry (FPoint{2, 3}, FSize{12, 1}, false); // Set dialog geometry and calling adjustSize() - setGeometry (FPoint{25, 5}), FSize{40, 12}); + setGeometry (FPoint{25, 5}, FSize{40, 12}); setMinimumSize (FSize{25, 9}); } @@ -1068,7 +1187,7 @@ int main (int argc, char* argv[]) ```
size-adjustment.cpp -
Figure 12. Dynamic layout
+
Figure 13. Dynamic layout


@@ -1198,7 +1317,7 @@ int main (int argc, char* argv[]) ```
scrollview.cpp -
Figure 13. Dialog with a scrolling viewport
+
Figure 14. Dialog with a scrolling viewport


diff --git a/doc/first-steps_user-event.cpp.png b/doc/first-steps_user-event.cpp.png new file mode 100644 index 0000000000000000000000000000000000000000..4e1c21d8e17357b0a5c9908031c4a6def01b2da0 GIT binary patch literal 586 zcmeAS@N?(olHy`uVBq!ia0y~yU;1OBOz`!jG!i)^F=12eq z*-JcqUD=8<*YJu!^o-U3d6}R5r%I#}15NJqTe?h*uQEkqFy$9d1wk`R- z|5Vfq^=U1k2iEPIY|^@Nn)|5+!??Px4YJ2nj~#bl&pxiJ&-80v!1J2ThaaSExj*l7 z8OK`g7XrUGo?5!?w&dS^ar?^}Z#6Hp*4Z0>kLT<3L%I4-j?L@RoOd=){J#I-6Zzhv{nPA4S52zYy(hlC7RVOYn)K`Qg2I_S6L;8LZrK;EoO$N^ zt%zS-OSA)O<)rS#`00FfNNl}aC%x*ZVG663wPSv|j<3)*=hfe49}QU&`dKEkb=uGL z1*$2p@~f?wKUb7aU|JR0YifT`X}|H8x;?eklU_;WuCV5^x?lEg;ZxI9#qrO!dcE-a zC%9teDyw*Rt&P7vM?`+ToPFr4^!CTHDW^`~iTc?rzwpzA6+8AHUw9#J-;|t6x6f}m yVcvoHYt{cx{}<0?2l@6JUvHunKf>GjoPSyCmEwx5c/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command="" - -# This environment variable determines our operation mode. -if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then - # install mode needs the following variables: - generated_by_libtool_version='2.4.6' - notinst_deplibs=' /usr/local/src/MyProgs/finalcut/src/.libs/libfinal.la' -else - # When we are sourced in execute mode, $file and $ECHO are already set. - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - file="$0" - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - ECHO="printf %s\\n" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ that is used only on -# windows platforms, and (c) all begin with the string --lt- -# (application programs are unlikely to have options that match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's ../libtool value, followed by no. -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=$0 - shift - for lt_opt - do - case "$lt_opt" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` - test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. - lt_dump_F=`$ECHO "X$lt_script_arg0" | /bin/sed -e 's/^X//' -e 's%^.*/%%'` - cat "$lt_dump_D/$lt_dump_F" - exit 0 - ;; - --lt-*) - $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n "$lt_option_debug"; then - echo "busy:busy:$LINENO: libtool wrapper (GNU libtool) 2.4.6 Debian-2.4.6-2" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - $ECHO "busy:busy:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" - lt_dump_args_N=`expr $lt_dump_args_N + 1` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ - - if test -n "$lt_option_debug"; then - $ECHO "busy:busy:$LINENO: newargv[0]: $progdir/$program" 1>&2 - func_lt_dump_args ${1+"$@"} 1>&2 - fi - exec "$progdir/$program" ${1+"$@"} - - $ECHO "$0: cannot exec $program $*" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from $@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case " $* " in - *\ --lt-*) - for lt_wr_arg - do - case $lt_wr_arg in - --lt-*) ;; - *) set x "$@" "$lt_wr_arg"; shift;; - esac - shift - done ;; - esac - func_exec_program_core ${1+"$@"} -} - - # Parse options - func_parse_lt_options "$0" ${1+"$@"} - - # Find the directory that this script lives in. - thisdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'` - test "x$thisdir" = "x$file" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'` - while test -n "$file"; do - destdir=`$ECHO "$file" | /bin/sed 's%/[^/]*$%%'` - - # If there was a directory component, then change thisdir. - if test "x$destdir" != "x$file"; then - case "$destdir" in - [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; - *) thisdir="$thisdir/$destdir" ;; - esac - fi - - file=`$ECHO "$file" | /bin/sed 's%^.*/%%'` - file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no - if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then - # special case for '.' - if test "$thisdir" = "."; then - thisdir=`pwd` - fi - # remove .libs from thisdir - case "$thisdir" in - *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /bin/sed 's%[\\/][^\\/]*$%%'` ;; - .libs ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=`cd "$thisdir" && pwd` - test -n "$absdir" && thisdir="$absdir" - - program='busy' - progdir="$thisdir/.libs" - - - if test -f "$progdir/$program"; then - # Add our own library path to LD_LIBRARY_PATH - LD_LIBRARY_PATH="/usr/local/src/MyProgs/finalcut/src/.libs:$LD_LIBRARY_PATH" - - # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH - # The second colon is a workaround for a bug in BeOS R4 sed - LD_LIBRARY_PATH=`$ECHO "$LD_LIBRARY_PATH" | /bin/sed 's/::*$//'` - - export LD_LIBRARY_PATH - - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - # Run the actual program with our arguments. - func_exec_program ${1+"$@"} - fi - else - # The program doesn't exist. - $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 - $ECHO "This script is just a wrapper for $program." 1>&2 - $ECHO "See the libtool documentation for more information." 1>&2 - exit 1 - fi -fi From c64b17ac49479b669516bb70708fba92adf424be Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sat, 13 Jun 2020 21:05:52 +0200 Subject: [PATCH 07/28] Add a "user event" chapter to the first steps document --- doc/first-steps.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/first-steps.md b/doc/first-steps.md index e4edfbf8..dc3397e4 100644 --- a/doc/first-steps.md +++ b/doc/first-steps.md @@ -11,6 +11,9 @@ Table of Contents - [Memory Management](#memory-management) - [Event Processing](#event-processing) - [Event handler reimplementation](#event-handler-reimplementation) + - [Event types](#available-event-types) + - [Timer event](#using-a-timer-event) + - [User event](#using-a-user-event) - [Signals and Callbacks](#signals-and-callbacks) - [Default signals](#the-final-cut-widgets-emit-the-following-default-signals) - [Callback function](#example-of-a-callback-function) @@ -280,7 +283,7 @@ types to specific event handlers such as `FMouseEvent()`, `FKeyEvent()` or types and send them to other objects and widgets. -**The FINAL CUT event types:** +### Available event types ### ```cpp enum events { @@ -312,7 +315,7 @@ enum events ``` -**Using a timer event** +### Using a timer event ### The following example starts a periodic timer that triggers an `FTimerEvent()` every 100 ms. The virtual method `onTimer()` is then called each time in the @@ -381,20 +384,21 @@ g++ -O2 -lfinal -std=c++11 timer.cpp -o timer ``` -**Using a user event** +### Using a user event ### -You can use the FUserEvent() to create a individual event and send it to a +You can use the `FUserEvent()` to create a individual event and send it to a specific object. If you want to create more than one user event, you can specify an identification number (0 in the example below) to identify the -different events. This number can get later with getUserId(). +different events. This number can get later with `getUserId()`. -User events should be generated in the main event loop. For this purpose, the -class FApplication provides the virtual method processExternalUserEvent(). -This method can be overwritten in a derived class and filled with user code. +User events should be generated in the main event loop. For this purpose, +the class `FApplication` provides the virtual method +`processExternalUserEvent()`. This method can be overwritten in a derived +class and filled with user code. The following example reads the average system load and creates a user event -when a value changes. This event sends the current values to an FLabel widget -and displays them in the terminal. +when a value changes. This event sends the current values to an `FLabel` +widget and displays them in the terminal. **File:** *user-event.cpp* From 219ac28fb742c1ea9aa5ea09c719fe05acc0096a Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Mon, 6 Jul 2020 19:32:01 +0200 Subject: [PATCH 08/28] Add a document that describes how to create user themes --- ChangeLog | 3 + README.md | 38 +-- configure.ac | 21 +- doc/mouse-control.md | 29 ++ doc/user-theme-bee-palette.svg | 330 ++++++++++++++++++++ doc/user-theme-fc16-dark-palette.svg | 330 ++++++++++++++++++++ doc/user-theme-fc16-palette.svg | 330 ++++++++++++++++++++ doc/user-theme-fc8-palette.svg | 194 ++++++++++++ doc/user-theme-vga-palette.svg | 330 ++++++++++++++++++++ doc/user-theme.md | 436 +++++++++++++++++++++++++++ doc/user-theme.png | Bin 0 -> 1593 bytes examples/timer.cpp | 2 +- m4/cppunit.m4 | 92 ------ src/fapplication.cpp | 14 +- src/fbusyindicator.cpp | 10 +- src/fcheckmenuitem.cpp | 7 +- src/fcolorpalette.cpp | 8 +- src/fkeyboard.cpp | 2 +- src/fmenu.cpp | 24 +- src/fmenuitem.cpp | 9 +- src/fmessagebox.cpp | 64 ++-- src/foptiattr.cpp | 10 +- src/foptimove.cpp | 28 +- src/fprogressbar.cpp | 10 +- src/fradiomenuitem.cpp | 7 +- src/fscrollview.cpp | 6 +- src/fstatusbar.cpp | 7 +- src/fstring.cpp | 8 +- src/fterm.cpp | 47 ++- src/fterm_functions.cpp | 4 +- src/ftermxterminal.cpp | 16 +- src/fvterm.cpp | 10 +- src/fwidget.cpp | 39 ++- src/fwidget_functions.cpp | 2 +- src/include/final/fapplication.h | 2 +- src/include/final/fbusyindicator.h | 1 + src/include/final/fcheckmenuitem.h | 2 +- src/include/final/fmenu.h | 2 +- src/include/final/fmenuitem.h | 2 +- src/include/final/fmessagebox.h | 4 +- src/include/final/fprogressbar.h | 1 + src/include/final/fradiomenuitem.h | 2 +- src/include/final/fscrollview.h | 2 +- src/include/final/fstatusbar.h | 2 +- src/include/final/fterm.h | 6 +- src/include/final/fwidget.h | 3 + src/include/final/fwidgetcolors.h | 30 ++ test/ftermdetection-test.cpp | 2 +- 48 files changed, 2265 insertions(+), 263 deletions(-) create mode 100644 doc/mouse-control.md create mode 100644 doc/user-theme-bee-palette.svg create mode 100644 doc/user-theme-fc16-dark-palette.svg create mode 100644 doc/user-theme-fc16-palette.svg create mode 100644 doc/user-theme-fc8-palette.svg create mode 100644 doc/user-theme-vga-palette.svg create mode 100644 doc/user-theme.md create mode 100644 doc/user-theme.png delete mode 100644 m4/cppunit.m4 diff --git a/ChangeLog b/ChangeLog index d7dde9c4..601a0bec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2020-07-06 Markus Gans + * Add a document that describes how to create user themes + 2020-06-11 Markus Gans * New widget FBusyIndicator to indicate background activity * Added example/busy to demonstrate the functionality of this widget diff --git a/README.md b/README.md index fdf8f635..a4fbc267 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ ![FINAL CUT](logo/svg/finalcut-logo.svg) # Library for creating terminal applications with text-based widgets -The FINAL CUT is a C++ class library and widget toolkit with full mouse support for creating a [text-based user interface](https://en.wikipedia.org/wiki/Text-based_user_interface). The library supports the programmer to develop an application for the text console. It allows the simultaneous handling of multiple text windows on the screen. + +The FINAL CUT is a C++ class library and widget toolkit with full [mouse](doc/mouse-control.md#title-bar-actions-on-mouse-clicks) support for creating a [text-based user interface](https://en.wikipedia.org/wiki/Text-based_user_interface). The library supports the programmer to develop an application for the text console. It allows the simultaneous handling of multiple text windows on the screen. The structure of the Qt framework was originally the inspiration for the C++ class design of FINAL CUT. It provides common controls like dialog boxes, push buttons, check boxes, radio buttons, input lines, list boxes, status bars and so on. ## Building and code analysis + | | Badge | |-------------------:|:------| | *Latest release* | [![Latest Release](https://img.shields.io/github/release/gansm/finalcut.svg)](https://github.com/gansm/finalcut/releases) | @@ -18,6 +20,7 @@ The structure of the Qt framework was originally the inspiration for the C++ cla | *CodeFactor* | [![CodeFactor](https://www.codefactor.io/repository/github/gansm/finalcut/badge)](https://www.codefactor.io/repository/github/gansm/finalcut) | ## Installation + ```bash > git clone git://github.com/gansm/finalcut.git > cd finalcut @@ -28,6 +31,7 @@ The structure of the Qt framework was originally the inspiration for the C++ cla ``` ## Supported platforms + * Linux * FreeBSD * NetBSD @@ -37,6 +41,7 @@ The structure of the Qt framework was originally the inspiration for the C++ cla * Solaris ## First steps + See the [first steps](doc/first-steps.md#first-steps-with-the-final-cut-widget-toolkit) documentation for information on how to use the library. ## Some screenshots @@ -45,46 +50,38 @@ The FFileDialog widget with incremental file name search: ![FFileDialog](doc/fileopen-dialog.png) - The FINAL CUT FProgressbar widget: ![FProgressbar](doc/progress-bar.png) - Scrollable text in the FTextView widget: ![FTextView](doc/textview.png) - The Mandelbrot set example: ![Mandelbrot set](doc/Mandelbrot.png) +## newfont -newfont -------- A [graphical text font](fonts/) for X11 and the Linux console. ![ui example in newfont mode](doc/newfont1.png) - Newfont drive symbols: ![drive symbols](doc/newfont2.png) - The calculator example in newfont mode: ![calculator](doc/calculator.png) +## Benchmark -Benchmark ---------- Here you can find a test for [measuring the character speed](doc/benchmark.md#benchmark) in the terminal. +## Virtual terminal -Virtual terminal ----------------- FINAL CUT uses a virtual terminal to print character via an update method on the screen. It provides (as an overlying layer) virtual windows for the realization of window movements. The update methods only transfer differences to the virtual terminal or physical screen.
@@ -136,9 +133,7 @@ printf(...)
                                                ▀▀▀▀▀▀▀▀▀
 
- -Class digramm -------------- +## Class digramm
               1┌──────────────┐
@@ -254,15 +249,14 @@ Class digramm
                                                      └────────────────┘
 
-Frequently Asked Questions --------------------------- +## Frequently Asked Questions + For general questions about FINAL CUT, likely the answer is already included in the [FAQ](doc/faq.md#frequently-asked-questions). -Please send bug reports to --------------------------- +## Please send bug reports to + https://github.com/gansm/finalcut/issues -License -------- -GNU Lesser General Public License Version 3 LGPLv3 +## License +GNU Lesser General Public License Version 3 LGPLv3 diff --git a/configure.ac b/configure.ac index 47f6e80d..2eb274dc 100644 --- a/configure.ac +++ b/configure.ac @@ -86,9 +86,9 @@ AX_CHECK_COMPILE_FLAG([[-std=c++11]],, # use GPM (General Purpose Mouse) AC_ARG_WITH([gpm], [AS_HELP_STRING([--without-gpm], [Disable GPM mouse support])], - [with_gpm=no], + [], [with_gpm=yes]) -if test "x$with_gpm" = "xyes" +if test "x$with_gpm" != "xno" then AC_CHECK_LIB([gpm], [main], @@ -99,9 +99,9 @@ fi # profiling AC_ARG_WITH([profiler], [AS_HELP_STRING([--with-profiler], [build extra google profiler binaries])], - [with_profiler=yes], + [], [with_profiler=no]) -if test "x$with_profiler" = "xyes" +if test "x$with_profiler" != "xno" then AC_CHECK_LIB([profiler], [ProfilerFlush], @@ -111,14 +111,13 @@ fi # unit test AC_ARG_WITH([unit-test], [AS_HELP_STRING([--with-unit-test], [build unit tests])], - [with_unit_test=yes], + [], [with_unit_test=no]) -if test "x$with_unit_test" = "xyes" +if test "x$with_unit_test" != "xno" then AC_MSG_NOTICE(enabled cppunit test) - AM_PATH_CPPUNIT([1.12.0], - [], - [AC_MSG_ERROR([*** CppUnit not found! ***])]) + PKG_CHECK_MODULES(CPPUNIT, + [cppunit > 1.12.0]) AM_CONDITIONAL(CPPUNIT_TEST, [test "1" = "1"]) else AM_CONDITIONAL(CPPUNIT_TEST, [test "1" = "0"]) @@ -128,9 +127,9 @@ fi # code coverage AC_ARG_WITH([gcov], [AS_HELP_STRING([--with-gcov], [build for code coverage testing])], - [with_gcov=yes], + [], [with_gcov=no]) -if test "x$with_gcov" = "xyes" +if test "x$with_gcov" != "xno" then AC_CHECK_LIB([gcov], [main], diff --git a/doc/mouse-control.md b/doc/mouse-control.md new file mode 100644 index 00000000..03ca4b70 --- /dev/null +++ b/doc/mouse-control.md @@ -0,0 +1,29 @@ +Title bar actions on mouse clicks +================================= + +The FINAL CUT title bar of dialog windows has different behaviors on mouse clicks. + + +Clicking on the title bar +------------------------- + +* A left-click activates and raises the window. After that, you can drag the window with the mouse. +* A middle-click activates and lower the window. +* A right-click activates the window and keeps its current position in the window stack. +* A double-click maximizes or restores the window size for a resizable dialog. + + +Clicking the title bar buttons +------------------------------ + +* Single-clicking on the title bar menu button opens the title bar menu. +* Double-clicking on the title bar menu button closes the dialog. +* Single-clicking on the zoom button maximizes the window size. +* Single-clicking on the unzoom button restores the window size. + + +Dialog resize corner +-------------------- + +If you click and drag the left mouse button in the lower right corner of the window, you can change the size of a resizable dialog. + diff --git a/doc/user-theme-bee-palette.svg b/doc/user-theme-bee-palette.svg new file mode 100644 index 00000000..90825aa4 --- /dev/null +++ b/doc/user-theme-bee-palette.svg @@ -0,0 +1,330 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + diff --git a/doc/user-theme-fc16-dark-palette.svg b/doc/user-theme-fc16-dark-palette.svg new file mode 100644 index 00000000..0d91e4d3 --- /dev/null +++ b/doc/user-theme-fc16-dark-palette.svg @@ -0,0 +1,330 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + diff --git a/doc/user-theme-fc16-palette.svg b/doc/user-theme-fc16-palette.svg new file mode 100644 index 00000000..7bcadf23 --- /dev/null +++ b/doc/user-theme-fc16-palette.svg @@ -0,0 +1,330 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + diff --git a/doc/user-theme-fc8-palette.svg b/doc/user-theme-fc8-palette.svg new file mode 100644 index 00000000..0578c6a1 --- /dev/null +++ b/doc/user-theme-fc8-palette.svg @@ -0,0 +1,194 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + diff --git a/doc/user-theme-vga-palette.svg b/doc/user-theme-vga-palette.svg new file mode 100644 index 00000000..e451e02c --- /dev/null +++ b/doc/user-theme-vga-palette.svg @@ -0,0 +1,330 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + diff --git a/doc/user-theme.md b/doc/user-theme.md new file mode 100644 index 00000000..b3f699b8 --- /dev/null +++ b/doc/user-theme.md @@ -0,0 +1,436 @@ +User Themes +=========== + +FINAL CUT supports color themes. That makes it possible to change the color +of all elements of a widget in the program. Also, you can adjust the color +palette to your preferences. If you want to switch back to the default +themes, you can always call the method `FApplication::setDefaultTheme()` +or `FApplication::setDarkTheme()` for the dark theme. + + +Widget Color Theme +------------------ + +FINAL CUT uses a default color scheme that the user can override in a +derived class of `FWidgetColors`. All widget colors are redefined in the +constructor by the method `setColorTheme()`. + +```cpp +class myWidgetColors final : public finalcut::FWidgetColors +{ + public: + myWidgetColors() + { + myWidgetColors::setColorTheme(); + } + + ~myWidgetColors() override + { } + + const finalcut::FString getClassName() const override + { + return "myWidgetColors"; + } + + void myWidgetColors() override + { + ... // Color definitions + } +}; +``` + +For setting the widget colors, it is recommended to call the method +`FWidget::setColorTheme()` via the `FApplication` object to create a +new instance of the theme and assign it to the application. + +```cpp +finalcut::FApplication app(argc, argv); +app.setColorTheme(); +``` + +In the following example, we will create the `BeeColorTheme`. For this +purpose, we will first create an include file that can be easily included +later in your application. + +**File:** *widget-color-theme.h* +```cpp +#ifndef WIDGETCOLORTHEME_H +#define WIDGETCOLORTHEME_H + +class BeeColorTheme final : public finalcut::FWidgetColors +{ + public: + BeeColorTheme() + { + BeeColorTheme::setColorTheme(); + } + + ~BeeColorTheme() override + { } + + const finalcut::FString getClassName() const override + { + return "BeeColorTheme"; + } + + void setColorTheme() override + { + term_fg = finalcut::fc::Black; + term_bg = finalcut::fc::LightBlue; + list_fg = finalcut::fc::Black; + list_bg = finalcut::fc::LightGray; + selected_list_fg = finalcut::fc::LightRed; + selected_list_bg = finalcut::fc::LightGray; + dialog_fg = finalcut::fc::Black; + dialog_resize_fg = finalcut::fc::Red; + dialog_emphasis_fg = finalcut::fc::Blue; + dialog_bg = finalcut::fc::LightGray; + error_box_fg = finalcut::fc::Black; + error_box_emphasis_fg = finalcut::fc::Red; + error_box_bg = finalcut::fc::Yellow; + tooltip_fg = finalcut::fc::Black; + tooltip_bg = finalcut::fc::Yellow; + shadow_fg = finalcut::fc::Black; + shadow_bg = finalcut::fc::LightGray; + current_element_focus_fg = finalcut::fc::White; + current_element_focus_bg = finalcut::fc::Green; + current_element_fg = finalcut::fc::LightGray; + current_element_bg = finalcut::fc::DarkGray; + current_inc_search_element_fg = finalcut::fc::Brown; + selected_current_element_focus_fg = finalcut::fc::LightRed; + selected_current_element_focus_bg = finalcut::fc::Green; + selected_current_element_fg = finalcut::fc::LightRed; + selected_current_element_bg = finalcut::fc::DarkGray; + label_fg = finalcut::fc::Black; + label_bg = finalcut::fc::LightGray; + label_inactive_fg = finalcut::fc::LightGray; + label_inactive_bg = finalcut::fc::DarkGray; + label_hotkey_fg = finalcut::fc::Red; + label_hotkey_bg = finalcut::fc::LightGray; + label_emphasis_fg = finalcut::fc::Blue; + label_ellipsis_fg = finalcut::fc::DarkGray; + inputfield_active_focus_fg = finalcut::fc::LightGray; + inputfield_active_focus_bg = finalcut::fc::Green; + inputfield_active_fg = finalcut::fc::Black; + inputfield_active_bg = finalcut::fc::Cyan ; + inputfield_inactive_fg = finalcut::fc::Black; + inputfield_inactive_bg = finalcut::fc::LightGray; + toggle_button_active_focus_fg = finalcut::fc::White; + toggle_button_active_focus_bg = finalcut::fc::Green; + toggle_button_active_fg = finalcut::fc::Black; + toggle_button_active_bg = finalcut::fc::LightGray; + toggle_button_inactive_fg = finalcut::fc::DarkGray; + toggle_button_inactive_bg = finalcut::fc::LightGray; + button_active_focus_fg = finalcut::fc::White; + button_active_focus_bg = finalcut::fc::Green; + button_active_fg = finalcut::fc::Black; + button_active_bg = finalcut::fc::Cyan; + button_inactive_fg = finalcut::fc::Cyan; + button_inactive_bg = finalcut::fc::LightGray; + button_hotkey_fg = finalcut::fc::Red; + titlebar_active_fg = finalcut::fc::White; + titlebar_active_bg = finalcut::fc::Blue; + titlebar_inactive_fg = finalcut::fc::LightGray; + titlebar_inactive_bg = finalcut::fc::DarkGray; + titlebar_button_fg = finalcut::fc::Black; + titlebar_button_bg = finalcut::fc::LightGray; + titlebar_button_focus_fg = finalcut::fc::LightGray; + titlebar_button_focus_bg = finalcut::fc::Black; + menu_active_focus_fg = finalcut::fc::White; + menu_active_focus_bg = finalcut::fc::Blue; + menu_active_fg = finalcut::fc::Black; + menu_active_bg = finalcut::fc::Yellow; + menu_inactive_fg = finalcut::fc::Cyan; + menu_inactive_bg = finalcut::fc::Yellow; + menu_hotkey_fg = finalcut::fc::Red; + menu_hotkey_bg = finalcut::fc::Yellow; + statusbar_fg = finalcut::fc::White; + statusbar_bg = finalcut::fc::DarkGray; + statusbar_hotkey_fg = finalcut::fc::LightRed; + statusbar_hotkey_bg = finalcut::fc::DarkGray; + statusbar_separator_fg = finalcut::fc::Black; + statusbar_active_fg = finalcut::fc::White; + statusbar_active_bg = finalcut::fc::Green; + statusbar_active_hotkey_fg = finalcut::fc::LightRed; + statusbar_active_hotkey_bg = finalcut::fc::Green; + scrollbar_fg = finalcut::fc::Black; + scrollbar_bg = finalcut::fc::Green; + scrollbar_button_fg = finalcut::fc::Black; + scrollbar_button_bg = finalcut::fc::Green; + scrollbar_button_inactive_fg = finalcut::fc::Cyan; + scrollbar_button_inactive_bg = finalcut::fc::LightGray; + progressbar_fg = finalcut::fc::Green; + progressbar_bg = finalcut::fc::DarkGray; + } +}; + +#endif // WIDGETCOLORTHEME_H +``` + + +Color Palette Theme +------------------- + +FINAL CUT has four color tables for the 16 standard colors in the terminal. +These are a redefinition of the 16 ANSI colors. You can address the colors +via indexes values from 0 to 15. They correspond to the following colors: + +| Index | Color name | +|:------:|:---------------------------| +| 0 | finalcut::fc::Black | +| 1 | finalcut::fc::Blue | +| 2 | finalcut::fc::Green | +| 3 | finalcut::fc::Cyan | +| 4 | finalcut::fc::Red | +| 5 | finalcut::fc::Magenta | +| 6 | finalcut::fc::Brown | +| 7 | finalcut::fc::LightGray | +| 8 | finalcut::fc::DarkGray | +| 9 | finalcut::fc::LightBlue | +| 10 | finalcut::fc::LightGreen | +| 11 | finalcut::fc::LightCyan | +| 12 | finalcut::fc::LightRed | +| 13 | finalcut::fc::LightMagenta | +| 14 | finalcut::fc::Yellow | +| 15 | finalcut::fc::White | + +You can define your color as an 8-bit value based on its red, green, and +blue components. To create a color palette, create a derived class of +`FColorPalette`. The constructor gets as argument the function to set +a palette color. This function must have the following structure: + +```cpp +setPalette(finalcut::FColor index, int red, int green, int blue); +``` + +A possible implementation could look as follows: + +```cpp +class myColorPalette final : public finalcut::FColorPalette +{ + public: + explicit myColorPalette (const FSetPalette& f) + : FColorPalette(f) + { } + + ~myColorPalette() + { } + + const finalcut::FString getClassName() const override + { + return "myColorPalette"; + } + + void setColorPalette() override + { + ... // Palette definitions + } + + void resetColorPalette() override + { + setVGAdefaultPalette(); + } +}; +``` +To set the colors of a palette theme, you should use the method +`FTerm::setColorPaletteTheme()`. This method creates a new instance and +saves it in the `FTerm` object. + +```cpp +finalcut::FTerm::setColorPaletteTheme(); +``` +The standard VGA palette is part of the `FColorPalette` class. To set it, +use the method `setVGAdefaultPalette()`. You can use it to reset the color +palette of terminals that cannot reset to default values with escape +sequences. +
+ VGA palette +
Figure 1. VGA palette
+
+ +The FINAL CUT eight-color palette `default8ColorPalette` is optimized for +the eight-color widget theme `default8ColorTheme`. It is for terminals +that cannot display more than eight colors. +
+ FINAL CUT 8-color palette +
Figure 2. FINAL CUT 8-color palette
+
+ +The FINAL CUT palette `default16ColorPalette` is the default 16-color +palette. It is optimized for the widget color theme `default16ColorTheme`. +
+ FINAL CUT 16-color palette +
Figure 3. FINAL CUT 16-color palette
+
+ +The second 16-color palette in FINAL CUT is for the dark theme. It was +adjusted for the widget color themes `default8ColorDarkTheme` and +`default16ColorDarkTheme`. +
+ FINAL CUT 16-color dark palette +
Figure 4. FINAL CUT 16-color dark palette
+
+ +In the following example, we want to create the palette them +`BeeColorPalette`. For this purpose, we generate an include file again, +in which we implement the new palette class. +
+ Bee palette +
Figure 6. Bee palette
+
+ +**File:** *color-palette-theme.h* +```cpp +#ifndef BEECOLORPALETTE_H +#define BEECOLORPALETTE_H + +class BeeColorPalette final : public finalcut::FColorPalette +{ + public: + explicit BeeColorPalette (const FSetPalette& f) + : FColorPalette(f) + { } + + ~BeeColorPalette() + { } + + const finalcut::FString getClassName() const override + { + return "BeeColorPalette"; + } + + void setColorPalette() override + { + setPalette (finalcut::fc::Black, 0x00, 0x00, 0x00); + setPalette (finalcut::fc::Blue, 0x23, 0x21, 0x2c); + setPalette (finalcut::fc::Green, 0x26, 0x93, 0x7c); + setPalette (finalcut::fc::Cyan, 0xcf, 0xb3, 0xa8); + setPalette (finalcut::fc::Red, 0xba, 0x1a, 0x1a); + setPalette (finalcut::fc::Magenta, 0xb2, 0x18, 0xb2); + setPalette (finalcut::fc::Brown, 0xe8, 0x87, 0x1f); + setPalette (finalcut::fc::LightGray, 0xff, 0xfb, 0xe4); + setPalette (finalcut::fc::DarkGray, 0x3a, 0x36, 0x37); + setPalette (finalcut::fc::LightBlue, 0xa5, 0xa5, 0xb1); + setPalette (finalcut::fc::LightGreen, 0x5e, 0xeb, 0x5c); + setPalette (finalcut::fc::LightCyan, 0x62, 0xbf, 0xf8); + setPalette (finalcut::fc::LightRed, 0xee, 0x44, 0x44); + setPalette (finalcut::fc::LightMagenta, 0xe9, 0xad, 0xff); + setPalette (finalcut::fc::Yellow, 0xf8, 0xef, 0xa6); + setPalette (finalcut::fc::White, 0xff, 0xff, 0xff); + } + + void resetColorPalette() override + { + setVGAdefaultPalette(); + } +}; + +#endif // BEECOLORPALETTE_H +``` + + +Use of Themes +------------- + +If you include the two include files above in your application, you can use +the widget color theme and the color palette theme. In the main function of +your application, the object instances of both classes are created and set. +
+ User theme example +
Figure 7. User theme example
+
+ + +**File:** *theme.cpp* +```cpp +#include + +#include "widget-color-theme.h" +#include "color-palette-theme.h" + +using namespace finalcut; + +class dialogWidget final : public FDialog +{ + public: + explicit dialogWidget (FWidget* parent = nullptr) + : FDialog{"Theming test application", parent} + { + FDialog::setGeometry (FPoint{15, 5}, FSize{50, 9}); + Input.setGeometry (FPoint{2, 2}, FSize{39, 1}); + Input.setLabelText("File name:"); + Input.setLabelOrientation(FLineEdit::label_above); + Input.setStatusbarMessage("Enter a file name"); + Browse.setGeometry (FPoint{43, 2}, FSize{4, 1}); + Browse.addCallback + ( + "clicked", + F_METHOD_CALLBACK (this, &dialogWidget::cb_FileBrowse) + ); + Apply.setGeometry (FPoint{24, 5}, FSize{10, 1}); + Apply.setStatusbarMessage("Apply settings"); + Quit.setGeometry (FPoint{37, 5}, FSize{10, 1}); + Quit.setStatusbarMessage("Exit the program"); + Quit.addCallback + ( + "clicked", + F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) + ); + Open.addCallback + ( + "clicked", + F_METHOD_CALLBACK (this, &dialogWidget::cb_FileBrowse) + ); + } + + private: + void cb_FileBrowse (finalcut::FWidget*, FDataPtr) + { + auto filename = FFileDialog::fileOpenChooser(this); + + if ( ! filename.isEmpty() ) + { + Input.setText(filename); + Input.redraw(); + } + } + + FMenuBar Menubar{this}; + FMenu File{"&File", &Menubar}; + FMenuItem New{"&New", &File}; + FMenuItem Open{"&Open...", &File}; + FMenu Edit{"&Edit", &Menubar}; + FMenuItem Undo{"&Undo", &Edit}; + FMenu Help{"&Help", &Menubar}; + FMenuItem About{"&About", &Help}; + FStatusBar Statusbar{this}; + FLineEdit Input{"input...", this}; + FButton Browse{"..", this}; + FButton Apply{"&Apply", this}; + FButton Quit{"&Quit", this}; +}; + +int main (int argc, char* argv[]) +{ + FApplication app(argc, argv); + + // Set the widget color theme + app.setColorTheme(); + + // Set the color palette theme + FTerm::setColorPaletteTheme(); + + dialogWidget dialog(&app); + FWidget::setMainWidget(&dialog); + dialog.show(); + return app.exec(); +} +``` + + +After entering the source code in *theme.cpp* you can compile +the above program with gcc: +```cpp +g++ -O2 -lfinal -std=c++11 theme.cpp -o theme + +``` diff --git a/doc/user-theme.png b/doc/user-theme.png new file mode 100644 index 0000000000000000000000000000000000000000..47019aab15d076bf56e7cdff50e395df8d2eb0eb GIT binary patch literal 1593 zcmeAS@N?(olHy`uVBq!ia0y~yU}|DuU~FPx28y(q?cWWg6a#!hT!FNbg0||UYD-hI zB}+E!l$1QTY5DheOaJ|P{O{kt|Ns9h3Wb#d6)`4xySp%Su*!M>Ih+L^k;M!Q+`=Ht z$S`Y;1W=H@#M9T6{Rul8gCJA(T%#il46O4!T^vIyZoR#0pZ~~1f<3`|yI01OrJ|zZd6Bo?0Ne#*k<~+bGA#)KYjW~`(V3CY;e@J_X0kg z+gLBlHfbLG+vFcQckA+FH|D8)jQOdFWq}yxk2*i_0qGUZ?8+c70!@<{jIG2 z^Mh3V~8!&4tWJ#Qg>P{s3~_`$%K+A!AB-#&}I32Ht%Yfq@bn(K@A%rw~CYibd*`eYqv zT46@s>Vt{KPMrTt4hEiQJsc&&;$B%h=lbNh&FlI;J++Bge{|u>JFC80f79=;R@(9R z?J2t-ecS6;INwzto+J3><{5X^^Om1q{V)9I1`041PN6q*6N(rmYgRsZz@!BgQUM2M zy1vBzpMh`Av$NQ%S*(!fC=;wvz2RFBclCjdWQel$o-GIWRN2Me6`sjHJ1}O?f?uty z*MGiFhoBWX-;bl2_S6d9UTN@UK32-SlAN)F;L)XPbXtd$i;p zTlVJ#TW{>P0=eUk=8vM{T|3v#`8RX#dHyDGjUBIkI8AsU-k;Ru&UH_$KhZo#-+a5d zx{>X?n;LvYUzf3Q3ibTdtvg;6TM)HXcu&c}Z)IFf;aAHhHEmySe%f@$jG9+$P44&k z=iP|jQ!I6qrGDLm_xbtx|ApRsxXE*{cK(KQ{=dre%=Wv1Y=?OH-_f~{K!I@K;z*2n z^B%m~uD1QD`|@lKA)9~?g+=#kTED+CIQZ1`Y`)`{h!1t&Zpg@J?AX(m5PnedV34xs zx<_W+^~=~f+v*ap9DiMh`te^=i|qUS=c?kG`;SJ|)GtZc)AnGS)Eu+&6V_P; z%h>uaE9{u}bK?He;y=<=4}E?tly_hDY4OLuX6-xQ%$P3IdZ_rGPebvG<0tm3CxRqks>%u(N=CUNa)+O6pI2dnPtEj=w2v+gO2`1|R1jvfoF*{*iuF>Bic z^?QNtYagAnTz6FZ*};O~*u3tol^3FPfPQ$haY4zM`p->DzTJxVe*+6|22WQ%mvv4F FO#n#=zMcR8 literal 0 HcmV?d00001 diff --git a/examples/timer.cpp b/examples/timer.cpp index 3b444c8c..032807e4 100644 --- a/examples/timer.cpp +++ b/examples/timer.cpp @@ -35,7 +35,7 @@ class Timer final : public finalcut::FWidget // Constructor explicit Timer (finalcut::FWidget* = nullptr); - protected: + private: // Method void draw() override; diff --git a/m4/cppunit.m4 b/m4/cppunit.m4 deleted file mode 100644 index 41f067b6..00000000 --- a/m4/cppunit.m4 +++ /dev/null @@ -1,92 +0,0 @@ -dnl -dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -dnl -AC_DEFUN([AM_PATH_CPPUNIT], -[ - -AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)], - cppunit_config_prefix="$withval", cppunit_config_prefix="") -AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)], - cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="") - - if test x$cppunit_config_exec_prefix != x ; then - cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix" - if test x${CPPUNIT_CONFIG+set} != xset ; then - CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config - fi - fi - if test x$cppunit_config_prefix != x ; then - cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix" - if test x${CPPUNIT_CONFIG+set} != xset ; then - CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config - fi - fi - - AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no) - cppunit_version_min=$1 - - AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min) - no_cppunit="" - if test "$CPPUNIT_CONFIG" = "no" ; then - AC_MSG_RESULT(no) - no_cppunit=yes - else - CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags` - CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs` - cppunit_version=`$CPPUNIT_CONFIG --version` - - cppunit_major_version=`echo $cppunit_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - cppunit_minor_version=`echo $cppunit_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - cppunit_micro_version=`echo $cppunit_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - - cppunit_major_min=`echo $cppunit_version_min | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - if test "x${cppunit_major_min}" = "x" ; then - cppunit_major_min=0 - fi - - cppunit_minor_min=`echo $cppunit_version_min | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - if test "x${cppunit_minor_min}" = "x" ; then - cppunit_minor_min=0 - fi - - cppunit_micro_min=`echo $cppunit_version_min | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x${cppunit_micro_min}" = "x" ; then - cppunit_micro_min=0 - fi - - cppunit_version_proper=`expr \ - $cppunit_major_version \> $cppunit_major_min \| \ - $cppunit_major_version \= $cppunit_major_min \& \ - $cppunit_minor_version \> $cppunit_minor_min \| \ - $cppunit_major_version \= $cppunit_major_min \& \ - $cppunit_minor_version \= $cppunit_minor_min \& \ - $cppunit_micro_version \>= $cppunit_micro_min ` - - if test "$cppunit_version_proper" = "1" ; then - AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version]) - else - AC_MSG_RESULT(no) - no_cppunit=yes - fi - fi - - if test "x$no_cppunit" = x ; then - ifelse([$2], , :, [$2]) - else - CPPUNIT_CFLAGS="" - CPPUNIT_LIBS="" - ifelse([$3], , :, [$3]) - fi - - AC_SUBST(CPPUNIT_CFLAGS) - AC_SUBST(CPPUNIT_LIBS) -]) - - - diff --git a/src/fapplication.cpp b/src/fapplication.cpp index efade18f..4177e28c 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -96,7 +96,7 @@ FApplication::FApplication (const int& _argc, char* _argv[]) app_argv = reinterpret_cast(&empty_str); } - init (key_timeout, dblclick_interval); + init(); } //---------------------------------------------------------------------- @@ -278,14 +278,14 @@ void FApplication::setDefaultTheme() if ( FTerm::getMaxColor() < 16 ) // for 8 color mode { if ( getStartOptions().color_change ) - FTerm::setColorPaletteTheme(&FTerm::setPalette); + FTerm::setColorPaletteTheme(); setColorTheme(); } else { if ( getStartOptions().color_change ) - FTerm::setColorPaletteTheme(&FTerm::setPalette); + FTerm::setColorPaletteTheme(); setColorTheme(); } @@ -295,7 +295,7 @@ void FApplication::setDefaultTheme() void FApplication::setDarkTheme() { if ( getStartOptions().color_change ) - FTerm::setColorPaletteTheme(&FTerm::setPalette); + FTerm::setColorPaletteTheme(); if ( FTerm::getMaxColor() < 16 ) // for 8 color mode setColorTheme(); @@ -335,7 +335,7 @@ void FApplication::processExternalUserEvent() // private methods of FApplication //---------------------------------------------------------------------- -void FApplication::init (uInt64 key_time, uInt64 dblclick_time) +void FApplication::init() { // Initialize keyboard keyboard = FTerm::getFKeyboard(); @@ -352,7 +352,7 @@ void FApplication::init (uInt64 key_time, uInt64 dblclick_time) keyboard->setPressCommand (key_cmd1); keyboard->setReleaseCommand (key_cmd2); keyboard->setEscPressedCommand (key_cmd3); - keyboard->setKeypressTimeout (key_time); + keyboard->setKeypressTimeout (key_timeout); } // Initialize mouse control @@ -364,7 +364,7 @@ void FApplication::init (uInt64 key_time, uInt64 dblclick_time) // Set the default double click interval if ( mouse ) - mouse->setDblclickInterval (dblclick_time); + mouse->setDblclickInterval (dblclick_interval); // Initialize logging if ( ! getStartOptions().logfile_stream.is_open() ) diff --git a/src/fbusyindicator.cpp b/src/fbusyindicator.cpp index 0b7ce8ee..dcd2f5a6 100644 --- a/src/fbusyindicator.cpp +++ b/src/fbusyindicator.cpp @@ -34,8 +34,7 @@ namespace finalcut FBusyIndicator::FBusyIndicator (FWidget* parent) : FToolTip{parent} { - FToolTip::hide(); - createIndicatorText(); + init(); } //---------------------------------------------------------------------- @@ -66,6 +65,13 @@ void FBusyIndicator::stop() // private methods of FBusyIndicator +//---------------------------------------------------------------------- +void FBusyIndicator::init() +{ + FToolTip::hide(); + createIndicatorText(); +} + //---------------------------------------------------------------------- void FBusyIndicator::createIndicatorText() { diff --git a/src/fcheckmenuitem.cpp b/src/fcheckmenuitem.cpp index 201d4e05..392ca681 100644 --- a/src/fcheckmenuitem.cpp +++ b/src/fcheckmenuitem.cpp @@ -36,14 +36,14 @@ namespace finalcut FCheckMenuItem::FCheckMenuItem (FWidget* parent) : FMenuItem{parent} { - init (parent); + init(); } //---------------------------------------------------------------------- FCheckMenuItem::FCheckMenuItem (const FString& txt, FWidget* parent) : FMenuItem{txt, parent} { - init (parent); + init(); } //---------------------------------------------------------------------- @@ -53,9 +53,10 @@ FCheckMenuItem::~FCheckMenuItem() // destructor // private methods of FCheckMenuItem //---------------------------------------------------------------------- -void FCheckMenuItem::init (FWidget* parent) +void FCheckMenuItem::init() { setCheckable(); + FWidget* parent = getParentWidget(); if ( ! parent ) return; diff --git a/src/fcolorpalette.cpp b/src/fcolorpalette.cpp index d061d767..e173218d 100644 --- a/src/fcolorpalette.cpp +++ b/src/fcolorpalette.cpp @@ -53,10 +53,10 @@ void FColorPalette::setVGAdefaultPalette() setPalette (fc::Black, 0x00, 0x00, 0x00); setPalette (fc::Blue, 0x00, 0x00, 0xaa); setPalette (fc::Green, 0x00, 0xaa, 0x00); - setPalette (fc::Cyan, 0x00, 0x55, 0xaa); + setPalette (fc::Cyan, 0x00, 0xaa, 0xaa); setPalette (fc::Red, 0xaa, 0x00, 0x00); setPalette (fc::Magenta, 0xaa, 0x00, 0xaa); - setPalette (fc::Brown, 0xaa, 0xaa, 0x00); + setPalette (fc::Brown, 0xaa, 0x55, 0x00); setPalette (fc::LightGray, 0xaa, 0xaa, 0xaa); setPalette (fc::DarkGray, 0x55, 0x55, 0x55); setPalette (fc::LightBlue, 0x55, 0x55, 0xff); @@ -126,7 +126,7 @@ default16ColorPalette::default16ColorPalette (const FSetPalette& f) default16ColorPalette::~default16ColorPalette() { } -// public methods of default8ColorPalette +// public methods of default16ColorPalette //---------------------------------------------------------------------- void default16ColorPalette::setColorPalette() { @@ -169,7 +169,7 @@ default16DarkColorPalette::default16DarkColorPalette (const FSetPalette& f) default16DarkColorPalette::~default16DarkColorPalette() { } -// public methods of default8ColorPalette +// public methods of default16DarkColorPalette //---------------------------------------------------------------------- void default16DarkColorPalette::setColorPalette() { diff --git a/src/fkeyboard.cpp b/src/fkeyboard.cpp index d058f5d2..35b6e005 100644 --- a/src/fkeyboard.cpp +++ b/src/fkeyboard.cpp @@ -124,7 +124,7 @@ bool FKeyboard::isKeyPressed() const FD_ZERO(&ifds); FD_SET(stdin_no, &ifds); tv.tv_sec = 0; - tv.tv_usec = suseconds_t(FKeyboard::read_blocking_time); // preset to 100 ms + tv.tv_usec = suseconds_t(read_blocking_time); // preset to 100 ms const int result = select (stdin_no + 1, &ifds, nullptr, nullptr, &tv); if ( result > 0 && FD_ISSET(stdin_no, &ifds) ) diff --git a/src/fmenu.cpp b/src/fmenu.cpp index 060bc3d1..ebca38b4 100644 --- a/src/fmenu.cpp +++ b/src/fmenu.cpp @@ -47,7 +47,7 @@ namespace finalcut FMenu::FMenu(FWidget* parent) : FWindow{parent} { - init(parent); + init(); } //---------------------------------------------------------------------- @@ -55,7 +55,7 @@ FMenu::FMenu (const FString& txt, FWidget* parent) : FWindow{parent} , menuitem{txt, parent} { - init(parent); + init(); } //---------------------------------------------------------------------- @@ -457,7 +457,7 @@ bool FMenu::isMouseOverMenuBar (const FPoint& termpos) } //---------------------------------------------------------------------- -void FMenu::init(FWidget* parent) +void FMenu::init() { setTopPadding(1); setLeftPadding(1); @@ -469,6 +469,7 @@ void FMenu::init(FWidget* parent) hide(); resetColors(); menuitem.setMenu(this); + FWidget* parent = getParentWidget(); if ( parent ) { @@ -1428,15 +1429,16 @@ inline void FMenu::drawAcceleratorKey (std::size_t& startpos, FKey accel_key) const FString accel_name {FTerm::getKeyName(accel_key)}; const std::size_t c = ( has_checkable_items ) ? 1 : 0; const std::size_t accel_len = accel_name.getLength(); - const std::size_t len = max_item_width - (startpos + accel_len + c + 2); + const std::size_t plain_text_length = startpos + accel_len + c + 2; - if ( len > 0 ) - { - // Print filling blank spaces + accelerator key name - const FString spaces {len, L' '}; - print (spaces + accel_name); - startpos = max_item_width - (c + 2); - } + if ( plain_text_length >= max_item_width ) + return; + + // Print filling blank spaces + accelerator key name + const std::size_t len = max_item_width - plain_text_length; + const FString spaces {len, L' '}; + print (spaces + accel_name); + startpos = max_item_width - (c + 2); } //---------------------------------------------------------------------- diff --git a/src/fmenuitem.cpp b/src/fmenuitem.cpp index 2bbc12db..25b750f6 100644 --- a/src/fmenuitem.cpp +++ b/src/fmenuitem.cpp @@ -44,7 +44,7 @@ namespace finalcut FMenuItem::FMenuItem (FWidget* parent) : FWidget{parent} { - init (parent); + init(); } //---------------------------------------------------------------------- @@ -52,7 +52,7 @@ FMenuItem::FMenuItem (const FString& txt, FWidget* parent) : FWidget{parent} , text{txt} { - init (parent); + init(); } //---------------------------------------------------------------------- @@ -61,7 +61,7 @@ FMenuItem::FMenuItem (FKey k, const FString& txt, FWidget* parent) , text{txt} , accel_key{k} { - init (parent); + init(); } //---------------------------------------------------------------------- @@ -503,7 +503,7 @@ FMenuList* FMenuItem::getFMenuList (FWidget& widget) } //---------------------------------------------------------------------- -void FMenuItem::init (FWidget* parent) +void FMenuItem::init() { text_length = text.getLength(); text_width = getColumnWidth(text); @@ -519,6 +519,7 @@ void FMenuItem::init (FWidget* parent) } setGeometry (FPoint{1, 1}, FSize{text_width + 2, 1}, false); + FWidget* parent = getParentWidget(); if ( ! parent ) return; diff --git a/src/fmessagebox.cpp b/src/fmessagebox.cpp index d47b1e4d..f156bfe7 100644 --- a/src/fmessagebox.cpp +++ b/src/fmessagebox.cpp @@ -51,9 +51,10 @@ static const char* const button_text[] = //---------------------------------------------------------------------- FMessageBox::FMessageBox (FWidget* parent) : FDialog{parent} + , button_digit{FMessageBox::Ok, 0, 0} { setTitlebarText("Message for you"); - init(FMessageBox::Ok, 0, 0); + init(); } //---------------------------------------------------------------------- @@ -64,14 +65,15 @@ FMessageBox::FMessageBox (const FMessageBox& mbox) , text_components{mbox.text_components} , max_line_width{mbox.max_line_width} , emphasis_color{mbox.emphasis_color} + , button_digit{mbox.button_digit[0], + mbox.button_digit[1], + mbox.button_digit[2]} , num_buttons{mbox.num_buttons} , text_num_lines{mbox.text_num_lines} , center_text{mbox.center_text} { setTitlebarText (mbox.getTitlebarText()); - init ( mbox.button_digit[0] - , mbox.button_digit[1] - , mbox.button_digit[2] ); + init(); } //---------------------------------------------------------------------- @@ -83,9 +85,10 @@ FMessageBox::FMessageBox ( const FString& caption , FWidget* parent ) : FDialog{parent} , text{message} + , button_digit{button0, button1, button2} { setTitlebarText(caption); - init(button0, button1, button2); + init(); } //---------------------------------------------------------------------- @@ -111,6 +114,7 @@ FMessageBox& FMessageBox::operator = (const FMessageBox& mbox) if ( mbox.getParentWidget() ) mbox.getParentWidget()->addChild (this); + setTitlebarText (mbox.getTitlebarText()); headline_text = mbox.headline_text; text = mbox.text; text_components = mbox.text_components; @@ -119,11 +123,10 @@ FMessageBox& FMessageBox::operator = (const FMessageBox& mbox) emphasis_color = mbox.emphasis_color; num_buttons = mbox.num_buttons; text_num_lines = mbox.text_num_lines; - - setTitlebarText (mbox.getTitlebarText()); - init ( mbox.button_digit[0] - , mbox.button_digit[1] - , mbox.button_digit[2] ); + button_digit[0] = mbox.button_digit[0]; + button_digit[1] = mbox.button_digit[1]; + button_digit[2] = mbox.button_digit[2]; + init(); return *this; } @@ -149,12 +152,14 @@ void FMessageBox::setText (const FString& txt) { text.setString(txt); calculateDimensions(); - button[0]->setY (int(getHeight()) - 4, false); - if ( button_digit[1] != 0 ) + if ( button[0] ) + button[0]->setY (int(getHeight()) - 4, false); + + if ( button[1] && button_digit[1] != 0 ) button[1]->setY (int(getHeight()) - 4, false); - if ( button_digit[2] != 0 ) + if ( button[2] && button_digit[2] != 0 ) button[2]->setY (int(getHeight()) - 4, false); adjustButtons(); @@ -197,30 +202,27 @@ void FMessageBox::cb_processClick (const FWidget*, FDataPtr data) // private methods of FMessageBox //---------------------------------------------------------------------- -void FMessageBox::init (int button0, int button1, int button2) +void FMessageBox::init() { calculateDimensions(); - if ( (button2 && ! button1) || (button1 && ! button0) ) + if ( (button_digit[2] && ! button_digit[1]) + || (button_digit[1] && ! button_digit[0]) ) { - button0 = button1 = button2 = 0; + button_digit[0] = button_digit[1] = button_digit[2] = 0; } - if ( button0 == 0 ) - button0 = FMessageBox::Ok; + if ( button_digit[0] == 0 ) + button_digit[0] = FMessageBox::Ok; - if ( button1 == 0 && button2 == 0 ) + if ( button_digit[1] == 0 && button_digit[2] == 0 ) num_buttons = 1; - else if ( button2 == 0 ) + else if ( button_digit[2] == 0 ) num_buttons = 2; else num_buttons = 3; - button_digit[0] = button0; - button_digit[1] = button1; - button_digit[2] = button2; - - allocation (button0, button1, button2); + allocation(); resizeButtons(); adjustButtons(); initCallbacks(); @@ -228,30 +230,30 @@ void FMessageBox::init (int button0, int button1, int button2) } //---------------------------------------------------------------------- -inline void FMessageBox::allocation (int button0, int button1, int button2) +inline void FMessageBox::allocation() { try { button[0] = new FButton (this); - button[0]->setText(button_text[button0]); + button[0]->setText(button_text[button_digit[0]]); button[0]->setPos(FPoint{3, int(getHeight()) - 4}, false); button[0]->setWidth(1, false); button[0]->setHeight(1, false); button[0]->setFocus(); - if ( button1 > 0 ) + if ( button_digit[1] > 0 ) { button[1] = new FButton(this); - button[1]->setText(button_text[button1]); + button[1]->setText(button_text[button_digit[1]]); button[1]->setPos(FPoint{17, int(getHeight()) - 4}, false); button[1]->setWidth(0, false); button[1]->setHeight(1, false); } - if ( button2 > 0 ) + if ( button_digit[2] > 0 ) { button[2] = new FButton(this); - button[2]->setText(button_text[button2]); + button[2]->setText(button_text[button_digit[2]]); button[2]->setPos(FPoint{32, int(getHeight()) - 4}, false); button[2]->setWidth(0, false); button[2]->setHeight(1, false); diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp index 8278f49d..2581ebe6 100644 --- a/src/foptiattr.cpp +++ b/src/foptiattr.cpp @@ -1501,13 +1501,13 @@ inline void FOptiAttr::change_current_color ( const FChar* const& term if ( term->fg_color != fg || frev ) { - color_str = FTermcap::encodeParameter(AF, ansi_fg); + color_str = FTermcap::encodeParameter(AF, ansi_fg, 0, 0, 0, 0, 0, 0, 0, 0); append_sequence (color_str); } if ( term->bg_color != bg || frev ) { - color_str = FTermcap::encodeParameter(AB, ansi_bg); + color_str = FTermcap::encodeParameter(AB, ansi_bg, 0, 0, 0, 0, 0, 0, 0, 0); append_sequence (color_str); } } @@ -1515,13 +1515,13 @@ inline void FOptiAttr::change_current_color ( const FChar* const& term { if ( term->fg_color != fg || frev ) { - color_str = FTermcap::encodeParameter(Sf, fg); + color_str = FTermcap::encodeParameter(Sf, fg, 0, 0, 0, 0, 0, 0, 0, 0); append_sequence (color_str); } if ( term->bg_color != bg || frev ) { - color_str = FTermcap::encodeParameter(Sb, bg); + color_str = FTermcap::encodeParameter(Sb, bg, 0, 0, 0, 0, 0, 0, 0, 0); append_sequence (color_str); } } @@ -1529,7 +1529,7 @@ inline void FOptiAttr::change_current_color ( const FChar* const& term { fg = vga2ansi(fg); bg = vga2ansi(bg); - color_str = FTermcap::encodeParameter(sp, fg, bg); + color_str = FTermcap::encodeParameter(sp, fg, bg, 0, 0, 0, 0, 0, 0, 0); append_sequence (color_str); } } diff --git a/src/foptimove.cpp b/src/foptimove.cpp index 8bef544c..88389cfd 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -288,7 +288,7 @@ void FOptiMove::set_column_address (const char cap[]) { if ( cap && FTermcap::isInitialized() ) { - const char* temp = FTermcap::encodeParameter(cap, 23); + const char* temp = FTermcap::encodeParameter(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); F_column_address.cap = cap; F_column_address.duration = capDuration (temp, 1); F_column_address.length = capDurationToLength (F_column_address.duration); @@ -306,7 +306,7 @@ void FOptiMove::set_row_address (const char cap[]) { if ( cap && FTermcap::isInitialized() ) { - const char* temp = FTermcap::encodeParameter(cap, 23); + const char* temp = FTermcap::encodeParameter(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); F_row_address.cap = cap; F_row_address.duration = capDuration (temp, 1); F_row_address.length = capDurationToLength (F_row_address.duration); @@ -324,7 +324,7 @@ void FOptiMove::set_parm_up_cursor (const char cap[]) { if ( cap && FTermcap::isInitialized() ) { - const char* temp = FTermcap::encodeParameter(cap, 23); + const char* temp = FTermcap::encodeParameter(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); F_parm_up_cursor.cap = cap; F_parm_up_cursor.duration = capDuration (temp, 1); F_parm_up_cursor.length = capDurationToLength (F_parm_up_cursor.duration); @@ -342,7 +342,7 @@ void FOptiMove::set_parm_down_cursor (const char cap[]) { if ( cap && FTermcap::isInitialized() ) { - const char* temp = FTermcap::encodeParameter(cap, 23); + const char* temp = FTermcap::encodeParameter(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); F_parm_down_cursor.cap = cap; F_parm_down_cursor.duration = capDuration (temp, 1); F_parm_down_cursor.length = capDurationToLength (F_parm_down_cursor.duration); @@ -360,7 +360,7 @@ void FOptiMove::set_parm_left_cursor (const char cap[]) { if ( cap && FTermcap::isInitialized() ) { - const char* temp = FTermcap::encodeParameter(cap, 23); + const char* temp = FTermcap::encodeParameter(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); F_parm_left_cursor.cap = cap; F_parm_left_cursor.duration = capDuration (temp, 1); F_parm_left_cursor.length = capDurationToLength (F_parm_left_cursor.duration); @@ -378,7 +378,7 @@ void FOptiMove::set_parm_right_cursor (const char cap[]) { if ( cap && FTermcap::isInitialized() ) { - const char* temp = FTermcap::encodeParameter(cap, 23); + const char* temp = FTermcap::encodeParameter(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); F_parm_right_cursor.cap = cap; F_parm_right_cursor.duration = capDuration (temp, 1); F_parm_right_cursor.length = capDurationToLength (F_parm_right_cursor.duration); @@ -396,7 +396,7 @@ void FOptiMove::set_erase_chars (const char cap[]) { if ( cap && FTermcap::isInitialized() ) { - const char* temp = FTermcap::encodeParameter(cap, 23); + const char* temp = FTermcap::encodeParameter(cap, 23, 0, 0, 0, 0, 0, 0, 0, 0); F_erase_chars.cap = cap; F_erase_chars.duration = capDuration (temp, 1); F_erase_chars.length = capDurationToLength (F_erase_chars.duration); @@ -414,7 +414,7 @@ void FOptiMove::set_repeat_char (const char cap[]) { if ( cap && FTermcap::isInitialized() ) { - const char* temp = FTermcap::encodeParameter(cap, ' ', 23); + const char* temp = FTermcap::encodeParameter(cap, ' ', 23, 0, 0, 0, 0, 0, 0, 0); F_repeat_char.cap = cap; F_repeat_char.duration = capDuration (temp, 1); F_repeat_char.length = capDurationToLength (F_repeat_char.duration); @@ -689,7 +689,7 @@ inline int FOptiMove::verticalMove (char move[], int from_y, int to_y) if ( move ) { std::strncpy ( move - , FTermcap::encodeParameter(F_row_address.cap, to_y) + , FTermcap::encodeParameter(F_row_address.cap, to_y, 0, 0, 0, 0, 0, 0, 0, 0) , BUF_SIZE ); move[BUF_SIZE - 1] = '\0'; } @@ -716,7 +716,7 @@ inline void FOptiMove::downMove ( char move[], int& vtime if ( move ) { std::strncpy ( move - , FTermcap::encodeParameter(F_parm_down_cursor.cap, num) + , FTermcap::encodeParameter(F_parm_down_cursor.cap, num, 0, 0, 0, 0, 0, 0, 0, 0) , BUF_SIZE ); move[BUF_SIZE - 1] = '\0'; } @@ -744,7 +744,7 @@ inline void FOptiMove::upMove ( char move[], int& vtime if ( move ) { std::strncpy ( move - , FTermcap::encodeParameter(F_parm_up_cursor.cap, num) + , FTermcap::encodeParameter(F_parm_up_cursor.cap, num, 0, 0, 0, 0, 0, 0, 0, 0) , BUF_SIZE ); move[BUF_SIZE - 1] = '\0'; } @@ -770,7 +770,7 @@ inline int FOptiMove::horizontalMove (char hmove[], int from_x, int to_x) { // Move to fixed column position1 std::strncat ( hmove - , FTermcap::encodeParameter(F_column_address.cap, to_x) + , FTermcap::encodeParameter(F_column_address.cap, to_x, 0, 0, 0, 0, 0, 0, 0, 0) , BUF_SIZE - std::strlen(hmove) - 1 ); hmove[BUF_SIZE - 1] = '\0'; htime = F_column_address.duration; @@ -793,7 +793,7 @@ inline void FOptiMove::rightMove ( char hmove[], int& htime if ( F_parm_right_cursor.cap && F_parm_right_cursor.duration < htime ) { std::strncpy ( hmove - , FTermcap::encodeParameter(F_parm_right_cursor.cap, num) + , FTermcap::encodeParameter(F_parm_right_cursor.cap, num, 0, 0, 0, 0, 0, 0, 0, 0) , BUF_SIZE - 1); hmove[BUF_SIZE - 1] = '\0'; htime = F_parm_right_cursor.duration; @@ -848,7 +848,7 @@ inline void FOptiMove::leftMove ( char hmove[], int& htime if ( F_parm_left_cursor.cap && F_parm_left_cursor.duration < htime ) { std::strncpy ( hmove - , FTermcap::encodeParameter(F_parm_left_cursor.cap, num) + , FTermcap::encodeParameter(F_parm_left_cursor.cap, num, 0, 0, 0, 0, 0, 0, 0, 0) , BUF_SIZE - 1); hmove[BUF_SIZE - 1] = '\0'; htime = F_parm_left_cursor.duration; diff --git a/src/fprogressbar.cpp b/src/fprogressbar.cpp index 829b8af9..e99b530a 100644 --- a/src/fprogressbar.cpp +++ b/src/fprogressbar.cpp @@ -38,8 +38,7 @@ namespace finalcut FProgressbar::FProgressbar(FWidget* parent) : FWidget{parent} { - unsetFocusable(); - setShadow(); + init(); } //---------------------------------------------------------------------- @@ -133,6 +132,13 @@ void FProgressbar::reset() // private methods of FProgressbar +//---------------------------------------------------------------------- +void FProgressbar::init() +{ + unsetFocusable(); + setShadow(); +} + //---------------------------------------------------------------------- void FProgressbar::draw() { diff --git a/src/fradiomenuitem.cpp b/src/fradiomenuitem.cpp index b3be0246..1496b916 100644 --- a/src/fradiomenuitem.cpp +++ b/src/fradiomenuitem.cpp @@ -36,14 +36,14 @@ namespace finalcut FRadioMenuItem::FRadioMenuItem (FWidget* parent) : FMenuItem{parent} { - init (parent); + init(); } //---------------------------------------------------------------------- FRadioMenuItem::FRadioMenuItem (const FString& txt, FWidget* parent) : FMenuItem{txt, parent} { - init (parent); + init(); } //---------------------------------------------------------------------- @@ -53,10 +53,11 @@ FRadioMenuItem::~FRadioMenuItem() // destructor // private methods of FRadioMenuItem //---------------------------------------------------------------------- -void FRadioMenuItem::init (FWidget* parent) +void FRadioMenuItem::init() { setCheckable(); setRadioButton(); + FWidget* parent = getParentWidget(); if ( ! parent ) return; diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp index cbc11031..5b0d722f 100644 --- a/src/fscrollview.cpp +++ b/src/fscrollview.cpp @@ -40,7 +40,7 @@ namespace finalcut FScrollView::FScrollView (FWidget* parent) : FWidget{parent} { - init(parent); + init(); } //---------------------------------------------------------------------- @@ -713,8 +713,10 @@ inline const FPoint FScrollView::getViewportCursorPos() } //---------------------------------------------------------------------- -void FScrollView::init (const FWidget* parent) +void FScrollView::init() { + const FWidget* parent = getParentWidget(); + assert ( parent != nullptr ); assert ( ! parent->isInstanceOf("FScrollView") ); diff --git a/src/fstatusbar.cpp b/src/fstatusbar.cpp index a2ec6983..a9e17f1b 100644 --- a/src/fstatusbar.cpp +++ b/src/fstatusbar.cpp @@ -38,7 +38,7 @@ namespace finalcut FStatusKey::FStatusKey(FWidget* parent) : FWidget{parent} { - init (parent); + init(); } //---------------------------------------------------------------------- @@ -47,7 +47,7 @@ FStatusKey::FStatusKey (FKey k, const FString& txt, FWidget* parent) , text{txt} , key{k} { - init (parent); + init(); } //---------------------------------------------------------------------- @@ -99,9 +99,10 @@ bool FStatusKey::setMouseFocus(bool enable) // private methods of FStatusKey //---------------------------------------------------------------------- -void FStatusKey::init (FWidget* parent) +void FStatusKey::init() { setGeometry (FPoint{1, 1}, FSize{1, 1}); + FWidget* parent = getParentWidget(); if ( parent && parent->isInstanceOf("FStatusBar") ) { diff --git a/src/fstring.cpp b/src/fstring.cpp index a2e9ffe7..7c3ba53a 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp @@ -980,13 +980,7 @@ bool FString::operator == (const FString& s) const //---------------------------------------------------------------------- bool FString::operator != (const FString& s) const { - if ( ! (string || s.string) ) - return false; - - if ( bool(string) != bool(s.string) || length != s.length ) - return true; - - return ( std::wcscmp(string, s.string) != 0 ); + return ! ( *this == s ); } //---------------------------------------------------------------------- diff --git a/src/fterm.cpp b/src/fterm.cpp index 931d2463..c7eb3e32 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -578,6 +578,12 @@ bool FTerm::isNewFont() return data->isNewFont(); } +//---------------------------------------------------------------------- +bool FTerm::isInitialized() +{ + return term_initialized; +} + //---------------------------------------------------------------------- bool FTerm::isCursorHideable() { @@ -1021,9 +1027,9 @@ void FTerm::setPalette (FColor index, int r, int g, int b) const int bb = (b * 1001) / 256; if ( Ic ) - color_str = FTermcap::encodeParameter(Ic, index, rr, gg, bb); + color_str = FTermcap::encodeParameter(Ic, index, rr, gg, bb, 0, 0, 0, 0, 0); else if ( Ip ) - color_str = FTermcap::encodeParameter(Ip, index, 0, 0, 0, rr, gg, bb); + color_str = FTermcap::encodeParameter(Ip, index, 0, 0, 0, rr, gg, bb, 0, 0); if ( color_str ) { @@ -1893,6 +1899,26 @@ inline bool FTerm::hasNoFontSettingOption() return false; } +//---------------------------------------------------------------------- +inline bool FTerm::isDefaultPaletteTheme() +{ + FStringList default_themes + { + "default8ColorPalette", + "default16ColorPalette", + "default16DarkColorPalette" + }; + + auto iter = std::find ( default_themes.begin() + , default_themes.end() + , getColorPaletteTheme()->getClassName() ); + + if ( iter == default_themes.end() ) // No default theme + return false; + + return true; +} + //---------------------------------------------------------------------- void FTerm::redefineColorPalette() { @@ -1904,16 +1930,23 @@ void FTerm::redefineColorPalette() resetColorMap(); saveColorMap(); + if ( getColorPaletteTheme().use_count() > 0 && ! isDefaultPaletteTheme() ) + { + // A user color palette theme is in use + getColorPaletteTheme()->setColorPalette(); + return; + } + if ( getStartOptions().dark_theme ) { - setColorPaletteTheme(&FTerm::setPalette); + setColorPaletteTheme(); } else { if ( getMaxColor() >= 16 ) - setColorPaletteTheme(&FTerm::setPalette); + setColorPaletteTheme(); else // 8 colors - setColorPaletteTheme(&FTerm::setPalette); + setColorPaletteTheme(); } } @@ -2468,7 +2501,7 @@ void FTerm::finish() // Switch to normal escape key mode disableApplicationEscKey(); - finishOSspecifics1(); + finishOSspecifics(); if ( isKdeTerminal() ) setKDECursor(fc::BlockCursor); @@ -2496,7 +2529,7 @@ void FTerm::finish() } //---------------------------------------------------------------------- -void FTerm::finishOSspecifics1() +void FTerm::finishOSspecifics() { #if defined(__linux__) linux->finish(); diff --git a/src/fterm_functions.cpp b/src/fterm_functions.cpp index d90f226c..646044c7 100644 --- a/src/fterm_functions.cpp +++ b/src/fterm_functions.cpp @@ -247,9 +247,11 @@ bool hasFullWidthSupports() if ( has_fullwidth_support == unknown_fullwidth_support ) { + if ( ! FTerm::isInitialized() ) + return true; // Assume that it is a modern terminal with full-width support + if ( FTerm::isCygwinTerminal() || FTerm::isTeraTerm() - || FTerm::isRxvtTerminal() || FTerm::isFreeBSDTerm() || FTerm::isNetBSDTerm() || FTerm::isOpenBSDTerm() diff --git a/src/ftermxterminal.cpp b/src/ftermxterminal.cpp index c120e63a..56c6c8d3 100644 --- a/src/ftermxterminal.cpp +++ b/src/ftermxterminal.cpp @@ -841,10 +841,10 @@ void FTermXTerminal::enableXTermMouse() fsystem = FTerm::getFSystem(); FTerm::putstring (CSI "?1001s" // save old highlight mouse tracking - CSI "?1000h" // enable x11 mouse tracking - CSI "?1002h" // enable cell motion mouse tracking - CSI "?1015h" // enable urxvt mouse mode - CSI "?1006h"); // enable SGR mouse mode + CSI "?1000;" // enable x11 mouse tracking + "1002;" // enable cell motion mouse tracking + "1015;" // enable urxvt mouse mode + "1006h"); // enable SGR mouse mode std::fflush(stdout); mouse_support = true; } @@ -857,10 +857,10 @@ void FTermXTerminal::disableXTermMouse() if ( ! mouse_support ) return; // The mouse was already deactivated - FTerm::putstring (CSI "?1006l" // disable SGR mouse mode - CSI "?1015l" // disable urxvt mouse mode - CSI "?1002l" // disable cell motion mouse tracking - CSI "?1000l" // disable x11 mouse tracking + FTerm::putstring (CSI "?1006;" // disable SGR mouse mode + "1015;" // disable urxvt mouse mode + "1002;" // disable cell motion mouse tracking + "1000l" // disable x11 mouse tracking CSI "?1001r"); // restore old highlight mouse tracking std::fflush(stdout); mouse_support = false; diff --git a/src/fvterm.cpp b/src/fvterm.cpp index aaf33999..2db393dc 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -2502,7 +2502,7 @@ void FVTerm::printFullWidthPaddingCharacter ( uInt& x, uInt y if ( le ) appendOutputBuffer (le); else if ( RI ) - appendOutputBuffer (FTermcap::encodeParameter(RI, 1)); + appendOutputBuffer (FTermcap::encodeParameter(RI, 1, 0, 0, 0, 0, 0, 0, 0, 0)); else { skipPaddingCharacter (x, y, prev_char); @@ -2542,7 +2542,7 @@ void FVTerm::printHalfCovertFullWidthCharacter ( uInt& x, uInt y if ( le ) appendOutputBuffer (le); else if ( RI ) - appendOutputBuffer (FTermcap::encodeParameter(RI, 1)); + appendOutputBuffer (FTermcap::encodeParameter(RI, 1, 0, 0, 0, 0, 0, 0, 0, 0)); if ( le || RI ) { @@ -2614,7 +2614,7 @@ FVTerm::exit_state FVTerm::eraseCharacters ( uInt& x, uInt xmax, uInt y && (ut || normal) ) { appendAttributes (print_char); - appendOutputBuffer (FTermcap::encodeParameter(ec, whitespace)); + appendOutputBuffer (FTermcap::encodeParameter(ec, whitespace, 0, 0, 0, 0, 0, 0, 0, 0)); if ( x + whitespace - 1 < xmax || draw_trailing_ws ) setTermXY (int(x + whitespace), int(y)); @@ -2679,7 +2679,7 @@ FVTerm::exit_state FVTerm::repeatCharacter (uInt& x, uInt xmax, uInt y) newFontChanges (print_char); charsetChanges (print_char); appendAttributes (print_char); - appendOutputBuffer (FTermcap::encodeParameter(rp, print_char->ch, repetitions)); + appendOutputBuffer (FTermcap::encodeParameter(rp, print_char->ch, repetitions, 0, 0, 0, 0, 0, 0, 0)); term_pos->x_ref() += int(repetitions); x = x + repetitions - 1; } @@ -3062,7 +3062,7 @@ int FVTerm::appendLowerRight (FChar*& screen_char) if ( IC ) { - appendOutputBuffer (FTermcap::encodeParameter(IC, 1)); + appendOutputBuffer (FTermcap::encodeParameter(IC, 1, 0, 0, 0, 0, 0, 0, 0, 0)); appendChar (screen_char); } else if ( im && ei ) diff --git a/src/fwidget.cpp b/src/fwidget.cpp index fdbbcc66..3fc74c42 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -1257,6 +1257,12 @@ bool FWidget::isChildPrintArea() const return false; } +//---------------------------------------------------------------------- +bool FWidget::isDesktopInitialized() const +{ + return ( root_widget ) ? root_widget->init_desktop : false; +} + //---------------------------------------------------------------------- void FWidget::setStatusBar (FStatusBar* sbar) { @@ -1774,6 +1780,10 @@ void FWidget::initRootWidget() return; } + // Initialize default widget colors + // (before terminal detection and root_widget is set) + initColorTheme(); + // Root widget basic initialization root_widget = this; show_root_widget = nullptr; @@ -1783,9 +1793,6 @@ void FWidget::initRootWidget() // Determine width and height of the terminal determineDesktopSize(); - - // Initialize default widget colors (before terminal detection) - initColorTheme(); } //---------------------------------------------------------------------- @@ -2057,11 +2064,35 @@ void FWidget::drawChildren() } } +//---------------------------------------------------------------------- +inline bool FWidget::isDefaultTheme() +{ + FStringList default_themes + { + "default8ColorTheme", + "default16ColorTheme", + "default8ColorDarkTheme", + "default16ColorDarkTheme" + }; + + auto iter = std::find ( default_themes.begin() + , default_themes.end() + , getColorTheme()->getClassName() ); + + if ( iter == default_themes.end() ) // No default theme + return false; + + return true; +} + //---------------------------------------------------------------------- void FWidget::initColorTheme() { // Sets the default color theme + if ( getColorTheme().use_count() > 0 && ! isDefaultTheme() ) + return; // A user theme is in use + if ( FStartOptions::getFStartOptions().dark_theme ) { if ( FTerm::getMaxColor() < 16 ) // for 8 color mode @@ -2069,7 +2100,7 @@ void FWidget::initColorTheme() else setColorTheme(); } - else + else // Default theme { if ( FTerm::getMaxColor() < 16 ) // for 8 color mode setColorTheme(); diff --git a/src/fwidget_functions.cpp b/src/fwidget_functions.cpp index d97426d7..a0d1dc70 100644 --- a/src/fwidget_functions.cpp +++ b/src/fwidget_functions.cpp @@ -150,7 +150,7 @@ void drawShadow (FWidget* w) if ( w->flags.trans_shadow ) drawTransparentShadow (w); // transparent shadow - else + else if ( w->flags.shadow ) drawBlockShadow (w); // non-transparent shadow } diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index 11a8d648..db0592a4 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -150,7 +150,7 @@ class FApplication : public FWidget typedef std::deque FEventQueue; // Methods - void init (uInt64, uInt64); + void init(); static void setTerminalEncoding (const FString&); static void setLogFile (const FString&); static void cmd_options (const int&, char*[]); diff --git a/src/include/final/fbusyindicator.h b/src/include/final/fbusyindicator.h index 9fb39bf8..761194ad 100644 --- a/src/include/final/fbusyindicator.h +++ b/src/include/final/fbusyindicator.h @@ -96,6 +96,7 @@ class FBusyIndicator : public FToolTip static constexpr std::size_t TIMER = 200; // Methods + void init(); void createIndicatorText(); // Event handler diff --git a/src/include/final/fcheckmenuitem.h b/src/include/final/fcheckmenuitem.h index e7e006ec..e2f795e2 100644 --- a/src/include/final/fcheckmenuitem.h +++ b/src/include/final/fcheckmenuitem.h @@ -82,7 +82,7 @@ class FCheckMenuItem : public FMenuItem private: // Methods - void init (FWidget*); + void init(); void processToggle(); void processClicked() override; }; diff --git a/src/include/final/fmenu.h b/src/include/final/fmenu.h index 282143cf..69be88c6 100644 --- a/src/include/final/fmenu.h +++ b/src/include/final/fmenu.h @@ -172,7 +172,7 @@ class FMenu : public FWindow, public FMenuList bool isMouseOverMenuBar (const FPoint&); // Methods - void init(FWidget*); + void init(); void initCallbacks(); void calculateDimensions(); void adjustItems(); diff --git a/src/include/final/fmenuitem.h b/src/include/final/fmenuitem.h index b2888e47..7cccde36 100644 --- a/src/include/final/fmenuitem.h +++ b/src/include/final/fmenuitem.h @@ -154,7 +154,7 @@ class FMenuItem : public FWidget FMenuList* getFMenuList (FWidget&); // Methods - void init (FWidget*); + void init(); void updateSuperMenuDimensions(); void processEnable(); void processDisable(); diff --git a/src/include/final/fmessagebox.h b/src/include/final/fmessagebox.h index 7ee09d56..b5db8d6c 100644 --- a/src/include/final/fmessagebox.h +++ b/src/include/final/fmessagebox.h @@ -138,8 +138,8 @@ class FMessageBox : public FDialog private: // Methods - void init (int, int, int); - void allocation (int, int, int); + void init(); + void allocation(); void deallocation(); void initCallbacks(); void calculateDimensions(); diff --git a/src/include/final/fprogressbar.h b/src/include/final/fprogressbar.h index b7630ea3..d77b62aa 100644 --- a/src/include/final/fprogressbar.h +++ b/src/include/final/fprogressbar.h @@ -93,6 +93,7 @@ class FProgressbar : public FWidget static constexpr std::size_t NOT_SET = static_cast(-1); // Methods + void init(); void draw() override; void drawProgressLabel(); void drawProgressBar(); diff --git a/src/include/final/fradiomenuitem.h b/src/include/final/fradiomenuitem.h index ad14547c..d98259cc 100644 --- a/src/include/final/fradiomenuitem.h +++ b/src/include/final/fradiomenuitem.h @@ -82,7 +82,7 @@ class FRadioMenuItem : public FMenuItem private: // Methods - void init (FWidget*); + void init(); void processToggle(); void processClicked() override; }; diff --git a/src/include/final/fscrollview.h b/src/include/final/fscrollview.h index 83cef868..1cca1927 100644 --- a/src/include/final/fscrollview.h +++ b/src/include/final/fscrollview.h @@ -160,7 +160,7 @@ class FScrollView : public FWidget const FPoint getViewportCursorPos(); // Methods - void init (const FWidget*); + void init(); void mapKeyFunctions(); void calculateScrollbarPos(); template diff --git a/src/include/final/fstatusbar.h b/src/include/final/fstatusbar.h index f9b3f961..db45f601 100644 --- a/src/include/final/fstatusbar.h +++ b/src/include/final/fstatusbar.h @@ -109,7 +109,7 @@ class FStatusKey : public FWidget private: // Methods - void init (FWidget*); + void init(); void processActivate(); FStatusBar* getConnectedStatusbar() const; void setConnectedStatusbar (FStatusBar*); diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h index d35e8b7e..8874abd8 100644 --- a/src/include/final/fterm.h +++ b/src/include/final/fterm.h @@ -241,6 +241,7 @@ class FTerm final static bool isScreenTerm(); static bool isTmuxTerm(); static bool isNewFont(); + static bool isInitialized(); static bool isCursorHideable(); static bool hasChangedTermSize(); static bool hasShadowCharacter(); @@ -277,7 +278,7 @@ class FTerm final static void resetColorMap(); static void setPalette (FColor, int, int, int); template - static void setColorPaletteTheme (const FSetPalette&); + static void setColorPaletteTheme (const FSetPalette& = &FTerm::setPalette); static void setBeep (int, int); static void resetBeep(); static void beep(); @@ -332,6 +333,7 @@ class FTerm final static void init_tab_quirks(); static void init_captureFontAndTitle(); static bool hasNoFontSettingOption(); + static bool isDefaultPaletteTheme(); static void redefineColorPalette(); static void restoreColorPalette(); static void setInsertCursorStyle(); @@ -355,7 +357,7 @@ class FTerm final void initTermspecifics(); void initBaudRate(); void finish(); - void finishOSspecifics1(); + void finishOSspecifics(); void finish_encoding(); void destroyColorPaletteTheme(); static void printExitMessage(); diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index f78273bc..d9af1d0a 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -368,6 +368,7 @@ class FWidget : public FVTerm, public FObject // Inquiry bool isChildPrintArea() const; + bool isDesktopInitialized() const; // Mutators virtual void setStatusBar (FStatusBar*); @@ -467,6 +468,7 @@ class FWidget : public FVTerm, public FObject virtual void draw(); void drawWindows(); void drawChildren(); + static bool isDefaultTheme(); static void initColorTheme(); void destroyColorTheme(); void setStatusbarText (bool); @@ -595,6 +597,7 @@ struct FWidget::FCallbackData // non-member function forward declarations // implemented in fwidget_functions.cpp //---------------------------------------------------------------------- +void initWidget (FWidget*); void detectTermSize(); bool isFocusNextKey (const FKey); bool isFocusPrevKey (const FKey); diff --git a/src/include/final/fwidgetcolors.h b/src/include/final/fwidgetcolors.h index 425cffa9..b839aecf 100644 --- a/src/include/final/fwidgetcolors.h +++ b/src/include/final/fwidgetcolors.h @@ -54,6 +54,7 @@ class FWidgetColors virtual ~FWidgetColors(); // Method + virtual const FString getClassName() const; virtual void setColorTheme() = 0; // Data members @@ -145,6 +146,11 @@ class FWidgetColors FColor progressbar_bg{fc::Default}; }; +// FWidgetColors inline functions +//---------------------------------------------------------------------- +inline const FString FWidgetColors::getClassName() const +{ return "FWidgetColors"; } + /* Inheritance diagram * ═══════════════════ @@ -173,9 +179,15 @@ class default8ColorTheme final : public FWidgetColors ~default8ColorTheme() override; // Method + const FString getClassName() const override; void setColorTheme() override; }; +// default8ColorTheme inline functions +//---------------------------------------------------------------------- +inline const FString default8ColorTheme::getClassName() const +{ return "default8ColorTheme"; } + /* Inheritance diagram * ═══════════════════ @@ -204,9 +216,15 @@ class default16ColorTheme final : public FWidgetColors ~default16ColorTheme() override; // Method + const FString getClassName() const override; void setColorTheme() override; }; +// default16ColorTheme inline functions +//---------------------------------------------------------------------- +inline const FString default16ColorTheme::getClassName() const +{ return "default16ColorTheme"; } + /* Inheritance diagram * ═══════════════════ @@ -235,9 +253,15 @@ class default8ColorDarkTheme final : public FWidgetColors ~default8ColorDarkTheme() override; // Method + const FString getClassName() const override; void setColorTheme() override; }; +// default8ColorDarkTheme inline functions +//---------------------------------------------------------------------- +inline const FString default8ColorDarkTheme::getClassName() const +{ return "default8ColorDarkTheme"; } + /* Inheritance diagram * ═══════════════════ @@ -266,9 +290,15 @@ class default16ColorDarkTheme final : public FWidgetColors ~default16ColorDarkTheme() override; // Method + const FString getClassName() const override; void setColorTheme() override; }; +// default16ColorDarkTheme inline functions +//---------------------------------------------------------------------- +inline const FString default16ColorDarkTheme::getClassName() const +{ return "default16ColorDarkTheme"; } + } // namespace finalcut #endif // FWIDGETCOLORS_H diff --git a/test/ftermdetection-test.cpp b/test/ftermdetection-test.cpp index 20254db6..4eb56e84 100644 --- a/test/ftermdetection-test.cpp +++ b/test/ftermdetection-test.cpp @@ -310,7 +310,7 @@ void FTermDetectionTest::rxvtTest() CPPUNIT_ASSERT ( detect.canDisplay256Colors() ); CPPUNIT_ASSERT ( detect.hasTerminalDetection() ); CPPUNIT_ASSERT ( ! detect.hasSetCursorStyleSupport() ); - CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "rxvt-cygwin-native") ; + CPPUNIT_ASSERT_CSTRING ( detect.getTermType(), "rxvt-16color") ; printConEmuDebug(); closeConEmuStdStreams(); From 53ba96504ff3b800b80ca33e945cb5267745eece Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Wed, 8 Jul 2020 21:32:47 +0200 Subject: [PATCH 09/28] New data wrapper class FData and minor text changes --- ChangeLog | 3 ++ Makefile.am | 4 ++ debian/control | 6 +-- debian/copyright | 6 +-- doc/Makefile.am | 47 ++++++++++++++++++++++ doc/class_template.cpp | 12 +++--- doc/class_template.h | 12 +++--- doc/faq.md | 2 +- doc/framebuffer.txt | 2 +- doc/user-theme.md | 9 ++++- examples/7segment.cpp | 12 +++--- examples/Makefile.am | 2 +- examples/background-color.cpp | 12 +++--- examples/busy.cpp | 12 +++--- examples/calculator.cpp | 12 +++--- examples/checklist.cpp | 12 +++--- examples/choice.cpp | 12 +++--- examples/dialog.cpp | 12 +++--- examples/event-log.cpp | 12 +++--- examples/fullwidth-character.cpp | 12 +++--- examples/hello.cpp | 12 +++--- examples/input-dialog.cpp | 12 +++--- examples/keyboard.cpp | 12 +++--- examples/listbox.cpp | 12 +++--- examples/listview.cpp | 12 +++--- examples/mandelbrot.cpp | 12 +++--- examples/menu.cpp | 12 +++--- examples/mouse.cpp | 12 +++--- examples/opti-move.cpp | 12 +++--- examples/rotozoomer.cpp | 12 +++--- examples/scrollview.cpp | 12 +++--- examples/string-operations.cpp | 12 +++--- examples/term-attributes.cpp | 12 +++--- examples/termcap.cpp | 12 +++--- examples/timer.cpp | 12 +++--- examples/transparent.cpp | 12 +++--- examples/treeview.cpp | 12 +++--- examples/ui.cpp | 16 ++++---- examples/watch.cpp | 12 +++--- examples/windows.cpp | 12 +++--- fonts/Makefile.am | 4 ++ src/Makefile.am | 8 ++-- src/Makefile.clang | 2 +- src/Makefile.gcc | 2 +- src/fapplication.cpp | 14 +++---- src/fbusyindicator.cpp | 12 +++--- src/fbutton.cpp | 12 +++--- src/fbuttongroup.cpp | 12 +++--- src/fcharmap.cpp | 12 +++--- src/fcheckbox.cpp | 12 +++--- src/fcheckmenuitem.cpp | 12 +++--- src/fcolorpalette.cpp | 12 +++--- src/fcombobox.cpp | 12 +++--- src/fdialog.cpp | 12 +++--- src/fdialoglistmenu.cpp | 12 +++--- src/fevent.cpp | 12 +++--- src/ffiledialog.cpp | 12 +++--- src/fkey_map.cpp | 12 +++--- src/fkeyboard.cpp | 12 +++--- src/flabel.cpp | 12 +++--- src/flineedit.cpp | 12 +++--- src/flistbox.cpp | 12 +++--- src/flistview.cpp | 12 +++--- src/flog.cpp | 12 +++--- src/flogger.cpp | 12 +++--- src/fmenu.cpp | 12 +++--- src/fmenubar.cpp | 12 +++--- src/fmenuitem.cpp | 12 +++--- src/fmenulist.cpp | 12 +++--- src/fmessagebox.cpp | 12 +++--- src/fmouse.cpp | 12 +++--- src/fobject.cpp | 12 +++--- src/foptiattr.cpp | 12 +++--- src/foptimove.cpp | 12 +++--- src/fpoint.cpp | 12 +++--- src/fprogressbar.cpp | 12 +++--- src/fradiobutton.cpp | 12 +++--- src/fradiomenuitem.cpp | 12 +++--- src/frect.cpp | 12 +++--- src/fscrollbar.cpp | 12 +++--- src/fscrollview.cpp | 12 +++--- src/fsize.cpp | 12 +++--- src/fspinbox.cpp | 12 +++--- src/fstartoptions.cpp | 12 +++--- src/fstatusbar.cpp | 12 +++--- src/fstring.cpp | 12 +++--- src/fstringstream.cpp | 12 +++--- src/fswitch.cpp | 12 +++--- src/fsystem.cpp | 12 +++--- src/fsystemimpl.cpp | 12 +++--- src/fterm.cpp | 12 +++--- src/fterm_functions.cpp | 12 +++--- src/ftermbuffer.cpp | 12 +++--- src/ftermcap.cpp | 12 +++--- src/ftermcapquirks.cpp | 12 +++--- src/ftermdebugdata.cpp | 12 +++--- src/ftermdetection.cpp | 12 +++--- src/ftermfreebsd.cpp | 12 +++--- src/ftermios.cpp | 12 +++--- src/ftermlinux.cpp | 12 +++--- src/ftermopenbsd.cpp | 12 +++--- src/ftermxterminal.cpp | 12 +++--- src/ftextview.cpp | 12 +++--- src/ftogglebutton.cpp | 12 +++--- src/ftooltip.cpp | 12 +++--- src/fvterm.cpp | 12 +++--- src/fwidget.cpp | 18 +++------ src/fwidget_functions.cpp | 12 +++--- src/fwidgetcolors.cpp | 12 +++--- src/fwindow.cpp | 12 +++--- src/include/final/emptyfstring.h | 12 +++--- src/include/final/fapplication.h | 12 +++--- src/include/final/fbusyindicator.h | 12 +++--- src/include/final/fbutton.h | 12 +++--- src/include/final/fbuttongroup.h | 12 +++--- src/include/final/fc.h | 12 +++--- src/include/final/fcharmap.h | 12 +++--- src/include/final/fcheckbox.h | 12 +++--- src/include/final/fcheckmenuitem.h | 12 +++--- src/include/final/fcolorpair.h | 12 +++--- src/include/final/fcolorpalette.h | 12 +++--- src/include/final/fcombobox.h | 12 +++--- src/include/final/fdata.h | 62 +++++++++++++++++++++++++++++ src/include/final/fdialog.h | 12 +++--- src/include/final/fdialoglistmenu.h | 12 +++--- src/include/final/fevent.h | 12 +++--- src/include/final/ffiledialog.h | 12 +++--- src/include/final/final.h | 16 ++++---- src/include/final/fkey_map.h | 12 +++--- src/include/final/fkeyboard.h | 12 +++--- src/include/final/flabel.h | 12 +++--- src/include/final/flineedit.h | 12 +++--- src/include/final/flistbox.h | 12 +++--- src/include/final/flistview.h | 12 +++--- src/include/final/flog.h | 12 +++--- src/include/final/flogger.h | 12 +++--- src/include/final/fmenu.h | 12 +++--- src/include/final/fmenubar.h | 12 +++--- src/include/final/fmenuitem.h | 12 +++--- src/include/final/fmenulist.h | 12 +++--- src/include/final/fmessagebox.h | 12 +++--- src/include/final/fmouse.h | 12 +++--- src/include/final/fobject.h | 12 +++--- src/include/final/foptiattr.h | 12 +++--- src/include/final/foptimove.h | 12 +++--- src/include/final/fpoint.h | 12 +++--- src/include/final/fprogressbar.h | 12 +++--- src/include/final/fradiobutton.h | 12 +++--- src/include/final/fradiomenuitem.h | 12 +++--- src/include/final/frect.h | 12 +++--- src/include/final/fscrollbar.h | 12 +++--- src/include/final/fscrollview.h | 12 +++--- src/include/final/fsize.h | 12 +++--- src/include/final/fspinbox.h | 12 +++--- src/include/final/fstartoptions.h | 12 +++--- src/include/final/fstatusbar.h | 12 +++--- src/include/final/fstring.h | 12 +++--- src/include/final/fstringstream.h | 12 +++--- src/include/final/fstyle.h | 12 +++--- src/include/final/fswitch.h | 12 +++--- src/include/final/fsystem.h | 12 +++--- src/include/final/fsystemimpl.h | 12 +++--- src/include/final/fterm.h | 12 +++--- src/include/final/ftermbuffer.h | 12 +++--- src/include/final/ftermcap.h | 12 +++--- src/include/final/ftermcapquirks.h | 12 +++--- src/include/final/ftermdata.h | 12 +++--- src/include/final/ftermdebugdata.h | 12 +++--- src/include/final/ftermdetection.h | 12 +++--- src/include/final/ftermfreebsd.h | 12 +++--- src/include/final/ftermios.h | 12 +++--- src/include/final/ftermlinux.h | 12 +++--- src/include/final/ftermopenbsd.h | 12 +++--- src/include/final/ftermxterminal.h | 12 +++--- src/include/final/ftextview.h | 12 +++--- src/include/final/ftogglebutton.h | 12 +++--- src/include/final/ftooltip.h | 12 +++--- src/include/final/ftypes.h | 15 +++---- src/include/final/fvterm.h | 12 +++--- src/include/final/fwidget.h | 15 ++++--- src/include/final/fwidgetcolors.h | 12 +++--- src/include/final/fwindow.h | 12 +++--- src/include/final/sgr_optimizer.h | 12 +++--- src/sgr_optimizer.cpp | 12 +++--- test/Makefile.clang | 2 +- test/Makefile.gcc | 2 +- test/conemu.h | 12 +++--- test/fcolorpair-test.cpp | 12 +++--- test/fkeyboard-test.cpp | 12 +++--- test/flogger-test.cpp | 12 +++--- test/fmouse-test.cpp | 12 +++--- test/fobject-test.cpp | 12 +++--- test/foptiattr-test.cpp | 12 +++--- test/foptimove-test.cpp | 12 +++--- test/fpoint-test.cpp | 12 +++--- test/frect-test.cpp | 12 +++--- test/fsize-test.cpp | 12 +++--- test/fstring-test.cpp | 12 +++--- test/fstringstream-test.cpp | 12 +++--- test/fstyle-test.cpp | 12 +++--- test/ftermcapquirks-test.cpp | 12 +++--- test/ftermdata-test.cpp | 12 +++--- test/ftermdetection-test.cpp | 12 +++--- test/ftermfreebsd-test.cpp | 12 +++--- test/ftermlinux-test.cpp | 12 +++--- test/ftermopenbsd-test.cpp | 12 +++--- 206 files changed, 1293 insertions(+), 1172 deletions(-) create mode 100644 src/include/final/fdata.h diff --git a/ChangeLog b/ChangeLog index 601a0bec..29ac2690 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2020-07-08 Markus Gans + * New data wrapper class FData + 2020-07-06 Markus Gans * Add a document that describes how to create user themes diff --git a/Makefile.am b/Makefile.am index 0b88c7dc..3931c23a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,3 +19,7 @@ docdir = ${datadir}/doc/${PACKAGE} doc_DATA = AUTHORS COPYING COPYING.LESSER ChangeLog test: check + +uninstall-hook: + if test -d ${docdir}; then rmdir ${docdir}; fi + diff --git a/debian/control b/debian/control index fdc3da05..072da752 100644 --- a/debian/control +++ b/debian/control @@ -27,7 +27,7 @@ Suggests: , ncurses-term , vim-common Description: Shared library for the final cut widget toolkit - The Final Cut is a class library and widget toolkit with full mouse + FINAL CUT is a class library and widget toolkit with full mouse support for creating a text-based user interface. The library supports the programmer to develop an application for the text console. It allows the simultaneous handling of multiple windows on the screen. @@ -50,7 +50,7 @@ Depends: , libtinfo-dev , libncurses5-dev Description: Developer's library for the final cut widget toolkit - The Final Cut is a class library and widget toolkit with full mouse + FINAL CUT is a class library and widget toolkit with full mouse support for creating a text-based user interface. The library supports the programmer to develop an application for the text console. It allows the simultaneous handling of multiple windows on the screen. @@ -74,7 +74,7 @@ Depends: , libtinfo-dev , libncurses5-dev Description: Test and example programs for the final cut widget toolkit - The Final Cut is a class library and widget toolkit with full mouse + FINAL CUT is a class library and widget toolkit with full mouse support for creating a text-based user interface. The library supports the programmer to develop an application for the text console. It allows the simultaneous handling of multiple windows on the screen. diff --git a/debian/copyright b/debian/copyright index 7330989e..11eb2172 100644 --- a/debian/copyright +++ b/debian/copyright @@ -7,13 +7,13 @@ Copyright: 2017, Markus Gans License: LGPL-3 License: LGPL-3 - The Final Cut is free software: you can redistribute it and/or modify + FINAL CUT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. . - The Final Cut is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of + FINAL CUT is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. . diff --git a/doc/Makefile.am b/doc/Makefile.am index 565853d0..d8ec9405 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -5,6 +5,7 @@ docdir = ${datadir}/doc/${PACKAGE} EXTRA_DIST = \ + benchmark.md \ build_openbsd.txt \ build_solaris.txt \ calendar-draft.png \ @@ -16,9 +17,21 @@ EXTRA_DIST = \ console_ioctl-manual.sh \ faq.md \ fileopen-dialog.png \ + final-cut-application-structure.svg \ first-steps.md \ + first-steps_callback-function.cpp.png \ + first-steps_callback-lambda.cpp.png \ + first-steps_callback-method.cpp.png \ + first-steps_dialog.cpp.png \ + first-steps_emit-signal.cpp.png \ + first-steps_memory.cpp.png \ + first-steps_scrollview.cpp.png \ + first-steps_size-adjustment.cpp.png \ + first-steps_timer.cpp.png \ + first-steps_user-event.cpp.png \ framebuffer.txt \ Mandelbrot.png \ + mouse-control.md \ ncurses.supp \ newfont1.png \ newfont2.png \ @@ -31,13 +44,24 @@ EXTRA_DIST = \ terminfo-manual.sh \ textview.png \ TODO \ + user-theme.md \ + user-theme.png \ + user-theme-bee-palette.svg \ + user-theme-fc16-dark-palette.svg \ + user-theme-fc16-palette.svg \ + user-theme-fc8-palette.svg \ + user-theme-vga-palette.svg \ vga.txt \ vt100_line_drawing_graphics.png \ virtual-terminal.txt \ + widget-coordinates.svg \ + widget-geometry.svg \ + widget-lengths.svg \ xterm.txt \ xgraphics doc_DATA = \ + benchmark.md \ build_openbsd.txt \ build_solaris.txt \ calendar-draft.png \ @@ -49,9 +73,21 @@ doc_DATA = \ console_ioctl-manual.sh \ faq.md \ fileopen-dialog.png \ + final-cut-application-structure.svg \ first-steps.md \ + first-steps_callback-function.cpp.png \ + first-steps_callback-lambda.cpp.png \ + first-steps_callback-method.cpp.png \ + first-steps_dialog.cpp.png \ + first-steps_emit-signal.cpp.png \ + first-steps_memory.cpp.png \ + first-steps_scrollview.cpp.png \ + first-steps_size-adjustment.cpp.png \ + first-steps_timer.cpp.png \ + first-steps_user-event.cpp.png \ framebuffer.txt \ Mandelbrot.png \ + mouse-control.md \ ncurses.supp \ newfont1.png \ newfont2.png \ @@ -64,8 +100,19 @@ doc_DATA = \ terminfo-manual.sh \ textview.png \ TODO \ + user-theme.md \ + user-theme.png \ + user-theme-bee-palette.svg \ + user-theme-fc16-dark-palette.svg \ + user-theme-fc16-palette.svg \ + user-theme-fc8-palette.svg \ + user-theme-vga-palette.svg \ vga.txt \ vt100_line_drawing_graphics.png \ virtual-terminal.txt \ + widget-coordinates.svg \ + widget-geometry.svg \ + widget-lengths.svg \ xterm.txt \ xgraphics + diff --git a/doc/class_template.cpp b/doc/class_template.cpp index f06e8d20..f7618712 100644 --- a/doc/class_template.cpp +++ b/doc/class_template.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fclassname.cpp - [brief description] * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright [year] [Maintainer] * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/doc/class_template.h b/doc/class_template.h index 12c19272..c3cc4325 100644 --- a/doc/class_template.h +++ b/doc/class_template.h @@ -1,17 +1,17 @@ /*********************************************************************** * fclassname.h - [brief description] * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright [year] [Maintainer] * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/doc/faq.md b/doc/faq.md index edb0b5bc..47164336 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -6,7 +6,7 @@ Frequently Asked Questions What is FINAL CUT? ------------------ -The FINAL CUT is a [C++](https://en.wikipedia.org/wiki/C%2B%2B) class library +FINAL CUT is a [C++](https://en.wikipedia.org/wiki/C%2B%2B) class library and a widget toolkit with full mouse support for creating a text-based user interface. It's based on the Termcap library and has its own cursor optimization and window management. diff --git a/doc/framebuffer.txt b/doc/framebuffer.txt index 4e11667a..8d6269a1 100644 --- a/doc/framebuffer.txt +++ b/doc/framebuffer.txt @@ -1,7 +1,7 @@ Framebuffer =========== -The Final Cut determines the used number of bits per pixel (bpp) +FINAL CUT determines the used number of bits per pixel (bpp) for Linux framebuffer console to determine whether 16 (or more) different background colors can be displayed. Therefore your user needs read-access to the framebuffer device (/dev/fb0 or /dev/fb/0). diff --git a/doc/user-theme.md b/doc/user-theme.md index b3f699b8..483b6a60 100644 --- a/doc/user-theme.md +++ b/doc/user-theme.md @@ -247,6 +247,7 @@ sequences. VGA palette
Figure 1. VGA palette
+

The FINAL CUT eight-color palette `default8ColorPalette` is optimized for the eight-color widget theme `default8ColorTheme`. It is for terminals @@ -255,6 +256,7 @@ that cannot display more than eight colors. FINAL CUT 8-color palette
Figure 2. FINAL CUT 8-color palette
+

The FINAL CUT palette `default16ColorPalette` is the default 16-color palette. It is optimized for the widget color theme `default16ColorTheme`. @@ -262,6 +264,7 @@ palette. It is optimized for the widget color theme `default16ColorTheme`. FINAL CUT 16-color palette
Figure 3. FINAL CUT 16-color palette
+

The second 16-color palette in FINAL CUT is for the dark theme. It was adjusted for the widget color themes `default8ColorDarkTheme` and @@ -270,6 +273,7 @@ adjusted for the widget color themes `default8ColorDarkTheme` and FINAL CUT 16-color dark palette
Figure 4. FINAL CUT 16-color dark palette
+

In the following example, we want to create the palette them `BeeColorPalette`. For this purpose, we generate an include file again, @@ -278,6 +282,7 @@ in which we implement the new palette class. Bee palette
Figure 6. Bee palette
+

**File:** *color-palette-theme.h* ```cpp @@ -339,7 +344,7 @@ your application, the object instances of both classes are created and set. User theme example
Figure 7. User theme example
- +

**File:** *theme.cpp* ```cpp @@ -432,5 +437,5 @@ After entering the source code in *theme.cpp* you can compile the above program with gcc: ```cpp g++ -O2 -lfinal -std=c++11 theme.cpp -o theme - ``` + diff --git a/examples/7segment.cpp b/examples/7segment.cpp index 8cf9cdbb..b46eee0d 100644 --- a/examples/7segment.cpp +++ b/examples/7segment.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * 7segment.cpp - Seven-segment display * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/Makefile.am b/examples/Makefile.am index 6c46137f..e8a33ee2 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,5 +1,5 @@ #---------------------------------------------------------------------- -# Makefile.am - The Final Cut example programs +# Makefile.am - FINAL CUT example programs #---------------------------------------------------------------------- if ! CPPUNIT_TEST diff --git a/examples/background-color.cpp b/examples/background-color.cpp index fe14f5f7..c44f0a95 100644 --- a/examples/background-color.cpp +++ b/examples/background-color.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * background-color.cpp - Sets the background color palette * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/busy.cpp b/examples/busy.cpp index 2bc2716b..8b503150 100644 --- a/examples/busy.cpp +++ b/examples/busy.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * busy.cpp - Shows the use of the FBusyIndicator * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/calculator.cpp b/examples/calculator.cpp index aff63430..b637d85d 100644 --- a/examples/calculator.cpp +++ b/examples/calculator.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * calculator.cpp - A simple calculator with trigonometric functions * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2016-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/checklist.cpp b/examples/checklist.cpp index 33ce1e60..9db553cc 100644 --- a/examples/checklist.cpp +++ b/examples/checklist.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * checklist.cpp - Example for FListView widget with checkboxes * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/choice.cpp b/examples/choice.cpp index 2869a412..d84deafd 100644 --- a/examples/choice.cpp +++ b/examples/choice.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * choice.cpp - FButtonGroup with scroll view * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/dialog.cpp b/examples/dialog.cpp index 705a9bb6..b65b8e82 100644 --- a/examples/dialog.cpp +++ b/examples/dialog.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * dialog.cpp - A FDialog example * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/event-log.cpp b/examples/event-log.cpp index 6d0991a7..a7ec3ec2 100644 --- a/examples/event-log.cpp +++ b/examples/event-log.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * event-log.cpp - Logs events in a dialog box * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/fullwidth-character.cpp b/examples/fullwidth-character.cpp index 8bc6067e..87ce8204 100644 --- a/examples/fullwidth-character.cpp +++ b/examples/fullwidth-character.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fullwidth-letter.cpp - Demonstrates use of full-width characters * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/hello.cpp b/examples/hello.cpp index e90643aa..613711c2 100644 --- a/examples/hello.cpp +++ b/examples/hello.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * hello.cpp - A simple hello world program * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/input-dialog.cpp b/examples/input-dialog.cpp index 99c9295a..cd6796b9 100644 --- a/examples/input-dialog.cpp +++ b/examples/input-dialog.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * input-dialog.cpp - An input field example * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/keyboard.cpp b/examples/keyboard.cpp index c3e06279..bc97335b 100644 --- a/examples/keyboard.cpp +++ b/examples/keyboard.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * keyboard.cpp - Shows typed-in key name * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/listbox.cpp b/examples/listbox.cpp index 0a6c60cc..adb41eb9 100644 --- a/examples/listbox.cpp +++ b/examples/listbox.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * listbox.cpp - Example for using a FListBox widget * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/listview.cpp b/examples/listview.cpp index 0ec35148..6b1fbcdb 100644 --- a/examples/listview.cpp +++ b/examples/listview.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * listview.cpp - Example for using a multi-column FListView widget * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/mandelbrot.cpp b/examples/mandelbrot.cpp index 1ec4935e..fe9d1c44 100644 --- a/examples/mandelbrot.cpp +++ b/examples/mandelbrot.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * mandelbrot.cpp - Shows a ASCII based Mandelbrot set * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/menu.cpp b/examples/menu.cpp index 978114f0..39bdce23 100644 --- a/examples/menu.cpp +++ b/examples/menu.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * menu.cpp - A menu example * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/mouse.cpp b/examples/mouse.cpp index 7f4614e2..16752c71 100644 --- a/examples/mouse.cpp +++ b/examples/mouse.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * mouse.cpp - A small mouse-controlled drawing program * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/opti-move.cpp b/examples/opti-move.cpp index 72b8a3d0..a4950f5e 100644 --- a/examples/opti-move.cpp +++ b/examples/opti-move.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * opti-move.cpp - Tests the cursor movement optimization * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2016-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/rotozoomer.cpp b/examples/rotozoomer.cpp index a1bf1399..13ab5e1f 100644 --- a/examples/rotozoomer.cpp +++ b/examples/rotozoomer.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * rotozoomer.cpp - Rotozoomer effect demo * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/scrollview.cpp b/examples/scrollview.cpp index bb3a9eb2..e45dd26e 100644 --- a/examples/scrollview.cpp +++ b/examples/scrollview.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * scrollview.cpp - Shows client widgets in a scroll area * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/string-operations.cpp b/examples/string-operations.cpp index cd92192d..a9ef2794 100644 --- a/examples/string-operations.cpp +++ b/examples/string-operations.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * string-operations.cpp - Demonstrates the functionality of FString * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp index f11a2249..c7a18c6b 100644 --- a/examples/term-attributes.cpp +++ b/examples/term-attributes.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * term-attributes.cpp - Test the video attributes of the terminal * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/termcap.cpp b/examples/termcap.cpp index e5e52dda..15c11200 100644 --- a/examples/termcap.cpp +++ b/examples/termcap.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * termcap.cpp - Show the used termcap variables * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/timer.cpp b/examples/timer.cpp index 032807e4..4fc9047b 100644 --- a/examples/timer.cpp +++ b/examples/timer.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * timer.cpp - Using timer events * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/transparent.cpp b/examples/transparent.cpp index 67ef2fd1..ac8d5644 100644 --- a/examples/transparent.cpp +++ b/examples/transparent.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * transparent.cpp - Demonstrates transparent windows * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2016-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/treeview.cpp b/examples/treeview.cpp index 8d36e5af..1d9a5012 100644 --- a/examples/treeview.cpp +++ b/examples/treeview.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * treeview.cpp - Example of a FListView widget with a tree hierarchy * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/ui.cpp b/examples/ui.cpp index a116ed00..f223c5af 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ui.cpp - Example of a user interface * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2019 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 * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * @@ -806,7 +806,7 @@ void MyDialog::cb_about (const finalcut::FWidget*, const FDataPtr) const finalcut::FString line(2, fc::BoxDrawingsHorizontal); finalcut::FMessageBox info ( "About" - , line + L" The Final Cut " + line + L"\n\n" + , line + L" FINAL CUT " + line + L"\n\n" L"Version " + libver + L"\n\n" L"(c) 2020 by Markus Gans" , finalcut::FMessageBox::Ok, 0, 0, this ); @@ -1042,7 +1042,7 @@ void MyDialog::cb_setInput (finalcut::FWidget* widget, FDataPtr data) int main (int argc, char* argv[]) { const finalcut::FString ver{F_VERSION}; // Library version - const finalcut::FString title { "The FINAL CUT " + ver + const finalcut::FString title { "FINAL CUT " + ver + " (C) 2020 by Markus Gans" }; // Create the application object app diff --git a/examples/watch.cpp b/examples/watch.cpp index 9b03b31f..2048626f 100644 --- a/examples/watch.cpp +++ b/examples/watch.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * watch.cpp - A watch with FSwitch widgets * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/examples/windows.cpp b/examples/windows.cpp index c9264857..d624fc9a 100644 --- a/examples/windows.cpp +++ b/examples/windows.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * windows.cpp - Shows window handling * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2016-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/fonts/Makefile.am b/fonts/Makefile.am index 6b7f78bc..b6a57cba 100644 --- a/fonts/Makefile.am +++ b/fonts/Makefile.am @@ -29,3 +29,7 @@ font_DATA = \ 8x16graph.pcf.gz \ fonts.alias \ fonts.dir + +uninstall-hook: + if test -d ${fontdir}; then rmdir ${fontdir}; fi + diff --git a/src/Makefile.am b/src/Makefile.am index 97549dd2..18aef3d5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,5 @@ #---------------------------------------------------------------------- -# Makefile.am - The Final Cut library +# Makefile.am - FINAL CUT library #---------------------------------------------------------------------- AM_CPPFLAGS = -Iinclude -Wall -Werror -DCOMPILE_FINAL_CUT -std=c++11 @@ -87,6 +87,7 @@ finalcutinclude_HEADERS = \ include/final/fbuttongroup.h \ include/final/fcheckbox.h \ include/final/fcolorpair.h \ + include/final/fdata.h \ include/final/fstyle.h \ include/final/fconfig.h \ include/final/fswitch.h \ @@ -159,5 +160,6 @@ finalcutinclude_HEADERS = \ clean-local: -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete -#uninstall: -# rm -R -f $(includedir)/final +uninstall-hook: + if test -d ${finalcutincludedir}; then rmdir ${finalcutincludedir}; fi + diff --git a/src/Makefile.clang b/src/Makefile.clang index c83f2636..4116e4a0 100644 --- a/src/Makefile.clang +++ b/src/Makefile.clang @@ -1,5 +1,5 @@ #----------------------------------------------------------------------------- -# Makefile for Final Cut +# Makefile for FINAL CUT #----------------------------------------------------------------------------- # This is where make install will install the library diff --git a/src/Makefile.gcc b/src/Makefile.gcc index 47ce8473..36222322 100644 --- a/src/Makefile.gcc +++ b/src/Makefile.gcc @@ -1,5 +1,5 @@ #----------------------------------------------------------------------------- -# Makefile for Final Cut +# Makefile for FINAL CUT #----------------------------------------------------------------------------- # This is where make install will install the library diff --git a/src/fapplication.cpp b/src/fapplication.cpp index 4177e28c..251f0a9c 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fapplication.cpp - Manages the application events * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2013-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * @@ -520,7 +520,7 @@ void FApplication::showParameterUsage() << " -h, --help " << " Display this help and exit\n" << "\n" - << "The Final Cut options:\n" + << "FINAL CUT options:\n" << " --encoding= " << " Sets the character encoding mode\n" << " " diff --git a/src/fbusyindicator.cpp b/src/fbusyindicator.cpp index dcd2f5a6..d46c1431 100644 --- a/src/fbusyindicator.cpp +++ b/src/fbusyindicator.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fbusyindicator.cpp - Shows background activity * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fbutton.cpp b/src/fbutton.cpp index 9e321441..2848c43c 100644 --- a/src/fbutton.cpp +++ b/src/fbutton.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fbutton.cpp - Widget FButton * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fbuttongroup.cpp b/src/fbuttongroup.cpp index 85943373..7daeb8f6 100644 --- a/src/fbuttongroup.cpp +++ b/src/fbuttongroup.cpp @@ -2,17 +2,17 @@ * fbuttongroup.cpp - The FButtonGroup widget organizes FToggleButton * * widgets in a group. * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fcharmap.cpp b/src/fcharmap.cpp index 77380469..23bb8753 100644 --- a/src/fcharmap.cpp +++ b/src/fcharmap.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fcharmap.cpp - Character mapping and encoding * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2019 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 * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fcheckbox.cpp b/src/fcheckbox.cpp index 44ba8b57..f06f3d07 100644 --- a/src/fcheckbox.cpp +++ b/src/fcheckbox.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fcheckbox.cpp - Widget FCheckBox * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fcheckmenuitem.cpp b/src/fcheckmenuitem.cpp index 392ca681..d75ef36e 100644 --- a/src/fcheckmenuitem.cpp +++ b/src/fcheckmenuitem.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fcheckmenuitem.cpp - Widget FCheckMenuItem * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fcolorpalette.cpp b/src/fcolorpalette.cpp index e173218d..9180dbdc 100644 --- a/src/fcolorpalette.cpp +++ b/src/fcolorpalette.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fcolorpalette.cpp - Define RGB color value for a palette entry * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fcombobox.cpp b/src/fcombobox.cpp index c08ffc1e..5c843fc4 100644 --- a/src/fcombobox.cpp +++ b/src/fcombobox.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fcombobox.cpp - Widget FComboBox * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fdialog.cpp b/src/fdialog.cpp index 2ea2a16a..59d3d93c 100644 --- a/src/fdialog.cpp +++ b/src/fdialog.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fdialog.cpp - Widget FDialog * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fdialoglistmenu.cpp b/src/fdialoglistmenu.cpp index 3567b8ad..a301b65b 100644 --- a/src/fdialoglistmenu.cpp +++ b/src/fdialoglistmenu.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fdialoglistmenu.cpp - Widget FDialogListMenu * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2016-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fevent.cpp b/src/fevent.cpp index 964cf440..be31e71c 100644 --- a/src/fevent.cpp +++ b/src/fevent.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fevent.cpp - Base event class of widgets * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/ffiledialog.cpp b/src/ffiledialog.cpp index 7087e6ed..565cfa0d 100644 --- a/src/ffiledialog.cpp +++ b/src/ffiledialog.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ffiledialog.cpp - Widget FFileDialog (a file chooser dialog) * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fkey_map.cpp b/src/fkey_map.cpp index aeff0b90..95a291f0 100644 --- a/src/fkey_map.cpp +++ b/src/fkey_map.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fkey_map.cpp - Key name mapping * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fkeyboard.cpp b/src/fkeyboard.cpp index 35b6e005..52afbfcd 100644 --- a/src/fkeyboard.cpp +++ b/src/fkeyboard.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fkeyboard.cpp - Read keyboard events * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/flabel.cpp b/src/flabel.cpp index 1ad9fa9a..ad3621fe 100644 --- a/src/flabel.cpp +++ b/src/flabel.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * flabel.cpp - Widget FLabel * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/flineedit.cpp b/src/flineedit.cpp index 47d05fc7..c5e3984e 100644 --- a/src/flineedit.cpp +++ b/src/flineedit.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * flineedit.cpp - Widget FLineEdit * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/flistbox.cpp b/src/flistbox.cpp index 6f990743..45234365 100644 --- a/src/flistbox.cpp +++ b/src/flistbox.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * flistbox.cpp - Widget FListBox and FListBoxItem * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/flistview.cpp b/src/flistview.cpp index a4226a0c..a61c6905 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * flistview.cpp - Widget FListView and FListViewItem * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/flog.cpp b/src/flog.cpp index 2a527412..a9fd54d5 100644 --- a/src/flog.cpp +++ b/src/flog.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * flog.cpp - Interface of the FINAL CUT logger * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/flogger.cpp b/src/flogger.cpp index 68720d68..59ac1948 100644 --- a/src/flogger.cpp +++ b/src/flogger.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * flogger.cpp - The FINAL CUT text logger * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fmenu.cpp b/src/fmenu.cpp index ebca38b4..81cd2a4c 100644 --- a/src/fmenu.cpp +++ b/src/fmenu.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fmenu.cpp - Widget FMenu * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp index 5923248a..aa879619 100644 --- a/src/fmenubar.cpp +++ b/src/fmenubar.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fmenubar.cpp - Widget FMenuBar * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fmenuitem.cpp b/src/fmenuitem.cpp index 25b750f6..ae1b3cd3 100644 --- a/src/fmenuitem.cpp +++ b/src/fmenuitem.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fmenuitem.cpp - Widget FMenuItem * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fmenulist.cpp b/src/fmenulist.cpp index c9e4d0a5..47061a43 100644 --- a/src/fmenulist.cpp +++ b/src/fmenulist.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fmenulist.cpp - Menu item container base class * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fmessagebox.cpp b/src/fmessagebox.cpp index f156bfe7..34851705 100644 --- a/src/fmessagebox.cpp +++ b/src/fmessagebox.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fmessagebox.cpp - Widget FMessageBox (a text message window) * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fmouse.cpp b/src/fmouse.cpp index 996c2268..7b6fbaf1 100644 --- a/src/fmouse.cpp +++ b/src/fmouse.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fmouse.cpp - Read mouse events * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fobject.cpp b/src/fobject.cpp index 77fdf11a..d75d1878 100644 --- a/src/fobject.cpp +++ b/src/fobject.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fobject.cpp - Object container base class of all widget objects * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp index 2581ebe6..d53d50a7 100644 --- a/src/foptiattr.cpp +++ b/src/foptiattr.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * foptiattr.cpp - Sets video attributes in optimized order * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2016-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/foptimove.cpp b/src/foptimove.cpp index 88389cfd..95ce383c 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * foptimove.cpp - Cursor movement optimization * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fpoint.cpp b/src/fpoint.cpp index 51ea2ecc..e41dab23 100644 --- a/src/fpoint.cpp +++ b/src/fpoint.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fpoint.cpp - Point with an x and y coordinate * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fprogressbar.cpp b/src/fprogressbar.cpp index e99b530a..8d3e04ad 100644 --- a/src/fprogressbar.cpp +++ b/src/fprogressbar.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fprogressbar.cpp - Widget FProgressbar * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fradiobutton.cpp b/src/fradiobutton.cpp index 5f511b6b..8c8e1a16 100644 --- a/src/fradiobutton.cpp +++ b/src/fradiobutton.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fradiobutton.cpp - Widget FRadioButton * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fradiomenuitem.cpp b/src/fradiomenuitem.cpp index 1496b916..48af6014 100644 --- a/src/fradiomenuitem.cpp +++ b/src/fradiomenuitem.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fradiomenuitem.cpp - Widget FRadioMenuItem * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/frect.cpp b/src/frect.cpp index 2d88eb6e..e396512c 100644 --- a/src/frect.cpp +++ b/src/frect.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * frect.cpp - Rectangle with position and size * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fscrollbar.cpp b/src/fscrollbar.cpp index 9dd0491f..3c96b6ce 100644 --- a/src/fscrollbar.cpp +++ b/src/fscrollbar.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fscrollbar.cpp - Widget FScrollbar * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp index 5b0d722f..f5a1e30b 100644 --- a/src/fscrollview.cpp +++ b/src/fscrollview.cpp @@ -2,17 +2,17 @@ * fscrollview.cpp - Widget FScrollView (a scrolling area with * * on-demand scroll bars) * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fsize.cpp b/src/fsize.cpp index 1baba394..5d957452 100644 --- a/src/fsize.cpp +++ b/src/fsize.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fsize.cpp - Height and width of a two-dimensional surface * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fspinbox.cpp b/src/fspinbox.cpp index c477b40d..e77edb9e 100644 --- a/src/fspinbox.cpp +++ b/src/fspinbox.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fspinbox.cpp - Widget FSpinBox * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fstartoptions.cpp b/src/fstartoptions.cpp index 864b5033..3250eadb 100644 --- a/src/fstartoptions.cpp +++ b/src/fstartoptions.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fstartoptions.cpp - Contains the start options for initialization * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fstatusbar.cpp b/src/fstatusbar.cpp index a9e17f1b..03b6030f 100644 --- a/src/fstatusbar.cpp +++ b/src/fstatusbar.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fstatusbar.cpp - Widget FStatusBar and FStatusKey * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fstring.cpp b/src/fstring.cpp index 7c3ba53a..55987c14 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fstring.cpp - Unicode string class with UTF-8 support * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fstringstream.cpp b/src/fstringstream.cpp index 31a3523d..c71897fa 100644 --- a/src/fstringstream.cpp +++ b/src/fstringstream.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fstringstream.cpp - I/O operations on FString based streams * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fswitch.cpp b/src/fswitch.cpp index 1db06e7d..58274d2d 100644 --- a/src/fswitch.cpp +++ b/src/fswitch.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fswitch.cpp - Widget FSwitch * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fsystem.cpp b/src/fsystem.cpp index 772c4545..2f1dd98e 100644 --- a/src/fsystem.cpp +++ b/src/fsystem.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fsystem.cpp - Abstract class for system calls * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019 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 * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fsystemimpl.cpp b/src/fsystemimpl.cpp index 3f8fdef3..498c86c2 100644 --- a/src/fsystemimpl.cpp +++ b/src/fsystemimpl.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fsystemimpl.cpp - FSystem implementation * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fterm.cpp b/src/fterm.cpp index c7eb3e32..6cbe556c 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fterm.cpp - Base class for terminal control * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fterm_functions.cpp b/src/fterm_functions.cpp index 646044c7..1fa430ee 100644 --- a/src/fterm_functions.cpp +++ b/src/fterm_functions.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fterm_functions.cpp - FTerm helper functions * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/ftermbuffer.cpp b/src/ftermbuffer.cpp index fa8cd5fb..7dd82959 100644 --- a/src/ftermbuffer.cpp +++ b/src/ftermbuffer.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermbuffer.cpp - Buffer for virtual terminal strings * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/ftermcap.cpp b/src/ftermcap.cpp index a1e4ff2a..53268d68 100644 --- a/src/ftermcap.cpp +++ b/src/ftermcap.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermcap.cpp - Provides access to terminal capabilities * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/ftermcapquirks.cpp b/src/ftermcapquirks.cpp index 52fcea0c..07faf1bd 100644 --- a/src/ftermcapquirks.cpp +++ b/src/ftermcapquirks.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermcapquirks.cpp - Termcap quirks for some well-known terminals * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/ftermdebugdata.cpp b/src/ftermdebugdata.cpp index 5260a594..8ea81d19 100644 --- a/src/ftermdebugdata.cpp +++ b/src/ftermdebugdata.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermdebugdata.cpp - Debug data class for FTerm * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/ftermdetection.cpp b/src/ftermdetection.cpp index 4554f85f..d81a6c29 100644 --- a/src/ftermdetection.cpp +++ b/src/ftermdetection.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermdetection.cpp - Detection of the terminal type * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/ftermfreebsd.cpp b/src/ftermfreebsd.cpp index 99359ba1..f9925f60 100644 --- a/src/ftermfreebsd.cpp +++ b/src/ftermfreebsd.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermfreebsd.cpp - Contains the FreeBSD terminal functions * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/ftermios.cpp b/src/ftermios.cpp index 243aa544..c3c17765 100644 --- a/src/ftermios.cpp +++ b/src/ftermios.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermios.cpp - Provides access to POSIX tty I/O control * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/ftermlinux.cpp b/src/ftermlinux.cpp index 4537cc83..f4263b2d 100644 --- a/src/ftermlinux.cpp +++ b/src/ftermlinux.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermlinux.cpp - Contains the Linux terminal functions * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/ftermopenbsd.cpp b/src/ftermopenbsd.cpp index e962d470..a49c34ae 100644 --- a/src/ftermopenbsd.cpp +++ b/src/ftermopenbsd.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermopenbsd.cpp - Contains the NetBSD/OpenBSD terminal functions * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/ftermxterminal.cpp b/src/ftermxterminal.cpp index 56c6c8d3..e78669aa 100644 --- a/src/ftermxterminal.cpp +++ b/src/ftermxterminal.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermxterminal.cpp - Contains all xterm-specific terminal functions * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/ftextview.cpp b/src/ftextview.cpp index 15ce3574..50ef7d98 100644 --- a/src/ftextview.cpp +++ b/src/ftextview.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftextview.cpp - Widget FTextView (a multiline text viewer) * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/ftogglebutton.cpp b/src/ftogglebutton.cpp index 7da98051..4c7e748f 100644 --- a/src/ftogglebutton.cpp +++ b/src/ftogglebutton.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftogglebutton.cpp - Intermediate base class for a toggle button * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/ftooltip.cpp b/src/ftooltip.cpp index ca26b639..354d1d7d 100644 --- a/src/ftooltip.cpp +++ b/src/ftooltip.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftooltip.cpp - Widget FToolTip * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2016-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 2db393dc..665ae218 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fvterm.cpp - Virtual terminal implementation * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2016-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fwidget.cpp b/src/fwidget.cpp index 3fc74c42..311756ef 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fwidget.cpp - Intermediate base class for all widget objects * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * @@ -1257,12 +1257,6 @@ bool FWidget::isChildPrintArea() const return false; } -//---------------------------------------------------------------------- -bool FWidget::isDesktopInitialized() const -{ - return ( root_widget ) ? root_widget->init_desktop : false; -} - //---------------------------------------------------------------------- void FWidget::setStatusBar (FStatusBar* sbar) { diff --git a/src/fwidget_functions.cpp b/src/fwidget_functions.cpp index a0d1dc70..d3925da3 100644 --- a/src/fwidget_functions.cpp +++ b/src/fwidget_functions.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fwidget_functions.cpp - FWidget helper functions * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fwidgetcolors.cpp b/src/fwidgetcolors.cpp index e54d4541..53c75a12 100644 --- a/src/fwidgetcolors.cpp +++ b/src/fwidgetcolors.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fwidgetcolors.cpp - Set widget color theme * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/fwindow.cpp b/src/fwindow.cpp index be668f88..e1153538 100644 --- a/src/fwindow.cpp +++ b/src/fwindow.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fwindow.cpp - Intermediate base class for all window objects * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/emptyfstring.h b/src/include/final/emptyfstring.h index 46174f1f..b11cf9f8 100644 --- a/src/include/final/emptyfstring.h +++ b/src/include/final/emptyfstring.h @@ -1,17 +1,17 @@ /*********************************************************************** * emptyfstring.h - Creates an empty FString object * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index db0592a4..87d1d729 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -1,17 +1,17 @@ /*********************************************************************** * fapplication.h - Manages the application events * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2013-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fbusyindicator.h b/src/include/final/fbusyindicator.h index 761194ad..a73618b1 100644 --- a/src/include/final/fbusyindicator.h +++ b/src/include/final/fbusyindicator.h @@ -1,17 +1,17 @@ /*********************************************************************** * fbusyindicator.h - Shows background activity * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fbutton.h b/src/include/final/fbutton.h index 0fef4af5..cfe0145b 100644 --- a/src/include/final/fbutton.h +++ b/src/include/final/fbutton.h @@ -1,17 +1,17 @@ /*********************************************************************** * fbutton.h - Widget FButton * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fbuttongroup.h b/src/include/final/fbuttongroup.h index 33b95d77..1b544692 100644 --- a/src/include/final/fbuttongroup.h +++ b/src/include/final/fbuttongroup.h @@ -2,17 +2,17 @@ * fbuttongroup.h - The FButtonGroup widget organizes FToggleButton * * widgets in a group. * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fc.h b/src/include/final/fc.h index 648b8a56..aa1585c4 100644 --- a/src/include/final/fc.h +++ b/src/include/final/fc.h @@ -1,17 +1,17 @@ /*********************************************************************** * fc.h - Implements global constants and enumerations * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fcharmap.h b/src/include/final/fcharmap.h index a9a30b94..009c4a76 100644 --- a/src/include/final/fcharmap.h +++ b/src/include/final/fcharmap.h @@ -1,17 +1,17 @@ /*********************************************************************** * fcharmap.h - Character mapping and encoding * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2019 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 * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fcheckbox.h b/src/include/final/fcheckbox.h index 132f4c68..07c5626d 100644 --- a/src/include/final/fcheckbox.h +++ b/src/include/final/fcheckbox.h @@ -1,17 +1,17 @@ /*********************************************************************** * fcheckbox.h - Widget FCheckBox * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fcheckmenuitem.h b/src/include/final/fcheckmenuitem.h index e2f795e2..212e3c94 100644 --- a/src/include/final/fcheckmenuitem.h +++ b/src/include/final/fcheckmenuitem.h @@ -1,17 +1,17 @@ /*********************************************************************** * fcheckmenuitem.h - Widget FCheckMenuItem * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fcolorpair.h b/src/include/final/fcolorpair.h index 6214e665..badcf497 100644 --- a/src/include/final/fcolorpair.h +++ b/src/include/final/fcolorpair.h @@ -1,17 +1,17 @@ /*********************************************************************** * fcolorpair.h - Foreground and background color of a character * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fcolorpalette.h b/src/include/final/fcolorpalette.h index b3ba52a8..38130f0e 100644 --- a/src/include/final/fcolorpalette.h +++ b/src/include/final/fcolorpalette.h @@ -1,17 +1,17 @@ /*********************************************************************** * fcolorpalette.h - Define RGB color value for a palette entry * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fcombobox.h b/src/include/final/fcombobox.h index b88e433f..1fddc318 100644 --- a/src/include/final/fcombobox.h +++ b/src/include/final/fcombobox.h @@ -1,17 +1,17 @@ /*********************************************************************** * fcombobox.h - Widget FComboBox * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fdata.h b/src/include/final/fdata.h new file mode 100644 index 00000000..473e9484 --- /dev/null +++ b/src/include/final/fdata.h @@ -0,0 +1,62 @@ +/*********************************************************************** +* fdata.h - A general-purpose data wrapper * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2020 Markus Gans * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#ifndef FDATA_H +#define FDATA_H + +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + +namespace +{ + +template +struct FData +{ + FData (T v) + : value(v) + { } + + T operator () () const + { + return value; + } + + template + T operator () (Args... args) const + { + return value(args...); + } + + operator T () const + { + return value; + } + + T value; +}; + +} // namespace + +#endif // FDATA_H + diff --git a/src/include/final/fdialog.h b/src/include/final/fdialog.h index 71208971..1fea5066 100644 --- a/src/include/final/fdialog.h +++ b/src/include/final/fdialog.h @@ -1,17 +1,17 @@ /*********************************************************************** * fdialog.h - Widget FDialog * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fdialoglistmenu.h b/src/include/final/fdialoglistmenu.h index 58acbdd0..e80f8953 100644 --- a/src/include/final/fdialoglistmenu.h +++ b/src/include/final/fdialoglistmenu.h @@ -1,17 +1,17 @@ /*********************************************************************** * fdialoglistmenu.h - Widget FDialogListMenu * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2016-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fevent.h b/src/include/final/fevent.h index 0e33d66a..21dfc7d5 100644 --- a/src/include/final/fevent.h +++ b/src/include/final/fevent.h @@ -1,17 +1,17 @@ /*********************************************************************** * fevent.h - Base event class of widgets * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ffiledialog.h b/src/include/final/ffiledialog.h index b99da7a6..f9a10a73 100644 --- a/src/include/final/ffiledialog.h +++ b/src/include/final/ffiledialog.h @@ -1,17 +1,17 @@ /*********************************************************************** * ffiledialog.h - Widget FFileDialog (a file chooser dialog) * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/final.h b/src/include/final/final.h index 9a985919..dc363458 100644 --- a/src/include/final/final.h +++ b/src/include/final/final.h @@ -1,18 +1,18 @@ /*********************************************************************** -* final.h - Include all in the Final Cut required functions, types * -* and macros * +* final.h - Include all in FINAL CUT required functions, * +* types and macros * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fkey_map.h b/src/include/final/fkey_map.h index ceacace7..5a623e42 100644 --- a/src/include/final/fkey_map.h +++ b/src/include/final/fkey_map.h @@ -1,17 +1,17 @@ /*********************************************************************** * fkey_map.h - Key name mapping * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2019 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 * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fkeyboard.h b/src/include/final/fkeyboard.h index f04bcf0e..7dd344e7 100644 --- a/src/include/final/fkeyboard.h +++ b/src/include/final/fkeyboard.h @@ -1,17 +1,17 @@ /*********************************************************************** * fkeyboard.h - Read keyboard events * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/flabel.h b/src/include/final/flabel.h index f6ad464f..d73d0a06 100644 --- a/src/include/final/flabel.h +++ b/src/include/final/flabel.h @@ -1,17 +1,17 @@ /*********************************************************************** * flabel.cpp - Widget FLabel * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/flineedit.h b/src/include/final/flineedit.h index b2cc6e14..59bac04a 100644 --- a/src/include/final/flineedit.h +++ b/src/include/final/flineedit.h @@ -1,17 +1,17 @@ /*********************************************************************** * flineedit.h - Widget FLineEdit * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/flistbox.h b/src/include/final/flistbox.h index 85742216..d628cfee 100644 --- a/src/include/final/flistbox.h +++ b/src/include/final/flistbox.h @@ -1,17 +1,17 @@ /*********************************************************************** * flistbox.h - Widget FListBox and FListBoxItem * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h index f9c3a970..3e1fec87 100644 --- a/src/include/final/flistview.h +++ b/src/include/final/flistview.h @@ -1,17 +1,17 @@ /*********************************************************************** * flistview.h - Widget FListView and FListViewItem * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/flog.h b/src/include/final/flog.h index 9ff759dc..291bceec 100644 --- a/src/include/final/flog.h +++ b/src/include/final/flog.h @@ -1,17 +1,17 @@ /*********************************************************************** * flog.h - Interface of the FINAL CUT logger * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/flogger.h b/src/include/final/flogger.h index a7fcd17f..cbcc89e4 100644 --- a/src/include/final/flogger.h +++ b/src/include/final/flogger.h @@ -1,17 +1,17 @@ /*********************************************************************** * flogger.h - The FINAL CUT text logger * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fmenu.h b/src/include/final/fmenu.h index 69be88c6..3af7bd7e 100644 --- a/src/include/final/fmenu.h +++ b/src/include/final/fmenu.h @@ -1,17 +1,17 @@ /*********************************************************************** * fmenu.h - Widget FMenu * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fmenubar.h b/src/include/final/fmenubar.h index 5ad7d7f1..1cf243fd 100644 --- a/src/include/final/fmenubar.h +++ b/src/include/final/fmenubar.h @@ -1,17 +1,17 @@ /*********************************************************************** * fmenubar.h - Widget FMenuBar * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fmenuitem.h b/src/include/final/fmenuitem.h index 7cccde36..28fed5ad 100644 --- a/src/include/final/fmenuitem.h +++ b/src/include/final/fmenuitem.h @@ -1,17 +1,17 @@ /*********************************************************************** * fmenuitem.h - Widget FMenuItem * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fmenulist.h b/src/include/final/fmenulist.h index bb8c9288..ec77e07a 100644 --- a/src/include/final/fmenulist.h +++ b/src/include/final/fmenulist.h @@ -1,17 +1,17 @@ /*********************************************************************** * fmenulist.h - Menu item container base class * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fmessagebox.h b/src/include/final/fmessagebox.h index b5db8d6c..0f0f86ab 100644 --- a/src/include/final/fmessagebox.h +++ b/src/include/final/fmessagebox.h @@ -1,17 +1,17 @@ /*********************************************************************** * fmessagebox.h - Widget FMessageBox (a text message window) * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fmouse.h b/src/include/final/fmouse.h index 8a747be0..21abf106 100644 --- a/src/include/final/fmouse.h +++ b/src/include/final/fmouse.h @@ -1,17 +1,17 @@ /*********************************************************************** * fmouse.h - Read mouse events * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fobject.h b/src/include/final/fobject.h index 0e68c500..1593287d 100644 --- a/src/include/final/fobject.h +++ b/src/include/final/fobject.h @@ -1,17 +1,17 @@ /*********************************************************************** * fobject.h - Object container base class of all widget objects * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/foptiattr.h b/src/include/final/foptiattr.h index a6b49698..dcadbacb 100644 --- a/src/include/final/foptiattr.h +++ b/src/include/final/foptiattr.h @@ -1,17 +1,17 @@ /*********************************************************************** * foptiattr.h - Sets video attributes in optimized order * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2016-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/foptimove.h b/src/include/final/foptimove.h index a9661755..6d66223e 100644 --- a/src/include/final/foptimove.h +++ b/src/include/final/foptimove.h @@ -1,17 +1,17 @@ /*********************************************************************** * foptimove.cpp - Cursor movement optimization * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fpoint.h b/src/include/final/fpoint.h index a3ae4b22..740af574 100644 --- a/src/include/final/fpoint.h +++ b/src/include/final/fpoint.h @@ -1,17 +1,17 @@ /*********************************************************************** * fpoint.h - Point with an x and y coordinate * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fprogressbar.h b/src/include/final/fprogressbar.h index d77b62aa..4d8c5cca 100644 --- a/src/include/final/fprogressbar.h +++ b/src/include/final/fprogressbar.h @@ -1,17 +1,17 @@ /*********************************************************************** * fprogressbar.h - Widget FProgressbar * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fradiobutton.h b/src/include/final/fradiobutton.h index 10cebb5b..d00410b8 100644 --- a/src/include/final/fradiobutton.h +++ b/src/include/final/fradiobutton.h @@ -1,17 +1,17 @@ /*********************************************************************** * fradiobutton.h - Widget FRadioButton * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fradiomenuitem.h b/src/include/final/fradiomenuitem.h index d98259cc..daff789c 100644 --- a/src/include/final/fradiomenuitem.h +++ b/src/include/final/fradiomenuitem.h @@ -1,17 +1,17 @@ /*********************************************************************** * fradiomenuitem.h - Widget FRadioMenuItem * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/frect.h b/src/include/final/frect.h index 1e538437..c6727031 100644 --- a/src/include/final/frect.h +++ b/src/include/final/frect.h @@ -1,17 +1,17 @@ /*********************************************************************** * frect.h - Rectangle with position and size * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fscrollbar.h b/src/include/final/fscrollbar.h index 164afe8f..327f76a1 100644 --- a/src/include/final/fscrollbar.h +++ b/src/include/final/fscrollbar.h @@ -1,17 +1,17 @@ /*********************************************************************** * fscrollbar.h - Widget FScrollbar * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fscrollview.h b/src/include/final/fscrollview.h index 1cca1927..69fcbbe9 100644 --- a/src/include/final/fscrollview.h +++ b/src/include/final/fscrollview.h @@ -2,17 +2,17 @@ * fscrollview.h - Widget FScrollView (a scrolling area with on-demand * * scroll bars) * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fsize.h b/src/include/final/fsize.h index fe6373b7..c06ad351 100644 --- a/src/include/final/fsize.h +++ b/src/include/final/fsize.h @@ -1,17 +1,17 @@ /*********************************************************************** * fsize.h - Height and width of a two-dimensional surface * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fspinbox.h b/src/include/final/fspinbox.h index 0b9f5b36..809e51c4 100644 --- a/src/include/final/fspinbox.h +++ b/src/include/final/fspinbox.h @@ -1,17 +1,17 @@ /*********************************************************************** * fspinbox.h - Widget FSpinBox * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fstartoptions.h b/src/include/final/fstartoptions.h index 6a0d1ad6..ab5cffae 100644 --- a/src/include/final/fstartoptions.h +++ b/src/include/final/fstartoptions.h @@ -1,17 +1,17 @@ /*********************************************************************** * fstartoptions.h - Contains the start options for initialization * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fstatusbar.h b/src/include/final/fstatusbar.h index db45f601..a931223b 100644 --- a/src/include/final/fstatusbar.h +++ b/src/include/final/fstatusbar.h @@ -1,17 +1,17 @@ /*********************************************************************** * fstatusbar.h - Widget FStatusBar and FStatusKey * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fstring.h b/src/include/final/fstring.h index ae8c7ef6..c5b9870f 100644 --- a/src/include/final/fstring.h +++ b/src/include/final/fstring.h @@ -1,17 +1,17 @@ /*********************************************************************** * fstring.h - Unicode string class with UTF-8 support * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fstringstream.h b/src/include/final/fstringstream.h index e0c111c8..15ec22a6 100644 --- a/src/include/final/fstringstream.h +++ b/src/include/final/fstringstream.h @@ -1,17 +1,17 @@ /*********************************************************************** * fstringstream.h - I/O operations on FString based streams * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fstyle.h b/src/include/final/fstyle.h index d5c26a8d..bef360fe 100644 --- a/src/include/final/fstyle.h +++ b/src/include/final/fstyle.h @@ -1,17 +1,17 @@ /*********************************************************************** * fstyle.h - Style attribute of a character * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fswitch.h b/src/include/final/fswitch.h index 00ee64a4..cd94a57d 100644 --- a/src/include/final/fswitch.h +++ b/src/include/final/fswitch.h @@ -1,17 +1,17 @@ /*********************************************************************** * fswitch.h - Widget FSwitch * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fsystem.h b/src/include/final/fsystem.h index 38b98868..e07fed7b 100644 --- a/src/include/final/fsystem.h +++ b/src/include/final/fsystem.h @@ -1,17 +1,17 @@ /*********************************************************************** * fsystem.h - Abstract class for system calls * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fsystemimpl.h b/src/include/final/fsystemimpl.h index 44d8c687..25bbf3c4 100644 --- a/src/include/final/fsystemimpl.h +++ b/src/include/final/fsystemimpl.h @@ -1,17 +1,17 @@ /*********************************************************************** * fsystemimpl.h - FSystem implementation * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h index 8874abd8..641c2f0d 100644 --- a/src/include/final/fterm.h +++ b/src/include/final/fterm.h @@ -1,17 +1,17 @@ /*********************************************************************** * fterm.h - Base class for terminal control * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2012-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftermbuffer.h b/src/include/final/ftermbuffer.h index 84fa4a0e..2a5e4c41 100644 --- a/src/include/final/ftermbuffer.h +++ b/src/include/final/ftermbuffer.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftermbuffer.h - Buffer for virtual terminal strings * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftermcap.h b/src/include/final/ftermcap.h index 59523473..e4f2d33e 100644 --- a/src/include/final/ftermcap.h +++ b/src/include/final/ftermcap.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftermcap.h - Provides access to terminal capabilities * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2016-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftermcapquirks.h b/src/include/final/ftermcapquirks.h index 35b6ad23..60148df9 100644 --- a/src/include/final/ftermcapquirks.h +++ b/src/include/final/ftermcapquirks.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftermcapquirks.h - Termcap quirks for some well-known terminals * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2019 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftermdata.h b/src/include/final/ftermdata.h index cf1124ab..7c6aae50 100644 --- a/src/include/final/ftermdata.h +++ b/src/include/final/ftermdata.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftermdata.h - Data class for FTerm * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftermdebugdata.h b/src/include/final/ftermdebugdata.h index 94870964..1d76e9da 100644 --- a/src/include/final/ftermdebugdata.h +++ b/src/include/final/ftermdebugdata.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftermdebugdata.h - Debug data class for FTerm * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftermdetection.h b/src/include/final/ftermdetection.h index f17786d3..430d0c52 100644 --- a/src/include/final/ftermdetection.h +++ b/src/include/final/ftermdetection.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftermdetection.h - Detection of the terminal type * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftermfreebsd.h b/src/include/final/ftermfreebsd.h index 130f980a..55f0a8a3 100644 --- a/src/include/final/ftermfreebsd.h +++ b/src/include/final/ftermfreebsd.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftermfreebsd.h - Contains the FreeBSD terminal functions * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftermios.h b/src/include/final/ftermios.h index e90c12da..e80813f7 100644 --- a/src/include/final/ftermios.h +++ b/src/include/final/ftermios.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftermios.h - Provides access to POSIX tty I/O control * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2019 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftermlinux.h b/src/include/final/ftermlinux.h index c28cbb56..7906fc1e 100644 --- a/src/include/final/ftermlinux.h +++ b/src/include/final/ftermlinux.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftermlinux.h - Contains the Linux terminal functions * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftermopenbsd.h b/src/include/final/ftermopenbsd.h index 00843e3f..b5e470ce 100644 --- a/src/include/final/ftermopenbsd.h +++ b/src/include/final/ftermopenbsd.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftermopenbsd.h - Contains the NetBSD/OpenBSD terminal functions * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftermxterminal.h b/src/include/final/ftermxterminal.h index 17058d0b..f04fa607 100644 --- a/src/include/final/ftermxterminal.h +++ b/src/include/final/ftermxterminal.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftermxterminal.h - Contains all xterm-specific terminal functions * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftextview.h b/src/include/final/ftextview.h index 6443bb1a..aec225d1 100644 --- a/src/include/final/ftextview.h +++ b/src/include/final/ftextview.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftextview.h - Widget FTextView (a multiline text viewer) * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftogglebutton.h b/src/include/final/ftogglebutton.h index d00080d4..42707ed9 100644 --- a/src/include/final/ftogglebutton.h +++ b/src/include/final/ftogglebutton.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftogglebutton.h - Intermediate base class for a toggle button * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2014-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftooltip.h b/src/include/final/ftooltip.h index 2a73a0ba..4fdc0839 100644 --- a/src/include/final/ftooltip.h +++ b/src/include/final/ftooltip.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftooltip.h - Widget FToolTip * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2016-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/ftypes.h b/src/include/final/ftypes.h index ff35a9ec..8285be69 100644 --- a/src/include/final/ftypes.h +++ b/src/include/final/ftypes.h @@ -1,17 +1,17 @@ /*********************************************************************** * ftypes.h - Implements global data types * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * @@ -35,6 +35,8 @@ #include #include +#include + #define null nullptr #define badAllocOutput(object_name) \ @@ -188,4 +190,3 @@ FKeyName; } // namespace finalcut #endif // FTYPES_H - diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 3d73c7eb..0357304f 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -1,17 +1,17 @@ /*********************************************************************** * fvterm.h - Virtual terminal implementation * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2016-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index d9af1d0a..63a40618 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -1,17 +1,17 @@ /*********************************************************************** * fwidget.h - Intermediate base class for all widget objects * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * @@ -368,8 +368,7 @@ class FWidget : public FVTerm, public FObject // Inquiry bool isChildPrintArea() const; - bool isDesktopInitialized() const; - + // Mutators virtual void setStatusBar (FStatusBar*); virtual void setMenuBar (FMenuBar*); diff --git a/src/include/final/fwidgetcolors.h b/src/include/final/fwidgetcolors.h index b839aecf..3b00cbf2 100644 --- a/src/include/final/fwidgetcolors.h +++ b/src/include/final/fwidgetcolors.h @@ -1,17 +1,17 @@ /*********************************************************************** * fwidgetcolors.h - Set widget color theme * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/fwindow.h b/src/include/final/fwindow.h index 572e4530..34df1509 100644 --- a/src/include/final/fwindow.h +++ b/src/include/final/fwindow.h @@ -1,17 +1,17 @@ /*********************************************************************** * fwindow.h - Intermediate base class for all window objects * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2015-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/include/final/sgr_optimizer.h b/src/include/final/sgr_optimizer.h index 0b69ed53..ca974cbe 100644 --- a/src/include/final/sgr_optimizer.h +++ b/src/include/final/sgr_optimizer.h @@ -1,17 +1,17 @@ /*********************************************************************** * sgr_optimizer.h - Combines SGR (Select Graphic Rendition) attributes * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/src/sgr_optimizer.cpp b/src/sgr_optimizer.cpp index 74cc3c57..43606a71 100644 --- a/src/sgr_optimizer.cpp +++ b/src/sgr_optimizer.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * sgr_optimizer.cpp - Combines SGR attributes * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/Makefile.clang b/test/Makefile.clang index 0f68b734..f4ae2e58 100644 --- a/test/Makefile.clang +++ b/test/Makefile.clang @@ -1,5 +1,5 @@ #----------------------------------------------------------------------------- -# Makefile for Final Cut +# Makefile for FINAL CUT #----------------------------------------------------------------------------- # This is where make install will install the executable diff --git a/test/Makefile.gcc b/test/Makefile.gcc index 7c598fa1..a3cd0ed1 100644 --- a/test/Makefile.gcc +++ b/test/Makefile.gcc @@ -1,5 +1,5 @@ #----------------------------------------------------------------------------- -# Makefile for Final Cut +# Makefile for FINAL CUT #----------------------------------------------------------------------------- # This is where make install will install the executable diff --git a/test/conemu.h b/test/conemu.h index 1105e4e8..d219e09c 100644 --- a/test/conemu.h +++ b/test/conemu.h @@ -1,17 +1,17 @@ /*********************************************************************** * conemu.h - Emulator for various consoles and terminals * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/fcolorpair-test.cpp b/test/fcolorpair-test.cpp index f130c652..76a597b9 100644 --- a/test/fcolorpair-test.cpp +++ b/test/fcolorpair-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fcolorpair-test.cpp - FColorPair unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/fkeyboard-test.cpp b/test/fkeyboard-test.cpp index 1f171f80..22de3452 100644 --- a/test/fkeyboard-test.cpp +++ b/test/fkeyboard-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fkeyboard-test.cpp - FKeyboard unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/flogger-test.cpp b/test/flogger-test.cpp index b14a3183..74bfc55d 100644 --- a/test/flogger-test.cpp +++ b/test/flogger-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * flogger-test.cpp - FLogger unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/fmouse-test.cpp b/test/fmouse-test.cpp index 77aeb2f1..230258fe 100644 --- a/test/fmouse-test.cpp +++ b/test/fmouse-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fmouse-test.cpp - FMouse unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/fobject-test.cpp b/test/fobject-test.cpp index 832070f3..a9ca10ea 100644 --- a/test/fobject-test.cpp +++ b/test/fobject-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fobject-test.cpp - FPoint unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/foptiattr-test.cpp b/test/foptiattr-test.cpp index 029be482..ad366311 100644 --- a/test/foptiattr-test.cpp +++ b/test/foptiattr-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * foptiattr_test.cpp - FOptiAttr unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2019 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/foptimove-test.cpp b/test/foptimove-test.cpp index 750e1479..35c8f0a8 100644 --- a/test/foptimove-test.cpp +++ b/test/foptimove-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * foptimove-test.cpp - FOptiMove unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2019 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/fpoint-test.cpp b/test/fpoint-test.cpp index eb1d1f5b..7d9a917a 100644 --- a/test/fpoint-test.cpp +++ b/test/fpoint-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fpoint-test.cpp - FPoint unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/frect-test.cpp b/test/frect-test.cpp index 71fb5b77..7ce7abef 100644 --- a/test/frect-test.cpp +++ b/test/frect-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * frect-test.cpp - FRect unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/fsize-test.cpp b/test/fsize-test.cpp index 96295535..6189fd4d 100644 --- a/test/fsize-test.cpp +++ b/test/fsize-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fsize-test.cpp - FSize unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/fstring-test.cpp b/test/fstring-test.cpp index 8e7c9d28..1a06b2d7 100644 --- a/test/fstring-test.cpp +++ b/test/fstring-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fstring-test.cpp - FString unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/fstringstream-test.cpp b/test/fstringstream-test.cpp index 4b12156e..fce07dc7 100644 --- a/test/fstringstream-test.cpp +++ b/test/fstringstream-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fstringstream-test.cpp - FStringStream unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/fstyle-test.cpp b/test/fstyle-test.cpp index 67dbd1d6..cace39df 100644 --- a/test/fstyle-test.cpp +++ b/test/fstyle-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * fstyle-test.cpp - FStyle unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019 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 * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/ftermcapquirks-test.cpp b/test/ftermcapquirks-test.cpp index fcef6438..05c265e7 100644 --- a/test/ftermcapquirks-test.cpp +++ b/test/ftermcapquirks-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermcapquirks-test.cpp - FTermcapQuirks unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2019 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/ftermdata-test.cpp b/test/ftermdata-test.cpp index e8f1b3f1..d556268b 100644 --- a/test/ftermdata-test.cpp +++ b/test/ftermdata-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermdata-test.cpp - FTermData unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/ftermdetection-test.cpp b/test/ftermdetection-test.cpp index 4eb56e84..8d445403 100644 --- a/test/ftermdetection-test.cpp +++ b/test/ftermdetection-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermdetection-test.cpp - FTermDetection unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2018-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/ftermfreebsd-test.cpp b/test/ftermfreebsd-test.cpp index 3264306e..3d19e7a7 100644 --- a/test/ftermfreebsd-test.cpp +++ b/test/ftermfreebsd-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermfreebsd-test.cpp - FTermFreeBSD unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/ftermlinux-test.cpp b/test/ftermlinux-test.cpp index 7c55a74a..1d5f4f76 100644 --- a/test/ftermlinux-test.cpp +++ b/test/ftermlinux-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermlinux-test.cpp - FTermLinux unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * diff --git a/test/ftermopenbsd-test.cpp b/test/ftermopenbsd-test.cpp index 81dd762c..374982b2 100644 --- a/test/ftermopenbsd-test.cpp +++ b/test/ftermopenbsd-test.cpp @@ -1,17 +1,17 @@ /*********************************************************************** * ftermopenbsd-test.cpp - FTermOpenBSD unit tests * * * -* This file is part of the Final Cut widget toolkit * +* This file is part of the FINAL CUT widget toolkit * * * * Copyright 2019-2020 Markus Gans * * * -* The Final Cut is free software; you can redistribute it and/or * -* modify it under the terms of the GNU Lesser General Public License * -* as published by the Free Software Foundation; either version 3 of * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * -* The Final Cut is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* FINAL CUT is distributed in the hope that it will be useful, but * +* WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * From 361f0e6a1458fd9d817b8baa7879aa5910382a38 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 12 Jul 2020 15:25:21 +0200 Subject: [PATCH 10/28] More function declared as const --- examples/calculator.cpp | 12 ++++----- examples/event-log.cpp | 4 +-- examples/mouse.cpp | 12 ++++----- examples/rotozoomer.cpp | 4 +-- examples/term-attributes.cpp | 4 +-- examples/ui.cpp | 20 +++++++-------- examples/windows.cpp | 4 +-- src/fapplication.cpp | 36 +++++++++++++-------------- src/fbutton.cpp | 2 +- src/fbuttongroup.cpp | 2 +- src/fcolorpalette.cpp | 2 +- src/fdialog.cpp | 2 +- src/ffiledialog.cpp | 8 +++--- src/fkeyboard.cpp | 8 +++--- src/flabel.cpp | 4 +-- src/flineedit.cpp | 8 +++--- src/flistbox.cpp | 8 +++--- src/flistview.cpp | 14 +++++------ src/flogger.cpp | 4 +-- src/fmenu.cpp | 12 ++++----- src/fmenubar.cpp | 10 ++++---- src/fmenuitem.cpp | 6 ++--- src/fmessagebox.cpp | 2 +- src/fmouse.cpp | 22 ++++++++--------- src/fobject.cpp | 6 ++--- src/foptiattr.cpp | 10 ++++---- src/foptimove.cpp | 8 +++--- src/fscrollbar.cpp | 6 ++--- src/fscrollview.cpp | 8 +++--- src/fstatusbar.cpp | 4 +-- src/fstring.cpp | 39 +++++++++++++++++------------- src/fterm.cpp | 12 ++++----- src/ftermbuffer.cpp | 6 ++--- src/ftermlinux.cpp | 26 ++++++++++---------- src/ftermxterminal.cpp | 2 +- src/ftextview.cpp | 10 ++++---- src/ftogglebutton.cpp | 2 +- src/fvterm.cpp | 26 ++++++++++---------- src/fwidget.cpp | 10 ++++---- src/fwindow.cpp | 2 +- src/include/final/fapplication.h | 36 +++++++++++++-------------- src/include/final/fbutton.h | 2 +- src/include/final/fbuttongroup.h | 2 +- src/include/final/fcolorpalette.h | 2 +- src/include/final/fdata.h | 33 +++++++++++++++++++------ src/include/final/fdialog.h | 2 +- src/include/final/ffiledialog.h | 8 +++--- src/include/final/fkeyboard.h | 14 +++++------ src/include/final/flabel.h | 8 +++--- src/include/final/flineedit.h | 10 ++++---- src/include/final/flistbox.h | 20 +++++++-------- src/include/final/flistview.h | 22 ++++++++--------- src/include/final/flog.h | 8 +++--- src/include/final/flogger.h | 4 +-- src/include/final/fmenu.h | 12 ++++----- src/include/final/fmenubar.h | 10 ++++---- src/include/final/fmenuitem.h | 6 ++--- src/include/final/fmessagebox.h | 2 +- src/include/final/fmouse.h | 26 ++++++++++---------- src/include/final/fobject.h | 6 ++--- src/include/final/foptiattr.h | 10 ++++---- src/include/final/foptimove.h | 8 +++--- src/include/final/fprogressbar.h | 4 +-- src/include/final/fscrollbar.h | 6 ++--- src/include/final/fscrollview.h | 12 ++++----- src/include/final/fspinbox.h | 4 +-- src/include/final/fstatusbar.h | 4 +-- src/include/final/fstring.h | 33 +++++++++++++------------ src/include/final/fterm.h | 18 +++++--------- src/include/final/ftermbuffer.h | 4 +-- src/include/final/ftermdata.h | 8 +++--- src/include/final/ftermlinux.h | 26 ++++++++++---------- src/include/final/ftermxterminal.h | 6 ++--- src/include/final/ftextview.h | 10 ++++---- src/include/final/ftogglebutton.h | 2 +- src/include/final/ftypes.h | 9 ++----- src/include/final/fvterm.h | 35 ++++++++++++++------------- src/include/final/fwidget.h | 28 ++++++++++----------- src/include/final/fwindow.h | 2 +- 79 files changed, 431 insertions(+), 418 deletions(-) diff --git a/examples/calculator.cpp b/examples/calculator.cpp index b637d85d..1c9eb947 100644 --- a/examples/calculator.cpp +++ b/examples/calculator.cpp @@ -207,15 +207,15 @@ class Calc final : public finalcut::FDialog void sine (lDouble&); void cosine (lDouble&); void tangent (lDouble&); - bool isDataEntryKey (int); - bool isOperatorKey (int); + bool isDataEntryKey (int) const; + bool isOperatorKey (int) const; lDouble& getValue(); void setDisplay (lDouble); void setInfixOperator (char); void clearInfixOperator(); void calcInfixOperator(); void adjustSize() override; - const wchar_t* getButtonText (const std::size_t); + const wchar_t* getButtonText (const std::size_t) const; void mapKeyFunctions(); // Data members @@ -941,7 +941,7 @@ void Calc::draw() } //---------------------------------------------------------------------- -bool Calc::isDataEntryKey (int key) +bool Calc::isDataEntryKey (int key) const { // Test if key is in {'.', '0'..'9'} const int data_entry_keys[] = @@ -968,7 +968,7 @@ bool Calc::isDataEntryKey (int key) } //---------------------------------------------------------------------- -bool Calc::isOperatorKey(int key) +bool Calc::isOperatorKey(int key) const { // Test if key is in {'*', '/', '+', '-', '^', '='} const int operators[] = @@ -1091,7 +1091,7 @@ void Calc::adjustSize() } //---------------------------------------------------------------------- -const wchar_t* Calc::getButtonText (const std::size_t key) +const wchar_t* Calc::getButtonText (const std::size_t key) const { static const wchar_t* const button_text[Calc::NUM_OF_BUTTONS] = { diff --git a/examples/event-log.cpp b/examples/event-log.cpp index a7ec3ec2..ee9284c8 100644 --- a/examples/event-log.cpp +++ b/examples/event-log.cpp @@ -58,7 +58,7 @@ class EventDialog final : public finalcut::FDialog private: // Methods - finalcut::FString getMouseButtonName (int); + finalcut::FString getMouseButtonName (int) const; void logMouseEvent ( const finalcut::FString& , const finalcut::FMouseEvent& ); @@ -103,7 +103,7 @@ EventDialog::~EventDialog() // destructor { } //---------------------------------------------------------------------- -finalcut::FString EventDialog::getMouseButtonName (int btn_state) +finalcut::FString EventDialog::getMouseButtonName (int btn_state) const { switch ( btn_state ) { diff --git a/examples/mouse.cpp b/examples/mouse.cpp index 16752c71..0992392b 100644 --- a/examples/mouse.cpp +++ b/examples/mouse.cpp @@ -49,8 +49,8 @@ class ColorChooser final : public finalcut::FWidget ColorChooser& operator = (const ColorChooser&) = delete; // Accessors - FColor getForeground(); - FColor getBackground(); + FColor getForeground() const; + FColor getBackground() const; private: // Mutator @@ -90,13 +90,13 @@ ColorChooser::~ColorChooser() { } //---------------------------------------------------------------------- -inline FColor ColorChooser::getForeground() +inline FColor ColorChooser::getForeground() const { return fg_color; } //---------------------------------------------------------------------- -inline FColor ColorChooser::getBackground() +inline FColor ColorChooser::getBackground() const { return bg_color; } @@ -192,7 +192,7 @@ class Brushes final : public finalcut::FWidget Brushes& operator = (const Brushes&) = delete; // Accessor - wchar_t getBrush(); + wchar_t getBrush() const; // Mutators void setForeground (FColor); @@ -293,7 +293,7 @@ void Brushes::onMouseDown (finalcut::FMouseEvent* ev) } //---------------------------------------------------------------------- -inline wchar_t Brushes::getBrush() +inline wchar_t Brushes::getBrush() const { return brush; } diff --git a/examples/rotozoomer.cpp b/examples/rotozoomer.cpp index 13ab5e1f..99f3d462 100644 --- a/examples/rotozoomer.cpp +++ b/examples/rotozoomer.cpp @@ -52,7 +52,7 @@ class RotoZoomer final : public finalcut::FDialog ~RotoZoomer() override; // Accessors - finalcut::FString getReport(); + finalcut::FString getReport() const; // Event handlers void onShow (finalcut::FShowEvent*) override; @@ -202,7 +202,7 @@ void RotoZoomer::generateReport() } //---------------------------------------------------------------------- -inline finalcut::FString RotoZoomer::getReport() +inline finalcut::FString RotoZoomer::getReport() const { return report; } diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp index c7a18c6b..a40a4dd2 100644 --- a/examples/term-attributes.cpp +++ b/examples/term-attributes.cpp @@ -50,7 +50,7 @@ class AttribDlg final : public finalcut::FDialog AttribDlg& operator = (const AttribDlg&) = delete; // Methods - FColor getBGColor(); + FColor getBGColor() const; // Event handlers void onKeyPress (finalcut::FKeyEvent*) override; @@ -105,7 +105,7 @@ AttribDlg::~AttribDlg() { } //---------------------------------------------------------------------- -FColor AttribDlg::getBGColor() +FColor AttribDlg::getBGColor() const { return bgcolor; } diff --git a/examples/ui.cpp b/examples/ui.cpp index f223c5af..9399431e 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -301,14 +301,14 @@ class MyDialog final : public finalcut::FDialog void cb_copyClipboard (const finalcut::FWidget*, const FDataPtr); void cb_pasteClipboard (const finalcut::FWidget*, const FDataPtr); void cb_clearInput (const finalcut::FWidget*, const FDataPtr); - void cb_switchTheme (const finalcut::FWidget*, const FDataPtr); - void cb_input2buttonText (finalcut::FWidget*, FDataPtr); + void cb_switchTheme (const finalcut::FWidget*, const FDataPtr) const; + void cb_input2buttonText (finalcut::FWidget*, FDataPtr) const; void cb_setTitlebar (finalcut::FWidget*, const FDataPtr); void cb_showProgressBar (const finalcut::FWidget*, const FDataPtr); - void cb_updateNumber (finalcut::FWidget*, FDataPtr); - void cb_activateButton (finalcut::FWidget*, FDataPtr); + void cb_updateNumber (finalcut::FWidget*, FDataPtr) const; + void cb_activateButton (finalcut::FWidget*, FDataPtr) const; void cb_view (const finalcut::FWidget*, FDataPtr); - void cb_setInput (finalcut::FWidget*, FDataPtr); + void cb_setInput (finalcut::FWidget*, FDataPtr) const; // Data members bool initialized{false}; @@ -916,7 +916,7 @@ void MyDialog::cb_clearInput (const finalcut::FWidget*, const FDataPtr) } //---------------------------------------------------------------------- -void MyDialog::cb_switchTheme (const finalcut::FWidget* widget, const FDataPtr) +void MyDialog::cb_switchTheme (const finalcut::FWidget* widget, const FDataPtr) const { const auto& check_menu = *(static_cast(widget)); @@ -931,7 +931,7 @@ void MyDialog::cb_switchTheme (const finalcut::FWidget* widget, const FDataPtr) } //---------------------------------------------------------------------- -void MyDialog::cb_input2buttonText (finalcut::FWidget* widget, FDataPtr data) +void MyDialog::cb_input2buttonText (finalcut::FWidget* widget, FDataPtr data) const { auto& button = *(static_cast(widget)); const auto& lineedit = *(static_cast(data)); @@ -958,7 +958,7 @@ void MyDialog::cb_showProgressBar (const finalcut::FWidget*, const FDataPtr) } //---------------------------------------------------------------------- -void MyDialog::cb_updateNumber (finalcut::FWidget* widget, FDataPtr data) +void MyDialog::cb_updateNumber (finalcut::FWidget* widget, FDataPtr data) const { const auto& list = *(static_cast(widget)); auto& num = *(static_cast(data)); @@ -975,7 +975,7 @@ void MyDialog::cb_updateNumber (finalcut::FWidget* widget, FDataPtr data) } //---------------------------------------------------------------------- -void MyDialog::cb_activateButton (finalcut::FWidget* widget, FDataPtr data) +void MyDialog::cb_activateButton (finalcut::FWidget* widget, FDataPtr data) const { const auto& rb = *(static_cast(widget)); auto& button = *(static_cast(data)); @@ -1026,7 +1026,7 @@ void MyDialog::cb_view (const finalcut::FWidget*, FDataPtr data) } //---------------------------------------------------------------------- -void MyDialog::cb_setInput (finalcut::FWidget* widget, FDataPtr data) +void MyDialog::cb_setInput (finalcut::FWidget* widget, FDataPtr data) const { auto& ListBox = *(static_cast(widget)); auto& lineedit = *(static_cast(data)); diff --git a/examples/windows.cpp b/examples/windows.cpp index d624fc9a..491c5246 100644 --- a/examples/windows.cpp +++ b/examples/windows.cpp @@ -216,7 +216,7 @@ class Window final : public finalcut::FDialog void cb_closeWindows (const finalcut::FWidget*, const FDataPtr); void cb_next (const finalcut::FWidget*, const FDataPtr); void cb_previous (const finalcut::FWidget*, const FDataPtr); - void cb_destroyWindow (const finalcut::FWidget*, FDataPtr); + void cb_destroyWindow (const finalcut::FWidget*, FDataPtr) const; // Data members std::vector windows{}; @@ -542,7 +542,7 @@ void Window::cb_previous (const finalcut::FWidget*, const FDataPtr) } //---------------------------------------------------------------------- -void Window::cb_destroyWindow (const finalcut::FWidget*, FDataPtr data) +void Window::cb_destroyWindow (const finalcut::FWidget*, FDataPtr data) const { auto win_dat = static_cast(data); diff --git a/src/fapplication.cpp b/src/fapplication.cpp index 251f0a9c..e1519430 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -174,7 +174,7 @@ int FApplication::enterLoop() // event loop } //---------------------------------------------------------------------- -void FApplication::exitLoop() +void FApplication::exitLoop() const { app_exit_loop = true; } @@ -187,7 +187,7 @@ void FApplication::exit (int retcode) } //---------------------------------------------------------------------- -void FApplication::quit() +void FApplication::quit() const { FApplication::exit(0); } @@ -231,7 +231,7 @@ void FApplication::sendQueuedEvents() } //---------------------------------------------------------------------- -bool FApplication::eventInQueue() +bool FApplication::eventInQueue() const { if ( app_object ) return ( ! event_queue.empty() ); @@ -571,7 +571,7 @@ inline void FApplication::destroyLog() } //---------------------------------------------------------------------- -inline void FApplication::findKeyboardWidget() +inline void FApplication::findKeyboardWidget() const { // Find the widget that has the keyboard focus @@ -675,7 +675,7 @@ inline void FApplication::performKeyboardAction() } //---------------------------------------------------------------------- -inline void FApplication::sendEscapeKeyPressEvent() +inline void FApplication::sendEscapeKeyPressEvent() const { // Send an escape key press event FKeyEvent k_press_ev (fc::KeyPress_Event, fc::Fkey_escape); @@ -683,7 +683,7 @@ inline void FApplication::sendEscapeKeyPressEvent() } //---------------------------------------------------------------------- -inline bool FApplication::sendKeyDownEvent (FWidget* widget) +inline bool FApplication::sendKeyDownEvent (FWidget* widget) const { // Send key down event FKeyEvent k_down_ev (fc::KeyDown_Event, keyboard->getKey()); @@ -692,7 +692,7 @@ inline bool FApplication::sendKeyDownEvent (FWidget* widget) } //---------------------------------------------------------------------- -inline bool FApplication::sendKeyPressEvent (FWidget* widget) +inline bool FApplication::sendKeyPressEvent (FWidget* widget) const { // Send key press event FKeyEvent k_press_ev (fc::KeyPress_Event, keyboard->getKey()); @@ -701,7 +701,7 @@ inline bool FApplication::sendKeyPressEvent (FWidget* widget) } //---------------------------------------------------------------------- -inline bool FApplication::sendKeyUpEvent (FWidget* widget) +inline bool FApplication::sendKeyUpEvent (FWidget* widget) const { // Send key up event FKeyEvent k_up_ev (fc::KeyUp_Event, keyboard->getKey()); @@ -753,7 +753,7 @@ void FApplication::processKeyboardEvent() } //---------------------------------------------------------------------- -bool FApplication::processDialogSwitchAccelerator() +bool FApplication::processDialogSwitchAccelerator() const { if ( keyboard->getKey() >= fc::Fmkey_1 && keyboard->getKey() <= fc::Fmkey_9 ) @@ -784,7 +784,7 @@ bool FApplication::processDialogSwitchAccelerator() } //---------------------------------------------------------------------- -bool FApplication::processAccelerator (const FWidget* const& widget) +bool FApplication::processAccelerator (const FWidget* const& widget) const { bool accpt{false}; @@ -822,7 +822,7 @@ bool FApplication::processAccelerator (const FWidget* const& widget) } //---------------------------------------------------------------------- -bool FApplication::getMouseEvent() +bool FApplication::getMouseEvent() const { bool mouse_event_occurred{false}; @@ -870,7 +870,7 @@ FWidget*& FApplication::determineClickedWidget() } //---------------------------------------------------------------------- -void FApplication::unsetMoveSizeMode() +void FApplication::unsetMoveSizeMode() const { // Unset the move/size mode @@ -972,7 +972,7 @@ void FApplication::sendMouseEvent() //---------------------------------------------------------------------- void FApplication::sendMouseMoveEvent ( const FPoint& widgetMousePos , const FPoint& mouse_position - , int key_state ) + , int key_state ) const { if ( ! mouse ) return; @@ -1010,7 +1010,7 @@ void FApplication::sendMouseMoveEvent ( const FPoint& widgetMousePos //---------------------------------------------------------------------- void FApplication::sendMouseLeftClickEvent ( const FPoint& widgetMousePos , const FPoint& mouse_position - , int key_state ) + , int key_state ) const { if ( ! mouse ) return; @@ -1052,7 +1052,7 @@ void FApplication::sendMouseLeftClickEvent ( const FPoint& widgetMousePos //---------------------------------------------------------------------- void FApplication::sendMouseRightClickEvent ( const FPoint& widgetMousePos , const FPoint& mouse_position - , int key_state ) + , int key_state ) const { if ( ! mouse ) return; @@ -1086,7 +1086,7 @@ void FApplication::sendMouseRightClickEvent ( const FPoint& widgetMousePos //---------------------------------------------------------------------- void FApplication::sendMouseMiddleClickEvent ( const FPoint& widgetMousePos , const FPoint& mouse_position - , int key_state ) + , int key_state ) const { if ( ! mouse ) return; @@ -1125,7 +1125,7 @@ void FApplication::sendMouseMiddleClickEvent ( const FPoint& widgetMousePos //---------------------------------------------------------------------- void FApplication::sendWheelEvent ( const FPoint& widgetMousePos - , const FPoint& mouse_position ) + , const FPoint& mouse_position ) const { if ( ! mouse ) return; @@ -1226,7 +1226,7 @@ void FApplication::processCloseWidget() } //---------------------------------------------------------------------- -void FApplication::processLogger() +void FApplication::processLogger() const { // Synchronizing the stream buffer with the logging output diff --git a/src/fbutton.cpp b/src/fbutton.cpp index 2848c43c..753b2f7e 100644 --- a/src/fbutton.cpp +++ b/src/fbutton.cpp @@ -670,7 +670,7 @@ void FButton::draw() } //---------------------------------------------------------------------- -void FButton::updateStatusBar() +void FButton::updateStatusBar() const { if ( ! getFlags().focus || ! getStatusBar() ) return; diff --git a/src/fbuttongroup.cpp b/src/fbuttongroup.cpp index 7daeb8f6..303a2a21 100644 --- a/src/fbuttongroup.cpp +++ b/src/fbuttongroup.cpp @@ -542,7 +542,7 @@ void FButtonGroup::directFocus() } //---------------------------------------------------------------------- -void FButtonGroup::cb_buttonToggled (FWidget* widget, const FDataPtr) +void FButtonGroup::cb_buttonToggled (FWidget* widget, const FDataPtr) const { const auto& button = static_cast(widget); diff --git a/src/fcolorpalette.cpp b/src/fcolorpalette.cpp index 9180dbdc..e0e5fcf0 100644 --- a/src/fcolorpalette.cpp +++ b/src/fcolorpalette.cpp @@ -42,7 +42,7 @@ FColorPalette::~FColorPalette() // destructor // protected methods of FColorPalette //---------------------------------------------------------------------- -void FColorPalette::setPalette (FColor index, int r, int g, int b) +void FColorPalette::setPalette (FColor index, int r, int g, int b) const { set_palette (index, r, g, b); } diff --git a/src/fdialog.cpp b/src/fdialog.cpp index 59d3d93c..0e131c53 100644 --- a/src/fdialog.cpp +++ b/src/fdialog.cpp @@ -1270,7 +1270,7 @@ void FDialog::setZoomItem() } //---------------------------------------------------------------------- -inline std::size_t FDialog::getZoomButtonWidth() +inline std::size_t FDialog::getZoomButtonWidth() const { if ( ! isResizeable() ) return 0; diff --git a/src/ffiledialog.cpp b/src/ffiledialog.cpp index 565cfa0d..69cbb4d5 100644 --- a/src/ffiledialog.cpp +++ b/src/ffiledialog.cpp @@ -415,8 +415,8 @@ void FFileDialog::initCallbacks() } //---------------------------------------------------------------------- -inline bool FFileDialog::pattern_match ( const char* const pattern - , const char fname[] ) +inline bool FFileDialog::patternMatch ( const char* const pattern + , const char fname[] ) const { char search[128]{}; @@ -583,14 +583,14 @@ void FFileDialog::getEntry (const char* const dir, const struct dirent* d_entry) if ( entry.directory ) dir_entries.push_back (entry); - else if ( pattern_match(filter, entry.name.c_str()) ) + else if ( patternMatch(filter, entry.name.c_str()) ) dir_entries.push_back (entry); else entry.name.clear(); } //---------------------------------------------------------------------- -void FFileDialog::followSymLink (const char* const dir, FDirEntry& entry) +void FFileDialog::followSymLink (const char* const dir, FDirEntry& entry) const { if ( ! entry.symbolic_link ) return; // No symbolic link diff --git a/src/fkeyboard.cpp b/src/fkeyboard.cpp index 52afbfcd..039c18bc 100644 --- a/src/fkeyboard.cpp +++ b/src/fkeyboard.cpp @@ -82,7 +82,7 @@ void FKeyboard::fetchKeyCode() } //---------------------------------------------------------------------- -const FString FKeyboard::getKeyName (const FKey keynum) +const FString FKeyboard::getKeyName (const FKey keynum) const { for (std::size_t i{0}; fc::fkeyname[i].string[0] != 0; i++) if ( fc::fkeyname[i].num && fc::fkeyname[i].num == keynum ) @@ -179,7 +179,7 @@ void FKeyboard::escapeKeyHandling() // private methods of FKeyboard //---------------------------------------------------------------------- -inline FKey FKeyboard::getMouseProtocolKey() +inline FKey FKeyboard::getMouseProtocolKey() const { // Looking for mouse string in the key buffer @@ -357,7 +357,7 @@ bool FKeyboard::isKeypressTimeout() } //---------------------------------------------------------------------- -FKey FKeyboard::UTF8decode (const char utf8[]) +FKey FKeyboard::UTF8decode (const char utf8[]) const { FKey ucs{0}; // Universal coded character constexpr std::size_t max = 4; @@ -488,7 +488,7 @@ FKey FKeyboard::parseKeyString() } //---------------------------------------------------------------------- -FKey FKeyboard::keyCorrection (const FKey& keycode) +FKey FKeyboard::keyCorrection (const FKey& keycode) const { FKey key_correction; diff --git a/src/flabel.cpp b/src/flabel.cpp index ad3621fe..d388abb1 100644 --- a/src/flabel.cpp +++ b/src/flabel.cpp @@ -83,7 +83,7 @@ FLabel& FLabel::operator << (const wchar_t c) } //---------------------------------------------------------------------- -const FLabel& FLabel::operator >> (FString& s) +const FLabel& FLabel::operator >> (FString& s) const { s += text; return *this; @@ -266,7 +266,7 @@ void FLabel::setHotkeyAccelerator() } //---------------------------------------------------------------------- -std::size_t FLabel::getAlignOffset (const std::size_t length) +std::size_t FLabel::getAlignOffset (const std::size_t length) const { const std::size_t width(getWidth()); assert ( alignment == fc::alignLeft diff --git a/src/flineedit.cpp b/src/flineedit.cpp index c5e3984e..81823bee 100644 --- a/src/flineedit.cpp +++ b/src/flineedit.cpp @@ -88,7 +88,7 @@ FLineEdit& FLineEdit::operator << (const wchar_t c) } //---------------------------------------------------------------------- -const FLineEdit& FLineEdit::operator >> (FString& s) +const FLineEdit& FLineEdit::operator >> (FString& s) const { s += text; return *this; @@ -661,7 +661,7 @@ void FLineEdit::init() bool FLineEdit::hasHotkey() const { if ( label_text.isEmpty() ) - return 0; + return false; return label_text.includes('&'); } @@ -787,7 +787,7 @@ inline std::size_t FLineEdit::printPassword() } //---------------------------------------------------------------------- -inline std::size_t FLineEdit::getCursorColumnPos() +inline std::size_t FLineEdit::getCursorColumnPos() const { if ( input_type == FLineEdit::textfield ) { @@ -1104,7 +1104,7 @@ inline bool FLineEdit::keyInput (FKey key) } //---------------------------------------------------------------------- -inline wchar_t FLineEdit::characterFilter (const wchar_t c) +inline wchar_t FLineEdit::characterFilter (const wchar_t c) const { if ( input_filter.empty() ) return c; diff --git a/src/flistbox.cpp b/src/flistbox.cpp index 45234365..7f4415e5 100644 --- a/src/flistbox.cpp +++ b/src/flistbox.cpp @@ -766,7 +766,7 @@ void FListBox::drawBorder() } //---------------------------------------------------------------------- -void FListBox::drawScrollbars() +void FListBox::drawScrollbars() const { if ( ! hbar->isShown() && isHorizontallyScrollable() ) hbar->show(); @@ -1061,7 +1061,7 @@ inline void FListBox::setLineAttributes ( int y } //---------------------------------------------------------------------- -inline void FListBox::unsetAttributes() +inline void FListBox::unsetAttributes() const { if ( FTerm::isMonochron() ) // unset for the last element setReverse(false); @@ -1120,7 +1120,7 @@ void FListBox::recalculateHorizontalBar (std::size_t len, bool has_brackets) } //---------------------------------------------------------------------- -void FListBox::recalculateVerticalBar (std::size_t element_count) +void FListBox::recalculateVerticalBar (std::size_t element_count) const { const int vmax = ( element_count + 2 > getHeight() ) ? int(element_count - getHeight() + 2) @@ -1714,7 +1714,7 @@ void FListBox::processChanged() } //---------------------------------------------------------------------- -void FListBox::changeOnResize() +void FListBox::changeOnResize() const { if ( FTerm::isNewFont() ) { diff --git a/src/flistview.cpp b/src/flistview.cpp index a61c6905..82134c89 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -310,7 +310,7 @@ FObject::iterator FListViewItem::insert (FListViewItem* child) //---------------------------------------------------------------------- FObject::iterator FListViewItem::insert ( FListViewItem* child - , iterator parent_iter ) + , iterator parent_iter ) const { if ( parent_iter == FListView::getNullIterator() ) return FListView::getNullIterator(); @@ -335,7 +335,7 @@ FObject::iterator FListViewItem::insert ( FListViewItem* child } //---------------------------------------------------------------------- -void FListViewItem::remove (FListViewItem* item) +void FListViewItem::remove (FListViewItem* item) const { if ( item == nullptr || item == *FListView::getNullIterator() ) return; @@ -696,7 +696,7 @@ FListView::~FListView() // destructor // public methods of FListView //---------------------------------------------------------------------- -std::size_t FListView::getCount() +std::size_t FListView::getCount() const { int n{0}; @@ -1585,7 +1585,7 @@ void FListView::sort (Compare cmp) //---------------------------------------------------------------------- std::size_t FListView::getAlignOffset ( const fc::text_alignment align , const std::size_t column_width - , const std::size_t width ) + , const std::size_t width ) const { assert ( align == fc::alignLeft || align == fc::alignCenter @@ -1892,7 +1892,7 @@ void FListView::clearList() //---------------------------------------------------------------------- inline void FListView::setLineAttributes ( bool is_current - , bool is_focus ) + , bool is_focus ) const { const auto& wc = getColorTheme(); setColor (wc->list_fg, wc->list_bg); @@ -1927,7 +1927,7 @@ inline void FListView::setLineAttributes ( bool is_current } //---------------------------------------------------------------------- -inline FString FListView::getCheckBox (const FListViewItem* item) +inline FString FListView::getCheckBox (const FListViewItem* item) const { FString checkbox{""}; @@ -2511,7 +2511,7 @@ void FListView::processChanged() } //---------------------------------------------------------------------- -void FListView::changeOnResize() +void FListView::changeOnResize() const { if ( FTerm::isNewFont() ) { diff --git a/src/flogger.cpp b/src/flogger.cpp index 59ac1948..4e74138d 100644 --- a/src/flogger.cpp +++ b/src/flogger.cpp @@ -42,7 +42,7 @@ FLogger::~FLogger() // destructor // private methods of FLogger //---------------------------------------------------------------------- void FLogger::newlineReplace ( std::string& str - , const std::string& replace_str ) + , const std::string& replace_str ) const { std::size_t pos{0}; std::size_t npos{std::string::npos}; @@ -56,7 +56,7 @@ void FLogger::newlineReplace ( std::string& str } //---------------------------------------------------------------------- -const std::string FLogger::getTimeString() +const std::string FLogger::getTimeString() const { char str[100]; const auto& now = std::chrono::system_clock::now(); diff --git a/src/fmenu.cpp b/src/fmenu.cpp index 81cd2a4c..a6e3b767 100644 --- a/src/fmenu.cpp +++ b/src/fmenu.cpp @@ -339,7 +339,7 @@ void FMenu::cb_menuitemDisabled (const FWidget*, const FDataPtr) } //---------------------------------------------------------------------- -void FMenu::cb_menuitemToggled (FWidget* widget, const FDataPtr) +void FMenu::cb_menuitemToggled (FWidget* widget, const FDataPtr) const { const auto& m_item = static_cast(widget); @@ -444,7 +444,7 @@ bool FMenu::isMouseOverSuperMenu (const FPoint& termpos) } //---------------------------------------------------------------------- -bool FMenu::isMouseOverMenuBar (const FPoint& termpos) +bool FMenu::isMouseOverMenuBar (const FPoint& termpos) const { if ( getMenuBar() && isMenuBar(getMenuBar()) @@ -563,7 +563,7 @@ void FMenu::calculateDimensions() } //---------------------------------------------------------------------- -void FMenu::adjustItems() +void FMenu::adjustItems() const { for (auto&& item : getItemList()) { @@ -980,7 +980,7 @@ void FMenu::passEventToSuperMenu (FMouseEvent* const& ev) } //---------------------------------------------------------------------- -void FMenu::passEventToMenuBar (FMouseEvent* const& ev) +void FMenu::passEventToMenuBar (FMouseEvent* const& ev) const { // Mouse event handover to the menu bar @@ -1145,7 +1145,7 @@ bool FMenu::selectPrevItem() } //---------------------------------------------------------------------- -void FMenu::keypressMenuBar (FKeyEvent* ev) +void FMenu::keypressMenuBar (FKeyEvent* ev) const { auto mbar = getMenuBar(); @@ -1491,7 +1491,7 @@ inline void FMenu::setLineAttributes (const FMenuItem* m_item, int y) } //---------------------------------------------------------------------- -inline void FMenu::setCursorToHotkeyPosition (FMenuItem* m_item) +inline void FMenu::setCursorToHotkeyPosition (FMenuItem* m_item) const { const bool is_checkable = m_item->checkable; const bool is_selected = m_item->isSelected(); diff --git a/src/fmenubar.cpp b/src/fmenubar.cpp index aa879619..3428425d 100644 --- a/src/fmenubar.cpp +++ b/src/fmenubar.cpp @@ -228,7 +228,7 @@ void FMenuBar::onAccel (FAccelEvent* ev) } //---------------------------------------------------------------------- -void FMenuBar::cb_itemDeactivated (FWidget* widget, const FDataPtr) +void FMenuBar::cb_itemDeactivated (FWidget* widget, const FDataPtr) const { auto menuitem = static_cast(widget); @@ -263,7 +263,7 @@ void FMenuBar::init() } //---------------------------------------------------------------------- -void FMenuBar::calculateDimensions() +void FMenuBar::calculateDimensions() const { FPoint item_pos{1, 1}; @@ -577,7 +577,7 @@ inline void FMenuBar::setLineAttributes (const FMenuItem* menuitem) //---------------------------------------------------------------------- inline void FMenuBar::setCursorToHotkeyPosition ( FMenuItem* menuitem - , std::size_t hotkeypos ) + , std::size_t hotkeypos ) const { if ( ! menuitem->isSelected() ) return; @@ -675,7 +675,7 @@ inline void FMenuBar::drawTrailingSpace (std::size_t& x) } //---------------------------------------------------------------------- -void FMenuBar::adjustItems() +void FMenuBar::adjustItems() const { int item_X = 1; int item_Y = 1; @@ -928,7 +928,7 @@ void FMenuBar::mouseMoveOverList (const FMouseEvent* ev) } //---------------------------------------------------------------------- -void FMenuBar::passEventToMenu (const FMouseEvent* const& ev) +void FMenuBar::passEventToMenu (const FMouseEvent* const& ev) const { if ( ! hasSelectedItem() || ! getSelectedItem()->hasMenu() ) return; diff --git a/src/fmenuitem.cpp b/src/fmenuitem.cpp index ae1b3cd3..3679fe33 100644 --- a/src/fmenuitem.cpp +++ b/src/fmenuitem.cpp @@ -591,7 +591,7 @@ void FMenuItem::processDeactivate() } //---------------------------------------------------------------------- -void FMenuItem::createDialogList (FMenu* winmenu) +void FMenuItem::createDialogList (FMenu* winmenu) const { winmenu->clear(); @@ -651,7 +651,7 @@ void FMenuItem::createDialogList (FMenu* winmenu) //---------------------------------------------------------------------- template void FMenuItem::passMouseEvent ( T widget, const FMouseEvent* ev - , fc::events ev_type ) + , fc::events ev_type ) const { if ( ! widget ) return; @@ -695,7 +695,7 @@ void FMenuItem::passMouseEvent ( T widget, const FMouseEvent* ev } //---------------------------------------------------------------------- -void FMenuItem::cb_switchToDialog (const FWidget*, FDataPtr data) +void FMenuItem::cb_switchToDialog (const FWidget*, FDataPtr data) const { auto win = static_cast(data); diff --git a/src/fmessagebox.cpp b/src/fmessagebox.cpp index 34851705..269be13e 100644 --- a/src/fmessagebox.cpp +++ b/src/fmessagebox.cpp @@ -384,7 +384,7 @@ void FMessageBox::draw() } //---------------------------------------------------------------------- -void FMessageBox::resizeButtons() +void FMessageBox::resizeButtons() const { std::size_t len[3]{}; std::size_t max_size{}; diff --git a/src/fmouse.cpp b/src/fmouse.cpp index 7b6fbaf1..5a104580 100644 --- a/src/fmouse.cpp +++ b/src/fmouse.cpp @@ -59,7 +59,7 @@ const FString FMouse::getClassName() const } //---------------------------------------------------------------------- -inline const FPoint& FMouse::getPos() +inline const FPoint& FMouse::getPos() const { return mouse; } @@ -89,7 +89,7 @@ inline void FMouse::setDblclickInterval (const uInt64 timeout) } //---------------------------------------------------------------------- -inline bool FMouse::hasEvent() +inline bool FMouse::hasEvent() const { return mouse_event_occurred; } @@ -172,7 +172,7 @@ inline bool FMouse::isMoved() } //---------------------------------------------------------------------- -inline bool FMouse::isInputDataPending() +inline bool FMouse::isInputDataPending() const { return input_data_pending; } @@ -193,25 +193,25 @@ inline FMouse::FMouseButton& FMouse::getButtonState() } //---------------------------------------------------------------------- -inline const FPoint& FMouse::getNewPos() +inline const FPoint& FMouse::getNewPos() const { return new_mouse_position; } //---------------------------------------------------------------------- -uInt16 FMouse::getMaxWidth() +uInt16 FMouse::getMaxWidth() const { return max_width; } //---------------------------------------------------------------------- -uInt16 FMouse::getMaxHeight() +uInt16 FMouse::getMaxHeight() const { return max_height; } //---------------------------------------------------------------------- -uInt64 FMouse::getDblclickInterval() +uInt64 FMouse::getDblclickInterval() const { return dblclick_interval; } @@ -260,7 +260,7 @@ void FMouse::setEvent() } //---------------------------------------------------------------------- -bool FMouse::isDblclickTimeout (const timeval* time) +bool FMouse::isDblclickTimeout (const timeval* time) const { return FObject::isTimeout (time, dblclick_interval); } @@ -397,7 +397,7 @@ bool FMouseGPM::gpmMouse (bool enable) } //---------------------------------------------------------------------- -bool FMouseGPM::hasSignificantEvents() +bool FMouseGPM::hasSignificantEvents() const { return ! (gpm_ev.type & GPM_MOVE) || gpm_ev.wdy != 0 @@ -483,7 +483,7 @@ void FMouseGPM::drawGpmPointer() } //---------------------------------------------------------------------- -int FMouseGPM::gpmEvent (bool clear) +int FMouseGPM::gpmEvent (bool clear) const { const int max = ( gpm_fd > stdin_no ) ? gpm_fd : stdin_no; fd_set ifds{}; @@ -1598,7 +1598,7 @@ FMouse* FMouseControl::getMouseWithEvent() } //---------------------------------------------------------------------- -void FMouseControl::xtermMouse (bool enable) +void FMouseControl::xtermMouse (bool enable) const { // activate/deactivate the xterm mouse support diff --git a/src/fobject.cpp b/src/fobject.cpp index d75d1878..3bdb4470 100644 --- a/src/fobject.cpp +++ b/src/fobject.cpp @@ -307,7 +307,7 @@ int FObject::addTimer (int interval) } //---------------------------------------------------------------------- -bool FObject::delTimer (int id) +bool FObject::delTimer (int id) const { // Deletes a timer by using the timer identifier number @@ -333,7 +333,7 @@ bool FObject::delTimer (int id) } //---------------------------------------------------------------------- -bool FObject::delOwnTimer() +bool FObject::delOwnTimer() const { // Deletes all timers of this object @@ -359,7 +359,7 @@ bool FObject::delOwnTimer() } //---------------------------------------------------------------------- -bool FObject::delAllTimer() +bool FObject::delAllTimer() const { // Deletes all timers of all objects diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp index d53d50a7..211772a9 100644 --- a/src/foptiattr.cpp +++ b/src/foptiattr.cpp @@ -1239,7 +1239,7 @@ inline bool FOptiAttr::hasColorChanged ( const FChar* const& term } //---------------------------------------------------------------------- -inline void FOptiAttr::resetColor (FChar*& attr) +inline void FOptiAttr::resetColor (FChar*& attr) const { if ( attr ) { @@ -1535,7 +1535,7 @@ inline void FOptiAttr::change_current_color ( const FChar* const& term } //---------------------------------------------------------------------- -inline void FOptiAttr::resetAttribute (FChar*& attr) +inline void FOptiAttr::resetAttribute (FChar*& attr) const { if ( attr ) { @@ -1555,7 +1555,7 @@ inline void FOptiAttr::reset (FChar*& attr) } //---------------------------------------------------------------------- -bool FOptiAttr::caused_reset_attributes (const char cap[], uChar test) +bool FOptiAttr::caused_reset_attributes (const char cap[], uChar test) const { // test if "cap" reset all attributes @@ -1648,14 +1648,14 @@ inline void FOptiAttr::detectSwitchOff (const FChar* const& term, const FChar* c } //---------------------------------------------------------------------- -inline bool FOptiAttr::switchOn() +inline bool FOptiAttr::switchOn() const { auto on_ptr = &on; return hasAttribute(on_ptr); } //---------------------------------------------------------------------- -inline bool FOptiAttr::switchOff() +inline bool FOptiAttr::switchOff() const { auto off_ptr = &off; return hasAttribute(off_ptr); diff --git a/src/foptimove.cpp b/src/foptimove.cpp index 95ce383c..8d45320b 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -463,7 +463,7 @@ void FOptiMove::set_clr_eol (const char cap[]) //---------------------------------------------------------------------- void FOptiMove::check_boundaries ( int& xold, int& yold - , int& xnew, int& ynew ) + , int& xnew, int& ynew ) const { if ( xold < 0 || xold >= int(screen_width) ) xold = -1; @@ -549,7 +549,7 @@ void FOptiMove::calculateCharDuration() } //---------------------------------------------------------------------- -int FOptiMove::capDuration (const char cap[], int affcnt) +int FOptiMove::capDuration (const char cap[], int affcnt) const { // calculate the duration in milliseconds of a given operation // cap - the term capability @@ -598,7 +598,7 @@ int FOptiMove::capDuration (const char cap[], int affcnt) } //---------------------------------------------------------------------- -int FOptiMove::capDurationToLength (int duration) +int FOptiMove::capDurationToLength (int duration) const { if ( duration != LONG_DURATION ) return (duration + char_duration - 1) / char_duration; @@ -609,7 +609,7 @@ int FOptiMove::capDurationToLength (int duration) //---------------------------------------------------------------------- int FOptiMove::repeatedAppend ( const capability& o , volatile int count - , char* dst ) + , char* dst ) const { const std::size_t src_len = std::strlen(o.cap); const std::size_t dst_len = ( dst != nullptr ) ? std::strlen(dst) : 0; diff --git a/src/fscrollbar.cpp b/src/fscrollbar.cpp index 3c96b6ce..43b3a004 100644 --- a/src/fscrollbar.cpp +++ b/src/fscrollbar.cpp @@ -626,7 +626,7 @@ FScrollbar::sType FScrollbar::getClickedScrollType (int x, int y) } //---------------------------------------------------------------------- -FScrollbar::sType FScrollbar::getVerticalClickedScrollType (int y) +FScrollbar::sType FScrollbar::getVerticalClickedScrollType (int y) const { if ( y == 1 ) { @@ -649,7 +649,7 @@ FScrollbar::sType FScrollbar::getVerticalClickedScrollType (int y) } //---------------------------------------------------------------------- -FScrollbar::sType FScrollbar::getHorizontalClickedScrollType (int x) +FScrollbar::sType FScrollbar::getHorizontalClickedScrollType (int x) const { if ( FTerm::isNewFont() ) { @@ -696,7 +696,7 @@ FScrollbar::sType FScrollbar::getHorizontalClickedScrollType (int x) } //---------------------------------------------------------------------- -int FScrollbar::getSliderClickPos (int mouse_x, int mouse_y) +int FScrollbar::getSliderClickPos (int mouse_x, int mouse_y) const { // Get the clicked position on the slider diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp index f5a1e30b..fb82aef3 100644 --- a/src/fscrollview.cpp +++ b/src/fscrollview.cpp @@ -694,7 +694,7 @@ void FScrollView::copy2area() // private methods of FScrollView //---------------------------------------------------------------------- -inline const FPoint FScrollView::getViewportCursorPos() +inline const FPoint FScrollView::getViewportCursorPos() const { const auto& window = FWindow::getWindowWidget(this); @@ -773,7 +773,7 @@ inline void FScrollView::mapKeyFunctions() } //---------------------------------------------------------------------- -void FScrollView::calculateScrollbarPos() +void FScrollView::calculateScrollbarPos() const { const std::size_t width = getWidth(); const std::size_t height = getHeight(); @@ -794,7 +794,7 @@ void FScrollView::calculateScrollbarPos() } //---------------------------------------------------------------------- -void FScrollView::setHorizontalScrollBarVisibility() +void FScrollView::setHorizontalScrollBarVisibility() const { assert ( v_mode == fc::Auto || v_mode == fc::Hidden @@ -820,7 +820,7 @@ void FScrollView::setHorizontalScrollBarVisibility() } //---------------------------------------------------------------------- -void FScrollView::setVerticalScrollBarVisibility() +void FScrollView::setVerticalScrollBarVisibility() const { assert ( v_mode == fc::Auto || v_mode == fc::Hidden diff --git a/src/fstatusbar.cpp b/src/fstatusbar.cpp index 03b6030f..806ce8be 100644 --- a/src/fstatusbar.cpp +++ b/src/fstatusbar.cpp @@ -528,14 +528,14 @@ void FStatusBar::init() } //---------------------------------------------------------------------- -int FStatusBar::getKeyNameWidth (const FStatusKey* key) +int FStatusBar::getKeyNameWidth (const FStatusKey* key) const { const FString& key_name = FTerm::getKeyName(key->getKey()); return int(getColumnWidth(key_name)); } //---------------------------------------------------------------------- -int FStatusBar::getKeyTextWidth (const FStatusKey* key) +int FStatusBar::getKeyTextWidth (const FStatusKey* key) const { const FString& key_text = key->getText(); return int(getColumnWidth(key_text)); diff --git a/src/fstring.cpp b/src/fstring.cpp index 55987c14..21eb6997 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp @@ -273,99 +273,104 @@ FString& FString::operator << (const char c) } //---------------------------------------------------------------------- -const FString& FString::operator >> (FString& s) +const FString& FString::operator >> (FString& s) const { s._insert (s.length, length, string); - _assign(s.string); return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (std::wstring& s) +const FString& FString::operator >> (std::wstring& s) const { s += std::wstring(string); return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (std::string& s) +const FString& FString::operator >> (std::string& s) const { s += toString(); return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (wchar_t& c) +const FString& FString::operator >> (wchar_t& c) const { c = ( length > 0 ) ? string[0] : L'\0'; return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (char& c) +const FString& FString::operator >> (char& c) const { c = ( length > 0 ) ? char(string[0] & 0xff) : '\0'; return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (sInt16& num) +const FString& FString::operator >> (sInt16& num) const { num = toShort(); return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (uInt16& num) +const FString& FString::operator >> (uInt16& num) const { num = toUShort(); return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (sInt32& num) +const FString& FString::operator >> (sInt32& num) const { num = toInt(); return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (uInt32& num) +const FString& FString::operator >> (uInt32& num) const { num = toUInt(); return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (sInt64& num) +const FString& FString::operator >> (sInt64& num) const { num = toLong(); return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (uInt64& num) +const FString& FString::operator >> (uInt64& num) const { num = toULong(); return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (double& num) +const FString& FString::operator >> (double& num) const { num = toDouble(); return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (float& num) +const FString& FString::operator >> (float& num) const { num = toFloat(); return *this; } //---------------------------------------------------------------------- -const FString& FString::operator () () +FString::operator bool () const +{ + return bool(string); +} + +//---------------------------------------------------------------------- +const FString& FString::operator () () const { return *this; } @@ -1034,7 +1039,7 @@ const FString& FString::insert (const FString& s, std::size_t pos) } //---------------------------------------------------------------------- -FString const FString::replace (const FString& from, const FString& to) +FString const FString::replace (const FString& from, const FString& to) const { FString s{*this}; @@ -1544,7 +1549,7 @@ inline const wchar_t* FString::_to_wcstring (const char s[]) const //---------------------------------------------------------------------- inline const wchar_t* FString::_extractToken ( wchar_t* rest[] , const wchar_t s[] - , const wchar_t delim[] ) + , const wchar_t delim[] ) const { wchar_t* token = ( s ) ? const_cast(s) : *rest; diff --git a/src/fterm.cpp b/src/fterm.cpp index 6cbe556c..e2ff12b2 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -2190,7 +2190,7 @@ void FTerm::useNormalScreenBuffer() } //---------------------------------------------------------------------- -inline void FTerm::allocationValues() +inline void FTerm::allocationValues() const { FStartOptions::getFStartOptions(); getFTermData(); @@ -2401,7 +2401,7 @@ bool FTerm::init_terminal() } //---------------------------------------------------------------------- -void FTerm::initOSspecifics() +void FTerm::initOSspecifics() const { #if defined(__linux__) linux->init(); // Initialize Linux console @@ -2435,7 +2435,7 @@ void FTerm::initOSspecifics() } //---------------------------------------------------------------------- -void FTerm::initTermspecifics() +void FTerm::initTermspecifics() const { if ( isKdeTerminal() ) setKDECursor(fc::UnderlineCursor); @@ -2448,7 +2448,7 @@ void FTerm::initTermspecifics() } //---------------------------------------------------------------------- -void FTerm::initBaudRate() +void FTerm::initBaudRate() const { const int stdout_no = FTermios::getStdOut(); const uInt baud = FTermios::getBaudRate(); @@ -2529,7 +2529,7 @@ void FTerm::finish() } //---------------------------------------------------------------------- -void FTerm::finishOSspecifics() +void FTerm::finishOSspecifics() const { #if defined(__linux__) linux->finish(); @@ -2541,7 +2541,7 @@ void FTerm::finishOSspecifics() } //---------------------------------------------------------------------- -void FTerm::finish_encoding() +void FTerm::finish_encoding() const { #if defined(__linux__) if ( isLinuxTerm() && data->hasUTF8Console() ) diff --git a/src/ftermbuffer.cpp b/src/ftermbuffer.cpp index 7dd82959..81c3ec88 100644 --- a/src/ftermbuffer.cpp +++ b/src/ftermbuffer.cpp @@ -92,9 +92,9 @@ int FTermBuffer::write (wchar_t ch) } //---------------------------------------------------------------------- -void FTermBuffer::write (const FStyle& style) +void FTermBuffer::write (const FStyle& style) const { - FAttribute attr = style.getStyle(); + FAttribute attr = style.getStyle(); if ( attr == 0 ) FVTerm::setNormal(); @@ -129,7 +129,7 @@ void FTermBuffer::write (const FStyle& style) } //---------------------------------------------------------------------- -void FTermBuffer::write (const FColorPair& pair) +void FTermBuffer::write (const FColorPair& pair) const { FVTerm::setColor(pair.getForegroundColor(), pair.getBackgroundColor()); } diff --git a/src/ftermlinux.cpp b/src/ftermlinux.cpp index f4263b2d..8023a248 100644 --- a/src/ftermlinux.cpp +++ b/src/ftermlinux.cpp @@ -63,7 +63,7 @@ FTermLinux::~FTermLinux() // destructor // public methods of FTermLinux //---------------------------------------------------------------------- #if defined(__linux__) -fc::linuxConsoleCursorStyle FTermLinux::getCursorStyle() +fc::linuxConsoleCursorStyle FTermLinux::getCursorStyle() const { // Get the current set cursor style @@ -102,7 +102,7 @@ bool FTermLinux::setCursorStyle (fc::linuxConsoleCursorStyle style) } //---------------------------------------------------------------------- -void FTermLinux::setUTF8 (bool enable) +void FTermLinux::setUTF8 (bool enable) const { if ( ! FTerm::isLinuxTerm() ) return; @@ -420,7 +420,7 @@ bool FTermLinux::resetColorMap() } //---------------------------------------------------------------------- -void FTermLinux::setBeep (int Hz, int ms) +void FTermLinux::setBeep (int Hz, int ms) const { if ( ! FTerm::isLinuxTerm() ) return; @@ -440,7 +440,7 @@ void FTermLinux::setBeep (int Hz, int ms) } //---------------------------------------------------------------------- -void FTermLinux::resetBeep() +void FTermLinux::resetBeep() const { if ( ! FTerm::isLinuxTerm() ) return; @@ -763,7 +763,7 @@ int FTermLinux::setUnicodeMap (struct unimapdesc* unimap) } //---------------------------------------------------------------------- -void FTermLinux::setLinuxCursorStyle (CursorStyle style) +void FTermLinux::setLinuxCursorStyle (CursorStyle style) const { FTerm::putstringf (CSI "?%dc", style); } @@ -1008,7 +1008,7 @@ bool FTermLinux::resetVGAPalette() #endif // defined(ISA_SYSCTL_SUPPORT) //---------------------------------------------------------------------- -FKey FTermLinux::shiftKeyCorrection (const FKey& key_id) +FKey FTermLinux::shiftKeyCorrection (const FKey& key_id) const { switch ( key_id ) { @@ -1048,7 +1048,7 @@ FKey FTermLinux::shiftKeyCorrection (const FKey& key_id) } //---------------------------------------------------------------------- -FKey FTermLinux::ctrlKeyCorrection (const FKey& key_id) +FKey FTermLinux::ctrlKeyCorrection (const FKey& key_id) const { switch ( key_id ) { @@ -1088,7 +1088,7 @@ FKey FTermLinux::ctrlKeyCorrection (const FKey& key_id) } //---------------------------------------------------------------------- -FKey FTermLinux::altKeyCorrection (const FKey& key_id) +FKey FTermLinux::altKeyCorrection (const FKey& key_id) const { switch ( key_id ) { @@ -1128,7 +1128,7 @@ FKey FTermLinux::altKeyCorrection (const FKey& key_id) } //---------------------------------------------------------------------- -FKey FTermLinux::shiftCtrlKeyCorrection (const FKey& key_id) +FKey FTermLinux::shiftCtrlKeyCorrection (const FKey& key_id) const { switch ( key_id ) { @@ -1168,7 +1168,7 @@ FKey FTermLinux::shiftCtrlKeyCorrection (const FKey& key_id) } //---------------------------------------------------------------------- -FKey FTermLinux::shiftAltKeyCorrection (const FKey& key_id) +FKey FTermLinux::shiftAltKeyCorrection (const FKey& key_id) const { switch ( key_id ) { @@ -1208,7 +1208,7 @@ FKey FTermLinux::shiftAltKeyCorrection (const FKey& key_id) } //---------------------------------------------------------------------- -FKey FTermLinux::ctrlAltKeyCorrection (const FKey& key_id) +FKey FTermLinux::ctrlAltKeyCorrection (const FKey& key_id) const { switch ( key_id ) { @@ -1248,7 +1248,7 @@ FKey FTermLinux::ctrlAltKeyCorrection (const FKey& key_id) } //---------------------------------------------------------------------- -FKey FTermLinux::shiftCtrlAltKeyCorrection (const FKey& key_id) +FKey FTermLinux::shiftCtrlAltKeyCorrection (const FKey& key_id) const { switch ( key_id ) { @@ -1315,7 +1315,7 @@ inline void FTermLinux::initSpecialCharacter() } //---------------------------------------------------------------------- -sInt16 FTermLinux::getFontPos (wchar_t ucs) +sInt16 FTermLinux::getFontPos (wchar_t ucs) const { constexpr sInt16 NOT_FOUND = -1; diff --git a/src/ftermxterminal.cpp b/src/ftermxterminal.cpp index e78669aa..2a501e2f 100644 --- a/src/ftermxterminal.cpp +++ b/src/ftermxterminal.cpp @@ -308,7 +308,7 @@ void FTermXTerminal::captureFontAndTitle() // private methods of FTermXTerminal //---------------------------------------------------------------------- -void FTermXTerminal::warnNotInitialized() +void FTermXTerminal::warnNotInitialized() const { *FApplication::getLog() << FLog::Warn << "The FTermXTerminal object has " diff --git a/src/ftextview.cpp b/src/ftextview.cpp index 50ef7d98..060ad2df 100644 --- a/src/ftextview.cpp +++ b/src/ftextview.cpp @@ -562,13 +562,13 @@ void FTextView::adjustSize() // private methods of FTextView //---------------------------------------------------------------------- -std::size_t FTextView::getTextHeight() +std::size_t FTextView::getTextHeight() const { return getHeight() - 2 + std::size_t(nf_offset); } //---------------------------------------------------------------------- -std::size_t FTextView::getTextWidth() +std::size_t FTextView::getTextWidth() const { return getWidth() - 2 - std::size_t(nf_offset); } @@ -702,7 +702,7 @@ void FTextView::drawText() } //---------------------------------------------------------------------- -inline bool FTextView::useFDialogBorder() +inline bool FTextView::useFDialogBorder() const { const auto& parent = getParentWidget(); bool use_fdialog_border{false}; @@ -722,7 +722,7 @@ inline bool FTextView::useFDialogBorder() } //---------------------------------------------------------------------- -inline bool FTextView::isPrintable (wchar_t ch) +inline bool FTextView::isPrintable (wchar_t ch) const { // Check for printable characters @@ -742,7 +742,7 @@ void FTextView::processChanged() } //---------------------------------------------------------------------- -void FTextView::changeOnResize() +void FTextView::changeOnResize() const { const std::size_t width = getWidth(); const std::size_t height = getHeight(); diff --git a/src/ftogglebutton.cpp b/src/ftogglebutton.cpp index 4c7e748f..c22314c6 100644 --- a/src/ftogglebutton.cpp +++ b/src/ftogglebutton.cpp @@ -533,7 +533,7 @@ void FToggleButton::drawText (const FString& label_text, std::size_t hotkeypos) } //---------------------------------------------------------------------- -void FToggleButton::correctSize (FSize& size) +void FToggleButton::correctSize (FSize& size) const { const std::size_t hotkey_mark = ( getHotkey(text) ) ? 1 : 0; const std::size_t column_width = getColumnWidth(text); diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 665ae218..94cc408c 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -117,7 +117,7 @@ const FPoint FVTerm::getPrintCursor() } //---------------------------------------------------------------------- -void FVTerm::setTermXY (int x, int y) +void FVTerm::setTermXY (int x, int y) const { // Sets the hardware cursor to the given (x,y) position @@ -168,7 +168,7 @@ void FVTerm::setTerminalUpdates (terminal_update refresh_state) } //---------------------------------------------------------------------- -void FVTerm::hideCursor (bool enable) +void FVTerm::hideCursor (bool enable) const { // Hides or shows the input cursor on the terminal @@ -194,7 +194,7 @@ void FVTerm::setPrintCursor (const FPoint& pos) } //---------------------------------------------------------------------- -FColor FVTerm::rgb2ColorIndex (uInt8 r, uInt8 g, uInt8 b) +FColor FVTerm::rgb2ColorIndex (uInt8 r, uInt8 g, uInt8 b) const { // Converts a 24-bit RGB color to a 256-color compatible approximation @@ -775,7 +775,7 @@ void FVTerm::resizeArea ( const FRect& box area->has_changes = false; const FSize size{full_width, full_height}; - setTextToDefault (area, size); + resetTextAreaToDefault (area, size); } //---------------------------------------------------------------------- @@ -1369,8 +1369,8 @@ void FVTerm::initTerminal() // private methods of FVTerm //---------------------------------------------------------------------- -inline void FVTerm::setTextToDefault ( const FTermArea* area - , const FSize& size ) +inline void FVTerm::resetTextAreaToDefault ( const FTermArea* area + , const FSize& size ) const { FChar default_char; FLineChanges unchanged; @@ -1751,7 +1751,7 @@ bool FVTerm::hasChildAreaChanges (FTermArea* area) const } //---------------------------------------------------------------------- -void FVTerm::clearChildAreaChanges (const FTermArea* area) +void FVTerm::clearChildAreaChanges (const FTermArea* area) const { if ( ! area ) return; @@ -2397,7 +2397,7 @@ void FVTerm::printRange ( uInt xmin, uInt xmax, uInt y //---------------------------------------------------------------------- inline void FVTerm::replaceNonPrintableFullwidth ( uInt x - , FChar*& print_char ) + , FChar*& print_char ) const { // Replace non-printable full-width characters that are truncated // from the right or left terminal side @@ -2564,7 +2564,7 @@ void FVTerm::printHalfCovertFullWidthCharacter ( uInt& x, uInt y //---------------------------------------------------------------------- inline void FVTerm::skipPaddingCharacter ( uInt& x, uInt y - , const FChar* const& print_char ) + , const FChar* const& print_char ) const { if ( isFullWidthChar(print_char) ) // full-width character { @@ -2740,7 +2740,7 @@ void FVTerm::cursorWrap() } //---------------------------------------------------------------------- -bool FVTerm::printWrap (FTermArea* area) +bool FVTerm::printWrap (FTermArea* area) const { bool end_of_area{false}; const int width = area->width; @@ -2882,7 +2882,7 @@ bool FVTerm::updateTerminalCursor() } //---------------------------------------------------------------------- -bool FVTerm::isInsideTerminal (const FPoint& pos) +bool FVTerm::isInsideTerminal (const FPoint& pos) const { // Check whether the coordinates are within the virtual terminal @@ -2895,7 +2895,7 @@ bool FVTerm::isInsideTerminal (const FPoint& pos) } //---------------------------------------------------------------------- -inline bool FVTerm::isTermSizeChanged() +inline bool FVTerm::isTermSizeChanged() const { const auto& data = FTerm::getFTermData(); @@ -3016,7 +3016,7 @@ inline void FVTerm::appendChar (FChar*& next_char) } //---------------------------------------------------------------------- -inline void FVTerm::appendAttributes (FChar*& next_attr) +inline void FVTerm::appendAttributes (FChar*& next_attr) const { auto term_attr = &term_attribute; diff --git a/src/fwidget.cpp b/src/fwidget.cpp index 311756ef..88db56fa 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -338,7 +338,7 @@ void FWidget::useParentWidgetColor() } //---------------------------------------------------------------------- -void FWidget::setColor() +void FWidget::setColor() const { // Changes colors to the widget default colors setColor (foreground_color, background_color); @@ -566,7 +566,7 @@ void FWidget::setRightPadding (int right, bool adjust) } //---------------------------------------------------------------------- -void FWidget::setTermSize (const FSize& size) +void FWidget::setTermSize (const FSize& size) const { // Set xterm size to width x height @@ -1407,7 +1407,7 @@ void FWidget::adjustSize() } //---------------------------------------------------------------------- -void FWidget::adjustSizeGlobal() +void FWidget::adjustSizeGlobal() const { if ( ! isRootWidget() ) { @@ -2013,7 +2013,7 @@ void FWidget::draw() { } //---------------------------------------------------------------------- -void FWidget::drawWindows() +void FWidget::drawWindows() const { // redraw windows FChar default_char{}; @@ -2111,7 +2111,7 @@ void FWidget::destroyColorTheme() } //---------------------------------------------------------------------- -void FWidget::setStatusbarText (bool enable) +void FWidget::setStatusbarText (bool enable) const { if ( ! isEnabled() || ! getStatusBar() ) return; diff --git a/src/fwindow.cpp b/src/fwindow.cpp index e1153538..865ebf65 100644 --- a/src/fwindow.cpp +++ b/src/fwindow.cpp @@ -156,7 +156,7 @@ bool FWindow::activateWindow (bool enable) } //---------------------------------------------------------------------- -void FWindow::unsetActiveWindow() +void FWindow::unsetActiveWindow() const { // unset the active FWindow object FWidget::setActiveWindow (nullptr); diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index 87d1d729..aab0c61b 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -125,13 +125,13 @@ class FApplication : public FWidget // Methods int exec(); // run int enterLoop(); - void exitLoop(); + void exitLoop() const; static void exit (int = EXIT_SUCCESS); - void quit(); + void quit() const; static bool sendEvent (FObject*, FEvent*); void queueEvent (FObject*, FEvent*); void sendQueuedEvents(); - bool eventInQueue(); + bool eventInQueue() const; bool removeQueuedEvent (const FObject*); void initTerminal() override; static void setDefaultTheme(); @@ -157,44 +157,44 @@ class FApplication : public FWidget static FStartOptions& getStartOptions(); static void showParameterUsage(); void destroyLog(); - void findKeyboardWidget(); + void findKeyboardWidget() const; bool isKeyPressed() const; void keyPressed(); void keyReleased(); void escapeKeyPressed(); void performKeyboardAction(); - void sendEscapeKeyPressEvent(); - bool sendKeyDownEvent (FWidget*); - bool sendKeyPressEvent (FWidget*); - bool sendKeyUpEvent (FWidget*); + void sendEscapeKeyPressEvent() const; + bool sendKeyDownEvent (FWidget*) const; + bool sendKeyPressEvent (FWidget*) const; + bool sendKeyUpEvent (FWidget*) const; void sendKeyboardAccelerator(); void processKeyboardEvent(); - bool processDialogSwitchAccelerator(); - bool processAccelerator (const FWidget* const&); - bool getMouseEvent(); + bool processDialogSwitchAccelerator() const; + bool processAccelerator (const FWidget* const&) const; + bool getMouseEvent() const; FWidget*& determineClickedWidget(); - void unsetMoveSizeMode(); + void unsetMoveSizeMode() const; void closeDropDown(); void unselectMenubarItems(); void sendMouseEvent(); void sendMouseMoveEvent ( const FPoint& , const FPoint& - , int ); + , int ) const; void sendMouseLeftClickEvent ( const FPoint& , const FPoint& - , int ); + , int ) const; void sendMouseRightClickEvent ( const FPoint& , const FPoint& - , int ); + , int ) const; void sendMouseMiddleClickEvent ( const FPoint& , const FPoint& - , int ); - void sendWheelEvent (const FPoint&, const FPoint&); + , int ) const; + void sendWheelEvent (const FPoint&, const FPoint&) const; static FWidget* processParameters (const int&, char*[]); void processMouseEvent(); void processResizeEvent(); void processCloseWidget(); - void processLogger(); + void processLogger() const; bool processNextEvent(); void performTimerAction (FObject*, FEvent*) override; static bool isEventProcessable (const FObject*, const FEvent*); diff --git a/src/include/final/fbutton.h b/src/include/final/fbutton.h index cfe0145b..d454d7ee 100644 --- a/src/include/final/fbutton.h +++ b/src/include/final/fbutton.h @@ -147,7 +147,7 @@ class FButton : public FWidget void drawTopBottomBackground(); void drawButtonTextLine (const FString&); void draw() override; - void updateStatusBar(); + void updateStatusBar() const; void updateButtonColor(); void processClick(); diff --git a/src/include/final/fbuttongroup.h b/src/include/final/fbuttongroup.h index 1b544692..eb904cd9 100644 --- a/src/include/final/fbuttongroup.h +++ b/src/include/final/fbuttongroup.h @@ -130,7 +130,7 @@ class FButtonGroup : public FScrollView void directFocus(); // Callback method - void cb_buttonToggled (FWidget*, const FDataPtr); + void cb_buttonToggled (FWidget*, const FDataPtr) const; // Data members FString text{}; diff --git a/src/include/final/fcolorpalette.h b/src/include/final/fcolorpalette.h index 38130f0e..860c40b4 100644 --- a/src/include/final/fcolorpalette.h +++ b/src/include/final/fcolorpalette.h @@ -66,7 +66,7 @@ class FColorPalette virtual void resetColorPalette() = 0; protected: - void setPalette (FColor, int, int, int); + void setPalette (FColor, int, int, int) const; void setVGAdefaultPalette(); private: diff --git a/src/include/final/fdata.h b/src/include/final/fdata.h index 473e9484..e2749c76 100644 --- a/src/include/final/fdata.h +++ b/src/include/final/fdata.h @@ -27,13 +27,10 @@ #error "Only can be included directly." #endif -namespace -{ - template struct FData { - FData (T v) + explicit FData (T v) : value(v) { } @@ -48,15 +45,35 @@ struct FData return value(args...); } - operator T () const + explicit operator T () const { - return value; + return value; + } + + T& get() + { + return value; + } + + void set (const T& v) + { + value = v; + } + + FData& operator << (const T& v) + { + value = v; + return *this; + } + + friend std::ostream& operator << (std::ostream &os, const FData& data) + { + os << data.value; + return os; } T value; }; -} // namespace - #endif // FDATA_H diff --git a/src/include/final/fdialog.h b/src/include/final/fdialog.h index 1fea5066..3af946f2 100644 --- a/src/include/final/fdialog.h +++ b/src/include/final/fdialog.h @@ -188,7 +188,7 @@ class FDialog : public FWindow void openMenu(); void selectFirstMenuItem(); void setZoomItem(); - std::size_t getZoomButtonWidth(); + std::size_t getZoomButtonWidth() const; void activateZoomButton (const mouseStates&); void deactivateZoomButton(); void leaveZoomButton (const mouseStates&); diff --git a/src/include/final/ffiledialog.h b/src/include/final/ffiledialog.h index f9a10a73..82c48b19 100644 --- a/src/include/final/ffiledialog.h +++ b/src/include/final/ffiledialog.h @@ -116,7 +116,7 @@ class FFileDialog : public FDialog const FString getPath() const; const FString getFilter() const; const FString getSelectedFile() const; - bool getShowHiddenFiles(); + bool getShowHiddenFiles() const; // Mutators void setPath (const FString&); @@ -192,13 +192,13 @@ class FFileDialog : public FDialog void init(); void widgetSettings (const FPoint&); void initCallbacks(); - bool pattern_match (const char* const, const char[]); + bool patternMatch (const char* const, const char[]) const; void clear(); sInt64 numOfDirs(); void sortDir(); int readDir(); void getEntry (const char* const, const struct dirent*); - void followSymLink (const char* const, FDirEntry&); + void followSymLink (const char* const, FDirEntry&) const; void dirEntriesToList(); void selectDirectoryEntry (const char* const); int changeDir (const FString&); @@ -260,7 +260,7 @@ inline bool FFileDialog::unsetShowHiddenFiles() { return setShowHiddenFiles(false); } //---------------------------------------------------------------------- -inline bool FFileDialog::getShowHiddenFiles() +inline bool FFileDialog::getShowHiddenFiles() const { return show_hidden; } } // namespace finalcut diff --git a/src/include/final/fkeyboard.h b/src/include/final/fkeyboard.h index 7dd344e7..7b4535f6 100644 --- a/src/include/final/fkeyboard.h +++ b/src/include/final/fkeyboard.h @@ -62,7 +62,7 @@ class FKeyboardCommand final { } // Method - void execute() + void execute() const { handler(); } @@ -100,8 +100,8 @@ class FKeyboard final // Accessors const FString getClassName() const; - FKey getKey(); - const FString getKeyName (const FKey); + FKey getKey() const; + const FString getKeyName (const FKey) const; keybuffer& getKeyBuffer(); timeval* getKeyPressedTime(); static uInt64 getKeypressTimeout(); @@ -136,7 +136,7 @@ class FKeyboard final static constexpr FKey NOT_SET = static_cast(-1); // Accessors - FKey getMouseProtocolKey(); + FKey getMouseProtocolKey() const; FKey getTermcapKey(); FKey getMetaKey(); FKey getSingleKey(); @@ -150,11 +150,11 @@ class FKeyboard final static bool isKeypressTimeout(); // Methods - FKey UTF8decode (const char[]); + FKey UTF8decode (const char[]) const; ssize_t readKey(); void parseKeyBuffer(); FKey parseKeyString(); - FKey keyCorrection (const FKey&); + FKey keyCorrection (const FKey&) const; void substringKeyHandling(); void keyPressed(); void keyReleased(); @@ -192,7 +192,7 @@ inline const FString FKeyboard::getClassName() const { return "FKeyboard"; } //---------------------------------------------------------------------- -inline FKey FKeyboard::getKey() +inline FKey FKeyboard::getKey() const { return key; } //---------------------------------------------------------------------- diff --git a/src/include/final/flabel.h b/src/include/final/flabel.h index d73d0a06..c07b36db 100644 --- a/src/include/final/flabel.h +++ b/src/include/final/flabel.h @@ -84,12 +84,12 @@ class FLabel : public FWidget FLabel& operator << (const typeT&); FLabel& operator << (fc::SpecialCharacter); FLabel& operator << (const wchar_t); - const FLabel& operator >> (FString&); + const FLabel& operator >> (FString&) const; // Accessors const FString getClassName() const override; FWidget* getAccelWidget(); - fc::text_alignment getAlignment(); + fc::text_alignment getAlignment() const; FString& getText(); // Mutators @@ -132,7 +132,7 @@ class FLabel : public FWidget // Methods void init(); void setHotkeyAccelerator(); - std::size_t getAlignOffset (const std::size_t); + std::size_t getAlignOffset (const std::size_t) const; void draw() override; void drawMultiLine(); void drawSingleLine(); @@ -173,7 +173,7 @@ inline FWidget* FLabel::getAccelWidget () { return accel_widget; } //---------------------------------------------------------------------- -inline fc::text_alignment FLabel::getAlignment() +inline fc::text_alignment FLabel::getAlignment() const { return alignment; } //---------------------------------------------------------------------- diff --git a/src/include/final/flineedit.h b/src/include/final/flineedit.h index 59bac04a..60dee836 100644 --- a/src/include/final/flineedit.h +++ b/src/include/final/flineedit.h @@ -100,7 +100,7 @@ class FLineEdit : public FWidget FLineEdit& operator << (const typeT&); FLineEdit& operator << (fc::SpecialCharacter); FLineEdit& operator << (const wchar_t); - const FLineEdit& operator >> (FString&); + const FLineEdit& operator >> (FString&) const; // Accessors const FString getClassName() const override; @@ -108,7 +108,7 @@ class FLineEdit : public FWidget std::size_t getMaxLength() const; std::size_t getCursorPosition() const; FLabel* getLabelObject() const; - label_o getLabelOrientation(); + label_o getLabelOrientation() const; // Mutators void setText (const FString&); @@ -184,7 +184,7 @@ class FLineEdit : public FWidget void drawInputField(); std::size_t printTextField(); std::size_t printPassword(); - std::size_t getCursorColumnPos(); + std::size_t getCursorColumnPos() const; const FString getPasswordText() const; bool isPasswordField() const; offsetPair endPosToOffset (std::size_t); @@ -199,7 +199,7 @@ class FLineEdit : public FWidget void switchInsertMode(); void acceptInput(); bool keyInput (FKey); - wchar_t characterFilter (const wchar_t); + wchar_t characterFilter (const wchar_t) const; void processActivate(); void processChanged(); @@ -257,7 +257,7 @@ inline FLabel* FLineEdit::getLabelObject() const { return label; } //---------------------------------------------------------------------- -inline FLineEdit::label_o FLineEdit::getLabelOrientation() +inline FLineEdit::label_o FLineEdit::getLabelOrientation() const { return label_orientation; } //---------------------------------------------------------------------- diff --git a/src/include/final/flistbox.h b/src/include/final/flistbox.h index d628cfee..587dadbf 100644 --- a/src/include/final/flistbox.h +++ b/src/include/final/flistbox.h @@ -173,12 +173,12 @@ class FListBox : public FWidget void setCurrentItem (std::size_t); void setCurrentItem (listBoxItems::iterator); void selectItem (std::size_t); - void selectItem (listBoxItems::iterator); + void selectItem (listBoxItems::iterator) const; void unselectItem (std::size_t); - void unselectItem (listBoxItems::iterator); + void unselectItem (listBoxItems::iterator) const; void showInsideBrackets (const std::size_t, fc::brackets_type); void showNoBrackets (std::size_t); - void showNoBrackets (listBoxItems::iterator); + void showNoBrackets (listBoxItems::iterator) const; void setSize (const FSize&, bool = true) override; void setGeometry ( const FPoint&, const FSize& , bool = true ) override; @@ -259,7 +259,7 @@ class FListBox : public FWidget void processKeyAction (FKeyEvent*); void draw() override; void drawBorder() override; - void drawScrollbars(); + void drawScrollbars() const; void drawHeadline(); void drawList(); void drawListLine (int, listBoxItems::iterator, bool); @@ -267,10 +267,10 @@ class FListBox : public FWidget void printRightBracket (fc::brackets_type); void drawListBracketsLine (int, listBoxItems::iterator, bool); void setLineAttributes (int, bool, bool, bool&); - void unsetAttributes(); + void unsetAttributes() const; void updateDrawing (bool, bool); void recalculateHorizontalBar (std::size_t, bool); - void recalculateVerticalBar (std::size_t); + void recalculateVerticalBar (std::size_t) const; void getWidgetFocus(); void multiSelection (std::size_t); void multiSelectionUpTo (std::size_t); @@ -304,7 +304,7 @@ class FListBox : public FWidget void processClick(); void processSelect(); void processChanged(); - void changeOnResize(); + void changeOnResize() const; void lazyConvert (listBoxItems::iterator, int); listBoxItems::iterator index2iterator (std::size_t); listBoxItems::const_iterator index2iterator (std::size_t index) const; @@ -415,7 +415,7 @@ inline void FListBox::selectItem (std::size_t index) { index2iterator(index - 1)->selected = true; } //---------------------------------------------------------------------- -inline void FListBox::selectItem (listBoxItems::iterator iter) +inline void FListBox::selectItem (listBoxItems::iterator iter) const { iter->selected = true; } //---------------------------------------------------------------------- @@ -423,7 +423,7 @@ inline void FListBox::unselectItem (std::size_t index) { index2iterator(index - 1)->selected = false; } //---------------------------------------------------------------------- -inline void FListBox::unselectItem (listBoxItems::iterator iter) +inline void FListBox::unselectItem (listBoxItems::iterator iter) const { iter->selected = false; } //---------------------------------------------------------------------- @@ -431,7 +431,7 @@ inline void FListBox::showNoBrackets (std::size_t index) { index2iterator(index - 1)->brackets = fc::NoBrackets; } //---------------------------------------------------------------------- -inline void FListBox::showNoBrackets (listBoxItems::iterator iter) +inline void FListBox::showNoBrackets (listBoxItems::iterator iter) const { iter->brackets = fc::NoBrackets; } //---------------------------------------------------------------------- diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h index 3e1fec87..79fb11be 100644 --- a/src/include/final/flistview.h +++ b/src/include/final/flistview.h @@ -103,8 +103,8 @@ class FListViewItem : public FObject // Methods iterator insert (FListViewItem*); - iterator insert (FListViewItem*, iterator); - void remove (FListViewItem*); + iterator insert (FListViewItem*, iterator) const; + void remove (FListViewItem*) const; void expand(); void collapse(); @@ -279,7 +279,7 @@ class FListView : public FWidget // Accessors const FString getClassName() const override; - std::size_t getCount(); + std::size_t getCount() const; fc::text_alignment getColumnAlignment (int) const; FString getColumnText (int) const; fc::sorting_type getColumnSortType (int) const; @@ -384,8 +384,8 @@ class FListView : public FWidget static void setNullIterator (const iterator&); // Inquiry - bool isHorizontallyScrollable(); - bool isVerticallyScrollable(); + bool isHorizontallyScrollable() const; + bool isVerticallyScrollable() const; // Methods void init(); @@ -395,7 +395,7 @@ class FListView : public FWidget void sort (Compare); std::size_t getAlignOffset ( const fc::text_alignment , const std::size_t - , const std::size_t ); + , const std::size_t ) const; iterator getListEnd (const FListViewItem*); void draw() override; void drawBorder() override; @@ -404,8 +404,8 @@ class FListView : public FWidget void drawList(); void drawListLine (const FListViewItem*, bool, bool); void clearList(); - void setLineAttributes (bool, bool); - FString getCheckBox (const FListViewItem* item); + void setLineAttributes (bool, bool) const; + FString getCheckBox (const FListViewItem* item) const; FString getLinePrefix (const FListViewItem*, std::size_t); void drawSortIndicator (std::size_t&, std::size_t); void drawHeadlineLabel (const headerItems::const_iterator&); @@ -430,7 +430,7 @@ class FListView : public FWidget iterator appendItem (FListViewItem*); void processClick(); void processChanged(); - void changeOnResize(); + void changeOnResize() const; void toggleCheckbox(); void collapseAndScrollLeft(); void expandAndScrollRight(); @@ -650,11 +650,11 @@ inline FObject::iterator FListView::endOfList() { return itemlist.end(); } //---------------------------------------------------------------------- -inline bool FListView::isHorizontallyScrollable() +inline bool FListView::isHorizontallyScrollable() const { return bool( max_line_width > getClientWidth() ); } //---------------------------------------------------------------------- -inline bool FListView::isVerticallyScrollable() +inline bool FListView::isVerticallyScrollable() const { return bool( getCount() > getClientHeight() ); } //---------------------------------------------------------------------- diff --git a/src/include/final/flog.h b/src/include/final/flog.h index 291bceec..20da08b3 100644 --- a/src/include/final/flog.h +++ b/src/include/final/flog.h @@ -97,9 +97,9 @@ class FLog : public std::stringbuf protected: int sync() override; - const LogLevel& getLevel(); + const LogLevel& getLevel() const; LogLevel& setLevel(); - const LineEnding& getEnding(); + const LineEnding& getEnding() const; LineEnding& setEnding(); private: @@ -131,7 +131,7 @@ inline const FString FLog::getClassName() const { return "FLog"; } //---------------------------------------------------------------------- -inline const FLog::LogLevel& FLog::getLevel() +inline const FLog::LogLevel& FLog::getLevel() const { return level; } //---------------------------------------------------------------------- @@ -139,7 +139,7 @@ inline FLog::LogLevel& FLog::setLevel() { return level; } //---------------------------------------------------------------------- -inline const FLog::LineEnding& FLog::getEnding() +inline const FLog::LineEnding& FLog::getEnding() const { return end_of_line; } //---------------------------------------------------------------------- diff --git a/src/include/final/flogger.h b/src/include/final/flogger.h index cbcc89e4..ea00fe06 100644 --- a/src/include/final/flogger.h +++ b/src/include/final/flogger.h @@ -85,8 +85,8 @@ class FLogger : public FLog private: // Methods - void newlineReplace (std::string&, const std::string&); - const std::string getTimeString(); + void newlineReplace (std::string&, const std::string&) const; + const std::string getTimeString() const; const std::string getEOL(); void printLogLine (const std::string&); diff --git a/src/include/final/fmenu.h b/src/include/final/fmenu.h index 3af7bd7e..69516a11 100644 --- a/src/include/final/fmenu.h +++ b/src/include/final/fmenu.h @@ -127,7 +127,7 @@ class FMenu : public FWindow, public FMenuList // Callback method void cb_menuitemEnabled (const FWidget*, const FDataPtr); void cb_menuitemDisabled (const FWidget*, const FDataPtr); - void cb_menuitemToggled (FWidget*, const FDataPtr); + void cb_menuitemToggled (FWidget*, const FDataPtr) const; private: // Constants @@ -169,13 +169,13 @@ class FMenu : public FWindow, public FMenuList bool isMouseOverMenu (const FPoint&); bool isMouseOverSubMenu (const FPoint&); bool isMouseOverSuperMenu (const FPoint&); - bool isMouseOverMenuBar (const FPoint&); + bool isMouseOverMenuBar (const FPoint&) const; // Methods void init(); void initCallbacks(); void calculateDimensions(); - void adjustItems(); + void adjustItems() const; int adjustX(int); void openSubMenu (FMenu*, bool = false); void closeOpenedSubMenu(); @@ -192,14 +192,14 @@ class FMenu : public FWindow, public FMenuList void mouseMoveOverBorder (mouseStates&); void passEventToSubMenu (FMouseEvent* const&); void passEventToSuperMenu (FMouseEvent* const&); - void passEventToMenuBar (FMouseEvent* const&); + void passEventToMenuBar (FMouseEvent* const&) const; bool containsMenuStructure (const FPoint&); bool containsMenuStructure (int, int); FMenu* superMenuAt (const FPoint&); FMenu* superMenuAt (int, int); bool selectNextItem(); bool selectPrevItem(); - void keypressMenuBar (FKeyEvent*); + void keypressMenuBar (FKeyEvent*) const; bool hotkeyMenu (FKeyEvent*); void draw() override; void drawItems(); @@ -211,7 +211,7 @@ class FMenu : public FWindow, public FMenuList void drawAcceleratorKey (std::size_t&, FKey); void drawTrailingSpaces (std::size_t); void setLineAttributes (const FMenuItem*, int); - void setCursorToHotkeyPosition (FMenuItem*); + void setCursorToHotkeyPosition (FMenuItem*) const; void selectPrevMenu (FKeyEvent*); void selectNextMenu (FKeyEvent*); void acceptSelection(); diff --git a/src/include/final/fmenubar.h b/src/include/final/fmenubar.h index 1cf243fd..6e0cbc73 100644 --- a/src/include/final/fmenubar.h +++ b/src/include/final/fmenubar.h @@ -99,7 +99,7 @@ class FMenuBar : public FWindow, public FMenuList void onAccel (FAccelEvent*) override; // Callback methods - void cb_itemDeactivated (FWidget*, const FDataPtr); + void cb_itemDeactivated (FWidget*, const FDataPtr) const; private: // Constants @@ -119,7 +119,7 @@ class FMenuBar : public FWindow, public FMenuList // Methods void init(); - void calculateDimensions(); + void calculateDimensions() const; bool selectNextItem(); bool selectPrevItem(); bool hotkeyMenu (FKeyEvent*&); @@ -127,12 +127,12 @@ class FMenuBar : public FWindow, public FMenuList void drawItems(); void drawItem (FMenuItem*, std::size_t&); void setLineAttributes (const FMenuItem*); - void setCursorToHotkeyPosition (FMenuItem*, std::size_t); + void setCursorToHotkeyPosition (FMenuItem*, std::size_t) const; void drawMenuText (menuText&); void drawEllipsis (const menuText&, std::size_t); void drawLeadingSpace (std::size_t&); void drawTrailingSpace (std::size_t&); - void adjustItems(); + void adjustItems() const; bool activateMenu (const FMenuItem*); bool clickItem (FMenuItem*); void unselectMenuItem (FMenuItem*); @@ -140,7 +140,7 @@ class FMenuBar : public FWindow, public FMenuList void mouseDownOverList (const FMouseEvent*); void mouseUpOverList (const FMouseEvent*); void mouseMoveOverList (const FMouseEvent*); - void passEventToMenu (const FMouseEvent* const&); + void passEventToMenu (const FMouseEvent* const&) const; void leaveMenuBar(); // Data members diff --git a/src/include/final/fmenuitem.h b/src/include/final/fmenuitem.h index 28fed5ad..eaa29dee 100644 --- a/src/include/final/fmenuitem.h +++ b/src/include/final/fmenuitem.h @@ -160,12 +160,12 @@ class FMenuItem : public FWidget void processDisable(); void processActivate(); void processDeactivate(); - void createDialogList (FMenu*); + void createDialogList (FMenu*) const; template - void passMouseEvent (T, const FMouseEvent*, fc::events); + void passMouseEvent (T, const FMouseEvent*, fc::events) const; // Callback methods - void cb_switchToDialog (const FWidget*, FDataPtr); + void cb_switchToDialog (const FWidget*, FDataPtr) const; void cb_destroyDialog (FWidget*, const FDataPtr); virtual void processClicked(); diff --git a/src/include/final/fmessagebox.h b/src/include/final/fmessagebox.h index 0f0f86ab..67f5692a 100644 --- a/src/include/final/fmessagebox.h +++ b/src/include/final/fmessagebox.h @@ -144,7 +144,7 @@ class FMessageBox : public FDialog void initCallbacks(); void calculateDimensions(); void draw() override; - void resizeButtons(); + void resizeButtons() const; void adjustButtons(); // Data members diff --git a/src/include/final/fmouse.h b/src/include/final/fmouse.h index 21abf106..5a1dc369 100644 --- a/src/include/final/fmouse.h +++ b/src/include/final/fmouse.h @@ -103,7 +103,7 @@ class FMouse // Accessors virtual const FString getClassName() const; - const FPoint& getPos(); + const FPoint& getPos() const; void clearEvent(); // Mutators @@ -113,7 +113,7 @@ class FMouse // Inquiries virtual bool hasData() = 0; - bool hasEvent(); + bool hasEvent() const; bool isLeftButtonPressed(); bool isLeftButtonReleased(); bool isLeftButtonDoubleClick(); @@ -127,7 +127,7 @@ class FMouse bool isWheelUp(); bool isWheelDown(); bool isMoved(); - bool isInputDataPending(); + bool isInputDataPending() const; // Methods template @@ -162,10 +162,10 @@ class FMouse // Accessors FMouseButton& getButtonState(); - const FPoint& getNewPos(); - uInt16 getMaxWidth(); - uInt16 getMaxHeight(); - uInt64 getDblclickInterval(); + const FPoint& getNewPos() const; + uInt16 getMaxWidth() const; + uInt16 getMaxHeight() const; + uInt64 getDblclickInterval() const; timeval* getMousePressedTime(); // Mutator @@ -177,7 +177,7 @@ class FMouse void resetMousePressedTime(); // Inquiry - bool isDblclickTimeout (const timeval*); + bool isDblclickTimeout (const timeval*) const; private: // Data members @@ -222,7 +222,7 @@ class FMouseGPM final : public FMouse // Inquiry bool hasData() override; - bool isGpmMouseEnabled(); + bool isGpmMouseEnabled() const; // Methods void setRawData (FKeyboard::keybuffer&) override; @@ -230,7 +230,7 @@ class FMouseGPM final : public FMouse bool gpmMouse (bool); bool enableGpmMouse(); bool disableGpmMouse(); - bool hasSignificantEvents(); + bool hasSignificantEvents() const; void interpretKeyDown(); void interpretKeyUp(); bool getGpmKeyPressed(bool); @@ -246,7 +246,7 @@ class FMouseGPM final : public FMouse }; // Method - int gpmEvent (bool = true); + int gpmEvent (bool = true) const; // Data member Gpm_Event gpm_ev{}; @@ -264,7 +264,7 @@ inline bool FMouseGPM::disableGpmMouse() { return gpmMouse(false); } //---------------------------------------------------------------------- -inline bool FMouseGPM::isGpmMouseEnabled() +inline bool FMouseGPM::isGpmMouseEnabled() const { return gpm_mouse_enabled; } #endif // F_HAVE_LIBGPM @@ -513,7 +513,7 @@ class FMouseControl // Accessor FMouse* getMouseWithData(); FMouse* getMouseWithEvent(); - void xtermMouse (bool); + void xtermMouse (bool) const; void enableXTermMouse(); void disableXTermMouse(); diff --git a/src/include/final/fobject.h b/src/include/final/fobject.h index 1593287d..39f5d82c 100644 --- a/src/include/final/fobject.h +++ b/src/include/final/fobject.h @@ -124,9 +124,9 @@ class FObject static void getCurrentTime (timeval*); static bool isTimeout (const timeval*, uInt64); int addTimer (int); - bool delTimer (int); - bool delOwnTimer(); - bool delAllTimer(); + bool delTimer (int) const; + bool delOwnTimer() const; + bool delAllTimer() const; protected: struct FTimerData diff --git a/src/include/final/foptiattr.h b/src/include/final/foptiattr.h index dcadbacb..95c38c97 100644 --- a/src/include/final/foptiattr.h +++ b/src/include/final/foptiattr.h @@ -244,7 +244,7 @@ class FOptiAttr final // Methods bool hasColorChanged (const FChar* const&, const FChar* const&) const; - void resetColor (FChar*&); + void resetColor (FChar*&) const; void prevent_no_color_video_attributes (FChar*&, bool = false); void deactivateAttributes (FChar*&, FChar*&); void changeAttributeSGR (FChar*&, FChar*&); @@ -252,14 +252,14 @@ class FOptiAttr final void change_color (FChar*&, FChar*&); void change_to_default_color (FChar*&, FChar*&, FColor&, FColor&); void change_current_color (const FChar* const&, FColor, FColor); - void resetAttribute (FChar*&); + void resetAttribute (FChar*&) const; void reset (FChar*&); - bool caused_reset_attributes (const char[], uChar = all_tests); + bool caused_reset_attributes (const char[], uChar = all_tests) const; bool hasCharsetEquivalence() const; void detectSwitchOn (const FChar* const&, const FChar* const&); void detectSwitchOff (const FChar* const&, const FChar* const&); - bool switchOn(); - bool switchOff(); + bool switchOn() const; + bool switchOff() const; bool append_sequence (const char[]); // Data members diff --git a/src/include/final/foptimove.h b/src/include/final/foptimove.h index 6d66223e..f7068b1f 100644 --- a/src/include/final/foptimove.h +++ b/src/include/final/foptimove.h @@ -143,7 +143,7 @@ class FOptiMove final void set_eat_newline_glitch (bool); // Methods - void check_boundaries (int&, int&, int&, int&); + void check_boundaries (int&, int&, int&, int&) const; const char* moveCursor (int, int, int, int); private: @@ -166,9 +166,9 @@ class FOptiMove final // Methods void calculateCharDuration(); - int capDuration (const char[], int); - int capDurationToLength (int); - int repeatedAppend (const capability&, volatile int, char*); + int capDuration (const char[], int) const; + int capDurationToLength (int) const; + int repeatedAppend (const capability&, volatile int, char*) const; int relativeMove (char[], int, int, int, int); int verticalMove (char[], int, int); void downMove (char[], int&, int, int); diff --git a/src/include/final/fprogressbar.h b/src/include/final/fprogressbar.h index 4d8c5cca..8f6bd4e8 100644 --- a/src/include/final/fprogressbar.h +++ b/src/include/final/fprogressbar.h @@ -70,7 +70,7 @@ class FProgressbar : public FWidget // Accessors const FString getClassName() const override; - std::size_t getPercentage(); + std::size_t getPercentage() const; // Mutators void setPercentage (std::size_t); @@ -112,7 +112,7 @@ inline const FString FProgressbar::getClassName() const { return "FProgressbar"; } //---------------------------------------------------------------------- -inline std::size_t FProgressbar::getPercentage() +inline std::size_t FProgressbar::getPercentage() const { return percentage; } //---------------------------------------------------------------------- diff --git a/src/include/final/fscrollbar.h b/src/include/final/fscrollbar.h index 327f76a1..3578cd70 100644 --- a/src/include/final/fscrollbar.h +++ b/src/include/final/fscrollbar.h @@ -139,9 +139,9 @@ class FScrollbar : public FWidget void drawHorizontalBackgroundColumn(); void drawButtons(); sType getClickedScrollType (int, int); - sType getVerticalClickedScrollType (int); - sType getHorizontalClickedScrollType (int); - int getSliderClickPos (int, int); + sType getVerticalClickedScrollType (int) const; + sType getHorizontalClickedScrollType (int) const; + int getSliderClickPos (int, int) const; void jumpToClickPos (int, int); void jumpToClickPos (int); void avoidScrollOvershoot(); diff --git a/src/include/final/fscrollview.h b/src/include/final/fscrollview.h index 69fcbbe9..e9d3a813 100644 --- a/src/include/final/fscrollview.h +++ b/src/include/final/fscrollview.h @@ -83,7 +83,7 @@ class FScrollView : public FWidget const FString getClassName() const override; std::size_t getViewportWidth() const; std::size_t getViewportHeight() const; - const FSize getViewportSize(); + const FSize getViewportSize() const; std::size_t getScrollWidth() const; std::size_t getScrollHeight() const; const FSize getScrollSize() const; @@ -157,18 +157,18 @@ class FScrollView : public FWidget static constexpr int horizontal_border_spacing = 2; // Accessors - const FPoint getViewportCursorPos(); + const FPoint getViewportCursorPos() const; // Methods void init(); void mapKeyFunctions(); - void calculateScrollbarPos(); + void calculateScrollbarPos() const; template void initScrollbar ( FScrollbarPtr& , fc::orientation , Callback ); - void setHorizontalScrollBarVisibility(); - void setVerticalScrollBarVisibility(); + void setHorizontalScrollBarVisibility() const; + void setVerticalScrollBarVisibility() const; void setViewportCursor(); // Callback methods @@ -203,7 +203,7 @@ inline std::size_t FScrollView::getViewportHeight() const { return getHeight() - horizontal_border_spacing; } //---------------------------------------------------------------------- -inline const FSize FScrollView::getViewportSize() +inline const FSize FScrollView::getViewportSize() const { return FSize(getViewportWidth(), getViewportHeight()); } //---------------------------------------------------------------------- diff --git a/src/include/final/fspinbox.h b/src/include/final/fspinbox.h index 809e51c4..9ed83b74 100644 --- a/src/include/final/fspinbox.h +++ b/src/include/final/fspinbox.h @@ -79,7 +79,7 @@ class FSpinBox : public FWidget // Accessors const FString getClassName() const override; - sInt64 getValue(); + sInt64 getValue() const; FString getPrefix() const; FString getSuffix() const; FLineEdit::label_o getLabelOrientation(); @@ -163,7 +163,7 @@ inline const FString FSpinBox::getClassName() const { return "FSpinBox"; } //---------------------------------------------------------------------- -inline sInt64 FSpinBox::getValue() +inline sInt64 FSpinBox::getValue() const { return value; } //---------------------------------------------------------------------- diff --git a/src/include/final/fstatusbar.h b/src/include/final/fstatusbar.h index a931223b..5a661aca 100644 --- a/src/include/final/fstatusbar.h +++ b/src/include/final/fstatusbar.h @@ -235,8 +235,8 @@ class FStatusBar : public FWindow // Methods void init(); - int getKeyNameWidth (const FStatusKey*); - int getKeyTextWidth (const FStatusKey*); + int getKeyNameWidth (const FStatusKey*) const; + int getKeyTextWidth (const FStatusKey*) const; void draw() override; void drawKeys(); void drawKey (keyList::const_iterator); diff --git a/src/include/final/fstring.h b/src/include/final/fstring.h index c5b9870f..d215f799 100644 --- a/src/include/final/fstring.h +++ b/src/include/final/fstring.h @@ -120,25 +120,26 @@ class FString , int>::type = 0 > FString& operator << (const NumT); - const FString& operator >> (FString&); - const FString& operator >> (std::wstring&); - const FString& operator >> (std::string&); - const FString& operator >> (wchar_t&); - const FString& operator >> (char&); - const FString& operator >> (sInt16&); - const FString& operator >> (uInt16&); - const FString& operator >> (sInt32&); - const FString& operator >> (uInt32&); - const FString& operator >> (sInt64&); - const FString& operator >> (uInt64&); - const FString& operator >> (double&); - const FString& operator >> (float&); + const FString& operator >> (FString&) const; + const FString& operator >> (std::wstring&) const; + const FString& operator >> (std::string&) const; + const FString& operator >> (wchar_t&) const; + const FString& operator >> (char&) const; + const FString& operator >> (sInt16&) const; + const FString& operator >> (uInt16&) const; + const FString& operator >> (sInt32&) const; + const FString& operator >> (uInt32&) const; + const FString& operator >> (sInt64&) const; + const FString& operator >> (uInt64&) const; + const FString& operator >> (double&) const; + const FString& operator >> (float&) const; template wchar_t& operator [] (const IndexT); template const wchar_t& operator [] (const IndexT) const; - const FString& operator () (); + explicit operator bool () const; + const FString& operator () () const; bool operator < (const FString&) const; template @@ -227,7 +228,7 @@ class FString const FString& insert (const FString&, int); const FString& insert (const FString&, std::size_t); - const FString replace (const FString&, const FString&); + const FString replace (const FString&, const FString&) const; const FString replaceControlCodes() const; const FString expandTabs (int = 8) const; @@ -254,7 +255,7 @@ class FString void _remove (std::size_t, std::size_t); const char* _to_cstring (const wchar_t[]) const; const wchar_t* _to_wcstring (const char[]) const; - const wchar_t* _extractToken (wchar_t*[], const wchar_t[], const wchar_t[]); + const wchar_t* _extractToken (wchar_t*[], const wchar_t[], const wchar_t[]) const; // Data members wchar_t* string{nullptr}; diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h index 641c2f0d..0e1f38b5 100644 --- a/src/include/final/fterm.h +++ b/src/include/final/fterm.h @@ -349,16 +349,16 @@ class FTerm final static void enableAlternateCharset(); static void useAlternateScreenBuffer(); static void useNormalScreenBuffer(); - void allocationValues(); + void allocationValues() const; void deallocationValues(); void init(); bool init_terminal(); - void initOSspecifics(); - void initTermspecifics(); - void initBaudRate(); + void initOSspecifics() const; + void initTermspecifics() const; + void initBaudRate() const; void finish(); - void finishOSspecifics(); - void finish_encoding(); + void finishOSspecifics() const; + void finish_encoding() const; void destroyColorPaletteTheme(); static void printExitMessage(); static void terminalSizeChange(); @@ -475,10 +475,6 @@ inline void FTerm::initTerminal() } // namespace finalcut - -namespace -{ - //---------------------------------------------------------------------- inline std::ostream& operator << ( std::ostream& os , finalcut::fc::SpecialCharacter c ) @@ -493,6 +489,4 @@ inline std::wostream& operator << ( std::wostream& os return os << static_cast(c); } -} // namespace - #endif // FTERM_H diff --git a/src/include/final/ftermbuffer.h b/src/include/final/ftermbuffer.h index 2a5e4c41..ffe26694 100644 --- a/src/include/final/ftermbuffer.h +++ b/src/include/final/ftermbuffer.h @@ -98,8 +98,8 @@ class FTermBuffer int writef (const FString&, Args&&...); int write (const FString&); int write (wchar_t); - void write (const FStyle&); - void write (const FColorPair&); + void write (const FStyle&) const; + void write (const FColorPair&) const; FTermBuffer& write (); private: diff --git a/src/include/final/ftermdata.h b/src/include/final/ftermdata.h index 7c6aae50..1ba99f3e 100644 --- a/src/include/final/ftermdata.h +++ b/src/include/final/ftermdata.h @@ -78,8 +78,8 @@ class FTermData final FRect& getTermGeometry(); int getTTYFileDescriptor() const; uInt getBaudrate() const; - const char* getTermType(); - const char* getTermFileName(); + const char* getTermType() const; + const char* getTermFileName() const; const FString& getXtermFont() const; const FString& getXtermTitle() const; const FString& getExitMessage() const; @@ -194,11 +194,11 @@ inline uInt FTermData::getBaudrate() const { return baudrate; } //---------------------------------------------------------------------- -inline const char* FTermData::getTermType() +inline const char* FTermData::getTermType() const { return termtype; } //---------------------------------------------------------------------- -inline const char* FTermData::getTermFileName() +inline const char* FTermData::getTermFileName() const { return termfilename; } //---------------------------------------------------------------------- diff --git a/src/include/final/ftermlinux.h b/src/include/final/ftermlinux.h index 7906fc1e..52e043ee 100644 --- a/src/include/final/ftermlinux.h +++ b/src/include/final/ftermlinux.h @@ -94,14 +94,14 @@ class FTermLinux final // Accessors const FString getClassName() const; - fc::linuxConsoleCursorStyle getCursorStyle(); + fc::linuxConsoleCursorStyle getCursorStyle() const; char* getCursorStyleString(); int getFramebufferBpp() const; // Mutators bool setCursorStyle (CursorStyle); bool setPalette (FColor, int, int, int); - void setUTF8 (bool); + void setUTF8 (bool) const; // Inquiries bool isLinuxConsole(); @@ -117,8 +117,8 @@ class FTermLinux final bool loadOldFont(); bool saveColorMap(); bool resetColorMap(); - void setBeep (int, int); - void resetBeep(); + void setBeep (int, int) const; + void resetBeep() const; FKey modifierKeyCorrection (const FKey&); @@ -155,7 +155,7 @@ class FTermLinux final int setScreenFont ( uChar[], uInt, uInt, uInt , bool = false ); int setUnicodeMap (struct unimapdesc*); - void setLinuxCursorStyle (fc::linuxConsoleCursorStyle); + void setLinuxCursorStyle (fc::linuxConsoleCursorStyle) const; // Methods #if defined(ISA_SYSCTL_SUPPORT) @@ -172,14 +172,14 @@ class FTermLinux final bool saveVGAPalette(); bool resetVGAPalette(); #endif // defined(ISA_SYSCTL_SUPPORT) - FKey shiftKeyCorrection (const FKey&); - FKey ctrlKeyCorrection (const FKey&); - FKey altKeyCorrection (const FKey&); - FKey shiftCtrlKeyCorrection (const FKey&); - FKey shiftAltKeyCorrection (const FKey&); - FKey ctrlAltKeyCorrection (const FKey&); - FKey shiftCtrlAltKeyCorrection (const FKey&); - sInt16 getFontPos (wchar_t ucs); + FKey shiftKeyCorrection (const FKey&) const; + FKey ctrlKeyCorrection (const FKey&) const; + FKey altKeyCorrection (const FKey&) const; + FKey shiftCtrlKeyCorrection (const FKey&) const; + FKey shiftAltKeyCorrection (const FKey&) const; + FKey ctrlAltKeyCorrection (const FKey&) const; + FKey shiftCtrlAltKeyCorrection (const FKey&) const; + sInt16 getFontPos (wchar_t ucs) const; void initSpecialCharacter(); void characterFallback (wchar_t, std::vector); diff --git a/src/include/final/ftermxterminal.h b/src/include/final/ftermxterminal.h index f04fa607..ead250de 100644 --- a/src/include/final/ftermxterminal.h +++ b/src/include/final/ftermxterminal.h @@ -110,7 +110,7 @@ class FTermXTerminal final private: // Methods - void warnNotInitialized(); + void warnNotInitialized() const; void setXTermCursorStyle(); void setXTermFont(); void setXTermTitle(); @@ -132,7 +132,7 @@ class FTermXTerminal final void resetXTermMouseForeground(); void resetXTermMouseBackground(); void resetXTermHighlightBackground(); - bool isInitialized(); + bool isInitialized() const; bool canResetColor(); void oscPrefix(); void oscPostfix(); @@ -225,7 +225,7 @@ inline void FTermXTerminal::unsetMouseSupport() { setMouseSupport (false); } //---------------------------------------------------------------------- -inline bool FTermXTerminal::isInitialized() +inline bool FTermXTerminal::isInitialized() const { return bool(fsystem && term_detection); } } // namespace finalcut diff --git a/src/include/final/ftextview.h b/src/include/final/ftextview.h index aec225d1..f8d6996c 100644 --- a/src/include/final/ftextview.h +++ b/src/include/final/ftextview.h @@ -141,8 +141,8 @@ class FTextView : public FWidget typedef std::unordered_map> keyMap; // Accessors - std::size_t getTextHeight(); - std::size_t getTextWidth(); + std::size_t getTextHeight() const; + std::size_t getTextWidth() const; // Inquiry bool isHorizontallyScrollable(); @@ -155,10 +155,10 @@ class FTextView : public FWidget void drawBorder() override; void drawScrollbars(); void drawText(); - bool useFDialogBorder(); - bool isPrintable (wchar_t); + bool useFDialogBorder() const; + bool isPrintable (wchar_t) const; void processChanged(); - void changeOnResize(); + void changeOnResize() const; // Callback methods void cb_vbarChange (const FWidget*, const FDataPtr); diff --git a/src/include/final/ftogglebutton.h b/src/include/final/ftogglebutton.h index 42707ed9..51ee8a32 100644 --- a/src/include/final/ftogglebutton.h +++ b/src/include/final/ftogglebutton.h @@ -149,7 +149,7 @@ class FToggleButton : public FWidget // Methods void init(); void drawText (const FString&, std::size_t); - void correctSize (FSize&); + void correctSize (FSize&) const; // Data members FButtonGroup* button_group{nullptr}; diff --git a/src/include/final/ftypes.h b/src/include/final/ftypes.h index 8285be69..19862ed2 100644 --- a/src/include/final/ftypes.h +++ b/src/include/final/ftypes.h @@ -47,9 +47,6 @@ << " in " \ << __func__ << std::endl; -namespace -{ - typedef unsigned char uChar; typedef unsigned short uShort; typedef unsigned int uInt; @@ -73,8 +70,6 @@ typedef uInt16 FAttribute; typedef uInt32 FKey; typedef void* FDataPtr; -} // namespace - namespace finalcut { @@ -82,7 +77,7 @@ namespace finalcut template struct is_negative { - inline bool operator () (const T& x) + inline bool operator () (const T& x) const { return x < 0; } @@ -91,7 +86,7 @@ struct is_negative template struct is_negative { - inline bool operator () (const T&) + inline bool operator () (const T&) const { return false; } diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 0357304f..7b47c9a4 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -151,14 +151,14 @@ class FVTerm FTerm& getFTerm(); // Mutators - void setTermXY (int, int); + void setTermXY (int, int) const; void setTerminalUpdates (terminal_update); - void hideCursor (bool); - void hideCursor(); - void showCursor(); + void hideCursor (bool) const; + void hideCursor() const; + void showCursor() const; void setPrintCursor (const FPoint&); - FColor rgb2ColorIndex (uInt8, uInt8, uInt8); + FColor rgb2ColorIndex (uInt8, uInt8, uInt8) const; static void setColor (FColor, FColor); static void setNormal(); @@ -287,7 +287,7 @@ class FVTerm // Mutators void setPrintArea (FTermArea*); void setChildPrintArea (FTermArea*); - void setActiveArea (FTermArea*); + void setActiveArea (FTermArea*) const; // Inquiries bool hasPrintArea() const; @@ -339,7 +339,8 @@ class FVTerm static constexpr uInt TERMINAL_OUTPUT_BUFFER_SIZE = 32768; // Methods - void setTextToDefault (const FTermArea*, const FSize&); + void resetTextAreaToDefault ( const FTermArea* + , const FSize&) const; static bool reallocateTextArea ( FTermArea* , std::size_t , std::size_t ); @@ -366,7 +367,7 @@ class FVTerm void updateVTerm(); static void callPreprocessingHandler (const FTermArea*); bool hasChildAreaChanges (FTermArea*) const; - void clearChildAreaChanges (const FTermArea*); + void clearChildAreaChanges (const FTermArea*) const; static bool isInsideArea (const FPoint&, const FTermArea*); static const FChar generateCharacter (const FPoint&); static const FChar getCharacter ( character_type @@ -390,30 +391,30 @@ class FVTerm static bool canClearTrailingWS (uInt&, uInt); bool skipUnchangedCharacters (uInt&, uInt, uInt); void printRange (uInt, uInt, uInt, bool); - void replaceNonPrintableFullwidth (uInt, FChar*&); + void replaceNonPrintableFullwidth (uInt, FChar*&) const; void printCharacter (uInt&, uInt, bool, FChar*&); void printFullWidthCharacter (uInt&, uInt, FChar*&); void printFullWidthPaddingCharacter (uInt&, uInt, FChar*&); void printHalfCovertFullWidthCharacter (uInt&, uInt, FChar*&); - void skipPaddingCharacter (uInt&, uInt, const FChar* const&); + void skipPaddingCharacter (uInt&, uInt, const FChar* const&) const; exit_state eraseCharacters (uInt&, uInt, uInt, bool); exit_state repeatCharacter (uInt&, uInt, uInt); bool isFullWidthChar (const FChar* const&) const; bool isFullWidthPaddingChar (const FChar* const&) const; static void cursorWrap(); - bool printWrap (FTermArea*); + bool printWrap (FTermArea*) const; void printPaddingCharacter (FTermArea*, const FChar&); void updateTerminalLine (uInt); bool updateTerminalCursor(); - bool isInsideTerminal (const FPoint&); - bool isTermSizeChanged(); + bool isInsideTerminal (const FPoint&) const; + bool isTermSizeChanged() const; static void markAsPrinted (uInt, uInt); static void markAsPrinted (uInt, uInt, uInt); static void newFontChanges (FChar*&); static void charsetChanges (FChar*&); void appendCharacter (FChar*&); void appendChar (FChar*&); - void appendAttributes (FChar*&); + void appendAttributes (FChar*&) const; int appendLowerRight (FChar*&); static void characterFilter (FChar*&); static void appendOutputBuffer (const std::string&); @@ -629,11 +630,11 @@ inline FTerm& FVTerm::getFTerm() { return *fterm; } //---------------------------------------------------------------------- -inline void FVTerm::hideCursor() +inline void FVTerm::hideCursor() const { return hideCursor(true); } //---------------------------------------------------------------------- -inline void FVTerm::showCursor() +inline void FVTerm::showCursor() const { return hideCursor(false); } //---------------------------------------------------------------------- @@ -957,7 +958,7 @@ inline void FVTerm::setChildPrintArea (FTermArea* area) { child_print_area = area; } //---------------------------------------------------------------------- -inline void FVTerm::setActiveArea (FTermArea* area) +inline void FVTerm::setActiveArea (FTermArea* area) const { active_area = area; } //---------------------------------------------------------------------- diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index 63a40618..3f8c0000 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -233,10 +233,10 @@ class FWidget : public FVTerm, public FObject const FRect& getGeometryWithShadow(); const FRect& getTermGeometry(); const FRect& getTermGeometryWithShadow(); - std::size_t getDesktopWidth(); - std::size_t getDesktopHeight(); + std::size_t getDesktopWidth() const; + std::size_t getDesktopHeight() const; const FWidgetFlags& getFlags() const; - const FPoint getCursorPos(); + const FPoint getCursorPos() const; const FPoint getPrintPos(); // Mutators @@ -272,7 +272,7 @@ class FWidget : public FVTerm, public FObject virtual void setBackgroundColor (FColor); virtual void resetColors(); void useParentWidgetColor(); - void setColor(); + void setColor() const; FWidgetFlags& setFlags(); // Positioning and sizes mutators... virtual void setX (int, bool = true); @@ -285,7 +285,7 @@ class FWidget : public FVTerm, public FObject void setLeftPadding (int, bool = true); void setBottomPadding (int, bool = true); void setRightPadding (int, bool = true); - void setTermSize (const FSize&); + void setTermSize (const FSize&) const; virtual void setGeometry (const FRect&, bool = true); virtual void setGeometry (const FPoint&, const FSize&, bool = true); virtual void setShadowSize (const FSize&); @@ -344,7 +344,7 @@ class FWidget : public FVTerm, public FObject virtual void hide(); virtual bool focusFirstChild(); // widget focusing virtual bool focusLastChild(); - const FPoint termToWidgetPos (const FPoint&); + const FPoint termToWidgetPos (const FPoint&) const; void print (const FPoint&) override; virtual void move (const FPoint&); virtual void drawBorder(); @@ -368,7 +368,7 @@ class FWidget : public FVTerm, public FObject // Inquiry bool isChildPrintArea() const; - + // Mutators virtual void setStatusBar (FStatusBar*); virtual void setMenuBar (FMenuBar*); @@ -381,7 +381,7 @@ class FWidget : public FVTerm, public FObject void initTerminal() override; void initDesktop(); virtual void adjustSize(); - void adjustSizeGlobal(); + void adjustSizeGlobal() const; void hideArea (const FSize&); virtual bool focusNextChild(); // Change child... virtual bool focusPrevChild(); // ...focus @@ -465,12 +465,12 @@ class FWidget : public FVTerm, public FObject bool changeFocus (FWidget*, FWidget*, fc::FocusTypes); void processDestroy(); virtual void draw(); - void drawWindows(); + void drawWindows() const; void drawChildren(); static bool isDefaultTheme(); static void initColorTheme(); void destroyColorTheme(); - void setStatusbarText (bool); + void setStatusbarText (bool) const; // Data members struct FWidgetFlags flags{}; @@ -817,11 +817,11 @@ inline const FRect& FWidget::getTermGeometryWithShadow() } //---------------------------------------------------------------------- -inline std::size_t FWidget::getDesktopWidth() +inline std::size_t FWidget::getDesktopWidth() const { return FTerm::getColumnNumber(); } //---------------------------------------------------------------------- -inline std::size_t FWidget::getDesktopHeight() +inline std::size_t FWidget::getDesktopHeight() const { return FTerm::getLineNumber(); } //---------------------------------------------------------------------- @@ -829,7 +829,7 @@ inline const FWidget::FWidgetFlags& FWidget::getFlags() const { return flags; } //---------------------------------------------------------------------- -inline const FPoint FWidget::getCursorPos() +inline const FPoint FWidget::getCursorPos() const { return widget_cursor_position; } //---------------------------------------------------------------------- @@ -1071,7 +1071,7 @@ inline void FWidget::delAccelerator() { delAccelerator(this); } //---------------------------------------------------------------------- -inline const FPoint FWidget::termToWidgetPos (const FPoint& tPos) +inline const FPoint FWidget::termToWidgetPos (const FPoint& tPos) const { return { tPos.getX() + 1 - woffset.getX1() - adjust_wsize.getX() , tPos.getY() + 1 - woffset.getY1() - adjust_wsize.getY() }; diff --git a/src/include/final/fwindow.h b/src/include/final/fwindow.h index 34df1509..f73d4c18 100644 --- a/src/include/final/fwindow.h +++ b/src/include/final/fwindow.h @@ -96,7 +96,7 @@ class FWindow : public FWidget void setWindowFocusWidget (FWidget*); bool activateWindow (bool); bool activateWindow(); - void unsetActiveWindow(); + void unsetActiveWindow() const; bool deactivateWindow(); virtual bool setResizeable (bool); virtual bool setResizeable(); From d8b35dc1a7e881bcfeb4f99f4c92c93a47e9a608 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 12 Jul 2020 17:00:16 +0200 Subject: [PATCH 11/28] More function declared as const --- examples/dialog.cpp | 2 +- examples/ui.cpp | 2 +- src/fapplication.cpp | 12 ++++++------ src/fcolorpalette.cpp | 2 +- src/fkeyboard.cpp | 6 +++--- src/flistview.cpp | 8 ++++---- src/flogger.cpp | 2 +- src/fmenu.cpp | 2 +- src/fmouse.cpp | 2 +- src/foptiattr.cpp | 2 +- src/foptimove.cpp | 8 ++++---- src/fscrollbar.cpp | 2 +- src/fscrollview.cpp | 2 +- src/fstring.cpp | 2 +- src/fterm.cpp | 4 ++-- src/ftermxterminal.cpp | 12 ++++++------ src/fvterm.cpp | 16 ++++++++-------- src/include/final/fapplication.h | 12 ++++++------ src/include/final/fcolorpalette.h | 2 +- src/include/final/fcombobox.h | 4 ++-- src/include/final/fkeyboard.h | 6 +++--- src/include/final/flistview.h | 8 ++++---- src/include/final/flogger.h | 2 +- src/include/final/fmenu.h | 2 +- src/include/final/fmouse.h | 10 +++++----- src/include/final/foptiattr.h | 2 +- src/include/final/foptimove.h | 8 ++++---- src/include/final/fscrollbar.h | 2 +- src/include/final/fscrollview.h | 2 +- src/include/final/fspinbox.h | 4 ++-- src/include/final/fstring.h | 2 +- src/include/final/fterm.h | 4 ++-- src/include/final/ftermxterminal.h | 12 ++++++------ src/include/final/ftextview.h | 8 ++++---- src/include/final/fvterm.h | 16 ++++++++-------- 35 files changed, 96 insertions(+), 96 deletions(-) diff --git a/examples/dialog.cpp b/examples/dialog.cpp index b65b8e82..88591909 100644 --- a/examples/dialog.cpp +++ b/examples/dialog.cpp @@ -34,7 +34,7 @@ void cb_quit (const finalcut::FWidget*, FDataPtr); //---------------------------------------------------------------------- void cb_quit (const finalcut::FWidget*, FDataPtr data) { - auto& app = *(static_cast(data)); + const auto& app = *(static_cast(data)); app.quit(); } diff --git a/examples/ui.cpp b/examples/ui.cpp index 9399431e..fa48153f 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -942,7 +942,7 @@ void MyDialog::cb_input2buttonText (finalcut::FWidget* widget, FDataPtr data) co //---------------------------------------------------------------------- void MyDialog::cb_setTitlebar (finalcut::FWidget* widget, const FDataPtr) { - auto& lineedit = *(static_cast(widget)); + const auto& lineedit = *(static_cast(widget)); finalcut::FString title{}; lineedit >> title; finalcut::FTerm::setTermTitle (title); diff --git a/src/fapplication.cpp b/src/fapplication.cpp index e1519430..1cd5382c 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -613,13 +613,13 @@ void FApplication::keyPressed() } //---------------------------------------------------------------------- -void FApplication::keyReleased() +void FApplication::keyReleased() const { sendKeyUpEvent (keyboard_widget); } //---------------------------------------------------------------------- -void FApplication::escapeKeyPressed() +void FApplication::escapeKeyPressed() const { sendEscapeKeyPressEvent(); } @@ -710,7 +710,7 @@ inline bool FApplication::sendKeyUpEvent (FWidget* widget) const } //---------------------------------------------------------------------- -inline void FApplication::sendKeyboardAccelerator() +inline void FApplication::sendKeyboardAccelerator() const { if ( FWidget::getOpenMenu() ) return; @@ -738,7 +738,7 @@ inline void FApplication::sendKeyboardAccelerator() } //---------------------------------------------------------------------- -void FApplication::processKeyboardEvent() +void FApplication::processKeyboardEvent() const { if ( quit_now || app_exit_loop ) return; @@ -933,7 +933,7 @@ void FApplication::unselectMenubarItems() } //---------------------------------------------------------------------- -void FApplication::sendMouseEvent() +void FApplication::sendMouseEvent() const { auto clicked = FWidget::getClickedWidget(); @@ -1186,7 +1186,7 @@ void FApplication::processMouseEvent() } //---------------------------------------------------------------------- -void FApplication::processResizeEvent() +void FApplication::processResizeEvent() const { if ( ! FTerm::hasChangedTermSize() ) return; diff --git a/src/fcolorpalette.cpp b/src/fcolorpalette.cpp index e0e5fcf0..9eb8329c 100644 --- a/src/fcolorpalette.cpp +++ b/src/fcolorpalette.cpp @@ -48,7 +48,7 @@ void FColorPalette::setPalette (FColor index, int r, int g, int b) const } //---------------------------------------------------------------------- -void FColorPalette::setVGAdefaultPalette() +void FColorPalette::setVGAdefaultPalette() const { setPalette (fc::Black, 0x00, 0x00, 0x00); setPalette (fc::Blue, 0x00, 0x00, 0xaa); diff --git a/src/fkeyboard.cpp b/src/fkeyboard.cpp index 039c18bc..84fb8687 100644 --- a/src/fkeyboard.cpp +++ b/src/fkeyboard.cpp @@ -535,19 +535,19 @@ void FKeyboard::substringKeyHandling() } //---------------------------------------------------------------------- -void FKeyboard::keyPressed() +void FKeyboard::keyPressed() const { keypressed_cmd.execute(); } //---------------------------------------------------------------------- -void FKeyboard::keyReleased() +void FKeyboard::keyReleased() const { keyreleased_cmd.execute(); } //---------------------------------------------------------------------- -void FKeyboard::escapeKeyPressed() +void FKeyboard::escapeKeyPressed() const { escape_key_cmd.execute(); } diff --git a/src/flistview.cpp b/src/flistview.cpp index 82134c89..4441188d 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -1454,7 +1454,7 @@ void FListView::adjustViewport (const int element_count) } //---------------------------------------------------------------------- -void FListView::adjustScrollbars (const std::size_t element_count) +void FListView::adjustScrollbars (const std::size_t element_count) const { const std::size_t width = getClientWidth(); const std::size_t height = getClientHeight(); @@ -1681,7 +1681,7 @@ void FListView::drawBorder() } //---------------------------------------------------------------------- -void FListView::drawScrollbars() +void FListView::drawScrollbars() const { if ( ! hbar->isShown() && isHorizontallyScrollable() ) hbar->show(); @@ -1958,7 +1958,7 @@ inline FString FListView::getCheckBox (const FListViewItem* item) const //---------------------------------------------------------------------- inline FString FListView::getLinePrefix ( const FListViewItem* item - , std::size_t indent ) + , std::size_t indent ) const { FString line{""}; @@ -2286,7 +2286,7 @@ void FListView::recalculateHorizontalBar (std::size_t len) } //---------------------------------------------------------------------- -void FListView::recalculateVerticalBar (std::size_t element_count) +void FListView::recalculateVerticalBar (std::size_t element_count) const { const std::size_t height = getClientHeight(); const int vmax = ( element_count > height ) diff --git a/src/flogger.cpp b/src/flogger.cpp index 4e74138d..106fc849 100644 --- a/src/flogger.cpp +++ b/src/flogger.cpp @@ -69,7 +69,7 @@ const std::string FLogger::getTimeString() const } //---------------------------------------------------------------------- -const std::string FLogger::getEOL() +const std::string FLogger::getEOL() const { if ( getEnding() == FLog::LF ) return "\n"; diff --git a/src/fmenu.cpp b/src/fmenu.cpp index a6e3b767..6f467921 100644 --- a/src/fmenu.cpp +++ b/src/fmenu.cpp @@ -585,7 +585,7 @@ void FMenu::adjustItems() const } //---------------------------------------------------------------------- -int FMenu::adjustX (int x_pos) +int FMenu::adjustX (int x_pos) const { // Is menu outside on the right of the screen? if ( x_pos + int(max_item_width) >= int(getDesktopWidth() - 1) ) diff --git a/src/fmouse.cpp b/src/fmouse.cpp index 5a104580..55c44629 100644 --- a/src/fmouse.cpp +++ b/src/fmouse.cpp @@ -476,7 +476,7 @@ bool FMouseGPM::getGpmKeyPressed (bool is_pending) } //---------------------------------------------------------------------- -void FMouseGPM::drawGpmPointer() +void FMouseGPM::drawGpmPointer() const { if ( isGpmMouseEnabled() && gpm_ev.x != -1 ) GPM_DRAWPOINTER(&gpm_ev); diff --git a/src/foptiattr.cpp b/src/foptiattr.cpp index 211772a9..9f6680dd 100644 --- a/src/foptiattr.cpp +++ b/src/foptiattr.cpp @@ -1545,7 +1545,7 @@ inline void FOptiAttr::resetAttribute (FChar*& attr) const } //---------------------------------------------------------------------- -inline void FOptiAttr::reset (FChar*& attr) +inline void FOptiAttr::reset (FChar*& attr) const { if ( attr ) { diff --git a/src/foptimove.cpp b/src/foptimove.cpp index 8d45320b..92388b80 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -707,7 +707,7 @@ inline int FOptiMove::verticalMove (char move[], int from_y, int to_y) //---------------------------------------------------------------------- inline void FOptiMove::downMove ( char move[], int& vtime - , int from_y, int to_y ) + , int from_y, int to_y ) const { const int num = to_y - from_y; @@ -735,7 +735,7 @@ inline void FOptiMove::downMove ( char move[], int& vtime //---------------------------------------------------------------------- inline void FOptiMove::upMove ( char move[], int& vtime - , int from_y, int to_y ) + , int from_y, int to_y ) const { const int num = from_y - to_y; @@ -786,7 +786,7 @@ inline int FOptiMove::horizontalMove (char hmove[], int from_x, int to_x) //---------------------------------------------------------------------- inline void FOptiMove::rightMove ( char hmove[], int& htime - , int from_x, int to_x ) + , int from_x, int to_x ) const { int num = to_x - from_x; @@ -841,7 +841,7 @@ inline void FOptiMove::rightMove ( char hmove[], int& htime //---------------------------------------------------------------------- inline void FOptiMove::leftMove ( char hmove[], int& htime - , int from_x, int to_x ) + , int from_x, int to_x ) const { int num = from_x - to_x; diff --git a/src/fscrollbar.cpp b/src/fscrollbar.cpp index 43b3a004..375fb78e 100644 --- a/src/fscrollbar.cpp +++ b/src/fscrollbar.cpp @@ -613,7 +613,7 @@ void FScrollbar::drawButtons() } //---------------------------------------------------------------------- -FScrollbar::sType FScrollbar::getClickedScrollType (int x, int y) +FScrollbar::sType FScrollbar::getClickedScrollType (int x, int y) const { if ( bar_orientation == fc::vertical ) { diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp index fb82aef3..fe0a6dae 100644 --- a/src/fscrollview.cpp +++ b/src/fscrollview.cpp @@ -846,7 +846,7 @@ void FScrollView::setVerticalScrollBarVisibility() const } //---------------------------------------------------------------------- -void FScrollView::setViewportCursor() +void FScrollView::setViewportCursor() const { if ( ! isChild(getFocusWidget()) ) return; diff --git a/src/fstring.cpp b/src/fstring.cpp index 21eb6997..1216fa32 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp @@ -776,7 +776,7 @@ const FString FString::mid (std::size_t pos, std::size_t len) const } //---------------------------------------------------------------------- -FStringList FString::split (const FString& delimiter) +FStringList FString::split (const FString& delimiter) const { const FString s{*this}; FStringList string_list{}; diff --git a/src/fterm.cpp b/src/fterm.cpp index e2ff12b2..01788721 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -2359,7 +2359,7 @@ void FTerm::init() } //---------------------------------------------------------------------- -bool FTerm::init_terminal() +bool FTerm::init_terminal() const { // Initialize termios FTermios::init(); @@ -2462,7 +2462,7 @@ void FTerm::initBaudRate() const } //---------------------------------------------------------------------- -void FTerm::finish() +void FTerm::finish() const { // Set default signal handler diff --git a/src/ftermxterminal.cpp b/src/ftermxterminal.cpp index 2a501e2f..c9093bfe 100644 --- a/src/ftermxterminal.cpp +++ b/src/ftermxterminal.cpp @@ -368,7 +368,7 @@ void FTermXTerminal::setXTermTitle() } //---------------------------------------------------------------------- -void FTermXTerminal::setXTermSize() +void FTermXTerminal::setXTermSize() const { initCheck(); @@ -572,7 +572,7 @@ inline void FTermXTerminal::setXTermDefaultsMouseCursor() } //---------------------------------------------------------------------- -inline bool FTermXTerminal::canSetXTermBackground() +inline bool FTermXTerminal::canSetXTermBackground() const { initCheck(false); @@ -691,7 +691,7 @@ void FTermXTerminal::resetXTermHighlightBackground() } //---------------------------------------------------------------------- -bool FTermXTerminal::canResetColor() +bool FTermXTerminal::canResetColor() const { initCheck(false); @@ -712,7 +712,7 @@ bool FTermXTerminal::canResetColor() } //---------------------------------------------------------------------- -void FTermXTerminal::oscPrefix() +void FTermXTerminal::oscPrefix() const { initCheck(); @@ -729,7 +729,7 @@ void FTermXTerminal::oscPrefix() } //---------------------------------------------------------------------- -void FTermXTerminal::oscPostfix() +void FTermXTerminal::oscPostfix() const { initCheck(); @@ -786,7 +786,7 @@ const FString FTermXTerminal::captureXTermFont() } //---------------------------------------------------------------------- -const FString FTermXTerminal::captureXTermTitle() +const FString FTermXTerminal::captureXTermTitle() const { initCheck(FString{}); diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 94cc408c..78660d49 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -711,7 +711,7 @@ void FVTerm::createArea ( const FRect& box //---------------------------------------------------------------------- void FVTerm::resizeArea ( const FRect& box , const FSize& shadow - , FTermArea* area ) + , FTermArea* area ) const { // Resize the virtual window to a new size. @@ -854,7 +854,7 @@ void FVTerm::restoreVTerm (const FRect& box) } //---------------------------------------------------------------------- -bool FVTerm::updateVTermCursor (const FTermArea* area) +bool FVTerm::updateVTermCursor (const FTermArea* area) const { if ( ! area ) return false; @@ -1147,7 +1147,7 @@ void FVTerm::putArea (const FPoint& pos, const FTermArea* area) } //---------------------------------------------------------------------- -void FVTerm::scrollAreaForward (FTermArea* area) +void FVTerm::scrollAreaForward (FTermArea* area) const { // Scrolls the entire area up line down FChar nc{}; // next character @@ -1201,7 +1201,7 @@ void FVTerm::scrollAreaForward (FTermArea* area) } //---------------------------------------------------------------------- -void FVTerm::scrollAreaReverse (FTermArea* area) +void FVTerm::scrollAreaReverse (FTermArea* area) const { // Scrolls the entire area one line down @@ -2111,7 +2111,7 @@ void FVTerm::getAreaCharacter ( const FPoint& pos, const FTermArea* area } //---------------------------------------------------------------------- -bool FVTerm::clearTerm (int fillchar) +bool FVTerm::clearTerm (int fillchar) const { // Clear the real terminal and put cursor at home @@ -2324,7 +2324,7 @@ bool FVTerm::canClearTrailingWS (uInt& xmax, uInt y) } //---------------------------------------------------------------------- -bool FVTerm::skipUnchangedCharacters(uInt& x, uInt xmax, uInt y) +bool FVTerm::skipUnchangedCharacters (uInt& x, uInt xmax, uInt y) const { // Skip characters without changes if it is faster than redrawing @@ -2860,7 +2860,7 @@ void FVTerm::updateTerminalLine (uInt y) } //---------------------------------------------------------------------- -bool FVTerm::updateTerminalCursor() +bool FVTerm::updateTerminalCursor() const { // Updates the input cursor visibility and the position if ( vterm && vterm->input_cursor_visible ) @@ -3006,7 +3006,7 @@ inline void FVTerm::appendCharacter (FChar*& next_char) } //---------------------------------------------------------------------- -inline void FVTerm::appendChar (FChar*& next_char) +inline void FVTerm::appendChar (FChar*& next_char) const { newFontChanges (next_char); charsetChanges (next_char); diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index aab0c61b..6b85dc8b 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -160,15 +160,15 @@ class FApplication : public FWidget void findKeyboardWidget() const; bool isKeyPressed() const; void keyPressed(); - void keyReleased(); - void escapeKeyPressed(); + void keyReleased() const; + void escapeKeyPressed() const; void performKeyboardAction(); void sendEscapeKeyPressEvent() const; bool sendKeyDownEvent (FWidget*) const; bool sendKeyPressEvent (FWidget*) const; bool sendKeyUpEvent (FWidget*) const; - void sendKeyboardAccelerator(); - void processKeyboardEvent(); + void sendKeyboardAccelerator() const; + void processKeyboardEvent() const; bool processDialogSwitchAccelerator() const; bool processAccelerator (const FWidget* const&) const; bool getMouseEvent() const; @@ -176,7 +176,7 @@ class FApplication : public FWidget void unsetMoveSizeMode() const; void closeDropDown(); void unselectMenubarItems(); - void sendMouseEvent(); + void sendMouseEvent() const; void sendMouseMoveEvent ( const FPoint& , const FPoint& , int ) const; @@ -192,7 +192,7 @@ class FApplication : public FWidget void sendWheelEvent (const FPoint&, const FPoint&) const; static FWidget* processParameters (const int&, char*[]); void processMouseEvent(); - void processResizeEvent(); + void processResizeEvent() const; void processCloseWidget(); void processLogger() const; bool processNextEvent(); diff --git a/src/include/final/fcolorpalette.h b/src/include/final/fcolorpalette.h index 860c40b4..606ab79c 100644 --- a/src/include/final/fcolorpalette.h +++ b/src/include/final/fcolorpalette.h @@ -67,7 +67,7 @@ class FColorPalette protected: void setPalette (FColor, int, int, int) const; - void setVGAdefaultPalette(); + void setVGAdefaultPalette() const; private: // Data members diff --git a/src/include/final/fcombobox.h b/src/include/final/fcombobox.h index 1fddc318..62e30897 100644 --- a/src/include/final/fcombobox.h +++ b/src/include/final/fcombobox.h @@ -151,7 +151,7 @@ class FComboBox : public FWidget std::size_t getCount() const; FString getText() const; FDataPtr getItemData(); - FLineEdit::label_o getLabelOrientation(); + FLineEdit::label_o getLabelOrientation() const; // Mutators void setSize (const FSize&, bool = true) override; @@ -254,7 +254,7 @@ inline FDataPtr FComboBox::getItemData() } //---------------------------------------------------------------------- -inline FLineEdit::label_o FComboBox::getLabelOrientation() +inline FLineEdit::label_o FComboBox::getLabelOrientation() const { return input_field.getLabelOrientation(); } //---------------------------------------------------------------------- diff --git a/src/include/final/fkeyboard.h b/src/include/final/fkeyboard.h index 7b4535f6..3a6b3b58 100644 --- a/src/include/final/fkeyboard.h +++ b/src/include/final/fkeyboard.h @@ -156,9 +156,9 @@ class FKeyboard final FKey parseKeyString(); FKey keyCorrection (const FKey&) const; void substringKeyHandling(); - void keyPressed(); - void keyReleased(); - void escapeKeyPressed(); + void keyPressed() const; + void keyReleased() const; + void escapeKeyPressed() const; // Data members FKeyboardCommand keypressed_cmd{}; diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h index 79fb11be..bff471ae 100644 --- a/src/include/final/flistview.h +++ b/src/include/final/flistview.h @@ -358,7 +358,7 @@ class FListView : public FWidget protected: // Methods void adjustViewport (const int); - void adjustScrollbars (const std::size_t); + void adjustScrollbars (const std::size_t) const; void adjustSize() override; private: @@ -399,14 +399,14 @@ class FListView : public FWidget iterator getListEnd (const FListViewItem*); void draw() override; void drawBorder() override; - void drawScrollbars(); + void drawScrollbars() const; void drawHeadlines(); void drawList(); void drawListLine (const FListViewItem*, bool, bool); void clearList(); void setLineAttributes (bool, bool) const; FString getCheckBox (const FListViewItem* item) const; - FString getLinePrefix (const FListViewItem*, std::size_t); + FString getLinePrefix (const FListViewItem*, std::size_t) const; void drawSortIndicator (std::size_t&, std::size_t); void drawHeadlineLabel (const headerItems::const_iterator&); void drawHeaderBorder (std::size_t); @@ -418,7 +418,7 @@ class FListView : public FWidget void beforeInsertion (FListViewItem*); void afterInsertion(); void recalculateHorizontalBar (std::size_t); - void recalculateVerticalBar (std::size_t); + void recalculateVerticalBar (std::size_t) const; void mouseHeaderClicked(); void wheelUp (int); void wheelDown (int); diff --git a/src/include/final/flogger.h b/src/include/final/flogger.h index ea00fe06..2811bc67 100644 --- a/src/include/final/flogger.h +++ b/src/include/final/flogger.h @@ -87,7 +87,7 @@ class FLogger : public FLog // Methods void newlineReplace (std::string&, const std::string&) const; const std::string getTimeString() const; - const std::string getEOL(); + const std::string getEOL() const; void printLogLine (const std::string&); // Data member diff --git a/src/include/final/fmenu.h b/src/include/final/fmenu.h index 69516a11..34ec1418 100644 --- a/src/include/final/fmenu.h +++ b/src/include/final/fmenu.h @@ -176,7 +176,7 @@ class FMenu : public FWindow, public FMenuList void initCallbacks(); void calculateDimensions(); void adjustItems() const; - int adjustX(int); + int adjustX(int) const; void openSubMenu (FMenu*, bool = false); void closeOpenedSubMenu(); void hideSubMenus(); diff --git a/src/include/final/fmouse.h b/src/include/final/fmouse.h index 5a1dc369..e182c9b7 100644 --- a/src/include/final/fmouse.h +++ b/src/include/final/fmouse.h @@ -234,7 +234,7 @@ class FMouseGPM final : public FMouse void interpretKeyDown(); void interpretKeyUp(); bool getGpmKeyPressed(bool); - void drawGpmPointer(); + void drawGpmPointer() const; private: // Enumeration @@ -514,8 +514,8 @@ class FMouseControl FMouse* getMouseWithData(); FMouse* getMouseWithEvent(); void xtermMouse (bool) const; - void enableXTermMouse(); - void disableXTermMouse(); + void enableXTermMouse() const; + void disableXTermMouse() const; // Data member FMouseProtocol mouse_protocol{}; @@ -530,11 +530,11 @@ inline const FString FMouseControl::getClassName() const { return "FMouseControl"; } //---------------------------------------------------------------------- -inline void FMouseControl::enableXTermMouse() +inline void FMouseControl::enableXTermMouse() const { xtermMouse(true); } //---------------------------------------------------------------------- -inline void FMouseControl::disableXTermMouse() +inline void FMouseControl::disableXTermMouse() const { xtermMouse(false); } } // namespace finalcut diff --git a/src/include/final/foptiattr.h b/src/include/final/foptiattr.h index 95c38c97..d0aa7abf 100644 --- a/src/include/final/foptiattr.h +++ b/src/include/final/foptiattr.h @@ -253,7 +253,7 @@ class FOptiAttr final void change_to_default_color (FChar*&, FChar*&, FColor&, FColor&); void change_current_color (const FChar* const&, FColor, FColor); void resetAttribute (FChar*&) const; - void reset (FChar*&); + void reset (FChar*&) const; bool caused_reset_attributes (const char[], uChar = all_tests) const; bool hasCharsetEquivalence() const; void detectSwitchOn (const FChar* const&, const FChar* const&); diff --git a/src/include/final/foptimove.h b/src/include/final/foptimove.h index f7068b1f..d86a0c83 100644 --- a/src/include/final/foptimove.h +++ b/src/include/final/foptimove.h @@ -171,11 +171,11 @@ class FOptiMove final int repeatedAppend (const capability&, volatile int, char*) const; int relativeMove (char[], int, int, int, int); int verticalMove (char[], int, int); - void downMove (char[], int&, int, int); - void upMove (char[], int&, int, int); + void downMove (char[], int&, int, int) const; + void upMove (char[], int&, int, int) const; int horizontalMove (char[], int, int); - void rightMove (char[], int&, int, int); - void leftMove (char[], int&, int, int); + void rightMove (char[], int&, int, int) const; + void leftMove (char[], int&, int, int) const; bool isWideMove (int, int, int, int) const; bool isMethod0Faster (int&, int, int); diff --git a/src/include/final/fscrollbar.h b/src/include/final/fscrollbar.h index 3578cd70..cb24a08c 100644 --- a/src/include/final/fscrollbar.h +++ b/src/include/final/fscrollbar.h @@ -138,7 +138,7 @@ class FScrollbar : public FWidget void drawHorizontalBar(); void drawHorizontalBackgroundColumn(); void drawButtons(); - sType getClickedScrollType (int, int); + sType getClickedScrollType (int, int) const; sType getVerticalClickedScrollType (int) const; sType getHorizontalClickedScrollType (int) const; int getSliderClickPos (int, int) const; diff --git a/src/include/final/fscrollview.h b/src/include/final/fscrollview.h index e9d3a813..a99b3c49 100644 --- a/src/include/final/fscrollview.h +++ b/src/include/final/fscrollview.h @@ -169,7 +169,7 @@ class FScrollView : public FWidget , Callback ); void setHorizontalScrollBarVisibility() const; void setVerticalScrollBarVisibility() const; - void setViewportCursor(); + void setViewportCursor() const; // Callback methods void cb_vbarChange (const FWidget*, const FDataPtr); diff --git a/src/include/final/fspinbox.h b/src/include/final/fspinbox.h index 9ed83b74..422c986c 100644 --- a/src/include/final/fspinbox.h +++ b/src/include/final/fspinbox.h @@ -82,7 +82,7 @@ class FSpinBox : public FWidget sInt64 getValue() const; FString getPrefix() const; FString getSuffix() const; - FLineEdit::label_o getLabelOrientation(); + FLineEdit::label_o getLabelOrientation() const; // Mutators void setSize (const FSize&, bool = true) override; @@ -175,7 +175,7 @@ inline FString FSpinBox::getSuffix() const { return sfix; } //---------------------------------------------------------------------- -inline FLineEdit::label_o FSpinBox::getLabelOrientation() +inline FLineEdit::label_o FSpinBox::getLabelOrientation() const { return input_field.getLabelOrientation(); } //---------------------------------------------------------------------- diff --git a/src/include/final/fstring.h b/src/include/final/fstring.h index d215f799..c3c5bcf4 100644 --- a/src/include/final/fstring.h +++ b/src/include/final/fstring.h @@ -211,7 +211,7 @@ class FString const FString right (std::size_t) const; const FString mid (std::size_t, std::size_t) const; - FStringList split (const FString&); + FStringList split (const FString&) const; FString& setString (const FString&); template diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h index 0e1f38b5..6bb74c48 100644 --- a/src/include/final/fterm.h +++ b/src/include/final/fterm.h @@ -352,11 +352,11 @@ class FTerm final void allocationValues() const; void deallocationValues(); void init(); - bool init_terminal(); + bool init_terminal() const; void initOSspecifics() const; void initTermspecifics() const; void initBaudRate() const; - void finish(); + void finish() const; void finishOSspecifics() const; void finish_encoding() const; void destroyColorPaletteTheme(); diff --git a/src/include/final/ftermxterminal.h b/src/include/final/ftermxterminal.h index ead250de..ff3b62cb 100644 --- a/src/include/final/ftermxterminal.h +++ b/src/include/final/ftermxterminal.h @@ -114,7 +114,7 @@ class FTermXTerminal final void setXTermCursorStyle(); void setXTermFont(); void setXTermTitle(); - void setXTermSize(); + void setXTermSize() const; void setXTermForeground(); void setXTermBackground(); void setXTermCursorColor(); @@ -124,7 +124,7 @@ class FTermXTerminal final void setXTerm8ColorDefaults(); void setXTerm16ColorDefaults(); void setXTermDefaultsMouseCursor(); - bool canSetXTermBackground(); + bool canSetXTermBackground() const; void resetXTermColorMap(); void resetXTermForeground(); void resetXTermBackground(); @@ -133,11 +133,11 @@ class FTermXTerminal final void resetXTermMouseBackground(); void resetXTermHighlightBackground(); bool isInitialized() const; - bool canResetColor(); - void oscPrefix(); - void oscPostfix(); + bool canResetColor() const; + void oscPrefix() const; + void oscPostfix() const; const FString captureXTermFont(); - const FString captureXTermTitle(); + const FString captureXTermTitle() const; static void enableXTermMouse(); static void disableXTermMouse(); void enableXTermMetaSendsESC(); diff --git a/src/include/final/ftextview.h b/src/include/final/ftextview.h index f8d6996c..ebea7ce3 100644 --- a/src/include/final/ftextview.h +++ b/src/include/final/ftextview.h @@ -145,8 +145,8 @@ class FTextView : public FWidget std::size_t getTextWidth() const; // Inquiry - bool isHorizontallyScrollable(); - bool isVerticallyScrollable(); + bool isHorizontallyScrollable() const; + bool isVerticallyScrollable() const; // Methods void init(); @@ -259,11 +259,11 @@ inline void FTextView::deleteLine (int pos) { deleteRange (pos, pos); } //---------------------------------------------------------------------- -inline bool FTextView::isHorizontallyScrollable() +inline bool FTextView::isHorizontallyScrollable() const { return bool( max_line_width > getTextWidth() ); } //---------------------------------------------------------------------- -inline bool FTextView::isVerticallyScrollable() +inline bool FTextView::isVerticallyScrollable() const { return bool( getRows() > getTextHeight() ); } } // namespace finalcut diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 7b47c9a4..42ffedbe 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -301,18 +301,18 @@ class FVTerm , FTermArea*& ); void resizeArea ( const FRect& , const FSize& - , FTermArea* ); + , FTermArea* ) const; static void removeArea (FTermArea*&); static void restoreVTerm (const FRect&); - bool updateVTermCursor (const FTermArea*); + bool updateVTermCursor (const FTermArea*) const; static void setAreaCursor ( const FPoint& , bool, FTermArea* ); static void getArea (const FPoint&, const FTermArea*); static void getArea (const FRect&, const FTermArea*); void putArea (const FTermArea*); static void putArea (const FPoint&, const FTermArea*); - void scrollAreaForward (FTermArea*); - void scrollAreaReverse (FTermArea*); + void scrollAreaForward (FTermArea*) const; + void scrollAreaReverse (FTermArea*) const; void clearArea (FTermArea*, int = ' '); void processTerminalUpdate(); static void startTerminalUpdate(); @@ -383,13 +383,13 @@ class FVTerm , const FChar*, FChar* ); static void getAreaCharacter ( const FPoint&, const FTermArea* , FChar*& ); - bool clearTerm (int = ' '); + bool clearTerm (int = ' ') const; bool clearFullArea (const FTermArea*, FChar&); static void clearAreaWithShadow (const FTermArea*, const FChar&); static bool canClearToEOL (uInt, uInt); static bool canClearLeadingWS (uInt&, uInt); static bool canClearTrailingWS (uInt&, uInt); - bool skipUnchangedCharacters (uInt&, uInt, uInt); + bool skipUnchangedCharacters (uInt&, uInt, uInt) const; void printRange (uInt, uInt, uInt, bool); void replaceNonPrintableFullwidth (uInt, FChar*&) const; void printCharacter (uInt&, uInt, bool, FChar*&); @@ -405,7 +405,7 @@ class FVTerm bool printWrap (FTermArea*) const; void printPaddingCharacter (FTermArea*, const FChar&); void updateTerminalLine (uInt); - bool updateTerminalCursor(); + bool updateTerminalCursor() const; bool isInsideTerminal (const FPoint&) const; bool isTermSizeChanged() const; static void markAsPrinted (uInt, uInt); @@ -413,7 +413,7 @@ class FVTerm static void newFontChanges (FChar*&); static void charsetChanges (FChar*&); void appendCharacter (FChar*&); - void appendChar (FChar*&); + void appendChar (FChar*&) const; void appendAttributes (FChar*&) const; int appendLowerRight (FChar*&); static void characterFilter (FChar*&); From 13dc85860bced66da77a201c48d96770e93bf7b7 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 12 Jul 2020 17:54:13 +0200 Subject: [PATCH 12/28] More function declared as const --- src/foptimove.cpp | 4 ++-- src/ftermxterminal.cpp | 16 ++++++++-------- src/ftextview.cpp | 2 +- src/fvterm.cpp | 8 ++++---- src/include/final/foptimove.h | 4 ++-- src/include/final/ftermxterminal.h | 16 ++++++++-------- src/include/final/ftextview.h | 2 +- src/include/final/fvterm.h | 8 ++++---- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/foptimove.cpp b/src/foptimove.cpp index 92388b80..d54bc521 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -680,7 +680,7 @@ int FOptiMove::relativeMove ( char move[] } //---------------------------------------------------------------------- -inline int FOptiMove::verticalMove (char move[], int from_y, int to_y) +inline int FOptiMove::verticalMove (char move[], int from_y, int to_y) const { int vtime{LONG_DURATION}; @@ -762,7 +762,7 @@ inline void FOptiMove::upMove ( char move[], int& vtime } //---------------------------------------------------------------------- -inline int FOptiMove::horizontalMove (char hmove[], int from_x, int to_x) +inline int FOptiMove::horizontalMove (char hmove[], int from_x, int to_x) const { int htime{LONG_DURATION}; diff --git a/src/ftermxterminal.cpp b/src/ftermxterminal.cpp index c9093bfe..e6bd664b 100644 --- a/src/ftermxterminal.cpp +++ b/src/ftermxterminal.cpp @@ -587,7 +587,7 @@ inline bool FTermXTerminal::canSetXTermBackground() const } //---------------------------------------------------------------------- -void FTermXTerminal::resetXTermColorMap() +void FTermXTerminal::resetXTermColorMap() const { // Reset the entire color table @@ -607,7 +607,7 @@ void FTermXTerminal::resetXTermColorMap() } //---------------------------------------------------------------------- -void FTermXTerminal::resetXTermForeground() +void FTermXTerminal::resetXTermForeground() const { // Reset the XTerm text foreground color @@ -621,7 +621,7 @@ void FTermXTerminal::resetXTermForeground() } //---------------------------------------------------------------------- -void FTermXTerminal::resetXTermBackground() +void FTermXTerminal::resetXTermBackground() const { // Reset the XTerm text background color @@ -635,7 +635,7 @@ void FTermXTerminal::resetXTermBackground() } //---------------------------------------------------------------------- -void FTermXTerminal::resetXTermCursorColor() +void FTermXTerminal::resetXTermCursorColor() const { // Reset the text cursor color @@ -649,7 +649,7 @@ void FTermXTerminal::resetXTermCursorColor() } //---------------------------------------------------------------------- -void FTermXTerminal::resetXTermMouseForeground() +void FTermXTerminal::resetXTermMouseForeground() const { // Reset the mouse foreground color @@ -663,7 +663,7 @@ void FTermXTerminal::resetXTermMouseForeground() } //---------------------------------------------------------------------- -void FTermXTerminal::resetXTermMouseBackground() +void FTermXTerminal::resetXTermMouseBackground() const { // Reset the mouse background color @@ -677,7 +677,7 @@ void FTermXTerminal::resetXTermMouseBackground() } //---------------------------------------------------------------------- -void FTermXTerminal::resetXTermHighlightBackground() +void FTermXTerminal::resetXTermHighlightBackground() const { // Reset the highlight background color @@ -742,7 +742,7 @@ void FTermXTerminal::oscPostfix() const } //---------------------------------------------------------------------- -const FString FTermXTerminal::captureXTermFont() +const FString FTermXTerminal::captureXTermFont() const { initCheck(FString{}); diff --git a/src/ftextview.cpp b/src/ftextview.cpp index 060ad2df..d180be48 100644 --- a/src/ftextview.cpp +++ b/src/ftextview.cpp @@ -642,7 +642,7 @@ void FTextView::drawBorder() } //---------------------------------------------------------------------- -void FTextView::drawScrollbars() +void FTextView::drawScrollbars() const { if ( ! hbar->isShown() && isHorizontallyScrollable() ) hbar->show(); diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 78660d49..756da257 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -228,7 +228,7 @@ void FVTerm::createVTerm (const FSize& size) } //---------------------------------------------------------------------- -void FVTerm::resizeVTerm (const FSize& size) +void FVTerm::resizeVTerm (const FSize& size) const { // resize virtual terminal @@ -992,7 +992,7 @@ void FVTerm::getArea (const FRect& box, const FTermArea* area) } //---------------------------------------------------------------------- -void FVTerm::putArea (const FTermArea* area) +void FVTerm::putArea (const FTermArea* area) const { // Add area changes to the virtual terminal @@ -2158,7 +2158,7 @@ bool FVTerm::clearTerm (int fillchar) const } //---------------------------------------------------------------------- -bool FVTerm::clearFullArea (const FTermArea* area, FChar& nc) +bool FVTerm::clearFullArea (const FTermArea* area, FChar& nc) const { // Clear area const int area_size = area->width * area->height; @@ -3028,7 +3028,7 @@ inline void FVTerm::appendAttributes (FChar*& next_attr) const } //---------------------------------------------------------------------- -int FVTerm::appendLowerRight (FChar*& screen_char) +int FVTerm::appendLowerRight (FChar*& screen_char) const { const auto& SA = TCAP(fc::t_enter_am_mode); const auto& RA = TCAP(fc::t_exit_am_mode); diff --git a/src/include/final/foptimove.h b/src/include/final/foptimove.h index d86a0c83..91753122 100644 --- a/src/include/final/foptimove.h +++ b/src/include/final/foptimove.h @@ -170,10 +170,10 @@ class FOptiMove final int capDurationToLength (int) const; int repeatedAppend (const capability&, volatile int, char*) const; int relativeMove (char[], int, int, int, int); - int verticalMove (char[], int, int); + int verticalMove (char[], int, int) const; void downMove (char[], int&, int, int) const; void upMove (char[], int&, int, int) const; - int horizontalMove (char[], int, int); + int horizontalMove (char[], int, int) const; void rightMove (char[], int&, int, int) const; void leftMove (char[], int&, int, int) const; diff --git a/src/include/final/ftermxterminal.h b/src/include/final/ftermxterminal.h index ff3b62cb..c279a1d2 100644 --- a/src/include/final/ftermxterminal.h +++ b/src/include/final/ftermxterminal.h @@ -125,18 +125,18 @@ class FTermXTerminal final void setXTerm16ColorDefaults(); void setXTermDefaultsMouseCursor(); bool canSetXTermBackground() const; - void resetXTermColorMap(); - void resetXTermForeground(); - void resetXTermBackground(); - void resetXTermCursorColor(); - void resetXTermMouseForeground(); - void resetXTermMouseBackground(); - void resetXTermHighlightBackground(); + void resetXTermColorMap() const; + void resetXTermForeground() const; + void resetXTermBackground() const; + void resetXTermCursorColor() const; + void resetXTermMouseForeground() const; + void resetXTermMouseBackground() const; + void resetXTermHighlightBackground() const; bool isInitialized() const; bool canResetColor() const; void oscPrefix() const; void oscPostfix() const; - const FString captureXTermFont(); + const FString captureXTermFont() const; const FString captureXTermTitle() const; static void enableXTermMouse(); static void disableXTermMouse(); diff --git a/src/include/final/ftextview.h b/src/include/final/ftextview.h index ebea7ce3..4cde2061 100644 --- a/src/include/final/ftextview.h +++ b/src/include/final/ftextview.h @@ -153,7 +153,7 @@ class FTextView : public FWidget void mapKeyFunctions(); void draw() override; void drawBorder() override; - void drawScrollbars(); + void drawScrollbars() const; void drawText(); bool useFDialogBorder() const; bool isPrintable (wchar_t) const; diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 42ffedbe..4daf8c7e 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -251,7 +251,7 @@ class FVTerm // Methods virtual void clearArea (int = ' '); void createVTerm (const FSize&); - void resizeVTerm (const FSize&); + void resizeVTerm (const FSize&) const; void putVTerm(); void updateTerminal(); virtual void addPreprocessingHandler ( const FVTerm* @@ -309,7 +309,7 @@ class FVTerm , bool, FTermArea* ); static void getArea (const FPoint&, const FTermArea*); static void getArea (const FRect&, const FTermArea*); - void putArea (const FTermArea*); + void putArea (const FTermArea*) const; static void putArea (const FPoint&, const FTermArea*); void scrollAreaForward (FTermArea*) const; void scrollAreaReverse (FTermArea*) const; @@ -384,7 +384,7 @@ class FVTerm static void getAreaCharacter ( const FPoint&, const FTermArea* , FChar*& ); bool clearTerm (int = ' ') const; - bool clearFullArea (const FTermArea*, FChar&); + bool clearFullArea (const FTermArea*, FChar&) const; static void clearAreaWithShadow (const FTermArea*, const FChar&); static bool canClearToEOL (uInt, uInt); static bool canClearLeadingWS (uInt&, uInt); @@ -415,7 +415,7 @@ class FVTerm void appendCharacter (FChar*&); void appendChar (FChar*&) const; void appendAttributes (FChar*&) const; - int appendLowerRight (FChar*&); + int appendLowerRight (FChar*&) const; static void characterFilter (FChar*&); static void appendOutputBuffer (const std::string&); static void appendOutputBuffer (const char[]); From f07a481d46dd24e88739471134ecf0dbcf56f20d Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 12 Jul 2020 19:05:29 +0200 Subject: [PATCH 13/28] More function declared as const --- src/foptimove.cpp | 2 +- src/ftermxterminal.cpp | 2 +- src/fvterm.cpp | 6 +++--- src/include/final/fdata.h | 22 +++++++++++++++++++++- src/include/final/fevent.h | 2 +- src/include/final/foptimove.h | 2 +- src/include/final/ftermxterminal.h | 2 +- src/include/final/fvterm.h | 6 +++--- 8 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/foptimove.cpp b/src/foptimove.cpp index d54bc521..e93d5b14 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -641,7 +641,7 @@ int FOptiMove::repeatedAppend ( const capability& o //---------------------------------------------------------------------- int FOptiMove::relativeMove ( char move[] , int from_x, int from_y - , int to_x, int to_y ) + , int to_x, int to_y ) const { int vtime{0}; int htime{0}; diff --git a/src/ftermxterminal.cpp b/src/ftermxterminal.cpp index e6bd664b..9ed49bc3 100644 --- a/src/ftermxterminal.cpp +++ b/src/ftermxterminal.cpp @@ -202,7 +202,7 @@ void FTermXTerminal::setDefaults() } //---------------------------------------------------------------------- -void FTermXTerminal::resetColorMap() +void FTermXTerminal::resetColorMap() const { // Reset the entire color table diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 756da257..f05bfcd5 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -1256,7 +1256,7 @@ void FVTerm::scrollAreaReverse (FTermArea* area) const } //---------------------------------------------------------------------- -void FVTerm::clearArea (FTermArea* area, int fillchar) +void FVTerm::clearArea (FTermArea* area, int fillchar) const { // Clear the area with the current attributes @@ -1682,7 +1682,7 @@ bool FVTerm::updateVTermCharacter ( const FTermArea* area } //---------------------------------------------------------------------- -void FVTerm::updateVTerm() +void FVTerm::updateVTerm() const { // Updates the character data from all areas to VTerm @@ -2991,7 +2991,7 @@ inline void FVTerm::charsetChanges (FChar*& next_char) } //---------------------------------------------------------------------- -inline void FVTerm::appendCharacter (FChar*& next_char) +inline void FVTerm::appendCharacter (FChar*& next_char) const { const int term_width = vterm->width - 1; const int term_height = vterm->height - 1; diff --git a/src/include/final/fdata.h b/src/include/final/fdata.h index e2749c76..a59a90d7 100644 --- a/src/include/final/fdata.h +++ b/src/include/final/fdata.h @@ -31,9 +31,29 @@ template struct FData { explicit FData (T v) - : value(v) + : value{v} { } + FData (const FData& d) // Copy constructor + : value{d.value} + { } + + FData& operator = (const FData& d) // Copy assignment operator (=) + { + value = d.value; + return *this; + } + + FData (FData&& d) noexcept // Move constructor + : value{std::move(d.value)} + { } + + FData& operator = (FData&& d) noexcept // Move assignment operator (=) + { + value = std::move(d.value); + return *this; + } + T operator () () const { return value; diff --git a/src/include/final/fevent.h b/src/include/final/fevent.h index 21dfc7d5..51298a62 100644 --- a/src/include/final/fevent.h +++ b/src/include/final/fevent.h @@ -327,7 +327,7 @@ class FTimerEvent : public FEvent // timer event // class FUserEvent //---------------------------------------------------------------------- -class FUserEvent : public FEvent // timer event +class FUserEvent : public FEvent // user event { public: FUserEvent() = default; diff --git a/src/include/final/foptimove.h b/src/include/final/foptimove.h index 91753122..7c8914c1 100644 --- a/src/include/final/foptimove.h +++ b/src/include/final/foptimove.h @@ -169,7 +169,7 @@ class FOptiMove final int capDuration (const char[], int) const; int capDurationToLength (int) const; int repeatedAppend (const capability&, volatile int, char*) const; - int relativeMove (char[], int, int, int, int); + int relativeMove (char[], int, int, int, int) const; int verticalMove (char[], int, int) const; void downMove (char[], int&, int, int) const; void upMove (char[], int&, int, int) const; diff --git a/src/include/final/ftermxterminal.h b/src/include/final/ftermxterminal.h index c279a1d2..628ed9ae 100644 --- a/src/include/final/ftermxterminal.h +++ b/src/include/final/ftermxterminal.h @@ -98,7 +98,7 @@ class FTermXTerminal final // Methods void init(); void setDefaults(); - void resetColorMap(); + void resetColorMap() const; void resetForeground(); void resetBackground(); void resetCursorColor(); diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 4daf8c7e..a146e485 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -313,7 +313,7 @@ class FVTerm static void putArea (const FPoint&, const FTermArea*); void scrollAreaForward (FTermArea*) const; void scrollAreaReverse (FTermArea*) const; - void clearArea (FTermArea*, int = ' '); + void clearArea (FTermArea*, int = ' ') const; void processTerminalUpdate(); static void startTerminalUpdate(); static void finishTerminalUpdate(); @@ -364,7 +364,7 @@ class FVTerm static bool updateVTermCharacter ( const FTermArea* , const FPoint& , const FPoint& ); - void updateVTerm(); + void updateVTerm() const; static void callPreprocessingHandler (const FTermArea*); bool hasChildAreaChanges (FTermArea*) const; void clearChildAreaChanges (const FTermArea*) const; @@ -412,7 +412,7 @@ class FVTerm static void markAsPrinted (uInt, uInt, uInt); static void newFontChanges (FChar*&); static void charsetChanges (FChar*&); - void appendCharacter (FChar*&); + void appendCharacter (FChar*&) const; void appendChar (FChar*&) const; void appendAttributes (FChar*&) const; int appendLowerRight (FChar*&) const; From 8f383a4def87c168650ed94c1b24614274e5671a Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 12 Jul 2020 19:33:12 +0200 Subject: [PATCH 14/28] More function declared as const --- src/foptimove.cpp | 10 +++++----- src/fvterm.cpp | 10 +++++----- src/include/final/fdata.h | 5 ++++- src/include/final/foptimove.h | 10 +++++----- src/include/final/fvterm.h | 10 +++++----- 5 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/foptimove.cpp b/src/foptimove.cpp index e93d5b14..6f815346 100644 --- a/src/foptimove.cpp +++ b/src/foptimove.cpp @@ -927,7 +927,7 @@ inline bool FOptiMove::isMethod0Faster ( int& move_time //---------------------------------------------------------------------- inline bool FOptiMove::isMethod1Faster ( int& move_time , int xold, int yold - , int xnew, int ynew ) + , int xnew, int ynew ) const { // Test method 1: local movement @@ -949,7 +949,7 @@ inline bool FOptiMove::isMethod1Faster ( int& move_time //---------------------------------------------------------------------- inline bool FOptiMove::isMethod2Faster ( int& move_time , int yold - , int xnew, int ynew ) + , int xnew, int ynew ) const { // Test method 2: carriage-return + local movement @@ -971,7 +971,7 @@ inline bool FOptiMove::isMethod2Faster ( int& move_time //---------------------------------------------------------------------- inline bool FOptiMove::isMethod3Faster ( int& move_time - , int xnew, int ynew ) + , int xnew, int ynew ) const { // Test method 3: home-cursor + local movement @@ -993,7 +993,7 @@ inline bool FOptiMove::isMethod3Faster ( int& move_time //---------------------------------------------------------------------- inline bool FOptiMove::isMethod4Faster ( int& move_time - , int xnew, int ynew ) + , int xnew, int ynew ) const { // Test method 4: home-down + local movement if ( F_cursor_to_ll.cap ) @@ -1017,7 +1017,7 @@ inline bool FOptiMove::isMethod4Faster ( int& move_time //---------------------------------------------------------------------- inline bool FOptiMove::isMethod5Faster ( int& move_time , int yold - , int xnew, int ynew ) + , int xnew, int ynew ) const { // Test method 5: left margin for wrap to right-hand side if ( automatic_left_margin diff --git a/src/fvterm.cpp b/src/fvterm.cpp index f05bfcd5..0a9db678 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -2444,7 +2444,7 @@ void FVTerm::printCharacter ( uInt& x, uInt y, bool min_and_not_max //---------------------------------------------------------------------- void FVTerm::printFullWidthCharacter ( uInt& x, uInt y - , FChar*& print_char ) + , FChar*& print_char ) const { const auto vt = vterm; auto next_char = &vt->data[y * uInt(vt->width) + x + 1]; @@ -2483,7 +2483,7 @@ void FVTerm::printFullWidthCharacter ( uInt& x, uInt y //---------------------------------------------------------------------- void FVTerm::printFullWidthPaddingCharacter ( uInt& x, uInt y - , FChar*& print_char) + , FChar*& print_char) const { const auto vt = vterm; auto prev_char = &vt->data[y * uInt(vt->width) + x - 1]; @@ -2528,7 +2528,7 @@ void FVTerm::printFullWidthPaddingCharacter ( uInt& x, uInt y //---------------------------------------------------------------------- void FVTerm::printHalfCovertFullWidthCharacter ( uInt& x, uInt y - , FChar*& print_char ) + , FChar*& print_char ) const { const auto vt = vterm; auto prev_char = &vt->data[y * uInt(vt->width) + x - 1]; @@ -2576,7 +2576,7 @@ inline void FVTerm::skipPaddingCharacter ( uInt& x, uInt y //---------------------------------------------------------------------- FVTerm::exit_state FVTerm::eraseCharacters ( uInt& x, uInt xmax, uInt y - , bool draw_trailing_ws ) + , bool draw_trailing_ws ) const { // Erase a number of characters to draw simple whitespaces @@ -2641,7 +2641,7 @@ FVTerm::exit_state FVTerm::eraseCharacters ( uInt& x, uInt xmax, uInt y } //---------------------------------------------------------------------- -FVTerm::exit_state FVTerm::repeatCharacter (uInt& x, uInt xmax, uInt y) +FVTerm::exit_state FVTerm::repeatCharacter (uInt& x, uInt xmax, uInt y) const { // Repeat one character n-fold diff --git a/src/include/final/fdata.h b/src/include/final/fdata.h index a59a90d7..c8c0b6da 100644 --- a/src/include/final/fdata.h +++ b/src/include/final/fdata.h @@ -30,10 +30,13 @@ template struct FData { - explicit FData (T v) + explicit FData (T v) // constructor : value{v} { } + ~FData() // destructor + { } + FData (const FData& d) // Copy constructor : value{d.value} { } diff --git a/src/include/final/foptimove.h b/src/include/final/foptimove.h index 7c8914c1..dc02ca5a 100644 --- a/src/include/final/foptimove.h +++ b/src/include/final/foptimove.h @@ -179,11 +179,11 @@ class FOptiMove final bool isWideMove (int, int, int, int) const; bool isMethod0Faster (int&, int, int); - bool isMethod1Faster (int&, int, int, int, int); - bool isMethod2Faster (int&, int, int, int); - bool isMethod3Faster (int&, int, int); - bool isMethod4Faster (int&, int, int); - bool isMethod5Faster (int&, int, int, int); + bool isMethod1Faster (int&, int, int, int, int) const; + bool isMethod2Faster (int&, int, int, int) const; + bool isMethod3Faster (int&, int, int) const; + bool isMethod4Faster (int&, int, int) const; + bool isMethod5Faster (int&, int, int, int) const; void moveByMethod (int, int, int, int, int); // Data members diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index a146e485..2efeeb62 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -393,12 +393,12 @@ class FVTerm void printRange (uInt, uInt, uInt, bool); void replaceNonPrintableFullwidth (uInt, FChar*&) const; void printCharacter (uInt&, uInt, bool, FChar*&); - void printFullWidthCharacter (uInt&, uInt, FChar*&); - void printFullWidthPaddingCharacter (uInt&, uInt, FChar*&); - void printHalfCovertFullWidthCharacter (uInt&, uInt, FChar*&); + void printFullWidthCharacter (uInt&, uInt, FChar*&) const; + void printFullWidthPaddingCharacter (uInt&, uInt, FChar*&) const; + void printHalfCovertFullWidthCharacter (uInt&, uInt, FChar*&) const; void skipPaddingCharacter (uInt&, uInt, const FChar* const&) const; - exit_state eraseCharacters (uInt&, uInt, uInt, bool); - exit_state repeatCharacter (uInt&, uInt, uInt); + exit_state eraseCharacters (uInt&, uInt, uInt, bool) const; + exit_state repeatCharacter (uInt&, uInt, uInt) const; bool isFullWidthChar (const FChar* const&) const; bool isFullWidthPaddingChar (const FChar* const&) const; static void cursorWrap(); From 07127634fdac54066cdb0dc4d4af54ff2f028b45 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 19 Jul 2020 14:15:02 +0200 Subject: [PATCH 15/28] Method name changes --- ChangeLog | 6 ++++++ doc/first-steps.md | 2 +- examples/busy.cpp | 2 +- examples/ui.cpp | 4 ++-- examples/watch.cpp | 2 +- examples/windows.cpp | 4 ++-- src/fbusyindicator.cpp | 2 +- src/fbutton.cpp | 2 +- src/flineedit.cpp | 8 ++++---- src/flistbox.cpp | 10 +++++----- src/flistview.cpp | 10 +++++----- src/fobject.cpp | 6 +++--- src/fscrollbar.cpp | 16 ++++++++-------- src/fspinbox.cpp | 12 ++++++------ src/fvterm.cpp | 2 +- src/fwidget.cpp | 8 ++++---- src/include/final/fobject.h | 4 ++-- src/include/final/fvterm.h | 2 +- src/include/final/fwidget.h | 2 +- test/fobject-test.cpp | 6 +++--- 20 files changed, 58 insertions(+), 52 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29ac2690..35a3eed8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-07-19 Markus Gans + * API: Some method name changes: + FObject::delOwnTimer() -> FObject::delOwnTimers() + FObject::delAllTimer() -> FObject::delAllTimers() + FWidget::delCallbacks() -> FWidget::delAllCallbacks() + 2020-07-08 Markus Gans * New data wrapper class FData diff --git a/doc/first-steps.md b/doc/first-steps.md index dc3397e4..e42e0b11 100644 --- a/doc/first-steps.md +++ b/doc/first-steps.md @@ -549,7 +549,7 @@ void FWidget::addCallback ( const FString& cb_signal There are two macros `F_FUNCTION_CALLBACK` and `F_METHOD_CALLBACK` to avoid having to deal with necessary type conversions. With `delCallback()` you can remove a connection to a signal handler or a widget. Alternatively, you can -use `delCallbacks()` to remove all existing callbacks from an object. +use `delAllCallbacks()` to remove all existing callbacks from an object. ### The FINAL CUT widgets emit the following default signals ### diff --git a/examples/busy.cpp b/examples/busy.cpp index 8b503150..f867fd0f 100644 --- a/examples/busy.cpp +++ b/examples/busy.cpp @@ -100,7 +100,7 @@ void Dialog::adjustSize() //---------------------------------------------------------------------- void Dialog::onTimer (finalcut::FTimerEvent*) { - delOwnTimer(); + delOwnTimers(); busy_indicator.stop(); } diff --git a/examples/ui.cpp b/examples/ui.cpp index fa48153f..ca97fe9f 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -126,7 +126,7 @@ ProgressDialog::ProgressDialog (finalcut::FWidget* parent) //---------------------------------------------------------------------- ProgressDialog::~ProgressDialog() // destructor { - delOwnTimer(); + delOwnTimers(); delCallback(&quit); delCallback(&more); delCallback(&reset); @@ -149,7 +149,7 @@ void ProgressDialog::onTimer (finalcut::FTimerEvent*) if ( p != 100 ) return; - delOwnTimer(); + delOwnTimers(); activateWindow(); raiseWindow(); reset.setEnable(); diff --git a/examples/watch.cpp b/examples/watch.cpp index 2048626f..53c4a43c 100644 --- a/examples/watch.cpp +++ b/examples/watch.cpp @@ -161,7 +161,7 @@ void Watch::cb_clock (const finalcut::FWidget*, const FDataPtr) } else { - delAllTimer(); // Delete all timers and stop updating the time + delAllTimers(); // Delete all timers and stop updating the time time_str = "--:--:--"; time_str.redraw(); } diff --git a/examples/windows.cpp b/examples/windows.cpp index 491c5246..27fa27b6 100644 --- a/examples/windows.cpp +++ b/examples/windows.cpp @@ -152,7 +152,7 @@ void SmallWindow::onTimer (finalcut::FTimerEvent*) bottom_label.unsetEmphasis(); bottom_label.redraw(); updateTerminal(); - delOwnTimer(); + delOwnTimers(); } @@ -277,7 +277,7 @@ Window::~Window() // Remove all callbacks before Window::cb_destroyWindow() will be called if ( win_dat->is_open && win_dat->dgl ) - win_dat->dgl->delCallbacks(); + win_dat->dgl->delAllCallbacks(); delete win_dat; iter = windows.erase(iter); diff --git a/src/fbusyindicator.cpp b/src/fbusyindicator.cpp index d46c1431..370c5975 100644 --- a/src/fbusyindicator.cpp +++ b/src/fbusyindicator.cpp @@ -56,7 +56,7 @@ void FBusyIndicator::start() //---------------------------------------------------------------------- void FBusyIndicator::stop() { - delOwnTimer(); + delOwnTimers(); running = false; hide(); updateTerminal(); diff --git a/src/fbutton.cpp b/src/fbutton.cpp index 753b2f7e..30c0c72f 100644 --- a/src/fbutton.cpp +++ b/src/fbutton.cpp @@ -53,7 +53,7 @@ FButton::FButton (const FString& txt, FWidget* parent) FButton::~FButton() // destructor { delAccelerator(); - delOwnTimer(); + delOwnTimers(); } // FButton operator diff --git a/src/flineedit.cpp b/src/flineedit.cpp index 81823bee..54aa8cfa 100644 --- a/src/flineedit.cpp +++ b/src/flineedit.cpp @@ -405,7 +405,7 @@ void FLineEdit::onMouseUp (FMouseEvent*) { if ( drag_scroll != FLineEdit::noScroll ) { - delOwnTimer(); + delOwnTimers(); drag_scroll = FLineEdit::noScroll; scroll_timer = false; } @@ -446,7 +446,7 @@ void FLineEdit::onMouseMove (FMouseEvent* ev) if ( text_offset == 0 ) { - delOwnTimer(); + delOwnTimers(); drag_scroll = FLineEdit::noScroll; } } @@ -462,14 +462,14 @@ void FLineEdit::onMouseMove (FMouseEvent* ev) if ( cursor_pos == len ) { - delOwnTimer(); + delOwnTimers(); drag_scroll = FLineEdit::noScroll; } } else { // no dragging - delOwnTimer(); + delOwnTimers(); scroll_timer = false; drag_scroll = FLineEdit::noScroll; } diff --git a/src/flistbox.cpp b/src/flistbox.cpp index 7f4415e5..76aef6f6 100644 --- a/src/flistbox.cpp +++ b/src/flistbox.cpp @@ -95,7 +95,7 @@ FListBox::FListBox (FWidget* parent) //---------------------------------------------------------------------- FListBox::~FListBox() // destructor { - delOwnTimer(); + delOwnTimers(); } @@ -572,7 +572,7 @@ void FListBox::onFocusOut (FFocusEvent*) getStatusBar()->drawMessage(); } - delOwnTimer(); + delOwnTimers(); inc_search.clear(); } @@ -1306,7 +1306,7 @@ void FListBox::dragUp (int mouse_button) if ( current == 1 ) { - delOwnTimer(); + delOwnTimers(); drag_scroll = fc::noScroll; } } @@ -1331,7 +1331,7 @@ void FListBox::dragDown (int mouse_button) if ( current == getCount() ) { - delOwnTimer(); + delOwnTimers(); drag_scroll = fc::noScroll; } } @@ -1339,7 +1339,7 @@ void FListBox::dragDown (int mouse_button) //---------------------------------------------------------------------- void FListBox::stopDragScroll() { - delOwnTimer(); + delOwnTimers(); drag_scroll = fc::noScroll; scroll_distance = 1; scroll_timer = false; diff --git a/src/flistview.cpp b/src/flistview.cpp index 4441188d..0a3cbbfc 100644 --- a/src/flistview.cpp +++ b/src/flistview.cpp @@ -691,7 +691,7 @@ FListView::FListView (FWidget* parent) //---------------------------------------------------------------------- FListView::~FListView() // destructor { - delOwnTimer(); + delOwnTimers(); } // public methods of FListView @@ -1408,7 +1408,7 @@ void FListView::onFocusOut (FFocusEvent*) getStatusBar()->drawMessage(); } - delOwnTimer(); + delOwnTimers(); } @@ -2447,7 +2447,7 @@ void FListView::dragUp (int mouse_button) if ( current_iter.getPosition() == 0 ) { - delOwnTimer(); + delOwnTimers(); drag_scroll = fc::noScroll; } } @@ -2472,7 +2472,7 @@ void FListView::dragDown (int mouse_button) if ( current_iter.getPosition() - 1 == int(getCount()) ) { - delOwnTimer(); + delOwnTimers(); drag_scroll = fc::noScroll; } } @@ -2480,7 +2480,7 @@ void FListView::dragDown (int mouse_button) //---------------------------------------------------------------------- void FListView::stopDragScroll() { - delOwnTimer(); + delOwnTimers(); scroll_timer = false; scroll_distance = 1; drag_scroll = fc::noScroll; diff --git a/src/fobject.cpp b/src/fobject.cpp index 3bdb4470..f10a8adc 100644 --- a/src/fobject.cpp +++ b/src/fobject.cpp @@ -72,7 +72,7 @@ FObject::FObject (FObject* parent) //---------------------------------------------------------------------- FObject::~FObject() // destructor { - delOwnTimer(); // Delete all timers of this object + delOwnTimers(); // Delete all timers of this object if ( ! has_parent && timer_list ) { @@ -333,7 +333,7 @@ bool FObject::delTimer (int id) const } //---------------------------------------------------------------------- -bool FObject::delOwnTimer() const +bool FObject::delOwnTimers() const { // Deletes all timers of this object @@ -359,7 +359,7 @@ bool FObject::delOwnTimer() const } //---------------------------------------------------------------------- -bool FObject::delAllTimer() const +bool FObject::delAllTimers() const { // Deletes all timers of all objects diff --git a/src/fscrollbar.cpp b/src/fscrollbar.cpp index 375fb78e..361e44a7 100644 --- a/src/fscrollbar.cpp +++ b/src/fscrollbar.cpp @@ -55,7 +55,7 @@ FScrollbar::FScrollbar(fc::orientation o, FWidget* parent) //---------------------------------------------------------------------- FScrollbar::~FScrollbar() // destructor { - delOwnTimer(); + delOwnTimers(); } @@ -305,7 +305,7 @@ void FScrollbar::onMouseUp (FMouseEvent* ev) if ( scroll_type != FScrollbar::noScroll ) { - delOwnTimer(); + delOwnTimers(); scroll_type = FScrollbar::noScroll; } } @@ -360,7 +360,7 @@ void FScrollbar::onMouseMove (FMouseEvent* ev) if ( mouse_x < 1 || mouse_x > int(getWidth()) || mouse_y < 1 || mouse_y > int(getHeight()) ) { - delOwnTimer(); + delOwnTimers(); } else if ( scroll_type != FScrollbar::scrollJump ) { @@ -369,7 +369,7 @@ void FScrollbar::onMouseMove (FMouseEvent* ev) if ( scroll_type != new_scroll_type ) { - delOwnTimer(); + delOwnTimers(); } } @@ -380,7 +380,7 @@ void FScrollbar::onWheel (FWheelEvent* ev) if ( scroll_type != FScrollbar::noScroll ) { - delOwnTimer(); + delOwnTimers(); scroll_type = FScrollbar::noScroll; } @@ -401,7 +401,7 @@ void FScrollbar::onTimer (FTimerEvent*) if ( ! threshold_reached ) { threshold_reached = true; - delOwnTimer(); + delOwnTimers(); addTimer(repeat_time); } @@ -426,7 +426,7 @@ void FScrollbar::onTimer (FTimerEvent*) processScroll(); } - delOwnTimer(); + delOwnTimers(); return; } @@ -787,7 +787,7 @@ void FScrollbar::avoidScrollOvershoot() && slider_pos > slider_click_stop_pos ) ) { jumpToClickPos (slider_click_stop_pos); - delOwnTimer(); + delOwnTimers(); } } diff --git a/src/fspinbox.cpp b/src/fspinbox.cpp index e77edb9e..ec6fa2b3 100644 --- a/src/fspinbox.cpp +++ b/src/fspinbox.cpp @@ -235,13 +235,13 @@ void FSpinBox::onMouseDown (FMouseEvent* ev) addTimer(threshold_time); } else - delOwnTimer(); + delOwnTimers(); } //---------------------------------------------------------------------- void FSpinBox::onMouseUp (FMouseEvent*) { - delOwnTimer(); + delOwnTimers(); spining_state = FSpinBox::noSpin; } @@ -250,7 +250,7 @@ void FSpinBox::onWheel (FWheelEvent* ev) { const int wheel = ev->getWheel(); - delOwnTimer(); + delOwnTimers(); forceFocus(); spining_state = FSpinBox::noSpin; @@ -277,7 +277,7 @@ void FSpinBox::onTimer (FTimerEvent*) if ( ! threshold_reached ) { threshold_reached = true; - delOwnTimer(); + delOwnTimers(); addTimer(repeat_time); } @@ -382,7 +382,7 @@ inline void FSpinBox::increaseValue() processChanged(); } else - delOwnTimer(); + delOwnTimers(); } //---------------------------------------------------------------------- @@ -394,7 +394,7 @@ inline void FSpinBox::decreaseValue() processChanged(); } else - delOwnTimer(); + delOwnTimers(); } //---------------------------------------------------------------------- diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 0a9db678..76f9eebf 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -2417,7 +2417,7 @@ inline void FVTerm::replaceNonPrintableFullwidth ( uInt x //---------------------------------------------------------------------- void FVTerm::printCharacter ( uInt& x, uInt y, bool min_and_not_max - , FChar*& print_char) + , FChar*& print_char) const { // General character output on terminal diff --git a/src/fwidget.cpp b/src/fwidget.cpp index 88db56fa..700e8f1d 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -101,7 +101,7 @@ FWidget::FWidget (FWidget* parent) FWidget::~FWidget() // destructor { processDestroy(); - delCallbacks(); + delAllCallbacks(); auto app_object = FApplication::getApplicationObject(); app_object->removeQueuedEvent(this); @@ -858,7 +858,7 @@ void FWidget::addCallback ( const FString& cb_signal //---------------------------------------------------------------------- void FWidget::delCallback (const FCallback& cb_function) { - // Delete cb_function form callback list + // Deletes entries with cb_function form the callback list if ( callback_objects.empty() ) return; @@ -877,7 +877,7 @@ void FWidget::delCallback (const FCallback& cb_function) //---------------------------------------------------------------------- void FWidget::delCallback (const FWidget* cb_instance) { - // Delete all member function pointer from cb_instance + // Deletes entries with cb_instance from the callback list if ( callback_objects.empty() ) return; @@ -894,7 +894,7 @@ void FWidget::delCallback (const FWidget* cb_instance) } //---------------------------------------------------------------------- -void FWidget::delCallbacks() +void FWidget::delAllCallbacks() { // Delete all callbacks from this widget diff --git a/src/include/final/fobject.h b/src/include/final/fobject.h index 39f5d82c..e4456bb8 100644 --- a/src/include/final/fobject.h +++ b/src/include/final/fobject.h @@ -125,8 +125,8 @@ class FObject static bool isTimeout (const timeval*, uInt64); int addTimer (int); bool delTimer (int) const; - bool delOwnTimer() const; - bool delAllTimer() const; + bool delOwnTimers() const; + bool delAllTimers() const; protected: struct FTimerData diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 2efeeb62..a60ee9dc 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -392,7 +392,7 @@ class FVTerm bool skipUnchangedCharacters (uInt&, uInt, uInt) const; void printRange (uInt, uInt, uInt, bool); void replaceNonPrintableFullwidth (uInt, FChar*&) const; - void printCharacter (uInt&, uInt, bool, FChar*&); + void printCharacter (uInt&, uInt, bool, FChar*&) const; void printFullWidthCharacter (uInt&, uInt, FChar*&) const; void printFullWidthPaddingCharacter (uInt&, uInt, FChar*&) const; void printHalfCovertFullWidthCharacter (uInt&, uInt, FChar*&) const; diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index 3f8c0000..bee3e49e 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -332,7 +332,7 @@ class FWidget : public FVTerm, public FObject , FDataPtr = nullptr ); void delCallback (const FCallback&); void delCallback (const FWidget*); - void delCallbacks(); + void delAllCallbacks(); void emitCallback (const FString&); void addAccelerator (FKey); virtual void addAccelerator (FKey, FWidget*); diff --git a/test/fobject-test.cpp b/test/fobject-test.cpp index a9ca10ea..eb356b10 100644 --- a/test/fobject-test.cpp +++ b/test/fobject-test.cpp @@ -514,7 +514,7 @@ void FObjectTest::timerTest() CPPUNIT_ASSERT ( t1.getTimerList()->size() == 0 ); CPPUNIT_ASSERT ( ! t1.delTimer (id1) ); // id double delete - CPPUNIT_ASSERT ( ! t1.delAllTimer() ); + CPPUNIT_ASSERT ( ! t1.delAllTimers() ); t1.addTimer(250); t1.addTimer(500); @@ -524,7 +524,7 @@ void FObjectTest::timerTest() CPPUNIT_ASSERT ( t1.getTimerList()->size() == 4 ); CPPUNIT_ASSERT ( t2.getTimerList()->size() == 4 ); - t1.delOwnTimer(); + t1.delOwnTimers(); CPPUNIT_ASSERT ( t1.getTimerList()->size() == 2 ); CPPUNIT_ASSERT ( t2.getTimerList()->size() == 2 ); @@ -532,7 +532,7 @@ void FObjectTest::timerTest() CPPUNIT_ASSERT ( t1.getTimerList()->size() == 3 ); CPPUNIT_ASSERT ( t2.getTimerList()->size() == 3 ); - t2.delAllTimer(); + t2.delAllTimers(); CPPUNIT_ASSERT ( t1.getTimerList()->empty() ); CPPUNIT_ASSERT ( t2.getTimerList()->empty() ); CPPUNIT_ASSERT ( t1.getTimerList()->size() == 0 ); From 6d72168ca40b9d1873d4a51421596cb0f78b2404 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Tue, 11 Aug 2020 23:04:46 +0200 Subject: [PATCH 16/28] New callback backend was implemented --- ChangeLog | 4 + doc/class_template.h | 1 - doc/first-steps.md | 82 ++--- doc/user-theme.md | 10 +- examples/7segment.cpp | 11 +- examples/background-color.cpp | 16 +- examples/busy.cpp | 13 +- examples/calculator.cpp | 25 +- examples/checklist.cpp | 6 +- examples/choice.cpp | 9 +- examples/dialog.cpp | 7 +- examples/fullwidth-character.cpp | 14 +- examples/input-dialog.cpp | 30 +- examples/listbox.cpp | 4 +- examples/listview.cpp | 10 +- examples/menu.cpp | 12 +- examples/mouse.cpp | 6 +- examples/scrollview.cpp | 28 +- examples/term-attributes.cpp | 12 +- examples/treeview.cpp | 4 +- examples/ui.cpp | 185 +++++------ examples/watch.cpp | 16 +- examples/windows.cpp | 72 +++-- src/Makefile.am | 2 + src/Makefile.clang | 2 + src/Makefile.gcc | 2 + src/fbuttongroup.cpp | 8 +- src/fcallback.cpp | 42 +++ src/fcombobox.cpp | 16 +- src/fdialog.cpp | 15 +- src/ffiledialog.cpp | 24 +- src/flabel.cpp | 8 +- src/fmenu.cpp | 17 +- src/fmenubar.cpp | 14 +- src/fmenuitem.cpp | 29 +- src/fmessagebox.cpp | 17 +- src/fradiomenuitem.cpp | 3 +- src/fspinbox.cpp | 15 +- src/fstatusbar.cpp | 10 +- src/fvterm.cpp | 4 +- src/fwidget.cpp | 101 +----- src/fwidget_functions.cpp | 7 + src/include/final/fapplication.h | 13 +- src/include/final/fbuttongroup.h | 2 +- src/include/final/fcallback.h | 449 ++++++++++++++++++++++++++ src/include/final/fcombobox.h | 8 +- src/include/final/fdialog.h | 6 +- src/include/final/ffiledialog.h | 12 +- src/include/final/flabel.h | 2 +- src/include/final/fmenu.h | 6 +- src/include/final/fmenubar.h | 2 +- src/include/final/fmenuitem.h | 4 +- src/include/final/fmessagebox.h | 2 +- src/include/final/fscrollbar.h | 2 +- src/include/final/fspinbox.h | 4 +- src/include/final/fstatusbar.h | 2 +- src/include/final/ftypes.h | 41 +-- src/include/final/fvterm.h | 2 +- src/include/final/fwidget.h | 161 +++------- test/Makefile.am | 2 + test/fcallback-test.cpp | 534 +++++++++++++++++++++++++++++++ 61 files changed, 1524 insertions(+), 643 deletions(-) create mode 100644 src/fcallback.cpp create mode 100644 src/include/final/fcallback.h create mode 100644 test/fcallback-test.cpp diff --git a/ChangeLog b/ChangeLog index 35a3eed8..e5bfbfd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2020-08-11 Markus Gans + * New callback backend was implemented. Callback functions with any + number of arguments are now possible. + 2020-07-19 Markus Gans * API: Some method name changes: FObject::delOwnTimer() -> FObject::delOwnTimers() diff --git a/doc/class_template.h b/doc/class_template.h index c3cc4325..c8352d65 100644 --- a/doc/class_template.h +++ b/doc/class_template.h @@ -126,4 +126,3 @@ class FClassName #endif // FCLASSNAME_H - diff --git a/doc/first-steps.md b/doc/first-steps.md index e42e0b11..a52e48a0 100644 --- a/doc/first-steps.md +++ b/doc/first-steps.md @@ -609,10 +609,8 @@ use `delAllCallbacks()` to remove all existing callbacks from an object. using namespace finalcut; -void cb_changeText (FWidget* w, FDataPtr data) +void cb_changeText (const FButton& button, FLabel& label) { - FButton& button = *(static_cast(w)); - FLabel& label = *(static_cast(data)); label.clear(); label << "The " << button.getClassName() << " was pressed"; label.redraw(); @@ -635,9 +633,10 @@ int main (int argc, char* argv[]) // Connect the button signal "clicked" with the callback function button.addCallback ( - "clicked", - F_FUNCTION_CALLBACK (&cb_changeText), - &label + "clicked", // Callback signal + &cb_changeText, // Function pointer + std::cref(button), // First function argument + std::ref(label) // Second function argument ); FWidget::setMainWidget(&dialog); @@ -683,11 +682,9 @@ int main (int argc, char* argv[]) // Connect the button signal "clicked" with the lambda expression button.addCallback ( - "clicked", - [] (FWidget* w, FDataPtr d) + "clicked", // Callback signal + [] (FButton& button, FDialog& dgl) // Lambda function { - FButton& button = *(static_cast(w)); - if ( button.getY() != 2 ) { button.setPos (FPoint{15, 2}); @@ -699,9 +696,10 @@ int main (int argc, char* argv[]) button.setText("&bottom"); } - static_cast(d)->redraw(); + dgl.redraw(); }, - &dialog + std::ref(button), // First function argument + std::ref(dialog) // Second function argument ); FWidget::setMainWidget(&dialog); @@ -748,9 +746,10 @@ class dialogWidget : public FDialog // Connect the button signal "clicked" with the callback method button.addCallback ( - "clicked", - F_METHOD_CALLBACK (this, &FApplication::cb_exitApp), - nullptr + "clicked", // Callback signal + finalcut::getFApplication(), // Class instance + &finalcut::FApplication::cb_exitApp, // Method pointer + this // Function argument ); } @@ -810,45 +809,22 @@ class dialogWidget : public FDialog label.setAlignment (fc::alignRight); label.setForegroundColor (fc::Black); plus.setGeometry (FPoint{3, 3}, size); - minus.setGeometry (FPoint{13, 3}, size); + minus.setGeometry (FPoint{3, 3} + FPoint{10, 0}, size); plus.setNoUnderline(); minus.setNoUnderline(); // Connect the button signal "clicked" with the callback method - plus.addCallback - ( - "clicked", - F_METHOD_CALLBACK (this, &dialogWidget::cb_plus) - ); - - minus.addCallback - ( - "clicked", - F_METHOD_CALLBACK (this, &dialogWidget::cb_minus) - ); + plus.addCallback ("clicked", this, &dialogWidget::cb_plus); + minus.addCallback ("clicked", this, &dialogWidget::cb_minus); // Connect own signals - addCallback - ( - "hot", - F_METHOD_CALLBACK (this, &dialogWidget::cb_set_red) - ); - - addCallback - ( - "regular", - F_METHOD_CALLBACK (this, &dialogWidget::cb_set_black) - ); - - addCallback - ( - "cold", - F_METHOD_CALLBACK (this, &dialogWidget::cb_set_blue) - ); + addCallback ("hot", this, &dialogWidget::cb_set_red); + addCallback ("regular", this, &dialogWidget::cb_set_black); + addCallback ("cold", this, &dialogWidget::cb_set_blue); } private: - void cb_plus (FWidget*, FDataPtr) + void cb_plus() { if ( t < 100 ) t++; @@ -861,7 +837,7 @@ class dialogWidget : public FDialog setTemperature(); } - void cb_minus (FWidget*, FDataPtr) + void cb_minus() { if ( t > -99 ) t--; @@ -874,17 +850,17 @@ class dialogWidget : public FDialog setTemperature(); } - void cb_set_blue (FWidget*, FDataPtr) + void cb_set_blue() { label.setForegroundColor (fc::Blue); } - void cb_set_black (FWidget*, FDataPtr) + void cb_set_black() { label.setForegroundColor (fc::Black); } - void cb_set_red (FWidget*, FDataPtr) + void cb_set_red() { label.setForegroundColor (fc::Red); } @@ -1291,8 +1267,7 @@ class dialogWidget : public FDialog btn->addCallback ( "clicked", - F_METHOD_CALLBACK (this, &dialogWidget::cb_button), - static_cast(&std::get<2>(b)) + this, &dialogWidget::cb_button, std::get<2>(b) ); }; } @@ -1300,10 +1275,9 @@ class dialogWidget : public FDialog private: typedef std::tuple direction; - void cb_button (FWidget*, FDataPtr data) + void cb_button (const FPoint& p) { - FPoint* p = static_cast(data); - scrollview.scrollTo(*p); + scrollview.scrollTo(p); } FScrollView scrollview{this}; diff --git a/doc/user-theme.md b/doc/user-theme.md index 483b6a60..fc59dd45 100644 --- a/doc/user-theme.md +++ b/doc/user-theme.md @@ -370,7 +370,7 @@ class dialogWidget final : public FDialog Browse.addCallback ( "clicked", - F_METHOD_CALLBACK (this, &dialogWidget::cb_FileBrowse) + this, &dialogWidget::cb_FileBrowse ); Apply.setGeometry (FPoint{24, 5}, FSize{10, 1}); Apply.setStatusbarMessage("Apply settings"); @@ -379,17 +379,19 @@ class dialogWidget final : public FDialog Quit.addCallback ( "clicked", - F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) + finalcut::getFApplication(), + &finalcut::FApplication::cb_exitApp, + this ); Open.addCallback ( "clicked", - F_METHOD_CALLBACK (this, &dialogWidget::cb_FileBrowse) + this, &dialogWidget::cb_FileBrowse ); } private: - void cb_FileBrowse (finalcut::FWidget*, FDataPtr) + void cb_FileBrowse() { auto filename = FFileDialog::fileOpenChooser(this); diff --git a/examples/7segment.cpp b/examples/7segment.cpp index b46eee0d..89991113 100644 --- a/examples/7segment.cpp +++ b/examples/7segment.cpp @@ -100,18 +100,19 @@ SegmentView::SegmentView (finalcut::FWidget* parent) Input.addCallback ( "changed", - [] (const finalcut::FWidget*, FDataPtr data) + [] (SegmentView& dialog) { - auto dialog = static_cast(data); - dialog->redraw(); + dialog.redraw(); }, - this + std::ref(*this) ); Exit.addCallback ( "clicked", - F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) + finalcut::getFApplication(), + &finalcut::FApplication::cb_exitApp, + this ); } diff --git a/examples/background-color.cpp b/examples/background-color.cpp index c44f0a95..3b0d16eb 100644 --- a/examples/background-color.cpp +++ b/examples/background-color.cpp @@ -58,8 +58,8 @@ class Background final : public finalcut::FDialog private: // Callback method - void cb_changed (const finalcut::FWidget*, const FDataPtr); - void cb_choice (const finalcut::FWidget*, const FDataPtr); + void cb_changed(); + void cb_choice(); // Data members finalcut::FComboBox color_choice{this}; @@ -148,7 +148,9 @@ Background::Background (finalcut::FWidget* parent) quit.addCallback ( "clicked", - F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) + finalcut::getFApplication(), + &finalcut::FApplication::cb_exitApp, + this ); for (const auto spinbox : {&red, &green, &blue}) @@ -156,7 +158,7 @@ Background::Background (finalcut::FWidget* parent) spinbox->addCallback ( "changed", - F_METHOD_CALLBACK (this, &Background::cb_changed) + this, &Background::cb_changed ); } @@ -165,7 +167,7 @@ Background::Background (finalcut::FWidget* parent) color_choice.addCallback ( signal, - F_METHOD_CALLBACK (this, &Background::cb_choice) + this, &Background::cb_choice ); } } @@ -175,7 +177,7 @@ Background::~Background() // destructor { } //---------------------------------------------------------------------- -void Background::cb_changed (const finalcut::FWidget*, const FDataPtr) +void Background::cb_changed() { if ( ! finalcut::FTerm::canChangeColorPalette() ) return; @@ -189,7 +191,7 @@ void Background::cb_changed (const finalcut::FWidget*, const FDataPtr) } //---------------------------------------------------------------------- -void Background::cb_choice (const finalcut::FWidget*, const FDataPtr) +void Background::cb_choice() { if ( ! finalcut::FTerm::canChangeColorPalette() ) return; diff --git a/examples/busy.cpp b/examples/busy.cpp index f867fd0f..24e3bf22 100644 --- a/examples/busy.cpp +++ b/examples/busy.cpp @@ -41,7 +41,7 @@ class Dialog final : public finalcut::FDialog void onTimer (finalcut::FTimerEvent*) override; // Callback method - void cb_start (const finalcut::FWidget*, const FDataPtr); + void cb_start(); // Data members finalcut::FSpinBox seconds{this}; @@ -67,21 +67,22 @@ Dialog::Dialog (FWidget* parent) seconds.addCallback ( "activate", - F_METHOD_CALLBACK (this, &Dialog::cb_start) + this, &Dialog::cb_start ); start.addCallback ( "clicked", - F_METHOD_CALLBACK (this, &Dialog::cb_start) + this, &Dialog::cb_start ); quit.addCallback ( "clicked", - F_METHOD_CALLBACK (this, &finalcut::FApplication::cb_exitApp) + finalcut::getFApplication(), + &finalcut::FApplication::cb_exitApp, + this ); - } //---------------------------------------------------------------------- @@ -105,7 +106,7 @@ void Dialog::onTimer (finalcut::FTimerEvent*) } //---------------------------------------------------------------------- -void Dialog::cb_start (const finalcut::FWidget*, const FDataPtr) +void Dialog::cb_start() { if ( seconds.getValue() < 1 ) return; diff --git a/examples/calculator.cpp b/examples/calculator.cpp index 1c9eb947..8160f41e 100644 --- a/examples/calculator.cpp +++ b/examples/calculator.cpp @@ -119,13 +119,6 @@ class Calc final : public finalcut::FDialog // Destructor ~Calc() override; - // Event handlers - void onKeyPress (finalcut::FKeyEvent*) override; - void onClose (finalcut::FCloseEvent*) override; - - // Callback method - void cb_buttonClicked (const finalcut::FWidget*, FDataPtr); - private: // Typedef and Enumeration typedef std::function keyFunction; // Member function @@ -218,6 +211,13 @@ class Calc final : public finalcut::FDialog const wchar_t* getButtonText (const std::size_t) const; void mapKeyFunctions(); + // Event handlers + void onKeyPress (finalcut::FKeyEvent*) override; + void onClose (finalcut::FCloseEvent*) override; + + // Callback method + void cb_buttonClicked (Calc::button); + // Data members bool error{false}; bool arcus_mode{false}; @@ -230,7 +230,7 @@ class Calc final : public finalcut::FDialog char infix_operator{'\0'}; char last_infix_operator{'\0'}; finalcut::FString input{""}; - std::size_t button_no[Calc::NUM_OF_BUTTONS]{}; + button button_no[Calc::NUM_OF_BUTTONS]{}; struct stack_data { @@ -257,7 +257,7 @@ Calc::Calc (FWidget* parent) clearInfixOperator(); std::setlocale(LC_NUMERIC, "C"); - for (std::size_t key{0}; key < Calc::NUM_OF_BUTTONS; key++) + for (button key{Sine}; key < Calc::NUM_OF_BUTTONS; key = button(key + 1)) { auto btn = std::make_shared