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 | |
221 | void |
218 | void |
222 | overlay::hide () |
219 | overlay::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 | |
244 | void overlay::swap () |
242 | void 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 | |
306 | struct rxvt_perl_interp rxvt_perl; |
305 | struct rxvt_perl_interp rxvt_perl; |
307 | |
306 | |
… | |
… | |
1224 | |
1223 | |
1225 | void |
1224 | void |
1226 | rxvt_term::want_refresh () |
1225 | rxvt_term::want_refresh () |
1227 | CODE: |
1226 | CODE: |
1228 | THIS->want_refresh = 1; |
1227 | THIS->want_refresh = 1; |
|
|
1228 | THIS->refresh_check (); |
1229 | |
1229 | |
1230 | void |
1230 | void |
1231 | rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0, int start_ofs = 0, int max_len = MAX_COLS) |
1231 | rxvt_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: |
1232 | PPCODE: |
1233 | { |
1233 | { |
… | |
… | |
1469 | |
1469 | |
1470 | if (set >= 0) |
1470 | if (set >= 0) |
1471 | { |
1471 | { |
1472 | THIS->set_option (optval, set); |
1472 | THIS->set_option (optval, set); |
1473 | |
1473 | |
1474 | if (THIS->prepare_ev.is_active ()) // avoid doing this before START |
1474 | if (THIS->env_colorfgbg [0]) // avoid doing this before START |
1475 | switch (optval) |
1475 | switch (optval) |
1476 | { |
1476 | { |
1477 | case Opt_skipBuiltinGlyphs: |
1477 | case Opt_skipBuiltinGlyphs: |
1478 | THIS->set_fonts (); |
1478 | THIS->set_fonts (); |
1479 | THIS->scr_remap_chars (); |
1479 | THIS->scr_remap_chars (); |
1480 | THIS->scr_touch (true); |
1480 | THIS->scr_touch (true); |
1481 | THIS->want_refresh = 1; |
1481 | THIS->want_refresh = 1; |
|
|
1482 | THIS->refresh_check (); |
1482 | break; |
1483 | break; |
1483 | |
1484 | |
1484 | case Opt_cursorUnderline: |
1485 | case Opt_cursorUnderline: |
1485 | THIS->want_refresh = 1; |
1486 | THIS->want_refresh = 1; |
|
|
1487 | THIS->refresh_check (); |
1486 | break; |
1488 | break; |
1487 | |
1489 | |
1488 | # case Opt_scrollBar_floating: |
1490 | # case Opt_scrollBar_floating: |
1489 | # case Opt_scrollBar_right: |
1491 | # case Opt_scrollBar_right: |
1490 | # THIS->resize_all_windows (THIS->width, THIS->height, 1); |
1492 | # THIS->resize_all_windows (THIS->width, THIS->height, 1); |
… | |
… | |
1548 | |
1550 | |
1549 | clamp_it (rc.col, 0, THIS->ncol); |
1551 | clamp_it (rc.col, 0, THIS->ncol); |
1550 | clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); |
1552 | clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); |
1551 | |
1553 | |
1552 | if (ix) |
1554 | if (ix) |
|
|
1555 | { |
1553 | THIS->want_refresh = 1; |
1556 | THIS->want_refresh = 1; |
|
|
1557 | THIS->refresh_check (); |
|
|
1558 | } |
1554 | } |
1559 | } |
1555 | } |
1560 | } |
1556 | |
1561 | |
1557 | char |
1562 | char |
1558 | rxvt_term::cur_charset () |
1563 | rxvt_term::cur_charset () |