From a6b4485ac5ea0673e0ce35dab14e2df26c27823e Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Mon, 30 Sep 2024 08:37:38 -0500 Subject: More setup to configurable controls. --- src/config.hpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/config.hpp') diff --git a/src/config.hpp b/src/config.hpp index 81da2dc..95df6b6 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -3,6 +3,7 @@ #include #include +#include #include #include #include @@ -69,6 +70,7 @@ using ShortcutMap = std::map; using ShortcutRevMap = std::map; ShortcutSet shortcutSetFromList(const ShortcutList& shortcutList); +ShortcutList shortcutListFromSet(const ShortcutSet& shortcutList); class Shortcuts { public: @@ -91,12 +93,18 @@ class Shortcuts { const ShortcutMap& shortcutMap() const; + static ShortcutMap fromUserConfig(const std::filesystem::path& configFileName); + private: + Shortcuts() = default; + + static Shortcuts fromLuaConfig(const std::filesystem::path& configFileName); + bool m_valid{false}; - ShortcutMap m_actionToShortcuts; - ShortcutSet m_shortcuts; - ShortcutRevMap m_shortcutToAction; + ShortcutMap m_actionToShortcuts{}; + ShortcutSet m_shortcuts{}; + ShortcutRevMap m_shortcutToAction{}; }; struct GetsuyomiConfig { @@ -114,6 +122,10 @@ struct GetsuyomiConfig { ShortcutList nextShortcuts{}; ShortcutList backShortcuts{}; + ShortcutList singlePageShortcuts{}; + ShortcutList dualPageShortcuts{}; + ShortcutList mangaPageShortcuts{}; + ShortcutMap shortcuts() const; }; -- cgit v1.2.3