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.198 by root, Tue Oct 4 22:25:14 2011 UTC vs.
Revision 1.205 by root, Tue Jun 5 19:32:29 2012 UTC

400=item confirm-paste 400=item confirm-paste
401 401
402Displays a confirmation dialog when a paste containing at least a full 402Displays a confirmation dialog when a paste containing at least a full
403line is detected. 403line is detected.
404 404
405=item bell-command
406
407Runs the command specified by the C<URxvt.bell-command> resource when
408a bell event occurs. For example, the following pops up a notification
409bubble with the text "Beep, Beep" using notify-send:
410
411 URxvt.bell-command: notify-send "Beep, Beep"
412
405=back 413=back
406 414
407=head1 API DOCUMENTATION 415=head1 API DOCUMENTATION
408 416
409=head2 General API Considerations 417=head2 General API Considerations
437 445
438=item $octets 446=item $octets
439 447
440Either binary data or - more common - a text string encoded in a 448Either binary data or - more common - a text string encoded in a
441locale-specific way. 449locale-specific way.
450
451=item $keysym
452
453an integer that is a valid X11 keysym code. You can convert a string
454into a keysym and viceversa by using C<XStringToKeysym> and
455C<XKeysymToString>.
442 456
443=back 457=back
444 458
445=head2 Extension Objects 459=head2 Extension Objects
446 460
657a C<perl:string> action bound to a key, see description of the B<keysym> 671a C<perl:string> action bound to a key, see description of the B<keysym>
658resource in the @@RXVT_NAME@@(1) manpage). 672resource in the @@RXVT_NAME@@(1) manpage).
659 673
660The event is simply the action string. This interface is assumed to change 674The event is simply the action string. This interface is assumed to change
661slightly in the future. 675slightly in the future.
676
677=item on_register_command $term, $keysym, $modifiermask, $string
678
679Called after parsing a keysym resource but before registering the
680associated binding. If this hook returns TRUE the binding is not
681registered. It can be used to modify a binding by calling
682C<register_command>.
662 683
663=item on_resize_all_windows $term, $new_width, $new_height 684=item on_resize_all_windows $term, $new_width, $new_height
664 685
665Called just after the new window size has been calculated, but before 686Called just after the new window size has been calculated, but before
666windows are actually being resized or hints are being set. If this hook 687windows are actually being resized or hints are being set. If this hook
967sub invoke { 988sub invoke {
968 local $TERM = shift; 989 local $TERM = shift;
969 my $htype = shift; 990 my $htype = shift;
970 991
971 if ($htype == 0) { # INIT 992 if ($htype == 0) { # INIT
972 my @dirs = ((split /:/, $TERM->resource ("perl_lib")), "$LIBDIR/perl"); 993 my @dirs = ((split /:/, $TERM->resource ("perl_lib")), "$ENV{HOME}/.urxvt/ext", "$LIBDIR/perl");
973 994
974 my %ext_arg; 995 my %ext_arg;
975 996
976 { 997 {
977 my @init = @TERM_INIT; 998 my @init = @TERM_INIT;
1079 while (my ($name, $cb) = each %hook) { 1100 while (my ($name, $cb) = each %hook) {
1080 my $htype = $HOOKTYPE{uc $name}; 1101 my $htype = $HOOKTYPE{uc $name};
1081 defined $htype 1102 defined $htype
1082 or Carp::croak "unsupported hook type '$name'"; 1103 or Carp::croak "unsupported hook type '$name'";
1083 1104
1084 $self->set_should_invoke ($htype, +1) 1105 $self->modify_should_invoke_count ($htype, +1)
1085 unless exists $self->{term}{_hook}[$htype]{$pkg}; 1106 unless exists $self->{term}{_hook}[$htype]{$pkg};
1086 1107
1087 $self->{term}{_hook}[$htype]{$pkg} = $cb; 1108 $self->{term}{_hook}[$htype]{$pkg} = $cb;
1088 } 1109 }
1089} 1110}
1095 for my $name (@hook) { 1116 for my $name (@hook) {
1096 my $htype = $HOOKTYPE{uc $name}; 1117 my $htype = $HOOKTYPE{uc $name};
1097 defined $htype 1118 defined $htype
1098 or Carp::croak "unsupported hook type '$name'"; 1119 or Carp::croak "unsupported hook type '$name'";
1099 1120
1100 $self->set_should_invoke ($htype, -1) 1121 $self->modify_should_invoke_count ($htype, -1)
1101 if delete $self->{term}{_hook}[$htype]{$pkg}; 1122 if delete $self->{term}{_hook}[$htype]{$pkg};
1102 } 1123 }
1103} 1124}
1104 1125
1105our $AUTOLOAD; 1126our $AUTOLOAD;
1374 1395
1375This method should only be called during the C<on_start> hook, as there is 1396This method should only be called during the C<on_start> hook, as there is
1376only one resource database per display, and later invocations might return 1397only one resource database per display, and later invocations might return
1377the wrong resources. 1398the wrong resources.
1378 1399
1379=item $success = $term->parse_keysym ($keysym_spec, $command_string) 1400=item $success = $term->parse_keysym ($key, $octets)
1380 1401
1381Adds a keymap translation exactly as specified via a resource. See the 1402Adds a key binding exactly as specified via a resource. See the
1382C<keysym> resource in the @@RXVT_NAME@@(1) manpage. 1403C<keysym> resource in the @@RXVT_NAME@@(1) manpage.
1404
1405=item $term->register_command ($keysym, $modifiermask, $string)
1406
1407Adds a key binding. This is a lower level api compared to
1408C<parse_keysym>, as it expects a parsed key description, and can be
1409used only inside either the C<on_init> hook, to add a binding, or the
1410C<on_register_command> hook, to modify a parsed binding.
1383 1411
1384=item $rend = $term->rstyle ([$new_rstyle]) 1412=item $rend = $term->rstyle ([$new_rstyle])
1385 1413
1386Return and optionally change the current rendition. Text that is output by 1414Return and optionally change the current rendition. Text that is output by
1387the terminal application will use this style. 1415the terminal application will use this style.
1600 1628
1601Adds the specified events to the vt event mask. Useful e.g. when you want 1629Adds the specified events to the vt event mask. Useful e.g. when you want
1602to receive pointer events all the times: 1630to receive pointer events all the times:
1603 1631
1604 $term->vt_emask_add (urxvt::PointerMotionMask); 1632 $term->vt_emask_add (urxvt::PointerMotionMask);
1633
1634=item $term->set_urgency ($set)
1635
1636Enable/disable the urgency hint on the toplevel window.
1605 1637
1606=item $term->focus_in 1638=item $term->focus_in
1607 1639
1608=item $term->focus_out 1640=item $term->focus_out
1609 1641
1925=item $term->XMoveResizeWindow ($window, $x, $y, $width, $height) 1957=item $term->XMoveResizeWindow ($window, $x, $y, $width, $height)
1926 1958
1927=item ($x, $y, $child_window) = $term->XTranslateCoordinates ($src, $dst, $x, $y) 1959=item ($x, $y, $child_window) = $term->XTranslateCoordinates ($src, $dst, $x, $y)
1928 1960
1929=item $term->XChangeInput ($window, $add_events[, $del_events]) 1961=item $term->XChangeInput ($window, $add_events[, $del_events])
1962
1963=item $keysym = $term->XStringToKeysym ($string)
1964
1965=item $string = $term->XKeysymToString ($keysym)
1930 1966
1931Various X or X-related functions. The C<$term> object only serves as 1967Various X or X-related functions. The C<$term> object only serves as
1932the source of the display, otherwise those functions map more-or-less 1968the source of the display, otherwise those functions map more-or-less
1933directly onto the X functions of the same name. 1969directly onto the X functions of the same name.
1934 1970

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines