… | |
… | |
79 | # include <afterimage.h> |
79 | # include <afterimage.h> |
80 | #undef min |
80 | #undef min |
81 | #undef max |
81 | #undef max |
82 | #endif |
82 | #endif |
83 | |
83 | |
|
|
84 | #include "background.h" |
|
|
85 | |
84 | #ifndef STDIN_FILENO |
86 | #ifndef STDIN_FILENO |
85 | # define STDIN_FILENO 0 |
87 | # define STDIN_FILENO 0 |
86 | # define STDOUT_FILENO 1 |
88 | # define STDOUT_FILENO 1 |
87 | # define STDERR_FILENO 2 |
89 | # define STDERR_FILENO 2 |
88 | #endif |
90 | #endif |
… | |
… | |
162 | */ |
164 | */ |
163 | #if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(PLAIN_SCROLLBAR) |
165 | #if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(PLAIN_SCROLLBAR) |
164 | # define KEEP_SCROLLCOLOR 1 |
166 | # define KEEP_SCROLLCOLOR 1 |
165 | #else |
167 | #else |
166 | # undef KEEP_SCROLLCOLOR |
168 | # undef KEEP_SCROLLCOLOR |
167 | #endif |
|
|
168 | |
|
|
169 | #if defined(XPM_BACKGROUND) || defined(ENABLE_TRANSPARENCY) |
|
|
170 | # define HAVE_BG_PIXMAP 1/* to simplify further usage */ |
|
|
171 | struct bgPixmap_t { |
|
|
172 | |
|
|
173 | enum { |
|
|
174 | geometrySet = (1UL<<0), |
|
|
175 | propScale = (1UL<<1), |
|
|
176 | geometryFlags = (geometrySet|propScale), |
|
|
177 | |
|
|
178 | tintSet = (1UL<<8), |
|
|
179 | tintNeeded = (1UL<<9), |
|
|
180 | tintWholesome = (1UL<<10), |
|
|
181 | tintServerSide = (1UL<<11), |
|
|
182 | tintFlags = (tintSet|tintServerSide|tintNeeded|tintWholesome), |
|
|
183 | blurNeeded = (1UL<<12), |
|
|
184 | blurServerSide = (1UL<<13), /* this don't work yet */ |
|
|
185 | |
|
|
186 | isTransparent = (1UL<<16), |
|
|
187 | isInvalid = (1UL<<17), |
|
|
188 | isVtOrigin = (1UL<<18) /* if set pixmap has origin at corner of |
|
|
189 | vt window instead of parent[0]! */ |
|
|
190 | }; |
|
|
191 | |
|
|
192 | unsigned long flags; |
|
|
193 | |
|
|
194 | enum { |
|
|
195 | transpPmapTiled = (1UL<<0), |
|
|
196 | transpPmapTinted = tintNeeded, |
|
|
197 | transpPmapBlured = blurNeeded, |
|
|
198 | transpTransformations = (tintNeeded|blurNeeded) |
|
|
199 | }; /* this flags are returned by make_transparency_pixmap if called */ |
|
|
200 | |
|
|
201 | # ifdef XPM_BACKGROUND |
|
|
202 | # ifdef HAVE_AFTERIMAGE |
|
|
203 | ASImage *original_asim; |
|
|
204 | bool render_asim (ASImage *background, ARGB32 background_tint); |
|
|
205 | # endif |
|
|
206 | |
|
|
207 | enum { defaultScale = 100, defaultAlign = 50 }; |
|
|
208 | |
|
|
209 | unsigned int h_scale, v_scale;/* percents of the window size */ |
|
|
210 | int h_align, v_align; /* percents of the window size: |
|
|
211 | 0 - left align, 50 - center, 100 - right */ |
|
|
212 | void unset_geometry () { flags = flags & ~geometryFlags; }; |
|
|
213 | bool set_geometry (const char *geom); |
|
|
214 | void set_defaultGeometry () |
|
|
215 | { |
|
|
216 | h_scale = v_scale = defaultScale; |
|
|
217 | h_align = v_align = defaultAlign; |
|
|
218 | flags |= geometrySet; |
|
|
219 | }; |
|
|
220 | |
|
|
221 | bool set_file (const char *file); |
|
|
222 | # endif /* XPM_BACKGROUND */ |
|
|
223 | |
|
|
224 | rxvt_term *target; |
|
|
225 | bool set_target (rxvt_term *new_target); |
|
|
226 | |
|
|
227 | # ifdef ENABLE_TRANSPARENCY |
|
|
228 | int root_depth; /* obtained when target is set */ |
|
|
229 | Pixmap root_pixmap; /* current root pixmap set */ |
|
|
230 | rxvt_color tint; |
|
|
231 | int shade; |
|
|
232 | int h_blurRadius, v_blurRadius; |
|
|
233 | |
|
|
234 | bool set_transparent (); |
|
|
235 | bool set_blur_radius (const char *geom); |
|
|
236 | bool set_tint (rxvt_color &new_tint); |
|
|
237 | bool unset_tint (); |
|
|
238 | bool set_shade (const char *shade_str); |
|
|
239 | bool set_root_pixmap (); |
|
|
240 | |
|
|
241 | unsigned long make_transparency_pixmap ();/* returns combination of the transpTransformations flags */ |
|
|
242 | # endif |
|
|
243 | double invalid_since; |
|
|
244 | |
|
|
245 | Pixmap pixmap; |
|
|
246 | unsigned int pmap_width, pmap_height; |
|
|
247 | unsigned int pmap_depth; |
|
|
248 | |
|
|
249 | bool window_size_sensitive (); |
|
|
250 | bool window_position_sensitive () { |
|
|
251 | return (flags & isTransparent); |
|
|
252 | }; |
|
|
253 | |
|
|
254 | bool is_parentOrigin () { |
|
|
255 | return !(flags & isVtOrigin); |
|
|
256 | }; |
|
|
257 | |
|
|
258 | bool need_client_side_rendering (); |
|
|
259 | void apply (); |
|
|
260 | bool render (); |
|
|
261 | void invalidate () { |
|
|
262 | if (!(flags & isInvalid)) |
|
|
263 | { |
|
|
264 | flags |= isInvalid; |
|
|
265 | invalid_since = NOW; |
|
|
266 | } |
|
|
267 | }; |
|
|
268 | }; |
|
|
269 | #else |
|
|
270 | # undef HAVE_BG_PIXMAP |
|
|
271 | #endif |
169 | #endif |
272 | |
170 | |
273 | /* |
171 | /* |
274 | * the 'essential' information for reporting Mouse Events |
172 | * the 'essential' information for reporting Mouse Events |
275 | * pared down from XButtonEvent |
173 | * pared down from XButtonEvent |
… | |
… | |
1319 | void set_window_color (int idx, const char *color); |
1217 | void set_window_color (int idx, const char *color); |
1320 | void set_colorfgbg (); |
1218 | void set_colorfgbg (); |
1321 | bool set_color (rxvt_color &color, const char *name); |
1219 | bool set_color (rxvt_color &color, const char *name); |
1322 | void alias_color (int dst, int src); |
1220 | void alias_color (int dst, int src); |
1323 | void set_widthheight (unsigned int newwidth, unsigned int newheight); |
1221 | void set_widthheight (unsigned int newwidth, unsigned int newheight); |
|
|
1222 | void get_window_origin (int &x, int &y); |
|
|
1223 | Pixmap get_pixmap_property (int prop_id); |
1324 | |
1224 | |
1325 | // screen.C |
1225 | // screen.C |
1326 | |
1226 | |
1327 | void lalloc (line_t &l) const |
1227 | void lalloc (line_t &l) const |
1328 | { |
1228 | { |
… | |
… | |
1511 | // xdefaults.C |
1411 | // xdefaults.C |
1512 | void get_options (int argc, const char *const *argv); |
1412 | void get_options (int argc, const char *const *argv); |
1513 | int parse_keysym (const char *str, const char *arg); |
1413 | int parse_keysym (const char *str, const char *arg); |
1514 | void get_xdefaults (FILE *stream, const char *name); |
1414 | void get_xdefaults (FILE *stream, const char *name); |
1515 | void extract_resources (); |
1415 | void extract_resources (); |
1516 | // xpm.C |
|
|
1517 | void get_window_origin (int &x, int &y); |
|
|
1518 | Pixmap get_pixmap_property (int prop_id); |
|
|
1519 | }; |
1416 | }; |
1520 | |
1417 | |
1521 | #endif /* _RXVT_H_ */ |
1418 | #endif /* _RXVT_H_ */ |
1522 | |
1419 | |