… | |
… | |
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 |
… | |
… | |
83 | #include <ecb.h> |
83 | #include <ecb.h> |
84 | #include "encoding.h" |
84 | #include "encoding.h" |
85 | #include "rxvtutil.h" |
85 | #include "rxvtutil.h" |
86 | #include "rxvtfont.h" |
86 | #include "rxvtfont.h" |
87 | #include "rxvttoolkit.h" |
87 | #include "rxvttoolkit.h" |
|
|
88 | #include "rxvtimg.h" |
88 | #include "scrollbar.h" |
89 | #include "scrollbar.h" |
89 | #include "ev_cpp.h" |
90 | #include "ev_cpp.h" |
90 | #include "libptytty.h" |
91 | #include "libptytty.h" |
91 | |
92 | |
92 | #include "rxvtperl.h" |
93 | #include "rxvtperl.h" |
… | |
… | |
239 | bool set_tint (const rxvt_color &new_tint); |
240 | bool set_tint (const rxvt_color &new_tint); |
240 | bool set_shade (const char *shade_str); |
241 | bool set_shade (const char *shade_str); |
241 | bool set_blur (const char *geom); |
242 | bool set_blur (const char *geom); |
242 | }; |
243 | }; |
243 | |
244 | |
244 | # ifdef BG_IMAGE_FROM_FILE |
245 | # if BG_IMAGE_FROM_FILE |
245 | enum { |
246 | enum { |
246 | IM_IS_SET = 1 << 0, |
247 | IM_IS_SET = 1 << 0, |
247 | IM_IS_SIZE_SENSITIVE = 1 << 1, |
248 | IM_IS_SIZE_SENSITIVE = 1 << 1, |
248 | IM_KEEP_ASPECT = 1 << 2, |
249 | IM_KEEP_ASPECT = 1 << 2, |
249 | IM_ROOT_ALIGN = 1 << 3, |
250 | IM_ROOT_ALIGN = 1 << 3, |
… | |
… | |
272 | return (!(flags & IM_TILE) |
273 | return (!(flags & IM_TILE) |
273 | || h_scale || v_scale |
274 | || h_scale || v_scale |
274 | || (!(flags & IM_ROOT_ALIGN) && (h_align || v_align))); |
275 | || (!(flags & IM_ROOT_ALIGN) && (h_align || v_align))); |
275 | } |
276 | } |
276 | |
277 | |
277 | # ifdef HAVE_PIXBUF |
278 | # if HAVE_PIXBUF |
278 | GdkPixbuf *pixbuf; |
279 | GdkPixbuf *pixbuf; |
279 | |
280 | |
280 | void destroy () |
281 | void destroy () |
281 | { |
282 | { |
282 | if (pixbuf) |
283 | if (pixbuf) |
… | |
… | |
350 | ***************************************************************************** |
351 | ***************************************************************************** |
351 | */ |
352 | */ |
352 | |
353 | |
353 | /* COLORTERM, TERM environment variables */ |
354 | /* COLORTERM, TERM environment variables */ |
354 | #define COLORTERMENV "rxvt" |
355 | #define COLORTERMENV "rxvt" |
355 | #ifdef BG_IMAGE_FROM_FILE |
356 | #if BG_IMAGE_FROM_FILE |
356 | # define COLORTERMENVFULL COLORTERMENV "-xpm" |
357 | # define COLORTERMENVFULL COLORTERMENV "-xpm" |
357 | #else |
358 | #else |
358 | # define COLORTERMENVFULL COLORTERMENV |
359 | # define COLORTERMENVFULL COLORTERMENV |
359 | #endif |
360 | #endif |
360 | #ifndef TERMENV |
361 | #ifndef TERMENV |
… | |
… | |
1191 | enum { |
1192 | enum { |
1192 | BG_IS_VALID = 1 << 0, |
1193 | BG_IS_VALID = 1 << 0, |
1193 | |
1194 | |
1194 | BG_IS_TRANSPARENT = 1 << 1, |
1195 | BG_IS_TRANSPARENT = 1 << 1, |
1195 | BG_NEEDS_REFRESH = 1 << 2, |
1196 | BG_NEEDS_REFRESH = 1 << 2, |
1196 | |
|
|
1197 | BG_HAS_RENDER = 1 << 3, |
|
|
1198 | BG_HAS_RENDER_CONV = 1 << 4, |
|
|
1199 | }; |
1197 | }; |
1200 | |
1198 | |
1201 | uint8_t bg_flags; |
1199 | uint8_t bg_flags; |
1202 | |
1200 | |
1203 | # ifdef BG_IMAGE_FROM_FILE |
1201 | # if BG_IMAGE_FROM_FILE |
1204 | vector<rxvt_image> image_vec; |
1202 | vector<rxvt_image> image_vec; |
1205 | rxvt_image *new_image () |
1203 | rxvt_image *new_image () |
1206 | { |
1204 | { |
1207 | image_vec.resize (image_vec.size () + 1); |
1205 | image_vec.resize (image_vec.size () + 1); |
1208 | return &image_vec.back (); |
1206 | return &image_vec.back (); |
… | |
… | |
1210 | 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); |
1211 | bool render_image (rxvt_image &image); |
1209 | bool render_image (rxvt_image &image); |
1212 | void parse_image (int id, const char *type, const char *arg); |
1210 | void parse_image (int id, const char *type, const char *arg); |
1213 | # endif |
1211 | # endif |
1214 | |
1212 | |
1215 | # ifdef ENABLE_TRANSPARENCY |
1213 | # if ENABLE_TRANSPARENCY |
1216 | Pixmap root_pixmap; /* current root pixmap set */ |
1214 | Pixmap root_pixmap; /* current root pixmap set */ |
1217 | image_effects root_effects; |
1215 | image_effects root_effects; |
1218 | |
1216 | |
1219 | void bg_set_transparent () |
1217 | void bg_set_transparent () |
1220 | { |
1218 | { |
1221 | bg_flags |= BG_IS_TRANSPARENT; |
1219 | bg_flags |= BG_IS_TRANSPARENT; |
… | |
… | |
1243 | void bg_invalidate () |
1241 | void bg_invalidate () |
1244 | { |
1242 | { |
1245 | bg_flags &= ~BG_IS_VALID; |
1243 | bg_flags &= ~BG_IS_VALID; |
1246 | } |
1244 | } |
1247 | #endif |
1245 | #endif |
1248 | #ifdef HAVE_PIXBUF |
1246 | #if HAVE_PIXBUF |
1249 | bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, |
1247 | bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, |
1250 | 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, |
1251 | unsigned int width, unsigned int height, bool argb); |
1249 | unsigned int width, unsigned int height, bool argb); |
1252 | #endif |
1250 | #endif |
1253 | |
1251 | |
… | |
… | |
1263 | void scr_overlay_set (int x, int y, const char *s) NOTHROW; |
1261 | void scr_overlay_set (int x, int y, const char *s) NOTHROW; |
1264 | void scr_overlay_set (int x, int y, const wchar_t *s) NOTHROW; |
1262 | void scr_overlay_set (int x, int y, const wchar_t *s) NOTHROW; |
1265 | #endif |
1263 | #endif |
1266 | |
1264 | |
1267 | vector<void *> allocated; // free these memory blocks with free() |
1265 | vector<void *> allocated; // free these memory blocks with free() |
|
|
1266 | |
|
|
1267 | int parent_x, parent_y; // parent window position relative to root, only updated on demand |
1268 | |
1268 | |
1269 | char *locale; |
1269 | char *locale; |
1270 | char charsets[4]; |
1270 | char charsets[4]; |
1271 | char *v_buffer; /* pointer to physical buffer */ |
1271 | char *v_buffer; /* pointer to physical buffer */ |
1272 | unsigned int v_buflen; /* size of area to write */ |
1272 | unsigned int v_buflen; /* size of area to write */ |
… | |
… | |
1467 | char *get_colorfgbg (); |
1467 | char *get_colorfgbg (); |
1468 | bool set_color (rxvt_color &color, const char *name); |
1468 | bool set_color (rxvt_color &color, const char *name); |
1469 | void alias_color (int dst, int src); |
1469 | void alias_color (int dst, int src); |
1470 | void set_widthheight (unsigned int newwidth, unsigned int newheight); |
1470 | void set_widthheight (unsigned int newwidth, unsigned int newheight); |
1471 | void get_window_origin (int &x, int &y); |
1471 | void get_window_origin (int &x, int &y); |
1472 | Pixmap get_pixmap_property (Atom property); |
|
|
1473 | |
1472 | |
1474 | // screen.C |
1473 | // screen.C |
1475 | |
1474 | |
1476 | int fgcolor_of (rend_t r) const NOTHROW |
1475 | int fgcolor_of (rend_t r) const NOTHROW |
1477 | { |
1476 | { |
… | |
… | |
1586 | void selection_click (int clicks, int x, int y) NOTHROW; |
1585 | void selection_click (int clicks, int x, int y) NOTHROW; |
1587 | void selection_extend (int x, int y, int flag) NOTHROW; |
1586 | void selection_extend (int x, int y, int flag) NOTHROW; |
1588 | void selection_rotate (int x, int y) NOTHROW; |
1587 | void selection_rotate (int x, int y) NOTHROW; |
1589 | |
1588 | |
1590 | // xdefaults.C |
1589 | // xdefaults.C |
|
|
1590 | void rxvt_usage (int type); |
1591 | const char **get_options (int argc, const char *const *argv); |
1591 | const char **get_options (int argc, const char *const *argv); |
1592 | int parse_keysym (const char *str, const char *arg); |
1592 | int parse_keysym (const char *str, const char *arg); |
1593 | const char *x_resource (const char *name); |
1593 | const char *x_resource (const char *name); |
1594 | void extract_resources (); |
1594 | void extract_resources (); |
1595 | void extract_keysym_resources (); |
1595 | void extract_keysym_resources (); |