r39832 - in /trunk/libgtk2-unique-perl: Changes META.yml debian/changelog debian/control examples/sample.pl lib/Gtk2/Unique.pm t/UniqueApp.t xs/UniqueApp.xs
ryan52-guest at users.alioth.debian.org
ryan52-guest at users.alioth.debian.org
Mon Jul 13 19:46:19 UTC 2009
Author: ryan52-guest
Date: Mon Jul 13 19:46:12 2009
New Revision: 39832
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=39832
Log:
* New upstream release
* Debian Policy 3.8.2
Modified:
trunk/libgtk2-unique-perl/Changes
trunk/libgtk2-unique-perl/META.yml
trunk/libgtk2-unique-perl/debian/changelog
trunk/libgtk2-unique-perl/debian/control
trunk/libgtk2-unique-perl/examples/sample.pl
trunk/libgtk2-unique-perl/lib/Gtk2/Unique.pm
trunk/libgtk2-unique-perl/t/UniqueApp.t
trunk/libgtk2-unique-perl/xs/UniqueApp.xs
Modified: trunk/libgtk2-unique-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgtk2-unique-perl/Changes?rev=39832&op=diff
==============================================================================
--- trunk/libgtk2-unique-perl/Changes (original)
+++ trunk/libgtk2-unique-perl/Changes Mon Jul 13 19:46:12 2009
@@ -1,6 +1,9 @@
Revision history for Gtk2::Unique
+
+
+0.02 Sun Jul 12 16:28:57 CEST 2009
+ More perlish API with send_message_by_name()
0.01 Thu Apr 2 15:44:36 CEST 2009
First version, released on an unsuspecting world.
-
Modified: trunk/libgtk2-unique-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgtk2-unique-perl/META.yml?rev=39832&op=diff
==============================================================================
--- trunk/libgtk2-unique-perl/META.yml (original)
+++ trunk/libgtk2-unique-perl/META.yml Mon Jul 13 19:46:12 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Gtk2-Unique
-version: 0.01
+version: 0.02
abstract: Use single instance applications
license: perl, lgpl
author:
Modified: trunk/libgtk2-unique-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgtk2-unique-perl/debian/changelog?rev=39832&op=diff
==============================================================================
--- trunk/libgtk2-unique-perl/debian/changelog (original)
+++ trunk/libgtk2-unique-perl/debian/changelog Mon Jul 13 19:46:12 2009
@@ -1,8 +1,13 @@
-libgtk2-unique-perl (0.01-2) UNRELEASED; urgency=low
+libgtk2-unique-perl (0.02-1) UNRELEASED; urgency=low
+ [ Nathan Handler ]
* debian/watch: Update to ignore development releases.
- -- Nathan Handler <nhandler at ubuntu.com> Sat, 06 Jun 2009 01:34:23 +0000
+ [ Ryan Niebur ]
+ * New upstream release
+ * Debian Policy 3.8.2
+
+ -- Ryan Niebur <ryanryan52 at gmail.com> Mon, 13 Jul 2009 12:46:03 -0700
libgtk2-unique-perl (0.01-1) unstable; urgency=low
Modified: trunk/libgtk2-unique-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgtk2-unique-perl/debian/control?rev=39832&op=diff
==============================================================================
--- trunk/libgtk2-unique-perl/debian/control (original)
+++ trunk/libgtk2-unique-perl/debian/control Mon Jul 13 19:46:12 2009
@@ -6,7 +6,7 @@
# xvfb, xauth, xfonts-base, dbus-x11
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Ryan Niebur <ryanryan52 at gmail.com>
-Standards-Version: 3.8.1
+Standards-Version: 3.8.2
Homepage: http://search.cpan.org/dist/Gtk2-Unique/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libgtk2-unique-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libgtk2-unique-perl/
Modified: trunk/libgtk2-unique-perl/examples/sample.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgtk2-unique-perl/examples/sample.pl?rev=39832&op=diff
==============================================================================
--- trunk/libgtk2-unique-perl/examples/sample.pl (original)
+++ trunk/libgtk2-unique-perl/examples/sample.pl Mon Jul 13 19:46:12 2009
@@ -33,8 +33,7 @@
# If there already is an instance running, this will return TRUE; there's no
# race condition because the check is already performed at construction time.
if ($app->is_running) {
- my $data = [$text, '/etc/passwd'];
- my $response = $app->send_message($COMMAND_WRITE, data => '/etc/passwd');
+ my $response = $app->send_message_by_name(write => data => $text);
return 0;
}
Modified: trunk/libgtk2-unique-perl/lib/Gtk2/Unique.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgtk2-unique-perl/lib/Gtk2/Unique.pm?rev=39832&op=diff
==============================================================================
--- trunk/libgtk2-unique-perl/lib/Gtk2/Unique.pm (original)
+++ trunk/libgtk2-unique-perl/lib/Gtk2/Unique.pm Mon Jul 13 19:46:12 2009
@@ -22,7 +22,7 @@
if ($app->is_running) {
# The application is already running, send it a message
my ($text) = @ARGV ? @ARGV : ("Foo text here");
- $app->send_message($COMMAND_FOO, text => $text);
+ $app->send_message_by_name('foo', text => $text);
}
else {
# Create the single application instance and wait for other requests
@@ -91,7 +91,7 @@
use Gtk2;
-our $VERSION = '0.01';
+our $VERSION = '0.02';
sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 }
Modified: trunk/libgtk2-unique-perl/t/UniqueApp.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgtk2-unique-perl/t/UniqueApp.t?rev=39832&op=diff
==============================================================================
--- trunk/libgtk2-unique-perl/t/UniqueApp.t (original)
+++ trunk/libgtk2-unique-perl/t/UniqueApp.t Mon Jul 13 19:46:12 2009
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Gtk2::TestHelper tests => 10;
+use Gtk2::TestHelper tests => 16;
use Gtk2::Unique;
@@ -79,7 +79,7 @@
if (! $app->is_running()) {
SKIP: {
- skip "No app is running; execute perl -Mblib t/unit-tests.pl", 3;
+ skip "No app is running; execute perl -Mblib t/unit-tests.pl", 6;
}
return;
}
@@ -88,8 +88,16 @@
$response = $app->send_message($COMMAND_FOO, text => "hello");
is($response, 'ok', "send_message(text)");
+ $response = $app->send_message_by_name(foo => text => "hello");
+ is($response, 'ok', "send_message_by_name(text)");
+
+
$response = $app->send_message($COMMAND_BAR, filename => __FILE__);
is($response, 'invalid', "send_message(filename)");
+
+ $response = $app->send_message_by_name(bar => filename => __FILE__);
+ is($response, 'invalid', "send_message_by_name(filename)");
+
$response = $app->send_message($COMMAND_FOO, uris => [
'http://live.gnome.org/LibUnique',
@@ -97,6 +105,12 @@
]);
is($response, 'ok', "send_message(uris)");
+ $response = $app->send_message_by_name(foo =>, uris => [
+ 'http://live.gnome.org/LibUnique',
+ 'http://gtk2-perl.sourceforge.net/',
+ ]);
+ is($response, 'ok', "send_message_by_name(uris)");
+
my $window = Gtk2::Window->new();
$app->watch_window($window);
Modified: trunk/libgtk2-unique-perl/xs/UniqueApp.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgtk2-unique-perl/xs/UniqueApp.xs?rev=39832&op=diff
==============================================================================
--- trunk/libgtk2-unique-perl/xs/UniqueApp.xs (original)
+++ trunk/libgtk2-unique-perl/xs/UniqueApp.xs Mon Jul 13 19:46:12 2009
@@ -7,7 +7,7 @@
UniqueApp_noinc*
unique_app_new (class, const gchar *name, const gchar_ornull *startup_id, ...)
ALIAS:
- Gtk2::UniqueApp::new_with_commands = 1
+ new_with_commands = 1
PREINIT:
UniqueApp *app = NULL;
@@ -70,19 +70,51 @@
unique_app_is_running (UniqueApp *app)
+#
# $app->send_message($ID) -> unique_app_send_message(app, command_id, NULL);
# $app->send_message($ID, text => $text) -> set_text() unique_app_send_message(app, command_id, message);
# $app->send_message($ID, data => $data) -> set() unique_app_send_message(app, command_id, message);
# $app->send_message($ID, uris => @uri) -> set_uris() unique_app_send_message(app, command_id, message);
#
+# $app->send_message_by_name('command') -> unique_app_send_message(app, command_id, NULL);
+# $app->send_message_by_name('command', text => $text) -> set_text() unique_app_send_message(app, command_id, message);
+# $app->send_message_by_name('command', data => $data) -> set() unique_app_send_message(app, command_id, message);
+# $app->send_message_by_name('command', uris => @uri) -> set_uris() unique_app_send_message(app, command_id, message);
+#
#
UniqueResponse
-unique_app_send_message (UniqueApp *app, gint command_id, ...)
+unique_app_send_message (UniqueApp *app, SV *command, ...)
+ ALIAS:
+ send_message_by_name = 1
+
PREINIT:
UniqueMessageData *message = NULL;
SV **s = NULL;
+ gint command_id = 0;
CODE:
+
+ switch (ix) {
+ case 0:
+ {
+ command_id = (gint) SvIV(command);
+ }
+ break;
+
+ case 1:
+ {
+ gchar *command_name = SvGChar(command);
+ command_id = unique_command_from_string(app, command_name);
+ if (command_id == 0) {
+ croak("Command '%s' isn't registered with the application", command_name);
+ }
+ }
+ break;
+
+ default:
+ croak("Method called with the wrong name");
+ }
+
if (items == 4) {
SV *sv_data;
gchar *type;
More information about the Pkg-perl-cvs-commits
mailing list