[feat] Layers mangaing

This commit is contained in:
2026-06-05 17:46:36 +08:00
Unverified
parent fd2ca8ad30
commit 1ba644168f
6 changed files with 483 additions and 28 deletions
+40
View File
@@ -0,0 +1,40 @@
#pragma once
#include <efi.h>
#define LAYER_MAX 32
#define LAYER_NAME_LEN 32
typedef enum {
LAYER_TYPE_DESKTOP,
LAYER_TYPE_WINDOW,
LAYER_TYPE_MOUSE,
LAYER_TYPE_OVERLAY,
} layer_type_t;
typedef struct layer {
UINT32 id;
char name[LAYER_NAME_LEN];
layer_type_t type;
int x, y;
UINT32 w, h;
int z;
bool visible;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL* buffer;
struct layer* next;
} layer_t;
// Initialization — allocates back buffer, registers keyboard handler
void layer_init(void);
// Layer management
layer_t* layer_create(const char* name, layer_type_t type, UINT32 w, UINT32 h);
void layer_destroy(layer_t* layer);
void layer_set_z(layer_t* layer, int z);
void layer_set_pos(layer_t* layer, int x, int y);
void layer_set_visible(layer_t* layer, bool visible);
layer_t* layer_get_by_id(UINT32 id);
layer_t* layer_get_focused(void);
// Compositor task entry
void layer_compositor_task(void);