… | |
… | |
793 | static const struct { |
793 | static const struct { |
794 | const char *name; |
794 | const char *name; |
795 | IV iv; |
795 | IV iv; |
796 | } *civ, const_iv[] = { |
796 | } *civ, const_iv[] = { |
797 | # define const_iv(name) { # name, (IV)name } |
797 | # define const_iv(name) { # name, (IV)name } |
|
|
798 | const_iv (HOOK_INIT), |
|
|
799 | const_iv (HOOK_DESTROY), |
|
|
800 | const_iv (HOOK_ACTION), |
|
|
801 | |
798 | const_iv (NUM_RESOURCES), |
802 | const_iv (NUM_RESOURCES), |
799 | const_iv (DEFAULT_RSTYLE), |
803 | const_iv (DEFAULT_RSTYLE), |
800 | const_iv (OVERLAY_RSTYLE), |
804 | const_iv (OVERLAY_RSTYLE), |
801 | const_iv (Color_Bits), |
805 | const_iv (Color_Bits), |
802 | const_iv (RS_bgShift), const_iv (RS_bgMask), |
806 | const_iv (RS_bgShift), const_iv (RS_bgMask), |
… | |
… | |
812 | const_iv (RS_Bold), |
816 | const_iv (RS_Bold), |
813 | const_iv (RS_Italic), |
817 | const_iv (RS_Italic), |
814 | const_iv (RS_Blink), |
818 | const_iv (RS_Blink), |
815 | const_iv (RS_RVid), |
819 | const_iv (RS_RVid), |
816 | const_iv (RS_Uline), |
820 | const_iv (RS_Uline), |
|
|
821 | |
|
|
822 | // TODO: should support all colour constants, create colorinc.h &c |
|
|
823 | const_iv (Color_fg), |
|
|
824 | const_iv (Color_bg), |
|
|
825 | #if OFF_FOCUS_FADING |
|
|
826 | const_iv (Color_fade), |
|
|
827 | #endif |
|
|
828 | const_iv (Color_pointer_fg), |
|
|
829 | const_iv (Color_pointer_bg), |
|
|
830 | const_iv (Color_border), |
|
|
831 | const_iv (NRS_COLORS), |
|
|
832 | const_iv (TOTAL_COLORS), |
817 | |
833 | |
818 | const_iv (CurrentTime), |
834 | const_iv (CurrentTime), |
819 | const_iv (ShiftMask), |
835 | const_iv (ShiftMask), |
820 | const_iv (LockMask), |
836 | const_iv (LockMask), |
821 | const_iv (ControlMask), |
837 | const_iv (ControlMask), |
… | |
… | |
1815 | } |
1831 | } |
1816 | OUTPUT: |
1832 | OUTPUT: |
1817 | RETVAL |
1833 | RETVAL |
1818 | |
1834 | |
1819 | bool |
1835 | bool |
1820 | rxvt_term::parse_keysym (char *keysym, char *str) |
1836 | rxvt_term::bind_action (char *keysym, char *str) |
|
|
1837 | ALIAS: |
|
|
1838 | parse_keysym = 1 |
1821 | CODE: |
1839 | CODE: |
1822 | RETVAL = 0 < THIS->parse_keysym (keysym, str); |
1840 | RETVAL = 0 < THIS->bind_action (keysym, str); |
1823 | THIS->keyboard->register_done (); |
1841 | THIS->keyboard->register_done (); |
1824 | OUTPUT: |
1842 | OUTPUT: |
1825 | RETVAL |
1843 | RETVAL |
1826 | |
1844 | |
1827 | void |
1845 | void |
1828 | rxvt_term::register_command (int keysym, unsigned int state, SV *str) |
1846 | rxvt_term::register_command (int keysym, unsigned int state, SV *str) |
1829 | CODE: |
1847 | CODE: |
1830 | wchar_t *wstr = sv2wcs (str); |
1848 | wchar_t *wstr = sv2wcs (str); |
1831 | THIS->keyboard->register_user_translation (keysym, state, wstr); |
1849 | THIS->keyboard->register_action (keysym, state, wstr); |
1832 | free (wstr); |
1850 | free (wstr); |
1833 | |
1851 | |
1834 | void |
1852 | void |
1835 | rxvt_term::screen_cur (...) |
1853 | rxvt_term::screen_cur (...) |
1836 | PROTOTYPE: $;$$ |
1854 | PROTOTYPE: $;$$ |
… | |
… | |
1895 | THIS->selection.screen = screen; |
1913 | THIS->selection.screen = screen; |
1896 | OUTPUT: |
1914 | OUTPUT: |
1897 | RETVAL |
1915 | RETVAL |
1898 | |
1916 | |
1899 | void |
1917 | void |
|
|
1918 | rxvt_term::selection_request (Time tm, int selnum) |
|
|
1919 | |
|
|
1920 | void |
1900 | rxvt_term::selection_clear (bool clipboard = false) |
1921 | rxvt_term::selection_clear (bool clipboard = false) |
1901 | |
1922 | |
1902 | void |
1923 | void |
1903 | rxvt_term::selection_make (Time eventtime, bool rect = false) |
1924 | rxvt_term::selection_make (Time eventtime, bool rect = false) |
1904 | CODE: |
1925 | CODE: |
… | |
… | |
1958 | { |
1979 | { |
1959 | wchar_t *wstr = sv2wcs (string); |
1980 | wchar_t *wstr = sv2wcs (string); |
1960 | THIS->scr_add_lines (wstr, wcslen (wstr)); |
1981 | THIS->scr_add_lines (wstr, wcslen (wstr)); |
1961 | free (wstr); |
1982 | free (wstr); |
1962 | } |
1983 | } |
|
|
1984 | |
|
|
1985 | void |
|
|
1986 | rxvt_term::tt_write_user_input (SV *octets) |
|
|
1987 | INIT: |
|
|
1988 | STRLEN len; |
|
|
1989 | char *str = SvPVbyte (octets, len); |
|
|
1990 | C_ARGS: |
|
|
1991 | str, len |
1963 | |
1992 | |
1964 | void |
1993 | void |
1965 | rxvt_term::tt_write (SV *octets) |
1994 | rxvt_term::tt_write (SV *octets) |
1966 | INIT: |
1995 | INIT: |
1967 | STRLEN len; |
1996 | STRLEN len; |
… | |
… | |
2397 | rxvt_img::nv *vparams = 0; |
2426 | rxvt_img::nv *vparams = 0; |
2398 | int nparams = 0; |
2427 | int nparams = 0; |
2399 | |
2428 | |
2400 | if (SvOK (params)) |
2429 | if (SvOK (params)) |
2401 | { |
2430 | { |
2402 | // we overlay rxvt_temp_buf, what a hack |
|
|
2403 | assert (sizeof (rxvt_img::nv) >= sizeof (int)); |
|
|
2404 | |
|
|
2405 | if (!SvROK (params) || SvTYPE (SvRV (params)) != SVt_PVAV) |
2431 | if (!SvROK (params) || SvTYPE (SvRV (params)) != SVt_PVAV) |
2406 | croak ("rxvt_img::filter: params must be an array reference with parameter values"); |
2432 | croak ("rxvt_img::filter: params must be an array reference with parameter values"); |
2407 | |
2433 | |
2408 | nparams = av_len ((AV *)SvRV (params)) + 1; |
2434 | nparams = av_len ((AV *)SvRV (params)) + 1; |
2409 | vparams = rxvt_temp_buf<rxvt_img::nv> (nparams); |
2435 | vparams = (rxvt_img::nv *)malloc (nparams * sizeof (rxvt_img::nv)); |
2410 | |
2436 | |
2411 | for (int i = 0; i < nparams; ++i) |
2437 | for (int i = 0; i < nparams; ++i) |
2412 | vparams [i] = SvNV (*av_fetch ((AV *)SvRV (params), i, 1)); |
2438 | vparams [i] = SvNV (*av_fetch ((AV *)SvRV (params), i, 1)); |
2413 | } |
2439 | } |
2414 | |
2440 | |
2415 | RETVAL = THIS->filter (name, nparams, vparams); |
2441 | RETVAL = THIS->filter (name, nparams, vparams); |
|
|
2442 | free (vparams); |
2416 | OUTPUT: |
2443 | OUTPUT: |
2417 | RETVAL |
2444 | RETVAL |
2418 | |
2445 | |
2419 | #endif |
2446 | #endif |
2420 | |
2447 | |