状态栏正确闭环(agent-142): 系统进程统一渲染+App不画+覆盖叠加+数据唯一+MD3图标式+主题换图标

- meow_ui_sys_set_system_mode: launcher置1才渲染, App默认0→不画状态栏; app_overlay_statusbar在launch_app循环~1s叠加28px顶条(不SIGSTOP App)
- 数据源唯一(launcher g_sys→meow_ui_sys_feed; wifi_level/batt/vol/bri/clock), 根治"launcher有亮度App没有"
- 右侧=MD3图标+变量值(statusbar_right_str文本退役→图标簇, 复用sb_icons.h/MEOW_SB_ICON_*/meow_gfx_blit_icon); 颜色随meow_theme
- ui.style换图标集(meow_ui_style/set_style读ui.style md3/miuix, MIUIx暂MD3占位)
- hello最小改动(redraw非全屏只清inset=28之下, 不冲系统顶条); 开放点: App不SIGSTOP/inset28/MIUIx占位/set_statusbar系统模式门
- meow_ui.a=3da5af7b launcher=a2b1c096 hello=67075741 0warning; 宿主test_sb_statusbar ALL PASS + render PPM目检(左时钟右亮度/WiFi/蓝牙/音量/电量)
- 遗留: 真机验证(无双画/数据一致/顶条叠加/inset/ui.style); 运行时fullscreen沉浸叠画待M3; MIUIx图标占位
This commit is contained in:
MeowOS committed 2026-08-30 19:32:40 +08:00
1 parent 2a6c4e97c5
commit 7300fc0a13
14 files changed
+731 -44

No files matched your search

+51
View File
@@ -0,0 +1,51 @@
/* render_sb_statusbar.c — 宿主可视化渲染:把「同一个状态栏」画进 back_buf 并 dump PPM 目检。
* 仅用于宿主验证(无 /dev/fb0 → 480x720 离屏;字体缺失时图标仍画,数值可能缺字)。
* 编译(宿主 gcc):
* gcc -o render_sb_statusbar render_sb_statusbar.c meow_ui_gfx.c meow_ui_sys.c meow_ui_theme.c \
* meow_ui_vol.c meow_ui_log.c /tmp/meow_font_host.o -I. -I../meow_launcherd -lz
*/
#include "meow_ui.h"
#include "meow_ui_internal.h"
#include "meow_ui_sys.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
(void)argc;
meow_ui_opts o = { 480, 720 };
if (meow_ui_init(&o) != 0) { printf("init failed\n"); return 1; }
meow_ui_sys_set_system_mode(1);
meow_ui_set_statusbar(1);
/* 喂权威快照(模拟 launcher):电量81/充电/音量60/蓝牙连/WiFi已连-50(强)/亮度100 */
meow_ui_feed f;
memset(&f, 0, sizeof f);
f.batt = 81; f.charging = 1; f.wifi_on = 1; f.wifi_connected = 1; f.wifi_level = -50;
f.bt_seen = 1; f.bt_on = 1; f.vol = 60; f.brightness = 100;
meow_ui_sys_feed(&f);
/* 清整屏(背景)→ 画状态栏 → 把 top 28 行 + 一点内容区 dump 成 PPM */
meow_ui_clear(0x141824);
meow_ui_sys_statusbar_render();
const char *path = argv[1] ? argv[1] : "/tmp/sb_statusbar.ppm";
FILE *fp = fopen(path, "wb");
if (!fp) { printf("cannot open %s\n", path); return 1; }
int w = 480, h = 480; /* 宽 x 全屏高,看顶条+背景 */
fprintf(fp, "P6\n%d %d\n255\n", w, h);
unsigned char *bb = meow_ui_back_buf();
for (int ry = 0; ry < h; ry++) {
for (int cx = 0; cx < w; cx++) {
uint16_t p = *(uint16_t *)(bb + (size_t)ry * (size_t)(w * 2) + (size_t)cx * 2);
int r = ((p >> 11) & 0x1F) << 3;
int g = ((p >> 5) & 0x3F) << 2;
int b = (p & 0x1F) << 3;
fputc(r, fp); fputc(g, fp); fputc(b, fp);
}
}
fclose(fp);
printf("wrote %s (%dx%d)\n", path, w, h);
return 0;
}