feat(gui): LVGL widgets, sleek aerodynamic cursor, right-click context menu, quick settings & settings app

This commit is contained in:
Adam Eehan committed 2026-10-24 21:52:15 +05:30
1 parent 7bbcf4567e
commit 2b3e8f0bb6
8 files changed
+948 -238

No files matched your search

+76 -3
View File
@@ -4,10 +4,14 @@
#include <airlys/vga.h> #include <airlys/vga.h>
#include <airlys/pic.h> #include <airlys/pic.h>
#include <airlys/shell.h> #include <airlys/shell.h>
#include <airlys/mouse.h>
#include <airlys/compositor.h>
#define KBD_DATA_PORT 0x60 #define KBD_DATA_PORT 0x60
static bool shift_pressed = false; static bool shift_pressed = false;
static bool s_ext_scancode = false;
static bool ctrl_pressed = false;
/* Scan Code Set 1 mapping (lower-case / normal) */ /* Scan Code Set 1 mapping (lower-case / normal) */
static const char kbd_scancode_normal[128] = { static const char kbd_scancode_normal[128] = {
@@ -43,18 +47,87 @@ static void keyboard_callback(registers_t* regs) {
(void)regs; (void)regs;
uint8_t scancode = inb(KBD_DATA_PORT); uint8_t scancode = inb(KBD_DATA_PORT);
/* Check for Shift key press (0x2A left, 0x36 right) */ /* Check extended prefix */
if (scancode == 0xE0) {
s_ext_scancode = true;
return;
}
if (s_ext_scancode) {
s_ext_scancode = false;
/* Extended scancodes for laptop keyboard */
switch (scancode) {
case 0x48: /* Up Arrow */
mouse_move_relative(0, -20);
return;
case 0x50: /* Down Arrow */
mouse_move_relative(0, 20);
return;
case 0x4B: /* Left Arrow */
mouse_move_relative(-20, 0);
return;
case 0x4D: /* Right Arrow */
mouse_move_relative(20, 0);
return;
case 0x5B: /* Super / Windows Key */
compositor_toggle_start_menu();
return;
case 0x5D: /* Context Menu Key (Right Click) */
mouse_set_buttons(false, true);
mouse_set_buttons(false, false);
return;
default:
break;
}
return;
}
/* Track Control key */
if (scancode == 0x1D) {
ctrl_pressed = true;
return;
}
if (scancode == 0x9D) {
ctrl_pressed = false;
return;
}
/* Shift press / release */
if (scancode == 0x2A || scancode == 0x36) { if (scancode == 0x2A || scancode == 0x36) {
shift_pressed = true; shift_pressed = true;
return; return;
} }
/* Check for Shift key release (0xAA left, 0xB6 right) */
if (scancode == 0xAA || scancode == 0xB6) { if (scancode == 0xAA || scancode == 0xB6) {
shift_pressed = false; shift_pressed = false;
return; return;
} }
/* Key release has bit 7 set (scancode >= 0x80) */ /* Escape key (0x01): Dismiss menus */
if (scancode == 0x01) {
compositor_close_context_menu();
return;
}
/* Enter key (0x1C) - Left Click trigger for cursor */
if (scancode == 0x1C) {
mouse_set_buttons(true, false);
} else if (scancode == 0x9C) {
mouse_set_buttons(false, false);
}
/* Ctrl+A: Toggle Action Center / Quick Settings */
if (ctrl_pressed && scancode == 0x1E) {
compositor_toggle_quick_settings();
return;
}
/* Keypad navigation when NumLock is off */
if (scancode == 0x48) { mouse_move_relative(0, -20); return; }
if (scancode == 0x50) { mouse_move_relative(0, 20); return; }
if (scancode == 0x4B) { mouse_move_relative(-20, 0); return; }
if (scancode == 0x4D) { mouse_move_relative(20, 0); return; }
/* Key release */
if (scancode & 0x80) { if (scancode & 0x80) {
return; return;
} }
+41 -19
View File
@@ -38,15 +38,28 @@ static uint8_t mouse_read(void) {
return inb(MOUSE_PORT_DATA); return inb(MOUSE_PORT_DATA);
} }
static void mouse_callback(registers_t* regs) { void mouse_move_relative(int32_t dx, int32_t dy) {
(void)regs; s_mouse_x += dx;
uint8_t status = inb(MOUSE_PORT_STATUS); s_mouse_y += dy;
if (!(status & 0x01)) return; /* No data ready */
if (!(status & 0x20)) return; /* Not auxiliary (mouse) data */
uint8_t b = inb(MOUSE_PORT_DATA); /* Clamp within display bounds */
vbe_screen_t* scr = vbe_get_screen();
if (scr && scr->width > 0 && scr->height > 0) {
if (s_mouse_x < 0) s_mouse_x = 0;
if (s_mouse_x >= (int32_t)scr->width) s_mouse_x = (int32_t)scr->width - 1;
if (s_mouse_y < 0) s_mouse_y = 0;
if (s_mouse_y >= (int32_t)scr->height) s_mouse_y = (int32_t)scr->height - 1;
}
}
/* Byte 0 alignment check: Bit 3 must always be 1 in PS/2 packet */ void mouse_set_buttons(bool left, bool right) {
s_left_button = left;
s_right_button = right;
compositor_handle_mouse(s_mouse_x, s_mouse_y, s_left_button, s_right_button);
}
static void mouse_process_byte(uint8_t b) {
/* Byte 0 alignment check: Bit 3 must always be 1 in standard PS/2 packet */
if (s_mouse_cycle == 0 && !(b & 0x08)) { if (s_mouse_cycle == 0 && !(b & 0x08)) {
return; return;
} }
@@ -67,26 +80,35 @@ static void mouse_callback(registers_t* regs) {
/* Ignore overflow packets */ /* Ignore overflow packets */
if (flags & 0x40 || flags & 0x80) return; if (flags & 0x40 || flags & 0x80) return;
s_mouse_x += dx; /* Invert dy because PS/2 Y is positive upwards, display Y is downwards */
s_mouse_y -= dy; /* PS/2 Y is positive up, screen Y is positive down */ mouse_move_relative(dx, -dy);
/* Clamp within display bounds */
vbe_screen_t* scr = vbe_get_screen();
if (scr && scr->width > 0 && scr->height > 0) {
if (s_mouse_x < 0) s_mouse_x = 0;
if (s_mouse_x >= (int32_t)scr->width) s_mouse_x = (int32_t)scr->width - 1;
if (s_mouse_y < 0) s_mouse_y = 0;
if (s_mouse_y >= (int32_t)scr->height) s_mouse_y = (int32_t)scr->height - 1;
}
s_left_button = (flags & 0x01) != 0; s_left_button = (flags & 0x01) != 0;
s_right_button = (flags & 0x02) != 0; s_right_button = (flags & 0x02) != 0;
/* Pass event to window compositor */ /* Dispatch event to window compositor */
compositor_handle_mouse(s_mouse_x, s_mouse_y, s_left_button, s_right_button); compositor_handle_mouse(s_mouse_x, s_mouse_y, s_left_button, s_right_button);
} }
} }
static void mouse_callback(registers_t* regs) {
(void)regs;
uint8_t status = inb(MOUSE_PORT_STATUS);
if (!(status & 0x01)) return; /* No data ready */
uint8_t b = inb(MOUSE_PORT_DATA);
mouse_process_byte(b);
}
/* Polling fallback for systems where IRQ 12 is intercepted by UEFI EC */
void mouse_poll(void) {
uint32_t guard = 16;
while ((inb(MOUSE_PORT_STATUS) & 0x01) && guard-- > 0) {
uint8_t b = inb(MOUSE_PORT_DATA);
mouse_process_byte(b);
}
}
void mouse_init(void) { void mouse_init(void) {
/* Step 1: Enable auxiliary mouse device on PS/2 controller */ /* Step 1: Enable auxiliary mouse device on PS/2 controller */
mouse_wait_input(); mouse_wait_input();
+6
View File
@@ -16,6 +16,10 @@ void app_taskmgr_draw(window_t* win);
void app_search_draw(window_t* win); void app_search_draw(window_t* win);
void app_term_draw(window_t* win); void app_term_draw(window_t* win);
void app_files_draw(window_t* win); void app_files_draw(window_t* win);
void app_files_click(window_t* win, int32_t mx, int32_t my);
void app_settings_draw(window_t* win);
void app_settings_click(window_t* win, int32_t mx, int32_t my);
void app_code_draw(window_t* win);
void app_lockscreen_draw(void); void app_lockscreen_draw(void);
/* Launch Application Windows */ /* Launch Application Windows */
@@ -23,5 +27,7 @@ window_t* app_launch_taskmgr(void);
window_t* app_launch_search(void); window_t* app_launch_search(void);
window_t* app_launch_terminal(void); window_t* app_launch_terminal(void);
window_t* app_launch_files(void); window_t* app_launch_files(void);
window_t* app_launch_settings(void);
window_t* app_launch_code(void);
#endif /* AIRLYS_APPS_H */ #endif /* AIRLYS_APPS_H */
+12
View File
@@ -12,6 +12,11 @@
#define MAX_WINDOWS 8 #define MAX_WINDOWS 8
#define WALLPAPER_DEFAULT_LOGO 0 /* Authentic Sovereign Logo on Obsidian */
#define WALLPAPER_CYBER_AURORA 1 /* Vibrant Cyan-Purple Aurora Vector */
#define WALLPAPER_MINIMAL_DARK 2 /* Pure Matte Stealth Dark */
#define WALLPAPER_EMERALD_MATRIX 3 /* Cyber Emerald Matrix */
struct window; struct window;
typedef void (*window_draw_fn)(struct window* win); typedef void (*window_draw_fn)(struct window* win);
@@ -37,8 +42,15 @@ void compositor_set_active_window(uint32_t id);
void compositor_toggle_start_menu(void); void compositor_toggle_start_menu(void);
void compositor_toggle_lock_screen(void); void compositor_toggle_lock_screen(void);
void compositor_toggle_quick_settings(void);
void compositor_close_context_menu(void);
bool compositor_is_start_menu_open(void); bool compositor_is_start_menu_open(void);
bool compositor_is_lock_screen_open(void); bool compositor_is_lock_screen_open(void);
bool compositor_is_quick_settings_open(void);
void compositor_set_wallpaper(uint32_t wallpaper_id);
uint32_t compositor_get_wallpaper(void);
void compositor_handle_mouse(int32_t x, int32_t y, bool left, bool right); void compositor_handle_mouse(int32_t x, int32_t y, bool left, bool right);
void compositor_render_frame(void); void compositor_render_frame(void);
+4 -1
View File
@@ -10,9 +10,12 @@
#include <airlys/types.h> #include <airlys/types.h>
void mouse_init(void); void mouse_init(void);
void mouse_poll(void);
int32_t mouse_get_x(void); int32_t mouse_get_x(void);
int32_t mouse_get_y(void); int32_t mouse_get_y(void);
bool mouse_is_left_down(void); bool mouse_is_left_down(void);
bool mouse_is_right_down(void); bool mouse_is_right_down(void);
void mouse_move_relative(int32_t dx, int32_t dy);
void mouse_set_buttons(bool left, bool right);
#endif #endif /* AIRLYS_MOUSE_H */
+266 -46
View File
@@ -1,4 +1,5 @@
#include <airlys/apps.h> #include <airlys/apps.h>
#include <airlys/compositor.h>
#include <airlys/vbe.h> #include <airlys/vbe.h>
#include <airlys/font.h> #include <airlys/font.h>
#include <airlys/pmm.h> #include <airlys/pmm.h>
@@ -8,6 +9,8 @@
#include <airlys/rtc.h> #include <airlys/rtc.h>
#include <airlys/string.h> #include <airlys/string.h>
static uint32_t s_settings_tab = 0; /* 0: System, 1: Personalization, 2: Network, 3: Power */
void apps_init(void) { void apps_init(void) {
/* Initialize Phase 7 application registry */ /* Initialize Phase 7 application registry */
} }
@@ -19,7 +22,7 @@ void app_taskmgr_draw(window_t* win) {
uint32_t w = win->w - 20; uint32_t w = win->w - 20;
/* Top Stats Bar */ /* Top Stats Bar */
font_draw_string_glow(x, y, "CPU: 1.8% @ 100 Hz Ticks (Preemptive RR)", COLOR_CYAN_GLOW, COLOR_CYAN_DARK); font_draw_string_glow(x, y, "CPU: 1.8% @ 100 Hz Ticks (Preemptive RR - 16 Threads)", COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
y += 20; y += 20;
/* Live CPU Wave Graph Box */ /* Live CPU Wave Graph Box */
@@ -44,7 +47,7 @@ void app_taskmgr_draw(window_t* win) {
y += 70; y += 70;
/* Memory Gauge */ /* Memory Gauge */
font_draw_string(x, y, "Physical RAM: 142 MB / 1024 MB Managed (14% Active)", COLOR_WHITE); font_draw_string(x, y, "Physical RAM: 142 MB / 16384 MB Managed (DDR5 4800MHz)", COLOR_WHITE);
y += 18; y += 18;
vbe_fill_rect(x, y, w, 12, 0xFF080D18); vbe_fill_rect(x, y, w, 12, 0xFF080D18);
vbe_draw_rect(x, y, w, 12, COLOR_BORDER_CYAN); vbe_draw_rect(x, y, w, 12, COLOR_BORDER_CYAN);
@@ -79,7 +82,7 @@ void app_taskmgr_draw(window_t* win) {
vbe_draw_rect(btn_x, btn_y, 95, 22, 0xFFFF6688); vbe_draw_rect(btn_x, btn_y, 95, 22, 0xFFFF6688);
font_draw_string(btn_x + 12, btn_y + 3, "End Task", COLOR_WHITE); font_draw_string(btn_x + 12, btn_y + 3, "End Task", COLOR_WHITE);
font_draw_string(x, btn_y + 3, "Threads: 5 | Handles: 124 | Uptime: OK", COLOR_LIGHT_GREY); font_draw_string(x, btn_y + 3, "Threads: 16 | Handles: 124 | Uptime: Sovereign Mode", COLOR_LIGHT_GREY);
} }
/* 2. Aira Search & Web Navigator Window */ /* 2. Aira Search & Web Navigator Window */
@@ -108,7 +111,7 @@ void app_search_draw(window_t* win) {
uint32_t center_x = win->x + (win->w / 2); 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); 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; y += 20;
font_draw_string(center_x - 165, y, "Sovereign Neural Knowledge Engine | Zero Ads • Zero Tracking", COLOR_LIGHT_GREY); font_draw_string(center_x - 165, y, "Sovereign Neural Knowledge Engine | Zero Ads * Zero Tracking", COLOR_LIGHT_GREY);
y += 25; y += 25;
/* Search Input Pill */ /* Search Input Pill */
@@ -134,8 +137,8 @@ void app_search_draw(window_t* win) {
vbe_fill_rect(x + 20, y, w - 40, 60, 0xFF0B1424); vbe_fill_rect(x + 20, y, w - 40, 60, 0xFF0B1424);
vbe_draw_rect(x + 20, y, w - 40, 60, COLOR_BORDER_CYAN); 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); font_draw_string(x + 30, y + 6, "[Aira 3 Ultra Instant Answer]", COLOR_CYAN_GLOW);
font_draw_string(x + 30, y + 24, "Airlys Phase 7 GUI active: VBE 1024x768 Linear Framebuffer @ 32bpp TrueColor.", COLOR_WHITE); font_draw_string(x + 30, y + 24, "Airlys Phase 7 GUI active: 1080p FHD Linear Framebuffer @ 32bpp TrueColor.", COLOR_WHITE);
font_draw_string(x + 30, y + 40, "Protected by Sovereign Privacy Shroud | 0 Trackers Blocked.", COLOR_GREEN_OK); font_draw_string(x + 30, y + 40, "Protected by Sovereign Privacy Shroud | Zero Telemetry.", COLOR_GREEN_OK);
} }
/* 3. Translucent Sovereign Terminal Window */ /* 3. Translucent Sovereign Terminal Window */
@@ -146,21 +149,19 @@ void app_term_draw(window_t* win) {
font_draw_string(x, y, "Airlys Sovereign Kernel Console (x86_64 Long Mode)", COLOR_CYAN_GLOW); font_draw_string(x, y, "Airlys Sovereign Kernel Console (x86_64 Long Mode)", COLOR_CYAN_GLOW);
y += 20; y += 20;
font_draw_string(x, y, "┌──(root㉿airlys-os)-[/home/user]", COLOR_CYAN_GLOW); font_draw_string(x, y, "root@airlys-os:~# start-desktop", COLOR_CYAN_GLOW);
y += 18;
font_draw_string(x, y, "[OK] Framebuffer initialized: 1920x1080 @ 32bpp TrueColor", COLOR_GREEN_OK);
y += 16; y += 16;
font_draw_string(x, y, "└─Airlys >> start-desktop", COLOR_WHITE); 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);
y += 16;
font_draw_string(x, y, "[OK] Dual-Input Keyboard Cursor Navigation co-pilot online", COLOR_GREEN_OK);
y += 20; y += 20;
font_draw_string(x, y, "[*] VBE Framebuffer initialized: 1024x768 @ 32bpp TrueColor", COLOR_GREEN_OK); font_draw_string(x, y, "root@airlys-os:~# _", COLOR_WHITE);
y += 16;
font_draw_string(x, y, "[*] Window Compositor: Acrylic Blur & 60 FPS VSync active", COLOR_GREEN_OK);
y += 16;
font_draw_string(x, y, "[OK] Desktop Shell (Phase 7 GUI) loaded successfully.", COLOR_CYAN_GLOW);
y += 20;
font_draw_string(x, y, "┌──(root㉿airlys-os)-[/home/user]", COLOR_CYAN_GLOW);
y += 16;
font_draw_string(x, y, "└─Airlys >> _", COLOR_CYAN_GLOW);
} }
/* 4. Sovereign File Explorer Window */ /* 4. Sovereign File Explorer Window */
@@ -175,35 +176,253 @@ void app_files_draw(window_t* win) {
vbe_draw_rect(x, y, sb_w, h, COLOR_BORDER_CYAN); vbe_draw_rect(x, y, sb_w, h, COLOR_BORDER_CYAN);
font_draw_string(x + 10, y + 10, "Quick Access", COLOR_CYAN_GLOW); font_draw_string(x + 10, y + 10, "Quick Access", COLOR_CYAN_GLOW);
font_draw_string(x + 10, y + 35, "> /home/user", COLOR_WHITE); font_draw_string(x + 10, y + 35, "> /wallpapers", COLOR_CYAN_GLOW);
font_draw_string(x + 10, y + 55, "> /etc", COLOR_LIGHT_GREY); font_draw_string(x + 10, y + 55, "> /home/user", COLOR_WHITE);
font_draw_string(x + 10, y + 75, "> /usr/bin", COLOR_LIGHT_GREY); font_draw_string(x + 10, y + 75, "> /usr/bin", COLOR_LIGHT_GREY);
font_draw_string(x + 10, y + 95, "> ram0 (Disk)", COLOR_CYAN_GLOW); font_draw_string(x + 10, y + 95, "> ram0 (Disk)", COLOR_LIGHT_GREY);
/* Main File Grid */ /* Main File Grid */
uint32_t grid_x = x + sb_w + 10; uint32_t grid_x = x + sb_w + 10;
uint32_t grid_w = win->w - sb_w - 30; uint32_t grid_w = win->w - sb_w - 25;
vbe_fill_rect(grid_x, y, grid_w, h, 0xFF080D18); vbe_fill_rect(grid_x, y, grid_w, h, 0xFF080D18);
vbe_draw_rect(grid_x, y, grid_w, h, COLOR_BORDER_CYAN); vbe_draw_rect(grid_x, y, grid_w, h, COLOR_BORDER_CYAN);
/* Files */ font_draw_string(grid_x + 10, y + 8, "Location: /wallpapers", COLOR_CYAN_GLOW);
const char* items[] = { vbe_draw_line(grid_x, y + 24, grid_x + grid_w, y + 24, COLOR_BORDER_CYAN);
"[PKG] demo.apkg (42 KB) - Aira Package",
"[SRC] system.aira (12 KB) - AiraLang Script", /* Wallpaper Files with direct "Set as Wallpaper" Action */
"[DOC] covenant.txt (4 KB) - Sovereign Covenant", const char* wall_names[] = {
"[ELF] kernel.elf (814 KB) - Monolithic Kernel", "sovereign_logo.png (Default Airlys Logo)",
"[DIR] /apps - Installed Apps" "cyber_aurora.png (Cyan Aurora Theme)",
"midnight_dark.png (Pure Matte Stealth)",
"emerald_matrix.png (Cyber Matrix Theme)"
}; };
uint32_t item_y = y + 15; uint32_t item_y = y + 32;
for (int i = 0; i < 5; i++) { for (int i = 0; i < 4; i++) {
vbe_fill_rect(grid_x + 10, item_y, grid_w - 20, 24, (i % 2 == 0) ? 0xFF0E1626 : 0xFF0A101C); vbe_fill_rect(grid_x + 8, item_y, grid_w - 16, 28, (i % 2 == 0) ? 0xFF0E1626 : 0xFF0A101C);
font_draw_string(grid_x + 18, item_y + 4, items[i], (i == 0) ? COLOR_CYAN_GLOW : COLOR_WHITE);
item_y += 30; /* 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);
vbe_fill_rect(btn_x, item_y + 4, btn_w, 20, is_current ? 0xFF006677 : 0xFF142236);
vbe_draw_rect(btn_x, item_y + 4, btn_w, 20, COLOR_BORDER_CYAN);
font_draw_string(btn_x + 8, item_y + 6, is_current ? "[Active Wall]" : "[Set Wallpaper]",
is_current ? COLOR_CYAN_GLOW : COLOR_LIGHT_GREY);
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;
} }
} }
/* 5. Sovereign Full-Screen Lock Screen & Greeter */ void app_files_click(window_t* win, int32_t mx, int32_t my) {
uint32_t x = win->x + 10;
uint32_t y = win->y + 35;
uint32_t sb_w = 140;
uint32_t grid_x = x + sb_w + 10;
uint32_t grid_w = win->w - sb_w - 25;
uint32_t item_y = y + 32;
for (int i = 0; i < 4; i++) {
uint32_t btn_w = 120;
uint32_t btn_x = grid_x + grid_w - btn_w - 14;
if (mx >= (int32_t)btn_x && mx <= (int32_t)(btn_x + btn_w) &&
my >= (int32_t)(item_y + 4) && my <= (int32_t)(item_y + 24)) {
compositor_set_wallpaper((uint32_t)i);
return;
}
item_y += 34;
}
}
/* 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;
}
}
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;
}
}
}
/* 6. Aira Code Editor Window */
void app_code_draw(window_t* win) {
uint32_t x = win->x + 12;
uint32_t y = win->y + 35;
font_draw_string_glow(x, y, "Aira Code Studio - [kmain.c]", COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
y += 22;
const char* lines[] = {
"1 /* Airlys Sovereign Operating System */",
"2 #include <airlys/kernel.h>",
"3 #include <airlys/compositor.h>",
"4 ",
"5 void kernel_main(uint64_t magic, uint64_t addr) {",
"6 serial_init();",
"7 vbe_init(1920, 1080);",
"8 mouse_init();",
"9 printk(\"[OK] Airlys Sovereign GUI 60 FPS Online\\n\");",
"10 for (;;) { mouse_poll(); compositor_render_frame(); }",
"11 }"
};
for (int i = 0; i < 11; i++) {
font_draw_string(x, y, lines[i], (i == 4 || i == 10) ? COLOR_CYAN_GLOW : COLOR_WHITE);
y += 18;
}
}
/* 7. Sovereign Full-Screen Lock Screen & Greeter */
void app_lockscreen_draw(void) { void app_lockscreen_draw(void) {
vbe_screen_t* scr = vbe_get_screen(); vbe_screen_t* scr = vbe_get_screen();
if (!scr) return; if (!scr) return;
@@ -211,20 +430,16 @@ void app_lockscreen_draw(void) {
/* Background Obsidian Wash */ /* Background Obsidian Wash */
vbe_fill_rect(0, 0, scr->width, scr->height, COLOR_OBSIDIAN); vbe_fill_rect(0, 0, scr->width, scr->height, COLOR_OBSIDIAN);
/* Glowing Center Watermark */
uint32_t cx = scr->width / 2;
uint32_t cy = scr->height / 2;
vbe_draw_circle(cx, cy - 30, 90, 0x3300F2FE);
vbe_draw_circle(cx, cy - 30, 89, 0x5500F2FE);
/* Clock & Date (Upper Left) */ /* Clock & Date (Upper Left) */
rtc_time_t t = rtc_get_time(); rtc_time_t t = rtc_get_time();
char time_str[32]; char time_str[32];
kstrcpy(time_str, "15:10 UTC | Friday, Oct 23"); kstrcpy(time_str, "15:10 UTC | Friday, Oct 24");
if (t.hour < 10) time_str[0] = '0'; if (t.hour < 10) time_str[0] = '0';
font_draw_string_glow(40, 40, time_str, COLOR_WHITE, COLOR_CYAN_DARK); font_draw_string_glow(40, 40, time_str, COLOR_WHITE, COLOR_CYAN_DARK);
/* Floating Center Login Card */ /* Floating Center Login Card */
uint32_t cx = scr->width / 2;
uint32_t cy = scr->height / 2;
uint32_t card_w = 340; uint32_t card_w = 340;
uint32_t card_h = 240; uint32_t card_h = 240;
uint32_t card_x = cx - (card_w / 2); uint32_t card_x = cx - (card_w / 2);
@@ -233,7 +448,7 @@ void app_lockscreen_draw(void) {
vbe_fill_rect(card_x, card_y, card_w, card_h, 0xEE0B1220); 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); vbe_draw_glow_rect(card_x, card_y, card_w, card_h, COLOR_CYAN_GLOW, COLOR_CYAN_DARK);
/* Avatar Cyber Ring */ /* Avatar Ring */
vbe_draw_circle(cx, card_y + 45, 26, COLOR_CYAN_GLOW); vbe_draw_circle(cx, card_y + 45, 26, COLOR_CYAN_GLOW);
vbe_fill_circle(cx, card_y + 45, 24, 0xFF003344); vbe_fill_circle(cx, card_y + 45, 24, 0xFF003344);
font_draw_char(cx - 4, card_y + 37, 'A', COLOR_CYAN_GLOW); font_draw_char(cx - 4, card_y + 37, 'A', COLOR_CYAN_GLOW);
@@ -253,9 +468,6 @@ void app_lockscreen_draw(void) {
/* Alternate Options */ /* Alternate Options */
font_draw_string(cx - 85, card_y + 175, "[ PIN ] [ Fingerprint ]", COLOR_LIGHT_GREY); 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); font_draw_string(cx - 75, card_y + 195, "Sign in with Aira ID", COLOR_CYAN_GLOW);
/* Bottom Status Glyphs */
font_draw_string(scr->width - 160, scr->height - 30, "[Gigabit] [Vol] [Power]", COLOR_LIGHT_GREY);
} }
/* App Launchers */ /* App Launchers */
@@ -274,3 +486,11 @@ window_t* app_launch_terminal(void) {
window_t* app_launch_files(void) { window_t* app_launch_files(void) {
return compositor_create_window("airlys-files", 260, 140, 580, 380, app_files_draw); return compositor_create_window("airlys-files", 260, 140, 580, 380, app_files_draw);
} }
window_t* app_launch_settings(void) {
return compositor_create_window("airlys-settings", 180, 110, 660, 420, app_settings_draw);
}
window_t* app_launch_code(void) {
return compositor_create_window("aira-code", 200, 120, 600, 380, app_code_draw);
}
+542 -169
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -272,6 +272,7 @@ void kernel_main(uint64_t magic, uint64_t addr) {
uint64_t last_frame_ticks = 0; uint64_t last_frame_ticks = 0;
uint32_t loop_counter = 0; uint32_t loop_counter = 0;
for (;;) { for (;;) {
mouse_poll(); /* Poll hardware touchpad/mouse EC packets */
uint64_t current_ticks = timer_get_ticks(); uint64_t current_ticks = timer_get_ticks();
loop_counter++; loop_counter++;
if (current_ticks > last_frame_ticks + 5 || loop_counter >= 300000) { if (current_ticks > last_frame_ticks + 5 || loop_counter >= 300000) {