--- rxvt-unicode/src/rxvt.h 2006/12/02 16:57:16 1.264 +++ rxvt-unicode/src/rxvt.h 2007/06/09 13:04:27 1.271 @@ -72,21 +72,14 @@ typedef char *XPointer; #endif -#ifdef HAVE_TERMIOS_H -# include +#include typedef struct termios ttymode_t; -#else -# include -typedef struct { - struct sgttyb sg; - struct tchars tc; - struct ltchars lc; - int line; - int local; -} ttymode_t; -#endif -#ifdef XPM_BACKGROUND +#ifdef HAVE_AFTERIMAGE +# include +#undef min +#undef max +#elif defined(XPM_BACKGROUND) # ifdef XPM_INC_X11 # include # else @@ -190,6 +183,7 @@ #ifdef XPM_BACKGROUND typedef struct { short w, h, x, y; + bool auto_resize ; Pixmap pixmap; } bgPixmap_t; #endif @@ -686,10 +680,9 @@ */ #define dLocal(type,name) type const name = this->name -// for speed reasons, we assume that all latin1 characters -// are single-width (the first unicode combining character -// is actually 0x300, but ascii is what matters most). -#define WCWIDTH(c) ((c) & ~0xff ? wcwidth (c) : 1) +// for speed reasons, we assume that all codepoints 32 to 126 are +// single-width. +#define WCWIDTH(c) (IN_RANGE_INC (c, 0x20, 0x7e) ? 1 : wcwidth (c)) /* convert pixel dimensions to row/column values. Everything as int32_t */ #define Pixel2Col(x) Pixel2Width((int32_t)(x)) @@ -701,15 +694,6 @@ #define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth) #define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight) -#define OPTION(opt) (options & (opt)) -#define DEFAULT_OPTIONS (Opt_scrollBar \ - | Opt_scrollTtyOutput \ - | Opt_jumpScroll \ - | Opt_secondaryScreen \ - | Opt_secondaryScroll \ - | Opt_pastableTabs \ - | Opt_intensityStyles) - // for m >= -n, ensure remainder lies between 0..n-1 #define MOD(m,n) (((m) + (n)) % (n)) @@ -919,8 +903,6 @@ unsigned char want_refresh:1, #ifdef TRANSPARENT want_full_refresh:1, /* awaiting full screen refresh */ -#endif -#if defined(XPM_BACKGROUND) || defined(TRANSPARENT) am_transparent:1, /* is a transparent term */ am_pixmap_trans:1, /* transparency w/known root pixmap */ #endif @@ -1041,7 +1023,13 @@ row_col_t oldcursor; #ifdef XPM_BACKGROUND bgPixmap_t bgPixmap; +#ifdef HAVE_AFTERIMAGE + ASImageManager *asimman; + ASImage *original_asim; + struct { unsigned int width, height; } xpmAttr; /* all we need is width/height */ +#else XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */ +#endif #endif #if ENABLE_OVERLAY @@ -1112,6 +1100,8 @@ #if TRANSPARENT || ENABLE_PERL void rootwin_cb (XEvent &xev); xevent_watcher rootwin_ev; + void check_our_parents_cb (time_watcher &w); + time_watcher check_our_parents_ev; #endif void x_cb (XEvent &xev); @@ -1310,7 +1300,7 @@ #ifndef NO_BRIGHTCOLOR if (r & RS_Bold # if ENABLE_STYLES - && OPTION (Opt_intensityStyles) + && option (Opt_intensityStyles) # endif && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) base += minBrightCOLOR - minCOLOR; @@ -1324,7 +1314,7 @@ #ifndef NO_BRIGHTCOLOR if (r & RS_Blink # if ENABLE_STYLES - && OPTION (Opt_intensityStyles) + && option (Opt_intensityStyles) # endif && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) base += minBrightCOLOR - minCOLOR; @@ -1332,17 +1322,17 @@ return base; } - bool option (uint32_t opt) const NOTHROW + bool option (uint8_t opt) const NOTHROW { - return OPTION (opt); + return options[opt >> 3] & (1 << (opt & 7)); } - void set_option (uint32_t opt, bool set) NOTHROW + void set_option (uint8_t opt, bool set = true) NOTHROW { if (set) - options |= opt; + options[opt >> 3] |= (1 << (opt & 7)); else - options &= ~opt; + options[opt >> 3] &= ~(1 << (opt & 7)); } void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW;