diff options
Diffstat (limited to 'src/ui/include/wheel_encoder.hpp')
| -rw-r--r-- | src/ui/include/wheel_encoder.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ui/include/wheel_encoder.hpp b/src/ui/include/wheel_encoder.hpp new file mode 100644 index 00000000..0651ce0b --- /dev/null +++ b/src/ui/include/wheel_encoder.hpp @@ -0,0 +1,30 @@ +/* + * Copyright 2023 jacqueline <me@jacqueline.id.au> + * + * SPDX-License-Identifier: GPL-3.0-only + */ + +#pragma once + +#include <memory> + +#include "hal/lv_hal_indev.h" + +#include "relative_wheel.hpp" + +namespace ui { + +class TouchWheelEncoder { + public: + explicit TouchWheelEncoder(std::weak_ptr<drivers::RelativeWheel> wheel); + + auto Read(lv_indev_data_t *data) -> void; + auto registration() -> lv_indev_t* { return registration_; } + + private: + lv_indev_drv_t driver_; + lv_indev_t *registration_; + std::weak_ptr<drivers::RelativeWheel> wheel_; +}; + +} // namespace ui |
