Mercurial > pidgin
annotate plugins/perl/scripts/plugin_action.pl @ 13726:e3bc5cdc85cd
[gaim-migrate @ 16137]
SF Patch #1482820 from genpeng
This is a fix for "--as-needed".
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sat, 06 May 2006 01:12:12 +0000 |
parents | b457aa723bab |
children |
rev | line source |
---|---|
12988
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
1 $MODULE_NAME = "Plugin Action Test Plugin"; |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
2 use Gaim; |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
3 |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
4 sub plugin_init { |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
5 return %PLUGIN_INFO; |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
6 } |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
7 |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
8 sub plugin_load { |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
9 my $plugin = shift; |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
10 } |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
11 |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
12 sub plugin_unload { |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
13 my $plugin = shift; |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
14 } |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
15 |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
16 sub fun1 { |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
17 print "1\n"; |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
18 } |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
19 |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
20 sub fun2 { |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
21 print "2\n"; |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
22 } |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
23 |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
24 sub fun3 { |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
25 print "3\n"; |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
26 } |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
27 |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
28 %plugin_actions = ( |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
29 "Action 1" => \&fun1, |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
30 "Action 2" => \&fun2, |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
31 "Action 3" => \&fun3 |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
32 # "Action 1" => sub { print "1\n"; }, |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
33 # "Action 2" => sub { print "2\n"; }, |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
34 # "Action 3" => sub { print "3\n"; } |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
35 ); |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
36 |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
37 sub plugin_action_names { |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
38 foreach $key (keys %plugin_actions) { |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
39 push @array, $key; |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
40 } |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
41 |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
42 return @array; |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
43 } |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
44 |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
45 # All the information Gaim gets about our nifty plugin |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
46 %PLUGIN_INFO = ( |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
47 perl_api_version => 2, |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
48 name => "Perl: $MODULE_NAME", |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
49 version => "0.1", |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
50 summary => "Test plugin for the Perl interpreter.", |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
51 description => "Just a basic test plugin template.", |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
52 author => "Etan Reisner <deryni\@gmail.com>", |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
53 url => "http://sourceforge.net/users/deryni9/", |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
54 |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
55 load => "plugin_load", |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
56 unload => "plugin_unload", |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
57 plugin_action_sub => "plugin_action_names" |
b457aa723bab
[gaim-migrate @ 15341]
Etan Reisner <pidgin@unreliablesource.net>
parents:
diff
changeset
|
58 ); |