ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvt.h
(Generate patch)

Comparing rxvt-unicode/src/rxvt.h (file contents):
Revision 1.487 by root, Mon May 28 14:25:16 2012 UTC vs.
Revision 1.493 by sf-exg, Thu May 31 20:23:51 2012 UTC

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 "scrollbar.h" 88#include "scrollbar.h"
89#include "ev_cpp.h" 89#include "ev_cpp.h"
90#include "salloc.h"
91#include "libptytty.h" 90#include "libptytty.h"
92 91
93#include "rxvtperl.h" 92#include "rxvtperl.h"
94 93
95// try to avoid some macros to decrease code size, on some systems 94// try to avoid some macros to decrease code size, on some systems
148 147
149const char * rxvt_basename (const char *str) NOTHROW; 148const char * rxvt_basename (const char *str) NOTHROW;
150void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW; 149void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW;
151void rxvt_log (const char *fmt,...) NOTHROW; 150void rxvt_log (const char *fmt,...) NOTHROW;
152void rxvt_warn (const char *fmt,...) NOTHROW; 151void rxvt_warn (const char *fmt,...) NOTHROW;
153void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) ecb_noreturn; 152void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) ecb_noreturn ecb_cold;
154void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) ecb_noreturn; 153void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) ecb_noreturn ecb_cold;
155 154
156char * rxvt_strtrim (char *str) NOTHROW; 155char * rxvt_strtrim (char *str) NOTHROW;
157char ** rxvt_strsplit (char delim, const char *str) NOTHROW; 156char ** rxvt_strsplit (char delim, const char *str) NOTHROW;
158 157
159static inline void 158static inline void
210 environ = orig_env; 209 environ = orig_env;
211 } 210 }
212}; 211};
213 212
214#ifdef HAVE_BG_PIXMAP 213#ifdef HAVE_BG_PIXMAP
214struct 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
215# ifdef BG_IMAGE_FROM_FILE 244# ifdef BG_IMAGE_FROM_FILE
216enum { 245enum {
217 IM_IS_SET = 1 << 0, 246 IM_IS_SET = 1 << 0,
218 IM_IS_SIZE_SENSITIVE = 1 << 1, 247 IM_IS_SIZE_SENSITIVE = 1 << 1,
219 IM_KEEP_ASPECT = 1 << 2, 248 IM_KEEP_ASPECT = 1 << 2,
228 defaultScale = windowScale, 257 defaultScale = windowScale,
229 centerAlign = 50, 258 centerAlign = 50,
230 defaultAlign = centerAlign, 259 defaultAlign = centerAlign,
231}; 260};
232 261
233struct rxvt_image 262struct rxvt_image : image_effects
234{ 263{
235 unsigned short alpha; 264 unsigned short alpha;
236 uint8_t flags; 265 uint8_t flags;
237 unsigned int h_scale, v_scale; /* percents of the window size */ 266 unsigned int h_scale, v_scale; /* percents of the window size */
238 int h_align, v_align; /* percents of the window size: 267 int h_align, v_align; /* percents of the window size:
239 0 - left align, 50 - center, 100 - right */ 268 0 - left align, 50 - center, 100 - right */
269
270 bool is_size_sensitive ()
271 {
272 return (!(flags & IM_TILE)
273 || h_scale || v_scale
274 || (!(flags & IM_ROOT_ALIGN) && (h_align || v_align)));
275 }
240 276
241# ifdef HAVE_PIXBUF 277# ifdef HAVE_PIXBUF
242 GdkPixbuf *pixbuf; 278 GdkPixbuf *pixbuf;
243 279
244 void destroy () 280 void destroy ()
1158 BG_IS_TRANSPARENT = 1 << 1, 1194 BG_IS_TRANSPARENT = 1 << 1,
1159 BG_NEEDS_REFRESH = 1 << 2, 1195 BG_NEEDS_REFRESH = 1 << 2,
1160 1196
1161 BG_HAS_RENDER = 1 << 3, 1197 BG_HAS_RENDER = 1 << 3,
1162 BG_HAS_RENDER_CONV = 1 << 4, 1198 BG_HAS_RENDER_CONV = 1 << 4,
1163 BG_CLIENT_RENDER = 1 << 5,
1164
1165 BG_TINT_SET = 1 << 6,
1166 BG_TINT_BITAND = 1 << 7,
1167 }; 1199 };
1168 1200
1169 uint8_t bg_flags; 1201 uint8_t bg_flags;
1170 1202
1171# ifdef BG_IMAGE_FROM_FILE 1203# ifdef BG_IMAGE_FROM_FILE
1180 void parse_image (int id, const char *type, const char *arg); 1212 void parse_image (int id, const char *type, const char *arg);
1181# endif 1213# endif
1182 1214
1183# ifdef ENABLE_TRANSPARENCY 1215# ifdef ENABLE_TRANSPARENCY
1184 Pixmap root_pixmap; /* current root pixmap set */ 1216 Pixmap root_pixmap; /* current root pixmap set */
1185 rxvt_color tint; 1217 image_effects root_effects;
1186 int shade;
1187 int h_blurRadius, v_blurRadius;
1188 1218
1189 void bg_set_transparent () 1219 void bg_set_transparent ()
1190 { 1220 {
1191 bg_flags |= BG_IS_TRANSPARENT; 1221 bg_flags |= BG_IS_TRANSPARENT;
1192 } 1222 }
1193 void bg_set_root_pixmap (); 1223 void bg_set_root_pixmap ();
1194 bool bg_set_tint (rxvt_color &new_tint); 1224 bool render_root_image ();
1195 bool bg_set_shade (const char *shade_str);
1196 bool bg_set_blur (const char *geom);
1197
1198 bool blur_pixmap (Pixmap pixmap, int width, int height);
1199 bool tint_pixmap (Pixmap pixmap, int width, int height);
1200 void tint_ximage (XImage *ximage);
1201 bool make_transparency_pixmap ();
1202# endif 1225# endif
1226
1227 bool blur_pixmap (Pixmap pixmap, int width, int height, bool argb, int h_blurRadius, int v_blurRadius);
1228 bool tint_pixmap (Pixmap pixmap, int width, int height, bool argb, rxvt_color &tint, bool tint_set, int shade);
1229 void tint_ximage (XImage *ximage, rxvt_color &tint, bool tint_set, int shade);
1203 1230
1204 ev_tstamp bg_valid_since; 1231 ev_tstamp bg_valid_since;
1205 1232
1206 Pixmap bg_pixmap; 1233 Pixmap bg_pixmap;
1207 unsigned int bg_pmap_width, bg_pmap_height; 1234 unsigned int bg_pmap_width, bg_pmap_height;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines