changeset 17104:7cdc1d7fad55

merge of '2d13b954e5450868a468d8b0a8c49f22f3b6d09f' and '48de9c844b6b246cc9f0be9ce455ed6d33d4c9da'
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 16 May 2007 04:03:58 +0000
parents 80350acaa289 (diff) de2946d55a2d (current diff)
children 3aee35e0ecd8 fb35886b0d85 77f8b8adb256 150980c9d79d
files
diffstat 4 files changed, 85 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/perl/Makefile.am	Wed May 16 03:18:33 2007 +0000
+++ b/libpurple/plugins/perl/Makefile.am	Wed May 16 04:03:58 2007 +0000
@@ -78,7 +78,8 @@
 #	common/fallback/const-xs.inc
 
 perl_scripts = \
-	scripts/function_list.pl
+	scripts/function_list.pl \
+	scripts/signals-test.pl
 
 EXTRA_DIST = \
 	Makefile.mingw \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/plugins/perl/scripts/signals-test.pl	Wed May 16 04:03:58 2007 +0000
@@ -0,0 +1,80 @@
+$MODULE_NAME = "Signals Test Script in Perl";
+
+use Purple;
+
+%PLUGIN_INFO = (
+	perl_api_version => 2,
+	name => "Perl: $MODULE_NAME",
+	version => "0.1",
+	summary => "Signals Test plugin for the Perl interpreter.",
+	description => "Demonstrate the user of purple signals from " .
+		       "a perl plugin.",
+	author => "Sadrul Habib Chowdhury <sadrul\@pidgin.im>",
+	url => "http://developer.pidgin.im/wiki/sadrul/",
+
+	load => "plugin_load",
+	unload => "plugin_unload"
+);
+
+# Accounts
+sub account_connecting_cb
+{
+	my $account = shift;
+	Purple::Debug::misc("signals test in perl", "account-connecting (" . $account->get_username() . ")\n");
+}
+
+# Buddylist
+sub buddy_signed_on
+{
+	my $buddy = shift;
+	Purple::Debug::misc("signals test in perl", "buddy-signed-on (" . $buddy->get_name() . ")\n");
+}
+
+# Connections
+sub signed_on
+{
+	my $conn = shift;
+	Purple::Debug::misc("signals test in perl", "signed-on (" . $conn->get_account()->get_username() . ")\n");
+}
+
+# Conversations
+sub conv_received_msg
+{
+	my ($account, $sender, $message, $conv, $flags, $data) = @_;
+	Purple::Debug::misc("signals test in perl", "$data (" . $account->get_username() . ", $sender, $message, $flags)\n");
+}
+
+sub plugin_load
+{
+	my $plugin = shift;
+
+	# Hook to the signals
+
+	# Accounts
+	$act_handle = Purple::Accounts::get_handle();
+	Purple::Signal::connect($act_handle, "account-connecting", $plugin,
+					\&account_connecting_cb, 0);
+
+	# Buddy List
+	$blist = Purple::BuddyList::get_handle();
+	Purple::Signal::connect($blist, "buddy-signed-on", $plugin,
+					\&buddy_signed_on, 0);
+
+	# Connections
+	$conn = Purple::Connections::get_handle();
+	Purple::Signal::connect($conn, "signed-on", $plugin,
+					\&signed_on, 0);
+
+	# Conversations
+	$conv = Purple::Conversations::get_handle();
+	Purple::Signal::connect($conv, "received-im-msg", $plugin,
+					\&conv_received_msg, "received im message");
+	Purple::Signal::connect($conv, "received-chat-msg", $plugin,
+					\&conv_received_msg, "received chat message");
+}
+
+sub plugin_unload
+{
+	# Nothing to do here for this plugin.
+}
+
--- a/pidgin/gtkconv.c	Wed May 16 03:18:33 2007 +0000
+++ b/pidgin/gtkconv.c	Wed May 16 04:03:58 2007 +0000
@@ -8304,6 +8304,7 @@
 	}
 
 	ebox = gtk_event_box_new();
+	gtk_event_box_set_visible_window(GTK_EVENT_BOX(ebox), FALSE);
 	gtk_container_add(GTK_CONTAINER(ebox), gtkconv->tabby);
 	g_signal_connect(G_OBJECT(ebox), "button-press-event",
 					G_CALLBACK(alias_double_click_cb), gtkconv);
--- a/pidgin/gtkdnd-hints.c	Wed May 16 03:18:33 2007 +0000
+++ b/pidgin/gtkdnd-hints.c	Wed May 16 04:03:58 2007 +0000
@@ -91,8 +91,6 @@
 	if (w->parent && w->parent->window == w->window)
 	{
 		get_widget_coords(w->parent, &ox, &oy, NULL, NULL);
-		ox += w->allocation.x;
-		oy += w->allocation.y;
 		height = w->allocation.height;
 		width = w->allocation.width;
 	}
@@ -174,6 +172,8 @@
 	gint x = 0, y = 0;
 
 	get_widget_coords(widget, &x1, &y1, &x2, &y2);
+	x1 += widget->allocation.x;	x2 += widget->allocation.x;
+	y1 += widget->allocation.y;	y2 += widget->allocation.y;
 
 	switch (horiz)
 	{