#pragma once #include #include #include #include #include #include #include #include "src/Targets/TargetMemory.hpp" #ifndef EXCLUDE_INSIGHT #include "src/Insight/UserInterfaces/InsightWindow/Widgets/PanelState.hpp" #include "src/Insight/UserInterfaces/InsightWindow/Widgets/PaneState.hpp" #include "src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPaneSettings.hpp" #endif #include "src/Helpers/BiMap.hpp" #ifndef EXCLUDE_INSIGHT struct InsightProjectSettings { public: std::optional mainWindowSize; std::optional leftPanelState; std::optional bottomPanelState; std::optional registersPaneState; /** * The key of the previously selected variant */ std::optional selectedVariantKey; std::map memoryInspectionPaneStatesByKey; std::map memoryInspectionSettingsByKey; InsightProjectSettings() = default; explicit InsightProjectSettings(const QJsonObject& jsonObject); [[nodiscard]] QJsonObject toJson() const; Widgets::TargetMemoryInspectionPaneSettings& findOrCreateMemoryInspectionPaneSettings( const QString& addressSpaceKey, const QString& memorySegmentKey ); Widgets::PaneState& findOrCreateMemoryInspectionPaneState( const QString& addressSpaceKey, const QString& memorySegmentKey ); private: static const inline BiMap addressTypesByName = { {AddressType::ABSOLUTE, "absolute"}, {AddressType::RELATIVE, "relative"}, }; [[nodiscard]] Widgets::TargetMemoryInspectionPaneSettings memoryInspectionPaneSettingsFromJson( const QJsonObject& jsonObject ) const; [[nodiscard]] Widgets::PanelState panelStateFromJson(const QJsonObject& jsonObject) const; [[nodiscard]] Widgets::PaneState paneStateFromJson(const QJsonObject& jsonObject) const; [[nodiscard]] QJsonObject memoryInspectionPaneSettingsToJson( const Widgets::TargetMemoryInspectionPaneSettings& inspectionPaneSettings ) const; [[nodiscard]] QJsonObject panelStateToJson(const Widgets::PanelState& panelState) const; [[nodiscard]] QJsonObject paneStateToJson(const Widgets::PaneState& paneState) const; }; #endif struct ProjectSettings { #ifndef EXCLUDE_INSIGHT InsightProjectSettings insightSettings; #endif ProjectSettings() = default; explicit ProjectSettings(const QJsonObject& jsonObject); [[nodiscard]] QJsonObject toJson() const; };