… | |
… | |
296 | PROTOTYPES: ENABLE |
296 | PROTOTYPES: ENABLE |
297 | |
297 | |
298 | BOOT: |
298 | BOOT: |
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 | |
324 | void |
331 | void |
… | |
… | |
339 | NV |
346 | NV |
340 | NOW () |
347 | NOW () |
341 | CODE: |
348 | CODE: |
342 | RETVAL = NOW; |
349 | RETVAL = NOW; |
343 | OUTPUT: |
350 | OUTPUT: |
|
|
351 | RETVAL |
|
|
352 | |
|
|
353 | int |
|
|
354 | GET_BASEFG (int rend) |
|
|
355 | CODE: |
|
|
356 | RETVAL = GET_BASEFG (rend); |
|
|
357 | OUTPUT: |
|
|
358 | RETVAL |
|
|
359 | |
|
|
360 | int |
|
|
361 | GET_BASEBG (int rend) |
|
|
362 | CODE: |
|
|
363 | RETVAL = GET_BASEBG (rend); |
|
|
364 | OUTPUT: |
|
|
365 | RETVAL |
|
|
366 | |
|
|
367 | int |
|
|
368 | SET_FGCOLOR (int rend, int color) |
|
|
369 | CODE: |
|
|
370 | RETVAL = SET_FGCOLOR (rend, color); |
|
|
371 | OUTPUT: |
|
|
372 | RETVAL |
|
|
373 | |
|
|
374 | int |
|
|
375 | SET_BGCOLOR (int rend, int color) |
|
|
376 | CODE: |
|
|
377 | RETVAL = SET_BGCOLOR (rend, color); |
|
|
378 | OUTPUT: |
344 | RETVAL |
379 | RETVAL |
345 | |
380 | |
346 | MODULE = urxvt PACKAGE = urxvt::term |
381 | MODULE = urxvt PACKAGE = urxvt::term |
347 | |
382 | |
348 | int |
383 | int |
… | |
… | |
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 | |