Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/nyx/nyx_gui/frontend/gui.h
1476 views
1
/*
2
* Copyright (c) 2018-2025 CTCaer
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms and conditions of the GNU General Public License,
6
* version 2, as published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
* more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*/
16
17
#ifndef _GUI_H_
18
#define _GUI_H_
19
20
#include <libs/lvgl/lvgl.h>
21
22
typedef struct _emmc_tool_gui_t
23
{
24
lv_obj_t *label_log;
25
lv_obj_t *label_info;
26
lv_obj_t *label_pct;
27
lv_obj_t *label_finish;
28
lv_obj_t *bar;
29
lv_style_t *bar_teal_bg;
30
lv_style_t *bar_teal_ind;
31
lv_style_t *bar_white_ind;
32
char *txt_buf;
33
char *base_path;
34
bool raw_emummc;
35
} emmc_tool_gui_t;
36
37
typedef struct _gui_status_bar_ctx
38
{
39
lv_obj_t *bar_bg;
40
lv_obj_t *mid;
41
lv_obj_t *time_temp;
42
lv_obj_t *temp_symbol;
43
lv_obj_t *temp_degrees;
44
lv_obj_t *battery;
45
lv_obj_t *battery_more;
46
} gui_status_bar_ctx;
47
48
extern lv_style_t hint_small_style;
49
extern lv_style_t hint_small_style_white;
50
extern lv_style_t monospace_text;
51
52
extern lv_obj_t *payload_list;
53
extern lv_obj_t *autorcm_btn;
54
extern lv_obj_t *close_btn;
55
56
extern lv_img_dsc_t *icon_switch;
57
extern lv_img_dsc_t *icon_payload;
58
extern lv_img_dsc_t *icon_lakka;
59
60
extern lv_img_dsc_t *hekate_bg;
61
62
extern lv_style_t btn_transp_rel, btn_transp_pr, btn_transp_tgl_rel, btn_transp_tgl_pr;
63
extern lv_style_t ddlist_transp_bg, ddlist_transp_sel;
64
extern lv_style_t tabview_btn_pr, tabview_btn_tgl_pr;
65
66
extern lv_style_t mbox_darken;
67
68
extern char *text_color;
69
70
extern gui_status_bar_ctx status_bar;
71
72
void reload_nyx();
73
lv_img_dsc_t *bmp_to_lvimg_obj(const char *path);
74
lv_res_t mbox_action(lv_obj_t * btns, const char * txt);
75
bool nyx_emmc_check_battery_enough();
76
lv_res_t nyx_win_close_action_custom(lv_obj_t * btn);
77
void nyx_window_toggle_buttons(lv_obj_t *win, bool disable);
78
lv_obj_t *nyx_create_standard_window(const char *win_title);
79
lv_obj_t *nyx_create_window_custom_close_btn(const char *win_title, lv_action_t rel_action);
80
void nyx_create_onoff_button(lv_theme_t *th, lv_obj_t *parent, lv_obj_t *btn, const char *btn_name, lv_action_t action, bool transparent);
81
lv_res_t nyx_generic_onoff_toggle(lv_obj_t *btn);
82
void manual_system_maintenance(bool refresh);
83
void nyx_load_and_run();
84
85
#endif
86
87