--- rxvt-unicode/src/urxvt.pm 2007/10/31 15:17:51 1.158 +++ rxvt-unicode/src/urxvt.pm 2008/09/23 07:03:13 1.170 @@ -42,7 +42,7 @@ Or by adding them to the resource for extensions loaded by default: - URxvt.perl-ext-common: default,automove-background,selection-autotransform + URxvt.perl-ext-common: default,selection-autotransform =over 4 @@ -110,7 +110,7 @@ first argument. The following will add an entry C that changes -C<$self->{myoption}>: +C<< $self->{myoption} >>: push @{ $self->{term}{option_popup_hook} }, sub { ("my option" => $myoption, sub { $self->{myoption} = $_[0] }) @@ -167,7 +167,7 @@ A support package that tries to make editing with readline easier. At the moment, it reacts to clicking shift-left mouse button by trying to move the text cursor to this position. It does so by generating as many -cursor-left or cursor-right keypresses as required (the this only works +cursor-left or cursor-right keypresses as required (this only works for programs that correctly support wide characters). To avoid too many false positives, this is only done when: @@ -305,19 +305,6 @@ If you want a quake-like animation, tell your window manager to do so (fvwm can do it). -=item automove-background - -This is basically a very small extension that dynamically changes the -background pixmap offset to the window position, in effect creating the -same effect as pseudo transparency with a custom pixmap. No scaling is -supported in this mode. Example: - - @@RXVT_NAME@@ -pixmap background.xpm -pe automove-background - -L -shows how this extension can be used to implement an automatically blurred -transparent background. - =item block-graphics-to-ascii A not very useful example of filtering all text output to the terminal @@ -1106,7 +1093,7 @@ =cut -our $VERSION = 1; +our $VERSION = '3.4'; $INC{"urxvt/anyevent.pm"} = 1; # mark us as there push @AnyEvent::REGISTRY, [urxvt => urxvt::anyevent::]; @@ -1147,20 +1134,6 @@ $_[0][1]->stop; } -sub condvar { - bless \my $flag, urxvt::anyevent:: -} - -sub broadcast { - ${$_[0]}++; -} - -sub wait { - unless (${$_[0]}) { - Carp::croak "AnyEvent->condvar blocking wait unsupported in urxvt, use a non-blocking API"; - } -} - sub one_event { Carp::croak "AnyEvent->one_event blocking wait unsupported in urxvt, use a non-blocking API"; } @@ -1291,7 +1264,7 @@ to see the actual list: answerbackstring backgroundPixmap backspace_key boldFont boldItalicFont - borderLess color cursorBlink cursorUnderline cutchars delete_key + borderLess chdir color cursorBlink cursorUnderline cutchars delete_key display_name embed ext_bwidth fade font geometry hold iconName imFont imLocale inputMethod insecure int_bwidth intensityStyles italicFont jumpScroll lineSpace loginShell mapAlert meta8 modifier @@ -1300,7 +1273,7 @@ preeditType print_pipe pty_fd reverseVideo saveLines scrollBar scrollBar_align scrollBar_floating scrollBar_right scrollBar_thickness scrollTtyKeypress scrollTtyOutput scrollWithBuffer scrollstyle - secondaryScreen secondaryScroll selectstyle shade term_name title + secondaryScreen secondaryScroll shade term_name title transient_for transparent transparent_all tripleclickwords utmpInhibit visualBell @@ -1309,7 +1282,7 @@ sub resource($$;$) { my ($self, $name) = (shift, shift); unshift @_, $self, $name, ($name =~ s/\s*\+\s*(\d+)$// ? $1 : 0); - &urxvt::term::_resource + goto &urxvt::term::_resource } =item $value = $term->x_resource ($pattern) @@ -1626,10 +1599,9 @@ =item $text = $term->ROW_t ($row_number[, $new_text[, $start_col]]) -Returns the text of the entire row with number C<$row_number>. Row C<0> -is the topmost terminal line, row C<< $term->$ncol-1 >> is the bottommost -terminal line. The scrollback buffer starts at line C<-1> and extends to -line C<< -$term->nsaved >>. Nothing will be returned if a nonexistent line +Returns the text of the entire row with number C<$row_number>. Row C<< $term->top_row >> +is the topmost terminal line, row C<< $term->nrow-1 >> is the bottommost +terminal line. Nothing will be returned if a nonexistent line is requested. If C<$new_text> is specified, it will replace characters in the current @@ -1640,7 +1612,7 @@ C<$text> is in a special encoding: tabs and wide characters that use more than one cell when displayed are padded with C<$urxvt::NOCHAR> (chr 65535) characters. Characters with combining characters and other characters that -do not fit into the normal tetx encoding will be replaced with characters +do not fit into the normal text encoding will be replaced with characters in the private use area. You have to obey this encoding when changing text. The advantage is @@ -1837,7 +1809,7 @@ =item ($type,$format,$octets) = $term->XGetWindowProperty ($window, $property) -=item $term->XChangeWindowProperty ($window, $property, $type, $format, $octets) +=item $term->XChangeProperty ($window, $property, $type, $format, $octets) =item $term->XDeleteProperty ($window, $property) @@ -1969,14 +1941,21 @@ delete $env->{LC_ALL}; $env->{LC_CTYPE} = $self->{term}->locale; - urxvt::term->new ($env, "popup", - "--perl-lib" => "", "--perl-ext-common" => "", - "-pty-fd" => -1, "-sl" => 0, - "-b" => 1, "-bd" => "grey80", "-bl", "-override-redirect", - "--transient-for" => $self->{term}->parent, - "-display" => $self->{term}->display_id, - "-pe" => "urxvt-popup") - or die "unable to create popup window\n"; + my $term = urxvt::term->new ( + $env, "popup", + "--perl-lib" => "", "--perl-ext-common" => "", + "-pty-fd" => -1, "-sl" => 0, + "-b" => 1, "-bd" => "grey80", "-bl", "-override-redirect", + "--transient-for" => $self->{term}->parent, + "-display" => $self->{term}->display_id, + "-pe" => "urxvt-popup", + ) or die "unable to create popup window\n"; + + unless (delete $term->{urxvt_popup_init_done}) { + $term->ungrab; + $term->destroy; + die "unable to initialise popup window\n"; + } } sub DESTROY { @@ -2057,7 +2036,7 @@ $term->{iow} = urxvt::iow ->new ->fd (fileno $term->{socket}) - ->events (urxvt::EVENT_READ) + ->events (urxvt::EV_READ) ->start ->cb (sub { my ($iow, $revents) = @_; @@ -2085,8 +2064,8 @@ =item $iow = $iow->events ($eventmask) Set the event mask to watch. The only allowed values are -C and C, which might be ORed -together, or C. +C and C, which might be ORed +together, or C. =item $iow = $iow->start