core: 定义按键和鼠标事件
This commit is contained in:
@@ -1,17 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "wm_state.h"
|
||||
|
||||
typedef enum wm_service_event_type_t {
|
||||
WM_SERVICE_EVENT_NONE,
|
||||
WM_SERVICE_EVENT_RUNTIME_STARTED,
|
||||
WM_SERVICE_EVENT_RUNTIME_STOPPING,
|
||||
WM_SERVICE_EVENT_WINDOW_METADATA_CHANGED,
|
||||
WM_SERVICE_EVENT_STATUS_TICK,
|
||||
WM_SERVICE_EVENT_RENDER_OUTPUT,
|
||||
} wm_service_event_type_t;
|
||||
|
||||
typedef struct wm_service_event_t {
|
||||
wm_service_event_type_t type;
|
||||
union {
|
||||
struct {
|
||||
wm_window_id_t window_id;
|
||||
uint32_t changed_fields;
|
||||
} window_metadata_changed;
|
||||
|
||||
struct {
|
||||
wm_output_id_t output_id;
|
||||
} render_output;
|
||||
@@ -43,3 +52,6 @@ void wm_service_registry_shutdown(wm_service_registry_t *registry);
|
||||
|
||||
bool wm_service_registry_register(wm_service_registry_t *registry,
|
||||
wm_service_t service);
|
||||
void wm_service_registry_emit(wm_service_registry_t *registry,
|
||||
const wm_service_event_t *event,
|
||||
const wm_state_t *state);
|
||||
|
||||
Reference in New Issue
Block a user