Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/nyx/nyx_gui/frontend/gui.h
3711 views
1
/*
2
* Copyright (c) 2018-2026 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_bg;
32
lv_style_t *bar_white_ind;
33
lv_style_t *bar_orange_bg;
34
lv_style_t *bar_orange_ind;
35
char *txt_buf;
36
char *base_path;
37
bool raw_emummc;
38
} emmc_tool_gui_t;
39
40
typedef struct _gui_status_bar_ctx
41
{
42
lv_obj_t *bar_bg;
43
lv_obj_t *mid;
44
lv_obj_t *time_temp;
45
lv_obj_t *temp_symbol;
46
lv_obj_t *temp_degrees;
47
lv_obj_t *battery;
48
lv_obj_t *battery_more;
49
} gui_status_bar_ctx;
50
51
extern lv_style_t hint_small_style;
52
extern lv_style_t hint_small_style_white;
53
extern lv_style_t monospace_text;
54
55
extern lv_obj_t *payload_list;
56
extern lv_obj_t *autorcm_btn;
57
extern lv_obj_t *close_btn;
58
59
extern lv_img_dsc_t *icon_switch;
60
extern lv_img_dsc_t *icon_payload;
61
extern lv_img_dsc_t *icon_lakka;
62
63
extern lv_img_dsc_t *hekate_bg;
64
65
extern lv_style_t btn_transp_rel, btn_transp_pr, btn_transp_tgl_rel, btn_transp_tgl_pr, btn_transp_ina;
66
extern lv_style_t ddlist_transp_bg, ddlist_transp_sel;
67
extern lv_style_t tabview_btn_pr, tabview_btn_tgl_pr;
68
69
extern lv_style_t mbox_darken;
70
71
extern char *text_color;
72
73
extern gui_status_bar_ctx status_bar;
74
75
void reload_nyx(lv_obj_t *obj, bool force);
76
lv_img_dsc_t *bmp_to_lvimg_obj(const char *path);
77
bool nyx_emmc_check_battery_enough();
78
lv_res_t nyx_mbox_action(lv_obj_t * btns, const char * txt);
79
lv_res_t nyx_win_close_action(lv_obj_t * btn);
80
void nyx_window_toggle_buttons(lv_obj_t *win, bool disable);
81
lv_obj_t *nyx_create_standard_window(const char *win_title, lv_action_t close_action);
82
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);
83
lv_res_t nyx_generic_onoff_toggle(lv_obj_t *btn);
84
void manual_system_maintenance(bool refresh);
85
void nyx_load_and_run();
86
87
#endif
88
89