diff --git a/src/gui/AboutDialog.cxx b/src/gui/AboutDialog.cxx index 47154b4ee..ba4a38081 100644 --- a/src/gui/AboutDialog.cxx +++ b/src/gui/AboutDialog.cxx @@ -25,10 +25,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AboutDialog::AboutDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font) - : Dialog(osystem, parent, font, "About Stella"), - myPage(1), - myNumPages(4), - myLinesPerPage(13) + : Dialog(osystem, parent, font, "About Stella") { const int lineHeight = font.getLineHeight(), fontWidth = font.getMaxCharWidth(), diff --git a/src/gui/AboutDialog.hxx b/src/gui/AboutDialog.hxx index a369d72f7..b2c063bbb 100644 --- a/src/gui/AboutDialog.hxx +++ b/src/gui/AboutDialog.hxx @@ -41,16 +41,16 @@ class AboutDialog : public Dialog void loadConfig() override { displayInfo(); } private: - ButtonWidget* myNextButton; - ButtonWidget* myPrevButton; + ButtonWidget* myNextButton{nullptr}; + ButtonWidget* myPrevButton{nullptr}; - StaticTextWidget* myTitle; - vector myDesc; + StaticTextWidget* myTitle{nullptr}; + vector myDesc{nullptr}; vector myDescStr; - int myPage; - int myNumPages; - int myLinesPerPage; + int myPage{1}; + int myNumPages{4}; + int myLinesPerPage{13}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/AudioDialog.hxx b/src/gui/AudioDialog.hxx index 1fff515d1..19a3c9cec 100644 --- a/src/gui/AudioDialog.hxx +++ b/src/gui/AudioDialog.hxx @@ -54,16 +54,16 @@ class AudioDialog : public Dialog kBufferSizeChanged = 'ADbc' }; - CheckboxWidget* mySoundEnableCheckbox; - SliderWidget* myVolumeSlider; - CheckboxWidget* myStereoSoundCheckbox; - PopUpWidget* myModePopup; - PopUpWidget* myFragsizePopup; - PopUpWidget* myFreqPopup; - PopUpWidget* myResamplingPopup; - SliderWidget* myHeadroomSlider; - SliderWidget* myBufferSizeSlider; - SliderWidget* myDpcPitch; + CheckboxWidget* mySoundEnableCheckbox{nullptr}; + SliderWidget* myVolumeSlider{nullptr}; + CheckboxWidget* myStereoSoundCheckbox{nullptr}; + PopUpWidget* myModePopup{nullptr}; + PopUpWidget* myFragsizePopup{nullptr}; + PopUpWidget* myFreqPopup{nullptr}; + PopUpWidget* myResamplingPopup{nullptr}; + SliderWidget* myHeadroomSlider{nullptr}; + SliderWidget* myBufferSizeSlider{nullptr}; + SliderWidget* myDpcPitch{nullptr}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/BrowserDialog.cxx b/src/gui/BrowserDialog.cxx index 040e7197f..89ae2b2b3 100644 --- a/src/gui/BrowserDialog.cxx +++ b/src/gui/BrowserDialog.cxx @@ -35,9 +35,7 @@ BrowserDialog::BrowserDialog(GuiObject* boss, const GUI::Font& font, int max_w, int max_h, const string& title) : Dialog(boss->instance(), boss->parent(), font, title), - CommandSender(boss), - _cmd(0), - _mode(FileSave) + CommandSender(boss) { // Set real dimensions _w = max_w; diff --git a/src/gui/BrowserDialog.hxx b/src/gui/BrowserDialog.hxx index 5a14ad834..906d81145 100644 --- a/src/gui/BrowserDialog.hxx +++ b/src/gui/BrowserDialog.hxx @@ -61,16 +61,16 @@ class BrowserDialog : public Dialog, public CommandSender kBaseDirCmd = 'BADR' }; - int _cmd; + int _cmd{0}; - FileListWidget* _fileList; - EditTextWidget* _currentPath; - StaticTextWidget* _type; - EditTextWidget* _selected; - ButtonWidget* _goUpButton; - ButtonWidget* _basedirButton; + FileListWidget* _fileList{nullptr}; + EditTextWidget* _currentPath{nullptr}; + StaticTextWidget* _type{nullptr}; + EditTextWidget* _selected{nullptr}; + ButtonWidget* _goUpButton{nullptr}; + ButtonWidget* _basedirButton{nullptr}; - BrowserDialog::ListMode _mode; + BrowserDialog::ListMode _mode{Directories}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/ColorWidget.cxx b/src/gui/ColorWidget.cxx index 86ee01260..7f3a98cb2 100644 --- a/src/gui/ColorWidget.cxx +++ b/src/gui/ColorWidget.cxx @@ -28,9 +28,7 @@ ColorWidget::ColorWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, int cmd) : Widget(boss, font, x, y, w, h), CommandSender(boss), - _color(kNone), - _cmd(cmd), - _crossGrid(false) + _cmd(cmd) { _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS; } diff --git a/src/gui/ColorWidget.hxx b/src/gui/ColorWidget.hxx index 19a6ebf4f..9de566dee 100644 --- a/src/gui/ColorWidget.hxx +++ b/src/gui/ColorWidget.hxx @@ -48,10 +48,10 @@ class ColorWidget : public Widget, public CommandSender void drawWidget(bool hilite) override; protected: - ColorId _color; - int _cmd; + ColorId _color{kNone}; + int _cmd{0}; - bool _crossGrid; + bool _crossGrid{false}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/ComboDialog.cxx b/src/gui/ComboDialog.cxx index 7f083f736..c6bce587e 100644 --- a/src/gui/ComboDialog.cxx +++ b/src/gui/ComboDialog.cxx @@ -29,8 +29,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font, const VariantList& combolist) - : Dialog(boss->instance(), boss->parent(), font, "Add..."), - myComboEvent(Event::NoType) + : Dialog(boss->instance(), boss->parent(), font, "Add...") { const int lineHeight = font.getLineHeight(), fontWidth = font.getMaxCharWidth(); diff --git a/src/gui/ComboDialog.hxx b/src/gui/ComboDialog.hxx index 7787a4682..94ee4d4ba 100644 --- a/src/gui/ComboDialog.hxx +++ b/src/gui/ComboDialog.hxx @@ -43,8 +43,8 @@ class ComboDialog : public Dialog void handleCommand(CommandSender* sender, int cmd, int data, int id) override; private: - Event::Type myComboEvent; - std::array myEvents; + Event::Type myComboEvent{Event::NoType}; + std::array myEvents{nullptr}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/Command.hxx b/src/gui/Command.hxx index 51766e239..339284c15 100644 --- a/src/gui/Command.hxx +++ b/src/gui/Command.hxx @@ -62,7 +62,7 @@ class CommandSender } protected: - CommandReceiver* _target; + CommandReceiver* _target{nullptr}; }; #endif diff --git a/src/gui/CommandDialog.hxx b/src/gui/CommandDialog.hxx index fc084fe2e..a7710d8a3 100644 --- a/src/gui/CommandDialog.hxx +++ b/src/gui/CommandDialog.hxx @@ -40,19 +40,19 @@ class CommandDialog : public Dialog void processCancel() override; // column 0 - ButtonWidget* myColorButton; - ButtonWidget* myLeftDiffButton; - ButtonWidget* myRightDiffButton; + ButtonWidget* myColorButton{nullptr}; + ButtonWidget* myLeftDiffButton{nullptr}; + ButtonWidget* myRightDiffButton{nullptr}; // column 1 - ButtonWidget* mySaveStateButton; - ButtonWidget* myStateSlotButton; - ButtonWidget* myLoadStateButton; - ButtonWidget* myTimeMachineButton; + ButtonWidget* mySaveStateButton{nullptr}; + ButtonWidget* myStateSlotButton{nullptr}; + ButtonWidget* myLoadStateButton{nullptr}; + ButtonWidget* myTimeMachineButton{nullptr}; // column 2 - ButtonWidget* myTVFormatButton; - ButtonWidget* myPaletteButton; - ButtonWidget* myPhosphorButton; - ButtonWidget* mySoundButton; + ButtonWidget* myTVFormatButton{nullptr}; + ButtonWidget* myPaletteButton{nullptr}; + ButtonWidget* myPhosphorButton{nullptr}; + ButtonWidget* mySoundButton{nullptr}; enum { kSelectCmd = 'Csel', diff --git a/src/gui/CommandMenu.cxx b/src/gui/CommandMenu.cxx index 664aefc18..75d8f0cb3 100644 --- a/src/gui/CommandMenu.cxx +++ b/src/gui/CommandMenu.cxx @@ -22,8 +22,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CommandMenu::CommandMenu(OSystem& osystem) - : DialogContainer(osystem), - myBaseDialog(nullptr) + : DialogContainer(osystem) { if (osystem.settings().getBool("minimal_ui")) myBaseDialog = new MinUICommandDialog(myOSystem, *this); diff --git a/src/gui/CommandMenu.hxx b/src/gui/CommandMenu.hxx index f8d431942..b3740d94f 100644 --- a/src/gui/CommandMenu.hxx +++ b/src/gui/CommandMenu.hxx @@ -43,7 +43,7 @@ class CommandMenu : public DialogContainer Dialog* baseDialog() override; private: - Dialog* myBaseDialog; + Dialog* myBaseDialog{nullptr}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/ContextMenu.cxx b/src/gui/ContextMenu.cxx index 8c88f85b2..b20498f2d 100644 --- a/src/gui/ContextMenu.cxx +++ b/src/gui/ContextMenu.cxx @@ -31,17 +31,7 @@ ContextMenu::ContextMenu(GuiObject* boss, const GUI::Font& font, : Dialog(boss->instance(), boss->parent(), font), CommandSender(boss), _rowHeight(font.getLineHeight()), - _firstEntry(0), - _numEntries(0), - _selectedOffset(0), - _selectedItem(-1), - _showScroll(false), - _isScrolling(false), - _scrollUpColor(kColor), - _scrollDnColor(kColor), _cmd(cmd), - _xorig(0), - _yorig(0), _maxWidth(width) { addItems(items); diff --git a/src/gui/ContextMenu.hxx b/src/gui/ContextMenu.hxx index 88bd6fe33..8827e8b03 100644 --- a/src/gui/ContextMenu.hxx +++ b/src/gui/ContextMenu.hxx @@ -113,17 +113,17 @@ class ContextMenu : public Dialog, public CommandSender private: VariantList _entries; - int _rowHeight; - int _firstEntry, _numEntries; - int _selectedOffset, _selectedItem; - bool _showScroll; - bool _isScrolling; - ColorId _scrollUpColor, _scrollDnColor; + int _rowHeight{0}; + int _firstEntry{0}, _numEntries{0}; + int _selectedOffset{0}, _selectedItem{-1}; + bool _showScroll{false}; + bool _isScrolling{false}; + ColorId _scrollUpColor{kColor}, _scrollDnColor{kColor}; - int _cmd; + int _cmd{0}; - uInt32 _xorig, _yorig; - uInt32 _maxWidth; + uInt32 _xorig{0}, _yorig{0}; + uInt32 _maxWidth{0}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/DeveloperDialog.hxx b/src/gui/DeveloperDialog.hxx index 854235cec..d69286f61 100644 --- a/src/gui/DeveloperDialog.hxx +++ b/src/gui/DeveloperDialog.hxx @@ -86,64 +86,64 @@ class DeveloperDialog : public Dialog static const int DEBUG_COLORS = 6; - TabWidget* myTab; + TabWidget* myTab{nullptr}; // Emulator widgets - RadioButtonGroup* mySettingsGroupEmulation; - CheckboxWidget* myFrameStatsWidget; - PopUpWidget* myConsoleWidget; - StaticTextWidget* myLoadingROMLabel; - CheckboxWidget* myRandomBankWidget; - CheckboxWidget* myRandomizeRAMWidget; - StaticTextWidget* myRandomizeCPULabel; - CheckboxWidget* myUndrivenPinsWidget; - std::array myRandomizeCPUWidget; + RadioButtonGroup* mySettingsGroupEmulation{nullptr}; + CheckboxWidget* myFrameStatsWidget{nullptr}; + PopUpWidget* myConsoleWidget{nullptr}; + StaticTextWidget* myLoadingROMLabel{nullptr}; + CheckboxWidget* myRandomBankWidget{nullptr}; + CheckboxWidget* myRandomizeRAMWidget{nullptr}; + StaticTextWidget* myRandomizeCPULabel{nullptr}; + CheckboxWidget* myUndrivenPinsWidget{nullptr}; + std::array myRandomizeCPUWidget{nullptr}; #ifdef DEBUGGER_SUPPORT - CheckboxWidget* myRWPortBreakWidget; - CheckboxWidget* myWRPortBreakWidget; + CheckboxWidget* myRWPortBreakWidget{nullptr}; + CheckboxWidget* myWRPortBreakWidget{nullptr}; #endif - CheckboxWidget* myThumbExceptionWidget; - CheckboxWidget* myEEPROMAccessWidget; + CheckboxWidget* myThumbExceptionWidget{nullptr}; + CheckboxWidget* myEEPROMAccessWidget{nullptr}; // TIA widgets - RadioButtonGroup* mySettingsGroupTia; - PopUpWidget* myTIATypeWidget; - StaticTextWidget* myInvPhaseLabel; - CheckboxWidget* myPlInvPhaseWidget; - CheckboxWidget* myMsInvPhaseWidget; - CheckboxWidget* myBlInvPhaseWidget; - StaticTextWidget* myPlayfieldLabel; - CheckboxWidget* myPFBitsWidget; - CheckboxWidget* myPFColorWidget; - StaticTextWidget* mySwapLabel; - CheckboxWidget* myPlSwapWidget; - CheckboxWidget* myBlSwapWidget; + RadioButtonGroup* mySettingsGroupTia{nullptr}; + PopUpWidget* myTIATypeWidget{nullptr}; + StaticTextWidget* myInvPhaseLabel{nullptr}; + CheckboxWidget* myPlInvPhaseWidget{nullptr}; + CheckboxWidget* myMsInvPhaseWidget{nullptr}; + CheckboxWidget* myBlInvPhaseWidget{nullptr}; + StaticTextWidget* myPlayfieldLabel{nullptr}; + CheckboxWidget* myPFBitsWidget{nullptr}; + CheckboxWidget* myPFColorWidget{nullptr}; + StaticTextWidget* mySwapLabel{nullptr}; + CheckboxWidget* myPlSwapWidget{nullptr}; + CheckboxWidget* myBlSwapWidget{nullptr}; // Video widgets - RadioButtonGroup* mySettingsGroupVideo; - CheckboxWidget* myTVJitterWidget; - SliderWidget* myTVJitterRecWidget; - StaticTextWidget* myTVJitterRecLabelWidget; - CheckboxWidget* myColorLossWidget; - CheckboxWidget* myDebugColorsWidget; - std::array myDbgColour; - std::array myDbgColourSwatch; + RadioButtonGroup* mySettingsGroupVideo{nullptr}; + CheckboxWidget* myTVJitterWidget{nullptr}; + SliderWidget* myTVJitterRecWidget{nullptr}; + StaticTextWidget* myTVJitterRecLabelWidget{nullptr}; + CheckboxWidget* myColorLossWidget{nullptr}; + CheckboxWidget* myDebugColorsWidget{nullptr}; + std::array myDbgColour{nullptr}; + std::array myDbgColourSwatch{nullptr}; // States widgets - RadioButtonGroup* mySettingsGroupTM; - CheckboxWidget* myTimeMachineWidget; - SliderWidget* myStateSizeWidget; - SliderWidget* myUncompressedWidget; - PopUpWidget* myStateIntervalWidget; - PopUpWidget* myStateHorizonWidget; - RadioButtonGroup* mySaveOnExitGroup; + RadioButtonGroup* mySettingsGroupTM{nullptr}; + CheckboxWidget* myTimeMachineWidget{nullptr}; + SliderWidget* myStateSizeWidget{nullptr}; + SliderWidget* myUncompressedWidget{nullptr}; + PopUpWidget* myStateIntervalWidget{nullptr}; + PopUpWidget* myStateHorizonWidget{nullptr}; + RadioButtonGroup* mySaveOnExitGroup{nullptr}; #ifdef DEBUGGER_SUPPORT // Debugger UI widgets - SliderWidget* myDebuggerWidthSlider; - SliderWidget* myDebuggerHeightSlider; - PopUpWidget* myDebuggerFontSize; - PopUpWidget* myDebuggerFontStyle; - CheckboxWidget* myGhostReadsTrapWidget; + SliderWidget* myDebuggerWidthSlider{nullptr}; + SliderWidget* myDebuggerHeightSlider{nullptr}; + PopUpWidget* myDebuggerFontSize{nullptr}; + PopUpWidget* myDebuggerFontStyle{nullptr}; + CheckboxWidget* myGhostReadsTrapWidget{nullptr}; #endif bool mySettings; diff --git a/src/gui/DialogContainer.cxx b/src/gui/DialogContainer.cxx index a5c505e6c..f9228df3a 100644 --- a/src/gui/DialogContainer.cxx +++ b/src/gui/DialogContainer.cxx @@ -27,13 +27,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DialogContainer::DialogContainer(OSystem& osystem) - : myOSystem(osystem), - myTime(0), - myClickRepeatTime(0), - myButtonRepeatTime(0), - myButtonLongPressTime(0), - myAxisRepeatTime(0), - myHatRepeatTime(0) + : myOSystem(osystem) { _DOUBLE_CLICK_DELAY = osystem.settings().getInt("mdouble"); _REPEAT_INITIAL_DELAY = osystem.settings().getInt("ctrldelay"); @@ -374,15 +368,12 @@ void DialogContainer::handleJoyHatEvent(int stick, int hat, JoyHatDir hdir, int // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void DialogContainer::reset() { - myCurrentMouseDown.b = MouseButton::NONE; - myLastClick.x = myLastClick.y = 0; - myLastClick.time = 0; - myLastClick.count = 0; + myCurrentMouseDown = { 0, 0, MouseButton::NONE }; + myCurrentButtonDown = { -1, -1 }; + myCurrentAxisDown = { -1, JoyAxis::NONE, JoyDir::NONE }; + myCurrentHatDown = { -1, -1, JoyHatDir::CENTER }; - myCurrentButtonDown.stick = myCurrentButtonDown.button = -1; - myCurrentAxisDown.stick = -1; - myCurrentAxisDown.axis = JoyAxis::NONE; - myCurrentHatDown.stick = myCurrentHatDown.hat = -1; + myLastClick = { 0, 0, 0, 0 }; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/DialogContainer.hxx b/src/gui/DialogContainer.hxx index 3cc175edd..8ed4ced42 100644 --- a/src/gui/DialogContainer.hxx +++ b/src/gui/DialogContainer.hxx @@ -183,7 +183,7 @@ class DialogContainer private: // Indicates the most current time (in milliseconds) as set by updateTime() - uInt64 myTime; + uInt64 myTime{0}; static uInt64 _DOUBLE_CLICK_DELAY; static uInt64 _REPEAT_INITIAL_DELAY; @@ -193,41 +193,41 @@ class DialogContainer // For continuous 'mouse down' events struct { - int x; - int y; - MouseButton b; + int x{0}; + int y{0}; + MouseButton b{MouseButton::NONE}; } myCurrentMouseDown; - uInt64 myClickRepeatTime; + uInt64 myClickRepeatTime{0}; // For continuous 'joy button down' events struct { - int stick; - int button; + int stick{-1}; + int button{-1}; } myCurrentButtonDown; - uInt64 myButtonRepeatTime; - uInt64 myButtonLongPressTime; + uInt64 myButtonRepeatTime{0}; + uInt64 myButtonLongPressTime{0}; // For continuous 'joy axis down' events struct { - int stick; - JoyAxis axis; - JoyDir adir; + int stick{-1}; + JoyAxis axis{JoyAxis::NONE}; + JoyDir adir{JoyDir::NONE}; } myCurrentAxisDown; - uInt64 myAxisRepeatTime; + uInt64 myAxisRepeatTime{0}; // For continuous 'joy hat' events struct { - int stick; - int hat; - JoyHatDir hdir; + int stick{-1}; + int hat{-1}; + JoyHatDir hdir{JoyHatDir::CENTER}; } myCurrentHatDown; - uInt64 myHatRepeatTime; + uInt64 myHatRepeatTime{0}; // Position and time of last mouse click (used to detect double clicks) struct { - int x, y; // Position of mouse when the click occurred - int count; // How often was it already pressed? - uInt64 time; // Time + int x{0}, y{0}; // Position of mouse when the click occurred + int count{0}; // How often was it already pressed? + uInt64 time{0}; // Time } myLastClick; private: diff --git a/src/gui/EditTextWidget.cxx b/src/gui/EditTextWidget.cxx index acd9aecc5..f4a1ff165 100644 --- a/src/gui/EditTextWidget.cxx +++ b/src/gui/EditTextWidget.cxx @@ -24,8 +24,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EditTextWidget::EditTextWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, const string& text) - : EditableWidget(boss, font, x, y, w, h + 2, text), - _changed(false) + : EditableWidget(boss, font, x, y, w, h + 2, text) { _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS; diff --git a/src/gui/EditTextWidget.hxx b/src/gui/EditTextWidget.hxx index 417e53a2c..e6d6b05fa 100644 --- a/src/gui/EditTextWidget.hxx +++ b/src/gui/EditTextWidget.hxx @@ -48,7 +48,7 @@ class EditTextWidget : public EditableWidget protected: string _backupString; - bool _changed; + bool _changed{false}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/EditableWidget.cxx b/src/gui/EditableWidget.cxx index 6c4ce7e95..e3b4e6d3b 100644 --- a/src/gui/EditableWidget.cxx +++ b/src/gui/EditableWidget.cxx @@ -21,30 +21,23 @@ #include "Font.hxx" #include "EditableWidget.hxx" +// Uncomment the following to give full-line copy/paste +// Note that this will be removed eventually, when we implement proper copy/paste +//#define PSEUDO_COPY_PASTE + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EditableWidget::EditableWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, const string& str) : Widget(boss, font, x, y, w, h), CommandSender(boss), - _editable(true), - _editString(str) + _editString(str), + _filter([](char c) { return isprint(c) && c != '\"'; }) { - _caretVisible = false; - _caretTime = 0; - _caretPos = 0; - - _caretInverse = false; - - _editScrollOffset = 0; - _bgcolor = kWidColor; _bgcolorhi = kWidColor; _bgcolorlo = kDlgColor; _textcolor = kTextColor; _textcolorhi = kTextColor; - - // By default, include all printable chars except quotes - _filter = [](char c) { return isprint(c) && c != '\"'; }; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -455,13 +448,17 @@ bool EditableWidget::moveWord(int direction) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void EditableWidget::copySelectedText() { -// _clippedText = _editString; +#if defined(PSEUDO_COPY_PASTE) + _clippedText = _editString; +#endif } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void EditableWidget::pasteSelectedText() { -// _editString = _clippedText; +#if defined(PSEUDO_COPY_PASTE) + _editString = _clippedText; +#endif } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/EditableWidget.hxx b/src/gui/EditableWidget.hxx index cdebcb647..d616ddf6d 100644 --- a/src/gui/EditableWidget.hxx +++ b/src/gui/EditableWidget.hxx @@ -95,17 +95,17 @@ class EditableWidget : public Widget, public CommandSender bool tryInsertChar(char c, int pos); private: - bool _editable; + bool _editable{true}; string _editString; - bool _caretVisible; - int _caretTime; - int _caretPos; +// bool _caretVisible{false}; +// int _caretTime{0}; + int _caretPos{0}; protected: - bool _caretInverse; + bool _caretInverse{false}; - int _editScrollOffset; + int _editScrollOffset{0}; static string _clippedText; diff --git a/src/gui/EventMappingWidget.cxx b/src/gui/EventMappingWidget.cxx index c21f48f5b..fcb7e3321 100644 --- a/src/gui/EventMappingWidget.cxx +++ b/src/gui/EventMappingWidget.cxx @@ -40,21 +40,7 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font, EventMode mode) : Widget(boss, font, x, y, w, h), CommandSender(boss), - myFilterPopup(nullptr), - myComboDialog(nullptr), - myEventMode(mode), - myEventGroup(Event::Group::Emulation), - myActionSelected(-1), - myRemapStatus(false), - myLastStick(0), - myLastHat(0), - myLastAxis(JoyAxis::NONE), - myLastDir(JoyDir::NONE), - myLastHatDir(JoyHatDir::CENTER), - myMod(0), - myLastKey(0), - myLastButton(JOY_CTRL_NONE), - myFirstTime(true) + myEventMode(mode) { const int fontHeight = font.getFontHeight(), lineHeight = font.getLineHeight(), @@ -139,8 +125,6 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font, VariantList combolist = instance().eventHandler().getComboList(mode); myComboDialog = new ComboDialog(boss, font, combolist); } - else - myComboButton = nullptr; // Show message for currently selected event xpos = HBORDER; diff --git a/src/gui/EventMappingWidget.hxx b/src/gui/EventMappingWidget.hxx index c199cbd53..d0cd8c228 100644 --- a/src/gui/EventMappingWidget.hxx +++ b/src/gui/EventMappingWidget.hxx @@ -81,49 +81,49 @@ class EventMappingWidget : public Widget, public CommandSender void enableButtons(bool state); private: - ButtonWidget* myMapButton; - ButtonWidget* myCancelMapButton; - ButtonWidget* myEraseButton; - ButtonWidget* myResetButton; - ButtonWidget* myComboButton; - PopUpWidget* myFilterPopup; - StringListWidget* myActionsList; - EditTextWidget* myKeyMapping; + ButtonWidget* myMapButton{nullptr}; + ButtonWidget* myCancelMapButton{nullptr}; + ButtonWidget* myEraseButton{nullptr}; + ButtonWidget* myResetButton{nullptr}; + ButtonWidget* myComboButton{nullptr}; + PopUpWidget* myFilterPopup{nullptr}; + StringListWidget* myActionsList{nullptr}; + EditTextWidget* myKeyMapping{nullptr}; - ComboDialog* myComboDialog; + ComboDialog* myComboDialog{nullptr}; // Since this widget can be used for different collections of events, // we need to specify exactly which group of events we are remapping - EventMode myEventMode; + EventMode myEventMode{EventMode::kEmulationMode}; // Since we can filter events, the event mode is not specific enough - Event::Group myEventGroup; + Event::Group myEventGroup{Event::Group::Emulation}; // Indicates the event that is currently selected - int myActionSelected; + int myActionSelected{-1}; // Indicates if we're currently in remap mode // In this mode, the next event received is remapped to some action - bool myRemapStatus; + bool myRemapStatus{false}; // Joystick axes and hats can be more problematic than ordinary buttons // or keys, in that there can be 'drift' in the values // Therefore, we map these events when they've been 'released', rather // than on their first occurrence (aka, when they're 'pressed') // As a result, we need to keep track of their old values - int myLastStick, myLastHat; - JoyAxis myLastAxis; - JoyDir myLastDir; - JoyHatDir myLastHatDir; + int myLastStick{0}, myLastHat{0}; + JoyAxis myLastAxis{JoyAxis::NONE}; + JoyDir myLastDir{JoyDir::NONE}; + JoyHatDir myLastHatDir{JoyHatDir::CENTER}; // Aggregates the modifier flags of the mapping - int myMod; + int myMod{0}; // Saves the last *pressed* key - int myLastKey; + int myLastKey{0}; // Saves the last *pressed* button - int myLastButton; + int myLastButton{JOY_CTRL_NONE}; - bool myFirstTime; + bool myFirstTime{true}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/FileListWidget.cxx b/src/gui/FileListWidget.cxx index a49b77939..954f7c9ca 100644 --- a/src/gui/FileListWidget.cxx +++ b/src/gui/FileListWidget.cxx @@ -27,15 +27,10 @@ FileListWidget::FileListWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) : StringListWidget(boss, font, x, y, w, h), - _fsmode(FilesystemNode::ListMode::All), - _selected(0), - _quickSelectTime(0) + _filter([](const FilesystemNode& node) { return true; }) { // This widget is special, in that it catches signals and redirects them setTarget(this); - - // By default, all filenames are valid - _filter = [](const FilesystemNode& node) { return true; }; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/gui/FileListWidget.hxx b/src/gui/FileListWidget.hxx index 6aebefa0c..bf6f9e13f 100644 --- a/src/gui/FileListWidget.hxx +++ b/src/gui/FileListWidget.hxx @@ -92,16 +92,16 @@ class FileListWidget : public StringListWidget void handleCommand(CommandSender* sender, int cmd, int data, int id) override; private: - FilesystemNode::ListMode _fsmode; + FilesystemNode::ListMode _fsmode{FilesystemNode::ListMode::All}; FilesystemNode::NameFilter _filter; FilesystemNode _node; FSList _fileList; Common::FixedStack _history; - uInt32 _selected; + uInt32 _selected{0}; string _quickSelectStr; - uInt64 _quickSelectTime; + uInt64 _quickSelectTime{0}; static uInt64 _QUICK_SELECT_DELAY; private: diff --git a/src/gui/GameInfoDialog.hxx b/src/gui/GameInfoDialog.hxx index a12c387e8..fd81339c7 100644 --- a/src/gui/GameInfoDialog.hxx +++ b/src/gui/GameInfoDialog.hxx @@ -58,49 +58,49 @@ class GameInfoDialog : public Dialog, public CommandSender void eraseEEPROM(); private: - TabWidget* myTab; + TabWidget* myTab{nullptr}; // Emulation properties - PopUpWidget* myBSType; - StaticTextWidget* myTypeDetected; - StaticTextWidget* myStartBankLabel; - PopUpWidget* myStartBank; - PopUpWidget* myFormat; - StaticTextWidget* myFormatDetected; - SliderWidget* myVCenter; - CheckboxWidget* myPhosphor; - SliderWidget* myPPBlend; - CheckboxWidget* mySound; + PopUpWidget* myBSType{nullptr}; + StaticTextWidget* myTypeDetected{nullptr}; + StaticTextWidget* myStartBankLabel{nullptr}; + PopUpWidget* myStartBank{nullptr}; + PopUpWidget* myFormat{nullptr}; + StaticTextWidget* myFormatDetected{nullptr}; + SliderWidget* myVCenter{nullptr}; + CheckboxWidget* myPhosphor{nullptr}; + SliderWidget* myPPBlend{nullptr}; + CheckboxWidget* mySound{nullptr}; // Console properties - RadioButtonGroup* myLeftDiffGroup; - RadioButtonGroup* myRightDiffGroup; - RadioButtonGroup* myTVTypeGroup; + RadioButtonGroup* myLeftDiffGroup{nullptr}; + RadioButtonGroup* myRightDiffGroup{nullptr}; + RadioButtonGroup* myTVTypeGroup{nullptr}; // Controller properties - StaticTextWidget* myLeftPortLabel; - StaticTextWidget* myRightPortLabel; - PopUpWidget* myLeftPort; - StaticTextWidget* myLeftPortDetected; - PopUpWidget* myRightPort; - StaticTextWidget* myRightPortDetected; - CheckboxWidget* mySwapPorts; - CheckboxWidget* mySwapPaddles; - StaticTextWidget* myEraseEEPROMLabel; - ButtonWidget* myEraseEEPROMButton; - StaticTextWidget* myEraseEEPROMInfo; - CheckboxWidget* myMouseControl; - PopUpWidget* myMouseX; - PopUpWidget* myMouseY; - SliderWidget* myMouseRange; + StaticTextWidget* myLeftPortLabel{nullptr}; + StaticTextWidget* myRightPortLabel{nullptr}; + PopUpWidget* myLeftPort{nullptr}; + StaticTextWidget* myLeftPortDetected{nullptr}; + PopUpWidget* myRightPort{nullptr}; + StaticTextWidget* myRightPortDetected{nullptr}; + CheckboxWidget* mySwapPorts{nullptr}; + CheckboxWidget* mySwapPaddles{nullptr}; + StaticTextWidget* myEraseEEPROMLabel{nullptr}; + ButtonWidget* myEraseEEPROMButton{nullptr}; + StaticTextWidget* myEraseEEPROMInfo{nullptr}; + CheckboxWidget* myMouseControl{nullptr}; + PopUpWidget* myMouseX{nullptr}; + PopUpWidget* myMouseY{nullptr}; + SliderWidget* myMouseRange{nullptr}; // Cartridge properties - EditTextWidget* myName; - EditTextWidget* myMD5; - EditTextWidget* myManufacturer; - EditTextWidget* myModelNo; - EditTextWidget* myRarity; - EditTextWidget* myNote; + EditTextWidget* myName{nullptr}; + EditTextWidget* myMD5{nullptr}; + EditTextWidget* myManufacturer{nullptr}; + EditTextWidget* myModelNo{nullptr}; + EditTextWidget* myRarity{nullptr}; + EditTextWidget* myNote{nullptr}; enum { kVCenterChanged = 'Vcch', diff --git a/src/gui/GlobalPropsDialog.hxx b/src/gui/GlobalPropsDialog.hxx index cb3e5b833..0b2bd0400 100644 --- a/src/gui/GlobalPropsDialog.hxx +++ b/src/gui/GlobalPropsDialog.hxx @@ -48,15 +48,15 @@ class GlobalPropsDialog : public Dialog, public CommandSender kJ1Up, kJ1Down, kJ1Left, kJ1Right, kJ1Fire }; - PopUpWidget* myBSType; - PopUpWidget* myLeftDiff; - PopUpWidget* myRightDiff; - PopUpWidget* myTVType; - PopUpWidget* myDebug; + PopUpWidget* myBSType{nullptr}; + PopUpWidget* myLeftDiff{nullptr}; + PopUpWidget* myRightDiff{nullptr}; + PopUpWidget* myTVType{nullptr}; + PopUpWidget* myDebug{nullptr}; - std::array myJoy; - CheckboxWidget* myHoldSelect; - CheckboxWidget* myHoldReset; + std::array myJoy{nullptr}; + CheckboxWidget* myHoldSelect{nullptr}; + CheckboxWidget* myHoldReset{nullptr}; static const std::array ourJoyState; diff --git a/src/gui/GuiObject.hxx b/src/gui/GuiObject.hxx index 0072e1c18..3521c7b8a 100644 --- a/src/gui/GuiObject.hxx +++ b/src/gui/GuiObject.hxx @@ -59,8 +59,7 @@ class GuiObject : public CommandReceiver : myOSystem(osystem), myParent(parent), myDialog(dialog), - _x(x), _y(y), _w(w), _h(h), - _firstWidget(nullptr) { } + _x(x), _y(y), _w(w), _h(h) { } virtual ~GuiObject() = default; @@ -104,9 +103,9 @@ class GuiObject : public CommandReceiver Dialog& myDialog; protected: - int _x, _y, _w, _h; + int _x{0}, _y{0}, _w{0}, _h{0}; - Widget* _firstWidget; + Widget* _firstWidget{nullptr}; WidgetArray _focusList; private: diff --git a/src/gui/HelpDialog.cxx b/src/gui/HelpDialog.cxx index b03700040..d0b714b89 100644 --- a/src/gui/HelpDialog.cxx +++ b/src/gui/HelpDialog.cxx @@ -26,9 +26,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font) - : Dialog(osystem, parent, font, "Help"), - myPage(1), - myNumPages(5) + : Dialog(osystem, parent, font, "Help") { const int lineHeight = font.getLineHeight(), fontWidth = font.getMaxCharWidth(), diff --git a/src/gui/HelpDialog.hxx b/src/gui/HelpDialog.hxx index a8f4ff7d3..52fb2a97e 100644 --- a/src/gui/HelpDialog.hxx +++ b/src/gui/HelpDialog.hxx @@ -41,17 +41,17 @@ class HelpDialog : public Dialog private: static constexpr uInt32 LINES_PER_PAGE = 10; - ButtonWidget* myNextButton; - ButtonWidget* myPrevButton; + ButtonWidget* myNextButton{nullptr}; + ButtonWidget* myPrevButton{nullptr}; StaticTextWidget* myTitle; - std::array myKey; - std::array myDesc; + std::array myKey{nullptr}; + std::array myDesc{nullptr}; std::array myKeyStr; std::array myDescStr; - uInt8 myPage; - uInt8 myNumPages; + uInt8 myPage{1}; + uInt8 myNumPages{5}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index 476633e98..63667e660 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -39,7 +39,6 @@ InputDialog::InputDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font, int max_w, int max_h) : Dialog(osystem, parent, font, "Input settings"), - myConfirmMsg(nullptr), myMaxWidth(max_w), myMaxHeight(max_h) { diff --git a/src/gui/InputDialog.hxx b/src/gui/InputDialog.hxx index 33431b267..8f2b891a6 100644 --- a/src/gui/InputDialog.hxx +++ b/src/gui/InputDialog.hxx @@ -76,34 +76,34 @@ class InputDialog : public Dialog kConfirmEEEraseCmd = 'EEcf' }; - TabWidget* myTab; + TabWidget* myTab{nullptr}; - EventMappingWidget* myEmulEventMapper; - EventMappingWidget* myMenuEventMapper; + EventMappingWidget* myEmulEventMapper{nullptr}; + EventMappingWidget* myMenuEventMapper{nullptr}; - CheckboxWidget* mySAPort; - PopUpWidget* myMouseControl; - PopUpWidget* myCursorState; + CheckboxWidget* mySAPort{nullptr}; + PopUpWidget* myMouseControl{nullptr}; + PopUpWidget* myCursorState{nullptr}; - EditTextWidget* myAVoxPort; + EditTextWidget* myAVoxPort{nullptr}; - SliderWidget* myDeadzone; - StaticTextWidget* myDeadzoneLabel; - SliderWidget* myDejitterBase; - SliderWidget* myDejitterDiff; - SliderWidget* myDPaddleSpeed; - SliderWidget* myMPaddleSpeed; - SliderWidget* myTrackBallSpeed; - StaticTextWidget* myDejitterLabel; - StaticTextWidget* myDPaddleLabel; - StaticTextWidget* myMPaddleLabel; - StaticTextWidget* myTrackBallLabel; - CheckboxWidget* myAllowAll4; - CheckboxWidget* myGrabMouse; - CheckboxWidget* myModCombo; + SliderWidget* myDeadzone{nullptr}; + StaticTextWidget* myDeadzoneLabel{nullptr}; + SliderWidget* myDejitterBase{nullptr}; + SliderWidget* myDejitterDiff{nullptr}; + SliderWidget* myDPaddleSpeed{nullptr}; + SliderWidget* myMPaddleSpeed{nullptr}; + SliderWidget* myTrackBallSpeed{nullptr}; + StaticTextWidget* myDejitterLabel{nullptr}; + StaticTextWidget* myDPaddleLabel{nullptr}; + StaticTextWidget* myMPaddleLabel{nullptr}; + StaticTextWidget* myTrackBallLabel{nullptr}; + CheckboxWidget* myAllowAll4{nullptr}; + CheckboxWidget* myGrabMouse{nullptr}; + CheckboxWidget* myModCombo{nullptr}; - ButtonWidget* myJoyDlgButton; - ButtonWidget* myEraseEEPROMButton; + ButtonWidget* myJoyDlgButton{nullptr}; + ButtonWidget* myEraseEEPROMButton{nullptr}; // Show the list of joysticks that the eventhandler knows about unique_ptr myJoyDialog; @@ -112,7 +112,7 @@ class InputDialog : public Dialog unique_ptr myConfirmMsg; // Maximum width and height for this dialog - int myMaxWidth, myMaxHeight; + int myMaxWidth{0}, myMaxHeight{0}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/InputTextDialog.cxx b/src/gui/InputTextDialog.cxx index 1ed10a81e..275508b4d 100644 --- a/src/gui/InputTextDialog.cxx +++ b/src/gui/InputTextDialog.cxx @@ -31,11 +31,7 @@ InputTextDialog::InputTextDialog(GuiObject* boss, const GUI::Font& font, const StringList& labels, const string& title) : Dialog(boss->instance(), boss->parent(), font, title), - CommandSender(boss), - myEnableCenter(false), - myErrorFlag(false), - myXOrig(0), - myYOrig(0) + CommandSender(boss) { initialize(font, font, labels); } diff --git a/src/gui/InputTextDialog.hxx b/src/gui/InputTextDialog.hxx index 6b8ef2eac..79aee65a8 100644 --- a/src/gui/InputTextDialog.hxx +++ b/src/gui/InputTextDialog.hxx @@ -61,13 +61,13 @@ class InputTextDialog : public Dialog, public CommandSender private: vector myInput; - StaticTextWidget* myMessage; + StaticTextWidget* myMessage{nullptr}; - bool myEnableCenter; - bool myErrorFlag; - int myCmd; + bool myEnableCenter{false}; + bool myErrorFlag{false}; + int myCmd{0}; - uInt32 myXOrig, myYOrig; + uInt32 myXOrig{0}, myYOrig{0}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/JoystickDialog.hxx b/src/gui/JoystickDialog.hxx index 6b0cb5615..5941ce4f6 100644 --- a/src/gui/JoystickDialog.hxx +++ b/src/gui/JoystickDialog.hxx @@ -45,11 +45,11 @@ class JoystickDialog : public Dialog void handleCommand(CommandSender* sender, int cmd, int data, int id) override; private: - StringListWidget* myJoyList; - EditTextWidget* myJoyText; + StringListWidget* myJoyList{nullptr}; + EditTextWidget* myJoyText{nullptr}; - ButtonWidget* myRemoveBtn; - ButtonWidget* myCloseBtn; + ButtonWidget* myRemoveBtn{nullptr}; + ButtonWidget* myCloseBtn{nullptr}; IntArray myJoyIDs; diff --git a/src/gui/Launcher.cxx b/src/gui/Launcher.cxx index 1ee2c895a..bec26916e 100644 --- a/src/gui/Launcher.cxx +++ b/src/gui/Launcher.cxx @@ -27,8 +27,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Launcher::Launcher(OSystem& osystem) - : DialogContainer(osystem), - myBaseDialog(nullptr) + : DialogContainer(osystem) { const Common::Size& s = myOSystem.settings().getSize("launcherres"); const Common::Size& d = myOSystem.frameBuffer().desktopSize(); diff --git a/src/gui/Launcher.hxx b/src/gui/Launcher.hxx index 537ff61ef..45b51f2b2 100644 --- a/src/gui/Launcher.hxx +++ b/src/gui/Launcher.hxx @@ -70,11 +70,11 @@ class Launcher : public DialogContainer Dialog* baseDialog() override; private: - Dialog* myBaseDialog; + Dialog* myBaseDialog{nullptr}; // The width and height of this dialog - uInt32 myWidth; - uInt32 myHeight; + uInt32 myWidth{0}; + uInt32 myHeight{0}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 1b8b3795b..5a9435c99 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -46,17 +46,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent, int x, int y, int w, int h) - : Dialog(osystem, parent, x, y, w, h), - myStartButton(nullptr), - myPrevDirButton(nullptr), - myOptionsButton(nullptr), - myQuitButton(nullptr), - myList(nullptr), - myPattern(nullptr), - myAllFiles(nullptr), - myRomInfoWidget(nullptr), - mySelectedItem(0), - myEventHandled(false) + : Dialog(osystem, parent, x, y, w, h) { myUseMinimalUI = instance().settings().getBool("minimal_ui"); diff --git a/src/gui/LauncherDialog.hxx b/src/gui/LauncherDialog.hxx index fa1a6a0d2..8633f0831 100644 --- a/src/gui/LauncherDialog.hxx +++ b/src/gui/LauncherDialog.hxx @@ -111,26 +111,26 @@ class LauncherDialog : public Dialog unique_ptr myGlobalProps; unique_ptr myRomDir; - ButtonWidget* myStartButton; - ButtonWidget* myPrevDirButton; - ButtonWidget* myOptionsButton; - ButtonWidget* myQuitButton; + ButtonWidget* myStartButton{nullptr}; + ButtonWidget* myPrevDirButton{nullptr}; + ButtonWidget* myOptionsButton{nullptr}; + ButtonWidget* myQuitButton{nullptr}; - FileListWidget* myList; - StaticTextWidget* myDirLabel; - EditTextWidget* myDir; - StaticTextWidget* myRomCount; - EditTextWidget* myPattern; - CheckboxWidget* myAllFiles; + FileListWidget* myList{nullptr}; + StaticTextWidget* myDirLabel{nullptr}; + EditTextWidget* myDir{nullptr}; + StaticTextWidget* myRomCount{nullptr}; + EditTextWidget* myPattern{nullptr}; + CheckboxWidget* myAllFiles{nullptr}; - RomInfoWidget* myRomInfoWidget; + RomInfoWidget* myRomInfoWidget{nullptr}; std::unordered_map myMD5List; - int mySelectedItem; + int mySelectedItem{0}; - bool myShowOnlyROMs; - bool myUseMinimalUI; - bool myEventHandled; + bool myShowOnlyROMs{false}; + bool myUseMinimalUI{false}; + bool myEventHandled{false}; enum { kAllfilesCmd = 'lalf', // show all files (or ROMs only) diff --git a/src/gui/ListWidget.cxx b/src/gui/ListWidget.cxx index a798ec284..de9a45d61 100644 --- a/src/gui/ListWidget.cxx +++ b/src/gui/ListWidget.cxx @@ -27,13 +27,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ListWidget::ListWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) - : EditableWidget(boss, font, x, y, 16, 16), - _rows(0), - _cols(0), - _currentPos(0), - _selectedItem(-1), - _highlightedItem(-1), - _editMode(false) + : EditableWidget(boss, font, x, y, 16, 16) { _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG | Widget::FLAG_RETAIN_FOCUS; _bgcolor = kWidColor; diff --git a/src/gui/ListWidget.hxx b/src/gui/ListWidget.hxx index 88ce7f646..bec316fca 100644 --- a/src/gui/ListWidget.hxx +++ b/src/gui/ListWidget.hxx @@ -94,14 +94,14 @@ class ListWidget : public EditableWidget void scrollToCurrent(int item); protected: - int _rows; - int _cols; - int _currentPos; - int _selectedItem; - int _highlightedItem; - bool _editMode; + int _rows{0}; + int _cols{0}; + int _currentPos{0}; + int _selectedItem{-1}; + int _highlightedItem{-1}; + bool _editMode{false}; - ScrollBarWidget* _scrollBar; + ScrollBarWidget* _scrollBar{nullptr}; StringList _list; diff --git a/src/gui/LoggerDialog.cxx b/src/gui/LoggerDialog.cxx index 624174238..672de8456 100644 --- a/src/gui/LoggerDialog.cxx +++ b/src/gui/LoggerDialog.cxx @@ -34,8 +34,7 @@ LoggerDialog::LoggerDialog(OSystem& osystem, DialogContainer& parent, const GUI::Font& font, int max_w, int max_h, bool uselargefont) - : Dialog(osystem, parent, font, "System logs"), - myLogInfo(nullptr) + : Dialog(osystem, parent, font, "System logs") { const int lineHeight = font.getLineHeight(), buttonWidth = font.getStringWidth("Save log to disk") + 20, diff --git a/src/gui/LoggerDialog.hxx b/src/gui/LoggerDialog.hxx index c4b814619..56fbe96b1 100644 --- a/src/gui/LoggerDialog.hxx +++ b/src/gui/LoggerDialog.hxx @@ -42,9 +42,9 @@ class LoggerDialog : public Dialog void handleCommand(CommandSender* sender, int cmd, int data, int id) override; private: - StringListWidget* myLogInfo; - PopUpWidget* myLogLevel; - CheckboxWidget* myLogToConsole; + StringListWidget* myLogInfo{nullptr}; + PopUpWidget* myLogLevel{nullptr}; + CheckboxWidget* myLogToConsole{nullptr}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/Menu.cxx b/src/gui/Menu.cxx index f50fd5200..88e47d05f 100644 --- a/src/gui/Menu.cxx +++ b/src/gui/Menu.cxx @@ -25,9 +25,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Menu::Menu(OSystem& osystem) - : DialogContainer(osystem), - stellaSettingDialog(nullptr), - optionsDialog(nullptr) + : DialogContainer(osystem) { } diff --git a/src/gui/Menu.hxx b/src/gui/Menu.hxx index cc9da0daa..95e8d0370 100644 --- a/src/gui/Menu.hxx +++ b/src/gui/Menu.hxx @@ -43,8 +43,8 @@ class Menu : public DialogContainer private: Dialog* baseDialog() override; - StellaSettingsDialog* stellaSettingDialog; - OptionsDialog* optionsDialog; + StellaSettingsDialog* stellaSettingDialog{nullptr}; + OptionsDialog* optionsDialog{nullptr}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/MessageBox.hxx b/src/gui/MessageBox.hxx index a0aa0a2be..7b97afd52 100644 --- a/src/gui/MessageBox.hxx +++ b/src/gui/MessageBox.hxx @@ -54,7 +54,7 @@ class MessageBox : public Dialog, public CommandSender void handleCommand(CommandSender* sender, int cmd, int data, int id) override; private: - int myCmd; + int myCmd{0}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/MinUICommandDialog.cxx b/src/gui/MinUICommandDialog.cxx index 8b31d26c2..7713b98b6 100644 --- a/src/gui/MinUICommandDialog.cxx +++ b/src/gui/MinUICommandDialog.cxx @@ -33,9 +33,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MinUICommandDialog::MinUICommandDialog(OSystem& osystem, DialogContainer& parent) - : Dialog(osystem, parent, osystem.frameBuffer().font(), "Commands"), - myStellaSettingsDialog(nullptr), - myOptionsDialog(nullptr) + : Dialog(osystem, parent, osystem.frameBuffer().font(), "Commands") { const int HBORDER = 10; const int VBORDER = 10; diff --git a/src/gui/MinUICommandDialog.hxx b/src/gui/MinUICommandDialog.hxx index 7b997f239..6afe2836e 100644 --- a/src/gui/MinUICommandDialog.hxx +++ b/src/gui/MinUICommandDialog.hxx @@ -44,19 +44,19 @@ class MinUICommandDialog : public Dialog void processCancel() override; // column 0 - ButtonWidget* myColorButton; - ButtonWidget* myLeftDiffButton; - ButtonWidget* myRightDiffButton; + ButtonWidget* myColorButton{nullptr}; + ButtonWidget* myLeftDiffButton{nullptr}; + ButtonWidget* myRightDiffButton{nullptr}; // column 1 - ButtonWidget* mySaveStateButton; - ButtonWidget* myStateSlotButton; - ButtonWidget* myLoadStateButton; - ButtonWidget* myRewindButton; - ButtonWidget* myUnwindButton; + ButtonWidget* mySaveStateButton{nullptr}; + ButtonWidget* myStateSlotButton{nullptr}; + ButtonWidget* myLoadStateButton{nullptr}; + ButtonWidget* myRewindButton{nullptr}; + ButtonWidget* myUnwindButton{nullptr}; // column 2 - ButtonWidget* myTVFormatButton; - ButtonWidget* myStretchButton; - ButtonWidget* myPhosphorButton; + ButtonWidget* myTVFormatButton{nullptr}; + ButtonWidget* myStretchButton{nullptr}; + ButtonWidget* myPhosphorButton{nullptr}; unique_ptr myStellaSettingsDialog; unique_ptr myOptionsDialog; diff --git a/src/gui/OptionsDialog.hxx b/src/gui/OptionsDialog.hxx index 3f91ecc79..b569e9b87 100644 --- a/src/gui/OptionsDialog.hxx +++ b/src/gui/OptionsDialog.hxx @@ -67,12 +67,12 @@ class OptionsDialog : public Dialog unique_ptr myHelpDialog; unique_ptr myAboutDialog; - ButtonWidget* myRomAuditButton; - ButtonWidget* myGameInfoButton; - ButtonWidget* myCheatCodeButton; + ButtonWidget* myRomAuditButton{nullptr}; + ButtonWidget* myGameInfoButton{nullptr}; + ButtonWidget* myCheatCodeButton{nullptr}; // Indicates if this dialog is used for global (vs. in-game) settings - Menu::AppMode myMode; + Menu::AppMode myMode{Menu::AppMode::emulator}; enum { kBasSetCmd = 'BAST', diff --git a/src/gui/PopUpWidget.cxx b/src/gui/PopUpWidget.cxx index afbed7cb0..fd1746d9d 100644 --- a/src/gui/PopUpWidget.cxx +++ b/src/gui/PopUpWidget.cxx @@ -30,8 +30,7 @@ PopUpWidget::PopUpWidget(GuiObject* boss, const GUI::Font& font, : Widget(boss, font, x, y - 1, w, h + 2), CommandSender(boss), _label(label), - _labelWidth(labelWidth), - _changed(false) + _labelWidth(labelWidth) { _flags = Widget::FLAG_ENABLED | Widget::FLAG_RETAIN_FOCUS; _bgcolor = kDlgColor; diff --git a/src/gui/PopUpWidget.hxx b/src/gui/PopUpWidget.hxx index df17338d0..f0d464dec 100644 --- a/src/gui/PopUpWidget.hxx +++ b/src/gui/PopUpWidget.hxx @@ -72,12 +72,12 @@ class PopUpWidget : public Widget, public CommandSender private: unique_ptr myMenu; - int myArrowsY; - int myTextY; + int myArrowsY{0}; + int myTextY{0}; string _label; - int _labelWidth; - bool _changed; + int _labelWidth{0}; + bool _changed{false}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/ProgressDialog.cxx b/src/gui/ProgressDialog.cxx index d7e9f21de..3ebaf2b37 100644 --- a/src/gui/ProgressDialog.cxx +++ b/src/gui/ProgressDialog.cxx @@ -27,12 +27,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ProgressDialog::ProgressDialog(GuiObject* boss, const GUI::Font& font, const string& message) - : Dialog(boss->instance(), boss->parent()), - myMessage(nullptr), - mySlider(nullptr), - myStart(0), - myFinish(0), - myStep(0) + : Dialog(boss->instance(), boss->parent()) { const int fontWidth = font.getMaxCharWidth(), fontHeight = font.getFontHeight(), diff --git a/src/gui/ProgressDialog.hxx b/src/gui/ProgressDialog.hxx index a240dbf83..110f5758a 100644 --- a/src/gui/ProgressDialog.hxx +++ b/src/gui/ProgressDialog.hxx @@ -36,10 +36,10 @@ class ProgressDialog : public Dialog void setProgress(int progress); private: - StaticTextWidget* myMessage; - SliderWidget* mySlider; + StaticTextWidget* myMessage{nullptr}; + SliderWidget* mySlider{nullptr}; - int myStart, myFinish, myStep; + int myStart{0}, myFinish{0}, myStep{0}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/R77HelpDialog.cxx b/src/gui/R77HelpDialog.cxx index 9223e075b..1cf8345f6 100644 --- a/src/gui/R77HelpDialog.cxx +++ b/src/gui/R77HelpDialog.cxx @@ -24,10 +24,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - R77HelpDialog::R77HelpDialog(OSystem& osystem, DialogContainer& parent, - const GUI::Font& font) - : Dialog(osystem, parent, font, "RetroN 77 help"), - myPage(1), - myNumPages(4) + const GUI::Font& font) + : Dialog(osystem, parent, font, "RetroN 77 help") { const int lineHeight = font.getLineHeight(), fontWidth = font.getMaxCharWidth(), diff --git a/src/gui/R77HelpDialog.hxx b/src/gui/R77HelpDialog.hxx index 40789039f..3519e32ee 100644 --- a/src/gui/R77HelpDialog.hxx +++ b/src/gui/R77HelpDialog.hxx @@ -42,19 +42,19 @@ class R77HelpDialog : public Dialog private: static constexpr uInt32 LINES_PER_PAGE = 11; - ButtonWidget* myNextButton; - ButtonWidget* myPrevButton; + ButtonWidget* myNextButton{nullptr}; + ButtonWidget* myPrevButton{nullptr}; - StaticTextWidget* myTitle; - std::array myJoy; - std::array myBtn; - std::array myDesc; + StaticTextWidget* myTitle{nullptr}; + std::array myJoy{nullptr}; + std::array myBtn{nullptr}; + std::array myDesc{nullptr}; std::array myJoyStr; std::array myBtnStr; std::array myDescStr; - uInt8 myPage; - uInt8 myNumPages; + uInt8 myPage{1}; + uInt8 myNumPages{4}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/RadioButtonWidget.cxx b/src/gui/RadioButtonWidget.cxx index 65ea729a9..f86adf148 100644 --- a/src/gui/RadioButtonWidget.cxx +++ b/src/gui/RadioButtonWidget.cxx @@ -46,8 +46,7 @@ static constexpr std::array radio_img_inactive = { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RadioButtonWidget::RadioButtonWidget(GuiObject* boss, const GUI::Font& font, int x, int y, const string& label, - RadioButtonGroup* group, - int cmd) + RadioButtonGroup* group, int cmd) : CheckboxWidget(boss, font, x, y, label, cmd), myGroup(group) { @@ -62,7 +61,6 @@ RadioButtonWidget::RadioButtonWidget(GuiObject* boss, const GUI::Font& font, _w = font.getStringWidth(label) + 20; _h = font.getFontHeight() < 14 ? 14 : font.getFontHeight(); - // Depending on font size, either the font or box will need to be // centered vertically if(_h > 14) // center box diff --git a/src/gui/RadioButtonWidget.hxx b/src/gui/RadioButtonWidget.hxx index 462d42692..838ac5557 100644 --- a/src/gui/RadioButtonWidget.hxx +++ b/src/gui/RadioButtonWidget.hxx @@ -42,7 +42,7 @@ class RadioButtonWidget : public CheckboxWidget void drawWidget(bool hilite) override; private: - RadioButtonGroup* myGroup; + RadioButtonGroup* myGroup{nullptr}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/RomAuditDialog.hxx b/src/gui/RomAuditDialog.hxx index fbd82e693..8db60fe7b 100644 --- a/src/gui/RomAuditDialog.hxx +++ b/src/gui/RomAuditDialog.hxx @@ -57,17 +57,17 @@ class RomAuditDialog : public Dialog const GUI::Font& myFont; // ROM audit path - EditTextWidget* myRomPath; + EditTextWidget* myRomPath{nullptr}; // Show the results of the ROM audit - EditTextWidget* myResults1; - EditTextWidget* myResults2; + EditTextWidget* myResults1{nullptr}; + EditTextWidget* myResults2{nullptr}; // Show a message about the dangers of using this function unique_ptr myConfirmMsg; // Maximum width and height for this dialog - int myMaxWidth, myMaxHeight; + int myMaxWidth{0}, myMaxHeight{0}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/RomInfoWidget.cxx b/src/gui/RomInfoWidget.cxx index c6914dc57..08e2eb926 100644 --- a/src/gui/RomInfoWidget.cxx +++ b/src/gui/RomInfoWidget.cxx @@ -36,8 +36,6 @@ RomInfoWidget::RomInfoWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) : Widget(boss, font, x, y, w, h), - mySurfaceIsValid(false), - myHaveProperties(false), myAvail(w > 400 ? Common::Size(TIAConstants::viewableWidth*2, TIAConstants::viewableHeight*2) : Common::Size(TIAConstants::viewableWidth, TIAConstants::viewableHeight)) diff --git a/src/gui/RomInfoWidget.hxx b/src/gui/RomInfoWidget.hxx index ff893266f..608724f40 100644 --- a/src/gui/RomInfoWidget.hxx +++ b/src/gui/RomInfoWidget.hxx @@ -49,7 +49,7 @@ class RomInfoWidget : public Widget shared_ptr mySurface; // Whether the surface should be redrawn by drawWidget() - bool mySurfaceIsValid; + bool mySurfaceIsValid{false}; // Some ROM properties info, as well as 'tEXt' chunks from the PNG image StringList myRomInfo; @@ -58,7 +58,7 @@ class RomInfoWidget : public Widget Properties myProperties; // Indicates if the current properties should actually be used - bool myHaveProperties; + bool myHaveProperties{false}; // Indicates if an error occurred in creating/displaying the surface string mySurfaceErrorMsg; diff --git a/src/gui/ScrollBarWidget.cxx b/src/gui/ScrollBarWidget.cxx index 0fcf10946..02ad1acb3 100644 --- a/src/gui/ScrollBarWidget.cxx +++ b/src/gui/ScrollBarWidget.cxx @@ -33,16 +33,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ScrollBarWidget::ScrollBarWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) - : Widget(boss, font, x, y, w, h), CommandSender(boss), - _numEntries(0), - _entriesPerPage(0), - _currentPos(0), - _wheel_lines(0), - _part(kNoPart), - _draggingPart(kNoPart), - _sliderHeight(0), - _sliderPos(0), - _sliderDeltaMouseDownPos(0) + : Widget(boss, font, x, y, w, h), CommandSender(boss) { _flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE | Widget::FLAG_CLEARBG; _bgcolor = kWidColor; @@ -54,7 +45,7 @@ void ScrollBarWidget::handleMouseDown(int x, int y, MouseButton b, int clickCount) { // Ignore subsequent mouse clicks when the slider is being moved - if(_draggingPart == kSliderPart) + if(_draggingPart == Part::Slider) return; int old_pos = _currentPos; @@ -67,13 +58,13 @@ void ScrollBarWidget::handleMouseDown(int x, int y, MouseButton b, { // Up arrow _currentPos--; - _draggingPart = kUpArrowPart; + _draggingPart = Part::UpArrow; } else if(y >= _h - UP_DOWN_BOX_HEIGHT) { // Down arrow _currentPos++; - _draggingPart = kDownArrowPart; + _draggingPart = Part::DownArrow; } else if(y < _sliderPos) { @@ -85,7 +76,7 @@ void ScrollBarWidget::handleMouseDown(int x, int y, MouseButton b, } else { - _draggingPart = kSliderPart; + _draggingPart = Part::Slider; _sliderDeltaMouseDownPos = y - _sliderPos; } @@ -97,7 +88,7 @@ void ScrollBarWidget::handleMouseDown(int x, int y, MouseButton b, void ScrollBarWidget::handleMouseUp(int x, int y, MouseButton b, int clickCount) { - _draggingPart = kNoPart; + _draggingPart = Part::None; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -124,7 +115,7 @@ void ScrollBarWidget::handleMouseMoved(int x, int y) if(_numEntries <= _entriesPerPage) return; - if(_draggingPart == kSliderPart) + if(_draggingPart == Part::Slider) { int old_pos = _currentPos; _sliderPos = y - _sliderDeltaMouseDownPos; @@ -141,18 +132,18 @@ void ScrollBarWidget::handleMouseMoved(int x, int y) } else { - int old_part = _part; + Part old_part = _part; if(y <= UP_DOWN_BOX_HEIGHT) // Up arrow - _part = kUpArrowPart; + _part = Part::UpArrow; else if(y >= _h - UP_DOWN_BOX_HEIGHT) // Down arrow - _part = kDownArrowPart; + _part = Part::DownArrow; else if(y < _sliderPos) - _part = kPageUpPart; + _part = Part::PageUp; else if(y >= _sliderPos + _sliderHeight) - _part = kPageDownPart; + _part = Part::PageDown; else - _part = kSliderPart; + _part = Part::Slider; if (old_part != _part) setDirty(); @@ -191,7 +182,7 @@ void ScrollBarWidget::handleMouseEntered() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void ScrollBarWidget::handleMouseLeft() { - _part = kNoPart; + _part = Part::None; clearFlags(Widget::FLAG_HILITED); setDirty(); } @@ -255,28 +246,28 @@ void ScrollBarWidget::drawWidget(bool hilite) s.frameRect(_x, _y, _w, _h, hilite ? kWidColorHi : kColor); - if(_draggingPart != kNoPart) + if(_draggingPart != Part::None) _part = _draggingPart; // Up arrow - if(hilite && _part == kUpArrowPart) + if(hilite && _part == Part::UpArrow) s.fillRect(_x + 1, _y + 1, _w - 2, UP_DOWN_BOX_HEIGHT - 2, kScrollColor); s.drawBitmap(up_arrow.data(), _x+4, _y+5, - onTop ? isSinglePage ? kColor : (hilite && _part == kUpArrowPart) ? kWidColor + onTop ? isSinglePage ? kColor : (hilite && _part == Part::UpArrow) ? kWidColor : kTextColor : kColor, 8); // Down arrow - if(hilite && _part == kDownArrowPart) + if(hilite && _part == Part::DownArrow) s.fillRect(_x + 1, bottomY - UP_DOWN_BOX_HEIGHT + 1, _w - 2, UP_DOWN_BOX_HEIGHT - 2, kScrollColor); s.drawBitmap(down_arrow.data(), _x+4, bottomY - UP_DOWN_BOX_HEIGHT + 5, - onTop ? isSinglePage ? kColor : (hilite && _part == kDownArrowPart) ? + onTop ? isSinglePage ? kColor : (hilite && _part == Part::DownArrow) ? kWidColor : kTextColor : kColor, 8); // Slider if(!isSinglePage) { s.fillRect(_x + 1, _y + _sliderPos - 1, _w - 2, _sliderHeight + 2, - onTop ? (hilite && _part == kSliderPart) ? kScrollColorHi : kScrollColor : kColor); + onTop ? (hilite && _part == Part::Slider) ? kScrollColorHi : kScrollColor : kColor); } } diff --git a/src/gui/ScrollBarWidget.hxx b/src/gui/ScrollBarWidget.hxx index c44a0a638..f6f0fb2d6 100644 --- a/src/gui/ScrollBarWidget.hxx +++ b/src/gui/ScrollBarWidget.hxx @@ -53,26 +53,19 @@ class ScrollBarWidget : public Widget, public CommandSender void handleMouseLeft() override; public: - int _numEntries; - int _entriesPerPage; - int _currentPos; - int _wheel_lines; + int _numEntries{0}; + int _entriesPerPage{0}; + int _currentPos{0}; + int _wheel_lines{0}; private: - enum Part { - kNoPart, - kUpArrowPart, - kDownArrowPart, - kSliderPart, - kPageUpPart, - kPageDownPart - }; + enum class Part { None, UpArrow, DownArrow, Slider, PageUp, PageDown }; - Part _part; - Part _draggingPart; - int _sliderHeight; - int _sliderPos; - int _sliderDeltaMouseDownPos; + Part _part{Part::None}; + Part _draggingPart{Part::None}; + int _sliderHeight{0}; + int _sliderPos{0}; + int _sliderDeltaMouseDownPos{0}; static int _WHEEL_LINES; diff --git a/src/gui/SnapshotDialog.hxx b/src/gui/SnapshotDialog.hxx index 88cf25363..65d775e8f 100644 --- a/src/gui/SnapshotDialog.hxx +++ b/src/gui/SnapshotDialog.hxx @@ -55,13 +55,13 @@ class SnapshotDialog : public Dialog const GUI::Font& myFont; // Config paths - EditTextWidget* mySnapSavePath; + EditTextWidget* mySnapSavePath{nullptr}; - CheckboxWidget* mySnapName; - SliderWidget* mySnapInterval; + CheckboxWidget* mySnapName{nullptr}; + SliderWidget* mySnapInterval{nullptr}; - CheckboxWidget* mySnapSingle; - CheckboxWidget* mySnap1x; + CheckboxWidget* mySnapSingle{nullptr}; + CheckboxWidget* mySnap1x{nullptr}; unique_ptr myBrowser; diff --git a/src/gui/StellaSettingsDialog.hxx b/src/gui/StellaSettingsDialog.hxx index e5b70b607..ec1e8cfa0 100644 --- a/src/gui/StellaSettingsDialog.hxx +++ b/src/gui/StellaSettingsDialog.hxx @@ -70,30 +70,30 @@ class StellaSettingsDialog : public Dialog private: // UI theme - PopUpWidget* myThemePopup; - PopUpWidget* myPositionPopup; + PopUpWidget* myThemePopup{nullptr}; + PopUpWidget* myPositionPopup{nullptr}; // TV effects - PopUpWidget* myTVMode; + PopUpWidget* myTVMode{nullptr}; // TV scanline intensity - SliderWidget* myTVScanIntense; + SliderWidget* myTVScanIntense{nullptr}; // TV phosphor effect - SliderWidget* myTVPhosLevel; + SliderWidget* myTVPhosLevel{nullptr}; // TV Overscan - SliderWidget* myTVOverscan; + SliderWidget* myTVOverscan{nullptr}; // Controller properties - StaticTextWidget* myGameSettings; + StaticTextWidget* myGameSettings{nullptr}; - StaticTextWidget* myLeftPortLabel; - StaticTextWidget* myRightPortLabel; - PopUpWidget* myLeftPort; - StaticTextWidget* myLeftPortDetected; - PopUpWidget* myRightPort; - StaticTextWidget* myRightPortDetected; + StaticTextWidget* myLeftPortLabel{nullptr}; + StaticTextWidget* myRightPortLabel{nullptr}; + PopUpWidget* myLeftPort{nullptr}; + StaticTextWidget* myLeftPortDetected{nullptr}; + PopUpWidget* myRightPort{nullptr}; + StaticTextWidget* myRightPortDetected{nullptr}; unique_ptr myConfirmMsg; #if defined(RETRON77) @@ -103,7 +103,7 @@ class StellaSettingsDialog : public Dialog #endif // Indicates if this dialog is used for global (vs. in-game) settings - Menu::AppMode myMode; + Menu::AppMode myMode{Menu::AppMode::emulator}; enum { kAdvancedSettings = 'SSad', diff --git a/src/gui/StringListWidget.hxx b/src/gui/StringListWidget.hxx index d311b5918..6d3561d4d 100644 --- a/src/gui/StringListWidget.hxx +++ b/src/gui/StringListWidget.hxx @@ -38,7 +38,7 @@ class StringListWidget : public ListWidget Common::Rect getEditRect() const override; protected: - bool _hilite; + bool _hilite{false}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/TabWidget.cxx b/src/gui/TabWidget.cxx index 999ca8013..7f644628e 100644 --- a/src/gui/TabWidget.cxx +++ b/src/gui/TabWidget.cxx @@ -28,10 +28,7 @@ TabWidget::TabWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) : Widget(boss, font, x, y, w, h), - CommandSender(boss), - _tabWidth(40), - _activeTab(-1), - _firstTime(true) + CommandSender(boss) { _id = 0; // For dialogs with multiple tab widgets, they should specifically // call ::setID to differentiate among them diff --git a/src/gui/TabWidget.hxx b/src/gui/TabWidget.hxx index 5b5664b89..80c6e7fb0 100644 --- a/src/gui/TabWidget.hxx +++ b/src/gui/TabWidget.hxx @@ -76,10 +76,10 @@ class TabWidget : public Widget, public CommandSender private: struct Tab { string title; - Widget* firstWidget; - Widget* parentWidget; - bool enabled; - int tabWidth; + Widget* firstWidget{nullptr}; + Widget* parentWidget{nullptr}; + bool enabled{true}; + int tabWidth{0}; Tab(const string& t, int tw = NO_WIDTH, Widget* first = nullptr, Widget* parent = nullptr, bool e = true) @@ -88,10 +88,10 @@ class TabWidget : public Widget, public CommandSender using TabList = vector; TabList _tabs; - int _tabWidth; - int _tabHeight; - int _activeTab; - bool _firstTime; + int _tabWidth{40}; + int _tabHeight{1}; + int _activeTab{-1}; + bool _firstTime{true}; enum { kTabLeftOffset = 0, diff --git a/src/gui/TimeLineWidget.cxx b/src/gui/TimeLineWidget.cxx index 923ec7ddf..1a67b7019 100644 --- a/src/gui/TimeLineWidget.cxx +++ b/src/gui/TimeLineWidget.cxx @@ -33,10 +33,6 @@ TimeLineWidget::TimeLineWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, const string& label, uInt32 labelWidth, int cmd) : ButtonWidget(boss, font, x, y, w, h, label, cmd), - _value(0), - _valueMin(0), - _valueMax(0), - _isDragging(false), _labelWidth(labelWidth) { _flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE; diff --git a/src/gui/TimeLineWidget.hxx b/src/gui/TimeLineWidget.hxx index 693ae4b89..d8a9d046b 100644 --- a/src/gui/TimeLineWidget.hxx +++ b/src/gui/TimeLineWidget.hxx @@ -53,10 +53,10 @@ class TimeLineWidget : public ButtonWidget uInt32 posToValue(uInt32 pos); protected: - uInt32 _value; - uInt32 _valueMin, _valueMax; - bool _isDragging; - uInt32 _labelWidth; + uInt32 _value{0}; + uInt32 _valueMin{0}, _valueMax{0}; + bool _isDragging{false}; + uInt32 _labelWidth{0}; uIntArray _stepValue; diff --git a/src/gui/TimeMachine.cxx b/src/gui/TimeMachine.cxx index 629c49392..53dfb9d77 100644 --- a/src/gui/TimeMachine.cxx +++ b/src/gui/TimeMachine.cxx @@ -23,7 +23,6 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TimeMachine::TimeMachine(OSystem& osystem) : DialogContainer(osystem), - myBaseDialog(nullptr), myWidth(FBMinimum::Width) { myBaseDialog = new TimeMachineDialog(myOSystem, *this, myWidth); diff --git a/src/gui/TimeMachine.hxx b/src/gui/TimeMachine.hxx index 22a339d91..902aaca2b 100644 --- a/src/gui/TimeMachine.hxx +++ b/src/gui/TimeMachine.hxx @@ -50,9 +50,9 @@ class TimeMachine : public DialogContainer void setEnterWinds(Int32 numWinds); private: - Dialog* myBaseDialog; + Dialog* myBaseDialog{nullptr}; - uInt32 myWidth; + uInt32 myWidth{0}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/TimeMachineDialog.cxx b/src/gui/TimeMachineDialog.cxx index bf8f4ed0b..b256da0ee 100644 --- a/src/gui/TimeMachineDialog.cxx +++ b/src/gui/TimeMachineDialog.cxx @@ -184,8 +184,7 @@ static constexpr std::array LOAD_ALL = { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TimeMachineDialog::TimeMachineDialog(OSystem& osystem, DialogContainer& parent, int width) - : Dialog(osystem, parent), - _enterWinds(0) + : Dialog(osystem, parent) { const GUI::Font& font = instance().frameBuffer().font(); const int H_BORDER = 6, BUTTON_GAP = 4, V_BORDER = 4; diff --git a/src/gui/TimeMachineDialog.hxx b/src/gui/TimeMachineDialog.hxx index c0adc17a2..0abd14b37 100644 --- a/src/gui/TimeMachineDialog.hxx +++ b/src/gui/TimeMachineDialog.hxx @@ -69,25 +69,25 @@ class TimeMachineDialog : public Dialog kLoadAll = 'TMld', }; - TimeLineWidget* myTimeline; + TimeLineWidget* myTimeline{nullptr}; - ButtonWidget* myToggleWidget; - ButtonWidget* myPlayWidget; - ButtonWidget* myRewindAllWidget; - ButtonWidget* myRewind1Widget; - ButtonWidget* myUnwind1Widget; - ButtonWidget* myUnwindAllWidget; - ButtonWidget* mySaveAllWidget; - ButtonWidget* myLoadAllWidget; + ButtonWidget* myToggleWidget{nullptr}; + ButtonWidget* myPlayWidget{nullptr}; + ButtonWidget* myRewindAllWidget{nullptr}; + ButtonWidget* myRewind1Widget{nullptr}; + ButtonWidget* myUnwind1Widget{nullptr}; + ButtonWidget* myUnwindAllWidget{nullptr}; + ButtonWidget* mySaveAllWidget{nullptr}; + ButtonWidget* myLoadAllWidget{nullptr}; - StaticTextWidget* myCurrentTimeWidget; - StaticTextWidget* myLastTimeWidget; + StaticTextWidget* myCurrentTimeWidget{nullptr}; + StaticTextWidget* myLastTimeWidget{nullptr}; - StaticTextWidget* myCurrentIdxWidget; - StaticTextWidget* myLastIdxWidget; - StaticTextWidget* myMessageWidget; + StaticTextWidget* myCurrentIdxWidget{nullptr}; + StaticTextWidget* myLastIdxWidget{nullptr}; + StaticTextWidget* myMessageWidget{nullptr}; - Int32 _enterWinds; + Int32 _enterWinds{0}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/UIDialog.hxx b/src/gui/UIDialog.hxx index d61177f87..d457ada76 100644 --- a/src/gui/UIDialog.hxx +++ b/src/gui/UIDialog.hxx @@ -50,32 +50,32 @@ class UIDialog : public Dialog, public CommandSender }; const GUI::Font& myFont; - TabWidget* myTab; + TabWidget* myTab{nullptr}; // Launcher options - EditTextWidget* myRomPath; - SliderWidget* myLauncherWidthSlider; - SliderWidget* myLauncherHeightSlider; - PopUpWidget* myLauncherFontPopup; - PopUpWidget* myRomViewerPopup; - ButtonWidget* myOpenBrowserButton; - EditTextWidget* mySnapLoadPath; - CheckboxWidget* myLauncherExitWidget; + EditTextWidget* myRomPath{nullptr}; + SliderWidget* myLauncherWidthSlider{nullptr}; + SliderWidget* myLauncherHeightSlider{nullptr}; + PopUpWidget* myLauncherFontPopup{nullptr}; + PopUpWidget* myRomViewerPopup{nullptr}; + ButtonWidget* myOpenBrowserButton{nullptr}; + EditTextWidget* mySnapLoadPath{nullptr}; + CheckboxWidget* myLauncherExitWidget{nullptr}; // Misc options - PopUpWidget* myPalettePopup; - CheckboxWidget* myHidpiWidget; - PopUpWidget* myPositionPopup; - SliderWidget* myListDelaySlider; - SliderWidget* myWheelLinesSlider; - SliderWidget* myControllerRateSlider; - SliderWidget* myControllerDelaySlider; - SliderWidget* myDoubleClickSlider; + PopUpWidget* myPalettePopup{nullptr}; + CheckboxWidget* myHidpiWidget{nullptr}; + PopUpWidget* myPositionPopup{nullptr}; + SliderWidget* myListDelaySlider{nullptr}; + SliderWidget* myWheelLinesSlider{nullptr}; + SliderWidget* myControllerRateSlider{nullptr}; + SliderWidget* myControllerDelaySlider{nullptr}; + SliderWidget* myDoubleClickSlider{nullptr}; unique_ptr myBrowser; // Indicates if this dialog is used for global (vs. in-game) settings - bool myIsGlobal; + bool myIsGlobal{false}; private: // Following constructors and assignment operators not supported diff --git a/src/gui/VideoDialog.hxx b/src/gui/VideoDialog.hxx index 5cbd7940a..32267dc30 100644 --- a/src/gui/VideoDialog.hxx +++ b/src/gui/VideoDialog.hxx @@ -54,51 +54,51 @@ class VideoDialog : public Dialog TabWidget* myTab; // General options - PopUpWidget* myRenderer; - SliderWidget* myTIAZoom; - PopUpWidget* myTIAPalette; - CheckboxWidget* myTIAInterpolate; - SliderWidget* myNAspectRatio; - SliderWidget* myPAspectRatio; - SliderWidget* mySpeed; + PopUpWidget* myRenderer{nullptr}; + SliderWidget* myTIAZoom{nullptr}; + PopUpWidget* myTIAPalette{nullptr}; + CheckboxWidget* myTIAInterpolate{nullptr}; + SliderWidget* myNAspectRatio{nullptr}; + SliderWidget* myPAspectRatio{nullptr}; + SliderWidget* mySpeed{nullptr}; - CheckboxWidget* myFullscreen; + CheckboxWidget* myFullscreen{nullptr}; //PopUpWidget* myFullScreenMode; - CheckboxWidget* myUseStretch; - SliderWidget* myTVOverscan; - CheckboxWidget* myUseVSync; - CheckboxWidget* myUIMessages; - CheckboxWidget* myCenter; - CheckboxWidget* myFastSCBios; - CheckboxWidget* myUseThreads; + CheckboxWidget* myUseStretch{nullptr}; + SliderWidget* myTVOverscan{nullptr}; + CheckboxWidget* myUseVSync{nullptr}; + CheckboxWidget* myUIMessages{nullptr}; + CheckboxWidget* myCenter{nullptr}; + CheckboxWidget* myFastSCBios{nullptr}; + CheckboxWidget* myUseThreads{nullptr}; // TV effects adjustables (custom mode) - PopUpWidget* myTVMode; - SliderWidget* myTVSharp; - SliderWidget* myTVHue; - SliderWidget* myTVRes; - SliderWidget* myTVArtifacts; - SliderWidget* myTVFringe; - SliderWidget* myTVBleed; - SliderWidget* myTVBright; - SliderWidget* myTVContrast; - SliderWidget* myTVSatur; - SliderWidget* myTVGamma; + PopUpWidget* myTVMode{nullptr}; + SliderWidget* myTVSharp{nullptr}; + SliderWidget* myTVHue{nullptr}; + SliderWidget* myTVRes{nullptr}; + SliderWidget* myTVArtifacts{nullptr}; + SliderWidget* myTVFringe{nullptr}; + SliderWidget* myTVBleed{nullptr}; + SliderWidget* myTVBright{nullptr}; + SliderWidget* myTVContrast{nullptr}; + SliderWidget* myTVSatur{nullptr}; + SliderWidget* myTVGamma{nullptr}; // TV phosphor effect - CheckboxWidget* myTVPhosphor; - SliderWidget* myTVPhosLevel; + CheckboxWidget* myTVPhosphor{nullptr}; + SliderWidget* myTVPhosLevel{nullptr}; // TV scanline intensity and interpolation - StaticTextWidget* myTVScanLabel; - SliderWidget* myTVScanIntense; + StaticTextWidget* myTVScanLabel{nullptr}; + SliderWidget* myTVScanIntense{nullptr}; // TV effects adjustables presets (custom mode) - ButtonWidget* myCloneComposite; - ButtonWidget* myCloneSvideo; - ButtonWidget* myCloneRGB; - ButtonWidget* myCloneBad; - ButtonWidget* myCloneCustom; + ButtonWidget* myCloneComposite{nullptr}; + ButtonWidget* myCloneSvideo{nullptr}; + ButtonWidget* myCloneRGB{nullptr}; + ButtonWidget* myCloneBad{nullptr}; + ButtonWidget* myCloneCustom{nullptr}; enum { kSpeedupChanged = 'VDSp', diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 711ef65a8..f1a782688 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -32,17 +32,7 @@ Widget::Widget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h) : GuiObject(boss->instance(), boss->parent(), boss->dialog(), x, y, w, h), _boss(boss), - _font(font), - _id(0), - _flags(0), - _hasFocus(false), - _bgcolor(kWidColor), - _bgcolorhi(kWidColor), - _bgcolorlo(kBGColorLo), - _textcolor(kTextColor), - _textcolorhi(kTextColorHi), - _textcolorlo(kBGColorLo), - _shadowcolor(kShadowColor) + _font(font) { // Insert into the widget list of the boss _next = _boss->_firstWidget; @@ -311,6 +301,7 @@ StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font, const string& text, TextAlign align, ColorId shadowColor) : Widget(boss, font, x, y, w, h), + _label(text), _align(align) { _flags = Widget::FLAG_ENABLED; @@ -319,9 +310,6 @@ StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font, _textcolor = kTextColor; _textcolorhi = kTextColor; _shadowcolor = shadowColor; - - _label = text; - _editable = false; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -368,11 +356,7 @@ ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font, : StaticTextWidget(boss, font, x, y, w, h, label, TextAlign::Center), CommandSender(boss), _cmd(cmd), - _repeat(repeat), - _useBitmap(false), - _bitmap(nullptr), - _bmw(0), - _bmh(0) + _repeat(repeat) { _flags = Widget::FLAG_ENABLED | Widget::FLAG_CLEARBG; _bgcolor = kBtnColor; @@ -381,15 +365,14 @@ ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font, _textcolor = kBtnTextColor; _textcolorhi = kBtnTextColorHi; _textcolorlo = kBGColorLo; - - _editable = false; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int dw, const string& label, int cmd, bool repeat) - : ButtonWidget(boss, font, x, y, font.getStringWidth(label) + dw, font.getLineHeight() + 4, label, cmd, repeat) + : ButtonWidget(boss, font, x, y, font.getStringWidth(label) + dw, + font.getLineHeight() + 4, label, cmd, repeat) { } @@ -499,14 +482,7 @@ void ButtonWidget::drawWidget(bool hilite) CheckboxWidget::CheckboxWidget(GuiObject* boss, const GUI::Font& font, int x, int y, const string& label, int cmd) - : ButtonWidget(boss, font, x, y, 16, 16, label, cmd), - _state(false), - _holdFocus(true), - _drawBox(true), - _changed(false), - _fillColor(kColor), - _boxY(0), - _textY(0) + : ButtonWidget(boss, font, x, y, 16, 16, label, cmd) { _flags = Widget::FLAG_ENABLED; _bgcolor = _bgcolorhi = kWidColor; @@ -520,7 +496,6 @@ CheckboxWidget::CheckboxWidget(GuiObject* boss, const GUI::Font& font, _w = font.getStringWidth(label) + 20; _h = font.getFontHeight() < 14 ? 14 : font.getFontHeight(); - // Depending on font size, either the font or box will need to be // centered vertically if(_h > 14) // center box @@ -648,17 +623,10 @@ SliderWidget::SliderWidget(GuiObject* boss, const GUI::Font& font, const string& label, int labelWidth, int cmd, int valueLabelWidth, const string& valueUnit, int valueLabelGap) : ButtonWidget(boss, font, x, y, w, h, label, cmd), - _value(-1), - _stepValue(1), - _valueMin(0), - _valueMax(100), - _isDragging(false), _labelWidth(labelWidth), - _valueLabel(""), _valueUnit(valueUnit), _valueLabelGap(valueLabelGap), - _valueLabelWidth(valueLabelWidth), - _numIntervals(0) + _valueLabelWidth(valueLabelWidth) { _flags = Widget::FLAG_ENABLED | Widget::FLAG_TRACK_MOUSE; _bgcolor = kDlgColor; diff --git a/src/gui/Widget.hxx b/src/gui/Widget.hxx index 63a3bcc74..a1aa1eec0 100644 --- a/src/gui/Widget.hxx +++ b/src/gui/Widget.hxx @@ -133,21 +133,21 @@ class Widget : public GuiObject { assert(_boss); _boss->handleCommand(sender, cmd, data, id); } protected: - GuiObject* _boss; + GuiObject* _boss{nullptr}; const GUI::Font& _font; - Widget* _next; - uInt32 _id; - uInt32 _flags; - bool _hasFocus; - int _fontWidth; - int _fontHeight; - ColorId _bgcolor; - ColorId _bgcolorhi; - ColorId _bgcolorlo; - ColorId _textcolor; - ColorId _textcolorhi; - ColorId _textcolorlo; - ColorId _shadowcolor; + Widget* _next{nullptr}; + uInt32 _id{0}; + uInt32 _flags{0}; + bool _hasFocus{false}; + int _fontWidth{0}; + int _fontHeight{0}; + ColorId _bgcolor{kWidColor}; + ColorId _bgcolorhi{kWidColor}; + ColorId _bgcolorlo{kBGColorLo}; + ColorId _textcolor{kTextColor}; + ColorId _textcolorhi{kTextColorHi}; + ColorId _textcolorlo{kBGColorLo}; + ColorId _shadowcolor{kShadowColor}; public: static Widget* findWidgetInChain(Widget* start, int x, int y); @@ -200,8 +200,8 @@ class StaticTextWidget : public Widget protected: string _label; - bool _editable; - TextAlign _align; + bool _editable{false}; + TextAlign _align{TextAlign::Left}; private: // Following constructors and assignment operators not supported @@ -249,9 +249,9 @@ class ButtonWidget : public StaticTextWidget, public CommandSender protected: int _cmd{0}; bool _repeat{false}; // button repeats - bool _useBitmap; - const uInt32* _bitmap; - int _bmw, _bmh; + bool _useBitmap{false}; + const uInt32* _bitmap{nullptr}; + int _bmw{0}, _bmh{0}; private: // Following constructors and assignment operators not supported @@ -291,15 +291,15 @@ class CheckboxWidget : public ButtonWidget void drawWidget(bool hilite) override; protected: - bool _state; - bool _holdFocus; - bool _drawBox; - bool _changed; + bool _state{false}; + bool _holdFocus{true}; + bool _drawBox{true}; + bool _changed{false}; - const uInt32* _img; - ColorId _fillColor; - int _boxY; - int _textY; + const uInt32* _img{nullptr}; + ColorId _fillColor{kColor}; + int _boxY{0}; + int _textY{0}; private: // Following constructors and assignment operators not supported @@ -317,11 +317,13 @@ class SliderWidget : public ButtonWidget SliderWidget(GuiObject* boss, const GUI::Font& font, int x, int y, int w, int h, const string& label = "", int labelWidth = 0, int cmd = 0, - int valueLabelWidth = 0, const string& valueUnit = "", int valueLabelGap = 4); + int valueLabelWidth = 0, const string& valueUnit = "", + int valueLabelGap = 4); SliderWidget(GuiObject* boss, const GUI::Font& font, int x, int y, const string& label = "", int labelWidth = 0, int cmd = 0, - int valueLabelWidth = 0, const string& valueUnit = "", int valueLabelGap = 4); + int valueLabelWidth = 0, const string& valueUnit = "", + int valueLabelGap = 4); virtual ~SliderWidget() = default; void setValue(int value); @@ -353,15 +355,15 @@ class SliderWidget : public ButtonWidget int posToValue(int pos) const; protected: - int _value, _stepValue; - int _valueMin, _valueMax; - bool _isDragging; - int _labelWidth; + int _value{-1}, _stepValue{1}; + int _valueMin{0}, _valueMax{100}; + bool _isDragging{false}; + int _labelWidth{0}; string _valueLabel; string _valueUnit; - int _valueLabelGap; - int _valueLabelWidth; - int _numIntervals; + int _valueLabelGap{0}; + int _valueLabelWidth{0}; + int _numIntervals{0}; private: // Following constructors and assignment operators not supported diff --git a/src/macos/OSystemMACOS.hxx b/src/macos/OSystemMACOS.hxx index 7426dfc41..905f73d9e 100644 --- a/src/macos/OSystemMACOS.hxx +++ b/src/macos/OSystemMACOS.hxx @@ -54,9 +54,8 @@ class OSystemMACOS : public OSystem string& savedir, string& loaddir, bool useappdir, const string& usedir) override; -protected: - - virtual shared_ptr createSettingsRepository() override; + protected: + virtual shared_ptr createSettingsRepository() override; private: // Following constructors and assignment operators not supported diff --git a/src/macos/SerialPortMACOS.cxx b/src/macos/SerialPortMACOS.cxx index 77dfcee08..781b6ecc0 100644 --- a/src/macos/SerialPortMACOS.cxx +++ b/src/macos/SerialPortMACOS.cxx @@ -29,8 +29,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SerialPortMACOS::SerialPortMACOS() - : SerialPort(), - myHandle(0) + : SerialPort() { } diff --git a/src/macos/SerialPortMACOS.hxx b/src/macos/SerialPortMACOS.hxx index b2fc6855f..ecfbec499 100644 --- a/src/macos/SerialPortMACOS.hxx +++ b/src/macos/SerialPortMACOS.hxx @@ -50,7 +50,7 @@ class SerialPortMACOS : public SerialPort private: // File descriptor for serial connection - int myHandle; + int myHandle{0}; private: // Following constructors and assignment operators not supported diff --git a/src/macos/SettingsRepositoryMACOS.hxx b/src/macos/SettingsRepositoryMACOS.hxx index 84c285d73..084ee8ab4 100644 --- a/src/macos/SettingsRepositoryMACOS.hxx +++ b/src/macos/SettingsRepositoryMACOS.hxx @@ -22,12 +22,12 @@ class SettingsRepositoryMACOS : public KeyValueRepository { -public: - std::map load() override; + public: + std::map load() override; - void save(const std::map& values) override; + void save(const std::map& values) override; - void save(const string& key, const Variant& value) override; + void save(const string& key, const Variant& value) override; }; #endif // SETTINGS_REPOSITORY_MACOS_HXX diff --git a/src/windows/FSNodeWINDOWS.cxx b/src/windows/FSNodeWINDOWS.cxx index ddc5687f7..ffc71e4fd 100644 --- a/src/windows/FSNodeWINDOWS.cxx +++ b/src/windows/FSNodeWINDOWS.cxx @@ -178,12 +178,6 @@ const TCHAR* FilesystemNodeWINDOWS::toUnicode(const char* str) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FilesystemNodeWINDOWS::FilesystemNodeWINDOWS() { - // Create a virtual root directory for standard Windows system - _isDirectory = true; - _isFile = false; - _isValid = false; - _path = ""; - _isPseudoRoot = true; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/windows/FSNodeWINDOWS.hxx b/src/windows/FSNodeWINDOWS.hxx index 6d0e3ed37..3dd767002 100644 --- a/src/windows/FSNodeWINDOWS.hxx +++ b/src/windows/FSNodeWINDOWS.hxx @@ -76,10 +76,10 @@ class FilesystemNodeWINDOWS : public AbstractFSNode protected: string _displayName; string _path; - bool _isDirectory; - bool _isFile; - bool _isPseudoRoot; - bool _isValid; + bool _isDirectory{true}; + bool _isFile{false}; + bool _isPseudoRoot{true}; + bool _isValid{false}; private: /** diff --git a/src/windows/SerialPortWINDOWS.cxx b/src/windows/SerialPortWINDOWS.cxx index 0f6e67fa5..face0ecff 100644 --- a/src/windows/SerialPortWINDOWS.cxx +++ b/src/windows/SerialPortWINDOWS.cxx @@ -21,8 +21,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SerialPortWINDOWS::SerialPortWINDOWS() - : SerialPort(), - myHandle(0) + : SerialPort() { } diff --git a/src/windows/SerialPortWINDOWS.hxx b/src/windows/SerialPortWINDOWS.hxx index 6287aa597..4da79dee9 100644 --- a/src/windows/SerialPortWINDOWS.hxx +++ b/src/windows/SerialPortWINDOWS.hxx @@ -49,7 +49,7 @@ class SerialPortWINDOWS : public SerialPort private: // Handle to serial port - HANDLE myHandle; + HANDLE myHandle{0}; private: // Following constructors and assignment operators not supported