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.128 by root, Sat Dec 26 09:42:16 2009 UTC vs.
Revision 1.172 by root, Tue Jun 5 22:46:50 2012 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-2008 Marc Lehmann <pcg@goof.com> 6 * Copyright (c) 2005-2008,2011 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 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.
23#define line_t perl_line_t 23#define line_t perl_line_t
24#include <EXTERN.h> 24#include <EXTERN.h>
25#include <perl.h> 25#include <perl.h>
26#include <XSUB.h> 26#include <XSUB.h>
27#undef line_t 27#undef line_t
28#undef bool // perl defines it's own bool type, except with g++... what a trap
28 29
29#include "../config.h" 30#include "../config.h"
30 31
31#include <cstddef> 32#include <stddef.h>
32#include <cstdarg> 33#include <stdarg.h>
33 34
34#include "unistd.h" 35#include "unistd.h"
35 36
36#include "ev_cpp.h" 37#include "ev_cpp.h"
37#include "rxvt.h" 38#include "rxvt.h"
45 46
46#undef LINENO 47#undef LINENO
47#define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) 48#define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows)
48#undef ROW 49#undef ROW
49#define ROW(n) THIS->row_buf [LINENO (n)] 50#define ROW(n) THIS->row_buf [LINENO (n)]
51
52/////////////////////////////////////////////////////////////////////////////
53
54typedef char * octet_string;
55typedef char * utf8_string;
56
57typedef int render_repeat_mode;
58
59typedef GdkPixbuf * urxvt__pixbuf;
60typedef rxvt_img * urxvt__img;
61
62/////////////////////////////////////////////////////////////////////////////
63
64static void
65parse_color (rxvt_screen *s, rxvt_color &c, SV *sv)
66{
67 //TODO: support component stuff
68 c.set (s, SvPVbyte_nolen (sv));
69}
50 70
51///////////////////////////////////////////////////////////////////////////// 71/////////////////////////////////////////////////////////////////////////////
52 72
53static wchar_t * 73static wchar_t *
54sv2wcs (SV *sv) 74sv2wcs (SV *sv)
302 THIS->refresh_check (); 322 THIS->refresh_check ();
303} 323}
304 324
305///////////////////////////////////////////////////////////////////////////// 325/////////////////////////////////////////////////////////////////////////////
306 326
307#define IOM_CLASS "urxvt"
308#define IOM_WARN rxvt_warn
309#include "iom_perl.h" 327#include "iom_perl.h"
310 328
311///////////////////////////////////////////////////////////////////////////// 329/////////////////////////////////////////////////////////////////////////////
312 330
313struct rxvt_perl_interp rxvt_perl; 331struct rxvt_perl_interp rxvt_perl;
329{ 347{
330 if (!perl) 348 if (!perl)
331 { 349 {
332 rxvt_push_locale (""); // perl init destroys current locale 350 rxvt_push_locale (""); // perl init destroys current locale
333 351
352 {
334 perl_environ = rxvt_environ; 353 perl_environ = rxvt_environ;
335 swap (perl_environ, environ); 354 localise_env set_environ (perl_environ);
336 355
337 char *args[] = { 356 char *args[] = {
338 "", 357 "",
339 "-e" 358 "-e"
340 "BEGIN {" 359 "BEGIN {"
341 " urxvt->bootstrap;" 360 " urxvt->bootstrap;"
342 " unshift @INC, '" LIBDIR "';" 361 " unshift @INC, '" LIBDIR "';"
343 "}" 362 "}"
344 "" 363 ""
345 "use urxvt;" 364 "use urxvt;"
346 }; 365 };
347 int argc = sizeof (args) / sizeof (args[0]); 366 int argc = ecb_array_length (args);
348 char **argv = args; 367 char **argv = args;
349 368
350 PERL_SYS_INIT3 (&argc, &argv, &environ); 369 PERL_SYS_INIT3 (&argc, &argv, &environ);
351 perl = perl_alloc (); 370 perl = perl_alloc ();
352 perl_construct (perl); 371 perl_construct (perl);
353 372
354 if (perl_parse (perl, xs_init, argc, argv, (char **)NULL) 373 if (perl_parse (perl, xs_init, argc, argv, (char **)NULL)
355 || perl_run (perl)) 374 || perl_run (perl))
356 { 375 {
357 rxvt_warn ("unable to initialize perl-interpreter, continuing without.\n"); 376 rxvt_warn ("unable to initialize perl-interpreter, continuing without.\n");
358 377
359 perl_destruct (perl); 378 perl_destruct (perl);
360 perl_free (perl); 379 perl_free (perl);
361 perl = 0; 380 perl = 0;
362 } 381 }
363 382 }
364 swap (perl_environ, environ);
365 383
366 rxvt_pop_locale (); 384 rxvt_pop_locale ();
367 } 385 }
368 386
369 if (perl) 387 if (perl)
370 { 388 {
371 // runs outside of perls ENV 389 // runs outside of perls ENV
372 term->perl.self = (void *)newSVptr ((void *)term, "urxvt::term"); 390 term->perl.self = (void *)newSVptr ((void *)term, "urxvt::term");
373 hv_store ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, newRV_noinc ((SV *)newAV ()), 0); 391 hv_store ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, newRV_noinc ((SV *)newAV ()), 0);
392 hv_store ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, newRV_noinc ((SV *)newAV ()), 0);
374 } 393 }
394}
395
396void
397rxvt_perl_interp::usage (rxvt_term *term, int type)
398{
399 localise_env set_environ (perl_environ);
400
401 ENTER;
402 SAVETMPS;
403
404 dSP;
405 EXTEND (SP, 2);
406 PUSHs (sv_2mortal (newSVterm (term)));
407 PUSHs (sv_2mortal (newSViv (type)));
408 PUTBACK;
409 call_pv ("urxvt::usage", G_VOID | G_DISCARD | G_EVAL);
410
411 FREETMPS;
412 LEAVE;
413}
414
415uint8_t
416rxvt_perl_interp::resource (rxvt_term *term, const char *name, bool arg, bool longopt, bool flag, const char *value)
417{
418 localise_env set_environ (perl_environ);
419
420 ENTER;
421 SAVETMPS;
422
423 dSP;
424 EXTEND (SP, 6);
425 PUSHs (sv_2mortal (newSVterm (term)));
426 PUSHs (sv_2mortal (newSVpv (name, 0)));
427 PUSHs (arg ? &PL_sv_yes : &PL_sv_no);
428 PUSHs (longopt ? &PL_sv_yes : &PL_sv_no);
429 PUSHs (flag ? &PL_sv_yes : &PL_sv_no);
430 PUSHs (value ? sv_2mortal (newSVpv (value, 0)) : &PL_sv_undef);
431 PUTBACK;
432 call_pv ("urxvt::resource", G_SCALAR | G_EVAL);
433
434 uint8_t ret = POPi;
435
436 FREETMPS;
437 LEAVE;
438
439 return ret;
375} 440}
376 441
377static void 442static void
378ungrab (rxvt_term *THIS) 443ungrab (rxvt_term *THIS)
379{ 444{
389rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...) 454rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...)
390{ 455{
391 if (!perl || !term->perl.self) 456 if (!perl || !term->perl.self)
392 return false; 457 return false;
393 458
459 localise_env set_environ (perl_environ);
460
394 // pre-handling of some events 461 // pre-handling of some events
395 if (htype == HOOK_REFRESH_END) 462 if (htype == HOOK_REFRESH_END)
396 { 463 {
397 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0)); 464 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0));
398 465
399 for (int i = 0; i <= AvFILL (av); i++) 466 for (int i = 0; i <= AvFILL (av); i++)
400 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap (); 467 ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap ();
401 } 468 }
469 else if (htype == HOOK_DESTROY)
470 {
471 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, 0));
402 472
403 swap (perl_environ, environ); 473 for (int i = AvFILL (av); i >= 0; i--)
474 {
475 rxvt_selection *req = (rxvt_selection *)SvIV (*av_fetch (av, i, 0));
476 delete req;
477 }
478 }
404 479
405 bool event_consumed; 480 bool event_consumed;
406 481
407 if (htype == HOOK_INIT || htype == HOOK_DESTROY // must be called always
408 || term->perl.should_invoke [htype]) 482 if (term->perl.should_invoke [htype])
409 try
410 { 483 {
411 dSP; 484 dSP;
412 va_list ap; 485 va_list ap;
413 486
414 va_start (ap, htype); 487 va_start (ap, htype);
415 488
416 ENTER; 489 ENTER;
417 SAVETMPS; 490 SAVETMPS;
418 491
419 PUSHMARK (SP); 492 PUSHMARK (SP);
420 493
494 EXTEND (SP, 2);
421 XPUSHs (sv_2mortal (newSVterm (term))); 495 PUSHs (sv_2mortal (newSVterm (term)));
422 XPUSHs (sv_2mortal (newSViv (htype))); 496 PUSHs (sv_2mortal (newSViv (htype)));
423 497
424 for (;;) { 498 for (;;) {
425 data_type dt = (data_type)va_arg (ap, int); 499 data_type dt = (data_type)va_arg (ap, int);
426 500
427 switch (dt) 501 switch (dt)
428 { 502 {
429 case DT_INT: 503 case DT_INT:
430 XPUSHs (sv_2mortal (newSViv (va_arg (ap, int)))); 504 XPUSHs (sv_2mortal (newSViv (va_arg (ap, int))));
431 break; 505 break;
432 506
433 case DT_LONG: 507 case DT_LONG:
434 XPUSHs (sv_2mortal (newSViv (va_arg (ap, long)))); 508 XPUSHs (sv_2mortal (newSViv (va_arg (ap, long))));
435 break; 509 break;
436 510
437 case DT_STR: 511 case DT_STR:
438 XPUSHs (sv_2mortal (newSVpv (va_arg (ap, char *), 0))); 512 XPUSHs (sv_2mortal (newSVpv (va_arg (ap, char *), 0)));
439 break; 513 break;
440 514
441 case DT_STR_LEN: 515 case DT_STR_LEN:
442 { 516 {
443 char *str = va_arg (ap, char *); 517 char *str = va_arg (ap, char *);
444 int len = va_arg (ap, int); 518 int len = va_arg (ap, int);
445 519
446 XPUSHs (sv_2mortal (newSVpvn (str, len))); 520 XPUSHs (sv_2mortal (newSVpvn (str, len)));
447 } 521 }
448 break; 522 break;
449 523
450 case DT_WCS_LEN: 524 case DT_WCS_LEN:
451 { 525 {
452 wchar_t *wstr = va_arg (ap, wchar_t *); 526 wchar_t *wstr = va_arg (ap, wchar_t *);
453 int wlen = va_arg (ap, int); 527 int wlen = va_arg (ap, int);
454 528
455 XPUSHs (sv_2mortal (wcs2sv (wstr, wlen))); 529 XPUSHs (sv_2mortal (wcs2sv (wstr, wlen)));
456 } 530 }
457 break; 531 break;
458 532
459 case DT_LCS_LEN: 533 case DT_LCS_LEN:
460 { 534 {
461 long *lstr = va_arg (ap, long *); 535 long *lstr = va_arg (ap, long *);
462 int llen = va_arg (ap, int); 536 int llen = va_arg (ap, int);
463 537
464 XPUSHs (sv_2mortal (newSVpvn ((char *)lstr, llen * sizeof (long)))); 538 XPUSHs (sv_2mortal (newSVpvn ((char *)lstr, llen * sizeof (long))));
465 } 539 }
466 break; 540 break;
467 541
468 case DT_XEVENT: 542 case DT_XEVENT:
469 { 543 {
470 XEvent *xe = va_arg (ap, XEvent *); 544 XEvent *xe = va_arg (ap, XEvent *);
471 HV *hv = newHV (); 545 HV *hv = newHV ();
472 546
473# define set(name, sv) hv_store (hv, # name, sizeof (# name) - 1, sv, 0) 547# define set(name, sv) hv_store (hv, # name, sizeof (# name) - 1, sv, 0)
474# define setiv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSViv (val), 0) 548# define setiv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSViv (val), 0)
475# define setuv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSVuv (val), 0) 549# define setuv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSVuv (val), 0)
476# undef set 550# undef set
477 551
478 setiv (type, xe->type); 552 setiv (type, xe->type);
479 setiv (send_event, xe->xany.send_event); 553 setiv (send_event, xe->xany.send_event);
480 setiv (serial, xe->xany.serial); 554 setiv (serial, xe->xany.serial);
481 555
482 switch (xe->type) 556 switch (xe->type)
483 { 557 {
484 case KeyPress: 558 case KeyPress:
485 case KeyRelease: 559 case KeyRelease:
486 case ButtonPress: 560 case ButtonPress:
487 case ButtonRelease: 561 case ButtonRelease:
488 case MotionNotify: 562 case MotionNotify:
489 setuv (window, xe->xmotion.window); 563 setuv (window, xe->xmotion.window);
490 setuv (root, xe->xmotion.root); 564 setuv (root, xe->xmotion.root);
491 setuv (subwindow, xe->xmotion.subwindow); 565 setuv (subwindow, xe->xmotion.subwindow);
492 setuv (time, xe->xmotion.time); 566 setuv (time, xe->xmotion.time);
493 setiv (x, xe->xmotion.x); 567 setiv (x, xe->xmotion.x);
494 setiv (y, xe->xmotion.y); 568 setiv (y, xe->xmotion.y);
495 setiv (row, xe->xmotion.y / term->fheight + term->view_start); 569 setiv (row, xe->xmotion.y / term->fheight + term->view_start);
496 setiv (col, xe->xmotion.x / term->fwidth); 570 setiv (col, xe->xmotion.x / term->fwidth);
497 setiv (x_root, xe->xmotion.x_root); 571 setiv (x_root, xe->xmotion.x_root);
498 setiv (y_root, xe->xmotion.y_root); 572 setiv (y_root, xe->xmotion.y_root);
499 setuv (state, xe->xmotion.state); 573 setuv (state, xe->xmotion.state);
500 574
501 switch (xe->type) 575 switch (xe->type)
502 { 576 {
503 case KeyPress: 577 case KeyPress:
504 case KeyRelease: 578 case KeyRelease:
505 setuv (keycode, xe->xkey.keycode); 579 setuv (keycode, xe->xkey.keycode);
506 break; 580 break;
507 581
508 case ButtonPress: 582 case ButtonPress:
509 case ButtonRelease: 583 case ButtonRelease:
510 setuv (button, xe->xbutton.button); 584 setuv (button, xe->xbutton.button);
511 break; 585 break;
512 586
513 case MotionNotify: 587 case MotionNotify:
514 setiv (is_hint, xe->xmotion.is_hint); 588 setiv (is_hint, xe->xmotion.is_hint);
515 break; 589 break;
516 } 590 }
517 591
518 break; 592 break;
519 593
520 case MapNotify: 594 case MapNotify:
521 case UnmapNotify: 595 case UnmapNotify:
522 case ConfigureNotify: 596 case ConfigureNotify:
523 setuv (event, xe->xconfigure.event); 597 setuv (event, xe->xconfigure.event);
524 setuv (window, xe->xconfigure.window); 598 setuv (window, xe->xconfigure.window);
525 599
526 switch (xe->type) 600 switch (xe->type)
527 { 601 {
528 case ConfigureNotify: 602 case ConfigureNotify:
529 setiv (x, xe->xconfigure.x); 603 setiv (x, xe->xconfigure.x);
530 setiv (y, xe->xconfigure.y); 604 setiv (y, xe->xconfigure.y);
531 setiv (width, xe->xconfigure.width); 605 setiv (width, xe->xconfigure.width);
532 setiv (height, xe->xconfigure.height); 606 setiv (height, xe->xconfigure.height);
533 setuv (above, xe->xconfigure.above); 607 setuv (above, xe->xconfigure.above);
534 break; 608 break;
535 } 609 }
536 610
537 break; 611 break;
538 612
539 case PropertyNotify: 613 case PropertyNotify:
540 setuv (window, xe->xproperty.window); 614 setuv (window, xe->xproperty.window);
541 setuv (atom, xe->xproperty.atom); 615 setuv (atom, xe->xproperty.atom);
542 setuv (time, xe->xproperty.time); 616 setuv (time, xe->xproperty.time);
543 setiv (state, xe->xproperty.state); 617 setiv (state, xe->xproperty.state);
544 break; 618 break;
545 619
546 case ClientMessage: 620 case ClientMessage:
547 setuv (window, xe->xclient.window); 621 setuv (window, xe->xclient.window);
548 setuv (message_type, xe->xclient.message_type); 622 setuv (message_type, xe->xclient.message_type);
549 setuv (format, xe->xclient.format); 623 setuv (format, xe->xclient.format);
550 setuv (l0, xe->xclient.data.l[0]); 624 setuv (l0, xe->xclient.data.l[0]);
551 setuv (l1, xe->xclient.data.l[1]); 625 setuv (l1, xe->xclient.data.l[1]);
552 setuv (l2, xe->xclient.data.l[2]); 626 setuv (l2, xe->xclient.data.l[2]);
553 setuv (l3, xe->xclient.data.l[3]); 627 setuv (l3, xe->xclient.data.l[3]);
554 setuv (l4, xe->xclient.data.l[4]); 628 setuv (l4, xe->xclient.data.l[4]);
555 break; 629 break;
556 } 630 }
557 631
558 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); 632 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv)));
559 } 633 }
560 break; 634 break;
561 635
562 case DT_END: 636 case DT_END:
563 goto call; 637 goto call;
564 638
565 default: 639 default:
566 rxvt_fatal ("FATAL: unable to pass data type %d\n", dt); 640 rxvt_fatal ("FATAL: unable to pass data type %d\n", dt);
567 } 641 }
642 }
643
644 call:
645 va_end (ap);
646
647 PUTBACK;
648 int count = call_pv ("urxvt::invoke", G_ARRAY | G_EVAL);
649 SPAGAIN;
650
651 if (count)
652 {
653 SV *status = POPs;
654 count = SvTRUE (status);
568 } 655 }
569 656
570 call:
571 va_end (ap);
572
573 PUTBACK; 657 PUTBACK;
574 int count = call_pv ("urxvt::invoke", G_ARRAY | G_EVAL);
575 SPAGAIN;
576
577 if (count)
578 {
579 SV *status = POPs;
580 count = SvTRUE (status);
581 }
582
583 PUTBACK;
584 FREETMPS; 658 FREETMPS;
585 LEAVE; 659 LEAVE;
586 660
587 if (SvTRUE (ERRSV)) 661 if (SvTRUE (ERRSV))
588 { 662 {
589 rxvt_warn ("perl hook %d evaluation error: %s", htype, SvPV_nolen (ERRSV)); 663 rxvt_warn ("perl hook %d evaluation error: %s", htype, SvPVbyte_nolen (ERRSV));
590 ungrab (term); // better lose the grab than the session 664 ungrab (term); // better lose the grab than the session
591 } 665 }
592 666
593 event_consumed = !!count; 667 event_consumed = !!count;
594 } 668 }
595 catch (...)
596 {
597 swap (perl_environ, environ);
598 throw;
599 }
600 else 669 else
601 event_consumed = false; 670 event_consumed = false;
602 671
603 // post-handling of some events 672 // post-handling of some events
604 if (htype == HOOK_REFRESH_BEGIN) 673 if (htype == HOOK_REFRESH_BEGIN)
615 684
616 // don't allow further calls 685 // don't allow further calls
617 term->perl.self = 0; 686 term->perl.self = 0;
618 } 687 }
619 688
620 swap (perl_environ, environ);
621
622 return event_consumed; 689 return event_consumed;
690}
691
692void
693rxvt_perl_interp::selection_finish (rxvt_selection *sel, char *data, unsigned int len)
694{
695 localise_env set_environ (perl_environ);
696
697 ENTER;
698 SAVETMPS;
699
700 dSP;
701 XPUSHs (sv_2mortal (newSVpvn (data, len)));
702 PUTBACK;
703 call_sv ((SV *)sel->cb_sv, G_VOID | G_DISCARD | G_EVAL);
704
705 if (SvTRUE (ERRSV))
706 rxvt_warn ("perl selection callback evaluation error: %s", SvPVbyte_nolen (ERRSV));
707
708 FREETMPS;
709 LEAVE;
623} 710}
624 711
625///////////////////////////////////////////////////////////////////////////// 712/////////////////////////////////////////////////////////////////////////////
626 713
627MODULE = urxvt PACKAGE = urxvt 714MODULE = urxvt PACKAGE = urxvt
639# define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); 726# define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0));
640# include "hookinc.h" 727# include "hookinc.h"
641# undef def 728# undef def
642 729
643 HV *option = get_hv ("urxvt::OPTION", 1); 730 HV *option = get_hv ("urxvt::OPTION", 1);
644# define def(name,val) hv_store (option, # name, sizeof (# name) - 1, newSVuv (Opt_ ## name), 0); 731# define def(name) hv_store (option, # name, sizeof (# name) - 1, newSVuv (Opt_ ## name), 0);
645# define nodef(name) 732# define nodef(name)
646# include "optinc.h" 733# include "optinc.h"
647# undef nodef 734# undef nodef
648# undef def 735# undef def
649 736
654 } *civ, const_iv[] = { 741 } *civ, const_iv[] = {
655# define const_iv(name) { # name, (IV)name } 742# define const_iv(name) { # name, (IV)name }
656 const_iv (NUM_RESOURCES), 743 const_iv (NUM_RESOURCES),
657 const_iv (DEFAULT_RSTYLE), 744 const_iv (DEFAULT_RSTYLE),
658 const_iv (OVERLAY_RSTYLE), 745 const_iv (OVERLAY_RSTYLE),
746 const_iv (Color_Bits),
747 const_iv (RS_bgShift), const_iv (RS_bgMask),
748 const_iv (RS_fgShift), const_iv (RS_fgMask),
749 const_iv (RS_Careful),
750 const_iv (RS_fontCount),
751 const_iv (RS_fontShift),
752 const_iv (RS_fontMask),
753 const_iv (RS_baseattrMask),
754 const_iv (RS_attrMask),
755 const_iv (RS_redraw),
756 const_iv (RS_Sel),
659 const_iv (RS_Bold), 757 const_iv (RS_Bold),
660 const_iv (RS_Italic), 758 const_iv (RS_Italic),
661 const_iv (RS_Blink), 759 const_iv (RS_Blink),
662 const_iv (RS_RVid), 760 const_iv (RS_RVid),
663 const_iv (RS_Uline), 761 const_iv (RS_Uline),
750 const_iv (XIMSecondary), 848 const_iv (XIMSecondary),
751 const_iv (XIMTertiary), 849 const_iv (XIMTertiary),
752 const_iv (XIMVisibleToForward), 850 const_iv (XIMVisibleToForward),
753 const_iv (XIMVisibleToBackword), 851 const_iv (XIMVisibleToBackword),
754 const_iv (XIMVisibleToCenter), 852 const_iv (XIMVisibleToCenter),
853#if XRENDER
854 const_iv (PictStandardARGB32),
855 const_iv (PictStandardRGB24),
856 const_iv (PictStandardA8),
857 const_iv (PictStandardA4),
858 const_iv (PictStandardA1),
859 const_iv (RepeatNone),
860 const_iv (RepeatNormal),
861 const_iv (RepeatPad),
862 const_iv (RepeatReflect),
863#endif
755# if 0 864# if 0
756 const_iv (XIMForwardChar), 865 const_iv (XIMForwardChar),
757 const_iv (XIMBackwardChar), 866 const_iv (XIMBackwardChar),
758 const_iv (XIMForwardWord), 867 const_iv (XIMForwardWord),
759 const_iv (XIMBackwardWord), 868 const_iv (XIMBackwardWord),
767 const_iv (XIMDontChange), 876 const_iv (XIMDontChange),
768# endif 877# endif
769# endif 878# endif
770 }; 879 };
771 880
772 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 881 for (civ = const_iv + ecb_array_length (const_iv); civ > const_iv; civ--)
773 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 882 newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv));
774} 883}
884
885void
886log (const char *msg)
887 CODE:
888 rxvt_log ("%s", msg);
775 889
776void 890void
777warn (const char *msg) 891warn (const char *msg)
778 CODE: 892 CODE:
779 rxvt_warn ("%s", msg); 893 rxvt_warn ("%s", msg);
783 CODE: 897 CODE:
784 rxvt_fatal ("%s", msg); 898 rxvt_fatal ("%s", msg);
785 899
786void 900void
787_exit (int status) 901_exit (int status)
902
903void
904catch_fatal (SV *block)
905 PROTOTYPE: &
906 CODE:
907 try
908 {
909 PUSHMARK (SP);
910 PUTBACK;
911 call_sv (block, G_VOID | G_DISCARD);
912 SPAGAIN;
913 }
914 catch (const rxvt_failure_exception &e)
915 {
916 croak ("rxvt_fatal exception caught, trying to continue.");
917 }
788 918
789NV 919NV
790NOW () 920NOW ()
791 CODE: 921 CODE:
792 RETVAL = ev::now (); 922 RETVAL = ev::now ();
850 for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++) 980 for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++)
851 if ((*t)->perl.self) 981 if ((*t)->perl.self)
852 PUSHs (sv_2mortal (newSVterm (*t))); 982 PUSHs (sv_2mortal (newSVterm (*t)));
853} 983}
854 984
985IV
986_new_selection_request (rxvt_term *term, int selnum, Time tm, Window win, Atom prop, SV *cb)
987 CODE:
988 rxvt_selection *req = new rxvt_selection (term->display, selnum, tm, win, prop, term);
989 req->cb_sv = newSVsv (cb);
990 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, 0));
991 av_push (av, newSViv ((IV)req));
992 RETVAL = (IV)req;
993 OUTPUT:
994 RETVAL
995
996void
997_delete_selection_request (IV req_)
998 CODE:
999 rxvt_selection *req = (rxvt_selection *)req_;
1000 AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)req->term->perl.self), "_selection", 10, 0));
1001 int i;
1002
1003 for (i = AvFILL (av); i >= 0; i--)
1004 if (SvIV (*av_fetch (av, i, 1)) == req_)
1005 break;
1006
1007 for (; i < AvFILL (av); i++)
1008 av_store (av, i, SvREFCNT_inc (*av_fetch (av, i + 1, 0)));
1009
1010 av_pop (av);
1011
1012 delete req;
1013
855MODULE = urxvt PACKAGE = urxvt::term 1014MODULE = urxvt PACKAGE = urxvt::term
856 1015
857SV * 1016SV *
858_new (AV *env, AV *arg) 1017_new (AV *env, AV *arg)
859 CODE: 1018 CODE:
860{ 1019{
861 rxvt_term *term = new rxvt_term; 1020 rxvt_term *term = new rxvt_term;
862 1021
863 stringvec *argv = new stringvec; 1022 stringvec *argv = new stringvec;
864 stringvec *envv = new stringvec;
865
866 for (int i = 0; i <= AvFILL (arg); i++) 1023 for (int i = 0; i <= AvFILL (arg); i++)
867 argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1)))); 1024 argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1))));
868 1025
1026 stringvec *envv = new stringvec;
869 for (int i = AvFILL (env) + 1; i--; ) 1027 for (int i = AvFILL (env) + 1; i--; )
870 envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); 1028 envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1))));
871 1029
872 envv->push_back (0);
873
874 try 1030 try
875 { 1031 {
876 term->init (argv, envv); 1032 term->init (argv, envv);
877 } 1033 }
878 catch (const class rxvt_failure_exception &e) 1034 catch (const class rxvt_failure_exception &e)
891rxvt_term::destroy () 1047rxvt_term::destroy ()
892 1048
893void 1049void
894rxvt_term::set_should_invoke (int htype, int inc) 1050rxvt_term::set_should_invoke (int htype, int inc)
895 CODE: 1051 CODE:
896 THIS->perl.should_invoke [htype] += inc; 1052 uint8_t &count = THIS->perl.should_invoke [htype];
1053 uint8_t prev = count;
1054 count += inc;
1055 if (!prev != !count)
1056 {
1057 // hook status changed, react
1058 switch (htype)
1059 {
1060 case HOOK_POSITION_CHANGE:
1061 if (count)
1062 THIS->get_window_origin (THIS->parent_x, THIS->parent_y);
1063 }
1064 }
897 1065
898int 1066int
899rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) 1067rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt)
900 CODE: 1068 CODE:
901 RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1, 1069 RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1,
917 1085
918void 1086void
919rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt) 1087rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt)
920 CODE: 1088 CODE:
921 XUngrabKey (THIS->dpy, keycode, modifiers, window); 1089 XUngrabKey (THIS->dpy, keycode, modifiers, window);
922
923void
924rxvt_term::XUngrabKeyboard (Time eventtime)
925 CODE:
926 XUngrabKeyboard (THIS->dpy, eventtime);
927 1090
928bool 1091bool
929rxvt_term::grab (Time eventtime, int sync = 0) 1092rxvt_term::grab (Time eventtime, int sync = 0)
930 CODE: 1093 CODE:
931{ 1094{
1043 rxvt_pop_locale (); 1206 rxvt_pop_locale ();
1044 1207
1045 RETVAL = wcs2sv (wstr); 1208 RETVAL = wcs2sv (wstr);
1046 free (wstr); 1209 free (wstr);
1047} 1210}
1048 OUTPUT:
1049 RETVAL
1050
1051char *
1052rxvt_term::locale ()
1053 CODE:
1054 RETVAL = THIS->locale;
1055 OUTPUT: 1211 OUTPUT:
1056 RETVAL 1212 RETVAL
1057 1213
1058#define TERM_OFFSET(sym) offsetof (TermWin_t, sym) 1214#define TERM_OFFSET(sym) offsetof (TermWin_t, sym)
1059 1215
1166 RETVAL 1322 RETVAL
1167 1323
1168Window 1324Window
1169rxvt_term::parent () 1325rxvt_term::parent ()
1170 CODE: 1326 CODE:
1171 RETVAL = THIS->parent [0]; 1327 RETVAL = THIS->parent;
1172 OUTPUT: 1328 OUTPUT:
1173 RETVAL 1329 RETVAL
1174 1330
1175Window 1331int
1176rxvt_term::vt () 1332rxvt_term::parent_x ()
1177 CODE: 1333 CODE:
1178 RETVAL = THIS->vt; 1334 RETVAL = THIS->parent_x;
1335 OUTPUT:
1336 RETVAL
1337
1338int
1339rxvt_term::parent_y ()
1340 CODE:
1341 RETVAL = THIS->parent_y;
1179 OUTPUT: 1342 OUTPUT:
1180 RETVAL 1343 RETVAL
1181 1344
1182void 1345void
1183rxvt_term::vt_emask_add (U32 emask) 1346rxvt_term::vt_emask_add (U32 emask)
1203 if (newval <= 0) 1366 if (newval <= 0)
1204 THIS->scr_changeview (max (newval, THIS->top_row)); 1367 THIS->scr_changeview (max (newval, THIS->top_row));
1205} 1368}
1206 OUTPUT: 1369 OUTPUT:
1207 RETVAL 1370 RETVAL
1371
1372void
1373rxvt_term::set_urgency (bool enable)
1208 1374
1209void 1375void
1210rxvt_term::focus_in () 1376rxvt_term::focus_in ()
1211 1377
1212void 1378void
1445# include "rsinc.h" 1611# include "rsinc.h"
1446# undef def 1612# undef def
1447# undef reserve 1613# undef reserve
1448 }; 1614 };
1449 1615
1450 rs = rslist + sizeof (rslist) / sizeof (rslist [0]); 1616 rs = rslist + ecb_array_length (rslist);
1451 1617
1452 if (*name) 1618 if (*name)
1453 { 1619 {
1454 do { 1620 do {
1455 if (rs-- == rslist) 1621 if (rs-- == rslist)
1494 1660
1495 if (set >= 0) 1661 if (set >= 0)
1496 { 1662 {
1497 THIS->set_option (optval, set); 1663 THIS->set_option (optval, set);
1498 1664
1499 if (THIS->env_colorfgbg [0]) // avoid doing this before START 1665 if (THIS->init_done) // avoid doing this before START
1500 switch (optval) 1666 switch (optval)
1501 { 1667 {
1502 case Opt_skipBuiltinGlyphs: 1668 case Opt_skipBuiltinGlyphs:
1503 THIS->set_fonts (); 1669 THIS->set_fonts ();
1504 THIS->scr_remap_chars (); 1670 THIS->scr_remap_chars ();
1505 THIS->scr_touch (true); 1671 THIS->scr_touch (true);
1506 THIS->want_refresh = 1; 1672 THIS->want_refresh = 1;
1507 THIS->refresh_check (); 1673 THIS->refresh_check ();
1508 break; 1674 break;
1675#ifdef CURSOR_BLINK
1676 case Opt_cursorBlink:
1677 THIS->cursor_blink_reset ();
1678 break;
1679#endif
1509 1680
1510 case Opt_cursorUnderline: 1681 case Opt_cursorUnderline:
1511 THIS->want_refresh = 1; 1682 THIS->want_refresh = 1;
1512 THIS->refresh_check (); 1683 THIS->refresh_check ();
1513 break; 1684 break;
1527 CODE: 1698 CODE:
1528 RETVAL = 0 < THIS->parse_keysym (keysym, str); 1699 RETVAL = 0 < THIS->parse_keysym (keysym, str);
1529 THIS->keyboard->register_done (); 1700 THIS->keyboard->register_done ();
1530 OUTPUT: 1701 OUTPUT:
1531 RETVAL 1702 RETVAL
1703
1704void
1705rxvt_term::register_command (int keysym, unsigned int state, SV *str)
1706 CODE:
1707 wchar_t *wstr = sv2wcs (str);
1708 THIS->keyboard->register_user_translation (keysym, state, wstr);
1709 free (wstr);
1532 1710
1533void 1711void
1534rxvt_term::screen_cur (...) 1712rxvt_term::screen_cur (...)
1535 PROTOTYPE: $;$$ 1713 PROTOTYPE: $;$$
1536 ALIAS: 1714 ALIAS:
1594 THIS->selection.screen = screen; 1772 THIS->selection.screen = screen;
1595 OUTPUT: 1773 OUTPUT:
1596 RETVAL 1774 RETVAL
1597 1775
1598void 1776void
1599rxvt_term::selection_clear () 1777rxvt_term::selection_clear (bool clipboard = false)
1600 1778
1601void 1779void
1602rxvt_term::selection_make (Time eventtime, bool rect = false) 1780rxvt_term::selection_make (Time eventtime, bool rect = false)
1603 CODE: 1781 CODE:
1604 THIS->selection.op = SELECTION_CONT; 1782 THIS->selection.op = SELECTION_CONT;
1605 THIS->selection.rect = rect; 1783 THIS->selection.rect = rect;
1606 THIS->selection_make (eventtime); 1784 THIS->selection_make (eventtime);
1607 1785
1608int 1786int
1609rxvt_term::selection_grab (Time eventtime) 1787rxvt_term::selection_grab (Time eventtime, bool clipboard = false)
1610 1788
1611void 1789void
1612rxvt_term::selection (SV *newtext = 0) 1790rxvt_term::selection (SV *newtext = 0, bool clipboard = false)
1613 PPCODE: 1791 PPCODE:
1614{ 1792{
1793 wchar_t * &text = clipboard ? THIS->selection.clip_text : THIS->selection.text;
1794 unsigned int &len = clipboard ? THIS->selection.clip_len : THIS->selection.len;
1795
1615 if (GIMME_V != G_VOID) 1796 if (GIMME_V != G_VOID)
1616 XPUSHs (THIS->selection.text 1797 XPUSHs (text
1617 ? sv_2mortal (wcs2sv (THIS->selection.text, THIS->selection.len)) 1798 ? sv_2mortal (wcs2sv (text, len))
1618 : &PL_sv_undef); 1799 : &PL_sv_undef);
1619 1800
1620 if (newtext) 1801 if (newtext)
1621 { 1802 {
1622 free (THIS->selection.text); 1803 free (text);
1623 1804
1624 THIS->selection.text = sv2wcs (newtext); 1805 text = sv2wcs (newtext);
1625 THIS->selection.len = wcslen (THIS->selection.text); 1806 len = wcslen (text);
1626 } 1807 }
1627} 1808}
1628 1809
1629char 1810char
1630rxvt_term::cur_charset () 1811rxvt_term::cur_charset ()
1639void 1820void
1640rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, U32 rstyle = RS_RVid) 1821rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, U32 rstyle = RS_RVid)
1641 1822
1642void 1823void
1643rxvt_term::scr_bell () 1824rxvt_term::scr_bell ()
1825
1826void
1827rxvt_term::scr_recolour (bool refresh = true);
1644 1828
1645void 1829void
1646rxvt_term::scr_change_screen (int screen) 1830rxvt_term::scr_change_screen (int screen)
1647 1831
1648void 1832void
1661 char *str = SvPVbyte (octets, len); 1845 char *str = SvPVbyte (octets, len);
1662 C_ARGS: 1846 C_ARGS:
1663 str, len 1847 str, len
1664 1848
1665void 1849void
1850rxvt_term::tt_paste (SV *octets)
1851 INIT:
1852 STRLEN len;
1853 char *str = SvPVbyte (octets, len);
1854 C_ARGS:
1855 str, len
1856
1857void
1666rxvt_term::cmd_parse (SV *octets) 1858rxvt_term::cmd_parse (SV *octets)
1667 CODE: 1859 CODE:
1668{ 1860{
1669 STRLEN len; 1861 STRLEN len;
1670 char *str = SvPVbyte (octets, len); 1862 char *str = SvPVbyte (octets, len);
1755 type, format, PropModeReplace, 1947 type, format, PropModeReplace,
1756 (unsigned char *)data_, len / elemsize); 1948 (unsigned char *)data_, len / elemsize);
1757} 1949}
1758 1950
1759Atom 1951Atom
1760XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE) 1952XInternAtom (rxvt_term *term, octet_string atom_name, int only_if_exists = FALSE)
1761 C_ARGS: term->dpy, atom_name, only_if_exists 1953 C_ARGS: term->dpy, atom_name, only_if_exists
1762 1954
1763char * 1955char *
1764XGetAtomName (rxvt_term *term, Atom atom) 1956XGetAtomName (rxvt_term *term, Atom atom)
1765 C_ARGS: term->dpy, atom 1957 C_ARGS: term->dpy, atom
1766 CLEANUP: 1958 CLEANUP:
1767 XFree (RETVAL); 1959 XFree (RETVAL);
1768 1960
1769void 1961void
1770XDeleteProperty (rxvt_term *term, Window window, Atom property) 1962XDeleteProperty (rxvt_term *term, Window window, Atom property)
1771 C_ARGS: term->dpy, window, property 1963 C_ARGS: term->dpy, window, property
1772 1964
1773Window 1965Window
1774rxvt_term::DefaultRootWindow () 1966rxvt_term::DefaultRootWindow ()
1775 CODE: 1967 CODE:
1776 RETVAL = THIS->display->root; 1968 RETVAL = THIS->display->root;
1828 PUSHs (newSVuv (child)); 2020 PUSHs (newSVuv (child));
1829 } 2021 }
1830} 2022}
1831 2023
1832############################################################################# 2024#############################################################################
2025# fancy bg bloatstuff (TODO: should be moved up somewhere)
2026
2027# TODO: ugly
2028void
2029rxvt_term::get_geometry ()
2030 PPCODE:
2031 EXTEND (SP, 4);
2032 PUSHs (sv_2mortal (newSViv (THIS->parent_x)));
2033 PUSHs (sv_2mortal (newSViv (THIS->parent_y)));
2034 PUSHs (sv_2mortal (newSViv (THIS->szHint.width)));
2035 PUSHs (sv_2mortal (newSViv (THIS->szHint.height)));
2036
2037#if HAVE_IMG
2038
2039rxvt_img *
2040rxvt_term::new_img (SV *format, int width, int height)
2041 CODE:
2042 XRenderPictFormat *f = SvOK (format)
2043 ? XRenderFindStandardFormat (THIS->dpy, SvIV (format))
2044 : XRenderFindVisualFormat (THIS->dpy, THIS->visual);
2045 RETVAL = new rxvt_img (THIS, f, width, height);
2046 OUTPUT:
2047 RETVAL
2048
2049#if ENABLE_TRANSPARENCY
2050
2051rxvt_img *
2052rxvt_term::new_img_from_root ()
2053 CODE:
2054 RETVAL = rxvt_img::new_from_root (THIS);
2055 OUTPUT:
2056 RETVAL
2057
2058#endif
2059
2060#if HAVE_PIXBUF
2061
2062rxvt_img *
2063rxvt_term::new_img_from_file (octet_string filename)
2064 CODE:
2065 try
2066 {
2067 RETVAL = rxvt_img::new_from_file (THIS, filename);
2068 }
2069 catch (const class rxvt_failure_exception &e)
2070 {
2071 croak ("new_img_from_file failed");
2072 }
2073 OUTPUT:
2074 RETVAL
2075
2076#endif
2077
2078#if HAVE_BG_PIXMAP
2079
2080void
2081rxvt_term::set_background (rxvt_img *img)
2082 CODE:
2083 THIS->bg_destroy ();
2084 THIS->bg_pixmap = None;
2085 THIS->bg_flags &= ~rxvt_term::BG_NEEDS_REFRESH;
2086
2087 if (img) // TODO: cannot be false
2088 {
2089 img->unshare ();
2090 //TODO: convetr to visual, possibly precompose with colour
2091 THIS->bg_pixmap = img->steal ();
2092 THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH;
2093 THIS->bg_valid_since = ev::now (); // TODO: extra bloat
2094 }
2095
2096#endif
2097
2098#endif
2099
2100#############################################################################
1833# urxvt::overlay 2101# urxvt::overlay
1834############################################################################# 2102#############################################################################
1835 2103
1836MODULE = urxvt PACKAGE = urxvt::overlay 2104MODULE = urxvt PACKAGE = urxvt::overlay
1837 2105
1847void 2115void
1848overlay::DESTROY () 2116overlay::DESTROY ()
1849 2117
1850INCLUDE: $PERL <iom_perl.xs -pe s/IOM_MODULE/urxvt/g,s/IOM_CLASS/urxvt/g | 2118INCLUDE: $PERL <iom_perl.xs -pe s/IOM_MODULE/urxvt/g,s/IOM_CLASS/urxvt/g |
1851 2119
2120MODULE = urxvt PACKAGE = urxvt::pixbuf PREFIX = gdk_pixbuf_
2121
2122#if HAVE_PIXBUF
2123
2124urxvt::pixbuf gdk_pixbuf_new_from_file (SV *klass, octet_string filename)
2125 C_ARGS: filename, 0
2126
2127void
2128DESTROY (urxvt::pixbuf self)
2129 CODE:
2130 gdk_pixbuf_unref (self);
2131
2132#endif
2133
2134MODULE = urxvt PACKAGE = urxvt::img
2135
2136#if HAVE_IMG
2137
2138# rxvt_img *new (rxvt_screen *screen, XRenderPictFormat *format, int width, int height)
2139# rxvt_img *rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap);
2140
2141int
2142rxvt_img::w ()
2143 CODE:
2144 RETVAL = THIS->w;
2145 OUTPUT:
2146 RETVAL
2147
2148int
2149rxvt_img::h ()
2150 CODE:
2151 RETVAL = THIS->h;
2152 OUTPUT:
2153 RETVAL
2154
2155bool
2156rxvt_img::shared ()
2157 CODE:
2158 RETVAL = THIS->shared;
2159 OUTPUT:
2160 RETVAL
2161
2162Pixmap
2163rxvt_img::pm ()
2164 CODE:
2165 RETVAL = THIS->pm;
2166 OUTPUT:
2167 RETVAL
2168
2169void
2170rxvt_img::fill (SV *c)
2171 INIT:
2172 rxvt_color rc;
2173 parse_color (THIS->s, rc, c);
2174 C_ARGS: rc
2175
2176void
2177rxvt_img::DESTROY ()
2178 CODE:
2179 delete THIS;
2180
2181rxvt_img *
2182rxvt_img::blur (int rh, int rv)
2183
2184void
2185rxvt_img::brightness (NV r, NV g, NV b, NV a = 1.)
2186
2187void
2188rxvt_img::contrast (NV r, NV g, NV b, NV a = 1.)
2189
2190void
2191rxvt_img::unshare ()
2192
2193rxvt_img *
2194rxvt_img::clone ()
2195
2196rxvt_img *
2197rxvt_img::sub_rect (int x, int y, int width, int height, render_repeat_mode repeat = RepeatNormal)
2198
2199rxvt_img *
2200rxvt_img::transform (int new_width, int new_height, NV p11, NV p12, NV p13, NV p21, NV p22, NV p23, NV p31, NV p32, NV p33, render_repeat_mode repeat = RepeatNormal)
2201 INIT:
2202 double matrix[9] = {
2203 p11, p12, p13,
2204 p21, p22, p23,
2205 p31, p32, p33
2206 };
2207 C_ARGS: new_width, new_height, matrix, repeat
2208
2209rxvt_img *
2210rxvt_img::scale (int new_width, int new_height)
2211
2212rxvt_img *
2213rxvt_img::rotate (int new_width, int new_height, int x, int y, NV phi, render_repeat_mode repeat = RepeatNormal)
2214
2215#endif
2216

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines