[libinline-java-perl] 365/398: ok

Jonas Smedegaard dr at jones.dk
Thu Feb 26 11:43:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.55
in repository libinline-java-perl.

commit c27cfad4d78f2df16b39a06ebbe32d54d11e1001
Author: patrick_leb <>
Date:   Sat Jan 21 14:26:31 2006 +0000

    ok
---
 Java.pm                                 |  4 ++--
 Java/Array.pm                           |  2 +-
 Java/Callback.pm                        |  2 +-
 Java/Callback.pod                       |  2 +-
 Java/Class.pm                           |  3 ++-
 Java/Handle.pm                          |  2 +-
 Java/JNI.pm                             |  2 +-
 Java/JVM.pm                             |  2 +-
 Java/Object.pm                          |  2 +-
 Java/PerlInterpreter/PerlInterpreter.pm |  2 +-
 Java/Portable.pm                        |  2 +-
 Java/Protocol.pm                        | 25 +++++++++++++++++++++----
 Java/Server.pm                          |  2 +-
 t/swing_callback.pl                     | 17 ++++++++++++++---
 14 files changed, 49 insertions(+), 20 deletions(-)

diff --git a/Java.pm b/Java.pm
index 48592d2..01e0fda 100644
--- a/Java.pm
+++ b/Java.pm
@@ -6,9 +6,9 @@ package Inline::Java ;
 
 
 use strict ;
-require 5.008 ;
+require 5.006 ;
 
-$Inline::Java::VERSION = '0.50_91' ;
+$Inline::Java::VERSION = '0.50_92' ;
 
 
 # DEBUG is set via the DEBUG config
diff --git a/Java/Array.pm b/Java/Array.pm
index 286e30b..47b1772 100644
--- a/Java/Array.pm
+++ b/Java/Array.pm
@@ -4,7 +4,7 @@ package Inline::Java::Array ;
 use strict ;
 use Carp ;
 
-$Inline::Java::Array::VERSION = '0.50_91' ;
+$Inline::Java::Array::VERSION = '0.50_92' ;
 
 # Here we store as keys the knots and as values our blessed objects
 my $OBJECTS = {} ;
diff --git a/Java/Callback.pm b/Java/Callback.pm
index 1c6e82d..cf83cad 100644
--- a/Java/Callback.pm
+++ b/Java/Callback.pm
@@ -3,7 +3,7 @@ package Inline::Java::Callback ;
 use strict ;
 use Carp ;
 
-$Inline::Java::Callback::VERSION = '0.50_91' ;
+$Inline::Java::Callback::VERSION = '0.50_92' ;
 
 $Inline::Java::Callback::OBJECT_HOOK = undef ;
 
diff --git a/Java/Callback.pod b/Java/Callback.pod
index 6228cf6..2e2f796 100644
--- a/Java/Callback.pod
+++ b/Java/Callback.pod
@@ -193,7 +193,7 @@ function name. The result will then be passed on to Java as an Array:
 
 Note: When calling a Perl function that returns a list or array, you will
 need to pass the Class object for the expected array type (in this case
-String []). Since these Class objects are fiddicult to access for array 
+String []). Since these Class objects are difficult to access for array 
 types, the easiest way to do this is to create a dummy array of the desired 
 type and call the getClass() method on that object (as seen above).
    Z<>
diff --git a/Java/Class.pm b/Java/Class.pm
index 50c2cb1..39a4535 100644
--- a/Java/Class.pm
+++ b/Java/Class.pm
@@ -3,7 +3,7 @@ package Inline::Java::Class ;
 use strict ;
 use Carp ;
 
-$Inline::Java::Class::VERSION = '0.50_91' ;
+$Inline::Java::Class::VERSION = '0.50_92' ;
 
 $Inline::Java::Class::MAX_SCORE = 10 ;
 
@@ -85,6 +85,7 @@ my %double_classes = map {($_ => 1)} qw(
 my %string_classes = map {($_ => 1)} qw(
 	java.lang.String
 	java.lang.StringBuffer
+	java.lang.CharSequence
 ) ;
 
 my %char_classes = map {($_ => 1)} qw(
diff --git a/Java/Handle.pm b/Java/Handle.pm
index f713e7c..8ffc9a1 100644
--- a/Java/Handle.pm
+++ b/Java/Handle.pm
@@ -5,7 +5,7 @@ use strict ;
 use Symbol ;
 use Carp ;
 
-$Inline::Java::Handle::VERSION = '0.50_91' ;
+$Inline::Java::Handle::VERSION = '0.50_92' ;
 
 
 # Here we store as keys the knots and as values our blessed objects
diff --git a/Java/JNI.pm b/Java/JNI.pm
index 8905372..03fc6fe 100644
--- a/Java/JNI.pm
+++ b/Java/JNI.pm
@@ -4,7 +4,7 @@ package Inline::Java::JNI ;
 
 use strict ;
 
-$Inline::Java::JNI::VERSION = '0.50_91' ;
+$Inline::Java::JNI::VERSION = '0.50_92' ;
 
 use DynaLoader ;
 use Carp ;
diff --git a/Java/JVM.pm b/Java/JVM.pm
index c6eae9c..6b150e8 100644
--- a/Java/JVM.pm
+++ b/Java/JVM.pm
@@ -9,7 +9,7 @@ use IO::Socket ;
 use Text::ParseWords ;
 use Inline::Java::Portable ;
 
-$Inline::Java::JVM::VERSION = '0.50_91' ;
+$Inline::Java::JVM::VERSION = '0.50_92' ;
 
 my %SIGS = () ;
 
diff --git a/Java/Object.pm b/Java/Object.pm
index 900c0f5..0474231 100644
--- a/Java/Object.pm
+++ b/Java/Object.pm
@@ -5,7 +5,7 @@ use strict ;
 use Inline::Java::Protocol ;
 use Carp ;
 
-$Inline::Java::Object::VERSION = '0.50_91' ;
+$Inline::Java::Object::VERSION = '0.50_92' ;
 
 # Here we store as keys the knots and as values our blessed private objects
 my $PRIVATES = {} ;
diff --git a/Java/PerlInterpreter/PerlInterpreter.pm b/Java/PerlInterpreter/PerlInterpreter.pm
index 0f2965b..9f719bc 100644
--- a/Java/PerlInterpreter/PerlInterpreter.pm
+++ b/Java/PerlInterpreter/PerlInterpreter.pm
@@ -3,7 +3,7 @@ package Inline::Java::PerlInterpreter ;
 use strict ;
 use Inline::Java ;
 
-$Inline::Java::PerlInterpreter::VERSION = '0.50_91' ;
+$Inline::Java::PerlInterpreter::VERSION = '0.50_92' ;
 
 
 use Inline (
diff --git a/Java/Portable.pm b/Java/Portable.pm
index b3bff35..b7c629e 100644
--- a/Java/Portable.pm
+++ b/Java/Portable.pm
@@ -9,7 +9,7 @@ use Config ;
 use File::Find ;
 use File::Spec ;
 
-$Inline::Java::Portable::VERSION = '0.50_91' ;
+$Inline::Java::Portable::VERSION = '0.50_92' ;
 
 # Here is some code to figure out if we are running on command.com
 # shell under Windows.
diff --git a/Java/Protocol.pm b/Java/Protocol.pm
index 5dac09c..a599d97 100644
--- a/Java/Protocol.pm
+++ b/Java/Protocol.pm
@@ -5,10 +5,12 @@ use Inline::Java::Object ;
 use Inline::Java::Array ;
 use Carp ;
 use MIME::Base64 ;
-use Encode () ;
+BEGIN {
+	eval "require Encode" ;
+}
 
 
-$Inline::Java::Protocol::VERSION = '0.50_91' ;
+$Inline::Java::Protocol::VERSION = '0.50_92' ;
 
 my %CLASSPATH_ENTRIES = () ;
 
@@ -560,7 +562,14 @@ sub encode {
 	my $s = shift ;
 
 	# Get UTF-8 byte representation of the data.
-	my $bytes = Encode::encode_utf8($s) ;
+	my $bytes = undef ;
+	if ($INC{'Encode.pm'}){
+		$bytes = Encode::encode_utf8($s) ;
+	}
+	else {
+		$bytes = $s ;
+		$bytes =~ s/([\x80-\xFF])/chr(0xC0|ord($1)>>6).chr(0x80|ord($1)&0x3F)/eg ;
+	}
 
 	# Base-64 encode it.
 	my $base64 = encode_base64($bytes, '') ;
@@ -576,7 +585,15 @@ sub decode {
 	my $bytes = decode_base64($s) ;
 
 	# Take the UTF-8 encoding and convert it back to logical characters.
-	my $string = Encode::decode_utf8($bytes) ;
+	my $string = undef ;
+	if ($INC{'Encode.pm'}){
+		$string = Encode::decode_utf8($bytes) ;
+	}
+	else {
+		$string = $bytes ;
+		$string =~ s/([\xC2\xC3])([\x80-\xBF])/chr(ord($1)<<6&0xC0|ord($2)&0x3F)/eg ;
+	}
+
 	if (utf8->can('downgrade')){
 		utf8::downgrade($string, 1) ;
 	}
diff --git a/Java/Server.pm b/Java/Server.pm
index 90989c8..632a741 100644
--- a/Java/Server.pm
+++ b/Java/Server.pm
@@ -13,7 +13,7 @@ require Inline::Java ;
 use File::Spec ;
 
 
-$Inline::Java::Server::VERSION = '0.50_91' ;
+$Inline::Java::Server::VERSION = '0.50_92' ;
 
 
 # Create a dummy Inline::Java object in order to 
diff --git a/t/swing_callback.pl b/t/swing_callback.pl
index 8da3e89..0fb8879 100644
--- a/t/swing_callback.pl
+++ b/t/swing_callback.pl
@@ -16,9 +16,14 @@ print "loop done\n" ;
 sub button_pressed {
   $cnt++ ;
   print "Button Pressed $cnt times (from perl)\n" ;
-  if ($cnt >= 10){
-	 $greeter->StopCallbackLoop() ;
+  if ($cnt > 10){
+	 print "sleep starting\n" ;
+	 sleep(10) ;
+	 print "sleep stopping\n" ;
+	 # $greeter->StopCallbackLoop() ;
   }
+ 
+  return $cnt ;
 }
 
 __DATA__
@@ -32,6 +37,8 @@ import java.awt.event.*;
 public class MyButton extends    InlineJavaPerlCaller
                       implements ActionListener
 {
+  private String cnt = "0" ;
+
   public MyButton() throws InlineJavaException
   {
     // create frame
@@ -54,7 +61,11 @@ public class MyButton extends    InlineJavaPerlCaller
   {
     try
     {
-      CallPerlSub("main::button_pressed", new Object [] {});
+      if (cnt.equals("10")){
+        InterruptWaitForCallback() ;
+      }
+      cnt = (String)CallPerlSub("main::button_pressed", new Object [] {});
+      System.out.println("Button Pressed " + cnt + " times (from java)") ;
     }
     catch (InlineJavaPerlException pe)  { }
     catch (InlineJavaException pe) { pe.printStackTrace() ;}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libinline-java-perl.git



More information about the Pkg-perl-cvs-commits mailing list