… | |
… | |
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 | |
584 | PROTOTYPES: ENABLE |
585 | PROTOTYPES: ENABLE |
585 | |
586 | |
586 | BOOT: |
587 | BOOT: |
587 | { |
588 | { |
|
|
589 | HV *stash = gv_stashpv ("urxvt", 1); |
588 | # define export_const(name) newCONSTSUB (gv_stashpv ("urxvt", 1), # name, newSViv (name)); |
590 | # define export_const_iv(name) newCONSTSUB (stash, # name, newSViv (name)); |
|
|
591 | |
589 | AV *hookname = get_av ("urxvt::HOOKNAME", 1); |
592 | AV *hookname = get_av ("urxvt::HOOKNAME", 1); |
590 | # define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); |
593 | # define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); |
591 | # include "hookinc.h" |
594 | # include "hookinc.h" |
592 | # undef def |
595 | # undef def |
593 | |
596 | |
|
|
597 | |
594 | export_const (DEFAULT_RSTYLE); |
598 | export_const_iv (DEFAULT_RSTYLE); |
595 | export_const (OVERLAY_RSTYLE); |
599 | export_const_iv (OVERLAY_RSTYLE); |
596 | export_const (RS_Bold); |
600 | export_const_iv (RS_Bold); |
597 | export_const (RS_Italic); |
601 | export_const_iv (RS_Italic); |
598 | export_const (RS_Blink); |
602 | export_const_iv (RS_Blink); |
599 | export_const (RS_RVid); |
603 | export_const_iv (RS_RVid); |
600 | export_const (RS_Uline); |
604 | export_const_iv (RS_Uline); |
|
|
605 | |
601 | export_const (CurrentTime); |
606 | export_const_iv (CurrentTime); |
|
|
607 | export_const_iv (ShiftMask); |
|
|
608 | export_const_iv (LockMask); |
|
|
609 | export_const_iv (ControlMask); |
|
|
610 | export_const_iv (Mod1Mask); |
|
|
611 | export_const_iv (Mod2Mask); |
|
|
612 | export_const_iv (Mod3Mask); |
|
|
613 | export_const_iv (Mod4Mask); |
|
|
614 | export_const_iv (Mod5Mask); |
|
|
615 | export_const_iv (Button1Mask); |
|
|
616 | export_const_iv (Button2Mask); |
|
|
617 | export_const_iv (Button3Mask); |
|
|
618 | export_const_iv (Button4Mask); |
|
|
619 | export_const_iv (Button5Mask); |
|
|
620 | export_const_iv (AnyModifier); |
602 | |
621 | |
603 | sv_setpv (get_sv ("urxvt::LIBDIR", 1), LIBDIR); |
622 | sv_setsv (get_sv ("urxvt::LIBDIR", 1), newSVpvn (LIBDIR, sizeof (LIBDIR) - 1)); |
604 | } |
623 | } |
605 | |
624 | |
606 | SV * |
625 | SV * |
607 | new (...) |
626 | new (...) |
608 | CODE: |
627 | CODE: |
… | |
… | |
807 | free (wstr); |
826 | free (wstr); |
808 | } |
827 | } |
809 | OUTPUT: |
828 | OUTPUT: |
810 | RETVAL |
829 | RETVAL |
811 | |
830 | |
812 | # very portable, especially on objects as opposed to pods |
831 | #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) |
813 | #define TERM_OFFSET(sym) (((char *)&((TermWin_t *)0)->sym) - (char *)(TermWin_t *)0) |
|
|
814 | |
832 | |
815 | #define TERM_OFFSET_width TERM_OFFSET(width) |
833 | #define TERM_OFFSET_width TERM_OFFSET(width) |
816 | #define TERM_OFFSET_height TERM_OFFSET(height) |
834 | #define TERM_OFFSET_height TERM_OFFSET(height) |
817 | #define TERM_OFFSET_fwidth TERM_OFFSET(fwidth) |
835 | #define TERM_OFFSET_fwidth TERM_OFFSET(fwidth) |
818 | #define TERM_OFFSET_fheight TERM_OFFSET(fheight) |
836 | #define TERM_OFFSET_fheight TERM_OFFSET(fheight) |
… | |
… | |
843 | CODE: |
861 | CODE: |
844 | RETVAL = *(int *)((char *)THIS + ix); |
862 | RETVAL = *(int *)((char *)THIS + ix); |
845 | OUTPUT: |
863 | OUTPUT: |
846 | RETVAL |
864 | RETVAL |
847 | |
865 | |
|
|
866 | unsigned int |
|
|
867 | rxvt_term::ModLevel3Mask () |
|
|
868 | ALIAS: |
|
|
869 | ModLevel3Mask = 0 |
|
|
870 | ModMetaMask = 1 |
|
|
871 | ModNumLockMask = 2 |
|
|
872 | CODE: |
|
|
873 | switch (ix) |
|
|
874 | { |
|
|
875 | case 0: RETVAL = THIS->ModLevel3Mask; break; |
|
|
876 | case 1: RETVAL = THIS->ModMetaMask; break; |
|
|
877 | case 2: RETVAL = THIS->ModNumLockMask; break; |
|
|
878 | } |
|
|
879 | OUTPUT: |
|
|
880 | RETVAL |
|
|
881 | |
848 | U32 |
882 | U32 |
849 | rxvt_term::parent () |
883 | rxvt_term::parent () |
850 | CODE: |
884 | CODE: |
851 | RETVAL = (U32)THIS->parent [0]; |
885 | RETVAL = (U32)THIS->parent [0]; |
852 | OUTPUT: |
886 | OUTPUT: |