summaryrefslogtreecommitdiff
path: root/src/tangara/ui/lvgl_task.hpp
blob: fcf00ab17dccc488d747d936cc16a86071fd2da2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * Copyright 2023 jacqueline <me@jacqueline.id.au>
 *
 * SPDX-License-Identifier: GPL-3.0-only
 */

#pragma once

#include <atomic>
#include <cstdbool>
#include <memory>

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/timers.h"

#include "drivers/display.hpp"
#include "input/lvgl_input_driver.hpp"
#include "drivers/touchwheel.hpp"
#include "ui/screen.hpp"
#include "ui/themes.hpp"

namespace ui {

class UiTask {
 public:
  static auto Start() -> UiTask*;
  ~UiTask();

  auto input(std::shared_ptr<input::LvglInputDriver> input) -> void;

 private:
  UiTask();

  auto Main() -> void;

  std::shared_ptr<input::LvglInputDriver> input_;
  std::shared_ptr<Screen> current_screen_;
};

}  // namespace ui