33 lines
739 B
C++
33 lines
739 B
C++
#pragma once
|
|
|
|
#include "window.h"
|
|
#include "tft_handler.h"
|
|
#include "event_manager.h"
|
|
#include <vector>
|
|
#include "GLOBALS.h"
|
|
|
|
#define COL_WHITE 0xffff
|
|
#define COL_BLACK 0x0000
|
|
#define COL_GREY 0xbdf7
|
|
#define COL_LIGHT_GREY 0x8410
|
|
#define COL_DARK_BLUE 0x0014
|
|
#define COL_RED 0xf800
|
|
|
|
class WindowManager : public IEventListener {
|
|
private:
|
|
TFT_Handler* tft;
|
|
DISPLAY_STATE* display_state;
|
|
std::vector<Window> windows;
|
|
|
|
int handle_window_click(CLICK_EVENT event);
|
|
|
|
public:
|
|
void init(TFT_Handler* th, DISPLAY_STATE* ds);
|
|
void create_window(Window window);
|
|
void close_window(int window_id);
|
|
void draw_all();
|
|
void draw_window(Window window);
|
|
|
|
// IEventListener interface
|
|
void on_click_event(CLICK_EVENT event) override;
|
|
}; |