remove the word "sticky" from everywhere, and replace with "all desktops". change...
[dana/openbox.git] / 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   _text_color_focus = new RenderColor(_screen, 0x272a2f);
18   _text_color_unfocus = new RenderColor(_screen, 0x676869);
19
20   _button_color_focus = new RenderColor(_screen, 0x96ba86);
21   _button_color_unfocus = new RenderColor(_screen, 0x676869);
22
23   _frame_border_color = new RenderColor(_screen, 0x181f24);
24   _frame_border_width = 1;
25
26   _client_border_color_focus = new RenderColor(_screen, 0x858687);
27   _client_border_color_unfocus = new RenderColor(_screen, 0x555657);
28   _client_border_width = 1;
29
30   _titlebar_focus = new RenderTexture(_screen,
31                                       false,
32                                       RenderTexture::Flat,
33                                       RenderTexture::Bevel1,
34                                       false,
35                                       RenderTexture::Vertical,
36                                       false,
37                                       0x858687,
38                                       0x373a3f,
39                                       0x0,
40                                       0x0);
41   _titlebar_unfocus = new RenderTexture(_screen,
42                                         false,
43                                         RenderTexture::Flat,
44                                         RenderTexture::Bevel1,
45                                         false,
46                                         RenderTexture::Vertical,
47                                         false,
48                                         0x555657,
49                                         0x171a1f,
50                                         0x0,
51                                         0x0);
52
53   _label_focus = new RenderTexture(_screen,
54                                    false,
55                                    RenderTexture::Flat,
56                                    RenderTexture::Bevel1,
57                                    true,
58                                    RenderTexture::Vertical,
59                                    false,
60                                    0x96ba86,
61                                    0x5a724c,
62                                    0x181f24,
63                                    0x0);
64   _label_unfocus = new RenderTexture(_screen,
65                                      false,
66                                      RenderTexture::Sunken,
67                                      RenderTexture::Bevel1,
68                                      false,
69                                      RenderTexture::CrossDiagonal,
70                                      false,
71                                      0x555657,
72                                      0x272a2f,
73                                      0x0,
74                                      0x0);
75
76
77   _handle_focus = new RenderTexture(_screen,
78                                     false,
79                                     RenderTexture::Flat,
80                                     RenderTexture::Bevel1,
81                                     false,
82                                     RenderTexture::Vertical,
83                                     false,
84                                     0x858687,
85                                     0x373a3f,
86                                     0x0,
87                                     0x0);
88   _handle_unfocus = new RenderTexture(_screen,
89                                       false,
90                                       RenderTexture::Flat,
91                                       RenderTexture::Bevel1,
92                                       false,
93                                       RenderTexture::Vertical,
94                                       false,
95                                       0x555657,
96                                       0x171a1f,
97                                       0x0,
98                                       0x0);
99
100   
101   _button_unpress_focus = new RenderTexture(_screen,
102                                             false,
103                                             RenderTexture::Raised,
104                                             RenderTexture::Bevel2,
105                                             false,
106                                             RenderTexture::CrossDiagonal,
107                                             false,
108                                             0x858687,
109                                             0x272a2f,
110                                             0x0,
111                                             0x0);
112   _button_unpress_unfocus = new RenderTexture(_screen,
113                                               false,
114                                               RenderTexture::Raised,
115                                               RenderTexture::Bevel2,
116                                               false,
117                                               RenderTexture::CrossDiagonal,
118                                               false,
119                                               0x555657,
120                                               0x171a1f,
121                                               0x0,
122                                               0x0);
123
124   _button_press_focus = new RenderTexture(_screen,
125                                           false,
126                                           RenderTexture::Sunken,
127                                           RenderTexture::Bevel2,
128                                           false,
129                                           RenderTexture::CrossDiagonal,
130                                           false,
131                                           0x96ba86,
132                                           0x5a724c,
133                                           0x0,
134                                           0x0);
135   _button_press_unfocus = new RenderTexture(_screen,
136                                             false,
137                                             RenderTexture::Sunken,
138                                             RenderTexture::Bevel2,
139                                             false,
140                                             RenderTexture::CrossDiagonal,
141                                             false,
142                                             0x555657,
143                                             0x171a1f,
144                                             0x0,
145                                             0x0);
146
147   _grip_focus = new RenderTexture(_screen,
148                                   false,
149                                   RenderTexture::Flat,
150                                   RenderTexture::Bevel1,
151                                   false,
152                                   RenderTexture::Vertical,
153                                   false,
154                                   0x96ba86,
155                                   0x5a724c,
156                                   0x0,
157                                   0x0);
158   _grip_unfocus = new RenderTexture(_screen,
159                                     false,
160                                     RenderTexture::Flat,
161                                     RenderTexture::Bevel1,
162                                     false,
163                                     RenderTexture::Vertical,
164                                     false,
165                                     0x555657,
166                                     0x171a1f,
167                                     0x0,
168                                     0x0);
169
170   _label_font = new Font(_screen, "Arial,Sans-9:bold", true, 1, 0x40);
171   _label_justify = RightJustify;
172
173   _max_mask = new PixmapMask();
174   _max_mask->w = _max_mask->h = 8;
175   {
176     //char data[] = { 0x7e, 0xff, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0x7e };
177     char data []  = {0x00, 0x00, 0x18, 0x3c, 0x66, 0x42, 0x00, 0x00 };
178     _max_mask->mask =
179       XCreateBitmapFromData(**display,
180                             display->screenInfo(_screen)->rootWindow(),
181                             data, 8, 8);
182   }
183
184   _icon_mask = new PixmapMask();
185   _icon_mask->w = _icon_mask->h = 8;
186   {
187     //char data[] = { 0x00, 0x00, 0xc3, 0xe7, 0x7e, 0x3c, 0x18, 0x00 };
188     char data[] = { 0x00, 0x00, 0x42, 0x66, 0x3c, 0x18, 0x00, 0x00 };
189     _icon_mask->mask =
190       XCreateBitmapFromData(**display,
191                             display->screenInfo(_screen)->rootWindow(),
192                             data, 8, 8);
193   }
194   
195   _alldesk_mask = new PixmapMask();
196   _alldesk_mask->w = _alldesk_mask->h = 8;
197   {
198     //char data[] = { 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00 };
199     char data[] = { 0x00, 0x66, 0x66, 0x00, 0x00, 0x66, 0x66, 0x00 };
200     _alldesk_mask->mask =
201       XCreateBitmapFromData(**display,
202                             display->screenInfo(_screen)->rootWindow(),
203                             data, 8, 8);
204   }
205   
206   _close_mask = new PixmapMask();
207   _close_mask->w = _close_mask->h = 8;
208   {
209     //char data[] = { 0xc3, 0xe7, 0x7e, 0x3c, 0x3c, 0x7e, 0xe7, 0xc3 };
210     char data[] = { 0x00, 0xc3, 0x66, 0x3c, 0x3c, 0x66, 0xc3, 0x00 };
211     _close_mask->mask =
212       XCreateBitmapFromData(**display,
213                             display->screenInfo(_screen)->rootWindow(),
214                             data, 8, 8);
215   }
216
217   _bevel_width = 1;
218   _handle_width = 4;
219 }
220
221 RenderStyle::~RenderStyle()
222 {
223   delete _text_color_focus;
224   delete _text_color_unfocus;
225
226   delete _button_color_focus;
227   delete _button_color_unfocus;
228
229   delete _frame_border_color;
230
231   delete _client_border_color_focus; 
232   delete _client_border_color_unfocus;
233  
234   delete _titlebar_focus;
235   delete _titlebar_unfocus;
236
237   delete _label_focus;
238   delete _label_unfocus;
239
240   delete _handle_focus;
241   delete _handle_unfocus;
242
243   delete _button_unpress_focus;
244   delete _button_unpress_unfocus;
245   delete _button_press_focus;
246   delete _button_press_unfocus;
247
248   delete _grip_focus;
249   delete _grip_unfocus;
250
251   delete _label_font;
252
253   delete _max_mask;
254   delete _icon_mask;
255   delete _alldesk_mask;
256   delete _close_mask;
257 }
258
259 }