ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/background.C
(Generate patch)

Comparing rxvt-unicode/src/background.C (file contents):
Revision 1.127 by sf-exg, Thu Dec 2 11:02:16 2010 UTC vs.
Revision 1.132 by sf-exg, Mon Jan 10 20:46:20 2011 UTC

175# endif 175# endif
176 176
177 return false; 177 return false;
178} 178}
179 179
180bool bgPixmap_t::need_client_side_rendering ()
181{
182# ifdef HAVE_AFTERIMAGE
183 if (original_asim)
184 return true;
185# endif
186 return false;
187}
188
189# ifdef BG_IMAGE_FROM_FILE 180# ifdef BG_IMAGE_FROM_FILE
190static inline bool 181static inline bool
191check_set_scale_value (int geom_flags, int flag, unsigned int &scale, unsigned int new_value) 182check_set_scale_value (int geom_flags, int flag, unsigned int &scale, unsigned int new_value)
192{ 183{
193 if (geom_flags & flag) 184 if (geom_flags & flag)
307 geom_flags |= WidthValue|HeightValue|XValue|YValue; 298 geom_flags |= WidthValue|HeightValue|XValue|YValue;
308 } 299 }
309 300
310 if (ops) 301 if (ops)
311 { 302 {
312 while (*ops) 303 char **arr = rxvt_strsplit (':', ops + 1);
313 {
314 while (*ops == ':' || isspace(*ops)) ++ops;
315 304
305 for (int i = 0; arr[i]; i++)
306 {
316# define CHECK_GEOM_OPS(op_str) (strncasecmp (ops, (op_str), sizeof (op_str) - 1) == 0) 307# define CHECK_GEOM_OPS(op_str) (strcasecmp (arr[i], (op_str)) == 0)
317 if (CHECK_GEOM_OPS ("tile")) 308 if (CHECK_GEOM_OPS ("tile"))
318 { 309 {
319 w = h = noScale; 310 w = h = noScale;
320 geom_flags |= WidthValue|HeightValue; 311 geom_flags |= WidthValue|HeightValue;
321 } 312 }
355 new_flags |= rootAlign; 346 new_flags |= rootAlign;
356 w = h = noScale; 347 w = h = noScale;
357 geom_flags |= WidthValue|HeightValue; 348 geom_flags |= WidthValue|HeightValue;
358 } 349 }
359# undef CHECK_GEOM_OPS 350# undef CHECK_GEOM_OPS
360
361 while (*ops != ':' && *ops != '\0') ++ops;
362 } /* done parsing ops */ 351 } /* done parsing ops */
352
353 rxvt_free_strsplit (arr);
363 } 354 }
364 355
365 if (check_set_scale_value (geom_flags, WidthValue, h_scale, w)) changed = true; 356 if (check_set_scale_value (geom_flags, WidthValue, h_scale, w)) changed = true;
366 if (check_set_scale_value (geom_flags, HeightValue, v_scale, h)) changed = true; 357 if (check_set_scale_value (geom_flags, HeightValue, v_scale, h)) changed = true;
367 if (check_set_align_value (geom_flags, XValue, h_align, x)) changed = true; 358 if (check_set_align_value (geom_flags, XValue, h_align, x)) changed = true;
708 { 699 {
709 free (data); 700 free (data);
710 return false; 701 return false;
711 } 702 }
712 703
713 ximage->byte_order = byteorder.big_endian () ? MSBFirst : LSBFirst; 704 ximage->byte_order = byteorder::big_endian () ? MSBFirst : LSBFirst;
714 705
715 rowstride = gdk_pixbuf_get_rowstride (pixbuf); 706 rowstride = gdk_pixbuf_get_rowstride (pixbuf);
716 channels = gdk_pixbuf_get_n_channels (pixbuf); 707 channels = gdk_pixbuf_get_n_channels (pixbuf);
717 row = gdk_pixbuf_get_pixels (pixbuf) + src_y * rowstride + src_x * channels; 708 row = gdk_pixbuf_get_pixels (pixbuf) + src_y * rowstride + src_x * channels;
718 line = data; 709 line = data;
940 if (image) 931 if (image)
941 { 932 {
942 if (original_asim) 933 if (original_asim)
943 safe_asimage_destroy (original_asim); 934 safe_asimage_destroy (original_asim);
944 original_asim = image; 935 original_asim = image;
936 flags |= CLIENT_RENDER;
945 have_image = true; 937 have_image = true;
946 return true; 938 return true;
947 } 939 }
948# endif 940# endif
949 941
1044 if (!(flags & tintSet) || tint != new_tint) 1036 if (!(flags & tintSet) || tint != new_tint)
1045 { 1037 {
1046 unsigned long new_flags = compute_tint_shade_flags (&new_tint, shade); 1038 unsigned long new_flags = compute_tint_shade_flags (&new_tint, shade);
1047 tint = new_tint; 1039 tint = new_tint;
1048 flags = (flags & ~tintFlags) | new_flags | tintSet; 1040 flags = (flags & ~tintFlags) | new_flags | tintSet;
1049 return true;
1050 }
1051
1052 return false;
1053}
1054
1055bool
1056bgPixmap_t::unset_tint ()
1057{
1058 unsigned long new_flags = compute_tint_shade_flags (NULL, shade);
1059
1060 if (new_flags != (flags & tintFlags))
1061 {
1062 flags = (flags & ~tintFlags) | new_flags;
1063 return true; 1041 return true;
1064 } 1042 }
1065 1043
1066 return false; 1044 return false;
1067} 1045}
1377 { 1355 {
1378 XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height); 1356 XFillRectangle (dpy, tiled_root_pmap, gc, 0, 0, window_width, window_height);
1379 result |= transpPmapTiled; 1357 result |= transpPmapTiled;
1380 XFreeGC (dpy, gc); 1358 XFreeGC (dpy, gc);
1381 1359
1382 if (!need_client_side_rendering ()) 1360 if (!(flags & CLIENT_RENDER))
1383 { 1361 {
1384 if ((flags & blurNeeded) 1362 if ((flags & blurNeeded)
1385 && (flags & HAS_RENDER_CONV)) 1363 && (flags & HAS_RENDER_CONV))
1386 { 1364 {
1387 if (blur_pixmap (tiled_root_pmap, target->visual, window_width, window_height)) 1365 if (blur_pixmap (tiled_root_pmap, target->visual, window_width, window_height))
1413} 1391}
1414 1392
1415void 1393void
1416bgPixmap_t::set_root_pixmap () 1394bgPixmap_t::set_root_pixmap ()
1417{ 1395{
1418 Pixmap new_root_pixmap = target->get_pixmap_property (XA_XROOTPMAP_ID); 1396 Pixmap new_root_pixmap = target->get_pixmap_property (target->xa[XA_XROOTPMAP_ID]);
1419 if (new_root_pixmap == None) 1397 if (new_root_pixmap == None)
1420 new_root_pixmap = target->get_pixmap_property (XA_ESETROOT_PMAP_ID); 1398 new_root_pixmap = target->get_pixmap_property (target->xa[XA_ESETROOT_PMAP_ID]);
1421 1399
1422 root_pixmap = new_root_pixmap; 1400 root_pixmap = new_root_pixmap;
1423} 1401}
1424# endif /* ENABLE_TRANSPARENCY */ 1402# endif /* ENABLE_TRANSPARENCY */
1425 1403
1594 uint32_t mask_r, mask_g, mask_b; 1572 uint32_t mask_r, mask_g, mask_b;
1595 uint32_t *lookup, *lookup_r, *lookup_g, *lookup_b; 1573 uint32_t *lookup, *lookup_r, *lookup_g, *lookup_b;
1596 rgba low; 1574 rgba low;
1597 rgba high; 1575 rgba high;
1598 int i; 1576 int i;
1599 int host_byte_order = byteorder.big_endian () ? MSBFirst : LSBFirst; 1577 int host_byte_order = byteorder::big_endian () ? MSBFirst : LSBFirst;
1600 1578
1601 if (visual->c_class != TrueColor || ximage->format != ZPixmap) return; 1579 if (visual->c_class != TrueColor || ximage->format != ZPixmap) return;
1602 1580
1603 /* for convenience */ 1581 /* for convenience */
1604 mask_r = visual->red_mask; 1582 mask_r = visual->red_mask;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines