… | |
… | |
254 | } |
254 | } |
255 | |
255 | |
256 | bool |
256 | bool |
257 | bgPixmap_t::set_geometry (const char *geom) |
257 | bgPixmap_t::set_geometry (const char *geom) |
258 | { |
258 | { |
|
|
259 | bool changed = false; |
259 | int geom_flags = 0, changed = 0; |
260 | int geom_flags = 0; |
260 | int x = 0, y = 0; |
261 | int x = 0, y = 0; |
261 | unsigned int w = 0, h = 0; |
262 | unsigned int w = 0, h = 0; |
262 | unsigned int n; |
263 | unsigned int n; |
263 | unsigned long new_flags = (flags & (~geometryFlags)); |
264 | unsigned long new_flags = (flags & (~geometryFlags)); |
264 | const char *p; |
265 | const char *p; |
… | |
… | |
420 | |
421 | |
421 | while (*ops != ':' && *ops != '\0') ++ops; |
422 | while (*ops != ':' && *ops != '\0') ++ops; |
422 | } /* done parsing ops */ |
423 | } /* done parsing ops */ |
423 | } |
424 | } |
424 | |
425 | |
425 | if (check_set_scale_value (geom_flags, WidthValue, h_scale, w)) ++changed; |
426 | if (check_set_scale_value (geom_flags, WidthValue, h_scale, w)) changed = true; |
426 | if (check_set_scale_value (geom_flags, HeightValue, v_scale, h)) ++changed; |
427 | if (check_set_scale_value (geom_flags, HeightValue, v_scale, h)) changed = true; |
427 | if (check_set_align_value (geom_flags, XValue, h_align, x)) ++changed; |
428 | if (check_set_align_value (geom_flags, XValue, h_align, x)) changed = true; |
428 | if (check_set_align_value (geom_flags, YValue, v_align, y)) ++changed; |
429 | if (check_set_align_value (geom_flags, YValue, v_align, y)) changed = true; |
429 | } |
430 | } |
430 | |
431 | |
431 | if (new_flags != flags) |
432 | if (new_flags != flags) |
432 | { |
433 | { |
433 | flags = new_flags; |
434 | flags = new_flags; |
434 | changed++; |
435 | changed = true; |
435 | } |
436 | } |
436 | |
437 | |
437 | return (changed > 0); |
438 | return changed; |
438 | } |
439 | } |
439 | |
440 | |
440 | void |
441 | void |
441 | bgPixmap_t::get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y) |
442 | bgPixmap_t::get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y) |
442 | { |
443 | { |
… | |
… | |
971 | } |
972 | } |
972 | |
973 | |
973 | bool |
974 | bool |
974 | bgPixmap_t::set_blur_radius (const char *geom) |
975 | bgPixmap_t::set_blur_radius (const char *geom) |
975 | { |
976 | { |
976 | int changed = 0; |
977 | bool changed = false; |
977 | unsigned int hr, vr; |
978 | unsigned int hr, vr; |
978 | int junk; |
979 | int junk; |
979 | int geom_flags = XParseGeometry (geom, &junk, &junk, &hr, &vr); |
980 | int geom_flags = XParseGeometry (geom, &junk, &junk, &hr, &vr); |
980 | |
981 | |
981 | if (!(geom_flags & WidthValue)) |
982 | if (!(geom_flags & WidthValue)) |
… | |
… | |
986 | min_it (hr, 128); |
987 | min_it (hr, 128); |
987 | min_it (vr, 128); |
988 | min_it (vr, 128); |
988 | |
989 | |
989 | if (h_blurRadius != hr) |
990 | if (h_blurRadius != hr) |
990 | { |
991 | { |
991 | ++changed; |
992 | changed = true; |
992 | h_blurRadius = hr; |
993 | h_blurRadius = hr; |
993 | } |
994 | } |
994 | |
995 | |
995 | if (v_blurRadius != vr) |
996 | if (v_blurRadius != vr) |
996 | { |
997 | { |
997 | ++changed; |
998 | changed = true; |
998 | v_blurRadius = vr; |
999 | v_blurRadius = vr; |
999 | } |
1000 | } |
1000 | |
1001 | |
1001 | if (v_blurRadius == 0 && h_blurRadius == 0) |
1002 | if (v_blurRadius == 0 && h_blurRadius == 0) |
1002 | flags &= ~blurNeeded; |
1003 | flags &= ~blurNeeded; |
1003 | else |
1004 | else |
1004 | flags |= blurNeeded; |
1005 | flags |= blurNeeded; |
1005 | |
1006 | |
1006 | return (changed > 0); |
1007 | return changed; |
1007 | } |
1008 | } |
1008 | |
1009 | |
1009 | static inline unsigned long |
1010 | static inline unsigned long |
1010 | compute_tint_shade_flags (rxvt_color *tint, int shade) |
1011 | compute_tint_shade_flags (rxvt_color *tint, int shade) |
1011 | { |
1012 | { |