1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
4 # include "../config.h"
5 #endif // HAVE_CONFIG_H
7 #include "renderstyle.hh"
9 #include "screeninfo.hh"
13 RenderStyle::RenderStyle(int screen
, const std::string
&stylefile
)
22 _root_color
= new RenderColor(_screen
, 0x272a2f);
24 _text_color_focus
= new RenderColor(_screen
, 0x272a2f);
25 _text_color_unfocus
= new RenderColor(_screen
, 0x676869);
27 _button_color_focus
= new RenderColor(_screen
, 0x96ba86);
28 _button_color_unfocus
= new RenderColor(_screen
, 0x676869);
30 _frame_border_color
= new RenderColor(_screen
, 0x181f24);
31 _frame_border_width
= 1;
33 _client_border_color_focus
= new RenderColor(_screen
, 0x858687);
34 _client_border_color_unfocus
= new RenderColor(_screen
, 0x555657);
35 _client_border_width
= 1;
37 _titlebar_focus
= new RenderTexture(_screen
,
40 RenderTexture::Bevel1
,
42 RenderTexture::Vertical
,
48 _titlebar_unfocus
= new RenderTexture(_screen
,
51 RenderTexture::Bevel1
,
53 RenderTexture::Vertical
,
60 _label_focus
= new RenderTexture(_screen
,
63 RenderTexture::Bevel1
,
65 RenderTexture::Vertical
,
71 _label_unfocus
= new RenderTexture(_screen
,
73 RenderTexture::Sunken
,
74 RenderTexture::Bevel1
,
76 RenderTexture::CrossDiagonal
,
84 _handle_focus
= new RenderTexture(_screen
,
87 RenderTexture::Bevel1
,
89 RenderTexture::Vertical
,
95 _handle_unfocus
= new RenderTexture(_screen
,
98 RenderTexture::Bevel1
,
100 RenderTexture::Vertical
,
108 _button_unpress_focus
= new RenderTexture(_screen
,
110 RenderTexture::Raised
,
111 RenderTexture::Bevel2
,
113 RenderTexture::CrossDiagonal
,
119 _button_unpress_unfocus
= new RenderTexture(_screen
,
121 RenderTexture::Raised
,
122 RenderTexture::Bevel2
,
124 RenderTexture::CrossDiagonal
,
131 _button_press_focus
= new RenderTexture(_screen
,
133 RenderTexture::Sunken
,
134 RenderTexture::Bevel2
,
136 RenderTexture::CrossDiagonal
,
142 _button_press_unfocus
= new RenderTexture(_screen
,
144 RenderTexture::Sunken
,
145 RenderTexture::Bevel2
,
147 RenderTexture::CrossDiagonal
,
154 _grip_focus
= new RenderTexture(_screen
,
157 RenderTexture::Bevel1
,
159 RenderTexture::Vertical
,
165 _grip_unfocus
= new RenderTexture(_screen
,
168 RenderTexture::Bevel1
,
170 RenderTexture::Vertical
,
177 _label_font
= new Font(_screen
, "Arial,Sans-9:bold", true, 1, 0x40);
178 _label_justify
= RightJustify
;
180 _max_mask
= new PixmapMask();
181 _max_mask
->w
= _max_mask
->h
= 8;
183 //char data[] = { 0x7e, 0xff, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0x7e };
184 char data
[] = {0x00, 0x00, 0x18, 0x3c, 0x66, 0x42, 0x00, 0x00 };
186 XCreateBitmapFromData(**display
,
187 display
->screenInfo(_screen
)->rootWindow(),
191 _icon_mask
= new PixmapMask();
192 _icon_mask
->w
= _icon_mask
->h
= 8;
194 //char data[] = { 0x00, 0x00, 0xc3, 0xe7, 0x7e, 0x3c, 0x18, 0x00 };
195 char data
[] = { 0x00, 0x00, 0x42, 0x66, 0x3c, 0x18, 0x00, 0x00 };
197 XCreateBitmapFromData(**display
,
198 display
->screenInfo(_screen
)->rootWindow(),
202 _alldesk_mask
= new PixmapMask();
203 _alldesk_mask
->w
= _alldesk_mask
->h
= 8;
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(),
213 _close_mask
= new PixmapMask();
214 _close_mask
->w
= _close_mask
->h
= 8;
216 //char data[] = { 0xc3, 0xe7, 0x7e, 0x3c, 0x3c, 0x7e, 0xe7, 0xc3 };
217 char data
[] = { 0x00, 0xc3, 0x66, 0x3c, 0x3c, 0x66, 0xc3, 0x00 };
219 XCreateBitmapFromData(**display
,
220 display
->screenInfo(_screen
)->rootWindow(),
228 _root_color
= new RenderColor(_screen
, 0x7b756a);
230 _text_color_focus
= new RenderColor(_screen
, 0xffffff);
231 _text_color_unfocus
= new RenderColor(_screen
, 0xffffff);
233 _button_color_focus
= new RenderColor(_screen
, 0x222222);
234 _button_color_unfocus
= new RenderColor(_screen
, 0x333333);
236 _frame_border_color
= new RenderColor(_screen
, 0x222222);
237 _frame_border_width
= 1;
239 _client_border_color_focus
= new RenderColor(_screen
, 0x858687);
240 _client_border_color_unfocus
= new RenderColor(_screen
, 0x555657);
241 _client_border_width
= 0;
243 _titlebar_focus
= new RenderTexture(_screen
,
246 RenderTexture::Bevel1
,
248 RenderTexture::Solid
,
254 _titlebar_unfocus
= new RenderTexture(_screen
,
257 RenderTexture::Bevel1
,
259 RenderTexture::Vertical
,
266 _label_focus
= new RenderTexture(_screen
,
269 RenderTexture::Bevel1
,
271 RenderTexture::Vertical
,
279 //urg this ain't so hot
280 _label_unfocus
= new RenderTexture(_screen
,
283 RenderTexture::Bevel1
,
285 RenderTexture::Vertical
,
293 _handle_focus
= new RenderTexture(_screen
,
296 RenderTexture::Bevel1
,
298 RenderTexture::Vertical
,
304 _handle_unfocus
= new RenderTexture(_screen
,
307 RenderTexture::Bevel1
,
309 RenderTexture::Solid
,
317 _button_unpress_focus
= new RenderTexture(_screen
,
320 RenderTexture::Bevel1
,
322 RenderTexture::Solid
,
328 _button_unpress_unfocus
= new RenderTexture(_screen
,
331 RenderTexture::Bevel1
,
333 RenderTexture::Solid
,
340 _button_press_focus
= new RenderTexture(_screen
,
342 RenderTexture::Sunken
,
343 RenderTexture::Bevel2
,
345 RenderTexture::Vertical
,
351 _button_press_unfocus
= new RenderTexture(_screen
,
353 RenderTexture::Sunken
,
354 RenderTexture::Bevel2
,
356 RenderTexture::Vertical
,
363 _grip_focus
= new RenderTexture(_screen
,
366 RenderTexture::Bevel1
,
368 RenderTexture::Vertical
,
374 _grip_unfocus
= new RenderTexture(_screen
,
377 RenderTexture::Bevel1
,
379 RenderTexture::Solid
,
386 _label_font
= new Font(_screen
, "Arial,Sans-8", true, 1, 0x3e);
387 _label_justify
= CenterJustify
;
389 _max_mask
= new PixmapMask();
390 _max_mask
->w
= _max_mask
->h
= 7;
392 char data
[] = {0x7c, 0x44, 0x47, 0x47, 0x7f, 0x1f, 0x1f };
394 XCreateBitmapFromData(**display
,
395 display
->screenInfo(_screen
)->rootWindow(),
399 _icon_mask
= new PixmapMask();
400 _icon_mask
->w
= _icon_mask
->h
= 7;
402 char data
[] = {0x00, 0x00, 0x00, 0x00, 0x3e, 0x3e, 0x3e };
404 XCreateBitmapFromData(**display
,
405 display
->screenInfo(_screen
)->rootWindow(),
409 _alldesk_mask
= new PixmapMask();
410 _alldesk_mask
->w
= _alldesk_mask
->h
= 7;
412 char data
[] = {0x00, 0x36, 0x36, 0x00, 0x36, 0x36, 0x00 };
413 _alldesk_mask
->mask
=
414 XCreateBitmapFromData(**display
,
415 display
->screenInfo(_screen
)->rootWindow(),
419 _close_mask
= new PixmapMask();
420 _close_mask
->w
= _close_mask
->h
= 7;
422 char data
[] = { 0x22, 0x77, 0x3e, 0x1c, 0x3e, 0x77, 0x22 };
424 XCreateBitmapFromData(**display
,
425 display
->screenInfo(_screen
)->rootWindow(),
437 RenderStyle::~RenderStyle()
441 delete _text_color_focus
;
442 delete _text_color_unfocus
;
444 delete _button_color_focus
;
445 delete _button_color_unfocus
;
447 delete _frame_border_color
;
449 delete _client_border_color_focus
;
450 delete _client_border_color_unfocus
;
452 delete _titlebar_focus
;
453 delete _titlebar_unfocus
;
456 delete _label_unfocus
;
458 delete _handle_focus
;
459 delete _handle_unfocus
;
461 delete _button_unpress_focus
;
462 delete _button_unpress_unfocus
;
463 delete _button_press_focus
;
464 delete _button_press_unfocus
;
467 delete _grip_unfocus
;
473 delete _alldesk_mask
;