Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_layout_internal_nanos.h
Go to the documentation of this file.
1
6
7#ifndef NBGL_LAYOUT_INTERNAL_NANOS_H
8#define NBGL_LAYOUT_INTERNAL_NANOS_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#include "nbgl_layout.h"
15
16/*********************
17 * INCLUDES
18 *********************/
19
20/*********************
21 * DEFINES
22 *********************/
27#define LAYOUT_OBJ_POOL_LEN 10
28
33#define BUTTON_MARGIN_Y 12
34
39#define NB_MAX_BUTTON_ROWS 3
40
46#define NB_MAX_BUTTON_ROWS_PUBLIC 2
47
53#define NB_MAX_CHAR_IN_BUTTON_ROW 20
54
55/**********************
56 * TYPEDEFS
57 **********************/
58
64typedef struct nbgl_layoutInternal_s {
65 bool modal;
66 uint8_t layer;
68 uint8_t nbChildren;
70
71 nbgl_layoutButtonCallback_t callback; // user callback for all controls
72 char
77
78/**********************
79 * GLOBAL PROTOTYPES
80 **********************/
82uint16_t layoutGetButtonRowLen(const char *text, uint16_t *len, uint16_t *width);
84 const char *text,
85 const char *subText,
87 uint8_t nbMaxLines,
88 bool ellipsis);
89
90/**********************
91 * MACROS
92 **********************/
93
94#ifdef __cplusplus
95} /* extern "C" */
96#endif
97
98#endif /* NBGL_LAYOUT_INTERNAL_NANOS_H */
nbgl_contentCenteredInfoStyle_t
possible styles for Centered Info Area
API of the Advanced BOLOS Graphical Library, for predefined layouts.
void * nbgl_layout_t
type shared externally
void(* nbgl_layoutButtonCallback_t)(nbgl_layout_t *layout, nbgl_buttonEvent_t event)
prototype of function to be called when buttons are touched on a screen
struct nbgl_layoutInternal_s nbgl_layoutInternal_t
Structure containing all information about the current layout.
int layoutAddText(nbgl_layout_t *layout, const char *text, const char *subText, nbgl_contentCenteredInfoStyle_t style, uint8_t nbMaxLines, bool ellipsis)
Same as nbgl_layoutAddText(), with the choice of the max number of lines (or buttons in BUTTON_INFO s...
#define NB_MAX_CHAR_IN_BUTTON_ROW
Maximum number of bytes (including '\0') of the text of a button in BUTTON_INFO style....
void layoutAddObject(nbgl_layoutInternal_t *layout, nbgl_obj_t *obj)
adds the given obj to the layout
#define NB_MAX_BUTTON_ROWS
Maximum number of buttons used to display the sub text in BUTTON_INFO style.
uint16_t layoutGetButtonRowLen(const char *text, uint16_t *len, uint16_t *width)
computes the part of the given text displayed in a single button in BUTTON_INFO style....
struct PACKED__ nbgl_obj_s nbgl_obj_t
Common structure for all graphical objects.
Structure containing all information about the current layout.
uint8_t layer
layer in screen stack
nbgl_layoutTouchCallback_t callback
user callback for all controls
uint8_t nbChildren
number of children in above array
char buttonTexts[NB_MAX_BUTTON_ROWS][NB_MAX_CHAR_IN_BUTTON_ROW]
uint8_t modal
if true, means the screen is a modal
nbgl_obj_t ** children
children for main screen