Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_obj.h
Go to the documentation of this file.
1
7#ifndef NBGL_OBJ_H
8#define NBGL_OBJ_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#include "nbgl_types.h"
15#include "nbgl_fonts.h"
16#include "ux_loc.h"
17
18/*********************
19 * INCLUDES
20 *********************/
21
22/*********************
23 * DEFINES
24 *********************/
25// Keypad special key values
26#define BACKSPACE_KEY 8
27#define VALIDATE_KEY '\r'
28
29// for Keyboard
30#ifdef NBGL_KEYBOARD
31#ifdef SCREEN_SIZE_WALLET
32#if defined(TARGET_STAX)
33#define KEYBOARD_KEY_HEIGHT 60
34#elif defined(TARGET_FLEX)
35#define KEYBOARD_KEY_HEIGHT 72
36#endif // TARGETS
37
38// index of keys for keyMask field of nbgl_keyboard_t
39#define SHIFT_KEY_INDEX 26
40#define DIGITS_SWITCH_KEY_INDEX 27
41#define BACKSPACE_KEY_INDEX 28
42#define SPACE_KEY_INDEX 29
43#define SPECIAL_KEYS_INDEX 30
44
45#else // SCREEN_SIZE_WALLET
46#define KEYBOARD_KEY_WIDTH 14
47#define KEYBOARD_KEY_HEIGHT 14
48#define KEYBOARD_WIDTH (5 * KEYBOARD_KEY_WIDTH)
49#endif // SCREEN_SIZE_WALLET
50#endif // NBGL_KEYBOARD
51
52// for Keypad
53#ifdef SCREEN_SIZE_WALLET
54#if defined(TARGET_STAX)
55#define KEYPAD_KEY_HEIGHT 104
56#elif defined(TARGET_FLEX)
57#define KEYPAD_KEY_HEIGHT 88
58#endif // TARGETS
59#else // SCREEN_SIZE_WALLET
60#define KEYPAD_WIDTH 114
61#define KEYPAD_HEIGHT 18
62#endif // SCREEN_SIZE_WALLET
63#define KEYPAD_MAX_DIGITS 12
64
65#ifdef SCREEN_SIZE_WALLET
66// external margin in pixels
67#if defined(TARGET_STAX)
68#define BORDER_MARGIN 24
69#define BOTTOM_BORDER_MARGIN 24
70#elif defined(TARGET_FLEX)
71#define BORDER_MARGIN 32
72#define BOTTOM_BORDER_MARGIN 24
73#endif // TARGETS
74
75// Back button header height
76#if defined(TARGET_STAX)
77#define BACK_BUTTON_HEADER_HEIGHT 88
78#elif defined(TARGET_FLEX)
79#define BACK_BUTTON_HEADER_HEIGHT 96
80#endif // TARGETS
81
82// common dimensions for buttons
83#if COMMON_RADIUS == 40
84#define BUTTON_RADIUS RADIUS_40_PIXELS
85#define BUTTON_DIAMETER (COMMON_RADIUS * 2)
86#elif COMMON_RADIUS == 44
87#define BUTTON_RADIUS RADIUS_44_PIXELS
88#define BUTTON_DIAMETER (COMMON_RADIUS * 2)
89#endif // COMMON_RADIUS
90
91// width & height for spinner
92#if defined(TARGET_STAX)
93#define SPINNER_WIDTH 60
94#define SPINNER_HEIGHT 44
95#elif defined(TARGET_FLEX)
96#define SPINNER_WIDTH 64
97#define SPINNER_HEIGHT 48
98#endif // TARGETS
99
100// width & height for radio button
101#if defined(TARGET_STAX)
102#define RADIO_WIDTH 32
103#define RADIO_HEIGHT 32
104#elif defined(TARGET_FLEX)
105#define RADIO_WIDTH 40
106#define RADIO_HEIGHT 40
107#endif // TARGETS
108
109// common small icons
110#if SMALL_ICON_SIZE == 32
111#define SPACE_ICON C_Space_32px
112#define BACKSPACE_ICON C_Erase_32px
113#define SHIFT_ICON C_Maj_32px
114#define SHIFT_LOCKED_ICON C_Maj_Lock_32px
115#define VALIDATE_ICON C_Check_32px
116#define RADIO_OFF_ICON C_radio_inactive_32px
117#define RADIO_ON_ICON C_radio_active_32px
118#define PUSH_ICON C_Chevron_32px
119#define LEFT_ARROW_ICON C_Back_32px
120#define RIGHT_ARROW_ICON C_Next_32px
121#define CHEVRON_BACK_ICON C_Chevron_Back_32px
122#define CHEVRON_NEXT_ICON C_Chevron_Next_32px
123#define CLOSE_ICON C_Close_32px
124#define WHEEL_ICON C_Settings_32px
125#define INFO_I_ICON C_Info_32px
126#define QRCODE_ICON C_QRCode_32px
127#define MINI_PUSH_ICON C_Mini_Push_32px
128#define WARNING_ICON C_Warning_32px
129#define ROUND_WARN_ICON C_Important_Circle_32px
130#define PRIVACY_ICON C_Privacy_32px
131#define EXCLAMATION_ICON C_Exclamation_32px
132#define DIGIT_ICON C_round_24px
133#elif SMALL_ICON_SIZE == 40
134#define SPACE_ICON C_Space_40px
135#define BACKSPACE_ICON C_Erase_40px
136#define SHIFT_ICON C_Maj_40px
137#define SHIFT_LOCKED_ICON C_Maj_Lock_40px
138#define VALIDATE_ICON C_Check_40px
139#define RADIO_OFF_ICON C_radio_inactive_40px
140#define RADIO_ON_ICON C_radio_active_40px
141#define PUSH_ICON C_Chevron_40px
142#define LEFT_ARROW_ICON C_Back_40px
143#define RIGHT_ARROW_ICON C_Next_40px
144#define CHEVRON_BACK_ICON C_Chevron_Back_40px
145#define CHEVRON_NEXT_ICON C_Chevron_Next_40px
146#define CLOSE_ICON C_Close_40px
147#define WHEEL_ICON C_Settings_40px
148#define INFO_I_ICON C_Info_40px
149#define QRCODE_ICON C_QRCode_40px
150#define MINI_PUSH_ICON C_Mini_Push_40px
151#define WARNING_ICON C_Warning_40px
152#define ROUND_WARN_ICON C_Important_Circle_40px
153#define PRIVACY_ICON C_Privacy_40px
154#define EXCLAMATION_ICON C_Exclamation_40px
155#define DIGIT_ICON C_pin_24
156#endif // SMALL_ICON_SIZE
157
158// common large icons
159#if LARGE_ICON_SIZE == 64
160#define CHECK_CIRCLE_ICON C_Check_Circle_64px
161#define DENIED_CIRCLE_ICON C_Denied_Circle_64px
162#define IMPORTANT_CIRCLE_ICON C_Important_Circle_64px
163#define LARGE_WARNING_ICON C_Warning_64px
164#else // LARGE_ICON_SIZE
165#error Undefined LARGE_ICON_SIZE
166#endif // LARGE_ICON_SIZE
167
168// For backward compatibility, to be remove later
169#define C_warning64px _Pragma("GCC warning \"Deprecated constant!\"") C_Warning_64px
170#define C_round_warning_64px _Pragma("GCC warning \"Deprecated constant!\"") C_Important_Circle_64px
171#define C_round_check_64px _Pragma("GCC warning \"Deprecated constant!\"") C_Check_Circle_64px
172#define C_Message_64px _Pragma("GCC warning \"Deprecated constant!\"") C_Review_64px
173#define C_leftArrow32px _Pragma("GCC warning \"Deprecated constant!\"") C_Back_32px
174#define C_Next32px _Pragma("GCC warning \"Deprecated constant!\"") C_Next_32px
175#define C_round_cross_64px _Pragma("GCC warning \"Deprecated constant!\"") C_Denied_Circle_64px
176
177// max number of pages when nbgl_page_indicator_t uses dashes (above, it uses n / nb_pages)
178#define NB_MAX_PAGES_WITH_DASHES 6
179
180// number of spinner positions
181#define NB_SPINNER_POSITIONS 4
182#endif // SCREEN_SIZE_WALLET
183
184/**********************
185 * TYPEDEFS
186 **********************/
187
188#define SWIPE_MASK \
189 ((1 << SWIPED_UP) | (1 << SWIPED_DOWN) | (1 << SWIPED_LEFT) | (1 << SWIPED_RIGHT))
190
195#define LEFT_BUTTON 0x01
196#define RIGHT_BUTTON 0x02
197#define BOTH_BUTTONS 0x03
198#define RELEASED_MASK 0x80
199#define CONTINUOUS_MASK \
200 0x40
202
214
221typedef void (*nbgl_buttonCallback_t)(void *obj, nbgl_buttonEvent_t buttonEvent);
222
227typedef struct {
229#ifdef HAVE_HW_TOUCH_SWIPE
231#endif // HAVE_HW_TOUCH_SWIPE
232 int16_t
236
242typedef void (*nbgl_touchCallback_t)(void *obj, nbgl_touchType_t eventType);
243
266
280
294
301typedef nbgl_icon_details_t *(*onImageDrawCallback_t)(uint8_t token);
302
318
328
341
354
365
378
387
401
408typedef char *(*onTextDrawCallback_t)(uint8_t token);
409
431
453
464
470
481
487typedef void (*keyboardCallback_t)(char touchedKey);
488
493typedef enum {
494#ifdef HAVE_SE_TOUCH
498#else // HAVE_SE_TOUCH
499 MODE_LOWER_LETTERS,
500 MODE_UPPER_LETTERS,
501 MODE_DIGITS_AND_SPECIALS,
502 MODE_NONE
503#endif // HAVE_SE_TOUCH
505
515
520typedef struct PACKED__ nbgl_keyboard_s {
525#ifdef SCREEN_SIZE_WALLET
528#else // SCREEN_SIZE_WALLET
529 bool enableBackspace;
530 bool enableValidate;
531 uint8_t selectedCharIndex;
532#endif // SCREEN_SIZE_WALLET
534 uint32_t keyMask;
539
544typedef struct PACKED__ nbgl_keypad_s {
546#ifdef SCREEN_SIZE_WALLET
550 bool partial;
551 uint8_t digitIndexes[5];
552#else // SCREEN_SIZE_WALLET
553 uint8_t selectedKey;
554#endif // SCREEN_SIZE_WALLET
557 bool shuffled;
560
565enum {
585 CONTROLS_ID, // when multiple controls in the same pages (buttons, switches, radios)
588
589/**********************
590 * GLOBAL PROTOTYPES
591 **********************/
592
593void nbgl_refresh(void);
596bool nbgl_refreshIsNeeded(void);
597void nbgl_refreshReset(void);
598
599void nbgl_objInit(void);
600void nbgl_objDraw(nbgl_obj_t *obj);
601void nbgl_objAllowDrawing(bool enable);
603bool nbgl_objIsUx(nbgl_obj_t *obj);
604
605void nbgl_objPoolRelease(uint8_t layer);
610 uint8_t nbObjs,
611 uint8_t layer,
612 nbgl_obj_t **objArray);
617
618// for internal use
621#ifdef HAVE_SE_TOUCH
624
625bool nbgl_keyboardGetPosition(nbgl_keyboard_t *kbd, char index, uint16_t *x, uint16_t *y);
626bool nbgl_keypadGetPosition(nbgl_keypad_t *kbd, char index, uint16_t *x, uint16_t *y);
627#else // HAVE_SE_TOUCH
628void nbgl_keyboardCallback(nbgl_obj_t *obj, nbgl_buttonEvent_t buttonEvent);
629void nbgl_keypadCallback(nbgl_obj_t *obj, nbgl_buttonEvent_t buttonEvent);
630#endif // HAVE_SE_TOUCH
631
632/**********************
633 * MACROS
634 **********************/
635
636#ifdef __cplusplus
637} /* extern "C" */
638#endif
639
640#endif /* NBGL_OBJ_H */
nbgl_font_id_e
Definition nbgl_fonts.h:136
struct PACKED__ nbgl_line_s nbgl_line_t
struct to represent a vertical or horizontal line
struct PACKED__ nbgl_navigation_bar_s nbgl_page_indicator_t
struct to represent a navigation bar (PAGE_INDICATOR type) There can be up to 5 page indicators,...
struct PACKED__ nbgl_radio_s nbgl_radio_t
struct to represent a radio button (RADIO_BUTTON type)
nbgl_obj_t * nbgl_objPoolGetPrevious(nbgl_obj_t *obj, uint8_t layer)
Gets a link to the previous object in the pool, for the given layer. (to be used with care)
void(* nbgl_touchCallback_t)(void *obj, nbgl_touchType_t eventType)
prototype of function to be called when a touch event is received by an object
Definition nbgl_obj.h:242
struct PACKED__ nbgl_text_area_s nbgl_text_area_t
struct to represent a text area (TEXT_AREA type)
uint8_t nbgl_containerPoolGetNbUsed(uint8_t layer)
returns the number of containers currently used in the pool
nbgl_icon_details_t *(* onImageDrawCallback_t)(uint8_t token)
prototype of function to be called when a IMAGE object is drawned, and no buffer was provided
Definition nbgl_obj.h:301
void nbgl_objDraw(nbgl_obj_t *obj)
This function draws or redraws the given object and its children (recursive version)
Definition nbgl_obj.c:1520
void nbgl_refresh(void)
This functions refreshes the actual screen on display with what has changed since the last refresh.
Definition nbgl_obj.c:1559
struct PACKED__ nbgl_progress_bar_s nbgl_progress_bar_t
struct to represent a progress bar (PROGRESS_BAR type)
void nbgl_keyboardTouchCallback(nbgl_obj_t *obj, nbgl_touchType_t eventType)
function to be called when the keyboard object is touched
nbgl_obj_t ** nbgl_containerPoolGet(uint8_t nbObjs, uint8_t layer)
Gets a new container from the pool, with the given number of obj pointers.
struct PACKED__ nbgl_keypad_s nbgl_keypad_t
struct to represent a keypad (KEYPAD type)
void nbgl_refreshReset(void)
This functions resets all changes since the last refresh.
Definition nbgl_obj.c:1617
struct PACKED__ nbgl_mask_control_s nbgl_mask_control_t
keyboardCase_t
Letters casing in which to open/set the keyboard.
Definition nbgl_obj.h:510
@ LOCKED_UPPER_CASE
locked upper case mode
Definition nbgl_obj.h:513
@ LOWER_CASE
lower case mode
Definition nbgl_obj.h:511
@ UPPER_CASE
upper case mode for one character
Definition nbgl_obj.h:512
nbgl_obj_t * nbgl_objPoolGet(nbgl_obj_type_t type, uint8_t layer)
Gets a new graphic object from the pool, with the given type. The type field of the object is set.
void nbgl_objAllowDrawing(bool enable)
This functions enables or disables drawing/refresh for all further calls.
Definition nbgl_obj.c:1649
struct PACKED__ nbgl_text_entry_s nbgl_text_entry_t
struct to represent a text entry area (TEXT_ENTRY type)
void nbgl_keypadTouchCallback(nbgl_obj_t *obj, nbgl_touchType_t eventType)
function to be called when the keypad object is touched
bool nbgl_keyboardGetPosition(nbgl_keyboard_t *kbd, char index, uint16_t *x, uint16_t *y)
This function gets the position (top-left corner) of the key at the given index. (to be used for Test...
struct PACKED__ nbgl_keyboard_s nbgl_keyboard_t
struct to represent a keyboard (KEYBOARD type)
void nbgl_refreshSpecial(nbgl_refresh_mode_t mode)
This functions refreshes the actual screen on display with what has changed since the last refresh,...
Definition nbgl_obj.c:1569
nbgl_buttonEvent_t
Definition nbgl_obj.h:203
@ BUTTON_BOTH_TOUCHED
Sent when both buttons are touched.
Definition nbgl_obj.h:211
@ BUTTON_LEFT_CONTINUOUS_PRESSED
Definition nbgl_obj.h:206
@ BUTTON_BOTH_PRESSED
Sent when both buttons are released.
Definition nbgl_obj.h:210
@ BUTTON_RIGHT_CONTINUOUS_PRESSED
Definition nbgl_obj.h:208
@ BUTTON_LEFT_PRESSED
Sent when Left button is released.
Definition nbgl_obj.h:204
@ BUTTON_RIGHT_PRESSED
Send when Right button is released.
Definition nbgl_obj.h:205
@ INVALID_BUTTON_EVENT
Definition nbgl_obj.h:212
void nbgl_containerPoolRelease(uint8_t layer)
Release the objects pointers from the pool for the given layer.
struct PACKED__ nbgl_image_s nbgl_image_t
struct to represent an image (IMAGE type)
int nbgl_objPoolGetArray(nbgl_obj_type_t type, uint8_t nbObjs, uint8_t layer, nbgl_obj_t **objArray)
Gets nbObjects new graphic object from the pool, with the given type, for the given layer (screen)....
bool nbgl_objIsUx(nbgl_obj_t *obj)
This function returns true if the object belongs to a UxScreen.
Definition nbgl_obj.c:1669
char *(* onTextDrawCallback_t)(uint8_t token)
prototype of function to be called when a TEXT_AREA object is drawned, and no text was provided
Definition nbgl_obj.h:408
uint8_t nbgl_objPoolGetId(nbgl_obj_t *obj)
Gets a unique index for the given object, in the pool.
bool nbgl_keypadGetPosition(nbgl_keypad_t *kbd, char index, uint16_t *x, uint16_t *y)
This function gets the position (top-left corner) of the key at the given index. (to be used for Test...
struct PACKED__ nbgl_button_s nbgl_button_t
struct to represent a button (BUTTON type) that can contain a text and/or an icon
void(* nbgl_buttonCallback_t)(void *obj, nbgl_buttonEvent_t buttonEvent)
prototype of function to be called when a button event is received by an object (TODO: change to scre...
Definition nbgl_obj.h:221
keyboardMode_t
Mode in which to open/set the keyboard.
Definition nbgl_obj.h:493
@ MODE_SPECIAL
extended special characters mode
Definition nbgl_obj.h:497
@ MODE_DIGITS
digits and some special characters mode
Definition nbgl_obj.h:496
@ MODE_LETTERS
letters mode
Definition nbgl_obj.h:495
void nbgl_objDrawKeyboard(nbgl_keyboard_t *kbd)
This function draws a keyboard object.
void nbgl_refreshSpecialWithPostRefresh(nbgl_refresh_mode_t mode, nbgl_post_refresh_t post_refresh)
Definition nbgl_obj.c:1585
@ CHOICE_1_ID
Definition nbgl_obj.h:574
@ TOP_RIGHT_BUTTON_ID
Definition nbgl_obj.h:570
@ LONG_PRESS_BUTTON_ID
Definition nbgl_obj.h:583
@ CONTROLS_ID
Definition nbgl_obj.h:585
@ ENTERED_TEXT_ID
Definition nbgl_obj.h:579
@ LEFT_BUTTON_ID
Definition nbgl_obj.h:567
@ VALUE_BUTTON_2_ID
Definition nbgl_obj.h:581
@ VALUE_BUTTON_3_ID
Definition nbgl_obj.h:582
@ RIGHT_BUTTON_ID
Definition nbgl_obj.h:568
@ WHOLE_SCREEN_ID
Definition nbgl_obj.h:569
@ BOTTOM_BUTTON_ID
Definition nbgl_obj.h:566
@ CHOICE_3_ID
Definition nbgl_obj.h:576
@ SINGLE_BUTTON_ID
Definition nbgl_obj.h:572
@ BACK_BUTTON_ID
Definition nbgl_obj.h:571
@ VALUE_BUTTON_1_ID
Definition nbgl_obj.h:580
@ KEYPAD_ID
Definition nbgl_obj.h:577
@ NB_CONTROL_IDS
Definition nbgl_obj.h:586
@ TIP_BOX_ID
Definition nbgl_obj.h:584
@ KEYBOARD_ID
Definition nbgl_obj.h:578
@ EXTRA_BUTTON_ID
Definition nbgl_obj.h:573
@ CHOICE_2_ID
Definition nbgl_obj.h:575
uint8_t nbgl_objPoolGetNbUsed(uint8_t layer)
returns the number of objects currently used in the pool
void(* keyboardCallback_t)(char touchedKey)
prototype of function to be called when a valid key is pressed on keyboard Backspace is equal to 0x8 ...
Definition nbgl_obj.h:487
void nbgl_objDrawKeypad(nbgl_keypad_t *kbd)
This function draws a keypad object.
struct PACKED__ nbgl_container_s nbgl_container_t
struct to represent a container (CONTAINER type)
uint8_t * nbgl_objGetRAMBuffer(void)
This function is used to get the all purpose RAM buffer.
Definition nbgl_obj.c:1659
nbgl_page_indicator_style_t
Style to apply to nbgl_page_indicator_t.
Definition nbgl_obj.h:383
@ CURRENT_INDICATOR
only current page dash is black
Definition nbgl_obj.h:385
@ PROGRESSIVE_INDICATOR
all dashes before active page are black
Definition nbgl_obj.h:384
void nbgl_objPoolRelease(uint8_t layer)
Release the objects from the pool for the given layer.
bool nbgl_refreshIsNeeded(void)
This functions returns true if there is something to refresh.
Definition nbgl_obj.c:1605
struct PACKED__ nbgl_switch_s nbgl_switch_t
struct to represent a switch (size is fixed) (SWITCH type)
struct PACKED__ nbgl_obj_s nbgl_obj_t
Common structure for all graphical objects.
struct PACKED__ nbgl_spinner_s nbgl_spinner_t
struct to represent a "spinner", represented by the Ledger corners, in gray, with one of the corners ...
void nbgl_objInit(void)
This functions inits all internal of nbgl objects layer.
Definition nbgl_obj.c:1634
struct PACKED__ nbgl_image_file_s nbgl_image_file_t
struct to represent an image file object (IMAGE_FILE type) The source of the data is an image file wi...
struct PACKED__ nbgl_qrcode_s nbgl_qrcode_t
struct to represent a QR code (QR_CODE type), whose size is fixed
common types for Graphical Library
color_t
Definition nbgl_types.h:120
uint8_t nbgl_transformation_t
Represents the transformation to be applied on the bitmap before rendering This is a bitfield using m...
Definition nbgl_types.h:362
nbgl_state_t
to represent a boolean state.
Definition nbgl_types.h:179
nbgl_post_refresh_t
Post refresh modes.
Definition nbgl_types.h:332
nbgl_radius_t
possible radius indexes for objects
Definition nbgl_types.h:343
nbgl_touchType_t
The different types of Touchscreen events.
Definition nbgl_types.h:239
nbgl_qrcode_version_t
possible modes for QR Code
Definition nbgl_types.h:209
nbgl_direction_t
Directions for layout or lines.
Definition nbgl_types.h:188
struct PACKED__ nbgl_icon_details_s nbgl_icon_details_t
Represents all information about an icon.
nbgl_aligment_t
All types of alignments.
Definition nbgl_types.h:159
nbgl_hardwareSwipe_t
Hardware powered detected swipe states.
Definition nbgl_types.h:227
nbgl_obj_type_t
All types of graphical objects.
Definition nbgl_types.h:134
nbgl_touchState_t
the 2 possible states of a finger on the Touchscreen
Definition nbgl_types.h:219
nbgl_style_t
possible styles for text area border
Definition nbgl_types.h:197
#define PACKED__
Definition nbgl_types.h:107
struct PACKED__ nbgl_area_s nbgl_area_t
Represents a rectangle area of the screen.
nbgl_refresh_mode_t
different modes of refresh for nbgl_refreshSpecial()
Definition nbgl_types.h:306
struct to represent a button (BUTTON type) that can contain a text and/or an icon
Definition nbgl_obj.h:416
const char * text
single line UTF-8 text (NULL terminated)
Definition nbgl_obj.h:425
color_t foregroundColor
Definition nbgl_obj.h:420
onTextDrawCallback_t onDrawCallback
Definition nbgl_obj.h:426
uint8_t token
token to use as param of onDrawCallback
Definition nbgl_obj.h:428
color_t borderColor
color set to button's border
Definition nbgl_obj.h:419
color_t innerColor
color set inside of the button
Definition nbgl_obj.h:418
nbgl_radius_t radius
radius of the corners, must be a multiple of 4.
Definition nbgl_obj.h:422
nbgl_font_id_e fontId
id of the font to use, if any
Definition nbgl_obj.h:423
nbgl_obj_t obj
common part
Definition nbgl_obj.h:417
bool localized
unused, kept for compatibility
Definition nbgl_obj.h:424
const nbgl_icon_details_t * icon
buffer containing icons bitmap. Set to NULL when no icon
Definition nbgl_obj.h:429
struct to represent a container (CONTAINER type)
Definition nbgl_obj.h:273
nbgl_obj_t obj
common part
Definition nbgl_obj.h:274
struct nbgl_obj_s ** children
children of this object (nbChildren size)
Definition nbgl_obj.h:278
nbgl_direction_t layout
layout of children inside this object
Definition nbgl_obj.h:275
bool forceClean
if set to true, a paint will be done with background color
Definition nbgl_obj.h:277
uint8_t nbChildren
Definition nbgl_obj.h:276
struct to represent an image file object (IMAGE_FILE type) The source of the data is an image file wi...
Definition nbgl_obj.h:324
nbgl_obj_t obj
Definition nbgl_obj.h:325
const uint8_t * buffer
buffer containing image file
Definition nbgl_obj.h:326
struct to represent an image (IMAGE type)
Definition nbgl_obj.h:307
nbgl_transformation_t transformation
usually NO_TRANSFORMATION
Definition nbgl_obj.h:311
onImageDrawCallback_t onDrawCallback
Definition nbgl_obj.h:314
uint8_t token
token to use as param of onDrawCallback
Definition nbgl_obj.h:316
const nbgl_icon_details_t * buffer
Definition nbgl_obj.h:312
color_t foregroundColor
Definition nbgl_obj.h:309
nbgl_obj_t obj
Definition nbgl_obj.h:308
struct to represent a keyboard (KEYBOARD type)
Definition nbgl_obj.h:520
uint32_t keyMask
Definition nbgl_obj.h:534
color_t textColor
color set to letters.
Definition nbgl_obj.h:522
keyboardCase_t casing
keyboard casing mode (lower, upper once or upper locked)
Definition nbgl_obj.h:527
bool lettersOnly
if true, only display letter keys and Backspace
Definition nbgl_obj.h:524
nbgl_obj_t obj
common part
Definition nbgl_obj.h:521
keyboardMode_t mode
keyboard mode to start with
Definition nbgl_obj.h:533
color_t borderColor
color set to key borders
Definition nbgl_obj.h:523
keyboardCallback_t callback
function called when an active key is pressed
Definition nbgl_obj.h:537
bool needsRefresh
if true, means that the keyboard has been redrawn and needs a refresh
Definition nbgl_obj.h:526
struct to represent a keypad (KEYPAD type)
Definition nbgl_obj.h:544
bool softValidation
if true, the "check icon" is replaced by an arrow
Definition nbgl_obj.h:548
bool enableBackspace
if true, Backspace key is enabled
Definition nbgl_obj.h:555
bool enableDigits
if true, Digit keys are enabled
Definition nbgl_obj.h:549
bool shuffled
if true, Digit keys are shuffled
Definition nbgl_obj.h:557
bool enableValidate
if true, Validate key is enabled
Definition nbgl_obj.h:556
nbgl_obj_t obj
common part
Definition nbgl_obj.h:545
color_t borderColor
color set to key borders
Definition nbgl_obj.h:547
bool partial
if true, means that only some keys have changed
Definition nbgl_obj.h:550
keyboardCallback_t callback
function called when an active key is pressed
Definition nbgl_obj.h:558
struct to represent a vertical or horizontal line
Definition nbgl_obj.h:285
nbgl_obj_t obj
common part
Definition nbgl_obj.h:286
nbgl_direction_t direction
direction of the line, e.g VERTICAL or HORIZONTAL
Definition nbgl_obj.h:287
color_t lineColor
color of the line
Definition nbgl_obj.h:288
uint8_t thickness
Definition nbgl_obj.h:289
uint8_t offset
Definition nbgl_obj.h:291
nbgl_obj_t obj
common part
Definition nbgl_obj.h:466
bool enableMasking
true: Enable masking of area / false: Disable masking of area
Definition nbgl_obj.h:467
uint8_t maskIndex
index of mask
Definition nbgl_obj.h:468
struct to represent a navigation bar (PAGE_INDICATOR type) There can be up to 5 page indicators,...
Definition nbgl_obj.h:395
nbgl_obj_t obj
common part
Definition nbgl_obj.h:396
nbgl_page_indicator_style_t style
Style to apply.
Definition nbgl_obj.h:399
uint8_t activePage
index of active page (from 0 to nbPages-1).
Definition nbgl_obj.h:398
uint8_t nbPages
number of pages.
Definition nbgl_obj.h:397
Common structure for all graphical objects.
Definition nbgl_obj.h:249
uint16_t touchMask
bit mask to tell engine which touch events are handled by this object
Definition nbgl_obj.h:262
struct nbgl_obj_s * parent
parent of this object
Definition nbgl_obj.h:256
uint8_t touchId
Definition nbgl_obj.h:263
nbgl_obj_type_t type
type of the graphical object, must be explicitly set
Definition nbgl_obj.h:261
int16_t rel_x0
horizontal position of top-left corner relative to parent's top-left corner
Definition nbgl_obj.h:253
int16_t alignmentMarginY
vertical margin when aligning
Definition nbgl_obj.h:260
nbgl_area_t area
Definition nbgl_obj.h:250
int16_t rel_y0
Definition nbgl_obj.h:254
struct nbgl_obj_s * alignTo
object to align to (parent by default)
Definition nbgl_obj.h:257
int16_t alignmentMarginX
horizontal margin when aligning
Definition nbgl_obj.h:259
nbgl_aligment_t alignment
type of alignment
Definition nbgl_obj.h:258
struct to represent a progress bar (PROGRESS_BAR type)
Definition nbgl_obj.h:370
color_t foregroundColor
color of the inner progress bar and border (if applicable)
Definition nbgl_obj.h:376
bool withBorder
if set to true, a border in black surround the whole object
Definition nbgl_obj.h:372
bool partialRedraw
set to true to redraw only partially the object (update state).
Definition nbgl_obj.h:374
uint16_t previousWidth
Definition nbgl_obj.h:375
uint8_t state
state of the progress, in % (from 0 to 100).
Definition nbgl_obj.h:373
struct to represent a QR code (QR_CODE type), whose size is fixed
Definition nbgl_obj.h:333
nbgl_obj_t obj
Definition nbgl_obj.h:334
nbgl_qrcode_version_t version
Definition nbgl_obj.h:337
color_t foregroundColor
Definition nbgl_obj.h:335
const char * text
text single line (NULL terminated)
Definition nbgl_obj.h:339
struct to represent a radio button (RADIO_BUTTON type)
Definition nbgl_obj.h:348
color_t activeColor
color set to to inner circle, when active.
Definition nbgl_obj.h:350
color_t borderColor
color set to border.
Definition nbgl_obj.h:351
nbgl_state_t state
state of the radio button. Active is when state == ON_STATE
Definition nbgl_obj.h:352
nbgl_obj_t obj
Definition nbgl_obj.h:349
struct to represent a "spinner", represented by the Ledger corners, in gray, with one of the corners ...
Definition nbgl_obj.h:476
uint8_t position
Definition nbgl_obj.h:478
nbgl_obj_t obj
common part
Definition nbgl_obj.h:477
struct to represent a switch (size is fixed) (SWITCH type)
Definition nbgl_obj.h:359
color_t offColor
color set to border and knob, when OFF (knob on the left).
Definition nbgl_obj.h:362
color_t onColor
color set to border and knob, when ON (knob on the right).
Definition nbgl_obj.h:361
nbgl_obj_t obj
Definition nbgl_obj.h:360
nbgl_state_t state
state of the switch.
Definition nbgl_obj.h:363
struct to represent a text area (TEXT_AREA type)
Definition nbgl_obj.h:436
bool wrapping
if set to true, break lines on ' ' when possible
Definition nbgl_obj.h:444
onTextDrawCallback_t onDrawCallback
function called if not NULL to get the text of the text area
Definition nbgl_obj.h:450
uint16_t len
number of bytes to write (if 0, max number of chars or strlen is used)
Definition nbgl_obj.h:448
nbgl_style_t style
to define the style of border
Definition nbgl_obj.h:440
uint8_t nbMaxLines
Definition nbgl_obj.h:445
color_t textColor
color set to '1' bits in text. '0' are set to backgroundColor color.
Definition nbgl_obj.h:438
bool autoHideLongLine
Definition nbgl_obj.h:442
uint8_t token
token to use as param of onDrawCallback
Definition nbgl_obj.h:451
nbgl_aligment_t textAlignment
alignment of text within the area
Definition nbgl_obj.h:439
nbgl_font_id_e fontId
id of the font to use
Definition nbgl_obj.h:441
nbgl_obj_t obj
common part
Definition nbgl_obj.h:437
const char * text
ASCII text to draw (NULL terminated). Can be NULL.
Definition nbgl_obj.h:447
struct to represent a text entry area (TEXT_ENTRY type)
Definition nbgl_obj.h:458
nbgl_font_id_e fontId
id of the font to use
Definition nbgl_obj.h:460
const char * text
text to display (up to nbChars chars).
Definition nbgl_obj.h:462
uint8_t nbChars
number of char placeholders to display (8 or 9 chars).
Definition nbgl_obj.h:461
nbgl_obj_t obj
common part
Definition nbgl_obj.h:459
The low level Touchscreen event, coming from driver.
Definition nbgl_obj.h:227
int16_t y
vertical position of the touch (or for a RELEASED the last touched point)
Definition nbgl_obj.h:234
int16_t x
horizontal position of the touch (or for a RELEASED the last touched point)
Definition nbgl_obj.h:233
nbgl_touchState_t state
state of the touch event, e.g PRESSED or RELEASED
Definition nbgl_obj.h:228
signed short int16_t
Definition usbd_conf.h:50
unsigned short uint16_t
Definition usbd_conf.h:54
unsigned char uint8_t
Definition usbd_conf.h:53