Muteki
EABI code execution on Besta® RTOS devices.
Loading...
Searching...
No Matches
framework.h
Go to the documentation of this file.
1/*
2 * Copyright 2024-2026 dogtopus
3 * SPDX-License-Identifier: MIT
4 */
5
10#ifndef __MUTEKI_UI_TYPES_FRAMEWORK_H__
11#define __MUTEKI_UI_TYPES_FRAMEWORK_H__
12
14#include "event.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
69
87typedef struct ui_group_s ui_group_t;
88
89#if defined(MUTEKI_HAS_PRIME_UI_EVENT) && MUTEKI_HAS_PRIME_UI_EVENT == 1
90#define ui_event_s ui_event_prime_s
92typedef struct ui_event_prime_s ui_event_t;
93#else
94#define ui_event_s ui_event_std_s
97#endif
98
110 ui_component_t *next; // 0x0:0x4
120 unsigned short state; // 0x8:0xa
125 unsigned short flags; // 0xa:0xc
135 void (*on_set_state)(ui_component_t *self, unsigned short mask, bool value); // 0x14:0x18
141 void (*on_erase_bg)(ui_component_t *self); // 0x18:0x1c
146 void (*on_draw)(ui_component_t *self); // 0x1c:0x20
151 void (*on_event)(ui_component_t *self, ui_event_t *event); // 0x20:0x24
155 void *user_data; // 0x24:0x2a
159 unsigned short tag;
163 unsigned short runtime_type; // 0x2a:0x2c
167 int unk_0x2c; // 0x2c:0x30
171 unsigned short unk_0x30; // 0x30:0x32
175 short unk_0x32; // 0x32:0x34
176};
177
179
182struct ui_group_s {
184 * @brief @x_term{superc}
185 */
190 ui_component_t *current; // 0x34:0x38
195 int (*on_exec)(ui_group_t *self); // 0x38:0x3c
200 void (*on_redraw)(ui_group_t *self); // 0x3c:0x40
205 ui_component_t *(*on_find_previous)(ui_group_t *self); // 0x40:0x44
210 ui_component_t *(*on_set_current)(ui_group_t *self, ui_component_t *child); // 0x44:0x48
215 void (*on_insert)(ui_group_t *self, ui_component_t *child); // 0x48:0x4c
222 int execution_result; // 0x4c:0x50
223};
224
225
227
234 * @see ui_event_type_e List of event types.
235 */
236 unsigned int type;
240 unsigned short finger_id;
241 union {
242 struct {
244 * @brief Keycode for the first pressed key.
245 */
246 unsigned short key_code0;
250 unsigned short key_code1;
251 };
252 struct {
255
255 * @details Only available when ui_multipress_event_s::type is
256 * ::UI_EVENT_TYPE_TOUCH_BEGIN,
257 * ::UI_EVENT_TYPE_TOUCH_MOVE, or ::UI_EVENT_TYPE_TOUCH_END.
258 */
259 unsigned short touch_x;
266 unsigned short touch_y;
267 };
268 };
271
272 unsigned short unk_0xb;
273};
274
277
279struct ui_event_ext_s {
280 union {
282 * @brief Extra user data.
283 * @details Format is event-specific. Usually unused.
284 */
285 void *user_data2; // 12-16 pointer that only shows up on USB insertion event.
289 unsigned int user_data2_scalar;
290 };
294
297 unsigned short event_source; // 20-22
301 unsigned short unk22; // 22-24
302};
303
307
308 unsigned short available_multipress_events; // 24-26
312 unsigned short unk_0x1a; // 26-28
317};
318
322
323struct ui_event_sys_s {
327 * widget's ui_component_t::on_event callback will be called with this event.
328 * @note Unused in system events.
329 */
335 int event_type;
336 union {
340 unsigned int value;
341 struct {
345 */
346 unsigned short key_code0;
353 unsigned short key_code1;
354 };
355 struct {
359
359 * ::UI_EVENT_TYPE_TOUCH_MOVE, or ::UI_EVENT_TYPE_TOUCH_END.
360 */
361 unsigned short touch_x;
367 unsigned short touch_y;
368 };
369 };
370 union {
373
374
374 */
375 void *user_data; // 12-16 pointer that only shows up on USB insertion event.
379 unsigned int user_data_scalar;
384 unsigned int scroll_wheel;
385 };
386};
387
390
391
392struct ui_event_std_s {
406
407struct ui_event_prime_s {
429 ui_event_t event; // 0x0:0x18
434 unsigned int state_change; // 0x18:0x1c
435}; // 0x1c bytes
436
437#ifdef __cplusplus
438} // extern "C"
439#endif
440
441#endif // __MUTEKI_UI_TYPES_FRAMEWORK_H__
struct ui_group_s ui_group_t
ui_group_s
Definition framework.h:87
struct ui_event_std_s ui_event_t
ui_event_std_s
Definition framework.h:96
struct ui_event_prime_s ui_event_prime_t
ui_event_prime_s
Definition framework.h:75
struct ui_event_ext_prime_s ui_event_ext_prime_t
ui_event_ext_prime_s
Definition framework.h:79
struct ui_event_state_change_s ui_event_state_change_t
ui_event_state_change_s
Definition framework.h:83
struct ui_event_std_s ui_event_std_t
ui_event_std_s
Definition framework.h:73
struct ui_event_ext_s ui_event_ext_t
ui_event_ext_s
Definition framework.h:77
struct ui_component_s ui_component_t
ui_component_s
Definition framework.h:71
ui_component_flag_e
Component behavior flag. Usually set by the component constructors but can sometimes change over time...
Definition framework.h:24
@ UI_COMPONENT_FLAG_FOCUS_TERMINAL
Component is a terminal node when resolving focusable items in a container.
Definition framework.h:34
@ UI_COMPONENT_FLAG_FOCUS_SKIP
Skip this component when searching for the next component to gain focus.
Definition framework.h:38
@ UI_COMPONENT_FLAG_DESKBOX_ALLOW_HOME_KEY
Deskbox-specific: Bubble KEY_HOME presses to system.
Definition framework.h:43
@ UI_COMPONENT_FLAG_GROUP_NO_AUTO_DRAW
Group-specific: Do not periodically draw this group.
Definition framework.h:63
@ UI_COMPONENT_FLAG_DESKBOX_ALLOW_SEARCH_KEYS
Deskbox-specific: Bubble translator and search key presses to system.
Definition framework.h:55
@ UI_COMPONENT_FLAG_DESKBOX_ALLOW_SYSTEM_EVENTS
Deskbox-specific: Handle system events and exit word.
Definition framework.h:47
@ UI_COMPONENT_FLAG_GROUP_ALLOW_EXIT_WORD
Group-specific: Handle exit word.
Definition framework.h:51
@ UI_COMPONENT_FLAG_DESKBOX_ALLOW_APP_KEYS
Deskbox-specific: Bubble app key presses to system.
Definition framework.h:67
@ UI_COMPONENT_FLAG_DESKBOX_ALLOW_INLINE_SEARCH
Deskbox-specific: Invoke the inline search modal with the selected text instead of the normal search ...
Definition framework.h:59
@ UI_COMPONENT_FLAG_SELECTABLE
Component is selectable.
Definition framework.h:29
struct ui_multipress_event_s ui_multipress_event_t
ui_multipress_event_s
Definition framework.h:85
struct ui_event_sys_s ui_event_sys_t
ui_event_sys_s
Definition framework.h:81
Drawing routine primitive types.
struct lcd_rect_s lcd_rect_t
Rectangle used to represent usable drawing area in an LCD descriptor.
Common part of all widgets and modals.
Definition framework.h:104
void(*) on_erase_bg(ui_component_t *self)
Component callback for erasing background.
Definition framework.h:141
int unk_0x2c
Unknown.
Definition framework.h:167
ui_component_t * parent
Parent component.
Definition framework.h:115
unsigned short flags
Component behavior bit field.
Definition framework.h:125
unsigned short runtime_type
Unknown. Set to 0x65 on buttons.
Definition framework.h:163
unsigned short unk_0x30
Unknown.
Definition framework.h:171
unsigned short tag
Component tag. Can be used to distinguish components under some circumstances (like when sharing a ca...
Definition framework.h:159
short unk_0x32
Unknown. Probably padding bytes.
Definition framework.h:175
lcd_rect_t footprint
Component visual footprint.
Definition framework.h:130
void(*) on_event(ui_component_t *self, ui_event_t *event)
Component event callback.
Definition framework.h:151
void * user_data
User data pointer. Content is component-specific.
Definition framework.h:155
ui_component_t * next
Next component in a component ring or list.
Definition framework.h:110
void(*) on_set_state(ui_component_t *self, unsigned short mask, bool value)
Component state change callback.
Definition framework.h:135
void(*) on_draw(ui_component_t *self)
Component draw callback.
Definition framework.h:146
unsigned short state
Component state bit field.
Definition framework.h:120
Definition framework.h:308
ui_multipress_event_t multipress_events[8]
The multipress events.
Definition framework.h:320
unsigned short available_multipress_events
Number of valid multipress events available for processing.
Definition framework.h:312
unsigned short unk_0x1a
Unknown. Sometimes can be 0x2 on startup.
Definition framework.h:316
Main event struct extension.
Definition framework.h:282
unsigned short unk22
Unknown. Seems unused.
Definition framework.h:301
unsigned short event_source
Seems to be tied to where the event comes from.
Definition framework.h:300
Structure for low level UI events (Prime G1 extension).
Definition framework.h:411
ui_event_sys_t body
Event body.
Definition framework.h:415
ui_event_ext_t ext
Extended main event data.
Definition framework.h:419
ui_event_ext_prime_t ext_prime
HP Prime multitouch extension.
Definition framework.h:423
Event struct used by SendMessage().
Definition framework.h:429
ui_event_t event
The event struct.
Definition framework.h:433
unsigned int state_change
State change value.
Definition framework.h:438
Structure for UI events.
Definition framework.h:396
ui_event_sys_t body
Event body.
Definition framework.h:400
ui_event_ext_t ext
Extended main event data.
Definition framework.h:404
unsigned short key_code0
Keycode for the first pressed key.
unsigned short key_code1
Keycode for the second pressed key.
unsigned short touch_x
The X coordinate of where the touch event is located, in pixels.
unsigned short touch_y
The Y coordinate of where the touch event is located, in pixels.
Common struct subset shared across system and main events.
Definition framework.h:327
int event_type
The type of event (0x10 being key event).
Definition framework.h:339
ui_component_t * recipient
Event recipient.
Definition framework.h:334
UI component group/container struct.
Definition framework.h:184
int execution_result
Execution result.
Definition framework.h:222
ui_component_t * current
The current head item.
Definition framework.h:190
void(*) on_redraw(ui_group_t *self)
Redraw callback.
Definition framework.h:200
void(*) on_insert(ui_group_t *self, ui_component_t *child)
Insert a new component after ui_group_s::on_find_previous.
Definition framework.h:215
ui_component_t component
The inherited component struct.
Definition framework.h:186
int(*) on_exec(ui_group_t *self)
Execute callback.
Definition framework.h:195
unsigned short key_code1
Keycode for the second pressed key (maybe unused).
unsigned short touch_y
The Y coordinate of where the touch event is located, in pixels.
unsigned short touch_x
The X coordinate of where the touch event is located, in pixels.
Multipress/multitouch event.
Definition framework.h:234
unsigned short unk_0xb
Unknown. Maybe unused and probably padding.
Definition framework.h:275
unsigned short finger_id
Finger ID of a touch event.
Definition framework.h:243
unsigned int type
Type of event.
Definition framework.h:239
Event constants.
unsigned int user_data2_scalar
Extra user data as a scalar value.
void * user_data2
Extra user data.
unsigned int value
Raw value of the event.
unsigned int scroll_wheel
Scroll wheel direction, either SCROLL_DOWN or SCROLL_UP.
unsigned int user_data_scalar
User data as a scalar value.