- M7 launcher 重写 5 期(虚拟化宫格/meow_theme 单一权威/横幅动画/自定义 PIN 键盘) - OOM 通用化(cachegov 上收 SDK)、自动切歌根治、meowpanel jv_free 泄漏修复、Hello 滚动卡顿修复 - ncm 歌词 UI / 媒体通知封面 / 封面分辨率 640 - 5 bug 修复:ncm 后台化 UI 叠层+点击穿透、再进 ncm 桌面叠层、播放页新旧 UI 叠层抢刷脏区(meow_ui_gfx 恢复边沿整帧重画)、PIN 亮屏亮度跳(keys.c meow_panel_on 按 settings_brightness_clamped 恢复)、通知中心封面显歌单封面(cover.c save_cover_raw 加 is_song + 命中块守卫) - 四 App 统一重链新 meow_ui.a 51caee4a;M6.19=0.8.19 固件 2d2331f2 推卡自刷验收全绿
69 lines
2.1 KiB
C
69 lines
2.1 KiB
C
/* app.c — os.meow.reader 应用装配层:main + 初始化 + 事件分发。
|
||
*
|
||
* 职责(SDK_VIEW_FRAMEWORK_DESIGN.md §B.2):main 只做 init/建页/跑事件循环/清理;把
|
||
* meow_ui_run 的平铺输入回调(key/tap/swipe/tick/touch)路由到当前活动页(shelf/reader)。
|
||
* 页面切换走 meow_view_page_push/pop(on_enter/on_leave 唯一入口)。
|
||
*/
|
||
#include "reader_internal.h"
|
||
#include "meow_ui_internal.h" /* 阅读页 blit 需要 back_buf 访问器(决策见报告) */
|
||
#include <signal.h>
|
||
|
||
static meow_view *g_shelf_view;
|
||
static meow_view *g_reader_view;
|
||
|
||
static void on_sigterm(int s) { (void)s; meow_ui_request_exit(); }
|
||
|
||
static void app_on_key(int keycode, int is_down) { (void)keycode; (void)is_down; }
|
||
|
||
static void app_on_tap(int x, int y)
|
||
{
|
||
if (reader_is_active()) { reader_on_tap(x, y); return; }
|
||
shelf_on_tap(x, y);
|
||
}
|
||
|
||
static void app_on_swipe(int dir, int dx, int dy)
|
||
{
|
||
(void)dy; (void)dx;
|
||
if (reader_is_active()) { reader_on_swipe(dir, dx, dy); return; }
|
||
if (dir == MEOW_SWIPE_LEFT) { meow_ui_request_exit(); }
|
||
}
|
||
|
||
static void app_on_tick(void)
|
||
{
|
||
uint64_t now = meow_ui_time_ms();
|
||
if (reader_is_active()) { reader_on_tick(now); return; }
|
||
}
|
||
|
||
static void app_on_touch_down(int x, int y)
|
||
{
|
||
if (reader_is_active()) { reader_on_touch_down(x, y); return; }
|
||
}
|
||
static void app_on_touch_move(int x, int y)
|
||
{
|
||
if (reader_is_active()) { reader_on_touch_move(x, y); return; }
|
||
}
|
||
|
||
int main(void)
|
||
{
|
||
meow_log(MEOW_LOG_INFO, "start");
|
||
meow_ui_opts o = { 480, 720 };
|
||
if (meow_ui_init(&o) != 0) { meow_log(MEOW_LOG_ERROR, "init failed"); return 1; }
|
||
meow_theme_add_listener(NULL);
|
||
signal(SIGTERM, on_sigterm);
|
||
|
||
g_shelf_view = shelf_view_create();
|
||
g_reader_view = reader_view_create();
|
||
|
||
meow_view_page_push(ACT_SHELF);
|
||
|
||
meow_ui_events ev = { app_on_key, app_on_tap, app_on_swipe, app_on_tick,
|
||
NULL, app_on_touch_down, app_on_touch_move };
|
||
meow_ui_run(&ev);
|
||
|
||
meow_view_free(g_reader_view);
|
||
meow_view_free(g_shelf_view);
|
||
meow_ui_shutdown();
|
||
meow_log(MEOW_LOG_INFO, "exit");
|
||
return 0;
|
||
}
|