comparison libgaim/plugins/perl/scripts/plugin_action.pl @ 14192:60b1bc8dbf37

[gaim-migrate @ 16863] Renamed 'core' to 'libgaim' committer: Tailor Script <tailor@pidgin.im>
author Evan Schoenberg <evan.s@dreskin.net>
date Sat, 19 Aug 2006 01:50:10 +0000
parents
children
comparison
equal deleted inserted replaced
14191:009db0b357b5 14192:60b1bc8dbf37
1 $MODULE_NAME = "Plugin Action Test Plugin";
2 use Gaim;
3
4 sub plugin_init {
5 return %PLUGIN_INFO;
6 }
7
8 sub plugin_load {
9 my $plugin = shift;
10 }
11
12 sub plugin_unload {
13 my $plugin = shift;
14 }
15
16 sub fun1 {
17 print "1\n";
18 }
19
20 sub fun2 {
21 print "2\n";
22 }
23
24 sub fun3 {
25 print "3\n";
26 }
27
28 %plugin_actions = (
29 "Action 1" => \&fun1,
30 "Action 2" => \&fun2,
31 "Action 3" => \&fun3
32 # "Action 1" => sub { print "1\n"; },
33 # "Action 2" => sub { print "2\n"; },
34 # "Action 3" => sub { print "3\n"; }
35 );
36
37 sub plugin_action_names {
38 foreach $key (keys %plugin_actions) {
39 push @array, $key;
40 }
41
42 return @array;
43 }
44
45 # All the information Gaim gets about our nifty plugin
46 %PLUGIN_INFO = (
47 perl_api_version => 2,
48 name => "Perl: $MODULE_NAME",
49 version => "0.1",
50 summary => "Test plugin for the Perl interpreter.",
51 description => "Just a basic test plugin template.",
52 author => "Etan Reisner <deryni\@gmail.com>",
53 url => "http://sourceforge.net/users/deryni9/",
54
55 load => "plugin_load",
56 unload => "plugin_unload",
57 plugin_action_sub => "plugin_action_names"
58 );