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.57 by root, Thu Jan 12 01:30:53 2006 UTC vs.
Revision 1.62 by root, Fri Jan 13 04:59:04 2006 UTC

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
394struct rxvt_perl_interp rxvt_perl; 396struct rxvt_perl_interp rxvt_perl;
395 397
396static PerlInterpreter *perl; 398static PerlInterpreter *perl;
397
398rxvt_perl_interp::rxvt_perl_interp ()
399{
400}
401 399
402rxvt_perl_interp::~rxvt_perl_interp () 400rxvt_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
696void 697 const_iv (NoEventMask),
697set_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
701void 764void
702warn (const char *msg) 765warn (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
782void
783_exit (int status)
718 784
719bool 785bool
720safe () 786safe ()
721 CODE: 787 CODE:
722 RETVAL = !rxvt_tainted (); 788 RETVAL = !rxvt_tainted ();
824 OUTPUT: 890 OUTPUT:
825 RETVAL 891 RETVAL
826 892
827void 893void
828rxvt_term::destroy () 894rxvt_term::destroy ()
895
896void
897rxvt_term::set_should_invoke (int htype, int inc)
898 CODE:
899 THIS->perl.should_invoke [htype] += inc;
829 900
830void 901void
831rxvt_term::grab_button (int button, U32 modifiers) 902rxvt_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
1108void
1109rxvt_term::vt_emask_add (U32 emask)
1110 CODE:
1111 THIS->vt_emask_perl |= emask;
1112 THIS->vt_select_input ();
1113
1037U32 1114U32
1038rxvt_term::rstyle (U32 new_rstyle = THIS->rstyle) 1115rxvt_term::rstyle (U32 new_rstyle = THIS->rstyle)
1039 CODE: 1116 CODE:
1040{ 1117{
1041 RETVAL = THIS->rstyle; 1118 RETVAL = THIS->rstyle;
1044 OUTPUT: 1121 OUTPUT:
1045 RETVAL 1122 RETVAL
1046 1123
1047int 1124int
1048rxvt_term::view_start (int newval = -1) 1125rxvt_term::view_start (int newval = -1)
1126 PROTOTYPE: $;$
1049 CODE: 1127 CODE:
1050{ 1128{
1051 RETVAL = THIS->view_start; 1129 RETVAL = THIS->view_start;
1052 1130
1053 if (newval >= 0) 1131 if (newval >= 0)
1380 CODE: 1458 CODE:
1381 RETVAL = THIS->charsets [THIS->screen.charset]; 1459 RETVAL = THIS->charsets [THIS->screen.charset];
1382 OUTPUT: 1460 OUTPUT:
1383 RETVAL 1461 RETVAL
1384 1462
1463#void
1464#rxvt_term::selection_clear ()
1465
1466void
1467rxvt_term::selection_make (U32 eventtime, bool rect = false)
1468 CODE:
1469 THIS->selection.op = SELECTION_CONT;
1470 THIS->selection.rect = rect;
1471 THIS->selection_make (eventtime);
1472
1385int 1473int
1386rxvt_term::selection_grab (U32 eventtime) 1474rxvt_term::selection_grab (U32 eventtime)
1387 1475
1388void 1476void
1389rxvt_term::selection (SV *newtext = 0) 1477rxvt_term::selection (SV *newtext = 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines