This is a bigger patch rewriting some part of the config saving functionality in device.cpp in order to:
- Make it possible to save ScrollMode as integer instead of using three booleans
- Simplify the addition of new keys or types in the future
Changes in detail:
a) Added new ConfigKey ScrollMethod and removed now unnecessary keys per method
b) Added constructors to the ConfigData struct. This allows to create ConfigData entries for s_configData without the need of stating empty brackets and allows default values. I switched to plain member function pointers instead of std::function, because I had compile errors all the time with std::function. Adding a new ConfigKey is possible without touching the member function pointer though. Only when a new type is added, it is necessary to copy-paste one of the old pointer definitions as a new struct and its constructor.
c) Cleaned up ScrollMethod functions and added interface methods for transforming the saved integer into type enum libinput_config_scroll_method.
d) Adjusted auto test for loading the ScrollMethod value from the config file.