--- rxvt-unicode/src/rxvtperl.xs 2006/01/03 01:29:55 1.10 +++ rxvt-unicode/src/rxvtperl.xs 2006/01/03 02:42:17 1.12 @@ -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,54 @@ 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 new_color) + CODE: + RETVAL = SET_FGCOLOR (rend, new_color); + OUTPUT: + RETVAL + +int +SET_BGCOLOR (int rend, int new_color) + CODE: + RETVAL = SET_BGCOLOR (rend, new_color); + OUTPUT: + RETVAL + +int +GET_CUSTOM (int rend) + CODE: + RETVAL = (rend && RS_customMask) >> RS_customShift; + OUTPUT: + RETVAL + +int +SET_CUSTOM (int rend, int new_value) + CODE: +{ + if (!IN_RANGE_EXC (new_value, 0, RS_customCount)) + croak ("custom value out of range, must be 0..%d", RS_customCount - 1); + + RETVAL = (rend & ~RS_customMask) + | ((new_value << RS_customShift) & RS_customMask); +} + OUTPUT: + RETVAL + MODULE = urxvt PACKAGE = urxvt::term int