37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <chrono>
|
|
#include <optional>
|
|
#include <set>
|
|
#include <vector>
|
|
|
|
#include <luma.hpp>
|
|
|
|
#include <vamp_style.hpp>
|
|
#include <vamp_zero/menu.hpp>
|
|
|
|
|
|
namespace vamp_zero {
|
|
|
|
struct menu_target {
|
|
luma::rect bounds{};
|
|
vamp_zero::menu_action action{};
|
|
};
|
|
|
|
auto menu_layout(luma::rect bounds, vamp_zero::app_state const &state) -> std::vector<vamp_zero::menu_target>;
|
|
auto draw_label(luma::draw_context &context, luma::rect bounds, std::string text, std::float32_t size, vamp_style::color color) -> void;
|
|
auto draw_menu(luma::draw_context &context, luma::rect bounds, vamp_zero::app_state const &state) -> void;
|
|
auto draw_header(luma::draw_context &context, luma::rect bounds, vamp_zero::app_state const &state) -> void;
|
|
|
|
class menu_touch {
|
|
public:
|
|
auto handle(luma::touch_event const &event, luma::rect bounds, vamp_zero::app_state const &state) -> std::optional<vamp_zero::menu_action>;
|
|
private:
|
|
std::set<std::int32_t> fingers_{};
|
|
std::optional<vamp_zero::menu_target> target_{};
|
|
luma::point origin_{};
|
|
std::chrono::steady_clock::time_point pressed_{};
|
|
};
|
|
|
|
}
|