]> git.vomp.tv Git - vompclient-marten.git/blob - colour.cc
Add addtional remote codes for MCE remotes as suggested by dingo35
[vompclient-marten.git] / colour.cc
1 /*
2     Copyright 2005 Chris Tallon
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP; if not, write to the Free Software
18     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19 */
20
21 #include "colour.h"
22
23
24 DrawStyle DrawStyle::BLACK(0, 0, 0);
25 DrawStyle DrawStyle::RED(255, 0, 0);
26 DrawStyle DrawStyle::GREEN(0, 255, 0);
27 DrawStyle DrawStyle::GREY(180, 180, 180);
28 DrawStyle DrawStyle::DARKGREY(100, 100, 100);
29 DrawStyle DrawStyle::BLUE(0, 0, 255);
30 DrawStyle DrawStyle::YELLOW(255, 255, 0);
31 DrawStyle DrawStyle::VIDEOBLUE(0, 0, 150);
32 DrawStyle DrawStyle::VIEWBACKGROUND(0, 0, 100);
33 DrawStyle DrawStyle::TABVIEWBACKGROUND(0, 0, 120);
34 DrawStyle DrawStyle::TITLEBARBACKGROUND(0, 0, 200);
35 DrawStyle DrawStyle::SELECTHIGHLIGHT(240, 250, 80);
36 DrawStyle DrawStyle::SELECTDARKHIGHLIGHT(120, 125, 40);
37 DrawStyle DrawStyle::LIGHTTEXT(255, 255, 255);
38 DrawStyle DrawStyle::DARKTEXT(0, 0, 100);
39 DrawStyle DrawStyle::DANGER(200, 0, 0);
40 DrawStyle DrawStyle::BUTTONBACKGROUND(0, 0, 200);
41 DrawStyle DrawStyle::PROGRAMMEB(80, 80, 240); // two colours used as alterating backgrounds for individual programmes in EPG
42 DrawStyle DrawStyle::PROGRAMMEA(40, 40, 120); // TODO fit epg style (colours) in with rest of application
43 DrawStyle DrawStyle::NOPROGRAMME(180, 180, 180); // no programme details colour
44
45
46 void SkinFactory::InitDefaultSkin()
47 {
48         /*
49 Real colours
50          */
51         DrawStyle::BLACK=DrawStyle(0, 0, 0);
52         DrawStyle::RED=DrawStyle(255, 0, 0);
53         DrawStyle::GREY=DrawStyle(180, 180, 180);
54         DrawStyle::DARKGREY=DrawStyle(100, 100, 100);
55         DrawStyle::GREEN=DrawStyle(0, 255, 0);
56         DrawStyle::BLUE=DrawStyle(0, 0, 255);
57         DrawStyle::YELLOW=DrawStyle(255, 255, 0);
58         DrawStyle::VIDEOBLUE=DrawStyle(0, 0, 150);
59         DrawStyle::VIEWBACKGROUND=DrawStyle(0, 0, 100);
60         DrawStyle::TABVIEWBACKGROUND=DrawStyle(0, 0, 120);
61         DrawStyle::TITLEBARBACKGROUND=DrawStyle(0, 0, 200);
62         DrawStyle::SELECTHIGHLIGHT=DrawStyle(240, 250, 80);
63         DrawStyle::SELECTDARKHIGHLIGHT=DrawStyle(120, 125, 40);
64         DrawStyle::LIGHTTEXT=DrawStyle(255, 255, 255);
65         DrawStyle::DARKTEXT=DrawStyle(0, 0, 100);
66         DrawStyle::DANGER=DrawStyle(200, 0, 0);
67         DrawStyle::BUTTONBACKGROUND=DrawStyle(0, 0, 200);
68         DrawStyle::PROGRAMMEB=DrawStyle(80, 80, 240); // two colours used as alterating backgrounds for individual programmes in EPG
69         DrawStyle::PROGRAMMEA=DrawStyle(40, 40, 120); // TODO fit epg style (colours) in with rest of application
70         DrawStyle::NOPROGRAMME=DrawStyle(180, 180, 180); // no programme details colour
71
72
73         /*
74 Silly colours
75
76 Colour Colour::VIDEOBLUE(250, 0, 0);
77 Colour Colour::VIEWBACKGROUND(100, 0, 100);
78 Colour Colour::TITLEBARBACKGROUND(100, 0, 200);
79 Colour Colour::SELECTHIGHLIGHT(240, 250, 180);
80 Colour Colour::LIGHTTEXT(255, 0, 255);
81 Colour Colour::DARKTEXT(0, 0, 255);
82 Colour Colour::DANGER(200, 200, 0);
83 Colour Colour::BUTTONBACKGROUND(255, 255, 255);
84          */
85 }
86
87 void SkinFactory::InitEnhancedSkin()
88 {
89         /*
90 Real colours
91          */
92         DrawStyle::BLACK=DrawStyle(0, 0, 0);
93
94         DrawStyle::RED=DrawStyle(100, 0, 0);
95         DrawStyle::RED.grad_col[0]=Colour(255, 0, 0);
96         DrawStyle::RED.grad_col[1]=Colour(100, 0, 0);
97         DrawStyle::RED.grad_pos[0]=0.5;
98         DrawStyle::RED.num_colors=2;
99         DrawStyle::RED.ft=DrawStyle::GradientLinear;
100         DrawStyle::RED.x1=0.0;
101         DrawStyle::RED.y1=0.0;
102         DrawStyle::RED.x2=0.0;
103         DrawStyle::RED.y2=1.0;
104
105         DrawStyle::GREEN=DrawStyle(0, 100, 0);
106         DrawStyle::GREEN.grad_col[0]=Colour(0, 255, 0);
107         DrawStyle::GREEN.grad_col[1]=Colour(0, 100, 0);
108         DrawStyle::GREEN.grad_pos[0]=0.5;
109         DrawStyle::GREEN.num_colors=2;
110         DrawStyle::GREEN.ft=DrawStyle::GradientLinear;
111         DrawStyle::GREEN.x1=0.0;
112         DrawStyle::GREEN.y1=0.0;
113         DrawStyle::GREEN.x2=0.0;
114         DrawStyle::GREEN.y2=1.0;
115
116         DrawStyle::BLUE=DrawStyle(0, 0, 100);
117         DrawStyle::BLUE.grad_col[0]=Colour(0, 0, 255);
118         DrawStyle::BLUE.grad_col[1]=Colour(0, 0, 100);
119         DrawStyle::BLUE.grad_pos[0]=0.5;
120         DrawStyle::BLUE.num_colors=2;
121         DrawStyle::BLUE.ft=DrawStyle::GradientLinear;
122         DrawStyle::BLUE.x1=0.0;
123         DrawStyle::BLUE.y1=0.0;
124         DrawStyle::BLUE.x2=0.0;
125         DrawStyle::BLUE.y2=1.0;
126
127         DrawStyle::YELLOW=DrawStyle(100, 100, 0);
128         DrawStyle::YELLOW.grad_col[0]=Colour(255, 255, 0);
129         DrawStyle::YELLOW.grad_col[1]=Colour(100, 100, 0);
130         DrawStyle::YELLOW.grad_pos[0]=0.5;
131         DrawStyle::YELLOW.num_colors=2;
132         DrawStyle::YELLOW.ft=DrawStyle::GradientLinear;
133         DrawStyle::YELLOW.x1=0.0;
134         DrawStyle::YELLOW.y1=0.0;
135         DrawStyle::YELLOW.x2=0.0;
136         DrawStyle::YELLOW.y2=1.0;
137
138         DrawStyle::GREY=DrawStyle(100, 100, 100);
139         DrawStyle::GREY.grad_col[0]=Colour(180, 180, 180);
140         DrawStyle::GREY.grad_col[1]=Colour(100, 100, 100);
141         DrawStyle::GREY.grad_pos[0]=0.5;
142         DrawStyle::GREY.num_colors=2;
143         DrawStyle::GREY.ft=DrawStyle::GradientLinear;
144         DrawStyle::GREY.x1=0.0;
145         DrawStyle::GREY.y1=0.0;
146         DrawStyle::GREY.x2=0.0;
147         DrawStyle::GREY.y2=1.0;
148
149         DrawStyle::DARKGREY=DrawStyle(50, 50, 50);
150         DrawStyle::DARKGREY.grad_col[0]=Colour(100, 100, 100);
151         DrawStyle::DARKGREY.grad_col[1]=Colour(80, 80, 80);
152         DrawStyle::DARKGREY.grad_pos[0]=0.5;
153         DrawStyle::DARKGREY.num_colors=2;
154         DrawStyle::DARKGREY.ft=DrawStyle::GradientLinear;
155         DrawStyle::DARKGREY.x1=0.0;
156         DrawStyle::DARKGREY.y1=0.0;
157         DrawStyle::DARKGREY.x2=0.0;
158         DrawStyle::DARKGREY.y2=1.0;
159
160
161         DrawStyle::VIDEOBLUE=DrawStyle(0, 0, 150);
162
163         DrawStyle::VIEWBACKGROUND=DrawStyle(0, 0, 100);
164         DrawStyle::VIEWBACKGROUND.grad_col[0]=Colour(0,0,160);
165         DrawStyle::VIEWBACKGROUND.num_colors=1;
166         DrawStyle::VIEWBACKGROUND.ft=DrawStyle::GradientLinear;
167         DrawStyle::VIEWBACKGROUND.x1=0.0;
168         DrawStyle::VIEWBACKGROUND.y1=0.0;
169         DrawStyle::VIEWBACKGROUND.x2=0.0;
170         DrawStyle::VIEWBACKGROUND.y2=1.0;
171
172         DrawStyle::TABVIEWBACKGROUND=DrawStyle(0, 0, 120);
173
174
175         DrawStyle::TITLEBARBACKGROUND=DrawStyle(0, 0, 160);
176         DrawStyle::TITLEBARBACKGROUND.grad_col[0]=Colour(0,0,250);
177         DrawStyle::TITLEBARBACKGROUND.num_colors=1;
178         DrawStyle::TITLEBARBACKGROUND.ft=DrawStyle::GradientLinear;
179         DrawStyle::TITLEBARBACKGROUND.x1=0.0;
180         DrawStyle::TITLEBARBACKGROUND.y1=0.0;
181         DrawStyle::TITLEBARBACKGROUND.x2=0.0;
182         DrawStyle::TITLEBARBACKGROUND.y2=1.0;
183
184
185         DrawStyle::SELECTHIGHLIGHT=DrawStyle(120, 125, 40);
186         DrawStyle::SELECTHIGHLIGHT.grad_col[0]=DrawStyle(240, 250, 80);
187         DrawStyle::SELECTHIGHLIGHT.num_colors=1;
188         DrawStyle::SELECTHIGHLIGHT.ft=DrawStyle::GradientLinear;
189         DrawStyle::SELECTHIGHLIGHT.x1=0.0;
190         DrawStyle::SELECTHIGHLIGHT.y1=0.0;
191         DrawStyle::SELECTHIGHLIGHT.x2=0.0;
192         DrawStyle::SELECTHIGHLIGHT.y2=1.0;
193
194
195         DrawStyle::SELECTDARKHIGHLIGHT=DrawStyle(60, 65, 20);
196         DrawStyle::SELECTDARKHIGHLIGHT.grad_col[0]=DrawStyle(120, 125, 40);
197         DrawStyle::SELECTDARKHIGHLIGHT.num_colors=1;
198         DrawStyle::SELECTDARKHIGHLIGHT.ft=DrawStyle::GradientLinear;
199         DrawStyle::SELECTDARKHIGHLIGHT.x1=0.0;
200         DrawStyle::SELECTDARKHIGHLIGHT.y1=0.0;
201         DrawStyle::SELECTDARKHIGHLIGHT.x2=0.0;
202         DrawStyle::SELECTDARKHIGHLIGHT.y2=1.0;
203
204         DrawStyle::LIGHTTEXT=DrawStyle(255, 255, 255);
205         DrawStyle::LIGHTTEXT.grad_col[0]=DrawStyle(150, 150, 150);
206         DrawStyle::LIGHTTEXT.num_colors=1;
207         DrawStyle::LIGHTTEXT.ft=DrawStyle::GradientLinear;
208         DrawStyle::LIGHTTEXT.x1=0.0;
209         DrawStyle::LIGHTTEXT.y1=0.0;
210         DrawStyle::LIGHTTEXT.x2=0.0;
211         DrawStyle::LIGHTTEXT.y2=1.0;
212
213         DrawStyle::DARKTEXT=DrawStyle(0, 0, 100);
214         DrawStyle::DANGER=DrawStyle(200, 0, 0);
215
216         DrawStyle::BUTTONBACKGROUND=DrawStyle(0, 0, 100);
217         DrawStyle::BUTTONBACKGROUND.grad_col[0]=DrawStyle(0, 0, 200);
218         DrawStyle::BUTTONBACKGROUND.num_colors=1;
219         DrawStyle::BUTTONBACKGROUND.ft=DrawStyle::GradientLinear;
220         DrawStyle::BUTTONBACKGROUND.x1=0.0;
221         DrawStyle::BUTTONBACKGROUND.y1=0.0;
222         DrawStyle::BUTTONBACKGROUND.x2=0.0;
223         DrawStyle::BUTTONBACKGROUND.y2=1.0;
224
225
226         DrawStyle::PROGRAMMEB=DrawStyle(40, 40, 120); // two colours used as alterating backgrounds for individual programmes in EPG
227         DrawStyle::PROGRAMMEB.grad_col[0]=DrawStyle(80, 80, 240);
228         DrawStyle::PROGRAMMEB.num_colors=1;
229         DrawStyle::PROGRAMMEB.ft=DrawStyle::GradientLinear;
230         DrawStyle::PROGRAMMEB.x1=0.0;
231         DrawStyle::PROGRAMMEB.y1=0.0;
232         DrawStyle::PROGRAMMEB.x2=0.0;
233         DrawStyle::PROGRAMMEB.y2=1.0;
234
235
236         DrawStyle::PROGRAMMEA=DrawStyle(80, 80, 240); // TODO fit epg style (colours) in with rest of application
237         DrawStyle::PROGRAMMEA.grad_col[0]=DrawStyle(40, 40, 120);
238         DrawStyle::PROGRAMMEA.num_colors=1;
239         DrawStyle::PROGRAMMEA.ft=DrawStyle::GradientLinear;
240         DrawStyle::PROGRAMMEA.x1=0.0;
241         DrawStyle::PROGRAMMEA.y1=0.0;
242         DrawStyle::PROGRAMMEA.x2=0.0;
243         DrawStyle::PROGRAMMEA.y2=1.0;
244
245
246         DrawStyle::NOPROGRAMME=DrawStyle(180, 180, 180); // no programme details colour
247         DrawStyle::NOPROGRAMME.grad_col[0]=DrawStyle(90, 90, 90);
248         DrawStyle::NOPROGRAMME.num_colors=1;
249         DrawStyle::NOPROGRAMME.ft=DrawStyle::GradientLinear;
250         DrawStyle::NOPROGRAMME.x1=0.0;
251         DrawStyle::NOPROGRAMME.y1=0.0;
252         DrawStyle::NOPROGRAMME.x2=0.0;
253         DrawStyle::NOPROGRAMME.y2=1.0;
254
255
256         /*
257 Silly colours
258
259 Colour Colour::VIDEOBLUE(250, 0, 0);
260 Colour Colour::VIEWBACKGROUND(100, 0, 100);
261 Colour Colour::TITLEBARBACKGROUND(100, 0, 200);
262 Colour Colour::SELECTHIGHLIGHT(240, 250, 180);
263 Colour Colour::LIGHTTEXT(255, 0, 255);
264 Colour Colour::DARKTEXT(0, 0, 255);
265 Colour Colour::DANGER(200, 200, 0);
266 Colour Colour::BUTTONBACKGROUND(255, 255, 255);
267          */
268 }