… | |
… | |
411 | void |
411 | void |
412 | rxvt_perl_interp::init () |
412 | rxvt_perl_interp::init () |
413 | { |
413 | { |
414 | if (!perl) |
414 | if (!perl) |
415 | { |
415 | { |
|
|
416 | temp_environ temp_environ(rxvt_environ); |
|
|
417 | |
416 | char *argv[] = { |
418 | char *argv[] = { |
417 | "", |
419 | "", |
418 | "-T", |
420 | "-T", |
419 | "-edo '" LIBDIR "/urxvt.pm' or ($@ and die $@) or exit 1", |
421 | "-edo '" LIBDIR "/urxvt.pm' or ($@ and die $@) or exit 1", |
420 | }; |
422 | }; |
… | |
… | |
479 | } |
481 | } |
480 | |
482 | |
481 | if (!should_invoke [htype]) |
483 | if (!should_invoke [htype]) |
482 | return false; |
484 | return false; |
483 | } |
485 | } |
|
|
486 | |
|
|
487 | temp_environ temp_environ(rxvt_environ); |
484 | |
488 | |
485 | dSP; |
489 | dSP; |
486 | va_list ap; |
490 | va_list ap; |
487 | |
491 | |
488 | va_start (ap, htype); |
492 | va_start (ap, htype); |
… | |
… | |
627 | |
631 | |
628 | PROTOTYPES: ENABLE |
632 | PROTOTYPES: ENABLE |
629 | |
633 | |
630 | BOOT: |
634 | BOOT: |
631 | { |
635 | { |
632 | sv_setsv (get_sv ("urxvt::LIBDIR", 1), newSVpvn (LIBDIR, sizeof (LIBDIR) - 1)); |
636 | sv_setsv (get_sv ("urxvt::LIBDIR", 1), newSVpvn (LIBDIR, sizeof (LIBDIR) - 1)); |
|
|
637 | sv_setsv (get_sv ("urxvt::RESNAME", 1), newSVpvn (RESNAME, sizeof (RESNAME) - 1)); |
|
|
638 | sv_setsv (get_sv ("urxvt::RESCLASS", 1), newSVpvn (RESCLASS, sizeof (RESCLASS) - 1)); |
|
|
639 | sv_setsv (get_sv ("urxvt::RXVTNAME", 1), newSVpvn (RXVTNAME, sizeof (RXVTNAME) - 1)); |
633 | |
640 | |
634 | AV *hookname = get_av ("urxvt::HOOKNAME", 1); |
641 | AV *hookname = get_av ("urxvt::HOOKNAME", 1); |
635 | # define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); |
642 | # define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); |
636 | # include "hookinc.h" |
643 | # include "hookinc.h" |
637 | # undef def |
644 | # undef def |
… | |
… | |
672 | export_const_iv (EVENT_NONE); |
679 | export_const_iv (EVENT_NONE); |
673 | export_const_iv (EVENT_READ); |
680 | export_const_iv (EVENT_READ); |
674 | export_const_iv (EVENT_WRITE); |
681 | export_const_iv (EVENT_WRITE); |
675 | } |
682 | } |
676 | |
683 | |
677 | SV * |
|
|
678 | new (...) |
|
|
679 | CODE: |
|
|
680 | { |
|
|
681 | stringvec *argv = new stringvec; |
|
|
682 | bool success; |
|
|
683 | |
|
|
684 | for (int i = 0; i < items ;i++) |
|
|
685 | argv->push_back (strdup (SvPVbyte_nolen (ST (i)))); |
|
|
686 | |
|
|
687 | rxvt_term *term = new rxvt_term; |
|
|
688 | |
|
|
689 | term->argv = argv; |
|
|
690 | |
|
|
691 | try |
|
|
692 | { |
|
|
693 | if (!term->init (argv->size (), argv->begin ())) |
|
|
694 | term = 0; |
|
|
695 | } |
|
|
696 | catch (const class rxvt_failure_exception &e) |
|
|
697 | { |
|
|
698 | term->destroy (); |
|
|
699 | croak ("exception caught while initializing new terminal instance"); |
|
|
700 | } |
|
|
701 | |
|
|
702 | RETVAL = term && term->perl.self ? newSVterm (term) : &PL_sv_undef; |
|
|
703 | } |
|
|
704 | OUTPUT: |
|
|
705 | RETVAL |
|
|
706 | |
|
|
707 | void |
684 | void |
708 | set_should_invoke (int htype, int value) |
685 | set_should_invoke (int htype, int value) |
709 | CODE: |
686 | CODE: |
710 | rxvt_perl.should_invoke [htype] = value; |
687 | rxvt_perl.should_invoke [htype] = value; |
711 | |
688 | |
… | |
… | |
788 | } |
765 | } |
789 | OUTPUT: |
766 | OUTPUT: |
790 | RETVAL |
767 | RETVAL |
791 | |
768 | |
792 | MODULE = urxvt PACKAGE = urxvt::term |
769 | MODULE = urxvt PACKAGE = urxvt::term |
|
|
770 | |
|
|
771 | SV * |
|
|
772 | _new (...) |
|
|
773 | CODE: |
|
|
774 | { |
|
|
775 | if (items < 1 || !SvROK (ST (0)) || SvTYPE (SvRV (ST (0))) != SVt_PVAV) |
|
|
776 | croak ("first argument to urxvt::term->_new must be arrayref"); |
|
|
777 | |
|
|
778 | rxvt_term *term = new rxvt_term; |
|
|
779 | |
|
|
780 | term->argv = new stringvec; |
|
|
781 | term->envv = new stringvec; |
|
|
782 | |
|
|
783 | for (int i = 1; i < items; i++) |
|
|
784 | term->argv->push_back (strdup (SvPVbyte_nolen (ST (i)))); |
|
|
785 | |
|
|
786 | AV *envv = (AV *)SvRV (ST (0)); |
|
|
787 | for (int i = av_len (envv) + 1; i--; ) |
|
|
788 | term->envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (envv, i, 1)))); |
|
|
789 | |
|
|
790 | term->envv->push_back (0); |
|
|
791 | |
|
|
792 | bool success; |
|
|
793 | |
|
|
794 | try |
|
|
795 | { |
|
|
796 | success = term->init (term->argv->size (), term->argv->begin ()); |
|
|
797 | } |
|
|
798 | catch (const class rxvt_failure_exception &e) |
|
|
799 | { |
|
|
800 | success = false; |
|
|
801 | } |
|
|
802 | |
|
|
803 | if (!success) |
|
|
804 | { |
|
|
805 | term->destroy (); |
|
|
806 | croak ("error while initializing new terminal instance"); |
|
|
807 | } |
|
|
808 | |
|
|
809 | RETVAL = term && term->perl.self |
|
|
810 | ? newSVterm (term) : &PL_sv_undef; |
|
|
811 | } |
|
|
812 | OUTPUT: |
|
|
813 | RETVAL |
793 | |
814 | |
794 | void |
815 | void |
795 | rxvt_term::destroy () |
816 | rxvt_term::destroy () |
796 | |
817 | |
797 | void |
818 | void |
… | |
… | |
956 | case 1: RETVAL = THIS->locale; break; |
977 | case 1: RETVAL = THIS->locale; break; |
957 | } |
978 | } |
958 | OUTPUT: |
979 | OUTPUT: |
959 | RETVAL |
980 | RETVAL |
960 | |
981 | |
|
|
982 | SV * |
|
|
983 | rxvt_term::_env () |
|
|
984 | CODE: |
|
|
985 | { |
|
|
986 | if (THIS->envv) |
|
|
987 | { |
|
|
988 | AV *av = newAV (); |
|
|
989 | |
|
|
990 | for (char **i = THIS->envv->begin (); i != THIS->envv->end (); ++i) |
|
|
991 | if (*i) |
|
|
992 | av_push (av, newSVpv (*i, 0)); |
|
|
993 | |
|
|
994 | RETVAL = newRV_noinc ((SV *)av); |
|
|
995 | } |
|
|
996 | else |
|
|
997 | RETVAL = &PL_sv_undef; |
|
|
998 | } |
|
|
999 | OUTPUT: |
|
|
1000 | RETVAL |
|
|
1001 | |
961 | int |
1002 | int |
962 | rxvt_term::pty_ev_events (int events = EVENT_UNDEF) |
1003 | rxvt_term::pty_ev_events (int events = EVENT_UNDEF) |
963 | CODE: |
1004 | CODE: |
964 | RETVAL = THIS->pty_ev.events; |
1005 | RETVAL = THIS->pty_ev.events; |
965 | if (events != EVENT_UNDEF) |
1006 | if (events != EVENT_UNDEF) |
… | |
… | |
1239 | else |
1280 | else |
1240 | THIS->rs [index] = 0; |
1281 | THIS->rs [index] = 0; |
1241 | } |
1282 | } |
1242 | } |
1283 | } |
1243 | |
1284 | |
|
|
1285 | const char * |
|
|
1286 | rxvt_term::x_resource (const char *name) |
|
|
1287 | CLEANUP: |
|
|
1288 | SvTAINTED_on (ST (0)); |
|
|
1289 | |
1244 | bool |
1290 | bool |
1245 | rxvt_term::option (U32 optval, int set = -1) |
1291 | rxvt_term::option (U32 optval, int set = -1) |
1246 | CODE: |
1292 | CODE: |
1247 | { |
1293 | { |
1248 | RETVAL = THIS->options & optval; |
1294 | RETVAL = THIS->options & optval; |
… | |
… | |
1315 | if (ix) |
1361 | if (ix) |
1316 | THIS->want_refresh = 1; |
1362 | THIS->want_refresh = 1; |
1317 | } |
1363 | } |
1318 | } |
1364 | } |
1319 | |
1365 | |
|
|
1366 | char |
|
|
1367 | rxvt_term::cur_charset () |
|
|
1368 | CODE: |
|
|
1369 | RETVAL = THIS->charsets [THIS->screen.charset]; |
|
|
1370 | OUTPUT: |
|
|
1371 | RETVAL |
|
|
1372 | |
1320 | int |
1373 | int |
1321 | rxvt_term::selection_grab (U32 eventtime) |
1374 | rxvt_term::selection_grab (U32 eventtime) |
1322 | |
1375 | |
1323 | void |
1376 | void |
1324 | rxvt_term::selection (SV *newtext = 0) |
1377 | rxvt_term::selection (SV *newtext = 0) |
… | |
… | |
1335 | |
1388 | |
1336 | THIS->selection.text = sv2wcs (newtext); |
1389 | THIS->selection.text = sv2wcs (newtext); |
1337 | THIS->selection.len = wcslen (THIS->selection.text); |
1390 | THIS->selection.len = wcslen (THIS->selection.text); |
1338 | } |
1391 | } |
1339 | } |
1392 | } |
|
|
1393 | |
|
|
1394 | void |
|
|
1395 | rxvt_term::scr_xor_rect (int beg_row, int beg_col, int end_row, int end_col, U32 rstyle1 = RS_RVid, U32 rstyle2 = RS_RVid | RS_Uline) |
|
|
1396 | |
|
|
1397 | void |
|
|
1398 | rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, U32 rstyle = RS_RVid) |
1340 | |
1399 | |
1341 | void |
1400 | void |
1342 | rxvt_term::scr_bell () |
1401 | rxvt_term::scr_bell () |
1343 | |
1402 | |
1344 | void |
1403 | void |