--- rxvt-unicode/src/rxvt.h 2005/12/21 14:19:19 1.166 +++ rxvt-unicode/src/rxvt.h 2005/12/23 14:46:35 1.170 @@ -164,8 +164,6 @@ unsigned int button; /* detail */ }; -#define MAX_POSITIVE_INT16 (((uint16_t)-1)>>1) // TODO: configure/limits - #if ENABLE_FRILLS typedef struct _mwmhints { CARD32 flags; @@ -355,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 () */ @@ -633,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 @@ -820,21 +819,24 @@ #define TermWin_TotalWidth() ((int32_t)this->width) #define TermWin_TotalHeight() ((int32_t)this->height) -#define LINENO(n) (((n) + term_start + total_rows) % total_rows) -#define ROW(n) (save [LINENO (n)]) +// 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) \ @@ -959,6 +961,7 @@ extern class rxvt_failure_exception { } rxvt_failure_exception; typedef callback1 log_callback; +typedef callback1 getfd_callback; extern void rxvt_vlog (const char *fmt, va_list arg_ptr); extern void rxvt_log (const char *fmt, ...); @@ -1045,6 +1048,7 @@ struct rxvt_term : zero_initialized, rxvt_vars { log_callback *log_hook; // log error messages through this hook, if != 0 + getfd_callback *getfd_hook; // convert remote to local fd, if != 0 struct mbstate mbstate; // current input multibyte state @@ -1323,6 +1327,7 @@ rxvt_term (); ~rxvt_term (); + void child_exit (); // child has exited, usually destroys void destroy (); void emergency_cleanup (); @@ -1469,11 +1474,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) { @@ -1493,7 +1500,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);