]> Dogcows Code - chaz/openbox/blob - otk/renderstyle.cc
rm a XXX.. comment it out :)
[chaz/openbox] / otk / renderstyle.cc
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2
3 #ifdef HAVE_CONFIG_H
4 # include "../config.h"
5 #endif // HAVE_CONFIG_H
6
7 #include "renderstyle.hh"
8 #include "display.hh"
9 #include "screeninfo.hh"
10
11 namespace otk {
12
13 RenderStyle::RenderStyle(int screen, const std::string &stylefile)
14 : _screen(screen),
15 _file(stylefile)
16 {
17 // pick one..
18 #define FIERON
19 //#define MERRY
20
21 #ifdef FIERON
22 _root_color = new RenderColor(_screen, 0x272a2f);
23
24 _text_color_focus = new RenderColor(_screen, 0x272a2f);
25 _text_color_unfocus = new RenderColor(_screen, 0x676869);
26
27 _button_color_focus = new RenderColor(_screen, 0x96ba86);
28 _button_color_unfocus = new RenderColor(_screen, 0x676869);
29
30 _frame_border_color = new RenderColor(_screen, 0x181f24);
31 _frame_border_width = 1;
32
33 _client_border_color_focus = new RenderColor(_screen, 0x858687);
34 _client_border_color_unfocus = new RenderColor(_screen, 0x555657);
35 _client_border_width = 1;
36
37 _titlebar_focus = new RenderTexture(_screen,
38 false,
39 RenderTexture::Flat,
40 RenderTexture::Bevel1,
41 false,
42 RenderTexture::Vertical,
43 false,
44 0x858687,
45 0x373a3f,
46 0x0,
47 0x0);
48 _titlebar_unfocus = new RenderTexture(_screen,
49 false,
50 RenderTexture::Flat,
51 RenderTexture::Bevel1,
52 false,
53 RenderTexture::Vertical,
54 false,
55 0x555657,
56 0x171a1f,
57 0x0,
58 0x0);
59
60 _label_focus = new RenderTexture(_screen,
61 false,
62 RenderTexture::Flat,
63 RenderTexture::Bevel1,
64 true,
65 RenderTexture::Vertical,
66 false,
67 0x96ba86,
68 0x5a724c,
69 0x181f24,
70 0x0);
71 _label_unfocus = new RenderTexture(_screen,
72 false,
73 RenderTexture::Sunken,
74 RenderTexture::Bevel1,
75 false,
76 RenderTexture::CrossDiagonal,
77 false,
78 0x555657,
79 0x272a2f,
80 0x0,
81 0x0);
82
83
84 _handle_focus = new RenderTexture(_screen,
85 false,
86 RenderTexture::Flat,
87 RenderTexture::Bevel1,
88 false,
89 RenderTexture::Vertical,
90 false,
91 0x858687,
92 0x373a3f,
93 0x0,
94 0x0);
95 _handle_unfocus = new RenderTexture(_screen,
96 false,
97 RenderTexture::Flat,
98 RenderTexture::Bevel1,
99 false,
100 RenderTexture::Vertical,
101 false,
102 0x555657,
103 0x171a1f,
104 0x0,
105 0x0);
106
107
108 _button_unpress_focus = new RenderTexture(_screen,
109 false,
110 RenderTexture::Raised,
111 RenderTexture::Bevel2,
112 false,
113 RenderTexture::CrossDiagonal,
114 false,
115 0x858687,
116 0x272a2f,
117 0x0,
118 0x0);
119 _button_unpress_unfocus = new RenderTexture(_screen,
120 false,
121 RenderTexture::Raised,
122 RenderTexture::Bevel2,
123 false,
124 RenderTexture::CrossDiagonal,
125 false,
126 0x555657,
127 0x171a1f,
128 0x0,
129 0x0);
130
131 _button_press_focus = new RenderTexture(_screen,
132 false,
133 RenderTexture::Sunken,
134 RenderTexture::Bevel2,
135 false,
136 RenderTexture::CrossDiagonal,
137 false,
138 0x96ba86,
139 0x5a724c,
140 0x0,
141 0x0);
142 _button_press_unfocus = new RenderTexture(_screen,
143 false,
144 RenderTexture::Sunken,
145 RenderTexture::Bevel2,
146 false,
147 RenderTexture::CrossDiagonal,
148 false,
149 0x555657,
150 0x171a1f,
151 0x0,
152 0x0);
153
154 _grip_focus = new RenderTexture(_screen,
155 false,
156 RenderTexture::Flat,
157 RenderTexture::Bevel1,
158 false,
159 RenderTexture::Vertical,
160 false,
161 0x96ba86,
162 0x5a724c,
163 0x0,
164 0x0);
165 _grip_unfocus = new RenderTexture(_screen,
166 false,
167 RenderTexture::Flat,
168 RenderTexture::Bevel1,
169 false,
170 RenderTexture::Vertical,
171 false,
172 0x555657,
173 0x171a1f,
174 0x0,
175 0x0);
176
177 _label_font = new Font(_screen, "Arial,Sans-9:bold", true, 1, 0x40);
178 _label_justify = RightJustify;
179
180 _max_mask = new PixmapMask();
181 _max_mask->w = _max_mask->h = 8;
182 {
183 //char data[] = { 0x7e, 0xff, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0x7e };
184 char data [] = {0x00, 0x00, 0x18, 0x3c, 0x66, 0x42, 0x00, 0x00 };
185 _max_mask->mask =
186 XCreateBitmapFromData(**display,
187 display->screenInfo(_screen)->rootWindow(),
188 data, 8, 8);
189 }
190
191 _icon_mask = new PixmapMask();
192 _icon_mask->w = _icon_mask->h = 8;
193 {
194 //char data[] = { 0x00, 0x00, 0xc3, 0xe7, 0x7e, 0x3c, 0x18, 0x00 };
195 char data[] = { 0x00, 0x00, 0x42, 0x66, 0x3c, 0x18, 0x00, 0x00 };
196 _icon_mask->mask =
197 XCreateBitmapFromData(**display,
198 display->screenInfo(_screen)->rootWindow(),
199 data, 8, 8);
200 }
201
202 _alldesk_mask = new PixmapMask();
203 _alldesk_mask->w = _alldesk_mask->h = 8;
204 {
205 //char data[] = { 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00 };
206 char data[] = { 0x00, 0x66, 0x66, 0x00, 0x00, 0x66, 0x66, 0x00 };
207 _alldesk_mask->mask =
208 XCreateBitmapFromData(**display,
209 display->screenInfo(_screen)->rootWindow(),
210 data, 8, 8);
211 }
212
213 _close_mask = new PixmapMask();
214 _close_mask->w = _close_mask->h = 8;
215 {
216 //char data[] = { 0xc3, 0xe7, 0x7e, 0x3c, 0x3c, 0x7e, 0xe7, 0xc3 };
217 char data[] = { 0x00, 0xc3, 0x66, 0x3c, 0x3c, 0x66, 0xc3, 0x00 };
218 _close_mask->mask =
219 XCreateBitmapFromData(**display,
220 display->screenInfo(_screen)->rootWindow(),
221 data, 8, 8);
222 }
223
224 _bevel_width = 1;
225 _handle_width = 4;
226 #else
227 # ifdef MERRY
228 _root_color = new RenderColor(_screen, 0x7b756a);
229
230 _text_color_focus = new RenderColor(_screen, 0xffffff);
231 _text_color_unfocus = new RenderColor(_screen, 0xffffff);
232
233 _button_color_focus = new RenderColor(_screen, 0x222222);
234 _button_color_unfocus = new RenderColor(_screen, 0x333333);
235
236 _frame_border_color = new RenderColor(_screen, 0x222222);
237 _frame_border_width = 1;
238
239 _client_border_color_focus = new RenderColor(_screen, 0x858687);
240 _client_border_color_unfocus = new RenderColor(_screen, 0x555657);
241 _client_border_width = 0;
242
243 _titlebar_focus = new RenderTexture(_screen,
244 false,
245 RenderTexture::Flat,
246 RenderTexture::Bevel1,
247 false,
248 RenderTexture::Solid,
249 false,
250 0xe6e6e6,
251 0xe6e6e6,
252 0x0,
253 0x0);
254 _titlebar_unfocus = new RenderTexture(_screen,
255 false,
256 RenderTexture::Flat,
257 RenderTexture::Bevel1,
258 false,
259 RenderTexture::Vertical,
260 false,
261 0xe6e6e6,
262 0xd9d9d9,
263 0x0,
264 0x0);
265
266 _label_focus = new RenderTexture(_screen,
267 false,
268 RenderTexture::Flat,
269 RenderTexture::Bevel1,
270 true,
271 RenderTexture::Vertical,
272 false,
273 //0x6a6973,
274 //0x6a6973,
275 0x4c59a6,
276 0x5a6dbd,
277 0x222222,
278 0x0);
279 //urg this ain't so hot
280 _label_unfocus = new RenderTexture(_screen,
281 false,
282 RenderTexture::Flat,
283 RenderTexture::Bevel1,
284 true,
285 RenderTexture::Vertical,
286 false,
287 0xb4b2ad,
288 0xc3c1bc,
289 0x6a696a,
290 0x0);
291
292
293 _handle_focus = new RenderTexture(_screen,
294 false,
295 RenderTexture::Flat,
296 RenderTexture::Bevel1,
297 false,
298 RenderTexture::Vertical,
299 false,
300 0xe6e6e6,
301 0xd9d9d9,
302 0x0,
303 0x0);
304 _handle_unfocus = new RenderTexture(_screen,
305 false,
306 RenderTexture::Flat,
307 RenderTexture::Bevel1,
308 false,
309 RenderTexture::Solid,
310 false,
311 0xe6e6e6,
312 0xe6e6e6,
313 0x0,
314 0x0);
315
316
317 _button_unpress_focus = new RenderTexture(_screen,
318 false,
319 RenderTexture::Flat,
320 RenderTexture::Bevel1,
321 false,
322 RenderTexture::Solid,
323 false,
324 0xe6e6e6,
325 0xe6e6e6,
326 0x0,
327 0x0);
328 _button_unpress_unfocus = new RenderTexture(_screen,
329 false,
330 RenderTexture::Flat,
331 RenderTexture::Bevel1,
332 false,
333 RenderTexture::Solid,
334 false,
335 0xe6e6e6,
336 0xe6e6e6,
337 0x0,
338 0x0);
339
340 _button_press_focus = new RenderTexture(_screen,
341 false,
342 RenderTexture::Sunken,
343 RenderTexture::Bevel2,
344 false,
345 RenderTexture::Vertical,
346 false,
347 0xe6e6e6,
348 0xe6e6e6,
349 0x0,
350 0x0);
351 _button_press_unfocus = new RenderTexture(_screen,
352 false,
353 RenderTexture::Sunken,
354 RenderTexture::Bevel2,
355 false,
356 RenderTexture::Vertical,
357 false,
358 0xe6e6e6,
359 0xe6e6e6,
360 0x0,
361 0x0);
362
363 _grip_focus = new RenderTexture(_screen,
364 false,
365 RenderTexture::Flat,
366 RenderTexture::Bevel1,
367 false,
368 RenderTexture::Vertical,
369 false,
370 0xe6e6e6,
371 0xd9d9d9,
372 0x0,
373 0x0);
374 _grip_unfocus = new RenderTexture(_screen,
375 false,
376 RenderTexture::Flat,
377 RenderTexture::Bevel1,
378 false,
379 RenderTexture::Solid,
380 false,
381 0xe6e6e6,
382 0xe6e6e6,
383 0x0,
384 0x0);
385
386 _label_font = new Font(_screen, "Arial,Sans-8", true, 1, 0x3e);
387 _label_justify = CenterJustify;
388
389 _max_mask = new PixmapMask();
390 _max_mask->w = _max_mask->h = 7;
391 {
392 char data [] = {0x7c, 0x44, 0x47, 0x47, 0x7f, 0x1f, 0x1f };
393 _max_mask->mask =
394 XCreateBitmapFromData(**display,
395 display->screenInfo(_screen)->rootWindow(),
396 data, 7, 7);
397 }
398
399 _icon_mask = new PixmapMask();
400 _icon_mask->w = _icon_mask->h = 7;
401 {
402 char data[] = {0x00, 0x00, 0x00, 0x00, 0x3e, 0x3e, 0x3e };
403 _icon_mask->mask =
404 XCreateBitmapFromData(**display,
405 display->screenInfo(_screen)->rootWindow(),
406 data, 7, 7);
407 }
408
409 _alldesk_mask = new PixmapMask();
410 _alldesk_mask->w = _alldesk_mask->h = 7;
411 {
412 char data[] = {0x00, 0x36, 0x36, 0x00, 0x36, 0x36, 0x00 };
413 _alldesk_mask->mask =
414 XCreateBitmapFromData(**display,
415 display->screenInfo(_screen)->rootWindow(),
416 data, 7, 7);
417 }
418
419 _close_mask = new PixmapMask();
420 _close_mask->w = _close_mask->h = 7;
421 {
422 char data[] = { 0x22, 0x77, 0x3e, 0x1c, 0x3e, 0x77, 0x22 };
423 _close_mask->mask =
424 XCreateBitmapFromData(**display,
425 display->screenInfo(_screen)->rootWindow(),
426 data, 7, 7);
427 }
428
429 _bevel_width = 1;
430 _handle_width = 3;
431 # else
432 # error 1
433 # endif
434 #endif
435 }
436
437 RenderStyle::~RenderStyle()
438 {
439 delete _root_color;
440
441 delete _text_color_focus;
442 delete _text_color_unfocus;
443
444 delete _button_color_focus;
445 delete _button_color_unfocus;
446
447 delete _frame_border_color;
448
449 delete _client_border_color_focus;
450 delete _client_border_color_unfocus;
451
452 delete _titlebar_focus;
453 delete _titlebar_unfocus;
454
455 delete _label_focus;
456 delete _label_unfocus;
457
458 delete _handle_focus;
459 delete _handle_unfocus;
460
461 delete _button_unpress_focus;
462 delete _button_unpress_unfocus;
463 delete _button_press_focus;
464 delete _button_press_unfocus;
465
466 delete _grip_focus;
467 delete _grip_unfocus;
468
469 delete _label_font;
470
471 delete _max_mask;
472 delete _icon_mask;
473 delete _alldesk_mask;
474 delete _close_mask;
475 }
476
477 }
This page took 0.058377 seconds and 4 git commands to generate.