Mercurial > pidgin
annotate plugins/perl/common/Gaim.pm @ 12869:45c7f6510baa
[gaim-migrate @ 15221]
ranma42 got me his name.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sat, 14 Jan 2006 00:32:31 +0000 |
parents | 61d516a3d4a8 |
children |
rev | line source |
---|---|
6508 | 1 package Gaim; |
2 | |
3 use 5.008; | |
4 use strict; | |
5 use warnings; | |
6588
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
6 use Carp; |
6508 | 7 |
8 require Exporter; | |
6588
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
9 use AutoLoader; |
6508 | 10 |
11 our @ISA = qw(Exporter); | |
12 | |
13 # Items to export into callers namespace by default. Note: do not export | |
14 # names by default without a very good reason. Use EXPORT_OK instead. | |
15 # Do not simply export all your public functions/methods/constants. | |
16 | |
17 # This allows declaration use Gaim ':all'; | |
18 # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK | |
19 # will save memory. | |
20 our %EXPORT_TAGS = ( 'all' => [ qw( | |
21 | |
22 ) ] ); | |
23 | |
24 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); | |
25 | |
26 our @EXPORT = qw( | |
27 | |
28 ); | |
29 | |
30 our $VERSION = '0.01'; | |
31 | |
6588
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
32 sub AUTOLOAD { |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
33 # This AUTOLOAD is used to 'autoload' constants from the constant() |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
34 # XS function. |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
35 |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
36 my $constname; |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
37 our $AUTOLOAD; |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
38 ($constname = $AUTOLOAD) =~ s/.*:://; |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
39 croak "&Gaim::constant not defined" if $constname eq 'constant'; |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
40 my ($error, $val) = constant($constname); |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
41 if ($error) { croak $error; } |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
42 { |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
43 no strict 'refs'; |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
44 |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
45 *$AUTOLOAD = sub { $val }; |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
46 } |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
47 |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
48 goto &$AUTOLOAD; |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
49 } |
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
50 |
6508 | 51 require XSLoader; |
52 XSLoader::load('Gaim', $VERSION); | |
53 | |
54 # Preloaded methods go here. | |
55 | |
56 1; | |
6619
61d516a3d4a8
[gaim-migrate @ 7143]
Christian Hammond <chipx86@chipx86.com>
parents:
6601
diff
changeset
|
57 __END__ |
6508 | 58 |
59 =head1 NAME | |
60 | |
6594
47744949513f
[gaim-migrate @ 7118]
Christian Hammond <chipx86@chipx86.com>
parents:
6588
diff
changeset
|
61 Gaim - Perl extension the Gaim instant messenger. |
6508 | 62 |
63 =head1 SYNOPSIS | |
64 | |
65 use Gaim; | |
66 | |
67 =head1 ABSTRACT | |
68 | |
6598
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
69 This module provides the interface for using perl scripts as plugins |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
70 in Gaim. |
6508 | 71 |
72 =head1 DESCRIPTION | |
73 | |
6594
47744949513f
[gaim-migrate @ 7118]
Christian Hammond <chipx86@chipx86.com>
parents:
6588
diff
changeset
|
74 This module provides the interface for using perl scripts as plugins |
47744949513f
[gaim-migrate @ 7118]
Christian Hammond <chipx86@chipx86.com>
parents:
6588
diff
changeset
|
75 in Gaim. With this, developers can write perl scripts that can be |
47744949513f
[gaim-migrate @ 7118]
Christian Hammond <chipx86@chipx86.com>
parents:
6588
diff
changeset
|
76 loaded in Gaim as plugins. The scripts can interact with IMs, chats, |
47744949513f
[gaim-migrate @ 7118]
Christian Hammond <chipx86@chipx86.com>
parents:
6588
diff
changeset
|
77 accounts, the buddy list, gaim signals, and more. |
6508 | 78 |
6594
47744949513f
[gaim-migrate @ 7118]
Christian Hammond <chipx86@chipx86.com>
parents:
6588
diff
changeset
|
79 The API for the perl interface is very similar to that of the Gaim C |
47744949513f
[gaim-migrate @ 7118]
Christian Hammond <chipx86@chipx86.com>
parents:
6588
diff
changeset
|
80 API, which can be viewed at http://gaim.sourceforge.net/api/ or in |
47744949513f
[gaim-migrate @ 7118]
Christian Hammond <chipx86@chipx86.com>
parents:
6588
diff
changeset
|
81 the header files in the Gaim source tree. |
6508 | 82 |
6598
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
83 =head1 FUNCTIONS |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
84 |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
85 =over |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
86 |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
87 =item @accounts = Gaim::accounts |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
88 |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
89 Returns a list of all accounts, online or offline. |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
90 |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
91 =item @chats = Gaim::chats |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
92 |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
93 Returns a list of all chats currently open. |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
94 |
6601
1521c3b63d7f
[gaim-migrate @ 7125]
Christian Hammond <chipx86@chipx86.com>
parents:
6598
diff
changeset
|
95 =item @connections = Gaim::connections |
6598
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
96 |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
97 Returns a list of all active connections. |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
98 |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
99 =item @conversations = Gaim::conversations |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
100 |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
101 Returns a list of all conversations, both IM and chat, currently open. |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
102 |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
103 =item @conv_windows = Gaim::conv_windows |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
104 |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
105 Returns a list of all conversation windows currently open. |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
106 |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
107 =item @ims = Gaim::ims |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
108 |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
109 Returns a list of all instant messages currently open. |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
110 |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
111 =back |
2f6850c7d980
[gaim-migrate @ 7122]
Christian Hammond <chipx86@chipx86.com>
parents:
6594
diff
changeset
|
112 |
6508 | 113 =head1 SEE ALSO |
114 | |
6594
47744949513f
[gaim-migrate @ 7118]
Christian Hammond <chipx86@chipx86.com>
parents:
6588
diff
changeset
|
115 Gaim C API documentation - http//gaim.sourceforge.net/api/ |
6508 | 116 |
6594
47744949513f
[gaim-migrate @ 7118]
Christian Hammond <chipx86@chipx86.com>
parents:
6588
diff
changeset
|
117 Gaim website - http://gaim.sourceforge.net/ |
6508 | 118 |
119 =head1 AUTHOR | |
120 | |
6588
7f5f57dd5cac
[gaim-migrate @ 7110]
Christian Hammond <chipx86@chipx86.com>
parents:
6508
diff
changeset
|
121 Christian Hammond, E<lt>chipx86@gnupdate.orgE<gt> |
6508 | 122 |
123 =head1 COPYRIGHT AND LICENSE | |
124 | |
125 Copyright 2003 by Christian Hammond | |
126 | |
127 This library is free software; you can redistribute it and/or modify | |
6594
47744949513f
[gaim-migrate @ 7118]
Christian Hammond <chipx86@chipx86.com>
parents:
6588
diff
changeset
|
128 it under the terms of the General Public License (GPL). For |
47744949513f
[gaim-migrate @ 7118]
Christian Hammond <chipx86@chipx86.com>
parents:
6588
diff
changeset
|
129 more information, see http://www.fsf.org/licenses/gpl.txt |
6508 | 130 |
131 =cut |