diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-04-20 16:38:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-04-20 16:38:15 +0300 |
commit | 747dc30f256606e28fd932a9626da7c328114036 (patch) | |
tree | 1b3e7e70ba439d14d4936660d44c95c27816a11b /src | |
parent | cef2952156ab09371ed04beec00d0f1e8615ada9 (diff) | |
download | manaverse-747dc30f256606e28fd932a9626da7c328114036.tar.gz manaverse-747dc30f256606e28fd932a9626da7c328114036.tar.bz2 manaverse-747dc30f256606e28fd932a9626da7c328114036.tar.xz manaverse-747dc30f256606e28fd932a9626da7c328114036.zip |
fix style in gui directory.
Diffstat (limited to 'src')
81 files changed, 363 insertions, 139 deletions
diff --git a/src/gui/botcheckerwindow.cpp b/src/gui/botcheckerwindow.cpp index 78bc20fca..3cc4b065b 100644 --- a/src/gui/botcheckerwindow.cpp +++ b/src/gui/botcheckerwindow.cpp @@ -65,7 +65,8 @@ public: explicit UsersTableModel(const Widget2 *const widget) : TableModel(), Widget2(widget), - mPlayers(0) + mPlayers(0), + mWidgets() { playersUpdated(); } diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp index 6c5430526..4f5a7e811 100644 --- a/src/gui/charcreatedialog.cpp +++ b/src/gui/charcreatedialog.cpp @@ -84,11 +84,18 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, mPrevHairStyleButton(new Button(this, _("<"), "prevstyle", this)), mHairStyleLabel(new Label(this, _("Hair style:"))), mHairStyleNameLabel(new Label(this, "")), + mNextRaceButton(nullptr), + mPrevRaceButton(nullptr), + mRaceLabel(nullptr), + mRaceNameLabel(nullptr), mActionButton(new Button(this, _("^"), "action", this)), mRotateButton(new Button(this, _(">"), "rotate", this)), mMale(new RadioButton(this, _("Male"), "gender")), mFemale(new RadioButton(this, _("Female"), "gender")), mOther(new RadioButton(this, _("Other"), "gender")), + mAttributeSlider(), + mAttributeLabel(), + mAttributeValue(), mAttributesLeft(new Label(this, strprintf(_("Please distribute %d points"), 99))), mMaxPoints(0), @@ -99,7 +106,13 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, mPlayer(new Being(0, ActorSprite::PLAYER, static_cast<uint16_t>(mRace), nullptr)), mPlayerBox(new PlayerBox(mPlayer, "charcreate_playerbox.xml")), + mHairStyle(0), + mHairColor(0), mSlot(slot), + maxHairColor(CharDB::getMaxHairColor()), + minHairColor(CharDB::getMinHairColor()), + maxHairStyle(CharDB::getMaxHairStyle()), + minHairStyle(CharDB::getMinHairStyle()), mAction(0), mDirection(0) { @@ -117,13 +130,8 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, mPlayer->setSprite(i, *it); } - maxHairColor = CharDB::getMaxHairColor(); - minHairColor = CharDB::getMinHairColor(); if (!maxHairColor) maxHairColor = ColorDB::getHairSize(); - - maxHairStyle = CharDB::getMaxHairStyle(); - minHairStyle = CharDB::getMinHairStyle(); if (!maxHairStyle) maxHairStyle = mPlayer->getNumOfHairstyles(); @@ -139,13 +147,6 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, mRaceLabel = new Label(this, _("Race:")); mRaceNameLabel = new Label(this, ""); } - else - { - mNextRaceButton = nullptr; - mPrevRaceButton = nullptr; - mRaceLabel = nullptr; - mRaceNameLabel = nullptr; - } // Default to a Male character mMale->setSelected(true); diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index da5e7394f..977e06726 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -166,6 +166,8 @@ class CharacterScroller final : public Container, add(mNumber); } + A_DELETE_COPY(CharacterScroller) + void show(const int i) { const int sz = static_cast<signed>(mCharacterEntries->size()); diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index c375b6748..2892bb842 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -182,16 +182,26 @@ ChatWindow::ChatWindow(): mItemLinkHandler(new ItemLinkHandler), mChatTabs(new TabbedArea(this)), mChatInput(new ChatInput(this, mChatTabs)), + mRainbowColor(0), mTmpVisible(false), + mWhispers(), + mHistory(), + mCurHist(), + mCommands(), + mCustomWords(), mReturnToggles(config.getBoolValue("ReturnToggles")), + mTradeFilter(), mColorListModel(new ColorListModel), mColorPicker(new DropDown(this, mColorListModel)), mChatColor(config.getIntValue("chatColor")), mChatHistoryIndex(0), + mAwayLog(), + mHighlights(), mGMLoaded(false), mHaveMouse(false), - mAutoHide(false), - mShowBattleEvents(false) + mAutoHide(config.getBoolValue("autohideChat")), + mShowBattleEvents(config.getBoolValue("showBattleEvents")), + mShowAllLang(serverConfig.getValue("showAllLang", 0)) { listen(CHANNEL_ATTRIBUTES); @@ -250,8 +260,6 @@ ChatWindow::ChatWindow(): // Add key listener to chat input to be able to respond to up/down mChatInput->addKeyListener(this); mCurHist = mHistory.end(); - - mRainbowColor = 0; mColorPicker->setVisible(config.getBoolValue("showChatColorsList")); fillCommands(); @@ -264,9 +272,6 @@ ChatWindow::ChatWindow(): config.addListener("autohideChat", this); config.addListener("showBattleEvents", this); - mAutoHide = config.getBoolValue("autohideChat"); - mShowBattleEvents = config.getBoolValue("showBattleEvents"); - mShowAllLang = serverConfig.getValue("showAllLang", 0); enableVisibleSound(true); } diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h index f8d9ae7da..2961d7de4 100644 --- a/src/gui/chatwindow.h +++ b/src/gui/chatwindow.h @@ -70,6 +70,15 @@ enum Own /** One item in the chat log */ struct CHATLOG final { + CHATLOG() : + nick(), + text(), + own(BY_UNKNOWN) + { + } + + A_DELETE_COPY(CHATLOG) + std::string nick; std::string text; Own own; diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp index 726167a49..2c9c40758 100644 --- a/src/gui/debugwindow.cpp +++ b/src/gui/debugwindow.cpp @@ -160,7 +160,8 @@ MapDebugTab::MapDebugTab(const Widget2 *const widget) : _("Draw calls:"), "?"))), #endif mFPSLabel(new Label(this, strprintf(_("%d FPS"), 0))), - mLPSLabel(new Label(this, strprintf(_("%d LPS"), 0))) + mLPSLabel(new Label(this, strprintf(_("%d LPS"), 0))), + mFPSText() { LayoutHelper h(this); ContainerPlacer place = h.getPlacer(0, 0); diff --git a/src/gui/editdialog.cpp b/src/gui/editdialog.cpp index ea11cbd91..30e115f88 100644 --- a/src/gui/editdialog.cpp +++ b/src/gui/editdialog.cpp @@ -37,11 +37,10 @@ EditDialog::EditDialog(const std::string &title, const std::string &msg, Window *const parent, const bool modal): Window(title, modal, parent, "edit.xml"), gcn::ActionListener(), + mEventOk(eventOk), mTextField(new TextField(this)) { mTextField->setText(msg); - mEventOk = eventOk; - Button *const okButton = new Button(this, _("OK"), mEventOk, this); const int numRows = 1; diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index dd9968585..a27d55c89 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -62,12 +62,16 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment, mForing(foring), mImageSet(nullptr), mBeing(being), + mBoxes(), mHighlightColor(getThemeColor(Theme::HIGHLIGHT)), mBorderColor(getThemeColor(Theme::BORDER)), mLabelsColor(getThemeColor(Theme::LABEL)), + mSlotBackground(), + mSlotHighlightedBackground(), mVertexes(new ImageCollection), mItemPadding(getOption("itemPadding")), mBoxSize(getOption("boxSize")), + mButtonPadding(getOption("buttonPadding", 5)), mMinX(180), mMinY(345), mMaxX(0), @@ -96,8 +100,6 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment, for (int f = 0; f < BOX_COUNT; f ++) mBoxes.push_back(nullptr); - mButtonPadding = getOption("buttonPadding", 5); - fillBoxes(); recalcSize(); diff --git a/src/gui/focushandler.h b/src/gui/focushandler.h index 5cba9d08f..021469321 100644 --- a/src/gui/focushandler.h +++ b/src/gui/focushandler.h @@ -37,7 +37,8 @@ class FocusHandler final : public gcn::FocusHandler { public: - FocusHandler() + FocusHandler() : + mModalStack() { } A_DELETE_COPY(FocusHandler) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index b0b9de0a8..e243bfc27 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -80,11 +80,17 @@ class GuiConfigListener final : public ConfigListener Gui::Gui(Graphics *const graphics) : gcn::Gui(), mConfigListener(new GuiConfigListener(this)), - mCustomCursor(false), + mGuiFont(), + mInfoParticleFont(), + mHelpFont(), + mSecureFont(), + mNpcFont(), mMouseCursors(nullptr), mMouseCursorAlpha(1.0f), mMouseInactivityTimer(0), - mCursorType(Cursor::CURSOR_POINTER) + mCursorType(Cursor::CURSOR_POINTER), + mFocusListeners(), + mCustomCursor(false) { logger->log1("Initializing GUI..."); // Set graphics diff --git a/src/gui/gui.h b/src/gui/gui.h index 04d76e538..477e93d6d 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -169,7 +169,6 @@ class Gui final : public gcn::Gui SDLFont *mHelpFont; /**< Font for Help Window */ SDLFont *mSecureFont; /**< Font for secure labels */ SDLFont *mNpcFont; /**< Font for npc text */ - bool mCustomCursor; /**< Show custom cursor */ ImageSet *mMouseCursors; /**< Mouse cursor images */ float mMouseCursorAlpha; int mMouseInactivityTimer; @@ -178,6 +177,7 @@ class Gui final : public gcn::Gui typedef std::list<gcn::FocusListener*> FocusListenerList; typedef FocusListenerList::iterator FocusListenerIterator; FocusListenerList mFocusListeners; + bool mCustomCursor; /**< Show custom cursor */ }; extern Gui *gui; /**< The GUI system */ diff --git a/src/gui/helpwindow.cpp b/src/gui/helpwindow.cpp index fb00495ce..1341a7756 100644 --- a/src/gui/helpwindow.cpp +++ b/src/gui/helpwindow.cpp @@ -50,7 +50,8 @@ HelpWindow::HelpWindow(): gcn::ActionListener(), mDYKButton(new Button(this, _("Did you know..."), "DYK", this)), mBrowserBox(new BrowserBox(this)), - mScrollArea(new ScrollArea(mBrowserBox, true, "help_background.xml")) + mScrollArea(new ScrollArea(mBrowserBox, true, "help_background.xml")), + mTagFileMap() { setMinWidth(300); setMinHeight(220); diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index c489d9278..fdd3e957a 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -95,6 +95,9 @@ InventoryWindow::InventoryWindow(Inventory *const inventory): gcn::SelectionListener(), InventoryListener(), mInventory(inventory), + mItems(new ItemContainer(this, mInventory)), + mWeight(), + mSlots(), mUseButton(nullptr), mDropButton(nullptr), mSplitButton(nullptr), @@ -143,7 +146,6 @@ InventoryWindow::InventoryWindow(Inventory *const inventory): setMinHeight(179); addKeyListener(this); - mItems = new ItemContainer(this, mInventory); mItems->addSelectionListener(this); gcn::ScrollArea *const invenScroll = new ScrollArea( diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h index 903f15254..48c097f88 100644 --- a/src/gui/inventorywindow.h +++ b/src/gui/inventorywindow.h @@ -152,14 +152,14 @@ class InventoryWindow final : public Window, */ void updateWeight(); - typedef std::list<InventoryWindow*> WindowList; static WindowList invInstances; Inventory *mInventory; ItemContainer *mItems; - std::string mWeight, mSlots; + std::string mWeight; + std::string mSlots; Button *mUseButton; Button *mDropButton; diff --git a/src/gui/itemamountwindow.cpp b/src/gui/itemamountwindow.cpp index 06320e295..6aeec37d2 100644 --- a/src/gui/itemamountwindow.cpp +++ b/src/gui/itemamountwindow.cpp @@ -50,7 +50,8 @@ class ItemsModal final : public gcn::ListModel { public: - ItemsModal() + ItemsModal() : + mStrings() { std::map<int, ItemInfo*> items = ItemDB::getItemInfos(); std::list<std::string> tempStrings; diff --git a/src/gui/killstats.cpp b/src/gui/killstats.cpp index f77c9a8f4..aa34c6ab8 100644 --- a/src/gui/killstats.cpp +++ b/src/gui/killstats.cpp @@ -48,6 +48,9 @@ KillStats::KillStats(): mKillTimer(0), mResetButton(new Button(this, _("Reset stats"), "reset", this)), mTimerButton(new Button(this, _("Reset timer"), "timer", this)), + mLine1(nullptr), + mLine2(nullptr), + mLine3(nullptr), mLine4(new Label(this, strprintf(_("Kills: %s, total exp: %s"), "?", "?"))), mLine5(new Label(this, strprintf(_("Avg Exp: %s"), "?"))), diff --git a/src/gui/logindialog.cpp b/src/gui/logindialog.cpp index f1f8bc200..baecf5f27 100644 --- a/src/gui/logindialog.cpp +++ b/src/gui/logindialog.cpp @@ -54,6 +54,13 @@ std::string LoginDialog::savedPasswordKey(""); struct OpenUrlListener : public gcn::ActionListener { + OpenUrlListener() : + url() + { + } + + A_DELETE_COPY(OpenUrlListener) + void action(const gcn::ActionEvent &event) { if (event.getId() == "yes") diff --git a/src/gui/ministatuswindow.cpp b/src/gui/ministatuswindow.cpp index f9c1a28ea..ad5890056 100644 --- a/src/gui/ministatuswindow.cpp +++ b/src/gui/ministatuswindow.cpp @@ -53,6 +53,9 @@ typedef std::vector <ProgressBar*>::const_iterator ProgressBarVectorCIter; MiniStatusWindow::MiniStatusWindow() : Popup("MiniStatus", "ministatus.xml"), InventoryListener(), + mBars(), + mBarNames(), + mIcons(), mSpacing(mSkin ? mSkin->getOption("spacing", 3) : 3), mIconPadding(mSkin ? mSkin->getOption("iconPadding", 3) : 3), mIconSpacing(mSkin ? mSkin->getOption("iconSpacing", 2) : 2), @@ -64,6 +67,7 @@ MiniStatusWindow::MiniStatusWindow() : : nullptr), mXpBar(createBar(0, 100, 0, Theme::PROG_EXP, "xp bar", _("experience bar"))), + mJobBar(nullptr), mWeightBar(createBar(0, 140, 0, Theme::PROG_WEIGHT, "weight bar", _("weight bar"))), mInvSlotsBar(createBar(0, 45, 0, Theme::PROG_INVY_SLOTS, @@ -95,10 +99,6 @@ MiniStatusWindow::MiniStatusWindow() : _("job bar")); StatusWindow::updateJobBar(mJobBar); } - else - { - mJobBar = nullptr; - } loadBars(); updateBars(); diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp index 2de27ff6c..4b9c27357 100644 --- a/src/gui/npcdialog.cpp +++ b/src/gui/npcdialog.cpp @@ -70,12 +70,17 @@ NpcDialog::NpcDialog(const int npcId) : mNpcId(npcId), mLogInteraction(config.getBoolValue("logNpcInGui")), mDefaultInt(0), + mDefaultString(), mTextBox(new BrowserBox(this, BrowserBox::AUTO_WRAP)), mScrollArea(new ScrollArea(mTextBox, getOptionBool("showtextbackground"), "npc_textbackground.xml")), + mText(), + mNewText(), mItemList(new ExtendedListBox(this, this, "extendedlistbox.xml")), mListScrollArea(new ScrollArea(mItemList, getOptionBool("showlistbackground"), "npc_listbackground.xml")), + mItems(), + mImages(), mItemLinkHandler(new ItemLinkHandler), mTextField(new TextField(this, "")), mIntField(new IntTextField(this)), diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp index dbe084c17..809b99b37 100644 --- a/src/gui/outfitwindow.cpp +++ b/src/gui/outfitwindow.cpp @@ -78,7 +78,9 @@ OutfitWindow::OutfitWindow(): mItemMoved(nullptr), mItemSelected(-1), mItemColorSelected(1), - mAwayOutfit(0) + mAwayOutfit(0), + mBorderColor(getThemeColor(Theme::BORDER, 64)), + mBackgroundColor(getThemeColor(Theme::BACKGROUND, 32)) { setWindowName("Outfits"); setResizable(true); @@ -89,9 +91,6 @@ OutfitWindow::OutfitWindow(): setMinWidth(145); setMinHeight(220); - mBorderColor = getThemeColor(Theme::BORDER, 64); - mBackgroundColor = getThemeColor(Theme::BACKGROUND, 32); - mCurrentLabel->setAlignment(gcn::Graphics::CENTER); mKeyLabel->setAlignment(gcn::Graphics::CENTER); diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp index c41fdfcd2..df77a8fe7 100644 --- a/src/gui/palette.cpp +++ b/src/gui/palette.cpp @@ -54,7 +54,9 @@ const int Palette::RAINBOW_COLOR_COUNT = 7; Palette::Palette(const int size) : mRainbowTime(tick_time), - mColors(Colors(size)) + mColors(Colors(size)), + mCharColors(), + mGradVector() { mInstances.insert(this); } diff --git a/src/gui/palette.h b/src/gui/palette.h index 30c8acec9..300df1f45 100644 --- a/src/gui/palette.h +++ b/src/gui/palette.h @@ -159,7 +159,7 @@ class Palette /** * Destructor */ - ~Palette(); + virtual ~Palette(); void advanceGradient(); diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 9ff5e19f1..a66a534f7 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -86,6 +86,7 @@ std::string tradePartnerName(""); PopupMenu::PopupMenu(): Popup("PopupMenu", "popupmenu.xml"), mBrowserBox(new BrowserBox(this)), + mScrollArea(nullptr), mBeingId(0), mFloorItemId(0), mItem(nullptr), @@ -95,6 +96,8 @@ PopupMenu::PopupMenu(): mTab(nullptr), mSpell(nullptr), mWindow(nullptr), + mRenameListener(), + mPlayerListener(), mDialog(nullptr), mButton(nullptr), mNick(""), diff --git a/src/gui/questswindow.cpp b/src/gui/questswindow.cpp index c4f3a6928..b3e96fd4f 100644 --- a/src/gui/questswindow.cpp +++ b/src/gui/questswindow.cpp @@ -69,6 +69,11 @@ struct QuestItem final { QuestItem() : var(0), + name(), + group(), + incomplete(), + complete(), + texts(), completeFlag(-1), broken(false) { @@ -101,9 +106,11 @@ class QuestsModel final : public ExtendedNamesModel struct QuestEffect final { QuestEffect() : + map(), var(0), id(0), - effectId(0) + effectId(0), + values() { } @@ -127,6 +134,12 @@ QuestsWindow::QuestsWindow() : mTextScrollArea(new ScrollArea(mText, getOptionBool("showtextbackground"), "quests_text_background.xml")), mCloseButton(new Button(this, _("Close"), "close", this)), + mVars(), + mQuests(), + mAllEffects(), + mMapEffects(), + mNpcEffects(), + mQuestLinks(), mCompleteIcon(Theme::getImageFromThemeXml("complete_icon.xml", "")), mIncompleteIcon(Theme::getImageFromThemeXml("incomplete_icon.xml", "")), mNewQuestEffectId(paths.getIntValue("newQuestEffectId")), diff --git a/src/gui/quitdialog.cpp b/src/gui/quitdialog.cpp index 1063296d4..dc3851b01 100644 --- a/src/gui/quitdialog.cpp +++ b/src/gui/quitdialog.cpp @@ -53,6 +53,7 @@ QuitDialog::QuitDialog(QuitDialog **const pointerToMe): Window(_("Quit"), true, nullptr, "quit.xml"), gcn::ActionListener(), gcn::KeyListener(), + mOptions(), mLogoutQuit(new RadioButton(this, _("Quit"), "quitdialog")), mForceQuit(new RadioButton(this, _("Quit"), "quitdialog")), mSwitchAccountServer(new RadioButton(this, @@ -62,7 +63,8 @@ QuitDialog::QuitDialog(QuitDialog **const pointerToMe): mRate(nullptr), mOkButton(new Button(this, _("OK"), "ok", this)), mCancelButton(new Button(this, _("Cancel"), "cancel", this)), - mMyPointer(pointerToMe) + mMyPointer(pointerToMe), + mNeedForceQuit(false) { addKeyListener(this); diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp index aa512207e..f3d904059 100644 --- a/src/gui/sdlfont.cpp +++ b/src/gui/sdlfont.cpp @@ -55,6 +55,7 @@ class SDLTextChunk final { } + ~SDLTextChunk() { delete img; @@ -159,6 +160,7 @@ typedef std::list<SDLTextChunk>::iterator CacheIterator; static int fontCounter; SDLFont::SDLFont(std::string filename, const int size, const int style) : + mFont(nullptr), mCreateCounter(0), mDeleteCounter(0), mCleanTime(cur_time + CLEAN_TIME) diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp index add3daf31..e80c0f8c2 100644 --- a/src/gui/sdlinput.cpp +++ b/src/gui/sdlinput.cpp @@ -65,6 +65,8 @@ #include <guichan/exception.hpp> SDLInput::SDLInput() : + mKeyInputQueue(), + mMouseInputQueue(), mMouseDown(false), mMouseInWindow(true) { diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index 29189c12b..ee879f2a8 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -248,6 +248,7 @@ ServerDialog::ServerDialog(ServerInfo *const serverInfo, gcn::ActionListener(), gcn::KeyListener(), gcn::SelectionListener(), + mMutex(), mDescription(new Label(this, std::string())), mQuitButton(new Button(this, _("Quit"), "quit", this)), mConnectButton(new Button(this, _("Connect"), "connect", this)), diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index 844840f8d..16aa2219a 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -54,6 +54,9 @@ extern Window *statusWindow; Setup::Setup(): Window(_("Setup"), false, nullptr, "setup.xml"), gcn::ActionListener(), + mTabs(), + mWindowsToReset(), + mButtons(), mResetWindows(nullptr), mPanel(new TabbedArea(this)), mVersion(new Label(this, FULL_VERSION)) diff --git a/src/gui/setup_joystick.cpp b/src/gui/setup_joystick.cpp index 8956384c1..6732a3a49 100644 --- a/src/gui/setup_joystick.cpp +++ b/src/gui/setup_joystick.cpp @@ -46,6 +46,7 @@ Setup_Joystick::Setup_Joystick(const Widget2 *const widget) : _("Press the button to start calibration"))), mCalibrateButton(new Button(this, _("Calibrate"), "calibrate", this)), mDetectButton(new Button(this, _("Detect joysticks"), "detect", this)), + mOriginalJoystickEnabled(config.getBoolValue("joystickEnabled")), mJoystickEnabled(new CheckBox(this, _("Enable joystick"))), mNamesModel(new NamesModel), mNamesDropDown(new DropDown(this, mNamesModel)), @@ -56,7 +57,6 @@ Setup_Joystick::Setup_Joystick(const Widget2 *const widget) : Joystick::getNames(mNamesModel->getNames()); - mOriginalJoystickEnabled = config.getBoolValue("joystickEnabled"); mJoystickEnabled->setSelected(mOriginalJoystickEnabled); mJoystickEnabled->setActionEventId("joystick"); mJoystickEnabled->addActionListener(this); diff --git a/src/gui/setup_relations.cpp b/src/gui/setup_relations.cpp index 562e86e6f..ccc6d8ce2 100644 --- a/src/gui/setup_relations.cpp +++ b/src/gui/setup_relations.cpp @@ -98,6 +98,7 @@ public: Widget2(widget), TableModel(), mPlayers(nullptr), + mWidgets(), mListModel(new PlayerRelationListModel) { playerRelationsUpdated(); @@ -247,7 +248,9 @@ Setup_Relations::Setup_Relations(const Widget2 *const widget) : player_relations.getDefault() & PlayerRelation::TRADE)), mDefaultWhisper(new CheckBox(this, _("Allow whispers"), player_relations.getDefault() & PlayerRelation::WHISPER)), - mDeleteButton(new Button(this, _("Delete"), ACTION_DELETE, this)) + mDeleteButton(new Button(this, _("Delete"), ACTION_DELETE, this)), + mIgnoreActionChoicesModel(new IgnoreChoicesListModel), + mIgnoreActionChoicesBox(new DropDown(widget, mIgnoreActionChoicesModel)) { setName(_("Relations")); @@ -258,8 +261,6 @@ Setup_Relations::Setup_Relations(const Widget2 *const widget) : RELATION_CHOICE_COLUMN_WIDTH); mPlayerTitleTable->setBackgroundColor(gcn::Color(0xbf, 0xbf, 0xbf)); - mIgnoreActionChoicesModel = new IgnoreChoicesListModel; - mIgnoreActionChoicesBox = new DropDown(widget, mIgnoreActionChoicesModel); for (int i = 0; i < COLUMNS_NR; i++) { diff --git a/src/gui/setup_theme.cpp b/src/gui/setup_theme.cpp index d95dc368a..db0b7b6f9 100644 --- a/src/gui/setup_theme.cpp +++ b/src/gui/setup_theme.cpp @@ -156,6 +156,8 @@ public: } } + A_DELETE_COPY(LangListModel) + virtual ~LangListModel() { for (int f = 0; f < langs_count; f ++) @@ -225,7 +227,8 @@ Setup_Theme::Setup_Theme(const Widget2 *const widget) : mNpcFontSize(config.getIntValue("npcfontSize")), mNpcFontSizeDropDown(new DropDown(this, mNpcFontSizeListModel)), // TRANSLATORS: button name with information about selected theme - mInfoButton(new Button(this, _("i"), ACTION_INFO, this)) + mInfoButton(new Button(this, _("i"), ACTION_INFO, this)), + mThemeInfo() { setName(_("Theme")); diff --git a/src/gui/setup_theme.h b/src/gui/setup_theme.h index 9357f629e..030a87193 100644 --- a/src/gui/setup_theme.h +++ b/src/gui/setup_theme.h @@ -102,7 +102,6 @@ class Setup_Theme final : public SetupTab Button *mInfoButton; std::string mThemeInfo; -// EditDialog *mEditDialog; }; #endif diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index c64bec32f..e0054b0e0 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -132,7 +132,8 @@ static bool modeSorter(std::string mode1, std::string mode2) } #endif -ModeListModel::ModeListModel() +ModeListModel::ModeListModel() : + mVideoModes() { graphicsManager.getAllVideoModes(mVideoModes); #ifndef ANDROID @@ -218,8 +219,10 @@ Setup_Video::Setup_Video(const Widget2 *const widget) : mEnableResize(config.getBoolValue("enableresize")), mNoFrame(config.getBoolValue("noframe")), mModeListModel(new ModeListModel), + mOpenGLListModel(new OpenGLListModel), mModeList(new ListBox(widget, mModeListModel, "")), mFsCheckBox(new CheckBox(this, _("Full screen"), mFullScreenEnabled)), + mOpenGLDropDown(new DropDown(widget, mOpenGLListModel)), mCustomCursorCheckBox(new CheckBox(this, #ifdef ANDROID _("Show cursor"), @@ -247,9 +250,6 @@ Setup_Video::Setup_Video(const Widget2 *const widget) : scrollArea->setWidth(150); scrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); - mOpenGLListModel = new OpenGLListModel; - mOpenGLDropDown = new DropDown(widget, mOpenGLListModel); - #ifdef USE_OPENGL #ifdef ANDROID if (mOpenGLEnabled == 1 || mOpenGLEnabled == 2) diff --git a/src/gui/shortcutwindow.cpp b/src/gui/shortcutwindow.cpp index 06127c8b2..6f00e36c2 100644 --- a/src/gui/shortcutwindow.cpp +++ b/src/gui/shortcutwindow.cpp @@ -59,7 +59,8 @@ ShortcutWindow::ShortcutWindow(const std::string &title, Window("Window", false, nullptr, skinFile), mItems(content), mScrollArea(new ScrollArea(mItems, false)), - mTabs(nullptr) + mTabs(nullptr), + mPages() { setWindowName(title); setTitleBarHeight(getPadding() + getTitlePadding()); @@ -108,7 +109,8 @@ ShortcutWindow::ShortcutWindow(const std::string &title, std::string skinFile, Window("Window", false, nullptr, skinFile), mItems(nullptr), mScrollArea(nullptr), - mTabs(new TabbedArea(this)) + mTabs(new TabbedArea(this)), + mPages() { setWindowName(title); setTitleBarHeight(getPadding() + getTitlePadding()); diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index cb4d2e481..a6c01cbb5 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -63,6 +63,12 @@ class SkillEntry; class SkillModel final : public gcn::ListModel { public: + SkillModel() : + mSkills(), + mVisibleSkills() + { + } + int getNumberOfElements() { return static_cast<int>(mVisibleSkills.size()); } @@ -101,10 +107,9 @@ class SkillListBox final : public ListBox mHighlightColor(getThemeColor(Theme::HIGHLIGHT)), mTextColor(getThemeColor(Theme::TEXT)), mTextPadding(mSkin ? mSkin->getOption("textPadding", 34) : 34), - mSpacing(mSkin ? mSkin->getOption("spacing", 0) : 0) + mSpacing(mSkin ? mSkin->getOption("spacing", 0) : 0), + mRowHeight(getFont()->getHeight() * 2 + mSpacing + 2 * mPadding) { - mRowHeight = getFont()->getHeight() * 2 - + mSpacing + 2 * mPadding; if (mRowHeight < 34) mRowHeight = 34; } @@ -263,7 +268,9 @@ class SkillTab final : public Tab SkillDialog::SkillDialog() : Window(_("Skills"), false, nullptr, "skills.xml"), gcn::ActionListener(), + mSkills(), mTabs(new TabbedArea(this)), + mDeleteTabs(), mPointsLabel(new Label(this, "0")), mUseButton(new Button(this, _("Use"), "use", this)), mIncreaseButton(new Button(this, _("Up"), "inc", this)), @@ -692,8 +699,19 @@ void SkillDialog::playUpdateEffect(const int id) } SkillInfo::SkillInfo() : - level(0), skillLevelWidth(0), id(0), modifiable(false), - visible(false), model(nullptr), progress(0.0f), range(0) + level(0), + skillLevel(), + skillLevelWidth(0), + id(0), + modifiable(false), + visible(false), + model(nullptr), + skillExp(), + progress(0.0f), + range(0), + color(), + data(nullptr), + dataMap() { dataMap[0] = new SkillData(); data = dataMap[0]; @@ -778,7 +796,12 @@ SkillData *SkillInfo::getData1(const int lev) } SkillData::SkillData() : + name(), + shortName(), + dispName(), + description(), icon(nullptr), + particle(), soundHit("", 0), soundMiss("", 0) { diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp index 893809def..b787c685e 100644 --- a/src/gui/socialwindow.cpp +++ b/src/gui/socialwindow.cpp @@ -420,7 +420,8 @@ class BeingsListModal final : public AvatarListModel { public: BeingsListModal() : - AvatarListModel() + AvatarListModel(), + mMembers() { } @@ -1231,8 +1232,11 @@ SocialWindow::SocialWindow() : mGuildInvited(0), mGuildAcceptDialog(nullptr), mGuildCreateDialog(nullptr), + mPartyInviter(), mPartyAcceptDialog(nullptr), mPartyCreateDialog(nullptr), + mGuilds(), + mParties(), mAttackFilter(nullptr), mPickupFilter(nullptr), // TRANSLATORS: here P is title for visible players tab in social window diff --git a/src/gui/speechbubble.cpp b/src/gui/speechbubble.cpp index 00746c7fd..66aed08c1 100644 --- a/src/gui/speechbubble.cpp +++ b/src/gui/speechbubble.cpp @@ -35,6 +35,7 @@ SpeechBubble::SpeechBubble() : Popup("Speech", "speechbubble.xml"), + mText(), mCaption(new Label(this)), mSpeechBox(new TextBox(this)) { diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index ef91582f8..6f8255089 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -154,7 +154,8 @@ StatusWindow::StatusWindow() : mDAttrScroll(new ScrollArea(mDAttrCont, false)), mCharacterPointsLabel(new Label(this, "C")), mCorrectionPointsLabel(nullptr), - mCopyButton(new Button(this, _("Copy to chat"), "copy", this)) + mCopyButton(new Button(this, _("Copy to chat"), "copy", this)), + mAttrs() { listen(CHANNEL_ATTRIBUTES); diff --git a/src/gui/textcommandeditor.cpp b/src/gui/textcommandeditor.cpp index 076a7a7f2..019d38133 100644 --- a/src/gui/textcommandeditor.cpp +++ b/src/gui/textcommandeditor.cpp @@ -54,7 +54,8 @@ class IconsModal final : public gcn::ListModel { public: - IconsModal() + IconsModal() : + mStrings() { std::map<int, ItemInfo*> items = ItemDB::getItemInfos(); std::list<std::string> tempStrings; @@ -165,6 +166,7 @@ TextCommandEditor::TextCommandEditor(TextCommand *const command) : gcn::ActionListener(), mIsMagicCommand(command->getCommandType() == TEXT_COMMAND_MAGIC), mCommand(command), + mAdvanced(false), mIsMagic(new RadioButton(this, _("magic"), "magic", mIsMagicCommand)), mIsOther(new RadioButton(this, _("other"), "magic", !mIsMagicCommand)), mSymbolLabel(new Label(this, _("Symbol:"))), @@ -201,8 +203,6 @@ TextCommandEditor::TextCommandEditor(TextCommand *const command) : setWindowName("TextCommandEditor"); setDefaultSize(w, h, ImageRect::CENTER); - mAdvanced = false; - mIsMagic->setActionEventId("magic"); mIsMagic->addActionListener(this); diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index 0d2e7d16f..27945b808 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -169,8 +169,9 @@ int Skin::getMinHeight() const mBorder->grid[ImageRect::LOWER_LEFT]->getHeight(); } -Theme::Theme(): +Theme::Theme() : Palette(THEME_COLORS_END * THEME_PALETTES), + mSkins(), mMinimumOpacity(-1.0f), mProgressColors(ProgressColors(THEME_PROG_END)) { @@ -406,6 +407,21 @@ static const SkinParameter imageParam[] = struct SkinHelper final { + SkinHelper() : + partType(), + xPos(), + yPos(), + width(), + height(), + rect(), + node(), + image(), + resman() + { + } + + A_DELETE_COPY(SkinHelper) + std::string partType; int xPos; int yPos; diff --git a/src/gui/theme.h b/src/gui/theme.h index 7914c9c26..fcd0f5614 100644 --- a/src/gui/theme.h +++ b/src/gui/theme.h @@ -43,6 +43,11 @@ const int THEME_PALETTES = 5; struct ThemeInfo final { + ThemeInfo() : + name(), + copyright() + { + } std::string name; std::string copyright; }; diff --git a/src/gui/tradewindow.cpp b/src/gui/tradewindow.cpp index a6f5b8d3e..e77fd3482 100644 --- a/src/gui/tradewindow.cpp +++ b/src/gui/tradewindow.cpp @@ -76,7 +76,10 @@ TradeWindow::TradeWindow(): mAutoAddToNick(""), mGotMoney(0), mGotMaxMoney(0), - mAutoMoney(0) + mAutoMoney(0), + mAutoAddAmount(0), + mOkOther(false), + mOkMe(false) { logger->log1("TradeWindow::TradeWindow nick"); diff --git a/src/gui/tradewindow.h b/src/gui/tradewindow.h index 975446aa4..ebf0cf6b2 100644 --- a/src/gui/tradewindow.h +++ b/src/gui/tradewindow.h @@ -172,13 +172,14 @@ class TradeWindow final : public Window, TextField *mMoneyField; Status mStatus; - bool mOkOther, mOkMe; Item* mAutoAddItem; std::string mAutoAddToNick; int mGotMoney; int mGotMaxMoney; int mAutoMoney; int mAutoAddAmount; + bool mOkOther; + bool mOkMe; }; extern TradeWindow *tradeWindow; diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp index 7ec4c42f2..935408714 100644 --- a/src/gui/updaterwindow.cpp +++ b/src/gui/updaterwindow.cpp @@ -57,15 +57,15 @@ const std::string txtUpdateFile = "resources2.txt"; const std::string updateServer2 = "http://download.evolonline.org/manaplus/updates/"; -std::vector<updateFile> loadXMLFile(const std::string &fileName); -std::vector<updateFile> loadTxtFile(const std::string &fileName); +std::vector<UpdateFile> loadXMLFile(const std::string &fileName); +std::vector<UpdateFile> loadTxtFile(const std::string &fileName); /** * Load the given file into a vector of updateFiles. */ -std::vector<updateFile> loadXMLFile(const std::string &fileName) +std::vector<UpdateFile> loadXMLFile(const std::string &fileName) { - std::vector<updateFile> files; + std::vector<UpdateFile> files; XML::Document doc(fileName, false); const XmlNodePtr rootNode = doc.rootNode(); @@ -81,7 +81,7 @@ std::vector<updateFile> loadXMLFile(const std::string &fileName) if (!xmlNameEqual(fileNode, "update")) continue; - updateFile file; + UpdateFile file; file.name = XML::getProperty(fileNode, "file", ""); file.hash = XML::getProperty(fileNode, "hash", ""); file.type = XML::getProperty(fileNode, "type", "data"); @@ -98,9 +98,9 @@ std::vector<updateFile> loadXMLFile(const std::string &fileName) return files; } -std::vector<updateFile> loadTxtFile(const std::string &fileName) +std::vector<UpdateFile> loadTxtFile(const std::string &fileName) { - std::vector<updateFile> files; + std::vector<UpdateFile> files; std::ifstream fileHandler; fileHandler.open(fileName.c_str(), std::ios::in); @@ -112,7 +112,7 @@ std::vector<updateFile> loadTxtFile(const std::string &fileName) fileHandler.getline(name, 256, ' '); fileHandler.getline(hash, 50); - updateFile thisFile; + UpdateFile thisFile; thisFile.name = name; thisFile.hash = hash; thisFile.type = "data"; @@ -144,7 +144,9 @@ UpdaterWindow::UpdaterWindow(const std::string &updateHost, mUpdatesDir(updatesDir), mUpdatesDirReal(updatesDir), mCurrentFile("news.txt"), + mNewLabelCaption(), mDownloadProgress(0.0f), + mDownloadMutex(), mCurrentChecksum(0), mStoreInMemory(true), mDownloadComplete(true), @@ -152,6 +154,8 @@ UpdaterWindow::UpdaterWindow(const std::string &updateHost, mDownloadedBytes(0), mMemoryBuffer(nullptr), mDownload(nullptr), + mUpdateFiles(), + mTempUpdateFiles(), mUpdateIndex(0), mUpdateIndexOffset(0), mLoadUpdates(applyUpdates), @@ -549,7 +553,7 @@ void UpdaterWindow::loadLocalUpdates(const std::string &dir) { const ResourceManager *const resman = ResourceManager::getInstance(); - std::vector<updateFile> updateFiles + std::vector<UpdateFile> updateFiles = loadXMLFile(std::string(dir).append("/").append(xmlUpdateFile)); if (updateFiles.empty()) @@ -575,7 +579,7 @@ void UpdaterWindow::loadManaPlusUpdates(const std::string &dir, const ResourceManager *const resman) { std::string fixPath = dir + "/fix"; - std::vector<updateFile> updateFiles + std::vector<UpdateFile> updateFiles = loadXMLFile(std::string(fixPath).append("/").append(xmlUpdateFile)); for (unsigned int updateIndex = 0, sz = static_cast<unsigned int>( @@ -722,7 +726,7 @@ void UpdaterWindow::logic() { if (mUpdateIndex < mUpdateFiles.size()) { - updateFile thisFile = mUpdateFiles[mUpdateIndex]; + UpdateFile thisFile = mUpdateFiles[mUpdateIndex]; if (!thisFile.required) { // This statement checks to see if the file type @@ -794,7 +798,7 @@ void UpdaterWindow::logic() { if (mUpdateIndex < mTempUpdateFiles.size()) { - updateFile thisFile = mTempUpdateFiles[mUpdateIndex]; + UpdateFile thisFile = mTempUpdateFiles[mUpdateIndex]; mCurrentFile = thisFile.name; std::string checksum; checksum = thisFile.hash; diff --git a/src/gui/updaterwindow.h b/src/gui/updaterwindow.h index fb94b0e97..1ee35195a 100644 --- a/src/gui/updaterwindow.h +++ b/src/gui/updaterwindow.h @@ -43,14 +43,22 @@ class ProgressBar; class ResourceManager; class ScrollArea; -struct updateFile final +struct UpdateFile final { public: + UpdateFile() : + name(), + hash(), + type(), + desc(), + required(false) + { + } std::string name; std::string hash; std::string type; - bool required; std::string desc; + bool required; }; /** @@ -127,8 +135,6 @@ class UpdaterWindow final : public Window, static void loadManaPlusUpdates(const std::string &dir, const ResourceManager *const resman); - int updateState; - private: void download(); @@ -212,10 +218,10 @@ private: Net::Download *mDownload; /** List of files to download. */ - std::vector<updateFile> mUpdateFiles; + std::vector<UpdateFile> mUpdateFiles; /** List of temp files to download. */ - std::vector<updateFile> mTempUpdateFiles; + std::vector<UpdateFile> mTempUpdateFiles; /** Index of the file to be downloaded. */ unsigned int mUpdateIndex; diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp index 75e8a95d6..27db30e77 100644 --- a/src/gui/whoisonline.cpp +++ b/src/gui/whoisonline.cpp @@ -82,8 +82,16 @@ WhoIsOnline::WhoIsOnline(): mDownloadedBytes(0), mMemoryBuffer(nullptr), mCurlError(new char[CURL_ERROR_SIZE]), + mBrowserBox(new BrowserBox(this)), + mScrollArea(new ScrollArea(mBrowserBox, false)), + mUpdateTimer(0), + mOnlinePlayers(), + mOnlineNicks(), + mUpdateButton(new Button(this, _("Update"), "update", this)), mAllowUpdate(true), mShowLevel(false), + mUpdateOnlineList(config.getBoolValue("updateOnlineList")), + mGroupFriends(true) { mCurlError[0] = 0; @@ -92,19 +100,15 @@ WhoIsOnline::WhoIsOnline(): const int h = 350; const int w = 200; setDefaultSize(w, h, ImageRect::CENTER); -// setContentSize(w, h); setVisible(false); setCloseButton(true); setResizable(true); setStickyButtonLock(true); setSaveVisible(true); - mUpdateButton = new Button(this, _("Update"), "update", this); mUpdateButton->setEnabled(false); mUpdateButton->setDimension(gcn::Rectangle(5, 5, w - 10, 20 + 5)); - mBrowserBox = new BrowserBox(this); - mScrollArea = new ScrollArea(mBrowserBox, false); mBrowserBox->setOpaque(false); mBrowserBox->setHighlightMode(BrowserBox::BACKGROUND); mScrollArea->setDimension(gcn::Rectangle(5, 20 + 10, w - 10, h - 10 - 30)); @@ -114,7 +118,6 @@ WhoIsOnline::WhoIsOnline(): add(mUpdateButton); add(mScrollArea); - mUpdateTimer = 0; setLocationRelativeTo(getParent()); loadWindowState(); @@ -125,7 +128,6 @@ WhoIsOnline::WhoIsOnline(): widgetResized(gcn::Event(nullptr)); config.addListener("updateOnlineList", this); config.addListener("groupFriends", this); - mUpdateOnlineList = config.getBoolValue("updateOnlineList"); mGroupFriends = config.getBoolValue("groupFriends"); } diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index 4ac0a3632..35cd2aa32 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -49,6 +49,10 @@ BrowserBox::BrowserBox(const Widget2 *const widget, const unsigned int mode, gcn::Widget(), Widget2(widget), gcn::MouseListener(), + mTextRows(), + mTextRowLinksCount(), + mLineParts(), + mLinks(), mLinkHandler(nullptr), mMode(mode), mHighMode(UNDERLINE | BACKGROUND), @@ -148,7 +152,7 @@ void BrowserBox::addRow(const std::string &row, const bool atTop) // Use links and user defined colors if (mUseLinksAndUserColors) { - BROWSER_LINK bLink; + BrowserLink bLink; // Check for links in format "@@link|Caption@@" idx1 = tmp.find("@@"); @@ -340,7 +344,7 @@ struct MouseOverLink mX(x), mY(y) { } - bool operator() (const BROWSER_LINK &link) const + bool operator() (const BrowserLink &link) const { return (mX >= link.x1 && mX < link.x2 && mY >= link.y1 && mY < link.y2); diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h index 304fa1e6c..739b5a18c 100644 --- a/src/gui/widgets/browserbox.h +++ b/src/gui/widgets/browserbox.h @@ -38,9 +38,22 @@ class Image; class Resource; class LinkHandler; -struct BROWSER_LINK final +struct BrowserLink final { - int x1, x2, y1, y2; /**< Where link is placed */ + BrowserLink() : + x1(0), + x2(0), + y1(0), + y2(0), + link(), + caption() + { + } + + int x1; + int x2; + int y1; + int y2; std::string link; std::string caption; }; @@ -68,8 +81,10 @@ class LinePart final mY(y), mColor(color), mColor2(color2), + mText(), mType(1), - mImage(image), mBold(false) + mImage(image), + mBold(false) { } @@ -227,7 +242,7 @@ class BrowserBox final : public gcn::Widget, typedef LinePartList::const_iterator LinePartCIter; LinePartList mLineParts; - typedef std::vector<BROWSER_LINK> Links; + typedef std::vector<BrowserLink> Links; typedef Links::iterator LinkIterator; Links mLinks; diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index ec0215206..1ae22aabe 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -70,6 +70,10 @@ Button::Button(const Widget2 *const widget) : mMode(0), mXOffset(0), mYOffset(0), + mEnabledColor(getThemeColor(Theme::BUTTON)), + mDisabledColor(getThemeColor(Theme::BUTTON_DISABLED)), + mHighlightedColor(getThemeColor(Theme::BUTTON_HIGHLIGHTED)), + mPressedColor(getThemeColor(Theme::BUTTON_PRESSED)), mImages(nullptr), mImageSet(nullptr), mImageWidth(0), @@ -95,6 +99,10 @@ Button::Button(const Widget2 *const widget, mMode(0), mXOffset(0), mYOffset(0), + mEnabledColor(getThemeColor(Theme::BUTTON)), + mDisabledColor(getThemeColor(Theme::BUTTON_DISABLED)), + mHighlightedColor(getThemeColor(Theme::BUTTON_HIGHLIGHTED)), + mPressedColor(getThemeColor(Theme::BUTTON_PRESSED)), mImages(nullptr), mImageSet(nullptr), mImageWidth(0), @@ -126,6 +134,10 @@ Button::Button(const Widget2 *const widget, mMode(0), mXOffset(0), mYOffset(0), + mEnabledColor(getThemeColor(Theme::BUTTON)), + mDisabledColor(getThemeColor(Theme::BUTTON_DISABLED)), + mHighlightedColor(getThemeColor(Theme::BUTTON_HIGHLIGHTED)), + mPressedColor(getThemeColor(Theme::BUTTON_PRESSED)), mImages(nullptr), mImageSet(nullptr), mImageWidth(imageWidth), @@ -157,6 +169,10 @@ Button::Button(const Widget2 *const widget, const std::string &imageName, mMode(0), mXOffset(0), mYOffset(0), + mEnabledColor(getThemeColor(Theme::BUTTON)), + mDisabledColor(getThemeColor(Theme::BUTTON_DISABLED)), + mHighlightedColor(getThemeColor(Theme::BUTTON_HIGHLIGHTED)), + mPressedColor(getThemeColor(Theme::BUTTON_PRESSED)), mImages(nullptr), mImageSet(nullptr), mImageWidth(imageWidth), @@ -192,10 +208,6 @@ void Button::init() updateAlpha(); } - mEnabledColor = getThemeColor(Theme::BUTTON); - mDisabledColor = getThemeColor(Theme::BUTTON_DISABLED); - mHighlightedColor = getThemeColor(Theme::BUTTON_HIGHLIGHTED); - mPressedColor = getThemeColor(Theme::BUTTON_PRESSED); mInstances++; } diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index 68a056077..56450cd1f 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -37,6 +37,7 @@ Desktop::Desktop(const Widget2 *const widget) : Container(widget), gcn::WidgetListener(), mWallpaper(nullptr), + mVersionLabel(nullptr), mBackgroundColor(getThemeColor(Theme::BACKGROUND, 128)), mBackgroundGrayColor(getThemeColor(Theme::BACKGROUND_GRAY)) { diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index 31a41307c..f05f40b62 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -76,10 +76,12 @@ DropDown::DropDown(const Widget2 *const widget, mHighlightColor(getThemeColor(Theme::HIGHLIGHT)), mPadding(1), mImagePadding(2), + mSpacing(0), mDroppedDown(false), mPushed(false), mFoldedUpHeight(0), - mIsDragged(false) + mIsDragged(false), + mSelectionListeners() { mFrameSize = 2; @@ -156,10 +158,10 @@ DropDown::DropDown(const Widget2 *const widget, if (mSkin) { + mSpacing = mSkin->getOption("spacing"); mFrameSize = mSkin->getOption("frameSize"); mPadding = mSkin->getPadding(); mImagePadding = mSkin->getOption("imagePadding"); - mSpacing = mSkin->getOption("spacing"); } adjustHeight(); } diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp index 8be6a4197..9366a9e36 100644 --- a/src/gui/widgets/emoteshortcutcontainer.cpp +++ b/src/gui/widgets/emoteshortcutcontainer.cpp @@ -47,6 +47,7 @@ static const int MAX_ITEMS = 48; EmoteShortcutContainer::EmoteShortcutContainer(): ShortcutContainer(), + mEmoteImg(), mEmoteClicked(false), mEmoteMoved(0), mEmotePopup(new TextPopup) diff --git a/src/gui/widgets/extendednamesmodel.cpp b/src/gui/widgets/extendednamesmodel.cpp index 90deb999c..4b9eabdae 100644 --- a/src/gui/widgets/extendednamesmodel.cpp +++ b/src/gui/widgets/extendednamesmodel.cpp @@ -26,7 +26,9 @@ #include "debug.h" -ExtendedNamesModel::ExtendedNamesModel() +ExtendedNamesModel::ExtendedNamesModel() : + mNames(), + mImages() { } diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp index 5a53a27b4..7cb5698c3 100644 --- a/src/gui/widgets/guitable.cpp +++ b/src/gui/widgets/guitable.cpp @@ -103,10 +103,11 @@ GuiTable::GuiTable(const Widget2 *const widget, mModel(nullptr), mSelectedRow(0), mSelectedColumn(0), - mTopWidget(nullptr) + mTopWidget(nullptr), + mActionListeners(), + mBackgroundColor(getThemeColor(Theme::BACKGROUND)), + mHighlightColor(getThemeColor(Theme::HIGHLIGHT)) { - mBackgroundColor = getThemeColor(Theme::BACKGROUND); - mHighlightColor = getThemeColor(Theme::HIGHLIGHT); setModel(initial_model); setFocusable(true); diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index 08e319588..3dfc23f1c 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -174,11 +174,6 @@ private: static float mAlpha; - /** - * Holds the background color of the table. - */ - gcn::Color mBackgroundColor; - TableModel *mModel; int mSelectedRow; @@ -190,6 +185,11 @@ private: /** Vector for compactness; used as a list in practice. */ std::vector<GuiTableActionListener *> mActionListeners; + /** + * Holds the background color of the table. + */ + gcn::Color mBackgroundColor; + gcn::Color mHighlightColor; }; diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 50ab7dfca..bbdaf0d20 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -172,6 +172,7 @@ ItemContainer::ItemContainer(const Widget2 *const widget, mDragPosY(0), mTag(0), mSortType(0), + mName(), mItemPopup(new ItemPopup), mShowMatrix(nullptr), mClicks(1), @@ -183,6 +184,7 @@ ItemContainer::ItemContainer(const Widget2 *const widget, "equippedTextPadding", 29) : 29), mPaddingItemX(mSkin ? mSkin->getOption("paddingItemX", 0) : 0), mPaddingItemY(mSkin ? mSkin->getOption("paddingItemY", 0) : 0), + mSelectionListeners(), mEquipedColor(getThemeColor(Theme::ITEM_EQUIPPED)), mUnEquipedColor(getThemeColor(Theme::ITEM_NOT_EQUIPPED)) { diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp index 76a1aeaaf..78652b4af 100644 --- a/src/gui/widgets/itemlinkhandler.cpp +++ b/src/gui/widgets/itemlinkhandler.cpp @@ -42,6 +42,13 @@ struct OpenUrlListener : public gcn::ActionListener { + OpenUrlListener() : + url() + { + } + + A_DELETE_COPY(OpenUrlListener) + void action(const gcn::ActionEvent &event) { if (event.getId() == "yes") diff --git a/src/gui/widgets/layout.cpp b/src/gui/widgets/layout.cpp index 932f8dfe5..9f0f761cd 100644 --- a/src/gui/widgets/layout.cpp +++ b/src/gui/widgets/layout.cpp @@ -108,7 +108,9 @@ void LayoutCell::computeSizes() mSize[1] = mArray->getSize(1); } -LayoutArray::LayoutArray(): mSpacing(4) +LayoutArray::LayoutArray(): + mCells(), + mSpacing(4) { } diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h index 267e8da6e..7dbb61384 100644 --- a/src/gui/widgets/layout.h +++ b/src/gui/widgets/layout.h @@ -189,7 +189,7 @@ class LayoutCell mSize[1] = 0; } - ~LayoutCell(); + virtual ~LayoutCell(); /** * Sets the padding around the cell content. diff --git a/src/gui/widgets/layouthelper.cpp b/src/gui/widgets/layouthelper.cpp index b95c6f93f..196b60415 100644 --- a/src/gui/widgets/layouthelper.cpp +++ b/src/gui/widgets/layouthelper.cpp @@ -26,6 +26,7 @@ LayoutHelper::LayoutHelper(gcn::Container *const container) : gcn::WidgetListener(), + mLayout(), mContainer(container) { mContainer->addWidgetListener(this); diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 7be2c15c3..2e84bb1a2 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -48,7 +48,8 @@ ListBox::ListBox(const Widget2 *const widget, mForegroundSelectedColor(getThemeColor(Theme::LISTBOX_SELECTED)), mDistributeMousePressed(true), mOldSelected(-1), - mPadding(0) + mPadding(0), + mSkin(nullptr) { mForegroundColor = getThemeColor(Theme::LISTBOX); diff --git a/src/gui/widgets/namesmodel.cpp b/src/gui/widgets/namesmodel.cpp index 05c12599c..bac8ee0b7 100644 --- a/src/gui/widgets/namesmodel.cpp +++ b/src/gui/widgets/namesmodel.cpp @@ -29,7 +29,8 @@ #include "debug.h" -NamesModel::NamesModel() +NamesModel::NamesModel() : + mNames() { } diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp index b713365b6..98c0adc42 100644 --- a/src/gui/widgets/playerbox.cpp +++ b/src/gui/widgets/playerbox.cpp @@ -38,6 +38,7 @@ PlayerBox::PlayerBox(Being *const being, const std::string &skin) : ScrollArea(), mBeing(being), mAlpha(1.0), + mBackground(), mSkin(nullptr), mDrawBackground(false), mOffsetX(-16), @@ -50,6 +51,7 @@ PlayerBox::PlayerBox(std::string skin) : ScrollArea(), mBeing(nullptr), mAlpha(1.0), + mBackground(), mSkin(nullptr), mDrawBackground(false), mOffsetX(-16), diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp index 20b4c3ca1..c2e39fdb2 100644 --- a/src/gui/widgets/popup.cpp +++ b/src/gui/widgets/popup.cpp @@ -38,6 +38,8 @@ Popup::Popup(const std::string &name, Container(nullptr), gcn::MouseListener(), gcn::WidgetListener(), + mPadding(3), + mSkin(nullptr), mPopupName(name), mMinWidth(100), mMinHeight(40), @@ -53,8 +55,6 @@ Popup::Popup(const std::string &name, addWidgetListener(this); - setPadding(3); - if (skin == "") skin = "popup.xml"; @@ -68,10 +68,6 @@ Popup::Popup(const std::string &name, setPalette(mSkin->getOption("palette")); } } - else - { - mSkin = nullptr; - } // Add this window to the window container windowContainer->add(this); diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp index de5543680..175bb7318 100644 --- a/src/gui/widgets/progressbar.cpp +++ b/src/gui/widgets/progressbar.cpp @@ -44,11 +44,15 @@ ProgressBar::ProgressBar(const Widget2 *const widget, float progress, gcn::Widget(), Widget2(widget), gcn::WidgetListener(), + mSkin(nullptr), mProgress(progress), mProgressToGo(progress), mSmoothProgress(true), mProgressPalette(color), + mColor(Theme::getProgressColor(color >= 0 ? color : 0, mProgress)), + mColorToGo(mColor), mSmoothColorChange(true), + mText(), mVertexes(new ImageCollection), mRedraw(true), mPadding(2), @@ -60,8 +64,6 @@ ProgressBar::ProgressBar(const Widget2 *const widget, float progress, mProgress = 1.0f; mForegroundColor = getThemeColor(Theme::PROGRESS_BAR); - mColor = Theme::getProgressColor(color >= 0 ? color : 0, mProgress); - mColorToGo = mColor; addWidgetListener(this); setSize(width, height); diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index e44ec74a7..ed99061fc 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -61,6 +61,7 @@ SetupItem::SetupItem(std::string text, std::string description, mValue(""), mDefault(""), mWidget(nullptr), + mTempWidgets(), mValueType(VBOOL) { } @@ -81,6 +82,7 @@ SetupItem::SetupItem(std::string text, std::string description, mValue(""), mDefault(def), mWidget(nullptr), + mTempWidgets(), mValueType(VBOOL) { } @@ -190,7 +192,8 @@ SetupItemCheckBox::SetupItemCheckBox(std::string text, std::string description, SetupTabScroll *const parent, std::string eventName, const bool mainConfig) : - SetupItem(text, description, keyName, parent, eventName, mainConfig) + SetupItem(text, description, keyName, parent, eventName, mainConfig), + mCheckBox(nullptr) { createControls(); } @@ -200,7 +203,8 @@ SetupItemCheckBox::SetupItemCheckBox(std::string text, std::string description, SetupTabScroll *const parent, std::string eventName, std::string def, const bool mainConfig) : - SetupItem(text, description, keyName, parent, eventName, def, mainConfig) + SetupItem(text, description, keyName, parent, eventName, def, mainConfig), + mCheckBox(nullptr) { createControls(); } diff --git a/src/gui/widgets/setuptab.cpp b/src/gui/widgets/setuptab.cpp index 9aeec73dc..68246cd0a 100644 --- a/src/gui/widgets/setuptab.cpp +++ b/src/gui/widgets/setuptab.cpp @@ -27,7 +27,8 @@ SetupTab::SetupTab(const Widget2 *const widget) : Container(widget), gcn::ActionListener(), - gcn::WidgetListener() + gcn::WidgetListener(), + mName() { setOpaque(false); addWidgetListener(this); diff --git a/src/gui/widgets/setuptabscroll.cpp b/src/gui/widgets/setuptabscroll.cpp index ec8f36eba..f407cce3b 100644 --- a/src/gui/widgets/setuptabscroll.cpp +++ b/src/gui/widgets/setuptabscroll.cpp @@ -31,6 +31,8 @@ SetupTabScroll::SetupTabScroll(const Widget2 *const widget) : SetupTab(widget), mContainer(new VertContainer(this, 25, false, 8)), mScroll(new ScrollArea(mContainer, false)), + mItems(), + mAllItems(), mPreferredFirstItemSize(200) { mScroll->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER); diff --git a/src/gui/widgets/setuptouchitem.cpp b/src/gui/widgets/setuptouchitem.cpp index 5d1ddfadc..aa731504f 100644 --- a/src/gui/widgets/setuptouchitem.cpp +++ b/src/gui/widgets/setuptouchitem.cpp @@ -40,7 +40,9 @@ static class SortTouchActionFunctor final } touchActionSorter; TouchActionsModel::TouchActionsModel() : - NamesModel() + NamesModel(), + mActionId(), + mActionToSelection() { std::vector<SetupActionData*> data; diff --git a/src/gui/widgets/shopitems.cpp b/src/gui/widgets/shopitems.cpp index 74cb6a716..2f8d31111 100644 --- a/src/gui/widgets/shopitems.cpp +++ b/src/gui/widgets/shopitems.cpp @@ -29,6 +29,7 @@ #include "debug.h" ShopItems::ShopItems(const bool mergeDuplicates) : + mShopItems(), mMergeDuplicates(mergeDuplicates) { } diff --git a/src/gui/widgets/sliderlist.cpp b/src/gui/widgets/sliderlist.cpp index 70734b707..c90be3629 100644 --- a/src/gui/widgets/sliderlist.cpp +++ b/src/gui/widgets/sliderlist.cpp @@ -47,12 +47,11 @@ SliderList::SliderList(const Widget2 *const widget, gcn::MouseListener(), mLabel(new Label(this)), mListModel(listModel), + mPrevEventId(eventId + "_prev"), + mNextEventId(eventId + "_next"), mOldWidth(0), mSelectedIndex(0) { - mPrevEventId = eventId + "_prev"; - mNextEventId = eventId + "_next"; - setHeight(sliderHeight); mButtons[0] = new Button(this, "<", mPrevEventId, this); diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp index ae7d426a8..ed9436c11 100644 --- a/src/gui/widgets/tab.cpp +++ b/src/gui/widgets/tab.cpp @@ -74,6 +74,7 @@ Tab::Tab(const Widget2 *const widget) : mFlashOutlineColor(&getThemeColor(Theme::TAB_FLASH_OUTLINE)), mPlayerFlashColor(&getThemeColor(Theme::TAB_PLAYER_FLASH)), mPlayerFlashOutlineColor(&getThemeColor(Theme::TAB_PLAYER_FLASH_OUTLINE)), + mFlash(0), mVertexes(new ImageCollection), mRedraw(true), mMode(0) diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 3eb09a113..75be5bf6f 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -42,6 +42,8 @@ TabbedArea::TabbedArea(const Widget2 *const widget) : mSelectedTab(nullptr), mTabContainer(new gcn::Container()), mWidgetContainer(new gcn::Container()), + mTabsToDelete(), + mTabs(), mOpaque(false), mTabsWidth(0), mVisibleTabsWidth(0), diff --git a/src/gui/widgets/tablemodel.cpp b/src/gui/widgets/tablemodel.cpp index 543c50ebd..3b0c3e854 100644 --- a/src/gui/widgets/tablemodel.cpp +++ b/src/gui/widgets/tablemodel.cpp @@ -67,7 +67,9 @@ StaticTableModel::StaticTableModel(const int row, const int column) : TableModel(), mRows(row), mColumns(column), - mHeight(1) + mHeight(1), + mTableModel(), + mWidths() { mTableModel.resize(row * column, nullptr); mWidths.resize(column, 1); diff --git a/src/gui/widgets/tablemodel.h b/src/gui/widgets/tablemodel.h index 7e061efb1..dace35a14 100644 --- a/src/gui/widgets/tablemodel.h +++ b/src/gui/widgets/tablemodel.h @@ -57,6 +57,10 @@ public: class TableModel { public: + TableModel() : + listeners() + { + } virtual ~TableModel() { } diff --git a/src/gui/widgets/vertcontainer.cpp b/src/gui/widgets/vertcontainer.cpp index c8bc862ee..ea7bb4e30 100644 --- a/src/gui/widgets/vertcontainer.cpp +++ b/src/gui/widgets/vertcontainer.cpp @@ -28,6 +28,7 @@ VertContainer::VertContainer(const Widget2 *const widget, const int leftSpacing) : Container(widget), gcn::WidgetListener(), + mResizableWidgets(), mVerticalItemSize(verticalItemSize), mCount(0), mNextY(0), diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h index 053b1560f..d657567ad 100644 --- a/src/gui/widgets/widget2.h +++ b/src/gui/widgets/widget2.h @@ -29,12 +29,14 @@ class Widget2 { public: Widget2() : - mPaletteOffset(0) + mPaletteOffset(0), + mForegroundColor2() { } explicit Widget2(const Widget2 *const widget) : - mPaletteOffset(widget ? widget->mPaletteOffset : 0) + mPaletteOffset(widget ? widget->mPaletteOffset : 0), + mForegroundColor2() { checkPalette(); } diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 4d16937e2..053c60875 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -60,6 +60,9 @@ Window::Window(const std::string &caption, const bool modal, mGrip(nullptr), mParent(parent), mLayout(nullptr), + mCloseRect(), + mStickyRect(), + mGripRect(), mWindowName("window"), mShowTitle(true), mModal(modal), diff --git a/src/gui/widgets/windowcontainer.cpp b/src/gui/widgets/windowcontainer.cpp index bb43a6261..cba565cc4 100644 --- a/src/gui/widgets/windowcontainer.cpp +++ b/src/gui/widgets/windowcontainer.cpp @@ -31,7 +31,8 @@ WindowContainer *windowContainer = nullptr; WindowContainer::WindowContainer(const Widget2 *const widget) : - Container(widget) + Container(widget), + mDeathList() { } diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index 7a583e954..9c03d20cc 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -55,6 +55,9 @@ WindowMenu::WindowMenu(const Widget2 *const widget) : mPadding(mSkin ? mSkin->getPadding() : 1), mSpacing(mSkin ? mSkin->getOption("spacing", 3) : 3), mTextPopup(new TextPopup), + mButtons(), + mButtonTexts(), + mButtonNames(), mHaveMouse(false), mAutoHide(1), mSmallWindow(mainGraphics->getWidth() < 600) |