uisettings.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. // Copyright 2016 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <array>
  6. #include <atomic>
  7. #include <vector>
  8. #include <QByteArray>
  9. #include <QMetaType>
  10. #include <QString>
  11. #include <QStringList>
  12. #include <QVector>
  13. #include "common/common_types.h"
  14. #include "common/settings.h"
  15. namespace UISettings {
  16. struct ContextualShortcut {
  17. QString keyseq;
  18. QString controller_keyseq;
  19. int context;
  20. };
  21. struct Shortcut {
  22. QString name;
  23. QString group;
  24. ContextualShortcut shortcut;
  25. };
  26. enum class Theme {
  27. Default,
  28. DefaultColorful,
  29. Dark,
  30. DarkColorful,
  31. MidnightBlue,
  32. MidnightBlueColorful,
  33. };
  34. using Themes = std::array<std::pair<const char*, const char*>, 6>;
  35. extern const Themes themes;
  36. struct GameDir {
  37. QString path;
  38. bool deep_scan = false;
  39. bool expanded = false;
  40. bool operator==(const GameDir& rhs) const {
  41. return path == rhs.path;
  42. }
  43. bool operator!=(const GameDir& rhs) const {
  44. return !operator==(rhs);
  45. }
  46. };
  47. struct Values {
  48. QByteArray geometry;
  49. QByteArray state;
  50. QByteArray renderwindow_geometry;
  51. QByteArray gamelist_header_state;
  52. QByteArray microprofile_geometry;
  53. Settings::BasicSetting<bool> microprofile_visible{false, "microProfileDialogVisible"};
  54. Settings::BasicSetting<bool> single_window_mode{true, "singleWindowMode"};
  55. Settings::BasicSetting<bool> fullscreen{false, "fullscreen"};
  56. Settings::BasicSetting<bool> display_titlebar{true, "displayTitleBars"};
  57. Settings::BasicSetting<bool> show_filter_bar{true, "showFilterBar"};
  58. Settings::BasicSetting<bool> show_status_bar{true, "showStatusBar"};
  59. Settings::BasicSetting<bool> confirm_before_closing{true, "confirmClose"};
  60. Settings::BasicSetting<bool> first_start{true, "firstStart"};
  61. Settings::BasicSetting<bool> pause_when_in_background{false, "pauseWhenInBackground"};
  62. Settings::BasicSetting<bool> mute_when_in_background{false, "muteWhenInBackground"};
  63. Settings::BasicSetting<bool> hide_mouse{true, "hideInactiveMouse"};
  64. Settings::BasicSetting<bool> select_user_on_boot{false, "select_user_on_boot"};
  65. // Discord RPC
  66. Settings::BasicSetting<bool> enable_discord_presence{true, "enable_discord_presence"};
  67. Settings::BasicSetting<bool> enable_screenshot_save_as{true, "enable_screenshot_save_as"};
  68. QString roms_path;
  69. QString symbols_path;
  70. QString game_dir_deprecated;
  71. bool game_dir_deprecated_deepscan;
  72. QVector<UISettings::GameDir> game_dirs;
  73. QStringList recent_files;
  74. QString language;
  75. QString theme;
  76. // Shortcut name <Shortcut, context>
  77. std::vector<Shortcut> shortcuts;
  78. Settings::BasicSetting<uint32_t> callout_flags{0, "calloutFlags"};
  79. // logging
  80. Settings::BasicSetting<bool> show_console{false, "showConsole"};
  81. // Game List
  82. Settings::BasicSetting<bool> show_add_ons{true, "show_add_ons"};
  83. Settings::BasicSetting<uint32_t> game_icon_size{64, "game_icon_size"};
  84. Settings::BasicSetting<uint32_t> folder_icon_size{48, "folder_icon_size"};
  85. Settings::BasicSetting<uint8_t> row_1_text_id{3, "row_1_text_id"};
  86. Settings::BasicSetting<uint8_t> row_2_text_id{2, "row_2_text_id"};
  87. std::atomic_bool is_game_list_reload_pending{false};
  88. Settings::BasicSetting<bool> cache_game_list{true, "cache_game_list"};
  89. Settings::BasicSetting<bool> favorites_expanded{true, "favorites_expanded"};
  90. QVector<u64> favorited_ids;
  91. bool configuration_applied;
  92. bool reset_to_defaults;
  93. Settings::BasicSetting<bool> disable_web_applet{true, "disable_web_applet"};
  94. };
  95. extern Values values;
  96. } // namespace UISettings
  97. Q_DECLARE_METATYPE(UISettings::GameDir*);