forked from esp-cpp/esp-box-emu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.c
109 lines (98 loc) · 3.41 KB
/
ui.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.3.4
// LVGL version: 8.3.3
// Project name: emu
#include "ui.h"
#include "ui_helpers.h"
///////////////////// VARIABLES ////////////////////
// SCREEN: ui_romscreen
void ui_romscreen_screen_init(void);
lv_obj_t *ui_romscreen;
lv_obj_t *ui_header;
void ui_event_settingsbutton( lv_event_t * e);
lv_obj_t *ui_settingsbutton;
lv_obj_t *ui_Screen1_Label2;
lv_obj_t *ui_battery_soc_symbol_1;
lv_obj_t *ui_battery_charging_symbol_1;
lv_obj_t *ui_battery_soc_text_1;
lv_obj_t *ui_Screen1_Label1;
lv_obj_t *ui_playbutton;
lv_obj_t *ui_Screen1_Label3;
lv_obj_t *ui_rompanel;
lv_obj_t *ui_boxartpanel;
lv_obj_t *ui_boxart;
// SCREEN: ui_settingsscreen
void ui_settingsscreen_screen_init(void);
lv_obj_t *ui_settingsscreen;
lv_obj_t *ui_header1;
lv_obj_t *ui_battery_charging_symbol;
lv_obj_t *ui_battery_soc_symbol;
lv_obj_t *ui_battery_soc_text;
void ui_event_closebutton( lv_event_t * e);
lv_obj_t *ui_closebutton;
lv_obj_t *ui_Screen1_Label4;
lv_obj_t *ui_Screen1_Label5;
lv_obj_t *ui_settingspanel;
lv_obj_t *ui_volumepanel;
lv_obj_t *ui_volumebar;
lv_obj_t *ui_mutebutton;
lv_obj_t *ui_settingsscreen_Label1;
lv_obj_t *ui_volumedownbutton;
lv_obj_t *ui_settingsscreen_Label2;
lv_obj_t *ui_volumeupbutton;
lv_obj_t *ui_settingsscreen_Label3;
lv_obj_t *ui_brightnesspanel;
lv_obj_t *ui_brightnessbar;
lv_obj_t *ui_brightnessdownbutton;
lv_obj_t *ui_settingsscreen_Label10;
lv_obj_t *ui_brightnessupbutton;
lv_obj_t *ui_settingsscreen_Label11;
lv_obj_t *ui_fillpanel;
lv_obj_t *ui_settingsscreen_Label4;
lv_obj_t *ui_videosettingdropdown;
lv_obj_t *ui_hapticpanel;
lv_obj_t *ui_settingsscreen_Label5;
lv_obj_t *ui_settingsscreen_Panel1;
lv_obj_t *ui_hapticlabel;
lv_obj_t *ui_hapticdownbutton;
lv_obj_t *ui_settingsscreen_Label7;
lv_obj_t *ui_hapticupbutton;
lv_obj_t *ui_settingsscreen_Label6;
lv_obj_t *ui_hapticplaybutton;
lv_obj_t *ui_settingsscreen_Label8;
lv_obj_t *ui_usb_panel;
lv_obj_t *ui_settingsscreen_Label9;
lv_obj_t *ui_usb_button;
lv_obj_t *ui_usb_label;
///////////////////// TEST LVGL SETTINGS ////////////////////
#if LV_COLOR_DEPTH != 16
#error "LV_COLOR_DEPTH should be 16bit to match SquareLine Studio's settings"
#endif
#if LV_COLOR_16_SWAP !=1
#error "LV_COLOR_16_SWAP should be 1 to match SquareLine Studio's settings"
#endif
///////////////////// ANIMATIONS ////////////////////
///////////////////// FUNCTIONS ////////////////////
void ui_event_settingsbutton( lv_event_t * e) {
lv_event_code_t event_code = lv_event_get_code(e);lv_obj_t * target = lv_event_get_target(e);
if ( event_code == LV_EVENT_CLICKED) {
_ui_screen_change( &ui_settingsscreen, LV_SCR_LOAD_ANIM_MOVE_RIGHT, 100, 0, &ui_settingsscreen_screen_init);
}
}
void ui_event_closebutton( lv_event_t * e) {
lv_event_code_t event_code = lv_event_get_code(e);lv_obj_t * target = lv_event_get_target(e);
if ( event_code == LV_EVENT_CLICKED) {
_ui_screen_change( &ui_romscreen, LV_SCR_LOAD_ANIM_MOVE_LEFT, 100, 0, &ui_romscreen_screen_init);
}
}
///////////////////// SCREENS ////////////////////
void ui_init( void )
{
lv_disp_t *dispp = lv_disp_get_default();
lv_theme_t *theme = lv_theme_default_init(dispp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED), true, LV_FONT_DEFAULT);
lv_disp_set_theme(dispp, theme);
ui_romscreen_screen_init();
ui_settingsscreen_screen_init();
ui____initial_actions0 = lv_obj_create(NULL);
lv_disp_load_scr( ui_romscreen);
}