Muteki
EABI code execution on Besta® RTOS devices.
Loading...
Searching...
No Matches
button.h
Go to the documentation of this file.
1/*
2 * Copyright 2024-2026 dogtopus
3 * SPDX-License-Identifier: MIT
4 */
5
10
11#ifndef __MUTEKI_UI_TYPES_BUTTON_H__
12#define __MUTEKI_UI_TYPES_BUTTON_H__
13
14#include "framework.h"
15#include "text_layout.h"
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
38
44static inline unsigned int ui_button_layout_from_text_layout(enum ui_text_layout_e text_layout) {
45 return ((unsigned int) text_layout) << 22;
46}
47
51typedef struct ui_button_s ui_button_t;
52
64 void (*on_draw_content)(ui_button_t *self); // 0x34:0x38
69 ui_button_t *self,
70 short x0,
71 short y0,
72 short x1,
73 short y1,
74 unsigned short button_flags,
75 unsigned short state
76 ); // 0x38:0x3c
82 int key_binding; // 0x3c:0x40
86 unsigned int event; // 0x40:0x44
90 const UTF16 *label; // 0x44:0x48
94 const char *key_binding_str; // 0x48:0x4c
98 int unk_0x4c; // 0x4c:0x50
103 unsigned int next_visual_state; // 0x50:0x54
112 unsigned int content_layout; // 0x54:0x58
116 short horizontal_padding; // 0x58:0x5a
121 unsigned short button_flags; // 0x5a:0x5c
125 unsigned int user_data; // 0x5c:0x60
126}; // 0x60 bytes
127
128#ifdef __cplusplus
129} // extern "C"
130#endif
131
132#endif // __MUTEKI_UI_TYPES_BUTTON_H__
#define UTF16
"Portable" Besta UTF-16 type used by other headers.
Definition common.h:54
UI framework type (component, group, event) definitions.
struct ui_component_s ui_component_t
ui_component_s
Definition framework.h:71
Button widget struct.
Definition button.h:56
int unk_0x4c
Unknown. Probably padding bytes.
Definition button.h:98
unsigned short button_flags
Style flags.
Definition button.h:121
unsigned int next_visual_state
Visual state.
Definition button.h:103
void(*) on_draw_content(ui_button_t *self)
Draw the button content.
Definition button.h:64
unsigned int event
Custom event to be sent on button press.
Definition button.h:86
ui_component_t component
The inherited component struct.
Definition button.h:60
const UTF16 * label
Button label text.
Definition button.h:90
unsigned int user_data
Reserved for subtype use.
Definition button.h:125
void(*) on_draw_border(ui_button_t *self, short x0, short y0, short x1, short y1, unsigned short button_flags, unsigned short state)
Draw the button border.
Definition button.h:68
short horizontal_padding
Number of horizontal padding pixels.
Definition button.h:116
unsigned int content_layout
Text layout of the button label.
Definition button.h:112
const char * key_binding_str
Human-readable label of key binding (can be NULL).
Definition button.h:94
int key_binding
Key binding.
Definition button.h:82
Text layout common constants.
ui_text_layout_e
Text layout types.
Definition text_layout.h:22
struct ui_button_s ui_button_t
Button widget type.
Definition button.h:51
static unsigned int ui_button_layout_from_text_layout(enum ui_text_layout_e text_layout)
Convert a ui_text_layout_e member to a ui_button_t::content_layout value.
Definition button.h:44
ui_button_visual_state_e
Valid button visual states.
Definition button.h:24
@ UI_BUTTON_VS_UNCHANGED
Do nothing and keep the current on-screen state.
Definition button.h:36
@ UI_BUTTON_VS_PRESSED
Redraw the button as pressed down.
Definition button.h:32
@ UI_BUTTON_VS_RELEASED
Redraw the button as released/not pressed down.
Definition button.h:28