core: 定义按键和鼠标事件

This commit is contained in:
2026-03-16 00:03:22 +08:00
parent 58d1b09203
commit 4c96f2a1db
15 changed files with 623 additions and 362 deletions

View File

@@ -25,7 +25,8 @@ typedef struct wm_interaction_state_t {
typedef struct wm_runtime_bootstrap_t {
/*
* 输出配置(启动时扫描显示器后填充)
* 输出配置(启动时扫描显示器后填充)
* 这是 bootstrap 后固定的 output 集合。
*/
const wm_output_t *outputs;
size_t output_count;
@@ -33,16 +34,19 @@ typedef struct wm_runtime_bootstrap_t {
/*
* 工作区配置(已绑定 output
* workspace.output_id 指向 outputs 中的某个输出
* 这是 bootstrap 后固定的 workspace 集合。
*/
const wm_workspace_t *workspaces;
size_t workspace_count;
/*
* 布局算法注册
* 布局算法注册
* layout registry 在 bootstrap 后固定;运行时只切换 workspace.layout_id。
*/
struct {
wm_layout_fn fn;
const char *name;
const char *symbol;
} *layouts;
size_t layout_count;
@@ -67,7 +71,7 @@ typedef struct wm_runtime_bootstrap_t {
size_t initial_command_count;
} wm_runtime_bootstrap_t;
// 运行时上下文(实现时采用不透明结构体,此定义仅作参考)
// 当前草案直接展示 runtime 结构,便于讨论;实现阶段可再封装
typedef struct wm_runtime_t {
bool running;
@@ -88,8 +92,8 @@ bool wm_runtime_register_service(wm_runtime_t *runtime, wm_service_t service);
/*
* 处理单个事件,方便做无平台依赖的单元测试。
* 元数据事件允许 runtime 直接更新 auxiliary store控制状态变更仍经由
* route_event() + apply_command()。
* 元数据事件允许 runtime 直接更新 wm_window_t 中的元数据字段;
* 控制状态变更仍经由 route_event() + apply_command()。
*/
bool wm_runtime_process_event(wm_runtime_t *runtime, const wm_event_t *event);