comparison libpurple/plugins/perl/common/Purple.pm @ 15833:2f8274ce570a

Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 19 Mar 2007 17:02:24 +0000
parents
children ca09f5b57672
comparison
equal deleted inserted replaced
15832:df859a1b40b1 15833:2f8274ce570a
1 package Purple;
2
3 use 5.008;
4 use strict;
5 use warnings;
6 use Carp;
7
8 require Exporter;
9 use AutoLoader;
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 Purple ':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
32 sub AUTOLOAD {
33 # This AUTOLOAD is used to 'autoload' constants from the constant()
34 # XS function.
35
36 my $constname;
37 our $AUTOLOAD;
38 ($constname = $AUTOLOAD) =~ s/.*:://;
39 croak "&Purple::constant not defined" if $constname eq 'constant';
40 my ($error, $val) = constant($constname);
41 if ($error) { croak $error; }
42 {
43 no strict 'refs';
44
45 *$AUTOLOAD = sub { $val };
46 }
47
48 goto &$AUTOLOAD;
49 }
50
51 require XSLoader;
52 XSLoader::load('Purple', $VERSION);
53
54 # Preloaded methods go here.
55
56 1;
57 __END__
58
59 =head1 NAME
60
61 libpurple - Perl extension to the libpurple instant messenger library.
62
63 =head1 SYNOPSIS
64
65 use Purple;
66
67 =head1 ABSTRACT
68
69 This module provides the interface for using perl scripts as plugins
70 in libpurple.
71
72 =head1 DESCRIPTION
73
74 This module provides the interface for using perl scripts as plugins
75 in Purple. With this, developers can write perl scripts that can be
76 loaded in Purple as plugins. The scripts can interact with IMs, chats,
77 accounts, the buddy list, libpurple signals, and more.
78
79 The API for the perl interface is very similar to that of the Purple C
80 API, which can be viewed at http://developer.pidgin.im/doxygen/ or in
81 the header files in the Purple source tree.
82
83 =head1 FUNCTIONS
84
85 =over
86
87 =item @accounts = Purple::accounts
88
89 Returns a list of all accounts, online or offline.
90
91 =item @chats = Purple::chats
92
93 Returns a list of all chats currently open.
94
95 =item @connections = Purple::connections
96
97 Returns a list of all active connections.
98
99 =item @conversations = Purple::conversations
100
101 Returns a list of all conversations, both IM and chat, currently open.
102
103 =item @conv_windows = Purple::conv_windows
104
105 Returns a list of all conversation windows currently open.
106
107 =item @ims = Purple::ims
108
109 Returns a list of all instant messages currently open.
110
111 =back
112
113 =head1 SEE ALSO
114
115 Purple C API documentation - http://developer.pidgin.im/doxygen/
116
117 Purple website - http://pidgin.im/
118
119 =head1 AUTHOR
120
121 Christian Hammond, E<lt>chipx86@gnupdate.orgE<gt>
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
128 it under the terms of the General Public License (GPL). For
129 more information, see http://www.fsf.org/licenses/gpl.txt
130
131 =cut