harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r576185 [1/4] - in /harmony/enhanced/classlib/branches/java6/modules: archive/src/main/native/archive/shared/ auth/ auth/src/main/java/common/org/apache/harmony/auth/module/ auth/src/test/java/common/org/apache/harmony/auth/tests/module/ au...
Date Sun, 16 Sep 2007 21:56:47 GMT
Author: tellison
Date: Sun Sep 16 14:56:42 2007
New Revision: 576185

URL: http://svn.apache.org/viewvc?rev=576185&view=rev
Log:
Merge updates between classlib trunk@r572896 and r576177

Added:
    harmony/enhanced/classlib/branches/java6/modules/auth/src/main/java/common/org/apache/harmony/auth/module/KeyStoreLoginModule.java
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/apache/harmony/auth/module/KeyStoreLoginModule.java
    harmony/enhanced/classlib/branches/java6/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/module/KeyStoreLoginModuleTest.java
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/module/KeyStoreLoginModuleTest.java
    harmony/enhanced/classlib/branches/java6/modules/auth/src/test/resources/fault_pass
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/auth/src/test/resources/fault_pass
    harmony/enhanced/classlib/branches/java6/modules/auth/src/test/resources/hyts_ks.bks
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/auth/src/test/resources/hyts_ks.bks
    harmony/enhanced/classlib/branches/java6/modules/auth/src/test/resources/hyts_ks_pass
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/auth/src/test/resources/hyts_ks_pass
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/resources/font.properties.xp
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/awt/src/main/resources/font.properties.xp
    harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java-internal/java/beans/NullPersistenceDelegateTest.java
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/beans/src/test/java-internal/java/beans/NullPersistenceDelegateTest.java
    harmony/enhanced/classlib/branches/java6/modules/beans/src/test/resources/xml/Array.xml
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/beans/src/test/resources/xml/Array.xml
    harmony/enhanced/classlib/branches/java6/modules/beans/src/test/resources/xml/Integer.xml
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/beans/src/test/resources/xml/Integer.xml
    harmony/enhanced/classlib/branches/java6/modules/beans/src/test/resources/xml/Proxy.xml
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/beans/src/test/resources/xml/Proxy.xml
    harmony/enhanced/classlib/branches/java6/modules/imageio/src/test/java/javax/imageio/stream/
      - copied from r576177, harmony/enhanced/classlib/trunk/modules/imageio/src/test/java/javax/imageio/stream/
    harmony/enhanced/classlib/branches/java6/modules/imageio/src/test/java/javax/imageio/stream/ImageInputStreamImplTest.java
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/imageio/src/test/java/javax/imageio/stream/ImageInputStreamImplTest.java
    harmony/enhanced/classlib/branches/java6/modules/imageio/src/test/java/javax/imageio/stream/ImageOutputStreamImplTest.java
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/imageio/src/test/java/javax/imageio/stream/ImageOutputStreamImplTest.java
    harmony/enhanced/classlib/branches/java6/modules/rmi/src/test/api/java/org/apache/harmony/rmi/server/ExportExceptionTest.java
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/rmi/src/test/api/java/org/apache/harmony/rmi/server/ExportExceptionTest.java
    harmony/enhanced/classlib/branches/java6/modules/rmi/src/test/resources/serialization/
      - copied from r576177, harmony/enhanced/classlib/trunk/modules/rmi/src/test/resources/serialization/
    harmony/enhanced/classlib/branches/java6/modules/rmi/src/test/resources/serialization/org/
      - copied from r576177, harmony/enhanced/classlib/trunk/modules/rmi/src/test/resources/serialization/org/
    harmony/enhanced/classlib/branches/java6/modules/rmi/src/test/resources/serialization/org/apache/
      - copied from r576177, harmony/enhanced/classlib/trunk/modules/rmi/src/test/resources/serialization/org/apache/
    harmony/enhanced/classlib/branches/java6/modules/rmi/src/test/resources/serialization/org/apache/harmony/
      - copied from r576177, harmony/enhanced/classlib/trunk/modules/rmi/src/test/resources/serialization/org/apache/harmony/
    harmony/enhanced/classlib/branches/java6/modules/rmi/src/test/resources/serialization/org/apache/harmony/rmi/
      - copied from r576177, harmony/enhanced/classlib/trunk/modules/rmi/src/test/resources/serialization/org/apache/harmony/rmi/
    harmony/enhanced/classlib/branches/java6/modules/rmi/src/test/resources/serialization/org/apache/harmony/rmi/server/
      - copied from r576177, harmony/enhanced/classlib/trunk/modules/rmi/src/test/resources/serialization/org/apache/harmony/rmi/server/
    harmony/enhanced/classlib/branches/java6/modules/rmi/src/test/resources/serialization/org/apache/harmony/rmi/server/ExportExceptionTest.golden.ser
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/rmi/src/test/resources/serialization/org/apache/harmony/rmi/server/ExportExceptionTest.golden.ser
    harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/HYOptimisticProvider.java
      - copied unchanged from r576177, harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/HYOptimisticProvider.java
Modified:
    harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/archiveglob.c
    harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/jarfile.c
    harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/zip.c
    harmony/enhanced/classlib/branches/java6/modules/auth/.classpath
    harmony/enhanced/classlib/branches/java6/modules/auth/src/main/java/common/org/apache/harmony/auth/module/LoginModuleUtils.java
    harmony/enhanced/classlib/branches/java6/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/module/LoginModuleUtilsTest.java
    harmony/enhanced/classlib/branches/java6/modules/awt/build.xml
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/ToolkitImpl.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/FontManager.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/image/OffscreenImage.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/nativebridge/linux/X11.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxWindow.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/blitter.cpp
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/blitter.h
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.h
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/WinGDIPGraphics2D.cpp
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/include/org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D.h
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/x11wrapper/unix/exports.txt
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.cpp
    harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.h
    harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/EventSetDescriptor.java
    harmony/enhanced/classlib/branches/java6/modules/beans/src/main/java/java/beans/NullPersistenceDelegate.java
    harmony/enhanced/classlib/branches/java6/modules/beans/src/test/java/org/apache/harmony/beans/tests/java/beans/PersistenceDelegateTest.java
    harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/java/javax/imageio/stream/ImageInputStreamImpl.java
    harmony/enhanced/classlib/branches/java6/modules/imageio/src/main/java/javax/imageio/stream/ImageOutputStreamImpl.java
    harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/InitialContext.java
    harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86.drl
    harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.linux.x86_64.drl
    harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86.drl
    harmony/enhanced/classlib/branches/java6/modules/luni/make/exclude.windows.x86_64.drl
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/EnumMap.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/HashMap.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Map.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSFileSystem.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/file.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/luniglob.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/nethelp.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/nethelp.h
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/ois.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/proxy.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/socket.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/HashMapTest.java
    harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigInteger.java
    harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java
    harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Codec.java
    harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java
    harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java
    harmony/enhanced/classlib/branches/java6/modules/rmi/META-INF/MANIFEST.MF
    harmony/enhanced/classlib/branches/java6/modules/rmi/build.xml
    harmony/enhanced/classlib/branches/java6/modules/security/META-INF/MANIFEST.MF
    harmony/enhanced/classlib/branches/java6/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Provider2Test.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/nls/messages.properties
    harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRow.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRowSetImpl.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRowSetWriter.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/FilteredRowSetImpl.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/JoinRowSetImpl.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/WebRowSetImpl.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/internal/rowset/CachedRowSetImplTest.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/AbstractButton.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/DefaultButtonModel.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/JTable.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/JToggleButton.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/RepaintManager.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/colorchooser/SwatchesPanel.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicComboBoxUI.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/main/java/common/javax/swing/text/AbstractDocument.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/AbstractButtonTest.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/plaf/basic/BasicMenuItemUITest.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/plaf/basic/BasicMenuUITest.java

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/archiveglob.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/archiveglob.c?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/archiveglob.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/archiveglob.c Sun Sep 16 14:56:42 2007
@@ -150,5 +150,5 @@
   /* clean up class references */
   classRef = JCL_CACHE_GET (env, CLS_java_util_zip_ZipEntry);
   if (classRef)
-    (*env)->DeleteWeakGlobalRef (env, (jweak) classRef);
+    (*env)->DeleteGlobalRef (env, classRef);
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/jarfile.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/jarfile.c?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/jarfile.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/jarfile.c Sun Sep 16 14:56:42 2007
@@ -69,11 +69,6 @@
     }
 
   javaClass = JCL_CACHE_GET (env, CLS_java_util_zip_ZipEntry);
-  javaClass = (*env)->NewLocalRef(env, javaClass);
-  if (javaClass == NULL) {
-      return NULL;
-  }
-
   mid = JCL_CACHE_GET (env, MID_java_util_zip_ZipEntry_init);
   java_ZipEntry = ((*env)->NewObject (env, javaClass, mid, entryName, NULL,
 				      extra,

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/zip.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/zip.c?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/zip.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/native/archive/shared/zip.c Sun Sep 16 14:56:42 2007
@@ -304,7 +304,7 @@
   JCLZipFileLink *zipfileHandles;
 
   javaClass = (*env)->FindClass (env, "java/util/zip/ZipEntry");
-  weakJavaClass = (*env)->NewWeakGlobalRef (env, javaClass);
+  weakJavaClass = (*env)->NewGlobalRef (env, javaClass);
   if (!weakJavaClass)
     return;
   mid =

Modified: harmony/enhanced/classlib/branches/java6/modules/auth/.classpath
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/auth/.classpath?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/auth/.classpath (original)
+++ harmony/enhanced/classlib/branches/java6/modules/auth/.classpath Sun Sep 16 14:56:42 2007
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry output="bin/main" kind="src" path="src/main/java/windows"/>
-	<classpathentry output="bin/main" kind="src" path="src/main/java/common"/>
-	<classpathentry output="bin/main" kind="src" path="src/main/java/unix"/>
-	<classpathentry output="bin/test" kind="src" path="src/test/java/common"/>
-	<classpathentry output="bin/test" kind="src" path="src/test/java/windows"/>
-	<classpathentry output="bin/test" kind="src" path="src/test/java/unix"/>
+	<classpathentry kind="src" output="bin/main" path="src/main/java/windows"/>
+	<classpathentry kind="src" output="bin/test" path="src/test/resources"/>
+	<classpathentry kind="src" output="bin/main" path="src/main/java/common"/>
+	<classpathentry kind="src" output="bin/main" path="src/main/java/unix"/>
+	<classpathentry kind="src" output="bin/test" path="src/test/java/common"/>
+	<classpathentry kind="src" output="bin/test" path="src/test/java/windows"/>
+	<classpathentry kind="src" output="bin/test" path="src/test/java/unix"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry sourcepath="JUNIT_SRC_HOME/junitsrc.zip" kind="var" path="JUNIT_HOME/junit.jar"/>
 	<classpathentry kind="output" path="bin/main"/>

Modified: harmony/enhanced/classlib/branches/java6/modules/auth/src/main/java/common/org/apache/harmony/auth/module/LoginModuleUtils.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/auth/src/main/java/common/org/apache/harmony/auth/module/LoginModuleUtils.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/auth/src/main/java/common/org/apache/harmony/auth/module/LoginModuleUtils.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/auth/src/main/java/common/org/apache/harmony/auth/module/LoginModuleUtils.java Sun Sep 16 14:56:42 2007
@@ -25,16 +25,16 @@
 
 public class LoginModuleUtils {
     
+    public static enum ACTION {
+        no_action, login, commit, logout
+    };
+    
     public final static class LoginModuleStatus {        
 
         private static enum PHASE {
             uninitialized, initialized, logined, committed
         };
 
-        public static enum ACTION {
-            no_action, login, commit, logout
-        };
-
         private PHASE phase;
         
         public LoginModuleStatus(){
@@ -56,7 +56,26 @@
         public void logouted(){
             phase = PHASE.logined;
         }
+        
+        public boolean isLoggined(){
+            return phase.equals(PHASE.logined) || phase.equals(PHASE.committed);
+        }
+        
+        public boolean isCommitted(){
+            return phase.equals(PHASE.committed);
+        }
 
+        
+        public ACTION checkAbout() {
+            switch (phase) {
+            case uninitialized:
+            case initialized:
+                return ACTION.no_action;
+            default:
+                return ACTION.logout;
+            }
+        }
+        
         public ACTION checkLogin() throws LoginException {
             switch (phase) {
             case uninitialized:

Modified: harmony/enhanced/classlib/branches/java6/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/module/LoginModuleUtilsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/module/LoginModuleUtilsTest.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/module/LoginModuleUtilsTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/module/LoginModuleUtilsTest.java Sun Sep 16 14:56:42 2007
@@ -97,7 +97,7 @@
         }
 
         status.initialized();
-        assertEquals(LoginModuleUtils.LoginModuleStatus.ACTION.login, status
+        assertEquals(LoginModuleUtils.ACTION.login, status
                 .checkLogin());
 
         try {
@@ -106,31 +106,31 @@
             // expected
         }
 
-        assertEquals(LoginModuleUtils.LoginModuleStatus.ACTION.no_action,
+        assertEquals(LoginModuleUtils.ACTION.no_action,
                 status.checkLogout());
 
         status.logined();
-        assertEquals(LoginModuleUtils.LoginModuleStatus.ACTION.no_action,
+        assertEquals(LoginModuleUtils.ACTION.no_action,
                 status.checkLogin());
-        assertEquals(LoginModuleUtils.LoginModuleStatus.ACTION.commit, status
+        assertEquals(LoginModuleUtils.ACTION.commit, status
                 .checkCommit());
-        assertEquals(LoginModuleUtils.LoginModuleStatus.ACTION.no_action,
+        assertEquals(LoginModuleUtils.ACTION.no_action,
                 status.checkLogout());
 
         status.committed();
-        assertEquals(LoginModuleUtils.LoginModuleStatus.ACTION.no_action,
+        assertEquals(LoginModuleUtils.ACTION.no_action,
                 status.checkLogin());
-        assertEquals(LoginModuleUtils.LoginModuleStatus.ACTION.no_action,
+        assertEquals(LoginModuleUtils.ACTION.no_action,
                 status.checkCommit());
-        assertEquals(LoginModuleUtils.LoginModuleStatus.ACTION.logout, status
+        assertEquals(LoginModuleUtils.ACTION.logout, status
                 .checkLogout());
 
         status.logined();
-        assertEquals(LoginModuleUtils.LoginModuleStatus.ACTION.no_action,
+        assertEquals(LoginModuleUtils.ACTION.no_action,
                 status.checkLogin());
-        assertEquals(LoginModuleUtils.LoginModuleStatus.ACTION.commit, status
+        assertEquals(LoginModuleUtils.ACTION.commit, status
                 .checkCommit());
-        assertEquals(LoginModuleUtils.LoginModuleStatus.ACTION.no_action,
+        assertEquals(LoginModuleUtils.ACTION.no_action,
                 status.checkLogout());
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/build.xml?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/build.xml Sun Sep 16 14:56:42 2007
@@ -107,7 +107,7 @@
         </javac>
     </target>
 
-    <target name="copy-resources">
+    <target name="copy-resources" depends="-copy-win-resources">
         <mkdir dir="${hy.build}" />
         <copy todir="${hy.build}" includeemptydirs="false">
             <fileset dir="${hy.awt.src.main.java}">
@@ -119,6 +119,12 @@
         <copy todir="${hy.jdk}/jre/lib/cmm">
             <fileset dir="${hy.awt.src.main.resources}/cmm"/>
         </copy>	
+    </target>
+    
+    <target name="-copy-win-resources" if="is.windows">
+        <mkdir dir="${hy.jdk}/jre/lib" />
+        <copy file="${hy.awt.src.main.resources}/font.properties.xp"
+              tofile="${hy.jdk}/jre/lib/font.properties"/>
     </target>
 
     <target name="build-jar" depends="svn-info">

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/ToolkitImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/ToolkitImpl.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/ToolkitImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/java/awt/ToolkitImpl.java Sun Sep 16 14:56:42 2007
@@ -35,6 +35,7 @@
 import org.apache.harmony.awt.datatransfer.DTK;
 import org.apache.harmony.awt.gl.*;
 import org.apache.harmony.awt.gl.image.*;
+import java.awt.datatransfer.StringSelection;
 
 class ToolkitImpl extends Toolkit {
     static final Hashtable<Serializable, Image> imageCache = new Hashtable<Serializable, Image>();
@@ -495,6 +496,9 @@
             }
             if (systemClipboard == null) {
                 systemClipboard = DTK.getDTK().getNativeClipboard();
+            }
+            if (systemClipboard.getContents(null) == null) {
+                systemClipboard.setContents ( new StringSelection("") , null);
             }
             return systemClipboard;
         } finally {

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/FontManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/FontManager.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/FontManager.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/FontManager.java Sun Sep 16 14:56:42 2007
@@ -611,10 +611,31 @@
 
             pathname = javaHome + pathname;
 
-            pathname = pathname.replaceAll("Language", language). //$NON-NLS-1$
-                                replaceAll("Country", country). //$NON-NLS-1$
-                                replaceAll("Encoding", fileEncoding). //$NON-NLS-1$
-                                replaceAll("Version", version); //$NON-NLS-1$
+//            pathname = pathname.replaceAll("Language", language). //$NON-NLS-1$
+//                                replaceAll("Country", country). //$NON-NLS-1$
+//                                replaceAll("Encoding", fileEncoding). //$NON-NLS-1$
+//                                replaceAll("Version", version); //$NON-NLS-1$
+	     int curPos;
+            StringBuilder result = new StringBuilder(pathname);
+
+            curPos = result.indexOf("Language"); //$NON-NLS-1$
+            if (curPos >= 0) {
+            	result.replace( curPos, curPos+8, language);
+            }
+            curPos = result.indexOf("Country"); //$NON-NLS-1$
+            if (curPos >= 0) {
+            	result.replace( curPos, curPos+7, country);
+            }
+            curPos = result.indexOf("Encoding"); //$NON-NLS-1$
+            if (curPos >= 0) {
+            	result.replace( curPos, curPos+8, fileEncoding);
+            }
+            curPos = result.indexOf("Version"); //$NON-NLS-1$
+            if (curPos >= 0) {
+            	result.replace( curPos, curPos+7, version);
+            }
+            pathname =  result.toString();
+
 
             file = new File(pathname);
 

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/image/OffscreenImage.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/image/OffscreenImage.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/image/OffscreenImage.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/image/OffscreenImage.java Sun Sep 16 14:56:42 2007
@@ -28,6 +28,7 @@
 import java.awt.Image;
 import java.awt.image.BufferedImage;
 import java.awt.image.ColorModel;
+import java.awt.image.ComponentColorModel;
 import java.awt.image.DataBuffer;
 import java.awt.image.DataBufferByte;
 import java.awt.image.DataBufferInt;
@@ -285,7 +286,17 @@
                 line++, lineOff += scansize, rof += scanline){
                 System.arraycopy(pixels, lineOff, data, rof, w);
             }
-        }else{
+        }else if(model == cm && model.getTransferType() == DataBuffer.TYPE_BYTE &&
+                cm instanceof ComponentColorModel){
+
+            int nc = cm.getNumComponents();
+            byte stride[] = new byte[scansize];
+            for (int sy = y, sOff = off; sy < y + h; sy++, sOff += scansize) {
+                System.arraycopy(pixels, sOff, stride, 0, scansize);
+                
+                raster.setDataElements(x, sy, w, 1, stride);
+            }
+        }else {
             for (int sy = y, sOff = off; sy < y + h; sy++, sOff += scansize) {
                 for (int sx = x, idx = 0; sx < x + w; sx++, idx++) {
                     int rgb = model.getRGB(pixels[sOff + idx] & 0xff);

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/nativebridge/linux/X11.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/nativebridge/linux/X11.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/nativebridge/linux/X11.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/nativebridge/linux/X11.java Sun Sep 16 14:56:42 2007
@@ -4645,6 +4645,66 @@
     }
     public final native int XSetStandardProperties(long param_0, long param_1, long param_2, long param_3, long param_4, long param_5, int param_6, long param_7);
 
+    public final void Xutf8SetWMProperties(long param_0, long param_1, String param_2, String param_3, PointerPointer param_4, int param_5, X11.XSizeHints param_6, X11.XWMHints param_7, PointerPointer param_8) {
+        Int8Pointer _param_2 = null == param_2? null :  nb.createInt8Pointer(param_2, false);
+        long tmp_0 = _param_2 == null ? 0 : _param_2.longLockPointer();
+        Int8Pointer _param_3 = null == param_3? null :  nb.createInt8Pointer(param_3, false);
+        long tmp_1 = _param_3 == null ? 0 : _param_3.longLockPointer();
+        long tmp_2 = param_4 == null ? 0 : param_4.longLockPointer();
+        long tmp_3 = param_6 == null ? 0 : param_6.longLockPointer();
+        long tmp_4 = param_7 == null ? 0 : param_7.longLockPointer();
+        long tmp_5 = param_8 == null ? 0 : param_8.longLockPointer();
+        Xutf8SetWMProperties(param_0, param_1, tmp_0, tmp_1, tmp_2, param_5, tmp_3, tmp_4, tmp_5);
+        if (_param_2 != null) {
+            _param_2.unlock();
+            _param_2.free();
+        }
+        if (_param_3 != null) {
+            _param_3.unlock();
+            _param_3.free();
+        }
+        if (param_4 != null) {
+            param_4.unlock();
+        }
+        if (param_6 != null) {
+            param_6.unlock();
+        }
+        if (param_7 != null) {
+            param_7.unlock();
+        }
+        if (param_8 != null) {
+            param_8.unlock();
+        }
+    }
+    public final void Xutf8SetWMProperties(long param_0, long param_1, Int8Pointer param_2, Int8Pointer param_3, PointerPointer param_4, int param_5, X11.XSizeHints param_6, X11.XWMHints param_7, PointerPointer param_8) {
+        long tmp_0 = param_2 == null ? 0 : param_2.longLockPointer();
+        long tmp_1 = param_3 == null ? 0 : param_3.longLockPointer();
+        long tmp_2 = param_4 == null ? 0 : param_4.longLockPointer();
+        long tmp_3 = param_6 == null ? 0 : param_6.longLockPointer();
+        long tmp_4 = param_7 == null ? 0 : param_7.longLockPointer();
+        long tmp_5 = param_8 == null ? 0 : param_8.longLockPointer();
+        Xutf8SetWMProperties(param_0, param_1, tmp_0, tmp_1, tmp_2, param_5, tmp_3, tmp_4, tmp_5);
+        if (param_2 != null) {
+            param_2.unlock();
+        }
+        if (param_3 != null) {
+            param_3.unlock();
+        }
+        if (param_4 != null) {
+            param_4.unlock();
+        }
+        if (param_6 != null) {
+            param_6.unlock();
+        }
+        if (param_7 != null) {
+            param_7.unlock();
+        }
+        if (param_8 != null) {
+            param_8.unlock();
+        }
+    }
+    public final native void Xutf8SetWMProperties(long param_0, long param_1, long param_2, long param_3, long param_4, int param_5, long param_6, long param_7, long param_8);
+
     public final native long XDefaultColormap(long param_0, int param_1);
 
     public final native long XAllocSizeHints();

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxWindow.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxWindow.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxWindow.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/unix/org/apache/harmony/awt/wtk/linux/LinuxWindow.java Sun Sep 16 14:56:42 2007
@@ -176,8 +176,8 @@
                                      X11Defs.CopyFromParent, 0, 0);
                                      */
         String title = (p.name != null) ? p.name : ""; //$NON-NLS-1$
-        x11.XSetStandardProperties(display, windowID, title, title, 0,
-                null, 0, null);
+        x11.Xutf8SetWMProperties(display, windowID, title, title, null, 0,
+                null, null, null);
         x11.XSelectInput(display, windowID, enabled ? DEFAULT_MASK : DISABLED_MASK);
 
         if (!popup) {
@@ -484,8 +484,8 @@
         if (title == null) {
             title = ""; //$NON-NLS-1$
         }
-        x11.XStoreName(display, windowID, title);
-        x11.XSetIconName(display, windowID, title);
+        x11.Xutf8SetWMProperties(display, windowID, title, title, null, 0,
+                null, null, null);
         x11.XFlush(display);
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java Sun Sep 16 14:56:42 2007
@@ -20,6 +20,7 @@
  */
 package org.apache.harmony.awt.gl.windows;
 
+import java.awt.AlphaComposite;
 import java.awt.BasicStroke;
 import java.awt.Color;
 import java.awt.Dimension;
@@ -332,9 +333,21 @@
     }
 
     @Override
+    public void drawOval(int x, int y, int width, int height) {
+        if (!nativePen) {
+            super.drawOval(x, y, width, height);
+            return;
+        }
+
+        drawOval(gi, x, y, width, height);
+    }
+
+    @Override
     public void fill(Shape s) {
-        if (!nativeBrush) {
-            super.fill(s);
+        if (!nativeBrush || composite != AlphaComposite.SrcOver) {
+            s = transform.createTransformedShape(s);
+            MultiRectArea mra = jsr.rasterize(s, 0.5);
+            super.fillMultiRectAreaPaint(mra);
             return;
         }
 
@@ -345,8 +358,10 @@
 
     @Override
     public void fillRect(int x, int y, int width, int height) {
-        if (!nativeBrush) {
-            super.fillRect(x, y, width, height);
+        if (!nativeBrush || composite != AlphaComposite.SrcOver) {
+            Shape s = transform.createTransformedShape(new Rectangle(x, y, width, height));
+            MultiRectArea mra = jsr.rasterize(s, 0.5);
+            super.fillMultiRectAreaPaint(mra);
             return;
         }
 
@@ -540,6 +555,7 @@
     // Draw native primitives
     private native void drawLine(long gi, int x1, int y1, int x2, int y2);
     private native void drawRect(long gi, int x, int y, int width, int height);
+    private native void drawOval(long gi, int x, int y, int width, int height);
 
     // Fill native primitives
     private native void fillRect(long gi, int x, int y, int width, int height);

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/blitter.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/blitter.cpp?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/blitter.cpp (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/blitter.cpp Sun Sep 16 14:56:42 2007
@@ -39,11 +39,11 @@
       unsigned char sr, sg, sb, sa, dr, dg, db, da, fs = 255, fd;
       for(int _sy = srcY, _dy = dstY, maxY = srcY + height; _sy < maxY; _sy++, _dy++){
           for(int _sx = srcX, _dx = dstX, maxX = srcX + width; _sx < maxX; _sx++, _dx++){
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fd = 255 - MUL(alpha, sa);
               COMPOSE_EXT(sa, sr, sg, sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -67,13 +67,13 @@
                           _sr = r;
                           _sg = g; 
                           _sb = b;
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
                           fd = 255 - sa;
               COMPOSE(sa, sr, sg, sb, fs, _sa, _sr, _sg, _sb, fd);
               fd = 255 - MUL(alpha, _sa);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               COMPOSE_EXT(_sa, _sr, _sg, _sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -86,13 +86,13 @@
       unsigned char sr, sg, sb, sa;
       for(int _sy = srcY, _dy = dstY, maxY = srcY + height; _sy < maxY; _sy++, _dy++){
           for(int _sx = srcX, _dx = dstX, maxX = srcX + width; _sx < maxX; _sx++, _dx++){
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
-                          if(alpha == 0){
-                                  setRGB(_dx, _dy, dstStruct, dstData, 0, 0, 0, 0);
-                          }else{
-                                  setRGB(_dx, _dy, dstStruct, dstData, MUL(alpha, sr), MUL(alpha, sg), 
-                                          MUL(alpha, sb), MUL(alpha, sa));
-                          }
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
+              if(alpha == 0){
+                  setRGB(_dx, _dy, dstStruct, dstData, 0, 0, 0, 0, true);
+              }else{
+                  setRGB(_dx, _dy, dstStruct, dstData, MUL(alpha, sr), MUL(alpha, sg), 
+                      MUL(alpha, sb), MUL(alpha, sa), true);
+              }
           }
       }
   }
@@ -116,15 +116,15 @@
                           _sr = r;
                           _sg = g; 
                           _sb = b;
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
-                          fd = 255 - sa;
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
+              fd = 255 - sa;
               COMPOSE(sa, sr, sg, sb, fs, _sa, _sr, _sg, _sb, fd);
-                          if(alpha == 0){
-                                  setRGB(_dx, _dy, dstStruct, dstData, 0, 0, 0, 0);
-                          }else{
-                                  setRGB(_dx, _dy, dstStruct, dstData, MUL(alpha, _sr), MUL(alpha, _sg), 
-                                          MUL(alpha, _sb), MUL(alpha, _sa));
-                          }
+              if(alpha == 0){
+                  setRGB(_dx, _dy, dstStruct, dstData, 0, 0, 0, 0, true);
+              }else{
+                  setRGB(_dx, _dy, dstStruct, dstData, MUL(alpha, _sr), MUL(alpha, _sg), 
+                      MUL(alpha, _sb), MUL(alpha, _sa), true);
+              }
           }
       }
   }
@@ -137,12 +137,12 @@
       unsigned char sr, sg, sb, sa, dr, dg, db, da, fs, fd;
       for(int _sy = srcY, _dy = dstY, maxY = srcY + height; _sy < maxY; _sy++, _dy++){
           for(int _sx = srcX, _dx = dstX, maxX = srcX + width; _sx < maxX; _sx++, _dx++){
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = 255 - da;
               fd = 255 - MUL(alpha, sa);
               COMPOSE_EXT(sa, sr, sg, sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -166,15 +166,15 @@
                           _sr = r;
                           _sg = g; 
                           _sb = b;
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
                           fs = 255;
                           fd = 255 - sa;
               COMPOSE(sa, sr, sg, sb, fs, _sa, _sr, _sg, _sb, fd);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = 255 - da;
               fd = 255 - MUL(alpha, _sa);
               COMPOSE_EXT(_sa, _sr, _sg, _sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -187,12 +187,12 @@
       unsigned char sr, sg, sb, sa, dr, dg, db, da, fs, fd;
       for(int _sy = srcY, _dy = dstY, maxY = srcY + height; _sy < maxY; _sy++, _dy++){
           for(int _sx = srcX, _dx = dstX, maxX = srcX + width; _sx < maxX; _sx++, _dx++){
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = da;
               fd = 255 - MUL(alpha, sa);
               COMPOSE_EXT(sa, sr, sg, sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -216,15 +216,15 @@
                           _sr = r;
                           _sg = g; 
                           _sb = b;
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
                           fs = 255;
                           fd = 255 - sa;
               COMPOSE(sa, sr, sg, sb, fs, _sa, _sr, _sg, _sb, fd);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = da;
               fd = 255 - MUL(alpha, _sa);
               COMPOSE_EXT(_sa, _sr, _sg, _sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -237,12 +237,12 @@
       unsigned char sr, sg, sb, sa, dr, dg, db, da, fs, fd;
       for(int _sy = srcY, _dy = dstY, maxY = srcY + height; _sy < maxY; _sy++, _dy++){
           for(int _sx = srcX, _dx = dstX, maxX = srcX + width; _sx < maxX; _sx++, _dx++){
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = da;
               fd = 0;
               COMPOSE_EXT(sa, sr, sg, sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -266,15 +266,15 @@
                           _sr = r;
                           _sg = g; 
                           _sb = b;
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
                           fs = 255;
                           fd = 255 - sa;
               COMPOSE(sa, sr, sg, sb, fs, _sa, _sr, _sg, _sb, fd);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = da;
               fd = 0;
               COMPOSE_EXT(_sa, _sr, _sg, _sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -287,12 +287,12 @@
       unsigned char sr, sg, sb, sa, dr, dg, db, da, fs, fd;
       for(int _sy = srcY, _dy = dstY, maxY = srcY + height; _sy < maxY; _sy++, _dy++){
           for(int _sx = srcX, _dx = dstX, maxX = srcX + width; _sx < maxX; _sx++, _dx++){
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = 255 - da;
               fd = 0;
               COMPOSE_EXT(sa, sr, sg, sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -316,15 +316,15 @@
                           _sr = r;
                           _sg = g; 
                           _sb = b;
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
                           fs = 255;
                           fd = 255 - sa;
               COMPOSE(sa, sr, sg, sb, fs, _sa, _sr, _sg, _sb, fd);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = 255 - da;
               fd = 0;
               COMPOSE_EXT(_sa, _sr, _sg, _sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -344,12 +344,12 @@
       unsigned char sr, sg, sb, sa, dr, dg, db, da, fs, fd;
       for(int _sy = srcY, _dy = dstY, maxY = srcY + height; _sy < maxY; _sy++, _dy++){
           for(int _sx = srcX, _dx = dstX, maxX = srcX + width; _sx < maxX; _sx++, _dx++){
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = 255 - da;
               fd = MUL(alpha, sa);
               COMPOSE_EXT(sa, sr, sg, sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -373,15 +373,15 @@
                           _sr = r;
                           _sg = g; 
                           _sb = b;
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
                           fs = 255;
                           fd = 255 - sa;
               COMPOSE(sa, sr, sg, sb, fs, _sa, _sr, _sg, _sb, fd);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = 255 - da;
               fd = MUL(alpha, _sa);
               COMPOSE_EXT(_sa, _sr, _sg, _sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -394,12 +394,12 @@
       unsigned char sr, sg, sb, sa, dr, dg, db, da, fs, fd;
       for(int _sy = srcY, _dy = dstY, maxY = srcY + height; _sy < maxY; _sy++, _dy++){
           for(int _sx = srcX, _dx = dstX, maxX = srcX + width; _sx < maxX; _sx++, _dx++){
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = 0;
               fd = MUL(alpha, sa);
               COMPOSE_EXT(sa, sr, sg, sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -423,15 +423,15 @@
                           _sr = r;
                           _sg = g; 
                           _sb = b;
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
                           fs = 255;
                           fd = 255 - sa;
               COMPOSE(sa, sr, sg, sb, fs, _sa, _sr, _sg, _sb, fd);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = 0;
               fd = MUL(alpha, _sa);
               COMPOSE_EXT(_sa, _sr, _sg, _sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -444,12 +444,12 @@
       unsigned char sr, sg, sb, sa, dr, dg, db, da, fs, fd;
       for(int _sy = srcY, _dy = dstY, maxY = srcY + height; _sy < maxY; _sy++, _dy++){
           for(int _sx = srcX, _dx = dstX, maxX = srcX + width; _sx < maxX; _sx++, _dx++){
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = 0;
               fd = 255 - MUL(alpha, sa);
               COMPOSE_EXT(sa, sr, sg, sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -473,15 +473,15 @@
                           _sr = r;
                           _sg = g; 
                           _sb = b;
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
                           fs = 255;
                           fd = 255 - sa;
               COMPOSE(sa, sr, sg, sb, fs, _sa, _sr, _sg, _sb, fd);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = 0;
               fd = 255 - MUL(alpha, _sa);
               COMPOSE_EXT(_sa, _sr, _sg, _sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -494,12 +494,12 @@
       unsigned char sr, sg, sb, sa, dr, dg, db, da, fs, fd;
       for(int _sy = srcY, _dy = dstY, maxY = srcY + height; _sy < maxY; _sy++, _dy++){
           for(int _sx = srcX, _dx = dstX, maxX = srcX + width; _sx < maxX; _sx++, _dx++){
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = 255 - da;
               fd = 255;
               COMPOSE_EXT(sa, sr, sg, sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -523,15 +523,15 @@
                           _sr = r;
                           _sg = g; 
                           _sb = b;
-              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa);
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, true);
                           fs = 255;
                           fd = 255 - sa;
               COMPOSE(sa, sr, sg, sb, fs, _sa, _sr, _sg, _sb, fd);
-              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
               fs = 255 - da;
               fd = 255;
               COMPOSE_EXT(_sa, _sr, _sg, _sb, fs, da, dr, dg, db, fd, alpha);
-              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, true);
           }
       }
   }
@@ -543,7 +543,7 @@
 
       for(int _sy = srcY, _dy = dstY, maxY = srcY + height; _sy < maxY; _sy++, _dy++){
           for(int _sx = srcX, _dx = dstX, maxX = srcX + width; _sx < maxX; _sx++, _dx++){
-              setRGB(_dx, _dy, dstStruct, dstData, 0, 0, 0, 0);
+              setRGB(_dx, _dy, dstStruct, dstData, 0, 0, 0, 0, true);
           }
       }
   }
@@ -810,9 +810,31 @@
       }
   }
 
+ void xor_mode_blt
+  (int srcX, int srcY, SURFACE_STRUCTURE *srcStruct, void *srcData,
+  int dstX, int dstY, SURFACE_STRUCTURE *dstStruct, void *dstData,
+  int width, int height, int xorcolor){
+
+      unsigned char r, g, b, sr, sg, sb, sa, dr, dg, db, da;
+      r = (unsigned char)((xorcolor >> 16) & 0xff);
+      g = (unsigned char)((xorcolor >> 8) & 0xff);
+      b = (unsigned char)(xorcolor & 0xff);
+
+      for(int _sy = srcY, _dy = dstY, maxY = srcY + height; _sy < maxY; _sy++, _dy++){
+          for(int _sx = srcX, _dx = dstX, maxX = srcX + width; _sx < maxX; _sx++, _dx++){
+              getRGB(_sx, _sy, srcStruct, srcData, sr, sg, sb, sa, false);
+              getRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, false);
+              dr ^= (r ^ sr);
+              dg ^= (g ^ sg);
+              db ^= (b ^ sb);
+              setRGB(_dx, _dy, dstStruct, dstData, dr, dg, db, da, false);
+          }
+      }
+  }
+
 void getRGB
   (int x, int y, SURFACE_STRUCTURE *surfStruct, void *data, 
-  unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a){
+  unsigned char &r, unsigned char &g, unsigned char &b, unsigned char &a, bool alphaPre){
 
       int type = surfStruct->ss_type;
       unsigned char *p, pixel;
@@ -834,9 +856,11 @@
               g = *p++;
               r = *p++;
               a = *p;
-              r = MUL(a, r);
-              g = MUL(a, g);
-              b = MUL(a, b);
+              if(alphaPre){
+                  r = MUL(a, r);
+                  g = MUL(a, g);
+                  b = MUL(a, b);
+              }
               return;
 
           case INT_ARGB_PRE:
@@ -845,6 +869,11 @@
               g = *p++;
               r = *p++;
               a = *p;
+              if(!alphaPre){
+                  r = DIV(a, r);
+                  g = DIV(a, g);
+                  b = DIV(a, b);
+              }
               return;
 
           case INT_BGR:
@@ -869,9 +898,11 @@
               b = *p++;
               g = *p++;
               r = *p;
-              r = MUL(a, r);
-              g = MUL(a, g);
-              b = MUL(a, b);
+              if(alphaPre){
+                  r = MUL(a, r);
+                  g = MUL(a, g);
+                  b = MUL(a, b);
+              }
               return;
 
           case BYTE_ABGR_PRE:
@@ -880,6 +911,11 @@
               b = *p++;
               g = *p++;
               r = *p;
+              if(!alphaPre){
+                  r = DIV(a, r);
+                  g = DIV(a, g);
+                  b = DIV(a, b);
+              }
               return;
 
           case USHORT_565:
@@ -956,9 +992,11 @@
                       break;
                   case GL_TRANSLUCENT:
                       a = (unsigned char)((rgb >> 24) & 0xff);
-                      r = MUL(a, r);
-                      g = MUL(a, g);
-                      b = MUL(a, b);
+                      if(alphaPre){
+                          r = MUL(a, r);
+                          g = MUL(a, g);
+                          b = MUL(a, b);
+                      }
               }
               return;
 
@@ -970,7 +1008,7 @@
 
 void setRGB
   (int x, int y, SURFACE_STRUCTURE *surfStruct, void *data, 
-  unsigned char r, unsigned char g, unsigned char b, unsigned char a){
+  unsigned char r, unsigned char g, unsigned char b, unsigned char a, bool alphaPre){
 
       int type = surfStruct->ss_type;
       unsigned char *p, pixel = 0;
@@ -981,7 +1019,7 @@
       switch(type){
           case INT_RGB:
               p = (unsigned char *)data + ((y * surfStruct->scanline_stride + x) << 2);
-              if(a != 255){
+              if(alphaPre && a != 255){
                   r = DIV(a, r);
                   g = DIV(a, g);
                   b = DIV(a, b);
@@ -994,7 +1032,7 @@
 
           case INT_ARGB:
               p = (unsigned char *)data + ((y * surfStruct->scanline_stride + x) << 2);
-              if(a != 255){
+              if(alphaPre && a != 255){
                   r = DIV(a, r);
                   g = DIV(a, g);
                   b = DIV(a, b);
@@ -1008,6 +1046,11 @@
 
           case INT_ARGB_PRE:
               p = (unsigned char *)data + ((y * surfStruct->scanline_stride + x) << 2);
+              if(!alphaPre){
+                  r = MUL(a, r);
+                  g = MUL(a, g);
+                  b = MUL(a, b);
+              }
               *p++ = b;
               *p++ = g;
               *p++ = r;
@@ -1016,7 +1059,7 @@
 
           case INT_BGR:
               p = (unsigned char *)data + ((y * surfStruct->scanline_stride + x) << 2);
-              if(a != 255){
+              if(alphaPre && a != 255){
                   r = DIV(a, r);
                   g = DIV(a, g);
                   b = DIV(a, b);
@@ -1029,7 +1072,7 @@
 
           case BYTE_BGR:
               p = (unsigned char *)data + y * surfStruct->scanline_stride + x * 3;
-              if(a != 255){
+              if(alphaPre && a != 255){
                   r = DIV(a, r);
                   g = DIV(a, g);
                   b = DIV(a, b);
@@ -1041,7 +1084,7 @@
 
           case BYTE_ABGR:
               p = (unsigned char *)data + y * surfStruct->scanline_stride + (x << 2);
-              if(a != 255){
+              if(alphaPre && a != 255){
                   r = DIV(a, r);
                   g = DIV(a, g);
                   b = DIV(a, b);
@@ -1054,6 +1097,11 @@
 
           case BYTE_ABGR_PRE:
               p = (unsigned char *)data + y * surfStruct->scanline_stride + (x << 2);
+              if(!alphaPre){
+                  r = MUL(a, r);
+                  g = MUL(a, g);
+                  b = MUL(a, b);
+              }
               *p++ = a;
               *p++ = b;
               *p++ = g;
@@ -1062,7 +1110,7 @@
 
           case USHORT_565:
               sp = (unsigned short *)data + y * surfStruct->scanline_stride + x;
-              if(a != 255){
+              if(alphaPre && a != 255){
                   r = DIV(a, r);
                   g = DIV(a, g);
                   b = DIV(a, b);
@@ -1076,7 +1124,7 @@
 
           case USHORT_555:
               sp = (unsigned short *)data + y * surfStruct->scanline_stride + x;
-              if(a != 255){
+              if(alphaPre && a != 255){
                   r = DIV(a, r);
                   g = DIV(a, g);
                   b = DIV(a, b);
@@ -1089,7 +1137,7 @@
 
           case BYTE_GRAY:
               p = (unsigned char *)data + y * surfStruct->scanline_stride + x;
-              if(a != 255){
+              if(alphaPre && a != 255){
                   r = DIV(a, r);
                   g = DIV(a, g);
                   b = DIV(a, b);
@@ -1103,7 +1151,7 @@
 
           case USHORT_GRAY:
               sp = (unsigned short *)data + y * surfStruct->scanline_stride + x;
-              if(a != 255){
+              if(alphaPre && a != 255){
                   r = DIV(a, r);
                   g = DIV(a, g);
                   b = DIV(a, b);
@@ -1119,7 +1167,7 @@
               gray = (int)(r * 0.299 + g * 0.587 + b * 0.114 + 0.5);
               minError = 255;
               error = 0;
-              if(a != 255){
+              if(alphaPre && a != 255){
                   r = DIV(a, r);
                   g = DIV(a, g);
                   b = DIV(a, b);
@@ -1149,7 +1197,7 @@
           case BYTE_INDEXED:
               p = (unsigned char *)data + y * surfStruct->scanline_stride + x;
 
-              if(a != 255){
+              if(alphaPre && a != 255){
                   r = DIV(a, r);
                   g = DIV(a, g);
                   b = DIV(a, b);
@@ -1417,46 +1465,48 @@
       SURFACE_STRUCTURE *srcSurf = (SURFACE_STRUCTURE *)srcSurfStruct;
       SURFACE_STRUCTURE *dstSurf = (SURFACE_STRUCTURE *)dstSurfStruct;
 
-          int srcType = srcSurf->ss_type;
-          int dstType = dstSurf->ss_type;
-          if(srcType < 0 || dstType < 0) return;
+      int srcType = srcSurf->ss_type;
+      int dstType = dstSurf->ss_type;
+      if(srcType < 0 || dstType < 0) return;
 
       int a = (int)(alpha * 255 + 0.5);
 
       int *rects = (int *)env->GetPrimitiveArrayCritical(clip, 0);
       int numRects = *rects;
 
-          void *srcDataPtr, *dstDataPtr;
-          if(srcData == NULL){
-                  srcDataPtr = NULL;
+      void *srcDataPtr, *dstDataPtr;
+
+      if(srcData == NULL){
+          srcDataPtr = NULL;
 
 #ifdef _WIN32
-                  if(srcSurf->bmpData == NULL){
-                          srcSurf->bmpData = (BYTE *)malloc(srcSurf->bmpInfo.bmiHeader.biSizeImage);
-                  }
-                  GetDIBits(srcSurf->gi->hdc, srcSurf->gi->bmp, 0, srcSurf->height, srcSurf->bmpData, 
-                          (BITMAPINFO *)&srcSurf->bmpInfo, DIB_RGB_COLORS);
-                  srcDataPtr = srcSurf->bmpData;
+          if(srcSurf->bmpData == NULL){
+              srcSurf->bmpData = (BYTE *)malloc(srcSurf->bmpInfo.bmiHeader.biSizeImage);
+          }
+          GetDIBits(srcSurf->gi->hdc, srcSurf->gi->bmp, 0, srcSurf->height, srcSurf->bmpData, 
+              (BITMAPINFO *)&srcSurf->bmpInfo, DIB_RGB_COLORS);
+          srcDataPtr = srcSurf->bmpData;
 
 #endif
 
-          }else{
-                  srcDataPtr = env->GetPrimitiveArrayCritical((jarray)srcData, 0);
-          }
+      }else{
+          srcDataPtr = env->GetPrimitiveArrayCritical((jarray)srcData, 0);
+      }
+
       dstDataPtr = env->GetPrimitiveArrayCritical((jarray)dstData, 0);
 
-          if(!numRects || !srcDataPtr || !dstDataPtr){
-                  if(clip){
-                          env->ReleasePrimitiveArrayCritical(clip, (void *)rects, 0);
-                  }
-                  if(srcData){
-                          env->ReleasePrimitiveArrayCritical((jarray)srcData, srcDataPtr, 0);
-                  }
-                  if(dstData){
-                          env->ReleasePrimitiveArrayCritical((jarray)dstData, dstDataPtr, 0);
-                  }
-                  return;
+      if(!numRects || !srcDataPtr || !dstDataPtr){
+          if(clip){
+              env->ReleasePrimitiveArrayCritical(clip, (void *)rects, 0);
+          }
+          if(srcData){
+              env->ReleasePrimitiveArrayCritical((jarray)srcData, srcDataPtr, 0);
           }
+          if(dstData){
+              env->ReleasePrimitiveArrayCritical((jarray)dstData, dstDataPtr, 0);
+          }
+          return;
+      }
 
       int srcW = srcSurf->width;
       int srcH = srcSurf->height;
@@ -1593,15 +1643,150 @@
 
       }
       env->ReleasePrimitiveArrayCritical(clip, (void *)rects, 0);
-          if(srcData) env->ReleasePrimitiveArrayCritical((jarray)srcData, srcDataPtr, 0);
-          env->ReleasePrimitiveArrayCritical((jarray)dstData, dstDataPtr, 0);
+      if(srcData) env->ReleasePrimitiveArrayCritical((jarray)srcData, srcDataPtr, 0);
+      env->ReleasePrimitiveArrayCritical((jarray)dstData, dstDataPtr, 0);
 
   }
 
 JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_render_NativeImageBlitter_xor
   (JNIEnv *env, jobject obj, jint srcX, jint srcY, jlong srcSurfStruct, jobject srcData, 
-  jint dstX, jint dstY, jlong dstSurfStruct, jobject dstData, jint width, jint heigth, 
+  jint dstX, jint dstY, jlong dstSurfStruct, jobject dstData, jint width, jint height, 
   jint xorcolor, jintArray clip, jboolean invalidated){
+
+      SURFACE_STRUCTURE *srcSurf = (SURFACE_STRUCTURE *)srcSurfStruct;
+      SURFACE_STRUCTURE *dstSurf = (SURFACE_STRUCTURE *)dstSurfStruct;
+
+      int srcType = srcSurf->ss_type;
+      int dstType = dstSurf->ss_type;
+      if(srcType < 0 || dstType < 0) return;
+
+      int *rects = (int *)env->GetPrimitiveArrayCritical(clip, 0);
+      int numRects = *rects;
+
+      void *srcDataPtr, *dstDataPtr;
+
+      if(srcData == NULL){
+          srcDataPtr = NULL;
+
+#ifdef _WIN32
+          if(srcSurf->bmpData == NULL){
+              srcSurf->bmpData = (BYTE *)malloc(srcSurf->bmpInfo.bmiHeader.biSizeImage);
+          }
+          GetDIBits(srcSurf->gi->hdc, srcSurf->gi->bmp, 0, srcSurf->height, srcSurf->bmpData, 
+              (BITMAPINFO *)&srcSurf->bmpInfo, DIB_RGB_COLORS);
+          srcDataPtr = srcSurf->bmpData;
+
+#endif
+
+      }else{
+          srcDataPtr = env->GetPrimitiveArrayCritical((jarray)srcData, 0);
+      }
+
+      dstDataPtr = env->GetPrimitiveArrayCritical((jarray)dstData, 0);
+
+      if(!numRects || !srcDataPtr || !dstDataPtr){
+          if(clip){
+              env->ReleasePrimitiveArrayCritical(clip, (void *)rects, 0);
+          }
+          if(srcData){
+              env->ReleasePrimitiveArrayCritical((jarray)srcData, srcDataPtr, 0);
+          }
+          if(dstData){
+              env->ReleasePrimitiveArrayCritical((jarray)dstData, dstDataPtr, 0);
+          }
+          return;
+      }
+
+      int srcW = srcSurf->width;
+      int srcH = srcSurf->height;
+
+      int dstW = dstSurf->width;
+      int dstH = dstSurf->height;
+
+      int srcX2 = srcW - 1;
+      int srcY2 = srcH - 1;
+      int dstX2 = dstW - 1;
+      int dstY2 = dstH - 1;
+
+      if(srcX > srcX2 || srcY > srcY2) return;
+      if(dstX > dstX2 || dstY > dstY2) return;
+
+      if(srcX < 0){
+          width += srcX;
+          srcX = 0;
+      }
+      if(srcY < 0){
+          height += srcY;
+          srcY = 0;
+      }
+
+      if(dstX < 0){
+          width += dstX;
+          srcX -= dstX;
+          dstX = 0;
+      }
+      if(dstY < 0){
+          height += srcY;
+          srcY -= dstY;
+          dstY = 0;
+      }
+
+      if(srcX + width > srcX2) width = srcX2 - srcX + 1;
+      if(srcY + height > srcY2) height = srcY2 - srcY + 1;
+      if(dstX + width > dstX2) width = dstX2 - dstX + 1;
+      if(dstY + height > dstY2) height = dstY2 - dstY + 1;
+
+      if(width <= 0 || height <= 0) return;
+
+      for(int i = 1; i < numRects; i += 4){
+          int _sx = srcX;
+          int _sy = srcY;
+
+          int _dx = dstX;
+          int _dy = dstY;
+
+          int _w = width;
+          int _h = height;
+
+          int cx = rects[i];            // Clipping left top X
+          int cy = rects[i + 1];        // Clipping left top Y
+          int cx2 = rects[i + 2];       // Clipping right bottom X
+          int cy2 = rects[i + 3];       // Clipping right bottom Y
+
+          if(_dx > cx2 || _dy > cy2 || dstX2 < cx || dstY2 < cy) continue;
+
+          if(cx > _dx){
+              int shx = cx - _dx;
+              _w -= shx;
+              _dx = cx;
+              _sx += shx;
+          }
+
+          if(cy > _dy){
+              int shy = cy - _dy;
+              _h -= shy;
+              _dy = cy;
+              _sy += shy;
+          }
+
+          if(_dx + _w > cx2 + 1){
+              _w = cx2 - _dx + 1;
+          }
+
+          if(_dy + _h > cy2 + 1){
+              _h = cy2 - _dy + 1;
+          }
+
+          if(_sx > srcX2 || _sy > srcY2) continue;
+
+          xor_mode_blt(_sx, _sy, srcSurf, srcDataPtr,
+                      _dx, _dy, dstSurf, dstDataPtr, _w, _h, xorcolor);
+
+      }
+      env->ReleasePrimitiveArrayCritical(clip, (void *)rects, 0);
+      if(srcData) env->ReleasePrimitiveArrayCritical((jarray)srcData, srcDataPtr, 0);
+      env->ReleasePrimitiveArrayCritical((jarray)dstData, dstDataPtr, 0);
+
 
   }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/blitter.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/blitter.h?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/blitter.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/shared/blitter.h Sun Sep 16 14:56:42 2007
@@ -121,10 +121,10 @@
 (int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
 
 void getRGB
-(int, int, SURFACE_STRUCTURE *, void *, unsigned char &, unsigned char &, unsigned char &, unsigned char &);
+(int, int, SURFACE_STRUCTURE *, void *, unsigned char &, unsigned char &, unsigned char &, unsigned char &, bool);
 
 void setRGB
-(int, int, SURFACE_STRUCTURE *, void *, unsigned char, unsigned char, unsigned char, unsigned char);
+(int, int, SURFACE_STRUCTURE *, void *, unsigned char, unsigned char, unsigned char, unsigned char, bool);
 
 extern void (* src_over_blt[14][14])(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);
 extern void (* src_blt[14][14])(int, int, SURFACE_STRUCTURE *, void *, int, int, SURFACE_STRUCTURE *, void *, int, int, int);

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.cpp Sun Sep 16 14:56:42 2007
@@ -369,16 +369,114 @@
 
 JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_GDIBlitter_xorImage
   (JNIEnv *env, jobject obj, jint srcX, jint srcY, jlong srcSurfStruct, jobject srcData, 
-  jint dstX, jint dstY, jlong dstSurfStruct, jint width, jint heigth, jint xorcolor, 
+  jint dstX, jint dstY, jlong dstSurfStruct, jint width, jint height, jint xorcolor, 
   jdoubleArray matrix, jintArray clip, jint numVertex, jboolean invalidated){
 
+      SURFACE_STRUCTURE *srcSurf = (SURFACE_STRUCTURE *)srcSurfStruct;
+      SURFACE_STRUCTURE *dstSurf = (SURFACE_STRUCTURE *)dstSurfStruct;
+
+      srcSurf->invalidated = invalidated != 0;
+      if(!initBitmap(srcSurf, env, srcData, false)) return;
+
+      BYTE r = (BYTE)((xorcolor >> 16) & 0xff);
+      BYTE g = (BYTE)((xorcolor >> 8) & 0xff);
+      BYTE b = (BYTE)(xorcolor & 0xff);
+
+      HBRUSH brush = CreateSolidBrush(RGB(r, g, b));
+
+
+      XFORM currentTransform, transform;
+      if(matrix != NULL){
+
+          jdouble * mtrx = (jdouble *)env->GetPrimitiveArrayCritical(matrix, 0);
+          jdouble * old_mtrx = mtrx;
+
+          transform.eM11 = (FLOAT)(*mtrx++);
+          transform.eM12 = (FLOAT)(*mtrx++);
+          transform.eM21 = (FLOAT)(*mtrx++);
+          transform.eM22 = (FLOAT)(*mtrx++);
+          transform.eDx = (FLOAT)(*mtrx++);
+          transform.eDy = (FLOAT)(*mtrx);
+
+          env->ReleasePrimitiveArrayCritical(matrix, old_mtrx, 0);
+
+          SetGraphicsMode(dstSurf->gi->hdc, GM_ADVANCED);
+          GetWorldTransform(dstSurf->gi->hdc, &currentTransform);
+          SetWorldTransform(dstSurf->gi->hdc, &transform);
+      }
+
+      HRGN oldClip = setGdiClip(env, dstSurf->gi->hdc, clip, numVertex);
+
+      HGDIOBJ oldBrush = SelectObject(dstSurf->gi->hdc, brush);
+
+      BitBlt(dstSurf->gi->hdc, dstX, dstY, width, height, srcSurf->srcDC,
+              srcX, srcY, 0x960169);
+
+      SelectObject(dstSurf->gi->hdc, oldBrush);
+
+
+      if(matrix){
+          SetWorldTransform(dstSurf->gi->hdc, &currentTransform);
+          SetGraphicsMode(dstSurf->gi->hdc, GM_COMPATIBLE);
+      }
+      restoreGdiClip(dstSurf->gi->hdc, oldClip);
+
+      DeleteObject(brush);
+
   }
 
 JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_GDIBlitter_xorBitmap
   (JNIEnv *env, jobject obj, jint srcX, jint srcY, jlong srcSurfStruct, jint dstX, 
-  jint dstY, jlong dstSurfStruct, jint width, jint heigth, jint xorcolor, 
+  jint dstY, jlong dstSurfStruct, jint width, jint height, jint xorcolor, 
   jdoubleArray matrix, jintArray clip, jint numVertex){
 
+      SURFACE_STRUCTURE *srcSurf = (SURFACE_STRUCTURE *)srcSurfStruct;
+      SURFACE_STRUCTURE *dstSurf = (SURFACE_STRUCTURE *)dstSurfStruct;
+
+      BYTE r = (BYTE)((xorcolor >> 16) & 0xff);
+      BYTE g = (BYTE)((xorcolor >> 8) & 0xff);
+      BYTE b = (BYTE)(xorcolor & 0xff);
+
+      HBRUSH brush = CreateSolidBrush(RGB(r, g, b));
+
+      XFORM currentTransform, transform;
+      if(matrix != NULL){
+
+          jdouble * mtrx = (jdouble *)env->GetPrimitiveArrayCritical(matrix, 0);
+          jdouble * old_mtrx = mtrx;
+
+          transform.eM11 = (FLOAT)(*mtrx++);
+          transform.eM12 = (FLOAT)(*mtrx++);
+          transform.eM21 = (FLOAT)(*mtrx++);
+          transform.eM22 = (FLOAT)(*mtrx++);
+          transform.eDx = (FLOAT)(*mtrx++);
+          transform.eDy = (FLOAT)(*mtrx);
+
+          env->ReleasePrimitiveArrayCritical(matrix, old_mtrx, 0);
+
+          SetGraphicsMode(dstSurf->gi->hdc, GM_ADVANCED);
+          GetWorldTransform(dstSurf->gi->hdc, &currentTransform);
+          SetWorldTransform(dstSurf->gi->hdc, &transform);
+      }
+
+      HRGN oldClip = setGdiClip(env, dstSurf->gi->hdc, clip, numVertex);
+
+      HGDIOBJ oldBrush = SelectObject(dstSurf->gi->hdc, brush);
+
+      BitBlt(dstSurf->gi->hdc, dstX, dstY, width, height, srcSurf->gi->hdc,
+                  srcX, srcY, 0x00960169);
+      SelectObject(dstSurf->gi->hdc, oldBrush);
+
+
+      if(matrix){
+          SetWorldTransform(dstSurf->gi->hdc, &currentTransform);
+          SetGraphicsMode(dstSurf->gi->hdc, GM_COMPATIBLE);
+      }
+      restoreGdiClip(dstSurf->gi->hdc, oldClip);
+
+      DeleteObject(brush);
+
+
   }
 
 void findNonExistColor(DWORD &tcolor, DWORD *colormap, UINT size){
@@ -483,13 +581,13 @@
 }
 
 BOOL initBitmap
-(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, BOOL alphaPre){
+(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, bool alphaPre){
 
     HBITMAP srcBmp = srcSurf->bitmap;
     if(!srcBmp){
         return false;
     }
-    updateCache(srcSurf, env, srcData, alphaPre != 0);
+    updateCache(srcSurf, env, srcData, alphaPre);
     if(srcSurf->isTrueColor){
         SetDIBits(srcSurf->srcDC, srcSurf->bitmap, 0, srcSurf->height, srcSurf->bmpData, (BITMAPINFO *)&srcSurf->bmpInfo, DIB_RGB_COLORS);
     }else{

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.h?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/GDIBlitter.h Sun Sep 16 14:56:42 2007
@@ -41,7 +41,7 @@
 BOOL initBlitData(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, UINT compType, 
                                 UCHAR srcConstAlpha, BLITSTRUCT *blitStruct);
 
-BOOL initBitmap(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, BOOL alphaPre);
+BOOL initBitmap(SURFACE_STRUCTURE *srcSurf, JNIEnv *env, jobject srcData, bool alphaPre);
 
 void CompositeBlt(HDC, jint, jint, jint, jint, SURFACE_STRUCTURE *, void *, jint, jint, UINT, UCHAR, PXFORM, PXFORM);
 

Modified: harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/WinGDIPGraphics2D.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/WinGDIPGraphics2D.cpp?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/WinGDIPGraphics2D.cpp (original)
+++ harmony/enhanced/classlib/branches/java6/modules/awt/src/main/native/gl/windows/WinGDIPGraphics2D.cpp Sun Sep 16 14:56:42 2007
@@ -555,6 +555,31 @@
 
 /*
  * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
+ * Method:    drawOval
+ * Signature: (JIIII)V
+ */
+JNIEXPORT void JNICALL Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_drawOval
+  (JNIEnv *env, jobject obj, jlong gip, jint x, jint y, jint width, jint height)
+{
+    if (width == 0) {
+        Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_drawLine(env, obj, gip, x, y, x, y+height);
+        return;
+    } else if (height == 0) {
+        Java_org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D_drawLine(env, obj, gip, x, y, x+width, y);
+        return;
+    }
+
+    GraphicsInfo *gi = (GraphicsInfo *)gip;
+    
+    gi->graphics->SetTransform(gi->matrix);
+
+    gi->graphics->DrawEllipse(gi->pen, x, y, width, height);
+
+    gi->graphics->ResetTransform();
+}
+ 
+/*
+ * Class:     org_apache_harmony_awt_gl_windows_WinGDIPGraphics2D
  * Method:    fillRect
  * Signature: (JIIII)V
  */



Mime
View raw message