- meow_ui.h(922 行)改为伞头:只做 #include 聚合 + 模块索引,不定义新 API。 - 新增 patch_v2/sdk/include/ 16 个子头(types/draw/image/theme/ime/widgets/input/ activity/zorder/statusbar/dialog/log/notify/config/font/audio),各自自洽可单独 include, 依赖最小化(不透明句柄前向声明 + 必要模块互引)。 - 验证:meow_ui.a md5 与主树完全一致(4786158d…,头重组 .o 逐字节等价); SDK .c 用 mipsel -Wall -Wextra 0 warning;hello/files 全量重编链接通过 (-Wall -Wextra 0 warning);宿主 test_p1p2p3_repro(P1c/P2/P3 ALL PASS) + 15 个 SDK/宿主测试 PASS;16 子头自洽编译 0 warning;伞头完整性回归 test_umbrella.c 0 warning;ncm 5 个含 meow_ui.h TÜ mipsel 交叉编译到 .o 0 warning。 - meow_ui_internal.h 及 view/nav/media/sys/vol 子头未动;build_sdk.sh 无需改。 - MEOW_APP_SDK.md 头部新增「公共头模块索引」。分支 sdk-header-split。
85 lines
4.7 KiB
C
85 lines
4.7 KiB
C
/*
|
||
* test_umbrella.c — 伞头完整性回归:只 #include "meow_ui.h",抽查各模块代表性声明
|
||
* (类型 / 函数 / 宏)都存在。头拆分后用来证明伞头聚合无遗漏、签名未变。
|
||
* 用法:gcc -std=c11 -Wall -Wextra -I<sdk> -c test_umbrella.c -o test_umbrella.o
|
||
* (纯声明级检查,不链接、不调用;产生可执行代码仍 0 warning)。
|
||
*/
|
||
#include "meow_ui.h"
|
||
|
||
#include <stddef.h>
|
||
|
||
/* ---- 类型形状 _Static_assert(编译期)---- */
|
||
_Static_assert(sizeof(meow_ui_opts) == 2 * sizeof(int), "meow_ui_opts shape");
|
||
_Static_assert(sizeof(meow_theme) > sizeof(uint32_t), "meow_theme shape");
|
||
_Static_assert(offsetof(meow_theme, bg) == 0, "meow_theme.bg at 0");
|
||
_Static_assert(offsetof(meow_ime_ctx, buf) == sizeof(meow_ime_mode), "meow_ime_ctx.buf offset");
|
||
_Static_assert(offsetof(meow_list_item, title) > 0, "meow_list_item layout");
|
||
_Static_assert(sizeof(meow_notify) > sizeof(void *), "meow_notify shape");
|
||
_Static_assert(sizeof(meow_audio_state) > 0, "meow_audio_state shape");
|
||
_Static_assert(sizeof(meow_widget_opts) > 0, "meow_widget_opts shape");
|
||
|
||
/* ---- 枚举/宏值 _Static_assert(编译期;值定格即防漂移)---- */
|
||
_Static_assert(MEOW_KEY_POWER == 116, "key power");
|
||
_Static_assert(MEOW_KEY_PREVIOUS == 165, "key previous");
|
||
_Static_assert(MEOW_SWIPE_DOWN == 3, "swipe down");
|
||
_Static_assert(MEOW_IME_PINYIN == 2, "ime pinyin");
|
||
_Static_assert(MEOW_THEME_DARK == 1, "theme dark");
|
||
_Static_assert(MEOW_STYLE_MIUIX == 1, "style miuix");
|
||
_Static_assert(MEOW_Z_TOP == 1000, "z top");
|
||
_Static_assert(MEOW_TOPBAR_BACK == (-2), "topbar back");
|
||
_Static_assert(MEOW_SBAR_HOTZONE_FS == 4, "sbar hotzone fs");
|
||
_Static_assert(MEOW_WS_PRESSED == (1u << 3), "ws pressed");
|
||
_Static_assert(MEOW_BTN_ELEVATED == 4, "btn elevated");
|
||
_Static_assert(MEOW_LAYOUT_BOX == 2, "layout box");
|
||
_Static_assert(MEOW_LIST_SEL_MULTI == 2, "list sel multi");
|
||
_Static_assert(MEOW_NOTIFY_CAT_MEDIA == 5, "notify cat media");
|
||
_Static_assert(MEOW_NOTIFY_URG_CRITICAL == 3, "notify urg critical");
|
||
_Static_assert(MEOW_NOTIFY_TIMEOUT_ONGOING == (-1), "notify ongoing");
|
||
_Static_assert(MEOW_LOG_ERROR == 3, "log error");
|
||
_Static_assert(MEOW_DLG_INPUT == 2, "dlg input");
|
||
_Static_assert(MEOW_FONT_TIER_FULL == 2, "font tier full");
|
||
_Static_assert(MEOW_CFG_ERR_NOENT == (-2), "cfg noent");
|
||
|
||
/* ---- 函数存在性检查(取址即要求已声明;未声明 → 编译错误)---- */
|
||
static void umbrella_smoke(void)
|
||
{
|
||
/* 绘制层(§3)+ 时间/刷新率(§7/§7.1) */
|
||
(void)&meow_ui_init; (void)&meow_ui_flush; (void)&meow_ui_fill_rect_alpha;
|
||
(void)&meow_ui_text_center; (void)&meow_ui_time_ms; (void)&meow_ui_effective_rate;
|
||
/* 图片层(§4) */
|
||
(void)&meow_img_load_file; (void)&meow_ui_img_cover; (void)&meow_img_w;
|
||
/* 主题(§8) */
|
||
(void)&meow_theme_get; (void)&meow_theme_defaults; (void)&meow_ui_set_style;
|
||
/* 输入法(§5.1) */
|
||
(void)&meow_ui_text_input; (void)&meow_ime_text; (void)&meow_ime_composition;
|
||
/* 控件层(§5/§5.8/§5.8.6/§5.5) */
|
||
(void)&meow_btn_create; (void)&meow_widget_custom_create; (void)&meow_row_create;
|
||
(void)&meow_topappbar_hit; (void)&meow_listview_create; (void)&meow_list_tap_at;
|
||
(void)&meow_widget_set_opts; (void)&meow_widget_state; (void)&meow_progress_set;
|
||
/* 输入层/生命周期(§6)+ 长按(§6.3) */
|
||
(void)&meow_ui_run; (void)&meow_ui_swipe_hint; (void)&meow_ui_set_long_press_cb;
|
||
/* Activity 栈(§6.1) */
|
||
(void)&meow_ui_activity_push; (void)&meow_ui_global_add; (void)&meow_ui_activity_depth;
|
||
/* 绘制物注册表 / z 序(§6.2) */
|
||
(void)&meow_widget_set_z; (void)&meow_draw_custom_register; (void)&meow_ui_invalidate;
|
||
(void)&meow_ui_paint_full; (void)&meow_ui_set_page_bg;
|
||
/* 状态栏 / 全屏(§3.1) */
|
||
(void)&meow_ui_set_statusbar; (void)&meow_ui_statusbar_height; (void)&meow_ui_statusbar_hotzone;
|
||
(void)&meow_ui_statusbar_set_collapsed;
|
||
/* 模态(§5.8.6 弹窗/面板) */
|
||
(void)&meow_dialog_create; (void)&meow_dialog_show; (void)&meow_sheet_open;
|
||
/* 日志(§9) */
|
||
(void)&meow_log; (void)&meow_log_get_level;
|
||
/* 通知(§9.1) */
|
||
(void)&meow_notify_send; (void)&meow_notify_category_str; (void)&meow_notify_update_progress;
|
||
/* 配置(§9.2) */
|
||
(void)&meow_config_dir; (void)&meow_config_int; (void)&meow_config_remove;
|
||
/* 字体(§5.7/§10) */
|
||
(void)&meow_font_enumerate; (void)&meow_font_tier; (void)&meow_font_select_by_id;
|
||
/* 音频(§11) */
|
||
(void)&meow_audio_open; (void)&meow_audio_query; (void)&meow_audio_on_preempt;
|
||
}
|
||
|
||
/* 供宿主回归驱动直接调用;不链接本库也没关系(纯地址丢弃)。 */
|
||
void test_umbrella_run(void) { umbrella_smoke(); }
|