refactor: 添加中文注释 + 优化模块结构
- 给全部 78 个 Swift 源文件添加详细的中文注释(文件级、类级、方法级) - 删除 LegacyRDReaderController/ 死代码目录(16 文件 4592 行) - 根目录翻页容器文件移入 ReaderView/ 目录 - Resources/ 移入 EPUBCore/Resources/(与使用者归属一致) - RDEPUBTextIndexTable.swift 移入 EPUBTextRendering/(消除反向依赖) - RDURLReaderController.swift 移入 EPUBUI/(入口控制器归入 UI 层) - 更新 podspec 资源路径
This commit is contained in:
@@ -1,13 +1,33 @@
|
||||
//
|
||||
// RDEPUBNavigatorState.swift
|
||||
// RDReaderView
|
||||
//
|
||||
// EPUBCore 层导航状态机定义文件。
|
||||
// 定义了阅读器导航器的状态枚举,状态流转遵循:
|
||||
// initializing → loading → idle ↔ jumping/moving/repaginating
|
||||
// 由 RDEPUBReadingSession 管理状态跃迁,控制分页快照的应用时机。
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// 导航状态枚举,描述阅读器的当前操作状态
|
||||
/// 状态机流转:initializing → loading → idle ↔ jumping/moving/repaginating
|
||||
public enum RDEPUBNavigatorState: String, Codable {
|
||||
/// 初始化状态,刚打开书籍,等待初始恢复位置
|
||||
case initializing
|
||||
/// 加载状态,正在生成首轮分页模型
|
||||
case loading
|
||||
/// 空闲状态,显示稳定,可接受用户操作和快照应用
|
||||
case idle
|
||||
/// 跳转状态,正在执行目录/内部链接跳转
|
||||
case jumping
|
||||
/// 翻页状态,用户正在翻页操作中
|
||||
case moving
|
||||
/// 重排状态,正在重新分页(字号/横竖屏变化触发)
|
||||
case repaginating
|
||||
|
||||
/// 是否处于可应用分页快照的稳定状态
|
||||
/// 只有 idle 状态才允许消费 staged snapshot
|
||||
public var isStableForSnapshotApplication: Bool {
|
||||
self == .idle
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user