Muteki
EABI code execution on Besta® RTOS devices.
Toggle main menu visibility
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
18
extern
"C"
{
19
#endif
20
24
enum
ui_button_visual_state_e
{
28
UI_BUTTON_VS_RELEASED
= 0,
32
UI_BUTTON_VS_PRESSED
= 1,
36
UI_BUTTON_VS_UNCHANGED
= 10,
37
};
38
44
static
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
51
typedef
struct
ui_button_s
ui_button_t
;
52
56
struct
ui_button_s
{
60
ui_component_t
component
;
// 0x0:0x34
64
void (*
on_draw_content
)(
ui_button_t
*self);
// 0x34:0x38
68
void (*
on_draw_border
)(
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__
UTF16
#define UTF16
"Portable" Besta UTF-16 type used by other headers.
Definition
common.h:54
framework.h
UI framework type (component, group, event) definitions.
ui_component_t
struct ui_component_s ui_component_t
ui_component_s
Definition
framework.h:71
ui_button_s
Button widget struct.
Definition
button.h:56
ui_button_s::unk_0x4c
int unk_0x4c
Unknown. Probably padding bytes.
Definition
button.h:98
ui_button_s::button_flags
unsigned short button_flags
Style flags.
Definition
button.h:121
ui_button_s::next_visual_state
unsigned int next_visual_state
Visual state.
Definition
button.h:103
ui_button_s::on_draw_content
void(*) on_draw_content(ui_button_t *self)
Draw the button content.
Definition
button.h:64
ui_button_s::event
unsigned int event
Custom event to be sent on button press.
Definition
button.h:86
ui_button_s::component
ui_component_t component
The inherited component struct.
Definition
button.h:60
ui_button_s::label
const UTF16 * label
Button label text.
Definition
button.h:90
ui_button_s::user_data
unsigned int user_data
Reserved for subtype use.
Definition
button.h:125
ui_button_s::on_draw_border
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
ui_button_s::horizontal_padding
short horizontal_padding
Number of horizontal padding pixels.
Definition
button.h:116
ui_button_s::content_layout
unsigned int content_layout
Text layout of the button label.
Definition
button.h:112
ui_button_s::key_binding_str
const char * key_binding_str
Human-readable label of key binding (can be NULL).
Definition
button.h:94
ui_button_s::key_binding
int key_binding
Key binding.
Definition
button.h:82
text_layout.h
Text layout common constants.
ui_text_layout_e
ui_text_layout_e
Text layout types.
Definition
text_layout.h:22
ui_button_t
struct ui_button_s ui_button_t
Button widget type.
Definition
button.h:51
ui_button_layout_from_text_layout
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
ui_button_visual_state_e
Valid button visual states.
Definition
button.h:24
UI_BUTTON_VS_UNCHANGED
@ UI_BUTTON_VS_UNCHANGED
Do nothing and keep the current on-screen state.
Definition
button.h:36
UI_BUTTON_VS_PRESSED
@ UI_BUTTON_VS_PRESSED
Redraw the button as pressed down.
Definition
button.h:32
UI_BUTTON_VS_RELEASED
@ UI_BUTTON_VS_RELEASED
Redraw the button as released/not pressed down.
Definition
button.h:28
include
muteki
ui
types
button.h
Generated by
1.18.0