From 3041cc710384f02b0616d5f2c7a42d2451a158da Mon Sep 17 00:00:00 2001 From: Maschell Date: Tue, 31 Oct 2017 17:21:17 +0100 Subject: [PATCH] Changes to be compatible to the newest libgui --- Makefile | 2 +- .../gui/DefaultGuiSelectBox.cpp} | 12 ++--- .../gui/DefaultGuiSelectBox.h} | 6 +-- .../gui}/DefaultGuiSwitch.cpp | 2 +- src/{mygui => custom/gui}/DefaultGuiSwitch.h | 11 +++-- .../gui}/GuiConfigurationScreen.h | 3 +- .../gui}/GuiControllerInputDisplay.cpp | 0 .../gui}/GuiControllerInputDisplay.h | 0 src/menu/MainWindow.h | 2 +- src/menu/drc/MainWindowDRC.cpp | 2 +- src/menu/drc/MainWindowDRC.h | 2 +- src/menu/drc/content/ContentController.h | 2 +- src/menu/drc/content/ContentSettings.h | 7 ++- src/menu/tv/MainWindowTV.h | 2 +- src/mygui/DefaultGuiCheckBox.cpp | 45 ------------------- src/mygui/DefaultGuiCheckBox.h | 41 ----------------- 16 files changed, 25 insertions(+), 114 deletions(-) rename src/{mygui/DefaultSelectBox.cpp => custom/gui/DefaultGuiSelectBox.cpp} (88%) rename src/{mygui/DefaultSelectBox.h => custom/gui/DefaultGuiSelectBox.h} (90%) rename src/{mygui => custom/gui}/DefaultGuiSwitch.cpp (98%) rename src/{mygui => custom/gui}/DefaultGuiSwitch.h (83%) rename src/{mygui => custom/gui}/GuiConfigurationScreen.h (96%) rename src/{mygui => custom/gui}/GuiControllerInputDisplay.cpp (100%) rename src/{mygui => custom/gui}/GuiControllerInputDisplay.h (100%) delete mode 100644 src/mygui/DefaultGuiCheckBox.cpp delete mode 100644 src/mygui/DefaultGuiCheckBox.h diff --git a/Makefile b/Makefile index 3ee7db3..48d8746 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ BUILD := build BUILD_DBG := $(TARGET)_dbg SOURCES := src \ src/common \ - src/mygui \ + src/custom/gui \ src/language \ src/menu \ src/menu/tv \ diff --git a/src/mygui/DefaultSelectBox.cpp b/src/custom/gui/DefaultGuiSelectBox.cpp similarity index 88% rename from src/mygui/DefaultSelectBox.cpp rename to src/custom/gui/DefaultGuiSelectBox.cpp index 72c2b31..935d142 100644 --- a/src/mygui/DefaultSelectBox.cpp +++ b/src/custom/gui/DefaultGuiSelectBox.cpp @@ -14,13 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . ****************************************************************************/ -#include "DefaultSelectBox.h" +#include "DefaultGuiSelectBox.h" /** - * Constructor for the DefaultSelectBox class. + * Constructor for the DefaultGuiSelectBox class. */ -DefaultSelectBox::DefaultSelectBox(std::string caption, GuiFrame *parent) - : GuiSelectBox(caption,parent) +DefaultGuiSelectBox::DefaultGuiSelectBox(std::string caption, GuiFrame *parent) + : GuiSelectBox(NULL,caption) ,topBackgroundImg_imgdata(Resources::GetImageData("gameSettingsButton.png")) ,topBackgroundImg_img(topBackgroundImg_imgdata) ,topHighlightedImg_imgdata(Resources::GetImageData("gameSettingsButtonSelected.png")) @@ -39,9 +39,9 @@ DefaultSelectBox::DefaultSelectBox(std::string caption, GuiFrame *parent) this->setSoundClick(buttonClickSound); } /** - * Destructor for the DefaultSelectBox class. + * Destructor for the DefaultGuiSelectBox class. */ -DefaultSelectBox::~DefaultSelectBox() +DefaultGuiSelectBox::~DefaultGuiSelectBox() { Resources::RemoveImageData(topBackgroundImg_imgdata); Resources::RemoveImageData(topHighlightedImg_imgdata); diff --git a/src/mygui/DefaultSelectBox.h b/src/custom/gui/DefaultGuiSelectBox.h similarity index 90% rename from src/mygui/DefaultSelectBox.h rename to src/custom/gui/DefaultGuiSelectBox.h index b6a2de0..310e08a 100644 --- a/src/mygui/DefaultSelectBox.h +++ b/src/custom/gui/DefaultGuiSelectBox.h @@ -20,13 +20,13 @@ #include //!A simple select box with default values. -class DefaultSelectBox : public GuiSelectBox{ +class DefaultGuiSelectBox : public GuiSelectBox{ public: //!Constructor //!\param checked Checked - DefaultSelectBox(std::string caption, GuiFrame *parent = NULL); + DefaultGuiSelectBox(std::string caption, GuiFrame *parent = NULL); //!Destructor - virtual ~DefaultSelectBox(); + virtual ~DefaultGuiSelectBox(); protected: GuiImageData * topBackgroundImg_imgdata; diff --git a/src/mygui/DefaultGuiSwitch.cpp b/src/custom/gui/DefaultGuiSwitch.cpp similarity index 98% rename from src/mygui/DefaultGuiSwitch.cpp rename to src/custom/gui/DefaultGuiSwitch.cpp index 6a18b48..4205697 100644 --- a/src/mygui/DefaultGuiSwitch.cpp +++ b/src/custom/gui/DefaultGuiSwitch.cpp @@ -20,7 +20,7 @@ */ DefaultGuiSwitch::DefaultGuiSwitch(bool checked) - : GuiSwitch(checked) + : GuiSwitch(NULL,checked) ,switchbase_imgdata(Resources::GetImageData("switchIconBase.png")) ,switchbase_img(switchbase_imgdata) ,switchbase_highlighted_imgdata(Resources::GetImageData("switchIconBaseHighlighted.png")) diff --git a/src/mygui/DefaultGuiSwitch.h b/src/custom/gui/DefaultGuiSwitch.h similarity index 83% rename from src/mygui/DefaultGuiSwitch.h rename to src/custom/gui/DefaultGuiSwitch.h index acebbe3..da6c563 100644 --- a/src/mygui/DefaultGuiSwitch.h +++ b/src/custom/gui/DefaultGuiSwitch.h @@ -20,8 +20,7 @@ #include //!A simple switch -class DefaultGuiSwitch : public GuiSwitch -{ +class DefaultGuiSwitch : public GuiSwitch{ public: //!Constructor //!\param checked Checked @@ -30,16 +29,16 @@ class DefaultGuiSwitch : public GuiSwitch virtual ~DefaultGuiSwitch(); protected: - GuiImageData * switchbase_imgdata; + GuiImageData * switchbase_imgdata = NULL; GuiImage switchbase_img; - GuiImageData * switchbase_highlighted_imgdata; + GuiImageData * switchbase_highlighted_imgdata = NULL; GuiImage switchbase_highlighted_img; - GuiImageData * switchOn_imgdata; + GuiImageData * switchOn_imgdata = NULL; GuiImage switchOn_img; - GuiImageData * switchOff_imgdata; + GuiImageData * switchOff_imgdata = NULL; GuiImage switchOff_img; }; diff --git a/src/mygui/GuiConfigurationScreen.h b/src/custom/gui/GuiConfigurationScreen.h similarity index 96% rename from src/mygui/GuiConfigurationScreen.h rename to src/custom/gui/GuiConfigurationScreen.h index 226b847..4c40537 100644 --- a/src/mygui/GuiConfigurationScreen.h +++ b/src/custom/gui/GuiConfigurationScreen.h @@ -20,8 +20,7 @@ #include #include -class GuiConfigurationScreen : public GuiFrame -{ +class GuiConfigurationScreen : public GuiFrame{ public: GuiConfigurationScreen(s32 w, s32 h) : GuiFrame(w, h) {} virtual ~GuiConfigurationScreen() {} diff --git a/src/mygui/GuiControllerInputDisplay.cpp b/src/custom/gui/GuiControllerInputDisplay.cpp similarity index 100% rename from src/mygui/GuiControllerInputDisplay.cpp rename to src/custom/gui/GuiControllerInputDisplay.cpp diff --git a/src/mygui/GuiControllerInputDisplay.h b/src/custom/gui/GuiControllerInputDisplay.h similarity index 100% rename from src/mygui/GuiControllerInputDisplay.h rename to src/custom/gui/GuiControllerInputDisplay.h diff --git a/src/menu/MainWindow.h b/src/menu/MainWindow.h index ebe934d..3bdb242 100644 --- a/src/menu/MainWindow.h +++ b/src/menu/MainWindow.h @@ -22,7 +22,7 @@ #include #include #include -#include "mygui/GuiConfigurationScreen.h" +#include "custom/gui/GuiConfigurationScreen.h" #include "InputGetterMenu.h" class CVideo; diff --git a/src/menu/drc/MainWindowDRC.cpp b/src/menu/drc/MainWindowDRC.cpp index 1844b66..f3e208a 100644 --- a/src/menu/drc/MainWindowDRC.cpp +++ b/src/menu/drc/MainWindowDRC.cpp @@ -16,7 +16,7 @@ ****************************************************************************/ #include "MainWindowDRC.h" #include "../../version.h" -#include "mygui/GuiControllerInputDisplay.h" +#include "custom/gui/GuiControllerInputDisplay.h" extern u32 hostIpAddress; diff --git a/src/menu/drc/MainWindowDRC.h b/src/menu/drc/MainWindowDRC.h index 77c15de..5bbcad8 100644 --- a/src/menu/drc/MainWindowDRC.h +++ b/src/menu/drc/MainWindowDRC.h @@ -20,7 +20,7 @@ #include #include -#include "mygui/GuiConfigurationScreen.h" +#include "custom/gui/GuiConfigurationScreen.h" #include "MenuListDRC.h" #include "menu/MainWindow.h" #include "MainWindowContent.h" diff --git a/src/menu/drc/content/ContentController.h b/src/menu/drc/content/ContentController.h index 4a89665..66d44fb 100644 --- a/src/menu/drc/content/ContentController.h +++ b/src/menu/drc/content/ContentController.h @@ -24,7 +24,7 @@ #include "ContentTemplate.h" #include "menu/drc/MenuElementController.h" #include "menu/InputGetterMenu.h" -#include "mygui/GuiControllerInputDisplay.h" +#include "custom/gui/GuiControllerInputDisplay.h" class ContentController : public ContentTemplate{ public: diff --git a/src/menu/drc/content/ContentSettings.h b/src/menu/drc/content/ContentSettings.h index 90a8721..14ac34b 100644 --- a/src/menu/drc/content/ContentSettings.h +++ b/src/menu/drc/content/ContentSettings.h @@ -22,9 +22,8 @@ #include #include -#include "mygui/DefaultGuiCheckBox.h" -#include "mygui/DefaultGuiSwitch.h" -#include "mygui/DefaultSelectBox.h" +#include "custom/gui/DefaultGuiSwitch.h" +#include "custom/gui/DefaultGuiSelectBox.h" #include "ContentTemplate.h" class ContentSettings : public ContentTemplate{ @@ -35,7 +34,7 @@ public: private: GuiTrigger touchTrigger; GuiTrigger wpadTouchTrigger; - DefaultSelectBox languageSelectBox; + DefaultGuiSelectBox languageSelectBox; std::map languagesNames; diff --git a/src/menu/tv/MainWindowTV.h b/src/menu/tv/MainWindowTV.h index 778de1a..25a216a 100644 --- a/src/menu/tv/MainWindowTV.h +++ b/src/menu/tv/MainWindowTV.h @@ -22,7 +22,7 @@ #include #include #include -#include "mygui/GuiConfigurationScreen.h" +#include "custom/gui/GuiConfigurationScreen.h" #include "TVControllerBanner.h" diff --git a/src/mygui/DefaultGuiCheckBox.cpp b/src/mygui/DefaultGuiCheckBox.cpp deleted file mode 100644 index 3ff7726..0000000 --- a/src/mygui/DefaultGuiCheckBox.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2017 Maschell - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - ****************************************************************************/ -#include "DefaultGuiCheckBox.h" -/** - * Constructor for the DefaultGuiCheckBox class. - */ - -DefaultGuiCheckBox::DefaultGuiCheckBox(bool checked) - : GuiCheckBox(checked) - ,checkbox_imgdata(Resources::GetImageData("checkbox.png")) - ,checkbox_img(checkbox_imgdata) - ,checkbox_selected_imgdata(Resources::GetImageData("checkbox_selected.png")) - ,checkbox_selected_img(checkbox_selected_imgdata) - ,highlighted_imgdata(Resources::GetImageData("checkbox_highlighted.png")) - ,highlighted_img(highlighted_imgdata) -{ - setSize(checkbox_img.getWidth(),checkbox_img.getHeight()); - this->setImageBackground(&checkbox_img); - this->setImageSelected(&checkbox_selected_img); - this->setImageHighlighted(&highlighted_img); -} - -/** - * Destructor for the GuiButton class. - */ -DefaultGuiCheckBox::~DefaultGuiCheckBox() -{ - Resources::RemoveImageData(checkbox_imgdata); - Resources::RemoveImageData(checkbox_selected_imgdata); - Resources::RemoveImageData(highlighted_imgdata); -} diff --git a/src/mygui/DefaultGuiCheckBox.h b/src/mygui/DefaultGuiCheckBox.h deleted file mode 100644 index 0683e25..0000000 --- a/src/mygui/DefaultGuiCheckBox.h +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - * Copyright (C) 2017 Maschell - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - ****************************************************************************/ -#ifndef DEFAULT_GUI_CHECKBOX_H_ -#define DEFAULT_GUI_CHECKBOX_H_ - -#include - -//!A simple CheckBox -class DefaultGuiCheckBox : public GuiCheckBox{ - public: - //!Constructor - //!\param checked Checked - DefaultGuiCheckBox(bool checked); - //!Destructor - virtual ~DefaultGuiCheckBox(); - protected: - GuiImageData * checkbox_imgdata; - GuiImage checkbox_img; - - GuiImageData * checkbox_selected_imgdata; - GuiImage checkbox_selected_img; - - GuiImageData * highlighted_imgdata; - GuiImage highlighted_img; -}; - -#endif