2023-01-28 20:41:18 +08:00
|
|
|
#ifndef TUI_H
|
|
|
|
|
#define TUI_H
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <locale.h>
|
|
|
|
|
#include <unistd.h>
|
2023-02-04 21:29:49 +08:00
|
|
|
#include <newt.h>
|
2023-05-29 01:56:12 +08:00
|
|
|
#include <paleinfo.h>
|
2023-01-28 20:41:18 +08:00
|
|
|
|
2023-02-05 02:42:12 +08:00
|
|
|
#define WIDTH 76
|
|
|
|
|
#define HEIGHT 19
|
2023-01-28 20:41:18 +08:00
|
|
|
|
2023-02-05 14:37:01 +08:00
|
|
|
#define PI_LOG_COLOR NEWT_COLORSET_CUSTOM(0)
|
|
|
|
|
#define PI_STEP_CURRENT NEWT_COLORSET_CUSTOM(1)
|
|
|
|
|
#define PI_STEP_OTHER NEWT_COLORSET_CUSTOM(2)
|
2023-01-29 13:08:48 +08:00
|
|
|
|
2023-06-12 19:58:34 +08:00
|
|
|
#define CHECKBOX_STATE(flags, opt) (flags & opt) != 0 ? '*' : ' '
|
2023-02-04 21:29:49 +08:00
|
|
|
|
2023-01-29 13:08:48 +08:00
|
|
|
typedef enum tui_screens {
|
2023-01-29 01:02:47 +08:00
|
|
|
ERROR_SCREEN = -1,
|
|
|
|
|
EXIT_SCREEN = 0,
|
|
|
|
|
MAIN_SCREEN = 1,
|
|
|
|
|
OPTIONS_SCREEN = 2,
|
|
|
|
|
ENTER_DFU_SCREEN = 3,
|
|
|
|
|
JAILBREAKING_SCREEN = 4,
|
|
|
|
|
ENTER_RECOVERY_SCREEN = 5
|
2023-01-29 13:08:48 +08:00
|
|
|
} tui_screen_t;
|
|
|
|
|
|
2023-02-04 21:29:49 +08:00
|
|
|
typedef struct bitfield_checkbox_info {
|
2023-05-29 01:56:12 +08:00
|
|
|
uint64_t* flags_p;
|
|
|
|
|
uint64_t opt;
|
2023-02-04 21:29:49 +08:00
|
|
|
} tui_bit_info_t;
|
|
|
|
|
|
2023-06-12 19:58:34 +08:00
|
|
|
tui_screen_t tui_screen_main(void);
|
|
|
|
|
tui_screen_t tui_screen_options(void);
|
|
|
|
|
tui_screen_t tui_screen_enter_recovery(void);
|
|
|
|
|
tui_screen_t tui_screen_enter_dfu(void);
|
|
|
|
|
tui_screen_t tui_screen_jailbreak(void);
|
2023-01-29 13:08:48 +08:00
|
|
|
|
2023-06-12 19:58:34 +08:00
|
|
|
int redraw_screen(void);
|
2023-01-29 13:08:48 +08:00
|
|
|
|
2023-01-28 20:41:18 +08:00
|
|
|
|
|
|
|
|
#endif
|