IconTheme.h 721 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include <filesystem>
  3. #include <map>
  4. #include <optional>
  5. #include <string>
  6. #include <vector>
  7. namespace WallpaperEngine::Desktop {
  8. class IconTheme {
  9. public:
  10. static IconTheme& get ();
  11. [[nodiscard]] std::optional<std::filesystem::path> find (const std::string& icon);
  12. private:
  13. IconTheme ();
  14. struct Candidate {
  15. std::filesystem::path path;
  16. int score;
  17. };
  18. const std::map<std::string, Candidate>& index (const std::string& theme);
  19. [[nodiscard]] std::vector<std::string> inherits (const std::string& theme) const;
  20. std::vector<std::filesystem::path> m_baseDirs;
  21. std::vector<std::string> m_themes;
  22. std::map<std::string, std::map<std::string, Candidate>> m_indexes;
  23. };
  24. }