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.36 by root, Sat Jan 7 19:29:17 2006 UTC vs.
Revision 1.39 by root, Sat Jan 7 23:18:56 2006 UTC

26#include <XSUB.h> 26#include <XSUB.h>
27#undef line_t 27#undef line_t
28 28
29#include "../config.h" 29#include "../config.h"
30 30
31#include <cstddef>
31#include <cstdarg> 32#include <cstdarg>
32 33
33#include "rxvt.h" 34#include "rxvt.h"
34#include "iom.h" 35#include "iom.h"
35#include "rxvtutil.h" 36#include "rxvtutil.h"
583 584
584PROTOTYPES: ENABLE 585PROTOTYPES: ENABLE
585 586
586BOOT: 587BOOT:
587{ 588{
588# define export_const(name) newCONSTSUB (gv_stashpv ("urxvt", 1), # name, newSViv (name)); 589 sv_setsv (get_sv ("urxvt::LIBDIR", 1), newSVpvn (LIBDIR, sizeof (LIBDIR) - 1));
590
589 AV *hookname = get_av ("urxvt::HOOKNAME", 1); 591 AV *hookname = get_av ("urxvt::HOOKNAME", 1);
590# define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); 592# define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0));
591# include "hookinc.h" 593# include "hookinc.h"
592# undef def 594# undef def
593 595
596 HV *option = get_hv ("urxvt::OPTION", 1);
597# define def(name,val) hv_store (option, # name, sizeof (# name) - 1, newSVuv (Opt_ ## name), 0);
598# define nodef(name)
599# include "optinc.h"
600# undef nodef
601# undef def
602
603 HV *stash = gv_stashpv ("urxvt", 1);
604# define export_const_iv(name) newCONSTSUB (stash, # name, newSViv (name));
594 export_const (DEFAULT_RSTYLE); 605 export_const_iv (DEFAULT_RSTYLE);
595 export_const (OVERLAY_RSTYLE); 606 export_const_iv (OVERLAY_RSTYLE);
596 export_const (RS_Bold); 607 export_const_iv (RS_Bold);
597 export_const (RS_Italic); 608 export_const_iv (RS_Italic);
598 export_const (RS_Blink); 609 export_const_iv (RS_Blink);
599 export_const (RS_RVid); 610 export_const_iv (RS_RVid);
600 export_const (RS_Uline); 611 export_const_iv (RS_Uline);
612
601 export_const (CurrentTime); 613 export_const_iv (CurrentTime);
602 614 export_const_iv (ShiftMask);
603 sv_setpv (get_sv ("urxvt::LIBDIR", 1), LIBDIR); 615 export_const_iv (LockMask);
616 export_const_iv (ControlMask);
617 export_const_iv (Mod1Mask);
618 export_const_iv (Mod2Mask);
619 export_const_iv (Mod3Mask);
620 export_const_iv (Mod4Mask);
621 export_const_iv (Mod5Mask);
622 export_const_iv (Button1Mask);
623 export_const_iv (Button2Mask);
624 export_const_iv (Button3Mask);
625 export_const_iv (Button4Mask);
626 export_const_iv (Button5Mask);
627 export_const_iv (AnyModifier);
604} 628}
605 629
606SV * 630SV *
607new (...) 631new (...)
608 CODE: 632 CODE:
807 free (wstr); 831 free (wstr);
808} 832}
809 OUTPUT: 833 OUTPUT:
810 RETVAL 834 RETVAL
811 835
812# very portable, especially on objects as opposed to pods 836#define TERM_OFFSET(sym) offsetof (TermWin_t, sym)
813#define TERM_OFFSET(sym) (((char *)&((TermWin_t *)0)->sym) - (char *)(TermWin_t *)0)
814 837
815#define TERM_OFFSET_width TERM_OFFSET(width) 838#define TERM_OFFSET_width TERM_OFFSET(width)
816#define TERM_OFFSET_height TERM_OFFSET(height) 839#define TERM_OFFSET_height TERM_OFFSET(height)
817#define TERM_OFFSET_fwidth TERM_OFFSET(fwidth) 840#define TERM_OFFSET_fwidth TERM_OFFSET(fwidth)
818#define TERM_OFFSET_fheight TERM_OFFSET(fheight) 841#define TERM_OFFSET_fheight TERM_OFFSET(fheight)
843 CODE: 866 CODE:
844 RETVAL = *(int *)((char *)THIS + ix); 867 RETVAL = *(int *)((char *)THIS + ix);
845 OUTPUT: 868 OUTPUT:
846 RETVAL 869 RETVAL
847 870
871unsigned int
872rxvt_term::ModLevel3Mask ()
873 ALIAS:
874 ModLevel3Mask = 0
875 ModMetaMask = 1
876 ModNumLockMask = 2
877 CODE:
878 switch (ix)
879 {
880 case 0: RETVAL = THIS->ModLevel3Mask; break;
881 case 1: RETVAL = THIS->ModMetaMask; break;
882 case 2: RETVAL = THIS->ModNumLockMask; break;
883 }
884 OUTPUT:
885 RETVAL
886
848U32 887U32
849rxvt_term::parent () 888rxvt_term::parent ()
850 CODE: 889 CODE:
851 RETVAL = (U32)THIS->parent [0]; 890 RETVAL = (U32)THIS->parent [0];
852 OUTPUT: 891 OUTPUT:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines