--- rxvt-unicode/src/rxvtperl.xs 2006/01/03 01:15:00 1.9 +++ rxvt-unicode/src/rxvtperl.xs 2006/01/03 02:01:27 1.11 @@ -298,6 +298,7 @@ BOOT: { # define set_hookname(sym) av_store (hookname, PP_CONCAT(HOOK_, sym), newSVpv (PP_STRINGIFY(sym), 0)) +# define export_const(name) newCONSTSUB (gv_stashpv ("urxvt", 1), #name, newSViv (name)); AV *hookname = get_av ("urxvt::HOOKNAME", 1); set_hookname (INIT); set_hookname (RESET); @@ -316,7 +317,13 @@ set_hookname (REFRESH_END); set_hookname (KEYBOARD_COMMAND); - newCONSTSUB (gv_stashpv ("urxvt", 1), "DEFAULT_RSTYLE", newSViv (DEFAULT_RSTYLE)); + export_const (DEFAULT_RSTYLE); + export_const (OVERLAY_RSTYLE); + export_const (RS_Bold); + export_const (RS_Italic); + export_const (RS_Blink); + export_const (RS_RVid); + export_const (RS_Uline); sv_setpv (get_sv ("urxvt::LIBDIR", 1), LIBDIR); } @@ -343,6 +350,34 @@ OUTPUT: RETVAL +int +GET_BASEFG (int rend) + CODE: + RETVAL = GET_BASEFG (rend); + OUTPUT: + RETVAL + +int +GET_BASEBG (int rend) + CODE: + RETVAL = GET_BASEBG (rend); + OUTPUT: + RETVAL + +int +SET_FGCOLOR (int rend, int color) + CODE: + RETVAL = SET_FGCOLOR (rend, color); + OUTPUT: + RETVAL + +int +SET_BGCOLOR (int rend, int color) + CODE: + RETVAL = SET_BGCOLOR (rend, color); + OUTPUT: + RETVAL + MODULE = urxvt PACKAGE = urxvt::term int @@ -473,10 +508,10 @@ int len = wcslen (wstr); - if (start_col + len > THIS->ncol) + if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) { free (wstr); - croak ("new_text extends beyond right margin"); + croak ("new_text extends beyond horizontal margins"); } for (int col = start_col; col < start_col + len; col++) @@ -517,8 +552,8 @@ AV *av = (AV *)SvRV (new_rend); int len = av_len (av) + 1; - if (start_col + len > THIS->ncol) - croak ("new_rend array extends beyond right margin"); + if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) + croak ("new_rend array extends beyond horizontal margins"); for (int col = start_col; col < start_col + len; col++) {