… | |
… | |
23 | #if HAVE_WCHAR_H |
23 | #if HAVE_WCHAR_H |
24 | # include <wchar.h> |
24 | # include <wchar.h> |
25 | #else |
25 | #else |
26 | // stdlib.h might provide it |
26 | // stdlib.h might provide it |
27 | #endif |
27 | #endif |
28 | |
|
|
29 | using namespace std; |
|
|
30 | |
28 | |
31 | // we assume that Xlib.h defines XPointer, and it does since at least 1994... |
29 | // we assume that Xlib.h defines XPointer, and it does since at least 1994... |
32 | |
30 | |
33 | extern "C" { |
31 | extern "C" { |
34 | #include <X11/Xlib.h> |
32 | #include <X11/Xlib.h> |
… | |
… | |
71 | |
69 | |
72 | #include <X11/cursorfont.h> |
70 | #include <X11/cursorfont.h> |
73 | #include <X11/keysym.h> |
71 | #include <X11/keysym.h> |
74 | #include <X11/keysymdef.h> |
72 | #include <X11/keysymdef.h> |
75 | #include <X11/Xatom.h> |
73 | #include <X11/Xatom.h> |
76 | |
|
|
77 | #ifdef HAVE_AFTERIMAGE |
|
|
78 | # include <afterimage.h> |
|
|
79 | # undef min |
|
|
80 | # undef max |
|
|
81 | #endif |
|
|
82 | |
74 | |
83 | #ifdef HAVE_PIXBUF |
75 | #ifdef HAVE_PIXBUF |
84 | # include <gdk-pixbuf/gdk-pixbuf.h> |
76 | # include <gdk-pixbuf/gdk-pixbuf.h> |
85 | #endif |
77 | #endif |
86 | |
78 | |
… | |
… | |
1090 | #ifdef HAVE_BG_PIXMAP |
1082 | #ifdef HAVE_BG_PIXMAP |
1091 | void bg_init (); |
1083 | void bg_init (); |
1092 | void bg_destroy (); |
1084 | void bg_destroy (); |
1093 | |
1085 | |
1094 | enum { |
1086 | enum { |
1095 | //subset returned by make_transparency_pixmap |
|
|
1096 | BG_IS_VALID = 1 << 0, |
1087 | BG_IS_VALID = 1 << 0, |
1097 | BG_NEEDS_TINT = 1 << 1, |
1088 | BG_NEEDS_TINT = 1 << 1, |
1098 | BG_NEEDS_BLUR = 1 << 2, |
1089 | BG_NEEDS_BLUR = 1 << 2, |
1099 | |
1090 | |
1100 | BG_EFFECTS_FLAGS = BG_NEEDS_TINT | BG_NEEDS_BLUR, |
1091 | BG_EFFECTS_FLAGS = BG_NEEDS_TINT | BG_NEEDS_BLUR, |
… | |
… | |
1120 | |
1111 | |
1121 | unsigned int bg_flags; |
1112 | unsigned int bg_flags; |
1122 | |
1113 | |
1123 | # ifdef BG_IMAGE_FROM_FILE |
1114 | # ifdef BG_IMAGE_FROM_FILE |
1124 | void get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y); |
1115 | void get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y); |
1125 | bool render_image (unsigned long tr_flags); |
1116 | bool render_image (bool transparent); |
1126 | |
1117 | |
1127 | enum { |
1118 | enum { |
1128 | noScale = 0, |
1119 | noScale = 0, |
1129 | windowScale = 100, |
1120 | windowScale = 100, |
1130 | defaultScale = windowScale, |
1121 | defaultScale = windowScale, |
… | |
… | |
1160 | bool bg_set_blur (const char *geom); |
1151 | bool bg_set_blur (const char *geom); |
1161 | |
1152 | |
1162 | bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height, int depth); |
1153 | bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height, int depth); |
1163 | bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height); |
1154 | bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height); |
1164 | void tint_ximage (Visual *visual, XImage *ximage); |
1155 | void tint_ximage (Visual *visual, XImage *ximage); |
1165 | unsigned long make_transparency_pixmap (); |
1156 | bool make_transparency_pixmap (); |
1166 | # endif |
1157 | # endif |
1167 | |
1158 | |
1168 | ev_tstamp bg_valid_since; |
1159 | ev_tstamp bg_valid_since; |
1169 | |
1160 | |
1170 | Pixmap bg_pixmap; |
1161 | Pixmap bg_pixmap; |
… | |
… | |
1178 | |
1169 | |
1179 | bool bg_render (); |
1170 | bool bg_render (); |
1180 | void bg_invalidate () |
1171 | void bg_invalidate () |
1181 | { |
1172 | { |
1182 | bg_flags &= ~BG_IS_VALID; |
1173 | bg_flags &= ~BG_IS_VALID; |
1183 | } |
|
|
1184 | #endif |
|
|
1185 | #ifdef HAVE_AFTERIMAGE |
|
|
1186 | ASImage *original_asim; |
|
|
1187 | ASVisual *asv; |
|
|
1188 | ASImageManager *asimman; |
|
|
1189 | |
|
|
1190 | void init_asv () |
|
|
1191 | { |
|
|
1192 | if (!asv) |
|
|
1193 | asv = create_asvisual_for_id (dpy, display->screen, depth, XVisualIDFromVisual (visual), cmap, NULL); |
|
|
1194 | } |
1174 | } |
1195 | #endif |
1175 | #endif |
1196 | #ifdef HAVE_PIXBUF |
1176 | #ifdef HAVE_PIXBUF |
1197 | GdkPixbuf *pixbuf; |
1177 | GdkPixbuf *pixbuf; |
1198 | bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, |
1178 | bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, |