… | |
… | |
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 | { |
588 | HV *stash = gv_stashpv ("urxvt", 1); |
589 | sv_setsv (get_sv ("urxvt::LIBDIR", 1), newSVpvn (LIBDIR, sizeof (LIBDIR) - 1)); |
589 | # define export_const_iv(name) newCONSTSUB (stash, # name, newSViv (name)); |
|
|
590 | |
590 | |
591 | AV *hookname = get_av ("urxvt::HOOKNAME", 1); |
591 | AV *hookname = get_av ("urxvt::HOOKNAME", 1); |
592 | # define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); |
592 | # define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); |
593 | # include "hookinc.h" |
593 | # include "hookinc.h" |
594 | # undef def |
594 | # undef def |
595 | |
595 | |
596 | |
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)); |
597 | export_const_iv (DEFAULT_RSTYLE); |
605 | export_const_iv (DEFAULT_RSTYLE); |
598 | export_const_iv (OVERLAY_RSTYLE); |
606 | export_const_iv (OVERLAY_RSTYLE); |
599 | export_const_iv (RS_Bold); |
607 | export_const_iv (RS_Bold); |
600 | export_const_iv (RS_Italic); |
608 | export_const_iv (RS_Italic); |
601 | export_const_iv (RS_Blink); |
609 | export_const_iv (RS_Blink); |
602 | export_const_iv (RS_RVid); |
610 | export_const_iv (RS_RVid); |
603 | export_const_iv (RS_Uline); |
611 | export_const_iv (RS_Uline); |
|
|
612 | |
604 | export_const_iv (CurrentTime); |
613 | export_const_iv (CurrentTime); |
605 | |
614 | export_const_iv (ShiftMask); |
606 | sv_setsv (get_sv ("urxvt::LIBDIR", 1), newSVpvn (LIBDIR, sizeof (LIBDIR) - 1)); |
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); |
607 | } |
628 | } |
608 | |
629 | |
609 | SV * |
630 | SV * |
610 | new (...) |
631 | new (...) |
611 | CODE: |
632 | CODE: |
… | |
… | |
810 | free (wstr); |
831 | free (wstr); |
811 | } |
832 | } |
812 | OUTPUT: |
833 | OUTPUT: |
813 | RETVAL |
834 | RETVAL |
814 | |
835 | |
815 | # very portable, especially on objects as opposed to pods |
836 | #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) |
816 | #define TERM_OFFSET(sym) (((char *)&((TermWin_t *)0)->sym) - (char *)(TermWin_t *)0) |
|
|
817 | |
837 | |
818 | #define TERM_OFFSET_width TERM_OFFSET(width) |
838 | #define TERM_OFFSET_width TERM_OFFSET(width) |
819 | #define TERM_OFFSET_height TERM_OFFSET(height) |
839 | #define TERM_OFFSET_height TERM_OFFSET(height) |
820 | #define TERM_OFFSET_fwidth TERM_OFFSET(fwidth) |
840 | #define TERM_OFFSET_fwidth TERM_OFFSET(fwidth) |
821 | #define TERM_OFFSET_fheight TERM_OFFSET(fheight) |
841 | #define TERM_OFFSET_fheight TERM_OFFSET(fheight) |
… | |
… | |
846 | CODE: |
866 | CODE: |
847 | RETVAL = *(int *)((char *)THIS + ix); |
867 | RETVAL = *(int *)((char *)THIS + ix); |
848 | OUTPUT: |
868 | OUTPUT: |
849 | RETVAL |
869 | RETVAL |
850 | |
870 | |
|
|
871 | unsigned int |
|
|
872 | rxvt_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 | |
851 | U32 |
887 | U32 |
852 | rxvt_term::parent () |
888 | rxvt_term::parent () |
853 | CODE: |
889 | CODE: |
854 | RETVAL = (U32)THIS->parent [0]; |
890 | RETVAL = (U32)THIS->parent [0]; |
855 | OUTPUT: |
891 | OUTPUT: |
… | |
… | |
1120 | else |
1156 | else |
1121 | THIS->rs [index] = 0; |
1157 | THIS->rs [index] = 0; |
1122 | } |
1158 | } |
1123 | } |
1159 | } |
1124 | |
1160 | |
|
|
1161 | bool |
|
|
1162 | rxvt_term::option (U32 optval, int set = -1) |
|
|
1163 | CODE: |
|
|
1164 | { |
|
|
1165 | RETVAL = THIS->options & optval; |
|
|
1166 | |
|
|
1167 | if (set >= 0) |
|
|
1168 | { |
|
|
1169 | if (set) |
|
|
1170 | THIS->options |= optval; |
|
|
1171 | else |
|
|
1172 | THIS->options &= ~optval; |
|
|
1173 | |
|
|
1174 | switch (optval) |
|
|
1175 | { |
|
|
1176 | case Opt_skipBuiltinGlyphs: |
|
|
1177 | THIS->set_fonts (); |
|
|
1178 | THIS->scr_remap_chars (); |
|
|
1179 | THIS->scr_touch (true); |
|
|
1180 | THIS->want_refresh = 1; |
|
|
1181 | break; |
|
|
1182 | |
|
|
1183 | case Opt_cursorUnderline: |
|
|
1184 | THIS->want_refresh = 1; |
|
|
1185 | break; |
|
|
1186 | |
|
|
1187 | # case Opt_scrollBar_floating: |
|
|
1188 | # case Opt_scrollBar_right: |
|
|
1189 | # THIS->resize_all_windows (THIS->width, THIS->height, 1); |
|
|
1190 | # break; |
|
|
1191 | } |
|
|
1192 | } |
|
|
1193 | } |
|
|
1194 | OUTPUT: |
|
|
1195 | RETVAL |
|
|
1196 | |
1125 | void |
1197 | void |
1126 | rxvt_term::cur (...) |
1198 | rxvt_term::cur (...) |
1127 | PROTOTYPE: $;$$ |
1199 | PROTOTYPE: $;$$ |
1128 | ALIAS: |
1200 | ALIAS: |
1129 | screen_cur = 0 |
1201 | screen_cur = 0 |