17#include "localization.h"
27#include "os_io_seph_ux.h"
29#include "os_helpers.h"
36#define INTERNAL_SPACE 16
38#define INNER_MARGIN 12
40#define NB_MAX_LAYOUTS 3
43#define NB_MAX_CONTAINER_CHILDREN 20
45#define TAG_VALUE_ICON_WIDTH 32
47#if defined(TARGET_STAX)
48#define RADIO_CHOICE_HEIGHT 96
49#define BAR_INTERVALE 12
50#define FOOTER_BUTTON_HEIGHT 128
51#define FOOTER_IN_PAIR_HEIGHT 80
52#define ROUNDED_AND_FOOTER_FOOTER_HEIGHT 192
53#define FOOTER_TEXT_AND_NAV_WIDTH 160
54#define TAP_TO_CONTINUE_MARGIN 24
55#define SUB_HEADER_MARGIN 24
56#define PRE_FIRST_TEXT_MARGIN 24
57#define INTER_PARAGRAPHS_MARGIN 40
58#define PRE_TITLE_MARGIN 24
59#define PRE_DESCRIPTION_MARGIN 16
60#define PRE_FIRST_ROW_MARGIN 32
61#define INTER_ROWS_MARGIN 16
62#define QR_PRE_TEXT_MARGIN 24
63#define QR_INTER_TEXTS_MARGIN 40
64#define SPINNER_TEXT_MARGIN 20
65#define SPINNER_INTER_TEXTS_MARGIN 20
66#define BAR_TEXT_MARGIN 24
67#define BAR_INTER_TEXTS_MARGIN 16
68#define LEFT_CONTENT_TEXT_PADDING 0
69#define BUTTON_FROM_BOTTOM_MARGIN 4
70#define TOP_BUTTON_MARGIN VERTICAL_BORDER_MARGIN
71#define TOP_BUTTON_MARGIN_WITH_ACTION VERTICAL_BORDER_MARGIN
72#define SINGLE_BUTTON_MARGIN 24
73#define LONG_PRESS_PROGRESS_HEIGHT 8
74#define LONG_PRESS_PROGRESS_ALIGN 1
75#define LEFT_CONTENT_ICON_TEXT_X 16
76#define TIP_BOX_MARGIN_Y 24
77#define TIP_BOX_TEXT_ICON_MARGIN 24
78#elif defined(TARGET_FLEX)
79#define RADIO_CHOICE_HEIGHT 92
80#define BAR_INTERVALE 16
81#define FOOTER_BUTTON_HEIGHT 136
82#define FOOTER_IN_PAIR_HEIGHT 88
83#define ROUNDED_AND_FOOTER_FOOTER_HEIGHT 208
84#define FOOTER_TEXT_AND_NAV_WIDTH 192
85#define TAP_TO_CONTINUE_MARGIN 30
86#define SUB_HEADER_MARGIN 28
87#define PRE_FIRST_TEXT_MARGIN 0
88#define INTER_PARAGRAPHS_MARGIN 24
89#define PRE_TITLE_MARGIN 16
90#define PRE_DESCRIPTION_MARGIN 24
91#define PRE_FIRST_ROW_MARGIN 32
92#define INTER_ROWS_MARGIN 24
93#define QR_PRE_TEXT_MARGIN 24
94#define QR_INTER_TEXTS_MARGIN 28
95#define SPINNER_TEXT_MARGIN 24
96#define SPINNER_INTER_TEXTS_MARGIN 16
97#define BAR_TEXT_MARGIN 24
98#define BAR_INTER_TEXTS_MARGIN 16
99#define LEFT_CONTENT_TEXT_PADDING 4
100#define BUTTON_FROM_BOTTOM_MARGIN 4
101#define TOP_BUTTON_MARGIN VERTICAL_BORDER_MARGIN
102#define TOP_BUTTON_MARGIN_WITH_ACTION VERTICAL_BORDER_MARGIN
103#define SINGLE_BUTTON_MARGIN 24
104#define LONG_PRESS_PROGRESS_HEIGHT 8
105#define LONG_PRESS_PROGRESS_ALIGN 1
106#define LEFT_CONTENT_ICON_TEXT_X 16
107#define TIP_BOX_MARGIN_Y 24
108#define TIP_BOX_TEXT_ICON_MARGIN 32
109#elif defined(TARGET_APEX)
110#define RADIO_CHOICE_HEIGHT 68
111#define BAR_INTERVALE 8
112#define FOOTER_BUTTON_HEIGHT 88
113#define FOOTER_IN_PAIR_HEIGHT 60
114#define ROUNDED_AND_FOOTER_FOOTER_HEIGHT 128
115#define FOOTER_TEXT_AND_NAV_WIDTH 120
116#define TAP_TO_CONTINUE_MARGIN 30
117#define SUB_HEADER_MARGIN 16
118#define PRE_FIRST_TEXT_MARGIN 0
119#define INTER_PARAGRAPHS_MARGIN 16
120#define PRE_TITLE_MARGIN 16
121#define PRE_DESCRIPTION_MARGIN 12
122#define PRE_FIRST_ROW_MARGIN 24
123#define INTER_ROWS_MARGIN 12
124#define QR_PRE_TEXT_MARGIN 16
125#define QR_INTER_TEXTS_MARGIN 20
126#define SPINNER_TEXT_MARGIN 16
127#define SPINNER_INTER_TEXTS_MARGIN 16
128#define BAR_TEXT_MARGIN 16
129#define BAR_INTER_TEXTS_MARGIN 12
130#define LEFT_CONTENT_TEXT_PADDING 4
131#define BUTTON_FROM_BOTTOM_MARGIN 0
132#define TOP_BUTTON_MARGIN 12
133#define TOP_BUTTON_MARGIN_WITH_ACTION 0
134#define SINGLE_BUTTON_MARGIN 16
135#define LONG_PRESS_PROGRESS_HEIGHT 4
136#define LONG_PRESS_PROGRESS_ALIGN 0
137#define LEFT_CONTENT_ICON_TEXT_X 8
138#define TIP_BOX_MARGIN_Y 12
139#define TIP_BOX_TEXT_ICON_MARGIN 20
141#error Undefined target
145#define SPINNER_REFRESH_PERIOD 400
192static uint8_t nbTouchableControls = 0;
200#if defined(TARGET_FLEX)
202#define HOLD_TO_APPROVE_STEP_PERCENT (7)
204#define HOLD_TO_APPROVE_STEP_DURATION_MS (100)
206#define HOLD_TO_APPROVE_FIRST_STEP (0)
207#elif defined(TARGET_STAX)
208#define HOLD_TO_APPROVE_STEP_PERCENT (25)
209#define HOLD_TO_APPROVE_STEP_DURATION_MS (400)
210#define HOLD_TO_APPROVE_FIRST_STEP (1)
211#elif defined(TARGET_APEX)
212#define HOLD_TO_APPROVE_STEP_PERCENT (20)
213#define HOLD_TO_APPROVE_STEP_DURATION_MS (300)
214#define HOLD_TO_APPROVE_FIRST_STEP (1)
217static inline uint8_t get_hold_to_approve_percent(uint32_t touch_duration)
219 uint8_t current_step_nb
220 = (touch_duration / HOLD_TO_APPROVE_STEP_DURATION_MS) + HOLD_TO_APPROVE_FIRST_STEP;
221 return (current_step_nb * HOLD_TO_APPROVE_STEP_PERCENT);
225static bool getLayoutAndLayoutObj(
nbgl_obj_t *obj,
232 if ((topLayout) && (topLayout->
isUsed)) {
239 "getLayoutAndLayoutObj(): obj found in layout %p "
240 "nbUsedCallbackObjs = %d\n",
253static void radioTouchCallback(
nbgl_obj_t *obj,
266 bool needRefresh =
false;
272 if (getLayoutAndLayoutObj(obj, &layout, &layoutObj) ==
false) {
274 if (getLayoutAndLayoutObj(obj->parent, &layout, &layoutObj) ==
false) {
277 "touchCallback(): eventType = %d, obj = %p, no active layout or obj not found\n",
295 layoutObj->
index = eventType;
344 layoutObj->
index = lSwitch->state;
350 radioTouchCallback(obj, eventType, layout);
357 longTouchCallback(obj, eventType, layout, layoutObj);
362#ifdef HAVE_PIEZO_SOUND
364 os_io_seph_cmd_piezo_play_tune(layoutObj->
tuneId);
391 uint8_t new_state = get_hold_to_approve_percent(touchDuration);
395 bool trigger_callback = (new_state >= 100) && (progressBar->state < 100);
398 if (new_state >= 100) {
403 if (new_state != progressBar->state) {
404 progressBar->partialRedraw =
true;
405 progressBar->state = new_state;
414 if (trigger_callback) {
425 progressBar->partialRedraw =
true;
426 progressBar->state = 0;
436static void radioTouchCallback(
nbgl_obj_t *obj,
440 uint8_t i =
NB_MAX_LAYOUTS, radioIndex = 0, foundRadio = 0xFF, foundRadioIndex;
448 while (i < layout->nbUsedCallbackObjs) {
458 foundRadioIndex = radioIndex;
460 textArea->textColor =
BLACK;
461 textArea->fontId = SMALL_BOLD_FONT;
483 textArea->fontId = SMALL_REGULAR_FONT;
491 if (foundRadio != 0xFF) {
493#ifdef HAVE_PIEZO_SOUND
505static void spinnerTickerCallback(
void)
510 if (!topLayout || !topLayout->
isUsed) {
515 while (i < topLayout->container->nbChildren) {
518 if (container->nbChildren && (container->children[0]->type ==
SPINNER)) {
523 spinner->position = 0;
535static void animTickerCallback(
void)
546 while (i < layout->container->nbChildren) {
549 if (container->children[1]->type ==
IMAGE) {
588static nbgl_line_t *createHorizontalLine(uint8_t layer)
594 line->obj.area.width = SCREEN_WIDTH;
595 line->obj.area.height = 1;
602static nbgl_line_t *createLeftVerticalLine(uint8_t layer)
608 line->obj.area.width = 1;
609 line->obj.area.height = SCREEN_HEIGHT;
629 layoutObj->
obj = obj;
630 layoutObj->
token = token;
631 layoutObj->
tuneId = tuneId;
680 layoutInt->
container->obj.touchMask = swipesMask;
718 container->nbChildren = 0;
721 container->obj.area.height
722 = LIST_ITEM_MIN_TEXT_HEIGHT
723 + 2 * (itemDesc->
large ? LIST_ITEM_PRE_HEADING_LARGE : LIST_ITEM_PRE_HEADING);
725 container->obj.alignmentMarginX = BORDER_MARGIN;
727 container->obj.alignTo = NULL;
732 container->obj.touchMask = (1 <<
TOUCHED);
733 container->obj.touchId =
CONTROLS_ID + nbTouchableControls;
734 nbTouchableControls++;
738 if (itemDesc->
text != NULL) {
740 textArea->textColor = color;
741 textArea->text = PIC(itemDesc->
text);
742 textArea->onDrawCallback = NULL;
743 textArea->fontId = fontId;
744 textArea->wrapping =
true;
745 textArea->obj.area.width = container->obj.area.width;
748 textArea->obj.area.width
753 textArea->obj.area.width
757 textArea->obj.area.width -= SWITCH_ICON.width + BAR_INTERVALE;
759 textArea->obj.area.height =
MAX(
760 LIST_ITEM_MIN_TEXT_HEIGHT,
762 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping));
765 textArea->obj.alignmentMarginY
766 = itemDesc->
large ? LIST_ITEM_PRE_HEADING_LARGE : LIST_ITEM_PRE_HEADING;
767 if (textArea->obj.area.height > LIST_ITEM_MIN_TEXT_HEIGHT) {
768 textArea->obj.alignmentMarginY
769 -= (textArea->obj.area.height - LIST_ITEM_MIN_TEXT_HEIGHT) / 2;
772 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
773 container->nbChildren++;
779 imageLeft->foregroundColor = color;
780 imageLeft->buffer = PIC(itemDesc->
iconLeft);
782 imageLeft->obj.alignment =
MID_LEFT;
783 imageLeft->obj.alignTo = (
nbgl_obj_t *) textArea;
784 imageLeft->obj.alignmentMarginX = BAR_INTERVALE;
785 container->children[container->nbChildren] = (
nbgl_obj_t *) imageLeft;
786 container->nbChildren++;
788 if (textArea != NULL) {
789 textArea->obj.alignmentMarginX = imageLeft->buffer->width + BAR_INTERVALE;
795 imageRight->foregroundColor = color;
796 imageRight->buffer = PIC(itemDesc->
iconRight);
799 imageRight->obj.alignmentMarginX = BAR_INTERVALE;
800 imageRight->obj.alignTo = (
nbgl_obj_t *) textArea;
802 container->children[container->nbChildren] = (
nbgl_obj_t *) imageRight;
803 container->nbChildren++;
807 switchObj->onColor =
BLACK;
809 switchObj->state = itemDesc->
state;
811 switchObj->obj.alignmentMarginX = BAR_INTERVALE;
812 switchObj->obj.alignTo = (
nbgl_obj_t *) textArea;
814 container->children[container->nbChildren] = (
nbgl_obj_t *) switchObj;
815 container->nbChildren++;
818 if (itemDesc->
subText != NULL) {
822 subTextArea->textColor = color;
823 subTextArea->text = PIC(itemDesc->
subText);
824 subTextArea->textAlignment =
MID_LEFT;
825 subTextArea->fontId = SMALL_REGULAR_FONT;
827 subTextArea->wrapping =
true;
828 if (itemDesc->
text != NULL) {
830 subTextArea->obj.alignTo = (
nbgl_obj_t *) textArea;
831 subTextArea->obj.alignmentMarginY = LIST_ITEM_HEADING_SUB_TEXT;
834 subTextArea->obj.alignment =
TOP_LEFT;
835 subTextArea->obj.alignmentMarginY = SUB_HEADER_MARGIN;
836 container->obj.area.height = SUB_HEADER_MARGIN;
839 subTextArea->obj.alignmentMarginX
842 subTextArea->obj.area.width = container->obj.area.width;
845 subTextArea->obj.area.width,
846 subTextArea->wrapping);
847 container->children[container->nbChildren] = (
nbgl_obj_t *) subTextArea;
848 container->nbChildren++;
849 container->obj.area.height
850 += subTextArea->obj.area.height + subTextArea->obj.alignmentMarginY;
872 uint16_t fullHeight = 0;
877 container->nbChildren = 0;
882 if (info->
icon != NULL) {
885 image->buffer = PIC(info->
icon);
887 image->obj.alignmentMarginY = info->
iconHug;
889 fullHeight += image->buffer->height + info->
iconHug;
890 container->children[container->nbChildren] = (
nbgl_obj_t *) image;
891 container->nbChildren++;
902 container->children[container->nbChildren] = (
nbgl_obj_t *) anim;
903 container->nbChildren++;
914 tickerCfg.tickerCallback = &animTickerCallback;
919 if (info->
title != NULL) {
922 textArea->text = PIC(info->
title);
923 textArea->textAlignment =
CENTER;
924 textArea->fontId = LARGE_MEDIUM_FONT;
925 textArea->wrapping =
true;
928 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
931 if (container->nbChildren > 0) {
934 textArea->obj.alignmentMarginY = ICON_TITLE_MARGIN + info->
iconHug;
940 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
942 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
943 container->nbChildren++;
950 textArea->textAlignment =
CENTER;
951 textArea->fontId = SMALL_BOLD_FONT;
952 textArea->wrapping =
true;
955 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
958 if (container->nbChildren > 0) {
960 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
961 textArea->obj.alignmentMarginY = VERTICAL_BORDER_MARGIN;
962 if (container->children[container->nbChildren - 1]->type ==
IMAGE) {
963 textArea->obj.alignmentMarginY = VERTICAL_BORDER_MARGIN + info->
iconHug;
966 textArea->obj.alignmentMarginY = TITLE_DESC_MARGIN;
973 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
975 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
976 container->nbChildren++;
983 textArea->textAlignment =
CENTER;
984 textArea->fontId = SMALL_REGULAR_FONT;
985 textArea->wrapping =
true;
988 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
991 if (container->nbChildren > 0) {
993 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
994 if (container->children[container->nbChildren - 1]->type ==
TEXT_AREA) {
996 textArea->obj.alignmentMarginY = TITLE_DESC_MARGIN;
999 textArea->obj.alignmentMarginY = ICON_TITLE_MARGIN + info->
iconHug;
1006 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
1008 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
1009 container->nbChildren++;
1015 textArea->text = PIC(info->
subText);
1016 textArea->textAlignment =
CENTER;
1017 textArea->fontId = SMALL_REGULAR_FONT;
1018 textArea->wrapping =
true;
1021 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1023 textArea->obj.area.height += 2 * 8;
1025 if (container->nbChildren > 0) {
1027 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
1028 textArea->obj.alignmentMarginY = 16;
1029 if (container->children[container->nbChildren - 1]->type ==
IMAGE) {
1030 textArea->obj.alignmentMarginY += info->
iconHug;
1037 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
1039 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
1040 container->nbChildren++;
1043 container->obj.alignment =
CENTER;
1045 container->obj.area.height = fullHeight;
1047 container->obj.area.height += 40;
1070 if (description->
modal) {
1074 if (!gLayout[i].isUsed) {
1075 layout = &gLayout[i];
1081 layout = &gLayout[0];
1082 if (topLayout == NULL) {
1086 if (layout == NULL) {
1095 if (description->
modal) {
1096 if (topLayout != NULL) {
1098 topLayout->
top = layout;
1099 layout->
bottom = topLayout;
1103 layout->
bottom = &gLayout[0];
1104 gLayout[0].
top = layout;
1110 gLayout[0].
top = backgroundTop;
1113 nbTouchableControls = 0;
1118 if (description->
modal) {
1132 layout->
container->obj.area.width = SCREEN_WIDTH;
1133 layout->
container->obj.area.height = SCREEN_HEIGHT;
1145 const char *tapActionText = PIC(description->
tapActionText);
1155 if (strlen(tapActionText) > 0) {
1158 footerDesc.
text.text = tapActionText;
1179 uint16_t swipesMask,
1182 tune_index_e tuneId)
1187 if (layout == NULL) {
1194 layoutInt->
tapText->text = PIC(text);
1196 layoutInt->
tapText->fontId = SMALL_REGULAR_FONT;
1200 layoutInt->
tapText->obj.alignmentMarginY = TAP_TO_CONTINUE_MARGIN;
1218 if (layout == NULL) {
1248 tune_index_e tuneId)
1255 if (layout == NULL) {
1266 button->radius = BUTTON_RADIUS;
1267 button->obj.alignmentMarginX = BORDER_MARGIN;
1268 button->obj.alignmentMarginY = BORDER_MARGIN;
1269 button->foregroundColor =
BLACK;
1270 button->innerColor =
WHITE;
1272 button->obj.touchMask = (1 <<
TOUCHED);
1274 button->icon = PIC(icon);
1319 bool separationLine,
1320 tune_index_e tuneId)
1349 if (layout == NULL) {
1353 if (barLayout->
text == NULL) {
1366 container = addListItem(layoutInt, &itemDesc);
1368 if (container == NULL) {
1371 return container->obj.area.height;
1388 if (layout == NULL) {
1392 if (switchLayout->
text == NULL) {
1396 itemDesc.
text = switchLayout->
text;
1401 itemDesc.
large =
false;
1403 container = addListItem(layoutInt, &itemDesc);
1405 if (container == NULL) {
1408 return container->obj.area.height;
1426 if (layout == NULL) {
1430 itemDesc.
text = text;
1435 container = addListItem(layoutInt, &itemDesc);
1437 if (container == NULL) {
1440 return container->obj.area.height;
1456 const char *subText,
1464 if (layout == NULL) {
1468 itemDesc.
text = text;
1471 itemDesc.
token = token;
1474 itemDesc.
index = index;
1476 container = addListItem(layoutInt, &itemDesc);
1478 if (container == NULL) {
1481 return container->obj.area.height;
1498 if (layout == NULL) {
1504 textArea->text = PIC(text);
1505 textArea->textAlignment =
MID_LEFT;
1506 textArea->fontId = LARGE_MEDIUM_FONT;
1508 textArea->wrapping =
true;
1510 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1513 textArea->obj.alignmentMarginX = BORDER_MARGIN;
1514 if (layoutInt->
container->nbChildren == 0) {
1516 textArea->obj.alignmentMarginY += PRE_FIRST_TEXT_MARGIN;
1519 textArea->obj.alignmentMarginY = INTER_PARAGRAPHS_MARGIN;
1542 const char *description,
1549 if (layout == NULL) {
1555 textArea->textColor =
BLACK;
1556 textArea->text = PIC(title);
1557 textArea->textAlignment =
MID_LEFT;
1558 textArea->fontId = LARGE_MEDIUM_FONT;
1560 textArea->wrapping =
true;
1562 textArea->obj.alignmentMarginX = BORDER_MARGIN;
1563 textArea->obj.alignmentMarginY = PRE_TITLE_MARGIN;
1566 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1572 textArea->textColor =
BLACK;
1573 textArea->text = PIC(description);
1574 textArea->fontId = SMALL_REGULAR_FONT;
1576 textArea->wrapping =
true;
1579 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1580 textArea->textAlignment =
MID_LEFT;
1582 textArea->obj.alignmentMarginX = BORDER_MARGIN;
1583 textArea->obj.alignmentMarginY = PRE_DESCRIPTION_MARGIN;
1590 textArea->text = PIC(info);
1591 textArea->fontId = SMALL_REGULAR_FONT;
1593 textArea->wrapping =
true;
1596 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1597 textArea->textAlignment =
MID_LEFT;
1599 textArea->obj.alignmentMarginX = BORDER_MARGIN;
1600 textArea->obj.alignmentMarginY = 40;
1604 return layoutInt->
container->obj.area.height;
1621 if (layout == NULL) {
1624 for (i = 0; i < choices->
nbChoices; i++) {
1641 container->nbChildren = 2;
1644 container->obj.area.height = RADIO_CHOICE_HEIGHT;
1646 container->obj.alignmentMarginX = BORDER_MARGIN;
1647 container->obj.alignTo = (
nbgl_obj_t *) NULL;
1650 button->activeColor =
BLACK;
1652 button->obj.alignTo = (
nbgl_obj_t *) container;
1655 container->children[1] = (
nbgl_obj_t *) button;
1659#ifdef HAVE_LANGUAGE_PACK
1660 textArea->text = get_ux_loc_string(choices->nameIds[i]);
1664 textArea->text = PIC(choices->
names[i]);
1666 textArea->textAlignment =
MID_LEFT;
1667 textArea->obj.area.width = container->obj.area.width - RADIO_WIDTH;
1669 textArea->obj.alignment =
MID_LEFT;
1670 textArea->obj.alignTo = (
nbgl_obj_t *) container;
1671 container->children[0] = (
nbgl_obj_t *) textArea;
1674 container->obj.touchMask = (1 <<
TOUCHED);
1675 container->obj.touchId =
CONTROLS_ID + nbTouchableControls;
1676 nbTouchableControls++;
1681 textArea->textColor =
BLACK;
1682 textArea->fontId = SMALL_BOLD_FONT;
1687 textArea->fontId = SMALL_REGULAR_FONT;
1691 line = createHorizontalLine(layoutInt->
layer);
1692 line->obj.alignmentMarginY = -1;
1717 if (layout == NULL) {
1724 if (info->
text1 != NULL) {
1732 if (info->
text2 != NULL) {
1740 if (info->
text3 != NULL) {
1748 container = addContentCenter(layoutInt, ¢eredInfo);
1751 container->obj.alignmentMarginX = BORDER_MARGIN;
1752 container->obj.alignmentMarginY = BORDER_MARGIN + info->
offsetY;
1756 container->obj.alignmentMarginY = info->
offsetY;
1759 return container->obj.area.height;
1776 if (layout == NULL) {
1780 container = addContentCenter(layoutInt, info);
1782 return container->obj.area.height;
1800 if (layout == NULL) {
1806 container->nbChildren = info->
nbRows + 1;
1810 container->obj.alignmentMarginX = BORDER_MARGIN;
1814 textArea->textColor =
BLACK;
1815 textArea->text = PIC(info->
title);
1816 textArea->textAlignment =
MID_LEFT;
1817 textArea->fontId = LARGE_MEDIUM_FONT;
1818 textArea->wrapping =
true;
1820 textArea->obj.alignmentMarginY = 24;
1824 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1826 container->obj.area.height += textArea->obj.area.height + textArea->obj.alignmentMarginY;
1828 container->children[0] = (
nbgl_obj_t *) textArea;
1830 for (row = 0; row < info->
nbRows; row++) {
1836 rowContainer->nbChildren = 2;
1841 image->foregroundColor =
BLACK;
1842 image->buffer = PIC(info->
rowIcons[row]);
1843 rowContainer->children[0] = (
nbgl_obj_t *) image;
1846 textArea->textColor =
BLACK;
1847 textArea->text = PIC(info->
rowTexts[row]);
1848 textArea->textAlignment =
MID_LEFT;
1849 textArea->fontId = SMALL_REGULAR_FONT;
1850 textArea->wrapping =
true;
1851 textArea->obj.area.width
1854 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1856 rowContainer->children[1] = (
nbgl_obj_t *) textArea;
1857 rowContainer->obj.area.height
1858 =
MAX(image->buffer->height, textArea->obj.area.height + LEFT_CONTENT_TEXT_PADDING);
1861 rowContainer->obj.alignmentMarginY = PRE_FIRST_ROW_MARGIN;
1864 rowContainer->obj.alignmentMarginY = INTER_ROWS_MARGIN;
1866 container->children[1 + row] = (
nbgl_obj_t *) rowContainer;
1867 container->obj.area.height
1868 += rowContainer->obj.area.height + rowContainer->obj.alignmentMarginY;
1872 return container->obj.area.height;
1890 uint16_t fullHeight = 0;
1893 if (layout == NULL) {
1901 container->nbChildren = 0;
1905 if (strlen(PIC(info->
url)) > 62) {
1928 fullHeight +=
qrcode->obj.area.height;
1930 container->nbChildren++;
1932 if (info->
text1 != NULL) {
1934 textArea->textColor =
BLACK;
1935 textArea->text = PIC(info->
text1);
1936 textArea->textAlignment =
CENTER;
1937 textArea->fontId = (info->
largeText1 ==
true) ? LARGE_MEDIUM_FONT : SMALL_REGULAR_FONT;
1938 textArea->wrapping =
true;
1941 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1943 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
1944 textArea->obj.alignmentMarginY = QR_PRE_TEXT_MARGIN;
1946 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY;
1948 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
1949 container->nbChildren++;
1951 if (info->
text2 != NULL) {
1954 textArea->text = PIC(info->
text2);
1955 textArea->textAlignment =
CENTER;
1956 textArea->fontId = SMALL_REGULAR_FONT;
1957 textArea->wrapping =
true;
1960 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
1962 textArea->obj.alignTo = (
nbgl_obj_t *) container->children[container->nbChildren - 1];
1963 if (info->
text1 != NULL) {
1964 textArea->obj.alignmentMarginY = QR_INTER_TEXTS_MARGIN;
1967 textArea->obj.alignmentMarginY = QR_PRE_TEXT_MARGIN + 8;
1970 fullHeight += textArea->obj.area.height + textArea->obj.alignmentMarginY + 8;
1972 container->children[container->nbChildren] = (
nbgl_obj_t *) textArea;
1973 container->nbChildren++;
1976 if ((fullHeight >= (layoutInt->
container->obj.area.height - 16))
1984 container->obj.area.height = fullHeight;
1987 container->obj.alignment =
CENTER;
1991 container->obj.alignTo
1994 container->obj.alignmentMarginY = info->
offsetY;
2040 .horizontalButtons.leftIcon = info->
leftIcon,
2041 .horizontalButtons.leftToken = info->
leftToken,
2042 .horizontalButtons.rightText = info->
rightText,
2043 .horizontalButtons.rightToken = info->
rightToken,
2044 .horizontalButtons.tuneId = info->
tuneId};
2066 if (layout == NULL) {
2070 for (i = 0; i < list->
nbPairs; i++) {
2072 uint16_t fullHeight = 0;
2075 if (list->
pairs != NULL) {
2076 pair = &list->
pairs[i];
2093 itemTextArea->text = PIC(pair->
item);
2094 itemTextArea->textAlignment =
MID_LEFT;
2095 itemTextArea->fontId = SMALL_REGULAR_FONT;
2096 itemTextArea->wrapping =
true;
2099 itemTextArea->fontId, itemTextArea->text,
AVAILABLE_WIDTH, itemTextArea->wrapping);
2102 itemTextArea->obj.alignmentMarginX = 0;
2103 itemTextArea->obj.alignmentMarginY = 0;
2104 itemTextArea->obj.alignTo = NULL;
2105 container->children[container->nbChildren] = (
nbgl_obj_t *) itemTextArea;
2106 container->nbChildren++;
2108 fullHeight += itemTextArea->obj.area.height;
2111 valueTextArea->textColor =
BLACK;
2112 valueTextArea->text = PIC(pair->
value);
2113 valueTextArea->textAlignment =
MID_LEFT;
2115 valueTextArea->fontId = SMALL_BOLD_FONT;
2118 valueTextArea->fontId = LARGE_MEDIUM_FONT;
2126 valueIcon = &MINI_PUSH_ICON;
2133 valueTextArea->obj.area.width =
AVAILABLE_WIDTH - valueIcon->width - 12;
2139 valueTextArea->text,
2140 valueTextArea->obj.area.width,
2149 valueTextArea->obj.area.height = nbLines * font->
line_height;
2152 valueTextArea->obj.alignmentMarginY = 4;
2153 valueTextArea->obj.alignTo = (
nbgl_obj_t *) itemTextArea;
2154 valueTextArea->wrapping = list->
wrapping;
2155 container->children[container->nbChildren] = (
nbgl_obj_t *) valueTextArea;
2156 container->nbChildren++;
2158 fullHeight += valueTextArea->obj.area.height + valueTextArea->obj.alignmentMarginY;
2159 if (valueIcon != NULL) {
2165 image->foregroundColor =
BLACK;
2166 image->buffer = valueIcon;
2168 image->obj.alignmentMarginX = 12;
2169 image->obj.alignTo = (
nbgl_obj_t *) valueTextArea;
2171 container->obj.touchMask = (1 <<
TOUCHED);
2174 container->children[container->nbChildren] = (
nbgl_obj_t *) image;
2175 container->nbChildren++;
2179 container->obj.area.height = fullHeight;
2181 container->obj.alignmentMarginX = BORDER_MARGIN;
2183 container->obj.alignmentMarginY = INTER_TAG_VALUE_MARGIN;
2191 container->obj.alignmentMarginY = INTER_TAG_VALUE_MARGIN;
2194 container->obj.alignmentMarginY = PRE_TAG_VALUE_MARGIN;
2219 const char *subText,
2228 if (layout == NULL) {
2235 container->nbChildren = (subText != NULL) ? 3 : 2;
2240 container->obj.alignment =
CENTER;
2244 progress->foregroundColor =
BLACK;
2245 progress->withBorder =
true;
2246 progress->state = percentage;
2247 progress->obj.area.width = PROGRESSBAR_WIDTH;
2248 progress->obj.area.height = PROGRESSBAR_HEIGHT;
2252 container->children[0] = (
nbgl_obj_t *) progress;
2255 container->obj.area.height = progress->obj.alignmentMarginY + progress->obj.area.height;
2259 textArea->textColor =
BLACK;
2260 textArea->text = PIC(text);
2261 textArea->textAlignment =
CENTER;
2262 textArea->fontId = LARGE_MEDIUM_FONT;
2263 textArea->wrapping =
true;
2264 textArea->obj.alignmentMarginY = BAR_TEXT_MARGIN;
2265 textArea->obj.alignTo = (
nbgl_obj_t *) progress;
2269 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
2273 container->obj.area.height += textArea->obj.alignmentMarginY + textArea->obj.area.height;
2276 container->children[1] = (
nbgl_obj_t *) textArea;
2278 if (subText != NULL) {
2282 subTextArea->textColor =
BLACK;
2283 subTextArea->text = PIC(subText);
2284 subTextArea->textAlignment =
CENTER;
2285 subTextArea->fontId = SMALL_REGULAR_FONT;
2286 subTextArea->wrapping =
true;
2287 subTextArea->obj.alignmentMarginY = BAR_INTER_TEXTS_MARGIN;
2288 subTextArea->obj.alignTo = (
nbgl_obj_t *) textArea;
2293 subTextArea->obj.area.width,
2294 subTextArea->wrapping);
2298 container->obj.area.height
2299 += subTextArea->obj.alignmentMarginY + subTextArea->obj.area.height;
2302 container->children[2] = (
nbgl_obj_t *) subTextArea;
2305 container->obj.area.height = (container->obj.area.height + 7) & 0xFFF8;
2324 line = createHorizontalLine(layoutInt->
layer);
2325 line->obj.alignmentMarginY = -1;
2344 if (layout == NULL) {
2380 button->obj.alignmentMarginX = BORDER_MARGIN;
2381 button->obj.alignmentMarginY = 12;
2384 button->innerColor =
BLACK;
2385 button->foregroundColor =
WHITE;
2388 button->innerColor =
WHITE;
2389 button->foregroundColor =
BLACK;
2392 button->borderColor =
WHITE;
2396 button->borderColor =
BLACK;
2402 button->text = PIC(buttonInfo->
text);
2403 button->fontId = SMALL_BOLD_FONT;
2404 button->icon = PIC(buttonInfo->
icon);
2407 + SMALL_BUTTON_HEIGHT
2408 + ((button->icon) ? (button->icon->width + 12) : 0);
2409 button->obj.area.height = SMALL_BUTTON_HEIGHT;
2410 button->radius = SMALL_BUTTON_RADIUS_INDEX;
2411 if (buttonInfo->
onBottom !=
true) {
2412 button->obj.alignmentMarginX += (
AVAILABLE_WIDTH - button->obj.area.width) / 2;
2418 button->radius = BUTTON_RADIUS;
2420 button->obj.alignTo = NULL;
2421 button->obj.touchMask = (1 <<
TOUCHED);
2441 tune_index_e tuneId)
2444 .longPress.text = text,
2445 .longPress.token = token,
2446 .longPress.tuneId = tuneId};
2449 if (layout == NULL) {
2469 tune_index_e tuneId)
2494 const char *leftText,
2496 const char *rightText,
2498 tune_index_e tuneId)
2529 if (layout == NULL) {
2543 switch (headerDesc->
type) {
2574 button->innerColor =
WHITE;
2576 button->borderColor =
WHITE;
2577 button->obj.area.width = BACK_KEY_WIDTH;
2578 button->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2579 button->text = NULL;
2580 button->icon = PIC(&LEFT_ARROW_ICON);
2593 image->foregroundColor =
BLACK;
2594 image->obj.alignment =
CENTER;
2609 textArea->obj.touchMask = (1 <<
TOUCHED);
2611 textArea->obj.alignment =
CENTER;
2612 textArea->textColor =
BLACK;
2613 textArea->obj.area.width
2617 textArea->obj.area.width -= 16 + image->buffer->width;
2619 textArea->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2620 textArea->text = text;
2621 textArea->fontId = SMALL_BOLD_FONT;
2622 textArea->textAlignment =
CENTER;
2623 textArea->wrapping =
true;
2628 textArea->obj.area.width,
2631 textArea->obj.area.height
2633#ifndef BUILD_SCREENSHOTS
2635 "nbgl_layoutAddHeader: text [%s] is too long for header\n",
2647 textArea->obj.alignmentMarginX = 8 + image->buffer->width / 2;
2648 image->obj.alignmentMarginX = -8 - textArea->obj.area.width / 2;
2664 actionButton->obj.touchMask = (1 <<
TOUCHED);
2667 actionButton->obj.alignment =
MID_RIGHT;
2668 actionButton->innerColor =
WHITE;
2669 button->foregroundColor
2672 actionButton->borderColor =
WHITE;
2673 actionButton->obj.area.width = BACK_KEY_WIDTH;
2674 actionButton->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2675 actionButton->text = NULL;
2683 layoutInt->
headerContainer->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2689 line = createHorizontalLine(layoutInt->
layer);
2691 line->obj.alignmentMarginY = TOUCHABLE_HEADER_BAR_HEIGHT;
2697 subTextArea->textColor =
BLACK;
2699 subTextArea->textAlignment =
MID_LEFT;
2700 subTextArea->fontId = SMALL_REGULAR_FONT;
2701 subTextArea->wrapping =
true;
2703 subTextArea->obj.alignmentMarginY = SUB_HEADER_MARGIN;
2705 subTextArea->obj.area.height
2708 subTextArea->obj.area.width,
2709 subTextArea->wrapping);
2714 += subTextArea->obj.area.height + 2 * SUB_HEADER_MARGIN;
2716 if (button != NULL) {
2717 button->obj.alignmentMarginY
2718 -= (subTextArea->obj.area.height + 2 * SUB_HEADER_MARGIN) / 2;
2720 if (textArea != NULL) {
2721 textArea->obj.alignmentMarginY
2722 -= (subTextArea->obj.area.height + 2 * SUB_HEADER_MARGIN) / 2;
2724 if (actionButton != NULL) {
2725 actionButton->obj.alignmentMarginY
2726 -= (subTextArea->obj.area.height + 2 * SUB_HEADER_MARGIN) / 2;
2745 button->innerColor =
WHITE;
2746 button->foregroundColor =
BLACK;
2747 button->borderColor =
WHITE;
2748 button->obj.area.width = BACK_KEY_WIDTH;
2749 button->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2750 button->text = NULL;
2751 button->icon = PIC(&LEFT_ARROW_ICON);
2752 button->obj.touchMask = (1 <<
TOUCHED);
2769 progress->obj.area.width = 224;
2770 progress->obj.alignment =
CENTER;
2778 layoutInt->
headerContainer->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2784 textArea->textColor =
BLACK;
2786 textArea->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2787 textArea->text = PIC(headerDesc->
title.
text);
2788 textArea->fontId = SMALL_BOLD_FONT;
2789 textArea->textAlignment =
CENTER;
2790 textArea->wrapping =
true;
2794 layoutInt->
headerContainer->obj.area.height = textArea->obj.area.height;
2807 textArea->obj.alignmentMarginX = BORDER_MARGIN;
2808 textArea->textColor =
BLACK;
2810 textArea->obj.area.height = TOUCHABLE_HEADER_BAR_HEIGHT;
2812 textArea->fontId = SMALL_BOLD_FONT;
2814 textArea->obj.touchMask = (1 <<
TOUCHED);
2820 layoutInt->
headerContainer->obj.area.height = textArea->obj.area.height;
2828 line = createHorizontalLine(layoutInt->
layer);
2864 if (layout == NULL) {
2878 switch (footerDesc->
type) {
2896 textArea->obj.area.height
2901 textArea->textAlignment =
CENTER;
2902 textArea->obj.touchMask = (1 <<
TOUCHED);
2907 layoutInt->
footerContainer->obj.area.height = textArea->obj.area.height;
2920 textArea->textColor =
BLACK;
2922 textArea->obj.area.height = SIMPLE_FOOTER_HEIGHT;
2924 textArea->fontId = SMALL_BOLD_FONT;
2925 textArea->textAlignment =
CENTER;
2926 textArea->obj.touchMask = (1 <<
TOUCHED);
2944 textArea->textColor =
BLACK;
2946 textArea->obj.area.height = SIMPLE_FOOTER_HEIGHT;
2948 textArea->fontId = SMALL_BOLD_FONT;
2949 textArea->textAlignment =
CENTER;
2950 textArea->obj.touchMask = (1 <<
TOUCHED);
2956 layoutInt->
footerContainer->obj.area.height = textArea->obj.area.height;
2961 separationLine->obj.area.width = 1;
2962 separationLine->obj.area.height = layoutInt->
footerContainer->obj.area.height;
2963 separationLine->direction =
VERTICAL;
2964 separationLine->thickness = 1;
2965 separationLine->obj.alignment =
MID_LEFT;
2966 separationLine->obj.alignTo = (
nbgl_obj_t *) textArea;
2967 separationLine->obj.alignmentMarginX = -1;
2982 textArea->textColor =
BLACK;
2983 textArea->obj.area.width = FOOTER_TEXT_AND_NAV_WIDTH;
2984 textArea->obj.area.height = SIMPLE_FOOTER_HEIGHT;
2986 textArea->fontId = SMALL_BOLD_FONT;
2987 textArea->textAlignment =
CENTER;
2988 textArea->obj.touchMask = (1 <<
TOUCHED);
3000 navContainer->nbChildren = 4;
3001 navContainer->children
3004 navContainer->obj.area.width = SCREEN_WIDTH - textArea->obj.area.width;
3005 navContainer->obj.area.height = SIMPLE_FOOTER_HEIGHT;
3018 separationLine->obj.area.width = 1;
3019 separationLine->obj.area.height = layoutInt->
footerContainer->obj.area.height;
3020 separationLine->direction =
VERTICAL;
3021 separationLine->thickness = 1;
3022 separationLine->obj.alignment =
MID_LEFT;
3023 separationLine->obj.alignTo = (
nbgl_obj_t *) navContainer;
3024 separationLine->obj.alignmentMarginX = -1;
3062 button->obj.alignmentMarginY = SINGLE_BUTTON_MARGIN;
3064 button->innerColor =
BLACK;
3065 button->foregroundColor =
WHITE;
3068 button->innerColor =
WHITE;
3069 button->foregroundColor =
BLACK;
3073 button->borderColor =
WHITE;
3077 button->borderColor =
BLACK;
3084 button->fontId = SMALL_BOLD_FONT;
3086 button->radius = BUTTON_RADIUS;
3095 button->obj.touchMask = (1 <<
TOUCHED);
3123 button->innerColor =
WHITE;
3125 button->obj.alignmentMarginY
3126 = SINGLE_BUTTON_MARGIN;
3131 button->obj.alignmentMarginY
3132 = BUTTON_FROM_BOTTOM_MARGIN;
3133 button->borderColor =
WHITE;
3134 button->obj.area.height = FOOTER_IN_PAIR_HEIGHT;
3136 button->foregroundColor =
BLACK;
3138 button->radius = BUTTON_RADIUS;
3140 button->fontId = SMALL_BOLD_FONT;
3141 button->obj.touchMask = (1 <<
TOUCHED);
3151 line = createHorizontalLine(layoutInt->
layer);
3172 button->obj.alignmentMarginY = TOP_BUTTON_MARGIN;
3175 button->obj.alignmentMarginY
3176 = SINGLE_BUTTON_MARGIN;
3179 button->obj.alignmentMarginY
3180 = TOP_BUTTON_MARGIN_WITH_ACTION;
3183 button->innerColor =
WHITE;
3185 button->foregroundColor =
BLACK;
3188 button->innerColor =
BLACK;
3189 button->borderColor =
BLACK;
3190 button->foregroundColor =
WHITE;
3194 button->radius = BUTTON_RADIUS;
3199 button->fontId = SMALL_BOLD_FONT;
3200 button->obj.touchMask = (1 <<
TOUCHED);
3208 layoutInt->
footerContainer->obj.area.height = ROUNDED_AND_FOOTER_FOOTER_HEIGHT;
3211 layoutInt->
footerContainer->obj.area.height = BOTH_ROUNDED_FOOTER_HEIGHT;
3214 layoutInt->
footerContainer->obj.area.height = ACTION_AND_FOOTER_FOOTER_HEIGHT;
3225 addSwipeInternal(layoutInt,
3236 line = createHorizontalLine(layoutInt->
layer);
3242 if (separationLine != NULL) {
3275 if (layout == NULL) {
3292 switch (upFooterDesc->
type) {
3311 button->obj.alignmentMarginX = BORDER_MARGIN;
3313 button->innerColor =
BLACK;
3314 button->foregroundColor =
WHITE;
3315 button->borderColor =
BLACK;
3318 button->radius = BUTTON_RADIUS;
3319 button->icon = PIC(&VALIDATE_ICON);
3323 textArea->textColor =
BLACK;
3325 textArea->textAlignment =
MID_LEFT;
3326 textArea->fontId = LARGE_MEDIUM_FONT;
3327 textArea->wrapping =
true;
3328 textArea->obj.area.width = SCREEN_WIDTH - 3 * BORDER_MARGIN - button->obj.area.width;
3330 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
3332 textArea->obj.alignment =
MID_LEFT;
3333 textArea->obj.alignmentMarginX = BORDER_MARGIN;
3336 line = createHorizontalLine(layoutInt->
layer);
3341 progressBar->obj.area.width = SCREEN_WIDTH;
3342 progressBar->obj.area.height = LONG_PRESS_PROGRESS_HEIGHT;
3344 progressBar->obj.alignmentMarginY = LONG_PRESS_PROGRESS_ALIGN;
3345 progressBar->resetIfOverriden =
true;
3346 progressBar->partialRedraw =
true;
3362 button->obj.alignment =
CENTER;
3365 button->innerColor =
BLACK;
3366 button->foregroundColor =
WHITE;
3369 button->innerColor =
WHITE;
3370 button->foregroundColor =
BLACK;
3373 button->borderColor =
WHITE;
3377 button->borderColor =
BLACK;
3383 button->text = PIC(upFooterDesc->
button.
text);
3384 button->fontId = SMALL_BOLD_FONT;
3385 button->icon = PIC(upFooterDesc->
button.
icon);
3388 button->radius = BUTTON_RADIUS;
3390 button->obj.alignTo = NULL;
3391 button->obj.touchMask = (1 <<
TOUCHED);
3418 button->obj.alignmentMarginX = BORDER_MARGIN;
3420 button->innerColor =
WHITE;
3421 button->foregroundColor =
BLACK;
3424 button->radius = BUTTON_RADIUS;
3426 button->fontId = SMALL_BOLD_FONT;
3427 button->obj.touchMask = (1 <<
TOUCHED);
3443 button->obj.alignmentMarginX = BORDER_MARGIN;
3444 button->innerColor =
BLACK;
3445 button->borderColor =
BLACK;
3446 button->foregroundColor =
WHITE;
3449 button->radius = BUTTON_RADIUS;
3451 button->fontId = SMALL_BOLD_FONT;
3452 button->obj.touchMask = (1 <<
TOUCHED);
3474 textArea->textColor =
BLACK;
3475 textArea->text = PIC(upFooterDesc->
tipBox.
text);
3476 textArea->textAlignment =
MID_LEFT;
3477 textArea->fontId = SMALL_REGULAR_FONT;
3478 textArea->wrapping =
true;
3481 textArea->obj.area.width
3483 + TIP_BOX_TEXT_ICON_MARGIN;
3486 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
3487 textArea->obj.alignment =
MID_LEFT;
3488 textArea->obj.alignmentMarginX = BORDER_MARGIN;
3492 line = createHorizontalLine(layoutInt->
layer);
3498 image->obj.alignmentMarginX = BORDER_MARGIN;
3500 image->foregroundColor =
BLACK;
3501 image->buffer = PIC(upFooterDesc->
tipBox.
icon);
3514 upFooterDesc->
text.token,
3515 upFooterDesc->
text.tuneId);
3525 if (strlen(PIC(upFooterDesc->
text.text))) {
3528 textArea->text = PIC(upFooterDesc->
text.text);
3529 textArea->textAlignment =
CENTER;
3530 textArea->fontId = SMALL_REGULAR_FONT;
3531 textArea->wrapping =
true;
3534 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
3535 textArea->obj.alignment =
CENTER;
3572 tune_index_e tuneId)
3575 .separationLine =
false,
3576 .progressAndBack.activePage = activePage,
3577 .progressAndBack.nbPages = nbPages,
3578 .progressAndBack.token = backToken,
3579 .progressAndBack.tuneId = tuneId,
3580 .progressAndBack.withBack = withBack,
3581 .progressAndBack.actionIcon = NULL,
3600 const char *subText,
3601 uint8_t initPosition)
3609 if (layout == NULL) {
3615 container->nbChildren = 3;
3620 container->obj.alignment =
CENTER;
3624 spinner->position = initPosition;
3627 container->children[0] = (
nbgl_obj_t *) spinner;
3630 container->obj.area.height += SPINNER_HEIGHT;
3634 textArea->textColor =
BLACK;
3635 textArea->text = PIC(text);
3636 textArea->textAlignment =
CENTER;
3637 textArea->fontId = (subText != NULL) ? LARGE_MEDIUM_FONT : SMALL_REGULAR_FONT;
3638 textArea->wrapping =
true;
3639 textArea->obj.alignmentMarginY = SPINNER_TEXT_MARGIN;
3640 textArea->obj.alignTo = (
nbgl_obj_t *) spinner;
3644 textArea->fontId, textArea->text, textArea->obj.area.width, textArea->wrapping);
3648 container->obj.area.height += textArea->obj.alignmentMarginY + textArea->obj.area.height;
3651 container->children[1] = (
nbgl_obj_t *) textArea;
3653 if (subText != NULL) {
3657 subTextArea->textColor =
BLACK;
3658 subTextArea->text = PIC(subText);
3659 subTextArea->textAlignment =
CENTER;
3660 subTextArea->fontId = SMALL_REGULAR_FONT;
3661 subTextArea->wrapping =
true;
3662 subTextArea->obj.alignmentMarginY = SPINNER_INTER_TEXTS_MARGIN;
3663 subTextArea->obj.alignTo = (
nbgl_obj_t *) textArea;
3668 subTextArea->obj.area.width,
3669 subTextArea->wrapping);
3673 container->obj.area.height
3674 += subTextArea->obj.alignmentMarginY + subTextArea->obj.area.height;
3677 container->children[2] = (
nbgl_obj_t *) subTextArea;
3687 tickerCfg.tickerCallback = &spinnerTickerCallback;
3707 const char *subText,
3717 if ((layout == NULL) || (layoutInt->
container->nbChildren == 0)) {
3722 if ((container->obj.type !=
CONTAINER) || (container->nbChildren < 2)) {
3727 if (spinner->obj.type !=
SPINNER) {
3731 if (spinner->position != position) {
3732 spinner->position = position;
3742 const char *newText = PIC(text);
3743 size_t newTextLen = strlen(newText);
3745 if ((newTextLen != strlen(textArea->text)) || memcmp(textArea->text, newText, newTextLen)) {
3746 textArea->text = newText;
3751 if (subText != NULL) {
3754 if (container->nbChildren != 3) {
3758 if (subTextArea->obj.type !=
TEXT_AREA) {
3761 const char *newSubText = PIC(subText);
3762 size_t newSubTextLen = strlen(newSubText);
3764 if ((newSubTextLen != strlen(subTextArea->text))
3765 || memcmp(subTextArea->text, newSubText, newSubTextLen)) {
3766 subTextArea->text = newSubText;
3785 if (layout == NULL) {
3815 if ((layout == NULL) || (!layout->
isUsed)) {
3819 if (layout->
modal) {
3822 if (layout == topLayout) {
3823 topLayout = layout->
bottom;
3824 topLayout->
top = NULL;
Random Number Generation.
@ ANIM_ILLUSTRATION
animation
@ ICON_ILLUSTRATION
simple icon
#define LOG_WARN(__logger,...)
#define LOG_DEBUG(__logger,...)
#define LOG_FATAL(__logger,...)
Middle Level API of the new BOLOS Graphical Library.
#define QR_V10_NB_PIX_SIZE
#define QR_V4_NB_PIX_SIZE
uint8_t nbgl_getFontHeight(nbgl_font_id_e fontId)
return the height in pixels of the font with the given font ID
uint16_t nbgl_getTextWidth(nbgl_font_id_e fontId, const char *text)
return the max width in pixels of the given text (can be multiline)
uint16_t nbgl_getTextHeightInWidth(nbgl_font_id_e fontId, const char *text, uint16_t maxWidth, bool wrapping)
return the height of the given multiline text, with the given font.
uint16_t nbgl_getTextNbLinesInWidth(nbgl_font_id_e fontId, const char *text, uint16_t maxWidth, bool wrapping)
compute the number of lines of the given text fitting in the given maxWidth
const nbgl_font_t * nbgl_getFont(nbgl_font_id_e fontId)
uint8_t nbgl_getFontLineHeight(nbgl_font_id_e fontId)
return the height in pixels of the line of font with the given font ID
Font screen low-Level driver API, to draw elementary forms.
int nbgl_layoutAddTagValueList(nbgl_layout_t *layout, const nbgl_layoutTagValueList_t *list)
Creates a list of [tag,value] pairs.
int nbgl_layoutAddContentCenter(nbgl_layout_t *layout, const nbgl_contentCenter_t *info)
Creates an area on the center of the main panel, with a possible icon, and possible texts under it.
int nbgl_layoutAddUpFooter(nbgl_layout_t *layout, const nbgl_layoutUpFooter_t *upFooterDesc)
Creates a touchable area on top of the footer of the screen, containing various controls,...
int nbgl_layoutDraw(nbgl_layout_t *layoutParam)
Applies given layout. The screen will be redrawn.
#define NB_MAX_CONTAINER_CHILDREN
int nbgl_layoutAddTextContent(nbgl_layout_t *layout, const char *title, const char *description, const char *info)
Creates in the main container three text areas:
int nbgl_layoutAddText(nbgl_layout_t *layout, const char *text, const char *subText)
Creates an area with given text (in bold) and sub text (in regular)
int nbgl_layoutAddProgressIndicator(nbgl_layout_t *layout, uint8_t activePage, uint8_t nbPages, bool withBack, uint8_t backToken, tune_index_e tuneId)
Creates a kind of navigation bar with an optional <- arrow on the left. This widget is placed on top ...
int nbgl_layoutAddNavigationBar(nbgl_layout_t *layout, const nbgl_layoutNavigationBar_t *info)
Creates a navigation bar on bottom of main container.
int nbgl_layoutAddSeparationLine(nbgl_layout_t *layout)
adds a separation line on bottom of the last added item
int nbgl_layoutAddQRCode(nbgl_layout_t *layout, const nbgl_layoutQRCode_t *info)
Creates an area on the center of the main panel, with a QRCode, a possible text in black (bold) under...
int nbgl_layoutAddRadioChoice(nbgl_layout_t *layout, const nbgl_layoutRadioChoice_t *choices)
Creates a list of radio buttons (on the right)
int nbgl_layoutAddCenteredInfo(nbgl_layout_t *layout, const nbgl_layoutCenteredInfo_t *info)
Creates an area on the center of the main panel, with a possible icon/image, a possible text in black...
int nbgl_layoutAddSplitFooter(nbgl_layout_t *layout, const char *leftText, uint8_t leftToken, const char *rightText, uint8_t rightToken, tune_index_e tuneId)
Creates 2 touchable texts at the footer of the screen, separated with a thin line from the rest of th...
int nbgl_layoutAddTextWithAlias(nbgl_layout_t *layout, const char *text, const char *subText, uint8_t token, uint8_t index)
Creates an area with given text (in bold) and sub text (in regular), with a icon on right of text to...
int nbgl_layoutAddTouchableBar(nbgl_layout_t *layout, const nbgl_layoutBar_t *barLayout)
Creates a touchable bar in main panel.
#define SPINNER_REFRESH_PERIOD
int nbgl_layoutAddTopRightButton(nbgl_layout_t *layout, const nbgl_icon_details_t *icon, uint8_t token, tune_index_e tuneId)
Creates a Top-right button in the top right corner of the top panel.
int nbgl_layoutInvertBackground(nbgl_layout_t *layout)
Inverts the background color (black instead of white)
int nbgl_layoutAddSwipe(nbgl_layout_t *layout, uint16_t swipesMask, const char *text, uint8_t token, tune_index_e tuneId)
Creates a swipe interaction on the main container.
int nbgl_layoutAddSwitch(nbgl_layout_t *layout, const nbgl_layoutSwitch_t *switchLayout)
Creates a switch with the given text and its state.
int nbgl_layoutAddHorizontalButtons(nbgl_layout_t *layout, const nbgl_layoutHorizontalButtons_t *info)
Creates two buttons to make a choice. Both buttons are mandatory The left one contains only an icon a...
int nbgl_layoutAddButton(nbgl_layout_t *layout, const nbgl_layoutButton_t *buttonInfo)
Creates a rounded button in the main container.
nbgl_layout_t * nbgl_layoutGet(const nbgl_layoutDescription_t *description)
returns a layout of the given type. The layout is reset
int nbgl_layoutAddExtendedFooter(nbgl_layout_t *layout, const nbgl_layoutFooter_t *footerDesc)
Creates a touchable area at the footer of the screen, containing various controls,...
int nbgl_layoutAddLeftContent(nbgl_layout_t *layout, const nbgl_layoutLeftContent_t *info)
Creates an area with a title, and rows of icon + text, left aligned.
int nbgl_layoutAddChoiceButtons(nbgl_layout_t *layout, const nbgl_layoutChoiceButtons_t *info)
Creates two buttons to make a choice. Both buttons are mandatory. Both buttons are full width,...
int nbgl_layoutRelease(nbgl_layout_t *layoutParam)
Release the layout obtained with nbgl_layoutGet()
int nbgl_layoutAddSpinner(nbgl_layout_t *layout, const char *text, const char *subText, uint8_t initPosition)
Creates a centered (vertically & horizontally) spinner with a text under it.
int nbgl_layoutUpdateSpinner(nbgl_layout_t *layout, const char *text, const char *subText, uint8_t position)
Update an existing spinner (must be the only object of the layout)
int nbgl_layoutAddLongPressButton(nbgl_layout_t *layout, const char *text, uint8_t token, tune_index_e tuneId)
Creates a long press button in the main container.
void layoutAddObject(nbgl_layoutInternal_t *layout, nbgl_obj_t *obj)
adds the given obj to the main container
int nbgl_layoutAddProgressBar(nbgl_layout_t *layout, const char *text, const char *subText, uint8_t percentage)
Creates an area in main panel to display a progress bar, with a title text and a subtext if needed.
int nbgl_layoutAddHeader(nbgl_layout_t *layout, const nbgl_layoutHeader_t *headerDesc)
Creates a touchable (or not) area at the header of the screen, containing various controls,...
int nbgl_layoutAddBottomButton(nbgl_layout_t *layout, const nbgl_icon_details_t *icon, uint8_t token, bool separationLine, tune_index_e tuneId)
Creates a centered button at bottom of main container.
int nbgl_layoutAddFooter(nbgl_layout_t *layout, const char *text, uint8_t token, tune_index_e tuneId)
Creates a touchable text at the footer of the screen, separated with a thin line from the rest of the...
int nbgl_layoutAddLargeCaseText(nbgl_layout_t *layout, const char *text, bool grayedOut)
Creates an area with given text in 32px font (in Black or Light Gray)
layoutObj_t * layoutAddCallbackObj(nbgl_layoutInternal_t *layout, nbgl_obj_t *obj, uint8_t token, tune_index_e tuneId)
void(* nbgl_layoutTouchCallback_t)(int token, uint8_t index)
prototype of function to be called when an object is touched
@ WHITE_BACKGROUND
rounded bordered button, with text/icon in black, on white background
@ NO_BORDER
simple clickable text, in black
@ BLACK_BACKGROUND
rounded bordered button, with text/icon in white, on black background
@ UP_FOOTER_TEXT
grayed-out text, for example "Tap to continue"
@ UP_FOOTER_BUTTON
simple button
@ UP_FOOTER_LONG_PRESS
long-press button
@ UP_FOOTER_TIP_BOX
Tip-box.
@ UP_FOOTER_HORIZONTAL_BUTTONS
2 buttons, on the same line
void * nbgl_layout_t
type shared externally
@ HEADER_TITLE
simple centered text
@ HEADER_BACK_AND_PROGRESS
optional back key and progress indicator (only on Stax)
@ HEADER_EMPTY
empty space, to have a better vertical centering of centered info
@ HEADER_EXTENDED_BACK
back key, centered text and touchable key on the right
@ HEADER_BACK_AND_TEXT
back key and optional text
@ HEADER_RIGHT_TEXT
touchable text on the right, with a vertical separation line
@ HEADER_BACK_ICON_AND_TEXT
back key and optional icon and text
#define NBGL_INVALID_TOKEN
#define SPINNER_FIXED
position to use for a "fixed" spinner
@ SOFT_ACTION_AND_FOOTER_STYLE
A white button on top of a footer, with a separation line.
@ BOTH_ROUNDED_STYLE
A black button on top of a white button.
@ ROUNDED_AND_FOOTER_STYLE
A black background button on top of a footer.
#define NBGL_NO_PROGRESS_INDICATOR
To be used when a control token shall not be used.
@ FOOTER_SIMPLE_TEXT
simple touchable text in bold
@ FOOTER_NAV
navigation bar
@ FOOTER_SIMPLE_BUTTON
simple black or white button (see nbgl_layoutButtonStyle_t)
@ FOOTER_DOUBLE_TEXT
2 touchable texts in bold, separated by a vertical line (only on Stax)
@ FOOTER_EMPTY
empty space, to have a better vertical centering of centered info
@ FOOTER_CHOICE_BUTTONS
double buttons (see nbgl_layoutChoiceButtonsStyle_t)
Internal functions/constants of NBGL layout layer.
@ SWIPE_USAGE_SUGGESTIONS
bool keyboardSwipeCallback(nbgl_obj_t *obj, nbgl_touchType_t eventType)
void layoutNavigationPopulate(nbgl_container_t *navContainer, const nbgl_layoutNavigationBar_t *navConfig, uint8_t layer)
This function creates a full navigation bar "object", with buttons and returns it as a container.
#define LAYOUT_OBJ_POOL_LEN
Max number of complex objects with callback retrievable from pool.
bool layoutNavigationCallback(nbgl_obj_t *obj, nbgl_touchType_t eventType, uint8_t nbPages, uint8_t *activePage)
function to be called when any of the controls in navigation bar is touched
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_radio_s nbgl_radio_t
struct to represent a radio button (RADIO_BUTTON type)
#define NB_SPINNER_POSITIONS
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
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)
This function draws or redraws the given object and its children (recursive version)
struct PACKED__ nbgl_progress_bar_s nbgl_progress_bar_t
struct to represent a progress bar (PROGRESS_BAR type)
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.
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_refreshSpecial(nbgl_refresh_mode_t mode)
This functions refreshes the actual screen on display with what has changed since the last refresh,...
struct PACKED__ nbgl_image_s nbgl_image_t
struct to represent an image (IMAGE type)
#define INACTIVE_SMALL_FONT
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
void nbgl_refreshSpecialWithPostRefresh(nbgl_refresh_mode_t mode, nbgl_post_refresh_t post_refresh)
struct PACKED__ nbgl_container_s nbgl_container_t
struct to represent a container (CONTAINER type)
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 ...
struct PACKED__ nbgl_qrcode_s nbgl_qrcode_t
struct to represent a QR code (QR_CODE type), whose size is fixed
int nbgl_screenSet(nbgl_obj_t ***elements, uint8_t nbElements, const nbgl_screenTickerConfiguration_t *ticker, nbgl_touchCallback_t touchCallback)
Configures the lowest layer screen. To be used by applications A nbgl_screenRedraw() can be called af...
int nbgl_screenPush(nbgl_obj_t ***elements, uint8_t nbElements, const nbgl_screenTickerConfiguration_t *ticker, nbgl_touchCallback_t touchCallback)
Pushes a screen on top of the stack, with the given number of elements, if possible....
void nbgl_wait_pipeline(void)
int nbgl_screenUpdateTicker(uint8_t screenIndex, const nbgl_screenTickerConfiguration_t *ticker)
Updates the ticker configuration of the screen at the given screenIndex, always set at WHITE in.
int nbgl_screenPop(uint8_t screenIndex)
Release the screen at the given index in screen array (index returned by nbgl_screenPush())....
struct PACKED__ nbgl_screenTickerConfiguration_s nbgl_screenTickerConfiguration_t
struct to configure a screen layer
int nbgl_screenUpdateBackgroundColor(uint8_t screenIndex, color_t color)
Updates the background color of the screen at the given screenIndex, always set at WHITE in.
void nbgl_screenRedraw(void)
This function redraws the whole screen on top of stack and its children.
uint32_t nbgl_touchGetTouchDuration(nbgl_obj_t *obj)
nbgl_state_t
to represent a boolean state.
@ POST_REFRESH_FORCE_POWER_OFF
Force screen power off after refresh.
@ POST_REFRESH_FORCE_POWER_ON
Force screen power on after refresh.
@ POST_REFRESH_FORCE_POWER_ON_WITH_PIPELINE
Force screen power on and enable pipeline.
nbgl_touchType_t
The different types of Touchscreen events.
@ TOUCHING
corresponding to an object that is currently touched
@ QRCODE_V10
QRCode V10, can encode text len up to 1500 chars, display size = 228*228.
@ QRCODE_V4_SMALL
QRCode V4, can encode text len up to 1500 chars, display size = 132*132.
@ QRCODE_V4
QRCode V4, can encode text len up to 62 chars, display size = 264*264.
@ VERTICAL
from top to bottom
@ HORIZONTAL
from left to right
@ LOOP_PARSING
0, 1, 2, 0, 1, 2, ...
struct PACKED__ nbgl_icon_details_s nbgl_icon_details_t
Represents all information about an icon.
@ NO_ALIGNMENT
used when parent container layout is used
@ RIGHT_TOP
on outside right
@ IMAGE
Bitmap (y and height must be multiple of 4 on Stax)
@ SWITCH
Switch to turn on/off something.
@ RADIO_BUTTON
Indicator to inform whether something is on or off.
@ BUTTON
Rounded rectangle button with icon and/or text.
@ PROGRESS_BAR
horizontal bar to indicate progression of something (between 0% and 100%)
@ 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)
@ NBGL_BPP_1
1 bit per pixel
@ BLACK_AND_WHITE_REFRESH
to be used for pure B&W area, when contrast is important
@ BLACK_AND_WHITE_FAST_REFRESH
to be used for pure B&W area, when contrast is not priority
@ FULL_COLOR_PARTIAL_REFRESH
to be used for small partial refresh (radio buttons, switches)
const nbgl_icon_details_t * iconRight
const nbgl_icon_details_t * iconLeft
uint16_t delayMs
delay between 2 drawings
uint8_t nbIcons
number of icons in icons array
const nbgl_icon_details_t ** icons
array of nbIcons pointers on icons
nbgl_parsingType_t parsing
This structure contains info to build a centered (vertically and horizontally) area,...
uint16_t iconHug
vertical margin to apply on top and bottom of the icon
const nbgl_icon_details_t * icon
the icon (can be null)
const char * title
title in black large (can be null)
const char * description
description in black small regular case (can be null)
const char * subText
sub-text in dark gray regular small case
uint16_t animOffsetY
vertical offset of animation in icon if integrated (but usually 0)
bool padding
if true, apply a padding of 40px at the bottom
const nbgl_animation_t * animation
the animation (can be null), used if illustrType is ANIM_ILLUSTRATION
const char * smallTitle
sub-title in black small bold case (can be null)
uint16_t animOffsetX
horizontal offset of animation in icon if integrated (but usually 0)
nbgl_contentIllustrationType_t illustrType
This structure contains info to build a centered (vertically and horizontally) area,...
const char * text2
second text (can be null)
const char * text1
first text (can be null)
bool onTop
if set to true, align only horizontally
nbgl_contentCenteredInfoStyle_t style
style to apply to this info
int16_t offsetY
vertical shift to apply to this info (if >0, shift to bottom)
const char * text3
third text (can be null)
const nbgl_icon_details_t * icon
a buffer containing the 1BPP icon
This structure contains a list of names to build a list of radio buttons (on the right part of screen...
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played when selecting a radio button)
uint8_t token
the token that will be used as argument of the callback
bool localized
if set to true, use nameIds and not names
uint8_t initChoice
index of the current choice
const char *const * names
array of strings giving the choices (nbChoices)
uint8_t nbChoices
number of choices
This structure contains info to build a switch (on the right) with a description (on the left),...
const char * text
main text for the switch
uint8_t token
the token that will be used as argument of the callback (unused on Nano)
nbgl_state_t initState
initial state of the switch
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played
const char * subText
description under main text (NULL terminated, single line, may be null)
This structure contains a list of [tag,value] pairs.
const nbgl_contentTagValue_t * pairs
array of [tag,value] pairs (nbPairs items). If NULL, callback is used instead
nbgl_contentTagValueCallback_t callback
function to call to retrieve a given pair
uint8_t nbMaxLinesForValue
if > 0, set the max number of lines for value field.
bool hideEndOfLastLine
if set to true, replace 3 last chars of last line by "..."
bool wrapping
if set to true, value text will be wrapped on ' ' to avoid cutting words
uint8_t startIndex
index of the first pair to get with callback
This structure contains a [tag,value] pair and possible extensions.
const nbgl_icon_details_t * valueIcon
const char * value
string giving the value name
const char * item
string giving the tag name
const char * text
text of the tip-box
const nbgl_icon_details_t * icon
icon of the tip-box
uint8_t token
token used when tip-box is tapped
tune_index_e tuneId
tune played when tip-box is tapped
structure defining an ASCII font
uint8_t line_height
height of a line for all characters in pixels
This structure contains info to build a clickable "bar" with a text and an icon.
bool inactive
if set to true, the bar is grayed-out and cannot be touched
const char * text
text (can be NULL)
uint8_t token
the token that will be used as argument of the callback
bool large
set to true only for the main level of OS settings
const char * subText
sub text (can be NULL)
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played
const nbgl_icon_details_t * iconLeft
a buffer containing the 1BPP icon for icon on left (can be NULL)
const nbgl_icon_details_t * iconRight
Structure containing all information when creating a layout. This structure must be passed as argumen...
nbgl_screenTickerConfiguration_t ticker
const char * tapActionText
Light gray text used when main container is "tapable".
nbgl_layoutTouchCallback_t onActionCallback
the callback to be called on any action on the layout
Structure containing all information about the current layout.
uint8_t nbUsedCallbackObjs
nbgl_container_t * footerContainer
container used to store footer (buttons, nav....)
uint8_t activePage
index of active page for navigation bar
uint8_t layer
layer in screen stack
struct nbgl_layoutInternal_s * top
layout above this one, in stack
nbgl_swipe_usage_t swipeUsage
nbgl_layoutTouchCallback_t callback
user callback for all controls
struct nbgl_layoutInternal_s * bottom
layout under this one, in stack
uint8_t invertedColors
if true, means that background is black
nbgl_container_t * container
uint8_t iconIdxInAnim
current icon index in animation
nbgl_container_t * headerContainer
container used to store header (progress, back, empty space...)
uint8_t isUsed
if true, means this layout is in use
nbgl_layoutFooterType_t footerType
type of footer
nbgl_layoutHeaderType_t headerType
type of header
nbgl_container_t * upFooterContainer
uint8_t incrementAnim
if true, means that animation index is currently incrementing
uint8_t nbPages
number of pages for navigation bar
nbgl_layoutUpFooterType_t upFooterType
type of up-footer
uint8_t modal
if true, means the screen is a modal
layoutObj_t callbackObjPool[LAYOUT_OBJ_POOL_LEN]
nbgl_text_area_t * tapText
nbgl_obj_t ** children
children for main screen
const nbgl_animation_t * animation
current animation (if not NULL)
This structure contains info to build a left content area.
uint8_t nbRows
number of rows in the area
const char * title
title of area in bold
const nbgl_icon_details_t ** rowIcons
array of nbRows icon
const char ** rowTexts
array of nbRows texts (displayed in regular)
This structure contains info to build a navigation bar at the bottom of the screen.
uint8_t activePage
index of active page (from 0 to nbPages-1).
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played when pressing keys)
bool withBackKey
if set to true, the "back" key is drawn
bool withExitKey
if set to true, an exit button is drawn (X on the left)
uint8_t token
the token that will be used as argument of the callback
uint8_t nbPages
number of pages. (if 0, no navigation)
This structure contains info to build a centered (vertically and horizontally) area,...
const char * text2
second text (can be null)
const char * text1
first text (can be null)
const char * url
URL for QR code.
bool largeText1
if set to true, use 32px font for text1
int16_t offsetY
vertical shift to apply to this info (if > 0, shift to bottom)
bool centered
if set to true, center vertically