42 lines
1.2 KiB
C++
42 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:
|
|
std::vector<TaskBarItem> task_bar_items;
|
|
std::vector<DesktopItem> items;
|
|
std::vector<Window*> windows;
|
|
TFT_Handler* tft;
|
|
DISPLAY_STATE* display_state;
|
|
SystemManager* _system_manager;
|
|
|
|
short handle_window_click(CLICK_EVENT event);
|
|
short handle_desktop_click(CLICK_EVENT event);
|
|
short 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(short window_id);
|
|
void minimize_window(short window_id);
|
|
void draw_window(const Window& window);
|
|
|
|
// ======= Desktop =======
|
|
void draw_background(short color);
|
|
void draw_task_bar(short 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;
|
|
}; |