-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
97 lines (78 loc) · 2.84 KB
/
main.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
#include <lvmx.h>
#define APP_NUM 16
int main() {
int splash = createSlotFromTemplate("UIXempty");
int splashText = createSlotFromTemplate("UIXtext");
setDVString(splashText, "content", "Gammalab");
setDVFloat(splashText, "R", 0.019607843137255f);
setDVFloat(splashText, "G", 0.949019607843137f);
setDVFloat(splashText, "B", 0.949019607843137f);
setSlotParent(splashText, splash);
setSlotParent(splash, UIXROOT_SLOT);
int wrap = createSlotFromTemplate("UIXempty");
int headerRect = createSlotFromTemplate("UIXempty");
setDVFloat(headerRect, "Amy", 0.9f);
setSlotParent(headerRect, wrap);
int headerText = createSlotFromTemplate("UIXtext");
setDVString(headerText, "content", "HOME");
setDVFloat(headerText, "size", 48.0f);
setDVFloat(headerText, "R", 0.019607843137255f);
setDVFloat(headerText, "G", 0.949019607843137f);
setDVFloat(headerText, "B", 0.949019607843137f);
setSlotParent(headerText, headerRect);
int bodyRect = createSlotFromTemplate("UIXempty");
setDVFloat(bodyRect, "AMy", 0.9f);
setSlotParent(bodyRect, wrap);
int body = createSlotFromTemplate("UIXlayoutV");
setDVInt(body, "alignV", 0);
setDVFloat(body, "padTop", 4.0f);
setDVFloat(body, "padBottom", 4.0f);
setDVFloat(body, "padLeft", 4.0f);
setDVFloat(body, "padRight", 4.0f);
setDVFloat(body, "spacing", 4.0f);
setSlotParent(body, bodyRect);
int appButtonTemp = createSlotFromTemplate("UIXbutton");
int appButtonImg = createSlotFromTemplate("UIXimage");
setDVFloat(appButtonImg, "R", 0.011764705882353f);
setDVFloat(appButtonImg, "G", 0.396078431372549f);
setDVFloat(appButtonImg, "B", 0.549019607843137f);
setSlotParent(appButtonImg, appButtonTemp);
int appButtonText = createSlotFromTemplate("UIXtext");
setDVFloat(appButtonText, "R", 0.8f);
setDVFloat(appButtonText, "G", 0.8f);
setDVFloat(appButtonText, "B", 0.8f);
setSlotParent(appButtonText, appButtonImg);
int layoutElem = createSlotFromTemplate("UIXlayoutElem");
setDVFloat(layoutElem, "minH", 32.0f);
int i;
int appitr = 0;
int textbuff[32];
int appNameBuff[64];
int app_buttons[APP_NUM];
int appIDs[APP_NUM];
for (i = 0; i < APP_NUM; i++) {
format(textbuff, "AppFlag%d", i);
if (getDVInt(DEVICEROOT_SLOT, textbuff) != 0) {
format(textbuff, "AppName%d", i);
getDVString(DEVICEROOT_SLOT, textbuff, appNameBuff);
setDVString(appButtonText, "content", appNameBuff);
int newLayout = dupSlot(layoutElem);
int newbutton = dupSlot(appButtonTemp);
setSlotParent(newbutton, newLayout);
setSlotParent(newLayout, body);
appIDs[appitr] = i;
app_buttons[appitr++] = newbutton;
}
}
destroySlot(splash);
setSlotParent(wrap, UIXROOT_SLOT);
setDVInt(DEVICEROOT_SLOT, "OVERCLOCK", 10);
while (1) {
for (i = 0; i < appitr; i++) {
if (getDVInt(app_buttons[i], "pressed") != 0) {
setDVInt(DEVICEROOT_SLOT, "NEXTLOAD", appIDs[i]);
setDVInt(DEVICEROOT_SLOT, "RESET", 1);
}
}
}
}