1 | /*----------------------------------------------------------------------* |
1 | /*----------------------------------------------------------------------* |
2 | * File: rxvtperl.xs |
2 | * File: rxvtperl.xs |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * |
4 | * |
5 | * All portions of code are copyright by their respective author/s. |
5 | * All portions of code are copyright by their respective author/s. |
6 | * Copyright (c) 2005-2014,2011 Marc Lehmann <schmorp@schmorp.de> |
6 | * Copyright (c) 2005-2014 Marc Lehmann <schmorp@schmorp.de> |
7 | * |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 3 of the License, or |
10 | * the Free Software Foundation; either version 3 of the License, or |
11 | * (at your option) any later version. |
11 | * (at your option) any later version. |
… | |
… | |
1027 | for (civ = const_iv + ecb_array_length (const_iv); civ > const_iv; civ--) |
1027 | for (civ = const_iv + ecb_array_length (const_iv); civ > const_iv; civ--) |
1028 | newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); |
1028 | newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); |
1029 | } |
1029 | } |
1030 | |
1030 | |
1031 | void |
1031 | void |
1032 | log (const char *msg) |
1032 | log (utf8_string msg) |
1033 | CODE: |
1033 | CODE: |
1034 | rxvt_log ("%s", msg); |
1034 | rxvt_log ("%s", msg); |
1035 | |
1035 | |
1036 | void |
1036 | void |
1037 | warn (const char *msg) |
1037 | warn (utf8_string msg) |
1038 | CODE: |
1038 | CODE: |
1039 | rxvt_warn ("%s", msg); |
1039 | rxvt_warn ("%s", msg); |
1040 | |
1040 | |
1041 | void |
1041 | void |
1042 | fatal (const char *msg) |
1042 | fatal (utf8_string msg) |
1043 | CODE: |
1043 | CODE: |
1044 | rxvt_fatal ("%s", msg); |
1044 | rxvt_fatal ("%s", msg); |
1045 | |
1045 | |
1046 | void |
1046 | void |
1047 | _exit (int status) |
1047 | _exit (int status) |
… | |
… | |
1287 | rxvt_term::ungrab () |
1287 | rxvt_term::ungrab () |
1288 | CODE: |
1288 | CODE: |
1289 | ungrab (THIS); |
1289 | ungrab (THIS); |
1290 | |
1290 | |
1291 | int |
1291 | int |
1292 | rxvt_term::XStringToKeysym (char *string) |
1292 | rxvt_term::XStringToKeysym (octet_string string) |
1293 | CODE: |
1293 | CODE: |
1294 | RETVAL = XStringToKeysym (string); |
1294 | RETVAL = XStringToKeysym (string); |
1295 | OUTPUT: RETVAL |
1295 | OUTPUT: RETVAL |
1296 | |
1296 | |
1297 | char * |
1297 | char * |
… | |
… | |
1574 | CODE: |
1574 | CODE: |
1575 | THIS->want_refresh = 1; |
1575 | THIS->want_refresh = 1; |
1576 | THIS->refresh_check (); |
1576 | THIS->refresh_check (); |
1577 | |
1577 | |
1578 | void |
1578 | void |
|
|
1579 | rxvt_term::refresh_check () |
|
|
1580 | |
|
|
1581 | void |
1579 | rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0, int start_ofs = 0, int max_len = MAX_COLS) |
1582 | rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0, int start_ofs = 0, int max_len = MAX_COLS) |
1580 | PPCODE: |
1583 | PPCODE: |
1581 | { |
1584 | { |
1582 | if (!IN_RANGE_EXC (row_number, THIS->top_row, THIS->nrow)) |
1585 | if (!IN_RANGE_EXC (row_number, THIS->top_row, THIS->nrow)) |
1583 | XSRETURN_EMPTY; |
1586 | XSRETURN_EMPTY; |
… | |
… | |
1726 | *r++ = NOCHAR; |
1729 | *r++ = NOCHAR; |
1727 | } |
1730 | } |
1728 | |
1731 | |
1729 | rxvt_pop_locale (); |
1732 | rxvt_pop_locale (); |
1730 | |
1733 | |
|
|
1734 | free (wstr); |
1731 | RETVAL = wcs2sv (rstr, r - rstr); |
1735 | RETVAL = wcs2sv (rstr, r - rstr); |
1732 | } |
1736 | } |
1733 | OUTPUT: |
1737 | OUTPUT: |
1734 | RETVAL |
1738 | RETVAL |
1735 | |
1739 | |
… | |
… | |
1759 | else if (IS_COMPOSE (*s)) |
1763 | else if (IS_COMPOSE (*s)) |
1760 | r += rxvt_composite.expand (*s, r); |
1764 | r += rxvt_composite.expand (*s, r); |
1761 | else |
1765 | else |
1762 | *r++ = *s; |
1766 | *r++ = *s; |
1763 | |
1767 | |
|
|
1768 | free (wstr); |
1764 | RETVAL = wcs2sv (rstr, r - rstr); |
1769 | RETVAL = wcs2sv (rstr, r - rstr); |
1765 | } |
1770 | } |
1766 | OUTPUT: |
1771 | OUTPUT: |
1767 | RETVAL |
1772 | RETVAL |
1768 | |
1773 | |
1769 | void |
1774 | void |
1770 | rxvt_term::_resource (char *name, int index, SV *newval = 0) |
1775 | rxvt_term::_resource (octet_string name, int index, SV *newval = 0) |
1771 | PPCODE: |
1776 | PPCODE: |
1772 | { |
1777 | { |
1773 | static const struct resval { const char *name; int value; } *rs, rslist [] = { |
1778 | static const struct resval { const char *name; int value; } *rs, rslist [] = { |
1774 | # define def(name) { # name, Rs_ ## name }, |
1779 | # define def(name) { # name, Rs_ ## name }, |
1775 | # define reserve(name,count) |
1780 | # define reserve(name,count) |
… | |
… | |
1813 | THIS->rs [index] = 0; |
1818 | THIS->rs [index] = 0; |
1814 | } |
1819 | } |
1815 | } |
1820 | } |
1816 | |
1821 | |
1817 | const char * |
1822 | const char * |
1818 | rxvt_term::x_resource (const char *name) |
1823 | rxvt_term::x_resource (octet_string name) |
1819 | |
1824 | |
1820 | bool |
1825 | bool |
1821 | rxvt_term::option (U8 optval, int set = -1) |
1826 | rxvt_term::option (U8 optval, int set = -1) |
1822 | CODE: |
1827 | CODE: |
1823 | { |
1828 | { |
… | |
… | |
1857 | } |
1862 | } |
1858 | } |
1863 | } |
1859 | OUTPUT: |
1864 | OUTPUT: |
1860 | RETVAL |
1865 | RETVAL |
1861 | |
1866 | |
|
|
1867 | SV * |
|
|
1868 | rxvt_term::lookup_keysym (int keysym, unsigned int state) |
|
|
1869 | CODE: |
|
|
1870 | { |
|
|
1871 | keysym_t *key = THIS->keyboard->lookup_keysym (THIS, keysym, state); |
|
|
1872 | RETVAL = key ? sv_2mortal (newSVpv (key->str, 0)) : &PL_sv_undef; |
|
|
1873 | } |
|
|
1874 | OUTPUT: |
|
|
1875 | RETVAL |
|
|
1876 | |
1862 | bool |
1877 | bool |
1863 | rxvt_term::bind_action (char *keysym, char *str) |
1878 | rxvt_term::bind_action (octet_string keysym, octet_string action) |
1864 | ALIAS: |
1879 | ALIAS: |
1865 | parse_keysym = 1 |
1880 | parse_keysym = 1 |
1866 | CODE: |
1881 | CODE: |
1867 | RETVAL = 0 < THIS->bind_action (keysym, str); |
1882 | RETVAL = 0 < THIS->bind_action (keysym, action); |
1868 | THIS->keyboard->register_done (); |
1883 | THIS->keyboard->register_done (); |
1869 | OUTPUT: |
1884 | OUTPUT: |
1870 | RETVAL |
1885 | RETVAL |
|
|
1886 | |
|
|
1887 | void |
|
|
1888 | rxvt_term::register_command (int keysym, unsigned int state, SV *str) |
|
|
1889 | CODE: |
|
|
1890 | wchar_t *wstr = sv2wcs (str); |
|
|
1891 | THIS->keyboard->register_action (keysym, state, wstr); |
|
|
1892 | free (wstr); |
1871 | |
1893 | |
1872 | void |
1894 | void |
1873 | rxvt_term::screen_cur (...) |
1895 | rxvt_term::screen_cur (...) |
1874 | PROTOTYPE: $;$$ |
1896 | PROTOTYPE: $;$$ |
1875 | ALIAS: |
1897 | ALIAS: |
… | |
… | |
1986 | |
2008 | |
1987 | void |
2009 | void |
1988 | rxvt_term::scr_bell () |
2010 | rxvt_term::scr_bell () |
1989 | |
2011 | |
1990 | void |
2012 | void |
1991 | rxvt_term::scr_recolour (bool refresh = true); |
2013 | rxvt_term::scr_recolor (bool refresh = true); |
1992 | |
2014 | |
1993 | void |
2015 | void |
1994 | rxvt_term::scr_change_screen (int screen) |
2016 | rxvt_term::scr_change_screen (int screen) |
1995 | |
2017 | |
1996 | void |
2018 | void |