diff options
Diffstat (limited to 'feature-tests')
| -rw-r--r-- | feature-tests/internal_signals.pl | 14 | ||||
| -rw-r--r-- | feature-tests/sbar_test.pl | 44 | ||||
| -rw-r--r-- | feature-tests/text_intercept.pl | 33 | 
3 files changed, 91 insertions, 0 deletions
| diff --git a/feature-tests/internal_signals.pl b/feature-tests/internal_signals.pl new file mode 100644 index 0000000..e40587f --- /dev/null +++ b/feature-tests/internal_signals.pl @@ -0,0 +1,14 @@ +# not a complete script, just a useful snippet +Irssi::signal_register({'complete command set' +                        => ["glistptr_char*", "Irssi::UI::Window", +                                "string", "string", "intptr"]}); + +my @res = (); +my $num; +Irssi::signal_emit('complete command set', \@res, Irssi::active_win(), +                   '', '', \$num); + +print "results: @res"; + +# will return all the possible completions for the /set command.  you can filter +# it by changing the 2 empty strings (word-fragment, and line context) diff --git a/feature-tests/sbar_test.pl b/feature-tests/sbar_test.pl index 6523842..121bc52 100644 --- a/feature-tests/sbar_test.pl +++ b/feature-tests/sbar_test.pl @@ -29,3 +29,47 @@ sub foo_sb {  }  Irssi::statusbar_item_register ('foo_bar', 0, 'foo_sb'); + +__END__ +# Name                           Type   Placement Position Visible +# window                         window bottom    1        active +# window_inact                   window bottom    1        inactive +# prompt                         root   bottom    0        always +# topic                          root   top       1        always + +# Statusbar: prompt +# Type     : root +# Placement: bottom +# Position : 0 +# Visible  : always +# Items    : Name                                Priority  Alignment +#          : prompt                              0         left +#          : prompt_empty                        0         left +#          : input                               10        left +# +# STATUSBAR <name> ENABLE +# STATUSBAR <name> DISABLE +# STATUSBAR <name> RESET +# STATUSBAR <name> TYPE window|root +# STATUSBAR <name> PLACEMENT top|bottom +# STATUSBAR <name> POSITION <num> +# STATUSBAR <name> VISIBLE always|active|inactive +# STATUSBAR <name> ADD +#                  [-before | -after <item>] [-priority #] +#                  [-alignment left|right] <item> +# +# STATUSBAR <name> REMOVE <item> +# +# Commands for modifying the statusbar. +# +# /STATUSBAR +#    - Display all statusbars. +# +# /STATUSBAR <name> +#    - display elements of statusbar <name> +# +# Irssi commands: +# statusbar add     statusbar enable    statusbar position  statusbar reset +# statusbar visible statusbar disable   statusbar placement statusbar remove +# statusbar type + diff --git a/feature-tests/text_intercept.pl b/feature-tests/text_intercept.pl new file mode 100644 index 0000000..932703e --- /dev/null +++ b/feature-tests/text_intercept.pl @@ -0,0 +1,33 @@ +use strict; +use Irssi; +use Irssi::TextUI; # for sbar_items_redraw + +use vars qw($VERSION %IRSSI); +$VERSION = "1.0.1"; +%IRSSI = ( +	authors         => "shabble", +	contact         => 'shabble+irssi@metavore.org, shabble@#irssi/Freenode', +	name            => "", +	description     => "", +	license         => "Public Domain", +	changed         => "" +); + +my $ignore_flag = 0; + +Irssi::signal_add 'print text' => \&handle_text; + + +sub handle_text { +    my ($dest, $text, $stripped) = @_; + +    return if $ignore_flag; + +    Irssi::signal_stop(); + +    $text =~ s/a/b/g; + +    $ignore_flag = 1; +    $dest->print($text); +    $ignore_flag = 0; +} | 
