9 # include <afterimage.h>
14 #if defined(BG_IMAGE_FROM_FILE) || defined(ENABLE_TRANSPARENCY)
15 # define HAVE_BG_PIXMAP 1/* to simplify further usage */
21 geometrySet = (1UL<<0),
23 geometryFlags = (geometrySet|propScale),
26 tintNeeded = (1UL<<9),
27 tintWholesome = (1UL<<10),
28 tintServerSide = (1UL<<11),
29 tintFlags = (tintSet|tintServerSide|tintNeeded|tintWholesome),
30 blurNeeded = (1UL<<12),
31 blurServerSide = (1UL<<13), /* this don't work yet */
33 isTransparent = (1UL<<16),
34 isInvalid = (1UL<<17),
35 isVtOrigin = (1UL<<18), /* if set pixmap has origin at corner of
36 vt window instead of parent[0]! */
37 hasChanged = (1UL<<19)
43 transpPmapTiled = (1UL<<0),
44 transpPmapTinted = tintNeeded,
45 transpPmapBlured = blurNeeded,
46 transpTransformations = (tintNeeded|blurNeeded)
47 }; /* this flags are returned by make_transparency_pixmap if called */
49 bool check_clearChanged () { bool r = flags & hasChanged; flags &= ~hasChanged; return r; };
51 # ifdef BG_IMAGE_FROM_FILE
52 # ifdef HAVE_AFTERIMAGE
53 ASImage *original_asim;
54 bool render_asim (ASImage *background, ARGB32 background_tint);
57 enum { defaultScale = 100, defaultAlign = 50 };
59 unsigned int h_scale, v_scale;/* percents of the window size */
60 int h_align, v_align; /* percents of the window size:
61 0 - left align, 50 - center, 100 - right */
62 void unset_geometry () { flags = flags & ~geometryFlags; };
63 bool set_geometry (const char *geom);
64 void set_defaultGeometry ()
66 h_scale = v_scale = defaultScale;
67 h_align = v_align = defaultAlign;
71 bool set_file (const char *file);
72 # endif /* BG_IMAGE_FROM_FILE */
75 bool set_target (rxvt_term *new_target);
77 # ifdef ENABLE_TRANSPARENCY
78 int root_depth; /* obtained when target is set */
79 Pixmap root_pixmap; /* current root pixmap set */
82 int h_blurRadius, v_blurRadius;
84 bool set_transparent ();
85 bool set_blur_radius (const char *geom);
86 bool set_tint (rxvt_color &new_tint);
88 bool set_shade (const char *shade_str);
89 bool set_root_pixmap ();
91 unsigned long make_transparency_pixmap ();/* returns combination of the transpTransformations flags */
96 unsigned int pmap_width, pmap_height;
97 unsigned int pmap_depth;
99 bool window_size_sensitive ();
100 bool window_position_sensitive () {
101 return (flags & isTransparent);
104 bool is_parentOrigin () {
105 return !(flags & isVtOrigin);
108 bool need_client_side_rendering ();
112 if (!(flags & isInvalid))
115 invalid_since = ev::now ();
120 # undef HAVE_BG_PIXMAP
125 #endif /* _BACKGROUND_H_ */