… | |
… | |
209 | environ = orig_env; |
209 | environ = orig_env; |
210 | } |
210 | } |
211 | }; |
211 | }; |
212 | |
212 | |
213 | #ifdef HAVE_BG_PIXMAP |
213 | #ifdef HAVE_BG_PIXMAP |
|
|
214 | struct image_effects |
|
|
215 | { |
|
|
216 | bool tint_set; |
|
|
217 | rxvt_color tint; |
|
|
218 | int shade; |
|
|
219 | int h_blurRadius, v_blurRadius; |
|
|
220 | |
|
|
221 | image_effects () |
|
|
222 | { |
|
|
223 | tint_set = |
|
|
224 | h_blurRadius = |
|
|
225 | v_blurRadius = 0; |
|
|
226 | shade = 100; |
|
|
227 | } |
|
|
228 | |
|
|
229 | bool need_tint () |
|
|
230 | { |
|
|
231 | return shade != 100 || tint_set; |
|
|
232 | } |
|
|
233 | |
|
|
234 | bool need_blur () |
|
|
235 | { |
|
|
236 | return h_blurRadius && v_blurRadius; |
|
|
237 | } |
|
|
238 | |
|
|
239 | bool set_tint (const rxvt_color &new_tint); |
|
|
240 | bool set_shade (const char *shade_str); |
|
|
241 | bool set_blur (const char *geom); |
|
|
242 | }; |
|
|
243 | |
214 | # ifdef BG_IMAGE_FROM_FILE |
244 | # ifdef BG_IMAGE_FROM_FILE |
215 | enum { |
245 | enum { |
216 | IM_IS_SET = 1 << 0, |
246 | IM_IS_SET = 1 << 0, |
217 | IM_IS_SIZE_SENSITIVE = 1 << 1, |
247 | IM_IS_SIZE_SENSITIVE = 1 << 1, |
218 | IM_KEEP_ASPECT = 1 << 2, |
248 | IM_KEEP_ASPECT = 1 << 2, |
… | |
… | |
227 | defaultScale = windowScale, |
257 | defaultScale = windowScale, |
228 | centerAlign = 50, |
258 | centerAlign = 50, |
229 | defaultAlign = centerAlign, |
259 | defaultAlign = centerAlign, |
230 | }; |
260 | }; |
231 | |
261 | |
232 | struct rxvt_image |
262 | struct rxvt_image : image_effects |
233 | { |
263 | { |
234 | unsigned short alpha; |
264 | unsigned short alpha; |
235 | uint8_t flags; |
265 | uint8_t flags; |
236 | unsigned int h_scale, v_scale; /* percents of the window size */ |
266 | unsigned int h_scale, v_scale; /* percents of the window size */ |
237 | int h_align, v_align; /* percents of the window size: |
267 | int h_align, v_align; /* percents of the window size: |
… | |
… | |
1165 | BG_NEEDS_REFRESH = 1 << 2, |
1195 | BG_NEEDS_REFRESH = 1 << 2, |
1166 | |
1196 | |
1167 | BG_HAS_RENDER = 1 << 3, |
1197 | BG_HAS_RENDER = 1 << 3, |
1168 | BG_HAS_RENDER_CONV = 1 << 4, |
1198 | BG_HAS_RENDER_CONV = 1 << 4, |
1169 | BG_CLIENT_RENDER = 1 << 5, |
1199 | BG_CLIENT_RENDER = 1 << 5, |
1170 | |
|
|
1171 | BG_TINT_SET = 1 << 6, |
|
|
1172 | BG_TINT_BITAND = 1 << 7, |
|
|
1173 | }; |
1200 | }; |
1174 | |
1201 | |
1175 | uint8_t bg_flags; |
1202 | uint8_t bg_flags; |
1176 | |
1203 | |
1177 | # ifdef BG_IMAGE_FROM_FILE |
1204 | # ifdef BG_IMAGE_FROM_FILE |
… | |
… | |
1186 | void parse_image (int id, const char *type, const char *arg); |
1213 | void parse_image (int id, const char *type, const char *arg); |
1187 | # endif |
1214 | # endif |
1188 | |
1215 | |
1189 | # ifdef ENABLE_TRANSPARENCY |
1216 | # ifdef ENABLE_TRANSPARENCY |
1190 | Pixmap root_pixmap; /* current root pixmap set */ |
1217 | Pixmap root_pixmap; /* current root pixmap set */ |
1191 | rxvt_color tint; |
1218 | image_effects root_effects; |
1192 | int shade; |
|
|
1193 | int h_blurRadius, v_blurRadius; |
|
|
1194 | |
1219 | |
1195 | void bg_set_transparent () |
1220 | void bg_set_transparent () |
1196 | { |
1221 | { |
1197 | bg_flags |= BG_IS_TRANSPARENT; |
1222 | bg_flags |= BG_IS_TRANSPARENT; |
1198 | } |
1223 | } |
1199 | void bg_set_root_pixmap (); |
1224 | void bg_set_root_pixmap (); |
1200 | bool bg_set_tint (rxvt_color &new_tint); |
|
|
1201 | bool bg_set_shade (const char *shade_str); |
|
|
1202 | bool bg_set_blur (const char *geom); |
|
|
1203 | |
|
|
1204 | bool blur_pixmap (Pixmap pixmap, int width, int height); |
|
|
1205 | bool tint_pixmap (Pixmap pixmap, int width, int height); |
|
|
1206 | void tint_ximage (XImage *ximage); |
|
|
1207 | bool make_transparency_pixmap (); |
1225 | bool make_transparency_pixmap (); |
1208 | # endif |
1226 | # endif |
|
|
1227 | |
|
|
1228 | bool blur_pixmap (Pixmap pixmap, int width, int height, bool argb, int h_blurRadius, int v_blurRadius); |
|
|
1229 | bool tint_pixmap (Pixmap pixmap, int width, int height, bool argb, rxvt_color &tint, bool tint_set, int shade); |
|
|
1230 | void tint_ximage (XImage *ximage, rxvt_color &tint, bool tint_set, int shade); |
1209 | |
1231 | |
1210 | ev_tstamp bg_valid_since; |
1232 | ev_tstamp bg_valid_since; |
1211 | |
1233 | |
1212 | Pixmap bg_pixmap; |
1234 | Pixmap bg_pixmap; |
1213 | unsigned int bg_pmap_width, bg_pmap_height; |
1235 | unsigned int bg_pmap_width, bg_pmap_height; |