1 | #ifndef SKINADJUST_H |
---|
2 | #define SKINADJUST_H |
---|
3 | |
---|
4 | void screenskinadjust() |
---|
5 | { |
---|
6 | int rcret = 0, oleftoffset = 0, orightoffset = 0, otopoffset = 0, obottomoffset = 0, reboot = 0; |
---|
7 | struct skin* skinadjust = getscreen("skinadjust"); |
---|
8 | struct skin* listbox = getscreennode(skinadjust, "listbox"); |
---|
9 | struct skin* fontsizeadjust = getscreennode(skinadjust, "fontsizeadjust"); |
---|
10 | struct skin* listboxselecttype = getscreennode(skinadjust, "listboxselecttype"); |
---|
11 | struct skin* osdtransparent = getscreennode(skinadjust, "osdtransparent"); |
---|
12 | struct skin* leftoffset = getscreennode(skinadjust, "leftoffset"); |
---|
13 | struct skin* rightoffset = getscreennode(skinadjust, "rightoffset"); |
---|
14 | struct skin* topoffset = getscreennode(skinadjust, "topoffset"); |
---|
15 | struct skin* bottomoffset = getscreennode(skinadjust, "bottomoffset"); |
---|
16 | struct skin* showrecfreesize = getscreennode(skinadjust, "showrecfreesize"); |
---|
17 | struct skin* listboxselect = getscreennode(skinadjust, "listboxselect"); |
---|
18 | struct skin* tithek_selectcol = getscreennode(skinadjust, "tithek_selectcol"); |
---|
19 | struct skin* filelistselect = getscreennode(skinadjust, "filelistselect"); |
---|
20 | |
---|
21 | struct skin* oled_sel = getscreennode(skinadjust, "oled_sel"); |
---|
22 | struct skin* infobar_sel = getscreennode(skinadjust, "infobar_sel"); |
---|
23 | struct skin* pic1 = getscreennode(skinadjust, "pic1"); |
---|
24 | struct skin* pic2 = getscreennode(skinadjust, "pic2"); |
---|
25 | |
---|
26 | struct skin* tmp = NULL; |
---|
27 | |
---|
28 | changeinput(fontsizeadjust, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n-15\n-14\n-13\n-12\n-11\n-10\n-9\n-8\n-7\n-6\n-5\n-4\n-3\n-2\n-1"); |
---|
29 | setchoiceboxselection(fontsizeadjust, getskinconfig("fontsizeadjust", NULL)); |
---|
30 | |
---|
31 | addchoicebox(listboxselecttype, "0", _("border")); |
---|
32 | addchoicebox(listboxselecttype, "1", _("bar")); |
---|
33 | addchoicebox(listboxselecttype, "2", _("text")); |
---|
34 | addchoicebox(listboxselecttype, "3", _("picture")); |
---|
35 | setchoiceboxselection(listboxselecttype, getskinconfig("listboxselecttype", NULL)); |
---|
36 | |
---|
37 | changeinput(osdtransparent, "0\n5\n10\n15\n20\n25\n30\n35\n40\n45\n50\n55\n60\n65\n70"); |
---|
38 | setchoiceboxselection(osdtransparent, getskinconfig("osdtransparent", NULL)); |
---|
39 | |
---|
40 | #ifdef MIPSEL |
---|
41 | changeinput(leftoffset, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20"); |
---|
42 | setchoiceboxselection(leftoffset, getconfig("fbleftoffset", NULL)); |
---|
43 | |
---|
44 | changeinput(rightoffset, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20"); |
---|
45 | setchoiceboxselection(rightoffset, getconfig("fbrightoffset", NULL)); |
---|
46 | |
---|
47 | changeinput(topoffset, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20"); |
---|
48 | setchoiceboxselection(topoffset, getconfig("fbtopoffset", NULL)); |
---|
49 | |
---|
50 | changeinput(bottomoffset, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20"); |
---|
51 | setchoiceboxselection(bottomoffset, getconfig("fbbottomoffset", NULL)); |
---|
52 | #else |
---|
53 | changeinput(leftoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100"); |
---|
54 | setchoiceboxselection(leftoffset, getconfig("fbleftoffset", NULL)); |
---|
55 | |
---|
56 | changeinput(rightoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100"); |
---|
57 | setchoiceboxselection(rightoffset, getconfig("fbrightoffset", NULL)); |
---|
58 | |
---|
59 | changeinput(topoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100"); |
---|
60 | setchoiceboxselection(topoffset, getconfig("fbtopoffset", NULL)); |
---|
61 | |
---|
62 | changeinput(bottomoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100"); |
---|
63 | setchoiceboxselection(bottomoffset, getconfig("fbbottomoffset", NULL)); |
---|
64 | #endif |
---|
65 | oleftoffset = getconfigint("fbleftoffset", NULL); |
---|
66 | orightoffset = getconfigint("fbrightoffset", NULL); |
---|
67 | otopoffset = getconfigint("fbtopoffset", NULL); |
---|
68 | obottomoffset = getconfigint("fbbottomoffset", NULL); |
---|
69 | |
---|
70 | // why this ? and atemio6200 ? |
---|
71 | if(checkbox("ATEMIO5200") == 3) |
---|
72 | { |
---|
73 | leftoffset->hidden = YES; |
---|
74 | rightoffset->hidden = YES; |
---|
75 | topoffset->hidden = YES; |
---|
76 | bottomoffset->hidden = YES; |
---|
77 | pic1->hidden = YES; |
---|
78 | pic2->hidden = YES; |
---|
79 | } |
---|
80 | if(checkbox("ATEMIO-NEMESIS")) |
---|
81 | { |
---|
82 | if(checkscreen("OLED_nemesis") != status.skinerr) |
---|
83 | addchoicebox(oled_sel, "OLED_nemesis", "v1"); |
---|
84 | if(checkscreen("OLED_nemesis_v2") != status.skinerr) |
---|
85 | addchoicebox(oled_sel, "OLED_nemesis_v2","v2"); |
---|
86 | if(checkscreen("OLED_nemesis_v3") != status.skinerr) |
---|
87 | addchoicebox(oled_sel, "OLED_nemesis_v3","v3"); |
---|
88 | if(checkscreen("OLED_nemesis_v4") != status.skinerr) |
---|
89 | addchoicebox(oled_sel, "OLED_nemesis_v4","v4"); |
---|
90 | if(checkscreen("OLED_nemesis_v5") != status.skinerr) |
---|
91 | addchoicebox(oled_sel, "OLED_nemesis_v5","v5"); |
---|
92 | if(checkscreen("OLED_nemesis_v6") != status.skinerr) |
---|
93 | addchoicebox(oled_sel, "OLED_nemesis_v6","v6"); |
---|
94 | |
---|
95 | setchoiceboxselection(oled_sel, getskinconfig("OLED_nemesis", NULL)); |
---|
96 | } |
---|
97 | else |
---|
98 | oled_sel->hidden = YES; |
---|
99 | |
---|
100 | if(checkscreen("infobar") != status.skinerr) |
---|
101 | addchoicebox(infobar_sel, "infobar", "v1"); |
---|
102 | if(checkscreen("infobar_v2") != status.skinerr) |
---|
103 | addchoicebox(infobar_sel, "infobar_v2","v2"); |
---|
104 | if(checkscreen("infobar_v3") != status.skinerr) |
---|
105 | addchoicebox(infobar_sel, "infobar_v3","v3"); |
---|
106 | setchoiceboxselection(infobar_sel, getskinconfig("infobar_selection", NULL)); |
---|
107 | |
---|
108 | addchoicebox(showrecfreesize, "0", _("no")); |
---|
109 | addchoicebox(showrecfreesize, "1", _("yes (Text in %)")); |
---|
110 | addchoicebox(showrecfreesize, "2", _("yes (Text in MB)")); |
---|
111 | setchoiceboxselection(showrecfreesize, getconfig("showrecfreesize", NULL)); |
---|
112 | |
---|
113 | addchoicebox(listboxselect, "0", _("press red")); |
---|
114 | addchoicebox(tithek_selectcol, "1", _("press green")); |
---|
115 | addchoicebox(filelistselect, "2", _("press yellow")); |
---|
116 | |
---|
117 | drawscreen(skinadjust, 0, 0); |
---|
118 | addscreenrc(skinadjust, listbox); |
---|
119 | |
---|
120 | tmp = listbox->select; |
---|
121 | while(1) |
---|
122 | { |
---|
123 | int offsetchange = 0; |
---|
124 | addscreenrc(skinadjust, tmp); |
---|
125 | rcret = waitrc(skinadjust, 0, 0); |
---|
126 | tmp = listbox->select; |
---|
127 | |
---|
128 | addconfigscreencheck("fbleftoffset", leftoffset, "0"); |
---|
129 | if(status.leftoffset != getconfigint("fbleftoffset", NULL)) offsetchange = 1; |
---|
130 | status.leftoffset = getconfigint("fbleftoffset", NULL); |
---|
131 | |
---|
132 | addconfigscreencheck("fbrightoffset", rightoffset, "0"); |
---|
133 | if(status.rightoffset != getconfigint("fbrightoffset", NULL)) offsetchange = 1; |
---|
134 | status.rightoffset = getconfigint("fbrightoffset", NULL); |
---|
135 | |
---|
136 | addconfigscreencheck("fbtopoffset", topoffset, "0"); |
---|
137 | if(status.topoffset != getconfigint("fbtopoffset", NULL)) offsetchange = 1; |
---|
138 | status.topoffset = getconfigint("fbtopoffset", NULL); |
---|
139 | |
---|
140 | addconfigscreencheck("fbbottomoffset", bottomoffset, "0"); |
---|
141 | if(status.bottomoffset != getconfigint("fbbottomoffset", NULL)) offsetchange = 1; |
---|
142 | status.bottomoffset = getconfigint("fbbottomoffset", NULL); |
---|
143 | |
---|
144 | if(offsetchange == 1 && (ostrcmp(getconfig("av_mode3d", NULL), "sbs") == 0 || ostrcmp(getconfig("av_mode3d", NULL), "tab") == 0)) clearfball(); |
---|
145 | |
---|
146 | drawscreen(skinadjust, 0, 0); |
---|
147 | |
---|
148 | #ifdef MIPSEL |
---|
149 | setfbosd(); |
---|
150 | #endif |
---|
151 | |
---|
152 | if((rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL)) && checkbox("ATEMIO-NEMESIS") == 1 && listbox->select != NULL && ostrcmp(listbox->select->name, "oled_sel") == 0) |
---|
153 | { |
---|
154 | char* tmpstr = NULL; |
---|
155 | tmpstr = ostrcat(tmpstr, oled_sel->ret, 0, 0); |
---|
156 | struct skin* OLED_nemesis = getscreen(tmpstr); |
---|
157 | if(status.skinerr == OLED_nemesis) |
---|
158 | OLED_nemesis = getscreen("OLED_nemesis"); |
---|
159 | struct skin* textbox = getscreennode(OLED_nemesis, "textbox"); |
---|
160 | changetext(textbox, tmpstr); |
---|
161 | drawscreen(OLED_nemesis, 0, 0); |
---|
162 | free(tmpstr);tmpstr=NULL; |
---|
163 | } |
---|
164 | |
---|
165 | if(rcret == getrcconfigint("rcexit", NULL)) |
---|
166 | { |
---|
167 | addconfigint("fbleftoffset", oleftoffset); |
---|
168 | status.leftoffset = getconfigint("fbleftoffset", NULL); |
---|
169 | addconfigint("fbrightoffset", orightoffset); |
---|
170 | status.rightoffset = getconfigint("fbrightoffset", NULL); |
---|
171 | addconfigint("fbtopoffset", otopoffset); |
---|
172 | status.topoffset = getconfigint("fbtopoffset", NULL); |
---|
173 | addconfigint("fbbottomoffset", obottomoffset); |
---|
174 | status.bottomoffset = getconfigint("fbbottomoffset", NULL); |
---|
175 | clearfball(); |
---|
176 | break; |
---|
177 | } |
---|
178 | |
---|
179 | if(rcret == getrcconfigint("rcred", NULL)) |
---|
180 | { |
---|
181 | if(listbox->select != NULL && ostrcmp(listbox->select->name, "listboxselect") == 0) |
---|
182 | { |
---|
183 | long oldlistboxselectcol = convertcol("listboxselect"); |
---|
184 | char* tmpstr = screencolorpicker(getskinconfig("listboxselect", NULL), 0, 0, 0); |
---|
185 | if(tmpstr != NULL) |
---|
186 | addskinconfigtmp("listboxselect", tmpstr); |
---|
187 | if(oldlistboxselectcol != convertcol("listboxselect")) reboot = 1; |
---|
188 | drawscreen(skinadjust, 0, 0); |
---|
189 | } |
---|
190 | |
---|
191 | continue; |
---|
192 | } |
---|
193 | |
---|
194 | if(rcret == getrcconfigint("rcgreen", NULL)) |
---|
195 | { |
---|
196 | if(listbox->select != NULL && ostrcmp(listbox->select->name, "tithek_selectcol") == 0) |
---|
197 | { |
---|
198 | long oldtithek_selectcol = convertcol("tithek_selectcol"); |
---|
199 | char* tmpstr = screencolorpicker(getskinconfig("tithek_selectcol", NULL), 0, 0, 0); |
---|
200 | if(tmpstr != NULL) |
---|
201 | addskinconfigtmp("tithek_selectcol", tmpstr); |
---|
202 | if(oldtithek_selectcol != convertcol("tithek_selectcol")) reboot = 1; |
---|
203 | drawscreen(skinadjust, 0, 0); |
---|
204 | } |
---|
205 | |
---|
206 | continue; |
---|
207 | } |
---|
208 | |
---|
209 | if(rcret == getrcconfigint("rcyellow", NULL)) |
---|
210 | { |
---|
211 | if(listbox->select != NULL && ostrcmp(listbox->select->name, "filelistselect") == 0) |
---|
212 | { |
---|
213 | long oldfilelistselect = convertcol("filelistselect"); |
---|
214 | char* tmpstr = screencolorpicker(getskinconfig("filelistselect", NULL), 0, 0, 0); |
---|
215 | if(tmpstr != NULL) |
---|
216 | addskinconfigtmp("filelistselect", tmpstr); |
---|
217 | if(oldfilelistselect != convertcol("filelistselect")) reboot = 1; |
---|
218 | drawscreen(skinadjust, 0, 0); |
---|
219 | } |
---|
220 | |
---|
221 | continue; |
---|
222 | } |
---|
223 | |
---|
224 | if(rcret == getrcconfigint("rcok", NULL)) |
---|
225 | { |
---|
226 | int oldfontsizeadjust = getskinconfigint("fontsizeadjust", NULL); |
---|
227 | addskinconfigscreencheck("fontsizeadjust", fontsizeadjust, "0"); |
---|
228 | if(oldfontsizeadjust != getskinconfigint("fontsizeadjust", NULL)) reboot = 1; |
---|
229 | status.fontsizeadjust = getskinconfigint("fontsizeadjust", NULL); |
---|
230 | |
---|
231 | addskinconfigscreencheck("listboxselecttype", listboxselecttype, "0"); |
---|
232 | status.listboxselecttype = getskinconfigint("listboxselecttype", NULL); |
---|
233 | addskinconfigscreencheck("osdtransparent", osdtransparent, "0"); |
---|
234 | setosdtransparent(getskinconfigint("osdtransparent", NULL)); |
---|
235 | addconfigscreencheck("showrecfreesize", showrecfreesize, "0"); |
---|
236 | status.showrecfreesize = getconfigint("showrecfreesize", NULL); |
---|
237 | |
---|
238 | if(checkbox("ATEMIO-NEMESIS")) |
---|
239 | addskinconfigscreencheck("OLED_nemesis", oled_sel, "0"); |
---|
240 | |
---|
241 | char* oldinfobar_sel = getskinconfig("infobar_selection", NULL); |
---|
242 | addskinconfigscreencheck("infobar_selection", infobar_sel, "0"); |
---|
243 | if(ostrcmp(oldinfobar_sel,getskinconfig("infobar_selection", NULL)) != 0) reboot = 1; |
---|
244 | if(ostrcmp(getskinconfig("infobar_selection", NULL), "infobar") != 0) |
---|
245 | addskinconfigscreencheck("infobar2_selection", "infobar2", "0"); |
---|
246 | if(ostrcmp(getskinconfig("infobar_selection", NULL), "infobar_v2") != 0) |
---|
247 | addskinconfigscreencheck("infobar2_selection", "infobar2_v2", "0"); |
---|
248 | if(ostrcmp(getskinconfig("infobar_selection", NULL), "infobar_v3") != 0) |
---|
249 | addskinconfigscreencheck("infobar2_selection", "infobar2_v3", "0"); |
---|
250 | |
---|
251 | writeskinconfigtmp(); |
---|
252 | if(reboot == 1) |
---|
253 | { |
---|
254 | textbox(_("Message"), _("Titan will be restartet!"), _("OK"), getrcconfigint("rcok", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 0, 0); |
---|
255 | oshutdown(3, 0); |
---|
256 | } |
---|
257 | |
---|
258 | break; |
---|
259 | } |
---|
260 | } |
---|
261 | |
---|
262 | delskinconfigtmpall(); |
---|
263 | delownerrc(skinadjust); |
---|
264 | clearscreen(skinadjust); |
---|
265 | } |
---|
266 | |
---|
267 | #endif |
---|