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.71 by root, Tue Jan 17 16:22:41 2006 UTC vs.
Revision 1.74 by root, Wed Jan 18 10:31:37 2006 UTC

402 perl_environ = rxvt_environ; 402 perl_environ = rxvt_environ;
403 swap (perl_environ, environ); 403 swap (perl_environ, environ);
404 404
405 char *argv[] = { 405 char *argv[] = {
406 "", 406 "",
407 "-edo '" LIBDIR "/urxvt.pm' or ($@ and die $@) or exit 1", 407 "-e"
408 "BEGIN {"
409 " urxvt->bootstrap;"
410 " unshift @INC, '" LIBDIR "';"
411 "}"
412 ""
413 "use urxvt;"
408 }; 414 };
409 415
410 perl = perl_alloc (); 416 perl = perl_alloc ();
411 perl_construct (perl); 417 perl_construct (perl);
412 418
529 XEvent *xe = va_arg (ap, XEvent *); 535 XEvent *xe = va_arg (ap, XEvent *);
530 HV *hv = newHV (); 536 HV *hv = newHV ();
531 537
532# define set(name, sv) hv_store (hv, # name, sizeof (# name) - 1, sv, 0) 538# define set(name, sv) hv_store (hv, # name, sizeof (# name) - 1, sv, 0)
533# define setiv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSViv (val), 0) 539# define setiv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSViv (val), 0)
540# define setuv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSVuv (val), 0)
534# undef set 541# undef set
535 542
536 setiv (type, xe->type); 543 setiv (type, xe->type);
537 setiv (send_event, xe->xany.send_event); 544 setiv (send_event, xe->xany.send_event);
538 setiv (serial, xe->xany.serial); 545 setiv (serial, xe->xany.serial);
542 case KeyPress: 549 case KeyPress:
543 case KeyRelease: 550 case KeyRelease:
544 case ButtonPress: 551 case ButtonPress:
545 case ButtonRelease: 552 case ButtonRelease:
546 case MotionNotify: 553 case MotionNotify:
554 setuv (window, xe->xmotion.window);
555 setuv (root, xe->xmotion.root);
556 setuv (subwindow, xe->xmotion.subwindow);
547 setiv (time, xe->xmotion.time); 557 setuv (time, xe->xmotion.time);
548 setiv (x, xe->xmotion.x); 558 setiv (x, xe->xmotion.x);
549 setiv (y, xe->xmotion.y); 559 setiv (y, xe->xmotion.y);
550 setiv (row, xe->xmotion.y / term->fheight); 560 setiv (row, xe->xmotion.y / term->fheight);
551 setiv (col, xe->xmotion.x / term->fwidth); 561 setiv (col, xe->xmotion.x / term->fwidth);
552 setiv (x_root, xe->xmotion.x_root); 562 setiv (x_root, xe->xmotion.x_root);
553 setiv (y_root, xe->xmotion.y_root); 563 setiv (y_root, xe->xmotion.y_root);
554 setiv (state, xe->xmotion.state); 564 setuv (state, xe->xmotion.state);
565
566 switch (xe->type)
567 {
568 case KeyPress:
569 case KeyRelease:
570 setuv (keycode, xe->xkey.keycode);
571 break;
572
573 case ButtonPress:
574 case ButtonRelease:
575 setuv (button, xe->xbutton.button);
576 break;
577
578 case MotionNotify:
579 setiv (is_hint, xe->xmotion.is_hint);
580 break;
581 }
582
555 break; 583 break;
556 }
557 584
585 case MapNotify:
586 case UnmapNotify:
587 case ConfigureNotify:
588 setuv (event, xe->xconfigure.event);
589 setuv (window, xe->xconfigure.window);
590
558 switch (xe->type) 591 switch (xe->type)
559 { 592 {
560 case KeyPress: 593 case ConfigureNotify:
561 case KeyRelease: 594 setiv (x, xe->xconfigure.x);
562 setiv (keycode, xe->xkey.keycode); 595 setiv (y, xe->xconfigure.y);
596 setiv (width, xe->xconfigure.width);
597 setiv (height, xe->xconfigure.height);
598 setuv (above, xe->xconfigure.above);
563 break; 599 break;
564
565 case ButtonPress:
566 case ButtonRelease:
567 setiv (button, xe->xbutton.button);
568 break; 600 }
569 601
570 case MotionNotify:
571 setiv (is_hint, xe->xmotion.is_hint);
572 break; 602 break;
573 } 603 }
574 604
575 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); 605 XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv)));
576 } 606 }
1506 PUSHs (sv_2mortal (newSViv (rc.col))); 1536 PUSHs (sv_2mortal (newSViv (rc.col)));
1507 } 1537 }
1508 1538
1509 if (items == 3) 1539 if (items == 3)
1510 { 1540 {
1541 rc.row = SvIV (ST (1));
1542 rc.col = SvIV (ST (2));
1543
1544 if (ix == 2 && rc.col == 0)
1545 {
1546 rc.row--;
1547 rc.col = THIS->ncol;
1548 }
1549
1550 clamp_it (rc.col, 0, THIS->ncol);
1511 rc.row = clamp (SvIV (ST (1)), THIS->top_row, THIS->nrow - 1); 1551 clamp_it (rc.row, THIS->top_row, THIS->nrow - 1);
1512 rc.col = clamp (SvIV (ST (2)), 0, THIS->ncol - 1);
1513 1552
1514 if (ix) 1553 if (ix)
1515 THIS->want_refresh = 1; 1554 THIS->want_refresh = 1;
1516 } 1555 }
1517} 1556}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines