--- rxvt-unicode/src/rxvt.h 2005/12/22 19:44:21 1.169 +++ rxvt-unicode/src/rxvt.h 2006/01/02 15:10:18 1.179 @@ -74,15 +74,6 @@ # define STDERR_FILENO 2 #endif -#if defined(HAVE_GRANTPT) && defined(HAVE_UNLOCKPT) -# if defined(PTYS_ARE_GETPT) || defined(PTYS_ARE_PTMX) -# define NO_SETOWNER_TTYDEV 1 -# endif -#endif -#if defined(__CYGWIN32__) || defined(PTYS_ARE_OPENPTY) -# define NO_SETOWNER_TTYDEV 1 -#endif - /* ***************************************************************************** * PROTOTYPES @@ -378,21 +369,24 @@ SECONDARY, }; -#define RS_None 0 /* Normal */ +#define RS_None 0 -#define RS_fgMask 0x0000007fUL /* 128 colors */ -#define RS_bgMask 0x00003f80UL /* 128 colors */ +#define RS_fgMask 0x0000007fUL // 128 colors +#define RS_bgMask 0x00003f80UL // 128 colors // font styles #define RS_Bold 0x00004000UL // value 1 #define RS_Italic 0x00008000UL // value 2 // fake styles -#define RS_Blink 0x00010000UL /* blink */ -#define RS_RVid 0x00020000UL /* reverse video */ -#define RS_Uline 0x00040000UL /* underline */ - -// 5 bits still to go +#define RS_Blink 0x00010000UL // blink +#define RS_RVid 0x00020000UL // reverse video +#define RS_Uline 0x00040000UL // underline + +// 5 custom bits for extensions +#define RS_customCount 32 +#define RS_customMask 0x00f80000UL +#define RS_customShift 19 // other flags #define RS_Careful 0x80000000UL /* be careful when drawing these */ @@ -575,6 +569,7 @@ Rs_boldFont, Rs_italicFont, Rs_boldItalicFont, + Rs_intensityStyles, #endif Rs_name, Rs_title, @@ -749,8 +744,8 @@ // do not change these constants lightly, there are many interdependencies #define IMBUFSIZ 128 // input modifier buffer sizes #define KBUFSZ 512 // size of keyboard mapping buffer -#define CBUFSIZ 4096 // size of command buffer -#define UBUFSIZ 4096 // character buffer +#define CBUFSIZ 2048 // size of command buffer +#define UBUFSIZ 2048 // character buffer #ifndef PATH_MAX # define PATH_MAX 16384 @@ -828,23 +823,6 @@ /* 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 \ - || GET_BASEFG (x) < minCOLOR \ - || GET_BASEFG (x) >= minBrightCOLOR) \ - ? GET_BASEFG (x) \ - : (GET_BASEFG (x) + (minBrightCOLOR - minCOLOR))) -# define GET_BGCOLOR(x) \ - ((((x) & RS_Blink) == 0 \ - || GET_BASEBG (x) < minCOLOR \ - || GET_BASEBG (x) >= minBrightCOLOR) \ - ? GET_BASEBG (x) \ - : (GET_BASEBG (x) + (minBrightCOLOR - minCOLOR))) -#else -# define GET_FGCOLOR(x) GET_BASEFG(x) -# define GET_BGCOLOR(x) GET_BASEBG(x) -#endif #define GET_FONT(x) (((x) & RS_fontMask) >> RS_fontShift) #define SET_FONT(x,fid) (((x) & ~RS_fontMask) | ((fid) << RS_fontShift)) @@ -961,6 +939,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, ...); @@ -1047,6 +1026,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 @@ -1261,7 +1241,7 @@ void commit_iso14755 (); int hex_keyval (XKeyEvent &ev); # if ISO_14755 - void iso14755_51 (unicode_t ch, rend_t r = DEFAULT_RSTYLE); + void iso14755_51 (unicode_t ch, rend_t r = DEFAULT_RSTYLE, int x = 0, int y = -1); void iso14755_54 (int x, int y); # endif #endif @@ -1494,6 +1474,34 @@ scr_blank_line (l, prev_ncol, ncol - prev_ncol, DEFAULT_RSTYLE); } + int fgcolor_of (rend_t r) + { + int base = GET_BASEFG (r); +#ifndef NO_BRIGHTCOLOR + if (r & RS_Bold +# if ENABLE_STYLES + && OPTION (Opt_intensityStyles) +# endif + && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) + base += minBrightCOLOR - minCOLOR; +#endif + return base; + } + + int bgcolor_of (rend_t r) + { + int base = GET_BASEBG (r); +#ifndef NO_BRIGHTCOLOR + if (r & RS_Blink +# if ENABLE_STYLES + && OPTION (Opt_intensityStyles) +# endif + && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) + base += minBrightCOLOR - minCOLOR; +#endif + return base; + } + void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs); void scr_blank_screen_mem (line_t &l, rend_t efs); int scr_scroll_text (int row1, int row2, int count);