// Copyright 2018 Dolphin Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include #include #include #include #include #include "Common/CommonTypes.h" #include "VideoCommon/PostProcessing.h" class EnhancementsWidget; class QCheckBox; class QDialogButtonBox; class QGridLayout; class QLineEdit; class QSlider; class QTabWidget; class QWidget; class PostProcessingConfigWindow final : public QDialog { Q_OBJECT public: explicit PostProcessingConfigWindow(EnhancementsWidget* parent, const std::string& shader); ~PostProcessingConfigWindow(); private: class ConfigGroup final { public: explicit ConfigGroup( const VideoCommon::PostProcessingConfiguration::ConfigurationOption* config_option); const std::string& GetGUIName() const noexcept; const std::string& GetParent() const noexcept; const std::string& GetOptionName() const noexcept; void AddSubGroup(std::unique_ptr&& subgroup); bool HasSubGroups() const noexcept; const std::vector>& GetSubGroups() const noexcept; u32 AddWidgets(PostProcessingConfigWindow* parent, QGridLayout* grid, u32 row); void EnableSuboptions(bool state); int GetSliderValue(size_t index) const; void SetSliderText(size_t index, const QString& text); private: u32 AddBool(PostProcessingConfigWindow* parent, QGridLayout* grid, u32 row); u32 AddInteger(PostProcessingConfigWindow* parent, QGridLayout* grid, u32 row); u32 AddFloat(PostProcessingConfigWindow* parent, QGridLayout* grid, u32 row); QCheckBox* m_checkbox; std::vector m_sliders; std::vector m_value_boxes; const VideoCommon::PostProcessingConfiguration::ConfigurationOption* m_config_option; std::vector> m_subgroups; }; void Create(); void ConnectWidgets(); QWidget* CreateDependentTab(const std::unique_ptr& config_group); void PopulateGroups(); void UpdateBool(ConfigGroup* config_group, bool state); void UpdateInteger(ConfigGroup* config_group, int value); void UpdateFloat(ConfigGroup* config_group, int value); QTabWidget* m_tabs; QDialogButtonBox* m_buttons; const std::string& m_shader; VideoCommon::PostProcessingConfiguration* m_post_processor; std::unordered_map m_config_map; std::vector> m_config_groups; };