1 package Xchat::XPI::Events;
8 use lib get_info 'xchatdir';
9 use Xchat::XPI::Utils qw<called_from_script>;
11 use constant DEFAULT_DELAY => 1000;
13 our $VERSION = '0.04';
16 my ($cb, @args) = @{$_[0]};
24 my ($delay, @args) = @_;
29 $delay = DEFAULT_DELAY;
33 hook_timer $delay, \&_delay_cb, { data => \@args }
39 my ($cb, $to) = @{$_[1]};
42 emit_print $to, @args;
50 my ($from, $cb, $to) = @_;
53 hook_print $from, \&_filter_cb, { data => [ $cb, $to ] }
57 use base qw<Exporter>;
61 'funcs' => [ qw<delay filter> ],
62 'consts' => [ qw<DEFAULT_DELAY> ],
64 our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
65 $EXPORT_TAGS{'all'} = [ @EXPORT_OK ];