source: titan/titan/skinadjust.h @ 33139

Last change on this file since 33139 was 33039, checked in by aafsvn, 9 years ago

fix

File size: 15.7 KB
Line 
1#ifndef SKINADJUST_H
2#define SKINADJUST_H
3
4void screenskinadjust()
5{
6        int rcret = 0, oleftoffset = 0, orightoffset = 0, otopoffset = 0, obottomoffset = 0, reboot = 0;
7        char* tmpstr = NULL;
8        struct skin* skinadjust = getscreen("skinadjust");
9        struct skin* listbox = getscreennode(skinadjust, "listbox");
10        struct skin* fontsizeadjust = getscreennode(skinadjust, "fontsizeadjust");
11        struct skin* listboxselecttype = getscreennode(skinadjust, "listboxselecttype");
12        struct skin* osdtransparent = getscreennode(skinadjust, "osdtransparent");
13        struct skin* leftoffset = getscreennode(skinadjust, "leftoffset");
14        struct skin* rightoffset = getscreennode(skinadjust, "rightoffset");
15        struct skin* topoffset = getscreennode(skinadjust, "topoffset");
16        struct skin* bottomoffset = getscreennode(skinadjust, "bottomoffset");
17        struct skin* showrecfreesize = getscreennode(skinadjust, "showrecfreesize");
18        struct skin* listboxselect = getscreennode(skinadjust, "listboxselect");
19        struct skin* tithek_selectcol = getscreennode(skinadjust, "tithek_selectcol");
20        struct skin* filelistselect = getscreennode(skinadjust, "filelistselect");
21        struct skin* buttonbar_bgcol2 = getscreennode(skinadjust, "buttonbar_bgcol2");
22        struct skin* bgcol = getscreennode(skinadjust, "bgcol");
23        struct skin* bgcol2 = getscreennode(skinadjust, "bgcol2");
24        struct skin* fontcol = getscreennode(skinadjust, "fontcol");
25        struct skin* bordercol = getscreennode(skinadjust, "bordercol");
26        struct skin* progresscol = getscreennode(skinadjust, "progresscol");
27        struct skin* titlebgcol = getscreennode(skinadjust, "titlebgcol");
28        struct skin* markcol = getscreennode(skinadjust, "markcol");
29
30        struct skin* oled_sel = getscreennode(skinadjust, "oled_sel");
31        struct skin* infobar_sel = getscreennode(skinadjust, "infobar_sel");
32        struct skin* infobar2_sel = getscreennode(skinadjust, "infobar2_sel");
33        struct skin* pic1 = getscreennode(skinadjust, "pic1");
34        struct skin* pic2 = getscreennode(skinadjust, "pic2");
35        struct skin* b4 = getscreennode(skinadjust, "b4");
36
37        struct skin* tmp = NULL;
38
39        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");
40        setchoiceboxselection(fontsizeadjust, getskinconfig("fontsizeadjust", NULL));
41
42        addchoicebox(listboxselecttype, "0", _("border"));
43        addchoicebox(listboxselecttype, "1", _("bar"));
44        addchoicebox(listboxselecttype, "2", _("text"));
45        addchoicebox(listboxselecttype, "3", _("picture"));
46        setchoiceboxselection(listboxselecttype, getskinconfig("listboxselecttype", NULL));
47
48        changeinput(osdtransparent, "0\n5\n10\n15\n20\n25\n30\n35\n40\n45\n50\n55\n60\n65\n70");
49        setchoiceboxselection(osdtransparent, getskinconfig("osdtransparent", NULL));
50
51#ifdef MIPSEL
52        changeinput(leftoffset, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20");
53        setchoiceboxselection(leftoffset, getconfig("fbleftoffset", NULL));
54
55        changeinput(rightoffset, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20");
56        setchoiceboxselection(rightoffset, getconfig("fbrightoffset", NULL));
57
58        changeinput(topoffset, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20");
59        setchoiceboxselection(topoffset, getconfig("fbtopoffset", NULL));
60
61        changeinput(bottomoffset, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20");
62        setchoiceboxselection(bottomoffset, getconfig("fbbottomoffset", NULL));
63#else
64        changeinput(leftoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100");
65        setchoiceboxselection(leftoffset, getconfig("fbleftoffset", NULL));
66
67        changeinput(rightoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100");
68        setchoiceboxselection(rightoffset, getconfig("fbrightoffset", NULL));
69
70        changeinput(topoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100");
71        setchoiceboxselection(topoffset, getconfig("fbtopoffset", NULL));
72
73        changeinput(bottomoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100");
74        setchoiceboxselection(bottomoffset, getconfig("fbbottomoffset", NULL));
75#endif
76        oleftoffset = getconfigint("fbleftoffset", NULL);
77        orightoffset = getconfigint("fbrightoffset", NULL);
78        otopoffset = getconfigint("fbtopoffset", NULL);
79        obottomoffset = getconfigint("fbbottomoffset", NULL);
80
81// why this ? and atemio6200 ?
82        if(checkbox("ATEMIO5200") == 3)
83        {
84                leftoffset->hidden = YES;
85                rightoffset->hidden = YES;
86                topoffset->hidden = YES;
87                bottomoffset->hidden = YES;
88                pic1->hidden = YES;
89                pic2->hidden = YES;
90        }
91        if(checkbox("ATEMIO-NEMESIS"))
92        {
93                if(checkscreen("OLED_nemesis") != status.skinerr)
94                        addchoicebox(oled_sel, "OLED_nemesis", "v1");
95                if(checkscreen("OLED_nemesis_v2") != status.skinerr)
96                        addchoicebox(oled_sel, "OLED_nemesis_v2","v2");
97                if(checkscreen("OLED_nemesis_v3") != status.skinerr)
98                        addchoicebox(oled_sel, "OLED_nemesis_v3","v3");
99                if(checkscreen("OLED_nemesis_v4") != status.skinerr)
100                        addchoicebox(oled_sel, "OLED_nemesis_v4","v4");
101                if(checkscreen("OLED_nemesis_v5") != status.skinerr)
102                        addchoicebox(oled_sel, "OLED_nemesis_v5","v5");
103                if(checkscreen("OLED_nemesis_v6") != status.skinerr)
104                        addchoicebox(oled_sel, "OLED_nemesis_v6","v6");
105
106                setchoiceboxselection(oled_sel, getskinconfig("OLED_nemesis", NULL));
107        }
108        else
109                oled_sel->hidden = YES;
110
111        if(checkscreen("infobar") != status.skinerr)
112                addchoicebox(infobar_sel, "infobar", "v1");
113        if(checkscreen("infobar_v2") != status.skinerr)
114                addchoicebox(infobar_sel, "infobar_v2","v2");
115        if(checkscreen("infobar_v3") != status.skinerr)
116                addchoicebox(infobar_sel, "infobar_v3","v3");
117        setchoiceboxselection(infobar_sel, getskinconfig("infobar_selection", NULL));
118
119        if(checkscreen("infobar2") != status.skinerr)
120                addchoicebox(infobar2_sel, "infobar2", "v1");
121        if(checkscreen("infobar2_v2") != status.skinerr)
122                addchoicebox(infobar2_sel, "infobar2_v2","v2");
123        if(checkscreen("infobar2_v3") != status.skinerr)
124                addchoicebox(infobar2_sel, "infobar2_v3","v3");
125        setchoiceboxselection(infobar2_sel, getskinconfig("infobar2_selection", NULL));
126
127        addchoicebox(showrecfreesize, "0", _("no"));
128        addchoicebox(showrecfreesize, "1", _("yes (Text in %)"));
129        addchoicebox(showrecfreesize, "2", _("yes (Text in MB)"));
130        setchoiceboxselection(showrecfreesize, getconfig("showrecfreesize", NULL));
131
132
133//      addchoicebox(listboxselect, "0", _("press red"));
134
135        addchoicebox(listboxselect, "0", getskinconfig("markcol", NULL));
136        addchoicebox(tithek_selectcol, "1", getskinconfig("tithek_selectcol", NULL));
137        addchoicebox(filelistselect, "2", getskinconfig("filelistselect", NULL));
138        addchoicebox(buttonbar_bgcol2, "3", getskinconfig("buttonbar_bgcol2", NULL));
139        addchoicebox(bgcol, "3", getskinconfig("bgcol", NULL));
140        addchoicebox(bgcol2, "4", getskinconfig("bgcol2", NULL));
141        addchoicebox(fontcol, "5", getskinconfig("fontcol", NULL));
142        addchoicebox(bordercol, "6", getskinconfig("bordercol", NULL));
143        addchoicebox(progresscol, "7", getskinconfig("progresscol", NULL));
144        addchoicebox(titlebgcol, "8", getskinconfig("titlebgcol", NULL));
145        addchoicebox(markcol, "9", getskinconfig("markcol", NULL));
146
147        b4->hidden = YES;
148
149        drawscreen(skinadjust, 0, 0);
150        addscreenrc(skinadjust, listbox);
151
152        tmp = listbox->select;
153        while(1)
154        {
155                int offsetchange = 0;
156                addscreenrc(skinadjust, tmp);
157                rcret = waitrc(skinadjust, 0, 0);
158                tmp = listbox->select;
159
160                addconfigscreencheck("fbleftoffset", leftoffset, "0");
161                if(status.leftoffset != getconfigint("fbleftoffset", NULL)) offsetchange = 1;
162                status.leftoffset = getconfigint("fbleftoffset", NULL);
163
164                addconfigscreencheck("fbrightoffset", rightoffset, "0");
165                if(status.rightoffset != getconfigint("fbrightoffset", NULL)) offsetchange = 1;
166                status.rightoffset = getconfigint("fbrightoffset", NULL);
167
168                addconfigscreencheck("fbtopoffset", topoffset, "0");
169                if(status.topoffset != getconfigint("fbtopoffset", NULL)) offsetchange = 1;
170                status.topoffset = getconfigint("fbtopoffset", NULL);
171
172                addconfigscreencheck("fbbottomoffset", bottomoffset, "0");
173                if(status.bottomoffset != getconfigint("fbbottomoffset", NULL)) offsetchange = 1;
174                status.bottomoffset = getconfigint("fbbottomoffset", NULL);
175
176                if(offsetchange == 1 && (ostrcmp(getconfig("av_mode3d", NULL), "sbs") == 0 || ostrcmp(getconfig("av_mode3d", NULL), "tab") == 0)) clearfball();
177
178                drawscreen(skinadjust, 0, 0);
179
180#ifdef MIPSEL
181                setfbosd();
182#endif
183
184                if((rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL)) && checkbox("ATEMIO-NEMESIS") == 1 && listbox->select != NULL && ostrcmp(listbox->select->name, "oled_sel") == 0)
185                {
186                        tmpstr = ostrcat(tmpstr, oled_sel->ret, 0, 0);
187                        struct skin* OLED_nemesis = getscreen(tmpstr);
188                        if(status.skinerr == OLED_nemesis)
189                                OLED_nemesis = getscreen("OLED_nemesis");
190                        struct skin* textbox = getscreennode(OLED_nemesis, "textbox");
191                        changetext(textbox, tmpstr);
192                        drawscreen(OLED_nemesis, 0, 0);
193                        free(tmpstr);tmpstr=NULL;
194                }
195
196                if(rcret == getrcconfigint("rcexit", NULL))
197                {
198                        addconfigint("fbleftoffset", oleftoffset);
199                        status.leftoffset = getconfigint("fbleftoffset", NULL);
200                        addconfigint("fbrightoffset", orightoffset);
201                        status.rightoffset = getconfigint("fbrightoffset", NULL);
202                        addconfigint("fbtopoffset", otopoffset);
203                        status.topoffset = getconfigint("fbtopoffset", NULL);
204                        addconfigint("fbbottomoffset", obottomoffset);
205                        status.bottomoffset = getconfigint("fbbottomoffset", NULL);
206                        clearfball();
207                        break;
208                }
209
210                if(rcret == getrcconfigint("rcred", NULL))
211                {
212                        if(listbox->select != NULL && ostrcmp(listbox->select->name, "listboxselect") == 0)
213                        {
214                                long oldlistboxselectcol = convertcol("listboxselect");
215                                tmpstr = screencolorpicker(getskinconfig("listboxselect", NULL), 0, 0, 0);
216                                if(tmpstr != NULL)
217                                        addskinconfigtmp("listboxselect", tmpstr);
218                                if(oldlistboxselectcol != convertcol("listboxselect")) reboot = 1;
219                        }
220
221                        if(listbox->select != NULL && ostrcmp(listbox->select->name, "tithek_selectcol") == 0)
222                        {
223                                long oldtithek_selectcol = convertcol("tithek_selectcol");
224                                tmpstr = screencolorpicker(getskinconfig("tithek_selectcol", NULL), 0, 0, 0);
225                                if(tmpstr != NULL)
226                                        addskinconfigtmp("tithek_selectcol", tmpstr);
227                                if(oldtithek_selectcol != convertcol("tithek_selectcol")) reboot = 1;
228                        }
229
230                        if(listbox->select != NULL && ostrcmp(listbox->select->name, "filelistselect") == 0)
231                        {
232                                long oldfilelistselect = convertcol("filelistselect");
233                                tmpstr = screencolorpicker(getskinconfig("filelistselect", NULL), 0, 0, 0);
234                                if(tmpstr != NULL)
235                                        addskinconfigtmp("filelistselect", tmpstr);
236                                if(oldfilelistselect != convertcol("filelistselect")) reboot = 1;
237                        }
238
239                        if(listbox->select != NULL && ostrcmp(listbox->select->name, "buttonbar_bgcol2") == 0)
240                        {
241                                long oldbuttonbar_bgcol2 = convertcol("buttonbar_bgcol2");
242                                tmpstr = screencolorpicker(getskinconfig("buttonbar_bgcol2", NULL), 0, 0, 0);
243                                if(tmpstr != NULL)
244                                        addskinconfigtmp("buttonbar_bgcol2", tmpstr);
245                                if(oldbuttonbar_bgcol2 != convertcol("buttonbar_bgcol2")) reboot = 1;
246                        }
247
248                        if(listbox->select != NULL && ostrcmp(listbox->select->name, "bgcol") == 0)
249                        {
250                                long oldbgcol = convertcol("bgcol");
251                                tmpstr = screencolorpicker(getskinconfig("bgcol", NULL), 0, 0, 0);
252                                if(tmpstr != NULL)
253                                        addskinconfigtmp("bgcol", tmpstr);
254                                if(oldbgcol != convertcol("bgcol")) reboot = 1;
255                        }
256
257                        if(listbox->select != NULL && ostrcmp(listbox->select->name, "bgcol2") == 0)
258                        {
259                                long oldbgcol2 = convertcol("bgcol2");
260                                tmpstr = screencolorpicker(getskinconfig("bgcol2", NULL), 0, 0, 0);
261                                if(tmpstr != NULL)
262                                        addskinconfigtmp("bgcol2", tmpstr);
263                                if(oldbgcol2 != convertcol("bgcol2")) reboot = 1;
264                        }
265
266                        if(listbox->select != NULL && ostrcmp(listbox->select->name, "fontcol") == 0)
267                        {
268                                long oldfontcol = convertcol("fontcol");
269                                tmpstr = screencolorpicker(getskinconfig("fontcol", NULL), 0, 0, 0);
270                                if(tmpstr != NULL)
271                                        addskinconfigtmp("fontcol", tmpstr);
272                                if(oldfontcol != convertcol("fontcol")) reboot = 1;
273                        }
274
275                        if(listbox->select != NULL && ostrcmp(listbox->select->name, "bordercol") == 0)
276                        {
277                                long oldbordercol = convertcol("bordercol");
278                                tmpstr = screencolorpicker(getskinconfig("bordercol", NULL), 0, 0, 0);
279                                if(tmpstr != NULL)
280                                        addskinconfigtmp("bordercol", tmpstr);
281                                if(oldbordercol != convertcol("bordercol")) reboot = 1;
282                        }
283
284                        if(listbox->select != NULL && ostrcmp(listbox->select->name, "progresscol") == 0)
285                        {
286                                long oldprogresscol = convertcol("progresscol");
287                                tmpstr = screencolorpicker(getskinconfig("progresscol", NULL), 0, 0, 0);
288                                if(tmpstr != NULL)
289                                        addskinconfigtmp("progresscol", tmpstr);
290                                if(oldprogresscol != convertcol("progresscol")) reboot = 1;
291                        }
292
293                        if(listbox->select != NULL && ostrcmp(listbox->select->name, "titlebgcol") == 0)
294                        {
295                                long oldtitlebgcol = convertcol("titlebgcol");
296                                tmpstr = screencolorpicker(getskinconfig("titlebgcol", NULL), 0, 0, 0);
297                                if(tmpstr != NULL)
298                                        addskinconfigtmp("titlebgcol", tmpstr);
299                                if(oldtitlebgcol != convertcol("titlebgcol")) reboot = 1;
300                        }
301
302                        if(listbox->select != NULL && ostrcmp(listbox->select->name, "markcol") == 0)
303                        {
304                                long oldmarkcol = convertcol("markcol");
305                                tmpstr = screencolorpicker(getskinconfig("markcol", NULL), 0, 0, 0);
306                                if(tmpstr != NULL)
307                                        addskinconfigtmp("markcol", tmpstr);
308                                if(oldmarkcol != convertcol("markcol")) reboot = 1;
309                        }
310
311                        drawscreen(skinadjust, 0, 0);
312
313                        debug(10, "%s set %s", listbox->select->name, tmpstr);
314                        free(tmpstr), tmpstr = NULL;
315                        continue;
316                }
317
318                if(rcret == getrcconfigint("rcok", NULL))
319                {
320                        int oldfontsizeadjust = getskinconfigint("fontsizeadjust", NULL);
321                        addskinconfigscreencheck("fontsizeadjust", fontsizeadjust, "0");
322                        if(oldfontsizeadjust != getskinconfigint("fontsizeadjust", NULL)) reboot = 1;
323                        status.fontsizeadjust = getskinconfigint("fontsizeadjust", NULL);
324
325                        addskinconfigscreencheck("listboxselecttype", listboxselecttype, "0");
326                        status.listboxselecttype = getskinconfigint("listboxselecttype", NULL);
327
328                        addskinconfigscreencheck("osdtransparent", osdtransparent, "0");
329                        setosdtransparent(getskinconfigint("osdtransparent", NULL));
330                        addconfigscreencheck("showrecfreesize", showrecfreesize, "0");
331                        status.showrecfreesize = getconfigint("showrecfreesize", NULL);
332
333                        if(checkbox("ATEMIO-NEMESIS"))
334                                addskinconfigscreencheck("OLED_nemesis", oled_sel, "0");
335
336                        char* oldinfobar_sel = getskinconfig("infobar_selection", NULL);
337                        addskinconfigscreencheck("infobar_selection", infobar_sel, "0");
338                        if(ostrcmp(oldinfobar_sel,getskinconfig("infobar_selection", NULL)) != 0) reboot = 1;
339                        //free(oldinfobar_sel); oldinfobar_sel=NULL;
340
341                        char* oldinfobar2_sel = getskinconfig("infobar2_selection", NULL);
342                        addskinconfigscreencheck("infobar2_selection", infobar2_sel, "0");
343                        if(ostrcmp(oldinfobar2_sel,getskinconfig("infobar2_selection", NULL)) != 0) reboot = 1;
344                        //free(oldinfobar2_sel); oldinfobar2_sel=NULL;
345
346                        writeskinconfigtmp();
347                        if(reboot == 1)
348                        {
349                                textbox(_("Message"), _("Titan will be restartet!"), _("OK"), getrcconfigint("rcok", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 0, 0);
350                                oshutdown(3, 0);
351                        }
352
353                        break;
354                }
355
356                if(ostrcmp(listbox->select->name, "listboxselect") == 0)
357                        b4->hidden = NO;
358                else if(ostrcmp(listbox->select->name, "tithek_selectcol") == 0)
359                        b4->hidden = NO;
360                else if(ostrcmp(listbox->select->name, "filelistselect") == 0)
361                        b4->hidden = NO;
362                else if(ostrcmp(listbox->select->name, "buttonbar_bgcol2") == 0)
363                        b4->hidden = NO;
364                else if(ostrcmp(listbox->select->name, "bgcol") == 0)
365                        b4->hidden = NO;
366                else if(ostrcmp(listbox->select->name, "bgcol2") == 0)
367                        b4->hidden = NO;
368                else if(ostrcmp(listbox->select->name, "fontcol") == 0)
369                        b4->hidden = NO;
370                else if(ostrcmp(listbox->select->name, "bordercol") == 0)
371                        b4->hidden = NO;
372                else if(ostrcmp(listbox->select->name, "titlebgcol") == 0)
373                        b4->hidden = NO;
374                else if(ostrcmp(listbox->select->name, "progresscol") == 0)
375                        b4->hidden = NO;
376                else if(ostrcmp(listbox->select->name, "markcol") == 0)
377                        b4->hidden = NO;
378                else
379                        b4->hidden = YES;
380       
381                drawscreen(skinadjust, 0, 0);
382        }
383
384        delskinconfigtmpall();
385        delownerrc(skinadjust);
386        clearscreen(skinadjust);
387}
388
389#endif
Note: See TracBrowser for help on using the repository browser.