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

Comparing rxvt-unicode/src/urxvt.pm (file contents):
Revision 1.29 by root, Wed Jan 4 00:12:12 2006 UTC vs.
Revision 1.32 by root, Wed Jan 4 21:37:55 2006 UTC

366 366
367 $pkg 367 $pkg
368 } 368 }
369} 369}
370 370
371our $retval; # return value for urxvt
372
371# called by the rxvt core 373# called by the rxvt core
372sub invoke { 374sub invoke {
373 local $TERM = shift; 375 local $TERM = shift;
374 my $htype = shift; 376 my $htype = shift;
375 377
376 if ($htype == 0) { # INIT 378 if ($htype == 0) { # INIT
377 my @dirs = ((split /:/, $TERM->resource ("perl_lib")), "$LIBDIR/perl"); 379 my @dirs = ((split /:/, $TERM->resource ("perl_lib")), "$LIBDIR/perl");
378 380
379 for my $ext (split /:/, $TERM->resource ("perl_ext")) { 381 for my $ext (map { split /:/, $TERM->resource ("perl_ext_$_") } 1, 2) {
380 my @files = grep -f $_, map "$_/$ext", @dirs; 382 my @files = grep -f $_, map "$_/$ext", @dirs;
381 383
382 if (@files) { 384 if (@files) {
383 register_package script_package $files[0]; 385 register_package script_package $files[0];
384 } else { 386 } else {
385 warn "perl extension '$ext' not found in perl library search path\n"; 387 warn "perl extension '$ext' not found in perl library search path\n";
386 } 388 }
387 } 389 }
390 }
388 391
392 $retval = undef;
393
394 if (my $cb = $TERM->{_hook}[$htype]) {
395 verbose 10, "$HOOKNAME[$htype] (" . (join ", ", $TERM, @_) . ")"
396 if $verbosity >= 10;
397
398 keys %$cb;
399
400 while (my ($pkg, $cb) = each %$cb) {
401 $retval = $cb->(
402 $TERM->{_pkg}{$pkg} ||= do {
403 my $proxy = bless { }, urxvt::term::proxy::;
404 Scalar::Util::weaken ($proxy->{term} = $TERM);
405 $proxy
406 },
407 @_,
408 ) and last;
409 }
410 }
411
389 } elsif ($htype == 1) { # DESTROY 412 if ($htype == 1) { # DESTROY
413 # remove hooks if unused
390 if (my $hook = $TERM->{_hook}) { 414 if (my $hook = $TERM->{_hook}) {
391 for my $htype (0..$#$hook) { 415 for my $htype (0..$#$hook) {
392 $hook_count[$htype] -= scalar keys %{ $hook->[$htype] || {} } 416 $hook_count[$htype] -= scalar keys %{ $hook->[$htype] || {} }
393 or set_should_invoke $htype, 0; 417 or set_should_invoke $htype, 0;
394 } 418 }
395 } 419 }
420
421 # clear package objects
422 %$_ = () for values %{ $TERM->{_pkg} };
423
424 # clear package
425 %$TERM = ();
396 } 426 }
397 427
398 my $cb = $TERM->{_hook}[$htype] 428 $retval
399 or return;
400
401 verbose 10, "$HOOKNAME[$htype] (" . (join ", ", $TERM, @_) . ")"
402 if $verbosity >= 10;
403
404 keys %$cb;
405
406 while (my ($pkg, $cb) = each %$cb) {
407 return 1
408 if $cb->(
409 $TERM->{$pkg} ||= do {
410 my $proxy = bless { }, urxvt::term::proxy::;
411 Scalar::Util::weaken ($proxy->{term} = $TERM);
412 $proxy
413 },
414 @_,
415 );
416 }
417
418 0
419} 429}
420 430
421sub urxvt::term::proxy::AUTOLOAD { 431sub urxvt::term::proxy::AUTOLOAD {
422 $urxvt::term::proxy::AUTOLOAD =~ /:([^:]+)$/ 432 $urxvt::term::proxy::AUTOLOAD =~ /:([^:]+)$/
423 or die "FATAL: \$AUTOLOAD '$urxvt::term::proxy::AUTOLOAD' unparsable"; 433 or die "FATAL: \$AUTOLOAD '$urxvt::term::proxy::AUTOLOAD' unparsable";
461 answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont 471 answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont
462 borderLess color cursorBlink cursorUnderline cutchars delete_key 472 borderLess color cursorBlink cursorUnderline cutchars delete_key
463 display_name embed ext_bwidth fade font geometry hold iconName 473 display_name embed ext_bwidth fade font geometry hold iconName
464 imFont imLocale inputMethod insecure int_bwidth intensityStyles 474 imFont imLocale inputMethod insecure int_bwidth intensityStyles
465 italicFont jumpScroll lineSpace loginShell mapAlert menu meta8 modifier 475 italicFont jumpScroll lineSpace loginShell mapAlert menu meta8 modifier
466 mouseWheelScrollPage name pastableTabs path perl_eval perl_ext 476 mouseWheelScrollPage name pastableTabs path perl_eval perl_ext_1 perl_ext_2
467 perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd 477 perl_lib pointerBlank pointerBlankDelay preeditType print_pipe pty_fd
468 reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating 478 reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating
469 scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput 479 scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput
470 scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle 480 scrollWithBuffer scrollstyle secondaryScreen secondaryScroll selectstyle
471 shade term_name title transparent transparent_all tripleclickwords 481 shade term_name title transparent transparent_all tripleclickwords
477 my ($self, $name) = (shift, shift); 487 my ($self, $name) = (shift, shift);
478 unshift @_, $self, $name, ($name =~ s/\s*\+\s*(\d+)$// ? $1 : 0); 488 unshift @_, $self, $name, ($name =~ s/\s*\+\s*(\d+)$// ? $1 : 0);
479 goto &urxvt::term::_resource; 489 goto &urxvt::term::_resource;
480} 490}
481 491
492=item $rend = $term->screen_rstyle ([$new_rstyle])
493
494Return and optionally change the current rendition. Text thta is output by
495the temrianl application will use this style.
496
497=item ($row, $col) = $term->screen_cur ([$row, $col])
498
499Return the current coordinates of the text cursor position and optionally
500set it (which is usually bad as applications don't expect that).
501
482=item ($row, $col) = $term->selection_mark ([$row, $col]) 502=item ($row, $col) = $term->selection_mark ([$row, $col])
483 503
484=item ($row, $col) = $term->selection_beg ([$row, $col]) 504=item ($row, $col) = $term->selection_beg ([$row, $col])
485 505
486=item ($row, $col) = $term->selection_end ([$row, $col]) 506=item ($row, $col) = $term->selection_end ([$row, $col])
570 590
571Write the octets given in C<$data> to the tty (i.e. as program input). To 591Write the octets given in C<$data> to the tty (i.e. as program input). To
572pass characters instead of octets, you should convert your strings first 592pass characters instead of octets, you should convert your strings first
573to the locale-specific encoding using C<< $term->locale_encode >>. 593to the locale-specific encoding using C<< $term->locale_encode >>.
574 594
595=item $window_width = $term->width
596
597=item $window_height = $term->height
598
599=item $font_width = $term->fwidth
600
601=item $font_height = $term->fheight
602
603=item $font_ascent = $term->fbase
604
575=item $nrow = $term->nrow 605=item $terminal_rows = $term->nrow
576 606
577=item $ncol = $term->ncol 607=item $terminal_columns = $term->ncol
578 608
579Return the number of rows/columns of the terminal window (i.e. as 609=item $has_focus = $term->focus
580specified by C<-geometry>, excluding any scrollback).
581 610
582=item $nsaved = $term->nsaved 611=item $is_mapped = $term->mapped
583 612
584Returns the number of lines in the scrollback buffer. 613=item $max_scrollback = $term->saveLines
614
615=item $nrow_plus_saveLines = $term->total_rows
616
617=item $lines_in_scrollback = $term->nsaved
618
619Return various integers describing terminal characteristics.
585 620
586=item $view_start = $term->view_start ([$newvalue]) 621=item $view_start = $term->view_start ([$newvalue])
587 622
588Returns the negative row number of the topmost line. Minimum value is 623Returns the negative row number of the topmost line. Minimum value is
589C<0>, which displays the normal terminal contents. Larger values scroll 624C<0>, which displays the normal terminal contents. Larger values scroll

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines