Merge
authorpsadhukhan
Mon, 12 Nov 2018 11:10:16 +0530
changeset 52551 339963bcff24
parent 52550 65407a437327 (diff)
parent 52486 6f5948597697 (current diff)
child 52552 1a62b3420c27
Merge
src/hotspot/share/prims/privilegedStack.cpp
src/hotspot/share/prims/privilegedStack.hpp
src/hotspot/share/utilities/internalVMTests.cpp
src/hotspot/share/utilities/internalVMTests.hpp
src/java.base/share/classes/jdk/internal/misc/JavaAWTAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaAWTFontAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaBeansAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaIOAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaIOFileDescriptorAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaIOFilePermissionAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaIORandomAccessFileAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaLangInvokeAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaLangModuleAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaLangRefAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaNetHttpCookieAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaNetInetAddressAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaNetSocketAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaNetURLAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaNetURLClassLoaderAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaNetUriAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaNioAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaObjectInputFilterAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaObjectInputStreamAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaSecurityAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaUtilJarAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaUtilResourceBundleAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaUtilZipFileAccess.java
src/java.base/share/classes/jdk/internal/misc/JavaxCryptoSealedObjectAccess.java
src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java
src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/internal/ReflectionAccessJDK.java
test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_noCompactStrings.java
test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions_stringDedup.java
test/hotspot/jtreg/sanity/ExecuteInternalVMTests.java
test/jdk/ProblemList.txt
test/jdk/java/lang/System/ClearProperty.java
test/jdk/java/lang/System/SetPropertiesNull.java
test/jdk/java/util/TimeZone/Bug8066652.sh
test/jdk/java/util/TimeZone/OldIDMappingTest.sh
test/jdk/java/util/TimeZone/TimeZoneDatePermissionCheck.sh
--- a/src/java.desktop/macosx/classes/sun/awt/CGraphicsConfig.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/macosx/classes/sun/awt/CGraphicsConfig.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,12 @@
 
 package sun.awt;
 
-import java.awt.*;
-import java.awt.geom.*;
-import java.awt.image.*;
+import java.awt.GraphicsConfiguration;
+import java.awt.Rectangle;
+import java.awt.Transparency;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
 
 import sun.java2d.SurfaceData;
 import sun.java2d.opengl.CGLLayer;
@@ -49,12 +52,9 @@
         throw new UnsupportedOperationException("not implemented");
     }
 
-    private static native Rectangle2D nativeGetBounds(int screen);
-
     @Override
-    public Rectangle getBounds() {
-        final Rectangle2D nativeBounds = nativeGetBounds(device.getCGDisplayID());
-        return nativeBounds.getBounds(); // does integer rounding
+    public final Rectangle getBounds() {
+        return device.getBounds();
     }
 
     @Override
--- a/src/java.desktop/macosx/classes/sun/awt/CGraphicsDevice.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/macosx/classes/sun/awt/CGraphicsDevice.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,8 +30,11 @@
 import java.awt.GraphicsConfiguration;
 import java.awt.GraphicsDevice;
 import java.awt.Insets;
+import java.awt.Rectangle;
 import java.awt.Window;
+import java.awt.geom.Rectangle2D;
 import java.util.Objects;
+
 import sun.java2d.SunGraphicsEnvironment;
 import sun.java2d.opengl.CGLGraphicsConfig;
 
@@ -45,6 +48,7 @@
     private volatile int displayID;
     private volatile double xResolution;
     private volatile double yResolution;
+    private volatile Rectangle bounds;
     private volatile int scale;
 
     // Array of all GraphicsConfig instances for this device
@@ -61,21 +65,11 @@
     public CGraphicsDevice(final int displayID) {
         this.displayID = displayID;
         configs = new GraphicsConfiguration[] {
-            CGLGraphicsConfig.getConfig(this, 0)
+            CGLGraphicsConfig.getConfig(this, displayID, 0)
         };
     }
 
     /**
-     * Returns CGDirectDisplayID, which is the same id as @"NSScreenNumber" in
-     * NSScreen.
-     *
-     * @return CoreGraphics display id.
-     */
-    public int getCGDisplayID() {
-        return displayID;
-    }
-
-    /**
      * Return a list of all configurations.
      */
     @Override
@@ -118,6 +112,10 @@
         return yResolution;
     }
 
+    Rectangle getBounds() {
+        return bounds.getBounds();
+    }
+
     public Insets getScreenInsets() {
         // the insets are queried synchronously and are not cached
         // since there are no Quartz or Cocoa means to receive notifications
@@ -140,6 +138,7 @@
     public void displayChanged() {
         xResolution = nativeGetXResolution(displayID);
         yResolution = nativeGetYResolution(displayID);
+        bounds = nativeGetBounds(displayID).getBounds(); //does integer rounding
         initScaleFactor();
         //TODO configs/fullscreenWindow/modes?
     }
@@ -273,4 +272,6 @@
     private static native double nativeGetYResolution(int displayID);
 
     private static native Insets nativeGetScreenInsets(int displayID);
+
+    private static native Rectangle2D nativeGetBounds(int displayID);
 }
--- a/src/java.desktop/macosx/classes/sun/awt/CGraphicsEnvironment.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/macosx/classes/sun/awt/CGraphicsEnvironment.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,22 @@
 
 package sun.awt;
 
-import java.awt.*;
-import java.util.*;
+import java.awt.AWTError;
+import java.awt.Font;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.HeadlessException;
+import java.awt.Toolkit;
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
 
-import sun.java2d.*;
+import sun.java2d.MacosxSurfaceManagerFactory;
+import sun.java2d.SunGraphicsEnvironment;
+import sun.java2d.SurfaceManagerFactory;
 
 /**
  * This is an implementation of a GraphicsEnvironment object for the default
@@ -87,6 +99,9 @@
     /** Reference to the display reconfiguration callback context. */
     private final long displayReconfigContext;
 
+    // list of invalidated graphics devices (those which were removed)
+    private List<WeakReference<CGraphicsDevice>> oldDevices = new ArrayList<>();
+
     /**
      * Construct a new instance.
      */
@@ -116,11 +131,23 @@
         synchronized (this) {
             if (removed && devices.containsKey(displayId)) {
                 final CGraphicsDevice gd = devices.remove(displayId);
-                gd.invalidate(getMainDisplayID());
-                gd.displayChanged();
+                oldDevices.add(new WeakReference<>(gd));
             }
         }
         initDevices();
+
+        // Need to notify old devices, in case the user hold the reference to it
+        for (ListIterator<WeakReference<CGraphicsDevice>> it =
+             oldDevices.listIterator(); it.hasNext(); ) {
+            CGraphicsDevice gd = it.next().get();
+            if (gd != null) {
+                gd.invalidate(mainDisplayID);
+                gd.displayChanged();
+            } else {
+                // no more references to this device, remove it
+                it.remove();
+            }
+        }
     }
 
     @Override
--- a/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java	Mon Nov 12 11:10:16 2018 +0530
@@ -54,12 +54,14 @@
 import sun.java2d.pipe.hw.AccelSurface;
 import sun.java2d.pipe.hw.AccelTypedVolatileImage;
 import sun.java2d.pipe.hw.ContextCapabilities;
-import static sun.java2d.opengl.OGLSurfaceData.*;
-import static sun.java2d.opengl.OGLContext.OGLContextCaps.*;
-
 import sun.lwawt.LWComponentPeer;
 import sun.lwawt.macosx.CPlatformView;
 
+import static sun.java2d.opengl.OGLContext.OGLContextCaps.CAPS_DOUBLEBUFFERED;
+import static sun.java2d.opengl.OGLContext.OGLContextCaps.CAPS_EXT_FBOBJECT;
+import static sun.java2d.opengl.OGLSurfaceData.FBOBJECT;
+import static sun.java2d.opengl.OGLSurfaceData.TEXTURE;
+
 public final class CGLGraphicsConfig extends CGraphicsConfig
     implements OGLGraphicsConfig
 {
@@ -125,7 +127,7 @@
     }
 
     public static CGLGraphicsConfig getConfig(CGraphicsDevice device,
-                                              int pixfmt)
+                                              int displayID, int pixfmt)
     {
         if (!cglAvailable) {
             return null;
@@ -141,9 +143,7 @@
             // surfaces/contexts, so we should first invalidate the current
             // Java-level context and flush the queue...
             OGLContext.invalidateCurrentContext();
-
-            cfginfo = getCGLConfigInfo(device.getCGDisplayID(), pixfmt,
-                                       kOpenGLSwapInterval);
+            cfginfo = getCGLConfigInfo(displayID, pixfmt, kOpenGLSwapInterval);
             if (cfginfo != 0L) {
                 textureSize = nativeGetMaxTextureSize();
                 // 7160609: GL still fails to create a square texture of this
@@ -259,8 +259,8 @@
 
     @Override
     public String toString() {
-        int displayID = getDevice().getCGDisplayID();
-        return ("CGLGraphicsConfig[dev="+displayID+",pixfmt="+pixfmt+"]");
+        String display = getDevice().getIDstring();
+        return ("CGLGraphicsConfig[" + display + ", pixfmt=" + pixfmt + "]");
     }
 
     @Override
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java	Mon Nov 12 11:10:16 2018 +0530
@@ -25,12 +25,15 @@
 
 package sun.lwawt.macosx;
 
-import java.awt.*;
-import java.awt.peer.*;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Robot;
+import java.awt.peer.RobotPeer;
 
 import sun.awt.CGraphicsDevice;
 
-class CRobot implements RobotPeer {
+final class CRobot implements RobotPeer {
+
     private static final int MOUSE_LOCATION_UNKNOWN      = -1;
 
     private final CGraphicsDevice fDevice;
@@ -65,8 +68,7 @@
         mouseLastX = x;
         mouseLastY = y;
 
-        mouseEvent(fDevice.getCGDisplayID(), mouseLastX, mouseLastY,
-                   mouseButtonsState, true, true);
+        mouseEvent(mouseLastX, mouseLastY, mouseButtonsState, true, true);
     }
 
     /**
@@ -79,8 +81,7 @@
     public void mousePress(int buttons) {
         mouseButtonsState |= buttons;
         checkMousePos();
-        mouseEvent(fDevice.getCGDisplayID(), mouseLastX, mouseLastY,
-                   buttons, true, false);
+        mouseEvent(mouseLastX, mouseLastY, buttons, true, false);
     }
 
     /**
@@ -93,8 +94,7 @@
     public void mouseRelease(int buttons) {
         mouseButtonsState &= ~buttons;
         checkMousePos();
-        mouseEvent(fDevice.getCGDisplayID(), mouseLastX, mouseLastY,
-                   buttons, false, false);
+        mouseEvent(mouseLastX, mouseLastY, buttons, false, false);
     }
 
     /**
@@ -193,8 +193,7 @@
     }
 
     private native void initRobot();
-    private native void mouseEvent(int displayID, int lastX, int lastY,
-                                   int buttonsState,
+    private native void mouseEvent(int lastX, int lastY, int buttonsState,
                                    boolean isButtonsDownState,
                                    boolean isMouseMove);
     private native void keyEvent(int javaKeyCode, boolean keydown);
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,11 +25,44 @@
 
 package sun.lwawt.macosx;
 
-import com.apple.laf.AquaMenuBarUI;
-import java.awt.peer.TaskbarPeer;
-import java.awt.*;
+import java.awt.AWTError;
+import java.awt.CheckboxMenuItem;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.Desktop;
+import java.awt.Dialog;
+import java.awt.Dimension;
+import java.awt.Event;
+import java.awt.EventQueue;
+import java.awt.FileDialog;
+import java.awt.Frame;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.HeadlessException;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.Menu;
+import java.awt.MenuBar;
+import java.awt.MenuItem;
+import java.awt.Point;
+import java.awt.PopupMenu;
+import java.awt.RenderingHints;
+import java.awt.Robot;
+import java.awt.SystemTray;
+import java.awt.Taskbar;
+import java.awt.Toolkit;
+import java.awt.TrayIcon;
+import java.awt.Window;
 import java.awt.datatransfer.Clipboard;
-import java.awt.dnd.*;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragGestureRecognizer;
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.InvalidDnDOperationException;
+import java.awt.dnd.MouseDragGestureRecognizer;
 import java.awt.dnd.peer.DragSourceContextPeer;
 import java.awt.event.InputEvent;
 import java.awt.event.InvocationEvent;
@@ -37,21 +70,54 @@
 import java.awt.font.TextAttribute;
 import java.awt.im.InputMethodHighlight;
 import java.awt.im.spi.InputMethodDescriptor;
-import java.awt.peer.*;
-import java.lang.reflect.*;
+import java.awt.peer.CheckboxMenuItemPeer;
+import java.awt.peer.DesktopPeer;
+import java.awt.peer.DialogPeer;
+import java.awt.peer.FileDialogPeer;
+import java.awt.peer.FontPeer;
+import java.awt.peer.MenuBarPeer;
+import java.awt.peer.MenuItemPeer;
+import java.awt.peer.MenuPeer;
+import java.awt.peer.PopupMenuPeer;
+import java.awt.peer.RobotPeer;
+import java.awt.peer.SystemTrayPeer;
+import java.awt.peer.TaskbarPeer;
+import java.awt.peer.TrayIconPeer;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.net.MalformedURLException;
 import java.net.URL;
-import java.security.*;
-import java.util.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.Objects;
+import java.util.ResourceBundle;
 import java.util.concurrent.Callable;
-import java.net.MalformedURLException;
+
 import javax.swing.UIManager;
 
-import sun.awt.*;
+import com.apple.laf.AquaMenuBarUI;
+import sun.awt.AWTAccessor;
+import sun.awt.AppContext;
+import sun.awt.CGraphicsConfig;
+import sun.awt.CGraphicsDevice;
+import sun.awt.LightweightFrame;
+import sun.awt.SunToolkit;
 import sun.awt.datatransfer.DataTransferer;
 import sun.awt.util.ThreadGroupUtils;
 import sun.java2d.opengl.OGLRenderQueue;
-import sun.lwawt.*;
+import sun.lwawt.LWComponentPeer;
+import sun.lwawt.LWCursorManager;
+import sun.lwawt.LWToolkit;
+import sun.lwawt.LWWindowPeer;
 import sun.lwawt.LWWindowPeer.PeerType;
+import sun.lwawt.PlatformComponent;
+import sun.lwawt.PlatformDropTarget;
+import sun.lwawt.PlatformWindow;
+import sun.lwawt.SecurityWarningWindow;
 import sun.security.action.GetBooleanAction;
 
 @SuppressWarnings("serial") // JDK implementation class
@@ -97,6 +163,10 @@
             }
         });
 
+        if (!GraphicsEnvironment.isHeadless() && !isInAquaSession()) {
+            throw new AWTError("WindowServer is not available");
+        }
+
         AWTAccessor.getToolkitAccessor().setPlatformResources(platformResources);
 
         if (!GraphicsEnvironment.isHeadless()) {
@@ -794,6 +864,13 @@
      */
     public static native boolean isEmbedded();
 
+    /**
+     * Returns true if the WindowServer is available, false otherwise.
+     *
+     * @return true if the WindowServer is available, false otherwise
+     */
+    private static native boolean isInAquaSession();
+
     /*
      * Activates application ignoring other apps.
      */
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m	Mon Nov 12 11:10:16 2018 +0530
@@ -214,7 +214,7 @@
     if (IS(styleBits, UNIFIED))       type |= NSUnifiedTitleAndToolbarWindowMask;
     if (IS(styleBits, UTILITY))       type |= NSUtilityWindowMask;
     if (IS(styleBits, HUD))           type |= NSHUDWindowMask;
-    if (IS(styleBits, SHEET))         type |= NSDocModalWindowMask;
+    if (IS(styleBits, SHEET))         type |= NSWindowStyleMaskDocModalWindow;
     if (IS(styleBits, NONACTIVATING)) type |= NSNonactivatingPanelMask;
 
     return type;
@@ -273,7 +273,12 @@
 {
 AWT_ASSERT_APPKIT_THREAD;
 
-    NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:bits];
+    NSUInteger newBits = bits;
+    if (IS(bits, SHEET) && owner == nil) {
+        newBits = bits & ~NSWindowStyleMaskDocModalWindow;
+    }
+    NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:newBits];
+
     NSRect contentRect = rect; //[NSWindow contentRectForFrameRect:rect styleMask:styleMask];
     if (contentRect.size.width <= 0.0) {
         contentRect.size.width = 1.0;
@@ -289,7 +294,8 @@
     if (IS(bits, UTILITY) ||
         IS(bits, NONACTIVATING) ||
         IS(bits, HUD) ||
-        IS(bits, HIDES_ON_DEACTIVATE))
+        IS(bits, HIDES_ON_DEACTIVATE) ||
+        IS(bits, SHEET))
     {
         self.nsWindow = [[AWTWindow_Panel alloc] initWithDelegate:self
                             frameRect:contentRect
@@ -319,6 +325,10 @@
         [self.nsWindow setCollectionBehavior:(1 << 8) /*NSWindowCollectionBehaviorFullScreenAuxiliary*/];
     }
 
+    if (IS(bits, SHEET) && owner != nil) {
+        [self.nsWindow setStyleMask: NSWindowStyleMaskDocModalWindow];
+    }
+
     return self;
 }
 
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsConfig.m	Sun Nov 11 21:24:46 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#include "LWCToolkit.h"
-#include "GeomUtilities.h"
-
-#include "sun_awt_CGraphicsConfig.h"
-#import <JavaNativeFoundation/JavaNativeFoundation.h>
-
-/*
- * Class:     sun_awt_CGraphicsConfig
- * Method:    nativeGetBounds
- * Signature: (I)Ljava/awt/Rectangle;
- */
-JNIEXPORT jobject JNICALL Java_sun_awt_CGraphicsConfig_nativeGetBounds
-(JNIEnv *env, jclass class, jint displayID)
-{
-    jobject jrect = NULL;
-
-JNF_COCOA_ENTER(env);
-
-    CGRect rect = CGDisplayBounds((CGDirectDisplayID)displayID);
-    jrect = CGToJavaRect(env, rect);
-
-JNF_COCOA_EXIT(env);
-
-    return jrect;
-}
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsDevice.m	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsDevice.m	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,17 @@
 
 #import "LWCToolkit.h"
 #import "ThreadUtilities.h"
+#include "GeomUtilities.h"
 
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 
+/**
+ * Some default values for invalid CoreGraphics display ID.
+ */
+#define DEFAULT_DEVICE_WIDTH 1024
+#define DEFAULT_DEVICE_HEIGHT 768
+#define DEFAULT_DEVICE_DPI 72
+
 /*
  * Convert the mode string to the more convinient bits per pixel value
  */
@@ -56,35 +64,39 @@
 }
 
 static CFMutableArrayRef getAllValidDisplayModes(jint displayID){
+    // CGDisplayCopyAllDisplayModes can return NULL if displayID is invalid
     CFArrayRef allModes = CGDisplayCopyAllDisplayModes(displayID, NULL);
+    CFMutableArrayRef validModes = nil;
+    if (allModes) {
+        CFIndex numModes = CFArrayGetCount(allModes);
+        validModes = CFArrayCreateMutable(kCFAllocatorDefault, numModes + 1, &kCFTypeArrayCallBacks);
 
-    CFIndex numModes = CFArrayGetCount(allModes);
-    CFMutableArrayRef validModes = CFArrayCreateMutable(kCFAllocatorDefault, numModes + 1, &kCFTypeArrayCallBacks);
+        CFIndex n;
+        for (n=0; n < numModes; n++) {
+            CGDisplayModeRef cRef = (CGDisplayModeRef) CFArrayGetValueAtIndex(allModes, n);
+            if (cRef != NULL && isValidDisplayMode(cRef)) {
+                CFArrayAppendValue(validModes, cRef);
+            }
+        }
+        CFRelease(allModes);
 
-    CFIndex n;
-    for (n=0; n < numModes; n++) {
-        CGDisplayModeRef cRef = (CGDisplayModeRef) CFArrayGetValueAtIndex(allModes, n);
-        if (cRef != NULL && isValidDisplayMode(cRef)) {
-            CFArrayAppendValue(validModes, cRef);
+        // CGDisplayCopyDisplayMode can return NULL if displayID is invalid
+        CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(displayID);
+        if (currentMode) {
+            BOOL containsCurrentMode = NO;
+            numModes = CFArrayGetCount(validModes);
+            for (n=0; n < numModes; n++) {
+                if(CFArrayGetValueAtIndex(validModes, n) == currentMode){
+                    containsCurrentMode = YES;
+                    break;
+                }
+            }
+            if (!containsCurrentMode) {
+                CFArrayAppendValue(validModes, currentMode);
+            }
+            CGDisplayModeRelease(currentMode);
         }
     }
-    CFRelease(allModes);
-    
-    CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(displayID);
-
-    BOOL containsCurrentMode = NO;
-    numModes = CFArrayGetCount(validModes);
-    for (n=0; n < numModes; n++) {
-        if(CFArrayGetValueAtIndex(validModes, n) == currentMode){
-            containsCurrentMode = YES;
-            break;
-        }
-    }
-
-    if (!containsCurrentMode) {
-        CFArrayAppendValue(validModes, currentMode);
-    }
-    CGDisplayModeRelease(currentMode);
 
     return validModes;
 }
@@ -95,7 +107,7 @@
  */
 static CGDisplayModeRef getBestModeForParameters(CFArrayRef allModes, int w, int h, int bpp, int refrate) {
     CGDisplayModeRef bestGuess = NULL;
-    CFIndex numModes = CFArrayGetCount(allModes), n;
+    CFIndex numModes = allModes ? CFArrayGetCount(allModes) : 0, n;
     int thisBpp = 0;
     for(n = 0; n < numModes; n++ ) {
         CGDisplayModeRef cRef = (CGDisplayModeRef) CFArrayGetValueAtIndex(allModes, n);
@@ -129,18 +141,21 @@
 }
 
 /*
- * Create a new java.awt.DisplayMode instance based on provided CGDisplayModeRef
+ * Create a new java.awt.DisplayMode instance based on provided
+ * CGDisplayModeRef, if CGDisplayModeRef is NULL, then some stub is returned.
  */
-static jobject createJavaDisplayMode(CGDisplayModeRef mode, JNIEnv *env, jint displayID) {
+static jobject createJavaDisplayMode(CGDisplayModeRef mode, JNIEnv *env) {
     jobject ret = NULL;
-    jint h, w, bpp, refrate;
+    jint h = DEFAULT_DEVICE_HEIGHT, w = DEFAULT_DEVICE_WIDTH, bpp = 0, refrate = 0;
     JNF_COCOA_ENTER(env);
-    CFStringRef currentBPP = CGDisplayModeCopyPixelEncoding(mode);
-    bpp = getBPPFromModeString(currentBPP);
-    refrate = CGDisplayModeGetRefreshRate(mode);
-    h = CGDisplayModeGetHeight(mode);
-    w = CGDisplayModeGetWidth(mode);
-    CFRelease(currentBPP);
+    if (mode) {
+        CFStringRef currentBPP = CGDisplayModeCopyPixelEncoding(mode);
+        bpp = getBPPFromModeString(currentBPP);
+        refrate = CGDisplayModeGetRefreshRate(mode);
+        h = CGDisplayModeGetHeight(mode);
+        w = CGDisplayModeGetWidth(mode);
+        CFRelease(currentBPP);
+    }
     static JNF_CLASS_CACHE(jc_DisplayMode, "java/awt/DisplayMode");
     static JNF_CTOR_CACHE(jc_DisplayMode_ctor, jc_DisplayMode, "(IIII)V");
     ret = JNFNewObject(env, jc_DisplayMode_ctor, w, h, bpp, refrate);
@@ -163,7 +178,7 @@
     CGRect rect = CGDisplayBounds(displayID);
     // 1 inch == 25.4 mm
     jfloat inches = size.width / 25.4f;
-    return inches > 0 ? rect.size.width / inches : 72;
+    return inches > 0 ? rect.size.width / inches : DEFAULT_DEVICE_DPI;
 }
 
 /*
@@ -180,7 +195,26 @@
     CGRect rect = CGDisplayBounds(displayID);
     // 1 inch == 25.4 mm
     jfloat inches = size.height / 25.4f;
-    return inches > 0 ? rect.size.height / inches : 72;
+    return inches > 0 ? rect.size.height / inches : DEFAULT_DEVICE_DPI;
+}
+
+/*
+ * Class:     sun_awt_CGraphicsDevice
+ * Method:    nativeGetBounds
+ * Signature: (I)Ljava/awt/Rectangle;
+ */
+JNIEXPORT jobject JNICALL
+Java_sun_awt_CGraphicsDevice_nativeGetBounds
+(JNIEnv *env, jclass class, jint displayID)
+{
+    CGRect rect = CGDisplayBounds(displayID);
+    if (rect.size.width == 0) {
+        rect.size.width = DEFAULT_DEVICE_WIDTH;
+    }
+    if (rect.size.height == 0) {
+        rect.size.height = DEFAULT_DEVICE_HEIGHT;
+    }
+    return CGToJavaRect(env, rect);
 }
 
 /*
@@ -196,7 +230,7 @@
     __block NSRect frame = NSZeroRect;
     __block NSRect visibleFrame = NSZeroRect;
 JNF_COCOA_ENTER(env);
-    
+
     [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
         NSArray *screens = [NSScreen screens];
         for (NSScreen *screen in screens) {
@@ -214,7 +248,7 @@
     jint top = frame.size.height - visibleFrame.size.height - bottom;
     jint left = visibleFrame.origin.x - frame.origin.x;
     jint right = frame.size.width - visibleFrame.size.width - left;
-    
+
     static JNF_CLASS_CACHE(jc_Insets, "java/awt/Insets");
     static JNF_CTOR_CACHE(jc_Insets_ctor, jc_Insets, "(IIII)V");
     ret = JNFNewObject(env, jc_Insets_ctor, top, left, bottom, right);
@@ -236,7 +270,7 @@
     JNF_COCOA_ENTER(env);
     CFArrayRef allModes = getAllValidDisplayModes(displayID);
     CGDisplayModeRef closestMatch = getBestModeForParameters(allModes, (int)w, (int)h, (int)bpp, (int)refrate);
-    
+
     __block CGError retCode = kCGErrorSuccess;
     if (closestMatch != NULL) {
         CGDisplayModeRetain(closestMatch);
@@ -269,8 +303,9 @@
 (JNIEnv *env, jclass class, jint displayID)
 {
     jobject ret = NULL;
+    // CGDisplayCopyDisplayMode can return NULL if displayID is invalid
     CGDisplayModeRef currentMode = CGDisplayCopyDisplayMode(displayID);
-    ret = createJavaDisplayMode(currentMode, env, displayID);
+    ret = createJavaDisplayMode(currentMode, env);
     CGDisplayModeRelease(currentMode);
     return ret;
 }
@@ -288,7 +323,7 @@
     JNF_COCOA_ENTER(env);
     CFArrayRef allModes = getAllValidDisplayModes(displayID);
 
-    CFIndex numModes = CFArrayGetCount(allModes);
+    CFIndex numModes = allModes ? CFArrayGetCount(allModes): 0;
     static JNF_CLASS_CACHE(jc_DisplayMode, "java/awt/DisplayMode");
 
     jreturnArray = JNFNewObjectArray(env, &jc_DisplayMode, (jsize) numModes);
@@ -301,7 +336,7 @@
     for (n=0; n < numModes; n++) {
         CGDisplayModeRef cRef = (CGDisplayModeRef) CFArrayGetValueAtIndex(allModes, n);
         if (cRef != NULL) {
-            jobject oneMode = createJavaDisplayMode(cRef, env, displayID);
+            jobject oneMode = createJavaDisplayMode(cRef, env);
             (*env)->SetObjectArrayElement(env, jreturnArray, n, oneMode);
             if ((*env)->ExceptionOccurred(env)) {
                 (*env)->ExceptionDescribe(env);
@@ -311,7 +346,9 @@
             (*env)->DeleteLocalRef(env, oneMode);
         }
     }
-    CFRelease(allModes);
+    if (allModes) {
+        CFRelease(allModes);
+    }
     JNF_COCOA_EXIT(env);
 
     return jreturnArray;
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -139,8 +139,7 @@
  */
 JNIEXPORT void JNICALL
 Java_sun_lwawt_macosx_CRobot_mouseEvent
-(JNIEnv *env, jobject peer,
- jint displayID, jint mouseLastX, jint mouseLastY, jint buttonsState,
+(JNIEnv *env, jobject peer, jint mouseLastX, jint mouseLastY, jint buttonsState,
  jboolean isButtonsDownState, jboolean isMouseMove)
 {
     JNF_COCOA_ENTER(env);
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m	Mon Nov 12 11:10:16 2018 +0530
@@ -465,8 +465,9 @@
     }
 
     // if it's a pagetab / radiobutton, it has a value but no min/max value.
+    // if it is a slider, supplying only the value makes it to voice out the value instead of percentages
     BOOL hasAxValue = attributeStatesArray[2];
-    if ([javaRole isEqualToString:@"pagetab"] || [javaRole isEqualToString:@"radiobutton"]) {
+    if ([javaRole isEqualToString:@"pagetab"] || [javaRole isEqualToString:@"radiobutton"] || [javaRole isEqualToString:@"slider"]) {
         [attributeNames addObject:NSAccessibilityValueAttribute];
     } else {
         // if not a pagetab/radio button, and it has a value, it has a min/max/current value.
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -84,7 +84,7 @@
     if ([event type] != NSScrollWheel) {
         return 0;
     }
-    
+
     if ([event phase]) {
         // process a phase of manual scrolling
         switch ([event phase]) {
@@ -804,3 +804,30 @@
     return isEmbedded ? JNI_TRUE : JNI_FALSE;
 }
 
+/*
+ * Class:     sun_lwawt_macosx_LWCToolkit
+ * Method:    isInAquaSession
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_sun_lwawt_macosx_LWCToolkit_isInAquaSession
+(JNIEnv *env, jclass klass) {
+    // copied from java.base/macosx/native/libjava/java_props_macosx.c
+    // environment variable to bypass the aqua session check
+    char *ev = getenv("AWT_FORCE_HEADFUL");
+    if (ev && (strncasecmp(ev, "true", 4) == 0)) {
+        // if "true" then tell the caller we're in an Aqua session without
+        // actually checking
+        return JNI_TRUE;
+    }
+    // Is the WindowServer available?
+    SecuritySessionId session_id;
+    SessionAttributeBits session_info;
+    OSStatus status = SessionGetInfo(callerSecuritySession, &session_id, &session_info);
+    if (status == noErr) {
+        if (session_info & sessionHasGraphicAccess) {
+            return JNI_TRUE;
+        }
+    }
+    return JNI_FALSE;
+}
--- a/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,17 +32,16 @@
 import java.lang.ref.WeakReference;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.util.Iterator;
 import java.util.LinkedList;
-import java.util.Iterator;
 import java.util.ListIterator;
 import java.util.Set;
 
-import sun.util.logging.PlatformLogger;
-
+import sun.awt.AWTAccessor;
 import sun.awt.AppContext;
 import sun.awt.SunToolkit;
-import sun.awt.AWTAccessor;
 import sun.awt.TimedWindowEvent;
+import sun.util.logging.PlatformLogger;
 
 /**
  * The default KeyboardFocusManager for AWT applications. Focus traversal is
@@ -813,7 +812,7 @@
                     : NULL_WINDOW_WR;
                 typeAheadAssertions(currentFocusedWindow, we);
 
-                if (oppositeWindow == null) {
+                if (oppositeWindow == null && activeWindow != null) {
                     // Then we need to deactivate the active Window as well.
                     // No need to synthesize in other cases, because
                     // WINDOW_ACTIVATED will handle it if necessary.
--- a/src/java.desktop/share/classes/java/awt/color/CMMException.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/share/classes/java/awt/color/CMMException.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +23,7 @@
  * questions.
  */
 
-/*
-    Created by gbp, October 25, 1997
-
- *
- */
-/*
- **********************************************************************
+/* ********************************************************************
  **********************************************************************
  **********************************************************************
  *** COPYRIGHT (c) Eastman Kodak Company, 1997                      ***
@@ -38,22 +33,24 @@
  **********************************************************************
  **********************************************************************/
 
-
 package java.awt.color;
 
-
 /**
  * This exception is thrown if the native CMM returns an error.
  */
+public class CMMException extends java.lang.RuntimeException {
 
-public class CMMException extends java.lang.RuntimeException {
+    /**
+     * Use serialVersionUID from JDK 1.2 for interoperability.
+     */
     private static final long serialVersionUID = 5775558044142994965L;
 
     /**
-     *  Constructs a CMMException with the specified detail message.
-     *  @param s the specified detail message
+     * Constructs a {@code CMMException} with the specified detail message.
+     *
+     * @param  s the specified detail message
      */
-    public CMMException (String s) {
-        super (s);
+    public CMMException(String s) {
+        super(s);
     }
 }
--- a/src/java.desktop/share/classes/java/awt/color/ColorSpace.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/share/classes/java/awt/color/ColorSpace.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,7 @@
  * questions.
  */
 
-/*
- **********************************************************************
+/* ********************************************************************
  **********************************************************************
  **********************************************************************
  *** COPYRIGHT (c) Eastman Kodak Company, 1997                      ***
@@ -38,63 +37,60 @@
 
 import java.lang.annotation.Native;
 
-import sun.java2d.cmm.PCMM;
 import sun.java2d.cmm.CMSManager;
 
-
 /**
  * This abstract class is used to serve as a color space tag to identify the
- * specific color space of a Color object or, via a ColorModel object,
- * of an Image, a BufferedImage, or a GraphicsDevice.  It contains
- * methods that transform colors in a specific color space to/from sRGB
- * and to/from a well-defined CIEXYZ color space.
+ * specific color space of a {@code Color} object or, via a {@code ColorModel}
+ * object, of an {@code Image}, a {@code BufferedImage}, or a
+ * {@code GraphicsDevice}. It contains methods that transform colors in a
+ * specific color space to/from sRGB and to/from a well-defined CIEXYZ color
+ * space.
  * <p>
- * For purposes of the methods in this class, colors are represented as
- * arrays of color components represented as floats in a normalized range
- * defined by each ColorSpace.  For many ColorSpaces (e.g. sRGB), this
- * range is 0.0 to 1.0.  However, some ColorSpaces have components whose
- * values have a different range.  Methods are provided to inquire per
- * component minimum and maximum normalized values.
+ * For purposes of the methods in this class, colors are represented as arrays
+ * of color components represented as floats in a normalized range defined by
+ * each {@code ColorSpace}. For many {@code ColorSpaces} (e.g. sRGB), this range
+ * is 0.0 to 1.0. However, some {@code ColorSpaces} have components whose values
+ * have a different range. Methods are provided to inquire per component minimum
+ * and maximum normalized values.
  * <p>
- * Several variables are defined for purposes of referring to color
- * space types (e.g. TYPE_RGB, TYPE_XYZ, etc.) and to refer to specific
- * color spaces (e.g. CS_sRGB and CS_CIEXYZ).
- * sRGB is a proposed standard RGB color space.  For more information,
- * see <A href="http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html">
- * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html
- * </A>.
+ * Several variables are defined for purposes of referring to color space types
+ * (e.g. {@code TYPE_RGB}, {@code TYPE_XYZ}, etc.) and to refer to specific
+ * color spaces (e.g. {@code CS_sRGB} and {@code CS_CIEXYZ}). sRGB is a proposed
+ * standard RGB color space. For more information, see
+ * <a href="http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html">
+ * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html</a>.
  * <p>
- * The purpose of the methods to transform to/from the well-defined
- * CIEXYZ color space is to support conversions between any two color
- * spaces at a reasonably high degree of accuracy.  It is expected that
- * particular implementations of subclasses of ColorSpace (e.g.
- * ICC_ColorSpace) will support high performance conversion based on
- * underlying platform color management systems.
+ * The purpose of the methods to transform to/from the well-defined CIEXYZ color
+ * space is to support conversions between any two color spaces at a reasonably
+ * high degree of accuracy. It is expected that particular implementations of
+ * subclasses of {@code ColorSpace} (e.g. {@code ICC_ColorSpace}) will support
+ * high performance conversion based on underlying platform color management
+ * systems.
  * <p>
- * The CS_CIEXYZ space used by the toCIEXYZ/fromCIEXYZ methods can be
- * described as follows:
-<pre>
-
-&nbsp;     CIEXYZ
-&nbsp;     viewing illuminance: 200 lux
-&nbsp;     viewing white point: CIE D50
-&nbsp;     media white point: "that of a perfectly reflecting diffuser" -- D50
-&nbsp;     media black point: 0 lux or 0 Reflectance
-&nbsp;     flare: 1 percent
-&nbsp;     surround: 20percent of the media white point
-&nbsp;     media description: reflection print (i.e., RLAB, Hunt viewing media)
-&nbsp;     note: For developers creating an ICC profile for this conversion
-&nbsp;           space, the following is applicable.  Use a simple Von Kries
-&nbsp;           white point adaptation folded into the 3X3 matrix parameters
-&nbsp;           and fold the flare and surround effects into the three
-&nbsp;           one-dimensional lookup tables (assuming one uses the minimal
-&nbsp;           model for monitors).
-
-</pre>
+ * The {@code CS_CIEXYZ} space used by the {@code toCIEXYZ/fromCIEXYZ} methods
+ * can be described as follows:
+ * <pre>
+ *
+ * &nbsp;   CIEXYZ
+ * &nbsp;   viewing illuminance: 200 lux
+ * &nbsp;   viewing white point: CIE D50
+ * &nbsp;   media white point: "that of a perfectly reflecting diffuser" -- D50
+ * &nbsp;   media black point: 0 lux or 0 Reflectance
+ * &nbsp;   flare: 1 percent
+ * &nbsp;   surround: 20percent of the media white point
+ * &nbsp;   media description: reflection print (i.e., RLAB, Hunt viewing media)
+ * &nbsp;   note: For developers creating an ICC profile for this conversion
+ * &nbsp;         space, the following is applicable. Use a simple Von Kries
+ * &nbsp;         white point adaptation folded into the 3X3 matrix parameters
+ * &nbsp;         and fold the flare and surround effects into the three
+ * &nbsp;         one-dimensional lookup tables (assuming one uses the minimal
+ * &nbsp;         model for monitors).
+ *
+ * </pre>
  *
  * @see ICC_ColorSpace
  */
-
 public abstract class ColorSpace implements java.io.Serializable {
 
     static final long serialVersionUID = -409452704308689724L;
@@ -237,15 +233,14 @@
 
     /**
      * The sRGB color space defined at
-     * <A href="http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html">
-     * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html
-     * </A>.
+     * <a href="http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html">
+     * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html</a>.
      */
     @Native public static final int CS_sRGB = 1000;
 
     /**
-     * A built-in linear RGB color space.  This space is based on the
-     * same RGB primaries as CS_sRGB, but has a linear tone reproduction curve.
+     * A built-in linear RGB color space. This space is based on the same RGB
+     * primaries as {@code CS_sRGB}, but has a linear tone reproduction curve.
      */
     @Native public static final int CS_LINEAR_RGB = 1004;
 
@@ -264,25 +259,26 @@
      */
     @Native public static final int CS_GRAY = 1003;
 
-
     /**
-     * Constructs a ColorSpace object given a color space type
-     * and the number of components.
-     * @param type one of the {@code ColorSpace} type constants
-     * @param numcomponents the number of components in the color space
+     * Constructs a {@code ColorSpace} object given a color space type and the
+     * number of components.
+     *
+     * @param  type one of the {@code ColorSpace} type constants
+     * @param  numcomponents the number of components in the color space
      */
-    protected ColorSpace (int type, int numcomponents) {
+    protected ColorSpace(int type, int numcomponents) {
         this.type = type;
         this.numComponents = numcomponents;
     }
 
-
     /**
-     * Returns a ColorSpace representing one of the specific
-     * predefined color spaces.
-     * @param colorspace a specific color space identified by one of
-     *        the predefined class constants (e.g. CS_sRGB, CS_LINEAR_RGB,
-     *        CS_CIEXYZ, CS_GRAY, or CS_PYCC)
+     * Returns a {@code ColorSpace} representing one of the specific predefined
+     * color spaces.
+     *
+     * @param  colorspace a specific color space identified by one of the
+     *         predefined class constants (e.g. {@code CS_sRGB},
+     *         {@code CS_LINEAR_RGB}, {@code CS_CIEXYZ}, {@code CS_GRAY}, or
+     *         {@code CS_PYCC})
      * @return the requested {@code ColorSpace} object
      */
     // NOTE: This method may be called by privileged threads.
@@ -363,11 +359,11 @@
         return theColorSpace;
     }
 
-
     /**
-     * Returns true if the ColorSpace is CS_sRGB.
-     * @return {@code true} if this is a {@code CS_sRGB} color
-     *         space, {@code false} if it is not
+     * Returns true if the {@code ColorSpace} is {@code CS_sRGB}.
+     *
+     * @return {@code true} if this is a {@code CS_sRGB} color space,
+     *         {@code false} if it is not
      */
     public boolean isCS_sRGB () {
         /* REMIND - make sure we know sRGBspace exists already */
@@ -375,115 +371,105 @@
     }
 
     /**
-     * Transforms a color value assumed to be in this ColorSpace
-     * into a value in the default CS_sRGB color space.
+     * Transforms a color value assumed to be in this {@code ColorSpace} into a
+     * value in the default {@code CS_sRGB} color space.
      * <p>
-     * This method transforms color values using algorithms designed
-     * to produce the best perceptual match between input and output
-     * colors.  In order to do colorimetric conversion of color values,
-     * you should use the {@code toCIEXYZ}
-     * method of this color space to first convert from the input
-     * color space to the CS_CIEXYZ color space, and then use the
-     * {@code fromCIEXYZ} method of the CS_sRGB color space to
-     * convert from CS_CIEXYZ to the output color space.
-     * See {@link #toCIEXYZ(float[]) toCIEXYZ} and
+     * This method transforms color values using algorithms designed to produce
+     * the best perceptual match between input and output colors. In order to do
+     * colorimetric conversion of color values, you should use the
+     * {@code toCIEXYZ} method of this color space to first convert from the
+     * input color space to the CS_CIEXYZ color space, and then use the
+     * {@code fromCIEXYZ} method of the {@code CS_sRGB} color space to convert
+     * from {@code CS_CIEXYZ} to the output color space. See
+     * {@link #toCIEXYZ(float[]) toCIEXYZ} and
      * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information.
      *
-     * @param colorvalue a float array with length of at least the number
-     *        of components in this ColorSpace
+     * @param  colorvalue a float array with length of at least the number of
+     *         components in this {@code ColorSpace}
      * @return a float array of length 3
-     * @throws ArrayIndexOutOfBoundsException if array length is not
-     *         at least the number of components in this ColorSpace
+     * @throws ArrayIndexOutOfBoundsException if array length is not at least
+     *         the number of components in this {@code ColorSpace}
      */
     public abstract float[] toRGB(float[] colorvalue);
 
-
     /**
-     * Transforms a color value assumed to be in the default CS_sRGB
-     * color space into this ColorSpace.
+     * Transforms a color value assumed to be in the default {@code CS_sRGB}
+     * color space into this {@code ColorSpace}.
      * <p>
-     * This method transforms color values using algorithms designed
-     * to produce the best perceptual match between input and output
-     * colors.  In order to do colorimetric conversion of color values,
-     * you should use the {@code toCIEXYZ}
-     * method of the CS_sRGB color space to first convert from the input
-     * color space to the CS_CIEXYZ color space, and then use the
-     * {@code fromCIEXYZ} method of this color space to
-     * convert from CS_CIEXYZ to the output color space.
-     * See {@link #toCIEXYZ(float[]) toCIEXYZ} and
+     * This method transforms color values using algorithms designed to produce
+     * the best perceptual match between input and output colors. In order to do
+     * colorimetric conversion of color values, you should use the
+     * {@code toCIEXYZ} method of the {@code CS_sRGB} color space to first
+     * convert from the input color space to the {@code CS_CIEXYZ} color space,
+     * and then use the {@code fromCIEXYZ} method of this color space to convert
+     * from {@code CS_CIEXYZ} to the output color space. See
+     * {@link #toCIEXYZ(float[]) toCIEXYZ} and
      * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information.
      *
-     * @param rgbvalue a float array with length of at least 3
-     * @return a float array with length equal to the number of
-     *         components in this ColorSpace
-     * @throws ArrayIndexOutOfBoundsException if array length is not
-     *         at least 3
+     * @param  rgbvalue a float array with length of at least 3
+     * @return a float array with length equal to the number of components in
+     *         this {@code ColorSpace}
+     * @throws ArrayIndexOutOfBoundsException if array length is not at least 3
      */
     public abstract float[] fromRGB(float[] rgbvalue);
 
-
     /**
-     * Transforms a color value assumed to be in this ColorSpace
-     * into the CS_CIEXYZ conversion color space.
+     * Transforms a color value assumed to be in this {@code ColorSpace} into
+     * the {@code CS_CIEXYZ} conversion color space.
      * <p>
-     * This method transforms color values using relative colorimetry,
-     * as defined by the International Color Consortium standard.  This
-     * means that the XYZ values returned by this method are represented
-     * relative to the D50 white point of the CS_CIEXYZ color space.
-     * This representation is useful in a two-step color conversion
-     * process in which colors are transformed from an input color
-     * space to CS_CIEXYZ and then to an output color space.  This
-     * representation is not the same as the XYZ values that would
-     * be measured from the given color value by a colorimeter.
-     * A further transformation is necessary to compute the XYZ values
-     * that would be measured using current CIE recommended practices.
-     * See the {@link ICC_ColorSpace#toCIEXYZ(float[]) toCIEXYZ} method of
+     * This method transforms color values using relative colorimetry, as
+     * defined by the International Color Consortium standard. This means that
+     * the XYZ values returned by this method are represented relative to the
+     * D50 white point of the {@code CS_CIEXYZ} color space. This representation
+     * is useful in a two-step color conversion process in which colors are
+     * transformed from an input color space to {@code CS_CIEXYZ} and then to an
+     * output color space. This representation is not the same as the XYZ values
+     * that would be measured from the given color value by a colorimeter. A
+     * further transformation is necessary to compute the XYZ values that would
+     * be measured using current CIE recommended practices. See the
+     * {@link ICC_ColorSpace#toCIEXYZ(float[]) toCIEXYZ} method of
      * {@code ICC_ColorSpace} for further information.
      *
-     * @param colorvalue a float array with length of at least the number
-     *        of components in this ColorSpace
+     * @param colorvalue a float array with length of at least the number of
+     *        components in this {@code ColorSpace}
      * @return a float array of length 3
-     * @throws ArrayIndexOutOfBoundsException if array length is not
-     *         at least the number of components in this ColorSpace.
+     * @throws ArrayIndexOutOfBoundsException if array length is not at least
+     *         the number of components in this {@code ColorSpace}.
      */
     public abstract float[] toCIEXYZ(float[] colorvalue);
 
-
     /**
-     * Transforms a color value assumed to be in the CS_CIEXYZ conversion
-     * color space into this ColorSpace.
+     * Transforms a color value assumed to be in the {@code CS_CIEXYZ}
+     * conversion color space into this {@code ColorSpace}.
      * <p>
-     * This method transforms color values using relative colorimetry,
-     * as defined by the International Color Consortium standard.  This
-     * means that the XYZ argument values taken by this method are represented
-     * relative to the D50 white point of the CS_CIEXYZ color space.
-     * This representation is useful in a two-step color conversion
-     * process in which colors are transformed from an input color
-     * space to CS_CIEXYZ and then to an output color space.  The color
-     * values returned by this method are not those that would produce
-     * the XYZ value passed to the method when measured by a colorimeter.
-     * If you have XYZ values corresponding to measurements made using
-     * current CIE recommended practices, they must be converted to D50
-     * relative values before being passed to this method.
-     * See the {@link ICC_ColorSpace#fromCIEXYZ(float[]) fromCIEXYZ} method of
+     * This method transforms color values using relative colorimetry, as
+     * defined by the International Color Consortium standard. This means that
+     * the XYZ argument values taken by this method are represented relative to
+     * the D50 white point of the {@code CS_CIEXYZ} color space. This
+     * representation is useful in a two-step color conversion process in which
+     * colors are transformed from an input color space to {@code CS_CIEXYZ} and
+     * then to an output color space. The color values returned by this method
+     * are not those that would produce the XYZ value passed to the method when
+     * measured by a colorimeter. If you have XYZ values corresponding to
+     * measurements made using current CIE recommended practices, they must be
+     * converted to D50 relative values before being passed to this method. See
+     * the {@link ICC_ColorSpace#fromCIEXYZ(float[]) fromCIEXYZ} method of
      * {@code ICC_ColorSpace} for further information.
      *
-     * @param colorvalue a float array with length of at least 3
-     * @return a float array with length equal to the number of
-     *         components in this ColorSpace
-     * @throws ArrayIndexOutOfBoundsException if array length is not
-     *         at least 3
+     * @param  colorvalue a float array with length of at least 3
+     * @return a float array with length equal to the number of components in
+     *         this {@code ColorSpace}
+     * @throws ArrayIndexOutOfBoundsException if array length is not at least 3
      */
     public abstract float[] fromCIEXYZ(float[] colorvalue);
 
     /**
-     * Returns the color space type of this ColorSpace (for example
-     * TYPE_RGB, TYPE_XYZ, ...).  The type defines the
-     * number of components of the color space and the interpretation,
-     * e.g. TYPE_RGB identifies a color space with three components - red,
-     * green, and blue.  It does not define the particular color
-     * characteristics of the space, e.g. the chromaticities of the
-     * primaries.
+     * Returns the color space type of this {@code ColorSpace} (for example
+     * {@code TYPE_RGB}, {@code TYPE_XYZ}, ...). The type defines the number of
+     * components of the color space and the interpretation, e.g.
+     * {@code TYPE_RGB} identifies a color space with three components - red,
+     * green, and blue. It does not define the particular color characteristics
+     * of the space, e.g. the chromaticities of the primaries.
      *
      * @return the type constant that represents the type of this
      *         {@code ColorSpace}
@@ -494,7 +480,8 @@
 
     /**
      * Returns the number of components of this ColorSpace.
-     * @return The number of components in this {@code ColorSpace}.
+     *
+     * @return the number of components in this {@code ColorSpace}
      */
     public int getNumComponents() {
         return numComponents;
@@ -503,10 +490,10 @@
     /**
      * Returns the name of the component given the component index.
      *
-     * @param idx the component index
+     * @param  idx the component index
      * @return the name of the component at the specified index
-     * @throws IllegalArgumentException if {@code idx} is
-     *         less than 0 or greater than numComponents - 1
+     * @throws IllegalArgumentException if {@code idx} is less than 0 or greater
+     *         than {@code numComponents - 1}
      */
     public String getName (int idx) {
         /* REMIND - handle common cases here */
@@ -564,15 +551,14 @@
     }
 
     /**
-     * Returns the minimum normalized color component value for the
-     * specified component.  The default implementation in this abstract
-     * class returns 0.0 for all components.  Subclasses should override
-     * this method if necessary.
+     * Returns the minimum normalized color component value for the specified
+     * component. The default implementation in this abstract class returns 0.0
+     * for all components. Subclasses should override this method if necessary.
      *
-     * @param component the component index
+     * @param  component the component index
      * @return the minimum normalized component value
-     * @throws IllegalArgumentException if component is less than 0 or
-     *         greater than numComponents - 1
+     * @throws IllegalArgumentException if component is less than 0 or greater
+     *         than {@code numComponents - 1}
      * @since 1.4
      */
     public float getMinValue(int component) {
@@ -584,15 +570,14 @@
     }
 
     /**
-     * Returns the maximum normalized color component value for the
-     * specified component.  The default implementation in this abstract
-     * class returns 1.0 for all components.  Subclasses should override
-     * this method if necessary.
+     * Returns the maximum normalized color component value for the specified
+     * component. The default implementation in this abstract class returns 1.0
+     * for all components. Subclasses should override this method if necessary.
      *
-     * @param component the component index
+     * @param  component the component index
      * @return the maximum normalized component value
-     * @throws IllegalArgumentException if component is less than 0 or
-     *         greater than numComponents - 1
+     * @throws IllegalArgumentException if component is less than 0 or greater
+     *         than {@code numComponents - 1}
      * @since 1.4
      */
     public float getMaxValue(int component) {
@@ -603,7 +588,8 @@
         return 1.0f;
     }
 
-    /* Returns true if cspace is the XYZspace.
+    /*
+     * Returns {@code true} if {@code cspace} is the XYZspace.
      */
     static boolean isCS_CIEXYZ(ColorSpace cspace) {
         return (cspace == XYZspace);
--- a/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java	Mon Nov 12 11:10:16 2018 +0530
@@ -23,8 +23,7 @@
  * questions.
  */
 
-/*
- **********************************************************************
+/* ********************************************************************
  **********************************************************************
  **********************************************************************
  *** COPYRIGHT (c) Eastman Kodak Company, 1997                      ***
@@ -36,54 +35,46 @@
 
 package java.awt.color;
 
+import sun.java2d.cmm.CMSManager;
 import sun.java2d.cmm.ColorTransform;
-import sun.java2d.cmm.CMSManager;
 import sun.java2d.cmm.PCMM;
 
-
 /**
- *
- * The ICC_ColorSpace class is an implementation of the abstract
- * ColorSpace class.  This representation of
- * device independent and device dependent color spaces is based on the
- * International Color Consortium Specification ICC.1:2001-12, File Format for
- * Color Profiles (see <A href="http://www.color.org">http://www.color.org</A>).
+ * The {@code ICC_ColorSpace} class is an implementation of the abstract
+ * {@code ColorSpace} class. This representation of device independent and
+ * device dependent color spaces is based on the International Color Consortium
+ * Specification ICC.1:2001-12, File Format for Color Profiles (see
+ * <a href="http://www.color.org">http://www.color.org</a>).
  * <p>
- * Typically, a Color or ColorModel would be associated with an ICC
- * Profile which is either an input, display, or output profile (see
- * the ICC specification).  There are other types of ICC Profiles, e.g.
- * abstract profiles, device link profiles, and named color profiles,
- * which do not contain information appropriate for representing the color
- * space of a color, image, or device (see ICC_Profile).
- * Attempting to create an ICC_ColorSpace object from an inappropriate ICC
- * Profile is an error.
+ * Typically, a {@code Color} or {@code ColorModel} would be associated with an
+ * ICC Profile which is either an input, display, or output profile (see the ICC
+ * specification). There are other types of ICC Profiles, e.g. abstract
+ * profiles, device link profiles, and named color profiles, which do not
+ * contain information appropriate for representing the color space of a color,
+ * image, or device (see {@code ICC_Profile}). Attempting to create an
+ * {@code ICC_ColorSpace} object from an inappropriate ICC Profile is an error.
  * <p>
- * ICC Profiles represent transformations from the color space of
- * the profile (e.g. a monitor) to a Profile Connection Space (PCS).
- * Profiles of interest for tagging images or colors have a
- * PCS which is one of the device independent
- * spaces (one CIEXYZ space and two CIELab spaces) defined in the
- * ICC Profile Format Specification.  Most profiles of interest
- * either have invertible transformations or explicitly specify
- * transformations going both directions.  Should an ICC_ColorSpace
- * object be used in a way requiring a conversion from PCS to
- * the profile's native space and there is inadequate data to
- * correctly perform the conversion, the ICC_ColorSpace object will
- * produce output in the specified type of color space (e.g. TYPE_RGB,
- * TYPE_CMYK, etc.), but the specific color values of the output data
- * will be undefined.
+ * ICC Profiles represent transformations from the color space of the profile
+ * (e.g. a monitor) to a Profile Connection Space (PCS). Profiles of interest
+ * for tagging images or colors have a PCS which is one of the device
+ * independent spaces (one CIEXYZ space and two CIELab spaces) defined in the
+ * ICC Profile Format Specification. Most profiles of interest either have
+ * invertible transformations or explicitly specify transformations going both
+ * directions. Should an {@code ICC_ColorSpace} object be used in a way
+ * requiring a conversion from PCS to the profile's native space and there is
+ * inadequate data to correctly perform the conversion, the
+ * {@code ICC_ColorSpace} object will produce output in the specified type of
+ * color space (e.g. {@code TYPE_RGB}, {@code TYPE_CMYK}, etc.), but the
+ * specific color values of the output data will be undefined.
  * <p>
- * The details of this class are not important for simple applets,
- * which draw in a default color space or manipulate and display
- * imported images with a known color space.  At most, such applets
- * would need to get one of the default color spaces via
- * ColorSpace.getInstance().
+ * The details of this class are not important for simple applets, which draw in
+ * a default color space or manipulate and display imported images with a known
+ * color space. At most, such applets would need to get one of the default color
+ * spaces via {@link ColorSpace#getInstance}.
+ *
  * @see ColorSpace
  * @see ICC_Profile
  */
-
-
-
 public class ICC_ColorSpace extends ColorSpace {
 
     static final long serialVersionUID = 3455889114070431483L;
@@ -101,13 +92,14 @@
     private transient ColorTransform this2xyz;
     private transient ColorTransform xyz2this;
 
-
     /**
-    * Constructs a new ICC_ColorSpace from an ICC_Profile object.
-    * @param profile the specified ICC_Profile object
-    * @exception IllegalArgumentException if profile is inappropriate for
-    *            representing a ColorSpace.
-    */
+     * Constructs a new {@code ICC_ColorSpace} from an {@code ICC_Profile}
+     * object.
+     *
+     * @param  profile the specified {@code ICC_Profile} object
+     * @throws IllegalArgumentException if profile is inappropriate for
+     *         representing a {@code ColorSpace}
+     */
     public ICC_ColorSpace (ICC_Profile profile) {
         super (profile.getColorSpaceType(), profile.getNumComponents());
 
@@ -140,33 +132,33 @@
     }
 
     /**
-    * Returns the ICC_Profile for this ICC_ColorSpace.
-    * @return the ICC_Profile for this ICC_ColorSpace.
-    */
+     * Returns the {@code ICC_Profile} for this {@code ICC_ColorSpace}.
+     *
+     * @return the {@code ICC_Profile} for this {@code ICC_ColorSpace}
+     */
     public ICC_Profile getProfile() {
         return thisProfile;
     }
 
     /**
-     * Transforms a color value assumed to be in this ColorSpace
-     * into a value in the default CS_sRGB color space.
+     * Transforms a color value assumed to be in this {@code ColorSpace} into a
+     * value in the default {@code CS_sRGB} color space.
      * <p>
-     * This method transforms color values using algorithms designed
-     * to produce the best perceptual match between input and output
-     * colors.  In order to do colorimetric conversion of color values,
-     * you should use the {@code toCIEXYZ}
-     * method of this color space to first convert from the input
-     * color space to the CS_CIEXYZ color space, and then use the
-     * {@code fromCIEXYZ} method of the CS_sRGB color space to
-     * convert from CS_CIEXYZ to the output color space.
-     * See {@link #toCIEXYZ(float[]) toCIEXYZ} and
+     * This method transforms color values using algorithms designed to produce
+     * the best perceptual match between input and output colors. In order to do
+     * colorimetric conversion of color values, you should use the
+     * {@code toCIEXYZ} method of this color space to first convert from the
+     * input color space to the {@code CS_CIEXYZ} color space, and then use the
+     * {@code fromCIEXYZ} method of the {@code CS_sRGB} color space to convert
+     * from {@code CS_CIEXYZ} to the output color space. See
+     * {@link #toCIEXYZ(float[]) toCIEXYZ} and
      * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information.
      *
-     * @param colorvalue a float array with length of at least the number
-     *      of components in this ColorSpace.
-     * @return a float array of length 3.
-     * @throws ArrayIndexOutOfBoundsException if array length is not
-     * at least the number of components in this ColorSpace.
+     * @param  colorvalue a float array with length of at least the number of
+     *         components in this {@code ColorSpace}
+     * @return a float array of length 3
+     * @throws ArrayIndexOutOfBoundsException if array length is not at least
+     *         the number of components in this {@code ColorSpace}
      */
     public float[]    toRGB (float[] colorvalue) {
 
@@ -200,25 +192,23 @@
     }
 
     /**
-     * Transforms a color value assumed to be in the default CS_sRGB
-     * color space into this ColorSpace.
+     * Transforms a color value assumed to be in the default {@code CS_sRGB}
+     * color space into this {@code ColorSpace}.
      * <p>
-     * This method transforms color values using algorithms designed
-     * to produce the best perceptual match between input and output
-     * colors.  In order to do colorimetric conversion of color values,
-     * you should use the {@code toCIEXYZ}
-     * method of the CS_sRGB color space to first convert from the input
-     * color space to the CS_CIEXYZ color space, and then use the
-     * {@code fromCIEXYZ} method of this color space to
-     * convert from CS_CIEXYZ to the output color space.
-     * See {@link #toCIEXYZ(float[]) toCIEXYZ} and
+     * This method transforms color values using algorithms designed to produce
+     * the best perceptual match between input and output colors. In order to do
+     * colorimetric conversion of color values, you should use the
+     * {@code toCIEXYZ} method of the {@code CS_sRGB} color space to first
+     * convert from the input color space to the {@code CS_CIEXYZ} color space,
+     * and then use the {@code fromCIEXYZ} method of this color space to convert
+     * from {@code CS_CIEXYZ} to the output color space. See
+     * {@link #toCIEXYZ(float[]) toCIEXYZ} and
      * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information.
      *
-     * @param rgbvalue a float array with length of at least 3.
-     * @return a float array with length equal to the number of
-     *       components in this ColorSpace.
-     * @throws ArrayIndexOutOfBoundsException if array length is not
-     * at least 3.
+     * @param  rgbvalue a float array with length of at least 3
+     * @return a float array with length equal to the number of components in
+     *         this {@code ColorSpace}
+     * @throws ArrayIndexOutOfBoundsException if array length is not at least 3
      */
     public float[]    fromRGB(float[] rgbvalue) {
 
@@ -251,70 +241,66 @@
         return result;
     }
 
-
     /**
-     * Transforms a color value assumed to be in this ColorSpace
-     * into the CS_CIEXYZ conversion color space.
+     * Transforms a color value assumed to be in this {@code ColorSpace} into
+     * the {@code CS_CIEXYZ} conversion color space.
      * <p>
-     * This method transforms color values using relative colorimetry,
-     * as defined by the ICC Specification.  This
-     * means that the XYZ values returned by this method are represented
-     * relative to the D50 white point of the CS_CIEXYZ color space.
-     * This representation is useful in a two-step color conversion
-     * process in which colors are transformed from an input color
-     * space to CS_CIEXYZ and then to an output color space.  This
-     * representation is not the same as the XYZ values that would
-     * be measured from the given color value by a colorimeter.
-     * A further transformation is necessary to compute the XYZ values
-     * that would be measured using current CIE recommended practices.
-     * The paragraphs below explain this in more detail.
+     * This method transforms color values using relative colorimetry, as
+     * defined by the ICC Specification. This means that the XYZ values returned
+     * by this method are represented relative to the D50 white point of the
+     * {@code CS_CIEXYZ} color space. This representation is useful in a
+     * two-step color conversion process in which colors are transformed from an
+     * input color space to {@code CS_CIEXYZ} and then to an output color space.
+     * This representation is not the same as the XYZ values that would be
+     * measured from the given color value by a colorimeter. A further
+     * transformation is necessary to compute the XYZ values that would be
+     * measured using current CIE recommended practices. The paragraphs below
+     * explain this in more detail.
      * <p>
      * The ICC standard uses a device independent color space (DICS) as the
-     * mechanism for converting color from one device to another device.  In
-     * this architecture, colors are converted from the source device's color
-     * space to the ICC DICS and then from the ICC DICS to the destination
-     * device's color space.  The ICC standard defines device profiles which
-     * contain transforms which will convert between a device's color space
-     * and the ICC DICS.  The overall conversion of colors from a source
-     * device to colors of a destination device is done by connecting the
-     * device-to-DICS transform of the profile for the source device to the
-     * DICS-to-device transform of the profile for the destination device.
-     * For this reason, the ICC DICS is commonly referred to as the profile
-     * connection space (PCS).  The color space used in the methods
-     * toCIEXYZ and fromCIEXYZ is the CIEXYZ PCS defined by the ICC
-     * Specification.  This is also the color space represented by
-     * ColorSpace.CS_CIEXYZ.
+     * mechanism for converting color from one device to another device. In this
+     * architecture, colors are converted from the source device's color space
+     * to the ICC DICS and then from the ICC DICS to the destination device's
+     * color space. The ICC standard defines device profiles which contain
+     * transforms which will convert between a device's color space and the ICC
+     * DICS. The overall conversion of colors from a source device to colors of
+     * a destination device is done by connecting the device-to-DICS transform
+     * of the profile for the source device to the DICS-to-device transform of
+     * the profile for the destination device. For this reason, the ICC DICS is
+     * commonly referred to as the profile connection space (PCS). The color
+     * space used in the methods {@code toCIEXYZ} and {@code fromCIEXYZ} is the
+     * CIEXYZ PCS defined by the ICC Specification. This is also the color space
+     * represented by {@code ColorSpace.CS_CIEXYZ}.
      * <p>
-     * The XYZ values of a color are often represented as relative to some
-     * white point, so the actual meaning of the XYZ values cannot be known
-     * without knowing the white point of those values.  This is known as
-     * relative colorimetry.  The PCS uses a white point of D50, so the XYZ
-     * values of the PCS are relative to D50.  For example, white in the PCS
-     * will have the XYZ values of D50, which is defined to be X=.9642,
-     * Y=1.000, and Z=0.8249.  This white point is commonly used for graphic
-     * arts applications, but others are often used in other applications.
+     * The XYZ values of a color are often represented as relative to some white
+     * point, so the actual meaning of the XYZ values cannot be known without
+     * knowing the white point of those values. This is known as relative
+     * colorimetry. The PCS uses a white point of D50, so the XYZ values of the
+     * PCS are relative to D50. For example, white in the PCS will have the XYZ
+     * values of D50, which is defined to be X=.9642, Y=1.000, and Z=0.8249.
+     * This white point is commonly used for graphic arts applications, but
+     * others are often used in other applications.
      * <p>
-     * To quantify the color characteristics of a device such as a printer
-     * or monitor, measurements of XYZ values for particular device colors
-     * are typically made.  For purposes of this discussion, the term
-     * device XYZ values is used to mean the XYZ values that would be
-     * measured from device colors using current CIE recommended practices.
+     * To quantify the color characteristics of a device such as a printer or
+     * monitor, measurements of XYZ values for particular device colors are
+     * typically made. For purposes of this discussion, the term device XYZ
+     * values is used to mean the XYZ values that would be measured from device
+     * colors using current CIE recommended practices.
      * <p>
-     * Converting between device XYZ values and the PCS XYZ values returned
-     * by this method corresponds to converting between the device's color
-     * space, as represented by CIE colorimetric values, and the PCS.  There
-     * are many factors involved in this process, some of which are quite
-     * subtle.  The most important, however, is the adjustment made to account
-     * for differences between the device's white point and the white point of
-     * the PCS.  There are many techniques for doing this and it is the
-     * subject of much current research and controversy.  Some commonly used
-     * methods are XYZ scaling, the von Kries transform, and the Bradford
-     * transform.  The proper method to use depends upon each particular
-     * application.
+     * Converting between device XYZ values and the PCS XYZ values returned by
+     * this method corresponds to converting between the device's color space,
+     * as represented by CIE colorimetric values, and the PCS. There are many
+     * factors involved in this process, some of which are quite subtle. The
+     * most important, however, is the adjustment made to account for
+     * differences between the device's white point and the white point of the
+     * PCS. There are many techniques for doing this and it is the subject of
+     * much current research and controversy. Some commonly used methods are XYZ
+     * scaling, the von Kries transform, and the Bradford transform. The proper
+     * method to use depends upon each particular application.
      * <p>
-     * The simplest method is XYZ scaling.  In this method each device XYZ
-     * value is  converted to a PCS XYZ value by multiplying it by the ratio
-     * of the PCS white point (D50) to the device white point.
+     * The simplest method is XYZ scaling. In this method each device XYZ value
+     * is converted to a PCS XYZ value by multiplying it by the ratio of the PCS
+     * white point (D50) to the device white point.
      * <pre>
      *
      * Xd, Yd, Zd are the device XYZ values
@@ -338,22 +324,21 @@
      *
      * </pre>
      * <p>
-     * Note that the media white point tag in an ICC profile is not the same
-     * as the device white point.  The media white point tag is expressed in
-     * PCS values and is used to represent the difference between the XYZ of
-     * device illuminant and the XYZ of the device media when measured under
-     * that illuminant.  The device white point is expressed as the device
-     * XYZ values corresponding to white displayed on the device.  For
-     * example, displaying the RGB color (1.0, 1.0, 1.0) on an sRGB device
-     * will result in a measured device XYZ value of D65.  This will not
-     * be the same as the media white point tag XYZ value in the ICC
-     * profile for an sRGB device.
+     * Note that the media white point tag in an ICC profile is not the same as
+     * the device white point. The media white point tag is expressed in PCS
+     * values and is used to represent the difference between the XYZ of device
+     * illuminant and the XYZ of the device media when measured under that
+     * illuminant. The device white point is expressed as the device XYZ values
+     * corresponding to white displayed on the device. For example, displaying
+     * the RGB color (1.0, 1.0, 1.0) on an sRGB device will result in a measured
+     * device XYZ value of D65. This will not be the same as the media white
+     * point tag XYZ value in the ICC profile for an sRGB device.
      *
-     * @param colorvalue a float array with length of at least the number
-     *        of components in this ColorSpace.
-     * @return a float array of length 3.
-     * @throws ArrayIndexOutOfBoundsException if array length is not
-     * at least the number of components in this ColorSpace.
+     * @param  colorvalue a float array with length of at least the number of
+     *         components in this {@code ColorSpace}
+     * @return a float array of length 3
+     * @throws ArrayIndexOutOfBoundsException if array length is not at least
+     *         the number of components in this {@code ColorSpace}
      */
     public float[]    toCIEXYZ(float[] colorvalue) {
 
@@ -394,71 +379,67 @@
         return result;
     }
 
-
     /**
-     * Transforms a color value assumed to be in the CS_CIEXYZ conversion
-     * color space into this ColorSpace.
+     * Transforms a color value assumed to be in the {@code CS_CIEXYZ}
+     * conversion color space into this ColorSpace.
      * <p>
-     * This method transforms color values using relative colorimetry,
-     * as defined by the ICC Specification.  This
-     * means that the XYZ argument values taken by this method are represented
-     * relative to the D50 white point of the CS_CIEXYZ color space.
-     * This representation is useful in a two-step color conversion
-     * process in which colors are transformed from an input color
-     * space to CS_CIEXYZ and then to an output color space.  The color
-     * values returned by this method are not those that would produce
-     * the XYZ value passed to the method when measured by a colorimeter.
-     * If you have XYZ values corresponding to measurements made using
-     * current CIE recommended practices, they must be converted to D50
-     * relative values before being passed to this method.
-     * The paragraphs below explain this in more detail.
+     * This method transforms color values using relative colorimetry, as
+     * defined by the ICC Specification. This means that the XYZ argument values
+     * taken by this method are represented relative to the D50 white point of
+     * the {@code CS_CIEXYZ} color space. This representation is useful in a
+     * two-step color conversion process in which colors are transformed from an
+     * input color space to {@code CS_CIEXYZ} and then to an output color space.
+     * The color values returned by this method are not those that would produce
+     * the XYZ value passed to the method when measured by a colorimeter. If you
+     * have XYZ values corresponding to measurements made using current CIE
+     * recommended practices, they must be converted to D50 relative values
+     * before being passed to this method. The paragraphs below explain this in
+     * more detail.
      * <p>
      * The ICC standard uses a device independent color space (DICS) as the
-     * mechanism for converting color from one device to another device.  In
-     * this architecture, colors are converted from the source device's color
-     * space to the ICC DICS and then from the ICC DICS to the destination
-     * device's color space.  The ICC standard defines device profiles which
-     * contain transforms which will convert between a device's color space
-     * and the ICC DICS.  The overall conversion of colors from a source
-     * device to colors of a destination device is done by connecting the
-     * device-to-DICS transform of the profile for the source device to the
-     * DICS-to-device transform of the profile for the destination device.
-     * For this reason, the ICC DICS is commonly referred to as the profile
-     * connection space (PCS).  The color space used in the methods
-     * toCIEXYZ and fromCIEXYZ is the CIEXYZ PCS defined by the ICC
-     * Specification.  This is also the color space represented by
-     * ColorSpace.CS_CIEXYZ.
+     * mechanism for converting color from one device to another device. In this
+     * architecture, colors are converted from the source device's color space
+     * to the ICC DICS and then from the ICC DICS to the destination device's
+     * color space. The ICC standard defines device profiles which contain
+     * transforms which will convert between a device's color space and the ICC
+     * DICS. The overall conversion of colors from a source device to colors of
+     * a destination device is done by connecting the device-to-DICS transform
+     * of the profile for the source device to the DICS-to-device transform of
+     * the profile for the destination device. For this reason, the ICC DICS is
+     * commonly referred to as the profile connection space (PCS). The color
+     * space used in the methods {@code toCIEXYZ} and {@code fromCIEXYZ} is the
+     * CIEXYZ PCS defined by the ICC Specification. This is also the color space
+     * represented by {@code ColorSpace.CS_CIEXYZ}.
      * <p>
-     * The XYZ values of a color are often represented as relative to some
-     * white point, so the actual meaning of the XYZ values cannot be known
-     * without knowing the white point of those values.  This is known as
-     * relative colorimetry.  The PCS uses a white point of D50, so the XYZ
-     * values of the PCS are relative to D50.  For example, white in the PCS
-     * will have the XYZ values of D50, which is defined to be X=.9642,
-     * Y=1.000, and Z=0.8249.  This white point is commonly used for graphic
-     * arts applications, but others are often used in other applications.
+     * The XYZ values of a color are often represented as relative to some white
+     * point, so the actual meaning of the XYZ values cannot be known without
+     * knowing the white point of those values. This is known as relative
+     * colorimetry. The PCS uses a white point of D50, so the XYZ values of the
+     * PCS are relative to D50. For example, white in the PCS will have the XYZ
+     * values of D50, which is defined to be X=.9642, Y=1.000, and Z=0.8249.
+     * This white point is commonly used for graphic arts applications, but
+     * others are often used in other applications.
      * <p>
-     * To quantify the color characteristics of a device such as a printer
-     * or monitor, measurements of XYZ values for particular device colors
-     * are typically made.  For purposes of this discussion, the term
-     * device XYZ values is used to mean the XYZ values that would be
-     * measured from device colors using current CIE recommended practices.
+     * To quantify the color characteristics of a device such as a printer or
+     * monitor, measurements of XYZ values for particular device colors are
+     * typically made. For purposes of this discussion, the term device XYZ
+     * values is used to mean the XYZ values that would be measured from device
+     * colors using current CIE recommended practices.
      * <p>
      * Converting between device XYZ values and the PCS XYZ values taken as
      * arguments by this method corresponds to converting between the device's
      * color space, as represented by CIE colorimetric values, and the PCS.
      * There are many factors involved in this process, some of which are quite
-     * subtle.  The most important, however, is the adjustment made to account
+     * subtle. The most important, however, is the adjustment made to account
      * for differences between the device's white point and the white point of
-     * the PCS.  There are many techniques for doing this and it is the
-     * subject of much current research and controversy.  Some commonly used
-     * methods are XYZ scaling, the von Kries transform, and the Bradford
-     * transform.  The proper method to use depends upon each particular
-     * application.
+     * the PCS. There are many techniques for doing this and it is the subject
+     * of much current research and controversy. Some commonly used methods are
+     * XYZ scaling, the von Kries transform, and the Bradford transform. The
+     * proper method to use depends upon each particular application.
      * <p>
-     * The simplest method is XYZ scaling.  In this method each device XYZ
-     * value is  converted to a PCS XYZ value by multiplying it by the ratio
-     * of the PCS white point (D50) to the device white point.
+     * The simplest method is XYZ scaling. In this method each device XYZ value
+     * is converted to a PCS XYZ value by multiplying it by the ratio of the PCS
+     * white point (D50) to the device white point.
      * <pre>
      *
      * Xd, Yd, Zd are the device XYZ values
@@ -482,22 +463,20 @@
      *
      * </pre>
      * <p>
-     * Note that the media white point tag in an ICC profile is not the same
-     * as the device white point.  The media white point tag is expressed in
-     * PCS values and is used to represent the difference between the XYZ of
-     * device illuminant and the XYZ of the device media when measured under
-     * that illuminant.  The device white point is expressed as the device
-     * XYZ values corresponding to white displayed on the device.  For
-     * example, displaying the RGB color (1.0, 1.0, 1.0) on an sRGB device
-     * will result in a measured device XYZ value of D65.  This will not
-     * be the same as the media white point tag XYZ value in the ICC
-     * profile for an sRGB device.
+     * Note that the media white point tag in an ICC profile is not the same as
+     * the device white point. The media white point tag is expressed in PCS
+     * values and is used to represent the difference between the XYZ of device
+     * illuminant and the XYZ of the device media when measured under that
+     * illuminant. The device white point is expressed as the device XYZ values
+     * corresponding to white displayed on the device. For example, displaying
+     * the RGB color (1.0, 1.0, 1.0) on an sRGB device will result in a measured
+     * device XYZ value of D65. This will not be the same as the media white
+     * point tag XYZ value in the ICC profile for an sRGB device.
      *
-     * @param colorvalue a float array with length of at least 3.
-     * @return a float array with length equal to the number of
-     *         components in this ColorSpace.
-     * @throws ArrayIndexOutOfBoundsException if array length is not
-     * at least 3.
+     * @param  colorvalue a float array with length of at least 3
+     * @return a float array with length equal to the number of components in
+     *         this {@code ColorSpace}
+     * @throws ArrayIndexOutOfBoundsException if array length is not at least 3
      */
     public float[]    fromCIEXYZ(float[] colorvalue) {
 
@@ -540,19 +519,20 @@
     }
 
     /**
-     * Returns the minimum normalized color component value for the
-     * specified component.  For TYPE_XYZ spaces, this method returns
-     * minimum values of 0.0 for all components.  For TYPE_Lab spaces,
-     * this method returns 0.0 for L and -128.0 for a and b components.
-     * This is consistent with the encoding of the XYZ and Lab Profile
-     * Connection Spaces in the ICC specification.  For all other types, this
-     * method returns 0.0 for all components.  When using an ICC_ColorSpace
-     * with a profile that requires different minimum component values,
-     * it is necessary to subclass this class and override this method.
-     * @param component The component index.
-     * @return The minimum normalized component value.
-     * @throws IllegalArgumentException if component is less than 0 or
-     *         greater than numComponents - 1.
+     * Returns the minimum normalized color component value for the specified
+     * component. For {@code TYPE_XYZ} spaces, this method returns minimum
+     * values of 0.0 for all components. For {@code TYPE_Lab} spaces, this
+     * method returns 0.0 for L and -128.0 for a and b components. This is
+     * consistent with the encoding of the XYZ and Lab Profile Connection Spaces
+     * in the ICC specification. For all other types, this method returns 0.0
+     * for all components. When using an {@code ICC_ColorSpace} with a profile
+     * that requires different minimum component values, it is necessary to
+     * subclass this class and override this method.
+     *
+     * @param  component the component index
+     * @return the minimum normalized component value
+     * @throws IllegalArgumentException if component is less than 0 or greater
+     *         than {@code numComponents - 1}
      * @since 1.4
      */
     public float getMinValue(int component) {
@@ -564,20 +544,21 @@
     }
 
     /**
-     * Returns the maximum normalized color component value for the
-     * specified component.  For TYPE_XYZ spaces, this method returns
-     * maximum values of 1.0 + (32767.0 / 32768.0) for all components.
-     * For TYPE_Lab spaces,
-     * this method returns 100.0 for L and 127.0 for a and b components.
-     * This is consistent with the encoding of the XYZ and Lab Profile
-     * Connection Spaces in the ICC specification.  For all other types, this
-     * method returns 1.0 for all components.  When using an ICC_ColorSpace
-     * with a profile that requires different maximum component values,
-     * it is necessary to subclass this class and override this method.
-     * @param component The component index.
-     * @return The maximum normalized component value.
-     * @throws IllegalArgumentException if component is less than 0 or
-     *         greater than numComponents - 1.
+     * Returns the maximum normalized color component value for the specified
+     * component. For {@code TYPE_XYZ} spaces, this method returns maximum
+     * values of 1.0 + (32767.0 / 32768.0) for all components. For
+     * {@code TYPE_Lab} spaces, this method returns 100.0 for L and 127.0 for a
+     * and b components. This is consistent with the encoding of the XYZ and Lab
+     * Profile Connection Spaces in the ICC specification. For all other types,
+     * this method returns 1.0 for all components. When using an
+     * {@code ICC_ColorSpace} with a profile that requires different maximum
+     * component values, it is necessary to subclass this class and override
+     * this method.
+     *
+     * @param  component the component index
+     * @return the maximum normalized component value
+     * @throws IllegalArgumentException if component is less than 0 or greater
+     *         than {@code numComponents - 1}
      * @since 1.4
      */
     public float getMaxValue(int component) {
--- a/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java	Mon Nov 12 11:10:16 2018 +0530
@@ -23,8 +23,7 @@
  * questions.
  */
 
-/*
- **********************************************************************
+/* ********************************************************************
  **********************************************************************
  **********************************************************************
  *** COPYRIGHT (c) Eastman Kodak Company, 1997                      ***
@@ -36,17 +35,8 @@
 
 package java.awt.color;
 
-import sun.java2d.cmm.PCMM;
-import sun.java2d.cmm.CMSManager;
-import sun.java2d.cmm.Profile;
-import sun.java2d.cmm.ProfileDataVerifier;
-import sun.java2d.cmm.ProfileDeferralMgr;
-import sun.java2d.cmm.ProfileDeferralInfo;
-import sun.java2d.cmm.ProfileActivator;
-
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.FilePermission;
 import java.io.IOException;
@@ -56,42 +46,43 @@
 import java.io.ObjectStreamException;
 import java.io.OutputStream;
 import java.io.Serializable;
-
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.StringTokenizer;
 
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
+import sun.java2d.cmm.CMSManager;
+import sun.java2d.cmm.PCMM;
+import sun.java2d.cmm.Profile;
+import sun.java2d.cmm.ProfileActivator;
+import sun.java2d.cmm.ProfileDataVerifier;
+import sun.java2d.cmm.ProfileDeferralInfo;
+import sun.java2d.cmm.ProfileDeferralMgr;
 
 /**
- * A representation of color profile data for device independent and
- * device dependent color spaces based on the International Color
- * Consortium Specification ICC.1:2001-12, File Format for Color Profiles,
- * (see <A href="http://www.color.org"> http://www.color.org</A>).
+ * A representation of color profile data for device independent and device
+ * dependent color spaces based on the International Color Consortium
+ * Specification ICC.1:2001-12, File Format for Color Profiles, (see
+ * <a href="http://www.color.org"> http://www.color.org</a>).
  * <p>
- * An ICC_ColorSpace object can be constructed from an appropriate
- * ICC_Profile.
- * Typically, an ICC_ColorSpace would be associated with an ICC
- * Profile which is either an input, display, or output profile (see
- * the ICC specification).  There are also device link, abstract,
- * color space conversion, and named color profiles.  These are less
- * useful for tagging a color or image, but are useful for other
- * purposes (in particular device link profiles can provide improved
- * performance for converting from one device's color space to
- * another's).
+ * An {@code ICC_ColorSpace} object can be constructed from an appropriate
+ * {@code ICC_Profile}. Typically, an {@code ICC_ColorSpace} would be associated
+ * with an ICC Profile which is either an input, display, or output profile (see
+ * the ICC specification). There are also device link, abstract, color space
+ * conversion, and named color profiles. These are less useful for tagging a
+ * color or image, but are useful for other purposes (in particular device link
+ * profiles can provide improved performance for converting from one device's
+ * color space to another's).
  * <p>
- * ICC Profiles represent transformations from the color space of
- * the profile (e.g. a monitor) to a Profile Connection Space (PCS).
- * Profiles of interest for tagging images or colors have a PCS
- * which is one of the two specific device independent
- * spaces (one CIEXYZ space and one CIELab space) defined in the
- * ICC Profile Format Specification.  Most profiles of interest
- * either have invertible transformations or explicitly specify
- * transformations going both directions.
+ * ICC Profiles represent transformations from the color space of the profile
+ * (e.g. a monitor) to a Profile Connection Space (PCS). Profiles of interest
+ * for tagging images or colors have a PCS which is one of the two specific
+ * device independent spaces (one CIEXYZ space and one CIELab space) defined in
+ * the ICC Profile Format Specification. Most profiles of interest either have
+ * invertible transformations or explicitly specify transformations going both
+ * directions.
+ *
  * @see ICC_ColorSpace
  */
-
-
 public class ICC_Profile implements Serializable {
 
     private static final long serialVersionUID = -3938515861990936766L;
@@ -110,7 +101,6 @@
     private static ICC_Profile GRAYprofile;
     private static ICC_Profile LINEAR_RGBprofile;
 
-
     /**
      * Profile class is input.
      */
@@ -146,7 +136,6 @@
      */
     public static final int CLASS_NAMEDCOLOR = 6;
 
-
     /**
      * ICC Profile Color Space Type Signature: 'XYZ '.
      */
@@ -321,6 +310,7 @@
 
     /**
      * ICC Profile Rendering Intent: Media-RelativeColorimetric.
+     *
      * @since 1.5
      */
     public static final int icMediaRelativeColorimetric = 1;
@@ -337,6 +327,7 @@
 
     /**
      * ICC Profile Rendering Intent: ICC-AbsoluteColorimetric.
+     *
      * @since 1.5
      */
     public static final int icICCAbsoluteColorimetric = 3;
@@ -369,6 +360,7 @@
 
     /**
      * ICC Profile Tag Signature: 'bXYZ'.
+     *
      * @since 1.5
      */
     public static final int icSigBlueMatrixColumnTag = 0x6258595A; /* 'bXYZ' */
@@ -446,6 +438,7 @@
 
     /**
      * ICC Profile Tag Signature: 'gXYZ'.
+     *
      * @since 1.5
      */
     public static final int icSigGreenMatrixColumnTag = 0x6758595A;/* 'gXYZ' */
@@ -550,6 +543,7 @@
 
     /**
      * ICC Profile Tag Signature: 'rXYZ'.
+     *
      * @since 1.5
      */
     public static final int icSigRedMatrixColumnTag = 0x7258595A;  /* 'rXYZ' */
@@ -596,18 +590,21 @@
 
     /**
      * ICC Profile Tag Signature: 'chad'.
+     *
      * @since 1.5
      */
     public static final int icSigChromaticAdaptationTag = 0x63686164;/* 'chad' */
 
     /**
      * ICC Profile Tag Signature: 'clro'.
+     *
      * @since 1.5
      */
     public static final int icSigColorantOrderTag = 0x636C726F;    /* 'clro' */
 
     /**
      * ICC Profile Tag Signature: 'clrt'.
+     *
      * @since 1.5
      */
     public static final int icSigColorantTableTag = 0x636C7274;    /* 'clrt' */
@@ -695,6 +692,7 @@
 
     /**
      * ICC Profile Header Location: profile's ID.
+     *
      * @since 1.5
      */
     public static final int icHdrProfileID = 84; /* Profile's ID */
@@ -727,15 +725,14 @@
 
 
     /**
-     * Constructs an ICC_Profile object with a given ID.
+     * Constructs an {@code ICC_Profile} object with a given ID.
      */
     ICC_Profile(Profile p) {
         this.cmmProfile = p;
     }
 
-
     /**
-     * Constructs an ICC_Profile object whose loading will be deferred.
+     * Constructs an {@code ICC_Profile} object whose loading will be deferred.
      * The ID will be 0 until the profile is loaded.
      */
     ICC_Profile(ProfileDeferralInfo pdi) {
@@ -748,18 +745,18 @@
         ProfileDeferralMgr.registerDeferral(this.profileActivator);
     }
 
-
     /**
-     * Frees the resources associated with an ICC_Profile object.
+     * Frees the resources associated with an {@code ICC_Profile} object.
      *
-     * @deprecated The {@code finalize} method has been deprecated.
-     *     Subclasses that override {@code finalize} in order to perform cleanup
-     *     should be modified to use alternative cleanup mechanisms and
-     *     to remove the overriding {@code finalize} method.
-     *     When overriding the {@code finalize} method, its implementation must explicitly
-     *     ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}.
-     *     See the specification for {@link Object#finalize()} for further
-     *     information about migration options.
+     * @deprecated The {@code finalize} method has been deprecated. Subclasses
+     *         that override {@code finalize} in order to perform cleanup should
+     *         be modified to use alternative cleanup mechanisms and to remove
+     *         the overriding {@code finalize} method. When overriding the
+     *         {@code finalize} method, its implementation must explicitly
+     *         ensure that {@code super.finalize()} is invoked as described in
+     *         {@link Object#finalize}. See the specification for {@link
+     *         Object#finalize()} for further information about migration
+     *         options.
      */
     @Deprecated(since="9")
     protected void finalize () {
@@ -770,14 +767,14 @@
         }
     }
 
-
     /**
-     * Constructs an ICC_Profile object corresponding to the data in
-     * a byte array.  Throws an IllegalArgumentException if the data
-     * does not correspond to a valid ICC Profile.
-     * @param data the specified ICC Profile data
-     * @return an {@code ICC_Profile} object corresponding to
-     *          the data in the specified {@code data} array.
+     * Constructs an {@code ICC_Profile} object corresponding to the data in a
+     * byte array. Throws an {@code IllegalArgumentException} if the data does
+     * not correspond to a valid ICC Profile.
+     *
+     * @param  data the specified ICC Profile data
+     * @return an {@code ICC_Profile} object corresponding to the data in the
+     *         specified {@code data} array
      */
     public static ICC_Profile getInstance(byte[] data) {
     ICC_Profile thisProfile;
@@ -821,22 +818,19 @@
         return thisProfile;
     }
 
-
-
     /**
-     * Constructs an ICC_Profile corresponding to one of the specific color
-     * spaces defined by the ColorSpace class (for example CS_sRGB).
-     * Throws an IllegalArgumentException if cspace is not one of the
-     * defined color spaces.
+     * Constructs an {@code ICC_Profile} corresponding to one of the specific
+     * color spaces defined by the {@code ColorSpace} class (for example
+     * {@code CS_sRGB}). Throws an {@code IllegalArgumentException} if cspace is
+     * not one of the defined color spaces.
      *
-     * @param cspace the type of color space to create a profile for.
-     * The specified type is one of the color
-     * space constants defined in the  {@code ColorSpace} class.
-     *
-     * @return an {@code ICC_Profile} object corresponding to
-     *          the specified {@code ColorSpace} type.
-     * @exception IllegalArgumentException If {@code cspace} is not
-     * one of the predefined color space types.
+     * @param  cspace the type of color space to create a profile for. The
+     *         specified type is one of the color space constants defined in the
+     *         {@code ColorSpace} class.
+     * @return an {@code ICC_Profile} object corresponding to the specified
+     *         {@code ColorSpace} type
+     * @throws IllegalArgumentException If {@code cspace} is not one of the
+     *         predefined color space types
      */
     public static ICC_Profile getInstance (int cspace) {
         ICC_Profile thisProfile = null;
@@ -931,51 +925,49 @@
         return thisProfile;
     }
 
-    /* This asserts system privileges, so is used only for the
-     * standard profiles.
+    /**
+     * This method asserts system privileges, so is used only for the standard
+     * profiles.
      */
     private static ICC_Profile getStandardProfile(final String name) {
-
         return AccessController.doPrivileged(
-            new PrivilegedAction<ICC_Profile>() {
-                 public ICC_Profile run() {
-                     ICC_Profile p = null;
-                     try {
-                         p = getInstance (name);
-                     } catch (IOException ex) {
-                         throw new IllegalArgumentException(
-                               "Can't load standard profile: " + name);
-                     }
-                     return p;
-                 }
-             });
+                new PrivilegedAction<ICC_Profile>() {
+                    public ICC_Profile run() {
+                        ICC_Profile p = null;
+                        try {
+                            p = getInstance(name);
+                        } catch (IOException ex) {
+                            throw new IllegalArgumentException(
+                                    "Can't load standard profile: " + name);
+                        }
+                        return p;
+                    }
+                });
     }
 
     /**
-     * Constructs an ICC_Profile corresponding to the data in a file.
-     * fileName may be an absolute or a relative file specification.
-     * Relative file names are looked for in several places: first, relative
-     * to any directories specified by the java.iccprofile.path property;
-     * second, relative to any directories specified by the java.class.path
-     * property; finally, in a directory used to store profiles always
-     * available, such as the profile for sRGB.  Built-in profiles use .pf as
-     * the file name extension for profiles, e.g. sRGB.pf.
-     * This method throws an IOException if the specified file cannot be
-     * opened or if an I/O error occurs while reading the file.  It throws
-     * an IllegalArgumentException if the file does not contain valid ICC
-     * Profile data.
-     * @param fileName The file that contains the data for the profile.
+     * Constructs an {@code ICC_Profile} corresponding to the data in a file.
+     * {@code fileName} may be an absolute or a relative file specification.
+     * Relative file names are looked for in several places: first, relative to
+     * any directories specified by the {@code java.iccprofile.path} property;
+     * second, relative to any directories specified by the
+     * {@code java.class.path} property; finally, in a directory used to store
+     * profiles always available, such as the profile for sRGB. Built-in
+     * profiles use {@code .pf} as the file name extension for profiles, e.g.
+     * {@code sRGB.pf}. This method throws an {@code IOException} if the
+     * specified file cannot be opened or if an I/O error occurs while reading
+     * the file. It throws an {@code IllegalArgumentException} if the file does
+     * not contain valid ICC Profile data.
      *
-     * @return an {@code ICC_Profile} object corresponding to
-     *          the data in the specified file.
-     * @exception IOException If the specified file cannot be opened or
-     * an I/O error occurs while reading the file.
-     *
-     * @exception IllegalArgumentException If the file does not
-     * contain valid ICC Profile data.
-     *
-     * @exception SecurityException If a security manager is installed
-     * and it does not permit read access to the given file.
+     * @param  fileName the file that contains the data for the profile
+     * @return an {@code ICC_Profile} object corresponding to the data in the
+     *         specified file
+     * @throws IOException If the specified file cannot be opened or an I/O
+     *         error occurs while reading the file
+     * @throws IllegalArgumentException If the file does not contain valid ICC
+     *         Profile data
+     * @throws SecurityException If a security manager is installed and it does
+     *         not permit read access to the given file
      */
     public static ICC_Profile getInstance(String fileName) throws IOException {
         ICC_Profile thisProfile;
@@ -999,21 +991,19 @@
         return thisProfile;
     }
 
-
     /**
-     * Constructs an ICC_Profile corresponding to the data in an InputStream.
-     * This method throws an IllegalArgumentException if the stream does not
-     * contain valid ICC Profile data.  It throws an IOException if an I/O
-     * error occurs while reading the stream.
-     * @param s The input stream from which to read the profile data.
+     * Constructs an {@code ICC_Profile} corresponding to the data in an
+     * {@code InputStream}. This method throws an
+     * {@code IllegalArgumentException} if the stream does not contain valid ICC
+     * Profile data. It throws an {@code IOException} if an I/O error occurs
+     * while reading the stream.
      *
-     * @return an {@code ICC_Profile} object corresponding to the
-     *     data in the specified {@code InputStream}.
-     *
-     * @exception IOException If an I/O error occurs while reading the stream.
-     *
-     * @exception IllegalArgumentException If the stream does not
-     * contain valid ICC Profile data.
+     * @param  s the input stream from which to read the profile data
+     * @return an {@code ICC_Profile} object corresponding to the data in the
+     *         specified {@code InputStream}
+     * @throws IOException If an I/O error occurs while reading the stream
+     * @throws IllegalArgumentException If the stream does not contain valid ICC
+     *         Profile data
      */
     public static ICC_Profile getInstance(InputStream s) throws IOException {
     byte[] profileData;
@@ -1070,17 +1060,15 @@
         return profileData;
     }
 
-
     /**
-     * Constructs an ICC_Profile for which the actual loading of the
-     * profile data from a file and the initialization of the CMM should
-     * be deferred as long as possible.
-     * Deferral is only used for standard profiles.
-     * If deferring is disabled, then getStandardProfile() ensures
-     * that all of the appropriate access privileges are granted
-     * when loading this profile.
-     * If deferring is enabled, then the deferred activation
-     * code will take care of access privileges.
+     * Constructs an {@code ICC_Profile} for which the actual loading of the
+     * profile data from a file and the initialization of the CMM should be
+     * deferred as long as possible. Deferral is only used for standard
+     * profiles. If deferring is disabled, then getStandardProfile() ensures
+     * that all of the appropriate access privileges are granted when loading
+     * this profile. If deferring is enabled, then the deferred activation code
+     * will take care of access privileges.
+     *
      * @see #activateDeferredProfile()
      */
     static ICC_Profile getDeferredInstance(ProfileDeferralInfo pdi) {
@@ -1131,10 +1119,10 @@
         }
     }
 
-
     /**
      * Returns profile major version.
-     * @return  The major version of the profile.
+     *
+     * @return the major version of the profile
      */
     public int getMajorVersion() {
     byte[] theHeader;
@@ -1147,7 +1135,8 @@
 
     /**
      * Returns profile minor version.
-     * @return The minor version of the profile.
+     *
+     * @return the minor version of the profile
      */
     public int getMinorVersion() {
     byte[] theHeader;
@@ -1160,7 +1149,8 @@
 
     /**
      * Returns the profile class.
-     * @return One of the predefined profile class constants.
+     *
+     * @return one of the predefined profile class constants
      */
     public int getProfileClass() {
     byte[] theHeader;
@@ -1214,16 +1204,16 @@
     }
 
     /**
-     * Returns the color space type.  Returns one of the color space type
-     * constants defined by the ColorSpace class.  This is the
-     * "input" color space of the profile.  The type defines the
-     * number of components of the color space and the interpretation,
-     * e.g. TYPE_RGB identifies a color space with three components - red,
-     * green, and blue.  It does not define the particular color
-     * characteristics of the space, e.g. the chromaticities of the
-     * primaries.
-     * @return One of the color space type constants defined in the
-     * {@code ColorSpace} class.
+     * Returns the color space type. Returns one of the color space type
+     * constants defined by the {@code ColorSpace} class. This is the "input"
+     * color space of the profile. The type defines the number of components of
+     * the color space and the interpretation, e.g. {@code TYPE_RGB} identifies
+     * a color space with three components - red, green, and blue. It does not
+     * define the particular color characteristics of the space, e.g. the
+     * chromaticities of the primaries.
+     *
+     * @return one of the color space type constants defined in the
+     *         {@code ColorSpace} class
      */
     public int getColorSpaceType() {
         if (deferralInfo != null) {
@@ -1247,15 +1237,16 @@
 
     /**
      * Returns the color space type of the Profile Connection Space (PCS).
-     * Returns one of the color space type constants defined by the
-     * ColorSpace class.  This is the "output" color space of the
-     * profile.  For an input, display, or output profile useful
-     * for tagging colors or images, this will be either TYPE_XYZ or
-     * TYPE_Lab and should be interpreted as the corresponding specific
-     * color space defined in the ICC specification.  For a device
-     * link profile, this could be any of the color space type constants.
-     * @return One of the color space type constants defined in the
-     * {@code ColorSpace} class.
+     * Returns one of the color space type constants defined by the ColorSpace
+     * class. This is the "output" color space of the profile. For an input,
+     * display, or output profile useful for tagging colors or images, this will
+     * be either {@code TYPE_XYZ} or {@code TYPE_Lab} and should be interpreted
+     * as the corresponding specific color space defined in the ICC
+     * specification. For a device link profile, this could be any of the color
+     * space type constants.
+     *
+     * @return one of the color space type constants defined in the
+     *         {@code ColorSpace} class
      */
     public int getPCSType() {
         if (ProfileDeferralMgr.deferring) {
@@ -1275,14 +1266,12 @@
         return thePCS;
     }
 
-
     /**
-     * Write this ICC_Profile to a file.
+     * Write this {@code ICC_Profile} to a file.
      *
-     * @param fileName The file to write the profile data to.
-     *
-     * @exception IOException If the file cannot be opened for writing
-     * or an I/O error occurs while writing to the file.
+     * @param  fileName the file to write the profile data to
+     * @throws IOException If the file cannot be opened for writing or an I/O
+     *         error occurs while writing to the file
      */
     public void write(String fileName) throws IOException {
     FileOutputStream outputFile;
@@ -1295,14 +1284,11 @@
         outputFile.close ();
     }
 
-
     /**
-     * Write this ICC_Profile to an OutputStream.
+     * Write this {@code ICC_Profile} to an {@code OutputStream}.
      *
-     * @param s The stream to write the profile data to.
-     *
-     * @exception IOException If an I/O error occurs while writing to the
-     * stream.
+     * @param  s the stream to write the profile data to
+     * @throws IOException If an I/O error occurs while writing to the stream
      */
     public void write(OutputStream s) throws IOException {
     byte[] profileData;
@@ -1312,10 +1298,11 @@
         s.write(profileData);
     }
 
-
     /**
-     * Returns a byte array corresponding to the data of this ICC_Profile.
-     * @return A byte array that contains the profile data.
+     * Returns a byte array corresponding to the data of this
+     * {@code ICC_Profile}.
+     *
+     * @return a byte array that contains the profile data
      * @see #setData(int, byte[])
      */
     public byte[] getData() {
@@ -1339,20 +1326,17 @@
         return profileData;
     }
 
-
     /**
-     * Returns a particular tagged data element from the profile as
-     * a byte array.  Elements are identified by signatures
-     * as defined in the ICC specification.  The signature
-     * icSigHead can be used to get the header.  This method is useful
-     * for advanced applets or applications which need to access
-     * profile data directly.
+     * Returns a particular tagged data element from the profile as a byte
+     * array. Elements are identified by signatures as defined in the ICC
+     * specification. The signature icSigHead can be used to get the header.
+     * This method is useful for advanced applets or applications which need to
+     * access profile data directly.
      *
-     * @param tagSignature The ICC tag signature for the data element you
-     * want to get.
-     *
-     * @return A byte array that contains the tagged data element. Returns
-     * {@code null} if the specified tag doesn't exist.
+     * @param  tagSignature the ICC tag signature for the data element you want
+     *         to get
+     * @return a byte array that contains the tagged data element. Returns
+     *         {@code null} if the specified tag doesn't exist.
      * @see #setData(int, byte[])
      */
     public byte[] getData(int tagSignature) {
@@ -1387,20 +1371,20 @@
     }
 
     /**
-     * Sets a particular tagged data element in the profile from
-     * a byte array. The array should contain data in a format, corresponded
-     * to the {@code tagSignature} as defined in the ICC specification, section 10.
+     * Sets a particular tagged data element in the profile from a byte array.
+     * The array should contain data in a format, corresponded to the
+     * {@code tagSignature} as defined in the ICC specification, section 10.
      * This method is useful for advanced applets or applications which need to
      * access profile data directly.
      *
-     * @param tagSignature The ICC tag signature for the data element
-     * you want to set.
-     * @param tagData the data to set for the specified tag signature
-     * @throws IllegalArgumentException if {@code tagSignature} is not a signature
-     *         as defined in the ICC specification.
+     * @param  tagSignature the ICC tag signature for the data element you want
+     *         to set
+     * @param  tagData the data to set for the specified tag signature
+     * @throws IllegalArgumentException if {@code tagSignature} is not a
+     *         signature as defined in the ICC specification.
      * @throws IllegalArgumentException if a content of the {@code tagData}
-     *         array can not be interpreted as valid tag data, corresponding
-     *         to the {@code tagSignature}.
+     *         array can not be interpreted as valid tag data, corresponding to
+     *         the {@code tagSignature}
      * @see #getData
      */
     public void setData(int tagSignature, byte[] tagData) {
@@ -1413,9 +1397,8 @@
     }
 
     /**
-     * Sets the rendering intent of the profile.
-     * This is used to select the proper transform from a profile that
-     * has multiple transforms.
+     * Sets the rendering intent of the profile. This is used to select the
+     * proper transform from a profile that has multiple transforms.
      */
     void setRenderingIntent(int renderingIntent) {
         byte[] theHeader = getData(icSigHead);/* getData will activate deferred
@@ -1425,12 +1408,11 @@
         setData (icSigHead, theHeader);
     }
 
-
     /**
-     * Returns the rendering intent of the profile.
-     * This is used to select the proper transform from a profile that
-     * has multiple transforms.  It is typically set in a source profile
-     * to select a transform from an output profile.
+     * Returns the rendering intent of the profile. This is used to select the
+     * proper transform from a profile that has multiple transforms. It is
+     * typically set in a source profile to select a transform from an output
+     * profile.
      */
     int getRenderingIntent() {
         byte[] theHeader = getData(icSigHead);/* getData will activate deferred
@@ -1449,17 +1431,13 @@
         return (0xffff & renderingIntent);
     }
 
-
     /**
-     * Returns the number of color components in the "input" color
-     * space of this profile.  For example if the color space type
-     * of this profile is TYPE_RGB, then this method will return 3.
+     * Returns the number of color components in the "input" color space of this
+     * profile. For example if the color space type of this profile is
+     * {@code TYPE_RGB}, then this method will return 3.
      *
-     * @return The number of color components in the profile's input
-     * color space.
-     *
-     * @throws ProfileDataException if color space is in the profile
-     *         is invalid
+     * @return the number of color components in the profile's input color space
+     * @throws ProfileDataException if color space is in the profile is invalid
      */
     public int getNumComponents() {
     byte[]    theHeader;
@@ -1553,20 +1531,18 @@
         return theNumComponents;
     }
 
-
     /**
-     * Returns a float array of length 3 containing the X, Y, and Z
-     * components of the mediaWhitePointTag in the ICC profile.
+     * Returns a float array of length 3 containing the X, Y, and Z components
+     * of the mediaWhitePointTag in the ICC profile.
      */
     float[] getMediaWhitePoint() {
         return getXYZTag(icSigMediaWhitePointTag);
                                            /* get the media white point tag */
     }
 
-
     /**
-     * Returns a float array of length 3 containing the X, Y, and Z
-     * components encoded in an XYZType tag.
+     * Returns a float array of length 3 containing the X, Y, and Z components
+     * encoded in an XYZType tag.
      */
     float[] getXYZTag(int theTagSignature) {
     byte[] theData;
@@ -1587,17 +1563,17 @@
         return theXYZNumber;
     }
 
-
     /**
-     * Returns a gamma value representing a tone reproduction
-     * curve (TRC).  If the profile represents the TRC as a table rather
-     * than a single gamma value, then an exception is thrown.  In this
-     * case the actual table can be obtained via getTRC().
-     * theTagSignature should be one of icSigGrayTRCTag, icSigRedTRCTag,
-     * icSigGreenTRCTag, or icSigBlueTRCTag.
-     * @return the gamma value as a float.
-     * @exception ProfileDataException if the profile does not specify
-     *            the TRC as a single gamma value.
+     * Returns a gamma value representing a tone reproduction curve (TRC). If
+     * the profile represents the TRC as a table rather than a single gamma
+     * value, then an exception is thrown. In this case the actual table can be
+     * obtained via {@link #getTRC}. {@code theTagSignature} should be one of
+     * {@code icSigGrayTRCTag}, {@code icSigRedTRCTag},
+     * {@code icSigGreenTRCTag}, or {@code icSigBlueTRCTag}.
+     *
+     * @return the gamma value as a float
+     * @throws ProfileDataException if the profile does not specify the TRC as a
+     *         single gamma value
      */
     float getGamma(int theTagSignature) {
     byte[] theTRCData;
@@ -1620,26 +1596,25 @@
         return theGamma;
     }
 
-
     /**
-     * Returns the TRC as an array of shorts.  If the profile has
-     * specified the TRC as linear (gamma = 1.0) or as a simple gamma
-     * value, this method throws an exception, and the getGamma() method
-     * should be used to get the gamma value.  Otherwise the short array
-     * returned here represents a lookup table where the input Gray value
-     * is conceptually in the range [0.0, 1.0].  Value 0.0 maps
-     * to array index 0 and value 1.0 maps to array index length-1.
-     * Interpolation may be used to generate output values for
-     * input values which do not map exactly to an index in the
-     * array.  Output values also map linearly to the range [0.0, 1.0].
-     * Value 0.0 is represented by an array value of 0x0000 and
-     * value 1.0 by 0xFFFF, i.e. the values are really unsigned
-     * short values, although they are returned in a short array.
-     * theTagSignature should be one of icSigGrayTRCTag, icSigRedTRCTag,
-     * icSigGreenTRCTag, or icSigBlueTRCTag.
-     * @return a short array representing the TRC.
-     * @exception ProfileDataException if the profile does not specify
-     *            the TRC as a table.
+     * Returns the TRC as an array of shorts. If the profile has specified the
+     * TRC as linear (gamma = 1.0) or as a simple gamma value, this method
+     * throws an exception, and the {@link #getGamma} method should be used to
+     * get the gamma value. Otherwise the short array returned here represents a
+     * lookup table where the input Gray value is conceptually in the range
+     * [0.0, 1.0]. Value 0.0 maps to array index 0 and value 1.0 maps to array
+     * index length-1. Interpolation may be used to generate output values for
+     * input values which do not map exactly to an index in the array. Output
+     * values also map linearly to the range [0.0, 1.0]. Value 0.0 is
+     * represented by an array value of 0x0000 and value 1.0 by 0xFFFF, i.e. the
+     * values are really unsigned short values, although they are returned in a
+     * short array. {@code theTagSignature} should be one of
+     * {@code icSigGrayTRCTag}, {@code icSigRedTRCTag},
+     * {@code icSigGreenTRCTag}, or {@code icSigBlueTRCTag}.
+     *
+     * @return a short array representing the TRC
+     * @throws ProfileDataException if the profile does not specify the TRC as a
+     *         table
      */
     short[] getTRC(int theTagSignature) {
     byte[] theTRCData;
@@ -1666,8 +1641,9 @@
         return theTRC;
     }
 
-
-    /* convert an ICC color space signature into a Java color space type */
+    /**
+     * Convert an ICC color space signature into a Java color space type.
+     */
     static int iccCStoJCS(int theColorSpaceSig) {
     int theColorSpace;
 
@@ -1775,7 +1751,6 @@
         default:
             throw new IllegalArgumentException ("Unknown color space");
         }
-
         return theColorSpace;
     }
 
@@ -1807,17 +1782,16 @@
             array[index+1] = (byte) (value);
     }
 
-
-    /*
-     * fileName may be an absolute or a relative file specification.
-     * Relative file names are looked for in several places: first, relative
-     * to any directories specified by the java.iccprofile.path property;
-     * second, relative to any directories specified by the java.class.path.
-     * The built-in profile files are now loaded as resources, since they
-     * may not be individual disk files, and so this method will not find
-     * these and on a null return, the caller needs to try as resources.
-     * Built-in profiles use .pf as the file name extension for profiles,
-     * e.g. sRGB.pf.
+    /**
+     * {@code fileName} may be an absolute or a relative file specification.
+     * Relative file names are looked for in several places: first, relative to
+     * any directories specified by the {@code java.iccprofile.path} property;
+     * second, relative to any directories specified by the
+     * {@code java.class.path}. The built-in profile files are now loaded as
+     * resources, since they may not be individual disk files, and so this
+     * method will not find these and on a {@code null} return, the caller needs
+     * to try as resources. Built-in profiles use {@code .pf} as the file name
+     * extension for profiles, e.g. {@code sRGB.pf}.
      */
     private static File getProfileFile(String fileName) {
         String path, dir, fullPath;
@@ -1862,10 +1836,9 @@
     }
 
     /**
-     * Returns a stream corresponding to a built-in profile
-     * specified by fileName.
-     * If there is no built-in profile with such name, then the method
-     * returns null.
+     * Returns a stream corresponding to a built-in profile specified by
+     * fileName. If there is no built-in profile with such name, then the method
+     * returns {@code null}.
      */
     private static InputStream getStandardProfileInputStream(String fileName) {
         return AccessController.doPrivileged(
@@ -1909,68 +1882,58 @@
             });
     }
 
-
     /*
      * Serialization support.
      *
-     * Directly deserialized profiles are useless since they are not
-     * registered with CMM.  We don't allow constructor to be called
-     * directly and instead have clients to call one of getInstance
-     * factory methods that will register the profile with CMM.  For
-     * deserialization we implement readResolve method that will
-     * resolve the bogus deserialized profile object with one obtained
-     * with getInstance as well.
+     * Directly deserialized profiles are useless since they are not registered
+     * with CMM. We don't allow constructor to be called directly and instead
+     * have clients to call one of getInstance factory methods that will
+     * register the profile with CMM. For deserialization we implement
+     * readResolve method that will resolve the bogus deserialized profile
+     * object with one obtained with getInstance as well.
      *
-     * There are two primary factory methods for construction of ICC
-     * profiles: getInstance(int cspace) and getInstance(byte[] data).
-     * This implementation of ICC_Profile uses the former to return a
-     * cached singleton profile object, other implementations will
-     * likely use this technique too.  To preserve the singleton
-     * pattern across serialization we serialize cached singleton
-     * profiles in such a way that deserializing VM could call
-     * getInstance(int cspace) method that will resolve deserialized
-     * object into the corresponding singleton as well.
+     * There are two primary factory methods for construction of ICC profiles:
+     * getInstance(int cspace) and getInstance(byte[] data). This implementation
+     * of ICC_Profile uses the former to return a cached singleton profile
+     * object, other implementations will likely use this technique too. To
+     * preserve the singleton pattern across serialization we serialize cached
+     * singleton profiles in such a way that deserializing VM could call
+     * getInstance(int cspace) method that will resolve deserialized object into
+     * the corresponding singleton as well.
      *
-     * Since the singletons are private to ICC_Profile the readResolve
-     * method have to be `protected' instead of `private' so that
-     * singletons that are instances of subclasses of ICC_Profile
-     * could be correctly deserialized.
+     * Since the singletons are private to ICC_Profile the readResolve method
+     * have to be `protected' instead of `private' so that singletons that are
+     * instances of subclasses of ICC_Profile could be correctly deserialized.
      */
 
-
     /**
-     * Version of the format of additional serialized data in the
-     * stream.  Version&nbsp;{@code 1} corresponds to Java&nbsp;2
-     * Platform,&nbsp;v1.3.
+     * Version of the format of additional serialized data in the stream.
+     * Version&nbsp;{@code 1} corresponds to Java&nbsp;2 Platform,&nbsp;v1.3.
+     *
+     * @serial
      * @since 1.3
-     * @serial
      */
     private int iccProfileSerializedDataVersion = 1;
 
-
     /**
-     * Writes default serializable fields to the stream.  Writes a
-     * string and an array of bytes to the stream as additional data.
+     * Writes default serializable fields to the stream. Writes a string and an
+     * array of bytes to the stream as additional data.
      *
-     * @param s stream used for serialization.
-     * @throws IOException
-     *     thrown by {@code ObjectInputStream}.
-     * @serialData
-     *     The {@code String} is the name of one of
-     *     <code>CS_<var>*</var></code> constants defined in the
-     *     {@link ColorSpace} class if the profile object is a profile
-     *     for a predefined color space (for example
-     *     {@code "CS_sRGB"}).  The string is {@code null}
-     *     otherwise.
-     *     <p>
-     *     The {@code byte[]} array is the profile data for the
-     *     profile.  For predefined color spaces {@code null} is
-     *     written instead of the profile data.  If in the future
-     *     versions of Java API new predefined color spaces will be
-     *     added, future versions of this class may choose to write
-     *     for new predefined color spaces not only the color space
-     *     name, but the profile data as well so that older versions
-     *     could still deserialize the object.
+     * @param  s stream used for serialization
+     * @throws IOException thrown by {@code ObjectInputStream}
+     * @serialData the {@code String} is the name of one of
+     *         <code>CS_<var>*</var></code> constants defined in the
+     *         {@link ColorSpace} class if the profile object is a profile for a
+     *         predefined color space (for example {@code "CS_sRGB"}). The
+     *         string is {@code null} otherwise.
+     *         <p>
+     *         The {@code byte[]} array is the profile data for the profile. For
+     *         predefined color spaces {@code null} is written instead of the
+     *         profile data. If in the future versions of Java API new
+     *         predefined color spaces will be added, future versions of this
+     *         class may choose to write for new predefined color spaces not
+     *         only the color space name, but the profile data as well so that
+     *         older versions could still deserialize the object.
      */
     private void writeObject(ObjectOutputStream s)
       throws IOException
@@ -2009,33 +1972,30 @@
     private transient ICC_Profile resolvedDeserializedProfile;
 
     /**
-     * Reads default serializable fields from the stream.  Reads from
-     * the stream a string and an array of bytes as additional data.
+     * Reads default serializable fields from the stream. Reads from the stream
+     * a string and an array of bytes as additional data.
      *
-     * @param s stream used for deserialization.
-     * @throws IOException
-     *     thrown by {@code ObjectInputStream}.
-     * @throws ClassNotFoundException
-     *     thrown by {@code ObjectInputStream}.
-     * @serialData
-     *     The {@code String} is the name of one of
-     *     <code>CS_<var>*</var></code> constants defined in the
-     *     {@link ColorSpace} class if the profile object is a profile
-     *     for a predefined color space (for example
-     *     {@code "CS_sRGB"}).  The string is {@code null}
-     *     otherwise.
-     *     <p>
-     *     The {@code byte[]} array is the profile data for the
-     *     profile.  It will usually be {@code null} for the
-     *     predefined profiles.
-     *     <p>
-     *     If the string is recognized as a constant name for
-     *     predefined color space the object will be resolved into
-     *     profile obtained with
-     *     <code>getInstance(int&nbsp;cspace)</code> and the profile
-     *     data are ignored.  Otherwise the object will be resolved
-     *     into profile obtained with
-     *     <code>getInstance(byte[]&nbsp;data)</code>.
+     * @param  s stream used for deserialization
+     * @throws IOException thrown by {@code ObjectInputStream}
+     * @throws ClassNotFoundException thrown by {@code
+     *         ObjectInputStream}
+     * @serialData the {@code String} is the name of one of
+     *         <code>CS_<var>*</var></code> constants defined in the
+     *         {@link ColorSpace} class if the profile object is a profile for a
+     *         predefined color space (for example {@code "CS_sRGB"}). The
+     *         string is {@code null} otherwise.
+     *         <p>
+     *         The {@code byte[]} array is the profile data for the profile. It
+     *         will usually be {@code null} for the predefined profiles.
+     *         <p>
+     *         If the string is recognized as a constant name for predefined
+     *         color space the object will be resolved into profile obtained
+     *         with
+     *         <code>getInstance(int&nbsp;cspace)</code> and the profile data
+     *         are
+     *         ignored. Otherwise the object will be resolved into profile
+     *         obtained with
+     *         <code>getInstance(byte[]&nbsp;data)</code>.
      * @see #readResolve()
      * @see #getInstance(int)
      * @see #getInstance(byte[])
@@ -2075,11 +2035,11 @@
     }
 
     /**
-     * Resolves instances being deserialized into instances registered
-     * with CMM.
-     * @return ICC_Profile object for profile registered with CMM.
-     * @throws ObjectStreamException
-     *     never thrown, but mandated by the serialization spec.
+     * Resolves instances being deserialized into instances registered with CMM.
+     *
+     * @return ICC_Profile object for profile registered with CMM
+     * @throws ObjectStreamException never thrown, but mandated by the
+     *         serialization spec
      * @since 1.3
      */
     protected Object readResolve() throws ObjectStreamException {
--- a/src/java.desktop/share/classes/java/awt/color/ICC_ProfileGray.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/share/classes/java/awt/color/ICC_ProfileGray.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,7 @@
  * questions.
  */
 
-/*
- **********************************************************************
+/* ********************************************************************
  **********************************************************************
  **********************************************************************
  *** COPYRIGHT (c) Eastman Kodak Company, 1997                      ***
@@ -40,80 +39,81 @@
 import sun.java2d.cmm.ProfileDeferralInfo;
 
 /**
- *
- * A subclass of the ICC_Profile class which represents profiles
- * which meet the following criteria: the color space type of the
- * profile is TYPE_GRAY and the profile includes the grayTRCTag and
- * mediaWhitePointTag tags.  Examples of this kind of profile are
- * monochrome input profiles, monochrome display profiles, and
- * monochrome output profiles.  The getInstance methods in the
- * ICC_Profile class will
- * return an ICC_ProfileGray object when the above conditions are
- * met.  The advantage of this class is that it provides a lookup
- * table that Java or native methods may be able to use directly to
- * optimize color conversion in some cases.
+ * The {@code ICC_ProfileGray} class is a subclass of the {@code ICC_Profile}
+ * class that represents profiles which meet the following criteria: the color
+ * space type of the profile is {@code TYPE_GRAY} and the profile includes the
+ * {@code grayTRCTag} and {@code mediaWhitePointTag} tags. The
+ * {@code getInstance} methods in the {@code ICC_Profile} class will return an
+ * {@code ICC_ProfileGray} object when the above conditions are met. Examples of
+ * this kind of profile are monochrome input profiles, monochrome display
+ * profiles, and monochrome output profiles.
+ * <p>
+ * The advantage of this class is that it provides a lookup table that Java
+ * or native methods can use directly to optimize color conversion in some
+ * cases.
  * <p>
  * To transform from a GRAY device profile color space to the CIEXYZ Profile
- * Connection Space, the device gray component is transformed by
- * a lookup through the tone reproduction curve (TRC).  The result is
- * treated as the achromatic component of the PCS.
-<pre>
-
-&nbsp;               PCSY = grayTRC[deviceGray]
-
-</pre>
- * The inverse transform is done by converting the PCS Y components to
- * device Gray via the inverse of the grayTRC.
+ * Connection Space, the device gray component is transformed by a lookup
+ * through the tone reproduction curve (TRC). The result is treated as the
+ * achromatic component of the PCS.
+ * <pre>
+ *
+ * &nbsp;               PCSY = grayTRC[deviceGray]
+ *
+ * </pre>
+ * The inverse transform is done by converting the PCS Y components to device
+ * Gray via the inverse of the grayTRC.
  */
-
-
-
 public class ICC_ProfileGray
 extends ICC_Profile {
 
+    /**
+     * Use serialVersionUID from JDK 1.2 for interoperability.
+     */
     static final long serialVersionUID = -1124721290732002649L;
 
     /**
-     * Constructs a new ICC_ProfileGray from a CMM ID.
+     * Constructs a new {@code ICC_ProfileGray} from a CMM ID.
      */
     ICC_ProfileGray(Profile p) {
         super(p);
     }
 
     /**
-     * Constructs a new ICC_ProfileGray from a ProfileDeferralInfo object.
+     * Constructs a new {@code ICC_ProfileGray} from a
+     * {@code ProfileDeferralInfo} object.
      */
     ICC_ProfileGray(ProfileDeferralInfo pdi) {
         super(pdi);
     }
 
-
     /**
-     * Returns a float array of length 3 containing the X, Y, and Z
-     * components of the mediaWhitePointTag in the ICC profile.
-     * @return an array containing the components of the
-     * mediaWhitePointTag in the ICC profile.
+     * Returns a float array of length 3 containing the X, Y, and Z components
+     * of the mediaWhitePointTag in the ICC profile.
+     *
+     * @return an array containing the components of the mediaWhitePointTag in
+     *         the ICC profile
      */
     public float[] getMediaWhitePoint() {
         return super.getMediaWhitePoint();
     }
 
-
     /**
-     * Returns a gamma value representing the tone reproduction
-     * curve (TRC).  If the profile represents the TRC as a table rather
-     * than a single gamma value, then an exception is thrown.  In this
-     * case the actual table can be obtained via getTRC().  When
-     * using a gamma value, the PCS Y component is computed as follows:
-<pre>
-
-&nbsp;                         gamma
-&nbsp;        PCSY = deviceGray
-
-</pre>
-     * @return the gamma value as a float.
-     * @exception ProfileDataException if the profile does not specify
-     *            the TRC as a single gamma value.
+     * Returns a gamma value representing the tone reproduction curve (TRC). If
+     * the profile represents the TRC as a table rather than a single gamma
+     * value, then an exception is thrown. In this case the actual table can be
+     * obtained via {@code getTRC()}. When using a gamma value, the PCS Y
+     * component is computed as follows:
+     * <pre>
+     *
+     * &nbsp;                         gamma
+     * &nbsp;        PCSY = deviceGray
+     *
+     * </pre>
+     *
+     * @return the gamma value as a float
+     * @throws ProfileDataException if the profile does not specify the TRC as a
+     *         single gamma value
      */
     public float getGamma() {
     float theGamma;
@@ -123,22 +123,22 @@
     }
 
     /**
-     * Returns the TRC as an array of shorts.  If the profile has
-     * specified the TRC as linear (gamma = 1.0) or as a simple gamma
-     * value, this method throws an exception, and the getGamma() method
-     * should be used to get the gamma value.  Otherwise the short array
-     * returned here represents a lookup table where the input Gray value
-     * is conceptually in the range [0.0, 1.0].  Value 0.0 maps
-     * to array index 0 and value 1.0 maps to array index length-1.
-     * Interpolation may be used to generate output values for
-     * input values which do not map exactly to an index in the
-     * array.  Output values also map linearly to the range [0.0, 1.0].
-     * Value 0.0 is represented by an array value of 0x0000 and
-     * value 1.0 by 0xFFFF, i.e. the values are really unsigned
-     * short values, although they are returned in a short array.
-     * @return a short array representing the TRC.
-     * @exception ProfileDataException if the profile does not specify
-     *            the TRC as a table.
+     * Returns the TRC as an array of shorts. If the profile has specified the
+     * TRC as linear (gamma = 1.0) or as a simple gamma value, this method
+     * throws an exception, and the {@code getGamma()} method should be used to
+     * get the gamma value. Otherwise the short array returned here represents a
+     * lookup table where the input Gray value is conceptually in the range
+     * [0.0, 1.0]. Value 0.0 maps to array index 0 and value 1.0 maps to array
+     * index {@code length-1}. Interpolation may be used to generate output
+     * values for input values which do not map exactly to an index in the
+     * array. Output values also map linearly to the range [0.0, 1.0]. Value 0.0
+     * is represented by an array value of 0x0000 and value 1.0 by 0xFFFF, i.e.
+     * the values are really unsigned short values, although they are returned
+     * in a short array.
+     *
+     * @return a short array representing the TRC
+     * @throws ProfileDataException if the profile does not specify the TRC as a
+     *         table
      */
     public short[] getTRC() {
     short[]    theTRC;
--- a/src/java.desktop/share/classes/java/awt/color/ICC_ProfileRGB.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/share/classes/java/awt/color/ICC_ProfileRGB.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,7 @@
  * questions.
  */
 
-/*
- **********************************************************************
+/* ********************************************************************
  **********************************************************************
  **********************************************************************
  *** COPYRIGHT (c) Eastman Kodak Company, 1997                      ***
@@ -40,30 +39,25 @@
 import sun.java2d.cmm.ProfileDeferralInfo;
 
 /**
- *
- * The ICC_ProfileRGB class is a subclass of the ICC_Profile class
- * that represents profiles which meet the following criteria:
- * <ul>
- * <li>The profile's color space type is RGB.</li>
- * <li>The profile includes the {@code redColorantTag},
- * {@code greenColorantTag}, {@code blueColorantTag},
- * {@code redTRCTag}, {@code greenTRCTag},
- * {@code blueTRCTag}, and {@code mediaWhitePointTag} tags.</li>
- * </ul>
- * The {@code ICC_Profile getInstance} method will
- * return an {@code ICC_ProfileRGB} object when these conditions are met.
- * Three-component, matrix-based input profiles and RGB display profiles are
- * examples of this type of profile.
+ * The {@code ICC_ProfileRGB} class is a subclass of the {@code ICC_Profile}
+ * class that represents profiles which meet the following criteria: the
+ * profile's color space type is RGB, and the profile includes the
+ * {@code redColorantTag}, {@code greenColorantTag}, {@code blueColorantTag},
+ * {@code redTRCTag}, {@code greenTRCTag}, {@code blueTRCTag},
+ * {@code mediaWhitePointTag} tags. The {@code getInstance} methods in the
+ * {@code ICC_Profile} class will return an {@code ICC_ProfileRGB} object when
+ * the above conditions are met. Three-component, matrix-based input profiles
+ * and RGB display profiles are examples of this type of profile.
  * <p>
- * This profile class provides color transform matrices and lookup tables
- * that Java or native methods can use directly to
- * optimize color conversion in some cases.
+ * The advantage of this class is that it provides color transform matrices and
+ * lookup tables that Java or native methods can use directly to optimize color
+ * conversion in some cases.
  * <p>
  * To transform from a device profile color space to the CIEXYZ Profile
- * Connection Space, each device color component is first linearized by
- * a lookup through the corresponding tone reproduction curve (TRC).
- * The resulting linear RGB components are converted to the CIEXYZ PCS
- * using a a 3x3 matrix constructed from the RGB colorants.
+ * Connection Space, each device color component is first linearized by a lookup
+ * through the corresponding tone reproduction curve (TRC). The resulting linear
+ * RGB components are converted to the CIEXYZ PCS using a a 3x3 matrix
+ * constructed from the RGB colorants.
  * <pre>
  *
  * &nbsp;               linearR = redTRC[deviceR]
@@ -81,12 +75,9 @@
  *
  * </pre>
  * The inverse transform is performed by converting PCS XYZ components to linear
- * RGB components through the inverse of the above 3x3 matrix, and then converting
- * linear RGB to device RGB through inverses of the TRCs.
+ * RGB components through the inverse of the above 3x3 matrix, and then
+ * converting linear RGB to device RGB through inverses of the TRCs.
  */
-
-
-
 public class ICC_ProfileRGB
 extends ICC_Profile {
 
@@ -107,12 +98,10 @@
      */
     public static final int BLUECOMPONENT = 2;
 
-
     /**
      * Constructs an new {@code ICC_ProfileRGB} from a CMM ID.
      *
-     * @param p The CMM ID for the profile.
-     *
+     * @param p the CMM ID for the profile.
      */
     ICC_ProfileRGB(Profile p) {
         super(p);
@@ -120,7 +109,7 @@
 
     /**
      * Constructs a new {@code ICC_ProfileRGB} from a
-     * ProfileDeferralInfo object.
+     * {@code ProfileDeferralInfo} object.
      *
      * @param pdi
      */
@@ -128,31 +117,28 @@
         super(pdi);
     }
 
-
     /**
      * Returns an array that contains the components of the profile's
      * {@code mediaWhitePointTag}.
      *
-     * @return A 3-element {@code float} array containing the x, y,
-     * and z components of the profile's {@code mediaWhitePointTag}.
+     * @return a 3-element {@code float} array containing the x, y, and z
+     *         components of the profile's {@code mediaWhitePointTag}
      */
     public float[] getMediaWhitePoint() {
         return super.getMediaWhitePoint();
     }
 
-
     /**
-     * Returns a 3x3 {@code float} matrix constructed from the
-     * X, Y, and Z components of the profile's {@code redColorantTag},
+     * Returns a 3x3 {@code float} matrix constructed from the X, Y, and Z
+     * components of the profile's {@code redColorantTag},
      * {@code greenColorantTag}, and {@code blueColorantTag}.
      * <p>
-     * This matrix can be used for color transforms in the forward
-     * direction of the profile--from the profile color space
-     * to the CIEXYZ PCS.
+     * This matrix can be used for color transforms in the forward direction of
+     * the profile--from the profile color space to the CIEXYZ PCS.
      *
-     * @return A 3x3 {@code float} array that contains the x, y, and z
-     * components of the profile's {@code redColorantTag},
-     * {@code greenColorantTag}, and {@code blueColorantTag}.
+     * @return a 3x3 {@code float} array that contains the x, y, and z
+     *         components of the profile's {@code redColorantTag},
+     *         {@code greenColorantTag}, and {@code blueColorantTag}
      */
     public float[][] getMatrix() {
         float[][] theMatrix = new float[3][3];
@@ -174,28 +160,27 @@
     }
 
     /**
-     * Returns a gamma value representing the tone reproduction curve
-     * (TRC) for a particular component.  The component parameter
-     * must be one of REDCOMPONENT, GREENCOMPONENT, or BLUECOMPONENT.
+     * Returns a gamma value representing the tone reproduction curve (TRC) for
+     * a particular component. The component parameter must be one of
+     * {@code REDCOMPONENT}, {@code GREENCOMPONENT}, or {@code BLUECOMPONENT}.
      * <p>
-     * If the profile
-     * represents the TRC for the corresponding component
-     * as a table rather than a single gamma value, an
-     * exception is thrown.  In this case the actual table
-     * can be obtained through the {@link #getTRC(int)} method.
-     * When using a gamma value,
-     * the linear component (R, G, or B) is computed as follows:
+     * If the profile represents the TRC for the corresponding component as a
+     * table rather than a single gamma value, an exception is thrown. In this
+     * case the actual table can be obtained through the {@link #getTRC(int)}
+     * method. When using a gamma value, the linear component (R, G, or B) is
+     * computed as follows:
      * <pre>
      *
      * &nbsp;                                         gamma
      * &nbsp;        linearComponent = deviceComponent
      *
-     *</pre>
-     * @param component The {@code ICC_ProfileRGB} constant that
-     * represents the component whose TRC you want to retrieve
-     * @return the gamma value as a float.
-     * @exception ProfileDataException if the profile does not specify
-     *            the corresponding TRC as a single gamma value.
+     * </pre>
+     *
+     * @param  component the {@code ICC_ProfileRGB} constant that represents the
+     *         component whose TRC you want to retrieve
+     * @return the gamma value as a float
+     * @throws ProfileDataException if the profile does not specify the
+     *         corresponding TRC as a single gamma value
      */
     public float getGamma(int component) {
     float theGamma;
@@ -224,34 +209,29 @@
     }
 
     /**
-     * Returns the TRC for a particular component as an array.
-     * Component must be {@code REDCOMPONENT},
-     * {@code GREENCOMPONENT}, or {@code BLUECOMPONENT}.
-     * Otherwise the returned array
-     * represents a lookup table where the input component value
-     * is conceptually in the range [0.0, 1.0].  Value 0.0 maps
-     * to array index 0 and value 1.0 maps to array index length-1.
-     * Interpolation might be used to generate output values for
-     * input values that do not map exactly to an index in the
-     * array.  Output values also map linearly to the range [0.0, 1.0].
-     * Value 0.0 is represented by an array value of 0x0000 and
-     * value 1.0 by 0xFFFF.  In other words, the values are really unsigned
-     * {@code short} values even though they are returned in a
+     * Returns the TRC for a particular component as an array. Component must be
+     * {@code REDCOMPONENT}, {@code GREENCOMPONENT}, or {@code BLUECOMPONENT}.
+     * Otherwise the returned array represents a lookup table where the input
+     * component value is conceptually in the range [0.0, 1.0]. Value 0.0 maps
+     * to array index 0 and value 1.0 maps to array index {@code length-1}.
+     * Interpolation might be used to generate output values for input values
+     * that do not map exactly to an index in the array. Output values also map
+     * linearly to the range [0.0, 1.0]. Value 0.0 is represented by an array
+     * value of 0x0000 and value 1.0 by 0xFFFF. In other words, the values are
+     * really unsigned {@code short} values even though they are returned in a
      * {@code short} array.
-     *
-     * If the profile has specified the corresponding TRC
-     * as linear (gamma = 1.0) or as a simple gamma value, this method
-     * throws an exception.  In this case, the {@link #getGamma(int)}
-     * method should be used to get the gamma value.
+     * <p>
+     * If the profile has specified the corresponding TRC as linear (gamma =
+     * 1.0) or as a simple gamma value, this method throws an exception. In this
+     * case, the {@link #getGamma(int)} method should be used to get the gamma
+     * value.
      *
-     * @param component The {@code ICC_ProfileRGB} constant that
-     * represents the component whose TRC you want to retrieve:
-     * {@code REDCOMPONENT}, {@code GREENCOMPONENT}, or
-     * {@code BLUECOMPONENT}.
-     *
-     * @return a short array representing the TRC.
-     * @exception ProfileDataException if the profile does not specify
-     *            the corresponding TRC as a table.
+     * @param  component the {@code ICC_ProfileRGB} constant that represents the
+     *         component whose TRC you want to retrieve: {@code REDCOMPONENT},
+     *         {@code GREENCOMPONENT}, or {@code BLUECOMPONENT}
+     * @return a short array representing the TRC
+     * @throws ProfileDataException if the profile does not specify the
+     *         corresponding TRC as a table
      */
     public short[] getTRC(int component) {
     short[] theTRC;
--- a/src/java.desktop/share/classes/java/awt/color/ProfileDataException.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/share/classes/java/awt/color/ProfileDataException.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,18 +26,23 @@
 package java.awt.color;
 
 /**
- * This exception is thrown when an error occurs in accessing or
- * processing an ICC_Profile object.
+ * This exception is thrown when an error occurs in accessing or processing an
+ * {@code ICC_Profile} object.
  */
+public class ProfileDataException extends java.lang.RuntimeException {
 
-public class ProfileDataException extends java.lang.RuntimeException {
+    /**
+     * Use serialVersionUID from JDK 1.2 for interoperability.
+     */
     private static final long serialVersionUID = 7286140888240322498L;
 
     /**
-     *  Constructs a ProfileDataException with the specified detail message.
-     *  @param s the specified detail message
+     * Constructs a {@code ProfileDataException} with the specified detail
+     * message.
+     *
+     * @param  s the specified detail message
      */
     public ProfileDataException(String s) {
-        super (s);
+        super(s);
     }
 }
--- a/src/java.desktop/share/classes/javax/imageio/package-info.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/share/classes/javax/imageio/package-info.java	Mon Nov 12 11:10:16 2018 +0530
@@ -88,7 +88,7 @@
  * <!-- TIFF plugin -->
  *   <tr>
  *     <th scope="row">
- *     <a href="https://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf">
+ *     <a href="https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pdf">
  *     TIFF</a>
  *     <td>yes
  *     <td>yes
--- a/src/java.desktop/share/classes/javax/swing/InputVerifier.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/share/classes/javax/swing/InputVerifier.java	Mon Nov 12 11:10:16 2018 +0530
@@ -69,7 +69,7 @@
  *         getContentPane().add(field1, BorderLayout.NORTH);
  *         getContentPane().add(field2, BorderLayout.SOUTH);
  *
- *         field.setInputVerifier(new InputVerifier() {
+ *         field1.setInputVerifier(new InputVerifier() {
  *             public boolean verify(JComponent input) {
  *                return "pass".equals(((JTextField) input).getText());
  *             }
--- a/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthButtonUI.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthButtonUI.java	Mon Nov 12 11:10:16 2018 +0530
@@ -25,6 +25,8 @@
 
 package javax.swing.plaf.synth;
 
+import sun.awt.AppContext;
+
 import javax.swing.*;
 import java.awt.*;
 import java.beans.*;
@@ -44,6 +46,8 @@
                                  PropertyChangeListener, SynthUI {
     private SynthStyle style;
 
+    private static final Object SYNTH_BUTTON_UI_KEY = new Object();
+
     /**
      * Creates a new UI object for the given component.
      *
@@ -51,7 +55,14 @@
      * @return the UI object
      */
     public static ComponentUI createUI(JComponent c) {
-        return new SynthButtonUI();
+        AppContext appContext = AppContext.getAppContext();
+        SynthButtonUI synthButtonUI =
+                (SynthButtonUI) appContext.get(SYNTH_BUTTON_UI_KEY);
+        if (synthButtonUI == null) {
+            synthButtonUI = new SynthButtonUI();
+            appContext.put(SYNTH_BUTTON_UI_KEY, synthButtonUI);
+        }
+        return synthButtonUI;
     }
 
     /**
@@ -206,7 +217,7 @@
         // layout the text and icon
         SynthContext context = getContext(b);
         FontMetrics fm = context.getComponent().getFontMetrics(
-            context.getStyle().getFont(context));
+                               context.getStyle().getFont(context));
         context.getStyle().getGraphicsUtils(context).layoutText(
             context, fm, b.getText(), b.getIcon(),
             b.getHorizontalAlignment(), b.getVerticalAlignment(),
--- a/src/java.desktop/unix/classes/sun/awt/X11/XDnDDropTargetProtocol.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XDnDDropTargetProtocol.java	Mon Nov 12 11:10:16 2018 +0530
@@ -620,7 +620,7 @@
 
         /* Time stamp - new in XDnD version 1. */
         if (sourceProtocolVersion > 0) {
-            time_stamp = xclient.get_data(3);
+            time_stamp = xclient.get_data(3) & 0xFFFFFFFFL;
         }
 
         /* User action - new in XDnD version 2. */
@@ -867,7 +867,7 @@
          */
         if (dropAction == DnDConstants.ACTION_MOVE && success) {
 
-            long time_stamp = xclient.get_data(2);
+            long time_stamp = xclient.get_data(2) & 0xFFFFFFFFL;
             long xdndSelectionAtom =
                 XDnDConstants.XDnDSelection.getSelectionAtom().getAtom();
 
--- a/src/java.desktop/unix/classes/sun/awt/X11/XKeysym.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XKeysym.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,3 @@
-// This is a generated file: do not edit! Edit keysym2ucs.h if necessary.
-
 /*
  * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,6 +23,19 @@
  * questions.
  */
 
+/*
+ * This file was originally generated by a tool that embedded much of
+ * an X11 keysym header file, keysym2ucs.h, turned into a Java program,
+ * and which also consumed an UnicodeData.txt database file.
+ * keysym2ucs.h and a genhash.awk script were checked in alongside this
+ * source file. Maintaining the Java program to match updated versions
+ * of keysym2ucs.h is too burdensome, since it is rarely, needed and any
+ * updates will be minimal, so they have been removed and
+ * this file can now be hand maintained. If it ever becomes necessary
+ * to re-generate it, then the deleted files can be recovered from
+ * the history.
+ */
+
 package sun.awt.X11;
 import java.util.Hashtable;
 import jdk.internal.misc.Unsafe;
@@ -33,15 +44,6 @@
 
 public class XKeysym {
 
-    public static void main( String[] args ) {
-       System.out.println( "Cyrillc zhe:"+convertKeysym(0x06d6, 0));
-       System.out.println( "Arabic sheen:"+convertKeysym(0x05d4, 0));
-       System.out.println( "Latin a breve:"+convertKeysym(0x01e3, 0));
-       System.out.println( "Latin f:"+convertKeysym(0x066, 0));
-       System.out.println( "Backspace:"+Integer.toHexString(convertKeysym(0xff08, 0)));
-       System.out.println( "Ctrl+f:"+Integer.toHexString(convertKeysym(0x066, XConstants.ControlMask)));
-    }
-
     private XKeysym() {}
 
     static class Keysym2JavaKeycode  {
@@ -71,7 +73,7 @@
     static long keysym_uppercase = unsafe.allocateMemory(Native.getLongSize());
     static Keysym2JavaKeycode kanaLock = new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_KANA_LOCK,
                                                                 java.awt.event.KeyEvent.KEY_LOCATION_STANDARD);
-    private static PlatformLogger keyEventLog = PlatformLogger.getLogger("sun.awt.X11.kye.XKeysym");
+    private static PlatformLogger keyEventLog = PlatformLogger.getLogger("sun.awt.X11.key.XKeysym");
     public static char convertKeysym( long ks, int state ) {
 
         /* First check for Latin-1 characters (1:1 mapping) */
--- a/src/java.desktop/unix/classes/sun/awt/X11/XMSelection.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XMSelection.java	Mon Nov 12 11:10:16 2018 +0530
@@ -200,7 +200,7 @@
             if (log.isLoggable(PlatformLogger.Level.FINE)) {
                 log.fine("client messags = " + xce);
             }
-            long timestamp = xce.get_data(0);
+            long timestamp = xce.get_data(0) & 0xFFFFFFFFL;
             long atom = xce.get_data(1);
             long owner = xce.get_data(2);
             long data = xce.get_data(3);
--- a/src/java.desktop/unix/classes/sun/awt/X11/genhash.awk	Sun Nov 11 21:24:46 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-# Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-#  With this script one can generate a new version XKeysym.java file out
-#  of keysym2ucs.h prototype and UnicodeData.txt database.
-#  Latter file should be fetched from a unicode.org site, most
-#  probably http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
-#
-BEGIN {   FS=";";
-          while((getline < "UnicodeData.txt")){
-              unic[$1]=$2;
-          }
-          FS=" ";
-          print("// This is a generated file: do not edit! Edit keysym2ucs.h if necessary.\n");          
-      }
-
-/^0x/{
-         if( $1 != "0x0000" ) {
-             ndx =  toupper($1);
-             sub(/0X/, "", ndx);
-             printf("        keysym2UCSHash.put( (long)%s, (char)%s); // %s -->%s\n",
-                        $4, $1, $3, (unic[ndx]=="" ? "" : " " unic[ndx]));
-         }
-     }
-/tojava/ { sub(/tojava /, ""); sub(/tojava$/, ""); print}    
--- a/src/java.desktop/unix/classes/sun/awt/X11/keysym2ucs.h	Sun Nov 11 21:24:46 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2758 +0,0 @@
-/*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * yan:
- * This table looks like C header because
- * (1) I use actual headers to make it;
- * (2) syntax is nicely highlighted in my editor.
- * Processed will be all lines started with 0x; 0x0000-started lines will
- * be skipped though.
- * Also java code will be copied to a resulting file.
- *
- * 0x0000 unicode means here either there's no equivalent to a keysym
- * or we just skip it from the table for now because i.e. we'll never use
- * the conversion in our workflow.
- *
- */
-
-tojava /*
-tojava  * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
-tojava  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-tojava  *
-tojava  * This code is free software; you can redistribute it and/or modify it
-tojava  * under the terms of the GNU General Public License version 2 only, as
-tojava  * published by the Free Software Foundation.  Oracle designates this
-tojava  * particular file as subject to the "Classpath" exception as provided
-tojava  * by Oracle in the LICENSE file that accompanied this code.
-tojava  *
-tojava  * This code is distributed in the hope that it will be useful, but WITHOUT
-tojava  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-tojava  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-tojava  * version 2 for more details (a copy is included in the LICENSE file that
-tojava  * accompanied this code).
-tojava  *
-tojava  * You should have received a copy of the GNU General Public License version
-tojava  * 2 along with this work; if not, write to the Free Software Foundation,
-tojava  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-tojava  *
-tojava  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-tojava  * or visit www.oracle.com if you need additional information or have any
-tojava  * questions.
-tojava  */
-tojava
-tojava package sun.awt.X11;
-tojava import java.util.Hashtable;
-tojava import jdk.internal.misc.Unsafe;
-tojava
-tojava import sun.util.logging.PlatformLogger;
-tojava
-tojava public class XKeysym {
-tojava
-tojava     public static void main( String args[] ) {
-tojava        System.out.println( "Cyrillc zhe:"+convertKeysym(0x06d6, 0));
-tojava        System.out.println( "Arabic sheen:"+convertKeysym(0x05d4, 0));
-tojava        System.out.println( "Latin a breve:"+convertKeysym(0x01e3, 0));
-tojava        System.out.println( "Latin f:"+convertKeysym(0x066, 0));
-tojava        System.out.println( "Backspace:"+Integer.toHexString(convertKeysym(0xff08, 0)));
-tojava        System.out.println( "Ctrl+f:"+Integer.toHexString(convertKeysym(0x066, XConstants.ControlMask)));
-tojava     }
-tojava
-tojava     private XKeysym() {}
-tojava
-tojava     static class Keysym2JavaKeycode  {
-tojava         int jkeycode;
-tojava         int keyLocation;
-tojava         int getJavaKeycode() {
-tojava             return jkeycode;
-tojava         }
-tojava         int getKeyLocation() {
-tojava             return keyLocation;
-tojava         }
-tojava         Keysym2JavaKeycode(int jk, int loc) {
-tojava             jkeycode = jk;
-tojava             keyLocation = loc;
-tojava         }
-tojava     };
-tojava     private static Unsafe unsafe = XlibWrapper.unsafe;
-tojava     static Hashtable<Long, Keysym2JavaKeycode>  keysym2JavaKeycodeHash = new Hashtable<Long, Keysym2JavaKeycode>();
-tojava     static Hashtable<Long, Character> keysym2UCSHash = new Hashtable<Long, Character>();
-tojava     static Hashtable<Long, Long> uppercaseHash = new Hashtable<Long, Long>();
-tojava     // TODO: or not to do: add reverse lookup javakeycode2keysym,
-tojava     // for robot only it seems to me. After that, we can remove lookup table
-tojava     // from XWindow.c altogether.
-tojava     // Another use for reverse lookup: query keyboard state, for some keys.
-tojava     static Hashtable<Integer, Long> javaKeycode2KeysymHash = new Hashtable<Integer, Long>();
-tojava     static long keysym_lowercase = unsafe.allocateMemory(Native.getLongSize());
-tojava     static long keysym_uppercase = unsafe.allocateMemory(Native.getLongSize());
-tojava     static Keysym2JavaKeycode kanaLock = new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_KANA_LOCK,
-tojava                                                                 java.awt.event.KeyEvent.KEY_LOCATION_STANDARD);
-tojava     private static PlatformLogger keyEventLog = PlatformLogger.getLogger("sun.awt.X11.kye.XKeysym");
-tojava     public static char convertKeysym( long ks, int state ) {
-tojava
-tojava         /* First check for Latin-1 characters (1:1 mapping) */
-tojava         if ((ks >= 0x0020 && ks <= 0x007e) ||
-tojava             (ks >= 0x00a0 && ks <= 0x00ff)) {
-tojava             if( (state & XConstants.ControlMask) != 0 ) {
-tojava                 if ((ks >= 'A' && ks <= ']') || (ks == '_') ||
-tojava                     (ks >= 'a' && ks <='z')) {
-tojava                     ks &= 0x1F;
-tojava                 }
-tojava             }
-tojava             return (char)ks;
-tojava         }
-tojava
-tojava         /* XXX: Also check for directly encoded 24-bit UCS characters:
-tojava          */
-tojava         if ((ks & 0xff000000) == 0x01000000)
-tojava           return (char)(ks & 0x00ffffff);
-tojava
-tojava         Character ch = keysym2UCSHash.get(ks);
-tojava         return ch == null ? (char)0 : ch.charValue();
-tojava     }
-tojava     static long xkeycode2keysym_noxkb(XKeyEvent ev, int ndx) {
-tojava         XToolkit.awtLock();
-tojava         try {
-tojava             return XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), ndx);
-tojava         } finally {
-tojava             XToolkit.awtUnlock();
-tojava         }
-tojava     }
-tojava     static long xkeycode2keysym_xkb(XKeyEvent ev, int ndx) {
-tojava         XToolkit.awtLock();
-tojava         try {
-tojava             int mods = ev.get_state();
-tojava             if ((ndx == 0) && ((mods & XConstants.ShiftMask) != 0)) {
-tojava                 // I don't know all possible meanings of 'ndx' in case of XKB
-tojava                 // and don't want to speculate. But this particular case
-tojava                 // clearly means that caller needs a so called primary keysym.
-tojava                 mods ^= XConstants.ShiftMask;
-tojava             }
-tojava             long kbdDesc = XToolkit.getXKBKbdDesc();
-tojava             if( kbdDesc != 0 ) {
-tojava                 XlibWrapper.XkbTranslateKeyCode(kbdDesc, ev.get_keycode(),
-tojava                        mods, XlibWrapper.iarg1, XlibWrapper.larg3);
-tojava             }else{
-tojava                 // xkb resources already gone
-tojava                 keyEventLog.fine("Thread race: Toolkit shutdown before the end of a key event processing.");
-tojava                 return 0;
-tojava             }
-tojava             //XXX unconsumed modifiers?
-tojava             return Native.getLong(XlibWrapper.larg3);
-tojava         } finally {
-tojava             XToolkit.awtUnlock();
-tojava         }
-tojava     }
-tojava     static long xkeycode2keysym(XKeyEvent ev, int ndx) {
-tojava         XToolkit.awtLock();
-tojava         try {
-tojava             if (XToolkit.canUseXKBCalls()) {
-tojava                 return xkeycode2keysym_xkb(ev, ndx);
-tojava             }else{
-tojava                 return xkeycode2keysym_noxkb(ev, ndx);
-tojava             }
-tojava         } finally {
-tojava             XToolkit.awtUnlock();
-tojava         }
-tojava     }
-tojava     static long xkeycode2primary_keysym(XKeyEvent ev) {
-tojava         return xkeycode2keysym(ev, 0);
-tojava     }
-tojava     public static boolean isKPEvent( XKeyEvent ev )
-tojava     {
-tojava         // Xsun without XKB uses keysymarray[2] keysym to determine if it is KP event.
-tojava         // Otherwise, it is [1].
-tojava         int ndx = XToolkit.isXsunKPBehavior() &&
-tojava                   ! XToolkit.isXKBenabled() ? 2 : 1;
-tojava         // Even if XKB is enabled, we have another problem: some symbol tables (e.g. cz) force
-tojava         // a regular comma instead of KP_comma for a decimal separator. Result is,
-tojava         // bugs like 6454041. So, we will try for keypadness  a keysym with ndx==0 as well.
-tojava         XToolkit.awtLock();
-tojava         try {
-tojava             return (XlibWrapper.IsKeypadKey(
-tojava                 XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), ndx ) ) ||
-tojava                    XlibWrapper.IsKeypadKey(
-tojava                 XlibWrapper.XKeycodeToKeysym(ev.get_display(), ev.get_keycode(), 0 ) ));
-tojava         } finally {
-tojava             XToolkit.awtUnlock();
-tojava         }
-tojava     }
-tojava     /**
-tojava         Return uppercase keysym correspondent to a given keysym.
-tojava         If input keysym does not belong to any lower/uppercase pair, return -1.
-tojava     */
-tojava     public static long getUppercaseAlphabetic( long keysym ) {
-tojava         long lc = -1;
-tojava         long uc = -1;
-tojava         Long stored =  uppercaseHash.get(keysym);
-tojava         if (stored != null ) {
-tojava             return stored.longValue();
-tojava         }
-tojava         XToolkit.awtLock();
-tojava         try {
-tojava             XlibWrapper.XConvertCase(keysym, keysym_lowercase, keysym_uppercase);
-tojava             lc = Native.getLong(keysym_lowercase);
-tojava             uc = Native.getLong(keysym_uppercase);
-tojava             if (lc == uc) {
-tojava                 //not applicable
-tojava                 uc = -1;
-tojava             }
-tojava             uppercaseHash.put(keysym, uc);
-tojava         } finally {
-tojava             XToolkit.awtUnlock();
-tojava         }
-tojava         return uc;
-tojava     }
-tojava     /**
-tojava         Get a keypad keysym derived from a keycode.
-tojava         I do not check if this is a keypad event, I just presume it.
-tojava     */
-tojava     private static long getKeypadKeysym( XKeyEvent ev ) {
-tojava         int ndx = 0;
-tojava         long keysym = XConstants.NoSymbol;
-tojava         if( XToolkit.isXsunKPBehavior() &&
-tojava             ! XToolkit.isXKBenabled() ) {
-tojava             if( (ev.get_state() & XConstants.ShiftMask) != 0 ) { // shift modifier is on
-tojava                 ndx = 3;
-tojava                 keysym = xkeycode2keysym(ev, ndx);
-tojava             } else {
-tojava                 ndx = 2;
-tojava                 keysym = xkeycode2keysym(ev, ndx);
-tojava             }
-tojava         } else {
-tojava             if( (ev.get_state() & XConstants.ShiftMask) != 0 || // shift modifier is on
-tojava                 ((ev.get_state() & XConstants.LockMask) != 0 && // lock modifier is on
-tojava                  (XToolkit.modLockIsShiftLock != 0)) ) {     // it is interpreted as ShiftLock
-tojava                 ndx = 0;
-tojava                 keysym = xkeycode2keysym(ev, ndx);
-tojava             } else {
-tojava                 ndx = 1;
-tojava                 keysym = xkeycode2keysym(ev, ndx);
-tojava             }
-tojava         }
-tojava         return keysym;
-tojava     }
-tojava
-tojava     /**
-tojava         Return java.awt.KeyEvent constant meaning (Java) keycode, derived from X keysym.
-tojava         Some keysyms maps to more than one keycode, these would require extra processing.
-tojava     */
-tojava     static Keysym2JavaKeycode getJavaKeycode( long keysym ) {
-tojava         if(keysym == XKeySymConstants.XK_Mode_switch){
-tojava            /* XK_Mode_switch on solaris maps either to VK_ALT_GRAPH (default) or VK_KANA_LOCK */
-tojava            if( XToolkit.isKanaKeyboard() ) {
-tojava                return kanaLock;
-tojava            }
-tojava         }else if(keysym == XKeySymConstants.XK_L1){
-tojava            /* if it is Sun keyboard, trick hash to return VK_STOP else VK_F11 (default) */
-tojava            if( XToolkit.isSunKeyboard() ) {
-tojava                keysym = XKeySymConstants.SunXK_Stop;
-tojava            }
-tojava         }else if(keysym == XKeySymConstants.XK_L2) {
-tojava            /* if it is Sun keyboard, trick hash to return VK_AGAIN else VK_F12 (default) */
-tojava            if( XToolkit.isSunKeyboard() ) {
-tojava                keysym = XKeySymConstants.SunXK_Again;
-tojava            }
-tojava         }
-tojava
-tojava         return  keysym2JavaKeycodeHash.get( keysym );
-tojava     }
-tojava     /**
-tojava         Return java.awt.KeyEvent constant meaning (Java) keycode, derived from X Window KeyEvent.
-tojava         Algorithm is, extract via XKeycodeToKeysym  a proper keysym according to Xlib spec rules and
-tojava         err exceptions, then search a java keycode in a table.
-tojava     */
-tojava     static Keysym2JavaKeycode getJavaKeycode( XKeyEvent ev ) {
-tojava         // get from keysym2JavaKeycodeHash.
-tojava         long keysym = XConstants.NoSymbol;
-tojava         int ndx = 0;
-tojava         if( (ev.get_state() & XToolkit.numLockMask) != 0 &&
-tojava              isKPEvent(ev)) {
-tojava             keysym = getKeypadKeysym( ev );
-tojava         } else {
-tojava             // we only need primary-layer keysym to derive a java keycode.
-tojava             ndx = 0;
-tojava             keysym = xkeycode2keysym(ev, ndx);
-tojava         }
-tojava
-tojava         Keysym2JavaKeycode jkc = getJavaKeycode( keysym );
-tojava         return jkc;
-tojava     }
-tojava     static int getJavaKeycodeOnly( XKeyEvent ev ) {
-tojava         Keysym2JavaKeycode jkc = getJavaKeycode( ev );
-tojava         return jkc == null ? java.awt.event.KeyEvent.VK_UNDEFINED : jkc.getJavaKeycode();
-tojava     }
-tojava     /**
-tojava      * Return an integer java keycode apprx as it was before extending keycodes range.
-tojava      * This call would ignore for instance XKB and process whatever is on the bottom
-tojava      * of keysym stack. Result will not depend on actual locale, will differ between
-tojava      * dual/multiple keyboard setup systems (e.g. English+Russian vs French+Russian)
-tojava      * but will be someway compatible with old releases.
-tojava      */
-tojava     static int getLegacyJavaKeycodeOnly( XKeyEvent ev ) {
-tojava         long keysym = XConstants.NoSymbol;
-tojava         int ndx = 0;
-tojava         if( (ev.get_state() & XToolkit.numLockMask) != 0 &&
-tojava              isKPEvent(ev)) {
-tojava             keysym = getKeypadKeysym( ev );
-tojava         } else {
-tojava             // we only need primary-layer keysym to derive a java keycode.
-tojava             ndx = 0;
-tojava             keysym = xkeycode2keysym_noxkb(ev, ndx);
-tojava         }
-tojava         Keysym2JavaKeycode jkc = getJavaKeycode( keysym );
-tojava         return jkc == null ? java.awt.event.KeyEvent.VK_UNDEFINED : jkc.getJavaKeycode();
-tojava     }
-tojava     static long javaKeycode2Keysym( int jkey ) {
-tojava         Long ks = javaKeycode2KeysymHash.get( jkey );
-tojava         return  (ks == null ? 0 : ks.longValue());
-tojava     }
-tojava     /**
-tojava         Return keysym derived from a keycode and modifiers.
-tojava         Usually an input method does this. However non-system input methods (e.g. Java IMs) do not.
-tojava         For rules, see "Xlib - C Language X Interface",
-tojava                         MIT X Consortium Standard
-tojava                         X Version 11, Release 6
-tojava                         Ch. 12.7
-tojava         XXX TODO: or maybe not to do: process Mode Lock and therefore
-tojava         not only 0-th and 1-st but 2-nd and 3-rd keysyms for a keystroke.
-tojava     */
-tojava     static long getKeysym( XKeyEvent ev ) {
-tojava         long keysym = XConstants.NoSymbol;
-tojava         long uppercaseKeysym = XConstants.NoSymbol;
-tojava         int  ndx = 0;
-tojava         boolean getUppercase = false;
-tojava         if ((ev.get_state() & XToolkit.numLockMask) != 0 &&
-tojava              isKPEvent(ev)) {
-tojava             keysym = getKeypadKeysym( ev );
-tojava         } else {
-tojava             // XXX: at this point, anything in keysym[23] is ignored.
-tojava             //
-tojava             // Shift & Lock are off ===> ndx = 0;
-tojava             // Shift off & Lock on & Lock is CapsLock ===> ndx = 0;
-tojava             //       if keysym[ndx] is lowecase alphabetic, then corresp. uppercase used.
-tojava             // Shift on & Lock on & Lock is CapsLock ===> ndx == 1;
-tojava             //       if keysym[ndx] is lowecase alphabetic, then corresp. uppercase used.
-tojava             // Shift on || (Lock on & Lock is ShiftLock) ===> ndx = 1.
-tojava             if ((ev.get_state() & XConstants.ShiftMask) == 0) {     // shift is off
-tojava                 if ((ev.get_state() & XConstants.LockMask) == 0 ) {  // lock is off
-tojava                     ndx = 0;
-tojava                     getUppercase = false;
-tojava                 } else if ((ev.get_state() & XConstants.LockMask) != 0 && // lock is on
-tojava                      (XToolkit.modLockIsShiftLock == 0)) { // lock is capslock
-tojava                     ndx = 0;
-tojava                     getUppercase = true;
-tojava                 } else if ((ev.get_state() & XConstants.LockMask) != 0 && // lock is on
-tojava                      (XToolkit.modLockIsShiftLock != 0)) { // lock is shift lock
-tojava                     ndx = 1;
-tojava                     getUppercase = false;
-tojava                 }
-tojava             } else { // shift on
-tojava                 if ((ev.get_state() & XConstants.LockMask) != 0 && // lock is on
-tojava                      (XToolkit.modLockIsShiftLock == 0)) { // lock is capslock
-tojava                     ndx = 1;
-tojava                     getUppercase = true;
-tojava                 } else {
-tojava                     ndx = 1;
-tojava                     getUppercase = false;
-tojava                 }
-tojava             }
-tojava             keysym = xkeycode2keysym(ev, ndx);
-tojava             if (getUppercase && (uppercaseKeysym =  getUppercaseAlphabetic( keysym )) != -1) {
-tojava                 keysym = uppercaseKeysym;
-tojava             }
-tojava         }
-tojava         return keysym;
-tojava     }
-tojava
-tojava     static {
-
-/***********************************************************
-Copyright 1987, 1994, 1998  The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts
-
-                        All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-/*
- * TTY Functions, cleverly chosen to map to ascii, for convenience of
- * programming, but could have been arbitrary (at the cost of lookup
- * tables in client code.
- */
-
-0x0008 #define XK_BackSpace        0xFF08    /* back space, back char */
-0x0009 #define XK_Tab            0xFF09
-0x000a #define XK_Linefeed        0xFF0A    /* Linefeed, LF */
-0x000b #define XK_Clear        0xFF0B
-/*XXX map to 0a instead of 0d - why? for some good reason I hope */
-0x000a #define XK_Return        0xFF0D    /* Return, enter */
-0x0000 #define XK_Pause        0xFF13    /* Pause, hold */
-0x0000 #define XK_Scroll_Lock        0xFF14
-0x0000 #define XK_Sys_Req        0xFF15
-0x001B #define XK_Escape        0xFF1B
-0x007F #define XK_Delete        0xFFFF    /* Delete, rubout */
-
-
-
-/* International & multi-key character composition */
-
-0x0000 #define XK_Multi_key        0xFF20  /* Multi-key character compose */
-0x0000 #define XK_Codeinput        0xFF37
-0x0000 #define XK_SingleCandidate    0xFF3C
-0x0000 #define XK_MultipleCandidate    0xFF3D
-0x0000 #define XK_PreviousCandidate    0xFF3E
-
-/* Japanese keyboard support */
-
-0x0000 #define XK_Kanji        0xFF21    /* Kanji, Kanji convert */
-0x0000 #define XK_Muhenkan        0xFF22  /* Cancel Conversion */
-0x0000 #define XK_Henkan_Mode        0xFF23  /* Start/Stop Conversion */
-0x0000 #define XK_Henkan        0xFF23  /* Alias for Henkan_Mode */
-0x0000 #define XK_Romaji        0xFF24  /* to Romaji */
-0x0000 #define XK_Hiragana        0xFF25  /* to Hiragana */
-0x0000 #define XK_Katakana        0xFF26  /* to Katakana */
-0x0000 #define XK_Hiragana_Katakana    0xFF27  /* Hiragana/Katakana toggle */
-0x0000 #define XK_Zenkaku        0xFF28  /* to Zenkaku */
-0x0000 #define XK_Hankaku        0xFF29  /* to Hankaku */
-0x0000 #define XK_Zenkaku_Hankaku    0xFF2A  /* Zenkaku/Hankaku toggle */
-0x0000 #define XK_Touroku        0xFF2B  /* Add to Dictionary */
-0x0000 #define XK_Massyo        0xFF2C  /* Delete from Dictionary */
-0x0000 #define XK_Kana_Lock        0xFF2D  /* Kana Lock */
-0x0000 #define XK_Kana_Shift        0xFF2E  /* Kana Shift */
-0x0000 #define XK_Eisu_Shift        0xFF2F  /* Alphanumeric Shift */
-0x0000 #define XK_Eisu_toggle        0xFF30  /* Alphanumeric toggle */
-0x0000 #define XK_Kanji_Bangou        0xFF37  /* Codeinput */
-0x0000 #define XK_Zen_Koho        0xFF3D    /* Multiple/All Candidate(s) */
-0x0000 #define XK_Mae_Koho        0xFF3E    /* Previous Candidate */
-
-/* Cursor control & motion */
-
-0x0000 #define XK_Home            0xFF50
-0x0000 #define XK_Left            0xFF51    /* Move left, left arrow */
-0x0000 #define XK_Up            0xFF52    /* Move up, up arrow */
-0x0000 #define XK_Right        0xFF53    /* Move right, right arrow */
-0x0000 #define XK_Down            0xFF54    /* Move down, down arrow */
-0x0000 #define XK_Prior        0xFF55    /* Prior, previous */
-0x0000 #define XK_Page_Up        0xFF55
-0x0000 #define XK_Next            0xFF56    /* Next */
-0x0000 #define XK_Page_Down        0xFF56
-0x0000 #define XK_End            0xFF57    /* EOL */
-0x0000 #define XK_Begin        0xFF58    /* BOL */
-
-
-/* Misc Functions */
-
-0x0000 #define XK_Select        0xFF60    /* Select, mark */
-0x0000 #define XK_Print        0xFF61
-0x0000 #define XK_Execute        0xFF62    /* Execute, run, do */
-0x0000 #define XK_Insert        0xFF63    /* Insert, insert here */
-0x0000 #define XK_Undo            0xFF65    /* Undo, oops */
-0x0000 #define XK_Redo            0xFF66    /* redo, again */
-0x0000 #define XK_Menu            0xFF67
-0x0000 #define XK_Find            0xFF68    /* Find, search */
-0x0000 #define XK_Cancel        0xFF69    /* Cancel, stop, abort, exit */
-0x0000 #define XK_Help            0xFF6A    /* Help */
-0x0000 #define XK_Break        0xFF6B
-0x0000 #define XK_Mode_switch        0xFF7E    /* Character set switch */
-0x0000 #define XK_script_switch        0xFF7E  /* Alias for mode_switch */
-0x0000 #define XK_Num_Lock        0xFF7F
-
-/* Keypad Functions, keypad numbers cleverly chosen to map to ascii */
-
-0x0020 #define XK_KP_Space        0xFF80    /* space */
-0x0009 #define XK_KP_Tab        0xFF89
-0x000A #define XK_KP_Enter        0xFF8D    /* enter: note that it is again 0A */
-0x0000 #define XK_KP_F1        0xFF91    /* PF1, KP_A, ... */
-0x0000 #define XK_KP_F2        0xFF92
-0x0000 #define XK_KP_F3        0xFF93
-0x0000 #define XK_KP_F4        0xFF94
-0x0000 #define XK_KP_Home        0xFF95
-0x0000 #define XK_KP_Left        0xFF96
-0x0000 #define XK_KP_Up        0xFF97
-0x0000 #define XK_KP_Right        0xFF98
-0x0000 #define XK_KP_Down        0xFF99
-0x0000 #define XK_KP_Prior        0xFF9A
-0x0000 #define XK_KP_Page_Up        0xFF9A
-0x0000 #define XK_KP_Next        0xFF9B
-0x0000 #define XK_KP_Page_Down        0xFF9B
-0x0000 #define XK_KP_End        0xFF9C
-0x0000 #define XK_KP_Begin        0xFF9D
-0x0000 #define XK_KP_Insert        0xFF9E
-0x007F #define XK_KP_Delete        0xFF9F
-0x003d #define XK_KP_Equal        0xFFBD    /* equals */
-0x002a #define XK_KP_Multiply        0xFFAA
-0x002b #define XK_KP_Add        0xFFAB
-0x002c #define XK_KP_Separator        0xFFAC    /* separator, often comma */
-0x002d #define XK_KP_Subtract        0xFFAD
-0x002e #define XK_KP_Decimal        0xFFAE
-0x002f #define XK_KP_Divide        0xFFAF
-
-0x0030 #define XK_KP_0            0xFFB0
-0x0031 #define XK_KP_1            0xFFB1
-0x0032 #define XK_KP_2            0xFFB2
-0x0033 #define XK_KP_3            0xFFB3
-0x0034 #define XK_KP_4            0xFFB4
-0x0035 #define XK_KP_5            0xFFB5
-0x0036 #define XK_KP_6            0xFFB6
-0x0037 #define XK_KP_7            0xFFB7
-0x0038 #define XK_KP_8            0xFFB8
-0x0039 #define XK_KP_9            0xFFB9
-
-
-
-/*
- * Auxilliary Functions; note the duplicate definitions for left and right
- * function keys;  Sun keyboards and a few other manufactures have such
- * function key groups on the left and/or right sides of the keyboard.
- * We've not found a keyboard with more than 35 function keys total.
- */
-
-0x0000 #define XK_F1            0xFFBE
-0x0000 #define XK_F2            0xFFBF
-0x0000 #define XK_F3            0xFFC0
-0x0000 #define XK_F4            0xFFC1
-0x0000 #define XK_F5            0xFFC2
-0x0000 #define XK_F6            0xFFC3
-0x0000 #define XK_F7            0xFFC4
-0x0000 #define XK_F8            0xFFC5
-0x0000 #define XK_F9            0xFFC6
-0x0000 #define XK_F10            0xFFC7
-0x0000 #define XK_F11            0xFFC8
-0x0000 #define XK_L1            0xFFC8
-0x0000 #define XK_F12            0xFFC9
-0x0000 #define XK_L2            0xFFC9
-0x0000 #define XK_F13            0xFFCA
-0x0000 #define XK_L3            0xFFCA
-0x0000 #define XK_F14            0xFFCB
-0x0000 #define XK_L4            0xFFCB
-0x0000 #define XK_F15            0xFFCC
-0x0000 #define XK_L5            0xFFCC
-0x0000 #define XK_F16            0xFFCD
-0x0000 #define XK_L6            0xFFCD
-0x0000 #define XK_F17            0xFFCE
-0x0000 #define XK_L7            0xFFCE
-0x0000 #define XK_F18            0xFFCF
-0x0000 #define XK_L8            0xFFCF
-0x0000 #define XK_F19            0xFFD0
-0x0000 #define XK_L9            0xFFD0
-0x0000 #define XK_F20            0xFFD1
-0x0000 #define XK_L10            0xFFD1
-0x0000 #define XK_F21            0xFFD2
-0x0000 #define XK_R1            0xFFD2
-0x0000 #define XK_F22            0xFFD3
-0x0000 #define XK_R2            0xFFD3
-0x0000 #define XK_F23            0xFFD4
-0x0000 #define XK_R3            0xFFD4
-0x0000 #define XK_F24            0xFFD5
-0x0000 #define XK_R4            0xFFD5
-0x0000 #define XK_F25            0xFFD6
-0x0000 #define XK_R5            0xFFD6
-0x0000 #define XK_F26            0xFFD7
-0x0000 #define XK_R6            0xFFD7
-0x0000 #define XK_F27            0xFFD8
-0x0000 #define XK_R7            0xFFD8
-0x0000 #define XK_F28            0xFFD9
-0x0000 #define XK_R8            0xFFD9
-0x0000 #define XK_F29            0xFFDA
-0x0000 #define XK_R9            0xFFDA
-0x0000 #define XK_F30            0xFFDB
-0x0000 #define XK_R10            0xFFDB
-0x0000 #define XK_F31            0xFFDC
-0x0000 #define XK_R11            0xFFDC
-0x0000 #define XK_F32            0xFFDD
-0x0000 #define XK_R12            0xFFDD
-0x0000 #define XK_F33            0xFFDE
-0x0000 #define XK_R13            0xFFDE
-0x0000 #define XK_F34            0xFFDF
-0x0000 #define XK_R14            0xFFDF
-0x0000 #define XK_F35            0xFFE0
-0x0000 #define XK_R15            0xFFE0
-
-/* Modifiers */
-
-0x0000 #define XK_Shift_L        0xFFE1    /* Left shift */
-0x0000 #define XK_Shift_R        0xFFE2    /* Right shift */
-0x0000 #define XK_Control_L        0xFFE3    /* Left control */
-0x0000 #define XK_Control_R        0xFFE4    /* Right control */
-0x0000 #define XK_Caps_Lock        0xFFE5    /* Caps lock */
-0x0000 #define XK_Shift_Lock        0xFFE6    /* Shift lock */
-
-0x0000 #define XK_Meta_L        0xFFE7    /* Left meta */
-0x0000 #define XK_Meta_R        0xFFE8    /* Right meta */
-0x0000 #define XK_Alt_L        0xFFE9    /* Left alt */
-0x0000 #define XK_Alt_R        0xFFEA    /* Right alt */
-0x0000 #define XK_Super_L        0xFFEB    /* Left super */
-0x0000 #define XK_Super_R        0xFFEC    /* Right super */
-0x0000 #define XK_Hyper_L        0xFFED    /* Left hyper */
-0x0000 #define XK_Hyper_R        0xFFEE    /* Right hyper */
-#endif /* XK_MISCELLANY */
-
-/*
- * ISO 9995 Function and Modifier Keys
- * Byte 3 = 0xFE
- */
-
-#ifdef XK_XKB_KEYS
-0x0000 #define    XK_ISO_Lock                    0xFE01
-0x0000 #define    XK_ISO_Level2_Latch                0xFE02
-0x0000 #define    XK_ISO_Level3_Shift                0xFE03
-0x0000 #define    XK_ISO_Level3_Latch                0xFE04
-0x0000 #define    XK_ISO_Level3_Lock                0xFE05
-0x0000 #define    XK_ISO_Group_Shift        0xFF7E    /* Alias for mode_switch */
-0x0000 #define    XK_ISO_Group_Latch                0xFE06
-0x0000 #define    XK_ISO_Group_Lock                0xFE07
-0x0000 #define    XK_ISO_Next_Group                0xFE08
-0x0000 #define    XK_ISO_Next_Group_Lock                0xFE09
-0x0000 #define    XK_ISO_Prev_Group                0xFE0A
-0x0000 #define    XK_ISO_Prev_Group_Lock                0xFE0B
-0x0000 #define    XK_ISO_First_Group                0xFE0C
-0x0000 #define    XK_ISO_First_Group_Lock                0xFE0D
-0x0000 #define    XK_ISO_Last_Group                0xFE0E
-0x0000 #define    XK_ISO_Last_Group_Lock                0xFE0F
-
-0x0009 #define    XK_ISO_Left_Tab                    0xFE20
-0x0000 #define    XK_ISO_Move_Line_Up                0xFE21
-0x0000 #define    XK_ISO_Move_Line_Down                0xFE22
-0x0000 #define    XK_ISO_Partial_Line_Up                0xFE23
-0x0000 #define    XK_ISO_Partial_Line_Down            0xFE24
-0x0000 #define    XK_ISO_Partial_Space_Left            0xFE25
-0x0000 #define    XK_ISO_Partial_Space_Right            0xFE26
-0x0000 #define    XK_ISO_Set_Margin_Left                0xFE27
-0x0000 #define    XK_ISO_Set_Margin_Right                0xFE28
-0x0000 #define    XK_ISO_Release_Margin_Left            0xFE29
-0x0000 #define    XK_ISO_Release_Margin_Right            0xFE2A
-0x0000 #define    XK_ISO_Release_Both_Margins            0xFE2B
-0x0000 #define    XK_ISO_Fast_Cursor_Left                0xFE2C
-0x0000 #define    XK_ISO_Fast_Cursor_Right            0xFE2D
-0x0000 #define    XK_ISO_Fast_Cursor_Up                0xFE2E
-0x0000 #define    XK_ISO_Fast_Cursor_Down                0xFE2F
-0x0000 #define    XK_ISO_Continuous_Underline            0xFE30
-0x0000 #define    XK_ISO_Discontinuous_Underline            0xFE31
-0x0000 #define    XK_ISO_Emphasize                0xFE32
-0x0000 #define    XK_ISO_Center_Object                0xFE33
-0x0000 #define    XK_ISO_Enter                    0xFE34
-
-0x02CB #define    XK_dead_grave                    0xFE50
-0x02CA #define    XK_dead_acute                    0xFE51
-0x02C6 #define    XK_dead_circumflex                0xFE52
-0x02DC #define    XK_dead_tilde                    0xFE53
-0x02C9 #define    XK_dead_macron                    0xFE54
-0x02D8 #define    XK_dead_breve                    0xFE55
-0x02D9 #define    XK_dead_abovedot                0xFE56
-0x00A8 #define    XK_dead_diaeresis                0xFE57
-0x02DA #define    XK_dead_abovering                0xFE58
-0x02DD #define    XK_dead_doubleacute                0xFE59
-0x02C7 #define    XK_dead_caron                    0xFE5A
-0x00B8 #define    XK_dead_cedilla                    0xFE5B
-0x02DB #define    XK_dead_ogonek                    0xFE5C
-0x0269 #define    XK_dead_iota                    0xFE5D
-0x3099 #define    XK_dead_voiced_sound                0xFE5E
-0x309A #define    XK_dead_semivoiced_sound            0xFE5F
-0x0323 #define    XK_dead_belowdot                0xFE60
-0x0321 #define XK_dead_hook                    0xFE61
-0x031B #define XK_dead_horn                    0xFE62
-
-0x0000 #define    XK_First_Virtual_Screen                0xFED0
-0x0000 #define    XK_Prev_Virtual_Screen                0xFED1
-0x0000 #define    XK_Next_Virtual_Screen                0xFED2
-0x0000 #define    XK_Last_Virtual_Screen                0xFED4
-0x0000 #define    XK_Terminate_Server                0xFED5
-
-0x0000 #define    XK_AccessX_Enable                0xFE70
-0x0000 #define    XK_AccessX_Feedback_Enable            0xFE71
-0x0000 #define    XK_RepeatKeys_Enable                0xFE72
-0x0000 #define    XK_SlowKeys_Enable                0xFE73
-0x0000 #define    XK_BounceKeys_Enable                0xFE74
-0x0000 #define    XK_StickyKeys_Enable                0xFE75
-0x0000 #define    XK_MouseKeys_Enable                0xFE76
-0x0000 #define    XK_MouseKeys_Accel_Enable            0xFE77
-0x0000 #define    XK_Overlay1_Enable                0xFE78
-0x0000 #define    XK_Overlay2_Enable                0xFE79
-0x0000 #define    XK_AudibleBell_Enable                0xFE7A
-
-0x0000 #define    XK_Pointer_Left                    0xFEE0
-0x0000 #define    XK_Pointer_Right                0xFEE1
-0x0000 #define    XK_Pointer_Up                    0xFEE2
-0x0000 #define    XK_Pointer_Down                    0xFEE3
-0x0000 #define    XK_Pointer_UpLeft                0xFEE4
-0x0000 #define    XK_Pointer_UpRight                0xFEE5
-0x0000 #define    XK_Pointer_DownLeft                0xFEE6
-0x0000 #define    XK_Pointer_DownRight                0xFEE7
-0x0000 #define    XK_Pointer_Button_Dflt                0xFEE8
-0x0000 #define    XK_Pointer_Button1                0xFEE9
-0x0000 #define    XK_Pointer_Button2                0xFEEA
-0x0000 #define    XK_Pointer_Button3                0xFEEB
-0x0000 #define    XK_Pointer_Button4                0xFEEC
-0x0000 #define    XK_Pointer_Button5                0xFEED
-0x0000 #define    XK_Pointer_DblClick_Dflt            0xFEEE
-0x0000 #define    XK_Pointer_DblClick1                0xFEEF
-0x0000 #define    XK_Pointer_DblClick2                0xFEF0
-0x0000 #define    XK_Pointer_DblClick3                0xFEF1
-0x0000 #define    XK_Pointer_DblClick4                0xFEF2
-0x0000 #define    XK_Pointer_DblClick5                0xFEF3
-0x0000 #define    XK_Pointer_Drag_Dflt                0xFEF4
-0x0000 #define    XK_Pointer_Drag1                0xFEF5
-0x0000 #define    XK_Pointer_Drag2                0xFEF6
-0x0000 #define    XK_Pointer_Drag3                0xFEF7
-0x0000 #define    XK_Pointer_Drag4                0xFEF8
-0x0000 #define    XK_Pointer_Drag5                0xFEFD
-
-0x0000 #define    XK_Pointer_EnableKeys                0xFEF9
-0x0000 #define    XK_Pointer_Accelerate                0xFEFA
-0x0000 #define    XK_Pointer_DfltBtnNext                0xFEFB
-0x0000 #define    XK_Pointer_DfltBtnPrev                0xFEFC
-
-#endif
-
-/*
- * 3270 Terminal Keys
- * Byte 3 = 0xFD
- */
-
-#ifdef XK_3270
-0x0000 #define XK_3270_Duplicate      0xFD01
-0x0000 #define XK_3270_FieldMark      0xFD02
-0x0000 #define XK_3270_Right2         0xFD03
-0x0000 #define XK_3270_Left2          0xFD04
-0x0000 #define XK_3270_BackTab        0xFD05
-0x0000 #define XK_3270_EraseEOF       0xFD06
-0x0000 #define XK_3270_EraseInput     0xFD07
-0x0000 #define XK_3270_Reset          0xFD08
-0x0000 #define XK_3270_Quit           0xFD09
-0x0000 #define XK_3270_PA1            0xFD0A
-0x0000 #define XK_3270_PA2            0xFD0B
-0x0000 #define XK_3270_PA3            0xFD0C
-0x0000 #define XK_3270_Test           0xFD0D
-0x0000 #define XK_3270_Attn           0xFD0E
-0x0000 #define XK_3270_CursorBlink    0xFD0F
-0x0000 #define XK_3270_AltCursor      0xFD10
-0x0000 #define XK_3270_KeyClick       0xFD11
-0x0000 #define XK_3270_Jump           0xFD12
-0x0000 #define XK_3270_Ident          0xFD13
-0x0000 #define XK_3270_Rule           0xFD14
-0x0000 #define XK_3270_Copy           0xFD15
-0x0000 #define XK_3270_Play           0xFD16
-0x0000 #define XK_3270_Setup          0xFD17
-0x0000 #define XK_3270_Record         0xFD18
-0x0000 #define XK_3270_ChangeScreen   0xFD19
-0x0000 #define XK_3270_DeleteWord     0xFD1A
-0x0000 #define XK_3270_ExSelect       0xFD1B
-0x0000 #define XK_3270_CursorSelect   0xFD1C
-0x0000 #define XK_3270_PrintScreen    0xFD1D
-0x0000 #define XK_3270_Enter          0xFD1E
-#endif
-
-/*
- *  Latin 1
- *  Byte 3 = 0
- */
-// yan: skip Latin1 as it is mapped to Unicode 1:1
-#ifdef XK_LATIN1
-0x0000 #define XK_space               0x020
-0x0000 #define XK_exclam              0x021
-0x0000 #define XK_quotedbl            0x022
-0x0000 #define XK_numbersign          0x023
-0x0000 #define XK_dollar              0x024
-0x0000 #define XK_percent             0x025
-0x0000 #define XK_ampersand           0x026
-0x0000 #define XK_apostrophe          0x027
-0x0000 #define XK_quoteright          0x027    /* deprecated */
-0x0000 #define XK_parenleft           0x028
-0x0000 #define XK_parenright          0x029
-0x0000 #define XK_asterisk            0x02a
-0x0000 #define XK_plus                0x02b
-0x0000 #define XK_comma               0x02c
-0x0000 #define XK_minus               0x02d
-0x0000 #define XK_period              0x02e
-0x0000 #define XK_slash               0x02f
-0x0000 #define XK_0                   0x030
-0x0000 #define XK_1                   0x031
-0x0000 #define XK_2                   0x032
-0x0000 #define XK_3                   0x033
-0x0000 #define XK_4                   0x034
-0x0000 #define XK_5                   0x035
-0x0000 #define XK_6                   0x036
-0x0000 #define XK_7                   0x037
-0x0000 #define XK_8                   0x038
-0x0000 #define XK_9                   0x039
-0x0000 #define XK_colon               0x03a
-0x0000 #define XK_semicolon           0x03b
-0x0000 #define XK_less                0x03c
-0x0000 #define XK_equal               0x03d
-0x0000 #define XK_greater             0x03e
-0x0000 #define XK_question            0x03f
-0x0000 #define XK_at                  0x040
-0x0000 #define XK_A                   0x041
-0x0000 #define XK_B                   0x042
-0x0000 #define XK_C                   0x043
-0x0000 #define XK_D                   0x044
-0x0000 #define XK_E                   0x045
-0x0000 #define XK_F                   0x046
-0x0000 #define XK_G                   0x047
-0x0000 #define XK_H                   0x048
-0x0000 #define XK_I                   0x049
-0x0000 #define XK_J                   0x04a
-0x0000 #define XK_K                   0x04b
-0x0000 #define XK_L                   0x04c
-0x0000 #define XK_M                   0x04d
-0x0000 #define XK_N                   0x04e
-0x0000 #define XK_O                   0x04f
-0x0000 #define XK_P                   0x050
-0x0000 #define XK_Q                   0x051
-0x0000 #define XK_R                   0x052
-0x0000 #define XK_S                   0x053
-0x0000 #define XK_T                   0x054
-0x0000 #define XK_U                   0x055
-0x0000 #define XK_V                   0x056
-0x0000 #define XK_W                   0x057
-0x0000 #define XK_X                   0x058
-0x0000 #define XK_Y                   0x059
-0x0000 #define XK_Z                   0x05a
-0x0000 #define XK_bracketleft         0x05b
-0x0000 #define XK_backslash           0x05c
-0x0000 #define XK_bracketright        0x05d
-0x0000 #define XK_asciicircum         0x05e
-0x0000 #define XK_underscore          0x05f
-0x0000 #define XK_grave               0x060
-0x0000 #define XK_quoteleft           0x060    /* deprecated */
-0x0000 #define XK_a                   0x061
-0x0000 #define XK_b                   0x062
-0x0000 #define XK_c                   0x063
-0x0000 #define XK_d                   0x064
-0x0000 #define XK_e                   0x065
-0x0000 #define XK_f                   0x066
-0x0000 #define XK_g                   0x067
-0x0000 #define XK_h                   0x068
-0x0000 #define XK_i                   0x069
-0x0000 #define XK_j                   0x06a
-0x0000 #define XK_k                   0x06b
-0x0000 #define XK_l                   0x06c
-0x0000 #define XK_m                   0x06d
-0x0000 #define XK_n                   0x06e
-0x0000 #define XK_o                   0x06f
-0x0000 #define XK_p                   0x070
-0x0000 #define XK_q                   0x071
-0x0000 #define XK_r                   0x072
-0x0000 #define XK_s                   0x073
-0x0000 #define XK_t                   0x074
-0x0000 #define XK_u                   0x075
-0x0000 #define XK_v                   0x076
-0x0000 #define XK_w                   0x077
-0x0000 #define XK_x                   0x078
-0x0000 #define XK_y                   0x079
-0x0000 #define XK_z                   0x07a
-0x0000 #define XK_braceleft           0x07b
-0x0000 #define XK_bar                 0x07c
-0x0000 #define XK_braceright          0x07d
-0x0000 #define XK_asciitilde          0x07e
-
-0x0000 #define XK_nobreakspace        0x0a0
-0x0000 #define XK_exclamdown          0x0a1
-0x0000 #define XK_cent                   0x0a2
-0x0000 #define XK_sterling            0x0a3
-0x0000 #define XK_currency            0x0a4
-0x0000 #define XK_yen                 0x0a5
-0x0000 #define XK_brokenbar           0x0a6
-0x0000 #define XK_section             0x0a7
-0x0000 #define XK_diaeresis           0x0a8
-0x0000 #define XK_copyright           0x0a9
-0x0000 #define XK_ordfeminine         0x0aa
-0x0000 #define XK_guillemotleft       0x0ab    /* left angle quotation mark */
-0x0000 #define XK_notsign             0x0ac
-0x0000 #define XK_hyphen              0x0ad
-0x0000 #define XK_registered          0x0ae
-0x0000 #define XK_macron              0x0af
-0x0000 #define XK_degree              0x0b0
-0x0000 #define XK_plusminus           0x0b1
-0x0000 #define XK_twosuperior         0x0b2
-0x0000 #define XK_threesuperior       0x0b3
-0x0000 #define XK_acute               0x0b4
-0x0000 #define XK_mu                  0x0b5
-0x0000 #define XK_paragraph           0x0b6
-0x0000 #define XK_periodcentered      0x0b7
-0x0000 #define XK_cedilla             0x0b8
-0x0000 #define XK_onesuperior         0x0b9
-0x0000 #define XK_masculine           0x0ba
-0x0000 #define XK_guillemotright      0x0bb    /* right angle quotation mark */
-0x0000 #define XK_onequarter          0x0bc
-0x0000 #define XK_onehalf             0x0bd
-0x0000 #define XK_threequarters       0x0be
-0x0000 #define XK_questiondown        0x0bf
-0x0000 #define XK_Agrave              0x0c0
-0x0000 #define XK_Aacute              0x0c1
-0x0000 #define XK_Acircumflex         0x0c2
-0x0000 #define XK_Atilde              0x0c3
-0x0000 #define XK_Adiaeresis          0x0c4
-0x0000 #define XK_Aring               0x0c5
-0x0000 #define XK_AE                  0x0c6
-0x0000 #define XK_Ccedilla            0x0c7
-0x0000 #define XK_Egrave              0x0c8
-0x0000 #define XK_Eacute              0x0c9
-0x0000 #define XK_Ecircumflex         0x0ca
-0x0000 #define XK_Ediaeresis          0x0cb
-0x0000 #define XK_Igrave              0x0cc
-0x0000 #define XK_Iacute              0x0cd
-0x0000 #define XK_Icircumflex         0x0ce
-0x0000 #define XK_Idiaeresis          0x0cf
-0x0000 #define XK_ETH                 0x0d0
-0x0000 #define XK_Eth                 0x0d0    /* deprecated */
-0x0000 #define XK_Ntilde              0x0d1
-0x0000 #define XK_Ograve              0x0d2
-0x0000 #define XK_Oacute              0x0d3
-0x0000 #define XK_Ocircumflex         0x0d4
-0x0000 #define XK_Otilde              0x0d5
-0x0000 #define XK_Odiaeresis          0x0d6
-0x0000 #define XK_multiply            0x0d7
-0x0000 #define XK_Ooblique            0x0d8
-0x0000 #define XK_Ugrave              0x0d9
-0x0000 #define XK_Uacute              0x0da
-0x0000 #define XK_Ucircumflex         0x0db
-0x0000 #define XK_Udiaeresis          0x0dc
-0x0000 #define XK_Yacute              0x0dd
-0x0000 #define XK_THORN               0x0de
-0x0000 #define XK_Thorn               0x0de    /* deprecated */
-0x0000 #define XK_ssharp              0x0df
-0x0000 #define XK_agrave              0x0e0
-0x0000 #define XK_aacute              0x0e1
-0x0000 #define XK_acircumflex         0x0e2
-0x0000 #define XK_atilde              0x0e3
-0x0000 #define XK_adiaeresis          0x0e4
-0x0000 #define XK_aring               0x0e5
-0x0000 #define XK_ae                  0x0e6
-0x0000 #define XK_ccedilla            0x0e7
-0x0000 #define XK_egrave              0x0e8
-0x0000 #define XK_eacute              0x0e9
-0x0000 #define XK_ecircumflex         0x0ea
-0x0000 #define XK_ediaeresis          0x0eb
-0x0000 #define XK_igrave              0x0ec
-0x0000 #define XK_iacute              0x0ed
-0x0000 #define XK_icircumflex         0x0ee
-0x0000 #define XK_idiaeresis          0x0ef
-0x0000 #define XK_eth                 0x0f0
-0x0000 #define XK_ntilde              0x0f1
-0x0000 #define XK_ograve              0x0f2
-0x0000 #define XK_oacute              0x0f3
-0x0000 #define XK_ocircumflex         0x0f4
-0x0000 #define XK_otilde              0x0f5
-0x0000 #define XK_odiaeresis          0x0f6
-0x0000 #define XK_division            0x0f7
-0x0000 #define XK_oslash              0x0f8
-0x0000 #define XK_ugrave              0x0f9
-0x0000 #define XK_uacute              0x0fa
-0x0000 #define XK_ucircumflex         0x0fb
-0x0000 #define XK_udiaeresis          0x0fc
-0x0000 #define XK_yacute              0x0fd
-0x0000 #define XK_thorn               0x0fe
-0x0000 #define XK_ydiaeresis          0x0ff
-#endif /* XK_LATIN1 */
-
-/*
- *   Latin 2
- *   Byte 3 = 1
- */
-
-#ifdef XK_LATIN2
-0x0104 #define XK_Aogonek             0x1a1
-0x02d8 #define XK_breve               0x1a2
-0x0141 #define XK_Lstroke             0x1a3
-0x013d #define XK_Lcaron              0x1a5
-0x015a #define XK_Sacute              0x1a6
-0x0160 #define XK_Scaron              0x1a9
-0x015e #define XK_Scedilla            0x1aa
-0x0164 #define XK_Tcaron              0x1ab
-0x0179 #define XK_Zacute              0x1ac
-0x017d #define XK_Zcaron              0x1ae
-0x017b #define XK_Zabovedot           0x1af
-0x0105 #define XK_aogonek             0x1b1
-0x02db #define XK_ogonek              0x1b2
-0x0142 #define XK_lstroke             0x1b3
-0x013e #define XK_lcaron              0x1b5
-0x015b #define XK_sacute              0x1b6
-0x02c7 #define XK_caron               0x1b7
-0x0161 #define XK_scaron              0x1b9
-0x015f #define XK_scedilla            0x1ba
-0x0165 #define XK_tcaron              0x1bb
-0x017a #define XK_zacute              0x1bc
-0x02dd #define XK_doubleacute         0x1bd
-0x017e #define XK_zcaron              0x1be
-0x017c #define XK_zabovedot           0x1bf
-0x0154 #define XK_Racute              0x1c0
-0x0102 #define XK_Abreve              0x1c3
-0x0139 #define XK_Lacute              0x1c5
-0x0106 #define XK_Cacute              0x1c6
-0x010c #define XK_Ccaron              0x1c8
-0x0118 #define XK_Eogonek             0x1ca
-0x011a #define XK_Ecaron              0x1cc
-0x010e #define XK_Dcaron              0x1cf
-0x0110 #define XK_Dstroke             0x1d0
-0x0143 #define XK_Nacute              0x1d1
-0x0147 #define XK_Ncaron              0x1d2
-0x0150 #define XK_Odoubleacute        0x1d5
-0x0158 #define XK_Rcaron              0x1d8
-0x016e #define XK_Uring               0x1d9
-0x0170 #define XK_Udoubleacute        0x1db
-0x0162 #define XK_Tcedilla            0x1de
-0x0155 #define XK_racute              0x1e0
-0x0103 #define XK_abreve              0x1e3
-0x013a #define XK_lacute              0x1e5
-0x0107 #define XK_cacute              0x1e6
-0x010d #define XK_ccaron              0x1e8
-0x0119 #define XK_eogonek             0x1ea
-0x011b #define XK_ecaron              0x1ec
-0x010f #define XK_dcaron              0x1ef
-0x0111 #define XK_dstroke             0x1f0
-0x0144 #define XK_nacute              0x1f1
-0x0148 #define XK_ncaron              0x1f2
-0x0151 #define XK_odoubleacute        0x1f5
-0x0171 #define XK_udoubleacute        0x1fb
-0x0159 #define XK_rcaron              0x1f8
-0x016f #define XK_uring               0x1f9
-0x0163 #define XK_tcedilla            0x1fe
-0x02d9 #define XK_abovedot            0x1ff
-#endif /* XK_LATIN2 */
-
-/*
- *   Latin 3
- *   Byte 3 = 2
- */
-
-#ifdef XK_LATIN3
-0x0126 #define XK_Hstroke             0x2a1
-0x0124 #define XK_Hcircumflex         0x2a6
-0x0130 #define XK_Iabovedot           0x2a9
-0x011e #define XK_Gbreve              0x2ab
-0x0134 #define XK_Jcircumflex         0x2ac
-0x0127 #define XK_hstroke             0x2b1
-0x0125 #define XK_hcircumflex         0x2b6
-0x0131 #define XK_idotless            0x2b9
-0x011f #define XK_gbreve              0x2bb
-0x0135 #define XK_jcircumflex         0x2bc
-0x010a #define XK_Cabovedot           0x2c5
-0x0108 #define XK_Ccircumflex         0x2c6
-0x0120 #define XK_Gabovedot           0x2d5
-0x011c #define XK_Gcircumflex         0x2d8
-0x016c #define XK_Ubreve              0x2dd
-0x015c #define XK_Scircumflex         0x2de
-0x010b #define XK_cabovedot           0x2e5
-0x0109 #define XK_ccircumflex         0x2e6
-0x0121 #define XK_gabovedot           0x2f5
-0x011d #define XK_gcircumflex         0x2f8
-0x016d #define XK_ubreve              0x2fd
-0x015d #define XK_scircumflex         0x2fe
-#endif /* XK_LATIN3 */
-
-
-/*
- *   Latin 4
- *   Byte 3 = 3
- */
-
-#ifdef XK_LATIN4
-0x0138 #define XK_kra                 0x3a2
-0x0000 #define XK_kappa               0x3a2    /* deprecated */
-0x0156 #define XK_Rcedilla            0x3a3
-0x0128 #define XK_Itilde              0x3a5
-0x013b #define XK_Lcedilla            0x3a6
-0x0112 #define XK_Emacron             0x3aa
-0x0122 #define XK_Gcedilla            0x3ab
-0x0166 #define XK_Tslash              0x3ac
-0x0157 #define XK_rcedilla            0x3b3
-0x0129 #define XK_itilde              0x3b5
-0x013c #define XK_lcedilla            0x3b6
-0x0113 #define XK_emacron             0x3ba
-0x0123 #define XK_gcedilla            0x3bb
-0x0167 #define XK_tslash              0x3bc
-0x014a #define XK_ENG                 0x3bd
-0x014b #define XK_eng                 0x3bf
-0x0100 #define XK_Amacron             0x3c0
-0x012e #define XK_Iogonek             0x3c7
-0x0116 #define XK_Eabovedot           0x3cc
-0x012a #define XK_Imacron             0x3cf
-0x0145 #define XK_Ncedilla            0x3d1
-0x014c #define XK_Omacron             0x3d2
-0x0136 #define XK_Kcedilla            0x3d3
-0x0172 #define XK_Uogonek             0x3d9
-0x0168 #define XK_Utilde              0x3dd
-0x016a #define XK_Umacron             0x3de
-0x0101 #define XK_amacron             0x3e0
-0x012f #define XK_iogonek             0x3e7
-0x0117 #define XK_eabovedot           0x3ec
-0x012b #define XK_imacron             0x3ef
-0x0146 #define XK_ncedilla            0x3f1
-0x014d #define XK_omacron             0x3f2
-0x0137 #define XK_kcedilla            0x3f3
-0x0173 #define XK_uogonek             0x3f9
-0x0169 #define XK_utilde              0x3fd
-0x016b #define XK_umacron             0x3fe
-#endif /* XK_LATIN4 */
-
-/*
- * Latin-8
- * Byte 3 = 18
- */
-#ifdef XK_LATIN8
-0x1e02 #define XK_Babovedot           0x12a1
-0x1e03 #define XK_babovedot           0x12a2
-0x1e0a #define XK_Dabovedot           0x12a6
-0x1e80 #define XK_Wgrave              0x12a8
-0x1e82 #define XK_Wacute              0x12aa
-0x1e0b #define XK_dabovedot           0x12ab
-0x1ef2 #define XK_Ygrave              0x12ac
-0x1e1e #define XK_Fabovedot           0x12b0
-0x1e1f #define XK_fabovedot           0x12b1
-0x1e40 #define XK_Mabovedot           0x12b4
-0x1e41 #define XK_mabovedot           0x12b5
-0x1e56 #define XK_Pabovedot           0x12b7
-0x1e81 #define XK_wgrave              0x12b8
-0x1e57 #define XK_pabovedot           0x12b9
-0x1e83 #define XK_wacute              0x12ba
-0x1e60 #define XK_Sabovedot           0x12bb
-0x1ef3 #define XK_ygrave              0x12bc
-0x1e84 #define XK_Wdiaeresis          0x12bd
-0x1e85 #define XK_wdiaeresis          0x12be
-0x1e61 #define XK_sabovedot           0x12bf
-0x017 4#define XK_Wcircumflex         0x12d0
-0x1e6a #define XK_Tabovedot           0x12d7
-0x0176 #define XK_Ycircumflex         0x12de
-0x0175 #define XK_wcircumflex         0x12f0
-0x1e6b #define XK_tabovedot           0x12f7
-0x0177 #define XK_ycircumflex         0x12fe
-#endif /* XK_LATIN8 */
-
-/*
- * Latin-9 (a.k.a. Latin-0)
- * Byte 3 = 19
- */
-
-#ifdef XK_LATIN9
-0x0152 #define XK_OE                  0x13bc
-0x0153 #define XK_oe                  0x13bd
-0x0178 #define XK_Ydiaeresis          0x13be
-#endif /* XK_LATIN9 */
-
-/*
- * Katakana
- * Byte 3 = 4
- */
-
-#ifdef XK_KATAKANA
-0x203e #define XK_overline                       0x47e
-0x3002 #define XK_kana_fullstop                               0x4a1
-0x300c #define XK_kana_openingbracket                         0x4a2
-0x300d #define XK_kana_closingbracket                         0x4a3
-0x3001 #define XK_kana_comma                                  0x4a4
-0x30fb #define XK_kana_conjunctive                            0x4a5
-0x0000 #define XK_kana_middledot                              0x4a5  /* deprecated */
-0x30f2 #define XK_kana_WO                                     0x4a6
-0x30a1 #define XK_kana_a                                      0x4a7
-0x30a3 #define XK_kana_i                                      0x4a8
-0x30a5 #define XK_kana_u                                      0x4a9
-0x30a7 #define XK_kana_e                                      0x4aa
-0x30a9 #define XK_kana_o                                      0x4ab
-0x30e3 #define XK_kana_ya                                     0x4ac
-0x30e5 #define XK_kana_yu                                     0x4ad
-0x30e7 #define XK_kana_yo                                     0x4ae
-0x30c3 #define XK_kana_tsu                                    0x4af
-0x0000 #define XK_kana_tu                                     0x4af  /* deprecated */
-0x30fc #define XK_prolongedsound                              0x4b0
-0x30a2 #define XK_kana_A                                      0x4b1
-0x30a4 #define XK_kana_I                                      0x4b2
-0x30a6 #define XK_kana_U                                      0x4b3
-0x30a8 #define XK_kana_E                                      0x4b4
-0x30aa #define XK_kana_O                                      0x4b5
-0x30ab #define XK_kana_KA                                     0x4b6
-0x30ad #define XK_kana_KI                                     0x4b7
-0x30af #define XK_kana_KU                                     0x4b8
-0x30b1 #define XK_kana_KE                                     0x4b9
-0x30b3 #define XK_kana_KO                                     0x4ba
-0x30b5 #define XK_kana_SA                                     0x4bb
-0x30b7 #define XK_kana_SHI                                    0x4bc
-0x30b9 #define XK_kana_SU                                     0x4bd
-0x30bb #define XK_kana_SE                                     0x4be
-0x30bd #define XK_kana_SO                                     0x4bf
-0x30bf #define XK_kana_TA                                     0x4c0
-0x30c1 #define XK_kana_CHI                                    0x4c1
-0x0000 #define XK_kana_TI                                     0x4c1  /* deprecated */
-0x30c4 #define XK_kana_TSU                                    0x4c2
-0x0000 #define XK_kana_TU                                     0x4c2  /* deprecated */
-0x30c6 #define XK_kana_TE                                     0x4c3
-0x30c8 #define XK_kana_TO                                     0x4c4
-0x30ca #define XK_kana_NA                                     0x4c5
-0x30cb #define XK_kana_NI                                     0x4c6
-0x30cc #define XK_kana_NU                                     0x4c7
-0x30cd #define XK_kana_NE                                     0x4c8
-0x30ce #define XK_kana_NO                                     0x4c9
-0x30cf #define XK_kana_HA                                     0x4ca
-0x30d2 #define XK_kana_HI                                     0x4cb
-0x30d5 #define XK_kana_FU                                     0x4cc
-0x0000 #define XK_kana_HU                                     0x4cc  /* deprecated */
-0x30d8 #define XK_kana_HE                                     0x4cd
-0x30db #define XK_kana_HO                                     0x4ce
-0x30de #define XK_kana_MA                                     0x4cf
-0x30df #define XK_kana_MI                                     0x4d0
-0x30e0 #define XK_kana_MU                                     0x4d1
-0x30e1 #define XK_kana_ME                                     0x4d2
-0x30e2 #define XK_kana_MO                                     0x4d3
-0x30e4 #define XK_kana_YA                                     0x4d4
-0x30e6 #define XK_kana_YU                                     0x4d5
-0x30e8 #define XK_kana_YO                                     0x4d6
-0x30e9 #define XK_kana_RA                                     0x4d7
-0x30ea #define XK_kana_RI                                     0x4d8
-0x30eb #define XK_kana_RU                                     0x4d9
-0x30ec #define XK_kana_RE                                     0x4da
-0x30ed #define XK_kana_RO                                     0x4db
-0x30ef #define XK_kana_WA                                     0x4dc
-0x30f3 #define XK_kana_N                                      0x4dd
-0x309b #define XK_voicedsound                                 0x4de
-0x309c #define XK_semivoicedsound                             0x4df
-0x0000 #define XK_kana_switch          0xFF7E  /* Alias for mode_switch */
-#endif /* XK_KATAKANA */
-
-/*
- *  Arabic
- *  Byte 3 = 5
- */
-
-#ifdef XK_ARABIC
-0x0670 #define XK_Farsi_0                                     0x590
-0x06f1 #define XK_Farsi_1                                     0x591
-0x06f2 #define XK_Farsi_2                                     0x592
-0x06f3 #define XK_Farsi_3                                     0x593
-0x06f4 #define XK_Farsi_4                                     0x594
-0x06f5 #define XK_Farsi_5                                     0x595
-0x06f6 #define XK_Farsi_6                                     0x596
-0x06f7 #define XK_Farsi_7                                     0x597
-0x06f8 #define XK_Farsi_8                                     0x598
-0x06f9 #define XK_Farsi_9                                     0x599
-0x066a #define XK_Arabic_percent                              0x5a5
-0x0670 #define XK_Arabic_superscript_alef                     0x5a6
-0x0679 #define XK_Arabic_tteh                                 0x5a7
-0x067e #define XK_Arabic_peh                                  0x5a8
-0x0686 #define XK_Arabic_tcheh                                0x5a9
-0x0688 #define XK_Arabic_ddal                                 0x5aa
-0x0691 #define XK_Arabic_rreh                                 0x5ab
-0x060c #define XK_Arabic_comma                                0x5ac
-0x06d4 #define XK_Arabic_fullstop                             0x5ae
-0x0660 #define XK_Arabic_0                                    0x5b0
-0x0661 #define XK_Arabic_1                                    0x5b1
-0x0662 #define XK_Arabic_2                                    0x5b2
-0x0663 #define XK_Arabic_3                                    0x5b3
-0x0664 #define XK_Arabic_4                                    0x5b4
-0x0665 #define XK_Arabic_5                                    0x5b5
-0x0666 #define XK_Arabic_6                                    0x5b6
-0x0667 #define XK_Arabic_7                                    0x5b7
-0x0668 #define XK_Arabic_8                                    0x5b8
-0x0669 #define XK_Arabic_9                                    0x5b9
-0x061b #define XK_Arabic_semicolon                            0x5bb
-0x061f #define XK_Arabic_question_mark                        0x5bf
-0x0621 #define XK_Arabic_hamza                                0x5c1
-0x0622 #define XK_Arabic_maddaonalef                          0x5c2
-0x0623 #define XK_Arabic_hamzaonalef                          0x5c3
-0x0624 #define XK_Arabic_hamzaonwaw                           0x5c4
-0x0625 #define XK_Arabic_hamzaunderalef                       0x5c5
-0x0626 #define XK_Arabic_hamzaonyeh                           0x5c6
-0x0627 #define XK_Arabic_alef                                 0x5c7
-0x0628 #define XK_Arabic_beh                                  0x5c8
-0x0629 #define XK_Arabic_tehmarbuta                           0x5c9
-0x062a #define XK_Arabic_teh                                  0x5ca
-0x062b #define XK_Arabic_theh                                 0x5cb
-0x062c #define XK_Arabic_jeem                                 0x5cc
-0x062d #define XK_Arabic_hah                                  0x5cd
-0x062e #define XK_Arabic_khah                                 0x5ce
-0x062f #define XK_Arabic_dal                                  0x5cf
-0x0630 #define XK_Arabic_thal                                 0x5d0
-0x0631 #define XK_Arabic_ra                                   0x5d1
-0x0632 #define XK_Arabic_zain                                 0x5d2
-0x0633 #define XK_Arabic_seen                                 0x5d3
-0x0634 #define XK_Arabic_sheen                                0x5d4
-0x0635 #define XK_Arabic_sad                                  0x5d5
-0x0636 #define XK_Arabic_dad                                  0x5d6
-0x0637 #define XK_Arabic_tah                                  0x5d7
-0x0638 #define XK_Arabic_zah                                  0x5d8
-0x0639 #define XK_Arabic_ain                                  0x5d9
-0x063a #define XK_Arabic_ghain                                0x5da
-0x0640 #define XK_Arabic_tatweel                              0x5e0
-0x0641 #define XK_Arabic_feh                                  0x5e1
-0x0642 #define XK_Arabic_qaf                                  0x5e2
-0x0643 #define XK_Arabic_kaf                                  0x5e3
-0x0644 #define XK_Arabic_lam                                  0x5e4
-0x0645 #define XK_Arabic_meem                                 0x5e5
-0x0646 #define XK_Arabic_noon                                 0x5e6
-0x0647 #define XK_Arabic_ha                                   0x5e7
-0x0000 #define XK_Arabic_heh                                  0x5e7  /* deprecated */
-0x0648 #define XK_Arabic_waw                                  0x5e8
-0x0649 #define XK_Arabic_alefmaksura                          0x5e9
-0x064a #define XK_Arabic_yeh                                  0x5ea
-0x064b #define XK_Arabic_fathatan                             0x5eb
-0x064c #define XK_Arabic_dammatan                             0x5ec
-0x064d #define XK_Arabic_kasratan                             0x5ed
-0x064e #define XK_Arabic_fatha                                0x5ee
-0x064f #define XK_Arabic_damma                                0x5ef
-0x0650 #define XK_Arabic_kasra                                0x5f0
-0x0651 #define XK_Arabic_shadda                               0x5f1
-0x0652 #define XK_Arabic_sukun                                0x5f2
-0x0653 #define XK_Arabic_madda_above                          0x5f3
-0x0654 #define XK_Arabic_hamza_above                          0x5f4
-0x0655 #define XK_Arabic_hamza_below                          0x5f5
-0x0698 #define XK_Arabic_jeh                                  0x5f6
-0x06a4 #define XK_Arabic_veh                                  0x5f7
-0x06a9 #define XK_Arabic_keheh                                0x5f8
-0x06af #define XK_Arabic_gaf                                  0x5f9
-0x06ba #define XK_Arabic_noon_ghunna                          0x5fa
-0x06be #define XK_Arabic_heh_doachashmee                      0x5fb
-0x06cc #define XK_Farsi_yeh                                   0x5fc
-0x06d2 #define XK_Arabic_yeh_baree                            0x5fd
-0x06c1 #define XK_Arabic_heh_goal                             0x5fe
-0x0000 #define XK_Arabic_switch        0xFF7E  /* Alias for mode_switch */
-#endif /* XK_ARABIC */
-
-/*
- * Cyrillic
- * Byte 3 = 6
- */
-#ifdef XK_CYRILLIC
-0x0492 #define XK_Cyrillic_GHE_bar                               0x680
-0x0493 #define XK_Cyrillic_ghe_bar                               0x690
-0x0496 #define XK_Cyrillic_ZHE_descender                       0x681
-0x0497 #define XK_Cyrillic_zhe_descender                       0x691
-0x049a #define XK_Cyrillic_KA_descender                   0x682
-0x049b #define XK_Cyrillic_ka_descender                       0x692
-0x049c #define XK_Cyrillic_KA_vertstroke                   0x683
-0x049d #define XK_Cyrillic_ka_vertstroke                   0x693
-0x04a2 #define XK_Cyrillic_EN_descender                   0x684
-0x04a3 #define XK_Cyrillic_en_descender                   0x694
-0x04ae #define XK_Cyrillic_U_straight                       0x685
-0x04af #define XK_Cyrillic_u_straight                       0x695
-0x04b0 #define XK_Cyrillic_U_straight_bar                   0x686
-0x04b1 #define XK_Cyrillic_u_straight_bar                   0x696
-0x04b2 #define XK_Cyrillic_HA_descender                       0x687
-0x04b3 #define XK_Cyrillic_ha_descender                       0x697
-0x04b6 #define XK_Cyrillic_CHE_descender                       0x688
-0x04b7 #define XK_Cyrillic_che_descender                       0x698
-0x04b8 #define XK_Cyrillic_CHE_vertstroke                       0x689
-0x04b9 #define XK_Cyrillic_che_vertstroke                       0x699
-0x04ba #define XK_Cyrillic_SHHA                               0x68a
-0x04bb #define XK_Cyrillic_shha                               0x69a
-
-0x04d8 #define XK_Cyrillic_SCHWA                               0x68c
-0x04d9 #define XK_Cyrillic_schwa                               0x69c
-0x04e2 #define XK_Cyrillic_I_macron                           0x68d
-0x04e3 #define XK_Cyrillic_i_macron                           0x69d
-0x04e8 #define XK_Cyrillic_O_bar                               0x68e
-0x04e9 #define XK_Cyrillic_o_bar                               0x69e
-0x04ee #define XK_Cyrillic_U_macron                           0x68f
-0x04ef #define XK_Cyrillic_u_macron                           0x69f
-
-0x0452 #define XK_Serbian_dje                                 0x6a1
-0x0453 #define XK_Macedonia_gje                               0x6a2
-0x0451 #define XK_Cyrillic_io                                 0x6a3
-0x0454 #define XK_Ukrainian_ie                                0x6a4
-0x0000 #define XK_Ukranian_je                                 0x6a4  /* deprecated */
-0x0455 #define XK_Macedonia_dse                               0x6a5
-0x0456 #define XK_Ukrainian_i                                 0x6a6
-0x0000 #define XK_Ukranian_i                                  0x6a6  /* deprecated */
-0x0457 #define XK_Ukrainian_yi                                0x6a7
-0x0000 #define XK_Ukranian_yi                                 0x6a7  /* deprecated */
-0x0458 #define XK_Cyrillic_je                                 0x6a8
-0x0000 #define XK_Serbian_je                                  0x6a8  /* deprecated */
-0x0459 #define XK_Cyrillic_lje                                0x6a9
-0x0000 #define XK_Serbian_lje                                 0x6a9  /* deprecated */
-0x045a #define XK_Cyrillic_nje                                0x6aa
-0x0000 #define XK_Serbian_nje                                 0x6aa  /* deprecated */
-0x045b #define XK_Serbian_tshe                                0x6ab
-0x045c #define XK_Macedonia_kje                               0x6ac
-0x0491 #define XK_Ukrainian_ghe_with_upturn                   0x6ad
-0x045e #define XK_Byelorussian_shortu                         0x6ae
-0x045f #define XK_Cyrillic_dzhe                               0x6af
-0x0000 #define XK_Serbian_dze                                 0x6af  /* deprecated */
-0x2116 #define XK_numerosign                                  0x6b0
-0x0402 #define XK_Serbian_DJE                                 0x6b1
-0x0403 #define XK_Macedonia_GJE                               0x6b2
-0x0401 #define XK_Cyrillic_IO                                 0x6b3
-0x0404 #define XK_Ukrainian_IE                                0x6b4
-0x0000 #define XK_Ukranian_JE                                 0x6b4  /* deprecated */
-0x0405 #define XK_Macedonia_DSE                               0x6b5
-0x0406 #define XK_Ukrainian_I                                 0x6b6
-0x0000 #define XK_Ukranian_I                                  0x6b6  /* deprecated */
-0x0407 #define XK_Ukrainian_YI                                0x6b7
-0x0000 #define XK_Ukranian_YI                                 0x6b7  /* deprecated */
-0x0408 #define XK_Cyrillic_JE                                 0x6b8
-0x0000 #define XK_Serbian_JE                                  0x6b8  /* deprecated */
-0x0409 #define XK_Cyrillic_LJE                                0x6b9
-0x0000 #define XK_Serbian_LJE                                 0x6b9  /* deprecated */
-0x040a #define XK_Cyrillic_NJE                                0x6ba
-0x0000 #define XK_Serbian_NJE                                 0x6ba  /* deprecated */
-0x040b #define XK_Serbian_TSHE                                0x6bb
-0x040c #define XK_Macedonia_KJE                               0x6bc
-0x0490 #define XK_Ukrainian_GHE_WITH_UPTURN                   0x6bd
-0x040e #define XK_Byelorussian_SHORTU                         0x6be
-0x040f #define XK_Cyrillic_DZHE                               0x6bf
-0x0000 #define XK_Serbian_DZE                                 0x6bf  /* deprecated */
-0x044e #define XK_Cyrillic_yu                                 0x6c0
-0x0430 #define XK_Cyrillic_a                                  0x6c1
-0x0431 #define XK_Cyrillic_be                                 0x6c2
-0x0446 #define XK_Cyrillic_tse                                0x6c3
-0x0434 #define XK_Cyrillic_de                                 0x6c4
-0x0435 #define XK_Cyrillic_ie                                 0x6c5
-0x0444 #define XK_Cyrillic_ef                                 0x6c6
-0x0433 #define XK_Cyrillic_ghe                                0x6c7
-0x0445 #define XK_Cyrillic_ha                                 0x6c8
-0x0438 #define XK_Cyrillic_i                                  0x6c9
-0x0439 #define XK_Cyrillic_shorti                             0x6ca
-0x043a #define XK_Cyrillic_ka                                 0x6cb
-0x043b #define XK_Cyrillic_el                                 0x6cc
-0x043c #define XK_Cyrillic_em                                 0x6cd
-0x043d #define XK_Cyrillic_en                                 0x6ce
-0x043e #define XK_Cyrillic_o                                  0x6cf
-0x043f #define XK_Cyrillic_pe                                 0x6d0
-0x044f #define XK_Cyrillic_ya                                 0x6d1
-0x0440 #define XK_Cyrillic_er                                 0x6d2
-0x0441 #define XK_Cyrillic_es                                 0x6d3
-0x0442 #define XK_Cyrillic_te                                 0x6d4
-0x0443 #define XK_Cyrillic_u                                  0x6d5
-0x0436 #define XK_Cyrillic_zhe                                0x6d6
-0x0432 #define XK_Cyrillic_ve                                 0x6d7
-0x044c #define XK_Cyrillic_softsign                           0x6d8
-0x044b #define XK_Cyrillic_yeru                               0x6d9
-0x0437 #define XK_Cyrillic_ze                                 0x6da
-0x0448 #define XK_Cyrillic_sha                                0x6db
-0x044d #define XK_Cyrillic_e                                  0x6dc
-0x0449 #define XK_Cyrillic_shcha                              0x6dd
-0x0447 #define XK_Cyrillic_che                                0x6de
-0x044a #define XK_Cyrillic_hardsign                           0x6df
-0x042e #define XK_Cyrillic_YU                                 0x6e0
-0x0410 #define XK_Cyrillic_A                                  0x6e1
-0x0411 #define XK_Cyrillic_BE                                 0x6e2
-0x0426 #define XK_Cyrillic_TSE                                0x6e3
-0x0414 #define XK_Cyrillic_DE                                 0x6e4
-0x0415 #define XK_Cyrillic_IE                                 0x6e5
-0x0424 #define XK_Cyrillic_EF                                 0x6e6
-0x0413 #define XK_Cyrillic_GHE                                0x6e7
-0x0425 #define XK_Cyrillic_HA                                 0x6e8
-0x0418 #define XK_Cyrillic_I                                  0x6e9
-0x0419 #define XK_Cyrillic_SHORTI                             0x6ea
-0x041a #define XK_Cyrillic_KA                                 0x6eb
-0x041b #define XK_Cyrillic_EL                                 0x6ec
-0x041c #define XK_Cyrillic_EM                                 0x6ed
-0x041d #define XK_Cyrillic_EN                                 0x6ee
-0x041e #define XK_Cyrillic_O                                  0x6ef
-0x041f #define XK_Cyrillic_PE                                 0x6f0
-0x042f #define XK_Cyrillic_YA                                 0x6f1
-0x0420 #define XK_Cyrillic_ER                                 0x6f2
-0x0421 #define XK_Cyrillic_ES                                 0x6f3
-0x0422 #define XK_Cyrillic_TE                                 0x6f4
-0x0423 #define XK_Cyrillic_U                                  0x6f5
-0x0416 #define XK_Cyrillic_ZHE                                0x6f6
-0x0412 #define XK_Cyrillic_VE                                 0x6f7
-0x042c #define XK_Cyrillic_SOFTSIGN                           0x6f8
-0x042b #define XK_Cyrillic_YERU                               0x6f9
-0x0417 #define XK_Cyrillic_ZE                                 0x6fa
-0x0428 #define XK_Cyrillic_SHA                                0x6fb
-0x042d #define XK_Cyrillic_E                                  0x6fc
-0x0429 #define XK_Cyrillic_SHCHA                              0x6fd
-0x0427 #define XK_Cyrillic_CHE                                0x6fe
-0x042a #define XK_Cyrillic_HARDSIGN                           0x6ff
-#endif /* XK_CYRILLIC */
-
-/*
- * Greek
- * Byte 3 = 7
- */
-
-#ifdef XK_GREEK
-0x0386 #define XK_Greek_ALPHAaccent                           0x7a1
-0x0388 #define XK_Greek_EPSILONaccent                         0x7a2
-0x0389 #define XK_Greek_ETAaccent                             0x7a3
-0x038a #define XK_Greek_IOTAaccent                            0x7a4
-0x03aa #define XK_Greek_IOTAdieresis                          0x7a5
-0x0000 #define XK_Greek_IOTAdiaeresis         XK_Greek_IOTAdieresis /* old typo */
-0x038c #define XK_Greek_OMICRONaccent                         0x7a7
-0x038e #define XK_Greek_UPSILONaccent                         0x7a8
-0x03ab  #define XK_Greek_UPSILONdieresis                       0x7a9
-0x038f #define XK_Greek_OMEGAaccent                           0x7ab
-0x0385 #define XK_Greek_accentdieresis                        0x7ae
-0x2015 #define XK_Greek_horizbar                              0x7af
-0x03ac #define XK_Greek_alphaaccent                           0x7b1
-0x03ad #define XK_Greek_epsilonaccent                         0x7b2
-0x03ae #define XK_Greek_etaaccent                             0x7b3
-0x03af #define XK_Greek_iotaaccent                            0x7b4
-0x03ca #define XK_Greek_iotadieresis                          0x7b5
-0x0390 #define XK_Greek_iotaaccentdieresis                    0x7b6
-0x03cc #define XK_Greek_omicronaccent                         0x7b7
-0x03cd #define XK_Greek_upsilonaccent                         0x7b8
-0x03cb #define XK_Greek_upsilondieresis                       0x7b9
-0x03b0 #define XK_Greek_upsilonaccentdieresis                 0x7ba
-0x03ce #define XK_Greek_omegaaccent                           0x7bb
-0x0391 #define XK_Greek_ALPHA                                 0x7c1
-0x0392 #define XK_Greek_BETA                                  0x7c2
-0x0393 #define XK_Greek_GAMMA                                 0x7c3
-0x0394 #define XK_Greek_DELTA                                 0x7c4
-0x0395 #define XK_Greek_EPSILON                               0x7c5
-0x0396 #define XK_Greek_ZETA                                  0x7c6
-0x0397 #define XK_Greek_ETA                                   0x7c7
-0x0398 #define XK_Greek_THETA                                 0x7c8
-0x0399 #define XK_Greek_IOTA                                  0x7c9
-0x039a #define XK_Greek_KAPPA                                 0x7ca
-0x0000 #define XK_Greek_LAMDA                                 0x7cb
-0x039b #define XK_Greek_LAMBDA                                0x7cb
-0x039c #define XK_Greek_MU                                    0x7cc
-0x039d #define XK_Greek_NU                                    0x7cd
-0x039e #define XK_Greek_XI                                    0x7ce
-0x039f #define XK_Greek_OMICRON                               0x7cf
-0x03a0 #define XK_Greek_PI                                    0x7d0
-0x03a1 #define XK_Greek_RHO                                   0x7d1
-0x03a3 #define XK_Greek_SIGMA                                 0x7d2
-0x03a4 #define XK_Greek_TAU                                   0x7d4
-0x03a5 #define XK_Greek_UPSILON                               0x7d5
-0x03a6 #define XK_Greek_PHI                                   0x7d6
-0x03a7 #define XK_Greek_CHI                                   0x7d7
-0x03a8 #define XK_Greek_PSI                                   0x7d8
-0x03a9 #define XK_Greek_OMEGA                                 0x7d9
-0x03b1 #define XK_Greek_alpha                                 0x7e1
-0x03b2 #define XK_Greek_beta                                  0x7e2
-0x03b3 #define XK_Greek_gamma                                 0x7e3
-0x03b4 #define XK_Greek_delta                                 0x7e4
-0x03b5 #define XK_Greek_epsilon                               0x7e5
-0x03b6 #define XK_Greek_zeta                                  0x7e6
-0x03b7 #define XK_Greek_eta                                   0x7e7
-0x03b8 #define XK_Greek_theta                                 0x7e8
-0x03b9 #define XK_Greek_iota                                  0x7e9
-0x03ba #define XK_Greek_kappa                                 0x7ea
-0x0000 #define XK_Greek_lamda                                 0x7eb
-0x03bb #define XK_Greek_lambda                                0x7eb
-0x03bc #define XK_Greek_mu                                    0x7ec
-0x03bd #define XK_Greek_nu                                    0x7ed
-0x03be #define XK_Greek_xi                                    0x7ee
-0x03bf #define XK_Greek_omicron                               0x7ef
-0x03c0 #define XK_Greek_pi                                    0x7f0
-0x03c1 #define XK_Greek_rho                                   0x7f1
-0x03c3 #define XK_Greek_sigma                                 0x7f2
-0x03c2 #define XK_Greek_finalsmallsigma                       0x7f3
-0x03c4 #define XK_Greek_tau                                   0x7f4
-0x03c5 #define XK_Greek_upsilon                               0x7f5
-0x03c6 #define XK_Greek_phi                                   0x7f6
-0x03c7 #define XK_Greek_chi                                   0x7f7
-0x03c8 #define XK_Greek_psi                                   0x7f8
-0x03c9 #define XK_Greek_omega                                 0x7f9
-0x0000 #define XK_Greek_switch         0xFF7E  /* Alias for mode_switch */
-#endif /* XK_GREEK */
-
-/*
- * Technical
- * Byte 3 = 8
- */
-
-#ifdef XK_TECHNICAL
-0x23b7 #define XK_leftradical                                 0x8a1
-0x250c #define XK_topleftradical                              0x8a2
-0x2500 #define XK_horizconnector                              0x8a3
-0x2320 #define XK_topintegral                                 0x8a4
-0x2321 #define XK_botintegral                                 0x8a5
-0x2502 #define XK_vertconnector                               0x8a6
-0x23a1 #define XK_topleftsqbracket                            0x8a7
-0x23a3 #define XK_botleftsqbracket                            0x8a8
-0x23a4 #define XK_toprightsqbracket                           0x8a9
-0x23a6 #define XK_botrightsqbracket                           0x8aa
-0x239b #define XK_topleftparens                               0x8ab
-0x239d #define XK_botleftparens                               0x8ac
-0x239e #define XK_toprightparens                              0x8ad
-0x23a0 #define XK_botrightparens                              0x8ae
-0x23a8 #define XK_leftmiddlecurlybrace                        0x8af
-0x23ac #define XK_rightmiddlecurlybrace                       0x8b0
-0x0000 #define XK_topleftsummation                            0x8b1
-0x0000 #define XK_botleftsummation                            0x8b2
-0x0000 #define XK_topvertsummationconnector                   0x8b3
-0x0000 #define XK_botvertsummationconnector                   0x8b4
-0x0000 #define XK_toprightsummation                           0x8b5
-0x0000 #define XK_botrightsummation                           0x8b6
-0x0000 #define XK_rightmiddlesummation                        0x8b7
-0x2264 #define XK_lessthanequal                               0x8bc
-0x2260 #define XK_notequal                                    0x8bd
-0x2265 #define XK_greaterthanequal                            0x8be
-0x222b #define XK_integral                                    0x8bf
-0x2234 #define XK_therefore                                   0x8c0
-0x221d #define XK_variation                                   0x8c1
-0x221e #define XK_infinity                                    0x8c2
-0x2207 #define XK_nabla                                       0x8c5
-0x223c #define XK_approximate                                 0x8c8
-0x2243 #define XK_similarequal                                0x8c9
-0x2104 #define XK_ifonlyif                                    0x8cd
-0x21d2 #define XK_implies                                     0x8ce
-0x2261 #define XK_identical                                   0x8cf
-0x221a #define XK_radical                                     0x8d6
-0x2282 #define XK_includedin                                  0x8da
-0x2283 #define XK_includes                                    0x8db
-0x2229 #define XK_intersection                                0x8dc
-0x222a #define XK_union                                       0x8dd
-0x2227 #define XK_logicaland                                  0x8de
-0x2228 #define XK_logicalor                                   0x8df
-0x2202 #define XK_partialderivative                           0x8ef
-0x0192 #define XK_function                                    0x8f6
-0x2190 #define XK_leftarrow                                   0x8fb
-0x2191 #define XK_uparrow                                     0x8fc
-0x2192 #define XK_rightarrow                                  0x8fd
-0x2193 #define XK_downarrow                                   0x8fe
-#endif /* XK_TECHNICAL */
-
-/*
- *  Special
- *  Byte 3 = 9
- */
-
-#ifdef XK_SPECIAL
-0x0000 #define XK_blank                                       0x9df
-0x25c6 #define XK_soliddiamond                                0x9e0
-0x2592 #define XK_checkerboard                                0x9e1
-0x2409 #define XK_ht                                          0x9e2
-0x240c #define XK_ff                                          0x9e3
-0x240d #define XK_cr                                          0x9e4
-0x240a #define XK_lf                                          0x9e5
-0x2424 #define XK_nl                                          0x9e8
-0x240b #define XK_vt                                          0x9e9
-0x2518 #define XK_lowrightcorner                              0x9ea
-0x2510 #define XK_uprightcorner                               0x9eb
-0x250c #define XK_upleftcorner                                0x9ec
-0x2514 #define XK_lowleftcorner                               0x9ed
-0x253c #define XK_crossinglines                               0x9ee
-0x23ba #define XK_horizlinescan1                              0x9ef
-0x23bb #define XK_horizlinescan3                              0x9f0
-0x2500 #define XK_horizlinescan5                              0x9f1
-0x23bc #define XK_horizlinescan7                              0x9f2
-0x23bd #define XK_horizlinescan9                              0x9f3
-0x251c #define XK_leftt                                       0x9f4
-0x2524 #define XK_rightt                                      0x9f5
-0x2534 #define XK_bott                                        0x9f6
-0x252c #define XK_topt                                        0x9f7
-0x2502 #define XK_vertbar                                     0x9f8
-#endif /* XK_SPECIAL */
-
-/*
- *  Publishing
- *  Byte 3 = a
- */
-
-#ifdef XK_PUBLISHING
-0x2003 #define XK_emspace                                     0xaa1
-0x2002 #define XK_enspace                                     0xaa2
-0x2004 #define XK_em3space                                    0xaa3
-0x2005 #define XK_em4space                                    0xaa4
-0x2007 #define XK_digitspace                                  0xaa5
-0x2008 #define XK_punctspace                                  0xaa6
-0x2009 #define XK_thinspace                                   0xaa7
-0x200a #define XK_hairspace                                   0xaa8
-0x2014 #define XK_emdash                                      0xaa9
-0x2013 #define XK_endash                                      0xaaa
-0x2423 #define XK_signifblank                                 0xaac
-0x2026 #define XK_ellipsis                                    0xaae
-0x2025 #define XK_doubbaselinedot                             0xaaf
-0x2153 #define XK_onethird                                    0xab0
-0x2154 #define XK_twothirds                                   0xab1
-0x2155 #define XK_onefifth                                    0xab2
-0x2156 #define XK_twofifths                                   0xab3
-0x2157 #define XK_threefifths                                 0xab4
-0x2158 #define XK_fourfifths                                  0xab5
-0x2159 #define XK_onesixth                                    0xab6
-0x215a #define XK_fivesixths                                  0xab7
-0x2105 #define XK_careof                                      0xab8
-0x2012 #define XK_figdash                                     0xabb
-0x27e8 #define XK_leftanglebracket                            0xabc
-0x002e #define XK_decimalpoint                                0xabd
-0x27e9 #define XK_rightanglebracket                           0xabe
-0x0000 #define XK_marker                                      0xabf
-0x215b #define XK_oneeighth                                   0xac3
-0x215c #define XK_threeeighths                                0xac4
-0x215d #define XK_fiveeighths                                 0xac5
-0x215e #define XK_seveneighths                                0xac6
-0x2122 #define XK_trademark                                   0xac9
-0x2613 #define XK_signaturemark                               0xaca
-0x0000 #define XK_trademarkincircle                           0xacb
-0x25c1 #define XK_leftopentriangle                            0xacc
-0x25b7 #define XK_rightopentriangle                           0xacd
-0x25cb #define XK_emopencircle                                0xace
-0x25af #define XK_emopenrectangle                             0xacf
-0x2018 #define XK_leftsinglequotemark                         0xad0
-0x2019 #define XK_rightsinglequotemark                        0xad1
-0x201c #define XK_leftdoublequotemark                         0xad2
-0x201d #define XK_rightdoublequotemark                        0xad3
-0x211e #define XK_prescription                                0xad4
-0x2032 #define XK_minutes                                     0xad6
-0x2033 #define XK_seconds                                     0xad7
-0x271d #define XK_latincross                                  0xad9
-0x0000 #define XK_hexagram                                    0xada
-0x25ac #define XK_filledrectbullet                            0xadb
-0x25c0 #define XK_filledlefttribullet                         0xadc
-0x25b6 #define XK_filledrighttribullet                        0xadd
-0x25cf #define XK_emfilledcircle                              0xade
-0x25ae #define XK_emfilledrect                                0xadf
-0x25e6 #define XK_enopencircbullet                            0xae0
-0x25ab #define XK_enopensquarebullet                          0xae1
-0x25ad #define XK_openrectbullet                              0xae2
-0x25b3 #define XK_opentribulletup                             0xae3
-0x25bd #define XK_opentribulletdown                           0xae4
-0x2606 #define XK_openstar                                    0xae5
-0x2022 #define XK_enfilledcircbullet                          0xae6
-0x25aa #define XK_enfilledsqbullet                            0xae7
-0x25b2 #define XK_filledtribulletup                           0xae8
-0x25bc #define XK_filledtribulletdown                         0xae9
-0x261c #define XK_leftpointer                                 0xaea
-0x261e #define XK_rightpointer                                0xaeb
-0x2663 #define XK_club                                        0xaec
-0x2666 #define XK_diamond                                     0xaed
-0x2665 #define XK_heart                                       0xaee
-0x2720 #define XK_maltesecross                                0xaf0
-0x2020 #define XK_dagger                                      0xaf1
-0x2021 #define XK_doubledagger                                0xaf2
-0x2713 #define XK_checkmark                                   0xaf3
-0x2717 #define XK_ballotcross                                 0xaf4
-0x266f #define XK_musicalsharp                                0xaf5
-0x266d #define XK_musicalflat                                 0xaf6
-0x2642 #define XK_malesymbol                                  0xaf7
-0x2640 #define XK_femalesymbol                                0xaf8
-0x260e #define XK_telephone                                   0xaf9
-0x2315 #define XK_telephonerecorder                           0xafa
-0x2117 #define XK_phonographcopyright                         0xafb
-0x2038 #define XK_caret                                       0xafc
-0x201a #define XK_singlelowquotemark                          0xafd
-0x201e #define XK_doublelowquotemark                          0xafe
-0x0000 #define XK_cursor                                      0xaff
-#endif /* XK_PUBLISHING */
-
-/*
- *  APL
- *  Byte 3 = b
- */
-
-#ifdef XK_APL
-0x003c #define XK_leftcaret                                   0xba3
-0x003e #define XK_rightcaret                                  0xba6
-0x2228 #define XK_downcaret                                   0xba8
-0x2227 #define XK_upcaret                                     0xba9
-0x00af #define XK_overbar                                     0xbc0
-0x22a5 #define XK_downtack                                    0xbc2
-0x2229 #define XK_upshoe                                      0xbc3
-0x230a #define XK_downstile                                   0xbc4
-0x005f #define XK_underbar                                    0xbc6
-0x2218 #define XK_jot                                         0xbca
-0x2395 #define XK_quad                                        0xbcc
-0x22a4 #define XK_uptack                                      0xbce
-0x25cb #define XK_circle                                      0xbcf
-0x2308 #define XK_upstile                                     0xbd3
-0x222a #define XK_downshoe                                    0xbd6
-0x2283 #define XK_rightshoe                                   0xbd8
-0x2282 #define XK_leftshoe                                    0xbda
-0x22a2 #define XK_lefttack                                    0xbdc
-0x22a3 #define XK_righttack                                   0xbfc
-#endif /* XK_APL */
-
-/*
- * Hebrew
- * Byte 3 = c
- */
-
-#ifdef XK_HEBREW
-0x2017 #define XK_hebrew_doublelowline                        0xcdf
-0x05d0 #define XK_hebrew_aleph                                0xce0
-0x05d1 #define XK_hebrew_bet                                  0xce1
-0x0000 #define XK_hebrew_beth                                 0xce1  /* deprecated */
-0x05d2 #define XK_hebrew_gimel                                0xce2
-0x0000 #define XK_hebrew_gimmel                               0xce2  /* deprecated */
-0x05d3 #define XK_hebrew_dalet                                0xce3
-0x0000 #define XK_hebrew_daleth                               0xce3  /* deprecated */
-0x05d4 #define XK_hebrew_he                                   0xce4
-0x05d5 #define XK_hebrew_waw                                  0xce5
-0x05d6 #define XK_hebrew_zain                                 0xce6
-0x0000 #define XK_hebrew_zayin                                0xce6  /* deprecated */
-0x05d7 #define XK_hebrew_chet                                 0xce7
-0x0000 #define XK_hebrew_het                                  0xce7  /* deprecated */
-0x05d8 #define XK_hebrew_tet                                  0xce8
-0x0000 #define XK_hebrew_teth                                 0xce8  /* deprecated */
-0x05d9 #define XK_hebrew_yod                                  0xce9
-0x05da #define XK_hebrew_finalkaph                            0xcea
-0x05db #define XK_hebrew_kaph                                 0xceb
-0x05dc #define XK_hebrew_lamed                                0xcec
-0x05dd #define XK_hebrew_finalmem                             0xced
-0x05de #define XK_hebrew_mem                                  0xcee
-0x05df #define XK_hebrew_finalnun                             0xcef
-0x05e0 #define XK_hebrew_nun                                  0xcf0
-0x05e1 #define XK_hebrew_samech                               0xcf1
-0x0000 #define XK_hebrew_samekh                               0xcf1  /* deprecated */
-0x05e2 #define XK_hebrew_ayin                                 0xcf2
-0x05e3 #define XK_hebrew_finalpe                              0xcf3
-0x05e4 #define XK_hebrew_pe                                   0xcf4
-0x05e5 #define XK_hebrew_finalzade                            0xcf5
-0x0000 #define XK_hebrew_finalzadi                            0xcf5  /* deprecated */
-0x05e6 #define XK_hebrew_zade                                 0xcf6
-0x0000 #define XK_hebrew_zadi                                 0xcf6  /* deprecated */
-0x05e7 #define XK_hebrew_qoph                                 0xcf7
-0x0000 #define XK_hebrew_kuf                                  0xcf7  /* deprecated */
-0x05e8 #define XK_hebrew_resh                                 0xcf8
-0x05e9 #define XK_hebrew_shin                                 0xcf9
-0x05ea #define XK_hebrew_taw                                  0xcfa
-0x0000 #define XK_hebrew_taf                                  0xcfa  /* deprecated */
-0x0000 #define XK_Hebrew_switch        0xFF7E  /* Alias for mode_switch */
-#endif /* XK_HEBREW */
-
-/*
- * Thai
- * Byte 3 = d
- */
-
-#ifdef XK_THAI
-0x0e01 #define XK_Thai_kokai                    0xda1
-0x0e02 #define XK_Thai_khokhai                    0xda2
-0x0e03 #define XK_Thai_khokhuat                0xda3
-0x0e04 #define XK_Thai_khokhwai                0xda4
-0x0e05 #define XK_Thai_khokhon                    0xda5
-0x0e06 #define XK_Thai_khorakhang                    0xda6
-0x0e07 #define XK_Thai_ngongu                    0xda7
-0x0e08 #define XK_Thai_chochan                    0xda8
-0x0e09 #define XK_Thai_choching                0xda9
-0x0e0a #define XK_Thai_chochang                0xdaa
-0x0e0b #define XK_Thai_soso                    0xdab
-0x0e0c #define XK_Thai_chochoe                    0xdac
-0x0e0d #define XK_Thai_yoying                    0xdad
-0x0e0e #define XK_Thai_dochada                    0xdae
-0x0e0f #define XK_Thai_topatak                    0xdaf
-0x0e10 #define XK_Thai_thothan                    0xdb0
-0x0e11 #define XK_Thai_thonangmontho                    0xdb1
-0x0e12 #define XK_Thai_thophuthao                    0xdb2
-0x0e13 #define XK_Thai_nonen                    0xdb3
-0x0e14 #define XK_Thai_dodek                    0xdb4
-0x0e15 #define XK_Thai_totao                    0xdb5
-0x0e16 #define XK_Thai_thothung                0xdb6
-0x0e17 #define XK_Thai_thothahan                0xdb7
-0x0e18 #define XK_Thai_thothong                 0xdb8
-0x0e19 #define XK_Thai_nonu                    0xdb9
-0x0e1a #define XK_Thai_bobaimai                0xdba
-0x0e1b #define XK_Thai_popla                    0xdbb
-0x0e1c #define XK_Thai_phophung                0xdbc
-0x0e1d #define XK_Thai_fofa                    0xdbd
-0x0e1e #define XK_Thai_phophan                    0xdbe
-0x0e1f #define XK_Thai_fofan                    0xdbf
-0x0e20 #define XK_Thai_phosamphao                    0xdc0
-0x0e21 #define XK_Thai_moma                    0xdc1
-0x0e22 #define XK_Thai_yoyak                    0xdc2
-0x0e23 #define XK_Thai_rorua                    0xdc3
-0x0e24 #define XK_Thai_ru                    0xdc4
-0x0e25 #define XK_Thai_loling                    0xdc5
-0x0e26 #define XK_Thai_lu                    0xdc6
-0x0e27 #define XK_Thai_wowaen                    0xdc7
-0x0e28 #define XK_Thai_sosala                    0xdc8
-0x0e29 #define XK_Thai_sorusi                    0xdc9
-0x0e2a #define XK_Thai_sosua                    0xdca
-0x0e2b #define XK_Thai_hohip                    0xdcb
-0x0e2c #define XK_Thai_lochula                    0xdcc
-0x0e2d #define XK_Thai_oang                    0xdcd
-0x0e2e #define XK_Thai_honokhuk                0xdce
-0x0e2f #define XK_Thai_paiyannoi                0xdcf
-0x0e30 #define XK_Thai_saraa                    0xdd0
-0x0e31 #define XK_Thai_maihanakat                0xdd1
-0x0e32 #define XK_Thai_saraaa                    0xdd2
-0x0e33 #define XK_Thai_saraam                    0xdd3
-0x0e34 #define XK_Thai_sarai                    0xdd4
-0x0e35 #define XK_Thai_saraii                    0xdd5
-0x0e36 #define XK_Thai_saraue                    0xdd6
-0x0e37 #define XK_Thai_sarauee                    0xdd7
-0x0e38 #define XK_Thai_sarau                    0xdd8
-0x0e39 #define XK_Thai_sarauu                    0xdd9
-0x0e3a #define XK_Thai_phinthu                    0xdda
-0x0000 #define XK_Thai_maihanakat_maitho               0xdde
-0x0e3f #define XK_Thai_baht                    0xddf
-0x0e40 #define XK_Thai_sarae                    0xde0
-0x0e41 #define XK_Thai_saraae                    0xde1
-0x0e42 #define XK_Thai_sarao                    0xde2
-0x0e43 #define XK_Thai_saraaimaimuan                0xde3
-0x0e44 #define XK_Thai_saraaimaimalai                0xde4
-0x0e45 #define XK_Thai_lakkhangyao                0xde5
-0x0e46 #define XK_Thai_maiyamok                0xde6
-0x0e47 #define XK_Thai_maitaikhu                0xde7
-0x0e48 #define XK_Thai_maiek                    0xde8
-0x0e49 #define XK_Thai_maitho                    0xde9
-0x0e4a #define XK_Thai_maitri                    0xdea
-0x0e4b #define XK_Thai_maichattawa                0xdeb
-0x0e4c #define XK_Thai_thanthakhat                0xdec
-0x0e4d #define XK_Thai_nikhahit                0xded
-0x0e50 #define XK_Thai_leksun                    0xdf0
-0x0e51 #define XK_Thai_leknung                    0xdf1
-0x0e52 #define XK_Thai_leksong                    0xdf2
-0x0e53 #define XK_Thai_leksam                    0xdf3
-0x0e54 #define XK_Thai_leksi                    0xdf4
-0x0e55 #define XK_Thai_lekha                    0xdf5
-0x0e56 #define XK_Thai_lekhok                    0xdf6
-0x0e57 #define XK_Thai_lekchet                    0xdf7
-0x0e58 #define XK_Thai_lekpaet                    0xdf8
-0x0e59 #define XK_Thai_lekkao                    0xdf9
-#endif /* XK_THAI */
-
-/*
- *   Korean
- *   Byte 3 = e
- */
-
-#ifdef XK_KOREAN
-
-0x0000 #define XK_Hangul        0xff31    /* Hangul start/stop(toggle) */
-0x0000 #define XK_Hangul_Start        0xff32    /* Hangul start */
-0x0000 #define XK_Hangul_End        0xff33    /* Hangul end, English start */
-0x0000 #define XK_Hangul_Hanja        0xff34    /* Start Hangul->Hanja Conversion */
-0x0000 #define XK_Hangul_Jamo        0xff35    /* Hangul Jamo mode */
-0x0000 #define XK_Hangul_Romaja    0xff36    /* Hangul Romaja mode */
-0x0000 #define XK_Hangul_Codeinput    0xff37    /* Hangul code input mode */
-0x0000 #define XK_Hangul_Jeonja    0xff38    /* Jeonja mode */
-0x0000 #define XK_Hangul_Banja        0xff39    /* Banja mode */
-0x0000 #define XK_Hangul_PreHanja    0xff3a    /* Pre Hanja conversion */
-0x0000 #define XK_Hangul_PostHanja    0xff3b    /* Post Hanja conversion */
-0x0000 #define XK_Hangul_SingleCandidate    0xff3c    /* Single candidate */
-0x0000 #define XK_Hangul_MultipleCandidate    0xff3d    /* Multiple candidate */
-0x0000 #define XK_Hangul_PreviousCandidate    0xff3e    /* Previous candidate */
-0x0000 #define XK_Hangul_Special    0xff3f    /* Special symbols */
-0x0000 #define XK_Hangul_switch    0xFF7E    /* Alias for mode_switch */
-
-/* Hangul Consonant Characters */
-0x3131 #define XK_Hangul_Kiyeog                0xea1
-0x3132 #define XK_Hangul_SsangKiyeog                0xea2
-0x3133 #define XK_Hangul_KiyeogSios                0xea3
-0x3134 #define XK_Hangul_Nieun                    0xea4
-0x3135 #define XK_Hangul_NieunJieuj                0xea5
-0x3136 #define XK_Hangul_NieunHieuh                0xea6
-0x3137 #define XK_Hangul_Dikeud                0xea7
-0x3138 #define XK_Hangul_SsangDikeud                0xea8
-0x3139 #define XK_Hangul_Rieul                    0xea9
-0x313a #define XK_Hangul_RieulKiyeog                0xeaa
-0x313b #define XK_Hangul_RieulMieum                0xeab
-0x313c #define XK_Hangul_RieulPieub                0xeac
-0x313d #define XK_Hangul_RieulSios                0xead
-0x313e #define XK_Hangul_RieulTieut                0xeae
-0x313f #define XK_Hangul_RieulPhieuf                0xeaf
-0x3140 #define XK_Hangul_RieulHieuh                0xeb0
-0x3141 #define XK_Hangul_Mieum                    0xeb1
-0x3142 #define XK_Hangul_Pieub                    0xeb2
-0x3143 #define XK_Hangul_SsangPieub                0xeb3
-0x3144 #define XK_Hangul_PieubSios                0xeb4
-0x3145 #define XK_Hangul_Sios                    0xeb5
-0x3146 #define XK_Hangul_SsangSios                0xeb6
-0x3147 #define XK_Hangul_Ieung                    0xeb7
-0x3148 #define XK_Hangul_Jieuj                    0xeb8
-0x3149 #define XK_Hangul_SsangJieuj                0xeb9
-0x314a #define XK_Hangul_Cieuc                    0xeba
-0x314b #define XK_Hangul_Khieuq                0xebb
-0x314c #define XK_Hangul_Tieut                    0xebc
-0x314d #define XK_Hangul_Phieuf                0xebd
-0x314e #define XK_Hangul_Hieuh                    0xebe
-
- /* Hangul Vowel Characters */
-0x314f #define XK_Hangul_A                    0xebf
-0x3150 #define XK_Hangul_AE                    0xec0
-0x3151 #define XK_Hangul_YA                    0xec1
-0x3152 #define XK_Hangul_YAE                    0xec2
-0x3153 #define XK_Hangul_EO                    0xec3
-0x3154 #define XK_Hangul_E                    0xec4
-0x3155 #define XK_Hangul_YEO                    0xec5
-0x3156 #define XK_Hangul_YE                    0xec6
-0x3157 #define XK_Hangul_O                    0xec7
-0x3158 #define XK_Hangul_WA                    0xec8
-0x3159 #define XK_Hangul_WAE                    0xec9
-0x315a #define XK_Hangul_OE                    0xeca
-0x315b #define XK_Hangul_YO                    0xecb
-0x315c #define XK_Hangul_U                    0xecc
-0x315d #define XK_Hangul_WEO                    0xecd
-0x315e #define XK_Hangul_WE                    0xece
-0x315f #define XK_Hangul_WI                    0xecf
-0x3160 #define XK_Hangul_YU                    0xed0
-0x3161 #define XK_Hangul_EU                    0xed1
-0x3162 #define XK_Hangul_YI                    0xed2
-0x3163 #define XK_Hangul_I                    0xed3
-
-/* Hangul syllable-final (JongSeong) Characters */
-0x11a8 #define XK_Hangul_J_Kiyeog                0xed4
-0x11a9 #define XK_Hangul_J_SsangKiyeog                0xed5
-0x11aa #define XK_Hangul_J_KiyeogSios                0xed6
-0x11ab #define XK_Hangul_J_Nieun                0xed7
-0x11ac #define XK_Hangul_J_NieunJieuj                0xed8
-0x11ad #define XK_Hangul_J_NieunHieuh                0xed9
-0x11ae #define XK_Hangul_J_Dikeud                0xeda
-0x11af #define XK_Hangul_J_Rieul                0xedb
-0x11b0 #define XK_Hangul_J_RieulKiyeog                0xedc
-0x11b1 #define XK_Hangul_J_RieulMieum                0xedd
-0x11b2 #define XK_Hangul_J_RieulPieub                0xede
-0x11b3 #define XK_Hangul_J_RieulSios                0xedf
-0x11b4 #define XK_Hangul_J_RieulTieut                0xee0
-0x11b5 #define XK_Hangul_J_RieulPhieuf                0xee1
-0x11b6 #define XK_Hangul_J_RieulHieuh                0xee2
-0x11b7 #define XK_Hangul_J_Mieum                0xee3
-0x11b8 #define XK_Hangul_J_Pieub                0xee4
-0x11b9 #define XK_Hangul_J_PieubSios                0xee5
-0x11ba #define XK_Hangul_J_Sios                0xee6
-0x11bb #define XK_Hangul_J_SsangSios                0xee7
-0x11bc #define XK_Hangul_J_Ieung                0xee8
-0x11bd #define XK_Hangul_J_Jieuj                0xee9
-0x11be #define XK_Hangul_J_Cieuc                0xeea
-0x11bf #define XK_Hangul_J_Khieuq                0xeeb
-0x11c0 #define XK_Hangul_J_Tieut                0xeec
-0x11c1 #define XK_Hangul_J_Phieuf                0xeed
-0x11c2 #define XK_Hangul_J_Hieuh                0xeee
-
-/* Ancient Hangul Consonant Characters */
-0x316d #define XK_Hangul_RieulYeorinHieuh            0xeef
-0x3171 #define XK_Hangul_SunkyeongeumMieum            0xef0
-0x3178 #define XK_Hangul_SunkyeongeumPieub            0xef1
-0x317f #define XK_Hangul_PanSios                0xef2
-0x3181 #define XK_Hangul_KkogjiDalrinIeung            0xef3
-0x3184 #define XK_Hangul_SunkyeongeumPhieuf            0xef4
-0x3186 #define XK_Hangul_YeorinHieuh                0xef5
-
-/* Ancient Hangul Vowel Characters */
-0x318d #define XK_Hangul_AraeA                    0xef6
-0x318e #define XK_Hangul_AraeAE                0xef7
-
-/* Ancient Hangul syllable-final (JongSeong) Characters */
-0x11eb #define XK_Hangul_J_PanSios                0xef8
-0x11f0 #define XK_Hangul_J_KkogjiDalrinIeung            0xef9
-0x11f9 #define XK_Hangul_J_YeorinHieuh                0xefa
-
-/* Korean currency symbol */
-0x20a9 #define XK_Korean_Won                    0xeff
-
-#endif /* XK_KOREAN */
-
-/*
- *   Armenian
- *   Byte 3 = 0x14
- */
-// yan: skip Armenian for the time being
-#ifdef XK_ARMENIAN
-0x0000 #define XK_Armenian_eternity                0x14a1
-0x0000 #define XK_Armenian_ligature_ew                0x14a2
-0x0000 #define XK_Armenian_full_stop                0x14a3
-0x0000 #define XK_Armenian_verjaket                0x14a3
-0x0000 #define XK_Armenian_parenright                0x14a4
-0x0000 #define XK_Armenian_parenleft                0x14a5
-0x0000 #define XK_Armenian_guillemotright            0x14a6
-0x0000 #define XK_Armenian_guillemotleft            0x14a7
-0x0000 #define XK_Armenian_em_dash                0x14a8
-0x0000 #define XK_Armenian_dot                    0x14a9
-0x0000 #define XK_Armenian_mijaket                0x14a9
-0x0000 #define XK_Armenian_separation_mark            0x14aa
-0x0000 #define XK_Armenian_but                    0x14aa
-0x0000 #define XK_Armenian_comma                0x14ab
-0x0000 #define XK_Armenian_en_dash                0x14ac
-0x0000 #define XK_Armenian_hyphen                0x14ad
-0x0000 #define XK_Armenian_yentamna                0x14ad
-0x0000 #define XK_Armenian_ellipsis                0x14ae
-0x0000 #define XK_Armenian_exclam                0x14af
-0x0000 #define XK_Armenian_amanak                0x14af
-0x0000 #define XK_Armenian_accent                0x14b0
-0x0000 #define XK_Armenian_shesht                0x14b0
-0x0000 #define XK_Armenian_question                0x14b1
-0x0000 #define XK_Armenian_paruyk                0x14b1
-0x0000 #define XK_Armenian_AYB                    0x14b2
-0x0000 #define XK_Armenian_ayb                    0x14b3
-0x0000 #define XK_Armenian_BEN                    0x14b4
-0x0000 #define XK_Armenian_ben                    0x14b5
-0x0000 #define XK_Armenian_GIM                    0x14b6
-0x0000 #define XK_Armenian_gim                    0x14b7
-0x0000 #define XK_Armenian_DA                    0x14b8
-0x0000 #define XK_Armenian_da                    0x14b9
-0x0000 #define XK_Armenian_YECH                0x14ba
-0x0000 #define XK_Armenian_yech                0x14bb
-0x0000 #define XK_Armenian_ZA                    0x14bc
-0x0000 #define XK_Armenian_za                    0x14bd
-0x0000 #define XK_Armenian_E                    0x14be
-0x0000 #define XK_Armenian_e                    0x14bf
-0x0000 #define XK_Armenian_AT                    0x14c0
-0x0000 #define XK_Armenian_at                    0x14c1
-0x0000 #define XK_Armenian_TO                    0x14c2
-0x0000 #define XK_Armenian_to                    0x14c3
-0x0000 #define XK_Armenian_ZHE                    0x14c4
-0x0000 #define XK_Armenian_zhe                    0x14c5
-0x0000 #define XK_Armenian_INI                    0x14c6
-0x0000 #define XK_Armenian_ini                    0x14c7
-0x0000 #define XK_Armenian_LYUN                0x14c8
-0x0000 #define XK_Armenian_lyun                0x14c9
-0x0000 #define XK_Armenian_KHE                    0x14ca
-0x0000 #define XK_Armenian_khe                    0x14cb
-0x0000 #define XK_Armenian_TSA                    0x14cc
-0x0000 #define XK_Armenian_tsa                    0x14cd
-0x0000 #define XK_Armenian_KEN                    0x14ce
-0x0000 #define XK_Armenian_ken                    0x14cf
-0x0000 #define XK_Armenian_HO                    0x14d0
-0x0000 #define XK_Armenian_ho                    0x14d1
-0x0000 #define XK_Armenian_DZA                    0x14d2
-0x0000 #define XK_Armenian_dza                    0x14d3
-0x0000 #define XK_Armenian_GHAT                0x14d4
-0x0000 #define XK_Armenian_ghat                0x14d5
-0x0000 #define XK_Armenian_TCHE                0x14d6
-0x0000 #define XK_Armenian_tche                0x14d7
-0x0000 #define XK_Armenian_MEN                    0x14d8
-0x0000 #define XK_Armenian_men                    0x14d9
-0x0000 #define XK_Armenian_HI                    0x14da
-0x0000 #define XK_Armenian_hi                    0x14db
-0x0000 #define XK_Armenian_NU                    0x14dc
-0x0000 #define XK_Armenian_nu                    0x14dd
-0x0000 #define XK_Armenian_SHA                    0x14de
-0x0000 #define XK_Armenian_sha                    0x14df
-0x0000 #define XK_Armenian_VO                    0x14e0
-0x0000 #define XK_Armenian_vo                    0x14e1
-0x0000 #define XK_Armenian_CHA                    0x14e2
-0x0000 #define XK_Armenian_cha                    0x14e3
-0x0000 #define XK_Armenian_PE                    0x14e4
-0x0000 #define XK_Armenian_pe                    0x14e5
-0x0000 #define XK_Armenian_JE                    0x14e6
-0x0000 #define XK_Armenian_je                    0x14e7
-0x0000 #define XK_Armenian_RA                    0x14e8
-0x0000 #define XK_Armenian_ra                    0x14e9
-0x0000 #define XK_Armenian_SE                    0x14ea
-0x0000 #define XK_Armenian_se                    0x14eb
-0x0000 #define XK_Armenian_VEV                    0x14ec
-0x0000 #define XK_Armenian_vev                    0x14ed
-0x0000 #define XK_Armenian_TYUN                0x14ee
-0x0000 #define XK_Armenian_tyun                0x14ef
-0x0000 #define XK_Armenian_RE                    0x14f0
-0x0000 #define XK_Armenian_re                    0x14f1
-0x0000 #define XK_Armenian_TSO                    0x14f2
-0x0000 #define XK_Armenian_tso                    0x14f3
-0x0000 #define XK_Armenian_VYUN                0x14f4
-0x0000 #define XK_Armenian_vyun                0x14f5
-0x0000 #define XK_Armenian_PYUR                0x14f6
-0x0000 #define XK_Armenian_pyur                0x14f7
-0x0000 #define XK_Armenian_KE                    0x14f8
-0x0000 #define XK_Armenian_ke                    0x14f9
-0x0000 #define XK_Armenian_O                    0x14fa
-0x0000 #define XK_Armenian_o                    0x14fb
-0x0000 #define XK_Armenian_FE                    0x14fc
-0x0000 #define XK_Armenian_fe                    0x14fd
-0x0000 #define XK_Armenian_apostrophe                0x14fe
-0x0000 #define XK_Armenian_section_sign            0x14ff
-#endif /* XK_ARMENIAN */
-
-/*
- *   Georgian
- *   Byte 3 = 0x15
- */
-//yan: skip Georgian for now;
-#ifdef XK_GEORGIAN
-0x0000 #define XK_Georgian_an                    0x15d0
-0x0000 #define XK_Georgian_ban                    0x15d1
-0x0000 #define XK_Georgian_gan                    0x15d2
-0x0000 #define XK_Georgian_don                    0x15d3
-0x0000 #define XK_Georgian_en                    0x15d4
-0x0000 #define XK_Georgian_vin                    0x15d5
-0x0000 #define XK_Georgian_zen                    0x15d6
-0x0000 #define XK_Georgian_tan                    0x15d7
-0x0000 #define XK_Georgian_in                    0x15d8
-0x0000 #define XK_Georgian_kan                    0x15d9
-0x0000 #define XK_Georgian_las                    0x15da
-0x0000 #define XK_Georgian_man                    0x15db
-0x0000 #define XK_Georgian_nar                    0x15dc
-0x0000 #define XK_Georgian_on                    0x15dd
-0x0000 #define XK_Georgian_par                    0x15de
-0x0000 #define XK_Georgian_zhar                0x15df
-0x0000 #define XK_Georgian_rae                    0x15e0
-0x0000 #define XK_Georgian_san                    0x15e1
-0x0000 #define XK_Georgian_tar                    0x15e2
-0x0000 #define XK_Georgian_un                    0x15e3
-0x0000 #define XK_Georgian_phar                0x15e4
-0x0000 #define XK_Georgian_khar                0x15e5
-0x0000 #define XK_Georgian_ghan                0x15e6
-0x0000 #define XK_Georgian_qar                    0x15e7
-0x0000 #define XK_Georgian_shin                0x15e8
-0x0000 #define XK_Georgian_chin                0x15e9
-0x0000 #define XK_Georgian_can                    0x15ea
-0x0000 #define XK_Georgian_jil                    0x15eb
-0x0000 #define XK_Georgian_cil                    0x15ec
-0x0000 #define XK_Georgian_char                0x15ed
-0x0000 #define XK_Georgian_xan                    0x15ee
-0x0000 #define XK_Georgian_jhan                0x15ef
-0x0000 #define XK_Georgian_hae                    0x15f0
-0x0000 #define XK_Georgian_he                    0x15f1
-0x0000 #define XK_Georgian_hie                    0x15f2
-0x0000 #define XK_Georgian_we                    0x15f3
-0x0000 #define XK_Georgian_har                    0x15f4
-0x0000 #define XK_Georgian_hoe                    0x15f5
-0x0000 #define XK_Georgian_fi                    0x15f6
-#endif /* XK_GEORGIAN */
-
-/*
- * Azeri (and other Turkic or Caucasian languages of ex-USSR)
- * Byte 3 = 0x16
- */
-
-#ifdef XK_CAUCASUS
-/* latin */
-0x0000 #define XK_Ccedillaabovedot    0x16a2
-0x1e8a #define XK_Xabovedot        0x16a3
-0x0000 #define XK_Qabovedot        0x16a5
-0x012c #define    XK_Ibreve        0x16a6
-0x0000 #define XK_IE            0x16a7
-0x0000 #define XK_UO            0x16a8
-0x01b5 #define XK_Zstroke        0x16a9
-0x01e6 #define    XK_Gcaron        0x16aa
-0x019f #define    XK_Obarred        0x16af
-0x0000 #define XK_ccedillaabovedot    0x16b2
-0x1e8b #define XK_xabovedot        0x16b3
-0x0000 #define    XK_Ocaron        0x16b4
-0x0000 #define XK_qabovedot        0x16b5
-0x012d #define    XK_ibreve        0x16b6
-0x0000 #define XK_ie            0x16b7
-0x0000 #define XK_uo            0x16b8
-0x01b6 #define XK_zstroke        0x16b9
-0x01e7 #define    XK_gcaron        0x16ba
-0x01d2 #define    XK_ocaron        0x16bd
-0x0275 #define    XK_obarred        0x16bf
-0x018f #define XK_SCHWA        0x16c6
-0x0259 #define XK_schwa        0x16f6
-/* those are not really Caucasus, but I put them here for now */
-/* For Inupiak */
-// yan: is there unicode for Inupiak or Guarani at all?
-0x0000 #define XK_Lbelowdot        0x16d1
-0x0000 #define XK_Lstrokebelowdot    0x16d2
-0x0000 #define XK_lbelowdot        0x16e1
-0x0000 #define XK_lstrokebelowdot    0x16e2
-/* For Guarani */
-0x0000 #define XK_Gtilde        0x16d3
-0x0000 #define XK_gtilde        0x16e3
-#endif /* XK_CAUCASUS */
-
-/*
- *   Vietnamese
- *   Byte 3 = 0x1e
- */
-
-#ifdef XK_VIETNAMESE
-0x1ea0 #define XK_Abelowdot                    0x1ea0
-0x1ea1 #define XK_abelowdot                    0x1ea1
-0x1ea2 #define XK_Ahook                    0x1ea2
-0x1ea3 #define XK_ahook                    0x1ea3
-0x1ea4 #define XK_Acircumflexacute                0x1ea4
-0x1ea5 #define XK_acircumflexacute                0x1ea5
-0x1ea6 #define XK_Acircumflexgrave                0x1ea6
-0x1ea7 #define XK_acircumflexgrave                0x1ea7
-0x1ea8 #define XK_Acircumflexhook                0x1ea8
-0x1ea9 #define XK_acircumflexhook                0x1ea9
-0x1eaa #define XK_Acircumflextilde                0x1eaa
-0x1eab #define XK_acircumflextilde                0x1eab
-0x1eac #define XK_Acircumflexbelowdot                0x1eac
-0x1ead #define XK_acircumflexbelowdot                0x1ead
-0x1eae #define XK_Abreveacute                    0x1eae
-0x1eaf #define XK_abreveacute                    0x1eaf
-0x1eb0 #define XK_Abrevegrave                    0x1eb0
-0x1eb1 #define XK_abrevegrave                    0x1eb1
-0x1eb2 #define XK_Abrevehook                    0x1eb2
-0x1eb3 #define XK_abrevehook                    0x1eb3
-0x1eb4 #define XK_Abrevetilde                    0x1eb4
-0x1eb5 #define XK_abrevetilde                    0x1eb5
-0x1eb6 #define XK_Abrevebelowdot                0x1eb6
-0x1eb7 #define XK_abrevebelowdot                0x1eb7
-0x1eb8 #define XK_Ebelowdot                    0x1eb8
-0x1eb9 #define XK_ebelowdot                    0x1eb9
-0x1eba #define XK_Ehook                    0x1eba
-0x1ebb #define XK_ehook                    0x1ebb
-0x1ebc #define XK_Etilde                    0x1ebc
-0x1ebd #define XK_etilde                    0x1ebd
-0x1ebe #define XK_Ecircumflexacute                0x1ebe
-0x1ebf #define XK_ecircumflexacute                0x1ebf
-0x1ec0 #define XK_Ecircumflexgrave                0x1ec0
-0x1ec1 #define XK_ecircumflexgrave                0x1ec1
-0x1ec2 #define XK_Ecircumflexhook                0x1ec2
-0x1ec3 #define XK_ecircumflexhook                0x1ec3
-0x1ec4 #define XK_Ecircumflextilde                0x1ec4
-0x1ec5 #define XK_ecircumflextilde                0x1ec5
-0x1ec6 #define XK_Ecircumflexbelowdot                0x1ec6
-0x1ec7 #define XK_ecircumflexbelowdot                0x1ec7
-0x1ec8 #define XK_Ihook                    0x1ec8
-0x1ec9 #define XK_ihook                    0x1ec9
-0x1eca #define XK_Ibelowdot                    0x1eca
-0x1ecb #define XK_ibelowdot                    0x1ecb
-0x1ecc #define XK_Obelowdot                    0x1ecc
-0x1ecd #define XK_obelowdot                    0x1ecd
-0x1ece #define XK_Ohook                    0x1ece
-0x1ecf #define XK_ohook                    0x1ecf
-0x1ed0 #define XK_Ocircumflexacute                0x1ed0
-0x1ed1 #define XK_ocircumflexacute                0x1ed1
-0x1ed2 #define XK_Ocircumflexgrave                0x1ed2
-0x1ed3 #define XK_ocircumflexgrave                0x1ed3
-0x1ed4 #define XK_Ocircumflexhook                0x1ed4
-0x1ed5 #define XK_ocircumflexhook                0x1ed5
-0x1ed6 #define XK_Ocircumflextilde                0x1ed6
-0x1ed7 #define XK_ocircumflextilde                0x1ed7
-0x1ed8 #define XK_Ocircumflexbelowdot                0x1ed8
-0x1ed9 #define XK_ocircumflexbelowdot                0x1ed9
-0x1eda #define XK_Ohornacute                    0x1eda
-0x1edb #define XK_ohornacute                    0x1edb
-0x1edc #define XK_Ohorngrave                    0x1edc
-0x1edd #define XK_ohorngrave                    0x1edd
-0x1ede #define XK_Ohornhook                    0x1ede
-0x1edf #define XK_ohornhook                    0x1edf
-0x1ee0 #define XK_Ohorntilde                    0x1ee0
-0x1ee1 #define XK_ohorntilde                    0x1ee1
-0x1ee2 #define XK_Ohornbelowdot                0x1ee2
-0x1ee3 #define XK_ohornbelowdot                0x1ee3
-0x1ee4 #define XK_Ubelowdot                    0x1ee4
-0x1ee5 #define XK_ubelowdot                    0x1ee5
-0x1ee6 #define XK_Uhook                    0x1ee6
-0x1ee7 #define XK_uhook                    0x1ee7
-0x1ee8 #define XK_Uhornacute                    0x1ee8
-0x1ee9 #define XK_uhornacute                    0x1ee9
-0x1eea #define XK_Uhorngrave                    0x1eea
-0x1eeb #define XK_uhorngrave                    0x1eeb
-0x1eec #define XK_Uhornhook                    0x1eec
-0x1eed #define XK_uhornhook                    0x1eed
-0x1eee #define XK_Uhorntilde                    0x1eee
-0x1eef #define XK_uhorntilde                    0x1eef
-0x1ef0 #define XK_Uhornbelowdot                0x1ef0
-0x1ef1 #define XK_uhornbelowdot                0x1ef1
-0x1ef4 #define XK_Ybelowdot                    0x1ef4
-0x1ef5 #define XK_ybelowdot                    0x1ef5
-0x1ef6 #define XK_Yhook                    0x1ef6
-0x1ef7 #define XK_yhook                    0x1ef7
-0x1ef8 #define XK_Ytilde                    0x1ef8
-0x1ef9 #define XK_ytilde                    0x1ef9
-0x01a0 #define XK_Ohorn                    0x1efa /* U+01a0 */
-0x01a1 #define XK_ohorn                    0x1efb /* U+01a1 */
-0x01af #define XK_Uhorn                    0x1efc /* U+01af */
-0x01b0 #define XK_uhorn                    0x1efd /* U+01b0 */
-
-0x0000 #define XK_combining_tilde                0x1e9f /* U+0303 */
-0x0000 #define XK_combining_grave                0x1ef2 /* U+0300 */
-0x0000 #define XK_combining_acute                0x1ef3 /* U+0301 */
-0x0000 #define XK_combining_hook                0x1efe /* U+0309 */
-0x0000 #define XK_combining_belowdot                0x1eff /* U+0323 */
-#endif /* XK_VIETNAMESE */
-
-#ifdef XK_CURRENCY
-0x20a0 #define XK_EcuSign                    0x20a0
-0x20a1 #define XK_ColonSign                    0x20a1
-0x20a2 #define XK_CruzeiroSign                    0x20a2
-0x20a3 #define XK_FFrancSign                    0x20a3
-0x20a4 #define XK_LiraSign                    0x20a4
-0x20a5 #define XK_MillSign                    0x20a5
-0x20a6 #define XK_NairaSign                    0x20a6
-0x20a7 #define XK_PesetaSign                    0x20a7
-0x20a8 #define XK_RupeeSign                    0x20a8
-0x20a9 #define XK_WonSign                    0x20a9
-0x20aa #define XK_NewSheqelSign                0x20aa
-0x20ab #define XK_DongSign                    0x20ab
-0x20ac #define XK_EuroSign                    0x20ac
-#endif
-
-//yan: keysyms from vendor headers go here. I don't know  many though.
-
-0x0008  #define  osfXK_BackSpace 0x1004FF08
-0x001b  #define  osfXK_Escape   0x1004FF1B
-//XXX ? Esc on Solaris?, to check
-0x0000  #define  osfXK_Cancel   0x1004FF69
-0x007f  #define  osfXK_Delete   0x1004FFFF
-
-tojava
-tojava         //XXX fill keysym2JavaKeycodeHash.
-tojava
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_a),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_A, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_b),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_B, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_c),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_C, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_d),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_D, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_e),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_E, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_f),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_g),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_G, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_h),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_H, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_i),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_I, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_j),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_J, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_k),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_K, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_l),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_L, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_m),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_M, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_n),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_N, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_o),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_O, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_p),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_P, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_q),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_Q, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_r),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_R, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_s),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_S, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_t),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_T, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_u),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_U, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_v),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_V, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_w),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_W, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_x),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_X, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_y),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_Y, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_z),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_Z, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* TTY Function keys */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_BackSpace),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_BACK_SPACE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Tab),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_TAB, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_ISO_Left_Tab),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_TAB, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Clear),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CLEAR, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Return),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ENTER, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Linefeed),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ENTER, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Pause),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAUSE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F21),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAUSE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_R1),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAUSE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Scroll_Lock),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_SCROLL_LOCK, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F23),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_SCROLL_LOCK, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_R3),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_SCROLL_LOCK, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Escape),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ESCAPE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Other vendor-specific versions of TTY Function keys */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_BackSpace),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_BACK_SPACE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Clear),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CLEAR, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Escape),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ESCAPE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Modifier keys */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Shift_L),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_SHIFT, java.awt.event.KeyEvent.KEY_LOCATION_LEFT));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Shift_R),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_SHIFT, java.awt.event.KeyEvent.KEY_LOCATION_RIGHT));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Control_L),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CONTROL, java.awt.event.KeyEvent.KEY_LOCATION_LEFT));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Control_R),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CONTROL, java.awt.event.KeyEvent.KEY_LOCATION_RIGHT));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Alt_L),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALT, java.awt.event.KeyEvent.KEY_LOCATION_LEFT));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Alt_R),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALT, java.awt.event.KeyEvent.KEY_LOCATION_RIGHT));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Meta_L),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_META, java.awt.event.KeyEvent.KEY_LOCATION_LEFT));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Meta_R),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_META, java.awt.event.KeyEvent.KEY_LOCATION_RIGHT));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Caps_Lock),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CAPS_LOCK, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Shift_Lock),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CAPS_LOCK, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Misc Functions */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Print),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PRINTSCREEN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F22),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PRINTSCREEN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_R2),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PRINTSCREEN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Cancel),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CANCEL, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Help),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_HELP, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Num_Lock),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_NUM_LOCK, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava
-tojava             /* Other vendor-specific versions of Misc Functions */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Cancel),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CANCEL, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Help),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_HELP, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Rectangular Navigation Block */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Home),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_HOME, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_R7),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_HOME, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Page_Up),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAGE_UP, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Prior),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAGE_UP, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_R9),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAGE_UP, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Page_Down),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAGE_DOWN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Next),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAGE_DOWN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_R15),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAGE_DOWN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_End),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_END, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_R13),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_END, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Insert),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_INSERT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Delete),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DELETE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Keypad equivalents of Rectangular Navigation Block */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Home),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_HOME, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Page_Up),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAGE_UP, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Prior),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAGE_UP, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Page_Down),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAGE_DOWN, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Next),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAGE_DOWN, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_End),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_END, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Insert),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_INSERT, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Delete),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DELETE, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava
-tojava             /* Other vendor-specific Rectangular Navigation Block */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_PageUp),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAGE_UP, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Prior),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAGE_UP, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_PageDown),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAGE_DOWN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Next),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PAGE_DOWN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_EndLine),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_END, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Insert),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_INSERT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Delete),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DELETE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Triangular Navigation Block */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Left),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_LEFT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Up),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_UP, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Right),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_RIGHT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Down),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DOWN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Keypad equivalents of Triangular Navigation Block */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Left),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_KP_LEFT, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Up),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_KP_UP, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Right),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_KP_RIGHT, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Down),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_KP_DOWN, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava
-tojava             /* Other vendor-specific Triangular Navigation Block */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Left),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_LEFT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Up),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_UP, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Right),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_RIGHT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Down),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DOWN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Remaining Cursor control & motion */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Begin),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_BEGIN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Begin),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_BEGIN, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_0),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_0, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_1),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_1, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_2),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_2, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_3),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_3, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_4),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_4, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_5),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_5, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_6),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_6, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_7),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_7, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_8),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_8, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_9),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_9, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_space),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_SPACE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_exclam),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_EXCLAMATION_MARK, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_quotedbl),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_QUOTEDBL, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_numbersign),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_NUMBER_SIGN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dollar),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DOLLAR, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_ampersand),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_AMPERSAND, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_apostrophe),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_QUOTE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_parenleft),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_LEFT_PARENTHESIS, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_parenright),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_RIGHT_PARENTHESIS, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_asterisk),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ASTERISK, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_plus),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PLUS, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_comma),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_COMMA, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_minus),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_MINUS, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_period),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PERIOD, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_slash),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_SLASH, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_colon),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_COLON, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_semicolon),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_SEMICOLON, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_less),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_LESS, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_equal),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_EQUALS, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_greater),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_GREATER, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_at),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_AT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_bracketleft),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_OPEN_BRACKET, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_backslash),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_BACK_SLASH, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_bracketright),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CLOSE_BRACKET, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_asciicircum),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CIRCUMFLEX, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_underscore),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_UNDERSCORE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Super_L),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_WINDOWS, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Super_R),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_WINDOWS, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Menu),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CONTEXT_MENU, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_grave),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_BACK_QUOTE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_braceleft),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_BRACELEFT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_braceright),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_BRACERIGHT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_exclamdown),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_INVERTED_EXCLAMATION_MARK, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Remaining Numeric Keypad Keys */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_0),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_NUMPAD0, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_1),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_NUMPAD1, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_2),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_NUMPAD2, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_3),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_NUMPAD3, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_4),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_NUMPAD4, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_5),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_NUMPAD5, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_6),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_NUMPAD6, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_7),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_NUMPAD7, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_8),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_NUMPAD8, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_9),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_NUMPAD9, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Space),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_SPACE, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Tab),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_TAB, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Enter),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ENTER, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Equal),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_EQUALS, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_R4),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_EQUALS, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Multiply),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_MULTIPLY, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F26),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_MULTIPLY, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_R6),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_MULTIPLY, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Add),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ADD, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Separator),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_SEPARATOR, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Subtract),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_SUBTRACT, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F24),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_SUBTRACT, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Decimal),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DECIMAL, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_KP_Divide),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DIVIDE, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F25),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DIVIDE, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_R5),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DIVIDE, java.awt.event.KeyEvent.KEY_LOCATION_NUMPAD));
-tojava
-tojava             /* Function Keys */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F1),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F1, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F2),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F2, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F3),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F3, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F4),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F4, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F5),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F5, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F6),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F6, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F7),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F7, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F8),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F8, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F9),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F9, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F10),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F10, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F11),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F11, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_F12),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F12, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Sun vendor-specific version of F11 and F12 */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_F36),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F11, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_F37),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_F12, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* X11 keysym names for input method related keys don't always
-tojava              * match keytop engravings or Java virtual key names, so here we
-tojava              * only map constants that we've found on real keyboards.
-tojava              */
-tojava             /* Type 5c Japanese keyboard: kakutei */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Execute),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ACCEPT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava             /* Type 5c Japanese keyboard: henkan */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Kanji),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CONVERT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava             /* Type 5c Japanese keyboard: nihongo */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Henkan_Mode),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_INPUT_METHOD_ON_OFF, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Eisu_Shift   ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALPHANUMERIC       , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Eisu_toggle  ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALPHANUMERIC       , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Zenkaku      ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_FULL_WIDTH         , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Hankaku      ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_HALF_WIDTH         , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Hiragana     ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_HIRAGANA           , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Katakana     ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_KATAKANA           , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Romaji       ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_JAPANESE_ROMAN     , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Kana_Shift   ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_KANA               , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Kana_Lock    ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_KANA_LOCK          , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Muhenkan     ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_NONCONVERT         , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Zen_Koho     ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALL_CANDIDATES     , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Kanji_Bangou ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CODE_INPUT         , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Mae_Koho     ), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PREVIOUS_CANDIDATE , java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava
-tojava             /* VK_KANA_LOCK is handled separately because it generates the
-tojava              * same keysym as ALT_GRAPH in spite of its different behavior.
-tojava              */
-tojava
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Multi_key),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_COMPOSE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Mode_switch),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALT_GRAPH, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_ISO_Level3_Shift),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALT_GRAPH, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Editing block */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Redo),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_AGAIN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         // XXX XK_L2 == F12; TODO: add code to use only one of them depending on the keyboard type. For now, restore
-tojava         // good PC behavior and bad but old Sparc behavior.
-tojava         // keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_L2),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_AGAIN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Undo),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_UNDO, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_L4),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_UNDO, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_L6),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_COPY, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_L8),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PASTE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_L10),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CUT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Find),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_FIND, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_L9),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_FIND, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_L3),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PROPS, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         // XXX XK_L1 == F11; TODO: add code to use only one of them depending on the keyboard type. For now, restore
-tojava         // good PC behavior and bad but old Sparc behavior.
-tojava         // keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_L1),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_STOP, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Sun vendor-specific versions for editing block */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_Again),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_AGAIN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_Undo),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_UNDO, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_Copy),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_COPY, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_Paste),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PASTE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_Cut),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CUT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_Find),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_FIND, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_Props),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PROPS, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_Stop),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_STOP, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Apollo (HP) vendor-specific versions for editing block */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.apXK_Copy),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_COPY, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.apXK_Cut),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CUT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.apXK_Paste),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PASTE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Other vendor-specific versions for editing block */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Copy),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_COPY, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Cut),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_CUT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Paste),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_PASTE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.osfXK_Undo),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_UNDO, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Dead key mappings (for European keyboards) */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_grave),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_GRAVE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_acute),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_ACUTE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_circumflex),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_CIRCUMFLEX, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_tilde),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_TILDE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_macron),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_MACRON, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_breve),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_BREVE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_abovedot),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_ABOVEDOT, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_diaeresis),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_DIAERESIS, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_abovering),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_ABOVERING, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_doubleacute),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_DOUBLEACUTE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_caron),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_CARON, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_cedilla),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_CEDILLA, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_ogonek),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_OGONEK, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_iota),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_IOTA, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_voiced_sound),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_VOICED_SOUND, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_dead_semivoiced_sound),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_SEMIVOICED_SOUND, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Sun vendor-specific dead key mappings (for European keyboards) */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_FA_Grave),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_GRAVE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_FA_Circum),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_CIRCUMFLEX, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_FA_Tilde),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_TILDE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_FA_Acute),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_ACUTE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_FA_Diaeresis),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_DIAERESIS, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.SunXK_FA_Cedilla),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_CEDILLA, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* DEC vendor-specific dead key mappings (for European keyboards) */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.DXK_ring_accent),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_ABOVERING, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.DXK_circumflex_accent),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_CIRCUMFLEX, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.DXK_cedilla_accent),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_CEDILLA, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.DXK_acute_accent),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_ACUTE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.DXK_grave_accent),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_GRAVE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.DXK_tilde),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_TILDE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.DXK_diaeresis),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_DIAERESIS, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava             /* Other vendor-specific dead key mappings (for European keyboards) */
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.hpXK_mute_acute),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_ACUTE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.hpXK_mute_grave),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_GRAVE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.hpXK_mute_asciicircum),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_CIRCUMFLEX, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.hpXK_mute_diaeresis),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_DIAERESIS, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.hpXK_mute_asciitilde),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_DEAD_TILDE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
-tojava
-tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XConstants.NoSymbol),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_UNDEFINED, java.awt.event.KeyEvent.KEY_LOCATION_UNKNOWN));
-tojava
-tojava         /* Reverse search of keysym by keycode. */
-tojava
-tojava         /* Add keyboard locking codes. */
-tojava         javaKeycode2KeysymHash.put( java.awt.event.KeyEvent.VK_CAPS_LOCK, XKeySymConstants.XK_Caps_Lock);
-tojava         javaKeycode2KeysymHash.put( java.awt.event.KeyEvent.VK_NUM_LOCK, XKeySymConstants.XK_Num_Lock);
-tojava         javaKeycode2KeysymHash.put( java.awt.event.KeyEvent.VK_SCROLL_LOCK, XKeySymConstants.XK_Scroll_Lock);
-tojava         javaKeycode2KeysymHash.put( java.awt.event.KeyEvent.VK_KANA_LOCK, XKeySymConstants.XK_Kana_Lock);
-tojava     };
-tojava
-tojava }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/java.desktop/unix/legal/xwd.md	Mon Nov 12 11:10:16 2018 +0530
@@ -0,0 +1,34 @@
+## xwd v1.0.7
+
+### xwd utility
+<pre>
+
+This is the copyright for the files in src/java.desktop/unix/native/libawt_xawt:
+list.h, multiVis.h, wsutils.h, list.c, multiVis.c
+
+Copyright 1994 Hewlett-Packard Co.
+Copyright 1996, 1998  The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+</pre>
--- a/src/java.desktop/unix/legal/xwindows.md	Sun Nov 11 21:24:46 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-## X Windows System v6.8.2
-
-### X Windows System License
-<pre>
-
-This is the copyright for the files in src/java.desktop/unix/native/libawt_xawt:
-list.h, multiVis.h, wsutils.h, list.c, multiVis.c
-
-Copyright (c) 1994 Hewlett-Packard Co.
-Copyright (c) 1996 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from the X Consortium.
-
-___________________________
-
-
-The files in motif/lib/Xm/util included this copyright:
-mkdirhier.man,xmkmf.man, chownxterm.c, makeg.man, mergelib.cpp,
- lndir.man, makestrs.man, checktree.c, lndir.c, makestrs.c
-
-Copyright (c) 1993, 1994 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not
-be used in advertising or otherwise to promote the sale, use or other
-dealing in this Software without prior written authorization from the
-X Consortium.
-
-_____________________________
-
-Xmos_r.h:
-/*
-Copyright (c) 1996 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-*/
-
-_____________________________
-
-Copyright notice for extutil.h:
-Copyright 1989, 1998 The Open Group
-
-All Rights Reserved.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-*
-* Author: Jim Fulton, MIT The Open Group
-*
-* Xlib Extension-Writing Utilities
-*
-* This package contains utilities for writing the client API for various
-* protocol extensions. THESE INTERFACES ARE NOT PART OF THE X STANDARD AND
-* ARE SUBJECT TO CHANGE!
-*/
-
-_____________________________
-
-Copyright notice in keysym2ucs.h:
-
-Copyright 1987, 1994, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts
-
-All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-</pre>
--- a/src/java.desktop/unix/native/libawt_xawt/awt/Xrandr.h	Sun Nov 11 21:24:46 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * $XFree86: xc/lib/Xrandr/Xrandr.h,v 1.9 2002/09/29 23:39:44 keithp Exp $
- *
- * Copyright © 2000 Compaq Computer Corporation, Inc.
- * Copyright © 2002 Hewlett-Packard Company, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Compaq not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  HP makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL COMPAQ
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author:  Jim Gettys, HP Labs, HP.
- */
-
-#ifndef _XRANDR_H_
-#define _XRANDR_H_
-
-/*#include <X11/extensions/randr.h>*/
-#include "randr.h"
-
-#include <X11/Xfuncproto.h>
-
-_XFUNCPROTOBEGIN
-
-
-typedef struct {
-    int width, height;
-    int mwidth, mheight;
-} XRRScreenSize;
-
-/*
- *  Events.
- */
-
-typedef struct {
-    int type;                   /* event base */
-    unsigned long serial;       /* # of last request processed by server */
-    Bool send_event;            /* true if this came from a SendEvent request */
-    Display *display;           /* Display the event was read from */
-    Window window;              /* window which selected for this event */
-    Window root;                /* Root window for changed screen */
-    Time timestamp;             /* when the screen change occurred */
-    Time config_timestamp;      /* when the last configuration change */
-    SizeID size_index;
-    SubpixelOrder subpixel_order;
-    Rotation rotation;
-    int width;
-    int height;
-    int mwidth;
-    int mheight;
-} XRRScreenChangeNotifyEvent;
-
-typedef XID RROutput;
-typedef XID RRCrtc;
-typedef XID RRMode;
-
-typedef unsigned long XRRModeFlags;
-
-typedef struct {
-    RRMode              id;
-    unsigned int        width;
-    unsigned int        height;
-    unsigned long       dotClock;
-    unsigned int        hSyncStart;
-    unsigned int        hSyncEnd;
-    unsigned int        hTotal;
-    unsigned int        hSkew;
-    unsigned int        vSyncStart;
-    unsigned int        vSyncEnd;
-    unsigned int        vTotal;
-    char                *name;
-    unsigned int        nameLength;
-    XRRModeFlags        modeFlags;
-} XRRModeInfo;
-
-typedef struct {
-    Time        timestamp;
-    Time        configTimestamp;
-    int         ncrtc;
-    RRCrtc      *crtcs;
-    int         noutput;
-    RROutput    *outputs;
-    int         nmode;
-    XRRModeInfo *modes;
-} XRRScreenResources;
-
-typedef struct {
-    Time            timestamp;
-    RRCrtc          crtc;
-    char            *name;
-    int             nameLen;
-    unsigned long   mm_width;
-    unsigned long   mm_height;
-    Connection      connection;
-    SubpixelOrder   subpixel_order;
-    int             ncrtc;
-    RRCrtc          *crtcs;
-    int             nclone;
-    RROutput        *clones;
-    int             nmode;
-    int             npreferred;
-    RRMode          *modes;
-} XRROutputInfo;
-
-typedef struct {
-    Time            timestamp;
-    int             x, y;
-    unsigned int    width, height;
-    RRMode          mode;
-    Rotation        rotation;
-    int             noutput;
-    RROutput        *outputs;
-    Rotation        rotations;
-    int             npossible;
-    RROutput        *possible;
-} XRRCrtcInfo;
-
-XRRScreenResources *XRRGetScreenResources (Display *dpy, Window window);
-
-void XRRFreeScreenResources (XRRScreenResources *resources);
-
-XRROutputInfo * XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources,
-                                                               RROutput output);
-void XRRFreeOutputInfo (XRROutputInfo *outputInfo);
-
-XRRCrtcInfo *XRRGetCrtcInfo (Display *dpy, XRRScreenResources *resources,
-                                                                   RRCrtc crtc);
-void XRRFreeCrtcInfo (XRRCrtcInfo *crtcInfo);
-
-
-/* internal representation is private to the library */
-typedef struct _XRRScreenConfiguration XRRScreenConfiguration;
-
-Bool XRRQueryExtension (Display *dpy, int *event_basep, int *error_basep);
-Status XRRQueryVersion (Display *dpy,
-                            int     *major_versionp,
-                            int     *minor_versionp);
-
-XRRScreenConfiguration *XRRGetScreenInfo (Display *dpy,
-                                          Drawable draw);
-
-void XRRFreeScreenConfigInfo (XRRScreenConfiguration *config);
-
-/*
- * Note that screen configuration changes are only permitted if the client can
- * prove it has up to date configuration information.  We are trying to
- * insist that it become possible for screens to change dynamically, so
- * we want to ensure the client knows what it is talking about when requesting
- * changes.
- */
-Status XRRSetScreenConfig (Display *dpy,
-                           XRRScreenConfiguration *config,
-                           Drawable draw,
-                           int size_index,
-                           Rotation rotation,
-                           Time timestamp);
-
-/* added in v1.1, sorry for the lame name */
-Status XRRSetScreenConfigAndRate (Display *dpy,
-                                  XRRScreenConfiguration *config,
-                                  Drawable draw,
-                                  int size_index,
-                                  Rotation rotation,
-                                  short rate,
-                                  Time timestamp);
-
-
-Rotation XRRConfigRotations(XRRScreenConfiguration *config, Rotation *current_rotation);
-
-Time XRRConfigTimes (XRRScreenConfiguration *config, Time *config_timestamp);
-
-XRRScreenSize *XRRConfigSizes(XRRScreenConfiguration *config, int *nsizes);
-
-short *XRRConfigRates (XRRScreenConfiguration *config, int sizeID, int *nrates);
-
-SizeID XRRConfigCurrentConfiguration (XRRScreenConfiguration *config,
-                              Rotation *rotation);
-
-short XRRConfigCurrentRate (XRRScreenConfiguration *config);
-
-int XRRRootToScreen(Display *dpy, Window root);
-
-/*
- * returns the screen configuration for the specified screen; does a lazy
- * evalution to delay getting the information, and caches the result.
- * These routines should be used in preference to XRRGetScreenInfo
- * to avoid unneeded round trips to the X server.  These are new
- * in protocol version 0.1.
- */
-
-
-XRRScreenConfiguration *XRRScreenConfig(Display *dpy, int screen);
-XRRScreenConfiguration *XRRConfig(Screen *screen);
-void XRRSelectInput(Display *dpy, Window window, int mask);
-
-/*
- * the following are always safe to call, even if RandR is not implemented
- * on a screen
- */
-
-
-Rotation XRRRotations(Display *dpy, int screen, Rotation *current_rotation);
-XRRScreenSize *XRRSizes(Display *dpy, int screen, int *nsizes);
-short *XRRRates (Display *dpy, int screen, int sizeID, int *nrates);
-Time XRRTimes (Display *dpy, int screen, Time *config_timestamp);
-
-
-/*
- * intended to take RRScreenChangeNotify,  or
- * ConfigureNotify (on the root window)
- * returns 1 if it is an event type it understands, 0 if not
- */
-int XRRUpdateConfiguration(XEvent *event);
-
-_XFUNCPROTOEND
-
-#endif /* _XRANDR_H_ */
--- a/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c	Mon Nov 12 11:10:16 2018 +0530
@@ -34,7 +34,7 @@
 #ifndef HEADLESS
 #include <X11/extensions/Xdbe.h>
 #include <X11/XKBlib.h>
-#include "Xrandr.h"
+#include <X11/extensions/Xrandr.h>
 #include "GLXGraphicsConfig.h"
 #endif /* !HEADLESS */
 
--- a/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c	Mon Nov 12 11:10:16 2018 +0530
@@ -42,13 +42,14 @@
 #include <X11/extensions/XI.h>
 #include <jni.h>
 #include <sizecalc.h>
-#include "robot_common.h"
 #include "canvas.h"
 #include "wsutils.h"
 #include "list.h"
 #include "multiVis.h"
 #include "gtk_interface.h"
 
+#include "java_awt_event_InputEvent.h"
+
 #if defined(__linux__) || defined(MACOSX)
 #include <sys/socket.h>
 #endif
--- a/src/java.desktop/unix/native/libawt_xawt/awt/list.c	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/list.c	Mon Nov 12 11:10:16 2018 +0530
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,7 +22,6 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* $XConsortium: list.c /main/4 1996/10/14 15:03:56 swick $ */
 /** ------------------------------------------------------------------------
         This file contains routines for manipulating generic lists.
         Lists are implemented with a "harness".  In other words, each
@@ -36,16 +36,14 @@
  However, the following notice accompanied the original version of this
  file:
 
-Copyright (c) 1994 Hewlett-Packard Co.
-Copyright (c) 1996  X Consortium
+Copyright 1994 Hewlett-Packard Co.
+Copyright 1996, 1998  The Open Group
 
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
 
 The above copyright notice and this permission notice shall be included
 in all copies or substantial portions of the Software.
@@ -53,32 +51,28 @@
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
-Except as contained in this notice, the name of the X Consortium shall
+Except as contained in this notice, the name of The Open Group shall
 not be used in advertising or otherwise to promote the sale, use or
 other dealings in this Software without prior written authorization
-from the X Consortium.
+from The Open Group.
 
   ----------------------------------------------------------------------- **/
 
 #include <stdio.h>
 #include <stdlib.h>
+
 #include "list.h"
 
 
 /** ------------------------------------------------------------------------
         Sets the pointers of the specified list to NULL.
     --------------------------------------------------------------------- **/
-#if NeedFunctionPrototypes
 void zero_list(list_ptr lp)
-#else
-void zero_list(lp)
-    list_ptr lp;
-#endif
 {
     lp->next = NULL;
     lp->ptr.item = NULL;
@@ -92,13 +86,7 @@
         and the next pointer in the new node is set to NULL.
         Returns 1 if successful, 0 if the malloc failed.
     -------------------------------------------------------------------- **/
-#if NeedFunctionPrototypes
-int32_t add_to_list(list_ptr lp, void *item)
-#else
-int32_t add_to_list(lp, item)
-    list_ptr lp;
-    void *item;
-#endif
+int add_to_list(list_ptr lp, void *item)
 {
     while (lp->next) {
         lp = lp->next;
@@ -118,11 +106,11 @@
         Creates a new list and sets its pointers to NULL.
         Returns a pointer to the new list.
     -------------------------------------------------------------------- **/
-list_ptr new_list ()
+list_ptr new_list (void)
 {
     list_ptr lp;
 
-    if (lp = (list_ptr) malloc( sizeof( list_item))) {
+    if ((lp = (list_ptr) malloc( sizeof( list_item)))) {
         lp->next = NULL;
         lp->ptr.item = NULL;
     }
@@ -140,38 +128,27 @@
         curr pointer in the new list is the same as in the old list.
         Returns a pointer to the new list head.
     -------------------------------------------------------------------- **/
-#if NeedFunctionPrototypes
-list_ptr dup_list_head(list_ptr lp, int32_t start_at_curr)
-#else
-list_ptr dup_list_head(lp, start_at_curr)
-    list_ptr lp;
-    int32_t start_at_curr;
-#endif
+list_ptr dup_list_head(list_ptr lp, int start_at_curr)
 {
-    list_ptr new_list;
+    list_ptr new_listp;
 
-    if ((new_list = (list_ptr) malloc( sizeof( list_item))) == NULL) {
+    if ((new_listp = (list_ptr) malloc( sizeof( list_item))) == NULL) {
 
         return (list_ptr)NULL;
     }
-    new_list->next = start_at_curr ? lp->ptr.curr : lp->next;
-    new_list->ptr.curr = lp->ptr.curr;
+    new_listp->next = start_at_curr ? lp->ptr.curr : lp->next;
+    new_listp->ptr.curr = lp->ptr.curr;
 
-    return new_list;
+    return new_listp;
 }
 
 
 /** ------------------------------------------------------------------------
         Returns the number of items in the list.
     -------------------------------------------------------------------- **/
-#if NeedFunctionPrototypes
-uint32_t list_length(list_ptr lp)
-#else
-uint32_t list_length(lp)
-    list_ptr lp;
-#endif
+unsigned int list_length(list_ptr lp)
 {
-    uint32_t count = 0;
+    unsigned int count = 0;
 
     while (lp->next) {
         count++;
@@ -191,13 +168,7 @@
         Returns a pointer to the item, so the caller can free it if it
         so desires.  If a match is not found, returns NULL.
     -------------------------------------------------------------------- **/
-#if NeedFunctionPrototypes
 void *delete_from_list(list_ptr lp, void *item)
-#else
-void *delete_from_list(lp, item)
-    list_ptr lp;
-    void *item;
-#endif
 {
     list_ptr new_next;
 
@@ -222,13 +193,7 @@
         with new_list().  If free_items is true, each item pointed to
         from the node is freed, in addition to the node itself.
     -------------------------------------------------------------------- **/
-#if NeedFunctionPrototypes
-void delete_list(list_ptr lp, int32_t free_items)
-#else
-void delete_list(lp, free_items)
-    list_ptr lp;
-    int32_t free_items;
-#endif
+void delete_list(list_ptr lp, int free_items)
 {
     list_ptr del_node;
     void *item;
@@ -244,13 +209,7 @@
     }
 }
 
-#if NeedFunctionPrototypes
 void delete_list_destroying(list_ptr lp, void destructor(void *item))
-#else
-void delete_list_destroying(lp, destructor)
-    list_ptr lp;
-    void (*destructor)();
-#endif
 {
     list_ptr del_node;
     void *item;
@@ -272,12 +231,7 @@
         Sets the list head node's curr ptr to the first node in the list.
         Returns NULL if the list is empty.
     -------------------------------------------------------------------- **/
-#if NeedFunctionPrototypes
 void * first_in_list(list_ptr lp)
-#else
-void * first_in_list(lp)
-    list_ptr lp;
-#endif
 {
     if (! lp) {
 
@@ -294,12 +248,7 @@
         first_in_list must have been called prior.
         Returns NULL if no next item.
     -------------------------------------------------------------------- **/
-#if NeedFunctionPrototypes
 void * next_in_list(list_ptr lp)
-#else
-void * next_in_list(lp)
-    list_ptr lp;
-#endif
 {
     if (! lp) {
 
@@ -312,12 +261,8 @@
     return lp->ptr.curr ? lp->ptr.curr->ptr.item : NULL;
 }
 
-#if NeedFunctionPrototypes
-int32_t list_is_empty(list_ptr lp)
-#else
-int32_t list_is_empty(lp)
-    list_ptr lp;
-#endif
+int list_is_empty(list_ptr lp)
 {
     return (lp == NULL || lp->next == NULL);
 }
+
--- a/src/java.desktop/unix/native/libawt_xawt/awt/list.h	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/list.h	Mon Nov 12 11:10:16 2018 +0530
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,7 +22,6 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* $XConsortium: list.h /main/4 1996/10/14 15:04:04 swick $ */
 /** ------------------------------------------------------------------------
         This file contains routines for manipulating generic lists.
         Lists are implemented with a "harness".  In other words, each
@@ -36,16 +36,14 @@
  However, the following notice accompanied the original version of this
  file:
 
-Copyright (c) 1994 Hewlett-Packard Co.
-Copyright (c) 1996  X Consortium
+Copyright 1994 Hewlett-Packard Co.
+Copyright 1996, 1998  The Open Group
 
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
 
 The above copyright notice and this permission notice shall be included
 in all copies or substantial portions of the Software.
@@ -53,23 +51,22 @@
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
-Except as contained in this notice, the name of the X Consortium shall
+Except as contained in this notice, the name of The Open Group shall
 not be used in advertising or otherwise to promote the sale, use or
 other dealings in this Software without prior written authorization
-from the X Consortium.
+from The Open Group.
 
     -------------------------------------------------------------------- **/
 
-#include "gdefs.h"
-
 #ifndef LIST_DEF
 #define LIST_DEF
 
+#include <X11/Xfuncproto.h>
 #define LESS    -1
 #define EQUAL   0
 #define GREATER 1
@@ -85,65 +82,41 @@
 } list, list_item, *list_ptr;
 
 typedef void (*DESTRUCT_FUNC_PTR)(
-#if NeedFunctionPrototypes
 void *
-#endif
 );
 
 void zero_list(
-#if NeedFunctionPrototypes
           list_ptr
-#endif
     );
-int32_t add_to_list (
-#if NeedFunctionPrototypes
+int add_to_list (
           list_ptr , void *
-#endif
     );
 list_ptr new_list (
-#if NeedFunctionPrototypes
           void
-#endif
     );
 list_ptr dup_list_head (
-#if NeedFunctionPrototypes
-          list_ptr , int32_t
-#endif
+          list_ptr , int
     );
-uint32_t list_length(
-#if NeedFunctionPrototypes
+unsigned int list_length(
           list_ptr
-#endif
     );
 void *delete_from_list (
-#if NeedFunctionPrototypes
           list_ptr , void *
-#endif
     );
 void delete_list(
-#if NeedFunctionPrototypes
-          list_ptr , int32_t
-#endif
+          list_ptr , int
     );
 void delete_list_destroying (
-#if NeedFunctionPrototypes
           list_ptr , DESTRUCT_FUNC_PTR
-#endif
     );
 void *first_in_list (
-#if NeedFunctionPrototypes
           list_ptr
-#endif
     );
 void *next_in_list (
-#if NeedFunctionPrototypes
           list_ptr
-#endif
     );
-int32_t list_is_empty (
-#if NeedFunctionPrototypes
+int list_is_empty (
           list_ptr
-#endif
     );
 
 #endif
--- a/src/java.desktop/unix/native/libawt_xawt/awt/multiVis.c	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/multiVis.c	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,6 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* $XConsortium: multiVis.c /main/4 1996/10/14 15:04:08 swick $ */
 /** ------------------------------------------------------------------------
         This file contains functions to create a list of regions which
         tile a specified window.  Each region contains all visible
@@ -37,16 +36,14 @@
  However, the following notice accompanied the original version of this
  file:
 
-Copyright (c) 1994 Hewlett-Packard Co.
-Copyright (c) 1996  X Consortium
+Copyright 1994 Hewlett-Packard Co.
+Copyright 1996, 1998  The Open Group
 
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
 
 The above copyright notice and this permission notice shall be included
 in all copies or substantial portions of the Software.
@@ -54,17 +51,18 @@
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
-Except as contained in this notice, the name of the X Consortium shall
+Except as contained in this notice, the name of The Open Group shall
 not be used in advertising or otherwise to promote the sale, use or
 other dealings in this Software without prior written authorization
-from the X Consortium.
+from The Open Group.
 
     ------------------------------------------------------------------------ **/
+
 #include <stdlib.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
@@ -73,20 +71,16 @@
 #include "list.h"
 #include "wsutils.h"
 #include "multiVis.h"
-#include "robot_common.h"
-
-static char *vis_class_str[] = { "StaticGray" , "GrayScale" , "StaticColor",
-                                 "PseudoColor","TrueColor","DirectColor" } ;
 /* These structures are copied from X11/region.h.  For some reason
- * they're invisible from the outside.*/
-
+ * they're invisible from the outside.
+ */
 typedef struct {
     short x1, x2, y1, y2;
 } myBox, myBOX, myBoxRec, *myBoxPtr;
 
-typedef struct my_XRegion {    /* 64-bit: Region is supposed to be opaque    */
-    long size;                 /* but it is defined here anyway.  I'm going  */
-    long numRects;             /* to leave those longs alone.                */
+typedef struct my_XRegion {
+    long size;
+    long numRects;
     myBOX *rects;
     myBOX extents;
 } myREGION;
@@ -96,10 +90,10 @@
     Window win;
     Visual *vis;
     Colormap cmap;
-    int32_t x_rootrel, y_rootrel;       /* root relative location of window */
-    int32_t x_vis, y_vis;               /* rt rel x,y of vis part, not parent clipped */
-    int32_t width, height;              /* width and height of visible part */
-    int32_t border_width;               /* border width of the window */
+    int x_rootrel, y_rootrel;   /* root relative location of window */
+    int x_vis, y_vis;           /* rt rel x,y of vis part, not parent clipped */
+    int width, height;          /* width and height of visible part */
+    int border_width;           /* border width of the window */
     Window parent;              /* id of parent (for debugging) */
 } image_win_type;
 
@@ -110,10 +104,10 @@
     Window win;                 /* lowest window of this visual */
     Visual *vis;
     Colormap cmap;
-    int32_t x_rootrel, y_rootrel;       /* root relative location of bottom window */
-    int32_t x_vis, y_vis;               /* rt rel x,y of vis part, not parent clipped */
-    int32_t width, height;              /* w & h of visible rect of bottom window */
-    int32_t border;                     /* border width of the window */
+    int x_rootrel, y_rootrel;   /* root relative location of bottom window */
+    int x_vis, y_vis;           /* rt rel x,y of vis part, not parent clipped */
+    int width, height;          /* w & h of visible rect of bottom window */
+    int border;                 /* border width of the window */
     Region visible_region;
 } image_region_type;
 
@@ -143,77 +137,67 @@
 extern list_ptr dup_list_head();
 extern void *   first_in_list();
 extern void *   next_in_list();
-extern int32_t  add_to_list();
+extern int      add_to_list();
 extern void     zero_list();
 extern void     delete_list();
 extern void     delete_list_destroying();
-extern uint32_t list_length();
+extern unsigned int list_length();
 */
 
 /* Prototype Declarations for Static Functions */
+static void QueryColorMap(
+           Display *, Colormap , Visual *,
+           XColor **, int *, int *, int *
+           );
 static void TransferImage(
-#if NeedFunctionPrototypes
-           Display *, XImage *,int32_t, int32_t , image_region_type*,
-           XImage *,int32_t ,int32_t
-#endif
+           Display *, XImage *,int, int , image_region_type*,
+           XImage *,int ,int
            );
 static XImage * ReadRegionsInList(
-#if NeedFunctionPrototypes
-           Display *, Visual *, int32_t ,int32_t ,int32_t ,
-           int32_t , XRectangle, list_ptr
-#endif
+           Display *, Visual *, int, int, unsigned int,
+           unsigned int, XRectangle, list_ptr
            );
 
 static list_ptr make_region_list(
-#if NeedFunctionPrototypes
                   Display*, Window, XRectangle*,
-                  int32_t*, int32_t, XVisualInfo**, int32_t     *
-#endif
+                  int*, int, XVisualInfo**, int *
          );
 
 static void destroy_region_list(
-#if NeedFunctionPrototypes
             list_ptr
-#endif
             ) ;
 static void subtr_rect_from_image_region(
-#if NeedFunctionPrototypes
-           image_region_type *, int32_t , int32_t , int32_t , int32_t
-#endif
+           image_region_type *, int , int , int , int
      );
 static void add_rect_to_image_region(
-#if NeedFunctionPrototypes
            image_region_type *,
-           int32_t , int32_t , int32_t , int32_t
-#endif
+           int , int , int , int
      );
-static int32_t src_in_region_list(
-#if NeedFunctionPrototypes
+static int src_in_region_list(
     image_win_type *, list_ptr
-#endif
     );
 static void add_window_to_list(
-#if NeedFunctionPrototypes
-    list_ptr, Window, int32_t, int32_t ,
-    int32_t     , int32_t , int32_t , int32_t, int32_t,
+    list_ptr, Window, int, int ,
+    int , int , int , int, int,
     Visual*, Colormap, Window
-#endif
+    );
+static int src_in_image(
+    image_win_type      *, int  , XVisualInfo**
     );
-static int32_t src_in_image(
-#if NeedFunctionPrototypes
-    image_win_type      *, int32_t      , XVisualInfo**
-#endif
+static int src_in_overlay(
+    image_region_type *, int, OverlayInfo *, int*, int*
     );
-static int32_t src_in_overlay(
-#if NeedFunctionPrototypes
-    image_region_type *, int32_t, OverlayInfo *, int32_t*, int32_t*
-#endif
-    );
+static void make_src_list(
+    Display *, list_ptr, XRectangle *, Window,
+    int, int, XWindowAttributes *, XRectangle *
+);
+static void destroy_image_region(
+    image_region_type *
+);
 
 /* End of Prototype Declarations */
 
-void initFakeVisual(Vis)
-Visual *Vis ;
+void initFakeVisual(Visual *Vis)
 {
     Vis->ext_data=NULL;
     Vis->class = DirectColor ;
@@ -224,42 +208,87 @@
     Vis->bits_per_rgb = 8 ;
 }
 
-/* QueryColorMap has been moved into robot_common.c so it can be used by
- * awt_DataTransferer.c as well.
- */
+static void
+QueryColorMap(Display *disp, Colormap src_cmap, Visual *src_vis,
+              XColor **src_colors, int *rShift, int *gShift, int *bShift)
+{
+     unsigned int ncolors,i ;
+     unsigned long       redMask, greenMask, blueMask;
+     int                 redShift, greenShift, blueShift;
+     XColor *colors ;
+
+     ncolors = (unsigned) src_vis->map_entries ;
+     *src_colors = colors = (XColor *)malloc(ncolors * sizeof(XColor) ) ;
 
-int32_t
-GetMultiVisualRegions(disp,srcRootWinid, x, y, width, height,
-    transparentOverlays,numVisuals, pVisuals,numOverlayVisuals, pOverlayVisuals,
-    numImageVisuals, pImageVisuals,vis_regions,vis_image_regions,allImage)
-    Display             *disp;
-    Window              srcRootWinid;   /* root win on which grab was done */
-    int32_t             x;      /* root rel UL corner of bounding box of grab */
-    int32_t             y;
-    uint32_t            width;  /* size of bounding box of grab */
-    uint32_t            height;
-    int32_t             *transparentOverlays ;
-    int32_t             *numVisuals;
-    XVisualInfo         **pVisuals;
-    int32_t             *numOverlayVisuals;
-    OverlayInfo         **pOverlayVisuals;
-    int32_t             *numImageVisuals;
-    XVisualInfo         ***pImageVisuals;
-    list_ptr            *vis_regions;    /* list of regions to read from */
-    list_ptr            *vis_image_regions ;
-    int32_t             *allImage ;
+     if(src_vis->class != TrueColor && src_vis->class != DirectColor)
+     {
+         for(i=0 ; i < ncolors ; i++)
+         {
+                colors[i].pixel = i ;
+                colors[i].pad = 0;
+                colors[i].flags = DoRed|DoGreen|DoBlue;
+         }
+     }
+     else /** src is decomposed rgb ***/
+     {
+        /* Get the X colormap */
+        redMask = src_vis->red_mask;
+        greenMask = src_vis->green_mask;
+        blueMask = src_vis->blue_mask;
+        redShift = 0; while (!(redMask&0x1)) {
+                redShift++;
+                redMask = redMask>>1;
+        }
+        greenShift = 0; while (!(greenMask&0x1)) {
+                greenShift++;
+                greenMask = greenMask>>1;
+        }
+        blueShift = 0; while (!(blueMask&0x1)) {
+                blueShift++;
+                blueMask = blueMask>>1;
+        }
+        *rShift = redShift ;
+        *gShift = greenShift ;
+        *bShift = blueShift ;
+        for (i=0; i<ncolors; i++) {
+                if( i <= redMask)colors[i].pixel = (i<<redShift) ;
+                if( i <= greenMask)colors[i].pixel |= (i<<greenShift) ;
+                if( i <= blueMask)colors[i].pixel |= (i<<blueShift) ;
+                /***** example :for gecko's 3-3-2 map, blue index should be <= 3.
+                colors[i].pixel = (i<<redShift)|(i<<greenShift)|(i<<blueShift);
+                *****/
+                colors[i].pad = 0;
+                colors[i].flags = DoRed|DoGreen|DoBlue;
+        }
+      }
+
+      XQueryColors(disp, src_cmap, colors, (int) ncolors);
+}
+
+int
+GetMultiVisualRegions(Display *disp,
+                      /* root win on which grab was done */
+                      Window srcRootWinid,
+                      /* root rel UL corner of bounding box of grab */
+                      int x, int y,
+                      /* size of bounding box of grab */
+                      unsigned int width, unsigned int height,
+                      int *transparentOverlays, int *numVisuals,
+                      XVisualInfo **pVisuals, int *numOverlayVisuals,
+                      OverlayInfo **pOverlayVisuals,
+                      int *numImageVisuals, XVisualInfo ***pImageVisuals,
+                      /* list of regions to read from */
+                      list_ptr *vis_regions,
+                      list_ptr *vis_image_regions, int *allImage)
 {
-    int32_t             hasNonDefault;
+    int                 hasNonDefault;
     XRectangle          bbox;           /* bounding box of grabbed area */
 
 
-    /* Java uses 32-bit ints for coordinates, but XRectangles use 16-bit shorts.
-     * Hope nobody passes in too big a coordinate */
-
-    bbox.x = (short) x;                 /* init X rect for bounding box */
-    bbox.y = (short) y;
-    bbox.width = (unsigned short) width;
-    bbox.height = (unsigned short) height;
+    bbox.x = x;                 /* init X rect for bounding box */
+    bbox.y = y;
+    bbox.width = width;
+    bbox.height = height;
 
     GetXVisualInfo(disp,DefaultScreen(disp),
                     transparentOverlays,
@@ -290,49 +319,48 @@
 
 }
 
-static void TransferImage(disp,reg_image,srcw,srch,reg,
-                          target_image,dst_x,dst_y)
-Display *disp;
-XImage *reg_image,*target_image ;
-image_region_type       *reg;
-int32_t srcw,srch,dst_x , dst_y ;
+static void TransferImage(Display *disp, XImage *reg_image,
+                          int srcw, int srch,
+                          image_region_type *reg, XImage *target_image,
+                          int dst_x, int dst_y)
 {
-    int32_t ncolors;
-    int32_t i,j,old_pixel,new_pixel,red_ind,green_ind,blue_ind ;
+    int i,j,old_pixel,new_pixel,red_ind,green_ind,blue_ind ;
     XColor *colors;
-    int32_t rShift,gShift,bShift;
-    int32_t targetBytesPerLine ;
+    int rShift = 0, gShift = 0, bShift = 0;
 
-    ncolors = QueryColorMap(disp,reg->cmap,reg->vis,&colors,
+    QueryColorMap(disp,reg->cmap,reg->vis,&colors,
          &rShift,&gShift,&bShift) ;
 
-    targetBytesPerLine = target_image->bytes_per_line;
-
     switch (reg->vis->class) {
     case TrueColor :
        for(i=0 ; i < srch ; i++)
        {
          for(j=0 ; j < srcw ;  j++)
          {
-           old_pixel = (int32_t) XGetPixel(reg_image,j,i) ;
+           old_pixel = XGetPixel(reg_image,j,i) ;
 
-/* commented out since not using server RGB masks in all true color modes
+/*
+ * JDK modification.
+ * commented out since not using server RGB masks in all true color modes
  * causes the R and B values to be swapped around on some X servers
  *    - robi.khan@eng 9/7/1999
- *           if( reg->vis->map_entries == 16) {
+ *         if( reg->vis->map_entries == 16) {
  */
-             red_ind   = (old_pixel & reg->vis->red_mask) >> rShift ;
+                 red_ind = (old_pixel & reg->vis->red_mask) >> rShift ;
                  green_ind = (old_pixel & reg->vis->green_mask) >> gShift ;
-                 blue_ind  = (old_pixel & reg->vis->blue_mask) >> bShift ;
+                 blue_ind = (old_pixel & reg->vis->blue_mask) >> bShift ;
 
                  new_pixel = (
                               ((colors[red_ind].red >> 8) << RED_SHIFT)
                               |((colors[green_ind].green >> 8) << GREEN_SHIFT)
                               |((colors[blue_ind].blue >> 8) << BLUE_SHIFT)
                              );
-/*         }
- *  else
- *    new_pixel = old_pixel;
+/* JDK modification.
+ * else part of above modification
+ *
+ *         }
+ *         else
+ *              new_pixel = old_pixel;
  */
 
            XPutPixel(target_image,dst_x+j, dst_y+i,new_pixel);
@@ -343,14 +371,15 @@
     case DirectColor :
        for(i=0 ; i < srch ; i++)
        {
+
          for(j=0 ; j < srcw ;  j++)
          {
-           old_pixel = (int32_t) XGetPixel(reg_image,j,i) ;
-           red_ind   = (old_pixel & reg->vis->red_mask) >> rShift ;
-               green_ind = (old_pixel & reg->vis->green_mask) >> gShift ;
-               blue_ind  = (old_pixel & reg->vis->blue_mask) >> bShift ;
+           old_pixel = XGetPixel(reg_image,j,i) ;
+           red_ind = (old_pixel & reg->vis->red_mask) >> rShift ;
+           green_ind = (old_pixel & reg->vis->green_mask) >> gShift ;
+           blue_ind = (old_pixel & reg->vis->blue_mask) >> bShift ;
 
-               new_pixel = (
+           new_pixel = (
                          ((colors[red_ind].red >> 8) << RED_SHIFT)
                         |((colors[green_ind].green >> 8) << GREEN_SHIFT)
                         |((colors[blue_ind].blue >> 8) << BLUE_SHIFT)
@@ -365,9 +394,9 @@
        {
          for(j=0 ; j < srcw ;  j++)
          {
-               old_pixel = (int32_t) XGetPixel(reg_image,j,i) ;
+            old_pixel = XGetPixel(reg_image,j,i) ;
 
-               new_pixel = (
+           new_pixel = (
                          ((colors[old_pixel].red >> 8) << RED_SHIFT)
                         |((colors[old_pixel].green >> 8) << GREEN_SHIFT)
                         |((colors[old_pixel].blue >> 8) << BLUE_SHIFT)
@@ -378,66 +407,76 @@
        }
        break;
     }
-
-    /* Fix memory leak by freeing colors
-     *  - robi.khan@eng 9/22/1999
-     */
+ /* JDK modification
+  * Fix memory leak by freeing colors
+  *  - robi.khan@eng 9/22/1999
+  */
     free(colors);
 }
 
 static XImage *
-ReadRegionsInList(disp,fakeVis,depth,format,width,height,bbox,regions)
-Display *disp ;
-Visual *fakeVis ;
-int32_t depth , width , height ;
-int32_t format ;
-XRectangle      bbox;           /* bounding box of grabbed area */
-list_ptr regions;/* list of regions to read from */
+ReadRegionsInList(Display *disp, Visual *fakeVis, int depth, int format,
+                  unsigned int width, unsigned int height,
+                  XRectangle bbox,      /* bounding box of grabbed area */
+                  list_ptr regions)     /* list of regions to read from */
 {
-    XImage              *ximage ;
-    image_region_type* reg;
-    int32_t rect;
+    image_region_type   *reg;
+    int                 dst_x, dst_y;   /* where in pixmap to write (UL) */
+    int                 diff;
+
+    XImage              *reg_image,*ximage ;
+    int                 srcRect_x,srcRect_y,srcRect_width,srcRect_height ;
+    int                 bytes_per_line;
 
-    ximage = XCreateImage(disp,fakeVis,(uint32_t) depth,format,0,NULL,
-                          (uint32_t)width,(uint32_t)height,8,0);
+    ximage = XCreateImage(disp,fakeVis,depth,format,0,NULL,width,height,
+                 8,0) ;
+    bytes_per_line = ximage->bytes_per_line;
 
-    ximage->data = calloc(ximage->bytes_per_line*height*((format==ZPixmap)? 1 : depth), sizeof(char));
+    if (format == ZPixmap)
+          ximage->data = malloc(height*bytes_per_line);
+    else
+        ximage->data = malloc(height*bytes_per_line*depth);
+
     ximage->bits_per_pixel = depth; /** Valid only if format is ZPixmap ***/
 
     for (reg = (image_region_type *) first_in_list( regions); reg;
          reg = (image_region_type *) next_in_list( regions))
     {
-                struct my_XRegion *vis_reg = (struct my_XRegion *)(reg->visible_region);
-                for (rect = 0; rect < vis_reg->numRects; rect++)
+                int rect;
+                struct my_XRegion *vis_reg;
+                vis_reg = (struct my_XRegion *)(reg->visible_region);
+                for (rect = 0;
+                     rect < vis_reg->numRects;
+                     rect++)
                 {
-                    /** ------------------------------------------------------------------------
-                            Intersect bbox with visible part of region giving src rect & output
-                            location.  Width is the min right side minus the max left side.
-                            Similar for height.  Offset src rect so x,y are relative to
-                            origin of win, not the root-relative visible rect of win.
-                        ------------------------------------------------------------------------ **/
-                        int32_t srcRect_width  = MIN( vis_reg->rects[rect].x2, bbox.width + bbox.x)
-                                         - MAX( vis_reg->rects[rect].x1, bbox.x);
-
-                        int32_t srcRect_height = MIN( vis_reg->rects[rect].y2, bbox.height + bbox.y)
-                                         - MAX( vis_reg->rects[rect].y1, bbox.y);
+                /** ------------------------------------------------------------------------
+                        Intersect bbox with visible part of region giving src rect & output
+                        location.  Width is the min right side minus the max left side.
+                        Similar for height.  Offset src rect so x,y are relative to
+                        origin of win, not the root-relative visible rect of win.
+                    ------------------------------------------------------------------------ **/
+                    srcRect_width  = MIN( vis_reg->rects[rect].x2, bbox.width + bbox.x) -
+                                     MAX( vis_reg->rects[rect].x1, bbox.x);
+                    srcRect_height = MIN( vis_reg->rects[rect].y2, bbox.height + bbox.y) -
+                                     MAX( vis_reg->rects[rect].y1, bbox.y);
+                    diff = bbox.x - vis_reg->rects[rect].x1;
+                    srcRect_x = MAX( 0, diff)  + (vis_reg->rects[rect].x1 - reg->x_rootrel - reg->border);
+                    dst_x     = MAX( 0, -diff) ;
+                    diff = bbox.y - vis_reg->rects[rect].y1;
+                    srcRect_y = MAX( 0, diff)  + (vis_reg->rects[rect].y1 - reg->y_rootrel - reg->border);
+                    dst_y     = MAX( 0, -diff) ;
+                    reg_image = XGetImage(disp,reg->win,srcRect_x,srcRect_y,
+                                srcRect_width,srcRect_height,AllPlanes,format) ;
 
-                        int32_t diff = bbox.x - vis_reg->rects[rect].x1;
-                        int32_t srcRect_x = MAX( 0, diff)  + (vis_reg->rects[rect].x1 - reg->x_rootrel - reg->border);
-                        int32_t dst_x     = MAX( 0, -diff) ;
-
-                        diff = bbox.y - vis_reg->rects[rect].y1;
-                        int32_t srcRect_y = MAX( 0, diff)  + (vis_reg->rects[rect].y1 - reg->y_rootrel - reg->border);
-                        int32_t dst_y     = MAX( 0, -diff) ;
-                        XImage* reg_image = XGetImage(disp,reg->win,srcRect_x,srcRect_y,
-                                            (uint32_t) srcRect_width, (uint32_t) srcRect_height,AllPlanes,format) ;
-
-                        if (reg_image) {
-                            TransferImage(disp,reg_image,srcRect_width,
-                                            srcRect_height,reg,ximage,dst_x,dst_y) ;
-                            XDestroyImage(reg_image);
-                        }
-                }
+                    /* JDK Modification
+                     * Enclose in if test and also call XDestroyImage
+                     */
+                    if (reg_image) {
+                        TransferImage(disp,reg_image,srcRect_width,
+                                     srcRect_height,reg,ximage,dst_x,dst_y) ;
+                        XDestroyImage(reg_image);
+                    }
+            }
     }
     return ximage ;
 }
@@ -446,62 +485,61 @@
 /** ------------------------------------------------------------------------
     ------------------------------------------------------------------------ **/
 
-XImage *ReadAreaToImage(disp, srcRootWinid, x, y, width, height,
-    numVisuals,pVisuals,numOverlayVisuals,pOverlayVisuals,numImageVisuals,
-    pImageVisuals,vis_regions,vis_image_regions,format,allImage)
-    Display             *disp;
-    Window              srcRootWinid;   /* root win on which grab was done */
-    int32_t                     x;   /* root rel UL corner of bounding box of grab */
-    int32_t                     y;
-    uint32_t            width;  /* size of bounding box of grab */
-    uint32_t            height;
-    /** int32_t                 transparentOverlays; ***/
-    int32_t                     numVisuals;
-    XVisualInfo         *pVisuals;
-    int32_t                     numOverlayVisuals;
-    OverlayInfo         *pOverlayVisuals;
-    int32_t                     numImageVisuals;
-    XVisualInfo         **pImageVisuals;
-    list_ptr            vis_regions;    /* list of regions to read from */
-    list_ptr            vis_image_regions ;/* list of regions to read from */
-    int32_t                     format;
-    int32_t             allImage ;
+XImage *ReadAreaToImage(Display *disp,
+                        /* root win on which grab was done */
+                        Window srcRootWinid,
+                        /* root rel UL corner of bounding box of grab */
+                        int x, int y,
+                        /* size of bounding box of grab */
+                        unsigned int width, unsigned int height,
+                        int numVisuals, XVisualInfo *pVisuals,
+                        int numOverlayVisuals, OverlayInfo *pOverlayVisuals,
+                        int numImageVisuals, XVisualInfo **pImageVisuals,
+                        /* list of regions to read from */
+                        list_ptr vis_regions,
+                        /* list of regions to read from */
+                        list_ptr vis_image_regions,
+                        int format, int allImage)
 {
     image_region_type   *reg;
     XRectangle          bbox;           /* bounding box of grabbed area */
-    int32_t             depth ;
-    XImage              *ximage, *ximage_ipm ;
+    int                 depth ;
+    XImage              *ximage, *ximage_ipm = NULL;
     Visual              fakeVis ;
-    int32_t     x1, y1;
+    int         x1, y1;
     XImage      *image;
+#if 0
     unsigned char       *pmData ,  *ipmData ;
-    int32_t                 transparentColor, transparentType;
-    int32_t                     srcRect_x,srcRect_y,srcRect_width,srcRect_height ;
-    int32_t                     diff ;
-    int32_t                     dst_x, dst_y;   /* where in pixmap to write (UL) */
-    int32_t                     pixel;
+#endif
+    int                 transparentColor, transparentType;
+    int                 srcRect_x,srcRect_y,srcRect_width,srcRect_height ;
+    int                 diff ;
+    int                 dst_x, dst_y;   /* where in pixmap to write (UL) */
+    int                 pixel;
 
-    bbox.x = (short) x;                 /* init X rect for bounding box */
-    bbox.y = (short) y;
-    bbox.width = (unsigned short) width;
-    bbox.height = (unsigned short) height;
-    ximage_ipm = NULL;
+    bbox.x = x;                 /* init X rect for bounding box */
+    bbox.y = y;
+    bbox.width = width;
+    bbox.height = height;
 
 
     initFakeVisual(&fakeVis) ;
 
     depth = 24 ;
-    ximage = ReadRegionsInList(disp,&fakeVis,depth,format,
-             (int32_t) width, (int32_t) height, bbox,vis_regions) ;
-
+    ximage = ReadRegionsInList(disp,&fakeVis,depth,format,width,height,
+             bbox,vis_regions) ;
+#if 0
     pmData = (unsigned char *)ximage -> data ;
+#endif
 
 /* if transparency possible do it again, but this time for image planes only */
     if (vis_image_regions && (vis_image_regions->next) && !allImage)
     {
-            ximage_ipm = ReadRegionsInList(disp,&fakeVis,depth,format,
-                         (int32_t) width, (int32_t) height,bbox,vis_image_regions) ;
+        ximage_ipm = ReadRegionsInList(disp,&fakeVis,depth,format,width,height,
+                     bbox,vis_image_regions) ;
+#if 0
         ipmData = (unsigned char *)ximage_ipm -> data ;
+#endif
     }
 /* Now tranverse the overlay visual windows and test for transparency index.  */
 /* If you find one, subsitute the value from the matching image plane pixmap. */
@@ -513,21 +551,20 @@
         if (src_in_overlay( reg, numOverlayVisuals, pOverlayVisuals,
                                  &transparentColor, &transparentType))
         {
-         int32_t test = 0 ;
+        int test = 0 ;
              srcRect_width  = MIN( reg->width + reg->x_vis, bbox.width + bbox.x)
                                  - MAX( reg->x_vis, bbox.x);
              srcRect_height = MIN( reg->height + reg->y_vis, bbox.height
                                  + bbox.y) - MAX( reg->y_vis, bbox.y);
-         diff = bbox.x - reg->x_vis;
-         srcRect_x = MAX( 0, diff) + (reg->x_vis - reg->x_rootrel - reg->border);
-         dst_x     = MAX( 0, -diff) ;
+             diff = bbox.x - reg->x_vis;
+             srcRect_x = MAX( 0, diff)  + (reg->x_vis - reg->x_rootrel - reg->border);
+             dst_x     = MAX( 0, -diff) ;
              diff = bbox.y - reg->y_vis;
              srcRect_y = MAX( 0, diff)  + (reg->y_vis - reg->y_rootrel - reg->border);
              dst_y     = MAX( 0, -diff) ;
         /* let's test some pixels for transparency */
-         image = XGetImage(disp, reg->win, srcRect_x, srcRect_y,
-                           (uint32_t) srcRect_width, (uint32_t) srcRect_height,
-                           0xffffffff, ZPixmap);
+             image = XGetImage(disp, reg->win, srcRect_x, srcRect_y,
+                 srcRect_width, srcRect_height, 0xffffffff, ZPixmap);
 
         /* let's assume byte per pixel for overlay image for now */
              if ((image->depth == 8) && (transparentType == TransparentPixel))
@@ -541,24 +578,24 @@
                     {
                         if (*pixel_ptr++ == transparentColor)
                         {
-                        /*
+#if 0
                             *pmData++ = *ipmData++;
                             *pmData++ = *ipmData++;
                             *pmData++ = *ipmData++;
-                        */
-                        pixel = (int32_t) XGetPixel(ximage_ipm,dst_x+x1,dst_y+y1) ;
-                    XPutPixel(ximage,dst_x+x1, dst_y+y1,(unsigned long)pixel);
+#endif
+                        pixel = XGetPixel(ximage_ipm,dst_x+x1,dst_y+y1) ;
+                        XPutPixel(ximage,dst_x+x1, dst_y+y1,pixel);
 
                         if(!test){
                            test = 1 ;
                         }
                         }
-                        /*
+#if 0
                         else {
                             pmData +=3;
                             ipmData +=3;
                         }
-                        */
+#endif
                     }
                     start_of_line += image->bytes_per_line;
                 }
@@ -567,53 +604,52 @@
                 for (y1 = 0; y1 < srcRect_height; y1++) {
                       for (x1 = 0; x1 < srcRect_width; x1++)
                       {
-                            int32_t pixel_value = (int32_t) XGetPixel(image, x1, y1);
+                            int pixel_value = XGetPixel(image, x1, y1);
                             if (pixel_value == transparentColor)
                             {
-                            /*
+#if 0
                                 *pmData++ = *ipmData++;
                                 *pmData++ = *ipmData++;
                                 *pmData++ = *ipmData++;
-                            */
-                        pixel = (int32_t) XGetPixel(ximage_ipm,dst_x+x1,dst_y+y1) ;
-                    XPutPixel(ximage,dst_x+x1, dst_y+y1,(unsigned long)pixel);
+#endif
+                        pixel = XGetPixel(ximage_ipm,dst_x+x1,dst_y+y1) ;
+                        XPutPixel(ximage,dst_x+x1, dst_y+y1,pixel);
                         if(!test){
                            test = 1 ;
                         }
                             }
-                            /*
+#if 0
                             else {
                                 pmData +=3;
                                 ipmData +=3;
                             }
-                            */
+#endif
                         }
                     }
                 } else {
                     for (y1 = 0; y1 < srcRect_height; y1++) {
                         for (x1 = 0; x1 < srcRect_width; x1++)
                         {
-                            int32_t pixel_value = (int32_t) XGetPixel(image, x1, y1);
+                            int pixel_value = XGetPixel(image, x1, y1);
                             if (pixel_value & transparentColor)
                             {
-                            /*
+#if 0
                                 *pmData++ = *ipmData++;
                                 *pmData++ = *ipmData++;
                                 *pmData++ = *ipmData++;
-                            */
-                     pixel = (int32_t) XGetPixel(ximage_ipm,dst_x+x1,
-                                    dst_y+y1) ;
-                     XPutPixel(ximage,dst_x+x1, dst_y+y1,(unsigned long)pixel);
+#endif
+                                pixel = XGetPixel(ximage_ipm,dst_x+x1,dst_y+y1) ;
+                                XPutPixel(ximage,dst_x+x1, dst_y+y1,pixel);
                         if(!test){
                            test = 1 ;
                         }
                             }
-                            /*
+#if 0
                             else {
                                 pmData +=3;
                                 ipmData +=3;
                             }
-                            */
+#endif
                         }
                     }
                 }
@@ -621,6 +657,7 @@
         XDestroyImage (image);
       } /* end of src_in_overlay */
     } /** end transparency **/
+    /* JDK modification - call XDestroyImage if non-null */
     if (ximage_ipm != NULL) {
         XDestroyImage(ximage_ipm);
     }
@@ -640,38 +677,36 @@
         image_wins must point to an existing list struct that's already
         been zeroed (zero_list()).
     ------------------------------------------------------------------------ **/
-static void make_src_list( disp, image_wins, bbox, curr, x_rootrel, y_rootrel,
-                    curr_attrs, pclip)
-    Display             *disp;
-    list_ptr            image_wins;
-    XRectangle          *bbox;                  /* bnding box of area we want */
-    Window              curr;
-    int32_t                     x_rootrel;              /* pos of curr WRT root */
-    int32_t                     y_rootrel;
-    XWindowAttributes   *curr_attrs;
-    XRectangle          *pclip;                 /* visible part of curr, not */
-                                                /* obscurred by ancestors */
+static void make_src_list(Display *disp, list_ptr image_wins,
+                          /* bnding box of area we want */
+                          XRectangle *bbox,
+                          Window curr,
+                          /* pos of curr WRT root */
+                          int x_rootrel, int y_rootrel,
+                          XWindowAttributes *curr_attrs,
+                          /* visible part of curr, not obscurred by ancestors */
+                          XRectangle *pclip)
 {
     XWindowAttributes child_attrs;
     Window root, parent, *child;        /* variables for XQueryTree() */
     Window *save_child_list;            /* variables for XQueryTree() */
-    uint32_t nchild;            /* variables for XQueryTree() */
+    unsigned int nchild;                /* variables for XQueryTree() */
     XRectangle child_clip;              /* vis part of child */
-    int32_t curr_clipX, curr_clipY, curr_clipRt, curr_clipBt;
+    int curr_clipX, curr_clipY, curr_clipRt, curr_clipBt;
 
     /* check that win is mapped & not outside bounding box */
     if (curr_attrs->map_state == IsViewable &&
         curr_attrs->class == InputOutput &&
-        !( pclip->x >= (bbox->x + bbox->width)  ||
-           pclip->y >= (bbox->y + bbox->height) ||
-           (pclip->x + pclip->width)  <= bbox->x        ||
-           (pclip->y + pclip->height) <= bbox->y)) {
+        !( pclip->x >= (int) (bbox->x + bbox->width)    ||
+           pclip->y >= (int) (bbox->y + bbox->height)   ||
+           (int) (pclip->x + pclip->width)  <= bbox->x  ||
+           (int) (pclip->y + pclip->height) <= bbox->y)) {
 
         XQueryTree( disp, curr, &root, &parent, &child, &nchild );
         save_child_list = child;      /* so we can free list when we're done */
         add_window_to_list( image_wins, curr, x_rootrel, y_rootrel,
-                            (int32_t) pclip->x, (int32_t) pclip->y,
-                            (int32_t) pclip->width, (int32_t) pclip->height,
+                            pclip->x, pclip->y,
+                            pclip->width, pclip->height,
                             curr_attrs->border_width,curr_attrs->visual,
                             curr_attrs->colormap, parent);
 
@@ -683,40 +718,39 @@
         child loop, we figure the clip rect for each child by adding in
         it's rectangle (not taking into account the child's borders).
     ------------------------------------------------------------------------ **/
-        curr_clipX = MAX( pclip->x, x_rootrel + curr_attrs->border_width);
-        curr_clipY = MAX( pclip->y, y_rootrel + curr_attrs->border_width);
-        curr_clipRt = MIN(pclip->x + pclip->width,
-                                  x_rootrel + curr_attrs->width + 2 * curr_attrs->border_width);
-
-        curr_clipBt = MIN(pclip->y + pclip->height,
-                                  y_rootrel + curr_attrs->height + 2 * curr_attrs->border_width);
-
+        curr_clipX = MAX( pclip->x, x_rootrel + (int) curr_attrs->border_width);
+        curr_clipY = MAX( pclip->y, y_rootrel + (int) curr_attrs->border_width);
+        curr_clipRt = MIN( pclip->x + (int) pclip->width,
+                           x_rootrel + (int) curr_attrs->width +
+                           2 * (int) curr_attrs->border_width);
+        curr_clipBt = MIN( pclip->y + (int) pclip->height,
+                           y_rootrel + (int) curr_attrs->height +
+                           2 * (int) curr_attrs->border_width);
 
         while (nchild--) {
-            int32_t new_width, new_height;
-            int32_t child_xrr, child_yrr;       /* root relative x & y of child */
+            int new_width, new_height;
+            int child_xrr, child_yrr;   /* root relative x & y of child */
 
             XGetWindowAttributes( disp, *child, &child_attrs);
 
             /* intersect parent & child clip rects */
             child_xrr = x_rootrel + child_attrs.x + curr_attrs->border_width;
-            child_clip.x = (short) MAX( curr_clipX, child_xrr);
-            new_width = MIN(curr_clipRt,
-                        child_xrr + child_attrs.width +
-                         2 * child_attrs.border_width) - child_clip.x;
-
+            child_clip.x = MAX( curr_clipX, child_xrr);
+            new_width = MIN( curr_clipRt, child_xrr + (int) child_attrs.width
+                             + 2 * child_attrs.border_width)
+                        - child_clip.x;
             if (new_width >= 0) {
-                child_clip.width = (unsigned short) new_width;
+                child_clip.width = new_width;
 
                 child_yrr = y_rootrel + child_attrs.y +
                             curr_attrs->border_width;
-                child_clip.y = (short) MAX( curr_clipY, child_yrr);
-                new_height = MIN(curr_clipBt,
-                                         child_yrr + (int32_t) child_attrs.height +
-                                         2 * child_attrs.border_width) - child_clip.y;
-
+                child_clip.y = MAX( curr_clipY, child_yrr);
+                new_height = MIN( curr_clipBt,
+                                  child_yrr + (int) child_attrs.height +
+                                      2 * child_attrs.border_width)
+                             - child_clip.y;
                 if (new_height >= 0) {
-                    child_clip.height = (unsigned short) new_height;
+                    child_clip.height = new_height;
                     make_src_list( disp, image_wins, bbox, *child,
                                    child_xrr, child_yrr,
                                    &child_attrs, &child_clip);
@@ -737,15 +771,9 @@
         there will be two regions in the list.
         Returns a pointer to the list.
     ------------------------------------------------------------------------ **/
-static list_ptr make_region_list( disp, win, bbox, hasNonDefault,
-                             numImageVisuals, pImageVisuals, allImage)
-    Display             *disp;
-    Window              win;
-    XRectangle          *bbox;
-    int32_t             *hasNonDefault;
-    int32_t                     numImageVisuals;
-    XVisualInfo         **pImageVisuals;
-    int32_t                     *allImage;
+static list_ptr make_region_list(Display *disp, Window win, XRectangle *bbox,
+                                 int *hasNonDefault, int numImageVisuals,
+                                 XVisualInfo **pImageVisuals, int *allImage)
 {
     XWindowAttributes   win_attrs;
     list                image_wins;
@@ -755,9 +783,9 @@
     image_win_type      *base_src, *src;
     Region              bbox_region = XCreateRegion();
     XRectangle          clip;
-    int32_t                     image_only;
+    int                 image_only;
 
-    int32_t                 count=0 ;
+    int                 count=0 ;
 
     *hasNonDefault = False;
     XUnionRectWithRegion( bbox, bbox_region, bbox_region);
@@ -766,8 +794,8 @@
     zero_list( &image_wins);
     clip.x = 0;
     clip.y = 0;
-    clip.width  = (unsigned short) win_attrs.width;
-    clip.height = (unsigned short) win_attrs.height;
+    clip.width  = win_attrs.width;
+    clip.height = win_attrs.height;
     make_src_list( disp, &image_wins, bbox, win,
                    0 /* x_rootrel */, 0 /* y_rootrel */, &win_attrs, &clip);
 
@@ -840,8 +868,7 @@
 /** ------------------------------------------------------------------------
         Destructor called from destroy_region_list().
     ------------------------------------------------------------------------ **/
-void destroy_image_region( image_region)
-    image_region_type *image_region;
+static void destroy_image_region(image_region_type *image_region)
 {
     XDestroyRegion( image_region->visible_region);
     free( (void *) image_region);
@@ -850,8 +877,7 @@
 /** ------------------------------------------------------------------------
         Destroys the region list, destroying all the regions contained in it.
     ------------------------------------------------------------------------ **/
-static void destroy_region_list( rlist)
-    list_ptr rlist;
+static void destroy_region_list(list_ptr rlist)
 {
     delete_list_destroying( rlist, (DESTRUCT_FUNC_PTR)destroy_image_region);
 }
@@ -863,21 +889,17 @@
         only provides a way to subtract one region from another, not a
         rectangle from a region.
     ------------------------------------------------------------------------ **/
-static void subtr_rect_from_image_region( image_region, x, y, width, height)
-    image_region_type *image_region;
-    int32_t x;
-    int32_t y;
-    int32_t width;
-    int32_t height;
+static void subtr_rect_from_image_region(image_region_type *image_region,
+                                         int x, int y, int width, int height)
 {
     XRectangle rect;
     Region rect_region;
 
     rect_region = XCreateRegion();
-    rect.x = (short)x;
-    rect.y = (short)y;
-    rect.width = (unsigned short)width;
-    rect.height = (unsigned short)height;
+    rect.x = x;
+    rect.y = y;
+    rect.width = width;
+    rect.height = height;
     XUnionRectWithRegion( &rect, rect_region, rect_region);
     XSubtractRegion( image_region->visible_region, rect_region,
                      image_region->visible_region);
@@ -888,19 +910,15 @@
 /** ------------------------------------------------------------------------
         Adds the specified rectangle to the region in image_region.
     ------------------------------------------------------------------------ **/
-static void add_rect_to_image_region( image_region, x, y, width, height)
-    image_region_type *image_region;
-    int32_t x;
-    int32_t y;
-    int32_t width;
-    int32_t height;
+static void add_rect_to_image_region(image_region_type *image_region,
+                                     int x, int y, int width, int height)
 {
     XRectangle rect;
 
-    rect.x = (short) x;
-    rect.y = (short) y;
-    rect.width = (unsigned short) width;
-    rect.height = (unsigned short) height;
+    rect.x = x;
+    rect.y = y;
+    rect.width = width;
+    rect.height = height;
     XUnionRectWithRegion( &rect, image_region->visible_region,
                           image_region->visible_region);
 }
@@ -910,9 +928,7 @@
         Returns TRUE if the given src's visual is already represented in
         the image_regions list, FALSE otherwise.
     ------------------------------------------------------------------------ **/
-static int32_t src_in_region_list( src, image_regions)
-    image_win_type *src;
-    list_ptr image_regions;
+static int src_in_region_list(image_win_type *src, list_ptr image_regions)
 {
     image_region_type   *ir;
 
@@ -931,20 +947,10 @@
 /** ------------------------------------------------------------------------
         Makes a new entry in image_wins with the given fields filled in.
     ------------------------------------------------------------------------ **/
-static void add_window_to_list( image_wins, w, xrr, yrr, x_vis, y_vis,
-                                width, height, border_width,vis, cmap, parent)
-    list_ptr    image_wins;
-    Window      w;
-    int32_t             xrr;
-    int32_t     yrr;
-    int32_t             x_vis;
-    int32_t     y_vis;
-    int32_t     width;
-    int32_t     height;
-    int32_t     border_width;
-    Visual      *vis;
-    Colormap    cmap;
-    Window      parent;
+static void add_window_to_list(list_ptr image_wins, Window w,
+                               int xrr, int yrr, int x_vis, int y_vis,
+                               int width, int height, int border_width,
+                               Visual *vis, Colormap cmap, Window parent)
 {
     image_win_type      *new_src;
 
@@ -970,12 +976,10 @@
         Returns TRUE if the given src's visual is in the image planes,
         FALSE otherwise.
     ------------------------------------------------------------------------ **/
-static int32_t src_in_image( src, numImageVisuals, pImageVisuals)
-    image_win_type      *src;
-    int32_t                     numImageVisuals;
-    XVisualInfo         **pImageVisuals;
+static int src_in_image(image_win_type *src, int numImageVisuals,
+                        XVisualInfo **pImageVisuals)
 {
-    int32_t             i;
+    int                 i;
 
     for (i = 0 ; i < numImageVisuals ; i++)
     {
@@ -990,15 +994,11 @@
         Returns TRUE if the given src's visual is in the overlay planes
         and transparency is possible, FALSE otherwise.
     ------------------------------------------------------------------------ **/
-static int32_t src_in_overlay( src, numOverlayVisuals, pOverlayVisuals,
-                        transparentColor, transparentType)
-    image_region_type   *src;
-    int32_t                     numOverlayVisuals;
-    OverlayInfo         *pOverlayVisuals;
-    int32_t                     *transparentColor;
-    int32_t                     *transparentType;
+static int src_in_overlay(image_region_type *src, int numOverlayVisuals,
+                          OverlayInfo *pOverlayVisuals,
+                          int *transparentColor, int *transparentType)
 {
-    int32_t             i;
+    int                 i;
 
     for (i = 0 ; i < numOverlayVisuals ; i++)
     {
@@ -1039,7 +1039,7 @@
 #define DIRECT_COLOR    0x11
 
 
-static int32_t  weCreateServerOverlayVisualsProperty = False;
+static int      weCreateServerOverlayVisualsProperty = False;
 
 
 /******************************************************************************
@@ -1064,42 +1064,40 @@
  *
  ******************************************************************************/
 
-int32_t GetXVisualInfo(display, screen, transparentOverlays,
-                   numVisuals, pVisuals,
-                   numOverlayVisuals, pOverlayVisuals,
-                   numImageVisuals, pImageVisuals)
-
-    Display     *display;                   /* Which X server (aka "display"). */
-    int32_t             screen;                 /* Which screen of the "display". */
-    int32_t             *transparentOverlays;   /* Non-zero if there's at least one
-                                         * overlay visual and if at least one
-                                         * of those supports a transparent
-                                         * pixel. */
-    int32_t             *numVisuals;            /* Number of XVisualInfo struct's
-                                         * pointed to by pVisuals. */
-    XVisualInfo **pVisuals;             /* All of the device's visuals. */
-    int32_t             *numOverlayVisuals;     /* Number of OverlayInfo's pointed
-                                         * to by pOverlayVisuals.  If this
-                                         * number is zero, the device does
-                                         * not have overlay planes. */
-    OverlayInfo **pOverlayVisuals;      /* The device's overlay plane visual
-                                         * information. */
-    int32_t             *numImageVisuals;       /* Number of XVisualInfo's pointed
-                                         * to by pImageVisuals. */
-    XVisualInfo ***pImageVisuals;       /* The device's image visuals. */
+int GetXVisualInfo(/* Which X server (aka "display"). */
+                   Display *display,
+                   /* Which screen of the "display". */
+                   int screen,
+                   /* Non-zero if there's at least one overlay visual and
+                    * if at least one of those supports a transparent pixel. */
+                   int *transparentOverlays,
+                   /* Number of XVisualInfo struct's pointed to by pVisuals. */
+                   int *numVisuals,
+                   /* All of the device's visuals. */
+                   XVisualInfo **pVisuals,
+                   /* Number of OverlayInfo's pointed to by pOverlayVisuals.
+                    * If this number is zero, the device does not have
+                    * overlay planes. */
+                   int *numOverlayVisuals,
+                   /* The device's overlay plane visual information. */
+                   OverlayInfo  **pOverlayVisuals,
+                   /* Number of XVisualInfo's pointed to by pImageVisuals. */
+                   int *numImageVisuals,
+                   /* The device's image visuals. */
+                   XVisualInfo ***pImageVisuals)
 {
-    XVisualInfo getVisInfo;             /* Parameters of XGetVisualInfo */
-    int32_t             mask;
+    XVisualInfo getVisInfo;             /* Paramters of XGetVisualInfo */
+    int         mask;
     XVisualInfo *pVis, **pIVis;         /* Faster, local copies */
     OverlayInfo *pOVis;
     OverlayVisualPropertyRec    *pOOldVis;
-    int32_t             nVisuals, nOVisuals;
+    int         nVisuals, nOVisuals;
     Atom        overlayVisualsAtom;     /* Parameters for XGetWindowProperty */
     Atom        actualType;
     unsigned long numLongs, bytesAfter;
-    int32_t             actualFormat;
-    int32_t             nImageVisualsAlloced;   /* Values to process the XVisualInfo */
-    int32_t             imageVisual;            /* array */
+    int         actualFormat;
+    int         nImageVisualsAlloced;   /* Values to process the XVisualInfo */
+    int         imageVisual;            /* array */
 
 
     /* First, get the list of visuals for this screen. */
@@ -1125,10 +1123,10 @@
          * do-while loop makes sure we get the entire list from the X server.
          */
         bytesAfter = 0;
-        numLongs = sizeof(OverlayVisualPropertyRec) / 4;
+        numLongs = sizeof(OverlayVisualPropertyRec) / sizeof(long);
         do
         {
-            numLongs += bytesAfter * 4;
+            numLongs += bytesAfter * sizeof(long);
             XGetWindowProperty(display, RootWindow(display, screen),
                                overlayVisualsAtom, 0, numLongs, False,
                                overlayVisualsAtom, &actualType, &actualFormat,
@@ -1137,7 +1135,6 @@
 
 
         /* Calculate the number of overlay visuals in the list. */
-        /* *numOverlayVisuals = numLongs / (sizeof(OverlayVisualPropertyRec) / 4); */
         *numOverlayVisuals = numLongs / (sizeof(OverlayVisualPropertyRec) / sizeof(long));
     }
     else
@@ -1199,11 +1196,8 @@
  *
  ******************************************************************************/
 
-void FreeXVisualInfo(pVisuals, pOverlayVisuals, pImageVisuals)
-
-    XVisualInfo *pVisuals;
-    OverlayInfo *pOverlayVisuals;
-    XVisualInfo **pImageVisuals;
+void FreeXVisualInfo(XVisualInfo *pVisuals, OverlayInfo *pOverlayVisuals,
+                     XVisualInfo **pImageVisuals)
 {
     XFree(pVisuals);
     if (weCreateServerOverlayVisualsProperty)
--- a/src/java.desktop/unix/native/libawt_xawt/awt/multiVis.h	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/multiVis.h	Mon Nov 12 11:10:16 2018 +0530
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,7 +22,6 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* $XConsortium: multiVis.h /main/4 1996/10/14 15:04:12 swick $ */
 /** ------------------------------------------------------------------------
         This file contains routines for manipulating generic lists.
         Lists are implemented with a "harness".  In other words, each
@@ -36,16 +36,14 @@
  However, the following notice accompanied the original version of this
  file:
 
-Copyright (c) 1994 Hewlett-Packard Co.
-Copyright (c) 1996  X Consortium
+Copyright 1994 Hewlett-Packard Co.
+Copyright 1996, 1998  The Open Group
 
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
 
 The above copyright notice and this permission notice shall be included
 in all copies or substantial portions of the Software.
@@ -53,38 +51,32 @@
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
-Except as contained in this notice, the name of the X Consortium shall
+Except as contained in this notice, the name of The Open Group shall
 not be used in advertising or otherwise to promote the sale, use or
 other dealings in this Software without prior written authorization
-from the X Consortium.
+from The Open Group.
 
  ------------------------------------------------------------------------ **/
 
-extern int32_t GetMultiVisualRegions(
-#if NeedFunctionPrototypes
-    Display *, Window, int32_t, int32_t, uint32_t,
-    uint32_t, int32_t *, int32_t *, XVisualInfo **, int32_t *,
-    OverlayInfo  **, int32_t *, XVisualInfo ***, list_ptr *,
-    list_ptr *, int32_t *
-#endif
+extern int GetMultiVisualRegions(
+    Display *, Window, int, int, unsigned int,
+    unsigned int, int *, int *, XVisualInfo **, int *,
+    OverlayInfo  **, int *, XVisualInfo ***, list_ptr *,
+    list_ptr *, int *
 );
 
 extern XImage *ReadAreaToImage(
-#if NeedFunctionPrototypes
-    Display *, Window, int32_t, int32_t, uint32_t,
-    uint32_t, int32_t, XVisualInfo *, int32_t,
-    OverlayInfo *, int32_t, XVisualInfo **, list_ptr,
-    list_ptr, int32_t, int32_t
-#endif
+    Display *, Window, int, int, unsigned int,
+    unsigned int, int, XVisualInfo *, int,
+    OverlayInfo *, int, XVisualInfo **, list_ptr,
+    list_ptr, int, int
 );
 
 extern void initFakeVisual(
-#if NeedFunctionPrototypes
     Visual *
-#endif
 );
--- a/src/java.desktop/unix/native/libawt_xawt/awt/randr.h	Sun Nov 11 21:24:46 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * $XFree86: xc/include/extensions/randr.h,v 1.4 2001/11/24 07:24:58 keithp Exp $
- *
- * Copyright © 2000, Compaq Computer Corporation,
- * Copyright © 2002, Hewlett Packard, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Compaq or HP not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.  HP makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author:  Jim Gettys, HP Labs, Hewlett-Packard, Inc.
- */
-
-#ifndef _RANDR_H_
-#define _RANDR_H_
-
-typedef unsigned short  Connection;
-typedef unsigned short  Rotation;
-typedef unsigned short  SizeID;
-typedef unsigned short  SubpixelOrder;
-
-#define RANDR_NAME              "RANDR"
-#define RANDR_MAJOR             1
-#define RANDR_MINOR             1
-
-#define RRNumberErrors          0
-#define RRNumberEvents          1
-
-#define X_RRQueryVersion        0
-/* we skip 1 to make old clients fail pretty immediately */
-#define X_RROldGetScreenInfo    1
-#define X_RR1_0SetScreenConfig  2
-/* V1.0 apps share the same set screen config request id */
-#define X_RRSetScreenConfig     2
-#define X_RROldScreenChangeSelectInput  3
-/* 3 used to be ScreenChangeSelectInput; deprecated */
-#define X_RRSelectInput         4
-#define X_RRGetScreenInfo       5
-
-/* used in XRRSelectInput */
-
-#define RRScreenChangeNotifyMask  (1L << 0)
-
-#define RRScreenChangeNotify    0
-
-/* used in the rotation field; rotation and reflection in 0.1 proto. */
-#define RR_Rotate_0             1
-#define RR_Rotate_90            2
-#define RR_Rotate_180           4
-#define RR_Rotate_270           8
-
-/* new in 1.0 protocol, to allow reflection of screen */
-
-#define RR_Reflect_X            16
-#define RR_Reflect_Y            32
-
-#define RRSetConfigSuccess              0
-#define RRSetConfigInvalidConfigTime    1
-#define RRSetConfigInvalidTime          2
-#define RRSetConfigFailed               3
-
-#endif  /* _RANDR_H_ */
--- a/src/java.desktop/unix/native/libawt_xawt/awt/robot_common.c	Sun Nov 11 21:24:46 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#ifdef HEADLESS
-    #error This file should not be included in headless library
-#endif
-
-#ifdef MACOSX
-#include <stdlib.h>
-#endif
-
-#include "robot_common.h"
-
-/*
- * QueryColorMap is taken from multiVis.c, part of the xwd distribution from
- * X.org. It was moved here so it can be shared with awt_DataTransferer.c
- */
-int32_t
-QueryColorMap(Display *disp,
-              Colormap src_cmap,
-              Visual *src_vis,
-              XColor **src_colors,
-              int32_t *rShift, int32_t *gShift, int32_t *bShift)
-
-{
-     int32_t ncolors, i;
-     unsigned long redMask, greenMask, blueMask;
-     int32_t                 redShift, greenShift, blueShift;
-     XColor *colors ;
-
-     ncolors = src_vis->map_entries ;
-     *src_colors = colors = (XColor *)calloc(ncolors,sizeof(XColor) ) ;
-
-     if(src_vis->class != TrueColor && src_vis->class != DirectColor)
-     {
-         for(i=0 ; i < ncolors ; i++)
-         {
-                colors[i].pixel = i ;
-                colors[i].pad = 0;
-                colors[i].flags = DoRed|DoGreen|DoBlue;
-         }
-     }
-     else /** src is decomposed rgb ***/
-     {
-        /* Get the X colormap */
-        redMask = src_vis->red_mask;
-        greenMask = src_vis->green_mask;
-        blueMask = src_vis->blue_mask;
-        redShift = 0; while (!(redMask&0x1)) {
-                redShift++;
-                redMask = redMask>>1;
-        }
-        greenShift = 0; while (!(greenMask&0x1)) {
-                greenShift++;
-                greenMask = greenMask>>1;
-        }
-        blueShift = 0; while (!(blueMask&0x1)) {
-                blueShift++;
-                blueMask = blueMask>>1;
-        }
-        *rShift = redShift ;
-        *gShift = greenShift ;
-        *bShift = blueShift ;
-        for (i=0; i<ncolors; i++) {
-                if( (uint32_t)i <= redMask) colors[i].pixel = (i<<redShift) ;
-                if( (uint32_t)i <= greenMask) colors[i].pixel |= (i<<greenShift) ;
-                if( (uint32_t)i <= blueMask) colors[i].pixel |= (i<<blueShift) ;
-                /***** example :for gecko's 3-3-2 map, blue index should be <= 3
-.
-                colors[i].pixel = (i<<redShift)|(i<<greenShift)|(i<<blueShift);
-                *****/
-                colors[i].pad = 0;
-                colors[i].flags = DoRed|DoGreen|DoBlue;
-        }
-      }
-
-      XQueryColors(disp, src_cmap, colors, ncolors);
-      return ncolors ;
-}
--- a/src/java.desktop/unix/native/libawt_xawt/awt/robot_common.h	Sun Nov 11 21:24:46 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-#ifndef _ROBOT_COMMON_H
-#define _ROBOT_COMMON_H
-
-#include "java_awt_event_InputEvent.h"
-
-#include <X11/Xlib.h>
-#include "gdefs.h"
-
-int QueryColorMap(Display *disp,
-                  Colormap src_cmap,
-                  Visual *src_vis,
-                  XColor **src_colors,
-                  int *rShift, int *gShift, int *bShift);
-
-#endif /* _ROBOT_COMMON_H */
--- a/src/java.desktop/unix/native/libawt_xawt/awt/wsutils.h	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/wsutils.h	Mon Nov 12 11:10:16 2018 +0530
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,7 +22,6 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-/* $XConsortium: wsutils.h /main/3 1996/10/14 15:04:17 swick $ */
 /** ------------------------------------------------------------------------
         This file contains routines for manipulating generic lists.
         Lists are implemented with a "harness".  In other words, each
@@ -36,16 +36,14 @@
  However, the following notice accompanied the original version of this
  file:
 
-Copyright (c) 1994 Hewlett-Packard Co.
-Copyright (c) 1996  X Consortium
+Copyright 1994 Hewlett-Packard Co.
+Copyright 1996, 1998  The Open Group
 
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
 
 The above copyright notice and this permission notice shall be included
 in all copies or substantial portions of the Software.
@@ -53,17 +51,18 @@
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 OTHER DEALINGS IN THE SOFTWARE.
 
-Except as contained in this notice, the name of the X Consortium shall
+Except as contained in this notice, the name of The Open Group shall
 not be used in advertising or otherwise to promote the sale, use or
 other dealings in this Software without prior written authorization
-from the X Consortium.
+from The Open Group.
 
     ------------------------------------------------------------------------ **/
+
 /******************************************************************************
  *
  * This file contains various typedef's, macros and procedure declarations for
@@ -71,16 +70,18 @@
  *
  ******************************************************************************/
 
+typedef unsigned long Pixel;
+
 /* This is the actual structure returned by the X server describing the
  * SERVER_OVERLAY_VISUAL property.
  */
 typedef struct
 {
   VisualID      visualID;               /* The VisualID of the overlay visual */
-  long  transparentType;        /* Can be None, TransparentPixel or
+  int           transparentType;        /* Can be None, TransparentPixel or
                                          * TransparentMask */
-  long  value;                  /* Pixel value */
-  long layer;                   /* Overlay planes will always be in
+  Pixel         value;                  /* Pixel value */
+  int           layer;                  /* Overlay planes will always be in
                                          * layer 1 */
 } OverlayVisualPropertyRec;
 
@@ -93,10 +94,10 @@
 typedef struct
 {
   XVisualInfo   *pOverlayVisualInfo;    /* Pointer to the XVisualInfo struct */
-  long transparentType; /* Can be None, TransparentPixel or
+  int           transparentType;        /* Can be None, TransparentPixel or
                                          * TransparentMask */
-  long value;                   /* Pixel value */
-  long layer;                   /* Overlay planes will always be in
+  Pixel         value;                  /* Pixel value */
+  int           layer;                  /* Overlay planes will always be in
                                          * layer 1 */
 } OverlayInfo;
 
@@ -158,27 +159,25 @@
  *
  ******************************************************************************/
 
-extern int32_t GetXVisualInfo(
-#if NeedFunctionPrototypes
+extern int GetXVisualInfo(
     Display     *display,               /* Which X server (aka "display"). */
-    int32_t             screen,                 /* Which screen of the "display". */
-    int32_t             *transparentOverlays,   /* Non-zero if there's at least one
+    int         screen,                 /* Which screen of the "display". */
+    int         *transparentOverlays,   /* Non-zero if there's at least one
                                          * overlay visual and if at least one
                                          * of those supports a transparent
                                          * pixel. */
-    int32_t             *numVisuals,            /* Number of XVisualInfo struct's
-                                         * pointed to by pVisuals. */
+    int         *numVisuals,            /* Number of XVisualInfo struct's
+                                         * pointed to to by pVisuals. */
     XVisualInfo **pVisuals,             /* All of the device's visuals. */
-    int32_t             *numOverlayVisuals,     /* Number of OverlayInfo's pointed
+    int         *numOverlayVisuals,     /* Number of OverlayInfo's pointed
                                          * to by pOverlayVisuals.  If this
                                          * number is zero, the device does
                                          * not have overlay planes. */
     OverlayInfo **pOverlayVisuals,      /* The device's overlay plane visual
                                          * information. */
-    int32_t             *numImageVisuals,       /* Number of XVisualInfo's pointed
+    int         *numImageVisuals,       /* Number of XVisualInfo's pointed
                                          * to by pImageVisuals. */
     XVisualInfo ***pImageVisuals        /* The device's image visuals. */
-#endif
                     );
 
 
@@ -191,11 +190,9 @@
  ******************************************************************************/
 
 extern void FreeXVisualInfo(
-#if NeedFunctionPrototypes
     XVisualInfo *pVisuals,
     OverlayInfo *pOverlayVisuals,
     XVisualInfo **pImageVisuals
-#endif
                      );
 
 
@@ -219,22 +216,20 @@
  *
  ******************************************************************************/
 
-extern int32_t FindImagePlanesVisual(
-#if NeedFunctionPrototypes
+extern int FindImagePlanesVisual(
     Display     *display,               /* Which X server (aka "display"). */
-    int32_t             screen,                 /* Which screen of the "display". */
-    int32_t             numImageVisuals,        /* Number of XVisualInfo's pointed
+    int         screen,                 /* Which screen of the "display". */
+    int         numImageVisuals,        /* Number of XVisualInfo's pointed
                                          * to by pImageVisuals. */
     XVisualInfo **pImageVisuals,        /* The device's image visuals. */
-    int32_t             sbCmapHint,             /* What Starbase cmap modes will be
+    int         sbCmapHint,             /* What Starbase cmap modes will be
                                          * used with the visual.  NOTE: This
                                          * is a mask of the possible values. */
-    int32_t             depthHint,              /* Desired depth. */
-    int32_t             depthFlexibility,       /* How much the actual value in
+    int         depthHint,              /* Desired depth. */
+    int         depthFlexibility,       /* How much the actual value in
                                          * "depthHint" is desired. */
     Visual      **pImageVisualToUse,    /* The screen's image visual to use. */
-    int32_t             *depthObtained          /* Actual depth of the visual. */
-#endif
+    int         *depthObtained          /* Actual depth of the visual. */
                                      );
 
 
@@ -267,25 +262,23 @@
  *
  ******************************************************************************/
 
-extern int32_t FindOverlayPlanesVisual(
-#if NeedFunctionPrototypes
+extern int FindOverlayPlanesVisual(
     Display     *display,               /* Which X server (aka "display"). */
-    int32_t             screen,                 /* Which screen of the "display". */
-    int32_t             numOverlayVisuals,      /* Number of OverlayInfo's pointed
+    int         screen,                 /* Which screen of the "display". */
+    int         numOverlayVisuals,      /* Number of OverlayInfo's pointed
                                          * to by pOverlayVisuals. */
     OverlayInfo *pOverlayVisuals,       /* The device's overlay plane visual
                                          * information. */
-    int32_t             depthHint,              /* Desired depth. */
-    int32_t             depthFlexibility,       /* How much the actual value in
+    int         depthHint,              /* Desired depth. */
+    int         depthFlexibility,       /* How much the actual value in
                                          * "depthHint" is desired. */
-    int32_t             transparentBackground,  /* Non-zero if the visual must have
+    int         transparentBackground,  /* Non-zero if the visual must have
                                          * a transparent color. */
     Visual      **pOverlayVisualToUse,  /* The screen's overlay visual to
                                          * use. */
-    int32_t             *depthObtained,         /* Actual depth of the visual. */
-    int32_t             *transparentColor       /* The transparent color the program
+    int         *depthObtained,         /* Actual depth of the visual. */
+    int         *transparentColor       /* The transparent color the program
                                          * can use with the visual. */
-#endif
                                 );
 
 
@@ -308,27 +301,25 @@
  *
  ******************************************************************************/
 
-extern int32_t CreateImagePlanesWindow(
-#if NeedFunctionPrototypes
+extern int CreateImagePlanesWindow(
     Display     *display,               /* Which X server (aka "display"). */
-    int32_t             screen,                 /* Which screen of the "display". */
+    int         screen,                 /* Which screen of the "display". */
     Window      parentWindow,           /* Window ID of the parent window for
                                          * the created window. */
-    int32_t             windowX,                /* Desired X coord. of the window. */
-    int32_t             windowY,                /* Desired Y coord of the window. */
-    int32_t             windowWidth,            /* Desired width of the window. */
-    int32_t             windowHeight,           /* Desired height of the window. */
-    int32_t             windowDepth,            /* Desired depth of the window. */
+    int         windowX,                /* Desired X coord. of the window. */
+    int         windowY,                /* Desired Y coord of the window. */
+    int         windowWidth,            /* Desired width of the window. */
+    int         windowHeight,           /* Desired height of the window. */
+    int         windowDepth,            /* Desired depth of the window. */
     Visual      *pImageVisualToUse,     /* The window's image planes visual. */
-    int32_t             argc,                   /* Program's argc parameter. */
+    int         argc,                   /* Program's argc parameter. */
     char        *argv[],                /* Program's argv parameter. */
     char        *windowName,            /* Name to put on window's border. */
     char        *iconName,              /* Name to put on window's icon. */
     Window      *imageWindow,           /* Window ID of the created window. */
     Colormap    *imageColormap,         /* The window's colormap. */
-    int32_t             *mustFreeImageColormap  /* Non-zero if the program must call
+    int         *mustFreeImageColormap  /* Non-zero if the program must call
                                          * XFreeColormap() for imageColormap. */
-#endif
                                 );
 
 
@@ -351,30 +342,28 @@
  *
  ******************************************************************************/
 
-int32_t CreateOverlayPlanesWindow(
-#if NeedFunctionPrototypes
+int CreateOverlayPlanesWindow(
     Display     *display,               /* Which X server (aka "display"). */
-    int32_t             screen,                 /* Which screen of the "display". */
+    int         screen,                 /* Which screen of the "display". */
     Window      parentWindow,           /* Window ID of the parent window for
                                          * the created window. */
-    int32_t             windowX,                /* Desired X coord. of the window. */
-    int32_t             windowY,                /* Desired Y coord of the window. */
-    int32_t             windowWidth,            /* Desired width of the window. */
-    int32_t             windowHeight,           /* Desired height of the window. */
-    int32_t             windowDepth,            /* Desired depth of the window. */
+    int         windowX,                /* Desired X coord. of the window. */
+    int         windowY,                /* Desired Y coord of the window. */
+    int         windowWidth,            /* Desired width of the window. */
+    int         windowHeight,           /* Desired height of the window. */
+    int         windowDepth,            /* Desired depth of the window. */
     Visual      *pOverlayVisualToUse,   /* The window's overlay planes visual.*/
-    int32_t             argc,                   /* Program's argc parameter. */
+    int         argc,                   /* Program's argc parameter. */
     char        *argv[],                /* Program's argv parameter. */
     char        *windowName,            /* Name to put on window's border. */
     char        *iconName,              /* Name to put on window's icon. */
-    int32_t             transparentBackground,  /* Non-zero if the window's background
+    int         transparentBackground,  /* Non-zero if the window's background
                                          * should be a transparent color. */
-    int32_t             *transparentColor,      /* The transparent color to use as the
+    int         *transparentColor,      /* The transparent color to use as the
                                          * window's background. */
     Window      *overlayWindow,         /* Window ID of the created window. */
     Colormap    *overlayColormap,       /* The window's colormap. */
-    int32_t             *mustFreeOverlayColormap/* Non-zero if the program must call
+    int         *mustFreeOverlayColormap/* Non-zero if the program must call
                                           * XFreeColormap() for
                                           * overlayColormap. */
-#endif
                                 );
--- a/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Mon Nov 12 11:10:16 2018 +0530
@@ -344,7 +344,11 @@
             if (c instanceof JComboBox) {
                 isEditable = ((JComboBox) c).isEditable();
             }
-            d.height += isEditable ? 4 : 6;
+            if (((JComboBox)c).getBorder() instanceof EmptyBorder) {
+                d.height += isEditable ? 2 : 4;
+            } else {
+                d.height += isEditable ? 4 : 6;
+            }
         } else {
             d.width += 4;
             d.height += 2;
--- a/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java	Mon Nov 12 11:10:16 2018 +0530
@@ -72,6 +72,8 @@
 import java.util.Locale;
 import java.util.Map;
 import java.util.Properties;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 import sun.awt.util.PerformanceLogger;
 import sun.font.FontManager;
@@ -810,21 +812,34 @@
         }
     }
 
+    private static ExecutorService displayChangeExecutor;
+
     /*
      * Called from Toolkit native code when a WM_DISPLAYCHANGE occurs.
      * Have Win32GraphicsEnvironment execute the display change code on the
      * Event thread.
      */
     public static void displayChanged() {
-        EventQueue.invokeLater(new Runnable() {
-            @Override
-            public void run() {
-                Object lge = GraphicsEnvironment.getLocalGraphicsEnvironment();
-                if (lge instanceof DisplayChangedListener) {
-                    ((DisplayChangedListener) lge).displayChanged();
-                }
+        final Runnable runnable = () -> {
+            Object lge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+            if (lge instanceof DisplayChangedListener) {
+                ((DisplayChangedListener) lge).displayChanged();
             }
-        });
+        };
+        if (AppContext.getAppContext() != null) {
+            // Common case, standalone application
+            EventQueue.invokeLater(runnable);
+        } else {
+            if (displayChangeExecutor == null) {
+                // No synchronization, called on the Toolkit thread only
+                displayChangeExecutor = Executors.newFixedThreadPool(1, r -> {
+                    Thread t = Executors.defaultThreadFactory().newThread(r);
+                    t.setDaemon(true);
+                    return t;
+                });
+            }
+            displayChangeExecutor.submit(runnable);
+        }
     }
 
     /**
--- a/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java	Mon Nov 12 11:10:16 2018 +0530
@@ -521,13 +521,7 @@
      * Called from native code when we have been dragged onto another screen.
      */
     void draggedToNewScreen() {
-        SunToolkit.executeOnEventHandlerThread((Component)target,new Runnable()
-        {
-            @Override
-            public void run() {
-                displayChanged();
-            }
-        });
+        displayChanged();
     }
 
     public void updateGC() {
@@ -600,7 +594,7 @@
      */
     @Override
     public void displayChanged() {
-        updateGC();
+        SunToolkit.executeOnEventHandlerThread(target, this::updateGC);
     }
 
     /**
--- a/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -699,10 +699,13 @@
     // maximized state bit (matches Motif behaviour)
     // (calling ShowWindow(SW_RESTORE) would fire an
     //  activation event which we don't want)
-        LONG    style = GetStyle();
-        DASSERT(style & WS_MAXIMIZE);
-        style ^= WS_MAXIMIZE;
-        SetStyle(style);
+        HWND hWnd = GetHWnd();
+        if (hWnd != NULL && ::IsWindowVisible(hWnd)) {
+            LONG style = GetStyle();
+            DASSERT(style & WS_MAXIMIZE);
+            style ^= WS_MAXIMIZE;
+            SetStyle(style);
+        }
     }
 
     AwtWindow::Reshape(x, y, width, height);
--- a/src/java.desktop/windows/native/libawt/windows/awt_List.cpp	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/windows/native/libawt/windows/awt_List.cpp	Mon Nov 12 11:10:16 2018 +0530
@@ -478,16 +478,22 @@
 MsgRouting AwtList::HandleEvent(MSG *msg, BOOL synthetic)
 {
     if (IsFocusingMouseMessage(msg)) {
-        LONG item = static_cast<LONG>(SendListMessage(LB_ITEMFROMPOINT, 0, msg->lParam));
-        if (item != LB_ERR) {
-            if (isMultiSelect) {
-                if (IsItemSelected(item)) {
-                    Deselect(item);
-                } else {
-                    Select(item);
+        LONG count = GetCount();
+        if (count > 0) {
+            LONG item = static_cast<LONG>(SendListMessage(LB_ITEMFROMPOINT, 0, msg->lParam));
+            if (HIWORD(item) == 0) {
+                item = LOWORD(item);
+                if (item >= 0 && item < count) {
+                    if (isMultiSelect) {
+                        if (IsItemSelected(item)) {
+                            Deselect(item);
+                        } else {
+                            Select(item);
+                        }
+                    } else {
+                        Select(item);
+                    }
                 }
-            } else {
-                Select(item);
             }
         }
         delete msg;
--- a/src/java.desktop/windows/native/libawt/windows/awt_MenuBar.cpp	Sun Nov 11 21:24:46 2018 +0100
+++ b/src/java.desktop/windows/native/libawt/windows/awt_MenuBar.cpp	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -206,7 +206,10 @@
  * this function must be called to draw the changed menu bar.
  */
 void AwtMenuBar::RedrawMenuBar() {
-    VERIFY(::DrawMenuBar(GetOwnerHWnd()));
+    HWND hOwnerWnd = GetOwnerHWnd();
+    if (hOwnerWnd != NULL) {
+        VERIFY(::DrawMenuBar(hOwnerWnd));
+    }
 }
 
 void AwtMenuBar::_AddMenu(void *param)
--- a/test/jdk/ProblemList.txt	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/ProblemList.txt	Mon Nov 12 11:10:16 2018 +0530
@@ -151,7 +151,6 @@
 java/awt/event/InputEvent/EventWhenTest/EventWhenTest.java 8168646 generic-all
 java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogButtonTest/EnqueueWithDialogButtonTest.java 8198623 macosx-all
 java/awt/KeyboardFocusmanager/TypeAhead/FreezeTest/FreezeTest.java 8198623 macosx-all
-java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.html 8198624 macosx-all
 java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.html 8198626 macosx-all
 java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java 8049405 macosx-all
 java/awt/Mixing/AWT_Mixing/OpaqueOverlappingChoice.java 8048171 generic-all
@@ -235,7 +234,7 @@
 sun/awt/shell/ShellFolderMemoryLeak.java 8197794 windows-all
 sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java 8022403 generic-all
 sun/java2d/DirectX/OverriddenInsetsTest/OverriddenInsetsTest.java 8196102 generic-all
-sun/java2d/DirectX/RenderingToCachedGraphicsTest/RenderingToCachedGraphicsTest.java 8196180 windows-all
+sun/java2d/DirectX/RenderingToCachedGraphicsTest/RenderingToCachedGraphicsTest.java 8196180 windows-all,macosx-all
 sun/java2d/GdiRendering/InsetClipping.java 8196181 windows-all
 java/awt/Graphics2D/CopyAreaOOB.java 7001973 windows-all,macosx-all
 sun/java2d/SunGraphics2D/EmptyClipRenderingTest.java 8144029 macosx-all
@@ -474,7 +473,6 @@
 java/awt/datatransfer/ConstructFlavoredObjectTest/ConstructFlavoredObjectTest.java 8202860 linux-all
 java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java 8202790 macosx-all,linux-all
 java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.html 8202882 linux-all
-java/awt/MenuBar/8007006/bug8007006.java 8202886 macosx-all
 java/awt/Frame/FramesGC/FramesGC.java 8079069 macosx-all
 java/awt/dnd/MissingDragExitEventTest/MissingDragExitEventTest.java 8030121 macosx-all
 java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java 8202931 macosx-all,linux-all
@@ -492,7 +490,15 @@
 java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java 6847163
 java/awt/xembed/server/RunTestXEmbed.java 7034201 linux-all
 java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java 8164473 linux-all
+java/awt/im/memoryleak/InputContextMemoryLeakTest.java 8023814 linux-all,solaris-all
+# below test fails only on Win 7
+java/awt/font/FontNames/LocaleFamilyNames.java 8213129 windows-all
 
+java/awt/Frame/DisposeParentGC/DisposeParentGC.java 8079786 macosx-all
+java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java 8169468 macosx-all
+java/awt/GraphicsDevice/CheckDisplayModes.java 8213119 macosx-all
+java/awt/TextArea/AutoScrollOnSelectAndAppend/AutoScrollOnSelectAndAppend.java 8213120 macosx-all
+java/awt/Window/MainKeyWindowTest/TestMainKeyWindow.java 8213126 macosx-all
 
 ############################################################################
 
@@ -714,10 +720,8 @@
 javax/swing/JComponent/6683775/bug6683775.java 8172337 generic-all
 javax/swing/JComboBox/6236162/bug6236162.java 8028707 windows-all,macosx-all
 javax/swing/text/html/parser/Test8017492.java 8022535 generic-all
-javax/swing/JButton/8151303/PressedIconTest.java 8198689 macosx-all
 javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentCanvas.java 8081476 windows-all,macosx-all
 javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentSwing.java 8194128 macosx-all
-javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedPerPixelTranslucentGradient.java 8198667 macosx-all
 javax/swing/JWindow/ShapedAndTranslucentWindows/SetShapeAndClickSwing.java 8013450 macosx-all
 javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentJComboBox.java 8024627 macosx-all
 # The next test below is an intermittent failure
@@ -733,12 +737,10 @@
 javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-all
 javax/swing/Action/8133039/bug8133039.java 8196089 windows-all,macosx-all
 javax/swing/JComboBox/6559152/bug6559152.java 8196090 windows-all,macosx-all
-javax/swing/JComboBox/6607130/bug6607130.java 8196091 windows-all
 javax/swing/JComboBox/8032878/bug8032878.java 8196092 windows-all,macosx-all
 javax/swing/JComboBox/8057893/bug8057893.java 8169953 windows-all,macosx-all
 javax/swing/JComboBox/8072767/bug8072767.java 8196093 windows-all,macosx-all
 javax/swing/JComponent/4337267/bug4337267.java 8146451 windows-all
-javax/swing/JEditorPane/5076514/bug5076514.java 8198321 generic-all
 javax/swing/JFileChooser/4524490/bug4524490.java 8042380 generic-all
 javax/swing/JFileChooser/8002077/bug8002077.java 8196094 windows-all
 javax/swing/JFileChooser/DeserializedJFileChooser/DeserializedJFileChooserTest.java 8196095 generic-all
@@ -752,7 +754,6 @@
 javax/swing/JTabbedPane/4624207/bug4624207.java 8064922 macosx-all
 javax/swing/JTabbedPane/7024235/Test7024235.java 8028281 macosx-all
 javax/swing/SwingUtilities/TestBadBreak/TestBadBreak.java 8160720 generic-all
-javax/swing/plaf/basic/BasicTextUI/8001470/bug8001470.java 8196098 windows-all
 javax/swing/plaf/basic/Test6984643.java 8198340 windows-all
 javax/swing/text/CSSBorder/6796710/bug6796710.java 8196099 windows-all
 javax/swing/text/DefaultCaret/HidingSelection/HidingSelectionTest.java 8194048 windows-all
@@ -787,7 +788,6 @@
 javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java 8042383 macosx-all
 javax/swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java 8065099 macosx-all
 javax/swing/DataTransfer/8059739/bug8059739.java 8199074 generic-all
-javax/swing/GroupLayout/6613904/bug6613904.java 8199072 generic-all
 javax/swing/JCheckBox/8032667/bug8032667_image_diff.java 8199063 macosx-all
 javax/swing/JComboBox/7031551/bug7031551.java 8199056 generic-all
 javax/swing/JScrollBar/6924059/bug6924059.java 8199078 generic-all
@@ -811,8 +811,12 @@
 javax/swing/JPopupMenu/8075063/ContextMenuScrollTest.java 202880 linux-all
 javax/swing/dnd/8139050/NativeErrorsInTableDnD.java 8202765  macosx-all,linux-all
 javax/swing/Popup/TaskbarPositionTest.java 8065097 macosx-all,linux-all
-java/awt/im/memoryleak/InputContextMemoryLeakTest.java 8023814 linux-all,solaris-all
-
+javax/swing/GraphicsConfigNotifier/StalePreferredSize.java 8213121 macosx-all
+javax/swing/JButton/4368790/bug4368790.java 8213123 macosx-all
+javax/swing/JEditorPane/6917744/bug6917744.java 8213124 macosx-all
+javax/swing/JTable/6263446/bug6263446.java 8169959 macosx-all
+javax/swing/JTree/6263446/bug6263446.java 8213125 macosx-all
+javax/swing/JTree/8003400/Test8003400.java 8197560 macosx-all
 
 ############################################################################
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/Dialog/DocumentModalSheetTest/DocumentModalSheetTest.java	Mon Nov 12 11:10:16 2018 +0530
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8208543
+ * @requires (os.family == "mac")
+ * @summary Support for apple.awt.documentModalSheet incomplete in Mac
+ * @run main/manual DocumentModalSheetTest
+ */
+
+import java.awt.Dialog;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.FlowLayout;
+import javax.swing.JFrame;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JButton;
+import javax.swing.JTextArea;
+import javax.swing.Timer;
+import javax.swing.SwingUtilities;
+
+public class DocumentModalSheetTest {
+
+    private static JFrame jFrame;
+    private static JDialog jDialog;
+    private static JFrame instructionFrame;
+    private static Timer timer;
+    private static final int sleepTime = 300000;
+    private static volatile boolean testContinueFlag = true;
+    private static final String TEST_INSTRUCTIONS =
+    " This is a manual test\n\n" +
+    " 1) A Modal dialog with label 'Modal Dialog as Sheet' will be displayed\n" +
+    "   i) Press PASS if dialog appears as a sheet\n" +
+    "   ii) Press FAIL otherwise\n" +
+    " 2) A Modal dialog with label 'Modal Dialog as Window' will be displayed\n" +
+    "   i) Press PASS if dialog appears as a Window\n" +
+    "   ii) Press FAIL otherwise\n";
+    private static String FAIL_MESSAGE = "Modal dialog displayed as a new window";
+
+    private static void createAndShowInstructionFrame() throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                JButton passButton = new JButton("Pass");
+                passButton.setEnabled(true);
+
+                JButton failButton = new JButton("Fail");
+                failButton.setEnabled(true);
+
+                JTextArea instructions = new JTextArea(5, 60);
+                instructions.setText(TEST_INSTRUCTIONS);
+
+                instructionFrame = new JFrame("Test Instructions");
+                instructionFrame.add(passButton);
+                instructionFrame.add(failButton);
+                instructionFrame.add(instructions);
+                instructionFrame.setSize(200,200);
+                instructionFrame.setLayout(new FlowLayout());
+                instructionFrame.pack();
+                instructionFrame.setVisible(true);
+
+                passButton.addActionListener(ae -> {
+                    jDialog.setVisible(false);
+                    timer.stop();
+                    dispose();
+                });
+
+                failButton.addActionListener(ae -> {
+                    jDialog.setVisible(false);
+                    timer.stop();
+                    dispose() ;
+                    testContinueFlag = false;
+                    throw new RuntimeException(FAIL_MESSAGE);
+                });
+            }
+        });
+    }
+
+    private static void createAndShowModalDialog() throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                try {
+                    //Display Modal Dialog as a SHEET
+                    jFrame = new JFrame();
+                    createAndShowModalSheet(jFrame, "Modal Dialog as Sheet");
+                    if (testContinueFlag) {
+                        //Display Modal Dialog as a Window
+                        FAIL_MESSAGE = "Modal dialog displayed as a Sheet";
+                        createAndShowModalSheet(null, "Modal Dialog as Window");
+                        testContinueFlag = false;
+                    }
+                } catch (Exception e) {
+                    throw new RuntimeException("Modal dialog creation failed");
+                } finally {
+                    if (instructionFrame != null) {
+                        instructionFrame.dispose();
+                    }
+                }
+            }
+        });
+    }
+
+    private static void createAndShowModalSheet(JFrame frame, String label) throws Exception {
+        jDialog = new JDialog(frame, null, Dialog.ModalityType.DOCUMENT_MODAL);
+        jDialog.setSize(200, 200);
+        jDialog.getRootPane().putClientProperty("apple.awt.documentModalSheet", Boolean.TRUE);
+        JLabel jLabel = new JLabel(label);
+        jDialog.add(jLabel);
+
+        timer = new Timer(sleepTime, new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                jDialog.setVisible(false);
+                testContinueFlag = false;
+                dispose();
+                throw new RuntimeException("Timed out after " +
+                                           sleepTime / 1000 + " seconds");
+            }
+        });
+        timer.setRepeats(false);
+        timer.start();
+
+        jDialog.pack();
+        jDialog.setVisible(true);
+    }
+
+    private static void dispose() {
+        if (jDialog != null) {
+            jDialog.dispose();
+        }
+        if (jFrame != null) {
+            jFrame.dispose();
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        createAndShowInstructionFrame();
+        createAndShowModalDialog();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/Focus/NullActiveWindowOnFocusLost/NullActiveWindowOnFocusLost.java	Mon Nov 12 11:10:16 2018 +0530
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.Button;
+import java.awt.Frame;
+import java.util.concurrent.TimeUnit;
+
+import sun.awt.SunToolkit;
+
+/**
+ * @test
+ * @key headful
+ * @bug 8211435
+ * @requires (os.family == "mac")
+ * @modules java.desktop/sun.awt
+ */
+public final class NullActiveWindowOnFocusLost {
+
+    private static volatile long endtime;
+    private static Throwable failed;
+
+    public static void main(final String[] args) throws Exception {
+        // Will run the test no more than 30 seconds
+        endtime = System.nanoTime() + TimeUnit.SECONDS.toNanos(30);
+        Thread.setDefaultUncaughtExceptionHandler((t, e) -> failed = e);
+
+        final Thread[] threads = new Thread[20];
+        for (int i = 0; i < threads.length; i++) {
+            threads[i] = testThread(i);
+        }
+        for (final Thread thread : threads) {
+            thread.start();
+        }
+        for (final Thread thread : threads) {
+            thread.join();
+        }
+        if (failed != null) {
+            failed.printStackTrace();
+            throw new RuntimeException(failed);
+        }
+    }
+
+    private static Thread testThread(int index) {
+        return new Thread(new ThreadGroup("TG " + index), () -> {
+            SunToolkit.createNewAppContext();
+            while (!isComplete()) {
+                final Frame frame = new Frame();
+                frame.setSize(300, 300);
+                frame.add(new Button("Button"));
+                frame.setLocationRelativeTo(null);
+                frame.setVisible(true);
+                try {
+                    Thread.sleep(index); // increase probability of the failure
+                } catch (InterruptedException ignored) {
+                }
+                frame.dispose();
+            }
+        });
+    }
+
+    private static boolean isComplete() {
+        return endtime - System.nanoTime() < 0 || failed != null;
+    }
+}
--- a/test/jdk/java/awt/GraphicsEnvironment/LoadLock/GE_init5.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/java/awt/GraphicsEnvironment/LoadLock/GE_init5.java	Mon Nov 12 11:10:16 2018 +0530
@@ -25,10 +25,10 @@
  * @test
  * @bug 7002839
  * @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
- * @run main/othervm -Djava.awt.headless=true GE_init4
+ * @run main/othervm -Djava.awt.headless=true GE_init5
  */
 
-import java.awt.Toolkit;
+import java.awt.GraphicsEnvironment;
 
 public class GE_init5 {
     public static void main(String[] args) {
--- a/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.html	Sun Nov 11 21:24:46 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-<!--
- Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation.
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- or visit www.oracle.com if you need additional information or have any
- questions.
--->
-
-<html>
-<!--
-  @test
-  @key headful
-  @bug        6380743
-  @summary    Submenu should be shown by mnemonic key press.
-  @author     anton.tarasov@...: area=awt.focus
-  @library    ../../../regtesthelpers
-  @library    /test/lib
-  @build      Util
-  @build      jdk.test.lib.Platform
-  @run        applet SubMenuShowTest.html
-  -->
-<head>
-<title>SubMenuShowTest</title>
-</head>
-<body>
- 
-<h1>SubMenuShowTest<br>Bug ID: 6380743</h1>
- 
-<p>See the dialog box (usually in upper left corner) for instructions</p>
- 
-<APPLET CODE=SubMenuShowTest.class WIDTH=200 HEIGHT=200></APPLET>
-</body>
-</html>
--- a/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java	Mon Nov 12 11:10:16 2018 +0530
@@ -22,50 +22,78 @@
  */
 
 /*
-  test
-  @bug       6380743 8158380
-  @summary   Submenu should be shown by mnemonic key press.
-  @author    anton.tarasov@...: area=awt.focus
-  @run       applet SubMenuShowTest.html
+  @test
+  @key headful
+  @bug 6380743 8158380 8198624
+  @summary Submenu should be shown by mnemonic key press.
+  @author anton.tarasov@...: area=awt.focus
+  @library ../../../regtesthelpers
+  @library /test/lib
+  @build Util
+  @build jdk.test.lib.Platform
+  @run main SubMenuShowTest
 */
 
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import java.applet.Applet;
+import java.awt.Robot;
+import java.awt.BorderLayout;
+import java.awt.event.KeyEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+import javax.swing.SwingUtilities;
+import javax.swing.JFrame;
+import javax.swing.JMenuBar;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.lang.reflect.InvocationTargetException;
-
 import jdk.test.lib.Platform;
 import test.java.awt.regtesthelpers.Util;
 
-public class SubMenuShowTest extends Applet {
-    Robot robot;
-    JFrame frame = new JFrame("Test Frame");
-    JMenuBar bar = new JMenuBar();
-    JMenu menu = new JMenu("Menu");
-    JMenu submenu = new JMenu("More");
-    JMenuItem item = new JMenuItem("item");
-    AtomicBoolean activated = new AtomicBoolean(false);
+public class SubMenuShowTest {
+    private static Robot robot;
+    private static JFrame frame;
+    private static JMenuBar bar;
+    private static JMenu menu;
+    private static JMenu submenu;
+    private static JMenuItem item;
+    private static AtomicBoolean activated = new AtomicBoolean(false);
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(SubMenuShowTest::createAndShowGUI);
 
-    public static void main(String[] args) {
-        SubMenuShowTest app = new SubMenuShowTest();
-        app.init();
-        app.start();
+        try {
+            robot = new Robot();
+            robot.setAutoDelay(100);
+            robot.setAutoWaitForIdle(true);
+
+            doTest();
+        } catch (Exception ex) {
+            throw new RuntimeException("Test failed: Exception thrown:"+ex);
+        } finally {
+            dispose();
+        }
+
+        System.out.println("Test passed.");
     }
 
-    public void init() {
-        robot = Util.createRobot();
-        robot.setAutoDelay(200);
-        robot.setAutoWaitForIdle(true);
+    public static void dispose() throws Exception {
+        if(frame != null) {
+            SwingUtilities.invokeAndWait(() -> {
+                frame.dispose();
+            });
+        }
+    }
 
+    public static void createAndShowGUI() {
         // Create instructions for the user here, as well as set up
         // the environment -- set the layout manager, add buttons,
         // etc.
-        this.setLayout (new BorderLayout ());
-    }
+        frame = new JFrame("Test Frame");
+        bar = new JMenuBar();
+        menu = new JMenu("Menu");
+        submenu = new JMenu("More");
+        item = new JMenuItem("item");
 
-    public void start() {
+        frame.setLayout (new BorderLayout ());
         menu.setMnemonic('f');
         submenu.setMnemonic('m');
         menu.add(submenu);
@@ -85,7 +113,9 @@
             });
 
         frame.setVisible(true);
+    }
 
+    public static void doTest() {
         boolean isMacOSX = Platform.isOSX();
         if (isMacOSX) {
             robot.keyPress(KeyEvent.VK_CONTROL);
@@ -104,11 +134,9 @@
         robot.keyPress(KeyEvent.VK_SPACE);
         robot.keyRelease(KeyEvent.VK_SPACE);
 
-        if (!Util.waitForCondition(activated, 2000)) {
-            throw new TestFailedException("a submenu wasn't activated by mnemonic key press");
+        if (!Util.waitForCondition(activated, 1500)) {
+            throw new TestFailedException("A submenu wasn't activated by mnemonic key press");
         }
-
-        System.out.println("Test passed.");
     }
 }
 
@@ -117,4 +145,3 @@
         super("Test failed: " + msg);
     }
 }
-
--- a/test/jdk/java/awt/List/EmptyListEventTest/EmptyListEventTest.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/java/awt/List/EmptyListEventTest/EmptyListEventTest.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 /*
  * @test
  * @key headful
- * @bug 6366126
+ * @bug 6366126 8198000
  * @summary List throws ArrayIndexOutOfBoundsException when pressing ENTER after removing all the items, Win32
  * @author Dmitry Cherepanov area=awt.list
  * @run main EmptyListEventTest
--- a/test/jdk/java/awt/Menu/WrongParentAfterRemoveMenu/WrongParentAfterRemoveMenu.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/java/awt/Menu/WrongParentAfterRemoveMenu/WrongParentAfterRemoveMenu.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
 
 /**
  * @test
- * @bug 8165769
+ * @bug 8165769 8198001
  * @key headful
  */
 public final class WrongParentAfterRemoveMenu {
--- a/test/jdk/java/awt/MenuBar/8007006/bug8007006.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/java/awt/MenuBar/8007006/bug8007006.java	Mon Nov 12 11:10:16 2018 +0530
@@ -25,10 +25,10 @@
  * @test
  * @key headful
  * @bug 8007006
+ * @requires (os.family == "mac")
  * @summary [macosx] Closing subwindow loses main window menus.
- * @author Leonid Romanov
  * @library /test/lib
- * @build ExtendedRobot jdk.test.lib.Platform
+ * @build jdk.test.lib.Platform
  * @run main bug8007006
  */
 
@@ -40,6 +40,7 @@
 public class bug8007006 {
     private static Frame frame1;
     private static Frame frame2;
+    private static volatile boolean isActionPerformed;
 
     public static void main(String[] args) throws Exception {
         if (!Platform.isOSX()) {
@@ -49,46 +50,19 @@
 
         System.setProperty("apple.laf.useScreenMenuBar", "true");
 
-        ExtendedRobot robot = new ExtendedRobot();
-        robot.setAutoDelay(50);
+        Robot robot = new Robot();
+        robot.setAutoDelay(300);
 
         createAndShowGUI();
-        robot.waitForIdle(1500);
-
+        robot.waitForIdle();
         frame2.dispose();
-
-        robot.waitForIdle(1500);
-
-
-        // open "Apple" menu (the leftmost one)
-        robot.keyPress(KeyEvent.VK_META);
-        robot.keyPress(KeyEvent.VK_SHIFT);
-        robot.keyPress(KeyEvent.VK_SLASH);
-        robot.keyRelease(KeyEvent.VK_SLASH);
-        robot.keyRelease(KeyEvent.VK_SHIFT);
-        robot.keyRelease(KeyEvent.VK_META);
-
-        // Select our menu
-        robot.keyPress(KeyEvent.VK_LEFT);
-        robot.keyRelease(KeyEvent.VK_LEFT);
-
-        // Select menu item
-        robot.keyPress(KeyEvent.VK_DOWN);
-        robot.keyRelease(KeyEvent.VK_DOWN);
-        robot.keyPress(KeyEvent.VK_ENTER);
-        robot.keyRelease(KeyEvent.VK_ENTER);
-
         robot.waitForIdle();
 
-        MenuBar mbar = frame1.getMenuBar();
-        Menu menu = mbar.getMenu(0);
-        CheckboxMenuItem item = (CheckboxMenuItem)menu.getItem(0);
-        boolean isChecked = item.getState();
+        performMenuItemTest(robot);
 
         frame1.dispose();
-
-        if (isChecked) {
-            throw new Exception("Test failed: menu item remained checked");
+        if (!isActionPerformed) {
+            throw new Exception("Test failed: menu item action was not performed");
         }
     }
 
@@ -106,14 +80,51 @@
     }
 
     private static MenuBar createMenuBar() {
-        MenuBar mbar = new MenuBar();
-        Menu menu = new Menu("Menu");
-        MenuItem item = new CheckboxMenuItem("Checked", true);
-
+        // A very long name makes it more likely that the robot will hit the
+        // menu
+        Menu menu = new Menu("TestTestTestTestTestTestTestTestTestTest");
+        MenuItem item = new MenuItem("TestTestTestTestTestTestTestTestTestTest");
+        item.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent ev) {
+                isActionPerformed = true;
+            }
+        });
         menu.add(item);
-        mbar.add(menu);
-
-        return mbar;
+        MenuBar mb = new MenuBar();
+        mb.add(menu);
+        return mb;
     }
 
+    private static void performMenuItemTest(Robot robot) {
+        // Find the menu on the screen menu bar
+        // The location depends upon the application name which is the name
+        // of the first menu.
+        // Unfortunately, the application name can vary based on how the
+        // application is run.
+        // The work around is to make the menu and the menu item names very
+        // long.
+        int menuBarX = 250;
+        int menuBarY = 11;
+        int menuItemX = menuBarX;
+        int menuItemY = 34;
+        robot.mouseMove(menuBarX, menuBarY);
+        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
+        robot.mouseMove(menuItemX, menuItemY);
+        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
+        robot.waitForIdle();
+        waitForAction();
+    }
+
+    private static void waitForAction() {
+        try {
+            for (int i = 0; i < 10; i++) {
+                if (isActionPerformed) {
+                    return;
+                }
+                Thread.sleep(100);
+            }
+        } catch (InterruptedException ex) {
+        }
+    }
 }
--- a/test/jdk/java/awt/Mixing/Validating.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/java/awt/Mixing/Validating.java	Mon Nov 12 11:10:16 2018 +0530
@@ -24,7 +24,7 @@
 /*
   @test
   @key headful
-  @bug 6682046
+  @bug 6682046 8198002
   @summary Mixing code does not always recalculate shapes correctly when resizing components
   @author anthony.petrov@...: area=awt.mixing
   @library ../regtesthelpers
@@ -38,8 +38,12 @@
  * summary:  Mixing code does not always recalculate shapes correctly when resizing components
  */
 
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.Button;
+import java.awt.event.InputEvent;
+import java.awt.Frame;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.Toolkit;
 import test.java.awt.regtesthelpers.Util;
 
 public class Validating
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/java/awt/Toolkit/DisplayChangesException/DisplayChangesException.java	Mon Nov 12 11:10:16 2018 +0530
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.awt.EventQueue;
+import java.awt.GraphicsEnvironment;
+import java.awt.Toolkit;
+import java.lang.reflect.Method;
+import java.util.concurrent.CountDownLatch;
+
+import javax.swing.JButton;
+import javax.swing.JFrame;
+
+import sun.awt.DisplayChangedListener;
+import sun.awt.SunToolkit;
+
+/**
+ * @test
+ * @key headful
+ * @bug 8207070
+ * @modules java.desktop/sun.java2d
+ *          java.desktop/sun.awt
+ */
+public final class DisplayChangesException {
+
+    private static boolean fail;
+    private static CountDownLatch go = new CountDownLatch(1);
+
+    static final class TestThread extends Thread {
+
+        private JFrame frame;
+
+        private TestThread(ThreadGroup tg, String threadName) {
+            super(tg, threadName);
+        }
+
+        public void run() {
+            try {
+                test();
+            } catch (final Exception e) {
+                throw new RuntimeException(e);
+            }
+        }
+
+        private void test() throws Exception {
+            SunToolkit.createNewAppContext();
+            EventQueue.invokeAndWait(() -> {
+                frame = new JFrame();
+                final JButton b = new JButton();
+                b.addPropertyChangeListener(evt -> {
+                    if (!SunToolkit.isDispatchThreadForAppContext(b)) {
+                        System.err.println("Wrong thread:" + currentThread());
+                        fail = true;
+                    }
+                });
+                frame.add(b);
+                frame.setSize(100, 100);
+                frame.setLocationRelativeTo(null);
+                frame.pack();
+            });
+            go.await();
+            EventQueue.invokeAndWait(() -> {
+                frame.dispose();
+            });
+        }
+    }
+
+    public static void main(final String[] args) throws Exception {
+        ThreadGroup tg0 = new ThreadGroup("ThreadGroup0");
+        ThreadGroup tg1 = new ThreadGroup("ThreadGroup1");
+
+        TestThread t0 = new TestThread(tg0, "TestThread 0");
+        TestThread t1 = new TestThread(tg1, "TestThread 1");
+
+        t0.start();
+        t1.start();
+        Thread.sleep(1500); // Cannot use Robot.waitForIdle
+        testToolkit();
+        Thread.sleep(1500);
+        testGE();
+        Thread.sleep(1500);
+        go.countDown();
+
+        if (fail) {
+            throw new RuntimeException();
+        }
+    }
+
+    private static void testGE() {
+        Object ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        if (!(ge instanceof DisplayChangedListener)) {
+            return;
+        }
+        ((DisplayChangedListener) ge).displayChanged();
+    }
+
+    private static void testToolkit() {
+        final Class toolkit;
+        try {
+            toolkit = Class.forName("sun.awt.windows.WToolkit");
+        } catch (final ClassNotFoundException ignored) {
+            return;
+        }
+        try {
+            final Method displayChanged = toolkit.getMethod("displayChanged");
+            displayChanged.invoke(Toolkit.getDefaultToolkit());
+        } catch (final Exception e) {
+            e.printStackTrace();
+            fail = true;
+        }
+    }
+}
+
--- a/test/jdk/java/awt/Window/ShapedAndTranslucentWindows/Common.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/java/awt/Window/ShapedAndTranslucentWindows/Common.java	Mon Nov 12 11:10:16 2018 +0530
@@ -47,7 +47,7 @@
     static final int STATIC_BLOCKS = 30;
     static final Color BG_COLOR = Color.BLUE;
     static final Color FG_COLOR = Color.RED;
-    static final int delay = 1000;
+    static final int delay = 55000;
     static final SecureRandom random = new SecureRandom();
     static final int dl = 100;
     static final Class[] WINDOWS_TO_TEST = { Window.class, Frame.class, Dialog.class };
--- a/test/jdk/javax/swing/GroupLayout/6613904/bug6613904.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/javax/swing/GroupLayout/6613904/bug6613904.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,11 +28,13 @@
  * @author Pavel Porvatov
  */
 
-import javax.swing.*;
+import javax.swing.GroupLayout;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
 
 public class bug6613904 {
-    public static void main(String[] args) {
-        SwingUtilities.invokeLater(new Runnable() {
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 GroupLayout groupLayout = new GroupLayout(new JPanel());
 
--- a/test/jdk/javax/swing/JComboBox/4199622/bug4199622.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/javax/swing/JComboBox/4199622/bug4199622.java	Mon Nov 12 11:10:16 2018 +0530
@@ -27,10 +27,9 @@
    @bug 4199622
    @requires (os.family == "windows")
    @summary RFE: JComboBox shouldn't send ActionEvents for keyboard navigation
-   @author Vladislav Karnaukhov
    @library /test/lib
    @modules java.desktop/com.sun.java.swing.plaf.windows
-   @build jdk.test.libr.Platform
+   @build jdk.test.lib.Platform
    @run main bug4199622
  */
 
--- a/test/jdk/javax/swing/JComboBox/WindowsComboBoxSize/WindowsComboBoxSizeTest.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/javax/swing/JComboBox/WindowsComboBoxSize/WindowsComboBoxSizeTest.java	Mon Nov 12 11:10:16 2018 +0530
@@ -24,7 +24,7 @@
 /**
  * @test
  * @key headful
- * @bug 8179027
+ * @bug 8179027 8213116
  * @requires (os.family == "windows")
  * @summary JComboBox too small under Windows LAF
  * @run main WindowsComboBoxSizeTest
@@ -64,7 +64,6 @@
         });
         Robot robot = new Robot();
         robot.waitForIdle();
-
         try {
             test();
         } finally {
@@ -78,12 +77,12 @@
             if (comboBox.getSize().height != expected ) {
                 throw new RuntimeException(
                         "Wrong non-editable JComboBox height " +
-                                              comboBox.getSize().height);
+                                              comboBox.getSize().height + " expected " + expected);
             }
             if (comboBoxEd.getSize().height != expected ) {
                 throw new RuntimeException(
                         "Wrong editable JComboBox height " +
-                                            comboBoxEd.getSize().height);
+                                            comboBoxEd.getSize().height + " expected " + expected);
             }
         });
     }
--- a/test/jdk/javax/swing/JEditorPane/5076514/bug5076514.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/javax/swing/JEditorPane/5076514/bug5076514.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,16 @@
  */
 
 /* @test
-   @bug 5076514 8025430
+   @bug 5076514 8025430 8198321
    @summary Tests if SecurityManager.checkPermission()
                   used for clipboard access with permission 'accessClipboard'
    @run main bug5076514
+   @run main/othervm -Djava.awt.headless=true bug5076514
 */
 
+import java.awt.GraphicsEnvironment;
 import java.security.Permission;
+
 import javax.swing.JEditorPane;
 
 public class bug5076514 {
@@ -37,9 +40,13 @@
 
     public static void main(String[] args) {
         System.setSecurityManager(new MySecurityManager());
+
+        // no system clipboard in the headless mode
+        boolean expected  = !GraphicsEnvironment.isHeadless();
+
         JEditorPane editor = new JEditorPane();
         editor.copy();
-        if (!isCheckPermissionCalled) {
+        if (isCheckPermissionCalled != expected) {
             throw new RuntimeException("JEditorPane's clipboard operations "
                     + "didn't call SecurityManager.checkPermission() with "
                     + "permission 'accessClipboard' when there is a security"
--- a/test/jdk/javax/swing/JFrame/NSTexturedJFrame/NSTexturedJFrame.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/javax/swing/JFrame/NSTexturedJFrame/NSTexturedJFrame.java	Mon Nov 12 11:10:16 2018 +0530
@@ -34,9 +34,10 @@
  * @test
  * @key headful
  * @bug 7124513
+ * @requires (os.family == "mac")
  * @summary We should support NSTexturedBackgroundWindowMask style on OSX.
- * @author Sergey Bylokhov
  * @library /test/lib
+ *          /test/jdk/lib/testlibrary/
  * @build ExtendedRobot jdk.test.lib.Platform
  * @run main NSTexturedJFrame
  */
--- a/test/jdk/javax/swing/JPopupMenu/7154841/bug7154841.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/javax/swing/JPopupMenu/7154841/bug7154841.java	Mon Nov 12 11:10:16 2018 +0530
@@ -25,9 +25,10 @@
  * @test
  * @key headful
  * @bug 7154841
+ * @requires (os.family == "mac")
  * @summary JPopupMenu is overlapped by a Dock on Mac OS X
- * @author Petr Pchelko
  * @library /test/lib
+ *          /test/jdk/lib/testlibrary/
  * @build ExtendedRobot jdk.test.lib.Platform
  * @run main bug7154841
  */
--- a/test/jdk/javax/swing/LookAndFeel/8145547/DemandGTK2.sh	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/javax/swing/LookAndFeel/8145547/DemandGTK2.sh	Mon Nov 12 11:10:16 2018 +0530
@@ -1,7 +1,7 @@
 #!/bin/ksh -p
 
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 #   @summary  Try to force GTK2. We must bail out to GTK3 (if any) if no 2 available.
 #
 #   @key headful
+#   @bug 8156128 8212903
 #   @compile ProvokeGTK.java
 #   @requires os.family == "linux"
 #   @run shell/timeout=400 DemandGTK2.sh
@@ -61,12 +62,12 @@
         exit 1
     fi
     echo "No GTK 2 library found: we should bail out to 3"
-    strace -o strace.log -fe open ${TESTJAVA}/bin/java  -cp ${TESTCLASSPATH}  -Djdk.gtk.version=2 ProvokeGTK
+    strace -o strace.log -fe open,openat ${TESTJAVA}/bin/java  -cp ${TESTCLASSPATH}  -Djdk.gtk.version=2 ProvokeGTK
     EXECRES=$?
     grep  'libgtk-3.*=\ *[0-9]*$' strace.log > logg
 else
     echo "There is GTK 2 library: we should use it"
-    strace -o strace.log -fe open ${TESTJAVA}/bin/java  -cp ${TESTCLASSPATH}  -Djdk.gtk.version=2 ProvokeGTK
+    strace -o strace.log -fe open,openat ${TESTJAVA}/bin/java  -cp ${TESTCLASSPATH}  -Djdk.gtk.version=2 ProvokeGTK
     EXECRES=$?
     grep  'libgtk-x11.*=\ *[0-9]*$' strace.log > logg
 fi
--- a/test/jdk/javax/swing/LookAndFeel/8145547/DemandGTK3.sh	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/javax/swing/LookAndFeel/8145547/DemandGTK3.sh	Mon Nov 12 11:10:16 2018 +0530
@@ -1,7 +1,7 @@
 #!/bin/ksh -p
 
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 #   @summary  Try to force GTK3. We must bail out to GTK2 if no 3 available.
 #
 #   @key headful
+#   @bug 8156128 8212903
 #   @compile ProvokeGTK.java
 #   @requires os.family == "linux"
 #   @run shell/timeout=400 DemandGTK3.sh
@@ -54,12 +55,12 @@
 then
     
     echo "No GTK 3 library found: we should bail out to 2"
-    strace -o strace.log -fe open ${TESTJAVA}/bin/java  -cp ${TESTCLASSPATH}  -Djdk.gtk.version=3 ProvokeGTK
+    strace -o strace.log -fe open,openat ${TESTJAVA}/bin/java  -cp ${TESTCLASSPATH}  -Djdk.gtk.version=3 ProvokeGTK
     EXECRES=$?
     grep  'libgtk-x11.*=\ *[0-9]*$' strace.log > logg
 else
     echo "There is GTK 3 library: we should use it"
-    strace -o strace.log -fe open ${TESTJAVA}/bin/java  -cp ${TESTCLASSPATH}  -Djdk.gtk.version=3 ProvokeGTK
+    strace -o strace.log -fe open,openat ${TESTJAVA}/bin/java  -cp ${TESTCLASSPATH}  -Djdk.gtk.version=3 ProvokeGTK
     EXECRES=$?
     grep  'libgtk-3.*=\ *[0-9]*$' strace.log > logg
 fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/javax/swing/plaf/nimbus/AllSwingComponentsBaselineTest.java	Mon Nov 12 11:10:16 2018 +0530
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+   @key headful
+   @bug 8192888 8213261
+   @summary Verifies getBaseline causes NPE for Nimbus L&F
+   @run main AllSwingComponentsBaselineTest
+ */
+
+import java.awt.FlowLayout;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.UIManager;
+import javax.swing.SwingUtilities;
+import javax.swing.plaf.basic.BasicButtonUI;
+
+public class AllSwingComponentsBaselineTest {
+    public static void main(String args[]) throws Exception {
+        for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
+            System.out.println("Test for LookAndFeel " + laf.getClassName());
+            UIManager.setLookAndFeel(laf.getClassName());
+            SwingUtilities.invokeAndWait(() -> test());
+            System.out.println("Test passed for LookAndFeel " + laf.getClassName());
+        }
+    }
+
+    public static void test() {
+        JFrame frame = null;
+        try {
+            frame = new JFrame();
+            JButton b = new JButton("test");
+            FlowLayout layout = new FlowLayout();
+            layout.setAlignOnBaseline(true);
+
+            frame.getContentPane().setLayout(layout);
+            frame.getContentPane().add(b);
+
+            BasicButtonUI bbUI = (BasicButtonUI) UIManager.getUI(b);
+            bbUI.getBaseline(b, b.getHeight(), b.getWidth());
+        } finally {
+            if (frame != null) {
+                frame.dispose();
+            }
+        }
+    }
+}
--- a/test/jdk/javax/swing/reliability/HangDuringStaticInitialization.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/javax/swing/reliability/HangDuringStaticInitialization.java	Mon Nov 12 11:10:16 2018 +0530
@@ -32,7 +32,7 @@
 
 /**
  * @test
- * @bug 8189604
+ * @bug 8189604 8208702
  * @run main/othervm -Djava.awt.headless=false HangDuringStaticInitialization
  * @run main/othervm -Djava.awt.headless=true HangDuringStaticInitialization
  */
@@ -63,4 +63,4 @@
             }
         });
     }
-}
\ No newline at end of file
+}
--- a/test/jdk/sanity/client/SwingSet/src/InternalFrameDemoTest.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/sanity/client/SwingSet/src/InternalFrameDemoTest.java	Mon Nov 12 11:10:16 2018 +0530
@@ -45,10 +45,12 @@
 
 import javax.swing.JDesktopPane;
 import javax.swing.JInternalFrame;
+import javax.swing.UIManager;
 
 import org.jemmy2ext.JemmyExt;
 import org.jtregext.GuiTestListener;
 import org.netbeans.jemmy.ClassReference;
+import org.netbeans.jemmy.JemmyProperties;
 import org.netbeans.jemmy.operators.ComponentOperator;
 import org.netbeans.jemmy.operators.JButtonOperator;
 import org.netbeans.jemmy.operators.JCheckBoxOperator;
@@ -74,7 +76,7 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.internalframe.InternalFrameDemo
- * @run testng InternalFrameDemoTest
+ * @run testng/timeout=600 InternalFrameDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class InternalFrameDemoTest {
@@ -92,8 +94,12 @@
      *
      * @throws Exception
      */
-    @Test
-    public void test() throws Exception {
+    @Test(dataProvider = "availableLookAndFeels", dataProviderClass = TestHelpers.class)
+    public void test(String lookAndFeel) throws Exception {
+        UIManager.setLookAndFeel(lookAndFeel);
+        // initializing internal frame driver for each L&F
+        JemmyProperties.setCurrentDispatchingModel(
+                JemmyProperties.getCurrentDispatchingModel());
 
         new ClassReference(InternalFrameDemo.class.getCanonicalName()).startApplication();
 
--- a/test/jdk/sanity/client/SwingSet/src/SplitPaneDemoTest.java	Sun Nov 11 21:24:46 2018 +0100
+++ b/test/jdk/sanity/client/SwingSet/src/SplitPaneDemoTest.java	Mon Nov 12 11:10:16 2018 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 import java.awt.Component;
 import java.awt.event.KeyEvent;
 import javax.swing.JSplitPane;
+import javax.swing.UIManager;
 
 import static org.jemmy2ext.JemmyExt.*;
 
@@ -59,13 +60,14 @@
  *          java.logging
  * @build org.jemmy2ext.JemmyExt
  * @build com.sun.swingset3.demos.splitpane.SplitPaneDemo
- * @run testng SplitPaneDemoTest
+ * @run testng/timeout=600 SplitPaneDemoTest
  */
 @Listeners(GuiTestListener.class)
 public class SplitPaneDemoTest {
 
-    @Test
-    public void test() throws Exception {
+    @Test(dataProvider = "availableLookAndFeels", dataProviderClass = TestHelpers.class)
+    public void test(String lookAndFeel) throws Exception {
+        UIManager.setLookAndFeel(lookAndFeel);
 
         new ClassReference(SplitPaneDemo.class.getCanonicalName()).startApplication();
 
@@ -73,21 +75,29 @@
 
         JSplitPaneOperator splitPane = new JSplitPaneOperator(frame);
 
-        // Toggle OneTouch Expandable
-        checkOneTouch(frame, splitPane, true);
-        checkOneTouch(frame, splitPane, false);
+        // OneTouch feature is not available in GTK L&F
+        if(!"GTK".equals(UIManager.getLookAndFeel().getID())) {
+            // Toggle OneTouch Expandable
+            checkOneTouch(frame, splitPane, true);
+            checkOneTouch(frame, splitPane, false);
+        }
 
         // Check changing divider size to minimum and maximum values
         changeDividerSize(frame, splitPane, 50);
         changeDividerSize(frame, splitPane, 6);
 
-        // Check moving the divider
-        checkDividerMoves(frame, splitPane, false);
-        checkDividerMoves(frame, splitPane, true);
 
-        // Check different minumum Day/Night sizes
-        changeMinimumSizes(frame, splitPane, 100);
-        changeMinimumSizes(frame, splitPane, 0);
+        // TODO Skipping this code for Motif L&F as the fix for "CODETOOLS-7902324"
+        // is deferred now
+        if(!("Motif".equals(UIManager.getLookAndFeel().getID()))) {
+            // Check moving the divider
+            checkDividerMoves(frame, splitPane, false);
+            checkDividerMoves(frame, splitPane, true);
+
+            // Check different minumum Day/Night sizes
+            changeMinimumSizes(frame, splitPane, 100);
+            changeMinimumSizes(frame, splitPane, 0);
+        }
     }
 
     // Check for different day and night minimum size