source: titan/titan/skinadjust.h @ 30950

Last change on this file since 30950 was 30950, checked in by obi, 9 years ago

fix skinadjust text

File size: 8.4 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        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* oled_sel = getscreennode(skinadjust, "oled_sel");
19        struct skin* pic1 = getscreennode(skinadjust, "pic1");
20        struct skin* pic2 = getscreennode(skinadjust, "pic2");
21       
22        struct skin* tmp = NULL;
23
24        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");
25        setchoiceboxselection(fontsizeadjust, getskinconfig("fontsizeadjust", NULL));
26
27        addchoicebox(listboxselecttype, "0", _("border"));
28        addchoicebox(listboxselecttype, "1", _("bar"));
29        addchoicebox(listboxselecttype, "2", _("text"));
30        addchoicebox(listboxselecttype, "3", _("picture"));
31        setchoiceboxselection(listboxselecttype, getskinconfig("listboxselecttype", NULL));
32       
33        changeinput(osdtransparent, "0\n5\n10\n15\n20\n25\n30\n35\n40\n45\n50\n55\n60\n65\n70");
34        setchoiceboxselection(osdtransparent, getskinconfig("osdtransparent", NULL));
35
36#ifdef MIPSEL
37        changeinput(leftoffset, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20");
38        setchoiceboxselection(leftoffset, getconfig("fbleftoffset", NULL));
39
40        changeinput(rightoffset, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20");
41        setchoiceboxselection(rightoffset, getconfig("fbrightoffset", NULL));
42
43        changeinput(topoffset, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20");
44        setchoiceboxselection(topoffset, getconfig("fbtopoffset", NULL));
45
46        changeinput(bottomoffset, "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20");
47        setchoiceboxselection(bottomoffset, getconfig("fbbottomoffset", NULL));
48#else
49        changeinput(leftoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100");
50        setchoiceboxselection(leftoffset, getconfig("fbleftoffset", NULL));
51
52        changeinput(rightoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100");
53        setchoiceboxselection(rightoffset, getconfig("fbrightoffset", NULL));
54
55        changeinput(topoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100");
56        setchoiceboxselection(topoffset, getconfig("fbtopoffset", NULL));
57
58        changeinput(bottomoffset, "0\n10\n20\n30\n40\n50\n60\n70\n80\n90\n100");
59        setchoiceboxselection(bottomoffset, getconfig("fbbottomoffset", NULL));
60#endif
61        oleftoffset = getconfigint("fbleftoffset", NULL);
62        orightoffset = getconfigint("fbrightoffset", NULL);
63        otopoffset = getconfigint("fbtopoffset", NULL);
64        obottomoffset = getconfigint("fbbottomoffset", NULL);
65
66// why this ? and atemio6200 ?
67        if(checkbox("ATEMIO5200") == 3)
68        {
69                leftoffset->hidden = YES;
70                rightoffset->hidden = YES;
71                topoffset->hidden = YES;
72                bottomoffset->hidden = YES;
73                pic1->hidden = YES;
74                pic2->hidden = YES;
75        }
76        if(checkbox("ATEMIO-NEMESIS"))
77        {
78                if(checkscreen("OLED_nemesis") != status.skinerr)
79                        addchoicebox(oled_sel, "OLED_nemesis", "v1");
80                if(checkscreen("OLED_nemesis_v2") != status.skinerr)
81                        addchoicebox(oled_sel, "OLED_nemesis_v2","v2");
82                if(checkscreen("OLED_nemesis_v3") != status.skinerr)
83                        addchoicebox(oled_sel, "OLED_nemesis_v3","v3");
84                if(checkscreen("OLED_nemesis_v4") != status.skinerr)
85                        addchoicebox(oled_sel, "OLED_nemesis_v4","v4");
86                if(checkscreen("OLED_nemesis_v5") != status.skinerr)
87                        addchoicebox(oled_sel, "OLED_nemesis_v5","v5");
88                if(checkscreen("OLED_nemesis_v6") != status.skinerr)
89                        addchoicebox(oled_sel, "OLED_nemesis_v6","v6");
90               
91                setchoiceboxselection(oled_sel, getskinconfig("OLED_nemesis", NULL));
92        }
93        else
94                oled_sel->hidden = YES;
95
96        addchoicebox(showrecfreesize, "0", _("no"));
97        addchoicebox(showrecfreesize, "1", _("yes (Text in %)"));
98        addchoicebox(showrecfreesize, "2", _("yes (Text in MB)"));
99        setchoiceboxselection(showrecfreesize, getconfig("showrecfreesize", NULL));
100       
101        addchoicebox(listboxselect, "0", _("press red"));
102
103        drawscreen(skinadjust, 0, 0);
104        addscreenrc(skinadjust, listbox);
105
106        tmp = listbox->select;
107        while(1)
108        {
109                int offsetchange = 0;
110                addscreenrc(skinadjust, tmp);
111                rcret = waitrc(skinadjust, 0, 0);
112                tmp = listbox->select;
113
114                addconfigscreencheck("fbleftoffset", leftoffset, "0");
115                if(status.leftoffset != getconfigint("fbleftoffset", NULL)) offsetchange = 1;
116                status.leftoffset = getconfigint("fbleftoffset", NULL);
117               
118                addconfigscreencheck("fbrightoffset", rightoffset, "0");
119                if(status.rightoffset != getconfigint("fbrightoffset", NULL)) offsetchange = 1;
120                status.rightoffset = getconfigint("fbrightoffset", NULL);
121               
122                addconfigscreencheck("fbtopoffset", topoffset, "0");
123                if(status.topoffset != getconfigint("fbtopoffset", NULL)) offsetchange = 1;
124                status.topoffset = getconfigint("fbtopoffset", NULL);
125               
126                addconfigscreencheck("fbbottomoffset", bottomoffset, "0");
127                if(status.bottomoffset != getconfigint("fbbottomoffset", NULL)) offsetchange = 1;
128                status.bottomoffset = getconfigint("fbbottomoffset", NULL);
129                       
130                if(offsetchange == 1 && (ostrcmp(getconfig("av_mode3d", NULL), "sbs") == 0 || ostrcmp(getconfig("av_mode3d", NULL), "tab") == 0)) clearfball();
131
132                drawscreen(skinadjust, 0, 0);
133
134#ifdef MIPSEL
135                setfbosd();
136#endif
137               
138                if((rcret == getrcconfigint("rcleft", NULL) || rcret == getrcconfigint("rcright", NULL)) && checkbox("ATEMIO-NEMESIS") == 1 && listbox->select != NULL && ostrcmp(listbox->select->name, "oled_sel") == 0)
139                {
140                        char* tmpstr = NULL;
141                        tmpstr = ostrcat(tmpstr, oled_sel->ret, 0, 0);
142                        struct skin* OLED_nemesis = getscreen(tmpstr);
143                        if(status.skinerr == OLED_nemesis)
144                                OLED_nemesis = getscreen("OLED_nemesis");
145                        struct skin* textbox = getscreennode(OLED_nemesis, "textbox");
146                        changetext(textbox, tmpstr);
147                        drawscreen(OLED_nemesis, 0, 0);
148                        free(tmpstr);tmpstr=NULL;
149                }
150               
151                if(rcret == getrcconfigint("rcexit", NULL))
152                {
153                        addconfigint("fbleftoffset", oleftoffset);
154                        status.leftoffset = getconfigint("fbleftoffset", NULL);
155                        addconfigint("fbrightoffset", orightoffset);
156                        status.rightoffset = getconfigint("fbrightoffset", NULL);
157                        addconfigint("fbtopoffset", otopoffset);
158                        status.topoffset = getconfigint("fbtopoffset", NULL);
159                        addconfigint("fbbottomoffset", obottomoffset);
160                        status.bottomoffset = getconfigint("fbbottomoffset", NULL);
161                        clearfball();
162                        break;
163                }
164               
165                if(rcret == getrcconfigint("rcred", NULL))
166                {
167                        if(listbox->select != NULL && ostrcmp(listbox->select->name, "listboxselect") == 0)
168                        {
169                                long oldlistboxselectcol = convertcol("listboxselect");
170                                char* tmpstr = screencolorpicker(getskinconfig("listboxselect", NULL), 0, 0, 0);
171                                if(tmpstr != NULL)
172                                        addskinconfigtmp("listboxselect", tmpstr);
173                                if(oldlistboxselectcol != convertcol("listboxselect")) reboot = 1;
174                                drawscreen(skinadjust, 0, 0);
175                        }
176                       
177                        continue;               
178                }
179
180                if(rcret == getrcconfigint("rcok", NULL))
181                {
182                        int oldfontsizeadjust = getskinconfigint("fontsizeadjust", NULL);
183                        addskinconfigscreencheck("fontsizeadjust", fontsizeadjust, "0");
184                        if(oldfontsizeadjust != getskinconfigint("fontsizeadjust", NULL)) reboot = 1;
185                        status.fontsizeadjust = getskinconfigint("fontsizeadjust", NULL);                       
186                       
187                        addskinconfigscreencheck("listboxselecttype", listboxselecttype, "0");
188                        status.listboxselecttype = getskinconfigint("listboxselecttype", NULL);
189                        addskinconfigscreencheck("osdtransparent", osdtransparent, "0");
190                        setosdtransparent(getskinconfigint("osdtransparent", NULL));
191                        addconfigscreencheck("showrecfreesize", showrecfreesize, "0");
192                        status.showrecfreesize = getconfigint("showrecfreesize", NULL);
193
194                        if(checkbox("ATEMIO-NEMESIS"))
195                                addskinconfigscreencheck("OLED_nemesis", oled_sel, "0");
196                       
197                        writeskinconfigtmp();
198                        if(reboot == 1)
199                        {
200                                textbox(_("Message"), _("Titan will be restartet !"), _("OK"), getrcconfigint("rcok", NULL), NULL, 0, NULL, 0, NULL, 0, 600, 200, 0, 0);
201                                oshutdown(3, 0);
202                        }
203     
204                        break;
205                }
206        }
207
208        delskinconfigtmpall();
209        delownerrc(skinadjust);
210        clearscreen(skinadjust);
211}
212
213#endif
Note: See TracBrowser for help on using the repository browser.