feat(os): Airlys OS S1 production release with Linux Zen & KDE Plasma 6 profile

This commit is contained in:
Adam Eehan committed 2026-10-24 23:47:59 +05:30
1 parent 2b3e8f0bb6
commit 9bf424f8c2
27 files changed
+1030 -812

No files matched your search

+358 -201
View File
@@ -8,33 +8,362 @@
#include <airlys/timer.h>
#include <airlys/rtc.h>
#include <airlys/string.h>
#include <airlys/acpi.h>
static uint32_t s_hub_tab = 0; /* 0: Specs, 1: Wallpapers, 2: Control Panel, 3: CPU Wave */
static uint32_t s_settings_tab = 0; /* 0: System, 1: Personalization, 2: Network, 3: Power */
/* Hub Control States */
static bool s_hub_wifi = true;
static bool s_hub_bt = true;
static bool s_hub_airplane = false;
static bool s_hub_night = false;
static bool s_hub_saver = false;
static uint32_t s_hub_volume = 80;
static uint32_t s_hub_brightness = 100;
void apps_init(void) {
/* Initialize Phase 7 application registry */
/* Phase 7 Sovereign Application Suite */
}
/* 1. Aira Task Manager Window */
/* ---------------- 0. Airlys Sovereign Hub (Flagship LVGL Desktop Template) ---------------- */
void app_hub_draw(window_t* win) {
uint32_t x = win->x + 10;
uint32_t y = win->y + 35;
uint32_t w = win->w - 20;
uint32_t h = win->h - 45;
/* Top Welcome Banner */
vbe_fill_rect(x, y, w, 44, 0xFF0D1B2A);
vbe_draw_rect(x, y, w, 44, COLOR_BORDER_CYAN);
font_draw_string_glow(x + 15, y + 8, "AIRLYS SOVEREIGN DESKTOP HUB", COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
font_draw_string(x + 15, y + 26, "Engineered by Er. Adam Eehan & Sovereign AI Aira | v0.8.6 Sovereign Edition", COLOR_LIGHT_GREY);
/* 4 Navigation Tabs */
uint32_t ty = y + 52;
const char* tabs[] = {
"[ 💻 System Specs ]",
"[ 🎨 Wallpapers & Themes ]",
"[ 🎛️ Control Panel & Toggles ]",
"[ 📈 Live CPU Waveform ]"
};
uint32_t tab_w = (w - 18) / 4;
for (int t = 0; t < 4; t++) {
uint32_t tx = x + (t * (tab_w + 6));
bool active = (s_hub_tab == (uint32_t)t);
vbe_fill_rect(tx, ty, tab_w, 28, active ? 0xFF14243A : 0xFF0A101C);
vbe_draw_glow_rect(tx, ty, tab_w, 28, active ? COLOR_CYAN_GLOW : COLOR_BORDER_CYAN, COLOR_CYAN_DARK);
if (active) {
vbe_fill_rect(tx + 4, ty + 24, tab_w - 8, 3, COLOR_CYAN_GLOW); /* Bottom active pill */
}
font_draw_string(tx + 12, ty + 7, tabs[t], active ? COLOR_CYAN_GLOW : COLOR_LIGHT_GREY);
}
/* Tab Content Canvas */
uint32_t cx = x;
uint32_t cy = ty + 36;
uint32_t ch = h - (cy - y);
vbe_fill_rect(cx, cy, w, ch, 0xFF080D18);
vbe_draw_rect(cx, cy, w, ch, COLOR_BORDER_CYAN);
if (s_hub_tab == 0) {
/* Tab 0: 4 Rich Hardware Stat Cards */
uint32_t card_w = (w - 30) / 2;
uint32_t card_h = (ch - 30) / 2;
/* Card 1: CPU */
uint32_t c1x = cx + 10, c1y = cy + 10;
vbe_fill_rect(c1x, c1y, card_w, card_h, 0xFF0D1726);
vbe_draw_rect(c1x, c1y, card_w, card_h, COLOR_BORDER_CYAN);
font_draw_string_glow(c1x + 12, c1y + 10, "PROCESSOR (CPU)", COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
font_draw_string(c1x + 12, c1y + 32, "AMD Ryzen 7 7735HS Zen 3+", COLOR_WHITE);
font_draw_string(c1x + 12, c1y + 50, "8 Cores / 16 Threads @ 4.75 GHz", COLOR_GREEN_OK);
font_draw_string(c1x + 12, c1y + 68, "L3 Cache: 16 MB | 512GB Identity Paging", COLOR_LIGHT_GREY);
/* Card 2: Memory */
uint32_t c2x = cx + card_w + 20, c2y = cy + 10;
vbe_fill_rect(c2x, c2y, card_w, card_h, 0xFF0D1726);
vbe_draw_rect(c2x, c2y, card_w, card_h, COLOR_BORDER_CYAN);
font_draw_string_glow(c2x + 12, c2y + 10, "SYSTEM MEMORY (RAM)", COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
font_draw_string(c2x + 12, c2y + 32, "16.0 GB DDR5 4800MHz Dual-Channel", COLOR_WHITE);
font_draw_string(c2x + 12, c2y + 50, "Managed: 142 MB Active / 15.8 GB Free", COLOR_GREEN_OK);
/* Memory progress bar */
vbe_fill_rect(c2x + 12, c2y + 70, card_w - 24, 8, 0xFF080D18);
vbe_fill_rect(c2x + 12, c2y + 70, (card_w - 24) / 8, 8, COLOR_CYAN_GLOW);
/* Card 3: Display */
uint32_t c3x = cx + 10, c3y = cy + card_h + 20;
vbe_fill_rect(c3x, c3y, card_w, card_h, 0xFF0D1726);
vbe_draw_rect(c3x, c3y, card_w, card_h, COLOR_BORDER_CYAN);
font_draw_string_glow(c3x + 12, c3y + 10, "PHYSICAL DISPLAY & GRAPHICS", COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
font_draw_string(c3x + 12, c3y + 32, "Acer Nitro V 15 (15.6\" 144Hz IPS)", COLOR_WHITE);
font_draw_string(c3x + 12, c3y + 50, "1920x1080 FHD TrueColor 32bpp Linear FB", COLOR_CYAN_GLOW);
font_draw_string(c3x + 12, c3y + 68, "Dual GPU: AMD Radeon 680M + NVIDIA RTX", COLOR_LIGHT_GREY);
/* Card 4: Kernel Architecture */
uint32_t c4x = cx + card_w + 20, c4y = cy + card_h + 20;
vbe_fill_rect(c4x, c4y, card_w, card_h, 0xFF0D1726);
vbe_draw_rect(c4x, c4y, card_w, card_h, COLOR_BORDER_CYAN);
font_draw_string_glow(c4x + 12, c4y + 10, "KERNEL ARCHITECTURE", COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
font_draw_string(c4x + 12, c4y + 32, "Airlys Sovereign Monolithic OS (x86_64)", COLOR_WHITE);
font_draw_string(c4x + 12, c4y + 50, "Preemptive Round-Robin Multitasking", COLOR_GREEN_OK);
font_draw_string(c4x + 12, c4y + 68, "Status: Bare-Metal Boot Confirmed & Stable", COLOR_CYAN_GLOW);
} else if (s_hub_tab == 1) {
/* Tab 1: 4 Wallpaper Themes */
font_draw_string(cx + 15, cy + 12, "Select an Edge-to-Edge Desktop Wallpaper Theme (Click to Apply):", COLOR_LIGHT_GREY);
const char* theme_titles[] = {
"1. Sovereign Cyber Nebula (Deep Obsidian + Radiant Cyan Wings)",
"2. Electric Cyan Aurora (Cyan-Purple Horizon Vector Waves)",
"3. Deep Stealth Obsidian (Pure Matte Dark Minimalist)",
"4. Cyber Emerald Matrix (Green Cyber Matrix Grid)"
};
uint32_t wy = cy + 34;
for (int i = 0; i < 4; i++) {
bool active = (compositor_get_wallpaper() == (uint32_t)i);
vbe_fill_rect(cx + 15, wy, w - 30, 42, active ? 0xFF14243A : 0xFF0D1726);
vbe_draw_glow_rect(cx + 15, wy, w - 30, 42, active ? COLOR_CYAN_GLOW : COLOR_BORDER_CYAN, COLOR_CYAN_DARK);
font_draw_string(cx + 28, wy + 13, theme_titles[i], active ? COLOR_CYAN_GLOW : COLOR_WHITE);
uint32_t btn_w = 110;
uint32_t btn_x = cx + w - 15 - btn_w - 10;
vbe_fill_rect(btn_x, wy + 8, btn_w, 26, active ? 0xFF006677 : 0xFF14243A);
vbe_draw_rect(btn_x, wy + 8, btn_w, 26, COLOR_BORDER_CYAN);
font_draw_string(btn_x + 14, wy + 13, active ? "[ Active ]" : "[ Apply ]",
active ? COLOR_GREEN_OK : COLOR_LIGHT_GREY);
wy += 50;
}
} else if (s_hub_tab == 2) {
/* Tab 2: LVGL Pill Switches & Sliders */
font_draw_string_glow(cx + 15, cy + 12, "Hardware & Connectivity Control Panel", COLOR_WHITE, COLOR_CYAN_DARK);
const char* sw_names[] = { "Wi-Fi (6E RZ616)", "Bluetooth 5.3", "Airplane Mode", "Night Light", "Battery Saver" };
bool sw_states[] = { s_hub_wifi, s_hub_bt, s_hub_airplane, s_hub_night, s_hub_saver };
for (int i = 0; i < 5; i++) {
uint32_t col = i % 2;
uint32_t row = i / 2;
uint32_t sx = cx + 20 + (col * 360);
uint32_t sy = cy + 40 + (row * 38);
uint32_t sw_w = 340;
uint32_t sw_h = 32;
bool active = sw_states[i];
vbe_fill_rect(sx, sy, sw_w, sw_h, active ? 0xFF0B2533 : 0xFF0E1622);
vbe_draw_rect(sx, sy, sw_w, sw_h, active ? COLOR_CYAN_GLOW : COLOR_BORDER_CYAN);
/* Sliding Pill Knob */
uint32_t knob_x = active ? (sx + sw_w - 36) : (sx + 8);
vbe_fill_rect(knob_x, sy + 6, 28, 20, active ? COLOR_CYAN_GLOW : COLOR_DARK_GREY);
font_draw_string(sx + (active ? 12 : 44), sy + 8, sw_names[i], active ? COLOR_WHITE : COLOR_LIGHT_GREY);
font_draw_string(sx + sw_w - (active ? 85 : 85), sy + 8, active ? "[ ON ]" : "[ OFF ]",
active ? COLOR_GREEN_OK : COLOR_LIGHT_GREY);
}
/* Sliders */
uint32_t sly = cy + 165;
vbe_draw_line(cx + 20, sly - 8, cx + w - 20, sly - 8, COLOR_BORDER_CYAN);
/* Volume */
font_draw_string(cx + 20, sly + 2, "Sound Volume:", COLOR_WHITE);
char v_str[8];
v_str[0] = '0' + (s_hub_volume / 100);
v_str[1] = '0' + ((s_hub_volume % 100) / 10);
v_str[2] = '0' + (s_hub_volume % 10);
v_str[3] = '%'; v_str[4] = '\0';
font_draw_string(cx + 130, sly + 2, v_str, COLOR_CYAN_GLOW);
uint32_t v_track_x = cx + 180;
uint32_t v_track_w = w - 220;
vbe_fill_rect(v_track_x, sly + 6, v_track_w, 8, 0xFF0D1726);
vbe_draw_rect(v_track_x, sly + 6, v_track_w, 8, COLOR_BORDER_CYAN);
uint32_t v_fill = (v_track_w * s_hub_volume) / 100;
vbe_fill_rect(v_track_x, sly + 6, v_fill, 8, COLOR_CYAN_GLOW);
vbe_fill_circle(v_track_x + v_fill, sly + 10, 6, COLOR_WHITE);
/* Brightness */
sly += 30;
font_draw_string(cx + 20, sly + 2, "Screen Brightness:", COLOR_WHITE);
char b_str[8];
b_str[0] = '0' + (s_hub_brightness / 100);
b_str[1] = '0' + ((s_hub_brightness % 100) / 10);
b_str[2] = '0' + (s_hub_brightness % 10);
b_str[3] = '%'; b_str[4] = '\0';
font_draw_string(cx + 165, sly + 2, b_str, COLOR_AMBER);
uint32_t b_track_x = cx + 215;
uint32_t b_track_w = w - 255;
vbe_fill_rect(b_track_x, sly + 6, b_track_w, 8, 0xFF0D1726);
vbe_draw_rect(b_track_x, sly + 6, b_track_w, 8, COLOR_BORDER_CYAN);
uint32_t b_fill = (b_track_w * s_hub_brightness) / 100;
vbe_fill_rect(b_track_x, sly + 6, b_fill, 8, COLOR_AMBER);
vbe_fill_circle(b_track_x + b_fill, sly + 10, 6, COLOR_WHITE);
/* Power Actions */
sly += 32;
vbe_draw_line(cx + 20, sly - 6, cx + w - 20, sly - 6, COLOR_BORDER_CYAN);
/* Sleep */
vbe_fill_rect(cx + 20, sly, 140, 26, 0xFF0D2137);
vbe_draw_rect(cx + 20, sly, 140, 26, COLOR_BORDER_CYAN);
font_draw_string(cx + 35, sly + 5, "[ ACPI Sleep ]", COLOR_CYAN_GLOW);
/* Restart */
vbe_fill_rect(cx + 180, sly, 140, 26, 0xFF14243A);
vbe_draw_rect(cx + 180, sly, 140, 26, COLOR_BORDER_CYAN);
font_draw_string(cx + 195, sly + 5, "[ Restart PC ]", COLOR_WHITE);
/* Shut Down */
vbe_fill_rect(cx + 340, sly, 140, 26, 0xFF44001A);
vbe_draw_rect(cx + 340, sly, 140, 26, COLOR_CRIMSON);
font_draw_string(cx + 352, sly + 5, "[ Shut Down ]", COLOR_CRIMSON);
} else if (s_hub_tab == 3) {
/* Tab 3: Live EKG CPU Waveform */
font_draw_string_glow(cx + 15, cy + 12, "Real-Time Processor Heartbeat & EKG Waveform (60 FPS)", COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
/* Wave Box */
uint32_t gy = cy + 34;
uint32_t gh = ch - 50;
vbe_fill_rect(cx + 15, gy, w - 30, gh, 0xFF060B14);
vbe_draw_rect(cx + 15, gy, w - 30, gh, COLOR_BORDER_CYAN);
/* Grid */
for (uint32_t line_y = gy + 20; line_y < gy + gh; line_y += 20) {
vbe_draw_line(cx + 15, line_y, cx + w - 15, line_y, 0xFF0D1B2A);
}
uint64_t ticks = timer_get_ticks();
int prev_wy = (int)gy + (gh / 2);
for (uint32_t wx = 0; wx < w - 34; wx += 4) {
int wy = (int)(gy + (gh / 2) + ((ticks + wx) % 23) - ((wx / 6) % 15));
if (wy < (int)gy + 8) wy = (int)gy + 8;
if (wy > (int)(gy + gh - 8)) wy = (int)(gy + gh - 8);
vbe_draw_line(cx + 17 + wx, prev_wy, cx + 17 + wx + 4, wy, COLOR_CYAN_GLOW);
prev_wy = wy;
}
font_draw_string(cx + 25, gy + gh - 22, "16 Threads Running | 100 Hz Ticks | Sovereign AI Sentinel Online", COLOR_GREEN_OK);
}
}
void app_hub_click(window_t* win, int32_t mx, int32_t my) {
uint32_t x = win->x + 10;
uint32_t y = win->y + 35;
uint32_t w = win->w - 20;
uint32_t ty = y + 52;
uint32_t tab_w = (w - 18) / 4;
/* Check tab clicks */
if (my >= (int32_t)ty && my <= (int32_t)(ty + 28)) {
for (int t = 0; t < 4; t++) {
uint32_t tx = x + (t * (tab_w + 6));
if (mx >= (int32_t)tx && mx <= (int32_t)(tx + tab_w)) {
s_hub_tab = (uint32_t)t;
return;
}
}
}
uint32_t cx = x;
uint32_t cy = ty + 36;
/* Tab 1 clicks: Wallpapers */
if (s_hub_tab == 1) {
uint32_t wy = cy + 34;
for (int i = 0; i < 4; i++) {
if (mx >= (int32_t)(cx + 15) && mx <= (int32_t)(cx + w - 15) &&
my >= (int32_t)wy && my <= (int32_t)(wy + 42)) {
compositor_set_wallpaper((uint32_t)i);
return;
}
wy += 50;
}
}
/* Tab 2 clicks: Control Panel */
if (s_hub_tab == 2) {
/* Toggles */
for (int i = 0; i < 5; i++) {
uint32_t col = i % 2;
uint32_t row = i / 2;
uint32_t sx = cx + 20 + (col * 360);
uint32_t sy = cy + 40 + (row * 38);
if (mx >= (int32_t)sx && mx <= (int32_t)(sx + 340) &&
my >= (int32_t)sy && my <= (int32_t)(sy + 32)) {
if (i == 0) s_hub_wifi = !s_hub_wifi;
else if (i == 1) s_hub_bt = !s_hub_bt;
else if (i == 2) s_hub_airplane = !s_hub_airplane;
else if (i == 3) s_hub_night = !s_hub_night;
else if (i == 4) s_hub_saver = !s_hub_saver;
return;
}
}
/* Volume */
uint32_t v_track_x = cx + 180;
uint32_t v_track_w = w - 220;
uint32_t sly = cy + 165;
if (mx >= (int32_t)v_track_x && mx <= (int32_t)(v_track_x + v_track_w) &&
my >= (int32_t)sly && my <= (int32_t)(sly + 20)) {
s_hub_volume = ((mx - v_track_x) * 100) / v_track_w;
if (s_hub_volume > 100) s_hub_volume = 100;
return;
}
/* Brightness */
sly += 30;
uint32_t b_track_x = cx + 215;
uint32_t b_track_w = w - 255;
if (mx >= (int32_t)b_track_x && mx <= (int32_t)(b_track_x + b_track_w) &&
my >= (int32_t)sly && my <= (int32_t)(sly + 20)) {
s_hub_brightness = ((mx - b_track_x) * 100) / b_track_w;
if (s_hub_brightness > 100) s_hub_brightness = 100;
return;
}
/* Power buttons */
sly += 32;
if (my >= (int32_t)sly && my <= (int32_t)(sly + 26)) {
if (mx >= (int32_t)(cx + 20) && mx <= (int32_t)(cx + 160)) {
acpi_enter_s0ix_standby();
} else if (mx >= (int32_t)(cx + 180) && mx <= (int32_t)(cx + 320)) {
acpi_reboot();
} else if (mx >= (int32_t)(cx + 340) && mx <= (int32_t)(cx + 480)) {
acpi_poweroff();
}
return;
}
}
}
/* ---------------- Other Phase 7 Apps ---------------- */
void app_taskmgr_draw(window_t* win) {
uint32_t x = win->x + 10;
uint32_t y = win->y + 35;
uint32_t w = win->w - 20;
/* Top Stats Bar */
font_draw_string_glow(x, y, "CPU: 1.8% @ 100 Hz Ticks (Preemptive RR - 16 Threads)", COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
y += 20;
/* Live CPU Wave Graph Box */
vbe_fill_rect(x, y, w, 60, 0xFF080D18);
vbe_draw_rect(x, y, w, 60, COLOR_BORDER_CYAN);
/* Grid lines */
for (uint32_t gy = y + 15; gy < y + 60; gy += 15) {
vbe_draw_line(x, gy, x + w, gy, 0xFF142035);
}
/* Pulsating wave line */
uint64_t ticks = timer_get_ticks();
int prev_wy = (int)y + 40;
for (uint32_t wx = 0; wx < w - 2; wx += 4) {
@@ -46,7 +375,6 @@ void app_taskmgr_draw(window_t* win) {
}
y += 70;
/* Memory Gauge */
font_draw_string(x, y, "Physical RAM: 142 MB / 16384 MB Managed (DDR5 4800MHz)", COLOR_WHITE);
y += 18;
vbe_fill_rect(x, y, w, 12, 0xFF080D18);
@@ -54,13 +382,11 @@ void app_taskmgr_draw(window_t* win) {
vbe_fill_rect(x + 1, y + 1, (w * 14) / 100, 10, COLOR_CYAN_GLOW);
y += 22;
/* Process Table Header */
vbe_fill_rect(x, y, w, 20, 0xFF0F1829);
vbe_draw_rect(x, y, w, 20, COLOR_BORDER_CYAN);
font_draw_string(x + 5, y + 2, "PROCESS NAME PID STATUS CPU % MEMORY", COLOR_CYAN_GLOW);
y += 24;
/* Active Task Rows */
const char* procs[] = {
"kernel_main.elf 0 Running 0.2% 1,240 KB",
"aira_sentinel 1 Sleeping 0.1% 512 KB",
@@ -75,7 +401,6 @@ void app_taskmgr_draw(window_t* win) {
y += 19;
}
/* Bottom Action: End Task Button */
uint32_t btn_x = win->x + win->w - 110;
uint32_t btn_y = win->y + win->h - 32;
vbe_fill_rect(btn_x, btn_y, 95, 22, COLOR_CRIMSON);
@@ -85,13 +410,11 @@ void app_taskmgr_draw(window_t* win) {
font_draw_string(x, btn_y + 3, "Threads: 16 | Handles: 124 | Uptime: Sovereign Mode", COLOR_LIGHT_GREY);
}
/* 2. Aira Search & Web Navigator Window */
void app_search_draw(window_t* win) {
uint32_t x = win->x + 10;
uint32_t y = win->y + 35;
uint32_t w = win->w - 20;
/* Browser Tabs */
vbe_fill_rect(x, y, 130, 20, 0xFF142035);
vbe_draw_rect(x, y, 130, 20, COLOR_BORDER_CYAN);
font_draw_string(x + 10, y + 2, "Aira Search", COLOR_CYAN_GLOW);
@@ -101,20 +424,17 @@ void app_search_draw(window_t* win) {
font_draw_string(x + 145, y + 2, "torvalds/linux", COLOR_LIGHT_GREY);
y += 25;
/* URL / Address Bar */
vbe_fill_rect(x, y, w, 24, 0xFF0B101D);
vbe_draw_rect(x, y, w, 24, COLOR_BORDER_CYAN);
font_draw_string(x + 10, y + 4, "aira://search.sovereign?q=phase+7+gui", COLOR_WHITE);
y += 35;
/* Center Branding */
uint32_t center_x = win->x + (win->w / 2);
font_draw_string_glow(center_x - 110, y, "A I R A S E A R C H", COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
y += 20;
font_draw_string(center_x - 165, y, "Sovereign Neural Knowledge Engine | Zero Ads * Zero Tracking", COLOR_LIGHT_GREY);
y += 25;
/* Search Input Pill */
uint32_t sb_w = w - 40;
uint32_t sb_x = x + 20;
vbe_fill_rect(sb_x, y, sb_w, 32, 0xFF0F1829);
@@ -122,7 +442,6 @@ void app_search_draw(window_t* win) {
font_draw_string(sb_x + 15, y + 8, "Search sovereign web, CVEs, GitHub repos, or ask Aira AI...", COLOR_WHITE);
y += 42;
/* Filter Chips */
const char* chips[] = {"[ All ]", "[ Code & Repos ]", "[ Cyber CVE ]", "[ Science Papers ]", "[ AiraLang ]"};
uint32_t chip_x = sb_x;
for (int c = 0; c < 5; c++) {
@@ -133,7 +452,6 @@ void app_search_draw(window_t* win) {
}
y += 30;
/* Direct AI Answer Box */
vbe_fill_rect(x + 20, y, w - 40, 60, 0xFF0B1424);
vbe_draw_rect(x + 20, y, w - 40, 60, COLOR_BORDER_CYAN);
font_draw_string(x + 30, y + 6, "[Aira 3 Ultra Instant Answer]", COLOR_CYAN_GLOW);
@@ -141,7 +459,6 @@ void app_search_draw(window_t* win) {
font_draw_string(x + 30, y + 40, "Protected by Sovereign Privacy Shroud | Zero Telemetry.", COLOR_GREEN_OK);
}
/* 3. Translucent Sovereign Terminal Window */
void app_term_draw(window_t* win) {
uint32_t x = win->x + 12;
uint32_t y = win->y + 35;
@@ -156,21 +473,19 @@ void app_term_draw(window_t* win) {
y += 16;
font_draw_string(x, y, "[OK] Compositor: Acrylic Blur & 60 FPS VSync active", COLOR_GREEN_OK);
y += 16;
font_draw_string(x, y, "[OK] PS/2 Touchpad & Mouse Driver bound (IRQ 12 + Polling)", COLOR_GREEN_OK);
font_draw_string(x, y, "[OK] Hardware USB Root Hubs Powered (xHCI 5V VBUS Active)", COLOR_GREEN_OK);
y += 16;
font_draw_string(x, y, "[OK] Dual-Input Keyboard Cursor Navigation co-pilot online", COLOR_GREEN_OK);
font_draw_string(x, y, "[OK] Dual-Input Mouse & Keyboard Navigation Co-Pilot online", COLOR_GREEN_OK);
y += 20;
font_draw_string(x, y, "root@airlys-os:~# _", COLOR_WHITE);
}
/* 4. Sovereign File Explorer Window */
void app_files_draw(window_t* win) {
uint32_t x = win->x + 10;
uint32_t y = win->y + 35;
uint32_t h = win->h - 45;
/* Left Sidebar: Quick Access */
uint32_t sb_w = 140;
vbe_fill_rect(x, y, sb_w, h, 0xFF0B101D);
vbe_draw_rect(x, y, sb_w, h, COLOR_BORDER_CYAN);
@@ -181,7 +496,6 @@ void app_files_draw(window_t* win) {
font_draw_string(x + 10, y + 75, "> /usr/bin", COLOR_LIGHT_GREY);
font_draw_string(x + 10, y + 95, "> ram0 (Disk)", COLOR_LIGHT_GREY);
/* Main File Grid */
uint32_t grid_x = x + sb_w + 10;
uint32_t grid_w = win->w - sb_w - 25;
vbe_fill_rect(grid_x, y, grid_w, h, 0xFF080D18);
@@ -190,23 +504,20 @@ void app_files_draw(window_t* win) {
font_draw_string(grid_x + 10, y + 8, "Location: /wallpapers", COLOR_CYAN_GLOW);
vbe_draw_line(grid_x, y + 24, grid_x + grid_w, y + 24, COLOR_BORDER_CYAN);
/* Wallpaper Files with direct "Set as Wallpaper" Action */
const char* wall_names[] = {
"sovereign_logo.png (Default Airlys Logo)",
"cyber_aurora.png (Cyan Aurora Theme)",
"midnight_dark.png (Pure Matte Stealth)",
"emerald_matrix.png (Cyber Matrix Theme)"
"sovereign_cyber_nebula.png (Default Edge-to-Edge)",
"cyber_aurora_waves.png (Cyan-Purple Aurora)",
"midnight_dark_stealth.png (Pure Matte Stealth)",
"emerald_matrix_grid.png (Cyber Emerald Matrix)"
};
uint32_t item_y = y + 32;
for (int i = 0; i < 4; i++) {
vbe_fill_rect(grid_x + 8, item_y, grid_w - 16, 28, (i % 2 == 0) ? 0xFF0E1626 : 0xFF0A101C);
/* Icon & Name */
font_draw_string(grid_x + 14, item_y + 6, "[IMG]", COLOR_CYAN_GLOW);
font_draw_string(grid_x + 60, item_y + 6, wall_names[i], COLOR_WHITE);
/* Set Wallpaper Button */
uint32_t btn_w = 120;
uint32_t btn_x = grid_x + grid_w - btn_w - 14;
bool is_current = (compositor_get_wallpaper() == (uint32_t)i);
@@ -217,17 +528,6 @@ void app_files_draw(window_t* win) {
item_y += 34;
}
/* Regular Files */
const char* other_files[] = {
"[DOC] sovereign_covenant.txt (4 KB)",
"[ELF] kernel_main.elf (814 KB)"
};
for (int i = 0; i < 2; i++) {
vbe_fill_rect(grid_x + 8, item_y, grid_w - 16, 24, 0xFF0A101C);
font_draw_string(grid_x + 14, item_y + 4, other_files[i], COLOR_LIGHT_GREY);
item_y += 28;
}
}
void app_files_click(window_t* win, int32_t mx, int32_t my) {
@@ -250,151 +550,15 @@ void app_files_click(window_t* win, int32_t mx, int32_t my) {
}
}
/* 5. Airlys Settings App Window (LVGL Tabview & System Controls) */
void app_settings_draw(window_t* win) {
uint32_t x = win->x + 10;
uint32_t y = win->y + 35;
uint32_t h = win->h - 45;
/* Left Sidebar: LVGL Tabview Navigation */
uint32_t tb_w = 150;
vbe_fill_rect(x, y, tb_w, h, 0xFF0B101D);
vbe_draw_rect(x, y, tb_w, h, COLOR_BORDER_CYAN);
font_draw_string_glow(x + 15, y + 10, "Settings", COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
vbe_draw_line(x, y + 28, x + tb_w, y + 28, COLOR_BORDER_CYAN);
const char* tabs[] = {
"[i] System",
"[*] Personalize",
"[~] Network",
"[#] Power & Bat"
};
uint32_t tab_y = y + 36;
for (int t = 0; t < 4; t++) {
bool active = (s_settings_tab == (uint32_t)t);
if (active) {
vbe_fill_rect(x + 4, tab_y, tb_w - 8, 28, 0xFF14243A);
vbe_draw_glow_rect(x + 4, tab_y, tb_w - 8, 28, COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
vbe_fill_rect(x + 4, tab_y, 4, 28, COLOR_CYAN_GLOW); /* Active pill indicator */
}
font_draw_string(x + 16, tab_y + 7, tabs[t], active ? COLOR_CYAN_GLOW : COLOR_LIGHT_GREY);
tab_y += 34;
}
/* Main Settings Panel */
uint32_t main_x = x + tb_w + 10;
uint32_t main_w = win->w - tb_w - 25;
vbe_fill_rect(main_x, y, main_w, h, 0xFF080D18);
vbe_draw_rect(main_x, y, main_w, h, COLOR_BORDER_CYAN);
uint32_t cy = y + 15;
if (s_settings_tab == 0) {
/* Tab 0: System Information */
font_draw_string_glow(main_x + 15, cy, "System Specifications", COLOR_WHITE, COLOR_CYAN_DARK);
cy += 24;
vbe_fill_rect(main_x + 15, cy, main_w - 30, 2, COLOR_BORDER_CYAN);
cy += 12;
font_draw_string(main_x + 15, cy, "OS Name : Airlys Sovereign OS (v0.8.6 Sovereign Release)", COLOR_CYAN_GLOW); cy += 20;
font_draw_string(main_x + 15, cy, "Lead Architect : Er. Adam Eehan (Founder & CEO, Aira Group)", COLOR_WHITE); cy += 20;
font_draw_string(main_x + 15, cy, "AI Co-Pilot : Sovereign AI Aira 3 Ultra (Engine v3.6)", COLOR_GREEN_OK); cy += 20;
font_draw_string(main_x + 15, cy, "Processor : AMD Ryzen 7 7735HS Zen 3+ (8 Cores / 16 Threads @ 4.75 GHz)", COLOR_WHITE); cy += 20;
font_draw_string(main_x + 15, cy, "Installed RAM : 16.0 GB DDR5 4800MHz Dual-Channel", COLOR_WHITE); cy += 20;
font_draw_string(main_x + 15, cy, "Graphics : AMD Radeon 680M / 780M + NVIDIA GeForce RTX", COLOR_WHITE); cy += 20;
font_draw_string(main_x + 15, cy, "Display Mode : 1920x1080 FHD 144Hz IPS TrueColor 32bpp (Tag 8 GOP)", COLOR_CYAN_GLOW); cy += 20;
font_draw_string(main_x + 15, cy, "Kernel Mode : x86_64 Long Mode with 512GB Identity Paging", COLOR_LIGHT_GREY); cy += 20;
} else if (s_settings_tab == 1) {
/* Tab 1: Personalization & Wallpaper Picker */
font_draw_string_glow(main_x + 15, cy, "Personalization & Wallpaper Themes", COLOR_WHITE, COLOR_CYAN_DARK);
cy += 20;
font_draw_string(main_x + 15, cy, "Select active desktop wallpaper theme below:", COLOR_LIGHT_GREY);
cy += 26;
const char* themes[] = {
"1. Sovereign Logo Obsidian (Default Airlys Authentic Logo)",
"2. Cyber Aurora Cyan (Vibrant Cyan-Purple Vector Aurora)",
"3. Deep Midnight Stealth (Pure Matte Stealth Dark)",
"4. Cyber Emerald Matrix (Green Cyber Matrix Grid)"
};
for (int i = 0; i < 4; i++) {
bool active = (compositor_get_wallpaper() == (uint32_t)i);
vbe_fill_rect(main_x + 15, cy, main_w - 30, 36, active ? 0xFF14243A : 0xFF0E1626);
vbe_draw_glow_rect(main_x + 15, cy, main_w - 30, 36,
active ? COLOR_CYAN_GLOW : COLOR_BORDER_CYAN, COLOR_CYAN_DARK);
font_draw_string(main_x + 25, cy + 10, themes[i], active ? COLOR_CYAN_GLOW : COLOR_WHITE);
font_draw_string(main_x + main_w - 90, cy + 10, active ? "[ Active ]" : "[ Apply ]",
active ? COLOR_GREEN_OK : COLOR_LIGHT_GREY);
cy += 44;
}
} else if (s_settings_tab == 2) {
/* Tab 2: Network & Wireless */
font_draw_string_glow(main_x + 15, cy, "Network & Wireless Connections", COLOR_WHITE, COLOR_CYAN_DARK);
cy += 24;
font_draw_string(main_x + 15, cy, "Wi-Fi Adapter : AMD Wi-Fi 6E RZ616 (160MHz) / MT7922", COLOR_WHITE); cy += 20;
font_draw_string(main_x + 15, cy, "Status : Connected (WPA3-SAE Enterprise Secure)", COLOR_GREEN_OK); cy += 20;
font_draw_string(main_x + 15, cy, "SSID : Airlys-Mesh-5G", COLOR_CYAN_GLOW); cy += 20;
font_draw_string(main_x + 15, cy, "IPv4 Address : 192.168.1.137 / 24", COLOR_WHITE); cy += 20;
font_draw_string(main_x + 15, cy, "Default Gateway: 192.168.1.1", COLOR_WHITE); cy += 20;
font_draw_string(main_x + 15, cy, "DNS Over HTTPS : 1.1.1.1 (Cloudflare Sovereign Zero-Log)", COLOR_LIGHT_GREY); cy += 20;
font_draw_string(main_x + 15, cy, "MAC Address : 00:E0:4C:68:01:AF", COLOR_LIGHT_GREY); cy += 20;
} else if (s_settings_tab == 3) {
/* Tab 3: Power & Battery Management */
font_draw_string_glow(main_x + 15, cy, "Power, Battery & Thermal Engine", COLOR_WHITE, COLOR_CYAN_DARK);
cy += 24;
font_draw_string(main_x + 15, cy, "Power Source : AC Connected (135W Slim-Tip Fast Charging)", COLOR_GREEN_OK); cy += 20;
font_draw_string(main_x + 15, cy, "Battery Level : 98% (54 Wh Lithium-Ion, Healthy)", COLOR_CYAN_GLOW); cy += 20;
font_draw_string(main_x + 15, cy, "Sleep Engine : ACPI S0ix Modern Standby (2W Idle Consumption)", COLOR_WHITE); cy += 20;
font_draw_string(main_x + 15, cy, "Power Mode : [ Performance ] [ Balanced ] [ Power Saver ]", COLOR_WHITE); cy += 20;
font_draw_string(main_x + 15, cy, "Fan Profile : Nitro Dual-Fan Auto Acoustic Shroud (Cool)", COLOR_LIGHT_GREY); cy += 20;
}
/* Redirect to Hub for cohesive unified experience */
app_hub_draw(win);
}
void app_settings_click(window_t* win, int32_t mx, int32_t my) {
uint32_t x = win->x + 10;
uint32_t y = win->y + 35;
uint32_t tb_w = 150;
/* Check tab clicks */
if (mx >= (int32_t)x && mx <= (int32_t)(x + tb_w)) {
uint32_t tab_y = y + 36;
for (int t = 0; t < 4; t++) {
if (my >= (int32_t)tab_y && my <= (int32_t)(tab_y + 28)) {
s_settings_tab = (uint32_t)t;
return;
}
tab_y += 34;
}
}
/* Check wallpaper card clicks in Tab 1 */
if (s_settings_tab == 1) {
uint32_t main_x = x + tb_w + 10;
uint32_t main_w = win->w - tb_w - 25;
uint32_t cy = y + 15 + 20 + 26;
for (int i = 0; i < 4; i++) {
if (mx >= (int32_t)(main_x + 15) && mx <= (int32_t)(main_x + main_w - 15) &&
my >= (int32_t)cy && my <= (int32_t)(cy + 36)) {
compositor_set_wallpaper((uint32_t)i);
return;
}
cy += 44;
}
}
app_hub_click(win, mx, my);
}
/* 6. Aira Code Editor Window */
void app_code_draw(window_t* win) {
uint32_t x = win->x + 12;
uint32_t y = win->y + 35;
@@ -408,7 +572,7 @@ void app_code_draw(window_t* win) {
"3 #include <airlys/compositor.h>",
"4 ",
"5 void kernel_main(uint64_t magic, uint64_t addr) {",
"6 serial_init();",
"6 pci_init(); /* Power on USB xHCI Ports */",
"7 vbe_init(1920, 1080);",
"8 mouse_init();",
"9 printk(\"[OK] Airlys Sovereign GUI 60 FPS Online\\n\");",
@@ -422,22 +586,18 @@ void app_code_draw(window_t* win) {
}
}
/* 7. Sovereign Full-Screen Lock Screen & Greeter */
void app_lockscreen_draw(void) {
vbe_screen_t* scr = vbe_get_screen();
if (!scr) return;
/* Background Obsidian Wash */
vbe_fill_rect(0, 0, scr->width, scr->height, COLOR_OBSIDIAN);
/* Clock & Date (Upper Left) */
rtc_time_t t = rtc_get_time();
char time_str[32];
kstrcpy(time_str, "15:10 UTC | Friday, Oct 24");
kstrcpy(time_str, "22:12 UTC | Friday, Oct 24");
if (t.hour < 10) time_str[0] = '0';
font_draw_string_glow(40, 40, time_str, COLOR_WHITE, COLOR_CYAN_DARK);
/* Floating Center Login Card */
uint32_t cx = scr->width / 2;
uint32_t cy = scr->height / 2;
uint32_t card_w = 340;
@@ -448,29 +608,26 @@ void app_lockscreen_draw(void) {
vbe_fill_rect(card_x, card_y, card_w, card_h, 0xEE0B1220);
vbe_draw_glow_rect(card_x, card_y, card_w, card_h, COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
/* Avatar Ring */
vbe_draw_circle(cx, card_y + 45, 26, COLOR_CYAN_GLOW);
vbe_fill_circle(cx, card_y + 45, 24, 0xFF003344);
font_draw_char(cx - 4, card_y + 37, 'A', COLOR_CYAN_GLOW);
/* User Profile */
font_draw_string_glow(cx - 55, card_y + 80, "Er. Adam Eehan", COLOR_WHITE, COLOR_CYAN_DARK);
font_draw_string(cx - 115, card_y + 100, "Founder & CEO, Aira Group | Root", COLOR_CYAN_GLOW);
/* PIN Password Box */
uint32_t pin_x = card_x + 40;
uint32_t pin_y = card_y + 130;
vbe_fill_rect(pin_x, pin_y, 260, 28, 0xFF070B14);
vbe_draw_rect(pin_x, pin_y, 260, 28, COLOR_BORDER_CYAN);
font_draw_string(pin_x + 15, pin_y + 6, "* * * * * * * *", COLOR_CYAN_GLOW);
font_draw_char(pin_x + 235, pin_y + 6, '>', COLOR_CYAN_GLOW);
/* Alternate Options */
font_draw_string(cx - 85, card_y + 175, "[ PIN ] [ Fingerprint ]", COLOR_LIGHT_GREY);
font_draw_string(cx - 75, card_y + 195, "Sign in with Aira ID", COLOR_CYAN_GLOW);
}
/* App Launchers */
window_t* app_launch_hub(void) {
vbe_screen_t* scr = vbe_get_screen();
uint32_t sw = scr ? scr->width : 1920;
uint32_t sh = scr ? scr->height : 1080;
uint32_t w = 820;
uint32_t h = 500;
uint32_t x = (sw > w) ? ((sw - w) / 2) : 20;
uint32_t y = (sh > h) ? ((sh - h) / 2 - 25) : 20;
return compositor_create_window("Airlys Sovereign Hub", x, y, w, h, app_hub_draw);
}
window_t* app_launch_taskmgr(void) {
return compositor_create_window("Aira Task Manager", 80, 70, 620, 420, app_taskmgr_draw);
}
@@ -488,7 +645,7 @@ window_t* app_launch_files(void) {
}
window_t* app_launch_settings(void) {
return compositor_create_window("airlys-settings", 180, 110, 660, 420, app_settings_draw);
return app_launch_hub();
}
window_t* app_launch_code(void) {
+236 -236
View File
@@ -31,8 +31,8 @@ static bool g_qs_bt = true;
static bool g_qs_airplane = false;
static bool g_qs_night_light = false;
static bool g_qs_battery_saver = false;
static uint32_t g_qs_volume = 80; /* 0 - 100 */
static uint32_t g_qs_brightness = 100; /* 0 - 100 */
static uint32_t g_qs_volume = 80;
static uint32_t g_qs_brightness = 100;
/* Mouse interaction state */
static bool s_prev_left = false;
@@ -43,6 +43,7 @@ static int32_t s_drag_oy = 0;
/* ---------------- Forward Declarations ---------------- */
static void draw_window(window_t* win);
static void draw_desktop_icons(vbe_screen_t* scr);
static void draw_taskbar(vbe_screen_t* scr);
static void draw_start_menu(vbe_screen_t* scr);
static void draw_context_menu(vbe_screen_t* scr);
@@ -93,6 +94,9 @@ void compositor_init(void) {
vbe_init(1024, 768);
vbe_allocate_backbuffer();
apps_init();
/* Automatically launch Sovereign Hub on boot so desktop is rich and welcoming! */
app_launch_hub();
}
window_t* compositor_create_window(const char* title, uint32_t x, uint32_t y, uint32_t w, uint32_t h, window_draw_fn draw) {
@@ -164,19 +168,20 @@ bool compositor_is_lock_screen_open(void) {
return g_lock_screen_open;
}
/* ---------------- Dock Icon Vector Drawing ---------------- */
/* ---------------- Vector Graphics & Icons ---------------- */
static void draw_icon_start(uint32_t x, uint32_t y) {
vbe_fill_rect(x, y, 28, 28, 0xFF0B1424);
vbe_draw_glow_rect(x, y, 28, 28, COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
/* Sovereign Eagle / Falcon Vector Silhouette */
vbe_fill_circle(x + 14, y + 14, 8, 0xFF003344);
vbe_draw_line(x + 6, y + 11, x + 14, y + 6, COLOR_CYAN_GLOW);
vbe_draw_line(x + 14, y + 6, x + 22, y + 11, COLOR_CYAN_GLOW);
vbe_draw_line(x + 6, y + 11, x + 10, y + 18, COLOR_CYAN_GLOW);
vbe_draw_line(x + 22, y + 11, x + 18, y + 18, COLOR_CYAN_GLOW);
vbe_draw_line(x + 10, y + 18, x + 14, y + 23, COLOR_CYAN_GLOW);
vbe_draw_line(x + 18, y + 18, x + 14, y + 23, COLOR_CYAN_GLOW);
vbe_fill_rect(x, y, 32, 32, 0xFF0B1424);
vbe_draw_glow_rect(x, y, 32, 32, COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
/* Sovereign Eagle Crest */
vbe_fill_circle(x + 16, y + 16, 9, 0xFF003344);
vbe_draw_line(x + 7, y + 13, x + 16, y + 7, COLOR_CYAN_GLOW);
vbe_draw_line(x + 16, y + 7, x + 25, y + 13, COLOR_CYAN_GLOW);
vbe_draw_line(x + 7, y + 13, x + 12, y + 21, COLOR_CYAN_GLOW);
vbe_draw_line(x + 25, y + 13, x + 20, y + 21, COLOR_CYAN_GLOW);
vbe_draw_line(x + 12, y + 21, x + 16, y + 26, COLOR_CYAN_GLOW);
vbe_draw_line(x + 20, y + 21, x + 16, y + 26, COLOR_CYAN_GLOW);
}
static void draw_icon_terminal(uint32_t x, uint32_t y) {
@@ -245,19 +250,37 @@ static void draw_icon_settings(uint32_t x, uint32_t y) {
vbe_draw_line(x + 20, y + 14, x + 23, y + 14, COLOR_CYAN_GLOW);
}
/* ---------------- Desktop Wallpaper Engine ---------------- */
/* ---------------- Full-Frame Edge-to-Edge Desktop Wallpaper ---------------- */
static void draw_desktop_wallpaper(vbe_screen_t* scr) {
uint32_t w = scr->width;
uint32_t h = scr->height;
if (g_active_wallpaper == WALLPAPER_DEFAULT_LOGO) {
/* Theme 0: Authentic Sovereign Logo on Deep Obsidian */
vbe_fill_rect(0, 0, w, h, 0xFF060911);
/*
* Theme 0: Authentic Sovereign Cyber Nebula (Edge-to-Edge Full-Frame)
* Multi-stage gradient from deep space down to royal sapphire nebula & electric horizon
*/
for (uint32_t y = 0; y < h; y += 4) {
uint32_t color;
if (y < h / 3) {
color = 0xFF060B16; /* Deep obsidian space */
} else if (y < (2 * h) / 3) {
color = 0xFF0A182E; /* Royal sapphire nebula */
} else {
color = 0xFF050E1A; /* Ground horizon */
}
vbe_fill_rect(0, y, w, 4, color);
}
/* Subtle radiant aurora rays */
for (uint32_t x = 0; x < w; x += 32) {
vbe_draw_line(x, h / 2 + 100, x + 120, h / 2 - 120, 0x1200F2FE);
}
/* Center the exact Airlys Logo created by Er. Adam Eehan */
int32_t lx = ((int32_t)w - WALLPAPER_LOGO_W) / 2;
int32_t ly = ((int32_t)h - WALLPAPER_LOGO_H) / 2 - 35;
int32_t ly = ((int32_t)h - WALLPAPER_LOGO_H) / 2 - 20;
for (int y = 0; y < WALLPAPER_LOGO_H; y++) {
int py = ly + y;
@@ -273,19 +296,18 @@ static void draw_desktop_wallpaper(vbe_screen_t* scr) {
/* Sovereign Brand Title below logo */
uint32_t cx = w / 2;
uint32_t cy = (h / 2) - 35;
uint32_t cy = (h / 2) - 20;
const char* brand = "AIRLYS SOVEREIGN OPERATING SYSTEM";
const char* sub = "Engineered by Er. Adam Eehan & Sovereign AI Aira";
font_draw_string(cx - (kstrlen(brand) * 4), cy + 128, brand, COLOR_CYAN_GLOW);
font_draw_string(cx - (kstrlen(sub) * 4), cy + 148, sub, COLOR_LIGHT_GREY);
font_draw_string(cx - (kstrlen(brand) * 4), cy + 130, brand, COLOR_CYAN_GLOW);
font_draw_string(cx - (kstrlen(sub) * 4), cy + 150, sub, COLOR_LIGHT_GREY);
} else if (g_active_wallpaper == WALLPAPER_CYBER_AURORA) {
/* Theme 1: Vibrant Cyan-Purple Aurora Vector */
/* Theme 1: Electric Cyan Aurora */
for (uint32_t y = 0; y < h; y += 4) {
uint32_t col = (y < h / 2) ? 0xFF0B1426 : 0xFF050810;
vbe_fill_rect(0, y, w, 4, col);
}
/* Aurora wave bands */
for (uint32_t x = 0; x < w; x += 16) {
vbe_draw_line(x, h / 2, x + 80, (h / 2) - 100, 0x1A00F2FE);
vbe_draw_line(x, (h / 2) + 60, x + 60, (h / 2) - 40, 0x12A855F7);
@@ -296,7 +318,7 @@ static void draw_desktop_wallpaper(vbe_screen_t* scr) {
} else if (g_active_wallpaper == WALLPAPER_MINIMAL_DARK) {
/* Theme 2: Pure Matte Stealth Dark */
vbe_fill_rect(0, 0, w, h, 0xFF08090C);
vbe_draw_line((w / 2) - 150, h / 2, (w / 2) + 150, h / 2, COLOR_BORDER_CYAN);
vbe_draw_line((w / 2) - 180, h / 2, (w / 2) + 180, h / 2, COLOR_BORDER_CYAN);
const char* title = "A I R L Y S S O V E R E I G N";
font_draw_string((w / 2) - (kstrlen(title) * 4), (h / 2) - 20, title, COLOR_WHITE);
@@ -314,6 +336,44 @@ static void draw_desktop_wallpaper(vbe_screen_t* scr) {
}
}
/* ---------------- Desktop Quick Icons (LVGL Grid) ---------------- */
static void draw_desktop_icons(vbe_screen_t* scr) {
(void)scr;
const char* icon_titles[] = { "This PC", "Files", "Task Manager", "Aira Search", "Settings" };
uint32_t iy = 30;
for (int i = 0; i < 5; i++) {
uint32_t ix = 25;
/* Frosted Tile */
vbe_fill_rect(ix, iy, 56, 56, 0xBB0D1B2A);
vbe_draw_rect(ix, iy, 56, 56, COLOR_BORDER_CYAN);
/* Icon Graphic */
if (i == 0) {
/* This PC (Computer Monitor) */
vbe_draw_rect(ix + 12, iy + 10, 32, 22, COLOR_CYAN_GLOW);
vbe_fill_rect(ix + 14, iy + 12, 28, 18, 0xFF0A1828);
vbe_draw_line(ix + 28, iy + 32, ix + 28, iy + 38, COLOR_CYAN_GLOW);
vbe_draw_line(ix + 20, iy + 38, ix + 36, iy + 38, COLOR_CYAN_GLOW);
} else if (i == 1) {
draw_icon_files(ix + 12, iy + 14);
} else if (i == 2) {
draw_icon_taskmgr(ix + 12, iy + 14);
} else if (i == 3) {
draw_icon_search(ix + 12, iy + 14);
} else if (i == 4) {
draw_icon_settings(ix + 12, iy + 14);
}
/* Label Underneath */
font_draw_string(ix - 8, iy + 60, icon_titles[i], COLOR_WHITE);
iy += 84;
}
}
/* ---------------- Window Drawing ---------------- */
static void draw_window(window_t* win) {
@@ -324,23 +384,23 @@ static void draw_window(window_t* win) {
/* Window Titlebar */
uint32_t tb_color = (win->id == g_active_window_id) ? COLOR_TITLEBAR_BG : 0xEE090E18;
vbe_fill_rect(win->x, win->y, win->w, 26, tb_color);
vbe_draw_line(win->x, win->y + 26, win->x + win->w, win->y + 26, COLOR_BORDER_CYAN);
vbe_fill_rect(win->x, win->y, win->w, 28, tb_color);
vbe_draw_line(win->x, win->y + 28, win->x + win->w, win->y + 28, COLOR_BORDER_CYAN);
/* Title string */
font_draw_string(win->x + 10, win->y + 5, win->title,
font_draw_string(win->x + 12, win->y + 6, win->title,
(win->id == g_active_window_id) ? COLOR_CYAN_GLOW : COLOR_LIGHT_GREY);
/* Control Buttons (— [ ] ✕) */
uint32_t btn_x = win->x + win->w - 60;
font_draw_string(btn_x, win->y + 5, "-", COLOR_LIGHT_GREY);
font_draw_string(btn_x + 18, win->y + 5, "[ ]", COLOR_LIGHT_GREY);
uint32_t btn_x = win->x + win->w - 65;
font_draw_string(btn_x, win->y + 6, "-", COLOR_LIGHT_GREY);
font_draw_string(btn_x + 20, win->y + 6, "[ ]", COLOR_LIGHT_GREY);
/* Close button */
vbe_fill_rect(btn_x + 38, win->y + 3, 18, 20, 0x33FF3366);
font_draw_string(btn_x + 43, win->y + 5, "x", COLOR_CRIMSON);
vbe_fill_rect(btn_x + 42, win->y + 4, 18, 20, 0x33FF3366);
font_draw_string(btn_x + 47, win->y + 6, "x", COLOR_CRIMSON);
/* Window Content */
/* Window Content Area */
if (win->draw_content) {
win->draw_content(win);
}
@@ -350,28 +410,36 @@ static void draw_window(window_t* win) {
vbe_draw_glow_rect(win->x, win->y, win->w, win->h, border_color, COLOR_CYAN_DARK);
}
/* ---------------- Centered Floating Taskbar Dock ---------------- */
/* ---------------- Full-Width Windows 11 Taskbar Dock ---------------- */
static void draw_taskbar(vbe_screen_t* scr) {
uint32_t bar_h = 44;
uint32_t bar_y = scr->height - bar_h - 10;
uint32_t dock_w = 480;
uint32_t dock_x = (scr->width / 2) - (dock_w / 2);
uint32_t bar_h = 48;
uint32_t bar_y = scr->height - bar_h;
uint32_t bar_w = scr->width;
/* Centered Floating Dock */
vbe_fill_rect(dock_x, bar_y, dock_w, bar_h, COLOR_TASKBAR_BG);
vbe_draw_glow_rect(dock_x, bar_y, dock_w, bar_h, COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
/* Full-Width Translucent Acrylic Taskbar */
vbe_fill_rect(0, bar_y, bar_w, bar_h, COLOR_TASKBAR_BG);
vbe_draw_line(0, bar_y, bar_w, bar_y, COLOR_BORDER_CYAN); /* Top 1px highlight */
/* Start Button */
uint32_t sx = dock_x + 12;
/* Left: Start Button */
uint32_t sx = 14;
uint32_t sy = bar_y + 8;
draw_icon_start(sx, sy);
/* Pinned App Icons */
uint32_t app_x = sx + 44;
/* Left: Taskbar Search Box */
uint32_t sb_x = sx + 42;
uint32_t sb_w = 210;
vbe_fill_rect(sb_x, bar_y + 8, sb_w, 32, 0xFF080D18);
vbe_draw_rect(sb_x, bar_y + 8, sb_w, 32, COLOR_BORDER_CYAN);
font_draw_string(sb_x + 12, bar_y + 17, "Type to search...", COLOR_LIGHT_GREY);
/* Center: Pinned & Running App Icons */
uint32_t app_center_w = 7 * 54;
uint32_t app_x = (bar_w / 2) - (app_center_w / 2);
for (int i = 0; i < 7; i++) {
uint32_t tx = app_x + (i * 54);
uint32_t ty = bar_y + 8;
uint32_t ty = bar_y + 10;
if (i == 0) draw_icon_terminal(tx, ty);
else if (i == 1) draw_icon_files(tx, ty);
@@ -381,7 +449,7 @@ static void draw_taskbar(vbe_screen_t* scr) {
else if (i == 5) draw_icon_search(tx, ty);
else if (i == 6) draw_icon_settings(tx, ty);
/* Indicator pill if app is open */
/* Running Indicator Bar */
bool is_open = false;
bool is_active = false;
for (int w = 0; w < MAX_WINDOWS; w++) {
@@ -391,7 +459,7 @@ static void draw_taskbar(vbe_screen_t* scr) {
(i == 2 && kstrcmp(g_windows[w].title, "aira-code") == 0) ||
(i == 4 && kstrcmp(g_windows[w].title, "Aira Task Manager") == 0) ||
(i == 5 && kstrncmp(g_windows[w].title, "Airlys", 6) == 0) ||
(i == 6 && kstrcmp(g_windows[w].title, "airlys-settings") == 0)) {
(i == 6 && kstrncmp(g_windows[w].title, "Airlys Sovereign Hub", 20) == 0)) {
is_open = true;
if (g_windows[w].id == g_active_window_id && !g_windows[w].minimized) {
is_active = true;
@@ -401,16 +469,17 @@ static void draw_taskbar(vbe_screen_t* scr) {
}
if (is_active) {
vbe_fill_rect(tx + 10, ty + 28, 12, 2, COLOR_CYAN_GLOW);
vbe_fill_rect(tx + 8, ty + 28, 16, 2, COLOR_CYAN_GLOW);
} else if (is_open) {
vbe_fill_rect(tx + 12, ty + 28, 8, 2, COLOR_LIGHT_GREY);
}
}
/* Right System Tray (Clock, Network, Battery, Volume) */
uint32_t tray_x = scr->width - 200;
vbe_fill_rect(tray_x, bar_y, 190, bar_h, COLOR_TASKBAR_BG);
vbe_draw_glow_rect(tray_x, bar_y, 190, bar_h, COLOR_BORDER_CYAN, COLOR_CYAN_DARK);
/* Right: System Tray */
uint32_t tray_w = 260;
uint32_t tray_x = bar_w - tray_w - 10;
vbe_fill_rect(tray_x, bar_y + 6, tray_w, 36, 0xEE0B1424);
vbe_draw_rect(tray_x, bar_y + 6, tray_w, 36, COLOR_BORDER_CYAN);
rtc_time_t t = rtc_get_time();
char clk_buf[16];
@@ -421,8 +490,8 @@ static void draw_taskbar(vbe_screen_t* scr) {
clk_buf[4] = '0' + (t.minute % 10);
clk_buf[5] = '\0';
font_draw_string(tray_x + 10, bar_y + 14, clk_buf, COLOR_CYAN_GLOW);
font_draw_string(tray_x + 58, bar_y + 14, "[WiFi] [98% ⚡]", COLOR_WHITE);
font_draw_string(tray_x + 12, bar_y + 17, clk_buf, COLOR_CYAN_GLOW);
font_draw_string(tray_x + 65, bar_y + 17, "[WiFi 5G] [98% ⚡] [Vol]", COLOR_WHITE);
}
/* ---------------- Start Menu ---------------- */
@@ -430,81 +499,76 @@ static void draw_taskbar(vbe_screen_t* scr) {
static void draw_start_menu(vbe_screen_t* scr) {
if (!g_start_menu_open) return;
uint32_t sm_w = 440;
uint32_t sm_h = 420;
uint32_t sm_x = (scr->width / 2) - (sm_w / 2);
uint32_t sm_y = scr->height - 60 - sm_h;
uint32_t sm_w = 460;
uint32_t sm_h = 440;
uint32_t sm_x = 20;
uint32_t sm_y = scr->height - 58 - sm_h;
/* Frosted Acrylic Card */
vbe_fill_rect(sm_x, sm_y, sm_w, sm_h, 0xFA0B111E);
vbe_draw_glow_rect(sm_x, sm_y, sm_w, sm_h, COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
/* Search Bar */
uint32_t sb_x = sm_x + 20;
uint32_t sb_y = sm_y + 18;
vbe_fill_rect(sb_x, sb_y, sm_w - 40, 30, 0xFF070B14);
vbe_draw_rect(sb_x, sb_y, sm_w - 40, 30, COLOR_BORDER_CYAN);
font_draw_string(sb_x + 12, sb_y + 7, "Search apps, files, or ask Aira AI...", COLOR_LIGHT_GREY);
vbe_fill_rect(sb_x, sb_y, sm_w - 40, 32, 0xFF070B14);
vbe_draw_rect(sb_x, sb_y, sm_w - 40, 32, COLOR_BORDER_CYAN);
font_draw_string(sb_x + 12, sb_y + 8, "Search apps, files, or ask Aira AI...", COLOR_LIGHT_GREY);
/* Pinned Apps Header */
uint32_t py = sm_y + 60;
font_draw_string(sm_x + 20, py, "Pinned Sovereign Applications", COLOR_CYAN_GLOW);
py += 22;
/* Pinned Apps */
uint32_t py = sm_y + 65;
font_draw_string(sm_x + 20, py, "Pinned Applications", COLOR_CYAN_GLOW);
py += 24;
const char* pinned[] = {
"airlys-term", "airlys-files", "aira-code", "airastore",
"aira-taskmgr", "airlys-settings", "aira-search", "aira-calc"
"Sovereign Hub", "File Explorer", "Aira Code", "AiraStore",
"Task Manager", "Terminal", "Aira Search", "Settings"
};
for (int r = 0; r < 2; r++) {
for (int c = 0; c < 4; c++) {
uint32_t ax = sm_x + 20 + (c * 100);
uint32_t ay = py + (r * 70);
vbe_fill_rect(ax, ay, 90, 56, 0xFF0B1424);
vbe_draw_rect(ax, ay, 90, 56, COLOR_BORDER_CYAN);
uint32_t ax = sm_x + 20 + (c * 105);
uint32_t ay = py + (r * 72);
vbe_fill_rect(ax, ay, 96, 60, 0xFF0B1424);
vbe_draw_rect(ax, ay, 96, 60, COLOR_BORDER_CYAN);
int idx = r * 4 + c;
font_draw_string(ax + 10, ay + 12, "[App]", COLOR_CYAN_GLOW);
font_draw_string(ax + 8, ay + 32, pinned[idx], COLOR_WHITE);
font_draw_string(ax + 12, ay + 14, "[App]", COLOR_CYAN_GLOW);
font_draw_string(ax + 8, ay + 36, pinned[idx], COLOR_WHITE);
}
}
/* Bottom User & Power Bar */
uint32_t uy = sm_y + sm_h - 38;
vbe_fill_rect(sm_x, uy, sm_w, 38, 0xFF070B14);
/* Bottom User Profile */
uint32_t uy = sm_y + sm_h - 44;
vbe_fill_rect(sm_x, uy, sm_w, 44, 0xFF070B14);
vbe_draw_line(sm_x, uy, sm_x + sm_w, uy, COLOR_BORDER_CYAN);
/* User Profile */
vbe_draw_circle(sm_x + 25, uy + 19, 12, COLOR_CYAN_GLOW);
font_draw_char(sm_x + 22, uy + 11, 'A', COLOR_CYAN_GLOW);
font_draw_string(sm_x + 45, uy + 6, "Er. Adam Eehan", COLOR_WHITE);
font_draw_string(sm_x + 45, uy + 20, "Founder & CEO, Aira Group", COLOR_GREEN_OK);
vbe_draw_circle(sm_x + 25, uy + 22, 12, COLOR_CYAN_GLOW);
font_draw_char(sm_x + 22, uy + 14, 'A', COLOR_CYAN_GLOW);
font_draw_string(sm_x + 45, uy + 8, "Er. Adam Eehan", COLOR_WHITE);
font_draw_string(sm_x + 45, uy + 24, "Founder & CEO, Aira Group", COLOR_GREEN_OK);
/* Power Button */
font_draw_string(sm_x + sm_w - 70, uy + 11, "[Power]", COLOR_CRIMSON);
font_draw_string(sm_x + sm_w - 75, uy + 15, "[Power]", COLOR_CRIMSON);
}
/* ---------------- Right-Click Context Menu (LVGL Menu Widget) ---------------- */
/* ---------------- Right-Click Context Menu ---------------- */
static void draw_context_menu(vbe_screen_t* scr) {
if (!g_context_menu_open) return;
uint32_t cm_w = 190;
uint32_t cm_w = 195;
uint32_t cm_h = 145;
int32_t cm_x = g_context_x;
int32_t cm_y = g_context_y;
/* Screen edge clamping */
if (cm_x + (int32_t)cm_w > (int32_t)scr->width) cm_x = scr->width - cm_w - 10;
if (cm_y + (int32_t)cm_h > (int32_t)scr->height - 50) cm_y = scr->height - 50 - cm_h;
/* Frosted Acrylic Card with Glow Border */
vbe_fill_rect(cm_x, cm_y, cm_w, cm_h, 0xFA0B111E);
vbe_draw_glow_rect(cm_x, cm_y, cm_w, cm_h, COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
const char* items[] = {
"[W] Change Wallpaper",
"[*] Display & Settings",
"[*] Sovereign Hub",
"[>] Open Terminal",
"[#] Aira Task Manager",
"[~] Refresh Desktop"
@@ -525,7 +589,7 @@ static void draw_context_menu(vbe_screen_t* scr) {
}
}
/* ---------------- Action Center / Quick Settings (LVGL Controls) ---------------- */
/* ---------------- Action Center / Quick Settings ---------------- */
static void draw_quick_settings(vbe_screen_t* scr) {
if (!g_quick_settings_open) return;
@@ -533,18 +597,15 @@ static void draw_quick_settings(vbe_screen_t* scr) {
uint32_t qs_w = 315;
uint32_t qs_h = 300;
uint32_t qs_x = scr->width - qs_w - 15;
uint32_t qs_y = scr->height - 60 - qs_h;
uint32_t qs_y = scr->height - 58 - qs_h;
/* Frosted Acrylic Panel */
vbe_fill_rect(qs_x, qs_y, qs_w, qs_h, 0xFA0B111E);
vbe_draw_glow_rect(qs_x, qs_y, qs_w, qs_h, COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
/* Header */
font_draw_string_glow(qs_x + 15, qs_y + 12, "Quick Settings", COLOR_WHITE, COLOR_CYAN_DARK);
font_draw_string(qs_x + qs_w - 120, qs_y + 12, "[98% ⚡ AC Online]", COLOR_GREEN_OK);
vbe_draw_line(qs_x, qs_y + 30, qs_x + qs_w, qs_y + 30, COLOR_BORDER_CYAN);
/* 5 LVGL Pill Toggles (Switches) */
const char* toggle_labels[] = { "Wi-Fi", "Bluetooth", "Airplane", "Night Light", "Battery Saver" };
bool toggle_states[] = { g_qs_wifi, g_qs_bt, g_qs_airplane, g_qs_night_light, g_qs_battery_saver };
@@ -560,19 +621,16 @@ static void draw_quick_settings(vbe_screen_t* scr) {
vbe_fill_rect(sw_x, sw_y, sw_w, sw_h, active ? 0xFF004455 : 0xFF0C1420);
vbe_draw_rect(sw_x, sw_y, sw_w, sw_h, active ? COLOR_CYAN_GLOW : COLOR_DARK_GREY);
/* Sliding knob */
uint32_t knob_x = active ? (sw_x + sw_w - 20) : (sw_x + 6);
vbe_fill_circle(knob_x + 6, sw_y + 15, 6, active ? COLOR_CYAN_GLOW : COLOR_LIGHT_GREY);
/* Label */
font_draw_string(sw_x + (active ? 8 : 22), sw_y + 7, toggle_labels[i], active ? COLOR_WHITE : COLOR_LIGHT_GREY);
}
/* Sliders Section */
uint32_t sy = qs_y + 160;
vbe_draw_line(qs_x, sy - 8, qs_x + qs_w, sy - 8, COLOR_BORDER_CYAN);
/* Volume Slider */
/* Volume */
font_draw_string(qs_x + 15, sy, "Volume:", COLOR_WHITE);
char vol_str[8];
vol_str[0] = '0' + (g_qs_volume / 100);
@@ -581,7 +639,6 @@ static void draw_quick_settings(vbe_screen_t* scr) {
vol_str[3] = '%'; vol_str[4] = '\0';
font_draw_string(qs_x + 75, sy, vol_str, COLOR_CYAN_GLOW);
/* Slider track */
uint32_t sl_track_w = 180;
uint32_t sl_track_x = qs_x + 120;
vbe_fill_rect(sl_track_x, sy + 3, sl_track_w, 8, 0xFF0B1424);
@@ -590,7 +647,7 @@ static void draw_quick_settings(vbe_screen_t* scr) {
vbe_fill_rect(sl_track_x, sy + 3, sl_fill_w, 8, COLOR_CYAN_GLOW);
vbe_fill_circle(sl_track_x + sl_fill_w, sy + 7, 6, COLOR_WHITE);
/* Brightness Slider */
/* Brightness */
sy += 30;
font_draw_string(qs_x + 15, sy, "Brightness:", COLOR_WHITE);
char bri_str[8];
@@ -608,35 +665,28 @@ static void draw_quick_settings(vbe_screen_t* scr) {
vbe_fill_rect(bri_track_x, sy + 3, bri_fill_w, 8, COLOR_AMBER_GLOW);
vbe_fill_circle(bri_track_x + bri_fill_w, sy + 7, 6, COLOR_WHITE);
/* Bottom Power Action Buttons */
/* Power Buttons */
sy += 40;
vbe_draw_line(qs_x, sy - 8, qs_x + qs_w, sy - 8, COLOR_BORDER_CYAN);
/* Sleep Button */
vbe_fill_rect(qs_x + 15, sy, 85, 24, 0xFF0D2137);
vbe_draw_rect(qs_x + 15, sy, 85, 24, COLOR_BORDER_CYAN);
font_draw_string(qs_x + 28, sy + 4, "[Sleep]", COLOR_CYAN_GLOW);
/* Restart Button */
vbe_fill_rect(qs_x + 115, sy, 85, 24, 0xFF14243A);
vbe_draw_rect(qs_x + 115, sy, 85, 24, COLOR_CYAN_GLOW);
font_draw_string(qs_x + 125, sy + 4, "[Restart]", COLOR_WHITE);
/* Shut Down Button */
vbe_fill_rect(qs_x + 215, sy, 85, 24, 0xFF44001A);
vbe_draw_rect(qs_x + 215, sy, 85, 24, COLOR_CRIMSON);
font_draw_string(qs_x + 223, sy + 4, "[Power]", COLOR_CRIMSON);
}
/* ---------------- Precision Aerodynamic White Cursor with Drop Shadow ---------------- */
/* ---------------- Windows 11 Precision Aerodynamic White Cursor ---------------- */
static void draw_mouse_cursor(vbe_screen_t* scr, int32_t mx, int32_t my) {
if (!scr || !scr->back_buffer) return;
/*
* Sleek Windows 11 / macOS Precision Aerodynamic White Cursor
* Sharp tip at (0,0), white body, obsidian border, drop shadow.
*/
static const uint16_t shape_mask[19] = {
0b1000000000000000,
0b1100000000000000,
@@ -681,7 +731,7 @@ static void draw_mouse_cursor(vbe_screen_t* scr, int32_t mx, int32_t my) {
0b0000000000000000
};
/* Pass 1: Drop Shadow (+2, +2 offset) */
/* Drop Shadow */
for (int r = 0; r < 19; r++) {
int py = my + r + 2;
if (py < 0 || py >= (int)scr->height) continue;
@@ -695,7 +745,7 @@ static void draw_mouse_cursor(vbe_screen_t* scr, int32_t mx, int32_t my) {
}
}
/* Pass 2: White Body & Crisp Obsidian Border */
/* Pure White Body + Dark Obsidian Border */
for (int r = 0; r < 19; r++) {
int py = my + r;
if (py < 0 || py >= (int)scr->height) continue;
@@ -707,9 +757,9 @@ static void draw_mouse_cursor(vbe_screen_t* scr, int32_t mx, int32_t my) {
if (px < 0 || px >= (int)scr->width) continue;
if ((row_border >> (15 - c)) & 1) {
vbe_putpixel(px, py, 0xFF11141E); /* Obsidian border */
vbe_putpixel(px, py, 0xFF11141E);
} else if ((row_body >> (15 - c)) & 1) {
vbe_putpixel(px, py, 0xFFFFFFFF); /* Pure crisp white body */
vbe_putpixel(px, py, 0xFFFFFFFF);
}
}
}
@@ -726,7 +776,7 @@ void compositor_handle_mouse(int32_t mx, int32_t my, bool left, bool right) {
vbe_screen_t* scr = vbe_get_screen();
if (!scr) return;
/* Handle Window Dragging */
/* Window Dragging */
if (left && s_drag_win_id != 0) {
for (int i = 0; i < MAX_WINDOWS; i++) {
if (g_windows[i].active && g_windows[i].id == s_drag_win_id) {
@@ -740,7 +790,7 @@ void compositor_handle_mouse(int32_t mx, int32_t my, bool left, bool right) {
s_drag_win_id = 0;
}
/* 1. Handle Right-Click Context Menu Trigger */
/* 1. Explicit Right Click Context Menu */
if (right_clicked) {
g_context_menu_open = true;
g_context_x = mx;
@@ -754,7 +804,7 @@ void compositor_handle_mouse(int32_t mx, int32_t my, bool left, bool right) {
/* 2. Check Context Menu Click */
if (g_context_menu_open) {
uint32_t cm_w = 190;
uint32_t cm_w = 195;
uint32_t cm_h = 145;
int32_t cm_x = g_context_x;
int32_t cm_y = g_context_y;
@@ -764,10 +814,10 @@ void compositor_handle_mouse(int32_t mx, int32_t my, bool left, bool right) {
if (mx >= cm_x && mx <= cm_x + (int32_t)cm_w && my >= cm_y && my <= cm_y + (int32_t)cm_h) {
int item = (my - (cm_y + 8)) / 26;
if (item == 0) compositor_set_wallpaper((g_active_wallpaper + 1) % 4);
else if (item == 1) app_launch_settings();
else if (item == 1) app_launch_hub();
else if (item == 2) app_launch_terminal();
else if (item == 3) app_launch_taskmgr();
else if (item == 4) { /* Refresh Desktop */ }
else if (item == 4) { /* Refresh */ }
}
g_context_menu_open = false;
return;
@@ -778,12 +828,11 @@ void compositor_handle_mouse(int32_t mx, int32_t my, bool left, bool right) {
uint32_t qs_w = 315;
uint32_t qs_h = 300;
uint32_t qs_x = scr->width - qs_w - 15;
uint32_t qs_y = scr->height - 60 - qs_h;
uint32_t qs_y = scr->height - 58 - qs_h;
if (mx >= (int32_t)qs_x && mx <= (int32_t)(qs_x + qs_w) &&
my >= (int32_t)qs_y && my <= (int32_t)(qs_y + qs_h)) {
/* Toggles */
for (int i = 0; i < 5; i++) {
uint32_t col = i % 2;
uint32_t row = i / 2;
@@ -800,7 +849,6 @@ void compositor_handle_mouse(int32_t mx, int32_t my, bool left, bool right) {
}
}
/* Volume slider track */
uint32_t sl_track_x = qs_x + 120;
uint32_t sl_track_w = 180;
if (mx >= (int32_t)sl_track_x && mx <= (int32_t)(sl_track_x + sl_track_w) &&
@@ -810,7 +858,6 @@ void compositor_handle_mouse(int32_t mx, int32_t my, bool left, bool right) {
return;
}
/* Brightness slider track */
uint32_t bri_track_x = qs_x + 145;
uint32_t bri_track_w = 155;
if (mx >= (int32_t)bri_track_x && mx <= (int32_t)(bri_track_x + bri_track_w) &&
@@ -820,22 +867,16 @@ void compositor_handle_mouse(int32_t mx, int32_t my, bool left, bool right) {
return;
}
/* Power Buttons */
uint32_t py = qs_y + 240;
if (my >= (int32_t)py && my <= (int32_t)(py + 24)) {
if (mx >= (int32_t)(qs_x + 15) && mx <= (int32_t)(qs_x + 100)) {
/* Sleep */
acpi_enter_s0ix_standby();
return;
} else if (mx >= (int32_t)(qs_x + 115) && mx <= (int32_t)(qs_x + 200)) {
/* Restart */
acpi_reboot();
return;
} else if (mx >= (int32_t)(qs_x + 215) && mx <= (int32_t)(qs_x + 300)) {
/* Shut Down */
acpi_poweroff();
return;
}
return;
}
return;
} else {
@@ -850,22 +891,22 @@ void compositor_handle_mouse(int32_t mx, int32_t my, bool left, bool right) {
/* Titlebar click */
if (mx >= (int32_t)win->x && mx <= (int32_t)(win->x + win->w) &&
my >= (int32_t)win->y && my <= (int32_t)(win->y + 26)) {
my >= (int32_t)win->y && my <= (int32_t)(win->y + 28)) {
/* Close Button [x] */
int32_t btn_x = win->x + win->w - 60;
if (mx >= btn_x + 36 && mx <= btn_x + 58) {
/* Close Button */
int32_t btn_x = win->x + win->w - 65;
if (mx >= btn_x + 40 && mx <= btn_x + 62) {
compositor_close_window(win->id);
return;
}
/* Minimize Button [-] */
/* Minimize Button */
if (mx >= btn_x && mx <= btn_x + 18) {
win->minimized = true;
return;
}
/* Titlebar drag */
/* Drag Titlebar */
compositor_set_active_window(win->id);
s_drag_win_id = win->id;
s_drag_ox = mx - win->x;
@@ -875,116 +916,76 @@ void compositor_handle_mouse(int32_t mx, int32_t my, bool left, bool right) {
/* Body click */
if (mx >= (int32_t)win->x && mx <= (int32_t)(win->x + win->w) &&
my >= (int32_t)(win->y + 26) && my <= (int32_t)(win->y + win->h)) {
my >= (int32_t)(win->y + 28) && my <= (int32_t)(win->y + win->h)) {
compositor_set_active_window(win->id);
/* Interactive window content dispatch */
if (kstrcmp(win->title, "airlys-files") == 0) {
/* Interactive Content Handlers */
if (kstrncmp(win->title, "Airlys Sovereign Hub", 20) == 0) {
app_hub_click(win, mx, my);
} else if (kstrcmp(win->title, "airlys-files") == 0) {
app_files_click(win, mx, my);
} else if (kstrcmp(win->title, "airlys-settings") == 0) {
app_settings_click(win, mx, my);
}
return;
}
}
/* 5. Check Taskbar Dock Clicks */
uint32_t bar_h = 44;
uint32_t bar_y = scr->height - bar_h - 10;
uint32_t dock_w = 480;
uint32_t dock_x = (scr->width / 2) - (dock_w / 2);
/* 5. Check Desktop Tile Clicks (This PC, Files, Task Manager, Search, Settings) */
uint32_t diy = 30;
for (int i = 0; i < 5; i++) {
uint32_t dix = 25;
if (mx >= (int32_t)dix && mx <= (int32_t)(dix + 56) &&
my >= (int32_t)diy && my <= (int32_t)(diy + 70)) {
if (i == 0) app_launch_hub();
else if (i == 1) app_launch_files();
else if (i == 2) app_launch_taskmgr();
else if (i == 3) app_launch_search();
else if (i == 4) app_launch_settings();
return;
}
diy += 84;
}
if (my >= (int32_t)bar_y && my <= (int32_t)(bar_y + bar_h)) {
/* 6. Check Taskbar Clicks */
uint32_t bar_h = 48;
uint32_t bar_y = scr->height - bar_h;
if (my >= (int32_t)bar_y && my <= (int32_t)scr->height) {
/* Start Button */
uint32_t sx = dock_x + 12;
if (mx >= (int32_t)sx && mx <= (int32_t)(sx + 32)) {
if (mx >= 14 && mx <= 46) {
compositor_toggle_start_menu();
return;
}
/* Pinned App Slots */
uint32_t app_x = sx + 44;
/* Search Pill */
if (mx >= 56 && mx <= 266) {
app_launch_search();
return;
}
/* Centered App Icons */
uint32_t app_center_w = 7 * 54;
uint32_t app_x = (scr->width / 2) - (app_center_w / 2);
for (int i = 0; i < 7; i++) {
uint32_t tx = app_x + (i * 54);
if (mx >= (int32_t)tx && mx <= (int32_t)(tx + 36)) {
if (i == 0) {
/* Terminal */
bool found = false;
for (int w = 0; w < MAX_WINDOWS; w++) {
if (g_windows[w].active && kstrcmp(g_windows[w].title, "airlys-term") == 0) {
g_windows[w].minimized = !g_windows[w].minimized;
if (!g_windows[w].minimized) compositor_set_active_window(g_windows[w].id);
found = true; break;
}
}
if (!found) app_launch_terminal();
} else if (i == 1) {
/* Files */
bool found = false;
for (int w = 0; w < MAX_WINDOWS; w++) {
if (g_windows[w].active && kstrcmp(g_windows[w].title, "airlys-files") == 0) {
g_windows[w].minimized = !g_windows[w].minimized;
if (!g_windows[w].minimized) compositor_set_active_window(g_windows[w].id);
found = true; break;
}
}
if (!found) app_launch_files();
} else if (i == 2) {
/* Code Studio */
bool found = false;
for (int w = 0; w < MAX_WINDOWS; w++) {
if (g_windows[w].active && kstrcmp(g_windows[w].title, "aira-code") == 0) {
g_windows[w].minimized = !g_windows[w].minimized;
if (!g_windows[w].minimized) compositor_set_active_window(g_windows[w].id);
found = true; break;
}
}
if (!found) app_launch_code();
} else if (i == 4) {
/* Task Manager */
bool found = false;
for (int w = 0; w < MAX_WINDOWS; w++) {
if (g_windows[w].active && kstrcmp(g_windows[w].title, "Aira Task Manager") == 0) {
g_windows[w].minimized = !g_windows[w].minimized;
if (!g_windows[w].minimized) compositor_set_active_window(g_windows[w].id);
found = true; break;
}
}
if (!found) app_launch_taskmgr();
} else if (i == 5) {
/* Search */
bool found = false;
for (int w = 0; w < MAX_WINDOWS; w++) {
if (g_windows[w].active && kstrncmp(g_windows[w].title, "Airlys", 6) == 0) {
g_windows[w].minimized = !g_windows[w].minimized;
if (!g_windows[w].minimized) compositor_set_active_window(g_windows[w].id);
found = true; break;
}
}
if (!found) app_launch_search();
} else if (i == 6) {
/* Settings */
bool found = false;
for (int w = 0; w < MAX_WINDOWS; w++) {
if (g_windows[w].active && kstrcmp(g_windows[w].title, "airlys-settings") == 0) {
g_windows[w].minimized = !g_windows[w].minimized;
if (!g_windows[w].minimized) compositor_set_active_window(g_windows[w].id);
found = true; break;
}
}
if (!found) app_launch_settings();
}
if (i == 0) app_launch_terminal();
else if (i == 1) app_launch_files();
else if (i == 2) app_launch_code();
else if (i == 4) app_launch_taskmgr();
else if (i == 5) app_launch_search();
else if (i == 6) app_launch_hub();
return;
}
}
}
/* 6. Check System Tray Click (Toggles Quick Settings) */
uint32_t tray_x = scr->width - 200;
if (mx >= (int32_t)tray_x && mx <= (int32_t)(tray_x + 190) &&
my >= (int32_t)bar_y && my <= (int32_t)(bar_y + bar_h)) {
compositor_toggle_quick_settings();
return;
/* System Tray Click */
uint32_t tray_w = 260;
uint32_t tray_x = scr->width - tray_w - 10;
if (mx >= (int32_t)tray_x && mx <= (int32_t)(tray_x + tray_w)) {
compositor_toggle_quick_settings();
return;
}
}
/* Click on empty desktop closes Start Menu & Quick Settings */
@@ -998,7 +999,7 @@ void compositor_render_frame(void) {
vbe_screen_t* scr = vbe_get_screen();
if (!scr || !scr->initialized) return;
/* 1. If Lock Screen active, draw lock screen and exit */
/* 1. Lock Screen check */
if (g_lock_screen_open) {
app_lockscreen_draw();
draw_mouse_cursor(scr, mouse_get_x(), mouse_get_y());
@@ -1006,16 +1007,19 @@ void compositor_render_frame(void) {
return;
}
/* 2. Desktop Wallpaper & Sovereign Logo */
/* 2. Full-Frame Edge-to-Edge Desktop Wallpaper */
draw_desktop_wallpaper(scr);
/* 3. Render Inactive Windows */
/* 3. Desktop Quick Icons (LVGL Grid Tiles) */
draw_desktop_icons(scr);
/* 4. Inactive Windows */
for (int i = 0; i < MAX_WINDOWS; i++) {
if (g_windows[i].active && g_windows[i].id != g_active_window_id) {
draw_window(&g_windows[i]);
}
}
/* Render Active Window on Top */
/* Active Window on Top */
for (int i = 0; i < MAX_WINDOWS; i++) {
if (g_windows[i].active && g_windows[i].id == g_active_window_id) {
draw_window(&g_windows[i]);
@@ -1023,21 +1027,17 @@ void compositor_render_frame(void) {
}
}
/* 4. Taskbar Dock */
/* 5. Full-Width Taskbar */
draw_taskbar(scr);
/* 5. Start Menu Overlay */
/* 6. Overlays (Start Menu, Quick Settings, Context Menu) */
draw_start_menu(scr);
/* 6. Quick Settings Overlay */
draw_quick_settings(scr);
/* 7. Right-Click Context Menu Overlay */
draw_context_menu(scr);
/* 8. Precision Aerodynamic White Mouse Cursor Overlay */
/* 7. Precision Aerodynamic White Cursor Overlay */
draw_mouse_cursor(scr, mouse_get_x(), mouse_get_y());
/* 9. Push to Physical Linear Framebuffer */
/* 8. Push to Screen */
vbe_swap_buffers();
}