39 lines
877 B
C
39 lines
877 B
C
#ifndef OS_APP_H
|
|
#define OS_APP_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include "esp_err.h"
|
|
#include "os_input.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct {
|
|
const char *id;
|
|
const char *name;
|
|
void (*init)(void);
|
|
void (*enter)(void);
|
|
void (*update)(uint32_t delta_ms);
|
|
void (*handle_input)(input_action_t action);
|
|
void (*exit)(void);
|
|
} sys_app_t;
|
|
|
|
esp_err_t sys_app_init(void);
|
|
esp_err_t sys_app_register(const sys_app_t *app);
|
|
esp_err_t sys_app_launch_by_id(const char *id);
|
|
esp_err_t sys_app_launch_by_index(size_t index);
|
|
void sys_app_launch_launcher(void);
|
|
const sys_app_t *sys_app_get_current(void);
|
|
void sys_app_update(uint32_t delta_ms);
|
|
void sys_app_dispatch_input(input_action_t action);
|
|
size_t sys_app_get_count(void);
|
|
const sys_app_t *sys_app_get_by_index(size_t index);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // OS_APP_H
|