ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtperl.xs
(Generate patch)

Comparing rxvt-unicode/src/rxvtperl.xs (file contents):
Revision 1.9 by root, Tue Jan 3 01:15:00 2006 UTC vs.
Revision 1.11 by root, Tue Jan 3 02:01:27 2006 UTC

296PROTOTYPES: ENABLE 296PROTOTYPES: ENABLE
297 297
298BOOT: 298BOOT:
299{ 299{
300# define set_hookname(sym) av_store (hookname, PP_CONCAT(HOOK_, sym), newSVpv (PP_STRINGIFY(sym), 0)) 300# define set_hookname(sym) av_store (hookname, PP_CONCAT(HOOK_, sym), newSVpv (PP_STRINGIFY(sym), 0))
301# define export_const(name) newCONSTSUB (gv_stashpv ("urxvt", 1), #name, newSViv (name));
301 AV *hookname = get_av ("urxvt::HOOKNAME", 1); 302 AV *hookname = get_av ("urxvt::HOOKNAME", 1);
302 set_hookname (INIT); 303 set_hookname (INIT);
303 set_hookname (RESET); 304 set_hookname (RESET);
304 set_hookname (START); 305 set_hookname (START);
305 set_hookname (DESTROY); 306 set_hookname (DESTROY);
314 set_hookname (TTY_ACTIVITY); 315 set_hookname (TTY_ACTIVITY);
315 set_hookname (REFRESH_BEGIN); 316 set_hookname (REFRESH_BEGIN);
316 set_hookname (REFRESH_END); 317 set_hookname (REFRESH_END);
317 set_hookname (KEYBOARD_COMMAND); 318 set_hookname (KEYBOARD_COMMAND);
318 319
319 newCONSTSUB (gv_stashpv ("urxvt", 1), "DEFAULT_RSTYLE", newSViv (DEFAULT_RSTYLE)); 320 export_const (DEFAULT_RSTYLE);
321 export_const (OVERLAY_RSTYLE);
322 export_const (RS_Bold);
323 export_const (RS_Italic);
324 export_const (RS_Blink);
325 export_const (RS_RVid);
326 export_const (RS_Uline);
320 327
321 sv_setpv (get_sv ("urxvt::LIBDIR", 1), LIBDIR); 328 sv_setpv (get_sv ("urxvt::LIBDIR", 1), LIBDIR);
322} 329}
323 330
324void 331void
339NV 346NV
340NOW () 347NOW ()
341 CODE: 348 CODE:
342 RETVAL = NOW; 349 RETVAL = NOW;
343 OUTPUT: 350 OUTPUT:
351 RETVAL
352
353int
354GET_BASEFG (int rend)
355 CODE:
356 RETVAL = GET_BASEFG (rend);
357 OUTPUT:
358 RETVAL
359
360int
361GET_BASEBG (int rend)
362 CODE:
363 RETVAL = GET_BASEBG (rend);
364 OUTPUT:
365 RETVAL
366
367int
368SET_FGCOLOR (int rend, int color)
369 CODE:
370 RETVAL = SET_FGCOLOR (rend, color);
371 OUTPUT:
372 RETVAL
373
374int
375SET_BGCOLOR (int rend, int color)
376 CODE:
377 RETVAL = SET_BGCOLOR (rend, color);
378 OUTPUT:
344 RETVAL 379 RETVAL
345 380
346MODULE = urxvt PACKAGE = urxvt::term 381MODULE = urxvt PACKAGE = urxvt::term
347 382
348int 383int
471 char *str = SvPVutf8 (new_text, slen); 506 char *str = SvPVutf8 (new_text, slen);
472 wchar_t *wstr = rxvt_utf8towcs (str, slen); 507 wchar_t *wstr = rxvt_utf8towcs (str, slen);
473 508
474 int len = wcslen (wstr); 509 int len = wcslen (wstr);
475 510
476 if (start_col + len > THIS->ncol) 511 if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len))
477 { 512 {
478 free (wstr); 513 free (wstr);
479 croak ("new_text extends beyond right margin"); 514 croak ("new_text extends beyond horizontal margins");
480 } 515 }
481 516
482 for (int col = start_col; col < start_col + len; col++) 517 for (int col = start_col; col < start_col + len; col++)
483 { 518 {
484 l.t [col] = wstr [col - start_col]; 519 l.t [col] = wstr [col - start_col];
515 croak ("new_rend must be arrayref"); 550 croak ("new_rend must be arrayref");
516 551
517 AV *av = (AV *)SvRV (new_rend); 552 AV *av = (AV *)SvRV (new_rend);
518 int len = av_len (av) + 1; 553 int len = av_len (av) + 1;
519 554
520 if (start_col + len > THIS->ncol) 555 if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len))
521 croak ("new_rend array extends beyond right margin"); 556 croak ("new_rend array extends beyond horizontal margins");
522 557
523 for (int col = start_col; col < start_col + len; col++) 558 for (int col = start_col; col < start_col + len; col++)
524 { 559 {
525 rend_t r = SvIV (*av_fetch (av, col - start_col, 1)) & ~RS_fontMask; 560 rend_t r = SvIV (*av_fetch (av, col - start_col, 1)) & ~RS_fontMask;
526 561

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines