diff --git a/ChangeLog b/ChangeLog index 2549a02c..d9a778db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2019-09-04 Markus Gans + * The Cygwin and Linux console do not use cp437 character encoding + by default anymore + 2019-09-01 Markus Gans * Removing public + protected data members from classes diff --git a/doc/class_template.h b/doc/class_template.h index 980c57c3..2fef30bc 100644 --- a/doc/class_template.h +++ b/doc/class_template.h @@ -82,7 +82,7 @@ class FClassName // Callback methods - // Data Members + // Data members protected: // Typedefs and Enumerations @@ -99,7 +99,7 @@ class FClassName // Callback methods - // Data Members + // Data members private: // Typedefs and Enumerations @@ -116,7 +116,7 @@ class FClassName // Callback methods - // Data Members + // Data members // Friend class diff --git a/examples/7segment.cpp b/examples/7segment.cpp index e7761fa5..8c6cd333 100644 --- a/examples/7segment.cpp +++ b/examples/7segment.cpp @@ -63,7 +63,7 @@ class SegmentView : public finalcut::FDialog void get7Segment (const wchar_t); void draw() override; - // Data Members + // Data members std::map code{}; finalcut::FString line[3]; finalcut::FLineEdit Input{"0123", this}; diff --git a/examples/calculator.cpp b/examples/calculator.cpp index 272ab04c..ff674b87 100644 --- a/examples/calculator.cpp +++ b/examples/calculator.cpp @@ -58,7 +58,7 @@ class Button : public finalcut::FButton void onKeyPress (finalcut::FKeyEvent*) override; private: - // Data Member + // Data member bool checked{false}; }; #pragma pack(pop) @@ -220,7 +220,7 @@ class Calc : public finalcut::FDialog const wchar_t* getButtonText (std::size_t); void mapKeyFunctions(); - // Data Members + // Data members bool error{false}; bool arcus_mode{false}; bool hyperbolic_mode{false}; diff --git a/examples/checklist.cpp b/examples/checklist.cpp index 4828f8e8..d8a7ab1f 100644 --- a/examples/checklist.cpp +++ b/examples/checklist.cpp @@ -65,7 +65,7 @@ class CheckList : public finalcut::FDialog // Callback method void cb_showList (finalcut::FWidget*, FDataPtr); - // Data Members + // Data members finalcut::FListView listView{this}; finalcut::FStatusBar status_bar{this}; }; diff --git a/examples/listbox.cpp b/examples/listbox.cpp index de366e85..3b4a891e 100644 --- a/examples/listbox.cpp +++ b/examples/listbox.cpp @@ -98,7 +98,7 @@ class Listbox : public FDialog // Event handlers void onClose (FCloseEvent*) override; - // Data Member + // Data member std::list double_list{}; FListBox list1{this}; FListBox list2{this}; diff --git a/examples/listview.cpp b/examples/listview.cpp index da2e16e1..ef4a6387 100644 --- a/examples/listview.cpp +++ b/examples/listview.cpp @@ -64,7 +64,7 @@ class Listview : public finalcut::FDialog // Callback method void cb_showInMessagebox (finalcut::FWidget*, FDataPtr); - // Data Members + // Data members finalcut::FListView listView{this}; finalcut::FButton Quit{this}; }; diff --git a/examples/menu.cpp b/examples/menu.cpp index cebcce8c..a50db8b5 100644 --- a/examples/menu.cpp +++ b/examples/menu.cpp @@ -66,7 +66,7 @@ class Menu : public finalcut::FDialog // Callback method void cb_message (finalcut::FWidget*, FDataPtr); - // Data Members + // Data members finalcut::FString line{13, fc::BoxDrawingsHorizontal}; finalcut::FMenuBar Menubar{this}; finalcut::FMenu File{"&File", &Menubar}; diff --git a/examples/mouse.cpp b/examples/mouse.cpp index 210aa2ab..567b8367 100644 --- a/examples/mouse.cpp +++ b/examples/mouse.cpp @@ -63,7 +63,7 @@ class ColorChooser : public finalcut::FWidget // Event handler void onMouseDown (finalcut::FMouseEvent*) override; - // Data Members + // Data members FColor fg_color{fc::White}; FColor bg_color{fc::Black}; finalcut::FLabel headline{this}; @@ -209,7 +209,7 @@ class Brushes : public finalcut::FWidget // Event handler void onMouseDown (finalcut::FMouseEvent*) override; - // Data Members + // Data members wchar_t brush{L' '}; FColor fg_color{fc::White}; FColor bg_color{fc::Black}; @@ -360,7 +360,7 @@ class MouseDraw : public finalcut::FDialog // Callback methods void cb_colorChanged (finalcut::FWidget*, FDataPtr); - // Data Members + // Data members term_area* canvas{nullptr}; ColorChooser c_chooser{this}; Brushes brush{this}; diff --git a/examples/scrollview.cpp b/examples/scrollview.cpp index 015a11b4..73aa0ca7 100644 --- a/examples/scrollview.cpp +++ b/examples/scrollview.cpp @@ -62,7 +62,7 @@ class Scrollview : public finalcut::FScrollView void cb_go_west (finalcut::FWidget*, FDataPtr); void cb_go_north (finalcut::FWidget*, FDataPtr); - // Data Members + // Data members wchar_t pointer_right{fc::BlackRightPointingPointer}; wchar_t pointer_down{fc::BlackDownPointingTriangle}; wchar_t pointer_left{fc::BlackLeftPointingPointer}; @@ -212,7 +212,7 @@ class Scrollviewdemo : public finalcut::FDialog // Callback method void cb_quit (finalcut::FWidget* = nullptr, FDataPtr = nullptr); - // Data Members + // Data members Scrollview sview{this}; finalcut::FButton quit_btn{"&Quit", this}; finalcut::FLabel label{this}; diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp index cc197614..24e71b0e 100644 --- a/examples/term-attributes.cpp +++ b/examples/term-attributes.cpp @@ -61,14 +61,14 @@ class AttribDlg : public finalcut::FDialog void cb_next (finalcut::FWidget* = nullptr, FDataPtr = nullptr); void cb_back (finalcut::FWidget* = nullptr, FDataPtr = nullptr); - // Data Members + // Data members FColor bgcolor; private: // Method void adjustSize() override; - // Data Members + // Data members finalcut::FButton next_button{"&Next >", this}; finalcut::FButton back_button{"< &Back", this}; }; @@ -238,7 +238,7 @@ class AttribDemo : public finalcut::FWidget void printProtected(); void draw() override; - // Data Member + // Data member int colors; }; #pragma pack(pop) diff --git a/examples/termcap.cpp b/examples/termcap.cpp index 5669501f..da757cb3 100644 --- a/examples/termcap.cpp +++ b/examples/termcap.cpp @@ -52,7 +52,7 @@ struct data { static int getNumberOfItems(); - struct termcap_string + struct alignas(alignof(std::string)) termcap_string { const std::string name; const fc::termcaps cap; diff --git a/examples/transparent.cpp b/examples/transparent.cpp index 7238edb2..d4ae3676 100644 --- a/examples/transparent.cpp +++ b/examples/transparent.cpp @@ -65,7 +65,7 @@ class Transparent : public finalcut::FDialog // Event handlers void onKeyPress (finalcut::FKeyEvent* ev) override; - // Data Members + // Data members trans_type type; }; #pragma pack(pop) @@ -187,7 +187,7 @@ class MainWindow : public finalcut::FDialog finalcut::FDialog::onKeyPress(ev); } - // Data Members + // Data members finalcut::FString line1{}; finalcut::FString line2{}; Transparent* transpwin{nullptr}; diff --git a/examples/treeview.cpp b/examples/treeview.cpp index 2721bb1c..c76cebe6 100644 --- a/examples/treeview.cpp +++ b/examples/treeview.cpp @@ -140,7 +140,7 @@ class Treeview : public finalcut::FDialog // Event handler void onClose (finalcut::FCloseEvent*) override; - // Data Members + // Data members bool initialized{false}; finalcut::FListView listView{this}; finalcut::FButton Quit{this}; @@ -168,7 +168,7 @@ struct Treeview::TreeItem const char* const* end() const { return reinterpret_cast(&child_element); } - // Data Members + // Data members const char* name; const char* population; const char* density; diff --git a/examples/ui.cpp b/examples/ui.cpp index bf15de87..cd6d8f3f 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -65,7 +65,7 @@ class ProgressDialog : public finalcut::FDialog void cb_more_bar (finalcut::FWidget*, FDataPtr); void cb_exit_bar (finalcut::FWidget*, FDataPtr); - // Data Members + // Data members finalcut::FProgressbar progressBar{this}; finalcut::FButton reset{this}; finalcut::FButton more{this}; @@ -208,7 +208,7 @@ class TextWindow : public finalcut::FDialog // Method void adjustSize() override; - // Data Members + // Data members finalcut::FTextView scrollText{this}; }; #pragma pack(pop) @@ -308,7 +308,7 @@ class MyDialog : public finalcut::FDialog void cb_view (finalcut::FWidget*, FDataPtr); void cb_setInput (finalcut::FWidget*, FDataPtr); - // Data Members + // Data members bool initialized{false}; finalcut::FMenuBar Menubar{this}; // Menu bar items diff --git a/examples/watch.cpp b/examples/watch.cpp index 236b4363..b1ddafac 100644 --- a/examples/watch.cpp +++ b/examples/watch.cpp @@ -65,7 +65,7 @@ class Watch : public finalcut::FDialog void adjustSize() override; private: - // Data Members + // Data members bool sec{true}; finalcut::FLabel time_label{L"Time", this}; finalcut::FLabel time_str{L"--:--:--", this}; diff --git a/examples/windows.cpp b/examples/windows.cpp index bb016604..9f3b7db1 100644 --- a/examples/windows.cpp +++ b/examples/windows.cpp @@ -58,7 +58,7 @@ class SmallWindow : public finalcut::FDialog void onShow (finalcut::FShowEvent*) override; void onTimer (finalcut::FTimerEvent*) override; - // Data Members + // Data members finalcut::FLabel left_arrow{this}; finalcut::FLabel right_arrow{this}; finalcut::FLabel top_left_label{this}; @@ -200,7 +200,7 @@ class Window : public finalcut::FDialog // Disable assignment operator (=) win_data& operator = (const win_data&) = delete; - // Data Members + // Data members bool is_open{false}; finalcut::FString title{}; SmallWindow* dgl{nullptr}; @@ -224,7 +224,7 @@ class Window : public finalcut::FDialog void cb_previous (finalcut::FWidget*, FDataPtr); void cb_destroyWindow (finalcut::FWidget*, FDataPtr); - // Data Members + // Data members std::vector windows{}; finalcut::FString drop_down_symbol{fc::BlackDownPointingTriangle}; finalcut::FMenuBar Menubar{this}; diff --git a/src/fcheckbox.cpp b/src/fcheckbox.cpp index 15844b30..b6fe572e 100644 --- a/src/fcheckbox.cpp +++ b/src/fcheckbox.cpp @@ -54,8 +54,8 @@ FCheckBox::~FCheckBox() // destructor //---------------------------------------------------------------------- void FCheckBox::init() { - label_offset_pos = 4; - button_width = 4; + setLabelOffsetPos(4); + setButtonWidth(4); setVisibleCursor(); } @@ -84,7 +84,7 @@ void FCheckBox::drawCheckButton() setReverse(true); } - if ( checked ) + if ( isChecked() ) drawChecked(); else drawUnchecked(); diff --git a/src/fradiobutton.cpp b/src/fradiobutton.cpp index 7e44cd1d..a21f5bcd 100644 --- a/src/fradiobutton.cpp +++ b/src/fradiobutton.cpp @@ -54,8 +54,8 @@ FRadioButton::~FRadioButton() // destructor //---------------------------------------------------------------------- void FRadioButton::init() { - label_offset_pos = 4; - button_width = 4; + setLabelOffsetPos(4); + setButtonWidth(4); setVisibleCursor(); } @@ -84,7 +84,7 @@ void FRadioButton::drawRadioButton() setReverse(true); } - if ( checked ) + if ( isChecked() ) drawChecked(); else drawUnchecked(); diff --git a/src/fscrollview.cpp b/src/fscrollview.cpp index caea7556..6b662558 100644 --- a/src/fscrollview.cpp +++ b/src/fscrollview.cpp @@ -705,11 +705,11 @@ void FScrollView::copy2area() , y_end = int(getViewportHeight()) , x_end = int(getViewportWidth()); - // viewport width does not fit into the print_area + // viewport width does not fit into the printarea if ( printarea->width <= ax + x_end ) x_end = printarea->width - ax; - // viewport height does not fit into the print_area + // viewport height does not fit into the printarea if ( printarea->height <= ay + y_end ) y_end = printarea->height - ay; diff --git a/src/fswitch.cpp b/src/fswitch.cpp index d9ab8195..147e009e 100644 --- a/src/fswitch.cpp +++ b/src/fswitch.cpp @@ -37,7 +37,7 @@ namespace finalcut FSwitch::FSwitch(FWidget* parent) : FToggleButton(parent) { - button_width = 11; + setButtonWidth(11); } //---------------------------------------------------------------------- @@ -45,7 +45,7 @@ FSwitch::FSwitch (const FString& txt, FWidget* parent) : FToggleButton(txt, parent) { switch_offset_pos = txt.getLength() + 1; - button_width = 11; + setButtonWidth(11); } //---------------------------------------------------------------------- @@ -132,7 +132,7 @@ void FSwitch::drawCheckButton() { print() << FPoint(1 + int(switch_offset_pos), 1); - if ( checked ) + if ( isChecked() ) drawChecked(); else drawUnchecked(); diff --git a/src/fterm.cpp b/src/fterm.cpp index 5dfeb231..ce415d6c 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -1828,9 +1828,7 @@ void FTerm::init_term_encoding() //---------------------------------------------------------------------- void FTerm::init_individual_term_encoding() { - if ( isLinuxTerm() - || isCygwinTerminal() - || isNewFont() + if ( isNewFont() || (isPuttyTerminal() && ! data->isUTF8()) || (isTeraTerm() && ! data->isUTF8()) ) { @@ -1839,9 +1837,7 @@ void FTerm::init_individual_term_encoding() if ( hasUTF8() && init_values.encoding == fc::UNKNOWN ) { - if ( isLinuxTerm() ) - setUTF8(false); - else if ( isXTerminal() ) + if ( isXTerminal() ) Fputchar = &FTerm::putchar_UTF8; // function pointer } } diff --git a/src/ftermbuffer.cpp b/src/ftermbuffer.cpp index 328f9f0b..90206722 100644 --- a/src/ftermbuffer.cpp +++ b/src/ftermbuffer.cpp @@ -100,7 +100,7 @@ int FTermBuffer::write (wchar_t c) //---------------------------------------------------------------------- void FTermBuffer::write (const FColorPair& pair) { - FVTerm::setColor(pair.fg_color, pair.bg_color); + FVTerm::setColor(pair.getForegroundColor(), pair.getBackgroundColor()); } diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 94316a41..7ea4c951 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -599,7 +599,7 @@ void FVTerm::print (const FPoint& p) //---------------------------------------------------------------------- void FVTerm::print (const FColorPair& pair) { - setColor (pair.fg_color, pair.bg_color); + setColor (pair.getForegroundColor(), pair.getBackgroundColor()); } diff --git a/src/include/final/emptyfstring.h b/src/include/final/emptyfstring.h index 9ebe9a65..6e195596 100644 --- a/src/include/final/emptyfstring.h +++ b/src/include/final/emptyfstring.h @@ -59,7 +59,7 @@ public: static void clear(); private: - // Data Member + // Data member static const FString* empty_string; }; #pragma pack(pop) diff --git a/src/include/final/fapplication.h b/src/include/final/fapplication.h index caf7081c..6e083f98 100644 --- a/src/include/final/fapplication.h +++ b/src/include/final/fapplication.h @@ -187,7 +187,7 @@ class FApplication : public FWidget void performTimerAction ( const FObject* , const FEvent* ) override; - // Data Members + // Data members int app_argc; char** app_argv; uInt64 key_timeout{100000}; // 100 ms diff --git a/src/include/final/fbutton.h b/src/include/final/fbutton.h index 729d2103..177b283d 100644 --- a/src/include/final/fbutton.h +++ b/src/include/final/fbutton.h @@ -158,7 +158,7 @@ class FButton : public FWidget void updateButtonColor(); void processClick(); - // Data Members + // Data members FString text{}; bool button_down{false}; bool active_focus{false}; diff --git a/src/include/final/fbuttongroup.h b/src/include/final/fbuttongroup.h index c5c58ae1..1b6bf5f6 100644 --- a/src/include/final/fbuttongroup.h +++ b/src/include/final/fbuttongroup.h @@ -140,7 +140,7 @@ class FButtonGroup : public FScrollView // Callback method void cb_buttonToggled (FWidget*, FDataPtr); - // Data Members + // Data members FString text{}; FObjectList buttonlist{}; }; diff --git a/src/include/final/fcolorpair.h b/src/include/final/fcolorpair.h index a096535d..13183d20 100644 --- a/src/include/final/fcolorpair.h +++ b/src/include/final/fcolorpair.h @@ -53,14 +53,14 @@ class FColorPair public: // Constructors explicit FColorPair (FColor fg = fc::Default, FColor bg = fc::Default) - : fg_color(fg) - , bg_color(bg) + : fg_color{fg} + , bg_color{bg} { } // Copy constructor FColorPair (const FColorPair& pair) - : fg_color(pair.fg_color) - , bg_color(pair.bg_color) + : fg_color{pair.fg_color} + , bg_color{pair.bg_color} { } // Destructor @@ -78,13 +78,39 @@ class FColorPair const char* getClassName() const { return "FColorPair"; } + FColor getForegroundColor() const + { return fg_color; } + + FColor getBackgroundColor() const + { return bg_color; } + + // Mutators + void setForegroundColor (FColor color) + { fg_color = color; } + + void setBackgroundColor (FColor color) + { bg_color = color; } + + void setColorPair (const FColorPair& pair) + { + fg_color = pair.fg_color; + bg_color = pair.bg_color; + } + + void setColorPair (FColor fg, FColor bg) + { + fg_color = fg; + bg_color = bg; + } + // Methods void swap() { std::swap (fg_color, bg_color); } - // Data Members + private: + // Data members FColor fg_color; // Foreground color FColor bg_color; // Background color }; diff --git a/src/include/final/fdialog.h b/src/include/final/fdialog.h index 4ecef800..fcad0f2c 100644 --- a/src/include/final/fdialog.h +++ b/src/include/final/fdialog.h @@ -218,7 +218,7 @@ class FDialog : public FWindow void cb_zoom (FWidget*, FDataPtr); void cb_close (FWidget*, FDataPtr); - // Data Members + // Data members FString tb_text{}; // title bar text int result_code{FDialog::Reject}; bool zoom_button_pressed{false}; diff --git a/src/include/final/ffiledialog.h b/src/include/final/ffiledialog.h index a6d4615c..c3ca69a6 100644 --- a/src/include/final/ffiledialog.h +++ b/src/include/final/ffiledialog.h @@ -196,7 +196,7 @@ class FFileDialog : public FDialog void cb_processOpen (FWidget*, FDataPtr); void cb_processShowHidden (FWidget*, FDataPtr); - // Data Members + // Data members static FSystem* fsystem; DIR* directory_stream{nullptr}; dirEntries dir_entries{}; diff --git a/src/include/final/fkeyboard.h b/src/include/final/fkeyboard.h index 4d045cdd..2d6511d3 100644 --- a/src/include/final/fkeyboard.h +++ b/src/include/final/fkeyboard.h @@ -64,7 +64,7 @@ class FKeyboardCommand final void execute(); private: - // Data Members + // Data members FApplication* instance{nullptr}; void (FApplication::*handler)(){nullptr}; }; @@ -159,7 +159,7 @@ class FKeyboard final void keyReleased(); void escapeKeyPressed(); - // Data Members + // Data members FKey key{0}; char read_buf[READ_BUF_SIZE]{'\0'}; char fifo_buf[FIFO_BUF_SIZE]{'\0'}; diff --git a/src/include/final/flabel.h b/src/include/final/flabel.h index 9154d54e..898bec6a 100644 --- a/src/include/final/flabel.h +++ b/src/include/final/flabel.h @@ -152,7 +152,7 @@ class FLabel : public FWidget void printLine ( wchar_t[], std::size_t , std::size_t, std::size_t = 0 ); - // Data Members + // Data members FStringList multiline_text{}; bool multiline{false}; FString text{}; diff --git a/src/include/final/flineedit.h b/src/include/final/flineedit.h index cffc7401..a732c806 100644 --- a/src/include/final/flineedit.h +++ b/src/include/final/flineedit.h @@ -185,7 +185,7 @@ class FLineEdit : public FWidget void processActivate(); void processChanged(); - // Data Members + // Data members FString text{""}; FString label_text{""}; FLabel* label{}; diff --git a/src/include/final/flistbox.h b/src/include/final/flistbox.h index a1d9b9d0..224581dc 100644 --- a/src/include/final/flistbox.h +++ b/src/include/final/flistbox.h @@ -102,7 +102,7 @@ class FListBoxItem // Friend classes friend class FListBox; - // Data Members + // Data members FString text{}; FDataPtr data_pointer{nullptr}; fc::brackets_type brackets{fc::NoBrackets}; @@ -326,7 +326,7 @@ class FListBox : public FWidget , FDataPtr , int index ){nullptr}; - // Data Members + // Data members listBoxItems itemlist{}; FDataPtr source_container{nullptr}; convert_type conv_type{FListBox::no_convert}; diff --git a/src/include/final/flistview.h b/src/include/final/flistview.h index a4a89dc6..53e94ffe 100644 --- a/src/include/final/flistview.h +++ b/src/include/final/flistview.h @@ -128,7 +128,7 @@ class FListViewItem : public FObject std::size_t getVisibleLines(); void resetVisibleLineCounter(); - // Data Members + // Data members FStringList column_list{}; FDataPtr data_pointer{nullptr}; FObjectIterator root{}; @@ -226,7 +226,7 @@ class FListViewIterator void nextElement (FObjectIterator&); void prevElement (FObjectIterator&); - // Data Members + // Data members FObjectIteratorStack iter_path{}; FObjectIterator node{}; int position{0}; @@ -360,7 +360,7 @@ class FListView : public FWidget void onFocusIn (FFocusEvent*) override; void onFocusOut (FFocusEvent*) override; - // Data Members + // Data members static FObjectIterator null_iter; protected: @@ -447,7 +447,7 @@ class FListView : public FWidget void cb_VBarChange (FWidget*, FDataPtr); void cb_HBarChange (FWidget*, FDataPtr); - // Data Members + // Data members FObjectIterator root{}; FObjectList selflist{}; FObjectList itemlist{}; diff --git a/src/include/final/fmenu.h b/src/include/final/fmenu.h index 75a19a30..e1e25c33 100644 --- a/src/include/final/fmenu.h +++ b/src/include/final/fmenu.h @@ -229,7 +229,7 @@ class FMenu : public FWindow, public FMenuList friend class FMenuItem; friend class FRadioMenuItem; - // Data Members + // Data members FMenuItem item{}; FWidget* super_menu{nullptr}; FMenu* opened_sub_menu{nullptr}; diff --git a/src/include/final/fmenubar.h b/src/include/final/fmenubar.h index c0df931e..65a5221a 100644 --- a/src/include/final/fmenubar.h +++ b/src/include/final/fmenubar.h @@ -154,7 +154,7 @@ class FMenuBar : public FWindow, public FMenuList friend class FMenu; friend class FMenuItem; - // Data Members + // Data members bool mouse_down{false}; bool drop_down{false}; bool focus_changed{false}; diff --git a/src/include/final/fmenuitem.h b/src/include/final/fmenuitem.h index 83244134..66602f4e 100644 --- a/src/include/final/fmenuitem.h +++ b/src/include/final/fmenuitem.h @@ -176,7 +176,7 @@ class FMenuItem : public FWidget virtual void processClicked(); - // Data Members + // Data members FString text{}; bool selected{false}; bool separator{false}; diff --git a/src/include/final/fmenulist.h b/src/include/final/fmenulist.h index 971d52b5..c73ecafe 100644 --- a/src/include/final/fmenulist.h +++ b/src/include/final/fmenulist.h @@ -99,7 +99,7 @@ class FMenuList void unselectItem(); private: - // Data Members + // Data members FMenuItem* selected_item{}; std::vector item_list{}; }; diff --git a/src/include/final/fmessagebox.h b/src/include/final/fmessagebox.h index d889b947..0c6a71ef 100644 --- a/src/include/final/fmessagebox.h +++ b/src/include/final/fmessagebox.h @@ -155,7 +155,7 @@ class FMessageBox : public FDialog void resizeButtons(); void adjustButtons(); - // Data Members + // Data members FString headline_text{}; FString text{}; FString* text_components{nullptr}; diff --git a/src/include/final/fmouse.h b/src/include/final/fmouse.h index 33b89cc6..c034a405 100644 --- a/src/include/final/fmouse.h +++ b/src/include/final/fmouse.h @@ -182,7 +182,7 @@ class FMouse bool isDblclickTimeout (timeval*); private: - // Data Members + // Data members button b_state{}; bool mouse_event_occurred{false}; bool input_data_pending{false}; @@ -247,7 +247,7 @@ class FMouseGPM final : public FMouse // Method int gpmEvent (bool = true); - // Data Member + // Data member Gpm_Event gpm_ev{}; bool has_gpm_mouse_data{false}; bool gpm_mouse_enabled{false}; @@ -325,7 +325,7 @@ class FMouseX11 final : public FMouse void setMoveState (const FPoint&, int); void setButtonState (int, struct timeval*); - // Data Member + // Data member char x11_mouse[MOUSE_BUF_SIZE]{'\0'}; uChar x11_button_state{all_buttons_released}; }; @@ -388,7 +388,7 @@ class FMouseSGR final : public FMouse void setPressedButtonState (int, struct timeval*); void setReleasedButtonState (int); - // Data Members + // Data members char sgr_mouse[MOUSE_BUF_SIZE]{'\0'}; uChar sgr_button_state{0x23}; }; @@ -451,7 +451,7 @@ class FMouseUrxvt final : public FMouse void setMoveState (const FPoint&, int); void setButtonState (int, struct timeval*); - // Data Members + // Data members char urxvt_mouse[MOUSE_BUF_SIZE]{'\0'}; uChar urxvt_button_state{all_buttons_released}; }; @@ -525,7 +525,7 @@ class FMouseControl void enableXTermMouse(); void disableXTermMouse(); - // Data Member + // Data member FMouseProtocol mouse_protocol{}; FPoint zero_point{0, 0}; bool use_gpm_mouse{false}; diff --git a/src/include/final/fobject.h b/src/include/final/fobject.h index 287cce43..477a31f2 100644 --- a/src/include/final/fobject.h +++ b/src/include/final/fobject.h @@ -157,7 +157,7 @@ class FObject // Method virtual void performTimerAction (const FObject*, const FEvent*); - // Data Members + // Data members FObject* parent_obj{nullptr}; FObjectList children_list{}; // no children yet bool has_parent{false}; diff --git a/src/include/final/foptiattr.h b/src/include/final/foptiattr.h index 23f670ce..39810447 100644 --- a/src/include/final/foptiattr.h +++ b/src/include/final/foptiattr.h @@ -185,7 +185,7 @@ class FOptiAttr final private: // Typedefs and Enumerations - typedef struct + typedef struct alignas(alignof(char*)) { char* cap; bool caused_reset; @@ -284,7 +284,7 @@ class FOptiAttr final bool switchOff(); bool append_sequence (char[]); - // Data Members + // Data members capability F_enter_bold_mode{}; capability F_exit_bold_mode{}; capability F_enter_dim_mode{}; diff --git a/src/include/final/foptimove.h b/src/include/final/foptimove.h index bd26b236..7da5982e 100644 --- a/src/include/final/foptimove.h +++ b/src/include/final/foptimove.h @@ -208,7 +208,7 @@ class FOptiMove final // Friend function friend void printDurations (const FOptiMove&); - // Data Members + // Data members capability F_cursor_home{}; capability F_carriage_return{}; capability F_cursor_to_ll{}; diff --git a/src/include/final/fpoint.h b/src/include/final/fpoint.h index 058c993d..792923d9 100644 --- a/src/include/final/fpoint.h +++ b/src/include/final/fpoint.h @@ -90,7 +90,7 @@ class FPoint int& y_ref(); private: - // Data Members + // Data members int xpos{0}; int ypos{0}; }; diff --git a/src/include/final/fprogressbar.h b/src/include/final/fprogressbar.h index ae6a2cbb..d5a2f98d 100644 --- a/src/include/final/fprogressbar.h +++ b/src/include/final/fprogressbar.h @@ -106,7 +106,7 @@ class FProgressbar : public FWidget std::size_t drawProgressIndicator(); void drawProgressBackground (std::size_t); - // Data Members + // Data members std::size_t percentage{NOT_SET}; std::size_t bar_length{getWidth()}; }; diff --git a/src/include/final/frect.h b/src/include/final/frect.h index 5631bb2a..3e7c487a 100644 --- a/src/include/final/frect.h +++ b/src/include/final/frect.h @@ -138,7 +138,7 @@ class FRect FRect combined (const FRect&) const; private: - // Data Members + // Data members int X1{0}; int Y1{0}; int X2{-1}; diff --git a/src/include/final/fscrollbar.h b/src/include/final/fscrollbar.h index 93b0c34f..e562daa1 100644 --- a/src/include/final/fscrollbar.h +++ b/src/include/final/fscrollbar.h @@ -143,7 +143,7 @@ class FScrollbar : public FWidget void avoidScrollOvershoot(); void processScroll(); - // Data Members + // Data members sType scroll_type{FScrollbar::noScroll}; bool threshold_reached{false}; int threshold_time{500}; diff --git a/src/include/final/fscrollview.h b/src/include/final/fscrollview.h index 77d458b8..0595a033 100644 --- a/src/include/final/fscrollview.h +++ b/src/include/final/fscrollview.h @@ -181,7 +181,7 @@ class FScrollView : public FWidget void cb_VBarChange (FWidget*, FDataPtr); void cb_HBarChange (FWidget*, FDataPtr); - // Data Members + // Data members FRect scroll_geometry{1, 1, 1, 1}; FRect viewport_geometry{}; term_area* viewport{nullptr}; // virtual scroll content diff --git a/src/include/final/fsize.h b/src/include/final/fsize.h index 399fa02c..f27c20c9 100644 --- a/src/include/final/fsize.h +++ b/src/include/final/fsize.h @@ -98,7 +98,7 @@ class FSize std::size_t& height_ref(); private: - // Data Members + // Data members std::size_t width{0}; std::size_t height{0}; }; diff --git a/src/include/final/fstatusbar.h b/src/include/final/fstatusbar.h index d01592b0..044860bf 100644 --- a/src/include/final/fstatusbar.h +++ b/src/include/final/fstatusbar.h @@ -124,7 +124,7 @@ class FStatusKey : public FWidget // Friend class friend class FStatusBar; - // Data Members + // Data members FKey key{0}; FString text{}; bool active{false}; @@ -250,7 +250,7 @@ class FStatusBar : public FWindow void drawKey (keyList::const_iterator); void drawActiveKey (keyList::const_iterator); - // Data Members + // Data members keyList key_list{}; FString text{""}; bool mouse_down{}; diff --git a/src/include/final/fstring.h b/src/include/final/fstring.h index 9c6730dd..34ff7067 100644 --- a/src/include/final/fstring.h +++ b/src/include/final/fstring.h @@ -274,7 +274,7 @@ class FString wchar_t* c_to_wc_str (const char[]) const; wchar_t* extractToken (wchar_t*[], const wchar_t[], const wchar_t[]); - // Data Members + // Data members wchar_t* string{nullptr}; std::size_t length{0}; std::size_t bufsize{0}; diff --git a/src/include/final/fswitch.h b/src/include/final/fswitch.h index d8a859ee..80db0101 100644 --- a/src/include/final/fswitch.h +++ b/src/include/final/fswitch.h @@ -103,7 +103,7 @@ class FSwitch : public FToggleButton void drawChecked(); void drawUnchecked(); - // Data Members + // Data members std::size_t switch_offset_pos{0}; bool button_pressed{false}; }; diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h index 02f78c5c..69224034 100644 --- a/src/include/final/fterm.h +++ b/src/include/final/fterm.h @@ -305,7 +305,7 @@ class FTerm final __attribute__((noreturn)) #endif ; - // Data Members + // Data members static struct initializationValues { public: @@ -401,7 +401,7 @@ class FTerm final static void resetSignalHandler(); static void signal_handler (int); - // Data Members + // Data members static FTermData* data; static FSystem* fsys; static FOptiMove* opti_move; diff --git a/src/include/final/ftermcap.h b/src/include/final/ftermcap.h index 63d0b6d3..88b0ece2 100644 --- a/src/include/final/ftermcap.h +++ b/src/include/final/ftermcap.h @@ -97,7 +97,7 @@ class FTermcap final // Methods static void init(); - // Data Members + // Data members static bool background_color_erase; static bool can_change_color_palette; static bool automatic_left_margin; @@ -122,7 +122,7 @@ class FTermcap final static void termcapKeys (char*&); static void termcapKeysVt100 (char*&); - // Data Member + // Data member static FTermData* fterm_data; static FTermDetection* term_detection; }; diff --git a/src/include/final/ftermcapquirks.h b/src/include/final/ftermcapquirks.h index 41411eaf..e24f95e1 100644 --- a/src/include/final/ftermcapquirks.h +++ b/src/include/final/ftermcapquirks.h @@ -81,7 +81,7 @@ class FTermcapQuirks final static void general(); static void ecma48(); - // Data Members + // Data members static FTermData* fterm_data; static FTermDetection* term_detection; }; diff --git a/src/include/final/ftermdata.h b/src/include/final/ftermdata.h index 80e78382..6c25634e 100644 --- a/src/include/final/ftermdata.h +++ b/src/include/final/ftermdata.h @@ -128,7 +128,7 @@ class FTermData final #endif private: - // Data Members + // Data members encodingMap encoding_list{}; charSubstitution char_substitution_map{}; fc::encoding term_encoding{fc::UNKNOWN}; diff --git a/src/include/final/ftermdebugdata.h b/src/include/final/ftermdebugdata.h index f6f36eb8..3bbebac2 100644 --- a/src/include/final/ftermdebugdata.h +++ b/src/include/final/ftermdebugdata.h @@ -77,7 +77,7 @@ class FTermDebugData final static void init(); private: - // Data Members + // Data members static FTermData* data; static FTermDetection* term_detection; }; diff --git a/src/include/final/ftermdetection.h b/src/include/final/ftermdetection.h index 4bfb2edb..b18a2cf7 100644 --- a/src/include/final/ftermdetection.h +++ b/src/include/final/ftermdetection.h @@ -186,7 +186,7 @@ class FTermDetection final static char* secDA_Analysis_85 (char[]); static char* secDA_Analysis_vte (char[]); - // Data Members + // Data members #if DEBUG static char termtype_256color[256]; static char termtype_Answerback[256]; diff --git a/src/include/final/ftermfreebsd.h b/src/include/final/ftermfreebsd.h index 6c463ad5..3be6601c 100644 --- a/src/include/final/ftermfreebsd.h +++ b/src/include/final/ftermfreebsd.h @@ -126,7 +126,7 @@ class FTermFreeBSD final static bool resetFreeBSDAlt2Meta(); static bool setFreeBSDCursorStyle (CursorStyle); - // Data Members + // Data members static uInt bsd_alt_keymap; static CursorStyle cursor_style; static bool change_cursorstyle; diff --git a/src/include/final/ftermios.h b/src/include/final/ftermios.h index d4c5e33b..37f0c7ce 100644 --- a/src/include/final/ftermios.h +++ b/src/include/final/ftermios.h @@ -85,7 +85,7 @@ class FTermios final static uInt getBaudRate(); private: - // Data Members + // Data members static int stdin_no; static int stdout_no; static int stderr_no; diff --git a/src/include/final/ftermlinux.h b/src/include/final/ftermlinux.h index 1021fd3e..2df3100c 100644 --- a/src/include/final/ftermlinux.h +++ b/src/include/final/ftermlinux.h @@ -177,7 +177,7 @@ class FTermLinux final static void initSpecialCharacter(); static void characterFallback (wchar_t, std::vector); - // Data Members + // Data members #if defined(__linux__) static bool vga_font; static bool new_font; diff --git a/src/include/final/ftermopenbsd.h b/src/include/final/ftermopenbsd.h index 702ef986..06d64c16 100644 --- a/src/include/final/ftermopenbsd.h +++ b/src/include/final/ftermopenbsd.h @@ -113,7 +113,7 @@ class FTermOpenBSD final static bool setBSDConsoleMetaEsc(); static bool resetBSDConsoleEncoding(); - // Data Members + // Data members static kbd_t bsd_keyboard_encoding; static bool meta_sends_escape; static FSystem* fsystem; diff --git a/src/include/final/ftermxterminal.h b/src/include/final/ftermxterminal.h index f9537166..cd485a1c 100644 --- a/src/include/final/ftermxterminal.h +++ b/src/include/final/ftermxterminal.h @@ -138,7 +138,7 @@ class FTermXTerminal final static void enableXTermMetaSendsESC(); static void disableXTermMetaSendsESC(); - // Data Members + // Data members static bool mouse_support; static bool meta_sends_esc; static bool xterm_default_colors; diff --git a/src/include/final/ftextview.h b/src/include/final/ftextview.h index 1b276317..eaa86440 100644 --- a/src/include/final/ftextview.h +++ b/src/include/final/ftextview.h @@ -157,7 +157,7 @@ class FTextView : public FWidget void cb_VBarChange (FWidget*, FDataPtr); void cb_HBarChange (FWidget*, FDataPtr); - // Data Members + // Data members FStringList data{}; FScrollbarPtr vbar{nullptr}; FScrollbarPtr hbar{nullptr}; diff --git a/src/include/final/ftogglebutton.h b/src/include/final/ftogglebutton.h index c7ebac7f..d5449229 100644 --- a/src/include/final/ftogglebutton.h +++ b/src/include/final/ftogglebutton.h @@ -128,6 +128,8 @@ class FToggleButton : public FWidget // Mutator void setHotkeyAccelerator(); + void setButtonWidth (std::size_t); + void setLabelOffsetPos (std::size_t); // Inquiries bool isRadioButton() const; @@ -143,11 +145,6 @@ class FToggleButton : public FWidget // Event handler void onKeyPress (FKeyEvent*) override; - // Data Members - bool checked{false}; - std::size_t label_offset_pos{0}; - std::size_t button_width{0}; // plus margin spaces - private: // Constants static constexpr std::size_t NOT_SET = static_cast(-1); @@ -162,10 +159,13 @@ class FToggleButton : public FWidget // Friend classes friend class FButtonGroup; - // Data Members + // Data members FButtonGroup* button_group{nullptr}; - bool focus_inside_group{true}; FString text{}; + std::size_t label_offset_pos{0}; + std::size_t button_width{0}; // plus margin spaces + bool focus_inside_group{true}; + bool checked{false}; }; #pragma pack(pop) @@ -223,6 +223,14 @@ inline bool FToggleButton::isChecked() inline FButtonGroup* FToggleButton::getGroup() const { return button_group; } +//---------------------------------------------------------------------- +inline void FToggleButton::setButtonWidth (std::size_t width) +{ button_width = width; } + +//---------------------------------------------------------------------- +inline void FToggleButton::setLabelOffsetPos (std::size_t offset) +{ label_offset_pos = offset; } + //---------------------------------------------------------------------- inline bool FToggleButton::hasGroup() const { return button_group; } diff --git a/src/include/final/ftooltip.h b/src/include/final/ftooltip.h index 2c807aed..1d416f4a 100644 --- a/src/include/final/ftooltip.h +++ b/src/include/final/ftooltip.h @@ -108,7 +108,7 @@ class FToolTip : public FWindow void calculateDimensions(); void adjustSize() override; - // Data Members + // Data members FString text{}; FString* text_components{nullptr}; FStringList text_split{}; diff --git a/src/include/final/ftypes.h b/src/include/final/ftypes.h index bc8a5990..2b8980d6 100644 --- a/src/include/final/ftypes.h +++ b/src/include/final/ftypes.h @@ -118,7 +118,7 @@ typedef struct union attribute { - struct + struct alignas(4) { // Attribute byte #0 uInt8 bold : 1; // bold @@ -144,7 +144,7 @@ typedef struct uInt8 : 6; // padding bits } bit; - uInt8 byte[3]; + alignas(4) uInt8 byte[3]; } attr; } charData; #pragma pack(pop) diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index c6fa1b15..534e6bc2 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -414,13 +414,6 @@ class FVTerm __attribute__((noreturn)) #endif ; - - // Data Members - private: - term_area* print_area{nullptr}; // print area for this object - term_area* child_print_area{nullptr}; // print area for children - term_area* vwin{nullptr}; // virtual window - private: // Enumeration enum exit_state @@ -472,7 +465,10 @@ class FVTerm static void appendOutputBuffer (const char[]); static int appendOutputBuffer (int); - // Data Members + // Data members + term_area* print_area{nullptr}; // print area for this object + term_area* child_print_area{nullptr}; // print area for children + term_area* vwin{nullptr}; // virtual window static FSystem* fsystem; static FTerm* fterm; static term_area* vterm; // virtual terminal @@ -495,6 +491,7 @@ class FVTerm static uInt clr_bol_length; static uInt clr_eol_length; static uInt cursor_address_length; + }; #pragma pack(pop) diff --git a/src/include/final/fwidget.h b/src/include/final/fwidget.h index 0791ba72..2e6dfc18 100644 --- a/src/include/final/fwidget.h +++ b/src/include/final/fwidget.h @@ -429,7 +429,7 @@ class FWidget : public FVTerm, public FObject void drawBlockShadow (int, int, int, int); static void setColorTheme(); - // Data Members + // Data members FPoint widget_cursor_position{-1, -1}; struct widget_size_hints diff --git a/src/include/final/fwidgetcolors.h b/src/include/final/fwidgetcolors.h index 63e6a32f..485401db 100644 --- a/src/include/final/fwidgetcolors.h +++ b/src/include/final/fwidgetcolors.h @@ -54,7 +54,7 @@ class FWidgetColors final void set8ColorTheme(); void set16ColorTheme(); - // Data Members + // Data members FColor term_fg{fc::Default}; FColor term_bg{fc::Default}; FColor list_fg{fc::Default}; diff --git a/src/include/final/fwindow.h b/src/include/final/fwindow.h index 865b76be..187cccf8 100644 --- a/src/include/final/fwindow.h +++ b/src/include/final/fwindow.h @@ -174,7 +174,7 @@ class FWindow : public FWidget static void deleteFromAlwaysOnTopList (FWidget*); static void processAlwaysOnTop(); - // Data Members + // Data members bool window_active{false}; bool zoomed{false}; FWidget* win_focus_widget{nullptr}; diff --git a/test/conemu.h b/test/conemu.h index 25941b1f..3c0a85cb 100644 --- a/test/conemu.h +++ b/test/conemu.h @@ -131,7 +131,7 @@ class ConEmu void closeSlavePTY(); void parseTerminalBuffer (std::size_t, console); - // Data Members + // Data members int fd_stdin{fileno(stdin)}; int fd_stdout{fileno(stdout)}; int fd_stderr{fileno(stderr)}; @@ -148,7 +148,7 @@ class ConEmu bool* ConEmu::shared_state = nullptr; -// private Data Member of ConEmu +// private data member of ConEmu //---------------------------------------------------------------------- char* ConEmu::colorname[] = { diff --git a/test/fcolorpair-test.cpp b/test/fcolorpair-test.cpp index 05f6b095..00b6be37 100644 --- a/test/fcolorpair-test.cpp +++ b/test/fcolorpair-test.cpp @@ -50,6 +50,7 @@ class FColorPairTest : public CPPUNIT_NS::TestFixture void noArgumentTest(); void copyConstructorTest(); void assignmentTest(); + void setColorTest(); void swapTest(); private: @@ -61,6 +62,7 @@ class FColorPairTest : public CPPUNIT_NS::TestFixture CPPUNIT_TEST (noArgumentTest); CPPUNIT_TEST (copyConstructorTest); CPPUNIT_TEST (assignmentTest); + CPPUNIT_TEST (setColorTest); CPPUNIT_TEST (swapTest); // End of test suite definition @@ -80,8 +82,8 @@ void FColorPairTest::classNameTest() void FColorPairTest::noArgumentTest() { const finalcut::FColorPair pair{}; - CPPUNIT_ASSERT ( pair.fg_color == finalcut::fc::Default ); - CPPUNIT_ASSERT ( pair.bg_color == finalcut::fc::Default ); + CPPUNIT_ASSERT ( pair.getForegroundColor() == finalcut::fc::Default ); + CPPUNIT_ASSERT ( pair.getBackgroundColor() == finalcut::fc::Default ); } //---------------------------------------------------------------------- @@ -89,18 +91,18 @@ void FColorPairTest::copyConstructorTest() { const finalcut::FColorPair p1a; finalcut::FColorPair p1b (p1a); - CPPUNIT_ASSERT ( p1b.fg_color == finalcut::fc::Default ); - CPPUNIT_ASSERT ( p1b.bg_color == finalcut::fc::Default ); + CPPUNIT_ASSERT ( p1b.getForegroundColor() == finalcut::fc::Default ); + CPPUNIT_ASSERT ( p1b.getBackgroundColor() == finalcut::fc::Default ); const finalcut::FColorPair p2a (finalcut::fc::Yellow ); const finalcut::FColorPair p2b (p2a); - CPPUNIT_ASSERT ( p2b.fg_color == finalcut::fc::Yellow ); - CPPUNIT_ASSERT ( p2b.bg_color == finalcut::fc::Default ); + CPPUNIT_ASSERT ( p2b.getForegroundColor() == finalcut::fc::Yellow ); + CPPUNIT_ASSERT ( p2b.getBackgroundColor() == finalcut::fc::Default ); const finalcut::FColorPair p3a (finalcut::fc::Red, finalcut::fc::Black); const finalcut::FColorPair p3b (p3a); - CPPUNIT_ASSERT ( p3b.fg_color == finalcut::fc::Red ); - CPPUNIT_ASSERT ( p3b.bg_color == finalcut::fc::Black ); + CPPUNIT_ASSERT ( p3b.getForegroundColor() == finalcut::fc::Red ); + CPPUNIT_ASSERT ( p3b.getBackgroundColor() == finalcut::fc::Black ); } //---------------------------------------------------------------------- @@ -108,18 +110,41 @@ void FColorPairTest::assignmentTest() { const finalcut::FColorPair p1a; const finalcut::FColorPair p1b = p1a; - CPPUNIT_ASSERT ( p1b.fg_color == finalcut::fc::Default ); - CPPUNIT_ASSERT ( p1b.bg_color == finalcut::fc::Default ); + CPPUNIT_ASSERT ( p1b.getForegroundColor() == finalcut::fc::Default ); + CPPUNIT_ASSERT ( p1b.getBackgroundColor() == finalcut::fc::Default ); const finalcut::FColorPair p2a (finalcut::fc::Yellow ); const finalcut::FColorPair p2b = p2a; - CPPUNIT_ASSERT ( p2b.fg_color == finalcut::fc::Yellow ); - CPPUNIT_ASSERT ( p2b.bg_color == finalcut::fc::Default ); + CPPUNIT_ASSERT ( p2b.getForegroundColor() == finalcut::fc::Yellow ); + CPPUNIT_ASSERT ( p2b.getBackgroundColor() == finalcut::fc::Default ); const finalcut::FColorPair p3a (finalcut::fc::Red, finalcut::fc::Black); const finalcut::FColorPair p3b = p3a; - CPPUNIT_ASSERT ( p3b.fg_color == finalcut::fc::Red ); - CPPUNIT_ASSERT ( p3b.bg_color == finalcut::fc::Black ); + CPPUNIT_ASSERT ( p3b.getForegroundColor() == finalcut::fc::Red ); + CPPUNIT_ASSERT ( p3b.getBackgroundColor() == finalcut::fc::Black ); +} + +//---------------------------------------------------------------------- +void FColorPairTest::setColorTest() +{ + finalcut::FColorPair p1; + p1.setForegroundColor (finalcut::fc::DarkGreen); + CPPUNIT_ASSERT ( p1.getForegroundColor() == finalcut::fc::DarkGreen ); + CPPUNIT_ASSERT ( p1.getBackgroundColor() == finalcut::fc::Default ); + + finalcut::FColorPair p2 (finalcut::fc::Yellow); + p2.setBackgroundColor (finalcut::fc::DeepSkyBlue1); + CPPUNIT_ASSERT ( p2.getForegroundColor() == finalcut::fc::Yellow ); + CPPUNIT_ASSERT ( p2.getBackgroundColor() == finalcut::fc::DeepSkyBlue1 ); + + finalcut::FColorPair p3 (finalcut::fc::Red, finalcut::fc::Black); + p3.setColorPair (finalcut::fc::NavyBlue, finalcut::fc::SandyBrown); + CPPUNIT_ASSERT ( p3.getForegroundColor() == finalcut::fc::NavyBlue ); + CPPUNIT_ASSERT ( p3.getBackgroundColor() == finalcut::fc::SandyBrown ); + finalcut::FColorPair p4 (finalcut::fc::DarkBlue, finalcut::fc::Grey66); + p3.setColorPair (p4); + CPPUNIT_ASSERT ( p3.getForegroundColor() == finalcut::fc::DarkBlue ); + CPPUNIT_ASSERT ( p3.getBackgroundColor() == finalcut::fc::Grey66 ); } //---------------------------------------------------------------------- @@ -127,18 +152,18 @@ void FColorPairTest::swapTest() { finalcut::FColorPair p1; p1.swap(); - CPPUNIT_ASSERT ( p1.fg_color == finalcut::fc::Default ); - CPPUNIT_ASSERT ( p1.bg_color == finalcut::fc::Default ); + CPPUNIT_ASSERT ( p1.getForegroundColor() == finalcut::fc::Default ); + CPPUNIT_ASSERT ( p1.getBackgroundColor() == finalcut::fc::Default ); finalcut::FColorPair p2 (finalcut::fc::LightBlue ); p2.swap(); - CPPUNIT_ASSERT ( p2.fg_color == finalcut::fc::Default ); - CPPUNIT_ASSERT ( p2.bg_color == finalcut::fc::LightBlue ); + CPPUNIT_ASSERT ( p2.getForegroundColor() == finalcut::fc::Default ); + CPPUNIT_ASSERT ( p2.getBackgroundColor() == finalcut::fc::LightBlue ); finalcut::FColorPair p3 (finalcut::fc::Cyan, finalcut::fc::White); p3.swap(); - CPPUNIT_ASSERT ( p3.fg_color == finalcut::fc::White ); - CPPUNIT_ASSERT ( p3.bg_color == finalcut::fc::Cyan ); + CPPUNIT_ASSERT ( p3.getForegroundColor() == finalcut::fc::White ); + CPPUNIT_ASSERT ( p3.getBackgroundColor() == finalcut::fc::Cyan ); } // Put the test suite in the registry diff --git a/test/fkeyboard-test.cpp b/test/fkeyboard-test.cpp index ac27be63..57a09816 100644 --- a/test/fkeyboard-test.cpp +++ b/test/fkeyboard-test.cpp @@ -276,7 +276,7 @@ class FKeyboardTest : public CPPUNIT_NS::TestFixture void keyReleased(); void escapeKeyPressed(); - // Data Members + // Data members FKey key_pressed{0}; FKey key_released{0}; int number_of_keys{0}; diff --git a/test/fobject-test.cpp b/test/fobject-test.cpp index 6dd61d9b..e2e0153f 100644 --- a/test/fobject-test.cpp +++ b/test/fobject-test.cpp @@ -79,7 +79,7 @@ class FObject_protected : public finalcut::FObject count++; } - // Data Member + // Data member uInt count; }; #pragma pack(pop) @@ -107,7 +107,7 @@ class FObject_timer : public finalcut::FObject } private: - // Data Member + // Data member int value{0}; }; #pragma pack(pop) @@ -135,7 +135,7 @@ class FObject_userEvent : public finalcut::FObject } private: - // Data Member + // Data member int value{0}; }; #pragma pack(pop) diff --git a/test/ftermfreebsd-test.cpp b/test/ftermfreebsd-test.cpp index 1a5cb614..befb07c4 100644 --- a/test/ftermfreebsd-test.cpp +++ b/test/ftermfreebsd-test.cpp @@ -75,7 +75,7 @@ class FSystemTest : public finalcut::FSystem struct keymap_t& getTerminalKeymap(); private: - // Data Members + // Data members std::string characters; int cursor_type = 0; static keymap_t keymap; @@ -83,7 +83,7 @@ class FSystemTest : public finalcut::FSystem }; #pragma pack(pop) -// private Data Member of FSystemTest +// private data member of FSystemTest //---------------------------------------------------------------------- keymap_t FSystemTest::keymap = { diff --git a/test/ftermlinux-test.cpp b/test/ftermlinux-test.cpp index dec33acc..e81e7773 100644 --- a/test/ftermlinux-test.cpp +++ b/test/ftermlinux-test.cpp @@ -130,7 +130,7 @@ class FSystemTest : public finalcut::FSystem static void initVScreenInfo(); static void initFScreenInfo(); - // Data Members + // Data members std::string characters; static shiftstate shift_state; static rgb terminal_color[16]; @@ -158,7 +158,7 @@ class FSystemTest : public finalcut::FSystem #pragma pack(pop) -// private Data Member of FSystemTest +// private data member of FSystemTest //---------------------------------------------------------------------- uChar FSystemTest::vga8x16[] = {