ZEReader 0.1.0
A Zephyr-based E-Book-Reader
Loading...
Searching...
No Matches
event_handler.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Anna-Lena Marx <mail@marx.engineer>
3 *
4 * SPDX-License-Identifier: MPL-2.0
5 */
6
7#ifndef _EVENT_HANDLER_H_
8#define _EVENT_HANDLER_H_
9
10#include <stdint.h>
11#include <zephyr/drivers/gpio.h>
12#include <ui/context/context.h>
13
21
80
84typedef struct
85{
93 union
94 {
98 struct
99 {
100 uint32_t id;
101 } selected;
105 struct
106 {
107 context_t *context;
108 } context;
112 struct
113 {
114 const struct gpio_dt_spec *pin;
115 } shutdown;
119 struct
120 {
121 size_t scroll_pos;
122 } save_state;
123 } data;
125
131void app_post_event(const app_event_t *event);
132
140
142#endif /* _EVENT_HANDLER_H_ */
The UI's context.
void app_events_init(void)
Initialize the application event system.
void app_post_event(const app_event_t *event)
Post an application event.
application_event_t
Represents possible events within the ZEReader application.
Definition event_handler.h:26
@ APP_EVENT_NONE
Definition event_handler.h:30
@ APP_EVENT_SAVE_STATE
Definition event_handler.h:74
@ APP_EVENT_EPUB_INIT
Definition event_handler.h:34
@ APP_EVENT_RESTORE_BOOK
Definition event_handler.h:38
@ APP_EVENT_SHOW_CHAPTERMENU
Definition event_handler.h:70
@ APP_EVENT_SHOW_BOOKMENU
Definition event_handler.h:66
@ APP_EVENT_NEXT_PAGE
Definition event_handler.h:62
@ APP_EVENT_SHUTDOWN
Definition event_handler.h:78
@ APP_EVENT_PREV_CHAPTER
Definition event_handler.h:50
@ APP_EVENT_NEXT_CHAPTER
Definition event_handler.h:54
@ APP_EVENT_BOOK_SELECTED
Definition event_handler.h:42
@ APP_EVENT_PREV_PAGE
Definition event_handler.h:58
@ APP_EVENT_CHAPTER_SELECTED
Definition event_handler.h:46
context_t
UI context definition.
Definition context.h:22
Represents an application event.
Definition event_handler.h:85
application_event_t type
Definition event_handler.h:89