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. |
… | |
… | |
291 | break; |
291 | break; |
292 | |
292 | |
293 | for (; i < AvFILL (overlay_av); i++) |
293 | for (; i < AvFILL (overlay_av); i++) |
294 | av_store (overlay_av, i, SvREFCNT_inc (*av_fetch (overlay_av, i + 1, 0))); |
294 | av_store (overlay_av, i, SvREFCNT_inc (*av_fetch (overlay_av, i + 1, 0))); |
295 | |
295 | |
296 | av_pop (overlay_av); |
296 | SvREFCNT_dec (av_pop (overlay_av)); |
297 | |
297 | |
298 | SvREFCNT_dec (overlay_av); |
298 | SvREFCNT_dec (overlay_av); |
299 | overlay_av = 0; |
299 | overlay_av = 0; |
300 | |
300 | |
301 | THIS->want_refresh = 1; |
301 | THIS->want_refresh = 1; |
… | |
… | |
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 * |
… | |
… | |
1387 | #define TERM_OFFSET_saveLines TERM_OFFSET(saveLines) |
1387 | #define TERM_OFFSET_saveLines TERM_OFFSET(saveLines) |
1388 | #define TERM_OFFSET_total_rows TERM_OFFSET(total_rows) |
1388 | #define TERM_OFFSET_total_rows TERM_OFFSET(total_rows) |
1389 | #define TERM_OFFSET_top_row TERM_OFFSET(top_row) |
1389 | #define TERM_OFFSET_top_row TERM_OFFSET(top_row) |
1390 | |
1390 | |
1391 | int |
1391 | int |
1392 | rxvt_term::width () |
1392 | rxvt_term::width (int new_value = NO_INIT) |
1393 | ALIAS: |
1393 | ALIAS: |
1394 | width = TERM_OFFSET_width |
1394 | width = TERM_OFFSET_width |
1395 | height = TERM_OFFSET_height |
1395 | height = TERM_OFFSET_height |
1396 | fwidth = TERM_OFFSET_fwidth |
1396 | fwidth = TERM_OFFSET_fwidth |
1397 | fheight = TERM_OFFSET_fheight |
1397 | fheight = TERM_OFFSET_fheight |
… | |
… | |
1407 | saveLines = TERM_OFFSET_saveLines |
1407 | saveLines = TERM_OFFSET_saveLines |
1408 | total_rows = TERM_OFFSET_total_rows |
1408 | total_rows = TERM_OFFSET_total_rows |
1409 | top_row = TERM_OFFSET_top_row |
1409 | top_row = TERM_OFFSET_top_row |
1410 | CODE: |
1410 | CODE: |
1411 | RETVAL = *(int *)((char *)THIS + ix); |
1411 | RETVAL = *(int *)((char *)THIS + ix); |
|
|
1412 | if (items > 1) |
|
|
1413 | *(int *)((char *)THIS + ix) = new_value; |
1412 | OUTPUT: |
1414 | OUTPUT: |
1413 | RETVAL |
1415 | RETVAL |
1414 | |
1416 | |
1415 | unsigned int |
1417 | unsigned int |
1416 | rxvt_term::ModLevel3Mask () |
1418 | rxvt_term::ModLevel3Mask () |
… | |
… | |
1427 | case 1: RETVAL = THIS->ModMetaMask; break; |
1429 | case 1: RETVAL = THIS->ModMetaMask; break; |
1428 | case 2: RETVAL = THIS->ModNumLockMask; break; |
1430 | case 2: RETVAL = THIS->ModNumLockMask; break; |
1429 | case 3: RETVAL = THIS->current_screen; break; |
1431 | case 3: RETVAL = THIS->current_screen; break; |
1430 | #ifdef CURSOR_BLINK |
1432 | #ifdef CURSOR_BLINK |
1431 | case 4: RETVAL = THIS->hidden_cursor; break; |
1433 | case 4: RETVAL = THIS->hidden_cursor; break; |
|
|
1434 | #else |
|
|
1435 | case 4: RETVAL = 0; break; |
1432 | #endif |
1436 | #endif |
1433 | } |
1437 | } |
1434 | OUTPUT: |
1438 | OUTPUT: |
1435 | RETVAL |
1439 | RETVAL |
1436 | |
1440 | |
… | |
… | |
1572 | void |
1576 | void |
1573 | rxvt_term::want_refresh () |
1577 | rxvt_term::want_refresh () |
1574 | CODE: |
1578 | CODE: |
1575 | THIS->want_refresh = 1; |
1579 | THIS->want_refresh = 1; |
1576 | THIS->refresh_check (); |
1580 | THIS->refresh_check (); |
|
|
1581 | |
|
|
1582 | void |
|
|
1583 | rxvt_term::refresh_check () |
1577 | |
1584 | |
1578 | void |
1585 | 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) |
1586 | 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: |
1587 | PPCODE: |
1581 | { |
1588 | { |
… | |
… | |
1767 | } |
1774 | } |
1768 | OUTPUT: |
1775 | OUTPUT: |
1769 | RETVAL |
1776 | RETVAL |
1770 | |
1777 | |
1771 | void |
1778 | void |
1772 | rxvt_term::_resource (char *name, int index, SV *newval = 0) |
1779 | rxvt_term::_resource (octet_string name, int index, SV *newval = 0) |
1773 | PPCODE: |
1780 | PPCODE: |
1774 | { |
1781 | { |
1775 | static const struct resval { const char *name; int value; } *rs, rslist [] = { |
1782 | static const struct resval { const char *name; int value; } *rs, rslist [] = { |
1776 | # define def(name) { # name, Rs_ ## name }, |
1783 | # define def(name) { # name, Rs_ ## name }, |
1777 | # define reserve(name,count) |
1784 | # define reserve(name,count) |
… | |
… | |
1815 | THIS->rs [index] = 0; |
1822 | THIS->rs [index] = 0; |
1816 | } |
1823 | } |
1817 | } |
1824 | } |
1818 | |
1825 | |
1819 | const char * |
1826 | const char * |
1820 | rxvt_term::x_resource (const char *name) |
1827 | rxvt_term::x_resource (octet_string name) |
1821 | |
1828 | |
1822 | bool |
1829 | bool |
1823 | rxvt_term::option (U8 optval, int set = -1) |
1830 | rxvt_term::option (U8 optval, int set = -1) |
1824 | CODE: |
1831 | CODE: |
1825 | { |
1832 | { |
… | |
… | |
1859 | } |
1866 | } |
1860 | } |
1867 | } |
1861 | OUTPUT: |
1868 | OUTPUT: |
1862 | RETVAL |
1869 | RETVAL |
1863 | |
1870 | |
|
|
1871 | SV * |
|
|
1872 | rxvt_term::lookup_keysym (int keysym, unsigned int state) |
|
|
1873 | CODE: |
|
|
1874 | { |
|
|
1875 | keysym_t *key = THIS->keyboard->lookup_keysym (THIS, keysym, state); |
|
|
1876 | RETVAL = key ? sv_2mortal (newSVpv (key->str, 0)) : &PL_sv_undef; |
|
|
1877 | } |
|
|
1878 | OUTPUT: |
|
|
1879 | RETVAL |
|
|
1880 | |
1864 | bool |
1881 | bool |
1865 | rxvt_term::bind_action (char *keysym, char *str) |
1882 | rxvt_term::bind_action (octet_string keysym, octet_string action) |
1866 | ALIAS: |
1883 | ALIAS: |
1867 | parse_keysym = 1 |
1884 | parse_keysym = 1 |
1868 | CODE: |
1885 | CODE: |
1869 | RETVAL = 0 < THIS->bind_action (keysym, str); |
1886 | RETVAL = 0 < THIS->bind_action (keysym, action); |
1870 | THIS->keyboard->register_done (); |
1887 | THIS->keyboard->register_done (); |
1871 | OUTPUT: |
1888 | OUTPUT: |
1872 | RETVAL |
1889 | RETVAL |
1873 | |
1890 | |
1874 | void |
1891 | void |
… | |
… | |
2286 | |
2303 | |
2287 | img->convert_format (XRenderFindVisualFormat (THIS->dpy, THIS->visual), THIS->pix_colors [Color_bg]) |
2304 | img->convert_format (XRenderFindVisualFormat (THIS->dpy, THIS->visual), THIS->pix_colors [Color_bg]) |
2288 | ->replace (img); |
2305 | ->replace (img); |
2289 | |
2306 | |
2290 | THIS->bg_img = img; |
2307 | THIS->bg_img = img; |
2291 | THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER; |
2308 | THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH; |
2292 | |
2309 | |
2293 | if (!border) |
2310 | if (!border) |
2294 | THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT; |
2311 | THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT; |
2295 | } |
2312 | } |
2296 | |
2313 | |