From 5257beb73a1212f3561bacac1e3ee5ca9a7e1d3a Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Tue, 6 Aug 2019 23:45:28 +0200 Subject: [PATCH] Small cleanups --- doc/build_openbsd.txt | 12 ++++-- doc/first-steps.md | 14 +++---- examples/7segment.cpp | 27 ++++++++++++- examples/calculator.cpp | 10 ++--- examples/checklist.cpp | 4 +- examples/choice.cpp | 1 + examples/keyboard.cpp | 6 +-- examples/listbox.cpp | 3 +- examples/listview.cpp | 2 +- examples/mandelbrot.cpp | 8 ++-- examples/menu.cpp | 4 +- examples/mouse.cpp | 20 +++++----- examples/scrollview.cpp | 4 +- examples/term-attributes.cpp | 13 ++++--- examples/timer.cpp | 6 +-- examples/transparent.cpp | 14 +++---- examples/treeview.cpp | 2 +- examples/ui.cpp | 14 ++++--- examples/watch.cpp | 6 +-- examples/windows.cpp | 10 ++--- src/fcharmap.cpp | 2 +- src/ffiledialog.cpp | 20 +++++----- src/fmouse.cpp | 36 +++++++++--------- src/fsize.cpp | 1 + src/fstring.cpp | 1 + src/ftermlinux.cpp | 21 ++++++---- src/ftermxterminal.cpp | 1 - src/fwindow.cpp | 2 + src/include/final/fapplication.h | 4 +- src/include/final/fbutton.h | 36 +++++++++--------- src/include/final/fbuttongroup.h | 20 +++++----- src/include/final/fcheckbox.h | 6 +-- src/include/final/fcheckmenuitem.h | 4 +- src/include/final/fcolorpair.h | 2 +- src/include/final/fdialog.h | 44 ++++++++++----------- src/include/final/fdialoglistmenu.h | 4 +- src/include/final/ffiledialog.h | 8 ++-- src/include/final/fkeyboard.h | 1 + src/include/final/flabel.h | 12 +++--- src/include/final/flineedit.h | 43 +++++++++++---------- src/include/final/flistbox.h | 36 +++++++++--------- src/include/final/flistview.h | 30 +++++++-------- src/include/final/fmenu.h | 30 +++++++-------- src/include/final/fmenubar.h | 18 ++++----- src/include/final/fmenuitem.h | 30 +++++++-------- src/include/final/fmessagebox.h | 6 +-- src/include/final/fmouse.h | 32 ++++++++-------- src/include/final/fprogressbar.h | 8 ++-- src/include/final/fradiobutton.h | 10 ++--- src/include/final/fradiomenuitem.h | 8 ++-- src/include/final/fscrollbar.h | 20 +++++----- src/include/final/fscrollview.h | 34 ++++++++--------- src/include/final/fsize.h | 1 + src/include/final/fstatusbar.h | 18 ++++----- src/include/final/fswitch.h | 14 +++---- src/include/final/fsystemimpl.h | 30 +++++++-------- src/include/final/ftermlinux.h | 1 + src/include/final/ftextview.h | 24 ++++++------ src/include/final/ftogglebutton.h | 36 +++++++++--------- src/include/final/ftooltip.h | 14 +++---- src/include/final/fwidget.h | 12 +++--- src/include/final/fwindow.h | 41 ++++++++++---------- test/Makefile.clang | 2 +- test/Makefile.gcc | 2 +- test/fkeyboard-test.cpp | 3 +- test/foptiattr-test.cpp | 1 + test/foptimove-test.cpp | 3 +- test/fpoint-test.cpp | 59 +++++++++++++++-------------- test/frect-test.cpp | 1 + test/fsize-test.cpp | 31 +++++++-------- test/ftermcapquirks-test.cpp | 1 + test/ftermfreebsd-test.cpp | 55 +++++++++++++-------------- test/ftermlinux-test.cpp | 31 ++++++++------- test/ftermopenbsd-test.cpp | 29 +++++++------- 74 files changed, 584 insertions(+), 535 deletions(-) diff --git a/doc/build_openbsd.txt b/doc/build_openbsd.txt index 29de3c4d..2bd180b0 100644 --- a/doc/build_openbsd.txt +++ b/doc/build_openbsd.txt @@ -1,3 +1,11 @@ +Build FINAL CUT with the clang c++ compiler +------------------------------------------- +openbsd# CXX=clang++ ./build.sh + +Build FINAL CUT with eg++ +------------------------- +openbsd# CXX=eg++ ./build.sh + Install egcc on OpenBSD ----------------------- openbsd# pkg_add g++ @@ -14,7 +22,3 @@ g++-8.3.0:libmpc-0.9p2: ok g++-8.3.0:gcc-8.3.0: ok g++-8.3.0: ok -Build FINAL CUT with eg++ -------------------------- -openbsd# CXX=eg++ ./build.sh - diff --git a/doc/first-steps.md b/doc/first-steps.md index 93d6aaab..0f33cd67 100644 --- a/doc/first-steps.md +++ b/doc/first-steps.md @@ -27,7 +27,7 @@ How to use the library At the beginning of this introduction to the Final Cut we will start with a small example. -The following example creates an empty 30×10 character dialog. +The following example creates an empty 30??10 character dialog. **File:** *dialog.cpp* ```cpp @@ -290,7 +290,7 @@ class dialogWidget : public FDialog } private: - virtual void onTimer (FTimerEvent* ev) override + void onTimer (FTimerEvent* ev) override { if ( id == ev->getTimerId() && n < 9999999999 ) { @@ -699,12 +699,12 @@ class dialogWidget : public FDialog void setTemperature() { label.clear(); - label << t << "°C"; + label << t << "??C"; label.redraw(); } int t = 20; - FLabel label{FString() << t << "°C", this}; + FLabel label{FString() << t << "??C", this}; FButton plus {"&+", this}; FButton minus {"&-", this}; }; @@ -795,7 +795,7 @@ class dialogWidget : public FDialog input.setY (ly, false); } - virtual void adjustSize() override + void adjustSize() override { // Calling super class method adjustSize() FDialog::adjustSize(); @@ -803,14 +803,14 @@ class dialogWidget : public FDialog centerDialog(); } - virtual void setSize (const FSize& size, bool) override + void setSize (const FSize& size, bool) override { // Calling super class methods setSize() + adjustSize() FDialog::setSize (size, false); FDialog::adjustSize(); } - virtual void draw() override + void draw() override { adjustWidgets(); // Adjust widgets before drawing diff --git a/examples/7segment.cpp b/examples/7segment.cpp index 904b2508..2d9b6f52 100644 --- a/examples/7segment.cpp +++ b/examples/7segment.cpp @@ -1,3 +1,28 @@ +/*********************************************************************** +* 7segment.cpp - Seven-segment display * +* * +* 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 * +* 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 +#include + #include namespace fc = finalcut::fc; @@ -35,7 +60,7 @@ class SegmentView : public finalcut::FDialog // Methods void hexEncoding(); void get7Segment (const wchar_t); - virtual void draw() override; + void draw() override; // Data Members std::map code{}; diff --git a/examples/calculator.cpp b/examples/calculator.cpp index 63397660..23b72934 100644 --- a/examples/calculator.cpp +++ b/examples/calculator.cpp @@ -55,7 +55,7 @@ class Button : public finalcut::FButton void setChecked(bool); // Event handler - virtual void onKeyPress (finalcut::FKeyEvent*) override; + void onKeyPress (finalcut::FKeyEvent*) override; private: // Data Member @@ -122,8 +122,8 @@ class Calc : public finalcut::FDialog ~Calc(); // Event handlers - virtual void onKeyPress (finalcut::FKeyEvent*) override; - virtual void onClose (finalcut::FCloseEvent*) override; + void onKeyPress (finalcut::FKeyEvent*) override; + void onClose (finalcut::FCloseEvent*) override; // Callback method void cb_buttonClicked (finalcut::FWidget*, FDataPtr); @@ -173,7 +173,7 @@ class Calc : public finalcut::FDialog // Methods void drawDispay(); - virtual void draw() override; + void draw() override; void clear (lDouble&); void zero (lDouble&); void one (lDouble&); @@ -215,7 +215,7 @@ class Calc : public finalcut::FDialog void setInfixOperator (char); void clearInfixOperator(); void calcInfixOperator(); - virtual void adjustSize() override; + void adjustSize() override; const wchar_t* getButtonText (std::size_t); void mapKeyFunctions(); diff --git a/examples/checklist.cpp b/examples/checklist.cpp index 9d1e8d0f..a672cd87 100644 --- a/examples/checklist.cpp +++ b/examples/checklist.cpp @@ -59,8 +59,8 @@ class CheckList : public finalcut::FDialog void populate(); // Event handlers - virtual void onKeyPress (finalcut::FKeyEvent*) override; - virtual void onClose (finalcut::FCloseEvent*) override; + void onKeyPress (finalcut::FKeyEvent*) override; + void onClose (finalcut::FCloseEvent*) override; // Callback method void cb_showList (finalcut::FWidget*, FDataPtr); diff --git a/examples/choice.cpp b/examples/choice.cpp index 0d082843..c3c5235c 100644 --- a/examples/choice.cpp +++ b/examples/choice.cpp @@ -20,6 +20,7 @@ * . * ***********************************************************************/ +#include #include #include diff --git a/examples/keyboard.cpp b/examples/keyboard.cpp index 6b35f19e..6bae910c 100644 --- a/examples/keyboard.cpp +++ b/examples/keyboard.cpp @@ -34,12 +34,12 @@ class Keyboard : public finalcut::FWidget protected: // Event handlers - virtual void onKeyPress (finalcut::FKeyEvent*) override; - virtual void onAccel (finalcut::FAccelEvent*) override; + void onKeyPress (finalcut::FKeyEvent*) override; + void onAccel (finalcut::FAccelEvent*) override; private: // Methods - virtual void draw() override; + void draw() override; }; //---------------------------------------------------------------------- diff --git a/examples/listbox.cpp b/examples/listbox.cpp index b04138a8..9573056d 100644 --- a/examples/listbox.cpp +++ b/examples/listbox.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -95,7 +96,7 @@ class Listbox : public FDialog private: // Event handlers - virtual void onClose (FCloseEvent*) override; + void onClose (FCloseEvent*) override; // Data Member std::list double_list{}; diff --git a/examples/listview.cpp b/examples/listview.cpp index 25374913..e0f95bee 100644 --- a/examples/listview.cpp +++ b/examples/listview.cpp @@ -59,7 +59,7 @@ class Listview : public finalcut::FDialog void populate(); // Event handlers - virtual void onClose (finalcut::FCloseEvent*) override; + void onClose (finalcut::FCloseEvent*) override; // Callback method void cb_showInMessagebox (finalcut::FWidget*, FDataPtr); diff --git a/examples/mandelbrot.cpp b/examples/mandelbrot.cpp index e32a8fd6..71242c05 100644 --- a/examples/mandelbrot.cpp +++ b/examples/mandelbrot.cpp @@ -44,13 +44,13 @@ class Mandelbrot : public finalcut::FDialog ~Mandelbrot(); // Event handlers - virtual void onKeyPress (finalcut::FKeyEvent*) override; - virtual void onClose (finalcut::FCloseEvent*) override; + void onKeyPress (finalcut::FKeyEvent*) override; + void onClose (finalcut::FCloseEvent*) override; private: // Methods - virtual void draw() override; - virtual void adjustSize() override; + void draw() override; + void adjustSize() override; }; #pragma pack(pop) diff --git a/examples/menu.cpp b/examples/menu.cpp index fb736af0..9d66d7f5 100644 --- a/examples/menu.cpp +++ b/examples/menu.cpp @@ -58,10 +58,10 @@ class Menu : public finalcut::FDialog void configureStyleMenuItems(); void configureBorderMenuItems(); void defaultCallback (finalcut::FMenuList*); - virtual void adjustSize() override; + void adjustSize() override; // Event handler - virtual void onClose (finalcut::FCloseEvent*) override; + void onClose (finalcut::FCloseEvent*) override; // Callback method void cb_message (finalcut::FWidget*, FDataPtr); diff --git a/examples/mouse.cpp b/examples/mouse.cpp index a2affd44..388e1274 100644 --- a/examples/mouse.cpp +++ b/examples/mouse.cpp @@ -56,10 +56,10 @@ class ColorChooser : public finalcut::FWidget private: // Method - virtual void draw() override; + void draw() override; // Event handler - virtual void onMouseDown (finalcut::FMouseEvent*) override; + void onMouseDown (finalcut::FMouseEvent*) override; // Data Members FColor fg_color{fc::White}; @@ -195,10 +195,10 @@ class Brushes : public finalcut::FWidget private: // Method - virtual void draw() override; + void draw() override; // Event handler - virtual void onMouseDown (finalcut::FMouseEvent*) override; + void onMouseDown (finalcut::FMouseEvent*) override; // Data Members wchar_t brush{L' '}; @@ -329,19 +329,19 @@ class MouseDraw : public finalcut::FDialog void setGeometry (const FPoint&, const FSize&, bool = true) override; // Event handlers - virtual void onKeyPress (finalcut::FKeyEvent*) override; - virtual void onClose (finalcut::FCloseEvent*) override; + void onKeyPress (finalcut::FKeyEvent*) override; + void onClose (finalcut::FCloseEvent*) override; private: // Methods - virtual void draw() override; + void draw() override; void drawBrush (int, int, bool = false); void drawCanvas(); - virtual void adjustSize() override; + void adjustSize() override; // Event handler - virtual void onMouseDown (finalcut::FMouseEvent*) override; - virtual void onMouseMove (finalcut::FMouseEvent*) override; + void onMouseDown (finalcut::FMouseEvent*) override; + void onMouseMove (finalcut::FMouseEvent*) override; // Callback methods void cb_colorChanged (finalcut::FWidget*, FDataPtr); diff --git a/examples/scrollview.cpp b/examples/scrollview.cpp index a062d946..ee7a2a49 100644 --- a/examples/scrollview.cpp +++ b/examples/scrollview.cpp @@ -54,7 +54,7 @@ class Scrollview : public finalcut::FScrollView private: // Method - virtual void draw() override; + void draw() override; // Callback methods void cb_go_east (finalcut::FWidget*, FDataPtr); @@ -206,7 +206,7 @@ class Scrollviewdemo : public finalcut::FDialog ~Scrollviewdemo(); // Event handler - virtual void onClose (finalcut::FCloseEvent*) override; + void onClose (finalcut::FCloseEvent*) override; // Callback method void cb_quit (finalcut::FWidget* = nullptr, FDataPtr = nullptr); diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp index 9512eaa5..0175030a 100644 --- a/examples/term-attributes.cpp +++ b/examples/term-attributes.cpp @@ -21,6 +21,7 @@ ***********************************************************************/ #include +#include #include namespace fc = finalcut::fc; @@ -52,9 +53,9 @@ class AttribDlg : public finalcut::FDialog AttribDlg& operator = (const AttribDlg&) = delete; // Event handlers - virtual void onKeyPress (finalcut::FKeyEvent*) override; - virtual void onWheel (finalcut::FWheelEvent*) override; - virtual void onClose (finalcut::FCloseEvent*) override; + void onKeyPress (finalcut::FKeyEvent*) override; + void onWheel (finalcut::FWheelEvent*) override; + void onClose (finalcut::FCloseEvent*) override; // Callback methods void cb_next (finalcut::FWidget* = nullptr, FDataPtr = nullptr); @@ -65,7 +66,7 @@ class AttribDlg : public finalcut::FDialog private: // Method - virtual void adjustSize() override; + void adjustSize() override; // Data Members finalcut::FButton next_button{"&Next >", this}; @@ -210,7 +211,7 @@ class AttribDemo : public finalcut::FWidget { } // Event handler - virtual void onWheel (finalcut::FWheelEvent* ev) override + void onWheel (finalcut::FWheelEvent* ev) override { auto p = static_cast(getParentWidget()); @@ -235,7 +236,7 @@ class AttribDemo : public finalcut::FWidget void printStandout(); void printInvisible(); void printProtected(); - virtual void draw() override; + void draw() override; // Data Member int colors; diff --git a/examples/timer.cpp b/examples/timer.cpp index be47482b..c0602547 100644 --- a/examples/timer.cpp +++ b/examples/timer.cpp @@ -37,11 +37,11 @@ class Timer : public finalcut::FWidget protected: // Method - virtual void draw() override; + void draw() override; // Event handlers - virtual void onTimer (finalcut::FTimerEvent*) override; - virtual void onAccel (finalcut::FAccelEvent*) override; + void onTimer (finalcut::FTimerEvent*) override; + void onAccel (finalcut::FAccelEvent*) override; }; //---------------------------------------------------------------------- diff --git a/examples/transparent.cpp b/examples/transparent.cpp index 8054f719..0a7f0a34 100644 --- a/examples/transparent.cpp +++ b/examples/transparent.cpp @@ -60,10 +60,10 @@ class Transparent : public finalcut::FDialog private: // Method - virtual void draw() override; + void draw() override; // Event handlers - virtual void onKeyPress (finalcut::FKeyEvent* ev) override; + void onKeyPress (finalcut::FKeyEvent* ev) override; // Data Members trans_type type; @@ -166,13 +166,13 @@ class MainWindow : public finalcut::FDialog private: // Method - virtual void draw() override; + void draw() override; // Event handlers - virtual void onClose (finalcut::FCloseEvent*) override; - virtual void onShow (finalcut::FShowEvent*) override; - virtual void onTimer (finalcut::FTimerEvent*) override; - virtual void onKeyPress (finalcut::FKeyEvent* ev) override + void onClose (finalcut::FCloseEvent*) override; + void onShow (finalcut::FShowEvent*) override; + void onTimer (finalcut::FTimerEvent*) override; + void onKeyPress (finalcut::FKeyEvent* ev) override { if ( ! ev ) return; diff --git a/examples/treeview.cpp b/examples/treeview.cpp index 686f5da4..2721bb1c 100644 --- a/examples/treeview.cpp +++ b/examples/treeview.cpp @@ -135,7 +135,7 @@ class Treeview : public finalcut::FDialog struct TreeItem; // forward declaration // Methods - virtual void adjustSize() override; + void adjustSize() override; // Event handler void onClose (finalcut::FCloseEvent*) override; diff --git a/examples/ui.cpp b/examples/ui.cpp index 44c5572d..0b32a3ed 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -1,5 +1,5 @@ /*********************************************************************** -* ui.cpp - Example of a user interface * +* 7segment.cpp - Seven-segment display example * * * * This file is part of the Final Cut widget toolkit * * * @@ -21,8 +21,10 @@ ***********************************************************************/ #include +#include #include #include +#include #include @@ -55,8 +57,8 @@ class ProgressDialog : public finalcut::FDialog private: // Event handlers - virtual void onShow (finalcut::FShowEvent*) override; - virtual void onTimer (finalcut::FTimerEvent*) override; + void onShow (finalcut::FShowEvent*) override; + void onTimer (finalcut::FTimerEvent*) override; // Callback methods void cb_reset_bar (finalcut::FWidget*, FDataPtr); @@ -204,7 +206,7 @@ class TextWindow : public finalcut::FDialog private: // Method - virtual void adjustSize() override; + void adjustSize() override; // Data Members finalcut::FTextView scrollText{this}; @@ -284,10 +286,10 @@ class MyDialog : public finalcut::FDialog void initButtons(); void initLabels(); void initWidgetsCallbacks(); - virtual void adjustSize() override; + void adjustSize() override; // Event handlers - virtual void onClose (finalcut::FCloseEvent*) override; + void onClose (finalcut::FCloseEvent*) override; // Callback methods void cb_noFunctionMsg (finalcut::FWidget*, FDataPtr); diff --git a/examples/watch.cpp b/examples/watch.cpp index 5ad107e8..3240ed1b 100644 --- a/examples/watch.cpp +++ b/examples/watch.cpp @@ -53,8 +53,8 @@ class Watch : public finalcut::FDialog void printTime(); // Event handlers - virtual void onTimer (finalcut::FTimerEvent*) override; - virtual void onClose (finalcut::FCloseEvent*) override; + void onTimer (finalcut::FTimerEvent*) override; + void onClose (finalcut::FCloseEvent*) override; // Callback methods void cb_clock (finalcut::FWidget*, FDataPtr); @@ -62,7 +62,7 @@ class Watch : public finalcut::FDialog protected: // Method - virtual void adjustSize() override; + void adjustSize() override; private: // Data Members diff --git a/examples/windows.cpp b/examples/windows.cpp index 85948441..895f49e6 100644 --- a/examples/windows.cpp +++ b/examples/windows.cpp @@ -52,11 +52,11 @@ class SmallWindow : public finalcut::FDialog private: // Method - virtual void adjustSize() override; + void adjustSize() override; // Event handlers - virtual void onShow (finalcut::FShowEvent*) override; - virtual void onTimer (finalcut::FTimerEvent*) override; + void onShow (finalcut::FShowEvent*) override; + void onTimer (finalcut::FTimerEvent*) override; // Data Members finalcut::FLabel left_arrow{this}; @@ -209,12 +209,12 @@ class Window : public finalcut::FDialog void configureFileMenuItems(); void configureDialogButtons(); void activateWindow (finalcut::FDialog*); - virtual void adjustSize() override; + void adjustSize() override; void addClickedCallback (finalcut::FWidget*, WindowCallback); void addClickedCallback (finalcut::FWidget*, FAppCallback); // Event handlers - virtual void onClose (finalcut::FCloseEvent*) override; + void onClose (finalcut::FCloseEvent*) override; // Callback methods void cb_createWindows (finalcut::FWidget*, FDataPtr); diff --git a/src/fcharmap.cpp b/src/fcharmap.cpp index 0af94a4d..c3e21e16 100644 --- a/src/fcharmap.cpp +++ b/src/fcharmap.cpp @@ -201,7 +201,7 @@ const std::size_t lastKeyItem = \ std::size_t((sizeof(vt100_key_to_utf8) / sizeof(vt100_key_to_utf8[0])) - 1); - wchar_t cp437_to_ucs[][2] = +wchar_t cp437_to_ucs[][2] = { {0x00, 0x0000}, // null {0x01, 0x263a}, // white smiling face diff --git a/src/ffiledialog.cpp b/src/ffiledialog.cpp index 4c41fa2d..5820dd36 100644 --- a/src/ffiledialog.cpp +++ b/src/ffiledialog.cpp @@ -449,26 +449,26 @@ void FFileDialog::clear() } //---------------------------------------------------------------------- -int FFileDialog::numOfDirs() +long FFileDialog::numOfDirs() { if ( dir_entries.empty() ) return 0; - int n = std::count_if ( std::begin(dir_entries) - , std::end(dir_entries) - , [] (dir_entry& entry) - { - return entry.directory - && std::strcmp(entry.name, ".") != 0; - } - ); + long n = std::count_if ( std::begin(dir_entries) + , std::end(dir_entries) + , [] (dir_entry& entry) + { + return entry.directory + && std::strcmp(entry.name, ".") != 0; + } + ); return n; } //---------------------------------------------------------------------- void FFileDialog::sortDir() { - int start, dir_num; + long start, dir_num; if ( std::strcmp((*dir_entries.begin()).name, "..") == 0 ) start = 1; diff --git a/src/fmouse.cpp b/src/fmouse.cpp index 8084cc4c..cccbe861 100644 --- a/src/fmouse.cpp +++ b/src/fmouse.cpp @@ -1564,15 +1564,15 @@ void FMouseControl::drawGpmPointer() //---------------------------------------------------------------------- FMouse* FMouseControl::getMouseWithData() { - const auto& iter = \ - std::find_if ( std::begin(mouse_protocol) - , std::end(mouse_protocol) - , [] (FMouseProtocol::const_reference m) - { - return m.second - && m.second->hasData(); - } - ); + const auto& iter = \ + std::find_if ( std::begin(mouse_protocol) + , std::end(mouse_protocol) + , [] (FMouseProtocol::const_reference m) + { + return m.second + && m.second->hasData(); + } + ); return ( iter != mouse_protocol.end() ) ? iter->second : 0; } @@ -1580,15 +1580,15 @@ FMouse* FMouseControl::getMouseWithData() //---------------------------------------------------------------------- FMouse* FMouseControl::getMouseWithEvent() { - const auto& iter = \ - std::find_if ( std::begin(mouse_protocol) - , std::end(mouse_protocol) - , [] (FMouseProtocol::const_reference m) - { - return m.second - && m.second->hasEvent(); - } - ); + const auto& iter = \ + std::find_if ( std::begin(mouse_protocol) + , std::end(mouse_protocol) + , [] (FMouseProtocol::const_reference m) + { + return m.second + && m.second->hasEvent(); + } + ); return ( iter != mouse_protocol.end() ) ? iter->second : 0; } diff --git a/src/fsize.cpp b/src/fsize.cpp index d1c90714..2690ea1e 100644 --- a/src/fsize.cpp +++ b/src/fsize.cpp @@ -20,6 +20,7 @@ * . * ***********************************************************************/ +#include #include "final/fsize.h" namespace finalcut diff --git a/src/fstring.cpp b/src/fstring.cpp index 087f34fb..433b90de 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp @@ -21,6 +21,7 @@ ***********************************************************************/ #include +#include #include #include "final/fstring.h" diff --git a/src/ftermlinux.cpp b/src/ftermlinux.cpp index 951423e2..b5ccba38 100644 --- a/src/ftermlinux.cpp +++ b/src/ftermlinux.cpp @@ -20,6 +20,8 @@ * . * ***********************************************************************/ +#include + #include "final/fc.h" #include "final/fcharmap.h" #include "final/fsystem.h" @@ -573,16 +575,19 @@ bool FTermLinux::getScreenFont() if ( fsystem ) ret = fsystem->ioctl (fd_tty, KDFONTOP, &font); - if ( ret == 0 ) + if ( ret != 0 ) { - screen_font.width = font.width; - screen_font.height = font.height; - screen_font.charcount = font.charcount; - screen_font.data = font.data; - return true; - } - else + if ( font.data ) + delete[] font.data; + return false; + } + + screen_font.width = font.width; + screen_font.height = font.height; + screen_font.charcount = font.charcount; + screen_font.data = font.data; + return true; } //---------------------------------------------------------------------- diff --git a/src/ftermxterminal.cpp b/src/ftermxterminal.cpp index d42fc63e..d9bb5701 100644 --- a/src/ftermxterminal.cpp +++ b/src/ftermxterminal.cpp @@ -628,7 +628,6 @@ void FTermXTerminal::resetXTermColorMap() oscPostfix(); std::fflush(stdout); } - } //---------------------------------------------------------------------- diff --git a/src/fwindow.cpp b/src/fwindow.cpp index f7cd50f4..7c897bec 100644 --- a/src/fwindow.cpp +++ b/src/fwindow.cpp @@ -20,6 +20,8 @@ * . * ***********************************************************************/ +#include + #include "final/fapplication.h" #include "final/fevent.h" #include "final/fmenubar.h" diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index e13a8e32..caf7081c 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -109,7 +109,7 @@ class FApplication : public FWidget FApplication& operator = (const FApplication&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; int getArgc() const; char** getArgv() const; static FApplication* getApplicationObject(); @@ -184,7 +184,7 @@ class FApplication : public FWidget void processResizeEvent(); void processCloseWidget(); bool processNextEvent(); - virtual void performTimerAction ( const FObject* + void performTimerAction ( const FObject* , const FEvent* ) override; // Data Members diff --git a/src/include/final/fbutton.h b/src/include/final/fbutton.h index 12bf069b..a2a8d055 100644 --- a/src/include/final/fbutton.h +++ b/src/include/final/fbutton.h @@ -85,7 +85,7 @@ class FButton : public FWidget FButton& operator = (const FString&); // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; FString& getText(); // Mutators @@ -99,13 +99,13 @@ class FButton : public FWidget bool setNoUnderline(bool); bool setNoUnderline(); bool unsetNoUnderline(); - virtual bool setEnable(bool) override; - virtual bool setEnable() override; - virtual bool unsetEnable() override; - virtual bool setDisable() override; - virtual bool setFocus(bool) override; - virtual bool setFocus() override; - virtual bool unsetFocus() override; + bool setEnable(bool) override; + bool setEnable() override; + bool unsetEnable() override; + bool setDisable() override; + bool setFocus(bool) override; + bool setFocus() override; + bool unsetFocus() override; bool setFlat(bool); bool setFlat(); bool unsetFlat(); @@ -127,17 +127,17 @@ class FButton : public FWidget bool hasClickAnimation(); // Methods - virtual void hide() override; + void hide() override; // Event handlers - virtual void onKeyPress (FKeyEvent*) override; - virtual void onMouseDown (FMouseEvent*) override; - virtual void onMouseUp (FMouseEvent*) override; - virtual void onMouseMove (FMouseEvent*) override; - virtual void onTimer (FTimerEvent*) override; - virtual void onAccel (FAccelEvent*) override; - virtual void onFocusIn (FFocusEvent*) override; - virtual void onFocusOut (FFocusEvent*) override; + void onKeyPress (FKeyEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onMouseUp (FMouseEvent*) override; + void onMouseMove (FMouseEvent*) override; + void onTimer (FTimerEvent*) override; + void onAccel (FAccelEvent*) override; + void onFocusIn (FFocusEvent*) override; + void onFocusOut (FFocusEvent*) override; private: // Constants @@ -154,7 +154,7 @@ class FButton : public FWidget void drawMarginRight(); void drawTopBottomBackground(); void drawButtonTextLine (wchar_t[]); - virtual void draw() override; + void draw() override; void updateStatusBar(); void updateButtonColor(); void processClick(); diff --git a/src/include/final/fbuttongroup.h b/src/include/final/fbuttongroup.h index a6370505..f382dc2b 100644 --- a/src/include/final/fbuttongroup.h +++ b/src/include/final/fbuttongroup.h @@ -86,7 +86,7 @@ class FButtonGroup : public FScrollView FButtonGroup& operator = (const FButtonGroup&) = delete; // Accessor - virtual const char* getClassName() const override; + const char* getClassName() const override; FToggleButton* getFirstButton(); FToggleButton* getLastButton(); FToggleButton* getButton (int) const; @@ -94,10 +94,10 @@ class FButtonGroup : public FScrollView FString& getText(); // Mutator - virtual bool setEnable(bool) override; - virtual bool setEnable() override; - virtual bool unsetEnable() override; - virtual bool setDisable() override; + bool setEnable(bool) override; + bool setEnable() override; + bool unsetEnable() override; + bool setDisable() override; void setText (const FString&); // Inquiries @@ -106,23 +106,23 @@ class FButtonGroup : public FScrollView bool hasCheckedButton() const; // Methods - virtual void hide() override; + void hide() override; void insert (FToggleButton*); void remove (FToggleButton*); void checkScrollSize (FToggleButton*); void checkScrollSize (const FRect&); // Event handlers - virtual void onMouseDown (FMouseEvent*) override; - virtual void onAccel (FAccelEvent*) override; - virtual void onFocusIn (FFocusEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onAccel (FAccelEvent*) override; + void onFocusIn (FFocusEvent*) override; protected: // Mutator void setHotkeyAccelerator(); // Methods - virtual void draw() override; + void draw() override; void drawLabel(); private: diff --git a/src/include/final/fcheckbox.h b/src/include/final/fcheckbox.h index 8505f018..c4a3f452 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-2018 Markus Gans * +* Copyright 2014-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 * @@ -86,12 +86,12 @@ class FCheckBox : public FToggleButton FCheckBox& operator = (const FCheckBox&) = delete; // Accessor - virtual const char* getClassName() const override; + const char* getClassName() const override; private: // Methods void init(); - virtual void draw() override; + void draw() override; void drawCheckButton(); }; #pragma pack(pop) diff --git a/src/include/final/fcheckmenuitem.h b/src/include/final/fcheckmenuitem.h index 5c818844..97a07ffd 100644 --- a/src/include/final/fcheckmenuitem.h +++ b/src/include/final/fcheckmenuitem.h @@ -86,13 +86,13 @@ class FCheckMenuItem : public FMenuItem FCheckMenuItem& operator = (const FCheckMenuItem&) = delete; // Accessor - virtual const char* getClassName() const override; + const char* getClassName() const override; private: // Methods void init (FWidget*); void processToggle(); - virtual void processClicked() override; + void processClicked() override; }; #pragma pack(pop) diff --git a/src/include/final/fcolorpair.h b/src/include/final/fcolorpair.h index 1be32b10..a096535d 100644 --- a/src/include/final/fcolorpair.h +++ b/src/include/final/fcolorpair.h @@ -52,7 +52,7 @@ class FColorPair { public: // Constructors - FColorPair (FColor fg = fc::Default, FColor bg = fc::Default) + explicit FColorPair (FColor fg = fc::Default, FColor bg = fc::Default) : fg_color(fg) , bg_color(bg) { } diff --git a/src/include/final/fdialog.h b/src/include/final/fdialog.h index c30a60f8..cbcbf817 100644 --- a/src/include/final/fdialog.h +++ b/src/include/final/fdialog.h @@ -99,7 +99,7 @@ class FDialog : public FWindow FDialog& operator = (const FDialog&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; FString getText() const; // Mutators @@ -109,7 +109,7 @@ class FDialog : public FWindow bool setModal (bool); bool setModal(); bool unsetModal(); - virtual bool setResizeable (bool) override; + bool setResizeable (bool) override; bool setScrollable (bool); bool setScrollable(); bool unsetScrollable(); @@ -120,16 +120,16 @@ class FDialog : public FWindow bool isScrollable(); // Methods - virtual void show() override; - virtual void hide() override; + void show() override; + void hide() override; int exec(); - virtual void setPos (const FPoint&, bool = true) override; - virtual void move (const FPoint&) override; + void setPos (const FPoint&, bool = true) override; + void move (const FPoint&) override; bool moveUp (int); bool moveDown (int); bool moveLeft (int); bool moveRight (int); - virtual void setSize (const FSize&, bool = true) override; + void setSize (const FSize&, bool = true) override; bool reduceHeight (int); bool expandHeight (int); bool reduceWidth (int); @@ -137,27 +137,27 @@ class FDialog : public FWindow void activateDialog(); // Event handlers - virtual void onKeyPress (FKeyEvent*) override; - virtual void onMouseDown (FMouseEvent*) override; - virtual void onMouseUp (FMouseEvent*) override; - virtual void onMouseMove (FMouseEvent*) override; - virtual void onMouseDoubleClick (FMouseEvent*) override; - virtual void onAccel (FAccelEvent*) override; - virtual void onWindowActive (FEvent*) override; - virtual void onWindowInactive (FEvent*) override; - virtual void onWindowRaised (FEvent*) override; - virtual void onWindowLowered (FEvent*) override; + void onKeyPress (FKeyEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onMouseUp (FMouseEvent*) override; + void onMouseMove (FMouseEvent*) override; + void onMouseDoubleClick (FMouseEvent*) override; + void onAccel (FAccelEvent*) override; + void onWindowActive (FEvent*) override; + void onWindowInactive (FEvent*) override; + void onWindowRaised (FEvent*) override; + void onWindowLowered (FEvent*) override; protected: // Methods virtual void done (int); - virtual void draw() override; + void draw() override; void drawDialogShadow(); // Event handlers - virtual void onShow (FShowEvent*) override; - virtual void onHide (FHideEvent*) override; - virtual void onClose (FCloseEvent*) override; + void onShow (FShowEvent*) override; + void onHide (FHideEvent*) override; + void onClose (FCloseEvent*) override; private: // Typedef @@ -183,7 +183,7 @@ class FDialog : public FWindow void initMoveSizeMenuItem (FMenu*); void initZoomMenuItem (FMenu*); void initCloseMenuItem (FMenu*); - virtual void drawBorder() override; + void drawBorder() override; void drawTitleBar(); void drawBarButton(); void drawZoomButton(); diff --git a/src/include/final/fdialoglistmenu.h b/src/include/final/fdialoglistmenu.h index 27194e69..939b6cf9 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-2018 Markus Gans * +* Copyright 2016-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 * @@ -92,7 +92,7 @@ class FDialogListMenu : public FMenu FDialogListMenu& operator = (const FDialogListMenu&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; private: // Method diff --git a/src/include/final/ffiledialog.h b/src/include/final/ffiledialog.h index 6b40f57b..282a9c27 100644 --- a/src/include/final/ffiledialog.h +++ b/src/include/final/ffiledialog.h @@ -118,7 +118,7 @@ class FFileDialog : public FDialog FFileDialog& operator = (const FFileDialog&); // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; const FString getPath() const; const FString getFilter() const; const FString getSelectedFile() const; @@ -132,7 +132,7 @@ class FFileDialog : public FDialog bool unsetShowHiddenFiles(); // Event handler - virtual void onKeyPress (FKeyEvent*) override; + void onKeyPress (FKeyEvent*) override; // Methods static const FString fileOpenChooser ( FWidget* @@ -149,7 +149,7 @@ class FFileDialog : public FDialog protected: // Method - virtual void adjustSize() override; + void adjustSize() override; private: // Typedef @@ -175,7 +175,7 @@ class FFileDialog : public FDialog void initCallbacks(); bool pattern_match (const char* const, char[]); void clear(); - int numOfDirs(); + long numOfDirs(); void sortDir(); int readDir(); void getEntry (const char* const, struct dirent*); diff --git a/src/include/final/fkeyboard.h b/src/include/final/fkeyboard.h index 274a59d7..4d045cdd 100644 --- a/src/include/final/fkeyboard.h +++ b/src/include/final/fkeyboard.h @@ -35,6 +35,7 @@ #error "Only can be included directly." #endif +#include #include "final/ftypes.h" namespace finalcut diff --git a/src/include/final/flabel.h b/src/include/final/flabel.h index fcf52545..00a90a00 100644 --- a/src/include/final/flabel.h +++ b/src/include/final/flabel.h @@ -101,7 +101,7 @@ class FLabel : public FWidget const FLabel& operator >> (FString&); // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; FWidget* getAccelWidget(); fc::text_alignment getAlignment(); FString& getText(); @@ -115,7 +115,7 @@ class FLabel : public FWidget bool setReverseMode(bool); bool setReverseMode(); bool unsetReverseMode(); - virtual bool setEnable (bool) override; + bool setEnable (bool) override; void setNumber (uLong); void setNumber (long); void setNumber (float, int = FLT_DIG); @@ -128,12 +128,12 @@ class FLabel : public FWidget bool hasReverseMode(); // Methods - virtual void hide() override; + void hide() override; void clear(); // Event handlers - virtual void onMouseDown (FMouseEvent*) override; - virtual void onAccel (FAccelEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onAccel (FAccelEvent*) override; // Callback method void cb_accel_widget_destroyed (FWidget*, FDataPtr); @@ -147,7 +147,7 @@ class FLabel : public FWidget std::size_t getHotkeyPos (wchar_t[], wchar_t[], std::size_t); void setHotkeyAccelerator(); std::size_t getAlignOffset (std::size_t); - virtual void draw() override; + void draw() override; void drawMultiLine(); void drawSingleLine(); void printLine ( wchar_t[], std::size_t diff --git a/src/include/final/flineedit.h b/src/include/final/flineedit.h index f1144184..a7d4150f 100644 --- a/src/include/final/flineedit.h +++ b/src/include/final/flineedit.h @@ -52,6 +52,7 @@ #error "Only can be included directly." #endif +#include #include "final/fwidget.h" namespace finalcut @@ -108,7 +109,7 @@ class FLineEdit : public FWidget const FLineEdit& operator >> (FString&); // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; FString getText() const; std::size_t getMaxLength() const; std::size_t getCursorPosition() const; @@ -122,15 +123,15 @@ class FLineEdit : public FWidget void setCursorPosition (std::size_t); void setLabelText (const FString&); void setLabelOrientation (const label_o); - virtual void setGeometry ( const FPoint&, const FSize& + void setGeometry ( const FPoint&, const FSize& , bool = true ) override; - virtual bool setEnable(bool) override; - virtual bool setEnable() override; - virtual bool unsetEnable() override; - virtual bool setDisable() override; - virtual bool setFocus(bool) override; - virtual bool setFocus() override; - virtual bool unsetFocus() override; + bool setEnable(bool) override; + bool setEnable() override; + bool unsetEnable() override; + bool setDisable() override; + bool setFocus(bool) override; + bool setFocus() override; + bool unsetFocus() override; bool setShadow(bool); bool setShadow(); bool unsetShadow(); @@ -139,23 +140,23 @@ class FLineEdit : public FWidget bool hasShadow(); // Methods - virtual void hide() override; + void hide() override; void clear(); // Event handlers - virtual void onKeyPress (FKeyEvent*) override; - virtual void onMouseDown (FMouseEvent*) override; - virtual void onMouseUp (FMouseEvent*) override; - virtual void onMouseMove (FMouseEvent*) override; - virtual void onTimer (FTimerEvent*) override; - virtual void onAccel (FAccelEvent*) override; - virtual void onHide (FHideEvent*) override; - virtual void onFocusIn (FFocusEvent*) override; - virtual void onFocusOut (FFocusEvent*) override; + void onKeyPress (FKeyEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onMouseUp (FMouseEvent*) override; + void onMouseMove (FMouseEvent*) override; + void onTimer (FTimerEvent*) override; + void onAccel (FAccelEvent*) override; + void onHide (FHideEvent*) override; + void onFocusIn (FFocusEvent*) override; + void onFocusOut (FFocusEvent*) override; protected: void adjustLabel(); - virtual void adjustSize() override; + void adjustSize() override; private: // Enumeration @@ -169,7 +170,7 @@ class FLineEdit : public FWidget // Methods void init(); bool hasHotkey(); - virtual void draw() override; + void draw() override; void drawInputField(); void keyLeft(); void keyRight(); diff --git a/src/include/final/flistbox.h b/src/include/final/flistbox.h index aa0cd6c7..933cec61 100644 --- a/src/include/final/flistbox.h +++ b/src/include/final/flistbox.h @@ -170,7 +170,7 @@ class FListBox : public FWidget FListBox& operator = (const FListBox&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; std::size_t getCount() const; FListBoxItem getItem (std::size_t); FListBoxItem getItem (listBoxItems::iterator) const; @@ -187,15 +187,15 @@ class FListBox : public FWidget void showInsideBrackets (std::size_t, fc::brackets_type); void showNoBrackets (std::size_t); void showNoBrackets (listBoxItems::iterator); - virtual void setGeometry ( const FPoint&, const FSize& + void setGeometry ( const FPoint&, const FSize& , bool = true ) override; void setMultiSelection (bool); void setMultiSelection (); void unsetMultiSelection (); - virtual bool setDisable() override; - virtual bool setFocus (bool) override; - virtual bool setFocus() override; - virtual bool unsetFocus() override; + bool setDisable() override; + bool setFocus (bool) override; + bool setFocus() override; + bool unsetFocus() override; void setText (const FString&); // Inquiries @@ -206,7 +206,7 @@ class FListBox : public FWidget bool hasBrackets (listBoxItems::iterator) const; // Methods - virtual void hide() override; + void hide() override; template void insert (Iterator, Iterator, InsertConverter); template @@ -227,20 +227,20 @@ class FListBox : public FWidget void clear(); // Event handlers - virtual void onKeyPress (FKeyEvent*) override; - virtual void onMouseDown (FMouseEvent*) override; - virtual void onMouseUp (FMouseEvent*) override; - virtual void onMouseMove (FMouseEvent*) override; - virtual void onMouseDoubleClick (FMouseEvent*) override; - virtual void onWheel (FWheelEvent*) override; - virtual void onTimer (FTimerEvent*) override; - virtual void onFocusIn (FFocusEvent*) override; - virtual void onFocusOut (FFocusEvent*) override; + void onKeyPress (FKeyEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onMouseUp (FMouseEvent*) override; + void onMouseMove (FMouseEvent*) override; + void onMouseDoubleClick (FMouseEvent*) override; + void onWheel (FWheelEvent*) override; + void onTimer (FTimerEvent*) override; + void onFocusIn (FFocusEvent*) override; + void onFocusOut (FFocusEvent*) override; protected: // Methods void adjustYOffset (std::size_t); - virtual void adjustSize() override; + void adjustSize() override; private: // Typedef @@ -267,7 +267,7 @@ class FListBox : public FWidget void initScrollbar ( FScrollbarPtr& , fc::orientation , FListBoxCallback ); - virtual void draw() override; + void draw() override; void drawHeadline(); void drawList(); void drawListLine (int, listBoxItems::iterator, bool); diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h index 6f6709be..0152e7a4 100644 --- a/src/include/final/flistview.h +++ b/src/include/final/flistview.h @@ -92,7 +92,7 @@ class FListViewItem : public FObject FListViewItem& operator = (const FListViewItem&); // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; uInt getColumnCount() const; int getSortColumn() const; FString getText (int) const; @@ -285,7 +285,7 @@ class FListView : public FWidget FListView& operator = (const FListView&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; std::size_t getCount(); fc::text_alignment getColumnAlignment (int) const; FString getColumnText (int) const; @@ -295,7 +295,7 @@ class FListView : public FWidget FListViewItem* getCurrentItem(); // Mutators - virtual void setGeometry ( const FPoint&, const FSize& + void setGeometry ( const FPoint&, const FSize& , bool = true ) override; void setColumnAlignment (int, fc::text_alignment); void setColumnText (int, const FString&); @@ -314,7 +314,7 @@ class FListView : public FWidget // Methods virtual int addColumn (const FString&, int = USE_MAX_SIZE); - virtual void hide() override; + void hide() override; FObjectIterator insert (FListViewItem*); FObjectIterator insert (FListViewItem*, FObjectIterator); FObjectIterator insert ( const FStringList& @@ -350,15 +350,15 @@ class FListView : public FWidget virtual void sort(); // Event handlers - virtual void onKeyPress (FKeyEvent*) override; - virtual void onMouseDown (FMouseEvent*) override; - virtual void onMouseUp (FMouseEvent*) override; - virtual void onMouseMove (FMouseEvent*) override; - virtual void onMouseDoubleClick (FMouseEvent*) override; - virtual void onWheel (FWheelEvent*) override; - virtual void onTimer (FTimerEvent*) override; - virtual void onFocusIn (FFocusEvent*) override; - virtual void onFocusOut (FFocusEvent*) override; + void onKeyPress (FKeyEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onMouseUp (FMouseEvent*) override; + void onMouseMove (FMouseEvent*) override; + void onMouseDoubleClick (FMouseEvent*) override; + void onWheel (FWheelEvent*) override; + void onTimer (FTimerEvent*) override; + void onFocusIn (FFocusEvent*) override; + void onFocusOut (FFocusEvent*) override; // Data Members static FObjectIterator null_iter; @@ -366,7 +366,7 @@ class FListView : public FWidget protected: // Methods void adjustViewport (int); - virtual void adjustSize() override; + void adjustSize() override; private: // Typedef @@ -393,7 +393,7 @@ class FListView : public FWidget std::size_t getAlignOffset ( fc::text_alignment , std::size_t , std::size_t ); - virtual void draw() override; + void draw() override; void drawHeadlines(); void drawList(); void drawListLine (const FListViewItem*, bool, bool); diff --git a/src/include/final/fmenu.h b/src/include/final/fmenu.h index 33566411..ff389650 100644 --- a/src/include/final/fmenu.h +++ b/src/include/final/fmenu.h @@ -93,21 +93,21 @@ class FMenu : public FWindow, public FMenuList FMenu& operator = (const FMenu&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; FString getText() const; FMenuItem* getItem(); // Mutators - virtual bool setEnable(bool) override; - virtual bool setEnable() override; - virtual bool unsetEnable() override; - virtual bool setDisable() override; + bool setEnable (bool) override; + bool setEnable() override; + bool unsetEnable() override; + bool setDisable() override; void setSelected(); void unsetSelected(); bool setMenuWidget (bool); bool setMenuWidget(); bool unsetMenuWidget(); - virtual void setStatusbarMessage (const FString&) override; + void setStatusbarMessage (const FString&) override; void setMenu (FMenu*); void setText (const FString&); @@ -118,15 +118,15 @@ class FMenu : public FWindow, public FMenuList bool hasMenu() const; // Methods - virtual void show() override; - virtual void hide() override; + void show() override; + void hide() override; // Event handlers - virtual void onKeyPress (FKeyEvent*) override; - virtual void onMouseDown (FMouseEvent*) override; - virtual void onMouseUp (FMouseEvent*) override; - virtual void onMouseMove (FMouseEvent*) override; - virtual void onAccel (FAccelEvent*) override; + void onKeyPress (FKeyEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onMouseUp (FMouseEvent*) override; + void onMouseMove (FMouseEvent*) override; + void onAccel (FAccelEvent*) override; // Callback method void cb_menuitem_toggled (FWidget*, FDataPtr); @@ -203,7 +203,7 @@ class FMenu : public FWindow, public FMenuList void keypressMenuBar (FKeyEvent*); bool hotkeyMenu (FKeyEvent*); std::size_t getHotkeyPos (wchar_t[], wchar_t[], std::size_t); - virtual void draw() override; + void draw() override; void drawItems(); void drawSeparator (int); void drawMenuLine (FMenuItem*, int); @@ -257,7 +257,7 @@ inline FMenuItem* FMenu::getItem() { return &item; } //---------------------------------------------------------------------- -inline bool FMenu::setEnable(bool enable) +inline bool FMenu::setEnable (bool enable) { return item.setEnable(enable); } //---------------------------------------------------------------------- diff --git a/src/include/final/fmenubar.h b/src/include/final/fmenubar.h index b78be7fb..5d245360 100644 --- a/src/include/final/fmenubar.h +++ b/src/include/final/fmenubar.h @@ -91,19 +91,19 @@ class FMenuBar : public FWindow, public FMenuList FMenuBar& operator = (const FMenuBar&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; // Methods void resetMenu(); - virtual void hide() override; - virtual void adjustSize() override; + void hide() override; + void adjustSize() override; // Event handlers - virtual void onKeyPress (FKeyEvent*) override; - virtual void onMouseDown (FMouseEvent*) override; - virtual void onMouseUp (FMouseEvent*) override; - virtual void onMouseMove (FMouseEvent*) override; - virtual void onAccel (FAccelEvent*) override; + void onKeyPress (FKeyEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onMouseUp (FMouseEvent*) override; + void onMouseMove (FMouseEvent*) override; + void onAccel (FAccelEvent*) override; // Callback methods void cb_item_deactivated (FWidget*, FDataPtr); @@ -132,7 +132,7 @@ class FMenuBar : public FWindow, public FMenuList bool selectPrevItem(); bool hotkeyMenu (FKeyEvent*&); std::size_t getHotkeyPos (wchar_t[], wchar_t[], std::size_t); - virtual void draw() override; + void draw() override; void drawItems(); void drawItem (FMenuItem*, std::size_t&); void setLineAttributes (FMenuItem*); diff --git a/src/include/final/fmenuitem.h b/src/include/final/fmenuitem.h index 281c4b51..75206fb6 100644 --- a/src/include/final/fmenuitem.h +++ b/src/include/final/fmenuitem.h @@ -96,17 +96,17 @@ class FMenuItem : public FWidget FMenuItem& operator = (const FMenuItem&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; uChar getHotkey() const; FMenu* getMenu() const; std::size_t getTextLength() const; FString getText() const; // Mutators - virtual bool setEnable (bool) override; - virtual bool setFocus (bool) override; - virtual bool setFocus() override; - virtual bool unsetFocus() override; + bool setEnable (bool) override; + bool setFocus (bool) override; + bool setFocus() override; + bool unsetFocus() override; void setSelected(); void unsetSelected(); void setSeparator(); @@ -124,19 +124,19 @@ class FMenuItem : public FWidget bool hasMenu() const; // Methods - virtual void addAccelerator (FKey, FWidget*) override; - virtual void delAccelerator (FWidget*) override; + void addAccelerator (FKey, FWidget*) override; + void delAccelerator (FWidget*) override; void openMenu(); // Event handlers - virtual void onKeyPress (FKeyEvent*) override; - virtual void onMouseDoubleClick (FMouseEvent*) override; - virtual void onMouseDown (FMouseEvent*) override; - virtual void onMouseUp (FMouseEvent*) override; - virtual void onMouseMove (FMouseEvent*) override; - virtual void onAccel (FAccelEvent*) override; - virtual void onFocusIn (FFocusEvent*) override; - virtual void onFocusOut (FFocusEvent*) override; + void onKeyPress (FKeyEvent*) override; + void onMouseDoubleClick (FMouseEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onMouseUp (FMouseEvent*) override; + void onMouseMove (FMouseEvent*) override; + void onAccel (FAccelEvent*) override; + void onFocusIn (FFocusEvent*) override; + void onFocusOut (FFocusEvent*) override; protected: // Accessor diff --git a/src/include/final/fmessagebox.h b/src/include/final/fmessagebox.h index f938b586..da8b0404 100644 --- a/src/include/final/fmessagebox.h +++ b/src/include/final/fmessagebox.h @@ -109,7 +109,7 @@ class FMessageBox : public FDialog FMessageBox& operator = (const FMessageBox&); // Accessor - virtual const char* getClassName() const override; + const char* getClassName() const override; const FString getTitlebarText() const; const FString getHeadline() const; const FString getText() const; @@ -139,7 +139,7 @@ class FMessageBox : public FDialog , int = 0 ); protected: // Method - virtual void adjustSize() override; + void adjustSize() override; // Callback method void cb_processClick (FWidget*, FDataPtr); @@ -151,7 +151,7 @@ class FMessageBox : public FDialog void deallocation(); void initCallbacks(); void calculateDimensions(); - virtual void draw() override; + void draw() override; void resizeButtons(); void adjustButtons(); diff --git a/src/include/final/fmouse.h b/src/include/final/fmouse.h index 14368b65..d54654ff 100644 --- a/src/include/final/fmouse.h +++ b/src/include/final/fmouse.h @@ -199,18 +199,18 @@ class FMouseGPM final : public FMouse virtual ~FMouseGPM(); // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; // Mutators void setStdinNo(int); // Inquiry - virtual bool hasData() override; + bool hasData() override; bool isGpmMouseEnabled(); // Methods - virtual void setRawData (FKeyboard::keybuffer&) override; - virtual void processEvent (struct timeval*) override; + void setRawData (FKeyboard::keybuffer&) override; + void processEvent (struct timeval*) override; bool gpmMouse (bool); bool enableGpmMouse(); bool disableGpmMouse(); @@ -271,14 +271,14 @@ class FMouseX11 final : public FMouse virtual ~FMouseX11() = default; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; // Inquiry - virtual bool hasData() override; + bool hasData() override; // Methods - virtual void setRawData (FKeyboard::keybuffer&) override; - virtual void processEvent (struct timeval*) override; + void setRawData (FKeyboard::keybuffer&) override; + void processEvent (struct timeval*) override; private: // Enumeration @@ -334,14 +334,14 @@ class FMouseSGR final : public FMouse virtual ~FMouseSGR() = default; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; // Inquiry - virtual bool hasData() override; + bool hasData() override; // Methods - virtual void setRawData (FKeyboard::keybuffer&) override; - virtual void processEvent (struct timeval*) override; + void setRawData (FKeyboard::keybuffer&) override; + void processEvent (struct timeval*) override; private: // Enumeration @@ -397,14 +397,14 @@ class FMouseUrxvt final : public FMouse virtual ~FMouseUrxvt() = default; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; // Inquiry - virtual bool hasData() override; + bool hasData() override; // Methods - virtual void setRawData (FKeyboard::keybuffer&) override; - virtual void processEvent (struct timeval*) override; + void setRawData (FKeyboard::keybuffer&) override; + void processEvent (struct timeval*) override; private: // Enumeration diff --git a/src/include/final/fprogressbar.h b/src/include/final/fprogressbar.h index cb9053f3..7391fba9 100644 --- a/src/include/final/fprogressbar.h +++ b/src/include/final/fprogressbar.h @@ -77,12 +77,12 @@ class FProgressbar : public FWidget virtual ~FProgressbar(); // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; std::size_t getPercentage(); // Mutators void setPercentage (std::size_t); - virtual void setGeometry ( const FPoint&, const FSize& + void setGeometry ( const FPoint&, const FSize& , bool = true ) override; bool setShadow (bool); bool setShadow(); @@ -92,7 +92,7 @@ class FProgressbar : public FWidget bool hasShadow(); // Methods - virtual void hide() override; + void hide() override; void reset(); private: @@ -100,7 +100,7 @@ class FProgressbar : public FWidget static constexpr std::size_t NOT_SET = static_cast(-1); // Methods - virtual void draw() override; + void draw() override; void drawProgressLabel(); void drawProgressBar(); std::size_t drawProgressIndicator(); diff --git a/src/include/final/fradiobutton.h b/src/include/final/fradiobutton.h index 42c67d99..473dfc63 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-2018 Markus Gans * +* Copyright 2014-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 * @@ -86,13 +86,13 @@ class FRadioButton : public FToggleButton FRadioButton& operator = (const FRadioButton&) = delete; // Accessor - virtual const char* getClassName() const override; + const char* getClassName() const override; private: // Methods - void init(); - virtual void draw() override; - void drawRadioButton(); + void init(); + void draw() override; + void drawRadioButton(); }; #pragma pack(pop) diff --git a/src/include/final/fradiomenuitem.h b/src/include/final/fradiomenuitem.h index 41d4dd65..78defafa 100644 --- a/src/include/final/fradiomenuitem.h +++ b/src/include/final/fradiomenuitem.h @@ -86,13 +86,13 @@ class FRadioMenuItem : public FMenuItem FRadioMenuItem& operator = (const FRadioMenuItem&) = delete; // Accessor - virtual const char* getClassName() const override; + const char* getClassName() const override; private: // Methods - void init (FWidget*); - void processToggle(); - virtual void processClicked() override; + void init (FWidget*); + void processToggle(); + void processClicked() override; }; #pragma pack(pop) diff --git a/src/include/final/fscrollbar.h b/src/include/final/fscrollbar.h index 02562296..33a2006a 100644 --- a/src/include/final/fscrollbar.h +++ b/src/include/final/fscrollbar.h @@ -97,7 +97,7 @@ class FScrollbar : public FWidget FScrollbar& operator = (const FScrollbar&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; int getValue() const; sType getScrollType() const; @@ -109,28 +109,28 @@ class FScrollbar : public FWidget void setSteps (double); void setPageSize (int, int); void setOrientation (fc::orientation); - virtual void setGeometry ( const FPoint&, const FSize& + void setGeometry ( const FPoint&, const FSize& , bool = true ) override; // Methods - virtual void resize() override; - virtual void redraw() override; + void resize() override; + void redraw() override; void calculateSliderValues(); void drawVerticalBar(); void drawHorizontalBar(); void drawBar(); // Event handlers - virtual void onMouseDown (FMouseEvent*) override; - virtual void onMouseUp (FMouseEvent*) override; - virtual void onMouseMove (FMouseEvent*) override; - virtual void onWheel (FWheelEvent*) override; - virtual void onTimer (FTimerEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onMouseUp (FMouseEvent*) override; + void onMouseMove (FMouseEvent*) override; + void onWheel (FWheelEvent*) override; + void onTimer (FTimerEvent*) override; private: // Methods void init(); - virtual void draw() override; + void draw() override; void drawButtons(); sType getClickedScrollType (int, int); sType getVerticalClickedScrollType (int); diff --git a/src/include/final/fscrollview.h b/src/include/final/fscrollview.h index cdb4bac8..0e16b76d 100644 --- a/src/include/final/fscrollview.h +++ b/src/include/final/fscrollview.h @@ -87,7 +87,7 @@ class FScrollView : public FWidget FScrollView& operator = (const FScrollView&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; std::size_t getViewportWidth() const; std::size_t getViewportHeight() const; const FSize getViewportSize(); @@ -102,13 +102,13 @@ class FScrollView : public FWidget virtual void setScrollWidth (std::size_t); virtual void setScrollHeight (std::size_t); virtual void setScrollSize (const FSize&); - virtual void setX (int, bool = true) override; - virtual void setY (int, bool = true) override; - virtual void setPos (const FPoint&, bool = true) override; - virtual void setWidth (std::size_t, bool = true) override; - virtual void setHeight (std::size_t, bool = true) override; - virtual void setSize (const FSize&, bool = true) override; - virtual void setGeometry ( const FPoint&, const FSize& + void setX (int, bool = true) override; + void setY (int, bool = true) override; + void setPos (const FPoint&, bool = true) override; + void setWidth (std::size_t, bool = true) override; + void setHeight (std::size_t, bool = true) override; + void setSize (const FSize&, bool = true) override; + void setGeometry ( const FPoint&, const FSize& , bool = true ) override; void setCursorPos (const FPoint&); void setPrintPos (const FPoint&); @@ -126,30 +126,30 @@ class FScrollView : public FWidget bool isViewportPrint(); // Method - virtual void clearArea (int = ' ') override; + void clearArea (int = ' ') override; void scrollToX (int); void scrollToY (int); void scrollTo (const FPoint&); void scrollTo (int, int); void scrollBy (int, int); - virtual void draw() override; + void draw() override; // Event handlers - virtual void onKeyPress (FKeyEvent*) override; - virtual void onWheel (FWheelEvent*) override; - virtual void onFocusIn (FFocusEvent*) override; - virtual void onChildFocusIn (FFocusEvent*) override; - virtual void onChildFocusOut (FFocusEvent*) override; + void onKeyPress (FKeyEvent*) override; + void onWheel (FWheelEvent*) override; + void onFocusIn (FFocusEvent*) override; + void onChildFocusIn (FFocusEvent*) override; + void onChildFocusOut (FFocusEvent*) override; protected: // Using-declaration using FVTerm::clearArea; // Accessor - virtual term_area* getPrintArea() override; + term_area* getPrintArea() override; // Method - virtual void adjustSize() override; + void adjustSize() override; void copy2area(); private: diff --git a/src/include/final/fsize.h b/src/include/final/fsize.h index 2aaa09ee..399fa02c 100644 --- a/src/include/final/fsize.h +++ b/src/include/final/fsize.h @@ -35,6 +35,7 @@ #error "Only can be included directly." #endif +#include #include #include "final/ftypes.h" diff --git a/src/include/final/fstatusbar.h b/src/include/final/fstatusbar.h index 925018a4..84d4614e 100644 --- a/src/include/final/fstatusbar.h +++ b/src/include/final/fstatusbar.h @@ -94,7 +94,7 @@ class FStatusKey : public FWidget FStatusKey& operator = (const FStatusKey&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; virtual FKey getKey() const; virtual FString getText() const; @@ -112,7 +112,7 @@ class FStatusKey : public FWidget bool hasMouseFocus() const; // Event handler - virtual void onAccel (FAccelEvent*) override; + void onAccel (FAccelEvent*) override; private: // Methods @@ -207,7 +207,7 @@ class FStatusBar : public FWindow FStatusBar& operator = (const FStatusBar&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; FStatusKey* getStatusKey (int) const; FString getMessage() const; std::size_t getCount() const; @@ -222,19 +222,19 @@ class FStatusBar : public FWindow bool hasActivatedKey(); // Methods - virtual void hide() override; + void hide() override; void drawMessage(); void clearMessage(); void insert (FStatusKey*); void remove (FStatusKey*); void remove (int); void clear(); - virtual void adjustSize() override; + void adjustSize() override; // Event handlers - virtual void onMouseDown (FMouseEvent*) override; - virtual void onMouseUp (FMouseEvent*) override; - virtual void onMouseMove (FMouseEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onMouseUp (FMouseEvent*) override; + void onMouseMove (FMouseEvent*) override; // Callback method void cb_statuskey_activated (FWidget*, FDataPtr); @@ -245,7 +245,7 @@ class FStatusBar : public FWindow // Methods void init(); - virtual void draw() override; + void draw() override; void drawKeys(); void drawKey (keyList::const_iterator); void drawActiveKey (keyList::const_iterator); diff --git a/src/include/final/fswitch.h b/src/include/final/fswitch.h index ca491901..d8a859ee 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-2018 Markus Gans * +* 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 * @@ -86,19 +86,19 @@ class FSwitch : public FToggleButton FSwitch& operator = (const FSwitch&) = delete; // Accessor - virtual const char* getClassName() const override; + const char* getClassName() const override; // Mutator - virtual void setText (const FString&) override; + void setText (const FString&) override; // Event handlers - virtual void onKeyPress (FKeyEvent*) override; - virtual void onMouseDown (FMouseEvent*) override; - virtual void onMouseUp (FMouseEvent*) override; + void onKeyPress (FKeyEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onMouseUp (FMouseEvent*) override; private: // Methods - virtual void draw() override; + void draw() override; void drawCheckButton(); void drawChecked(); void drawUnchecked(); diff --git a/src/include/final/fsystemimpl.h b/src/include/final/fsystemimpl.h index d00083d4..ec9a0a55 100644 --- a/src/include/final/fsystemimpl.h +++ b/src/include/final/fsystemimpl.h @@ -94,18 +94,18 @@ class FSystemImpl : public FSystem // Methods #if defined(__linux__) #if defined(__x86_64__) || defined(__i386) || defined(__arm__) - virtual uChar inPortByte (uShort port) override + uChar inPortByte (uShort port) override { return ::inb (port); } #else - virtual uChar inPortByte (uShort) override + uChar inPortByte (uShort) override { return 0; } #endif #else - virtual uChar inPortByte (uShort) override + uChar inPortByte (uShort) override { return 0; } @@ -114,26 +114,26 @@ class FSystemImpl : public FSystem #if defined(__linux__) #if defined(__x86_64__) || defined(__i386) || defined(__arm__) - virtual void outPortByte (uChar value, uShort port) override + void outPortByte (uChar value, uShort port) override { ::outb (value, port); } #else - virtual void outPortByte (uChar, uShort) override + void outPortByte (uChar, uShort) override { } #endif #else - virtual void outPortByte (uChar, uShort) override + void outPortByte (uChar, uShort) override { } #endif - virtual int isTTY (int fd) override + int isTTY (int fd) override { return ::isatty(fd); } - virtual int ioctl (int fd, uLong request, ...) override + int ioctl (int fd, uLong request, ...) override { va_list args; va_start (args, request); @@ -143,7 +143,7 @@ class FSystemImpl : public FSystem return ret; } - virtual int open (const char* pathname, int flags, ...) override + int open (const char* pathname, int flags, ...) override { va_list args; va_start (args, flags); @@ -153,22 +153,22 @@ class FSystemImpl : public FSystem return ret; } - virtual int close (int fildes) override + int close (int fildes) override { return ::close(fildes); } - virtual FILE* fopen (const char* path, const char* mode) override + FILE* fopen (const char* path, const char* mode) override { return std::fopen (path, mode); } - virtual int fclose (FILE* fp) override + int fclose (FILE* fp) override { return std::fclose (fp); } - virtual int putchar (int c) override + int putchar (int c) override { #if defined(__sun) && defined(__SVR4) return std::putchar(char(c)); @@ -177,7 +177,7 @@ class FSystemImpl : public FSystem #endif } - virtual int tputs (const char* str, int affcnt, int (*putc)(int)) override + int tputs (const char* str, int affcnt, int (*putc)(int)) override { #if defined(__sun) && defined(__SVR4) return ::tputs (C_STR(str), affcnt, reinterpret_cast(putc)); @@ -186,7 +186,7 @@ class FSystemImpl : public FSystem #endif } - virtual uid_t getuid() override + uid_t getuid() override { return ::getuid(); } diff --git a/src/include/final/ftermlinux.h b/src/include/final/ftermlinux.h index 463c8f8f..1021fd3e 100644 --- a/src/include/final/ftermlinux.h +++ b/src/include/final/ftermlinux.h @@ -50,6 +50,7 @@ #include // need for sprintf #include +#include #include "final/ftermdata.h" diff --git a/src/include/final/ftextview.h b/src/include/final/ftextview.h index f54309e8..1b276317 100644 --- a/src/include/final/ftextview.h +++ b/src/include/final/ftextview.h @@ -89,14 +89,14 @@ class FTextView : public FWidget FTextView& operator = (const FTextView&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; std::size_t getColumns() const; std::size_t getRows() const; const FString getText() const; const FStringList& getLines() const; // Mutators - virtual void setGeometry ( const FPoint&, const FSize& + void setGeometry ( const FPoint&, const FSize& , bool = true ) override; void setText (const FString&); void scrollToX (int); @@ -106,7 +106,7 @@ class FTextView : public FWidget void scrollBy (int, int); // Methods - virtual void hide() override; + void hide() override; template void append (const std::initializer_list&); void append (const FString&); @@ -119,17 +119,17 @@ class FTextView : public FWidget void clear(); // Event handlers - virtual void onKeyPress (FKeyEvent*) override; - virtual void onMouseDown (FMouseEvent*) override; - virtual void onMouseUp (FMouseEvent*) override; - virtual void onMouseMove (FMouseEvent*) override; - virtual void onWheel (FWheelEvent*) override; - virtual void onFocusIn (FFocusEvent*) override; - virtual void onFocusOut (FFocusEvent*) override; + void onKeyPress (FKeyEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onMouseUp (FMouseEvent*) override; + void onMouseMove (FMouseEvent*) override; + void onWheel (FWheelEvent*) override; + void onFocusIn (FFocusEvent*) override; + void onFocusOut (FFocusEvent*) override; protected: // Method - virtual void adjustSize() override; + void adjustSize() override; private: // Typedef @@ -149,7 +149,7 @@ class FTextView : public FWidget void initScrollbar ( FScrollbarPtr& , fc::orientation , FTextViewCallback ); - virtual void draw() override; + void draw() override; void drawText(); void processChanged(); diff --git a/src/include/final/ftogglebutton.h b/src/include/final/ftogglebutton.h index e4395ebb..ca447281 100644 --- a/src/include/final/ftogglebutton.h +++ b/src/include/final/ftogglebutton.h @@ -87,22 +87,22 @@ class FToggleButton : public FWidget FToggleButton& operator = (const FToggleButton&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; FString& getText(); // Mutators - virtual void setGeometry ( const FPoint&, const FSize& + void setGeometry ( const FPoint&, const FSize& , bool = true ) override; bool setNoUnderline (bool); bool setNoUnderline(); bool unsetNoUnderline(); - virtual bool setEnable (bool) override; - virtual bool setEnable() override; - virtual bool unsetEnable() override; - virtual bool setDisable() override; - virtual bool setFocus (bool) override; - virtual bool setFocus() override; - virtual bool unsetFocus() override; + bool setEnable (bool) override; + bool setEnable() override; + bool unsetEnable() override; + bool setDisable() override; + bool setFocus (bool) override; + bool setFocus() override; + bool unsetFocus() override; bool setChecked (bool); bool setChecked(); bool unsetChecked(); @@ -112,15 +112,15 @@ class FToggleButton : public FWidget bool isChecked(); // Methods - virtual void hide() override; + void hide() override; // Event handlers - virtual void onMouseDown (FMouseEvent*) override; - virtual void onMouseUp (FMouseEvent*) override; - virtual void onWheel (FWheelEvent*) override; - virtual void onAccel (FAccelEvent*) override; - virtual void onFocusIn (FFocusEvent*) override; - virtual void onFocusOut (FFocusEvent*) override; + void onMouseDown (FMouseEvent*) override; + void onMouseUp (FMouseEvent*) override; + void onWheel (FWheelEvent*) override; + void onAccel (FAccelEvent*) override; + void onFocusIn (FFocusEvent*) override; + void onFocusOut (FFocusEvent*) override; protected: // Accessor @@ -135,13 +135,13 @@ class FToggleButton : public FWidget bool hasGroup() const; // Methods - virtual void draw() override; + void draw() override; void drawLabel(); void processClick(); void processToggle(); // Event handler - virtual void onKeyPress (FKeyEvent*) override; + void onKeyPress (FKeyEvent*) override; // Data Members bool checked{false}; diff --git a/src/include/final/ftooltip.h b/src/include/final/ftooltip.h index 957095f2..2c807aed 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-2018 Markus Gans * +* Copyright 2016-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 * @@ -88,25 +88,25 @@ class FToolTip : public FWindow FToolTip& operator = (const FToolTip&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; const FString getText() const; // Mutators void setText (const FString&); // Methods - virtual void draw() override; - virtual void show() override; - virtual void hide() override; + void draw() override; + void show() override; + void hide() override; // Event handler - virtual void onMouseDown (FMouseEvent*) override; + void onMouseDown (FMouseEvent*) override; private: // Methods void init(); void calculateDimensions(); - virtual void adjustSize() override; + void adjustSize() override; // Data Members FString text{}; diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index 7f0a6206..9372a286 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -186,7 +186,7 @@ class FWidget : public FVTerm, public FObject FWidget& operator = (const FWidget&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; FWidget* getRootWidget() const; FWidget* getParentWidget() const; static FWidget*& getMainWidget(); @@ -333,7 +333,7 @@ class FWidget : public FVTerm, public FObject virtual bool focusLastChild(); FPoint termToWidgetPos (const FPoint&); void detectTermSize(); - virtual void print (const FPoint& p) override; + void print (const FPoint& p) override; virtual void move (const FPoint&); void drawShadow(); void clearShadow(); @@ -368,10 +368,10 @@ class FWidget : public FVTerm, public FObject typedef std::vector MemberCallbackObjects; // Accessor - virtual term_area* getPrintArea() override; - virtual void addPreprocessingHandler ( FVTerm* + term_area* getPrintArea() override; + void addPreprocessingHandler ( FVTerm* , FPreprocessingHandler ) override; - virtual void delPreprocessingHandler (FVTerm*) override; + void delPreprocessingHandler (FVTerm*) override; // Inquiry bool isChildPrintArea() const; @@ -388,7 +388,7 @@ class FWidget : public FVTerm, public FObject virtual bool focusPrevChild(); // ...focus // Event handlers - virtual bool event (FEvent*) override; + bool event (FEvent*) override; virtual void onKeyPress (FKeyEvent*); virtual void onKeyUp (FKeyEvent*); virtual void onKeyDown (FKeyEvent*); diff --git a/src/include/final/fwindow.h b/src/include/final/fwindow.h index 6f61d9c8..2cf9a10d 100644 --- a/src/include/final/fwindow.h +++ b/src/include/final/fwindow.h @@ -92,7 +92,7 @@ class FWindow : public FWidget FWindow& operator = (const FWindow&) = delete; // Accessors - virtual const char* getClassName() const override; + const char* getClassName() const override; static FWindow* getWindowWidget (const FWidget*); static int getWindowLayer (const FWidget*); FWidget* getWindowFocusWidget() const; @@ -130,18 +130,18 @@ class FWindow : public FWidget bool hasShadow() const; // Methods - virtual void drawBorder() override; - virtual void show() override; - virtual void hide() override; - virtual void setX (int, bool = true) override; - virtual void setY (int, bool = true) override; - virtual void setPos (const FPoint&, bool = true) override; - virtual void setWidth (std::size_t, bool = true) override; - virtual void setHeight (std::size_t, bool = true) override; - virtual void setSize (const FSize&, bool = true) override; - virtual void setGeometry ( const FPoint&, const FSize& + void drawBorder() override; + void show() override; + void hide() override; + void setX (int, bool = true) override; + void setY (int, bool = true) override; + void setPos (const FPoint&, bool = true) override; + void setWidth (std::size_t, bool = true) override; + void setHeight (std::size_t, bool = true) override; + void setSize (const FSize&, bool = true) override; + void setGeometry ( const FPoint&, const FSize& , bool = true ) override; - virtual void move (const FPoint&) override; + void move (const FPoint&) override; static FWindow* getWindowWidgetAt (const FPoint&); static FWindow* getWindowWidgetAt (int, int); static void addWindow (FWidget*); @@ -154,17 +154,17 @@ class FWindow : public FWidget bool zoomWindow (); static void switchToPrevWindow (FWidget*); static bool activatePrevWindow(); - virtual void setShadowSize (const FSize&) override; + void setShadowSize (const FSize&) override; protected: // Method - virtual void adjustSize() override; + void adjustSize() override; // Mutator static void setPreviousWindow (FWindow*); // Event handlers - virtual bool event (FEvent*) override; + bool event (FEvent*) override; virtual void onWindowActive (FEvent*); virtual void onWindowInactive (FEvent*); virtual void onWindowRaised (FEvent*); @@ -176,12 +176,11 @@ class FWindow : public FWidget static void processAlwaysOnTop(); // Data Members - bool window_active{false}; - bool zoomed{false}; - FWidget* win_focus_widget{nullptr}; - FRect normalGeometry{}; - static FWindow* previous_window; - + bool window_active{false}; + bool zoomed{false}; + FWidget* win_focus_widget{nullptr}; + FRect normalGeometry{}; + static FWindow* previous_window; }; #pragma pack(pop) diff --git a/test/Makefile.clang b/test/Makefile.clang index d95b64f9..9361b340 100644 --- a/test/Makefile.clang +++ b/test/Makefile.clang @@ -29,7 +29,7 @@ endif all: $(OBJS) debug: - $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -Wall -Wextra -Wpedantic -Wpadded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough" + $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -DUNIT_TEST -Wall -Wextra -Wpedantic -Wpadded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough" check: test test: debug diff --git a/test/Makefile.gcc b/test/Makefile.gcc index d650dc5d..1f26b58a 100644 --- a/test/Makefile.gcc +++ b/test/Makefile.gcc @@ -29,7 +29,7 @@ endif all: $(OBJS) debug: - $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -Wall -Wextra -Wpedantic" + $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -DUNIT_TEST -Wall -Wextra -Wpedantic" check: test test: debug diff --git a/test/fkeyboard-test.cpp b/test/fkeyboard-test.cpp index 7308196e..ac27be63 100644 --- a/test/fkeyboard-test.cpp +++ b/test/fkeyboard-test.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2018 Markus Gans * +* 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 * @@ -28,6 +28,7 @@ #include #include +#include #include namespace test diff --git a/test/foptiattr-test.cpp b/test/foptiattr-test.cpp index fac9dd71..88451dde 100644 --- a/test/foptiattr-test.cpp +++ b/test/foptiattr-test.cpp @@ -32,6 +32,7 @@ #include #include +#include #include diff --git a/test/foptimove-test.cpp b/test/foptimove-test.cpp index c1fe9f3d..14a8e57b 100644 --- a/test/foptimove-test.cpp +++ b/test/foptimove-test.cpp @@ -3,7 +3,7 @@ * * * This file is part of the Final Cut widget toolkit * * * -* Copyright 2018 Markus Gans * +* 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 * @@ -32,6 +32,7 @@ #include #include +#include #include diff --git a/test/fpoint-test.cpp b/test/fpoint-test.cpp index d315bf63..15171f4f 100644 --- a/test/fpoint-test.cpp +++ b/test/fpoint-test.cpp @@ -21,6 +21,7 @@ ***********************************************************************/ #include +#include #include #include @@ -106,7 +107,7 @@ void FPointTest::noArgumentTest() //---------------------------------------------------------------------- void FPointTest::copyConstructorTest() { - const finalcut::FPoint p1 (15,10); + const finalcut::FPoint p1 (15, 10); const finalcut::FPoint p2 (p1); CPPUNIT_ASSERT ( p2.getX() == 15 ); CPPUNIT_ASSERT ( p2.getY() == 10 ); @@ -115,7 +116,7 @@ void FPointTest::copyConstructorTest() //---------------------------------------------------------------------- void FPointTest::moveConstructorTest() { - finalcut::FPoint p1 (25,16); + finalcut::FPoint p1 (25, 16); const finalcut::FPoint p2 (std::move(p1)); CPPUNIT_ASSERT ( p1.getX() == 0 ); CPPUNIT_ASSERT ( p1.getY() == 0 ); @@ -126,7 +127,7 @@ void FPointTest::moveConstructorTest() //---------------------------------------------------------------------- void FPointTest::assignmentTest() { - const finalcut::FPoint p1 (-99,100); + const finalcut::FPoint p1 (-99, 100); CPPUNIT_ASSERT ( p1.getX() == -99 ); CPPUNIT_ASSERT ( p1.getY() == 100 ); @@ -169,12 +170,12 @@ void FPointTest::assignmentTest() //---------------------------------------------------------------------- void FPointTest::additionAssignmentTest() { - finalcut::FPoint p1 (1,2); - p1 += finalcut::FPoint (3,1); + finalcut::FPoint p1 (1, 2); + p1 += finalcut::FPoint (3, 1); CPPUNIT_ASSERT ( p1.getX() == 4 ); CPPUNIT_ASSERT ( p1.getY() == 3 ); - p1 += finalcut::FPoint (-4,-3); + p1 += finalcut::FPoint (-4, -3); CPPUNIT_ASSERT ( p1.getX() == 0 ); CPPUNIT_ASSERT ( p1.getY() == 0 ); CPPUNIT_ASSERT ( p1.isOrigin() ); @@ -194,37 +195,37 @@ void FPointTest::additionAssignmentTest() //---------------------------------------------------------------------- void FPointTest::subtractionAssignmentTest() { - finalcut::FPoint p1 (10,20); - p1 -= finalcut::FPoint (5,5); + finalcut::FPoint p1 (10, 20); + p1 -= finalcut::FPoint (5, 5); CPPUNIT_ASSERT ( p1.getX() == 5 ); CPPUNIT_ASSERT ( p1.getY() == 15 ); - p1 -= finalcut::FPoint (-5,20); + p1 -= finalcut::FPoint (-5, 20); CPPUNIT_ASSERT ( p1.getX() == 10 ); CPPUNIT_ASSERT ( p1.getY() == -5 ); CPPUNIT_ASSERT ( ! p1.isOrigin() ); - p1 -= finalcut::FPoint (-10,0); + p1 -= finalcut::FPoint (-10, 0); CPPUNIT_ASSERT ( p1.getX() == 20 ); CPPUNIT_ASSERT ( p1.getY() == -5 ); CPPUNIT_ASSERT ( ! p1.isOrigin() ); - p1 -= finalcut::FPoint (20,0); + p1 -= finalcut::FPoint (20, 0); CPPUNIT_ASSERT ( p1.getX() == 0 ); CPPUNIT_ASSERT ( p1.getY() == -5 ); CPPUNIT_ASSERT ( ! p1.isOrigin() ); - p1 -= finalcut::FPoint (0,-6); + p1 -= finalcut::FPoint (0, -6); CPPUNIT_ASSERT ( p1.getX() == 0 ); CPPUNIT_ASSERT ( p1.getY() == 1 ); CPPUNIT_ASSERT ( ! p1.isOrigin() ); - p1 -= finalcut::FPoint (1,0); + p1 -= finalcut::FPoint (1, 0); CPPUNIT_ASSERT ( p1.getX() == -1 ); CPPUNIT_ASSERT ( p1.getY() == 1 ); CPPUNIT_ASSERT ( ! p1.isOrigin() ); - p1 -= (finalcut::FPoint (0,1) + finalcut::FPoint (-1,0)); + p1 -= (finalcut::FPoint (0, 1) + finalcut::FPoint (-1, 0)); CPPUNIT_ASSERT ( p1.getX() == 0 ); CPPUNIT_ASSERT ( p1.getY() == 0 ); CPPUNIT_ASSERT ( p1.isOrigin() ); @@ -243,11 +244,11 @@ void FPointTest::subtractionAssignmentTest() //---------------------------------------------------------------------- void FPointTest::equalTest() { - const finalcut::FPoint p1 (1,2); - const finalcut::FPoint p2 (1,2); + const finalcut::FPoint p1 (1, 2); + const finalcut::FPoint p2 (1, 2); CPPUNIT_ASSERT ( p1 == p2 ); - CPPUNIT_ASSERT ( finalcut::FPoint(1,2) == p2 ); - CPPUNIT_ASSERT ( p1 == finalcut::FPoint(1,2) ); + CPPUNIT_ASSERT ( finalcut::FPoint(1, 2) == p2 ); + CPPUNIT_ASSERT ( p1 == finalcut::FPoint(1, 2) ); const finalcut::FPoint p3{}; const finalcut::FPoint p4{}; CPPUNIT_ASSERT ( p3 == p4 ); @@ -257,11 +258,11 @@ void FPointTest::equalTest() //---------------------------------------------------------------------- void FPointTest::notEqualTest() { - const finalcut::FPoint p1 (1,2); - const finalcut::FPoint p2 (2,4); + const finalcut::FPoint p1 (1, 2); + const finalcut::FPoint p2 (2, 4); CPPUNIT_ASSERT ( p1 != p2 ); - CPPUNIT_ASSERT ( finalcut::FPoint(1,2) != p2 ); - CPPUNIT_ASSERT ( p1 != finalcut::FPoint(2,4) ); + CPPUNIT_ASSERT ( finalcut::FPoint(1, 2) != p2 ); + CPPUNIT_ASSERT ( p1 != finalcut::FPoint(2, 4) ); CPPUNIT_ASSERT ( finalcut::FPoint() != p2 ); CPPUNIT_ASSERT ( p1 != finalcut::FPoint() ); } @@ -269,12 +270,12 @@ void FPointTest::notEqualTest() //---------------------------------------------------------------------- void FPointTest::additionTest() { - const finalcut::FPoint p1 (1,2); - const finalcut::FPoint p2 (5,8); + const finalcut::FPoint p1 (1, 2); + const finalcut::FPoint p2 (5, 8); const finalcut::FPoint p3 = p1 + p2; CPPUNIT_ASSERT ( p3.getX() == 6 ); CPPUNIT_ASSERT ( p3.getY() == 10 ); - CPPUNIT_ASSERT ( p1 + p2 == finalcut::FPoint(6,10) ); + CPPUNIT_ASSERT ( p1 + p2 == finalcut::FPoint(6, 10) ); CPPUNIT_ASSERT ( p1 + finalcut::FPoint() == p1 ); CPPUNIT_ASSERT ( finalcut::FPoint() + p2 == p2 ); CPPUNIT_ASSERT ( finalcut::FPoint() + finalcut::FPoint() == finalcut::FPoint() ); @@ -283,12 +284,12 @@ void FPointTest::additionTest() //---------------------------------------------------------------------- void FPointTest::subtractionTest() { - const finalcut::FPoint p1 (-5,-20); - const finalcut::FPoint p2 (0,-30); + const finalcut::FPoint p1 (-5, -20); + const finalcut::FPoint p2 (0, -30); const finalcut::FPoint p3 = p1 - p2; CPPUNIT_ASSERT ( p3.getX() == -5 ); CPPUNIT_ASSERT ( p3.getY() == 10 ); - CPPUNIT_ASSERT ( p1 - p2 == finalcut::FPoint(-5,10) ); + CPPUNIT_ASSERT ( p1 - p2 == finalcut::FPoint(-5, 10) ); CPPUNIT_ASSERT ( p1 - finalcut::FPoint() == p1 ); CPPUNIT_ASSERT ( finalcut::FPoint() - finalcut::FPoint() == finalcut::FPoint() ); } @@ -296,7 +297,7 @@ void FPointTest::subtractionTest() //---------------------------------------------------------------------- void FPointTest::referenceTest() { - finalcut::FPoint p1 (1,1); + finalcut::FPoint p1 (1, 1); CPPUNIT_ASSERT ( p1.getX() == 1 ); CPPUNIT_ASSERT ( p1.getY() == 1 ); diff --git a/test/frect-test.cpp b/test/frect-test.cpp index 1fa309e4..6d31b126 100644 --- a/test/frect-test.cpp +++ b/test/frect-test.cpp @@ -28,6 +28,7 @@ #include #include +#include #include //---------------------------------------------------------------------- diff --git a/test/fsize-test.cpp b/test/fsize-test.cpp index 1c4c949c..c08acc37 100644 --- a/test/fsize-test.cpp +++ b/test/fsize-test.cpp @@ -21,6 +21,7 @@ ***********************************************************************/ #include +#include #include #include @@ -133,7 +134,7 @@ void FSizeTest::moveConstructorTest() //---------------------------------------------------------------------- void FSizeTest::assignmentTest() { - const finalcut::FSize s1 (0,100); + const finalcut::FSize s1 (0, 100); CPPUNIT_ASSERT ( s1.getWidth() == 0 ); CPPUNIT_ASSERT ( s1.getHeight() == 100 ); @@ -178,8 +179,8 @@ void FSizeTest::assignmentTest() //---------------------------------------------------------------------- void FSizeTest::additionAssignmentTest() { - finalcut::FSize s1 (1,2); - s1 += finalcut::FSize{3,1}; + finalcut::FSize s1 (1, 2); + s1 += finalcut::FSize{3, 1}; CPPUNIT_ASSERT ( s1.getWidth() == 4 ); CPPUNIT_ASSERT ( s1.getHeight() == 3 ); @@ -256,11 +257,11 @@ void FSizeTest::subtractionAssignmentTest() //---------------------------------------------------------------------- void FSizeTest::equalTest() { - const finalcut::FSize s1 (1,2); - const finalcut::FSize s2 (1,2); + const finalcut::FSize s1 (1, 2); + const finalcut::FSize s2 (1, 2); CPPUNIT_ASSERT ( s1 == s2 ); - CPPUNIT_ASSERT ( finalcut::FSize(1,2) == s2 ); - CPPUNIT_ASSERT ( s1 == finalcut::FSize(1,2) ); + CPPUNIT_ASSERT ( finalcut::FSize(1, 2) == s2 ); + CPPUNIT_ASSERT ( s1 == finalcut::FSize(1, 2) ); const finalcut::FSize s3{}; const finalcut::FSize s4{}; CPPUNIT_ASSERT ( s3 == s4 ); @@ -269,11 +270,11 @@ void FSizeTest::equalTest() //---------------------------------------------------------------------- void FSizeTest::notEqualTest() { - const finalcut::FSize s1 (3,5); - const finalcut::FSize s2 (2,4); + const finalcut::FSize s1 (3, 5); + const finalcut::FSize s2 (2, 4); CPPUNIT_ASSERT ( s1 != s2 ); - CPPUNIT_ASSERT ( finalcut::FSize(1,2) != s2 ); - CPPUNIT_ASSERT ( s1 != finalcut::FSize(2,4) ); + CPPUNIT_ASSERT ( finalcut::FSize(1, 2) != s2 ); + CPPUNIT_ASSERT ( s1 != finalcut::FSize(2, 4) ); CPPUNIT_ASSERT ( finalcut::FSize() != s2 ); CPPUNIT_ASSERT ( s1 != finalcut::FSize() ); } @@ -313,12 +314,12 @@ void FSizeTest::LessTest() //---------------------------------------------------------------------- void FSizeTest::additionTest() { - const finalcut::FSize s1 (1 ,2); - const finalcut::FSize s2 (5 ,8); + const finalcut::FSize s1 (1, 2); + const finalcut::FSize s2 (5, 8); const finalcut::FSize s3 = s1 + s2; CPPUNIT_ASSERT ( s3.getWidth() == 6 ); CPPUNIT_ASSERT ( s3.getHeight() == 10 ); - CPPUNIT_ASSERT ( s1 + s2 == finalcut::FSize(6 ,10) ); + CPPUNIT_ASSERT ( s1 + s2 == finalcut::FSize(6, 10) ); CPPUNIT_ASSERT ( s1 + finalcut::FSize() == s1 ); CPPUNIT_ASSERT ( finalcut::FSize() + s2 == s2 ); CPPUNIT_ASSERT ( finalcut::FSize() + finalcut::FSize() == finalcut::FSize() ); @@ -355,7 +356,7 @@ void FSizeTest::areaTest() //---------------------------------------------------------------------- void FSizeTest::referenceTest() { - finalcut::FSize s1 (1,1); + finalcut::FSize s1 (1, 1); CPPUNIT_ASSERT ( s1.getWidth() == 1 ); CPPUNIT_ASSERT ( s1.getHeight() == 1 ); diff --git a/test/ftermcapquirks-test.cpp b/test/ftermcapquirks-test.cpp index 614439ff..37d2d699 100644 --- a/test/ftermcapquirks-test.cpp +++ b/test/ftermcapquirks-test.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #define CPPUNIT_ASSERT_CSTRING(expected, actual) \ diff --git a/test/ftermfreebsd-test.cpp b/test/ftermfreebsd-test.cpp index ea9adcff..bfd6dfce 100644 --- a/test/ftermfreebsd-test.cpp +++ b/test/ftermfreebsd-test.cpp @@ -20,8 +20,6 @@ * . * ***********************************************************************/ -#include - #include #include #include @@ -31,7 +29,10 @@ #include #include -#include +#include +#include + +#include "conemu.h" #include namespace test @@ -54,17 +55,17 @@ class FSystemTest : public finalcut::FSystem virtual ~FSystemTest(); // Methods - virtual uChar inPortByte (uShort) override; - virtual void outPortByte (uChar, uShort) override; - virtual int isTTY (int) override; - virtual int ioctl (int, uLong, ...) override; - virtual int open (const char*, int, ...) override; - virtual int close (int) override; - virtual FILE* fopen (const char*, const char*) override; - virtual int fclose (FILE*) override; - virtual int putchar (int) override; - virtual int tputs (const char*, int, int (*)(int)) override; - virtual uid_t getuid() override; + uChar inPortByte (uShort) override; + void outPortByte (uChar, uShort) override; + int isTTY (int) override; + int ioctl (int, uLong, ...) override; + int open (const char*, int, ...) override; + int close (int) override; + FILE* fopen (const char*, const char*) override; + int fclose (FILE*) override; + int putchar (int) override; + int tputs (const char*, int, int (*)(int)) override; + uid_t getuid() override; std::string& getCharacters(); int& getCursorType(); struct keymap_t& getTerminalKeymap(); @@ -73,16 +74,16 @@ class FSystemTest : public finalcut::FSystem // Data Members std::string characters; int cursor_type = 0; - static struct keymap_t keymap; - static struct keymap_t terminal_keymap; + static keymap_t keymap; + static keymap_t terminal_keymap; }; #pragma pack(pop) // private Data Member of FSystemTest //---------------------------------------------------------------------- -struct keymap_t FSystemTest::keymap = +keymap_t FSystemTest::keymap = { - 109, // Number of keys + 109, // Number of keys { // map spcl flag //------------------------------------------------ ---- ---- @@ -363,7 +364,7 @@ struct keymap_t FSystemTest::keymap = // static class attributes //---------------------------------------------------------------------- -struct keymap_t FSystemTest::terminal_keymap{}; +keymap_t FSystemTest::terminal_keymap{}; // constructors and destructor //---------------------------------------------------------------------- @@ -587,14 +588,12 @@ class ftermfreebsdTest : public CPPUNIT_NS::TestFixture, test::ConEmu //---------------------------------------------------------------------- ftermfreebsdTest::ftermfreebsdTest() -{ - -} +{ } //---------------------------------------------------------------------- void ftermfreebsdTest::classNameTest() { - const finalcut::FTermFreeBSD p; + const finalcut::FTermFreeBSD p{}; const char* const classname = p.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname, "FTermFreeBSD") == 0 ); } @@ -750,15 +749,15 @@ void ftermfreebsdTest::freebsdConsoleTest() std::string& characters = fsystest->getCharacters(); characters.clear(); - freebsd.setBeep (20, 100); // Hz < 21 + freebsd.setBeep (20, 100); // Hz < 21 CPPUNIT_ASSERT ( characters.empty() ); - freebsd.setBeep (32767, 100); // Hz > 32766 + freebsd.setBeep (32767, 100); // Hz > 32766 CPPUNIT_ASSERT ( characters.empty() ); - freebsd.setBeep (200, -1); // ms < 0 + freebsd.setBeep (200, -1); // ms < 0 CPPUNIT_ASSERT ( characters.empty() ); - freebsd.setBeep (200, 2000); // ms > 1999 + freebsd.setBeep (200, 2000); // ms > 1999 CPPUNIT_ASSERT ( characters.empty() ); - freebsd.setBeep (200, 100); // 200 Hz - 100 ms + freebsd.setBeep (200, 100); // 200 Hz - 100 ms CPPUNIT_ASSERT ( characters == CSI "=5965;10B" ); characters.clear(); diff --git a/test/ftermlinux-test.cpp b/test/ftermlinux-test.cpp index 69019833..a38053f0 100644 --- a/test/ftermlinux-test.cpp +++ b/test/ftermlinux-test.cpp @@ -21,6 +21,7 @@ ***********************************************************************/ #include +#include #include #include @@ -86,17 +87,17 @@ class FSystemTest : public finalcut::FSystem virtual ~FSystemTest(); // Methods - virtual uChar inPortByte (uShort) override; - virtual void outPortByte (uChar, uShort) override; - virtual int isTTY (int) override; - virtual int ioctl (int, uLong, ...) override; - virtual int open (const char*, int, ...) override; - virtual int close (int) override; - virtual FILE* fopen (const char*, const char*) override; - virtual int fclose (FILE*) override; - virtual int putchar (int) override; - virtual int tputs (const char*, int, int (*)(int)) override; - virtual uid_t getuid() override; + uChar inPortByte (uShort) override; + void outPortByte (uChar, uShort) override; + int isTTY (int) override; + int ioctl (int, uLong, ...) override; + int open (const char*, int, ...) override; + int close (int) override; + FILE* fopen (const char*, const char*) override; + int fclose (FILE*) override; + int putchar (int) override; + int tputs (const char*, int, int (*)(int)) override; + uid_t getuid() override; rgb& getRGB (std::size_t); console_font_op& getConsoleFont(); shiftstate& getShiftState(); @@ -1470,14 +1471,12 @@ class FTermLinuxTest : public CPPUNIT_NS::TestFixture, test::ConEmu //---------------------------------------------------------------------- FTermLinuxTest::FTermLinuxTest() -{ - -} +{ } //---------------------------------------------------------------------- void FTermLinuxTest::classNameTest() { - const finalcut::FTermLinux p; + const finalcut::FTermLinux p{}; const char* const classname = p.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname, "FTermLinux") == 0 ); } @@ -2210,7 +2209,7 @@ void FTermLinuxTest::modifierKeyTest() { FKey keycode; FKey mod_keycode; - const finalcut::FTermLinux linux; + const finalcut::FTermLinux linux{}; finalcut::FSystem* fsys; fsys = new test::FSystemTest(); test::FSystemTest* fsystest = static_cast(fsys); diff --git a/test/ftermopenbsd-test.cpp b/test/ftermopenbsd-test.cpp index 8806502f..2bd794c4 100644 --- a/test/ftermopenbsd-test.cpp +++ b/test/ftermopenbsd-test.cpp @@ -21,6 +21,7 @@ ***********************************************************************/ #include +#include #include #include @@ -72,17 +73,17 @@ class FSystemTest : public finalcut::FSystem virtual ~FSystemTest(); // Methods - virtual uChar inPortByte (uShort) override; - virtual void outPortByte (uChar, uShort) override; - virtual int isTTY (int) override; - virtual int ioctl (int, uLong, ...) override; - virtual int open (const char*, int, ...) override; - virtual int close (int) override; - virtual FILE* fopen (const char*, const char*) override; - virtual int fclose (FILE*) override; - virtual int putchar (int) override; - virtual int tputs (const char*, int, int (*)(int)) override; - virtual uid_t getuid() override; + uChar inPortByte (uShort) override; + void outPortByte (uChar, uShort) override; + int isTTY (int) override; + int ioctl (int, uLong, ...) override; + int open (const char*, int, ...) override; + int close (int) override; + FILE* fopen (const char*, const char*) override; + int fclose (FILE*) override; + int putchar (int) override; + int tputs (const char*, int, int (*)(int)) override; + uid_t getuid() override; private: kbd_t kbdencoding = 512; @@ -265,14 +266,12 @@ class ftermopenbsdTest : public CPPUNIT_NS::TestFixture, test::ConEmu //---------------------------------------------------------------------- ftermopenbsdTest::ftermopenbsdTest() -{ - -} +{ } //---------------------------------------------------------------------- void ftermopenbsdTest::classNameTest() { - const finalcut::FTermOpenBSD p; + const finalcut::FTermOpenBSD p{}; const char* const classname = p.getClassName(); CPPUNIT_ASSERT ( std::strcmp(classname, "FTermOpenBSD") == 0 ); }