… | |
… | |
29 | #include "../config.h" |
29 | #include "../config.h" |
30 | |
30 | |
31 | #include <cstddef> |
31 | #include <cstddef> |
32 | #include <cstdarg> |
32 | #include <cstdarg> |
33 | |
33 | |
|
|
34 | #include "unistd.h" |
|
|
35 | |
34 | #include "iom.h" |
36 | #include "iom.h" |
35 | #include "rxvt.h" |
37 | #include "rxvt.h" |
36 | #include "keyboard.h" |
38 | #include "keyboard.h" |
37 | #include "rxvtutil.h" |
39 | #include "rxvtutil.h" |
38 | #include "rxvtperl.h" |
40 | #include "rxvtperl.h" |
… | |
… | |
392 | ///////////////////////////////////////////////////////////////////////////// |
394 | ///////////////////////////////////////////////////////////////////////////// |
393 | |
395 | |
394 | struct rxvt_perl_interp rxvt_perl; |
396 | struct rxvt_perl_interp rxvt_perl; |
395 | |
397 | |
396 | static PerlInterpreter *perl; |
398 | static PerlInterpreter *perl; |
397 | |
|
|
398 | rxvt_perl_interp::rxvt_perl_interp () |
|
|
399 | { |
|
|
400 | } |
|
|
401 | |
399 | |
402 | rxvt_perl_interp::~rxvt_perl_interp () |
400 | rxvt_perl_interp::~rxvt_perl_interp () |
403 | { |
401 | { |
404 | if (perl) |
402 | if (perl) |
405 | { |
403 | { |
… | |
… | |
481 | ((overlay *)SvIV (hv_iterval (hv, he)))->swap (); |
479 | ((overlay *)SvIV (hv_iterval (hv, he)))->swap (); |
482 | } |
480 | } |
483 | |
481 | |
484 | } |
482 | } |
485 | |
483 | |
486 | if (!should_invoke [htype]) |
484 | if (!term->perl.should_invoke [htype]) |
487 | return false; |
485 | return false; |
488 | } |
486 | } |
489 | |
487 | |
490 | swap (perl_environ, environ); |
488 | swap (perl_environ, environ); |
491 | |
489 | |
… | |
… | |
661 | # include "optinc.h" |
659 | # include "optinc.h" |
662 | # undef nodef |
660 | # undef nodef |
663 | # undef def |
661 | # undef def |
664 | |
662 | |
665 | HV *stash = gv_stashpv ("urxvt", 1); |
663 | HV *stash = gv_stashpv ("urxvt", 1); |
666 | # define export_const_iv(name) newCONSTSUB (stash, # name, newSViv (name)); |
664 | struct { |
|
|
665 | const char *name; |
|
|
666 | IV iv; |
|
|
667 | } *civ, const_iv[] = { |
|
|
668 | # define const_iv(name) { # name, (IV)name } |
667 | export_const_iv (DEFAULT_RSTYLE); |
669 | const_iv (DEFAULT_RSTYLE), |
668 | export_const_iv (OVERLAY_RSTYLE); |
670 | const_iv (OVERLAY_RSTYLE), |
669 | export_const_iv (RS_Bold); |
671 | const_iv (RS_Bold), |
670 | export_const_iv (RS_Italic); |
672 | const_iv (RS_Italic), |
671 | export_const_iv (RS_Blink); |
673 | const_iv (RS_Blink), |
672 | export_const_iv (RS_RVid); |
674 | const_iv (RS_RVid), |
673 | export_const_iv (RS_Uline); |
675 | const_iv (RS_Uline), |
674 | |
676 | |
675 | export_const_iv (CurrentTime); |
677 | const_iv (CurrentTime), |
676 | export_const_iv (ShiftMask); |
678 | const_iv (ShiftMask), |
677 | export_const_iv (LockMask); |
679 | const_iv (LockMask), |
678 | export_const_iv (ControlMask); |
680 | const_iv (ControlMask), |
679 | export_const_iv (Mod1Mask); |
681 | const_iv (Mod1Mask), |
680 | export_const_iv (Mod2Mask); |
682 | const_iv (Mod2Mask), |
681 | export_const_iv (Mod3Mask); |
683 | const_iv (Mod3Mask), |
682 | export_const_iv (Mod4Mask); |
684 | const_iv (Mod4Mask), |
683 | export_const_iv (Mod5Mask); |
685 | const_iv (Mod5Mask), |
684 | export_const_iv (Button1Mask); |
686 | const_iv (Button1Mask), |
685 | export_const_iv (Button2Mask); |
687 | const_iv (Button2Mask), |
686 | export_const_iv (Button3Mask); |
688 | const_iv (Button3Mask), |
687 | export_const_iv (Button4Mask); |
689 | const_iv (Button4Mask), |
688 | export_const_iv (Button5Mask); |
690 | const_iv (Button5Mask), |
689 | export_const_iv (AnyModifier); |
691 | const_iv (AnyModifier), |
690 | |
692 | |
691 | export_const_iv (EVENT_NONE); |
693 | const_iv (EVENT_NONE), |
692 | export_const_iv (EVENT_READ); |
694 | const_iv (EVENT_READ), |
693 | export_const_iv (EVENT_WRITE); |
695 | const_iv (EVENT_WRITE), |
694 | } |
|
|
695 | |
696 | |
696 | void |
697 | const_iv (NoEventMask), |
697 | set_should_invoke (int htype, int value) |
698 | const_iv (KeyPressMask), |
698 | CODE: |
699 | const_iv (KeyReleaseMask), |
699 | rxvt_perl.should_invoke [htype] = value; |
700 | const_iv (ButtonPressMask), |
|
|
701 | const_iv (ButtonReleaseMask), |
|
|
702 | const_iv (EnterWindowMask), |
|
|
703 | const_iv (LeaveWindowMask), |
|
|
704 | const_iv (PointerMotionMask), |
|
|
705 | const_iv (PointerMotionHintMask), |
|
|
706 | const_iv (Button1MotionMask), |
|
|
707 | const_iv (Button2MotionMask), |
|
|
708 | const_iv (Button3MotionMask), |
|
|
709 | const_iv (Button4MotionMask), |
|
|
710 | const_iv (Button5MotionMask), |
|
|
711 | const_iv (ButtonMotionMask), |
|
|
712 | const_iv (KeymapStateMask), |
|
|
713 | const_iv (ExposureMask), |
|
|
714 | const_iv (VisibilityChangeMask), |
|
|
715 | const_iv (StructureNotifyMask), |
|
|
716 | const_iv (ResizeRedirectMask), |
|
|
717 | const_iv (SubstructureNotifyMask), |
|
|
718 | const_iv (SubstructureRedirectMask), |
|
|
719 | const_iv (FocusChangeMask), |
|
|
720 | const_iv (PropertyChangeMask), |
|
|
721 | const_iv (ColormapChangeMask), |
|
|
722 | const_iv (OwnerGrabButtonMask), |
|
|
723 | |
|
|
724 | const_iv (KeyPress), |
|
|
725 | const_iv (KeyRelease), |
|
|
726 | const_iv (ButtonPress), |
|
|
727 | const_iv (ButtonRelease), |
|
|
728 | const_iv (MotionNotify), |
|
|
729 | const_iv (EnterNotify), |
|
|
730 | const_iv (LeaveNotify), |
|
|
731 | const_iv (FocusIn), |
|
|
732 | const_iv (FocusOut), |
|
|
733 | const_iv (KeymapNotify), |
|
|
734 | const_iv (Expose), |
|
|
735 | const_iv (GraphicsExpose), |
|
|
736 | const_iv (NoExpose), |
|
|
737 | const_iv (VisibilityNotify), |
|
|
738 | const_iv (CreateNotify), |
|
|
739 | const_iv (DestroyNotify), |
|
|
740 | const_iv (UnmapNotify), |
|
|
741 | const_iv (MapNotify), |
|
|
742 | const_iv (MapRequest), |
|
|
743 | const_iv (ReparentNotify), |
|
|
744 | const_iv (ConfigureNotify), |
|
|
745 | const_iv (ConfigureRequest), |
|
|
746 | const_iv (GravityNotify), |
|
|
747 | const_iv (ResizeRequest), |
|
|
748 | const_iv (CirculateNotify), |
|
|
749 | const_iv (CirculateRequest), |
|
|
750 | const_iv (PropertyNotify), |
|
|
751 | const_iv (SelectionClear), |
|
|
752 | const_iv (SelectionRequest), |
|
|
753 | const_iv (SelectionNotify), |
|
|
754 | const_iv (ColormapNotify), |
|
|
755 | const_iv (ClientMessage), |
|
|
756 | const_iv (MappingNotify), |
|
|
757 | }; |
|
|
758 | |
|
|
759 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); |
|
|
760 | civ-- > const_iv; ) |
|
|
761 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
|
|
762 | } |
700 | |
763 | |
701 | void |
764 | void |
702 | warn (const char *msg) |
765 | warn (const char *msg) |
703 | CODE: |
766 | CODE: |
704 | rxvt_warn ("%s", msg); |
767 | rxvt_warn ("%s", msg); |
… | |
… | |
713 | CODE: |
776 | CODE: |
714 | RETVAL = newSVsv (sv); |
777 | RETVAL = newSVsv (sv); |
715 | SvTAINTED_off (RETVAL); |
778 | SvTAINTED_off (RETVAL); |
716 | OUTPUT: |
779 | OUTPUT: |
717 | RETVAL |
780 | RETVAL |
|
|
781 | |
|
|
782 | void |
|
|
783 | _exit (int status) |
718 | |
784 | |
719 | bool |
785 | bool |
720 | safe () |
786 | safe () |
721 | CODE: |
787 | CODE: |
722 | RETVAL = !rxvt_tainted (); |
788 | RETVAL = !rxvt_tainted (); |
… | |
… | |
824 | OUTPUT: |
890 | OUTPUT: |
825 | RETVAL |
891 | RETVAL |
826 | |
892 | |
827 | void |
893 | void |
828 | rxvt_term::destroy () |
894 | rxvt_term::destroy () |
|
|
895 | |
|
|
896 | void |
|
|
897 | rxvt_term::set_should_invoke (int htype, int inc) |
|
|
898 | CODE: |
|
|
899 | THIS->perl.should_invoke [htype] += inc; |
829 | |
900 | |
830 | void |
901 | void |
831 | rxvt_term::grab_button (int button, U32 modifiers) |
902 | rxvt_term::grab_button (int button, U32 modifiers) |
832 | CODE: |
903 | CODE: |
833 | XGrabButton (THIS->display->display, button, modifiers, THIS->vt, 1, |
904 | XGrabButton (THIS->display->display, button, modifiers, THIS->vt, 1, |
… | |
… | |
1032 | CODE: |
1103 | CODE: |
1033 | RETVAL = (U32)THIS->vt; |
1104 | RETVAL = (U32)THIS->vt; |
1034 | OUTPUT: |
1105 | OUTPUT: |
1035 | RETVAL |
1106 | RETVAL |
1036 | |
1107 | |
|
|
1108 | void |
|
|
1109 | rxvt_term::vt_emask_add (U32 emask) |
|
|
1110 | CODE: |
|
|
1111 | THIS->vt_emask_perl |= emask; |
|
|
1112 | THIS->vt_select_input (); |
|
|
1113 | |
1037 | U32 |
1114 | U32 |
1038 | rxvt_term::rstyle (U32 new_rstyle = THIS->rstyle) |
1115 | rxvt_term::rstyle (U32 new_rstyle = THIS->rstyle) |
1039 | CODE: |
1116 | CODE: |
1040 | { |
|
|
1041 | RETVAL = THIS->rstyle; |
1117 | RETVAL = THIS->rstyle; |
1042 | THIS->rstyle = new_rstyle; |
1118 | THIS->rstyle = new_rstyle; |
1043 | } |
|
|
1044 | OUTPUT: |
1119 | OUTPUT: |
1045 | RETVAL |
1120 | RETVAL |
1046 | |
1121 | |
1047 | int |
1122 | int |
1048 | rxvt_term::view_start (int newval = -1) |
1123 | rxvt_term::view_start (int newval = -1) |
|
|
1124 | PROTOTYPE: $;$ |
1049 | CODE: |
1125 | CODE: |
1050 | { |
1126 | { |
1051 | RETVAL = THIS->view_start; |
1127 | RETVAL = THIS->view_start; |
1052 | |
1128 | |
1053 | if (newval >= 0) |
1129 | if (newval >= 0) |
… | |
… | |
1380 | CODE: |
1456 | CODE: |
1381 | RETVAL = THIS->charsets [THIS->screen.charset]; |
1457 | RETVAL = THIS->charsets [THIS->screen.charset]; |
1382 | OUTPUT: |
1458 | OUTPUT: |
1383 | RETVAL |
1459 | RETVAL |
1384 | |
1460 | |
|
|
1461 | #void |
|
|
1462 | #rxvt_term::selection_clear () |
|
|
1463 | |
|
|
1464 | void |
|
|
1465 | rxvt_term::selection_make (U32 eventtime, bool rect = false) |
|
|
1466 | CODE: |
|
|
1467 | THIS->selection.op = SELECTION_CONT; |
|
|
1468 | THIS->selection.rect = rect; |
|
|
1469 | THIS->selection_make (eventtime); |
|
|
1470 | |
1385 | int |
1471 | int |
1386 | rxvt_term::selection_grab (U32 eventtime) |
1472 | rxvt_term::selection_grab (U32 eventtime) |
1387 | |
1473 | |
1388 | void |
1474 | void |
1389 | rxvt_term::selection (SV *newtext = 0) |
1475 | rxvt_term::selection (SV *newtext = 0) |