Files
MeowOS-SDK/meow_ui_activity.c
T
MeowOS 143c11ac94 M2.60→M2.61 骨架: SDK Activity 栈 + 控件归属(agent-122) + 按钮去圈/即时重绘(agent-119) + SDK 模板文档(agent-121)
- SDK §6.1 三层控件模型: Activity栈(push/pop/active) + 页面控件归属 owner + meow_ui_global_* 骨架(②) + 系统级仅内部接口(③)
- meow_widget 加 owner; live_btn_hit/meow_widget_hit 仅 active activity 命中; touch_refresh stale 保护
- 根治"全屏页触摸主页按钮闪现"(跨页面控件残留); 控件对象复用弹栈不重建
- hello 迁移双 Activity(home/full): 全屏左滑=弹栈回主页, 根左滑=退出
- agent-119 按钮去圈(纯色accent+黑12/24%)+即时局部重绘保留; agent-121 SDK模板§5.3-5.7
2026-08-30 15:27:10 +08:00

34 lines
1005 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* meow_ui_activity.c — Activity 栈(§6.1 ①)。
*
* 控件严格归属创建它的 Activity;命中/实时按压只在「当前 active Activity」的控件集里
* 生效(见 meow_ui_widget.c 的 owner 绑定 + live_btn_hit/meow_widget_hit 过滤)。
* 栈空时 active() 返回 0(根/default Activity)。
*
* 依赖:无(纯静态数组 + 无外部符号),宿主/真机均可链入,便于单测。
* 语义:push = 压栈(新 Activity 成为 active); pop = 弹栈(回上级,栈空则停在根 0)。
*/
#include "meow_ui.h"
#define MEOW_ACT_MAX 32
static int g_act[MEOW_ACT_MAX];
static int g_act_n = 0;
void meow_ui_activity_push(int id)
{
if (g_act_n >= MEOW_ACT_MAX)
return; /* 栈满:静默钳制(骨架级,不崩) */
g_act[g_act_n++] = id;
}
void meow_ui_activity_pop(void)
{
if (g_act_n > 0) g_act_n--;
}
int meow_ui_activity_active(void)
{
return g_act_n > 0 ? g_act[g_act_n - 1] : 0;
}