From 1573a8c4cde1cd9528b422b2dcc598e37ffe94a7 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 2 May 2024 19:12:26 +1000 Subject: WIP merge cyclically dependent components into one big component --- src/tangara/input/input_device.hpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/tangara/input/input_device.hpp (limited to 'src/tangara/input/input_device.hpp') diff --git a/src/tangara/input/input_device.hpp b/src/tangara/input/input_device.hpp new file mode 100644 index 00000000..d944c3bf --- /dev/null +++ b/src/tangara/input/input_device.hpp @@ -0,0 +1,37 @@ +/* + * Copyright 2024 jacqueline + * + * SPDX-License-Identifier: GPL-3.0-only + */ + +#pragma once + +#include +#include +#include + +#include "hal/lv_hal_indev.h" +#include "input_hook.hpp" +#include "property.hpp" + +namespace input { + +/* + * Interface for all device input methods. Each 'Input Device' is polled by + * LVGL at regular intervals, and can effect the device either via LVGL's input + * device driver API, or by emitting events for other parts of the system to + * react to (e.g. issuing a play/pause event, or altering the volume). + */ +class IInputDevice { + public: + virtual ~IInputDevice() {} + + virtual auto read(lv_indev_data_t* data) -> void = 0; + + virtual auto name() -> std::string = 0; + virtual auto triggers() -> std::vector> { + return {}; + } +}; + +} // namespace input -- cgit v1.2.3