23#include "os_io_seph_cmd.h"
24#include "os_io_seph_ux.h"
26#include "os_helpers.h"
31#if defined(TARGET_FLEX) || defined(TARGET_APEX)
32#define USE_PARTIAL_BUTTONS 1
37 PAGE_INDICATOR_INDEX = 0,
38#ifdef USE_PARTIAL_BUTTONS
44#ifndef USE_PARTIAL_BUTTONS
48 NB_SUGGESTION_CHILDREN
59#if defined(TARGET_STAX)
60#define TEXT_ENTRY_NORMAL_HEIGHT 64
61#define TEXT_ENTRY_COMPACT_HEIGHT 64
62#define BOTTOM_NORMAL_MARGIN 24
63#define BOTTOM_CONFIRM_MARGIN 24
64#define BOTTOM_COMPACT_MARGIN 24
65#define TOP_NORMAL_MARGIN 20
66#define TOP_CONFIRM_MARGIN 20
67#define TOP_COMPACT_MARGIN 20
68#define TITLE_ENTRY_MARGIN_Y 4
69#define TEXT_ENTRY_FONT LARGE_MEDIUM_1BPP_FONT
70#define TEXT_ENTRY_FONT_OBFUSCATED LARGE_OBFUSCATED_MEDIUM_1BPP_FONT
73#define NUMBER_TEXT_SPACE 8
74#define NUMBER_WIDTH 56
75#define DELETE_ICON C_Close_32px
76#elif defined(TARGET_FLEX)
77#define TEXT_ENTRY_NORMAL_HEIGHT 72
78#define TEXT_ENTRY_COMPACT_HEIGHT 56
79#define BOTTOM_NORMAL_MARGIN 24
80#define BOTTOM_CONFIRM_MARGIN 24
81#define BOTTOM_COMPACT_MARGIN 12
82#define TOP_NORMAL_MARGIN 20
83#define TOP_CONFIRM_MARGIN 20
84#define TOP_COMPACT_MARGIN 12
85#define TITLE_ENTRY_MARGIN_Y 4
86#define TEXT_ENTRY_FONT LARGE_MEDIUM_1BPP_FONT
87#define TEXT_ENTRY_FONT_OBFUSCATED LARGE_OBFUSCATED_MEDIUM_1BPP_FONT
89#define NUMBER_TEXT_SPACE 8
90#define NUMBER_WIDTH 56
91#define DELETE_ICON C_Close_40px
92#elif defined(TARGET_APEX)
93#define TEXT_ENTRY_NORMAL_HEIGHT 44
94#define TEXT_ENTRY_COMPACT_HEIGHT 44
95#define BOTTOM_NORMAL_MARGIN 20
96#define BOTTOM_CONFIRM_MARGIN 16
97#define BOTTOM_COMPACT_MARGIN 8
98#define TOP_NORMAL_MARGIN 20
99#define TOP_CONFIRM_MARGIN 12
100#define TOP_COMPACT_MARGIN 8
101#define TITLE_ENTRY_MARGIN_Y 4
102#define TEXT_ENTRY_FONT LARGE_MEDIUM_1BPP_FONT
103#define TEXT_ENTRY_FONT_OBFUSCATED LARGE_OBFUSCATED_MEDIUM_1BPP_FONT
105#define NUMBER_TEXT_SPACE 4
106#define NUMBER_WIDTH 40
107#define DELETE_ICON C_Close_Tiny_24px
110#ifdef USE_PARTIAL_BUTTONS
111#if defined(TARGET_FLEX)
112#define LEFT_HALF_ICON C_left_half_64px
113#define SUGGESTION_CONTAINER_HEIGHT 92
114#elif defined(TARGET_APEX)
115#define LEFT_HALF_ICON C_half_disc_left_40px_1bpp
116#define SUGGESTION_CONTAINER_HEIGHT 56
121#define SUGGESTION_BUTTONS_SIDE_MARGIN BORDER_MARGIN
122#if defined(TARGET_APEX)
123#define LINE_THICKNESS 1
124#define LINE_COLOR BLACK
126#define LINE_THICKNESS 2
127#define LINE_COLOR LIGHT_GRAY
143static char numText[5];
144static uint8_t nbActiveButtons;
145static uint8_t currentFirstButtonToken;
146#ifdef USE_PARTIAL_BUTTONS
159 uint8_t currentLeftButtonIndex)
161 bool needRefresh =
false;
167 && (currentLeftButtonIndex
168 < (uint32_t) (nbActiveButtons - NB_MAX_VISIBLE_SUGGESTION_BUTTONS))) {
171 currentLeftButtonIndex += NB_MAX_VISIBLE_SUGGESTION_BUTTONS;
174 button = (
nbgl_button_t *) container->children[FIRST_BUTTON_INDEX];
177 button->text = choiceTexts[currentLeftButtonIndex];
179 layoutInt, (
nbgl_obj_t *) button, currentFirstButtonToken + currentLeftButtonIndex);
181 for (i = 1; i < NB_MAX_VISIBLE_SUGGESTION_BUTTONS; i++) {
183 button = (
nbgl_button_t *) container->children[FIRST_BUTTON_INDEX + i];
185 if (currentLeftButtonIndex < (uint32_t) (nbActiveButtons - i)) {
186 button->text = choiceTexts[currentLeftButtonIndex + i];
189 currentFirstButtonToken + currentLeftButtonIndex + i);
196 page = currentLeftButtonIndex / NB_MAX_VISIBLE_SUGGESTION_BUTTONS;
200 && (currentLeftButtonIndex > (NB_MAX_VISIBLE_SUGGESTION_BUTTONS - 1))) {
203 currentLeftButtonIndex -= NB_MAX_VISIBLE_SUGGESTION_BUTTONS;
204 for (i = 0; i < NB_MAX_VISIBLE_SUGGESTION_BUTTONS; i++) {
206 button = (
nbgl_button_t *) container->children[FIRST_BUTTON_INDEX + i];
209 button->text = choiceTexts[currentLeftButtonIndex + i];
212 currentFirstButtonToken + currentLeftButtonIndex + i);
214 page = currentLeftButtonIndex / NB_MAX_VISIBLE_SUGGESTION_BUTTONS;
218 if (container->children[FIRST_BUTTON_INDEX] != NULL) {
219 container->children[FIRST_BUTTON_INDEX]->alignmentMarginX = SUGGESTION_BUTTONS_SIDE_MARGIN;
220 container->children[FIRST_BUTTON_INDEX]->alignmentMarginY = 0;
221 container->children[FIRST_BUTTON_INDEX]->alignment =
TOP_LEFT;
222 container->children[FIRST_BUTTON_INDEX]->alignTo = (
nbgl_obj_t *) container;
226 if (container->children[SECOND_BUTTON_INDEX] != NULL) {
227 container->children[SECOND_BUTTON_INDEX]->alignmentMarginX =
INTERNAL_MARGIN;
228 container->children[SECOND_BUTTON_INDEX]->alignmentMarginY = 0;
229 container->children[SECOND_BUTTON_INDEX]->alignment =
MID_RIGHT;
230 container->children[SECOND_BUTTON_INDEX]->alignTo = container->children[FIRST_BUTTON_INDEX];
232#ifndef USE_PARTIAL_BUTTONS
234 if (container->children[THIRD_BUTTON_INDEX] != NULL) {
235 container->children[THIRD_BUTTON_INDEX]->alignmentMarginX = 0;
236 container->children[THIRD_BUTTON_INDEX]->alignmentMarginY =
INTERNAL_MARGIN;
237 container->children[THIRD_BUTTON_INDEX]->alignment =
BOTTOM_MIDDLE;
238 container->children[THIRD_BUTTON_INDEX]->alignTo = container->children[FIRST_BUTTON_INDEX];
242 if (container->children[FOURTH_BUTTON_INDEX] != NULL) {
243 container->children[FOURTH_BUTTON_INDEX]->alignmentMarginX =
INTERNAL_MARGIN;
244 container->children[FOURTH_BUTTON_INDEX]->alignmentMarginY = 0;
245 container->children[FOURTH_BUTTON_INDEX]->alignment =
MID_RIGHT;
246 container->children[FOURTH_BUTTON_INDEX]->alignTo = container->children[THIRD_BUTTON_INDEX];
254 indicator->activePage = page;
256#ifdef USE_PARTIAL_BUTTONS
258 if (currentLeftButtonIndex > 0) {
259 container->children[LEFT_HALF_INDEX] = (
nbgl_obj_t *) partialButtonImages[0];
262 container->children[LEFT_HALF_INDEX] = NULL;
265 if (currentLeftButtonIndex < (nbActiveButtons - NB_MAX_VISIBLE_SUGGESTION_BUTTONS)) {
266 container->children[RIGHT_HALF_INDEX] = (
nbgl_obj_t *) partialButtonImages[1];
269 container->children[RIGHT_HALF_INDEX] = NULL;
286 if ((container->nbChildren < 2) || (container->children[1]->type !=
CONTAINER)) {
292 && (suggestionsContainer->nbChildren == NB_SUGGESTION_CHILDREN)
293 && (nbActiveButtons > NB_MAX_VISIBLE_SUGGESTION_BUTTONS)) {
295 while (i < (uint32_t) nbActiveButtons) {
296 if (((
nbgl_button_t *) suggestionsContainer->children[FIRST_BUTTON_INDEX])->text
303 if (i < (uint32_t) nbActiveButtons) {
304 if (updateSuggestionButtons(layoutInt, suggestionsContainer, eventType, i)) {
305 os_io_seph_cmd_piezo_play_tune(TUNE_TAP_CASUAL);
328 uint16_t textEntryHeight = (compactMode ? TEXT_ENTRY_COMPACT_HEIGHT : TEXT_ENTRY_NORMAL_HEIGHT);
329 bool withCross = ((text != NULL) && (strlen(text) > 0));
333 mainContainer->nbChildren = 2;
336 mainContainer->obj.alignment =
CENTER;
341 textArea->textColor =
BLACK;
342 textArea->text = title;
343 textArea->textAlignment =
CENTER;
344 textArea->fontId = SMALL_REGULAR_FONT;
345 textArea->wrapping =
true;
349 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
350 mainContainer->children[0] = (
nbgl_obj_t *) textArea;
351 mainContainer->obj.area.height = textArea->obj.area.height + TITLE_ENTRY_MARGIN_Y;
356 container->nbChildren = 4;
364 textArea->textColor =
BLACK;
365 snprintf(numText,
sizeof(numText),
"%d.", number);
366 textArea->text = numText;
367 textArea->textAlignment =
CENTER;
368 textArea->fontId = TEXT_ENTRY_FONT;
369 textArea->obj.area.width = NUMBER_WIDTH;
373 container->children[NUMBER_INDEX] = (
nbgl_obj_t *) textArea;
378 enteredTextFont = TEXT_ENTRY_FONT_OBFUSCATED;
383 textArea->textColor =
BLACK;
384 textArea->text = text;
386 textArea->fontId = enteredTextFont;
387 textArea->obj.area.width =
AVAILABLE_WIDTH - DELETE_ICON.width - NUMBER_TEXT_SPACE;
389 textArea->obj.alignmentMarginX = NUMBER_TEXT_SPACE;
390 textArea->obj.alignTo = container->children[0];
392 textArea->obj.area.width -= textArea->obj.alignmentMarginX + NUMBER_WIDTH;
398 textArea->autoHideLongLine =
true;
400 container->children[TEXT_INDEX] = (
nbgl_obj_t *) textArea;
401 container->obj.area.height = textEntryHeight;
405 image->buffer = &DELETE_ICON;
407 image->foregroundColor = withCross ?
BLACK :
WHITE;
413 image->obj.alignTo = container->children[TEXT_INDEX];
414 image->obj.alignmentMarginX = NUMBER_TEXT_SPACE;
415 image->obj.touchMask = (1 <<
TOUCHED);
417 container->children[DELETE_INDEX] = (
nbgl_obj_t *) image;
421 line->lineColor = LINE_COLOR;
425 line->obj.area.height = LINE_THICKNESS;
427 line->thickness = LINE_THICKNESS;
429 container->children[LINE_INDEX] = (
nbgl_obj_t *) line;
432 mainContainer->children[1] = (
nbgl_obj_t *) container;
433 mainContainer->obj.area.height += container->obj.area.height;
435 return mainContainer;
439 uint8_t nbUsedButtons,
440 const char **buttonTexts,
441 int firstButtonToken,
448 nbActiveButtons = nbUsedButtons;
449 currentFirstButtonToken = firstButtonToken;
451 suggestionsContainer->layout =
VERTICAL;
453#ifndef USE_PARTIAL_BUTTONS
455 suggestionsContainer->obj.area.height = 2 * SMALL_BUTTON_HEIGHT +
INTERNAL_MARGIN + 28;
458 suggestionsContainer->obj.area.height = SUGGESTION_CONTAINER_HEIGHT;
460 suggestionsContainer->nbChildren = NB_SUGGESTION_CHILDREN;
461 suggestionsContainer->children
465 suggestionsContainer->obj.alignmentMarginY = BOTTOM_NORMAL_MARGIN;
470 suggestionsFontId = SMALL_OBFUSCATED_BOLD_1BPP_FONT;
474 for (
int i = 0; i < NB_MAX_VISIBLE_SUGGESTION_BUTTONS; i++) {
482 button->innerColor =
BLACK;
483 button->borderColor =
BLACK;
484 button->foregroundColor =
WHITE;
485 button->obj.area.width
487 button->obj.area.height = SMALL_BUTTON_HEIGHT;
488 button->radius = SMALL_BUTTON_RADIUS_INDEX;
489 button->fontId = suggestionsFontId;
490 button->text = buttonTexts[i];
491 button->obj.touchMask = (1 <<
TOUCHED);
494 suggestionsContainer->children[i + FIRST_BUTTON_INDEX] = (
nbgl_obj_t *) button;
500 indicator->activePage = 0;
501 indicator->nbPages = (nbActiveButtons + NB_MAX_VISIBLE_SUGGESTION_BUTTONS - 1)
502 / NB_MAX_VISIBLE_SUGGESTION_BUTTONS;
503 indicator->obj.area.width
504 = (indicator->nbPages < 3) ? STEPPER_2_PAGES_WIDTH : STEPPER_N_PAGES_WIDTH;
507 suggestionsContainer->children[PAGE_INDICATOR_INDEX] = (
nbgl_obj_t *) indicator;
508#ifdef USE_PARTIAL_BUTTONS
512 partialButtonImages[0]->buffer = &LEFT_HALF_ICON;
513 partialButtonImages[0]->obj.alignment =
TOP_LEFT;
514 partialButtonImages[0]->foregroundColor =
BLACK;
516 partialButtonImages[1]->buffer = &LEFT_HALF_ICON;
517 partialButtonImages[1]->obj.alignment =
TOP_RIGHT;
518 partialButtonImages[1]->foregroundColor =
BLACK;
520 updateSuggestionButtons(layoutInt, suggestionsContainer, 0, 0);
523 return suggestionsContainer;
543 button->obj.alignmentMarginY = compactMode ? BOTTOM_COMPACT_MARGIN : BOTTOM_CONFIRM_MARGIN;
545 button->foregroundColor =
WHITE;
547 button->innerColor =
BLACK;
548 button->borderColor =
BLACK;
549 button->obj.touchMask = (1 <<
TOUCHED);
556 button->text = PIC(text);
557 button->fontId = SMALL_BOLD_1BPP_FONT;
559 button->obj.area.height = BUTTON_DIAMETER;
560 button->radius = BUTTON_RADIUS;
582 if (layout == NULL) {
598 keyboard->obj.alignmentMarginY = 56;
602 keyboard->callback = PIC(kbdInfo->
callback);
604 keyboard->mode = kbdInfo->
mode;
605 keyboard->keyMask = kbdInfo->
keyMask;
606 keyboard->casing = kbdInfo->casing;
616 = keyboard->obj.area.height + keyboard->obj.alignmentMarginY;
655 if (layout == NULL) {
662 if ((keyboard == NULL) || (keyboard->obj.type !=
KEYBOARD)) {
665 keyboard->keyMask = keyMask;
667 keyboard->casing = casing;
682bool nbgl_layoutKeyboardNeedsRefresh(
nbgl_layout_t *layout, uint8_t index)
688 if (layout == NULL) {
695 if ((keyboard == NULL) || (keyboard->obj.type !=
KEYBOARD)) {
698 if (keyboard->needsRefresh) {
699 keyboard->needsRefresh =
false;
733 uint8_t enteredTextIndex = (layoutInt->
container->nbChildren == 2) ? 0 : 1;
734 bool compactMode = ((layoutInt->
container->children[enteredTextIndex + 1] != NULL)
735 && (layoutInt->
container->children[enteredTextIndex + 1]->type ==
BUTTON)
736 && (layoutInt->
container->nbChildren == 3));
739 if (layout == NULL) {
745 container = addTextEntry(layoutInt, NULL, text, numbered, number, token, compactMode,
false);
750 if (layoutInt->
container->children[enteredTextIndex + 1] != NULL) {
751 if (layoutInt->
container->children[enteredTextIndex + 1]->type ==
BUTTON) {
754 container->obj.alignmentMarginY
755 -= (button->obj.area.height + button->obj.alignmentMarginY
756 + (compactMode ? TOP_COMPACT_MARGIN : TOP_NORMAL_MARGIN))
762 container->obj.alignmentMarginY
763 -= (suggestionContainer->obj.area.height + suggestionContainer->obj.alignmentMarginY
764 + (compactMode ? TOP_COMPACT_MARGIN : TOP_NORMAL_MARGIN))
770 if (layoutInt->
container->nbChildren == 3) {
771 container->obj.alignmentMarginY += layoutInt->
container->children[0]->area.height / 2;
801 uint8_t enteredTextIndex = (layoutInt->
container->nbChildren == 2) ? 0 : 1;
804 if (layout == NULL) {
811 if ((container == NULL) || (container->obj.type !=
CONTAINER)) {
815 if ((textArea == NULL) || (textArea->obj.type !=
TEXT_AREA)) {
818 textArea->text = text;
827 snprintf(numText,
sizeof(numText),
"%d.", number);
828 textArea->text = numText;
857 uint8_t enteredTextIndex = (layoutInt->
container->nbChildren == 2) ? 0 : 1;
858 bool compactMode = (layoutInt->
container->nbChildren == 3);
861 if (layout == NULL) {
865 button = addConfirmationButton(layoutInt, active, text, token, tuneId, compactMode);
868 if (layoutInt->
container->children[enteredTextIndex] != NULL) {
870 ->obj.alignmentMarginY
871 -= (button->obj.area.height + button->obj.alignmentMarginY
872 + (compactMode ? TOP_COMPACT_MARGIN : TOP_NORMAL_MARGIN))
890int nbgl_layoutUpdateConfirmationButton(
nbgl_layout_t *layout,
897 uint8_t enteredTextIndex = (layoutInt->
container->nbChildren == 2) ? 0 : 1;
902 if (layout == NULL) {
908 if ((button == NULL) || (button->obj.type !=
BUTTON)) {
914 button->innerColor =
BLACK;
915 button->borderColor =
BLACK;
916 button->obj.touchMask = (1 <<
TOUCHED);
942 if (layout == NULL) {
946 textEntryContainer = addTextEntry(layoutInt,
960 = addSuggestionButtons(layoutInt,
977 textEntryContainer->obj.alignmentMarginY
978 -= (suggestionsContainer->obj.area.height + suggestionsContainer->obj.alignmentMarginY
988 (content->
title != NULL));
991 textEntryContainer->obj.alignmentMarginY
992 -= (button->obj.area.height + button->obj.alignmentMarginY
993 + ((content->
title != NULL) ? TOP_COMPACT_MARGIN : TOP_CONFIRM_MARGIN))
996 return layoutInt->
container->obj.area.height;
1018 if (layout == NULL) {
1029 snprintf(numText,
sizeof(numText),
"%d.", content->
number);
1035 textArea->text = content->
text;
1036 textArea->fontId = content->
obfuscated ? TEXT_ENTRY_FONT_OBFUSCATED : TEXT_ENTRY_FONT;
1040 image = (
nbgl_image_t *) container->children[DELETE_INDEX];
1041 if ((textArea->text != NULL) && (strlen(textArea->text) > 0)) {
1042 if (image->foregroundColor ==
WHITE) {
1043 image->foregroundColor =
BLACK;
1048 if (image->foregroundColor ==
BLACK) {
1049 image->foregroundColor =
WHITE;
1065 for (i = 0; i < NB_MAX_VISIBLE_SUGGESTION_BUTTONS; i++) {
1069 = (
nbgl_button_t *) suggestionsContainer->children[i + FIRST_BUTTON_INDEX];
1071 if (i < nbActiveButtons) {
1073 button->text = choiceTexts[i];
1075 layoutInt, (
nbgl_obj_t *) button, currentFirstButtonToken + i);
1078 button->text = NULL;
1082 suggestionsContainer->forceClean =
true;
1087 indicator->nbPages = (nbActiveButtons + NB_MAX_VISIBLE_SUGGESTION_BUTTONS - 1)
1088 / NB_MAX_VISIBLE_SUGGESTION_BUTTONS;
1089 indicator->activePage = 0;
1090 updateSuggestionButtons(layoutInt, suggestionsContainer, 0, 0);
1097 if ((button == NULL) || (button->obj.type !=
BUTTON)) {
1103#if NB_COLOR_BITS == 4
1109 button->innerColor =
BLACK;
1110 button->borderColor =
BLACK;
1111 button->obj.touchMask = (1 <<
TOUCHED);
#define LOG_DEBUG(__logger,...)
Middle Level API of the new BOLOS Graphical Library.
uint16_t nbgl_getSingleLineTextWidth(nbgl_font_id_e fontId, const char *text)
uint8_t nbgl_getFontHeight(nbgl_font_id_e fontId)
uint16_t nbgl_getTextHeightInWidth(nbgl_font_id_e fontId, const char *text, uint16_t maxWidth, bool wrapping)
Font screen low-Level driver API, to draw elementary forms.
int nbgl_layoutAddKeyboard(nbgl_layout_t *layout, const nbgl_layoutKbd_t *kbdInfo)
Creates a keyboard on bottom of the screen, with the given configuration.
int nbgl_layoutUpdateKeyboard(nbgl_layout_t *layout, uint8_t index, uint32_t keyMask)
Updates an existing keyboard on bottom of the screen, with the given configuration.
int nbgl_layoutUpdateEnteredText(nbgl_layout_t *layout, uint8_t index, const char *text)
Updates an existing "text entry" area, created with nbgl_layoutAddEnteredText()
int nbgl_layoutAddEnteredText(nbgl_layout_t *layout, const char *text, bool lettersOnly)
Adds a "text entry" area under the previously entered object. The max number of really displayable ch...
#define NB_MAX_SUGGESTION_BUTTONS
void * nbgl_layout_t
type shared externally
#define NBGL_INVALID_TOKEN
@ KEYBOARD_WITH_BUTTON
text entry area + confirmation button
@ KEYBOARD_WITH_SUGGESTIONS
text entry area + suggestion buttons
Internal functions/constants of NBGL layout layer.
@ SWIPE_USAGE_SUGGESTIONS
#define KEYBOARD_FOOTER_TYPE
bool keyboardSwipeCallback(nbgl_layoutInternal_t *layoutInt, nbgl_obj_t *obj, nbgl_touchType_t eventType)
void layoutAddObject(nbgl_layoutInternal_t *layout, nbgl_obj_t *obj)
adds the given obj to the layout
void layoutUpdateCallbackObjToken(nbgl_layoutInternal_t *layout, nbgl_obj_t *obj, uint8_t token)
layoutObj_t * layoutAddCallbackObj(nbgl_layoutInternal_t *layout, nbgl_obj_t *obj, uint8_t token, tune_index_e tuneId)
API to draw all basic graphic objects.
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_text_area_s nbgl_text_area_t
struct to represent a text area (TEXT_AREA type)
void nbgl_objDraw(nbgl_obj_t *obj)
nbgl_obj_t ** nbgl_containerPoolGet(uint8_t nbObjs, uint8_t layer)
keyboardCase_t
Letters casing in which to open/set the keyboard.
nbgl_obj_t * nbgl_objPoolGet(nbgl_obj_type_t type, uint8_t layer)
struct PACKED__ nbgl_keyboard_s nbgl_keyboard_t
struct to represent a keyboard (KEYBOARD type)
void nbgl_refreshSpecial(nbgl_refresh_mode_t mode)
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)
struct PACKED__ nbgl_button_s nbgl_button_t
struct to represent a button (BUTTON type) that can contain a text and/or an icon
#define INACTIVE_TEXT_COLOR
#define KEYBOARD_KEY_HEIGHT
struct PACKED__ nbgl_container_s nbgl_container_t
struct to represent a container (CONTAINER type)
@ CURRENT_INDICATOR
only current page dash is black
struct PACKED__ nbgl_obj_s nbgl_obj_t
Common structure for all graphical objects.
nbgl_touchType_t
The different types of Touchscreen events.
@ VERTICAL
from top to bottom
@ HORIZONTAL
from left to right
@ IMAGE
Bitmap (y and height must be multiple of 4 on Stax)
@ BUTTON
Rounded rectangle button with icon and/or text.
@ PAGE_INDICATOR
horizontal bar to indicate position within pages
@ LINE
Vertical or Horizontal line.
@ CONTAINER
Empty container.
@ TEXT_AREA
Area to contain text line(s)
#define NO_TRANSFORMATION
@ FULL_COLOR_PARTIAL_REFRESH
to be used for small partial refresh (radio buttons, switches)
Structure containing all information about the current layout.
nbgl_container_t * footerContainer
container used to store footer (buttons, nav....)
uint8_t layer
layer in screen stack
nbgl_swipe_usage_t swipeUsage
nbgl_container_t * container
nbgl_layoutFooterType_t footerType
type of footer
nbgl_obj_t ** children
children for main screen
This structure contains info to build a keyboard with nbgl_layoutAddKeyboard()
bool lettersOnly
if true, only display letter keys and Backspace
keyboardCallback_t callback
function called when an active key is pressed
keyboardMode_t mode
keyboard mode to start with
This structure contains info to build a keyboard content (controls that are linked to keyboard)
uint8_t number
if numbered is true, number used to build 'number.' text
const char * text
already entered text
nbgl_layoutKeyboardContentType_t type
type of content
nbgl_layoutSuggestionButtons_t suggestionButtons
nbgl_layoutConfirmationButton_t confirmationButton
used if type is KEYBOARD_WITH_SUGGESTIONS
const char * title
centered title explaining the screen
bool numbered
if set to true, the text is preceded on the left by 'number.'