25#include "os_io_seph_ux.h"
34 for (i = 0; i < ARRAYLEN(
G_ux.stack) && i <
G_ux.stack_count; i++) {
36 if (
G_ux.stack[i].element_arrays[j].element_array == element_array) {
48 if (
G_ux.stack_count < ARRAYLEN(
G_ux.stack)) {
49 memset(&
G_ux.stack[
G_ux.stack_count], 0,
sizeof(
G_ux.stack[0]));
51 memset(&
G_ux.flow_stack[
G_ux.stack_count], 0,
sizeof(
G_ux.flow_stack[0]));
56 return G_ux.stack_count - 1;
61 unsigned int exit_code = BOLOS_UX_OK;
63 if (
G_ux.stack_count > 0) {
66 exit_code =
G_ux.stack[
G_ux.stack_count].exit_code_after_elements_displayed;
68 memset(&
G_ux.stack[
G_ux.stack_count], 0,
sizeof(
G_ux.stack[0]));
70 memset(&
G_ux.flow_stack[
G_ux.stack_count], 0,
sizeof(
G_ux.flow_stack[0]));
76 if (
G_ux.stack_count == 0) {
77 G_ux.exit_code = exit_code;
83 G_ux.stack[
G_ux.stack_count - 1].element_index = 0;
86 return G_ux.stack_count - 1;
103 if (
G_ux.stack_count > 0 &&
G_ux.stack_count <= ARRAYLEN(
G_ux.stack)) {
104 G_ux.stack[
G_ux.stack_count - 1].element_index = 0;
108 else if (
G_ux.stack_count == 0) {
109 if (
G_ux.exit_code == BOLOS_UX_OK) {
110 G_ux.exit_code = BOLOS_UX_REDRAW;
117 if (stack_slot >= ARRAYLEN(
G_ux.stack)) {
121 if (
G_ux.stack_count < ARRAYLEN(
G_ux.stack)) {
123 if (stack_slot != ARRAYLEN(
G_ux.stack) - 1) {
124 memmove(&
G_ux.stack[stack_slot + 1],
125 &
G_ux.stack[stack_slot],
126 (ARRAYLEN(
G_ux.stack) - (stack_slot + 1)) *
sizeof(
G_ux.stack[0]));
128 memmove(&
G_ux.flow_stack[stack_slot + 1],
129 &
G_ux.flow_stack[stack_slot],
130 (ARRAYLEN(
G_ux.flow_stack) - (stack_slot + 1)) *
sizeof(
G_ux.flow_stack[0]));
146 if (stack_slot > ARRAYLEN(
G_ux.stack) - 1) {
147 stack_slot = ARRAYLEN(
G_ux.stack) - 1;
151 if (stack_slot >=
G_ux.stack_count) {
158 if (stack_slot != ARRAYLEN(
G_ux.stack) - 1) {
159 memmove(&
G_ux.stack[stack_slot],
160 &
G_ux.stack[stack_slot + 1],
161 (ARRAYLEN(
G_ux.stack) - (stack_slot + 1)) *
sizeof(
G_ux.stack[0]));
164 memmove(&
G_ux.flow_stack[stack_slot],
165 &
G_ux.flow_stack[stack_slot + 1],
166 (ARRAYLEN(
G_ux.flow_stack) - (stack_slot + 1)) *
sizeof(
G_ux.flow_stack[0]));
185#ifdef HAVE_UX_STACK_INIT_KEEP_TICKER
187 unsigned int ticker_value =
G_ux.stack[stack_slot].ticker_value;
188 unsigned int ticker_interval =
G_ux.stack[stack_slot].ticker_interval;
192 memset(&
G_ux.stack[stack_slot], 0,
sizeof(
G_ux.stack[0]));
194#ifdef HAVE_UX_STACK_INIT_KEEP_TICKER
195 G_ux.stack[stack_slot].ticker_callback = ticker_callback;
196 G_ux.stack[stack_slot].ticker_value = ticker_value;
197 G_ux.stack[stack_slot].ticker_interval = ticker_interval;
201 G_ux.stack[stack_slot].exit_code_after_elements_displayed = BOLOS_UX_CONTINUE;
209 if (
G_ux.stack_count) {
210 if (
G_ux.stack[
G_ux.stack_count - 1].screen_before_element_display_callback) {
211 el =
G_ux.stack[
G_ux.stack_count - 1].screen_before_element_display_callback(element);
216 if ((
unsigned int) el != 1) {
227 unsigned int elem_idx;
228 unsigned int total_element_count;
232 total_element_count = 0;
235 if ((os_perso_isonboarded() != BOLOS_UX_OK || os_global_pin_is_validated() == BOLOS_UX_OK))
244 while (elem_idx < slot->element_arrays[i].element_array_count) {
253 if (
G_ux.exit_code != BOLOS_UX_CONTINUE) {
259 if ((
unsigned int) el != 1) {
262 io_seph_ux_display_bagl_element(element);
277 if (slot->displayed_callback) {
280 if (!slot->displayed_callback(0)) {
282 G_ux.exit_code = BOLOS_UX_CONTINUE;
295 if (
G_ux.stack_count > 0 && stack_slot + 1 ==
G_ux.stack_count) {
298 G_ux.stack[stack_slot].element_index = 0;
303 else if (stack_slot == -1UL ||
G_ux.stack_count == 0) {
304 if (
G_ux.exit_code == BOLOS_UX_OK) {
305 G_ux.exit_code = BOLOS_UX_REDRAW;
unsigned char element_arrays_count
bolos_task_status_t exit_code_after_elements_displayed
unsigned short element_index
const bagl_element_t * element_array
struct ux_stack_slot_s::@166304236013336006265026002007073137100166151357 element_arrays[UX_STACK_SLOT_ARRAY_COUNT]
unsigned char element_array_count
static void ux_discard_button_gesture(void)
#define UX_STACK_SLOT_COUNT
struct bagl_element_e bagl_element_t
struct ux_stack_slot_s ux_stack_slot_t
#define UX_STACK_SLOT_ARRAY_COUNT
unsigned int(* callback_int_t)(unsigned int)
unsigned int ux_flow_relayout(void)
unsigned int ux_stack_push(void)
unsigned int ux_stack_is_element_array_present(const bagl_element_t *element_array)
const bagl_element_t * ux_stack_display_element_callback(const bagl_element_t *element)
void ux_stack_display(unsigned int stack_slot)
void ux_stack_remove(unsigned int stack_slot)
void ux_stack_insert(unsigned int stack_slot)
void ux_stack_init(unsigned int stack_slot)
void ux_stack_display_elements(ux_stack_slot_t *slot)
void ux_stack_redisplay(void)
unsigned int ux_stack_pop(void)