logiops/src/logid/Configuration.h

44 lines
1.1 KiB
C
Raw Normal View History

2019-10-05 01:56:17 +00:00
#ifndef LOGID_CONFIGURATION_H
#define LOGID_CONFIGURATION_H
#include <map>
#include <libconfig.h++>
#include <hidpp20/ISmartShift.h>
#include "Actions.h"
2019-10-05 01:56:17 +00:00
namespace logid
{
2019-10-05 01:56:17 +00:00
class DeviceConfig;
class ButtonAction;
enum class Action;
2019-10-05 01:56:17 +00:00
class DeviceConfig
{
public:
DeviceConfig();
~DeviceConfig();
DeviceConfig(DeviceConfig* dc, Device* dev);
DeviceConfig(const libconfig::Setting& root);
const int* dpi = nullptr;
HIDPP20::ISmartShift::SmartshiftStatus* smartshift = nullptr;
2019-10-05 01:56:17 +00:00
const uint8_t* hiresscroll = nullptr;
std::map<uint16_t, ButtonAction*> actions;
const bool baseConfig = true;
};
class Configuration
{
public:
Configuration(const char* config_file);
Configuration() {}
std::map<std::string, DeviceConfig*> devices;
private:
libconfig::Config cfg;
};
2019-10-05 01:56:17 +00:00
ButtonAction* parse_action(Action action, const libconfig::Setting* action_config, bool is_gesture=false);
2019-10-05 01:56:17 +00:00
extern Configuration* global_config;
}
2019-10-05 01:56:17 +00:00
#endif //LOGID_CONFIGURATION_H