Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_layout_internal.h
Go to the documentation of this file.
1
7#ifndef NBGL_LAYOUT_INTERNAL_H
8#define NBGL_LAYOUT_INTERNAL_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 *********************/
23// internal margin, between sub-items
24#define INTERNAL_MARGIN 8
25
26#ifdef SCREEN_SIZE_WALLET
27#if SMALL_BUTTON_RADIUS == 32
28#define SMALL_BUTTON_HEIGHT 64
29#define SMALL_BUTTON_RADIUS_INDEX RADIUS_32_PIXELS
30#endif // SMALL_BUTTON_RADIUS
31#endif // SCREEN_SIZE_WALLET
32
37#define LAYOUT_OBJ_POOL_LEN 16
38
39#define KEYBOARD_FOOTER_TYPE 99
40#define KEYPAD_FOOTER_TYPE 98
41
42/**********************
43 * TYPEDEFS
44 **********************/
45typedef struct {
47 uint8_t token; // user token, attached to callback
48 uint8_t index; // index within the token
49 tune_index_e tuneId; // if not @ref NBGL_NO_TUNE, a tune will be played
51
58
59// used by screen (top level)
60enum {
61 HEADER_INDEX = 0, // For header container
68};
69
107
108/**********************
109 * GLOBAL PROTOTYPES
110 **********************/
114 nbgl_obj_t *obj,
115 uint8_t token,
116 tune_index_e tuneId);
118 const nbgl_layoutNavigationBar_t *navConfig,
119 uint8_t layer);
121 nbgl_touchType_t eventType,
122 uint8_t nbPages,
123 uint8_t *activePage);
124
125/**********************
126 * MACROS
127 **********************/
128
129#ifdef __cplusplus
130} /* extern "C" */
131#endif
132
133#endif /* NBGL_LAYOUT_INTERNAL_H */
API of the Advanced BOLOS Graphical Library, for predefined layouts.
void(* nbgl_layoutTouchCallback_t)(int token, uint8_t index)
prototype of function to be called when an object is touched
nbgl_layoutUpFooterType_t
The different types of area on top of footer.
nbgl_layoutHeaderType_t
The different types of extended header.
nbgl_layoutFooterType_t
The different types of extended footer.
nbgl_swipe_usage_t
@ NB_SWIPE_USAGE
@ SWIPE_USAGE_CUSTOM
@ SWIPE_USAGE_SUGGESTIONS
@ SWIPE_USAGE_NAVIGATION
@ UP_FOOTER_INDEX
@ FOOTER_INDEX
@ HEADER_INDEX
@ TOP_RIGHT_BUTTON_INDEX
@ MAIN_CONTAINER_INDEX
@ LEFT_BORDER_INDEX
@ NB_MAX_SCREEN_CHILDREN
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.
void layoutAddObject(nbgl_layoutInternal_t *layout, nbgl_obj_t *obj)
adds the given obj to the main container
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
struct nbgl_layoutInternal_s nbgl_layoutInternal_t
Structure containing all information about the current layout.
layoutObj_t * layoutAddCallbackObj(nbgl_layoutInternal_t *layout, nbgl_obj_t *obj, uint8_t token, tune_index_e tuneId)
#define LAYOUT_OBJ_POOL_LEN
Max number of complex objects with callback retrievable from pool.
struct PACKED__ nbgl_text_area_s nbgl_text_area_t
struct to represent a text area (TEXT_AREA type)
struct PACKED__ nbgl_container_s nbgl_container_t
struct to represent a container (CONTAINER type)
struct PACKED__ nbgl_obj_s nbgl_obj_t
Common structure for all graphical objects.
nbgl_touchType_t
The different types of Touchscreen events.
Definition nbgl_types.h:239
tune_index_e tuneId
Represents all information about an animation (succession of icons)
Definition nbgl_types.h:396
Structure containing all information about the current layout.
nbgl_container_t * footerContainer
container used to store footer (buttons, nav....)
bool incrementAnim
if true, means that animation index is currently incrementing
uint8_t activePage
index of active page for navigation bar
nbgl_swipe_usage_t swipeUsage
nbgl_layoutTouchCallback_t callback
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...)
nbgl_layoutFooterType_t footerType
type of footer
bool modal
if true, means the screen is a modal
uint8_t nbChildren
number of children in above array
nbgl_layoutHeaderType_t headerType
type of header
nbgl_container_t * upFooterContainer
uint8_t nbPages
number of pages for navigation bar
nbgl_layoutUpFooterType_t upFooterType
type of up-footer
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 navigation bar at the bottom of the screen.
unsigned char uint8_t
Definition usbd_conf.h:53