--- rxvt-unicode/src/rxvt.h 2005/12/20 20:58:31 1.164 +++ rxvt-unicode/src/rxvt.h 2005/12/22 19:44:21 1.169 @@ -164,18 +164,6 @@ unsigned int button; /* detail */ }; -#define MAX_IT(current, other) if ((other) > (current)) (current) = (other) -#define MIN_IT(current, other) if ((other) < (current)) (current) = (other) -#define SWAP_IT(one, two, typeof) \ - do { \ - typeof swapittmp; \ - (swapittmp) = (one); (one) = (two); (two) = (swapittmp); \ - } while (/* CONSTCOND */ 0) -#define BOUND_POSITIVE_INT16(val) \ - (int16_t) ((val) <= 0 \ - ? 0 \ - : min ((val), (((uint16_t)-1)>>1))) - #if ENABLE_FRILLS typedef struct _mwmhints { CARD32 flags; @@ -365,9 +353,9 @@ /* flags for rxvt_scr_gotorc () */ enum { - C_RELATIVE = 1 , /* col movement is relative */ - R_RELATIVE = 2, /* row movement is relative */ - RELATIVE = 1 | 2, + C_RELATIVE = 1, /* col movement is relative */ + R_RELATIVE = 2, /* row movement is relative */ + RELATIVE = C_RELATIVE | R_RELATIVE, }; /* modes for rxvt_scr_insdel_chars (), rxvt_scr_insdel_lines () */ @@ -643,11 +631,12 @@ Rs_transparent_all, #endif #if ENABLE_FRILLS + Rs_pty_fd, + Rs_hold, Rs_ext_bwidth, Rs_int_bwidth, Rs_borderLess, Rs_lineSpace, - Rs_pty_fd, Rs_cursorUnderline, #endif #if CURSOR_BLINK @@ -827,21 +816,27 @@ #define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth) #define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight) -#define TermWin_TotalWidth() ((int32_t)width) -#define TermWin_TotalHeight() ((int32_t)height) +#define TermWin_TotalWidth() ((int32_t)this->width) +#define TermWin_TotalHeight() ((int32_t)this->height) + +// for m >= -n, ensure remainder lies between 0..n-1 +#define MOD(m,n) (((m) + (n)) % (n)) + +#define LINENO(n) MOD (term_start + int(n), total_rows) +#define ROW(n) row_buf [LINENO (n)] /* how to build & extract colors and attributes */ #define GET_BASEFG(x) (((x) & RS_fgMask)) #define GET_BASEBG(x) (((x) & RS_bgMask)>>Color_Bits) #ifndef NO_BRIGHTCOLOR -# define GET_FGCOLOR(x) \ - ((((x) & RS_Bold) == 0 \ +# define GET_FGCOLOR(x) \ + ((((x) & RS_Bold) == 0 \ || GET_BASEFG (x) < minCOLOR \ || GET_BASEFG (x) >= minBrightCOLOR) \ ? GET_BASEFG (x) \ : (GET_BASEFG (x) + (minBrightCOLOR - minCOLOR))) -# define GET_BGCOLOR(x) \ - ((((x) & RS_Blink) == 0 \ +# define GET_BGCOLOR(x) \ + ((((x) & RS_Blink) == 0 \ || GET_BASEBG (x) < minCOLOR \ || GET_BASEBG (x) >= minBrightCOLOR) \ ? GET_BASEBG (x) \ @@ -1330,6 +1325,7 @@ rxvt_term (); ~rxvt_term (); + void child_exit (); // child has exited, usually destroys void destroy (); void emergency_cleanup (); @@ -1476,11 +1472,13 @@ l.r = (rend_t *)ralloc->alloc (); } +#if 0 void lfree (line_t &l) { talloc->free (l.t); ralloc->free (l.r); } +#endif void lresize (line_t &l) { @@ -1490,7 +1488,7 @@ l.t = (text_t *)talloc->alloc (l.t, prev_ncol * sizeof (text_t)); l.r = (rend_t *)ralloc->alloc (l.r, prev_ncol * sizeof (rend_t)); - MIN_IT (l.l, (int16_t)ncol); + l.l = min (l.l, ncol); if (ncol > prev_ncol) scr_blank_line (l, prev_ncol, ncol - prev_ncol, DEFAULT_RSTYLE); @@ -1500,7 +1498,6 @@ void scr_blank_screen_mem (line_t &l, rend_t efs); int scr_scroll_text (int row1, int row2, int count); void scr_reset (); - void scr_reset_realloc (); void scr_release (); void scr_clear (bool really = false); void scr_refresh (unsigned char refresh_type);