ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtperl.xs
(Generate patch)

Comparing rxvt-unicode/src/rxvtperl.xs (file contents):
Revision 1.224 by root, Thu May 22 18:54:33 2014 UTC vs.
Revision 1.240 by root, Thu Jun 22 23:46:38 2017 UTC

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;
495} 495}
496 496
497static void 497static void
498_keysym_resource_push (rxvt_term *term, const char *k, const char *v) 498_keysym_resource_push (rxvt_term *term, const char *k, const char *v)
499{ 499{
500 unsigned int state;
501
502 if (term->parse_keysym (k, state) == -1)
503 return;
504
500 dSP; 505 dSP;
501 XPUSHs (sv_2mortal (newSVpv (v, 0))); 506 XPUSHs (sv_2mortal (newSVpv (v, 0)));
502 PUTBACK; 507 PUTBACK;
503} 508}
504 509
1022 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--)
1023 newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); 1028 newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv));
1024} 1029}
1025 1030
1026void 1031void
1027log (const char *msg) 1032log (utf8_string msg)
1028 CODE: 1033 CODE:
1029 rxvt_log ("%s", msg); 1034 rxvt_log ("%s", msg);
1030 1035
1031void 1036void
1032warn (const char *msg) 1037warn (utf8_string msg)
1033 CODE: 1038 CODE:
1034 rxvt_warn ("%s", msg); 1039 rxvt_warn ("%s", msg);
1035 1040
1036void 1041void
1037fatal (const char *msg) 1042fatal (utf8_string msg)
1038 CODE: 1043 CODE:
1039 rxvt_fatal ("%s", msg); 1044 rxvt_fatal ("%s", msg);
1040 1045
1041void 1046void
1042_exit (int status) 1047_exit (int status)
1282rxvt_term::ungrab () 1287rxvt_term::ungrab ()
1283 CODE: 1288 CODE:
1284 ungrab (THIS); 1289 ungrab (THIS);
1285 1290
1286int 1291int
1287rxvt_term::XStringToKeysym (char *string) 1292rxvt_term::XStringToKeysym (octet_string string)
1288 CODE: 1293 CODE:
1289 RETVAL = XStringToKeysym (string); 1294 RETVAL = XStringToKeysym (string);
1290 OUTPUT: RETVAL 1295 OUTPUT: RETVAL
1291 1296
1292char * 1297char *
1302 OUTPUT: RETVAL 1307 OUTPUT: RETVAL
1303 1308
1304int 1309int
1305rxvt_term::XKeycodeToKeysym (int code, int index) 1310rxvt_term::XKeycodeToKeysym (int code, int index)
1306 CODE: 1311 CODE:
1307 RETVAL = XKeycodeToKeysym (THIS->dpy, code, index); 1312 RETVAL = rxvt_XKeycodeToKeysym (THIS->dpy, code, index);
1308 OUTPUT: RETVAL 1313 OUTPUT: RETVAL
1309 1314
1310int 1315int
1311rxvt_term::strwidth (SV *str) 1316rxvt_term::strwidth (SV *str)
1312 CODE: 1317 CODE:
1382#define TERM_OFFSET_saveLines TERM_OFFSET(saveLines) 1387#define TERM_OFFSET_saveLines TERM_OFFSET(saveLines)
1383#define TERM_OFFSET_total_rows TERM_OFFSET(total_rows) 1388#define TERM_OFFSET_total_rows TERM_OFFSET(total_rows)
1384#define TERM_OFFSET_top_row TERM_OFFSET(top_row) 1389#define TERM_OFFSET_top_row TERM_OFFSET(top_row)
1385 1390
1386int 1391int
1387rxvt_term::width () 1392rxvt_term::width (int new_value = NO_INIT)
1388 ALIAS: 1393 ALIAS:
1389 width = TERM_OFFSET_width 1394 width = TERM_OFFSET_width
1390 height = TERM_OFFSET_height 1395 height = TERM_OFFSET_height
1391 fwidth = TERM_OFFSET_fwidth 1396 fwidth = TERM_OFFSET_fwidth
1392 fheight = TERM_OFFSET_fheight 1397 fheight = TERM_OFFSET_fheight
1402 saveLines = TERM_OFFSET_saveLines 1407 saveLines = TERM_OFFSET_saveLines
1403 total_rows = TERM_OFFSET_total_rows 1408 total_rows = TERM_OFFSET_total_rows
1404 top_row = TERM_OFFSET_top_row 1409 top_row = TERM_OFFSET_top_row
1405 CODE: 1410 CODE:
1406 RETVAL = *(int *)((char *)THIS + ix); 1411 RETVAL = *(int *)((char *)THIS + ix);
1412 if (items > 1)
1413 *(int *)((char *)THIS + ix) = new_value;
1407 OUTPUT: 1414 OUTPUT:
1408 RETVAL 1415 RETVAL
1409 1416
1410unsigned int 1417unsigned int
1411rxvt_term::ModLevel3Mask () 1418rxvt_term::ModLevel3Mask ()
1422 case 1: RETVAL = THIS->ModMetaMask; break; 1429 case 1: RETVAL = THIS->ModMetaMask; break;
1423 case 2: RETVAL = THIS->ModNumLockMask; break; 1430 case 2: RETVAL = THIS->ModNumLockMask; break;
1424 case 3: RETVAL = THIS->current_screen; break; 1431 case 3: RETVAL = THIS->current_screen; break;
1425#ifdef CURSOR_BLINK 1432#ifdef CURSOR_BLINK
1426 case 4: RETVAL = THIS->hidden_cursor; break; 1433 case 4: RETVAL = THIS->hidden_cursor; break;
1434#else
1435 case 4: RETVAL = 0; break;
1427#endif 1436#endif
1428 } 1437 }
1429 OUTPUT: 1438 OUTPUT:
1430 RETVAL 1439 RETVAL
1431 1440
1567void 1576void
1568rxvt_term::want_refresh () 1577rxvt_term::want_refresh ()
1569 CODE: 1578 CODE:
1570 THIS->want_refresh = 1; 1579 THIS->want_refresh = 1;
1571 THIS->refresh_check (); 1580 THIS->refresh_check ();
1581
1582void
1583rxvt_term::refresh_check ()
1572 1584
1573void 1585void
1574rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0, int start_ofs = 0, int max_len = MAX_COLS) 1586rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0, int start_ofs = 0, int max_len = MAX_COLS)
1575 PPCODE: 1587 PPCODE:
1576{ 1588{
1721 *r++ = NOCHAR; 1733 *r++ = NOCHAR;
1722 } 1734 }
1723 1735
1724 rxvt_pop_locale (); 1736 rxvt_pop_locale ();
1725 1737
1738 free (wstr);
1726 RETVAL = wcs2sv (rstr, r - rstr); 1739 RETVAL = wcs2sv (rstr, r - rstr);
1727} 1740}
1728 OUTPUT: 1741 OUTPUT:
1729 RETVAL 1742 RETVAL
1730 1743
1754 else if (IS_COMPOSE (*s)) 1767 else if (IS_COMPOSE (*s))
1755 r += rxvt_composite.expand (*s, r); 1768 r += rxvt_composite.expand (*s, r);
1756 else 1769 else
1757 *r++ = *s; 1770 *r++ = *s;
1758 1771
1772 free (wstr);
1759 RETVAL = wcs2sv (rstr, r - rstr); 1773 RETVAL = wcs2sv (rstr, r - rstr);
1760} 1774}
1761 OUTPUT: 1775 OUTPUT:
1762 RETVAL 1776 RETVAL
1763 1777
1764void 1778void
1765rxvt_term::_resource (char *name, int index, SV *newval = 0) 1779rxvt_term::_resource (octet_string name, int index, SV *newval = 0)
1766 PPCODE: 1780 PPCODE:
1767{ 1781{
1768 static const struct resval { const char *name; int value; } *rs, rslist [] = { 1782 static const struct resval { const char *name; int value; } *rs, rslist [] = {
1769# define def(name) { # name, Rs_ ## name }, 1783# define def(name) { # name, Rs_ ## name },
1770# define reserve(name,count) 1784# define reserve(name,count)
1808 THIS->rs [index] = 0; 1822 THIS->rs [index] = 0;
1809 } 1823 }
1810} 1824}
1811 1825
1812const char * 1826const char *
1813rxvt_term::x_resource (const char *name) 1827rxvt_term::x_resource (octet_string name)
1814 1828
1815bool 1829bool
1816rxvt_term::option (U8 optval, int set = -1) 1830rxvt_term::option (U8 optval, int set = -1)
1817 CODE: 1831 CODE:
1818{ 1832{
1837 THIS->cursor_blink_reset (); 1851 THIS->cursor_blink_reset ();
1838 break; 1852 break;
1839#endif 1853#endif
1840 1854
1841 case Opt_cursorUnderline: 1855 case Opt_cursorUnderline:
1856 THIS->cursor_type = set ? 1 : 0;
1842 THIS->want_refresh = 1; 1857 THIS->want_refresh = 1;
1843 THIS->refresh_check (); 1858 THIS->refresh_check ();
1844 break; 1859 break;
1845 1860
1846# case Opt_scrollBar_floating: 1861# case Opt_scrollBar_floating:
1851 } 1866 }
1852} 1867}
1853 OUTPUT: 1868 OUTPUT:
1854 RETVAL 1869 RETVAL
1855 1870
1871SV *
1872rxvt_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
1856bool 1881bool
1857rxvt_term::bind_action (char *keysym, char *str) 1882rxvt_term::bind_action (octet_string keysym, octet_string action)
1858 ALIAS: 1883 ALIAS:
1859 parse_keysym = 1 1884 parse_keysym = 1
1860 CODE: 1885 CODE:
1861 RETVAL = 0 < THIS->bind_action (keysym, str); 1886 RETVAL = 0 < THIS->bind_action (keysym, action);
1862 THIS->keyboard->register_done (); 1887 THIS->keyboard->register_done ();
1863 OUTPUT: 1888 OUTPUT:
1864 RETVAL 1889 RETVAL
1865 1890
1866void 1891void
1987 2012
1988void 2013void
1989rxvt_term::scr_bell () 2014rxvt_term::scr_bell ()
1990 2015
1991void 2016void
1992rxvt_term::scr_recolour (bool refresh = true); 2017rxvt_term::scr_recolor (bool refresh = true);
1993 2018
1994void 2019void
1995rxvt_term::scr_change_screen (int screen) 2020rxvt_term::scr_change_screen (int screen)
1996 2021
1997void 2022void
2278 2303
2279 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])
2280 ->replace (img); 2305 ->replace (img);
2281 2306
2282 THIS->bg_img = img; 2307 THIS->bg_img = img;
2283 THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER; 2308 THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH;
2284 2309
2285 if (!border) 2310 if (!border)
2286 THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT; 2311 THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT;
2287 } 2312 }
2288 2313

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines