… | |
… | |
70 | #include <X11/cursorfont.h> |
70 | #include <X11/cursorfont.h> |
71 | #include <X11/keysym.h> |
71 | #include <X11/keysym.h> |
72 | #include <X11/keysymdef.h> |
72 | #include <X11/keysymdef.h> |
73 | #include <X11/Xatom.h> |
73 | #include <X11/Xatom.h> |
74 | |
74 | |
75 | #ifdef HAVE_PIXBUF |
75 | #if HAVE_PIXBUF |
76 | # include <gdk-pixbuf/gdk-pixbuf.h> |
76 | # include <gdk-pixbuf/gdk-pixbuf.h> |
77 | #endif |
77 | #endif |
78 | |
78 | |
79 | #if defined(BG_IMAGE_FROM_FILE) || defined(ENABLE_TRANSPARENCY) |
79 | #if defined(BG_IMAGE_FROM_FILE) || defined(ENABLE_TRANSPARENCY) |
80 | # define HAVE_BG_PIXMAP 1 |
80 | # define HAVE_BG_PIXMAP 1 |
… | |
… | |
240 | bool set_tint (const rxvt_color &new_tint); |
240 | bool set_tint (const rxvt_color &new_tint); |
241 | bool set_shade (const char *shade_str); |
241 | bool set_shade (const char *shade_str); |
242 | bool set_blur (const char *geom); |
242 | bool set_blur (const char *geom); |
243 | }; |
243 | }; |
244 | |
244 | |
245 | # ifdef BG_IMAGE_FROM_FILE |
245 | # if BG_IMAGE_FROM_FILE |
246 | enum { |
246 | enum { |
247 | IM_IS_SET = 1 << 0, |
247 | IM_IS_SET = 1 << 0, |
248 | IM_IS_SIZE_SENSITIVE = 1 << 1, |
248 | IM_IS_SIZE_SENSITIVE = 1 << 1, |
249 | IM_KEEP_ASPECT = 1 << 2, |
249 | IM_KEEP_ASPECT = 1 << 2, |
250 | IM_ROOT_ALIGN = 1 << 3, |
250 | IM_ROOT_ALIGN = 1 << 3, |
… | |
… | |
273 | return (!(flags & IM_TILE) |
273 | return (!(flags & IM_TILE) |
274 | || h_scale || v_scale |
274 | || h_scale || v_scale |
275 | || (!(flags & IM_ROOT_ALIGN) && (h_align || v_align))); |
275 | || (!(flags & IM_ROOT_ALIGN) && (h_align || v_align))); |
276 | } |
276 | } |
277 | |
277 | |
278 | # ifdef HAVE_PIXBUF |
278 | # if HAVE_PIXBUF |
279 | GdkPixbuf *pixbuf; |
279 | GdkPixbuf *pixbuf; |
280 | |
280 | |
281 | void destroy () |
281 | void destroy () |
282 | { |
282 | { |
283 | if (pixbuf) |
283 | if (pixbuf) |
… | |
… | |
351 | ***************************************************************************** |
351 | ***************************************************************************** |
352 | */ |
352 | */ |
353 | |
353 | |
354 | /* COLORTERM, TERM environment variables */ |
354 | /* COLORTERM, TERM environment variables */ |
355 | #define COLORTERMENV "rxvt" |
355 | #define COLORTERMENV "rxvt" |
356 | #ifdef BG_IMAGE_FROM_FILE |
356 | #if BG_IMAGE_FROM_FILE |
357 | # define COLORTERMENVFULL COLORTERMENV "-xpm" |
357 | # define COLORTERMENVFULL COLORTERMENV "-xpm" |
358 | #else |
358 | #else |
359 | # define COLORTERMENVFULL COLORTERMENV |
359 | # define COLORTERMENVFULL COLORTERMENV |
360 | #endif |
360 | #endif |
361 | #ifndef TERMENV |
361 | #ifndef TERMENV |
… | |
… | |
1196 | BG_NEEDS_REFRESH = 1 << 2, |
1196 | BG_NEEDS_REFRESH = 1 << 2, |
1197 | }; |
1197 | }; |
1198 | |
1198 | |
1199 | uint8_t bg_flags; |
1199 | uint8_t bg_flags; |
1200 | |
1200 | |
1201 | # ifdef BG_IMAGE_FROM_FILE |
1201 | # if BG_IMAGE_FROM_FILE |
1202 | vector<rxvt_image> image_vec; |
1202 | vector<rxvt_image> image_vec; |
1203 | rxvt_image *new_image () |
1203 | rxvt_image *new_image () |
1204 | { |
1204 | { |
1205 | image_vec.resize (image_vec.size () + 1); |
1205 | image_vec.resize (image_vec.size () + 1); |
1206 | return &image_vec.back (); |
1206 | return &image_vec.back (); |
… | |
… | |
1208 | void get_image_geometry (rxvt_image &image, int &w, int &h, int &x, int &y); |
1208 | void get_image_geometry (rxvt_image &image, int &w, int &h, int &x, int &y); |
1209 | bool render_image (rxvt_image &image); |
1209 | bool render_image (rxvt_image &image); |
1210 | void parse_image (int id, const char *type, const char *arg); |
1210 | void parse_image (int id, const char *type, const char *arg); |
1211 | # endif |
1211 | # endif |
1212 | |
1212 | |
1213 | # ifdef ENABLE_TRANSPARENCY |
1213 | # if ENABLE_TRANSPARENCY |
1214 | Pixmap root_pixmap; /* current root pixmap set */ |
1214 | Pixmap root_pixmap; /* current root pixmap set */ |
1215 | image_effects root_effects; |
1215 | image_effects root_effects; |
1216 | |
1216 | |
1217 | void bg_set_transparent () |
1217 | void bg_set_transparent () |
1218 | { |
1218 | { |
… | |
… | |
1241 | void bg_invalidate () |
1241 | void bg_invalidate () |
1242 | { |
1242 | { |
1243 | bg_flags &= ~BG_IS_VALID; |
1243 | bg_flags &= ~BG_IS_VALID; |
1244 | } |
1244 | } |
1245 | #endif |
1245 | #endif |
1246 | #ifdef HAVE_PIXBUF |
1246 | #if HAVE_PIXBUF |
1247 | bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, |
1247 | bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, |
1248 | int src_x, int src_y, int dst_x, int dst_y, |
1248 | int src_x, int src_y, int dst_x, int dst_y, |
1249 | unsigned int width, unsigned int height, bool argb); |
1249 | unsigned int width, unsigned int height, bool argb); |
1250 | #endif |
1250 | #endif |
1251 | |
1251 | |