Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_obj.h
Go to the documentation of this file.
1
6
7#ifndef NBGL_OBJ_H
8#define NBGL_OBJ_H
9
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#include "nbgl_types.h"
17#include "nbgl_obj_types.h"
18#include "nbgl_fonts.h"
19#include "nbgl_icons.h"
20#include "ux_loc.h"
21
22/*********************
23 * INCLUDES
24 *********************/
25
26/*********************
27 * DEFINES
28 *********************/
29// Keypad special key values
30#define BACKSPACE_KEY 8
31#define VALIDATE_KEY '\r'
32
33// for Keyboard
34#ifdef NBGL_KEYBOARD
35#ifdef SCREEN_SIZE_WALLET
36#if defined(TARGET_STAX)
37#define KEYBOARD_KEY_HEIGHT 60
38#elif defined(TARGET_FLEX) || defined(TARGET_APOLLO)
39#define KEYBOARD_KEY_HEIGHT 72
40#elif defined(TARGET_APEX)
41#define KEYBOARD_KEY_HEIGHT 51
42#endif // TARGETS
43
44// index of keys for keyMask field of nbgl_keyboard_t
45#define SHIFT_KEY_INDEX 26
46#define DIGITS_SWITCH_KEY_INDEX 27
47#define BACKSPACE_KEY_INDEX 28
48#define SPACE_KEY_INDEX 29
49#define SPECIAL_KEYS_INDEX 30
50
51#else // SCREEN_SIZE_WALLET
52#define KEYBOARD_KEY_WIDTH 14
53#define KEYBOARD_KEY_HEIGHT 14
54#define KEYBOARD_WIDTH (5 * KEYBOARD_KEY_WIDTH)
55
56#define BACKSPACE_KEY_INDEX 26
57#define VALIDATE_INDEX 27
58#define SHIFT_KEY_INDEX 28
59#define KEYBOARD_MAX_TITLE 20
60#endif // SCREEN_SIZE_WALLET
61#endif // NBGL_KEYBOARD
62
63// for Keypad
64#ifdef SCREEN_SIZE_WALLET
65#if defined(TARGET_STAX)
66#define KEYPAD_KEY_HEIGHT 104
67#elif defined(TARGET_FLEX) || defined(TARGET_APOLLO)
68#define KEYPAD_KEY_HEIGHT 88
69#elif defined(TARGET_APEX)
70#define KEYPAD_KEY_HEIGHT 60
71#endif // TARGETS
72#else // SCREEN_SIZE_WALLET
73#define KEYPAD_WIDTH 114
74#define KEYPAD_HEIGHT 18
75#endif // SCREEN_SIZE_WALLET
76#define KEYPAD_MAX_DIGITS 12
77
78#ifdef SCREEN_SIZE_WALLET
79// external margin in pixels
80#if defined(TARGET_STAX)
81#define BORDER_MARGIN 24
82#define VERTICAL_BORDER_MARGIN 24
83#elif defined(TARGET_FLEX) || defined(TARGET_APOLLO)
84#define BORDER_MARGIN 32
85#define VERTICAL_BORDER_MARGIN 24
86#elif defined(TARGET_APEX)
87#define BORDER_MARGIN 16
88#define VERTICAL_BORDER_MARGIN 24
89#endif // TARGETS
90
91// Back button header height
92#if defined(TARGET_STAX)
93#define BACK_BUTTON_HEADER_HEIGHT 88
94#elif defined(TARGET_FLEX) || defined(TARGET_APOLLO)
95#define BACK_BUTTON_HEADER_HEIGHT 96
96#elif defined(TARGET_APEX)
97#define BACK_BUTTON_HEADER_HEIGHT 60
98#endif // TARGETS
99
100// common dimensions for buttons
101#if COMMON_RADIUS == 40
102#define BUTTON_RADIUS RADIUS_40_PIXELS
103#elif COMMON_RADIUS == 44
104#define BUTTON_RADIUS RADIUS_44_PIXELS
105#elif COMMON_RADIUS == 28
106#define BUTTON_RADIUS RADIUS_28_PIXELS
107#endif // COMMON_RADIUS
108#define BUTTON_DIAMETER (COMMON_RADIUS * 2)
109// on Apex, "round" buttons are not exactly round
110#if defined(TARGET_APEX)
111#define BUTTON_WIDTH (BUTTON_DIAMETER - 2)
112#else
113#define BUTTON_WIDTH BUTTON_DIAMETER
114#endif
115
116// width & height for spinner
117#if defined(TARGET_STAX)
118#define SPINNER_WIDTH 60
119#define SPINNER_HEIGHT 44
120#elif defined(TARGET_FLEX) || defined(TARGET_APOLLO)
121#define SPINNER_WIDTH 64
122#define SPINNER_HEIGHT 48
123#elif defined(TARGET_APEX)
124#define SPINNER_WIDTH 40
125#define SPINNER_HEIGHT 32
126#endif // TARGETS
127
128// width for indicator
129#if defined(TARGET_STAX)
130#define STEPPER_2_PAGES_WIDTH 136
131#define STEPPER_N_PAGES_WIDTH 184
132#elif defined(TARGET_FLEX) || defined(TARGET_APOLLO)
133#define STEPPER_2_PAGES_WIDTH 136
134#define STEPPER_N_PAGES_WIDTH 184
135#elif defined(TARGET_APEX)
136#define STEPPER_2_PAGES_WIDTH 108
137#define STEPPER_N_PAGES_WIDTH 104
138#endif // TARGETS
139
140// width & height for radio button
141#if defined(TARGET_STAX)
142#define RADIO_WIDTH 32
143#define RADIO_HEIGHT 32
144#elif defined(TARGET_FLEX) || defined(TARGET_APOLLO)
145#define RADIO_WIDTH 40
146#define RADIO_HEIGHT 40
147#elif defined(TARGET_APEX)
148#define RADIO_WIDTH 24
149#define RADIO_HEIGHT 24
150#endif // TARGETS
151
152// Icon defines are in nbgl_icons.h (included above)
153
154// max number of pages when nbgl_page_indicator_t uses dashes (above, it uses n / nb_pages)
155#define NB_MAX_PAGES_WITH_DASHES 6
156
157// number of spinner positions
158#define NB_SPINNER_POSITIONS 4
159#endif // SCREEN_SIZE_WALLET
160
161#if NB_COLOR_BITS == 1
162#define INACTIVE_COLOR WHITE
163#define INACTIVE_TEXT_COLOR BLACK
164#define INACTIVE_ARROW_COLOR WHITE
165#define INACTIVE_SMALL_FONT SMALL_REGULAR_FONT
166#define LIGHT_TEXT_COLOR BLACK
167#define BUTTON_STROKE 1
168#else
169#define INACTIVE_COLOR LIGHT_GRAY
170#define INACTIVE_TEXT_COLOR LIGHT_GRAY
171#define INACTIVE_ARROW_COLOR LIGHT_GRAY
172#define INACTIVE_SMALL_FONT SMALL_BOLD_FONT
173#define LIGHT_TEXT_COLOR DARK_GRAY
174#define BUTTON_STROKE 2
175#endif
176
177#define KEYPAD_REINIT_KEYS 0x1F
178
179/**********************
180 * TYPEDEFS
181 **********************/
182
183#define SWIPE_MASK \
184 ((1 << SWIPED_UP) | (1 << SWIPED_DOWN) | (1 << SWIPED_LEFT) | (1 << SWIPED_RIGHT))
185
190#define LEFT_BUTTON 0x01
191#define RIGHT_BUTTON 0x02
192#define BOTH_BUTTONS 0x03
193#define RELEASED_MASK 0x80
194#define CONTINUOUS_MASK 0x40
195
207
214typedef void (*nbgl_buttonCallback_t)(void *obj, nbgl_buttonEvent_t buttonEvent);
215
220typedef struct {
222#ifdef HAVE_HW_TOUCH_SWIPE
224#endif // HAVE_HW_TOUCH_SWIPE
225 int16_t
227 int16_t y;
229
235typedef void (*nbgl_touchCallback_t)(void *obj, nbgl_touchType_t eventType);
236
256
270
284
291typedef nbgl_icon_details_t *(*onImageDrawCallback_t)(uint8_t token);
292
308
315 nbgl_obj_t obj; // common part
316 const uint8_t *buffer;
318
331
344
355
370
379
393
400typedef char *(*onTextDrawCallback_t)(uint8_t token);
401
423
446
457
463
474
480typedef void (*keyboardCallback_t)(char touchedKey);
481
486typedef struct PACKED__ nbgl_keyboard_s {
491#ifdef SCREEN_SIZE_WALLET
494#else // SCREEN_SIZE_WALLET
495 bool enableBackspace;
496 bool enableValidate;
497 bool obfuscated;
498 uint8_t selectedCharIndex;
499#endif // SCREEN_SIZE_WALLET
501 uint32_t keyMask;
506
511typedef struct PACKED__ nbgl_keypad_s {
514#ifdef SCREEN_SIZE_WALLET
515 uint8_t softValidation : 1;
516 uint8_t enableDigits : 1;
517 uint8_t digitsChanged : 1;
518 uint8_t validateChanged : 1;
519 uint8_t enableBackspace : 1;
520 uint8_t enableValidate : 1;
521 uint8_t shuffled : 1;
522 uint8_t digitIndexes[5];
523#else // SCREEN_SIZE_WALLET
524 uint8_t selectedKey : 5;
525 uint8_t enableBackspace : 1;
526 uint8_t enableValidate : 1;
527 uint8_t shuffled : 1;
528#endif // SCREEN_SIZE_WALLET
530
535enum {
555 CONTROLS_ID, // when multiple controls in the same pages (buttons, switches, radios)
557};
558
559/**********************
560 * GLOBAL VARIABLES
561 **********************/
562
563extern uint8_t ramBuffer[];
564
565/**********************
566 * GLOBAL PROTOTYPES
567 **********************/
568
569void nbgl_refresh(void);
574
575void nbgl_objInit(void);
577void nbgl_objAllowDrawing(bool enable);
578uint8_t *nbgl_objGetRAMBuffer(void);
580
581void nbgl_objPoolRelease(uint8_t layer);
585 uint8_t nbObjs,
586 uint8_t layer,
587 nbgl_obj_t **objArray);
588uint8_t nbgl_objPoolGetNbUsed(uint8_t layer);
589void nbgl_containerPoolRelease(uint8_t layer);
590nbgl_obj_t **nbgl_containerPoolGet(uint8_t nbObjs, uint8_t layer);
591uint8_t nbgl_containerPoolGetNbUsed(uint8_t layer);
592
593// for internal use
596#ifdef HAVE_SE_TOUCH
599
600bool nbgl_keyboardGetPosition(nbgl_keyboard_t *kbd, char index, uint16_t *x, uint16_t *y);
601bool nbgl_keypadGetPosition(nbgl_keypad_t *kbd, char index, uint16_t *x, uint16_t *y);
602#else // HAVE_SE_TOUCH
603void nbgl_keyboardCallback(nbgl_obj_t *obj, nbgl_buttonEvent_t buttonEvent);
604void nbgl_keypadCallback(nbgl_obj_t *obj, nbgl_buttonEvent_t buttonEvent);
605#endif // HAVE_SE_TOUCH
606
607/**********************
608 * MACROS
609 **********************/
610
611#ifdef __cplusplus
612} /* extern "C" */
613#endif
614
615#endif /* NBGL_OBJ_H */
nbgl_font_id_e
Definition nbgl_fonts.h:143
Semantic icon defines for NBGL.
Included by every low-level NBGL header, to forbid them in apollo app code.
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)
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:235
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)
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:291
void nbgl_objDraw(nbgl_obj_t *obj)
void nbgl_refresh(void)
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)
nbgl_obj_t ** nbgl_containerPoolGet(uint8_t nbObjs, uint8_t layer)
struct PACKED__ nbgl_keypad_s nbgl_keypad_t
struct to represent a keypad (KEYPAD type)
void nbgl_refreshReset(void)
struct PACKED__ nbgl_mask_control_s nbgl_mask_control_t
nbgl_obj_t * nbgl_objPoolGet(nbgl_obj_type_t type, uint8_t layer)
void nbgl_objAllowDrawing(bool enable)
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)
bool nbgl_keyboardGetPosition(nbgl_keyboard_t *kbd, char index, uint16_t *x, uint16_t *y)
uint8_t ramBuffer[]
struct PACKED__ nbgl_keyboard_s nbgl_keyboard_t
struct to represent a keyboard (KEYBOARD type)
void nbgl_refreshSpecial(nbgl_refresh_mode_t mode)
nbgl_buttonEvent_t
Definition nbgl_obj.h:196
@ BUTTON_BOTH_TOUCHED
Sent when both buttons are touched.
Definition nbgl_obj.h:204
@ BUTTON_LEFT_CONTINUOUS_PRESSED
Definition nbgl_obj.h:199
@ BUTTON_BOTH_PRESSED
Sent when both buttons are released.
Definition nbgl_obj.h:203
@ BUTTON_RIGHT_CONTINUOUS_PRESSED
Definition nbgl_obj.h:201
@ BUTTON_LEFT_PRESSED
Sent when Left button is released.
Definition nbgl_obj.h:197
@ BUTTON_RIGHT_PRESSED
Send when Right button is released.
Definition nbgl_obj.h:198
@ INVALID_BUTTON_EVENT
Definition nbgl_obj.h:205
void nbgl_containerPoolRelease(uint8_t 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)
bool nbgl_objIsUx(nbgl_obj_t *obj)
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:400
uint8_t nbgl_objPoolGetId(nbgl_obj_t *obj)
bool nbgl_keypadGetPosition(nbgl_keypad_t *kbd, char index, uint16_t *x, uint16_t *y)
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:214
void nbgl_objDrawKeyboard(nbgl_keyboard_t *kbd)
void nbgl_refreshSpecialWithPostRefresh(nbgl_refresh_mode_t mode, nbgl_post_refresh_t post_refresh)
uint8_t nbgl_objPoolGetNbUsed(uint8_t layer)
@ CHOICE_1_ID
Definition nbgl_obj.h:544
@ TOP_RIGHT_BUTTON_ID
Definition nbgl_obj.h:540
@ LONG_PRESS_BUTTON_ID
Definition nbgl_obj.h:553
@ CONTROLS_ID
Definition nbgl_obj.h:555
@ ENTERED_TEXT_ID
Definition nbgl_obj.h:549
@ LEFT_BUTTON_ID
Definition nbgl_obj.h:537
@ VALUE_BUTTON_2_ID
Definition nbgl_obj.h:551
@ VALUE_BUTTON_3_ID
Definition nbgl_obj.h:552
@ RIGHT_BUTTON_ID
Definition nbgl_obj.h:538
@ WHOLE_SCREEN_ID
Definition nbgl_obj.h:539
@ BOTTOM_BUTTON_ID
Definition nbgl_obj.h:536
@ CHOICE_3_ID
Definition nbgl_obj.h:546
@ SINGLE_BUTTON_ID
Definition nbgl_obj.h:542
@ BACK_BUTTON_ID
Definition nbgl_obj.h:541
@ VALUE_BUTTON_1_ID
Definition nbgl_obj.h:550
@ KEYPAD_ID
Definition nbgl_obj.h:547
@ NB_CONTROL_IDS
Definition nbgl_obj.h:556
@ TIP_BOX_ID
Definition nbgl_obj.h:554
@ KEYBOARD_ID
Definition nbgl_obj.h:548
@ EXTRA_BUTTON_ID
Definition nbgl_obj.h:543
@ CHOICE_2_ID
Definition nbgl_obj.h:545
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:480
void nbgl_objDrawKeypad(nbgl_keypad_t *kbd)
struct PACKED__ nbgl_container_s nbgl_container_t
struct to represent a container (CONTAINER type)
uint8_t * nbgl_objGetRAMBuffer(void)
nbgl_page_indicator_style_t
Style to apply to nbgl_page_indicator_t.
Definition nbgl_obj.h:375
@ CURRENT_INDICATOR
only current page dash is black
Definition nbgl_obj.h:377
@ PROGRESSIVE_INDICATOR
all dashes before active page are black
Definition nbgl_obj.h:376
void nbgl_objPoolRelease(uint8_t layer)
bool nbgl_refreshIsNeeded(void)
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)
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
Types of NBGL objects also used by the use-case API.
keyboardCase_t
Letters casing in which to open/set the keyboard.
keyboardMode_t
Mode in which to open/set the keyboard.
common types for Graphical Library
color_t
Definition nbgl_types.h:153
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:395
nbgl_state_t
to represent a boolean state.
Definition nbgl_types.h:212
nbgl_post_refresh_t
Post refresh modes.
Definition nbgl_types.h:364
nbgl_radius_t
possible radius indexes for objects
Definition nbgl_types.h:375
nbgl_touchType_t
The different types of Touchscreen events.
Definition nbgl_types.h:272
nbgl_qrcode_version_t
possible modes for QR Code
Definition nbgl_types.h:242
nbgl_direction_t
Directions for layout or lines.
Definition nbgl_types.h:221
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:192
nbgl_hardwareSwipe_t
Hardware powered detected swipe states.
Definition nbgl_types.h:260
nbgl_obj_type_t
All types of graphical objects.
Definition nbgl_types.h:167
nbgl_touchState_t
the 2 possible states of a finger on the Touchscreen
Definition nbgl_types.h:252
nbgl_style_t
possible styles for text area border
Definition nbgl_types.h:230
#define PACKED__
Definition nbgl_types.h:140
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:338
struct to represent a button (BUTTON type) that can contain a text and/or an icon
Definition nbgl_obj.h:408
const char * text
single line UTF-8 text (NULL terminated)
Definition nbgl_obj.h:410
color_t foregroundColor
Definition nbgl_obj.h:415
onTextDrawCallback_t onDrawCallback
function called if not NULL, with above token as
Definition nbgl_obj.h:411
uint8_t token
token to use as param of onDrawCallback
Definition nbgl_obj.h:421
color_t borderColor
color set to button's border
Definition nbgl_obj.h:414
color_t innerColor
color set inside of the button
Definition nbgl_obj.h:413
nbgl_radius_t radius
radius of the corners, must be a multiple of 4.
Definition nbgl_obj.h:417
nbgl_font_id_e fontId
id of the font to use, if any
Definition nbgl_obj.h:418
nbgl_obj_t obj
common part
Definition nbgl_obj.h:409
const nbgl_icon_details_t * icon
buffer containing icons bitmap. Set to NULL when no icon
Definition nbgl_obj.h:412
struct to represent a container (CONTAINER type)
Definition nbgl_obj.h:263
nbgl_obj_t obj
common part
Definition nbgl_obj.h:264
nbgl_direction_t layout
layout of children inside this object
Definition nbgl_obj.h:266
bool forceClean
if set to true, a paint will be done with background color
Definition nbgl_obj.h:268
uint8_t nbChildren
Definition nbgl_obj.h:267
nbgl_obj_t ** children
children of this object (nbChildren size)
Definition nbgl_obj.h:265
struct to represent an image file object (IMAGE_FILE type) The source of the data is an image file wi...
Definition nbgl_obj.h:314
nbgl_obj_t obj
Definition nbgl_obj.h:315
const uint8_t * buffer
buffer containing image file
Definition nbgl_obj.h:316
struct to represent an image (IMAGE type)
Definition nbgl_obj.h:297
nbgl_transformation_t transformation
usually NO_TRANSFORMATION
Definition nbgl_obj.h:305
onImageDrawCallback_t onDrawCallback
Definition nbgl_obj.h:301
uint8_t token
token to use as param of onDrawCallback
Definition nbgl_obj.h:306
const nbgl_icon_details_t * buffer
Definition nbgl_obj.h:299
color_t foregroundColor
Definition nbgl_obj.h:303
nbgl_obj_t obj
Definition nbgl_obj.h:298
struct to represent a keyboard (KEYBOARD type)
Definition nbgl_obj.h:486
uint32_t keyMask
Definition nbgl_obj.h:501
color_t textColor
color set to letters.
Definition nbgl_obj.h:488
keyboardCase_t casing
keyboard casing mode (lower, upper once or upper locked)
Definition nbgl_obj.h:493
bool lettersOnly
if true, only display letter keys and Backspace
Definition nbgl_obj.h:490
nbgl_obj_t obj
common part
Definition nbgl_obj.h:487
keyboardMode_t mode
keyboard mode to start with
Definition nbgl_obj.h:500
color_t borderColor
color set to key borders
Definition nbgl_obj.h:489
keyboardCallback_t callback
function called when an active key is pressed
Definition nbgl_obj.h:504
bool needsRefresh
if true, means that the keyboard has been redrawn and needs a refresh
Definition nbgl_obj.h:492
struct to represent a keypad (KEYPAD type)
Definition nbgl_obj.h:511
uint8_t validateChanged
if true, means that validate key has changed
Definition nbgl_obj.h:518
uint8_t digitsChanged
if true, means that only digit keys have changed
Definition nbgl_obj.h:517
nbgl_obj_t obj
common part
Definition nbgl_obj.h:512
uint8_t enableDigits
if true, Digit keys are enabled
Definition nbgl_obj.h:516
uint8_t enableValidate
if true, Validate key is enabled
Definition nbgl_obj.h:520
uint8_t softValidation
if true, the "check icon" is replaced by an arrow
Definition nbgl_obj.h:515
uint8_t digitIndexes[5]
array of digits indexes, 4 bits per digit
Definition nbgl_obj.h:522
uint8_t enableBackspace
if true, Backspace key is enabled
Definition nbgl_obj.h:519
uint8_t shuffled
if true, Digit keys are shuffled
Definition nbgl_obj.h:521
keyboardCallback_t callback
function called when an active key is pressed
Definition nbgl_obj.h:513
struct to represent a vertical or horizontal line
Definition nbgl_obj.h:275
nbgl_obj_t obj
common part
Definition nbgl_obj.h:276
nbgl_direction_t direction
direction of the line, e.g VERTICAL or HORIZONTAL
Definition nbgl_obj.h:277
color_t lineColor
color of the line
Definition nbgl_obj.h:278
uint8_t thickness
Definition nbgl_obj.h:279
uint8_t offset
Definition nbgl_obj.h:281
nbgl_obj_t obj
common part
Definition nbgl_obj.h:459
bool enableMasking
true: Enable masking of area / false: Disable masking of area
Definition nbgl_obj.h:460
uint8_t maskIndex
index of mask
Definition nbgl_obj.h:461
struct to represent a navigation bar (PAGE_INDICATOR type) There can be up to 5 page indicators,...
Definition nbgl_obj.h:387
nbgl_obj_t obj
common part
Definition nbgl_obj.h:388
nbgl_page_indicator_style_t style
Style to apply.
Definition nbgl_obj.h:391
uint8_t activePage
index of active page (from 0 to nbPages-1).
Definition nbgl_obj.h:390
uint8_t nbPages
number of pages.
Definition nbgl_obj.h:389
Common structure for all graphical objects.
Definition nbgl_obj.h:242
uint8_t objId
id of the obj in the screen (only used externally)
Definition nbgl_obj.h:254
uint16_t touchMask
bit mask to tell engine which touch events are handled by this object
Definition nbgl_obj.h:251
struct nbgl_obj_s * parent
parent of this object (automatically set)
Definition nbgl_obj.h:247
uint8_t touchId
Definition nbgl_obj.h:252
nbgl_obj_type_t type
type of the graphical object, must be explicitly set
Definition nbgl_obj.h:245
int16_t alignmentMarginY
vertical margin when aligning
Definition nbgl_obj.h:250
nbgl_area_t area
Definition nbgl_obj.h:243
struct nbgl_obj_s * alignTo
object to align to (parent if NULL)
Definition nbgl_obj.h:248
int16_t alignmentMarginX
horizontal margin when aligning
Definition nbgl_obj.h:249
nbgl_aligment_t alignment
type of alignment
Definition nbgl_obj.h:246
struct to represent a progress bar (PROGRESS_BAR type)
Definition nbgl_obj.h:360
color_t foregroundColor
color of the inner progress bar and border (if applicable)
Definition nbgl_obj.h:368
uint8_t withBorder
if set to true, a border in black surround the whole object
Definition nbgl_obj.h:365
uint16_t previousWidth
Definition nbgl_obj.h:362
uint8_t partialRedraw
set to true to redraw only partially the object (update state).
Definition nbgl_obj.h:364
uint8_t resetIfOverriden
Definition nbgl_obj.h:366
uint8_t state
state of the progress, in % (from 0 to 100).
Definition nbgl_obj.h:363
struct to represent a QR code (QR_CODE type), whose size is fixed
Definition nbgl_obj.h:323
nbgl_obj_t obj
Definition nbgl_obj.h:324
nbgl_qrcode_version_t version
Definition nbgl_obj.h:328
color_t foregroundColor
Definition nbgl_obj.h:326
const char * text
text single line (NULL terminated)
Definition nbgl_obj.h:325
struct to represent a radio button (RADIO_BUTTON type)
Definition nbgl_obj.h:338
color_t activeColor
color set to to inner circle, when active.
Definition nbgl_obj.h:340
color_t borderColor
color set to border.
Definition nbgl_obj.h:341
nbgl_state_t state
state of the radio button. Active is when state == ON_STATE
Definition nbgl_obj.h:342
nbgl_obj_t obj
Definition nbgl_obj.h:339
struct to represent a "spinner", represented by the Ledger corners, in gray, with one of the corners ...
Definition nbgl_obj.h:469
uint8_t position
Definition nbgl_obj.h:471
nbgl_obj_t obj
common part
Definition nbgl_obj.h:470
struct to represent a switch (size is fixed) (SWITCH type)
Definition nbgl_obj.h:349
color_t offColor
color set to border and knob, when OFF (knob on the left).
Definition nbgl_obj.h:352
color_t onColor
color set to border and knob, when ON (knob on the right).
Definition nbgl_obj.h:351
nbgl_obj_t obj
Definition nbgl_obj.h:350
nbgl_state_t state
state of the switch.
Definition nbgl_obj.h:353
struct to represent a text area (TEXT_AREA type)
Definition nbgl_obj.h:428
onTextDrawCallback_t onDrawCallback
function called if not NULL to get the text of the text area
Definition nbgl_obj.h:442
uint16_t len
number of bytes to write (if 0, max number of chars or strlen is used)
Definition nbgl_obj.h:440
nbgl_style_t style
to define the style of border
Definition nbgl_obj.h:432
uint8_t wrapping
if set to true, break lines on ' ' when possible
Definition nbgl_obj.h:436
uint8_t nbMaxLines
if >0, only display the nbMaxLines first lines
Definition nbgl_obj.h:438
color_t textColor
color set to '1' bits in text. '0' are set to backgroundColor color.
Definition nbgl_obj.h:430
uint8_t hideEndOfLastLine
if set to true, replace 3 last chars of last line by "..."
Definition nbgl_obj.h:437
bool autoHideLongLine
Definition nbgl_obj.h:434
uint8_t token
token to use as param of onDrawCallback
Definition nbgl_obj.h:443
nbgl_aligment_t textAlignment
alignment of text within the area
Definition nbgl_obj.h:431
nbgl_font_id_e fontId
id of the font to use
Definition nbgl_obj.h:433
nbgl_obj_t obj
common part
Definition nbgl_obj.h:429
const char * text
ASCII text to draw (NULL terminated). Can be NULL.
Definition nbgl_obj.h:439
struct to represent a text entry area (TEXT_ENTRY type)
Definition nbgl_obj.h:451
nbgl_font_id_e fontId
id of the font to use
Definition nbgl_obj.h:454
const char * text
text to display (up to nbChars chars).
Definition nbgl_obj.h:453
uint8_t nbChars
number of char placeholders to display (8 or 9 chars).
Definition nbgl_obj.h:455
nbgl_obj_t obj
common part
Definition nbgl_obj.h:452
The low level Touchscreen event, coming from driver.
Definition nbgl_obj.h:220
int16_t y
vertical position of the touch (or for a RELEASED the last touched point)
Definition nbgl_obj.h:227
int16_t x
horizontal position of the touch (or for a RELEASED the last touched point)
Definition nbgl_obj.h:226
nbgl_touchState_t state
state of the touch event, e.g PRESSED or RELEASED
Definition nbgl_obj.h:221