diff --git a/doc/first-steps.md b/doc/first-steps.md index 5fec9a6d..b900b3e5 100644 --- a/doc/first-steps.md +++ b/doc/first-steps.md @@ -775,7 +775,7 @@ int getTermY() const; const FPoint getTermPos() const; virtual void setX (int x, bool adjust = true); virtual void setY (int y, bool adjust = true); -virtual void setPos (const Fpoint& p, bool adjust = true); +virtual void setPos (const FPoint& p, bool adjust = true); ``` If you set the value of `adjust` to `false` when calling `setX()`, @@ -878,7 +878,7 @@ const FRect& getGeometryWithShadow(); const FRect& getTermGeometryWithShadow(); virtual void setSize (const FSize& size, bool adjust = true); virtual void setGeometry (const FRect& box, bool adjust = true); -virtual void setGeometry (const Fpoint& p, const FSize& s, bool adjust = true); +virtual void setGeometry (const FPoint& p, const FSize& s, bool adjust = true); virtual void setShadowSize (const FSize& size); ``` diff --git a/examples/mandelbrot.cpp b/examples/mandelbrot.cpp index cf2454fb..ced5b7ff 100644 --- a/examples/mandelbrot.cpp +++ b/examples/mandelbrot.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2019 Markus Gans * +* 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 * @@ -79,6 +79,9 @@ void Mandelbrot::draw() int Cols = int(getClientWidth()); int Lines = int(getClientHeight()); + if ( Cols < 2 || Lines < 2 ) + return; + double dX = (x_max - x_min) / (Cols - 1); double dY = (y_max - y_min) / Lines; diff --git a/examples/ui.cpp b/examples/ui.cpp index 0879d02f..0d35821e 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -779,7 +779,7 @@ void MyDialog::cb_about (finalcut::FWidget*, FDataPtr) finalcut::FMessageBox info ( "About" , line + L" The Final Cut " + line + "\n\n" L"Version " + libver + "\n\n" - L"(c) 2019 by Markus Gans" + L"(c) 2020 by Markus Gans" , finalcut::FMessageBox::Ok, 0, 0, this ); info.setCenterText(); info.show(); @@ -1000,7 +1000,7 @@ int main (int argc, char* argv[]) const finalcut::FString ver{F_VERSION}; // Library version const finalcut::FString title { "The FINAL CUT " + ver - + " (C) 2019 by Markus Gans" }; + + " (C) 2020 by Markus Gans" }; // Create the application object app finalcut::FApplication app(argc, argv); diff --git a/src/.swp b/src/.swp new file mode 100644 index 00000000..ff9788fd Binary files /dev/null and b/src/.swp differ diff --git a/src/fapplication.cpp b/src/fapplication.cpp index d47792cf..207210f5 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -31,6 +31,7 @@ #include "final/fmouse.h" #include "final/fstartoptions.h" #include "final/fstatusbar.h" +#include "final/ftermdata.h" #include "final/ftermios.h" #include "final/fwidgetcolors.h" #include "final/fwindow.h" @@ -75,8 +76,13 @@ FApplication::FApplication ( const int& _argc , app_argv{_argv} { if ( app_object ) - throw std::runtime_error( "FApplication: There should be " - "only one application object" ); + { + auto ftermdata = getFTerm().getFTermData(); + ftermdata->setExitMessage("FApplication: There should be " + "only one application object"); + FApplication::exit(EXIT_FAILURE); + return; + } app_object = this; @@ -96,6 +102,7 @@ FApplication::~FApplication() // destructor if ( event_queue ) delete event_queue; + event_queue = nullptr; app_object = nullptr; } @@ -153,12 +160,6 @@ void FApplication::exitLoop() //---------------------------------------------------------------------- void FApplication::exit (int retcode) { - if ( ! app_object ) // no global app object - return; - - if ( quit_now ) // don't overwrite quit code - return; - quit_now = true; quit_code = retcode; } diff --git a/src/flineedit.cpp b/src/flineedit.cpp index e1143787..4619f7ab 100644 --- a/src/flineedit.cpp +++ b/src/flineedit.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2012-2019 Markus Gans * +* 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 * @@ -917,7 +917,16 @@ void FLineEdit::adjustTextOffset() char_width_offset = 0; if ( cursor_pos < len ) - cursor_char_width = getColumnWidth(print_text[cursor_pos]); + { + try + { + cursor_char_width = getColumnWidth(print_text[cursor_pos]); + } + catch (const std::out_of_range& ex) + { + std::cerr << "Out of Range error: " << ex.what() << std::endl; + } + } if ( len > 0 ) first_char_width = getColumnWidth(print_text[0]); diff --git a/src/fsize.cpp b/src/fsize.cpp index e50a7b4e..2f266242 100644 --- a/src/fsize.cpp +++ b/src/fsize.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2019 Markus Gans * +* 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 * @@ -106,12 +106,22 @@ bool FSize::isEmpty() const void FSize::scaleBy (int dx, int dy) { if ( dx < 0 ) - width -= std::size_t(-dx); + { + if ( std::size_t(-dx) < width ) + width -= std::size_t(-dx); + else + width = std::size_t(-dx) - width; + } else width += std::size_t(dx); - if ( dx < 0 ) - height -= std::size_t(-dy); + if ( dy < 0 ) + { + if ( std::size_t(-dy) < height ) + height -= std::size_t(-dy); + else + height = std::size_t(-dy) - height; + } else height += std::size_t(dy); } diff --git a/src/fterm.cpp b/src/fterm.cpp index 41324ac9..66cf9d90 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -2440,6 +2440,12 @@ void FTerm::finish() if ( data->isNewFont() || data->isVGAFont() ) setOldFont(); + // Print exit message + const auto& exit_message = data->getExitMessage(); + + if ( ! exit_message.isEmpty() ) + std::cerr << exit_message << std::endl; + deallocationValues(); } diff --git a/src/fterm_functions.cpp b/src/fterm_functions.cpp index 9c6fde21..6499b58c 100644 --- a/src/fterm_functions.cpp +++ b/src/fterm_functions.cpp @@ -430,7 +430,16 @@ std::size_t getColumnWidth (const FString& s, std::size_t pos) pos = length; for (std::size_t i{0}; i < pos; i++) - column_width += getColumnWidth(s[i]); + { + try + { + column_width += getColumnWidth(s[i]); + } + catch (const std::out_of_range& ex) + { + std::cerr << "Out of Range error: " << ex.what() << std::endl; + } + } return column_width; } diff --git a/src/fwidget.cpp b/src/fwidget.cpp index f8eb60b6..04bb70ee 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2019 Markus Gans * +* 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 * @@ -59,7 +59,7 @@ uInt FWidget::modal_dialog_counter{}; // constructors and destructor //---------------------------------------------------------------------- FWidget::FWidget (FWidget* parent, bool disable_alt_screen) - : FVTerm(bool(! parent), disable_alt_screen) + : FVTerm( ! (bool(parent) || rootObject), disable_alt_screen) , FObject(parent) { // init bit field with 0 @@ -73,9 +73,15 @@ FWidget::FWidget (FWidget* parent, bool disable_alt_screen) if ( ! parent ) { - if ( rootObject ) - throw std::runtime_error( "FWidget: No parent defined! " - "There should be only one root object" ); + if ( rootObject ) + { + auto ftermdata = getFTerm().getFTermData(); + ftermdata->setExitMessage("FWidget: No parent defined! " + "There should be only one root object"); + FApplication::exit(EXIT_FAILURE); + return; + } + rootObject = this; show_root_widget = nullptr; redraw_root_widget = nullptr; diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index 2be55309..a8eb2ad4 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2013-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fbutton.h b/src/include/final/fbutton.h index ae06b6c2..7622fa7d 100644 --- a/src/include/final/fbutton.h +++ b/src/include/final/fbutton.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2012-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fbuttongroup.h b/src/include/final/fbuttongroup.h index 3cdf9c99..76d51d82 100644 --- a/src/include/final/fbuttongroup.h +++ b/src/include/final/fbuttongroup.h @@ -4,7 +4,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2019 Markus Gans * +* 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 * @@ -24,11 +24,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fcheckbox.h b/src/include/final/fcheckbox.h index 08c60c9b..c6970d24 100644 --- a/src/include/final/fcheckbox.h +++ b/src/include/final/fcheckbox.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fcheckmenuitem.h b/src/include/final/fcheckmenuitem.h index 7b70eb52..7a81c2a3 100644 --- a/src/include/final/fcheckmenuitem.h +++ b/src/include/final/fcheckmenuitem.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fcombobox.h b/src/include/final/fcombobox.h index 5259f012..72237940 100644 --- a/src/include/final/fcombobox.h +++ b/src/include/final/fcombobox.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fdialog.h b/src/include/final/fdialog.h index 818428ad..4b2a1097 100644 --- a/src/include/final/fdialog.h +++ b/src/include/final/fdialog.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2012-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fdialoglistmenu.h b/src/include/final/fdialoglistmenu.h index 9cfe261f..45031a51 100644 --- a/src/include/final/fdialoglistmenu.h +++ b/src/include/final/fdialoglistmenu.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2016-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/ffiledialog.h b/src/include/final/ffiledialog.h index 75d3092f..a1097ad7 100644 --- a/src/include/final/ffiledialog.h +++ b/src/include/final/ffiledialog.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/flabel.h b/src/include/final/flabel.h index 82e806e8..f52708ae 100644 --- a/src/include/final/flabel.h +++ b/src/include/final/flabel.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/flineedit.h b/src/include/final/flineedit.h index 028c5e40..6b90c82b 100644 --- a/src/include/final/flineedit.h +++ b/src/include/final/flineedit.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2012-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/flistbox.h b/src/include/final/flistbox.h index c6e1b1b9..9db2d50b 100644 --- a/src/include/final/flistbox.h +++ b/src/include/final/flistbox.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -e Copyright 2014-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ e Copyright 2014-2019 Markus Gans * /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h index 6e7d3f20..8256d929 100644 --- a/src/include/final/flistview.h +++ b/src/include/final/flistview.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2017-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fmenu.h b/src/include/final/fmenu.h index 10c62c8d..b0d8554d 100644 --- a/src/include/final/fmenu.h +++ b/src/include/final/fmenu.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fmenubar.h b/src/include/final/fmenubar.h index 8262d41f..51551654 100644 --- a/src/include/final/fmenubar.h +++ b/src/include/final/fmenubar.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fmenuitem.h b/src/include/final/fmenuitem.h index b313d8c6..277b2d77 100644 --- a/src/include/final/fmenuitem.h +++ b/src/include/final/fmenuitem.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fmessagebox.h b/src/include/final/fmessagebox.h index bc00e14b..7d19043f 100644 --- a/src/include/final/fmessagebox.h +++ b/src/include/final/fmessagebox.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fprogressbar.h b/src/include/final/fprogressbar.h index ee46d590..7c6168a7 100644 --- a/src/include/final/fprogressbar.h +++ b/src/include/final/fprogressbar.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fradiobutton.h b/src/include/final/fradiobutton.h index dd426a64..ac0176fb 100644 --- a/src/include/final/fradiobutton.h +++ b/src/include/final/fradiobutton.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fradiomenuitem.h b/src/include/final/fradiomenuitem.h index 3b782358..53e4fb0f 100644 --- a/src/include/final/fradiomenuitem.h +++ b/src/include/final/fradiomenuitem.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fscrollbar.h b/src/include/final/fscrollbar.h index 48962c2c..36497ce9 100644 --- a/src/include/final/fscrollbar.h +++ b/src/include/final/fscrollbar.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2012-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fscrollview.h b/src/include/final/fscrollview.h index 8f79310d..eb7f4fa2 100644 --- a/src/include/final/fscrollview.h +++ b/src/include/final/fscrollview.h @@ -4,7 +4,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2017-2019 Markus Gans * +* 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 * @@ -24,11 +24,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fspinbox.h b/src/include/final/fspinbox.h index 1567c7ee..c3ec606c 100644 --- a/src/include/final/fspinbox.h +++ b/src/include/final/fspinbox.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fstatusbar.h b/src/include/final/fstatusbar.h index 3331d30d..d55280aa 100644 --- a/src/include/final/fstatusbar.h +++ b/src/include/final/fstatusbar.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fswitch.h b/src/include/final/fswitch.h index a05dc885..eb29991d 100644 --- a/src/include/final/fswitch.h +++ b/src/include/final/fswitch.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/ftermdata.h b/src/include/final/ftermdata.h index 675f2aa8..12e79c7f 100644 --- a/src/include/final/ftermdata.h +++ b/src/include/final/ftermdata.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2018-2019 Markus Gans * +* Copyright 2018-2020 Markus Gans * * * * The Final Cut is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public License * @@ -80,6 +80,7 @@ class FTermData final char* getTermFileName(); const FString& getXtermFont() const; const FString& getXtermTitle() const; + const FString& getExitMessage() const; #if DEBUG int getFramebufferBpp() const; #endif @@ -120,6 +121,7 @@ class FTermData final void setTermFileName (const char[]); void setXtermFont (const FString&); void setXtermTitle (const FString&); + void setExitMessage (const FString&); #if DEBUG void setFramebufferBpp (int); #endif @@ -131,6 +133,7 @@ class FTermData final FRect term_geometry{}; // current terminal geometry FString xterm_font{}; FString xterm_title{}; + FString exit_message{}; fc::encoding term_encoding{fc::UNKNOWN}; int fd_tty{-1}; // Teletype (tty) file descriptor // is still undefined @@ -201,6 +204,10 @@ inline const FString& FTermData::getXtermFont() const inline const FString& FTermData::getXtermTitle() const { return xterm_title; } +//---------------------------------------------------------------------- +inline const FString& FTermData::getExitMessage() const +{ return exit_message; } + //---------------------------------------------------------------------- #if DEBUG inline int FTermData::getFramebufferBpp() const @@ -351,6 +358,10 @@ inline void FTermData::setXtermFont (const FString& font) inline void FTermData::setXtermTitle (const FString& title) { xterm_title = title; } +//---------------------------------------------------------------------- +inline void FTermData::setExitMessage (const FString& message) +{ exit_message = message; } + //---------------------------------------------------------------------- #if DEBUG && defined(__linux__) inline void FTermData::setFramebufferBpp (int bpp) diff --git a/src/include/final/ftermdetection.h b/src/include/final/ftermdetection.h index 6861ef90..4b2fc9d1 100644 --- a/src/include/final/ftermdetection.h +++ b/src/include/final/ftermdetection.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2018-2019 Markus Gans * +* Copyright 2018-2020 Markus Gans * * * * The Final Cut is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public License * @@ -20,7 +20,6 @@ * . * ***********************************************************************/ - /* Standalone class * ════════════════ * diff --git a/src/include/final/ftextview.h b/src/include/final/ftextview.h index f0fc9edc..5676b5c8 100644 --- a/src/include/final/ftextview.h +++ b/src/include/final/ftextview.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/ftogglebutton.h b/src/include/final/ftogglebutton.h index 13d07469..6d1026af 100644 --- a/src/include/final/ftogglebutton.h +++ b/src/include/final/ftogglebutton.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2014-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/ftooltip.h b/src/include/final/ftooltip.h index 4496b76e..9097829f 100644 --- a/src/include/final/ftooltip.h +++ b/src/include/final/ftooltip.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2016-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 487f2ea9..d41bb6f4 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2016-2019 Markus Gans * +* 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 * @@ -23,22 +23,22 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ - * ▕▔▔▔▔▔▔▔▔▔▏1 *▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FVTerm ▏- - -┬- - -▕ FString ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ : ▕▁▁▁▁▁▁▁▁▁▏ + * ▕▔▔▔▔▔▔▔▔▔▏1 *▕▔▔▔▔▔▔▔▏ + * ▕ FVTerm ▏- - -┬- - -▕ FTerm ▏ + * ▕▁▁▁▁▁▁▁▁▁▏ : ▕▁▁▁▁▁▁▁▏ + * : + * : *▕▔▔▔▔▔▔▔▔▔▏ + * :- - -▕ FString ▏ + * : ▕▁▁▁▁▁▁▁▁▁▏ * : * : *▕▔▔▔▔▔▔▔▔▏ - * :- - -▕ FPoint ▏ + * └- - -▕ FPoint ▏ * : ▕▁▁▁▁▁▁▁▁▏ * : * : *▕▔▔▔▔▔▔▔▏ * └- - -▕ FRect ▏ * ▕▁▁▁▁▁▁▁▏ + */ #ifndef FVTERM_H diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index ec8b7aa5..6405db5c 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/src/include/final/fwindow.h b/src/include/final/fwindow.h index 868afd04..da77fcb1 100644 --- a/src/include/final/fwindow.h +++ b/src/include/final/fwindow.h @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2015-2019 Markus Gans * +* 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 * @@ -23,11 +23,6 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▔▏ - * ▕ FTerm ▏ - * ▕▁▁▁▁▁▁▁▁▁▏ - * ▲ - * │ * ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏ * ▕ FVTerm ▏ ▕ FObject ▏ * ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏ diff --git a/test/fsize-test.cpp b/test/fsize-test.cpp index 496eedd0..b9516c7b 100644 --- a/test/fsize-test.cpp +++ b/test/fsize-test.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2019 Markus Gans * +* 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 * @@ -400,6 +400,16 @@ void FSizeTest::scaleTest() CPPUNIT_ASSERT ( s1.getWidth() == 15 ); CPPUNIT_ASSERT ( s1.getHeight() == 15 ); CPPUNIT_ASSERT ( s1 == finalcut::FSize(15, 15) ); + + s1.scaleBy(-20, 0); + CPPUNIT_ASSERT ( s1.getWidth() == 5 ); + CPPUNIT_ASSERT ( s1.getHeight() == 15 ); + CPPUNIT_ASSERT ( s1 == finalcut::FSize(5, 15) ); + + s1.scaleBy(0, -20); + CPPUNIT_ASSERT ( s1.getWidth() == 5 ); + CPPUNIT_ASSERT ( s1.getHeight() == 5 ); + CPPUNIT_ASSERT ( s1 == finalcut::FSize(5, 5) ); } //---------------------------------------------------------------------- diff --git a/test/ftermdata-test.cpp b/test/ftermdata-test.cpp index 60b1ba9c..72e9754b 100644 --- a/test/ftermdata-test.cpp +++ b/test/ftermdata-test.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2018-2019 Markus Gans * +* Copyright 2018-2020 Markus Gans * * * * The Final Cut is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public License * @@ -97,6 +97,7 @@ void FTermDataTest::defaultDataTest() CPPUNIT_ASSERT_CSTRING ( data.getTermFileName(), C_STR("") ); CPPUNIT_ASSERT ( data.getXtermFont() == finalcut::FString() ); CPPUNIT_ASSERT ( data.getXtermTitle() == finalcut::FString() ); + CPPUNIT_ASSERT ( data.getExitMessage() == finalcut::FString() ); #if DEBUG CPPUNIT_ASSERT ( data.getFramebufferBpp() == -1 ); @@ -192,6 +193,10 @@ void FTermDataTest::dataTest() data.setXtermTitle("Terminal"); CPPUNIT_ASSERT ( data.getXtermTitle() == finalcut::FString("Terminal") ); + CPPUNIT_ASSERT ( data.getExitMessage() == finalcut::FString() ); + data.setExitMessage("No tty found"); + CPPUNIT_ASSERT ( data.getExitMessage() == finalcut::FString("No tty found") ); + #if DEBUG CPPUNIT_ASSERT ( data.getFramebufferBpp() == -1 ); data.setFramebufferBpp(32);