40 lines
1.0 KiB
C++
40 lines
1.0 KiB
C++
#pragma once
|
|
#include "window.h"
|
|
#include "desktop.h"
|
|
#include "tft_handler.h"
|
|
#include "event_manager.h"
|
|
#include <vector>
|
|
#include "GLOBALS.h"
|
|
|
|
class WindowManager : public IEventListener {
|
|
private:
|
|
TFT_Handler* tft;
|
|
DISPLAY_STATE* display_state;
|
|
std::vector<Window> windows;
|
|
std::vector<TaskBarItem> task_bar_items;
|
|
std::vector<Desktop_Item> items;
|
|
|
|
int handle_window_click(CLICK_EVENT event);
|
|
int handle_desktop_click(CLICK_EVENT event);
|
|
int handle_taskbar_click(CLICK_EVENT event);
|
|
bool handle_start_button_click(CLICK_EVENT event);
|
|
|
|
public:
|
|
void init(TFT_Handler* th, DISPLAY_STATE* ds);
|
|
|
|
// ======= Window =======
|
|
void create_window(Window window);
|
|
void close_window(int window_id);
|
|
void minimize_window(int window_id);
|
|
void draw_window(Window window);
|
|
|
|
// ======= Desktop =======
|
|
void draw_background(int color);
|
|
void draw_task_bar(int color);
|
|
void draw_desktop_Item(Desktop_Item desktop_item);
|
|
|
|
// ======= Shared =======
|
|
void draw_all();
|
|
// IEventListener interface
|
|
void on_click_event(CLICK_EVENT event) override;
|
|
}; |