microui  3.1.0
microui
microui_event_decoder.h
1 /*
2  * C
3  *
4  * Copyright 2021-2023 MicroEJ Corp. All rights reserved.
5  * Use of this source code is governed by a BSD-style license that can be found with this software.
6  */
7 
8 /*
9  * @file
10  * @brief See microui_event_decoder.c.
11  * @author MicroEJ Developer Team
12  * @version 3.1.0
13  * @since MicroEJ UI Pack 13.1.0
14  */
15 
16 #if !defined MICROUI_EVENT_DECODER_H
17 #define MICROUI_EVENT_DECODER_H
18 
19 // -----------------------------------------------------------------------------
20 // Includes
21 // -----------------------------------------------------------------------------
22 
23 #include <stdlib.h>
24 #include <stdint.h>
25 #include <stdbool.h>
26 
27 #include "microui_event_decoder_conf.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #ifdef MICROUIEVENTDECODER_ENABLED
34 
35 // -----------------------------------------------------------------------------
36 // Types
37 // -----------------------------------------------------------------------------
38 
39 /*
40  * @brief Function to decode the data of an event.
41  *
42  * @param[in] event the event that requires the data.
43  * @param[in] data the event data.
44  * @param[in] index the data index in queue.
45  */
46 typedef void (* MICROUI_EVENT_DECODER_decode_event_data) (uint32_t event, uint32_t data, uint32_t index);
47 
48 // -----------------------------------------------------------------------------
49 // API
50 // -----------------------------------------------------------------------------
51 
52 /*
53  * @brief Notifies the start of MicroUI FIFO dump.
54  */
55 void MICROUI_EVENT_DECODER_describe_dump_start(void);
56 
57 /*
58  * @brief Notifies the next logs are already consumed.
59  */
60 void MICROUI_EVENT_DECODER_describe_dump_past(void);
61 
62 /*
63  * @brief Notifies the next logs are not consumed yet.
64  */
65 void MICROUI_EVENT_DECODER_describe_dump_future(void);
66 
67 /*
68  * @brief Notifies the dump will log the Java objects associated with the events
69  * that are not consumed yet.
70  */
71 void MICROUI_EVENT_DECODER_describe_dump_events_objects(void);
72 
73 /*
74  * @brief Notifies the end of MicroUI FIFO dump.
75  */
76 void MICROUI_EVENT_DECODER_describe_dump_end(void);
77 
78 /*
79  * @brief Drops a data. This is an orphaned data of an old event already executed.
80  */
81 void MICROUI_EVENT_DECODER_drop_data(uint32_t data, uint32_t index);
82 
83 /*
84  * @brief Decodes an event.
85  *
86  * @param[in] event the 32-bit event.
87  * @param[in] index the event's index in queue.
88  * @param[out] fct_data_decoder function to decode the data of the event.
89  */
90 void MICROUI_EVENT_DECODER_decode_event(uint32_t event, uint32_t index, MICROUI_EVENT_DECODER_decode_event_data* fct_data_decoder);
91 
92 #endif // MICROUIEVENTDECODER_ENABLED
93 
94 // -----------------------------------------------------------------------------
95 // EOF
96 // -----------------------------------------------------------------------------
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 #endif // MICROUI_EVENT_DECODER_H