diff options
| author | a1xd <[email protected]> | 2021-09-08 04:43:15 -0400 |
|---|---|---|
| committer | a1xd <[email protected]> | 2021-09-23 22:34:51 -0400 |
| commit | 427a94bc4086c67a044ebbaed8bc789b1ed174c9 (patch) | |
| tree | ae2daa55e24a7947e0691c3763d1d9163ccd53e8 /common | |
| parent | fix clang build errors (diff) | |
| download | rawaccel-427a94bc4086c67a044ebbaed8bc789b1ed174c9.tar.xz rawaccel-427a94bc4086c67a044ebbaed8bc789b1ed174c9.zip | |
rename driver_settings
found a better one
refactor driver/DeviceSetup
Diffstat (limited to 'common')
| -rw-r--r-- | common/rawaccel-io.hpp | 16 | ||||
| -rw-r--r-- | common/rawaccel.hpp | 12 |
2 files changed, 14 insertions, 14 deletions
diff --git a/common/rawaccel-io.hpp b/common/rawaccel-io.hpp index f368896..046ac3d 100644 --- a/common/rawaccel-io.hpp +++ b/common/rawaccel-io.hpp @@ -47,19 +47,19 @@ namespace rawaccel { size_t size = sizeof(base_data); - if (base_data.driver_data_size == 0) { + if (base_data.modifier_data_size == 0) { // driver has no data, but it's more useful to return something, - // so return a default driver_settings object along with base data + // so return a default modifier_settings object along with base data - size += sizeof(driver_settings); - base_data.driver_data_size = 1; + size += sizeof(modifier_settings); + base_data.modifier_data_size = 1; auto bytes = std::make_unique<std::byte[]>(size); *reinterpret_cast<io_base*>(bytes.get()) = base_data; - *reinterpret_cast<driver_settings*>(bytes.get() + sizeof(io_base)) = {}; + *reinterpret_cast<modifier_settings*>(bytes.get() + sizeof(io_base)) = {}; return bytes; } else { - size += sizeof(driver_settings) * base_data.driver_data_size; + size += sizeof(modifier_settings) * base_data.modifier_data_size; size += sizeof(device_settings) * base_data.device_data_size; auto bytes = std::make_unique<std::byte[]>(size); io_control(READ, NULL, 0, bytes.get(), DWORD(size)); @@ -74,7 +74,7 @@ namespace rawaccel { auto* base_ptr = static_cast<const io_base*>(buffer); auto size = sizeof(io_base); - size += base_ptr->driver_data_size * sizeof(driver_settings); + size += base_ptr->modifier_data_size * sizeof(modifier_settings); size += base_ptr->device_data_size * sizeof(device_settings); if (size > DWORD(-1)) throw io_error("write buffer is too large"); @@ -85,7 +85,7 @@ namespace rawaccel { inline void reset() { io_base base_data{}; - // all driver/device data is cleared when a default io_base is passed + // all modifier/device data is cleared when a default io_base is passed io_control(WRITE, &base_data, sizeof(io_base), NULL, 0); } diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp index c7bf33d..be4e1a5 100644 --- a/common/rawaccel.hpp +++ b/common/rawaccel.hpp @@ -24,7 +24,7 @@ namespace rawaccel { device_config config; }; - struct driver_settings { + struct modifier_settings { profile prof; struct data_t { @@ -34,7 +34,7 @@ namespace rawaccel { } data = {}; }; - inline void init_data(driver_settings& settings) + inline void init_data(modifier_settings& settings) { auto set_accel = [](accel_union& u, const accel_args& args) { u.visit([&](auto& impl) { @@ -50,18 +50,18 @@ namespace rawaccel { struct io_base { device_config default_dev_cfg; - unsigned driver_data_size = 0; + unsigned modifier_data_size = 0; unsigned device_data_size = 0; }; - static_assert(alignof(io_base) == alignof(driver_settings) && alignof(driver_settings) == alignof(device_settings)); + static_assert(alignof(io_base) == alignof(modifier_settings) && alignof(modifier_settings) == alignof(device_settings)); class modifier { public: #ifdef _KERNEL_MODE __forceinline #endif - void modify(vec2d& in, const driver_settings& settings, double dpi_factor, milliseconds time) const + void modify(vec2d& in, const modifier_settings& settings, double dpi_factor, milliseconds time) const { auto& args = settings.prof; auto& data = settings.data; @@ -147,7 +147,7 @@ namespace rawaccel { } } - modifier(driver_settings& settings) + modifier(modifier_settings& settings) { auto& args = settings.prof; |