plugins/perl/scripts/gtk_frame_test.pl

Mon, 16 Apr 2007 00:43:53 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Mon, 16 Apr 2007 00:43:53 +0000
changeset 13071
b98e72d4089a
parent 11457
e787f1445e64
permissions
-rw-r--r--

Commit a proper copy of this binary file. The old one was corrupted,
probably due to missing SVN attributes.

This was retrieved from the following URL, though we may have it in CVS:
http://dev.openwengo.com/trac/openwengo/trac.cgi/browser/vendors/gaim/trunk/doc/oscar/On_Sending_Files_via_OSCAR.odt?rev=4273

11170
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
1 $MODULE_NAME = "GTK Frame Test";
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
2
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
3 use Gaim;
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
4
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
5 %PLUGIN_INFO = (
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
6 perl_api_version => 2,
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
7 name => " Perl: $MODULE_NAME",
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
8 version => "0.1",
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
9 summary => "Test plugin for the Perl interpreter.",
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
10 description => "Implements a set of test proccedures to ensure all functions that work in the C API still work in the Perl plugin interface. As XSUBs are added, this *should* be updated to test the changes. Furthermore, this will function as the tutorial perl plugin.",
11457
e787f1445e64 [gaim-migrate @ 13696]
Richard Laager <rlaager@pidgin.im>
parents: 11170
diff changeset
11 author => "John H. Kelm <johnhkelm\@gmail.com>",
11170
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
12 url => "http://gaim.sourceforge.net/",
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
13
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
14 GTK_UI => TRUE,
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
15 gtk_prefs_info => "foo",
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
16 load => "plugin_load",
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
17 unload => "plugin_unload",
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
18 );
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
19
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
20
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
21 sub plugin_init {
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
22 return %PLUGIN_INFO;
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
23 }
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
24
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
25 sub button_cb {
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
26 my $widget = shift;
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
27 my $data = shift;
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
28 print "Clicked button with message: " . $data . "\n";
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
29 }
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
30
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
31 sub foo {
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
32 eval '
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
33 use Glib;
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
34 use Gtk2 \'-init\';
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
35
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
36 $frame = Gtk2::Frame->new(\'Gtk Test Frame\');
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
37 $button = Gtk2::Button->new(\'Print Message\');
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
38
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
39 $frame->set_border_width(10);
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
40 $button->set_border_width(150);
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
41 $button->signal_connect("clicked" => \&button_cb, "Message Text");
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
42 $frame->add($button);
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
43
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
44 $button->show();
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
45 $frame->show();
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
46 ';
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
47 return $frame;
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
48 }
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
49
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
50 sub plugin_load {
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
51 my $plugin = shift;
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
52 print "#" x 80 . "\n";
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
53
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
54
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
55 ######### TEST CODE HERE ##########
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
56
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
57 print "$MODULE_NAME: Loading...\n";
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
58
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
59
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
60 Gaim::debug_info("plugin_load()", "Testing $MODULE_NAME Completed.");
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
61 print "#" x 80 . "\n\n";
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
62 }
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
63
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
64 sub plugin_unload {
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
65
d8941580d87f [gaim-migrate @ 13271]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
66 }

mercurial