13 #include <io/status_loggers.h>
14 #include <lib/stdio.h>
16 #include <drv/input/keymap.h>
18 #define TE_COLOR_BODY 0x00
19 #define TE_COLOR_TEXT 0x01
20 #define TE_COLOR_START_BODY 0x02
21 #define TE_COLOR_START_TEXT 0x03
22 #define TE_COLOR_BORDER 0x04
23 #define TE_COLOR_BACKGROUND 0x05
24 #define TE_COLOR_TITLE_BODY 0x06
25 #define TE_COLOR_TITLE_TEXT 0x07
26 #define TE_COLOR_BTN_BODY 0x08
27 #define TE_COLOR_BTN_TEXT 0x09
28 #define TE_COLOR_BTN_BORD 0x10
29 #define TE_COLOR_PGB_BORD 0x11
30 #define TE_COLOR_PGB_BODY 0x12
31 #define TE_COLOR_PGB_TEXT 0x13
35 int TE_getColor(
int item){
36 if (item == TE_COLOR_BODY)
return 0xFFFFFF;
37 if (item == TE_COLOR_TEXT)
return 0x000000;
38 if (item == TE_COLOR_START_BODY)
return 0xFFFFFF;
39 if (item == TE_COLOR_START_TEXT)
return 0x000000;
40 if (item == TE_COLOR_BORDER)
return 0x000000;
41 if (item == TE_COLOR_BACKGROUND)
return 0x000000;
42 if (item == TE_COLOR_TITLE_BODY)
return 0xFFFFFF;
43 if (item == TE_COLOR_TITLE_TEXT)
return 0x000000;
44 if (item == TE_COLOR_BTN_BODY)
return 0xFFFFFF;
45 if (item == TE_COLOR_BTN_TEXT)
return 0x000000;
46 if (item == TE_COLOR_BTN_BORD)
return 0x000000;
47 if (item == TE_COLOR_PGB_BORD)
return 0x000000;
48 if (item == TE_COLOR_PGB_BODY)
return 0xFFFFFF;
49 if (item == TE_COLOR_PGB_TEXT)
return 0x43ACE8;
54 setPosY(getScreenHeight() - 20);
59 tty_puts_color(
"22:22:22",TE_getColor(TE_COLOR_START_TEXT),TE_getColor(TE_COLOR_START_BODY));
63 tty_puts_color(
"EN",TE_getColor(TE_COLOR_START_TEXT),TE_getColor(TE_COLOR_START_BODY));
75 drawRect(x,y,w,h,TE_getColor(TE_COLOR_BODY));
77 drawRect(x+1,y+1,w-3,h-3,TE_getColor(TE_COLOR_TITLE_BODY));
81 _tty_puts_color(title,TE_getColor(TE_COLOR_TITLE_TEXT),TE_getColor(TE_COLOR_TITLE_BODY));
86 _tty_puts_color(msg,TE_getColor(TE_COLOR_TEXT),TE_getColor(TE_COLOR_BODY));
91 _tty_puts_color(
"X",TE_getColor(TE_COLOR_TITLE_TEXT),TE_getColor(TE_COLOR_TITLE_BODY));
94 if (
mode == 0)
return;
96 drawRect(x+16,y+h-22,w-32,16,TE_getColor(TE_COLOR_BTN_BODY));
97 drawRectBorder(x+17,y+h-21,w-35,15,TE_getColor(TE_COLOR_BTN_BORD));
100 _tty_puts_color(
"OK",TE_getColor(TE_COLOR_BTN_TEXT),TE_getColor(TE_COLOR_BTN_BODY));
105 drawRect(x+16,y+h-22,w-32,16,TE_getColor(TE_COLOR_PGB_BODY));
106 drawRectBorder(x+17,y+h-21,w-35,15,TE_getColor(TE_COLOR_PGB_BORD));
109 int pc = (((int) data * wb)/(int) data2);
110 drawRect(x+20,y+h-18,(pc == 0?((
int) data) + (wb) :pc),hb,TE_getColor(TE_COLOR_PGB_TEXT));
118 void TE_IconsLoader(){
162 qemu_log(
"[TE] Desktop Draw..");
165 drawRect(0, 0, getScreenWidth(), getScreenHeight(), TE_getColor(TE_COLOR_BACKGROUND));
170 drawRect(0, getScreenHeight() - 24, getScreenWidth(), 24, TE_getColor(TE_COLOR_START_BODY));
171 drawRectBorder(2, getScreenHeight() - 21, 38, 18, TE_getColor(TE_COLOR_BORDER));
174 setPosY(getScreenHeight() - 20);
175 tty_puts_color(
"Пуск",TE_getColor(TE_COLOR_START_TEXT),TE_getColor(TE_COLOR_START_BODY));
185 qemu_log(
"[TE] Loader..");
189 TE_DrawMessageBox(
"Заголовок",
"А я точно попаду в MessageBox?", 1, getScreenWidth() / 4, getScreenHeight() / 3, 1, 0, 0);
190 TE_DrawMessageBox(
"Инициализация...",
"Ожидание ответа NatSuki...", 2, getScreenWidth() / 4, 100, 0, 3, 10);
197 if (zx == 0)
TE_DrawMessageBox(
"[1/10] Инициализация...",
"Проверка...", 2, getScreenWidth() / 4, 100, 0, 1, 10);
198 if (zx == 2)
TE_DrawMessageBox(
"[2/10] Инициализация...",
"Инициализация системы...", 2, getScreenWidth() / 4, 100, 0, 2, 10);
199 if (zx == 3)
TE_DrawMessageBox(
"[3/10] Инициализация...",
"Сбор информации...", 2, getScreenWidth() / 4, 100, 0, 3, 10);
200 if (zx == 4)
TE_DrawMessageBox(
"[4/10] Инициализация...",
"Подключение к NatSuki...", 2, getScreenWidth() / 4, 100, 0, 4, 10);
201 if (zx == 5)
TE_DrawMessageBox(
"[5/10] Инициализация...",
"Синхронизация...", 2, getScreenWidth() / 4, 100, 0, 5, 10);
202 if (zx == 6)
TE_DrawMessageBox(
"[6/10] Инициализация...",
"Загрузка темы оформления...", 2, getScreenWidth() / 4, 100, 0, 6, 10);
203 if (zx == 7)
TE_DrawMessageBox(
"[7/10] Инициализация...",
"Загрузка меню пуск...", 2, getScreenWidth() / 4, 100, 0, 7, 10);
204 if (zx == 8)
TE_DrawMessageBox(
"[8/10] Инициализация...",
"Поиск доступных программ...", 2, getScreenWidth() / 4, 100, 0, 8, 10);
205 if (zx == 9)
TE_DrawMessageBox(
"[9/10] Инициализация...",
"Активация курсора...", 2, getScreenWidth() / 4, 100, 0, 9, 10);
206 if (zx == 9) mouse_set_state(CURSOR_NORMAL);
207 if (zx == 10)
TE_DrawMessageBox(
"[10/10] Инициализация...",
"С возращением, oem!", 2, getScreenWidth() / 4, 100, 0, 10, 10);
uint32_t mode
Режим работы (0 - Обычный | 1 - Режим логирования)
void drawRect(uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t color)
Рисуем залитый прямоугольник
void drawRectBorder(int x, int y, int w, int h, int color)
Рисует линию вокруг прямоугольника
void sleep_ms(uint32_t milliseconds)
Ожидание по миллисекундам
void TE_DrawMessageBox(char *title, char *msg, int mode, int x, int y, int close, int data, int data2)
void setPosX(uint32_t x)
Изменяем позицию курсора по X.
void setPosY(uint32_t y)
Изменяем позицию курсора по Y.