2
Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25
struct xftcolors XftColors;
26
struct xftfonts XftFonts;
28
X_scale_style sca_dBsm, sca_dBsh, sca_dBlg, sca_Tatt, sca_Patt, sca_0_12, sca_Tu1, sca_Tu2, sca_Tu3, sca_Tu4;
29
X_scale_style sca_azim, sca_difg, sca_size, sca_trev, sca_spos, sca_Tfr, sca_Tmd, sca_Swl;
30
X_button_style ife0, ife1, ife2, ife3, but1, but2;
31
X_textln_style text0, text1, text2, texti, textc;
35
void init_styles (X_display *disp, X_resman *xrm)
37
XftColors.black = disp->alloc_xftcolor ("black", 0);
38
XftColors.white = disp->alloc_xftcolor ("white", 0);
39
XftColors.spla_fg = disp->alloc_xftcolor (xrm->get (".color.spla.fg", "blue"), XftColors.black);
40
XftColors.main_fg = disp->alloc_xftcolor (xrm->get (".color.main.fg", "white"), XftColors.black);
41
XftColors.text_fg = disp->alloc_xftcolor (xrm->get (".color.text.fg", "black"), XftColors.black);
42
XftColors.butt_fg0 = disp->alloc_xftcolor (xrm->get (".color.butt.fg0", "white"), XftColors.white);
43
XftColors.butt_fg1 = disp->alloc_xftcolor (xrm->get (".color.butt.fg1", "black"), XftColors.black);
44
XftColors.ife0_fg0 = disp->alloc_xftcolor (xrm->get (".color.ife0.fg0", "white"), XftColors.white);
45
XftColors.ife0_fg1 = disp->alloc_xftcolor (xrm->get (".color.ife0.fg1", "black"), XftColors.black);
46
XftColors.ife1_fg0 = disp->alloc_xftcolor (xrm->get (".color.ife1.fg0", "white"), XftColors.white);
47
XftColors.ife1_fg1 = disp->alloc_xftcolor (xrm->get (".color.ife1.fg1", "black"), XftColors.black);
48
XftColors.ife2_fg0 = disp->alloc_xftcolor (xrm->get (".color.ife2.fg0", "white"), XftColors.white);
49
XftColors.ife2_fg1 = disp->alloc_xftcolor (xrm->get (".color.ife2.fg1", "black"), XftColors.black);
50
XftColors.ife3_fg0 = disp->alloc_xftcolor (xrm->get (".color.ife3.fg0", "white"), XftColors.white);
51
XftColors.ife3_fg1 = disp->alloc_xftcolor (xrm->get (".color.ife3.fg1", "black"), XftColors.black);
52
XftColors.func_d0 = disp->alloc_xftcolor (xrm->get (".color.func.d0", "gray50"), XftColors.black);
53
XftColors.func_d1 = disp->alloc_xftcolor (xrm->get (".color.func.d1", "yellow"), XftColors.black);
54
XftColors.func_d2 = disp->alloc_xftcolor (xrm->get (".color.func.d2", "green"), XftColors.black);
55
XftColors.midi_fg = disp->alloc_xftcolor (xrm->get (".color.midi.fg", "white"), XftColors.black);
57
Colors.black = disp->blackpixel ();
58
Colors.white = disp->whitepixel ();
59
Colors.spla_bg = disp->alloc_color (xrm->get (".color.spla.bg", "white"), Colors.white);
60
Colors.main_bg = disp->alloc_color (xrm->get (".color.main.bg", "gray40"), Colors.black);
61
Colors.main_ds = disp->alloc_color (xrm->get (".color.main.ds", "gray20"), Colors.black);
62
Colors.main_ls = disp->alloc_color (xrm->get (".color.main.ls", "gray60"), Colors.white);
63
Colors.text_bg = disp->alloc_color (xrm->get (".color.text.bg", "gray80"), Colors.white);
64
Colors.text_hl = disp->alloc_color (xrm->get (".color.text.hl", "white"), Colors.white);
65
Colors.text_ca = disp->alloc_color (xrm->get (".color.text.ca", "red"), Colors.black);
66
Colors.slid_kn = disp->alloc_color (xrm->get (".color.slid.kn", "coral"), Colors.black);
67
Colors.slid_mk = disp->alloc_color (xrm->get (".color.slid.mk", "white"), Colors.white);
68
Colors.butt_bg0 = disp->alloc_color (xrm->get (".color.butt.bg0", "gray30"), Colors.white);
69
Colors.butt_bg1 = disp->alloc_color (xrm->get (".color.butt.bg1", "gray90"), Colors.white);
70
Colors.ife0_bg0 = disp->alloc_color (xrm->get (".color.ife0.bg0", "#202040"), Colors.white);
71
Colors.ife0_bg1 = disp->alloc_color (xrm->get (".color.ife0.bg1", "#e0e0ff"), Colors.white);
72
Colors.ife1_bg0 = disp->alloc_color (xrm->get (".color.ife1.bg0", "#203030"), Colors.white);
73
Colors.ife1_bg1 = disp->alloc_color (xrm->get (".color.ife1.bg1", "#e0ffff"), Colors.white);
74
Colors.ife2_bg0 = disp->alloc_color (xrm->get (".color.ife2.bg0", "#403020"), Colors.white);
75
Colors.ife2_bg1 = disp->alloc_color (xrm->get (".color.ife2.bg1", "#ffffa0"), Colors.white);
76
Colors.ife3_bg0 = disp->alloc_color (xrm->get (".color.ife3.bg0", "#204020"), Colors.white);
77
Colors.ife3_bg1 = disp->alloc_color (xrm->get (".color.ife3.bg1", "#e0ffa0"), Colors.white);
78
Colors.func_bg = disp->alloc_color (xrm->get (".color.func.bg", "gray10"), Colors.white);
79
Colors.func_gr = disp->alloc_color (xrm->get (".color.func.gr", "gray20"), Colors.black);
80
Colors.func_mk = disp->alloc_color (xrm->get (".color.func.mk", "red"), Colors.black);
81
Colors.midi_bg = disp->alloc_color (xrm->get (".color.midi.bg", "gray10"), Colors.white);
82
Colors.midi_gr1 = disp->alloc_color (xrm->get (".color.midi.gr1", "gray30"), Colors.black);
83
Colors.midi_gr2 = disp->alloc_color (xrm->get (".color.midi.gr2", "gray70"), Colors.white);
84
Colors.midi_co1 = disp->alloc_color (xrm->get (".color.midi.c01", "yellow"), Colors.white);
85
Colors.midi_co2 = disp->alloc_color (xrm->get (".color.midi.c02", "green"), Colors.white);
86
Colors.midi_co3 = disp->alloc_color (xrm->get (".color.midi.c03", "coral"), Colors.white);
88
XftFonts.spla1 = disp->alloc_xftfont (xrm->get (".font.spla1", "times:pixelsize=24"));
89
XftFonts.spla2 = disp->alloc_xftfont (xrm->get (".font.spla2", "times:pixelsize=15"));
90
XftFonts.main = disp->alloc_xftfont (xrm->get (".font.main", "suse sans,luxi:pixelsize=12"));
91
XftFonts.large = disp->alloc_xftfont (xrm->get (".font.large", "times:bold:pixelsize=18"));
92
XftFonts.stops = disp->alloc_xftfont (xrm->get (".font.stops", "times:bold:pixelsize=14"));
93
XftFonts.button = disp->alloc_xftfont (xrm->get (".font.button", "suse sans,luxi:pixelsize=12"));
94
XftFonts.scales = disp->alloc_xftfont (xrm->get (".font.scales", "luxi:pixelsize=9"));
95
XftFonts.midimt = disp->alloc_xftfont (xrm->get (".font.midimt", "luxi:bold:pixelsize=9"));
97
text0.font = XftFonts.main;
98
text0.color.normal.bgnd = Colors.main_bg;
99
text0.color.normal.text = XftColors.main_fg;
101
text1.font = XftFonts.main;
102
text1.color.normal.bgnd = Colors.main_bg;
103
text1.color.normal.text = XftColors.func_d1;
105
text2.font = XftFonts.main;
106
text2.color.normal.bgnd = Colors.main_bg;
107
text2.color.normal.text = XftColors.func_d2;
109
texti.font = XftFonts.main;
110
texti.color.normal.bgnd = Colors.text_bg;
111
texti.color.normal.text = XftColors.text_fg;
112
texti.color.focus.bgnd = Colors.text_hl;
113
texti.color.focus.text = XftColors.text_fg;
114
texti.color.focus.line = Colors.text_ca;
115
texti.color.shadow.lite = Colors.main_ls;
116
texti.color.shadow.dark = Colors.main_ds;
118
textc.font = XftFonts.main;
119
textc.color.normal.bgnd = Colors.main_bg;
120
textc.color.normal.text = XftColors.main_fg;
121
textc.color.focus.bgnd = Colors.text_hl;
122
textc.color.focus.text = XftColors.text_fg;
123
textc.color.focus.line = Colors.text_ca;
124
textc.color.shadow.lite = Colors.main_bg;
125
textc.color.shadow.dark = Colors.main_bg;
127
ife0.type = X_button_style::RAISED;
128
ife0.font = XftFonts.stops;
129
ife0.color.bg [0] = Colors.ife0_bg0;
130
ife0.color.bg [1] = Colors.ife0_bg1;
131
ife0.color.fg [0] = XftColors.ife0_fg0;
132
ife0.color.fg [1] = XftColors.ife0_fg1;
133
ife0.color.shadow.bgnd = Colors.main_bg;
134
ife0.color.shadow.lite = Colors.main_ls;
135
ife0.color.shadow.dark = Colors.main_ds;
139
ife1.type = X_button_style::RAISED;
140
ife1.font = XftFonts.stops;
141
ife1.color.bg [0] = Colors.ife1_bg0;
142
ife1.color.bg [1] = Colors.ife1_bg1;
143
ife1.color.fg [0] = XftColors.ife1_fg0;
144
ife1.color.fg [1] = XftColors.ife1_fg1;
145
ife1.color.shadow.bgnd = Colors.main_bg;
146
ife1.color.shadow.lite = Colors.main_ls;
147
ife1.color.shadow.dark = Colors.main_ds;
151
ife2.type = X_button_style::RAISED;
152
ife2.font = XftFonts.stops;
153
ife2.color.bg [0] = Colors.ife2_bg0;
154
ife2.color.bg [1] = Colors.ife2_bg1;
155
ife2.color.fg [0] = XftColors.ife2_fg0;
156
ife2.color.fg [1] = XftColors.ife2_fg1;
157
ife2.color.shadow.bgnd = Colors.main_bg;
158
ife2.color.shadow.lite = Colors.main_ls;
159
ife2.color.shadow.dark = Colors.main_ds;
163
ife3.type = X_button_style::RAISED;
164
ife3.font = XftFonts.stops;
165
ife3.color.bg [0] = Colors.ife3_bg0;
166
ife3.color.bg [1] = Colors.ife3_bg1;
167
ife3.color.fg [0] = XftColors.ife3_fg0;
168
ife3.color.fg [1] = XftColors.ife3_fg1;
169
ife3.color.shadow.bgnd = Colors.main_bg;
170
ife3.color.shadow.lite = Colors.main_ls;
171
ife3.color.shadow.dark = Colors.main_ds;
175
but1.type = X_button_style::RAISED;
176
but1.font = XftFonts.button;
177
but1.color.bg [0] = Colors.butt_bg0;
178
but1.color.bg [1] = Colors.butt_bg1;
179
but1.color.fg [0] = XftColors.butt_fg0;
180
but1.color.fg [1] = XftColors.butt_fg1;
181
but1.color.shadow.bgnd = Colors.main_bg;
182
but1.color.shadow.lite = Colors.main_ls;
183
but1.color.shadow.dark = Colors.main_ds;
187
but2.type = X_button_style::RAISED;
188
but2.font = XftFonts.button;
189
but2.color.bg [0] = Colors.main_bg;
190
but2.color.bg [1] = Colors.main_bg;
191
but2.color.fg [0] = XftColors.main_fg;
192
but2.color.fg [1] = XftColors.main_fg;
193
but2.color.shadow.bgnd = Colors.main_bg;
194
but2.color.shadow.lite = Colors.main_ls;
195
but2.color.shadow.dark = Colors.main_ds;
199
sca_dBlg.bg = Colors.main_bg;
200
sca_dBlg.fg = XftColors.main_fg;
202
sca_dBlg.font = XftFonts.scales;
204
sca_dBlg.set_tick ( 0, 10, -100, 0);
205
sca_dBlg.set_tick ( 1, 15, -80, "-80");
206
sca_dBlg.set_tick ( 2, 50, -70, "-70");
207
sca_dBlg.set_tick ( 3, 85, -60, "-60");
208
sca_dBlg.set_tick ( 4, 120, -50, "-50");
209
sca_dBlg.set_tick ( 5, 155, -40, "-40");
210
sca_dBlg.set_tick ( 6, 190, -30, "-30");
211
sca_dBlg.set_tick ( 7, 225, -20, "-20");
212
sca_dBlg.set_tick ( 8, 260, -10, "-10");
213
sca_dBlg.set_tick ( 9, 295, 0, "0");
215
sca_dBsm.bg = Colors.main_bg;
216
sca_dBsm.fg = XftColors.func_d1;
218
sca_dBsm.font = XftFonts.scales;
220
sca_dBsm.set_tick ( 0, 10, -100, 0);
221
sca_dBsm.set_tick ( 1, 20, -50, "-50");
222
sca_dBsm.set_tick ( 2, 54, -40, "-40");
223
sca_dBsm.set_tick ( 3, 88, -30, "-30");
224
sca_dBsm.set_tick ( 4, 122, -20, "-20");
225
sca_dBsm.set_tick ( 5, 156, -10, "-10");
226
sca_dBsm.set_tick ( 6, 190, 0, "0");
228
sca_size.bg = Colors.main_bg;
229
sca_size.fg = XftColors.main_fg;
231
sca_size.font = XftFonts.scales;
233
sca_size.set_tick ( 0, 10, 0.025, 0 );
234
sca_size.set_tick ( 1, 46, 0.050, "50" );
235
sca_size.set_tick ( 2, 82, 0.075, 0 );
236
sca_size.set_tick ( 3, 118, 0.100, "100");
237
sca_size.set_tick ( 4, 154, 0.125, 0 );
238
sca_size.set_tick ( 5, 190, 0.150, "150");
240
sca_trev.bg = Colors.main_bg;
241
sca_trev.fg = XftColors.main_fg;
243
sca_trev.font = XftFonts.scales;
245
sca_trev.set_tick ( 0, 10, 2, "2");
246
sca_trev.set_tick ( 1, 46, 3, "3");
247
sca_trev.set_tick ( 2, 82, 4, "4");
248
sca_trev.set_tick ( 3, 118, 5, "5");
249
sca_trev.set_tick ( 4, 154, 6, "6");
250
sca_trev.set_tick ( 5, 190, 7, "7");
252
sca_dBsh.bg = Colors.main_bg;
253
sca_dBsh.fg = XftColors.main_fg;
255
sca_dBsh.font = XftFonts.scales;
257
sca_dBsh.set_tick ( 0, 10, 0.000, 0 );
258
sca_dBsh.set_tick ( 1, 18, 0.100, "-20");
259
sca_dBsh.set_tick ( 2, 56, 0.178, 0 );
260
sca_dBsh.set_tick ( 3, 94, 0.316, "-10");
261
sca_dBsh.set_tick ( 4, 132, 0.562, 0 );
262
sca_dBsh.set_tick ( 5, 170, 1.000, "0" );
264
sca_spos.bg = Colors.main_bg;
265
sca_spos.fg = XftColors.main_fg;
267
sca_spos.font = XftFonts.scales;
269
sca_spos.set_tick ( 0, 10, -1.0, "B");
270
sca_spos.set_tick ( 1, 50, -0.5, 0);
271
sca_spos.set_tick ( 2, 90, 0.0, "C");
272
sca_spos.set_tick ( 3, 130, 0.5, 0);
273
sca_spos.set_tick ( 4, 170, 1.0, "F");
275
sca_azim.bg = Colors.main_bg;
276
sca_azim.fg = XftColors.main_fg;
278
sca_azim.font = XftFonts.scales;
280
sca_azim.set_tick ( 0, 10, -0.50, "B");
281
sca_azim.set_tick ( 1, 50, -0.25, "L");
282
sca_azim.set_tick ( 2, 90, 0.00, "F");
283
sca_azim.set_tick ( 3, 130, 0.25, "R");
284
sca_azim.set_tick ( 4, 170, 0.50, "B");
286
sca_difg.bg = Colors.main_bg;
287
sca_difg.fg = XftColors.main_fg;
289
sca_difg.font = XftFonts.scales;
291
sca_difg.set_tick ( 0, 10, 0.00, "0");
292
sca_difg.set_tick ( 1, 50, 0.25, 0);
293
sca_difg.set_tick ( 2, 90, 0.50, "0.5");
294
sca_difg.set_tick ( 3, 130, 0.75, 0);
295
sca_difg.set_tick ( 4, 170, 1.00, "1");
297
sca_Tatt.bg = Colors.main_bg;
298
sca_Tatt.fg = XftColors.func_d1;
300
sca_Tatt.font = XftFonts.scales;
302
sca_Tatt.set_tick ( 0, 10, 0.010, "10");
303
sca_Tatt.set_tick ( 1, 40, 0.025, "25");
304
sca_Tatt.set_tick ( 2, 70, 0.050, "50");
305
sca_Tatt.set_tick ( 3, 100, 0.100, "100");
306
sca_Tatt.set_tick ( 4, 130, 0.200, "200");
307
sca_Tatt.set_tick ( 5, 160, 0.300, "300");
308
sca_Tatt.set_tick ( 6, 190, 0.400, "400");
310
sca_Patt.bg = Colors.main_bg;
311
sca_Patt.fg = XftColors.func_d2;
313
sca_Patt.font = XftFonts.scales;
315
sca_Patt.set_tick ( 0, 10, -3.0, "-3");
316
sca_Patt.set_tick ( 1, 46, 0.0, "0");
317
sca_Patt.set_tick ( 2, 82, 3.0, "3");
318
sca_Patt.set_tick ( 3, 118, 6.0, "6");
319
sca_Patt.set_tick ( 4, 154, 19.0, "9");
320
sca_Patt.set_tick ( 5, 190, 12.0, "12");
322
sca_0_12.bg = Colors.main_bg;
323
sca_0_12.fg = XftColors.func_d1;
325
sca_0_12.font = XftFonts.scales;
327
sca_0_12.set_tick ( 0, 10, 0.0, "0");
328
sca_0_12.set_tick ( 1, 40, 2.0, "2");
329
sca_0_12.set_tick ( 2, 70, 4.0, "4");
330
sca_0_12.set_tick ( 3, 100, 6.0, "6");
331
sca_0_12.set_tick ( 4, 130, 8.0, "8");
332
sca_0_12.set_tick ( 5, 160, 10.0, "10");
333
sca_0_12.set_tick ( 6, 190, 12.0, "12");
335
sca_Tu1.bg = Colors.main_bg;
336
sca_Tu1.fg = XftColors.func_d1;
338
sca_Tu1.font = XftFonts.scales;
340
sca_Tu1.set_tick ( 0, 10, -6.0, "-6");
341
sca_Tu1.set_tick ( 1, 40, -4.0, "-4");
342
sca_Tu1.set_tick ( 2, 70, -2.0, "-2");
343
sca_Tu1.set_tick ( 3, 100, 0.0, "0");
344
sca_Tu1.set_tick ( 4, 130, 2.0, "2");
345
sca_Tu1.set_tick ( 5, 160, 4.0, "4");
346
sca_Tu1.set_tick ( 6, 190, 6.0, "6");
348
sca_Tu2.bg = Colors.main_bg;
349
sca_Tu2.fg = XftColors.func_d2;
351
sca_Tu2.font = XftFonts.scales;
353
sca_Tu2.set_tick ( 0, 10, 0.0, "0");
354
sca_Tu2.set_tick ( 1, 40, 0.1, "0.1");
355
sca_Tu2.set_tick ( 2, 70, 0.2, "0.2");
356
sca_Tu2.set_tick ( 3, 100, 0.5, "0.5");
357
sca_Tu2.set_tick ( 4, 130, 1.0, "1.0");
358
sca_Tu2.set_tick ( 5, 160, 2.0, "2.0");
359
sca_Tu2.set_tick ( 6, 190, 5.0, "5.0");
361
sca_Tu3.bg = Colors.main_bg;
362
sca_Tu3.fg = XftColors.func_d2;
364
sca_Tu3.font = XftFonts.scales;
366
sca_Tu3.set_tick ( 0, 10, -60.0, "-60");
367
sca_Tu3.set_tick ( 1, 40, -40.0, "-40");
368
sca_Tu3.set_tick ( 2, 70, -20.0, "-20");
369
sca_Tu3.set_tick ( 3, 100, 0.0, "0");
370
sca_Tu3.set_tick ( 4, 130, 20.0, "20");
371
sca_Tu3.set_tick ( 5, 160, 40.0, "40");
372
sca_Tu3.set_tick ( 6, 190, 60.0, "60");
374
sca_Tu4.bg = Colors.main_bg;
375
sca_Tu4.fg = XftColors.func_d2;
377
sca_Tu4.font = XftFonts.scales;
379
sca_Tu4.set_tick ( 0, 10, -0.01f, 0);
380
sca_Tu4.set_tick ( 1, 20, 0.0, "0");
381
sca_Tu4.set_tick ( 2, 54, 2.0, "2");
382
sca_Tu4.set_tick ( 3, 88, 4.0, "4");
383
sca_Tu4.set_tick ( 4, 122, 6.0, "6");
384
sca_Tu4.set_tick ( 5, 156, 8.0, "8");
385
sca_Tu4.set_tick ( 6, 190, 10.0, "10");
387
sca_Tfr.bg = Colors.main_bg;
388
sca_Tfr.fg = XftColors.main_fg;
390
sca_Tfr.font = XftFonts.scales;
392
sca_Tfr.set_tick ( 0, 10, 2.0, "2");
393
sca_Tfr.set_tick ( 1, 30, 3.0, "3");
394
sca_Tfr.set_tick ( 2, 50, 4.0, "4");
395
sca_Tfr.set_tick ( 3, 70, 5.0, "5");
396
sca_Tfr.set_tick ( 4, 90, 6.0, "6");
397
sca_Tfr.set_tick ( 5, 110, 7.0, "7");
398
sca_Tfr.set_tick ( 6, 130, 8.0, "8");
400
sca_Tmd.bg = Colors.main_bg;
401
sca_Tmd.fg = XftColors.main_fg;
403
sca_Tmd.font = XftFonts.scales;
405
sca_Tmd.set_tick ( 0, 10, 0.0, "0ff");
406
sca_Tmd.set_tick ( 1, 30, 0.1, 0);
407
sca_Tmd.set_tick ( 2, 50, 0.2, "0.2");
408
sca_Tmd.set_tick ( 3, 70, 0.3, 0);
409
sca_Tmd.set_tick ( 4, 90, 0.4, "0.4");
410
sca_Tmd.set_tick ( 5, 110, 0.5, 0);
411
sca_Tmd.set_tick ( 6, 130, 0.6, "0.6");
413
sca_Swl.bg = Colors.main_bg;
414
sca_Swl.fg = XftColors.main_fg;
416
sca_Swl.font = XftFonts.scales;
418
sca_Swl.set_tick ( 0, 10, 0.00, "C");
419
sca_Swl.set_tick ( 1, 40, 0.25, 0);
420
sca_Swl.set_tick ( 2, 70, 0.50, "H");
421
sca_Swl.set_tick ( 3, 100, 0.75, 0);
422
sca_Swl.set_tick ( 4, 130, 1.00, "O");
424
sli1.bg = Colors.main_bg;
425
sli1.lite = Colors.main_ls;
426
sli1.dark = Colors.main_ds;
427
sli1.knob = Colors.slid_kn;
428
sli1.mark = Colors.slid_mk;