ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/background.C
Revision: 1.238
Committed: Sun Jun 10 15:48:08 2012 UTC (11 years, 11 months ago) by sf-exg
Content type: text/plain
Branch: MAIN
Changes since 1.237: +0 -17 lines
Log Message:
Remove unused function.

File Contents

# User Rev Content
1 sasha 1.1 /*----------------------------------------------------------------------*
2 ayin 1.4 * File: background.C - former xpm.C
3 sasha 1.1 *----------------------------------------------------------------------*
4     *
5     * All portions of code are copyright by their respective author/s.
6 root 1.147 * Copyright (c) 2005-2008 Marc Lehmann <schmorp@schmorp.de>
7 sasha 1.1 * Copyright (c) 2007 Sasha Vasko <sasha@aftercode.net>
8 sf-exg 1.209 * Copyright (c) 2010-2012 Emanuele Giaquinta <e.giaquinta@glauco.it>
9 sasha 1.1 *
10     * This program is free software; you can redistribute it and/or modify
11     * it under the terms of the GNU General Public License as published by
12     * the Free Software Foundation; either version 2 of the License, or
13     * (at your option) any later version.
14     *
15     * This program is distributed in the hope that it will be useful,
16     * but WITHOUT ANY WARRANTY; without even the implied warranty of
17     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18     * GNU General Public License for more details.
19     *
20     * You should have received a copy of the GNU General Public License
21     * along with this program; if not, write to the Free Software
22     * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23     *---------------------------------------------------------------------*/
24    
25     #include "../config.h" /* NECESSARY */
26     #include "rxvt.h" /* NECESSARY */
27    
28     #ifdef HAVE_BG_PIXMAP
29 sf-exg 1.188
30 root 1.14 void
31 sf-exg 1.142 rxvt_term::bg_destroy ()
32 sasha 1.11 {
33 sf-exg 1.236 # if ENABLE_TRANSPARENCY
34     delete root_img;
35 root 1.237 root_img = 0;
36 sf-exg 1.236 # endif
37    
38 root 1.232 # if BG_IMAGE_FROM_FILE
39 sf-exg 1.233 fimage.destroy ();
40 sf-exg 1.221 # endif
41    
42 sf-exg 1.236 delete bg_img;
43 root 1.237 bg_img = 0;
44 sasha 1.11 }
45 sasha 1.2
46 sasha 1.1 bool
47 sf-exg 1.142 rxvt_term::bg_set_position (int x, int y)
48 sf-exg 1.121 {
49    
50     if (target_x != x
51     || target_y != y)
52     {
53     target_x = x;
54     target_y = y;
55     return true;
56     }
57     return false;
58     }
59    
60     bool
61 sf-exg 1.142 rxvt_term::bg_window_size_sensitive ()
62 sasha 1.1 {
63 root 1.232 # if ENABLE_TRANSPARENCY
64 sf-exg 1.143 if (bg_flags & BG_IS_TRANSPARENT)
65 sasha 1.13 return true;
66     # endif
67    
68 root 1.232 # if BG_IMAGE_FROM_FILE
69 sf-exg 1.236 if (fimage.img)
70 sasha 1.1 {
71 sf-exg 1.233 if ((fimage.flags & IM_IS_SIZE_SENSITIVE)
72 sf-exg 1.236 || fimage.img->w > szHint.width
73     || fimage.img->h > szHint.height)
74 sasha 1.1 return true;
75     }
76     # endif
77 sasha 1.13
78     return false;
79     }
80    
81 sf-exg 1.37 bool
82 sf-exg 1.142 rxvt_term::bg_window_position_sensitive ()
83 sasha 1.13 {
84 root 1.232 # if ENABLE_TRANSPARENCY
85 sf-exg 1.143 if (bg_flags & BG_IS_TRANSPARENT)
86 sasha 1.1 return true;
87     # endif
88 sasha 1.13
89 root 1.232 # if BG_IMAGE_FROM_FILE
90 sf-exg 1.236 if (fimage.img)
91 sasha 1.13 {
92 sf-exg 1.233 if (fimage.flags & IM_ROOT_ALIGN)
93 sasha 1.13 return true;
94     }
95     # endif
96    
97 sasha 1.1 return false;
98 sf-exg 1.117 }
99 sasha 1.1
100 root 1.232 # if BG_IMAGE_FROM_FILE
101 sasha 1.1 static inline int
102     make_align_position (int align, int window_size, int image_size)
103     {
104 sf-exg 1.66 if (align >= 0 && align <= 100)
105 sf-exg 1.206 return lerp (0, window_size - image_size, align);
106 sf-exg 1.205 else if (align > 100)
107 sf-exg 1.206 return lerp (window_size - image_size, window_size, align - 100);
108 sf-exg 1.205 else
109 sf-exg 1.206 return lerp (-image_size, 0, align + 100);
110 sasha 1.1 }
111    
112 sf-exg 1.219 static void
113     parse_style (const char *style, int &x, int &y, unsigned int &w, unsigned int &h, uint8_t &flags)
114     {
115     if (!strcasecmp (style, "tiled"))
116     {
117     flags = IM_TILE;
118     w = h = noScale;
119     x = y = 0;
120     }
121     else if (!strcasecmp (style, "aspect-stretched"))
122     {
123     flags = IM_KEEP_ASPECT;
124     w = h = windowScale;
125     x = y = centerAlign;
126     }
127     else if (!strcasecmp (style, "stretched"))
128     {
129     flags = 0;
130     w = h = windowScale;
131     x = y = centerAlign;
132     }
133     else if (!strcasecmp (style, "centered"))
134     {
135     flags = 0;
136     w = h = noScale;
137     x = y = centerAlign;
138     }
139     else if (!strcasecmp (style, "root-tiled"))
140     {
141     flags = IM_TILE|IM_ROOT_ALIGN;
142     w = h = noScale;
143     x = y = 0;
144     }
145     }
146    
147 sasha 1.1 bool
148 sf-exg 1.214 rxvt_image::set_geometry (const char *geom, bool update)
149 sasha 1.1 {
150 sf-exg 1.110 bool changed = false;
151     int geom_flags = 0;
152 sf-exg 1.198 int x = h_align;
153     int y = v_align;
154     unsigned int w = h_scale;
155     unsigned int h = v_scale;
156 sf-exg 1.219 uint8_t new_flags = 0;
157 sasha 1.1
158     if (geom == NULL)
159     return false;
160    
161 sf-exg 1.163 if (geom[0])
162 sf-exg 1.122 {
163 sf-exg 1.163 char **arr = rxvt_strsplit (':', geom);
164 sf-exg 1.131
165 sf-exg 1.173 for (int i = 0; arr[i]; i++)
166 sasha 1.1 {
167 sf-exg 1.219 if (!strncasecmp (arr[i], "style=", 6))
168 sf-exg 1.160 {
169 sf-exg 1.219 parse_style (arr[i] + 6, x, y, w, h, new_flags);
170 sf-exg 1.160 geom_flags = WidthValue|HeightValue|XValue|YValue;
171     }
172     else if (!strcasecmp (arr[i], "op=tile"))
173 sf-exg 1.214 new_flags |= IM_TILE;
174 sf-exg 1.176 else if (!strcasecmp (arr[i], "op=keep-aspect"))
175 sf-exg 1.214 new_flags |= IM_KEEP_ASPECT;
176 sf-exg 1.176 else if (!strcasecmp (arr[i], "op=root-align"))
177 sf-exg 1.214 new_flags |= IM_ROOT_ALIGN;
178 sf-exg 1.160
179     // deprecated
180     else if (!strcasecmp (arr[i], "tile"))
181 sf-exg 1.122 {
182 sf-exg 1.214 new_flags |= IM_TILE;
183 sf-exg 1.122 w = h = noScale;
184     geom_flags |= WidthValue|HeightValue;
185     }
186 sf-exg 1.133 else if (!strcasecmp (arr[i], "propscale"))
187 sf-exg 1.122 {
188 sf-exg 1.214 new_flags |= IM_KEEP_ASPECT;
189 sf-exg 1.177 w = h = windowScale;
190     geom_flags |= WidthValue|HeightValue;
191 sf-exg 1.122 }
192 sf-exg 1.161 else if (!strcasecmp (arr[i], "hscale"))
193     {
194 sf-exg 1.214 new_flags |= IM_TILE;
195 sf-exg 1.161 w = windowScale;
196     h = noScale;
197     geom_flags |= WidthValue|HeightValue;
198     }
199     else if (!strcasecmp (arr[i], "vscale"))
200     {
201 sf-exg 1.214 new_flags |= IM_TILE;
202 sf-exg 1.161 h = windowScale;
203     w = noScale;
204     geom_flags |= WidthValue|HeightValue;
205     }
206 sf-exg 1.133 else if (!strcasecmp (arr[i], "scale"))
207 sf-exg 1.122 {
208 sf-exg 1.161 w = h = windowScale;
209 sf-exg 1.122 geom_flags |= WidthValue|HeightValue;
210     }
211 sf-exg 1.161 else if (!strcasecmp (arr[i], "auto"))
212     {
213     w = h = windowScale;
214     x = y = centerAlign;
215     geom_flags |= WidthValue|HeightValue|XValue|YValue;
216     }
217 sf-exg 1.133 else if (!strcasecmp (arr[i], "root"))
218 sf-exg 1.122 {
219 sf-exg 1.214 new_flags |= IM_TILE|IM_ROOT_ALIGN;
220 sf-exg 1.122 w = h = noScale;
221     geom_flags |= WidthValue|HeightValue;
222     }
223 sf-exg 1.163
224     else
225     geom_flags |= XParseGeometry (arr[i], &x, &y, &w, &h);
226 sf-exg 1.131 } /* done parsing ops */
227 root 1.26
228 sf-exg 1.131 rxvt_free_strsplit (arr);
229 sf-exg 1.122 }
230 sasha 1.1
231 sf-exg 1.214 new_flags |= flags & ~IM_GEOMETRY_FLAGS;
232 sf-exg 1.185
233 sf-exg 1.163 if (!update)
234     {
235     if (!(geom_flags & XValue))
236     x = y = defaultAlign;
237     else if (!(geom_flags & YValue))
238     y = x;
239    
240     if (!(geom_flags & (WidthValue|HeightValue)))
241     w = h = defaultScale;
242     else if (!(geom_flags & HeightValue))
243     h = w;
244     else if (!(geom_flags & WidthValue))
245     w = h;
246     }
247    
248 sf-exg 1.198 clamp_it (x, -100, 200);
249     clamp_it (y, -100, 200);
250    
251 sf-exg 1.214 if (flags != new_flags
252 sf-exg 1.198 || h_scale != w
253     || v_scale != h
254     || h_align != x
255     || v_align != y)
256 sasha 1.1 {
257 sf-exg 1.214 flags = new_flags;
258 sf-exg 1.198 h_scale = w;
259     v_scale = h;
260     h_align = x;
261     v_align = y;
262 sf-exg 1.110 changed = true;
263 sasha 1.1 }
264 root 1.26
265 sf-exg 1.225 if (is_size_sensitive ())
266 sf-exg 1.214 flags |= IM_IS_SIZE_SENSITIVE;
267     else
268     flags &= ~IM_IS_SIZE_SENSITIVE;
269    
270 sf-exg 1.110 return changed;
271 sasha 1.1 }
272    
273 sf-exg 1.59 void
274 sf-exg 1.214 rxvt_term::get_image_geometry (rxvt_image &image, int &w, int &h, int &x, int &y)
275 sf-exg 1.59 {
276 sf-exg 1.236 int image_width = image.img->w;
277     int image_height = image.img->h;
278 sf-exg 1.142 int target_width = szHint.width;
279     int target_height = szHint.height;
280 sf-exg 1.217 int h_scale = min (image.h_scale, 32767 * 100 / target_width);
281     int v_scale = min (image.v_scale, 32767 * 100 / target_height);
282 sf-exg 1.59
283 sf-exg 1.217 w = h_scale * target_width / 100;
284     h = v_scale * target_height / 100;
285 sf-exg 1.164
286 sf-exg 1.214 if (image.flags & IM_KEEP_ASPECT)
287 sf-exg 1.62 {
288 sf-exg 1.164 float scale = (float)w / image_width;
289     min_it (scale, (float)h / image_height);
290 sf-exg 1.62 w = image_width * scale + 0.5;
291     h = image_height * scale + 0.5;
292     }
293 sf-exg 1.59
294 sf-exg 1.68 if (!w) w = image_width;
295     if (!h) h = image_height;
296    
297 sf-exg 1.214 if (image.flags & IM_ROOT_ALIGN)
298 sf-exg 1.59 {
299 sf-exg 1.121 x = -target_x;
300     y = -target_y;
301 sf-exg 1.59 }
302 sf-exg 1.63 else
303     {
304 sf-exg 1.214 x = make_align_position (image.h_align, target_width, w);
305     y = make_align_position (image.v_align, target_height, h);
306 sf-exg 1.63 }
307 sf-exg 1.59 }
308    
309 sf-exg 1.127 bool
310 sf-exg 1.215 rxvt_term::render_image (rxvt_image &image)
311 sf-exg 1.55 {
312 sf-exg 1.142 int target_width = szHint.width;
313     int target_height = szHint.height;
314 sf-exg 1.55
315     int x = 0;
316     int y = 0;
317 sf-exg 1.59 int w = 0;
318     int h = 0;
319 sf-exg 1.55
320 sf-exg 1.214 get_image_geometry (image, w, h, x, y);
321 sf-exg 1.55
322 sf-exg 1.214 if (!(image.flags & IM_ROOT_ALIGN)
323 sf-exg 1.67 && (x >= target_width
324     || y >= target_height
325 sf-exg 1.172 || x + w <= 0
326     || y + h <= 0))
327 sf-exg 1.55 return false;
328    
329 sf-exg 1.236 rxvt_img *img = image.img->scale (w, h);
330 sf-exg 1.55
331 sf-exg 1.236 if (image.flags & IM_TILE)
332     img->repeat_mode (RepeatNormal);
333 sf-exg 1.152 else
334 sf-exg 1.236 img->repeat_mode (RepeatNone);
335     img->sub_rect (-x, -y, target_width, target_height)->replace (img);
336 sf-exg 1.154
337 sf-exg 1.236 if (bg_flags & BG_IS_VALID)
338 sf-exg 1.152 {
339 sf-exg 1.236 double factor = image.alpha * 1. / 0xffff;
340     bg_img->blend (img, factor)->replace (img);
341 sf-exg 1.152 }
342 sf-exg 1.79
343 sf-exg 1.236 XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual);
344     img->convert_format (format, pix_colors [Color_bg])->replace (img);
345 sf-exg 1.55
346 sf-exg 1.236 delete bg_img;
347     bg_img = img;
348 sf-exg 1.55
349 sf-exg 1.236 return true;
350 sf-exg 1.55 }
351    
352 sf-exg 1.220 rxvt_image::rxvt_image ()
353     {
354 sf-exg 1.224 alpha = 0xffff;
355     flags = 0;
356 sf-exg 1.220 h_scale =
357 sf-exg 1.224 v_scale = defaultScale;
358 sf-exg 1.220 h_align =
359 sf-exg 1.224 v_align = defaultAlign;
360 sf-exg 1.220
361 sf-exg 1.236 img = 0;
362 sf-exg 1.220 }
363    
364 sasha 1.1 bool
365 sf-exg 1.236 rxvt_image::set_file_geometry (rxvt_screen *s, const char *file)
366 sasha 1.1 {
367 sf-exg 1.107 if (!file || !*file)
368     return false;
369 sasha 1.1
370 sf-exg 1.167 const char *p = strchr (file, ';');
371    
372     if (p)
373 sasha 1.1 {
374 sf-exg 1.107 size_t len = p - file;
375     char *f = rxvt_temp_buf<char> (len + 1);
376     memcpy (f, file, len);
377     f[len] = '\0';
378     file = f;
379     }
380 root 1.25
381 sf-exg 1.236 bool ret = set_file (s, file);
382 sf-exg 1.220 alpha = 0x8000;
383 sf-exg 1.224 if (ret)
384     set_geometry (p ? p + 1 : "");
385 sf-exg 1.220 return ret;
386     }
387    
388     bool
389 sf-exg 1.236 rxvt_image::set_file (rxvt_screen *s, const char *file)
390 sf-exg 1.220 {
391 sf-exg 1.236 delete img;
392     img = rxvt_img::new_from_file (s, file);
393     return img != 0;
394 sasha 1.1 }
395    
396 ayin 1.12 # endif /* BG_IMAGE_FROM_FILE */
397 sasha 1.1
398 ayin 1.10 bool
399 sf-exg 1.226 image_effects::set_blur (const char *geom)
400 sasha 1.1 {
401 sf-exg 1.110 bool changed = false;
402 sasha 1.1 unsigned int hr, vr;
403     int junk;
404     int geom_flags = XParseGeometry (geom, &junk, &junk, &hr, &vr);
405    
406 sf-exg 1.52 if (!(geom_flags & WidthValue))
407 sasha 1.1 hr = 1;
408 sf-exg 1.52 if (!(geom_flags & HeightValue))
409 sasha 1.1 vr = hr;
410    
411 sf-exg 1.80 min_it (hr, 128);
412     min_it (vr, 128);
413    
414 sasha 1.1 if (h_blurRadius != hr)
415     {
416 sf-exg 1.110 changed = true;
417 sasha 1.1 h_blurRadius = hr;
418     }
419    
420     if (v_blurRadius != vr)
421     {
422 sf-exg 1.110 changed = true;
423 sasha 1.1 v_blurRadius = vr;
424     }
425 ayin 1.10
426 sf-exg 1.110 return changed;
427 sasha 1.1 }
428    
429     bool
430 sf-exg 1.226 image_effects::set_tint (const rxvt_color &new_tint)
431 sasha 1.1 {
432 sf-exg 1.226 if (!tint_set || tint != new_tint)
433 sasha 1.1 {
434     tint = new_tint;
435 sf-exg 1.226 tint_set = true;
436 sf-exg 1.203
437 sasha 1.1 return true;
438     }
439 root 1.20
440 sasha 1.1 return false;
441     }
442    
443     bool
444 sf-exg 1.226 image_effects::set_shade (const char *shade_str)
445 sasha 1.1 {
446 sf-exg 1.186 int new_shade = atoi (shade_str);
447 sasha 1.1
448 sf-exg 1.75 clamp_it (new_shade, -100, 200);
449     if (new_shade < 0)
450 root 1.20 new_shade = 200 - (100 + new_shade);
451 sasha 1.1
452     if (new_shade != shade)
453     {
454     shade = new_shade;
455     return true;
456     }
457 root 1.20
458 sasha 1.1 return false;
459     }
460    
461 root 1.232 # if ENABLE_TRANSPARENCY
462 sf-exg 1.149 /*
463 sf-exg 1.100 * Builds a pixmap of the same size as the terminal window that contains
464     * the tiled portion of the root pixmap that is supposed to be covered by
465 sasha 1.1 * our window.
466     */
467 sf-exg 1.202 bool
468 sf-exg 1.228 rxvt_term::render_root_image ()
469 sasha 1.1 {
470 sf-exg 1.39 /* root dimensions may change from call to call - but Display structure should
471 sasha 1.1 * be always up-to-date, so let's use it :
472     */
473 sf-exg 1.142 int screen = display->screen;
474 sasha 1.1 int root_width = DisplayWidth (dpy, screen);
475     int root_height = DisplayHeight (dpy, screen);
476 sf-exg 1.142 int window_width = szHint.width;
477     int window_height = szHint.height;
478 sasha 1.1 int sx, sy;
479    
480 sf-exg 1.121 sx = target_x;
481     sy = target_y;
482 sasha 1.1
483 sf-exg 1.236 if (!root_img)
484     return false;
485    
486 sasha 1.1 /* check if we are outside of the visible part of the virtual screen : */
487     if (sx + window_width <= 0 || sy + window_height <= 0
488     || sx >= root_width || sy >= root_height)
489     return 0;
490    
491 sf-exg 1.236 while (sx < 0) sx += root_img->w;
492     while (sy < 0) sy += root_img->h;
493 sf-exg 1.103
494 sf-exg 1.236 rxvt_img *img = root_img->sub_rect (sx, sy, window_width, window_height);
495 sf-exg 1.103
496 sf-exg 1.236 if (root_effects.need_blur ())
497     img->blur (root_effects.h_blurRadius, root_effects.v_blurRadius)->replace (img);
498 sf-exg 1.103
499 sf-exg 1.236 if (root_effects.need_tint ())
500     tint_image (img, root_effects.tint, root_effects.tint_set, root_effects.shade);
501 sf-exg 1.103
502 sf-exg 1.236 XRenderPictFormat *format = XRenderFindVisualFormat (dpy, visual);
503     img->convert_format (format, pix_colors [Color_bg])->replace (img);
504 sf-exg 1.103
505 sf-exg 1.236 delete bg_img;
506     bg_img = img;
507 sf-exg 1.152
508 sf-exg 1.236 return true;
509 sasha 1.1 }
510    
511 sf-exg 1.98 void
512 sf-exg 1.142 rxvt_term::bg_set_root_pixmap ()
513 sasha 1.1 {
514 sf-exg 1.236 delete root_img;
515     root_img = rxvt_img::new_from_root (this);
516 sasha 1.1 }
517     # endif /* ENABLE_TRANSPARENCY */
518    
519 sf-exg 1.234 void
520 sf-exg 1.142 rxvt_term::bg_render ()
521 sasha 1.1 {
522 sf-exg 1.235 if (bg_flags & BG_INHIBIT_RENDER)
523     return;
524    
525 sf-exg 1.142 bg_invalidate ();
526 root 1.232 # if ENABLE_TRANSPARENCY
527 sf-exg 1.143 if (bg_flags & BG_IS_TRANSPARENT)
528 sasha 1.1 {
529     /* we need to re-generate transparency pixmap in that case ! */
530 sf-exg 1.228 if (render_root_image ())
531 sf-exg 1.199 bg_flags |= BG_IS_VALID;
532 sasha 1.1 }
533     # endif
534    
535 root 1.232 # if BG_IMAGE_FROM_FILE
536 sf-exg 1.236 if (fimage.img)
537 sasha 1.1 {
538 sf-exg 1.233 if (render_image (fimage))
539 sf-exg 1.143 bg_flags |= BG_IS_VALID;
540 sasha 1.1 }
541 sf-exg 1.46 # endif
542 sasha 1.7
543 sf-exg 1.143 if (!(bg_flags & BG_IS_VALID))
544 sasha 1.1 {
545 sf-exg 1.236 delete bg_img;
546     bg_img = 0;
547 sasha 1.1 }
548    
549 sf-exg 1.142 scr_recolour (false);
550 sf-exg 1.143 bg_flags |= BG_NEEDS_REFRESH;
551 sasha 1.1
552 sf-exg 1.142 bg_valid_since = ev::now ();
553 sasha 1.1 }
554    
555 sf-exg 1.106 void
556 sf-exg 1.142 rxvt_term::bg_init ()
557 sasha 1.1 {
558 root 1.232 #if BG_IMAGE_FROM_FILE
559 sf-exg 1.220 if (rs[Rs_backgroundPixmap])
560     {
561 sf-exg 1.236 if (fimage.set_file_geometry (this, rs[Rs_backgroundPixmap])
562 sf-exg 1.233 && !bg_window_position_sensitive ())
563     update_background ();
564 sf-exg 1.220 }
565     #endif
566 sasha 1.1 }
567    
568 sf-exg 1.183 void
569 sf-exg 1.236 rxvt_term::tint_image (rxvt_img *img, rxvt_color &tint, bool tint_set, int shade)
570 sasha 1.1 {
571 sf-exg 1.194 rgba c (rgba::MAX_CC, rgba::MAX_CC, rgba::MAX_CC);
572 sf-exg 1.183
573 sf-exg 1.226 if (tint_set)
574 sf-exg 1.194 tint.get (c);
575 sf-exg 1.183
576 sf-exg 1.87 if (shade > 100)
577     {
578 sf-exg 1.184 c.r = c.r * (200 - shade) / 100;
579     c.g = c.g * (200 - shade) / 100;
580     c.b = c.b * (200 - shade) / 100;
581 sf-exg 1.87 }
582     else
583     {
584 sf-exg 1.184 c.r = c.r * shade / 100;
585     c.g = c.g * shade / 100;
586     c.b = c.b * shade / 100;
587 sf-exg 1.87 }
588 sasha 1.1
589 sf-exg 1.236 img->contrast (c.r, c.g, c.b, c.a);
590 sasha 1.1
591 sf-exg 1.236 if (shade > 100)
592 sf-exg 1.93 {
593 sf-exg 1.236 c.a = 0xffff;
594     c.r =
595     c.g =
596     c.b = 0xffff * (shade - 100) / 100;
597     img->brightness (c.r, c.g, c.b, c.a);
598 sasha 1.1 }
599     }
600 sf-exg 1.226
601     #endif /* HAVE_BG_PIXMAP */