From 5025c209cb4f2dbead01b6053f7e9a036161b1a2 Mon Sep 17 00:00:00 2001 From: Takayama Fumihiko Date: Thu, 21 Sep 2023 08:56:34 +0900 Subject: [PATCH] Add get_device_mouse_flip_*, set_device_mouse_flip_* --- .../core_configuration/details/profile.hpp | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/src/share/core_configuration/details/profile.hpp b/src/share/core_configuration/details/profile.hpp index e302579c9..773394ec4 100644 --- a/src/share/core_configuration/details/profile.hpp +++ b/src/share/core_configuration/details/profile.hpp @@ -357,6 +357,90 @@ class profile final { } } + bool get_device_mouse_flip_x(const device_identifiers& identifiers) const { + for (const auto& d : devices_) { + if (d.get_identifiers() == identifiers) { + return d.get_mouse_flip_x(); + } + } + return false; + } + + void set_device_mouse_flip_x(const device_identifiers& identifiers, + bool value) { + add_device(identifiers); + + for (auto&& device : devices_) { + if (device.get_identifiers() == identifiers) { + device.set_mouse_flip_x(value); + return; + } + } + } + + bool get_device_mouse_flip_y(const device_identifiers& identifiers) const { + for (const auto& d : devices_) { + if (d.get_identifiers() == identifiers) { + return d.get_mouse_flip_y(); + } + } + return false; + } + + void set_device_mouse_flip_y(const device_identifiers& identifiers, + bool value) { + add_device(identifiers); + + for (auto&& device : devices_) { + if (device.get_identifiers() == identifiers) { + device.set_mouse_flip_y(value); + return; + } + } + } + + bool get_device_mouse_flip_vertical_wheel(const device_identifiers& identifiers) const { + for (const auto& d : devices_) { + if (d.get_identifiers() == identifiers) { + return d.get_mouse_flip_vertical_wheel(); + } + } + return false; + } + + void set_device_mouse_flip_vertical_wheel(const device_identifiers& identifiers, + bool value) { + add_device(identifiers); + + for (auto&& device : devices_) { + if (device.get_identifiers() == identifiers) { + device.set_mouse_flip_vertical_wheel(value); + return; + } + } + } + + bool get_device_mouse_flip_horizontal_wheel(const device_identifiers& identifiers) const { + for (const auto& d : devices_) { + if (d.get_identifiers() == identifiers) { + return d.get_mouse_flip_horizontal_wheel(); + } + } + return false; + } + + void set_device_mouse_flip_horizontal_wheel(const device_identifiers& identifiers, + bool value) { + add_device(identifiers); + + for (auto&& device : devices_) { + if (device.get_identifiers() == identifiers) { + device.set_mouse_flip_horizontal_wheel(value); + return; + } + } + } + private: void add_device(const device_identifiers& identifiers) { for (auto&& device : devices_) {