changeset 16562:1f9cba8efdfb

merge of '2ec86531b43742d8242195bf529e7ba77be9d3dc' and 'fb970fdd4f3e27ac176f55bee8baf7074a1a96ef'
author Richard Laager <rlaager@wiktel.com>
date Sat, 28 Apr 2007 02:42:26 +0000
parents 69e36b560549 (current diff) f0d399f91756 (diff)
children fb633ba3fb1e 06ee8064b3d0
files pidgin/plugins/perl/common/GtkUI.pm pidgin/plugins/perl/common/GtkUI.xs
diffstat 18 files changed, 261 insertions(+), 223 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/perl/Makefile.am	Sat Apr 28 02:29:48 2007 +0000
+++ b/libpurple/plugins/perl/Makefile.am	Sat Apr 28 02:42:26 2007 +0000
@@ -1,13 +1,11 @@
 plugindir = $(libdir)/purple
-hackdir = $(plugindir)/private
 
 perl_dirs = common
 
 plugin_LTLIBRARIES = perl.la
-hack_LTLIBRARIES = libpurpleperl.la
 
 perl_la_LDFLAGS = -module -avoid-version
-perl_la_LIBADD = $(GLIB_LIBS) $(PERL_LIBS) libpurpleperl.la
+perl_la_LIBADD = $(GLIB_LIBS) $(PERL_LIBS)
 perl_la_SOURCES = \
 	perl.c \
 	perl-common.c \
@@ -17,12 +15,7 @@
 
 perl_la_DEPENDENCIES = \
 	.libs/libperl_orig.a \
-	.libs/DynaLoader.a \
-	libpurpleperl.la
-
-libpurpleperl_la_LDFLAGS = -module -avoid-version
-libpurpleperl_la_LIBADD = $(GLIB_LIBS)
-libpurpleperl_la_SOURCES = libpurpleperl.c
+	.libs/DynaLoader.a
 
 .libs/libperl_orig.a:
 	@mkdir -p .libs
@@ -42,55 +35,52 @@
 		$(LN_S) $(DYNALOADER_A) .libs/DynaLoader.a; \
 	fi
 
-
 common_sources = \
-        common/Account.xs \
-        common/AccountOpts.xs \
-        common/BuddyIcon.xs \
-        common/BuddyList.xs \
-        common/Cipher.xs \
-        common/Cmds.xs \
-        common/Core.xs \
-        common/Connection.xs \
-        common/Conversation.xs \
-        common/Debug.xs \
-        common/FT.xs \
-        common/ImgStore.xs \
-        common/Log.xs \
-        common/Makefile.PL.in \
-        common/Network.xs \
-        common/Notify.xs \
-        common/Plugin.xs \
-        common/PluginPref.xs \
-        common/Pounce.xs \
-        common/Prefs.xs \
-        common/Privacy.xs \
-        common/Proxy.xs \
-        common/Prpl.xs \
-        common/Purple.pm \
-        common/Purple.xs \
-        common/Request.xs \
-        common/Roomlist.xs \
-        common/SSLConn.xs \
-        common/SavedStatuses.xs \
-        common/Server.xs \
-        common/Signal.xs \
-        common/Sound.xs \
-        common/Status.xs \
-        common/Stringref.xs \
-        common/Util.xs \
-        common/XMLNode.xs \
-        common/fallback/const-c.inc \
-        common/fallback/const-xs.inc \
-        common/module.h \
-        common/typemap
-
+	common/Account.xs \
+	common/AccountOpts.xs \
+	common/BuddyIcon.xs \
+	common/BuddyList.xs \
+	common/Cipher.xs \
+	common/Cmds.xs \
+	common/Core.xs \
+	common/Connection.xs \
+	common/Conversation.xs \
+	common/Debug.xs \
+	common/FT.xs \
+	common/ImgStore.xs \
+	common/Log.xs \
+	common/Makefile.PL.in \
+	common/Network.xs \
+	common/Notify.xs \
+	common/Plugin.xs \
+	common/PluginPref.xs \
+	common/Pounce.xs \
+	common/Prefs.xs \
+	common/Privacy.xs \
+	common/Proxy.xs \
+	common/Prpl.xs \
+	common/Purple.pm \
+	common/Purple.xs \
+	common/Request.xs \
+	common/Roomlist.xs \
+	common/SSLConn.xs \
+	common/SavedStatuses.xs \
+	common/Server.xs \
+	common/Signal.xs \
+	common/Sound.xs \
+	common/Status.xs \
+	common/Stringref.xs \
+	common/Util.xs \
+	common/XMLNode.xs \
+	common/module.h \
+	common/typemap \
+	common/fallback/const-c.inc \
+	common/fallback/const-xs.inc
 
 EXTRA_DIST = \
 	Makefile.mingw \
 	common/Makefile.mingw \
-	$(common_sources) \
-	libpurpleperl.c
+	$(common_sources)
 
 common/Makefile: common/Makefile.PL
 	@if test "x${top_srcdir}" != "x${top_builddir}"; then \
@@ -157,7 +147,6 @@
 		done; \
 	fi
 
-
 AM_CPPFLAGS = \
 	-DVERSION=\"$(VERSION)\" \
 	-I$(top_srcdir) \
--- a/libpurple/plugins/perl/common/Makefile.PL.in	Sat Apr 28 02:29:48 2007 +0000
+++ b/libpurple/plugins/perl/common/Makefile.PL.in	Sat Apr 28 02:42:26 2007 +0000
@@ -1,18 +1,18 @@
 use 5.006;
 use ExtUtils::MakeMaker;
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence the contents
+# of the Makefile that is written.
 WriteMakefile(
-    'NAME'		=> 'Purple',
-    'VERSION_FROM'	=> '@srcdir@/Purple.pm', # finds $VERSION
-    'PREREQ_PM'		=> {}, # e.g., Module::Name => 1.1
-    ($] >= 5.005 ?    ## Add these new keywords supported since 5.005
-      (ABSTRACT_FROM => '@srcdir@/Purple.pm', # retrieve abstract from module
-       AUTHOR     => 'Purple <http://pidgin.im/>') : ()),
-    'LIBS'		=> [''], # e.g., '-lm'
-    'DEFINE'		=> '@DEBUG_CFLAGS@', # e.g., '-DHAVE_SOMETHING'
-    'INC'		=> '-I. -I@srcdir@ -I@top_srcdir@ -I@top_srcdir@/libpurple @GLIB_CFLAGS@', # e.g., '-I. -I/usr/include/other'
-    'OBJECT'		=> '$(O_FILES)', # link all the C files too
+    'NAME'              => 'Purple',
+    'VERSION_FROM'      => '@srcdir@/Purple.pm', # finds $VERSION
+    'PREREQ_PM'         => {}, # e.g., Module::Name => 1.1
+    ($] >= 5.005 ? ## Add these new keywords supported since 5.005
+      (ABSTRACT_FROM    => '@srcdir@/Purple.pm', # finds $ABSTRACT
+       AUTHOR           => 'Purple <http://pidgin.im/>') : ()),
+    'DEFINE'            => '@DEBUG_CFLAGS@',
+    'INC'               => '-I. -I@srcdir@ -I@top_srcdir@ -I@top_srcdir@/libpurple @GLIB_CFLAGS@',
+    'OBJECT'            => '$(O_FILES)', # link all the C files too
+#    'OPTIMIZE'          => '-g', # For debugging
 );
 
 if (eval {require ExtUtils::Constant; 1}) {
--- a/libpurple/plugins/perl/common/Makefile.mingw	Sat Apr 28 02:29:48 2007 +0000
+++ b/libpurple/plugins/perl/common/Makefile.mingw	Sat Apr 28 02:42:26 2007 +0000
@@ -66,7 +66,7 @@
 				Status.xs \
 				Stringref.xs \
 				Util.xs \
-				XMLNode.xs \
+				XMLNode.xs
 
 FALLBACKS =	const-c.inc const-xs.inc
 C_FILES = $(XS_FILES:%.xs=%.c)
--- a/libpurple/plugins/perl/common/Purple.pm	Sat Apr 28 02:29:48 2007 +0000
+++ b/libpurple/plugins/perl/common/Purple.pm	Sat Apr 28 02:42:26 2007 +0000
@@ -58,7 +58,7 @@
 
 =head1 NAME
 
-libpurple - Perl extension to the libpurple instant messenger library.
+Purple - Perl extension to the libpurple instant messenger library.
 
 =head1 SYNOPSIS
 
--- a/libpurple/plugins/perl/perl.c	Sat Apr 28 02:29:48 2007 +0000
+++ b/libpurple/plugins/perl/perl.c	Sat Apr 28 02:42:26 2007 +0000
@@ -93,6 +93,8 @@
 #include "perl-common.h"
 #include "perl-handlers.h"
 
+#include <gmodule.h>
+
 #define PERL_PLUGIN_ID "core-perl"
 
 PerlInterpreter *my_perl = NULL;
@@ -578,11 +580,11 @@
 	PURPLE_PLUGIN_MAGIC,
 	PURPLE_MAJOR_VERSION,
 	PURPLE_MINOR_VERSION,
-	PURPLE_PLUGIN_LOADER,                               /**< type           */
+	PURPLE_PLUGIN_LOADER,                             /**< type           */
 	NULL,                                             /**< ui_requirement */
 	0,                                                /**< flags          */
 	NULL,                                             /**< dependencies   */
-	PURPLE_PRIORITY_DEFAULT,                            /**< priority       */
+	PURPLE_PRIORITY_DEFAULT,                          /**< priority       */
 
 	PERL_PLUGIN_ID,                                   /**< id             */
 	N_("Perl Plugin Loader"),                         /**< name           */
@@ -590,7 +592,7 @@
 	N_("Provides support for loading perl plugins."), /**< summary        */
 	N_("Provides support for loading perl plugins."), /**< description    */
 	"Christian Hammond <chipx86@gnupdate.org>",       /**< author         */
-	PURPLE_WEBSITE,                                     /**< homepage       */
+	PURPLE_WEBSITE,                                   /**< homepage       */
 
 	plugin_load,                                      /**< load           */
 	plugin_unload,                                    /**< unload         */
@@ -608,4 +610,23 @@
 	loader_info.exts = g_list_append(loader_info.exts, "pl");
 }
 
+#ifdef __SUNPRO_C
+#pragma init (my_init)
+#else
+void __attribute__ ((constructor)) my_init(void);
+#endif
+
+void
+my_init(void)
+{
+	/* Mostly evil hack... puts perl.so's symbols in the global table but
+	 * does not create a circular dependency because g_module_open will
+	 * only open the library once. */
+	/* Do we need to keep track of the returned GModule here so that we
+	 * can g_module_close it when this plugin gets unloaded?
+	 * At the moment I don't think this plugin can ever get unloaded but
+	 * in case that becomes possible this wants to get noted. */
+	g_module_open("perl.so", 0);
+}
+
 PURPLE_INIT_PLUGIN(perl, init_plugin, info)
--- a/libpurple/prefs.c	Sat Apr 28 02:29:48 2007 +0000
+++ b/libpurple/prefs.c	Sat Apr 28 02:42:26 2007 +0000
@@ -1102,13 +1102,14 @@
 static void
 purple_prefs_rename_node(struct purple_pref *oldpref, struct purple_pref *newpref)
 {
-	struct purple_pref *child;
+	struct purple_pref *child, *next;
 	char *oldname, *newname;
 
 	/* if we're a parent, rename the kids first */
-	for(child = oldpref->first_child; child != NULL; child = child->sibling)
+	for(child = oldpref->first_child; child != NULL; child = next)
 	{
 		struct purple_pref *newchild;
+		next = child->sibling;
 		for(newchild = newpref->first_child; newchild != NULL; newchild = newchild->sibling)
 		{
 			if(!strcmp(child->name, newchild->name))
--- a/libpurple/util.c	Sat Apr 28 02:29:48 2007 +0000
+++ b/libpurple/util.c	Sat Apr 28 02:42:26 2007 +0000
@@ -2696,6 +2696,7 @@
 purple_normalize(const PurpleAccount *account, const char *str)
 {
 	const char *ret = NULL;
+	static char buf[BUF_LEN];
 
 	if (account != NULL)
 	{
@@ -2712,7 +2713,6 @@
 
 	if (ret == NULL)
 	{
-		static char buf[BUF_LEN];
 		char *tmp;
 
 		tmp = g_utf8_normalize(str, -1, G_NORMALIZE_DEFAULT);
--- a/pidgin.spec.in	Sat Apr 28 02:29:48 2007 +0000
+++ b/pidgin.spec.in	Sat Apr 28 02:42:26 2007 +0000
@@ -227,8 +227,10 @@
 # Delete files that we don't want to put in any of the RPMs
 rm -f $RPM_BUILD_ROOT%{_libdir}/finch/*.la
 rm -f $RPM_BUILD_ROOT%{_libdir}/pidgin/*.la
-rm -f $RPM_BUILD_ROOT%{_libdir}/libpurple/*.la
-rm -f $RPM_BUILD_ROOT%{_libdir}/libpurple/private/*.la
+rm -f $RPM_BUILD_ROOT%{_libdir}/purple/*.la
+rm -f $RPM_BUILD_ROOT%{_libdir}/purple/liboscar.so
+rm -f $RPM_BUILD_ROOT%{_libdir}/purple/libjabber.so
+rm -f $RPM_BUILD_ROOT%{_libdir}/purple/private/*.la
 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
 rm -f $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
 find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
--- a/pidgin/gtkdocklet-x11.c	Sat Apr 28 02:29:48 2007 +0000
+++ b/pidgin/gtkdocklet-x11.c	Sat Apr 28 02:42:26 2007 +0000
@@ -25,6 +25,7 @@
 #include "internal.h"
 #include "pidgin.h"
 #include "debug.h"
+#include "prefs.h"
 #include "pidginstock.h"
 
 #include "gtkdialogs.h"
@@ -32,7 +33,8 @@
 #include "eggtrayicon.h"
 #include "gtkdocklet.h"
 
-#define EMBED_TIMEOUT 5000
+#define SHORT_EMBED_TIMEOUT 5000
+#define LONG_EMBED_TIMEOUT 15000
 
 /* globals */
 static EggTrayIcon *docklet = NULL;
@@ -44,12 +46,12 @@
 static int docklet_height = 0;
 
 /* protos */
-static void docklet_x11_create(void);
+static void docklet_x11_create(gboolean);
 
 static gboolean
-docklet_x11_create_cb()
+docklet_x11_recreate_cb()
 {
-	docklet_x11_create();
+	docklet_x11_create(TRUE);
 
 	return FALSE; /* for when we're called by the glib idle handler */
 }
@@ -62,6 +64,7 @@
 	g_source_remove(embed_timeout);
 	embed_timeout = 0;
 	pidgin_docklet_embedded();
+	purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/x11/embedded", FALSE);
 }
 
 static void
@@ -236,7 +239,7 @@
 }
 
 static void
-docklet_x11_create()
+docklet_x11_create(gboolean recreate)
 {
 	GtkWidget *box;
 
@@ -272,17 +275,35 @@
 	 * previous visibility state.  If the docklet does not get embedded within
 	 * the timeout, it will be removed as a visibility manager until it does
 	 * get embedded.  Ideally, we would only call docklet_embedded() when the
-	 * icon was actually embedded.
+	 * icon was actually embedded. This only happens when the docklet is first
+	 * created, not when being recreated.
+	 *
+	 * The x11 docklet tracks whether it successfully embedded in a pref and
+	 * allows for a longer timeout period if it successfully embedded the last
+	 * time it was run. This should hopefully solve problems with the buddy
+	 * list not properly starting hidden when gaim is started on login.
 	 */
-	pidgin_docklet_embedded();
-	embed_timeout = g_timeout_add(EMBED_TIMEOUT, docklet_x11_embed_timeout_cb, NULL);
+	if(!recreate) {
+		pidgin_docklet_embedded();
+		if(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/docklet/x11/embedded")) {
+			embed_timeout = g_timeout_add(LONG_EMBED_TIMEOUT, docklet_x11_embed_timeout_cb, NULL);
+		} else {
+			embed_timeout = g_timeout_add(SHORT_EMBED_TIMEOUT, docklet_x11_embed_timeout_cb, NULL);
+		}
+	}
 
 	purple_debug(PURPLE_DEBUG_INFO, "docklet", "created\n");
 }
 
+static void
+docklet_x11_create_ui_op()
+{
+	docklet_x11_create(FALSE);
+}
+
 static struct docklet_ui_ops ui_ops =
 {
-	docklet_x11_create,
+	docklet_x11_create_ui_op,
 	docklet_x11_destroy,
 	docklet_x11_update_icon,
 	docklet_x11_blank_icon,
@@ -298,4 +319,6 @@
 docklet_ui_init()
 {
 	pidgin_docklet_set_ui_ops(&ui_ops);
+	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/docklet/x11");
+	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/docklet/x11/embedded", FALSE);
 }
--- a/pidgin/plugins/perl/Makefile.am	Sat Apr 28 02:29:48 2007 +0000
+++ b/pidgin/plugins/perl/Makefile.am	Sat Apr 28 02:42:26 2007 +0000
@@ -24,10 +24,10 @@
 	common/GtkSound.xs \
 	common/GtkStatusBox.xs \
 	common/GtkThemes.xs \
-	common/GtkUI.pm \
-	common/GtkUI.xs \
 	common/GtkUtils.xs \
 	common/Makefile.PL.in \
+	common/Pidgin.pm \
+	common/Pidgin.xs \
 	common/gtkmodule.h \
 	common/typemap
 
--- a/pidgin/plugins/perl/common/GtkSession.xs	Sat Apr 28 02:29:48 2007 +0000
+++ b/pidgin/plugins/perl/common/GtkSession.xs	Sat Apr 28 02:42:26 2007 +0000
@@ -1,6 +1,6 @@
 #include "gtkmodule.h"
 
-MODULE = Purple::GtkUI::Session  PACKAGE = Purple::GtkUI::Session  PREFIX = gaim_gtk_session_
+MODULE = Pidgin::Session  PACKAGE = Pidgin::Session  PREFIX = pidgin_session_
 PROTOTYPES: ENABLE
 
 void
--- a/pidgin/plugins/perl/common/GtkUI.pm	Sat Apr 28 02:29:48 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-package Purple::GtkUI;
-
-use 5.008;
-use strict;
-use warnings;
-use Carp;
-
-our $VERSION = '0.01';
-
-use Purple;
-
-require XSLoader;
-XSLoader::load('Purple::GtkUI', $VERSION);
-
-1;
-__END__
-
-=head1 NAME
-
-Purple::GtkUI - Perl extension for the Pidgin instant messenger.
-
-=head1 SYNOPSIS
-
-    use Purple::GtkUI;
-
-=head1 ABSTRACT
-
-    This module provides the interface for using perl scripts as plugins in
-    Pidgin, with access to the Pidgin Gtk interface functions.
-
-=head1 DESCRIPTION
-
-This module provides the interface for using perl scripts as plugins in Pidgin,
-with access to the Pidgin Gtk interface functions. With this, developers can
-write perl scripts that can be loaded in Pidgin as plugins. The script can
-interact with IMs, chats, accounts, the buddy list, pidgin signals, and more.
-
-The API for the perl interface is very similar to that of the Pidgin C API,
-which can be viewed at http://developer.pidgin.im/doxygen/ or in the header files
-in the Pidgin source tree.
-
-=head1 FUNCTIONS
-
-=over
-
-=back
-
-=head1 SEE ALSO
-Pidgin C API documentation - http://developer.pidgin.im/doxygen/
-
-The Pidgin perl module.
-
-Pidgin website - http://pidgin.im/
-
-=head1 AUTHOR
-
-Etan Reisner, E<lt>deryni@gmail.comE<gt>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright 2006 by Etan Reisner
--- a/pidgin/plugins/perl/common/GtkUI.xs	Sat Apr 28 02:29:48 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-#include "gtkmodule.h"
-
-/* Prototypes for the BOOT section below. */
-PURPLE_PERL_BOOT_PROTO(GtkUI__Account);
-PURPLE_PERL_BOOT_PROTO(GtkUI__BuddyList);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Connection);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Conversation);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Conversation__Window);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Debug);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Dialogs);
-PURPLE_PERL_BOOT_PROTO(GtkUI__IMHtml);
-PURPLE_PERL_BOOT_PROTO(GtkUI__IMHtmlToolbar);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Log);
-PURPLE_PERL_BOOT_PROTO(GtkUI__MenuTray);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Plugin);
-PURPLE_PERL_BOOT_PROTO(GtkUI__PluginPref);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Pounce);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Prefs);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Privacy);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Roomlist);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Status);
-#ifndef _WIN32
-PURPLE_PERL_BOOT_PROTO(GtkUI__Session);
-#endif
-PURPLE_PERL_BOOT_PROTO(GtkUI__Sound);
-PURPLE_PERL_BOOT_PROTO(GtkUI__StatusBox);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Themes);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Utils);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Xfer);
-
-MODULE = Purple::GtkUI  PACKAGE = Purple::GtkUI  PREFIX = pidgin_
-PROTOTYPES: ENABLE
-
-BOOT:
-	PURPLE_PERL_BOOT(GtkUI__Account);
-	PURPLE_PERL_BOOT(GtkUI__BuddyList);
-	PURPLE_PERL_BOOT(GtkUI__Connection);
-	PURPLE_PERL_BOOT(GtkUI__Conversation);
-	PURPLE_PERL_BOOT(GtkUI__Conversation__Window);
-	PURPLE_PERL_BOOT(GtkUI__Debug);
-	PURPLE_PERL_BOOT(GtkUI__Dialogs);
-	PURPLE_PERL_BOOT(GtkUI__IMHtml);
-	PURPLE_PERL_BOOT(GtkUI__IMHtmlToolbar);
-	PURPLE_PERL_BOOT(GtkUI__Log);
-	PURPLE_PERL_BOOT(GtkUI__MenuTray);
-	PURPLE_PERL_BOOT(GtkUI__Plugin);
-	PURPLE_PERL_BOOT(GtkUI__PluginPref);
-	PURPLE_PERL_BOOT(GtkUI__Pounce);
-	PURPLE_PERL_BOOT(GtkUI__Prefs);
-	PURPLE_PERL_BOOT(GtkUI__Privacy);
-	PURPLE_PERL_BOOT(GtkUI__Roomlist);
-	PURPLE_PERL_BOOT(GtkUI__Status);
-#ifndef _WIN32
-	PURPLE_PERL_BOOT(GtkUI__Session);
-#endif
-	PURPLE_PERL_BOOT(GtkUI__Sound);
-	PURPLE_PERL_BOOT(GtkUI__StatusBox);
-	PURPLE_PERL_BOOT(GtkUI__Themes);
-	PURPLE_PERL_BOOT(GtkUI__Utils);
-	PURPLE_PERL_BOOT(GtkUI__Xfer);
--- a/pidgin/plugins/perl/common/MANIFEST	Sat Apr 28 02:29:48 2007 +0000
+++ b/pidgin/plugins/perl/common/MANIFEST	Sat Apr 28 02:42:26 2007 +0000
@@ -21,8 +21,8 @@
 GtkSound.xs
 GtkStatusBox.xs
 GtkThemes.xs
-GtkUI.pm
-GtkUI.xs
 GtkUtils.xs
 MANIFEST
+Pidgin.pm
+Pidgin.xs
 typemap
--- a/pidgin/plugins/perl/common/Makefile.PL.in	Sat Apr 28 02:29:48 2007 +0000
+++ b/pidgin/plugins/perl/common/Makefile.PL.in	Sat Apr 28 02:42:26 2007 +0000
@@ -1,20 +1,16 @@
 use 5.006;
 use ExtUtils::MakeMaker;
-
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence the contents
+# of the Makefile that is written.
 WriteMakefile(
-    'NAME'          => 'Purple::GtkUI',
-    'VERSION_FROM'  => '@srcdir@/GtkUI.pm', # finds $VERSION
+    'NAME'             => 'Pidgin',
+    'VERSION_FROM'     => '@srcdir@/Pidgin.pm', # finds $VERSION
     ($] >= 5.005 ? ## Add these new keywords supported since 5.005
-	('ABSTRACT_FROM' => '@srcdir@/GtkUI.pm', # finds $ABSTRACT
-	'AUTHOR'        => 'Pidgin <http://pidgin.im/>') :  ()),
+      ('ABSTRACT_FROM' => '@srcdir@/Pidgin.pm', # finds $ABSTRACT
+       'AUTHOR'        => 'Pidgin <http://pidgin.im/>') :  ()),
     'DEFINE'        => '@DEBUG_CFLAGS@',
     'INC'           => '-I. -I@srcdir@ -I@top_srcdir@ -I@top_srcdir@/libpurple -I@top_srcdir@/pidgin @GTK_CFLAGS@',
-#    'PREREQ_PM'     => { 'Pidgin' => '@VERSION@'},
-    # Do this because the MakeMaker Makefile is dumb, and on clean it moves
-    # Makefile to the default setting for MAKEFILE_OLD which is Makefile.old
-    # but this breaks running make clean more than once in a row.
-    'MAKEFILE_OLD'  => "Makefile",
-    'OBJECT'        => '$(O_FILES)',
+    'OBJECT'        => '$(O_FILES)', # link all the C files too
     'TYPEMAPS'      => ["@top_srcdir@/libpurple/plugins/perl/common/typemap"],
 #    'OPTIMIZE'      => '-g', # For debugging.
 );
--- a/pidgin/plugins/perl/common/Makefile.mingw	Sat Apr 28 02:29:48 2007 +0000
+++ b/pidgin/plugins/perl/common/Makefile.mingw	Sat Apr 28 02:42:26 2007 +0000
@@ -39,7 +39,7 @@
 ##  SOURCES, OBJECTS
 ##
 XS_FILES = \
-	GtkUI.xs \
+	Pidgin.xs \
 	GtkAccount.xs \
 	GtkBlist.xs \
 	GtkConn.xs \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/plugins/perl/common/Pidgin.pm	Sat Apr 28 02:42:26 2007 +0000
@@ -0,0 +1,61 @@
+package Pidgin;
+
+use 5.008;
+use strict;
+use warnings;
+use Carp;
+
+our $VERSION = '0.01';
+
+use Purple;
+
+require XSLoader;
+XSLoader::load('Pidgin', $VERSION);
+
+1;
+__END__
+
+=head1 NAME
+
+Pidgin - Perl extension for the Pidgin instant messenger.
+
+=head1 SYNOPSIS
+
+    use Pidgin;
+
+=head1 ABSTRACT
+
+    This module provides the interface for using perl scripts as plugins in
+    Pidgin, with access to the Pidgin Gtk interface functions.
+
+=head1 DESCRIPTION
+
+This module provides the interface for using perl scripts as plugins in Pidgin,
+with access to the Pidgin Gtk interface functions. With this, developers can
+write perl scripts that can be loaded in Pidgin as plugins. The script can
+interact with IMs, chats, accounts, the buddy list, pidgin signals, and more.
+
+The API for the perl interface is very similar to that of the Pidgin C API,
+which can be viewed at http://developer.pidgin.im/doxygen/ or in the header files
+in the Pidgin source tree.
+
+=head1 FUNCTIONS
+
+=over
+
+=back
+
+=head1 SEE ALSO
+Pidgin C API documentation - http://developer.pidgin.im/doxygen/
+
+The Pidgin perl module.
+
+Pidgin website - http://pidgin.im/
+
+=head1 AUTHOR
+
+Etan Reisner, E<lt>deryni@gmail.comE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2006 by Etan Reisner
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/plugins/perl/common/Pidgin.xs	Sat Apr 28 02:42:26 2007 +0000
@@ -0,0 +1,66 @@
+#define PIDGIN_PERL_BOOT_PROTO(x) \
+	void boot_Pidgin__##x(pTHX_ CV *cv)
+
+#define PIDGIN_PERL_BOOT(x) \
+	purple_perl_callXS(boot_Pidgin__##x, cv, mark)
+
+#include "gtkmodule.h"
+
+/* Prototypes for the BOOT section below. */
+PIDGIN_PERL_BOOT_PROTO(Account);
+PIDGIN_PERL_BOOT_PROTO(BuddyList);
+PIDGIN_PERL_BOOT_PROTO(Connection);
+PIDGIN_PERL_BOOT_PROTO(Conversation);
+PIDGIN_PERL_BOOT_PROTO(Conversation__Window);
+PIDGIN_PERL_BOOT_PROTO(Debug);
+PIDGIN_PERL_BOOT_PROTO(Dialogs);
+PIDGIN_PERL_BOOT_PROTO(IMHtml);
+PIDGIN_PERL_BOOT_PROTO(IMHtmlToolbar);
+PIDGIN_PERL_BOOT_PROTO(Log);
+PIDGIN_PERL_BOOT_PROTO(MenuTray);
+PIDGIN_PERL_BOOT_PROTO(Plugin);
+PIDGIN_PERL_BOOT_PROTO(PluginPref);
+PIDGIN_PERL_BOOT_PROTO(Pounce);
+PIDGIN_PERL_BOOT_PROTO(Prefs);
+PIDGIN_PERL_BOOT_PROTO(Privacy);
+PIDGIN_PERL_BOOT_PROTO(Roomlist);
+PIDGIN_PERL_BOOT_PROTO(Status);
+#ifndef _WIN32
+PIDGIN_PERL_BOOT_PROTO(Session);
+#endif
+PIDGIN_PERL_BOOT_PROTO(Sound);
+PIDGIN_PERL_BOOT_PROTO(StatusBox);
+PIDGIN_PERL_BOOT_PROTO(Themes);
+PIDGIN_PERL_BOOT_PROTO(Utils);
+PIDGIN_PERL_BOOT_PROTO(Xfer);
+
+MODULE = Pidgin  PACKAGE = Pidgin  PREFIX = pidgin_
+PROTOTYPES: ENABLE
+
+BOOT:
+	PIDGIN_PERL_BOOT(Account);
+	PIDGIN_PERL_BOOT(BuddyList);
+	PIDGIN_PERL_BOOT(Connection);
+	PIDGIN_PERL_BOOT(Conversation);
+	PIDGIN_PERL_BOOT(Conversation__Window);
+	PIDGIN_PERL_BOOT(Debug);
+	PIDGIN_PERL_BOOT(Dialogs);
+	PIDGIN_PERL_BOOT(IMHtml);
+	PIDGIN_PERL_BOOT(IMHtmlToolbar);
+	PIDGIN_PERL_BOOT(Log);
+	PIDGIN_PERL_BOOT(MenuTray);
+	PIDGIN_PERL_BOOT(Plugin);
+	PIDGIN_PERL_BOOT(PluginPref);
+	PIDGIN_PERL_BOOT(Pounce);
+	PIDGIN_PERL_BOOT(Prefs);
+	PIDGIN_PERL_BOOT(Privacy);
+	PIDGIN_PERL_BOOT(Roomlist);
+	PIDGIN_PERL_BOOT(Status);
+#ifndef _WIN32
+	PIDGIN_PERL_BOOT(Session);
+#endif
+	PIDGIN_PERL_BOOT(Sound);
+	PIDGIN_PERL_BOOT(StatusBox);
+	PIDGIN_PERL_BOOT(Themes);
+	PIDGIN_PERL_BOOT(Utils);
+	PIDGIN_PERL_BOOT(Xfer);