-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
259 lines (191 loc) · 5.97 KB
/
main.cpp
File metadata and controls
259 lines (191 loc) · 5.97 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
/*
* PROJECT: LVGL ported to Windows Desktop
* FILE: LVGL.Windows.Desktop.cpp
* PURPOSE: Implementation for LVGL ported to Windows Desktop
*
* LICENSE: The MIT License
*
* DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com)
*/
#include <Windows.h>
#include "resource.h"
#if _MSC_VER >= 1200
// Disable compilation warnings.
#pragma warning(push)
// nonstandard extension used : bit field types other than int
#pragma warning(disable:4214)
// 'conversion' conversion from 'type1' to 'type2', possible loss of data
#pragma warning(disable:4244)
#endif
#include "lvgl/lvgl.h"
#include "lvgl/examples/lv_examples.h"
#include "lv_demos/lv_demo.h"
#include "lv_drivers/win32drv/win32drv.h"
#include "app/text_table.h"
#ifdef __cplusplus
extern "C" {
void frmCounterProcess(void);
void frmOvenProcess(void);
void frmOvenControl_init(void);
void frmCounterProcess_init(void);
void loadSettings(void);
void ui_common_init(void);
void ui_set_main_frm_init(void (*fncptr)(void));
}
#endif
#if _MSC_VER >= 1200
// Restore compilation warnings.
#pragma warning(pop)
#endif
int main()
{
lv_init();
if (!lv_win32_init(
GetModuleHandleW(NULL),
SW_SHOW,
320,//800,
240,//480,
LoadIconW(GetModuleHandleW(NULL), MAKEINTRESOURCE(IDI_LVGL))))
{
return -1;
}
/*
* Demos, benchmarks, and tests.
*
* Uncomment any one (and only one) of the functions below to run that
* item.
*/
// ----------------------------------
// my application
// ----------------------------------
// TODO: It's your implementation here.
loadSettings();
// ----------------------------------
// Demos from lv_examples
// ----------------------------------
ui_common_init();
load_language();
frmCounterProcess_init();
ui_set_main_frm_init(frmCounterProcess_init);
//frmOvenControl_init();
//ui_set_main_frm_init(frmOvenControl_init);
// lv_demo_widgets(); // ok
uint32_t i;
// lv_demo_benchmark();
// lv_demo_keypad_encoder(); // ok
// lv_demo_music(); // removed from repository
// lv_demo_printer(); // removed from repository
// lv_demo_stress(); // ok
// ----------------------------------
// LVGL examples
// ----------------------------------
/*
* There are many examples of individual widgets found under the
* lvgl\exampless directory. Here are a few sample test functions.
* Look in that directory to find all the rest.
*/
// lv_ex_get_started_1();
// lv_ex_get_started_2();
// lv_ex_get_started_3();
// lv_example_flex_1();
// lv_example_flex_2();
// lv_example_flex_3();
// lv_example_flex_4();
// lv_example_flex_5();
// lv_example_flex_6(); // ok
// lv_example_grid_1();
// lv_example_grid_2();
// lv_example_grid_3();
// lv_example_grid_4();
// lv_example_grid_5();
// lv_example_grid_6();
// lv_port_disp_template();
// lv_port_fs_template();
// lv_port_indev_template();
// lv_example_scroll_1();
// lv_example_scroll_2();
// lv_example_scroll_3();
// lv_example_style_1();
// lv_example_style_2();
// lv_example_style_3();
// lv_example_style_4(); // ok
// lv_example_style_6(); // file has no source code
// lv_example_style_7();
// lv_example_style_8();
// lv_example_style_9();
// lv_example_style_10();
// lv_example_style_11(); // ok
// ----------------------------------
// LVGL widgets examples
// ----------------------------------
// lv_example_arc_1();
// lv_example_arc_2();
// lv_example_bar_1(); // ok
// lv_example_bar_2();
// lv_example_bar_3();
// lv_example_bar_4();
// lv_example_bar_5();
// lv_example_bar_6(); // issues
// lv_example_btn_1();
// lv_example_btn_2();
// lv_example_btn_3();
// lv_example_btnmatrix_1();
// lv_example_btnmatrix_2();
// lv_example_btnmatrix_3();
// lv_example_calendar_1();
// lv_example_canvas_1();
// lv_example_canvas_2();
// lv_example_chart_1(); // ok
// lv_example_chart_2(); // ok
// lv_example_chart_3(); // ok
// lv_example_chart_4(); // ok
// lv_example_chart_5(); // ok
// lv_example_chart_6(); // ok
// lv_example_checkbox_1();
// lv_example_colorwheel_1(); // ok
// lv_example_dropdown_1();
// lv_example_dropdown_2();
// lv_example_dropdown_3();
// lv_example_img_1();
// lv_example_img_2();
// lv_example_img_3();
// lv_example_img_4(); // ok
// lv_example_imgbtn_1();
// lv_example_keyboard_1(); // ok
// lv_example_label_1();
// lv_example_label_2(); // ok
// lv_example_led_1();
// lv_example_line_1();
// lv_example_list_1();
// lv_example_meter_1();
// lv_example_meter_2();
// lv_example_meter_3();
// lv_example_meter_4(); // ok
// lv_example_msgbox_1();
// lv_example_obj_1(); // ok
// lv_example_roller_1();
// lv_example_roller_2(); // ok
// lv_example_slider_1(); // ok
// lv_example_slider_2(); // issues
// lv_example_slider_3(); // issues
// lv_example_spinbox_1();
// lv_example_spinner_1(); // ok
// lv_example_switch_1(); // ok
// lv_example_table_1();
// lv_example_table_2(); // ok
// lv_example_tabview_1();
// lv_example_textarea_1(); // ok
// lv_example_textarea_2();
// lv_example_textarea_3(); // ok, but not all button have functions
// lv_example_tileview_1(); // ok
// lv_example_win_1(); // ok
// ----------------------------------
// Task handler loop
// ----------------------------------
while (!lv_win32_quit_signal)
{
lv_task_handler();
Sleep(1);
}
return 0;
}