PocketPutr/Desktop_Test/shell.h

43 lines
1.2 KiB
C++

#pragma once
#include "tft_handler.h"
#include "event_manager.h"
#include "system_manager.h"
#include <vector>
#include "GLOBALS.h"
#include "program.h"
class Shell : public IEventListener {
private:
TFT_Handler* tft;
DISPLAY_STATE* display_state;
std::vector<Window*> windows;
std::vector<TaskBarItem> task_bar_items;
std::vector<DesktopItem> items;
SystemManager* _system_manager;
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, SystemManager* system_manager);
// ======= Window =======
void create_window(Window* window);
void close_window(int window_id);
void minimize_window(int window_id);
void draw_window(const Window& window);
// ======= Desktop =======
void draw_background(int color);
void draw_task_bar(int color);
void draw_start_menu();
void draw_desktop_Item(const DesktopItem& desktop_item);
// ======= Shared =======
void draw_all();
// IEventListener interface
void on_click_event(CLICK_EVENT event) override;
};