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.117 by root, Thu Dec 13 18:24:36 2007 UTC vs.
Revision 1.124 by root, Thu Jul 31 03:24:08 2008 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-2006 Marc Lehmann <pcg@goof.com> 6 * Copyright (c) 2005-2008 Marc Lehmann <pcg@goof.com>
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 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version. 11 * (at your option) any later version.
39#include "rxvtutil.h" 39#include "rxvtutil.h"
40#include "rxvtperl.h" 40#include "rxvtperl.h"
41 41
42#include "perlxsi.c" 42#include "perlxsi.c"
43 43
44#ifdef HAVE_SCROLLBARS
45# define GRAB_CURSOR THIS->leftptr_cursor 44#define GRAB_CURSOR THIS->scrollBar.leftptr_cursor
46#else
47# define GRAB_CURSOR None
48#endif
49 45
50#undef LINENO 46#undef LINENO
51#define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) 47#define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows)
52#undef ROW 48#undef ROW
53#define ROW(n) THIS->row_buf [LINENO (n)] 49#define ROW(n) THIS->row_buf [LINENO (n)]
214 *hv_fetch ((HV *)SvRV ((SV *)THIS->perl.self), "_overlay", 8, 0) 210 *hv_fetch ((HV *)SvRV ((SV *)THIS->perl.self), "_overlay", 8, 0)
215 )); 211 ));
216 av_push (overlay_av, newSViv ((long)this)); 212 av_push (overlay_av, newSViv ((long)this));
217 213
218 THIS->want_refresh = 1; 214 THIS->want_refresh = 1;
215 THIS->refresh_check ();
219} 216}
220 217
221void 218void
222overlay::hide () 219overlay::hide ()
223{ 220{
237 234
238 SvREFCNT_dec (overlay_av); 235 SvREFCNT_dec (overlay_av);
239 overlay_av = 0; 236 overlay_av = 0;
240 237
241 THIS->want_refresh = 1; 238 THIS->want_refresh = 1;
239 THIS->refresh_check ();
242} 240}
243 241
244void overlay::swap () 242void overlay::swap ()
245{ 243{
246 int ov_x = max (0, min (MOD (x, THIS->ncol), THIS->ncol - w)); 244 int ov_x = max (0, min (MOD (x, THIS->ncol), THIS->ncol - w));
291 for (int col = min (AvFILL (av) + 1, w - x - border); col--; ) 289 for (int col = min (AvFILL (av) + 1, w - x - border); col--; )
292 this->rend [y][x + col] = SvIV (*av_fetch (av, col, 1)); 290 this->rend [y][x + col] = SvIV (*av_fetch (av, col, 1));
293 } 291 }
294 292
295 THIS->want_refresh = 1; 293 THIS->want_refresh = 1;
294 THIS->refresh_check ();
296} 295}
297 296
298///////////////////////////////////////////////////////////////////////////// 297/////////////////////////////////////////////////////////////////////////////
299 298
300#define IOM_CLASS "urxvt" 299#define IOM_CLASS "urxvt"
301#define IOM_WARN rxvt_warn 300#define IOM_WARN rxvt_warn
302#include <iom_perl.h> 301#include "iom_perl.h"
303 302
304///////////////////////////////////////////////////////////////////////////// 303/////////////////////////////////////////////////////////////////////////////
305 304
306struct rxvt_perl_interp rxvt_perl; 305struct rxvt_perl_interp rxvt_perl;
307 306
640 static const struct { 639 static const struct {
641 const char *name; 640 const char *name;
642 IV iv; 641 IV iv;
643 } *civ, const_iv[] = { 642 } *civ, const_iv[] = {
644# define const_iv(name) { # name, (IV)name } 643# define const_iv(name) { # name, (IV)name }
644 const_iv (NUM_RESOURCES),
645 const_iv (DEFAULT_RSTYLE), 645 const_iv (DEFAULT_RSTYLE),
646 const_iv (OVERLAY_RSTYLE), 646 const_iv (OVERLAY_RSTYLE),
647 const_iv (RS_Bold), 647 const_iv (RS_Bold),
648 const_iv (RS_Italic), 648 const_iv (RS_Italic),
649 const_iv (RS_Blink), 649 const_iv (RS_Blink),
1097 { 1097 {
1098 case 0: RETVAL = THIS->ModLevel3Mask; break; 1098 case 0: RETVAL = THIS->ModLevel3Mask; break;
1099 case 1: RETVAL = THIS->ModMetaMask; break; 1099 case 1: RETVAL = THIS->ModMetaMask; break;
1100 case 2: RETVAL = THIS->ModNumLockMask; break; 1100 case 2: RETVAL = THIS->ModNumLockMask; break;
1101 case 3: RETVAL = THIS->current_screen; break; 1101 case 3: RETVAL = THIS->current_screen; break;
1102#ifdef CURSOR_BLINK
1102 case 4: RETVAL = THIS->hidden_cursor; break; 1103 case 4: RETVAL = THIS->hidden_cursor; break;
1104#endif
1103 } 1105 }
1104 OUTPUT: 1106 OUTPUT:
1105 RETVAL 1107 RETVAL
1106 1108
1107char * 1109char *
1224 1226
1225void 1227void
1226rxvt_term::want_refresh () 1228rxvt_term::want_refresh ()
1227 CODE: 1229 CODE:
1228 THIS->want_refresh = 1; 1230 THIS->want_refresh = 1;
1231 THIS->refresh_check ();
1229 1232
1230void 1233void
1231rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0, int start_ofs = 0, int max_len = MAX_COLS) 1234rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0, int start_ofs = 0, int max_len = MAX_COLS)
1232 PPCODE: 1235 PPCODE:
1233{ 1236{
1430# undef reserve 1433# undef reserve
1431 }; 1434 };
1432 1435
1433 rs = rslist + sizeof (rslist) / sizeof (rslist [0]); 1436 rs = rslist + sizeof (rslist) / sizeof (rslist [0]);
1434 1437
1438 if (*name)
1435 do { 1439 {
1440 do {
1436 if (rs-- == rslist) 1441 if (rs-- == rslist)
1437 croak ("no such resource '%s', requested", name); 1442 croak ("no such resource '%s', requested", name);
1438 } while (strcmp (name, rs->name)); 1443 } while (strcmp (name, rs->name));
1439 1444
1440 index += rs->value; 1445 index += rs->value;
1446 }
1447 else
1448 {
1449 --rs;
1450 name = "";
1451 }
1441 1452
1442 if (!IN_RANGE_EXC (index, 0, NUM_RESOURCES)) 1453 if (!IN_RANGE_EXC (index, 0, NUM_RESOURCES))
1443 croak ("requested out-of-bound resource %s+%d,", name, index - rs->value); 1454 croak ("requested out-of-bound resource %s+%d,", name, index - rs->value);
1444 1455
1445 if (GIMME_V != G_VOID) 1456 if (GIMME_V != G_VOID)
1469 1480
1470 if (set >= 0) 1481 if (set >= 0)
1471 { 1482 {
1472 THIS->set_option (optval, set); 1483 THIS->set_option (optval, set);
1473 1484
1474 if (THIS->prepare_ev.is_active ()) // avoid doing this before START 1485 if (THIS->env_colorfgbg [0]) // avoid doing this before START
1475 switch (optval) 1486 switch (optval)
1476 { 1487 {
1477 case Opt_skipBuiltinGlyphs: 1488 case Opt_skipBuiltinGlyphs:
1478 THIS->set_fonts (); 1489 THIS->set_fonts ();
1479 THIS->scr_remap_chars (); 1490 THIS->scr_remap_chars ();
1480 THIS->scr_touch (true); 1491 THIS->scr_touch (true);
1481 THIS->want_refresh = 1; 1492 THIS->want_refresh = 1;
1493 THIS->refresh_check ();
1482 break; 1494 break;
1483 1495
1484 case Opt_cursorUnderline: 1496 case Opt_cursorUnderline:
1485 THIS->want_refresh = 1; 1497 THIS->want_refresh = 1;
1498 THIS->refresh_check ();
1486 break; 1499 break;
1487 1500
1488# case Opt_scrollBar_floating: 1501# case Opt_scrollBar_floating:
1489# case Opt_scrollBar_right: 1502# case Opt_scrollBar_right:
1490# THIS->resize_all_windows (THIS->width, THIS->height, 1); 1503# THIS->resize_all_windows (THIS->width, THIS->height, 1);
1548 1561
1549 clamp_it (rc.col, 0, THIS->ncol); 1562 clamp_it (rc.col, 0, THIS->ncol);
1550 clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); 1563 clamp_it (rc.row, THIS->top_row, THIS->nrow - 1);
1551 1564
1552 if (ix) 1565 if (ix)
1566 {
1553 THIS->want_refresh = 1; 1567 THIS->want_refresh = 1;
1568 THIS->refresh_check ();
1569 }
1554 } 1570 }
1555} 1571}
1556 1572
1557char 1573char
1558rxvt_term::cur_charset () 1574rxvt_term::cur_charset ()
1698 XFree (prop); 1714 XFree (prop);
1699 } 1715 }
1700} 1716}
1701 1717
1702void 1718void
1703rxvt_term::XChangeWindowProperty (Window window, Atom property, Atom type, int format, SV *data) 1719rxvt_term::XChangeProperty (Window window, Atom property, Atom type, int format, SV *data)
1704 CODE: 1720 CODE:
1705{ 1721{
1706 STRLEN len; 1722 STRLEN len;
1707 char *data_ = SvPVbyte (data, len); 1723 char *data_ = SvPVbyte (data, len);
1708 1724

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines