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
71
75typedef struct {
83 union {
87 struct {
88 uint32_t book_id;
89 } book_selected;
93 struct {
94 context_t *context;
95 } context;
99 struct {
100 const struct gpio_dt_spec *pin;
101 } shutdown;
105 struct {
106 size_t scroll_pos;
107 } save_state;
108 } data;
110
116void app_post_event(const app_event_t *event);
117
125
127#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:25
@ APP_EVENT_NONE
Definition event_handler.h:29
@ APP_EVENT_SAVE_STATE
Definition event_handler.h:65
@ APP_EVENT_EPUB_INIT
Definition event_handler.h:33
@ APP_EVENT_RESTORE_BOOK
Definition event_handler.h:37
@ APP_EVENT_SHOW_BOOKMENU
Definition event_handler.h:61
@ APP_EVENT_NEXT_PAGE
Definition event_handler.h:57
@ APP_EVENT_SHUTDOWN
Definition event_handler.h:69
@ APP_EVENT_PREV_CHAPTER
Definition event_handler.h:45
@ APP_EVENT_NEXT_CHAPTER
Definition event_handler.h:49
@ APP_EVENT_BOOK_SELECTED
Definition event_handler.h:41
@ APP_EVENT_PREV_PAGE
Definition event_handler.h:53
context_t
UI context definition.
Definition context.h:22
Represents an application event.
Definition event_handler.h:75
application_event_t type
Definition event_handler.h:79