11#ifndef __MUTEKI_UI_COMMON_H__
12#define __MUTEKI_UI_COMMON_H__
222 DASH_0_1_8_1_8_1_8_1_4_0 = 12,
223 DASH_4_1_8_1_7_1_9_1,
224 DASH_3_1_7_1_7_1_4_8,
225 DASH_3_1_7_1_7_1_7_1_4_0,
226 DASH_0_1_6_1_1_1_4_1_3_1_2_1_5_2_3_0,
227 DASH_3_2_5_1_2_1_3_1_4_1_1_1_6_1,
228 DASH_7_1_6_1_6_1_6_1_3_0,
229 DASH_3_1_6_1_6_1_6_1_7_0,
466 KEY_PRIME_APPS = 0xb1,
473 KEY_PRIME_DECIMAL_POINT,
572 KEY_SHIFT_PGUP = 0xe047,
573 KEY_PRIME_HOME = 0xe047,
574 KEY_SHIFT_PGDN = 0xe04f,
641 SANS_TINY_CJK_NORMAL = 0,
642 SANS_BOLD_TINY_CJK_NORMAL,
643 SANS_ITALIC_TINY_CJK_REGULAR_NORMAL,
644 SANS_BOLDITALIC_TINY_CJK_REGULAR_NORMAL,
646 SERIF_BOLD_SMALL_CJK,
647 SERIF_ITALIC_SMALL_CJK_REGULAR,
648 SERIF_BOLDITALIC_SMALL_CJK_REGULAR,
651 SERIF_ITALIC_CJK_REGULAR,
652 SERIF_BOLDITALIC_CJK_REGULAR,
654 SERIF_BOLD_LARGE_CJK,
655 SERIF_ITALIC_LARGE_CJK,
656 SERIF_BOLDITALIC_LARGE_CJK,
658 MONOSPACE_TINY_NOCJK,
663 SANS_BOLD_TINY_NOCJK,
664 SANS_ITALIC_TINY_NOCJK,
665 SANS_BOLDITALIC_TINY_NOCJK,
667 SERIF_BOLD_SMALL_CJK_26,
668 SERIF_ITALIC_SMALL_CJK_REGULAR_27,
669 SERIF_BOLDITALIC_SMALL_CJK_REGULAR_28,
672 SERIF_ITALIC_CJK_REGULAR_31,
673 SERIF_BOLDITALIC_CJK_REGULAR_32,
674 SERIF_HUGE_CJK_LARGE,
676 SERIF_ITALIC_HUGE_CJK_LARGE,
677 SANS_ITALIC_HUGE_CJK_LARGE,
708#if defined(MUTEKI_HAS_PRIME_UI_EVENT) && MUTEKI_HAS_PRIME_UI_EVENT == 1
709#define ui_event_s ui_event_prime_s
712#define ui_event_s ui_event_base_s
716#if defined(MUTEKI_HAS_THREAD_SAFE_LCD) && MUTEKI_HAS_THREAD_SAFE_LCD == 1
717#define lcd_s lcd_thread_safe_s
720#define lcd_s lcd_base_s
1311#define RGB_FROM_U8(r, g, b) ((r & 0xff) << 16 | ((g & 0xff) << 8) | (b & 0xff))
Common include file for all muteki-shims headers.
Critical section descriptor structure.
Definition threading.h:203
The LCD descriptor.
Definition common.h:901
int rotation
Current canvas rotation.
Definition common.h:932
lcd_cursor_t * cursor
Cursor states.
Definition common.h:923
lcd_rotate_callback_t rotate
Rotation callback.
Definition common.h:948
short depth_bytes
Integer size of each pixel in bytes.
Definition common.h:938
ui_rect_t drawing_area
Usable drawing area of the LCD.
Definition common.h:919
lcd_draw_t draw
Per-LCD states shared by drawing routines.
Definition common.h:913
void * pixel_end
End address of the pixel/framebuffer.
Definition common.h:905
size_t pixel_size
Total size of the pixel/framebuffer in bytes.
Definition common.h:907
short width
Width of the LCD in pixels.
Definition common.h:925
int unk_0x74[3]
Unknown.
Definition common.h:921
short xsize
Pixel row size in bytes.
Definition common.h:943
int transparent_color
Current transparent color.
Definition common.h:911
lcd_font_t font
Per-LCD states shared by specifically font rendering routines.
Definition common.h:915
short height
Height of the LCD in pixels.
Definition common.h:927
lcd_surface_t * surface
Surface linked to the LCD.
Definition common.h:903
lcd_cursor_t saved_cursor
A copy of the cursor states when the LCD descriptor was created.
Definition common.h:917
int bg_color
Current background color.
Definition common.h:909
Cursor states usually linked to an LCD descriptor.
Definition common.h:772
short x
X coordinate of the cursor.
Definition common.h:774
short type
Type of the cursor.
Definition common.h:783
short unk_0xe
Unknown.
Definition common.h:789
short unk_0xa
Unknown.
Definition common.h:785
unsigned int size
Size of the cursor.
Definition common.h:778
short y
Y coordinate of the cursor.
Definition common.h:776
short grab_count
Number of times this cursor has been locked/grabbed by other code.
Definition common.h:787
Drawing routine common states.
Definition common.h:810
int unk_0x18
Unknown.
Definition common.h:826
unsigned int stroke_dash_pattern
Dash bit pattern.
Definition common.h:816
int unk_0x14
Unknown.
Definition common.h:824
int unk_0x0
Unknown.
Definition common.h:812
short stroke_size
Size of stroke.
Definition common.h:818
short stroke_dash
Predefined dash pattern.
Definition common.h:820
int unk_0x10
Unknown.
Definition common.h:822
int fg_color
Current foreground color.
Definition common.h:814
int unk_0x1c
Unknown.
Definition common.h:828
Font rendering routine common states.
Definition common.h:834
short unk_0xa
Unknown.
Definition common.h:855
short type
Font type.
Definition common.h:839
short unk_0xc
Unknown.
Definition common.h:860
short height
Height of the font.
Definition common.h:841
short unk_0x6
Unknown.
Definition common.h:848
short unk_0x4
Unknown.
Definition common.h:846
short unk_0x8
Unknown.
Definition common.h:850
An extended part of the LCD descriptor that implements descriptor locking.
Definition common.h:869
int unk_0x0
Unknown.
Definition common.h:871
void(* lock)(void)
Shortcut to lock the descriptor.
Definition common.h:875
int unk_0xa4[23]
Unknown.
Definition common.h:879
critical_section_t * cs
A critical section descriptor. It's unclear where it is used.
Definition common.h:873
void(* unlock)(void)
Shortcut to unlock the descriptor.
Definition common.h:877
Descriptor of an LCD drawing surface or hardware framebuffer.
Definition common.h:728
int * palette
Palette used to pack RGBA color into pixels.
Definition common.h:761
short xsize
Pixel row size in bytes (aka. pitch if you know SDL).
Definition common.h:751
char magic[2]
Header magic.
Definition common.h:733
short height
Height of the framebuffer.
Definition common.h:741
short depth
Depth of the color in bits.
Definition common.h:746
short encoding
Pixel buffer encoding.
Definition common.h:756
short width
Width of the framebuffer.
Definition common.h:737
void * buffer
The actual framebuffer/surface pixel buffer region.
Definition common.h:766
A thread-safe variant of the LCD descriptor used on some versions of Besta RTOS.
Definition common.h:955
ui_rect_t drawing_area
Usable drawing area of the LCD.
Definition common.h:973
void(* unlock)(void)
Shortcut to unlock the descriptor.
Definition common.h:1010
lcd_surface_t * surface
Surface linked to the LCD.
Definition common.h:957
int transparent_color
Current transparent color.
Definition common.h:965
int bg_color
Current background color.
Definition common.h:963
lcd_draw_t draw
Per-LCD states shared by drawing routines.
Definition common.h:967
int rotation
Current canvas rotation.
Definition common.h:986
lcd_font_t font
Per-LCD states shared by specifically font rendering routines.
Definition common.h:969
critical_section_t * cs
A critical section descriptor. It's unclear where it is used.
Definition common.h:1006
int unk_0xa4[23]
Unknown.
Definition common.h:1012
short depth_bytes
Integer size of each pixel in bytes.
Definition common.h:992
int unk_0x94
Unknown.
Definition common.h:1004
int unk_0x74[3]
Unknown.
Definition common.h:975
lcd_cursor_t * cursor
Cursor states.
Definition common.h:977
void(* lock)(void)
Shortcut to lock the descriptor.
Definition common.h:1008
short height
Height of the LCD in pixels.
Definition common.h:981
size_t pixel_size
Total size of the pixel/framebuffer in bytes.
Definition common.h:961
void * pixel_end
End address of the pixel/framebuffer.
Definition common.h:959
lcd_rotate_callback_t rotate
Rotation callback.
Definition common.h:1002
short width
Width of the LCD in pixels.
Definition common.h:979
lcd_cursor_t saved_cursor
A copy of the cursor states when the LCD descriptor was created.
Definition common.h:971
short xsize
Pixel row size in bytes.
Definition common.h:997
Common part of all widgets and views.
Definition common.h:1236
int unk_0x2c
Unknown.
Definition common.h:1294
ui_component_t * parent
Parent component.
Definition common.h:1247
short unk_0x28
Unknown.
Definition common.h:1286
void(* on_erase_bg)(ui_component_t *self)
Component callback for erasing background.
Definition common.h:1270
unsigned short tag
Definition common.h:1298
ui_rect_t footprint
Component visual footprint.
Definition common.h:1261
short unk_0x2a
Unknown. Set to 0x65 on buttons.
Definition common.h:1290
short unk_0x32
Unknown. Probably padding.
Definition common.h:1302
void(* on_change_state)(ui_component_t *self, unsigned short mask, bool value)
Component state change callback.
Definition common.h:1265
short unk_0xa
Unknown. Set to 1 on buttons and 0xfd01 on deskbox views.
Definition common.h:1256
void(* on_event)(ui_component_t *self, ui_event_t *event)
Component event callback.
Definition common.h:1278
void(* on_draw)(ui_component_t *self)
Component draw callback.
Definition common.h:1274
void * unk_0x24
Unknown. Used in MessageBox().
Definition common.h:1282
ui_component_t * next
Next component in a component ring or list.
Definition common.h:1242
unsigned short state
Component state bit field.
Definition common.h:1252
Structure for low level UI events.
Definition common.h:1066
unsigned short touch_x
The X coordinate of where the touch event is located, in pixels.
Definition common.h:1099
void * unk20
Unknown.
Definition common.h:1131
unsigned int scroll_wheel
Scroll wheel direction, either SCROLL_DOWN or SCROLL_UP.
Definition common.h:1118
unsigned short touch_y
The Y coordinate of where the touch event is located, in pixels.
Definition common.h:1105
unsigned short key_code0
Keycode for the first pressed key.
Definition common.h:1084
unsigned short key_code1
Keycode for the second pressed key.
Definition common.h:1091
int event_type
The type of event (0x10 being key event)
Definition common.h:1077
ui_component_t * recipient
Event recipient.
Definition common.h:1072
void * unk16
Unknown.
Definition common.h:1125
void * usb_data
Unknown.
Definition common.h:1113
Structure for low level UI events (Prime G1 extension).
Definition common.h:1138
ui_component_t * recipient
Event recipient.
Definition common.h:1144
unsigned short touch_x
The X coordinate of where the touch event is located, in pixels.
Definition common.h:1171
ui_multipress_event_t multipress_events[8]
The multipress events.
Definition common.h:1214
unsigned short touch_y
The Y coordinate of where the touch event is located, in pixels.
Definition common.h:1177
unsigned short key_code0
Keycode for the first pressed key.
Definition common.h:1156
void * unk16
Unknown.
Definition common.h:1196
void * usb_data
Unknown.
Definition common.h:1185
unsigned short unk_0x1a
Unknown. Sometimes can be 0x2 on startup.
Definition common.h:1210
int event_type
The type of event (0x10 being key event)
Definition common.h:1149
void * unk20
Unknown.
Definition common.h:1202
unsigned short available_multipress_events
Number of valid multipress events available for processing.
Definition common.h:1206
unsigned short key_code1
Keycode for the second pressed key.
Definition common.h:1163
unsigned int scroll_wheel
Scroll wheel direction, either SCROLL_DOWN or SCROLL_UP.
Definition common.h:1190
Event struct used by SendMessage().
Definition common.h:1220
int unk_0x18
Unknown.
Definition common.h:1228
ui_event_t event
The event struct.
Definition common.h:1224
Multipress/multitouch event.
Definition common.h:1020
unsigned short unk_0xb
Unknown. Maybe unused and probably padding.
Definition common.h:1059
unsigned short touch_x
The X coordinate of where the touch event is located, in pixels.
Definition common.h:1047
unsigned short finger_id
Finger ID of a touch event.
Definition common.h:1029
unsigned short key_code1
Keycode for the second pressed key (maybe unused).
Definition common.h:1039
unsigned short touch_y
The Y coordinate of where the touch event is located, in pixels.
Definition common.h:1053
unsigned short key_code0
Keycode for the first pressed key.
Definition common.h:1035
unsigned int type
Type of event.
Definition common.h:1025
Rectangle used to represent usable drawing area in an LCD descriptor.
Definition common.h:796
short x1
Definition common.h:802
short y0
Definition common.h:800
short y1
Definition common.h:804
short x0
Definition common.h:798
scroll_wheel_e
Scroll wheel direction.
Definition common.h:581
@ SCROLL_DOWN
Scroll down (clockwise direction).
Definition common.h:585
@ SCROLL_UP
Scroll up (counter-clockwise direction).
Definition common.h:589
print_flag_e
Process flags for string and character printing.
Definition common.h:25
@ PRINT_NONE
No extra process.
Definition common.h:29
@ PRINT_UNDERSCORE_ONLY
Draw underscores only.
Definition common.h:43
@ PRINT_INVERT_ALT
Seems to be an alternative version of PRINT_INVERT.
Definition common.h:38
@ PRINT_INVERT
Invert colors.
Definition common.h:34
stroke_predefined_dash_e
Predefined dash patterns.
Definition common.h:210
@ DASH_NONE
Solid line.
Definition common.h:214
@ DASH_CUSTOM
Custom dash pattern.
Definition common.h:234
blit_flag_e
Process flags for blit operations.
Definition common.h:90
@ BLIT_XOR
Perform XOR operation between source line and destination line.
Definition common.h:111
@ BLIT_OR
Perform OR operation between source line and destination line.
Definition common.h:106
@ BLIT_ALPHA_BLENDING
Perform alpha blending (when supported).
Definition common.h:122
@ BLIT_AND
Perform AND operation between source line and destination line.
Definition common.h:100
@ BLIT_TRANSPARENT
Honor transparent color settings on the current LCD canvas.
Definition common.h:117
@ BLIT_NONE
Nothing.
Definition common.h:95
@ BLIT_ALPHA_BLENDING_FAST
Perform alpha blending (when supported).
Definition common.h:129
print_str_flag_e
Process flags for string printing only.
Definition common.h:49
@ PRINT_STR_ENCODING_BIG5
Assume text encoding to be BIG5 instead of UTF-16.
Definition common.h:54
@ PRINT_STR_ENCODING_TIS_620
Assume text encoding to be TIS-620 instead of UTF-16.
Definition common.h:62
@ PRINT_STR_ENCODING_GB18030
Assume text encoding to be GB18030 instead of UTF-16.
Definition common.h:58
font_type_e
Font types.
Definition common.h:640
rotation_value_e
Rotation values used by lcd_rotate_callback_t.
Definition common.h:188
@ ROTATION_APPLY
Actually rotate the buffer. Used internally.
Definition common.h:200
@ ROTATION_TOP_SIDE_FACING_UP
Set the rotation so the top side of the canvas is facing up.
Definition common.h:190
@ ROTATION_TOP_SIDE_FACING_DOWN
Set the rotation so the top side of the canvas is facing down.
Definition common.h:194
@ ROTATION_TOP_SIDE_FACING_RIGHT
Set the rotation so the top side of the canvas is facing right.
Definition common.h:196
@ ROTATION_QUERY
Query the current rotation. Will not change the current location.
Definition common.h:198
@ ROTATION_TOP_SIDE_FACING_LEFT
Set the rotation so the top side of the canvas is facing left.
Definition common.h:192
int(* lcd_rotate_callback_t)(lcd_t *self, int rotation)
Callback type for handling canvas rotation.
Definition common.h:895
lcd_surface_pixfmt_e
Valid pixel formats for LCD surfaces.
Definition common.h:136
@ LCD_SURFACE_PIXFMT_L4
4-bit index color.
Definition common.h:144
@ LCD_SURFACE_PIXFMT_L1
1-bit index color.
Definition common.h:140
@ LCD_SURFACE_PIXFMT_RGB444
12-bit RGB444.
Definition common.h:152
@ LCD_SURFACE_PIXFMT_RGB565
16-bit RGB565.
Definition common.h:156
@ LCD_SURFACE_PIXFMT_L8
8-bit index color.
Definition common.h:148
@ LCD_SURFACE_PIXFMT_RGB
24-bit RGB.
Definition common.h:160
@ LCD_SURFACE_PIXFMT_XRGB
32-bit XRGB.
Definition common.h:164
@ LCD_SURFACE_PIXFMT_ARGB
32-bit ARGB (alias of LCD_SURFACE_PIXFMT_XRGB).
Definition common.h:168
lcd_surface_encoding_e
Valid pixel buffer encoding for LCD surfaces.
Definition common.h:174
@ LCD_SURFACE_ENCODING_RAW
Pixel buffer is in raw format.
Definition common.h:182
@ LCD_SURFACE_ENCODING_HCA
Pixel buffer is contained in HCA container.
Definition common.h:178
ui_event_type_e
UI event types.
Definition common.h:595
@ UI_EVENT_TYPE_TOUCH_MOVE
Touch/pen move event.
Definition common.h:607
@ UI_EVENT_TYPE_TOUCH_END
End of touch/pen up event.
Definition common.h:611
@ UI_EVENT_TYPE_INVALID
Invalid/cleared.
Definition common.h:599
@ UI_EVENT_TYPE_TOUCH_BEGIN
Beginning of touch/pen down event.
Definition common.h:603
@ UI_EVENT_TYPE_KEY
Key(s) pressed.
Definition common.h:615
@ UI_EVENT_TYPE_KEY_UP
Key(s) released.
Definition common.h:620
keycode_e
List of available keycodes.
Definition common.h:241
@ KEY_MENU
Bring up the function menu of the current scene.
Definition common.h:258
@ KEY_BACKLIGHT
Open the Backlight adjustment menu.
Definition common.h:535
@ KEY_APP_DICT_ZH_EN_BESTA
Launch Besta Chinese-English dictionary.
Definition common.h:505
@ KEY_APP_MISC_3
Board-specific app launching shortcut.
Definition common.h:408
@ KEY_SYMBOL
Activate the symbol selection input method.
Definition common.h:361
@ KEY_APP_DICT_EN_LONGMAN
Launch Longman dictionary.
Definition common.h:450
@ KEY_APP_TRANSLATOR_ZH_EN
Open the Chinese to English translator app.
Definition common.h:496
@ KEY_HOME_MENU
Return to home menu.
Definition common.h:370
@ KEY_APP_DICT_JA_ZH_BESTA
Launch Besta Japanese-Chinese dictionary.
Definition common.h:509
@ KEY_PRIME_MENU
The MENU key on HP Prime.
Definition common.h:375
@ KEY_APP_DICT_JA_DAJIRIN
Launch Daijirin Japanese dictionary.
Definition common.h:422
@ KEY_APP_DICT_EN_PRO
Launch Besta professional vocabulary dictionary.
Definition common.h:500
@ KEY_FONT
Change font size.
Definition common.h:267
@ KEY_TTS
Trigger TTS.
Definition common.h:571
@ KEY_AUX_MENU
Open the global auxilary menu on touchscreen-only devices.
Definition common.h:488
@ KEY_VOL_BACKLIGHT
Open the Volume + Backlight adjustment menu.
Definition common.h:395
@ KEY_SCROLL_WHEEL_EVENT
Scroll wheel event.
Definition common.h:566
@ KEY_APP_MP3_PLAYER
Launch MP3 player.
Definition common.h:391
@ KEY_SYLLABLE
Dictionary: Pronounce the current word syllable-by-syllable.
Definition common.h:399
@ KEY_REPEAT
Dictionary: Repeatedly read out the current word.
Definition common.h:560
@ KEY_APP_DICT_EN_OXFORD
Launch Oxford dictionary.
Definition common.h:518
@ KEY_SEARCH
Launch the unified search app.
Definition common.h:530
@ KEY_APP_MISC_7
Board-specific app launching shortcut.
Definition common.h:445
@ KEY_APP_MISC_6
Board-specific app launching shortcut.
Definition common.h:431
@ KEY_APP_GAMES
Launch the Games app.
Definition common.h:427
@ KEY_APP_REC
Launch voice recorder.
Definition common.h:347
@ KEY_LANG_YUE
Trigger TTS in Cantonese.
Definition common.h:330
@ KEY_COMPARE
Dictionary: Parrot the current word and compare the pronunciations.
Definition common.h:539
@ KEY_APP_TRANSLATOR_EN_ZH
Open the English to Chinese translator app.
Definition common.h:492
@ KEY_POWER
Power button event.
Definition common.h:338
@ KEY_IME
Switch input method.
Definition common.h:352
@ KEY_LANG_CHN
Trigger TTS in Mandarain Chinese.
Definition common.h:326
@ KEY_APP_MISC_8
Board-specific app launching shortcut.
Definition common.h:459
@ KEY_APP_MISC_5
Board-specific app launching shortcut.
Definition common.h:417
@ KEY_TOGGLE_SC_TC
Toggle simplified/traditional Chinese.
Definition common.h:379
@ KEY_BATTERY
Display battery indicator popup.
Definition common.h:548
@ KEY_LANG_JPN
Trigger TTS in Japanese.
Definition common.h:356
@ KEY_LANG_ENG
Trigger TTS in English.
Definition common.h:334
@ KEY_APP_DICT_EN_ZH_BESTA
Launch Besta English-Chinese dictionary.
Definition common.h:522
@ KEY_APP_DICT_EN_JA_GENIUS
Launch Genius English-Japanese dictionary.
Definition common.h:464
@ KEY_ORIGINAL_INPUT
Dictionary and search: Go back to the first screen the user initiated a search (with input memorized)...
Definition common.h:403
@ KEY_APP_ALBUM
Launch the album app.
Definition common.h:441
@ KEY_APP_DICT_JA_EN_GENIUS
Launch Genius Japanese-English dictionary.
Definition common.h:455
@ KEY_APP_DICT_JA_SHINMEIKAI
Launch Shin-Meikai Japanese dictionary.
Definition common.h:436
@ KEY_HOME
Return to home menu.
Definition common.h:365
@ KEY_HELP
Show in-app help.
Definition common.h:383
@ KEY_FUNC_MENU
Bring up the function menu of the current scene.
Definition common.h:263
@ KEY_CONTRAST
Open LCD backlight and contrast adjustment menu.
Definition common.h:552
@ KEY_VOL
Open the Volume adjustment menu.
Definition common.h:544
@ KEY_APP_VIDEO_PLAYER
Launch video player app.
Definition common.h:484
@ KEY_FAV
Show the Favorites menu.
Definition common.h:479
@ KEY_USB_INSERTION
Event on USB cable insertion.
Definition common.h:556
@ KEY_EDIT
Show the edit menu (cut/copy/paste).
Definition common.h:526
@ KEY_APP_FLASHCARD
Launch the flashcard app.
Definition common.h:413
@ KEY_APP_DICT_ZH_JA_BESTA
Launch Besta Chinese-Japanese dictionary.
Definition common.h:513
@ KEY_SAVE
Save current change and exit.
Definition common.h:387
str_align_e
String alignment types.
Definition common.h:68
@ STR_ALIGN_CENTER
Align to top-center.
Definition common.h:80
@ STR_ALIGN_LEFT
Align to top-left.
Definition common.h:72
@ STR_ALIGN_RIGHT
Align to top-right.
Definition common.h:76