2 Copyright 2005 Chris Tallon
4 This file is part of VOMP.
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.
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.
16 You should have received a copy of the GNU General Public License
17 along with VOMP. If not, see <https://www.gnu.org/licenses/>.
27 { red = 0; green = 0; blue = 0; alpha = 255; }
29 Colour(int Tred, int Tgreen, int Tblue)
30 { red = Tred; green = Tgreen; blue = Tblue; alpha = 255; }
32 Colour(int Tred, int Tgreen, int Tblue, int Talpha)
33 { red = Tred; green = Tgreen; blue = Tblue; alpha = Talpha; }
35 Colour(unsigned int color)
37 red = (color & 0x00ff0000)>>16;
38 green = (color & 0x0000ff00)>>8;
39 blue = (color & 0x000000ff);
40 alpha = (color & 0xff000000)>>24;
43 void set(int Tred, int Tgreen, int Tblue)
44 { red = Tred; green = Tgreen; blue = Tblue; alpha = 255; }
46 void set(int Tred, int Tgreen, int Tblue, int Talpha)
47 { red = Tred; green = Tgreen; blue = Tblue; alpha = Talpha; }
49 inline unsigned long rgba() const
51 return (alpha << 24) | (red << 16) | (green << 8) | blue;
64 // TODO move to seperate File
65 class DrawStyle: public Colour
69 { red = 0; green = 0; blue = 0; alpha = 255; ft=Color;ct=Global; }
71 DrawStyle(int Tred, int Tgreen, int Tblue)
72 { red = Tred; green = Tgreen; blue = Tblue; alpha = 255 ;ft=Color;ct=Global; }
74 DrawStyle(int Tred, int Tgreen, int Tblue, int Talpha)
75 { red = Tred; green = Tgreen; blue = Tblue; alpha = Talpha; ft=Color;ct=Global;}
76 DrawStyle(unsigned int color)
78 red = (color & 0x00ff0000)>>16;
79 green = (color & 0x0000ff00)>>8;
80 blue = (color & 0x000000ff);
81 alpha = (color & 0xff000000)>>24;
85 DrawStyle(const Colour &c)
105 enum CoordType ct; //not implemented yet
106 float x1,y1,x2,y2,r; // Parameter for gradient either relative to object or to global coordinate system
107 int num_colors; //max is 4, min is 0
109 float grad_pos[3]; //Last position is alway 1.0 and first 0.0
111 static DrawStyle BLACK;
112 static DrawStyle RED;
113 static DrawStyle GREEN;
114 static DrawStyle YELLOW;
115 static DrawStyle BLUE;
116 static DrawStyle GREY;
117 static DrawStyle DARKGREY;
118 static DrawStyle VIDEOBLUE;
119 static DrawStyle VIEWBACKGROUND;
120 static DrawStyle VIEWTRANSPARENTBACKGROUND;
121 static DrawStyle LIVETVSYMBOLS;
122 static DrawStyle PROGRESSBAR;
123 static DrawStyle OSDBACKGROUND;
124 static DrawStyle TABVIEWBACKGROUND;
125 static DrawStyle TITLEBARBACKGROUND;
126 static DrawStyle SELECTBACKGROUND;
127 static DrawStyle SELECTHIGHLIGHT;
128 static DrawStyle SELECTDARKHIGHLIGHT;
129 static DrawStyle LIGHTTEXT;
130 static DrawStyle DARKTEXT;
131 static DrawStyle DANGER;
132 static DrawStyle BUTTONBACKGROUND;
133 static DrawStyle PROGRAMMEA;
134 static DrawStyle PROGRAMMEB;
135 static DrawStyle NOPROGRAMME;
136 static DrawStyle WALLPAPER; // this one is special, if transparent it means picture
140 #define COMPARE_TEST(x) if (rhs.x!=lhs.x) { \
141 return rhs.x < lhs.x; \
144 inline bool operator<(const DrawStyle& rhs, const DrawStyle& lhs)
149 if (rhs.ft==DrawStyle::Color) return false;
151 COMPARE_TEST(num_colors)
156 if (rhs.ft==DrawStyle::GradientRadial) COMPARE_TEST(r)
159 for (int i=0;i<lhs.num_colors; i++) {
160 COMPARE_TEST(grad_col[i].rgba())
161 if (i>0) COMPARE_TEST(grad_pos[i-1])
171 #define COMPARE_TEST(x) if (rhs.x!=lhs.x) return true;
174 inline bool operator!=(const DrawStyle& rhs, const DrawStyle& lhs)
179 if (rhs.ft==DrawStyle::Color) return false;
181 COMPARE_TEST(num_colors)
186 if (rhs.ft==DrawStyle::GradientRadial) COMPARE_TEST(r)
189 for (int i=0;i<lhs.num_colors; i++) {
190 COMPARE_TEST(grad_col[i].rgba())
191 if (i>0) COMPARE_TEST(grad_pos[i-1])
203 static int getNumberofSkins();
204 static const char* *getSkinNames();
205 static bool InitSkin(int n);
207 static void InitDefaultSkin();
208 static void InitEnhancedSkin();
209 static void InitNoopacityInspiredSkin();