changeset 4857:e446c7d24d6c

Merge
author lana
date Thu, 15 Dec 2011 19:52:13 -0800
parents c647ebb3c4f7 e55ac966ed95
children 33ac7a057b9c
files make/sun/motif12/reorder-i586 make/sun/motif12/reorder-sparc make/sun/motif12/reorder-sparcv9 src/solaris/classes/sun/awt/motif/AWTLockAccess.java src/solaris/classes/sun/awt/motif/MFontPeer.java src/solaris/classes/sun/awt/motif/MToolkit.java src/solaris/classes/sun/awt/motif/MToolkitThreadBlockedHandler.java src/solaris/classes/sun/awt/motif/MWindowAttributes.java src/solaris/classes/sun/awt/motif/X11FontMetrics.java src/solaris/native/sun/awt/MouseInfo.c src/solaris/native/sun/awt/XDrawingArea.c src/solaris/native/sun/awt/XDrawingArea.h src/solaris/native/sun/awt/XDrawingAreaP.h src/solaris/native/sun/awt/awt_Cursor.h src/solaris/native/sun/awt/awt_KeyboardFocusManager.h src/solaris/native/sun/awt/awt_MToolkit.c src/solaris/native/sun/awt/awt_MToolkit.h src/solaris/native/sun/awt/awt_MenuItem.h src/solaris/native/sun/awt/awt_PopupMenu.h src/solaris/native/sun/awt/awt_TopLevel.h src/solaris/native/sun/awt/awt_Window.h src/solaris/native/sun/awt/awt_mgrsel.c src/solaris/native/sun/awt/awt_mgrsel.h src/solaris/native/sun/awt/awt_motif.h src/solaris/native/sun/awt/awt_wm.c src/solaris/native/sun/awt/awt_wm.h src/solaris/native/sun/awt/awt_xembed.h src/solaris/native/sun/awt/awt_xembed_server.c src/solaris/native/sun/awt/awt_xembed_server.h
diffstat 124 files changed, 2140 insertions(+), 14834 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Dec 13 15:41:47 2011 -0800
+++ b/.hgtags	Thu Dec 15 19:52:13 2011 -0800
@@ -136,3 +136,6 @@
 09fd2067f715e4505c44b01c301258a4e8f8964e jdk8-b12
 4cb2e8679b27432854690cb688ea06d3b2d8e008 jdk8-b13
 99632935785e2038b2fc836da9f2ede69dea294b jdk8-b14
+3c248d0e2c486624cc0d7aba1e4df45ae5774ff7 jdk8-b15
+b71d1acfae5240d8c1359443cd02b5ddb587231c jdk8-b17
+929597c6e777f742ad252660045ebaa4a3ea4772 jdk8-b16
--- a/make/sun/awt/FILES_c_unix.gmk	Tue Dec 13 15:41:47 2011 -0800
+++ b/make/sun/awt/FILES_c_unix.gmk	Thu Dec 15 19:52:13 2011 -0800
@@ -140,71 +140,13 @@
 	debug_trace.c \
 	debug_util.c
 
-# These files rely on motif to be built, and should not be included
-# in a headless build.
-
-#FILES_MOTIF_c = \
-#keep	awt_AWTEvent.c \
-#	awt_Button.c \
-#	awt_Canvas.c \
-#	awt_Checkbox.c \
-#keep .h	awt_Component.c \
-#keep .h	awt_Cursor.c \
-#	awt_DataTransferer.c \
-#	awt_DrawingSurface.c \
-#	awt_Event.c \
-#	awt_FileDialog.c \
-#	awt_GlobalCursorManager.c \
-#	awt_GraphicsEnv.c \
-#	awt_InputMethod.c \
-#keep	awt_Insets.c \
-#	awt_KeyboardFocusManager.c \
-#	awt_Label.c \
-#	awt_List.c \
-#	awt_Menu.c \
-#	awt_MenuBar.c \
-#	awt_MenuComponent.c \
-#	awt_MenuItem.c \
-#	awt_motif.c \
-#	awt_Plugin.c \
-#	awt_PopupMenu.c \
-#	awt_Robot.c \
-#	awt_Scrollbar.c \
-#	awt_ScrollPane.c \
-#	awt_Selection.c \
-#	awt_UNIXToolkit.c \
-#	awt_TextArea.c \
-#	awt_TextField.c \
-#	awt_TopLevel.c \
-#	awt_mgrsel.c \
-#	awt_util.c \
-#	awt_wm.c \
-#	awt_XmDnD.c \
-#	awt_dnd.c \
-#	awt_dnd_ds.c \
-#	awt_dnd_dt.c \
-#	canvas.c \
-#	cursor.c \
-#	multi_font.c \
-#	robot_common.c \
-#        list.c \
-#        multiVis.c \
-#	XDrawingArea.c \
-#	MouseInfo.c \
-#	awt_xembed.c \
-#	awt_xembed_server.c \
-#        gtk2_interface.c \
-#        swing_GTKEngine.c \
-#        swing_GTKStyle.c
-
-
 # These files are required to be built, with or without motif.  Some of
 # these are only dependent on X11, and some contain native source that
 # is required, even in a headless build.
 
 FILES_NO_MOTIF_c = \
 	awt_Font.c \
-	awt_MToolkit.c \
+	HeadlessToolkit.c \
 	fontpath.c \
 	VDrawingArea.c \
 	X11Color.c \
--- a/make/sun/awt/FILES_export_unix.gmk	Tue Dec 13 15:41:47 2011 -0800
+++ b/make/sun/awt/FILES_export_unix.gmk	Thu Dec 15 19:52:13 2011 -0800
@@ -61,11 +61,8 @@
 	sun/awt/image/BufImgSurfaceData.java \
 	sun/awt/image/DataBufferNative.java \
 	\
-	sun/awt/motif/X11FontMetrics.java \
 	sun/awt/X11InputMethod.java \
 	sun/awt/motif/MFontConfiguration.java \
-	sun/awt/motif/MFontPeer.java \
-	sun/awt/motif/MToolkit.java \
         sun/awt/DebugSettings.java \
 	sun/awt/EmbeddedFrame.java \
 	sun/awt/PlatformFont.java \
@@ -93,7 +90,6 @@
         sun/java2d/cmm/ColorTransform.java \
         sun/awt/datatransfer/DataTransferer.java \
 	sun/awt/dnd/SunDragSourceContextPeer.java \
-	sun/awt/motif/MToolkitThreadBlockedHandler.java \
 	sun/java2d/opengl/OGLBlitLoops.java \
 	sun/java2d/opengl/OGLContext.java \
 	sun/java2d/opengl/OGLMaskFill.java \
--- a/make/sun/awt/mapfile-mawt-vers	Tue Dec 13 15:41:47 2011 -0800
+++ b/make/sun/awt/mapfile-mawt-vers	Thu Dec 15 19:52:13 2011 -0800
@@ -31,7 +31,6 @@
 	global:
 		JNI_OnLoad;
 
-                #Java_sun_awt_motif_MComponentPeer_restoreFocus;
 		Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords;
 		Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse;
 		Java_java_awt_AWTEvent_nativeSetSource;
@@ -56,230 +55,11 @@
                 Java_sun_awt_UNIXToolkit_load_1stock_1icon;
                 Java_sun_awt_UNIXToolkit_load_1gtk_1icon;
 		Java_sun_awt_UNIXToolkit_nativeSync;
-		#Java_sun_awt_motif_MButtonPeer_create;
-		#Java_sun_awt_motif_MButtonPeer_setLabel;
-                #Java_sun_awt_motif_MPanelPeer_pEnsureIndex;
-                #Java_sun_awt_motif_MPanelPeer_pRestack;
-		#Java_sun_awt_motif_MCanvasPeer_create;
-		#Java_sun_awt_motif_MCanvasPeer_initIDs;
-		#Java_sun_awt_motif_MCanvasPeer_resetTargetGC;
-		#Java_sun_awt_motif_MCheckboxMenuItemPeer_pSetState;
-		#Java_sun_awt_motif_MCheckboxPeer_create;
-		#Java_sun_awt_motif_MCheckboxPeer_setCheckboxGroup;
-		#Java_sun_awt_motif_MCheckboxPeer_setLabel;
-		#Java_sun_awt_motif_MCheckboxPeer_pSetState;
-		#Java_sun_awt_motif_MCheckboxPeer_pGetState;
-		#Java_sun_awt_motif_MChoicePeer_addItem;
-		#Java_sun_awt_motif_MChoicePeer_appendItems;
-		#Java_sun_awt_motif_MChoicePeer_create;
-		#Java_sun_awt_motif_MChoicePeer_pReshape;
-		#Java_sun_awt_motif_MChoicePeer_remove;
-		#Java_sun_awt_motif_MChoicePeer_removeAll;
-		#Java_sun_awt_motif_MChoicePeer_setBackground;
-		#Java_sun_awt_motif_MChoicePeer_pSelect;
-		#Java_sun_awt_motif_MChoicePeer_setFont;
-		#Java_sun_awt_motif_MChoicePeer_setForeground;
-		#Java_sun_awt_motif_MComponentPeer_addNativeDropTarget;
-		#Java_sun_awt_motif_MComponentPeer_getNativeColor;
-		#Java_sun_awt_motif_MComponentPeer_getWindow;
-		#Java_sun_awt_motif_MComponentPeer_pDisable;
-		#Java_sun_awt_motif_MComponentPeer_pDispose;
-		#Java_sun_awt_motif_MComponentPeer_pEnable;
-		#Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen;
-		#Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen2;
-		#Java_sun_awt_motif_MComponentPeer_pHide;
-		#Java_sun_awt_motif_MComponentPeer_pInitialize;
-		#Java_sun_awt_motif_MComponentPeer_pMakeCursorVisible;
-		#Java_sun_awt_motif_MComponentPeer_pReshape;
-		#Java_sun_awt_motif_MComponentPeer_pShow;
-		#Java_sun_awt_motif_MComponentPeer_removeNativeDropTarget;
-		#Java_sun_awt_motif_MComponentPeer_pSetBackground;
-		#Java_sun_awt_motif_MComponentPeer_pSetFont;
-                #Java_sun_awt_motif_MComponentPeer_processSynchronousLightweightTransfer;
-                #Java_sun_awt_motif_MComponentPeer__1requestFocus;
-                #Java_sun_awt_motif_MComponentPeer_getNativeFocusedWindow;
-		#Java_sun_awt_motif_MCheckboxMenuItemPeer_getState;
-		#Java_sun_awt_motif_MComponentPeer_pSetForeground;
-		#Java_sun_awt_motif_MDragSourceContextPeer_startDrag;
-		#Java_sun_awt_motif_MDragSourceContextPeer_setNativeCursor;
-		#Java_sun_awt_motif_MDropTargetContextPeer_addTransfer;
-		#Java_sun_awt_motif_MDropTargetContextPeer_dropDone;
-		#Java_sun_awt_motif_MDropTargetContextPeer_startTransfer;
-		#Java_sun_awt_motif_X11DragSourceContextPeer_startDrag;
-		#Java_sun_awt_motif_X11DragSourceContextPeer_setNativeCursor;
-		#Java_sun_awt_motif_X11DropTargetContextPeer_sendResponse;
-		#Java_sun_awt_motif_X11DropTargetContextPeer_dropDone;
-		#Java_sun_awt_motif_X11DropTargetContextPeer_getData;
-		#Java_sun_awt_motif_MEmbeddedFramePeer_NEFcreate;
-		#Java_sun_awt_motif_MEmbeddedFramePeer_pShowImpl;
-		#Java_sun_awt_motif_MEmbeddedFramePeer_requestXEmbedFocus;
-		#Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedApplicationActive;
-		#Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedActive;
-                #Java_sun_awt_motif_MEmbeddedFramePeer_synthesizeFocusInOut;
-		#Java_sun_awt_motif_MEmbeddedFramePeer_pReshapePrivate;
-		#Java_sun_awt_motif_MEmbeddedFramePeer_getBoundsPrivate;
-		#Java_sun_awt_motif_MEmbeddedFrame_getWidget;
-		#Java_sun_awt_motif_MEmbeddedFrame_mapWidget;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_forwardEventToEmbedded;       
-		#Java_sun_awt_motif_MFramePeer_pSetIconImage___3B_3I_3SII;
-		#Java_sun_awt_motif_MFileDialogPeer_create;
-		#Java_sun_awt_motif_MFileDialogPeer_pDispose;
-		#Java_sun_awt_motif_MFileDialogPeer_pHide;
-		#Java_sun_awt_motif_MFileDialogPeer_pReshape;
-		#Java_sun_awt_motif_MFileDialogPeer_pShow;
-		#Java_sun_awt_motif_MFileDialogPeer_setFileEntry;
-		#Java_sun_awt_motif_MFileDialogPeer_setFont;
-		#Java_sun_awt_motif_MFramePeer_pGetIconSize;
-		#Java_sun_awt_motif_MGlobalCursorManager_cacheInit;
-		#Java_sun_awt_motif_MGlobalCursorManager_findComponentAt;
-		#Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor;
-		#Java_sun_awt_motif_MGlobalCursorManager_getCursorPos;
-		#Java_sun_awt_motif_MGlobalCursorManager_getLocationOnScreen;
-		#Java_sun_awt_motif_MLabelPeer_create;
-		#Java_sun_awt_motif_MLabelPeer_setAlignment;
-		#Java_sun_awt_motif_MLabelPeer_setText;
-		#Java_sun_awt_motif_MListPeer_addItem;
-		#Java_sun_awt_motif_MListPeer_create;
-		#Java_sun_awt_motif_MListPeer_delItems;
-		#Java_sun_awt_motif_MListPeer_deselect;
-		#Java_sun_awt_motif_MListPeer_isSelected;
-		#Java_sun_awt_motif_MListPeer_makeVisible;
-		#Java_sun_awt_motif_MListPeer_nativeHandleMouseWheel;
-		#Java_sun_awt_motif_MListPeer_select;
-		#Java_sun_awt_motif_MListPeer_setMultipleSelections;
-		#Java_sun_awt_motif_MMenuBarPeer_create;
-		#Java_sun_awt_motif_MMenuItemPeer_createMenuItem;
-		#Java_sun_awt_motif_MMenuItemPeer_pDisable;
-		#Java_sun_awt_motif_MMenuItemPeer_pDispose;
-		#Java_sun_awt_motif_MMenuItemPeer_pEnable;
-		#Java_sun_awt_motif_MMenuItemPeer_pSetLabel;
-		#Java_sun_awt_motif_MMenuPeer_createMenu;
-		#Java_sun_awt_motif_MMenuPeer_createSubMenu;
-		#Java_sun_awt_motif_MMenuPeer_pDispose;
-		#Java_sun_awt_motif_MPopupMenuPeer_createMenu;
-		#Java_sun_awt_motif_MPopupMenuPeer_pDispose;
-		#Java_sun_awt_motif_MPopupMenuPeer_pShow;
-		#Java_sun_awt_motif_MRobotPeer_getRGBPixelsImpl;
-		#Java_sun_awt_motif_MRobotPeer_keyPressImpl;
-		#Java_sun_awt_motif_MRobotPeer_keyReleaseImpl;
-		#Java_sun_awt_motif_MRobotPeer_mouseMoveImpl;
-		#Java_sun_awt_motif_MRobotPeer_mousePressImpl;
-		#Java_sun_awt_motif_MRobotPeer_mouseReleaseImpl;
-		#Java_sun_awt_motif_MRobotPeer_mouseWheelImpl;
-		#Java_sun_awt_motif_MRobotPeer_setup;
-		#Java_sun_awt_motif_MScrollbarPeer_create;
-		#Java_sun_awt_motif_MScrollbarPeer_setLineIncrement;
-		#Java_sun_awt_motif_MScrollbarPeer_setPageIncrement;
-		#Java_sun_awt_motif_MScrollbarPeer_pSetValues;
-		#Java_sun_awt_motif_MScrollPanePeer_create;
-		#Java_sun_awt_motif_MScrollPanePeer_pGetBlockIncrement;
-		#Java_sun_awt_motif_MScrollPanePeer_pGetScrollbarSpace;
-		#Java_sun_awt_motif_MScrollPanePeer_pGetShadow;
-		#Java_sun_awt_motif_MScrollPanePeer_pInsets;
-		#Java_sun_awt_motif_MScrollPanePeer_pSetIncrement;
-		#Java_sun_awt_motif_MScrollPanePeer_pSetScrollChild;
-		#Java_sun_awt_motif_MScrollPanePeer_setScrollPosition;
-		#Java_sun_awt_motif_MScrollPanePeer_setTypedValue;
-		#Java_sun_awt_motif_MTextAreaPeer_initIDs;
-		#Java_sun_awt_motif_MTextAreaPeer_pCreate;
-		#Java_sun_awt_motif_MTextAreaPeer_getCaretPosition;
-		#Java_sun_awt_motif_MTextAreaPeer_getExtraHeight;
-		#Java_sun_awt_motif_MTextAreaPeer_getExtraWidth;
-		#Java_sun_awt_motif_MTextAreaPeer_getSelectionEnd;
-		#Java_sun_awt_motif_MTextAreaPeer_getSelectionStart;
-		#Java_sun_awt_motif_MTextAreaPeer_getText;
-		#Java_sun_awt_motif_MTextAreaPeer_insert;
-		#Java_sun_awt_motif_MTextAreaPeer_nativeHandleMouseWheel;
-		#Java_sun_awt_motif_MTextAreaPeer_pMakeCursorVisible;
-		#Java_sun_awt_motif_MTextAreaPeer_pSetEditable;
-		#Java_sun_awt_motif_MTextAreaPeer_pShow2;
-		#Java_sun_awt_motif_MTextAreaPeer_replaceRange;
-		#Java_sun_awt_motif_MTextAreaPeer_select;
-                #Java_sun_awt_motif_MTextAreaPeer_setCaretPosition;
-		#Java_sun_awt_motif_MTextAreaPeer_setFont;
-		#Java_sun_awt_motif_MTextAreaPeer_setText;
-		#Java_sun_awt_motif_MTextAreaPeer_setTextBackground;
-		#Java_sun_awt_motif_MTextFieldPeer_initIDs;
-		#Java_sun_awt_motif_MTextFieldPeer_pCreate;
-		#Java_sun_awt_motif_MTextFieldPeer_getCaretPosition;
-		#Java_sun_awt_motif_MTextFieldPeer_getSelectionEnd;
-		#Java_sun_awt_motif_MTextFieldPeer_getSelectionStart;
-		#Java_sun_awt_motif_MTextFieldPeer_getText;
-		#Java_sun_awt_motif_MTextFieldPeer_insertReplaceText;
-		#Java_sun_awt_motif_MTextFieldPeer_preDispose;
-		#Java_sun_awt_motif_MTextFieldPeer_pSetEditable;
-		#Java_sun_awt_motif_MTextFieldPeer_select;
-		#Java_sun_awt_motif_MTextFieldPeer_setCaretPosition;
-		#Java_sun_awt_motif_MTextFieldPeer_setEchoChar;
-		#Java_sun_awt_motif_MTextFieldPeer_setFont;
-		#Java_sun_awt_motif_MTextFieldPeer_setText;
-		Java_sun_awt_motif_MToolkit_beep;
-		Java_sun_awt_motif_MToolkit_getLockingKeyStateNative;
-		Java_sun_awt_motif_MToolkit_getMulticlickTime;
-		Java_sun_awt_motif_MToolkit_getNumMouseButtons;
-		Java_sun_awt_motif_MToolkit_loadXSettings;
-		Java_sun_awt_motif_MToolkit_getScreenHeight;
-		Java_sun_awt_motif_MToolkit_getScreenResolution;
-		Java_sun_awt_motif_MToolkit_getScreenWidth;
-		Java_sun_awt_motif_MToolkit_init;
-		Java_sun_awt_motif_MToolkit_isDynamicLayoutSupportedNative;
-		Java_sun_awt_motif_MToolkit_isFrameStateSupported;
-		Java_sun_awt_motif_MToolkit_loadSystemColors;
-		Java_sun_awt_motif_MToolkit_makeColorModel;
-		Java_sun_awt_motif_MToolkit_run;
-                Java_sun_awt_motif_MToolkit_isAlwaysOnTopSupported;
-                Java_sun_awt_motif_MToolkit_getEventNumber;
-                Java_sun_awt_motif_MToolkit_updateSyncSelection;
-                Java_sun_awt_motif_MToolkit_isSyncUpdated;
-                Java_sun_awt_motif_MToolkit_isSyncFailed;
-                Java_sun_awt_motif_MToolkit_nativeUnGrab;
-                Java_sun_awt_motif_MToolkit_nativeGrab;
-                Java_sun_awt_motif_MToolkit_getWMName;
-		Java_sun_awt_motif_MWindowAttributes_initIDs;
-		#Java_sun_awt_motif_MWindowPeer_pDispose;
-		#Java_sun_awt_motif_MWindowPeer_pHide;
-		#Java_sun_awt_motif_MWindowPeer_pReshape;
-		#Java_sun_awt_motif_MWindowPeer_pSetTitle;
-		#Java_sun_awt_motif_MWindowPeer_pShow;
-		#Java_sun_awt_motif_MWindowPeer_setResizable;
-		#Java_sun_awt_motif_MWindowPeer_toBack;
-		#Java_sun_awt_motif_MWindowPeer_addTextComponentNative;
-		#Java_sun_awt_motif_MWindowPeer_getState;
-		#Java_sun_awt_motif_MWindowPeer_pSetIMMOption;
-		#Java_sun_awt_motif_MWindowPeer_pSetMenuBar;
-		#Java_sun_awt_motif_MWindowPeer_pShowModal;
-		#Java_sun_awt_motif_MWindowPeer_removeTextComponentNative;
-		#Java_sun_awt_motif_MWindowPeer_setSaveUnder;
-		#Java_sun_awt_motif_MWindowPeer_setState;
-		#Java_sun_awt_motif_MWindowPeer_resetTargetGC;
-		#Java_sun_awt_motif_MWindowPeer_registerX11DropTarget;
-		#Java_sun_awt_motif_MWindowPeer_unregisterX11DropTarget;
-		#Java_sun_awt_motif_MWindowPeer_updateAlwaysOnTop;
-                #Java_sun_awt_motif_MWindowPeer_setFocusableWindow;
-                #Java_sun_awt_motif_MWindowPeer_pToFront;
-		#Java_sun_awt_motif_MCustomCursor_cacheInit;
-		#Java_sun_awt_motif_MCustomCursor_createCursor;
-		#Java_sun_awt_motif_MCustomCursor_queryBestCursor;
-		Java_sun_awt_motif_X11FontMetrics_bytesWidth;
-		Java_sun_awt_motif_X11FontMetrics_getMFCharsWidth;
-		Java_sun_awt_motif_X11FontMetrics_init;
 		Java_sun_awt_X11InputMethod_disposeXIC;
 		Java_sun_awt_X11InputMethod_isCompositionEnabledNative;
 		Java_sun_awt_X11InputMethod_resetXIC;
 		Java_sun_awt_X11InputMethod_setCompositionEnabledNative;
 		Java_sun_awt_X11InputMethod_turnoffStatusWindow;
-		#Java_sun_awt_motif_MInputMethod_openXIMNative;
-		#Java_sun_awt_motif_MInputMethod_configureStatusAreaNative;
-		#Java_sun_awt_motif_MInputMethod_createXICNative;
-		#Java_sun_awt_motif_MInputMethod_reconfigureXICNative;
-		#Java_sun_awt_motif_MInputMethod_setXICFocusNative;
-		#Java_sun_awt_motif_X11Clipboard_getClipboardData;
-		#Java_sun_awt_motif_X11Clipboard_getClipboardFormats;
-		#Java_sun_awt_motif_X11Clipboard_registerClipboardViewer;
-		#Java_sun_awt_motif_X11Clipboard_unregisterClipboardViewer;
-		#Java_sun_awt_motif_X11Selection_init;
-		#Java_sun_awt_motif_X11Selection_pGetSelectionOwnership;
-		#Java_sun_awt_motif_X11Selection_clearNativeContext;
 		Java_sun_awt_SunToolkit_closeSplashScreen;
 		Java_sun_awt_PlatformFont_initIDs;
 		Java_sun_awt_X11GraphicsConfig_init;
@@ -313,25 +93,6 @@
 		Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama;
 		Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint;
 		Java_sun_awt_X11GraphicsEnvironment_initXRender;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_initXEmbedServer;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_destroyXEmbedServer;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_isXEmbedActive;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_initDispatching;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_endDispatching;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_embedChild;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_childDestroyed;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedPreferredSize;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedMinimumSize;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_getClientBounds;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_notifyChildEmbedded;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_detachChild;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_forwardKeyEvent;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_getAWTKeyCodeForKeySym;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__I;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__IJJJ;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_getWindow;       
-                #Java_sun_awt_motif_GrabbedKey_initKeySymAndModifiers;
-                #Java_sun_awt_motif_MEmbeddedFramePeer_traverseOut;
 		Java_java_awt_AWTEvent_initIDs;
 		Java_java_awt_Button_initIDs;
 		Java_java_awt_Container_initIDs;
@@ -345,41 +106,6 @@
 		Java_java_awt_Insets_initIDs;
 		Java_java_awt_TextField_initIDs;
 		Java_java_awt_Window_initIDs;
-		#Java_sun_awt_motif_MCheckboxPeer_getIndicatorSize;
-		#Java_sun_awt_motif_MCheckboxPeer_getSpacing;
-		#Java_sun_awt_motif_MChoicePeer_freeNativeData;
-		#Java_sun_awt_motif_MComponentPeer_getComponents_1NoClientCode;
-		#Java_sun_awt_motif_MComponentPeer_getParent_1NoClientCode;
-		#Java_sun_awt_motif_MComponentPeer_initIDs;
-		#Java_sun_awt_motif_MComponentPeer_nativeHandleEvent;
-		#Java_sun_awt_motif_MComponentPeer_pSetCursor;
-		#Java_sun_awt_motif_MComponentPeer_pSetInnerForeground;
-		#Java_sun_awt_motif_MComponentPeer_pSetScrollbarBackground;
-		#Java_sun_awt_motif_MComponentPeer_setTargetBackground;
-		#Java_sun_awt_motif_MDataTransferer_dragQueryFile;
-		#Java_sun_awt_motif_MDataTransferer_getAtomForTarget;
-		#Java_sun_awt_motif_MDataTransferer_getTargetNameForAtom;
-		#Java_sun_awt_motif_MFileDialogPeer_insertReplaceFileDialogText;
-		Java_sun_awt_motif_MFontPeer_initIDs;
-		#Java_sun_awt_motif_MListPeer_setBackground;
-		#Java_sun_awt_motif_MMenuBarPeer_initIDs;
-		#Java_sun_awt_motif_MMenuBarPeer_pDispose;
-		#Java_sun_awt_motif_MMenuItemPeer_getParent_1NoClientCode;
-		#Java_sun_awt_motif_MMenuItemPeer_initIDs;
-		#Java_sun_awt_motif_MMenuItemPeer_pSetShortcut;
-		#Java_sun_awt_motif_MPopupMenuPeer_initIDs;
-		#Java_sun_awt_motif_MScrollbarPeer_initIDs;
-		#Java_sun_awt_motif_MScrollPanePeer_initIDs;
-		#Java_sun_awt_motif_MTextAreaPeer_pSetCursor;
-		Java_sun_awt_motif_MToolkit_shutdown;
-		#Java_sun_awt_motif_MWindowPeer_initIDs;
-		#Java_sun_awt_motif_MWindowPeer_pCreate;
-		#Java_sun_awt_motif_MWindowPeer_wrapInSequenced;
-		Java_sun_awt_motif_X11FontMetrics_initIDs;
-		#Java_sun_awt_X11InputMethod_initIDs;
-		#Java_sun_awt_motif_X11Selection_initIDs;
-		Java_sun_awt_motif_MToolkitThreadBlockedHandler_enter;
-		Java_sun_awt_motif_MToolkitThreadBlockedHandler_exit;
 		Java_sun_awt_X11GraphicsConfig_init;
 		Java_sun_awt_X11GraphicsConfig_initIDs;
 		Java_sun_awt_X11GraphicsConfig_makeColorModel;
--- a/make/sun/awt/mapfile-vers-linux	Tue Dec 13 15:41:47 2011 -0800
+++ b/make/sun/awt/mapfile-vers-linux	Thu Dec 15 19:52:13 2011 -0800
@@ -170,7 +170,6 @@
 		GrPrim_Sg2dGetPixel;
 		GrPrim_Sg2dGetLCDTextContrast;
 
-		#Java_sun_awt_motif_MComponentPeer_restoreFocus;
 		Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords;
 		Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse;
 		Java_java_awt_AWTEvent_nativeSetSource;
@@ -189,216 +188,11 @@
 		Java_java_awt_ScrollPane_initIDs;
 		Java_java_awt_TextArea_initIDs;
 		Java_sun_awt_FontDescriptor_initIDs;
-		#Java_sun_awt_motif_MButtonPeer_create;
-		#Java_sun_awt_motif_MButtonPeer_setLabel;
-		#Java_sun_awt_motif_MCanvasPeer_create;
-		#Java_sun_awt_motif_MCanvasPeer_initIDs;
-		#Java_sun_awt_motif_MCanvasPeer_resetTargetGC;
-		#Java_sun_awt_motif_MCheckboxMenuItemPeer_pSetState;
-		#Java_sun_awt_motif_MCheckboxPeer_create;
-		#Java_sun_awt_motif_MCheckboxPeer_setCheckboxGroup;
-		#Java_sun_awt_motif_MCheckboxPeer_setLabel;
-		#Java_sun_awt_motif_MCheckboxPeer_pSetState;
-		#Java_sun_awt_motif_MCheckboxPeer_pGetState;
-		#Java_sun_awt_motif_MChoicePeer_addItem;
-		#Java_sun_awt_motif_MChoicePeer_appendItems;
-		#Java_sun_awt_motif_MChoicePeer_create;
-		#Java_sun_awt_motif_MChoicePeer_pReshape;
-		#Java_sun_awt_motif_MChoicePeer_remove;
-		#Java_sun_awt_motif_MChoicePeer_removeAll;
-		#Java_sun_awt_motif_MChoicePeer_setBackground;
-		#Java_sun_awt_motif_MChoicePeer_pSelect;
-		#Java_sun_awt_motif_MChoicePeer_setFont;
-		#Java_sun_awt_motif_MChoicePeer_setForeground;
-		#Java_sun_awt_motif_MComponentPeer_addNativeDropTarget;
-		#Java_sun_awt_motif_MComponentPeer_createBackBuffer;
-		#Java_sun_awt_motif_MComponentPeer_destroyBackBuffer;
-		#Java_sun_awt_motif_MComponentPeer_getNativeColor;
-		#Java_sun_awt_motif_MComponentPeer_getWindow;
-		#Java_sun_awt_motif_MComponentPeer_pDisable;
-		#Java_sun_awt_motif_MComponentPeer_pDispose;
-		#Java_sun_awt_motif_MComponentPeer_pEnable;
-		#Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen;
-		#Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen2;
-		#Java_sun_awt_motif_MComponentPeer_pHide;
-		#Java_sun_awt_motif_MComponentPeer_pInitialize;
-		#Java_sun_awt_motif_MComponentPeer_pMakeCursorVisible;
-		#Java_sun_awt_motif_MComponentPeer_pReshape;
-		#Java_sun_awt_motif_MComponentPeer_pShow;
-		#Java_sun_awt_motif_MComponentPeer_removeNativeDropTarget;
-		#Java_sun_awt_motif_MComponentPeer_swapBuffers;
-		#Java_sun_awt_motif_MComponentPeer_pSetBackground;
-		#Java_sun_awt_motif_MComponentPeer_pSetFont;
-                #Java_sun_awt_motif_MComponentPeer_processSynchronousLightweightTransfer;
-                #Java_sun_awt_motif_MComponentPeer__1requestFocus;
-		#Java_sun_awt_motif_MCheckboxMenuItemPeer_getState;
-		#Java_sun_awt_motif_MComponentPeer_pSetForeground;
-		#Java_sun_awt_motif_MDragSourceContextPeer_startDrag;
-		#Java_sun_awt_motif_MDragSourceContextPeer_setNativeCursor;
-		#Java_sun_awt_motif_MDropTargetContextPeer_addTransfer;
-		#Java_sun_awt_motif_MDropTargetContextPeer_dropDone;
-		#Java_sun_awt_motif_MDropTargetContextPeer_startTransfer;
-		#Java_sun_awt_motif_X11DragSourceContextPeer_startDrag;
-		#Java_sun_awt_motif_X11DragSourceContextPeer_setNativeCursor;
-		#Java_sun_awt_motif_X11DropTargetContextPeer_sendResponse;
-		#Java_sun_awt_motif_X11DropTargetContextPeer_dropDone;
-		#Java_sun_awt_motif_X11DropTargetContextPeer_getData;
-		#Java_sun_awt_motif_MEmbeddedFramePeer_NEFcreate;
-		#Java_sun_awt_motif_MEmbeddedFramePeer_pShowImpl;
-		#Java_sun_awt_motif_MEmbeddedFramePeer_pReshapePrivate;
-		#Java_sun_awt_motif_MEmbeddedFramePeer_getBoundsPrivate;
-		#Java_sun_awt_motif_MFramePeer_pSetIconImage___3B_3I_3SII;
-		#Java_sun_awt_motif_MEmbeddedFramePeer_requestXEmbedFocus;
-		#Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedApplicationActive;
-		#Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedActive;
-		#Java_sun_awt_motif_MEmbeddedFrame_getWidget;
-		#Java_sun_awt_motif_MEmbeddedFrame_mapWidget;
-		#Java_sun_awt_motif_MFileDialogPeer_create;
-		#Java_sun_awt_motif_MFileDialogPeer_pDispose;
-		#Java_sun_awt_motif_MFileDialogPeer_pHide;
-		#Java_sun_awt_motif_MFileDialogPeer_pReshape;
-		#Java_sun_awt_motif_MFileDialogPeer_pShow;
-		#Java_sun_awt_motif_MFileDialogPeer_setFileEntry;
-		#Java_sun_awt_motif_MFileDialogPeer_setFont;
-		#Java_sun_awt_motif_MFramePeer_pGetIconSize;
-		#Java_sun_awt_motif_MGlobalCursorManager_cacheInit;
-		#Java_sun_awt_motif_MGlobalCursorManager_findComponentAt;
-		#Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor;
-		#Java_sun_awt_motif_MGlobalCursorManager_getCursorPos;
-		#Java_sun_awt_motif_MGlobalCursorManager_getLocationOnScreen;
-		#Java_sun_awt_motif_MLabelPeer_create;
-		#Java_sun_awt_motif_MLabelPeer_setAlignment;
-		#Java_sun_awt_motif_MLabelPeer_setText;
-		#Java_sun_awt_motif_MListPeer_addItem;
-		#Java_sun_awt_motif_MListPeer_create;
-		#Java_sun_awt_motif_MListPeer_delItems;
-		#Java_sun_awt_motif_MListPeer_deselect;
-		#Java_sun_awt_motif_MListPeer_isSelected;
-		#Java_sun_awt_motif_MListPeer_makeVisible;
-		#Java_sun_awt_motif_MListPeer_select;
-		#Java_sun_awt_motif_MListPeer_setMultipleSelections;
-		#Java_sun_awt_motif_MMenuBarPeer_create;
-		#Java_sun_awt_motif_MMenuItemPeer_createMenuItem;
-		#Java_sun_awt_motif_MMenuItemPeer_pDisable;
-		#Java_sun_awt_motif_MMenuItemPeer_pDispose;
-		#Java_sun_awt_motif_MMenuItemPeer_pEnable;
-		#Java_sun_awt_motif_MMenuItemPeer_pSetLabel;
-		#Java_sun_awt_motif_MMenuPeer_createMenu;
-		#Java_sun_awt_motif_MMenuPeer_createSubMenu;
-		#Java_sun_awt_motif_MMenuPeer_pDispose;
-		#Java_sun_awt_motif_MPopupMenuPeer_createMenu;
-		#Java_sun_awt_motif_MPopupMenuPeer_pDispose;
-		#Java_sun_awt_motif_MPopupMenuPeer_pShow;
-		#Java_sun_awt_motif_MRobotPeer_getRGBPixelsImpl;
-		#Java_sun_awt_motif_MRobotPeer_keyPressImpl;
-		#Java_sun_awt_motif_MRobotPeer_keyReleaseImpl;
-		#Java_sun_awt_motif_MRobotPeer_mouseMoveImpl;
-		#Java_sun_awt_motif_MRobotPeer_mousePressImpl;
-		#Java_sun_awt_motif_MRobotPeer_mouseReleaseImpl;
-		#Java_sun_awt_motif_MRobotPeer_mouseWheelImpl;
-		#Java_sun_awt_motif_MRobotPeer_setup;
-		#Java_sun_awt_motif_MScrollbarPeer_create;
-		#Java_sun_awt_motif_MScrollbarPeer_setLineIncrement;
-		#Java_sun_awt_motif_MScrollbarPeer_setPageIncrement;
-		#Java_sun_awt_motif_MScrollbarPeer_pSetValues;
-		#Java_sun_awt_motif_MScrollPanePeer_create;
-		#Java_sun_awt_motif_MScrollPanePeer_pGetBlockIncrement;
-		#Java_sun_awt_motif_MScrollPanePeer_pGetScrollbarSpace;
-		#Java_sun_awt_motif_MScrollPanePeer_pGetShadow;
-		#Java_sun_awt_motif_MScrollPanePeer_pInsets;
-		#Java_sun_awt_motif_MScrollPanePeer_pSetIncrement;
-		#Java_sun_awt_motif_MScrollPanePeer_pSetScrollChild;
-		#Java_sun_awt_motif_MScrollPanePeer_setScrollPosition;
-		#Java_sun_awt_motif_MTextAreaPeer_initIDs;
-		#Java_sun_awt_motif_MTextAreaPeer_pCreate;
-		#Java_sun_awt_motif_MTextAreaPeer_getCaretPosition;
-		#Java_sun_awt_motif_MTextAreaPeer_getExtraHeight;
-		#Java_sun_awt_motif_MTextAreaPeer_getExtraWidth;
-		#Java_sun_awt_motif_MTextAreaPeer_getSelectionEnd;
-		#Java_sun_awt_motif_MTextAreaPeer_getSelectionStart;
-		#Java_sun_awt_motif_MTextAreaPeer_getText;
-		#Java_sun_awt_motif_MTextAreaPeer_insert;
-		#Java_sun_awt_motif_MTextAreaPeer_pMakeCursorVisible;
-		#Java_sun_awt_motif_MTextAreaPeer_pSetEditable;
-		#Java_sun_awt_motif_MTextAreaPeer_pShow2;
-		#Java_sun_awt_motif_MTextAreaPeer_replaceRange;
-		#Java_sun_awt_motif_MTextAreaPeer_select;
-		#Java_sun_awt_motif_MTextAreaPeer_setCaretPosition;
-		#Java_sun_awt_motif_MTextAreaPeer_setFont;
-		#Java_sun_awt_motif_MTextAreaPeer_setText;
-		#Java_sun_awt_motif_MTextAreaPeer_setTextBackground;
-		#Java_sun_awt_motif_MTextFieldPeer_initIDs;
-		#Java_sun_awt_motif_MTextFieldPeer_pCreate;
-		#Java_sun_awt_motif_MTextFieldPeer_getCaretPosition;
-		#Java_sun_awt_motif_MTextFieldPeer_getSelectionEnd;
-		#Java_sun_awt_motif_MTextFieldPeer_getSelectionStart;
-		#Java_sun_awt_motif_MTextFieldPeer_getText;
-		#Java_sun_awt_motif_MTextFieldPeer_insertReplaceText;
-		#Java_sun_awt_motif_MTextFieldPeer_preDispose;
-		#Java_sun_awt_motif_MTextFieldPeer_pSetEditable;
-		#Java_sun_awt_motif_MTextFieldPeer_select;
-		#Java_sun_awt_motif_MTextFieldPeer_setCaretPosition;
-		#Java_sun_awt_motif_MTextFieldPeer_setEchoChar;
-		#Java_sun_awt_motif_MTextFieldPeer_setFont;
-		#Java_sun_awt_motif_MTextFieldPeer_setText;
-		Java_sun_awt_motif_MToolkit_beep;
-		Java_sun_awt_motif_MToolkit_getLockingKeyStateNative;
-		Java_sun_awt_motif_MToolkit_getMulticlickTime;
-                Java_sun_awt_motif_MToolkit_getNumMouseButtons;
-		Java_sun_awt_motif_MToolkit_getScreenHeight;
-		Java_sun_awt_motif_MToolkit_getScreenResolution;
-		Java_sun_awt_motif_MToolkit_getScreenWidth;
-		Java_sun_awt_motif_MToolkit_init;
-		Java_sun_awt_motif_MToolkit_isDynamicLayoutSupportedNative;
-		Java_sun_awt_motif_MToolkit_isFrameStateSupported;
-		Java_sun_awt_motif_MToolkit_loadSystemColors;
-		Java_sun_awt_motif_MToolkit_makeColorModel;
-		Java_sun_awt_motif_MToolkit_run;
-		Java_sun_awt_motif_MToolkit_sync;
-                Java_sun_awt_motif_MToolkit_isAlwaysOnTopSupported;
-		Java_sun_awt_motif_MWindowAttributes_initIDs;
-		#Java_sun_awt_motif_MWindowPeer_pDispose;
-		#Java_sun_awt_motif_MWindowPeer_pHide;
-		#Java_sun_awt_motif_MWindowPeer_pReshape;
-		#Java_sun_awt_motif_MWindowPeer_pSetTitle;
-		#Java_sun_awt_motif_MWindowPeer_pShow;
-		#Java_sun_awt_motif_MWindowPeer_setResizable;
-		#Java_sun_awt_motif_MWindowPeer_toBack;
-		#Java_sun_awt_motif_MWindowPeer_addTextComponentNative;
-		#Java_sun_awt_motif_MWindowPeer_getState;
-		#Java_sun_awt_motif_MWindowPeer_pSetIMMOption;
-		#Java_sun_awt_motif_MWindowPeer_pSetMenuBar;
-		#Java_sun_awt_motif_MWindowPeer_pShowModal;
-		#Java_sun_awt_motif_MWindowPeer_removeTextComponentNative;
-		#Java_sun_awt_motif_MWindowPeer_setSaveUnder;
-		#Java_sun_awt_motif_MWindowPeer_setState;
-		#Java_sun_awt_motif_MWindowPeer_resetTargetGC;
-		#Java_sun_awt_motif_MWindowPeer_registerX11DropTarget;
-		#Java_sun_awt_motif_MWindowPeer_unregisterX11DropTarget;
-                #Java_sun_awt_motif_MWindowPeer_updateAlwaysOnTop;
-		#Java_sun_awt_motif_X11CustomCursor_cacheInit;
-		#Java_sun_awt_motif_X11CustomCursor_createCursor;
-		#Java_sun_awt_motif_X11CustomCursor_queryBestCursor;
-		Java_sun_awt_motif_X11FontMetrics_bytesWidth;
-		Java_sun_awt_motif_X11FontMetrics_getMFCharsWidth;
-		Java_sun_awt_motif_X11FontMetrics_init;
 		Java_sun_awt_X11InputMethod_disposeXIC;
 		Java_sun_awt_X11InputMethod_isCompositionEnabledNative;
 		Java_sun_awt_X11InputMethod_resetXIC;
 		Java_sun_awt_X11InputMethod_setCompositionEnabledNative;
 		Java_sun_awt_X11InputMethod_turnoffStatusWindow;
-		#Java_sun_awt_motif_MInputMethod_openXIMNative;
-		#Java_sun_awt_motif_MInputMethod_configureStatusAreaNative;
-		#Java_sun_awt_motif_MInputMethod_createXICNative;
-		#Java_sun_awt_motif_MInputMethod_reconfigureXICNative;
-		#Java_sun_awt_motif_MInputMethod_setXICFocusNative;
-		#Java_sun_awt_motif_X11Clipboard_getClipboardData;
-		#Java_sun_awt_motif_X11Clipboard_getClipboardFormats;
-		#Java_sun_awt_motif_X11Clipboard_registerClipboardViewer;
-		#Java_sun_awt_motif_X11Clipboard_unregisterClipboardViewer;
-		#Java_sun_awt_motif_X11Selection_init;
-		#Java_sun_awt_motif_X11Selection_pGetSelectionOwnership;
-		#Java_sun_awt_motif_X11Selection_clearNativeContext;
 		Java_sun_awt_SunToolkit_closeSplashScreen;
 		Java_sun_awt_PlatformFont_initIDs;
 		Java_sun_awt_X11GraphicsConfig_init;
@@ -444,42 +238,7 @@
 		Java_java_awt_Insets_initIDs;
 		Java_java_awt_TextField_initIDs;
 		Java_java_awt_Window_initIDs;
-		#Java_sun_awt_motif_MCheckboxPeer_getIndicatorSize;
-		#Java_sun_awt_motif_MCheckboxPeer_getSpacing;
-		#Java_sun_awt_motif_MChoicePeer_freeNativeData;
-		#Java_sun_awt_motif_MComponentPeer_getComponents_1NoClientCode;
-		#Java_sun_awt_motif_MComponentPeer_getParent_1NoClientCode;
-		#Java_sun_awt_motif_MComponentPeer_initIDs;
-		#Java_sun_awt_motif_MComponentPeer_nativeHandleEvent;
-		#Java_sun_awt_motif_MComponentPeer_pSetCursor;
-		#Java_sun_awt_motif_MComponentPeer_pSetInnerForeground;
-		#Java_sun_awt_motif_MComponentPeer_pSetScrollbarBackground;
-		#Java_sun_awt_motif_MComponentPeer_setTargetBackground;
-		#Java_sun_awt_motif_MDataTransferer_dragQueryFile;
-		#Java_sun_awt_motif_MDataTransferer_getAtomForTarget;
-		#Java_sun_awt_motif_MDataTransferer_getTargetNameForAtom;
-		#Java_sun_awt_motif_MFileDialogPeer_insertReplaceFileDialogText;
-		Java_sun_awt_motif_MFontPeer_initIDs;
-		#Java_sun_awt_motif_MListPeer_setBackground;
-		#Java_sun_awt_motif_MMenuBarPeer_initIDs;
-		#Java_sun_awt_motif_MMenuBarPeer_pDispose;
-		#Java_sun_awt_motif_MMenuItemPeer_getParent_1NoClientCode;
-		#Java_sun_awt_motif_MMenuItemPeer_initIDs;
-		#Java_sun_awt_motif_MMenuItemPeer_pSetShortcut;
-		#Java_sun_awt_motif_MPopupMenuPeer_initIDs;
-		#Java_sun_awt_motif_MScrollbarPeer_initIDs;
-		#Java_sun_awt_motif_MScrollPanePeer_initIDs;
-		#Java_sun_awt_motif_MTextAreaPeer_pSetCursor;
-		Java_sun_awt_motif_MToolkit_shutdown;
-		#Java_sun_awt_motif_MWindowPeer_initIDs;
-		#Java_sun_awt_motif_MWindowPeer_pCreate;
-		#Java_sun_awt_motif_MWindowPeer_wrapInSequenced;
-		Java_sun_awt_motif_X11FontMetrics_initIDs;
-		#Java_sun_awt_X11InputMethod_initIDs;
 		Java_sun_awt_motif_X11OffScreenImage_updateBitmask;
-		#Java_sun_awt_motif_X11Selection_initIDs;
-		Java_sun_awt_motif_MToolkitThreadBlockedHandler_enter;
-		Java_sun_awt_motif_MToolkitThreadBlockedHandler_exit;
 		Java_sun_awt_X11GraphicsConfig_init;
 		Java_sun_awt_X11GraphicsConfig_initIDs;
 		Java_sun_awt_X11GraphicsConfig_makeColorModel;
@@ -505,26 +264,6 @@
 		Java_sun_awt_X11SurfaceData_isDgaAvailable;
 		Java_sun_awt_X11SurfaceData_setInvalid;
 		Java_sun_awt_X11SurfaceData_flushNativeSurface;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_initXEmbedServer;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_destroyXEmbedServer;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_isXEmbedActive;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_initDispatching;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_endDispatching;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_embedChild;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_childDestroyed;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedPreferredSize;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedMinimumSize;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_getClientBounds;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_notifyChildEmbedded;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_detachChild;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_forwardKeyEvent;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_getAWTKeyCodeForKeySym;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__I;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__IJJJ;
-                #Java_sun_awt_motif_MEmbedCanvasPeer_getWindow;       
-                #Java_sun_awt_motif_MEmbedCanvasPeer_forwardEventToEmbedded;       
-                #Java_sun_awt_motif_GrabbedKey_initKeySymAndModifiers;
-                #Java_sun_awt_motif_MEmbeddedFramePeer_traverseOut;
 		awt_display;
 		awt_lock;
 		awt_Lock;
--- a/make/sun/awt/mawt.gmk	Tue Dec 13 15:41:47 2011 -0800
+++ b/make/sun/awt/mawt.gmk	Thu Dec 15 19:52:13 2011 -0800
@@ -41,13 +41,7 @@
 # Check which C files should be built.  Headless uses only
 # non-motif files.  Also, a version-specific motif file is
 # compiled based on the motif version.
-ifdef HEADLESS
-  FILES_c = $(FILES_NO_MOTIF_c)
-else
-#  FILES_c = $(FILES_MOTIF_c) $(FILES_NO_MOTIF_c)
-#  XXX if in FILES_MOTIF_c there are unrelated to motif stuff, create a separate list!
-  FILES_c = $(FILES_NO_MOTIF_c)
-endif
+FILES_c = $(FILES_NO_MOTIF_c)
 
 ifeq ($(PLATFORM), solaris)
   ifneq ($(ARCH), amd64)
@@ -116,32 +110,6 @@
 CPPFLAGS += -DHEADLESS=$(HEADLESS)
 OTHER_LDLIBS =
 else
-#CFLAGS += -DMOTIF_VERSION=$(MOTIF_VERSION)
-
-#ifeq ($(STATIC_MOTIF),true)
-#    LIBXM = $(MOTIF_LIB)/libXm.a -lXp -lXmu
-#    ifeq ($(PLATFORM), linux)
-#	ifeq ($(ARCH_DATA_MODEL), 64)
-#            LIBXT = -lXt
-#        else
-#        # Allows for builds on Debian GNU Linux, X11 is in a different place 
-#	    LIBXT = $(firstword $(wildcard /usr/X11R6/lib/libXt.a) \
-#                            $(wildcard /usr/lib/libXt.a))
-#	    LIBSM = $(firstword $(wildcard /usr/X11R6/lib/libSM.a) \
-#                            $(wildcard /usr/lib/libSM.a))
-#	    LIBICE = $(firstword $(wildcard /usr/X11R6/lib/libICE.a) \
-#                             $(wildcard /usr/lib/libICE.a))
-#	endif
-#    endif
-#else
-#    LIBXM = -L$(MOTIF_LIB) -lXm -lXp
-#    ifeq ($(PLATFORM), linux)
-#	LIBXT = -lXt
-#	LIBSM = 
-#	LIBICE = 
-#    endif
-#endif
-
 LIBXTST = -lXtst
 ifeq ($(PLATFORM), linux)
    ifeq ($(ARCH_DATA_MODEL), 64)
--- a/make/sun/motif12/reorder-i586	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +0,0 @@
-data = R0x2000;
-text = LOAD ?RXO;
-# Test Null
-# Test Exit
-# Test Hello
-# Test Sleep
-# Test IntToString
-# Test LoadToolkit
-text: .text%JNI_OnLoad;
-text: .text%awt_util_debug_init;
-text: .text%Java_sun_awt_X11GraphicsEnvironment_initDisplay;
-text: .text%awt_init_Display;
-text: .text%makeDefaultConfig: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_GraphicsEnv.o;
-text: .text%awt_allocate_colors;
-text: .text%alloc_col: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11Color.o;
-text: .text%getVirtCubeSize;
-text: .text%uname: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11Color.o;
-text: .text%Java_sun_awt_font_NativeFontWrapper_getFontPath;
-text: .text%getPlatformFontPathChars: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
-text: .text%getSolarisFontLocations: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
-text: .text%fstat: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
-text: .text%AppendFont: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
-text: .text%freePlatformFontPathChars: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
-text: .text%checkFont: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_Font.o;
-text: .text%Java_sun_awt_X11GraphicsEnvironment_getNativeFonts;
-text: .text%Java_sun_awt_font_NativeFontWrapper_setNativeFontPath;
-text: .text%isDisplayLocal;
-text: .text%Java_sun_awt_X11GraphicsEnvironment_checkShmExt;
-text: .text%TryInitMITShm: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_GraphicsEnv.o;
-text: .text%awt_output_flush;
-text: .text%awtJNI_TimeMillis: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%AddFontsToX11FontPath: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
-text: .text%Java_sun_awt_X11GraphicsEnvironment_getNumScreens;
-text: .text%Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum;
-text: .text%Java_sun_awt_X11GraphicsDevice_getConfigVisualId;
-text: .text%Java_sun_awt_X11GraphicsDevice_isDBESupported;
-text: .text%Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals;
-text: .text%Java_sun_awt_X11GraphicsConfig_initIDs;
-text: .text%Java_sun_awt_X11GraphicsConfig_init;
-text: .text%getAllConfigs: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_GraphicsEnv.o;
-text: .text%Java_sun_awt_motif_MToolkit_init;
-text: .text%getDefaultConfig;
-text: .text%getScreenData;
-text: .text%Java_sun_awt_PlatformFont_initIDs;
-text: .text%Java_sun_awt_motif_MFontPeer_initIDs;
-text: .text%awt_wm_init;
-text: .text%awt_wm_initAtoms: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_getRunningWM;
-text: .text%xerror_detect_wm: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_prepareIsIceWM: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isNetSupporting: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_checkAnchor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_getProperty32: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isWinSupporting: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isIceWM: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isEnlightenment: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_getECommsWindowIDProperty: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isSawfish: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isNetWMName: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isKDE2: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isCDE: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_color_match;
-text: .text%setup_modifier_map: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%set_mod_mask: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%awt_initialize_DataTransferer;
-text: .text%awt_initialize_Xm_DnD;
-text: .text%cacheDropDone: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_XmDnD.o;
-text: .text%awt_motif_enableSingleDragInitiator;
-text: .text%Java_java_awt_Cursor_initIDs;
-text: .text%Java_sun_awt_motif_X11CustomCursor_cacheInit;
-text: .text%Java_sun_awt_motif_MToolkit_run;
-text: .text%awtJNI_GetCurrentThread;
-text: .text%awt_MToolkit_loop: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%awt_pipe_init: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%awt_set_poll_timeout: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%awt_events_pending: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%processOneEvent: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%set_toolkit_busy;
-text: .text%waitForEvents;
-text: .text%performPoll: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%awt_get_poll_timeout: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%awtJNI_CleanupGlobalRefs;
-text: .text%Java_java_awt_AWTEvent_initIDs;
-text: .text%Java_sun_awt_SunToolkit_wakeupEventQueue;
-text: .text%Java_sun_awt_motif_MToolkit_shutdown;
-text: .text%X11SD_LibDispose;
-text: .text%LibDisposeStub: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-# Test LoadFrame
-text: .text%Java_java_awt_Component_initIDs;
-text: .text%Java_java_awt_Container_initIDs;
-text: .text%Java_java_awt_Window_initIDs;
-text: .text%Java_java_awt_Frame_initIDs;
-text: .text%Java_sun_awt_SunToolkit_getPrivateKey;
-text: .text%Java_java_awt_MenuComponent_initIDs;
-text: .text%Java_sun_awt_X11GraphicsConfig_pGetBounds;
-text: .text%Java_java_awt_Insets_initIDs;
-text: .text%Java_sun_awt_motif_MComponentPeer_initIDs;
-text: .text%Java_sun_awt_motif_MWindowPeer_initIDs;
-text: .text%Java_sun_awt_motif_MWindowAttributes_initIDs;
-text: .text%Java_sun_awt_motif_MWindowPeer_pCreate;
-text: .text%awtJNI_CreateAndSetGlobalRef;
-text: .text%copyGraphicsConfigToPeer;
-text: .text%awt_Frame_guessInsets;
-text: .text%awtJNI_ChangeInsets: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%getMotifFontList;
-text: .text%getMotifFontStruct;
-text: .text%setDeleteCallback: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%awt_canvas_create;
-text: .text%awt_util_show;
-text: .text%addTopLevel;
-text: .text%Java_sun_awt_motif_MWindowPeer_pHide;
-text: .text%Java_sun_awt_motif_MComponentPeer_pInitialize;
-text: .text%awt_addWidget;
-text: .text%Java_sun_awt_motif_MComponentPeer_pSetCursor;
-text: .text%getCursor;
-text: .text%awt_util_setCursor;
-text: .text%Java_sun_awt_motif_MComponentPeer_getParent_1NoClientCode;
-text: .text%Java_sun_awt_motif_MWindowPeer_pReshape;
-text: .text%reshape: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%awtJNI_setMbAndWwHeightAndOffsets: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%awt_wm_configureGravityBuggy;
-text: .text%Java_sun_awt_X11SurfaceData_initIDs;
-text: .text%Java_sun_awt_motif_MToolkit_loadSystemColors;
-text: .text%colorToRGB: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%awt_allocate_systemcolors;
-text: .text%Java_sun_awt_X11GraphicsConfig_makeColorModel;
-text: .text%awtJNI_GetColorModel;
-text: .text%Java_sun_awt_X11SurfaceData_initOps;
-text: .text%Java_sun_awt_motif_MWindowPeer_pSetTitle;
-text: .text%Java_sun_awt_motif_MWindowPeer_setResizable;
-text: .text%Java_java_awt_Font_initIDs;
-text: .text%Java_sun_awt_motif_MComponentPeer_pSetFont;
-text: .text%awt_util_mapChildren;
-text: .text%changeFont: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_Component.o;
-text: .text%Java_sun_awt_motif_MComponentPeer_pSetBackground;
-text: .text%getGraphicsConfigFromComponentPeer;
-text: .text%awtJNI_GetColorForVis;
-text: .text%ColorProc;
-text: .text%Java_sun_awt_motif_MComponentPeer_pSetForeground;
-text: .text%Java_sun_awt_motif_MWindowPeer_pShow;
-text: .text%Java_sun_awt_motif_MWindowPeer_pShowModal;
-text: .text%awt_wm_setExtendedState;
-text: .text%awt_wm_doStateProtocolNet: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_doStateProtocolWin: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_setShellDecor;
-text: .text%awt_wm_setMotifDecor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_setOLDecor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_normalizeMotifDecor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_removeSizeHints;
-text: .text%shellEH: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%awt_wm_isStateChange;
-text: .text%awt_wm_getWMState;
-text: .text%Java_sun_awt_motif_MGlobalCursorManager_cacheInit;
-text: .text%innerCanvasEH: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%reconfigureOuterCanvas: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%outerCanvasResizeCB: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor;
-text: .text%awt_wm_getInsetsFromProp;
-text: .text%syncTopLevelPos;
-text: .text%raiseInputMethodWindow;
-text: .text%awt_wm_getExtendedState: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_canvas_event_handler;
-text: .text%awt_canvas_handleEvent;
-text: .text%HandleExposeEvent: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/canvas.o;
-text: .text%checkForExpose: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/canvas.o;
-text: .text%expandDamageRect: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/canvas.o;
-text: .text%getCurComponent;
-text: .text%Java_java_awt_KeyboardFocusManager_initIDs;
-text: .text%Java_java_awt_event_InputEvent_initIDs;
-text: .text%Java_java_awt_event_KeyEvent_initIDs;
-text: .text%Java_java_awt_AWTKeyStroke_allocateNewInstance;
-text: .text%Java_sun_awt_motif_MComponentPeer_nativeHandleEvent;
-text: .text%Java_java_awt_Event_initIDs;
-# Test LoadJFrame
-text: .text%Java_sun_awt_motif_MToolkit_getScreenWidth;
-text: .text%Java_sun_awt_motif_MToolkit_getScreenHeight;
-text: .text%X11SD_Lock: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-text: .text%X11SD_InitWindow: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-text: .text%GetLockStub: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-text: .text%X11SD_GetRasInfo: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-text: .text%X11SD_Unlock: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-text: .text%X11SD_InitClip: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-text: .text%XRequestSentStub: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-# Test JHello
-text: .text%AWTLoadFont;
-text: .text%AWTFontMaxByte1;
-text: .text%AWTFontMaxCharOrByte2;
-text: .text%AWTFontMaxBounds;
-text: .text%AWTCharAscent;
-text: .text%AWTCharDescent;
-text: .text%AWTCharWidth;
-text: .text%AWTFontMinByte1;
-text: .text%AWTFontMinCharOrByte2;
-text: .text%AWTFontPerChar;
-text: .text%AWTCharRBearing;
-text: .text%AWTCharLBearing;
-text: .text%Java_sun_awt_X11SurfaceData_setInvalid;
-text: .text%Java_sun_awt_X11SurfaceData_nativeDispose;
-text: .text%X11SurfaceData_GetOps;
-# SwingSet
-text: .text%Java_sun_awt_motif_MWindowPeer_setSaveUnder;
-text: .text%Java_sun_awt_motif_MCanvasPeer_create;
-text: .text%awt_util_insertCallback;
-text: .text%Java_sun_awt_motif_MComponentPeer_getComponents_1NoClientCode;
-text: .text%Java_sun_awt_motif_MComponentPeer_pReshape;
-text: .text%awt_util_reshape;
-text: .text%Java_sun_awt_motif_MComponentPeer_pShow;
-text: .text%Java_sun_awt_motif_MDataTransferer_getAtomForTarget;
-text: .text%Java_sun_awt_motif_MComponentPeer_addNativeDropTarget;
-text: .text%register_drop_site;
-text: .text%update_drop_site_hierarchy: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_XmDnD.o;
-text: .text%AWTFontDefaultChar;
-text: .text%AWTFontGenerateImage;
-text: .text%CreatePixmapAndGC;
-text: .text%isAncestor;
-text: .text%xerror_handler;
--- a/make/sun/motif12/reorder-sparc	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,212 +0,0 @@
-data = R0x2000;
-text = LOAD ?RXO;
-# Test Null
-# Test Exit
-# Test Hello
-# Test Sleep
-# Test IntToString
-# Test LoadToolkit
-text: .text%JNI_OnLoad;
-text: .text%awt_util_debug_init;
-text: .text%Java_sun_awt_X11GraphicsEnvironment_initDisplay;
-text: .text%awt_init_Display;
-text: .text%makeDefaultConfig: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_GraphicsEnv.o;
-text: .text%awt_allocate_colors;
-text: .text%Java_sun_awt_font_NativeFontWrapper_getFontPath;
-text: .text%getPlatformFontPathChars: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
-text: .text%getSolarisFontLocations: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
-text: .text%AppendFont: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
-text: .text%freePlatformFontPathChars: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
-text: .text%checkFont: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_Font.o;
-text: .text%Java_sun_awt_X11GraphicsEnvironment_getNativeFonts;
-text: .text%Java_sun_awt_font_NativeFontWrapper_setNativeFontPath;
-text: .text%isDisplayLocal;
-text: .text%Java_sun_awt_X11GraphicsEnvironment_checkShmExt;
-text: .text%TryInitMITShm: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_GraphicsEnv.o;
-text: .text%awt_output_flush;
-text: .text%awtJNI_TimeMillis: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%AddFontsToX11FontPath: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
-text: .text%Java_sun_awt_X11GraphicsEnvironment_getNumScreens;
-text: .text%Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum;
-text: .text%Java_sun_awt_X11GraphicsDevice_getConfigVisualId;
-text: .text%Java_sun_awt_X11GraphicsDevice_isDBESupported;
-text: .text%Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals;
-text: .text%Java_sun_awt_X11GraphicsConfig_initIDs;
-text: .text%Java_sun_awt_X11GraphicsConfig_init;
-text: .text%getAllConfigs: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_GraphicsEnv.o;
-text: .text%Java_sun_awt_motif_MToolkit_init;
-text: .text%getDefaultConfig;
-text: .text%getScreenData;
-text: .text%Java_sun_awt_PlatformFont_initIDs;
-text: .text%Java_sun_awt_motif_MFontPeer_initIDs;
-text: .text%awt_wm_init;
-text: .text%awt_wm_initAtoms: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_getRunningWM;
-text: .text%xerror_detect_wm: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_prepareIsIceWM: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isNetSupporting: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_checkAnchor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_getProperty32: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isWinSupporting: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isIceWM: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isEnlightenment: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_getECommsWindowIDProperty: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isSawfish: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isNetWMName: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isKDE2: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_isCDE: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_color_matchTC;
-text: .text%setup_modifier_map: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%set_mod_mask: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%awt_initialize_DataTransferer;
-text: .text%awt_initialize_Xm_DnD;
-text: .text%cacheDropDone: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_XmDnD.o;
-text: .text%awt_motif_enableSingleDragInitiator;
-text: .text%Java_java_awt_Cursor_initIDs;
-text: .text%Java_sun_awt_motif_X11CustomCursor_cacheInit;
-text: .text%Java_sun_awt_motif_MToolkit_run;
-text: .text%awtJNI_GetCurrentThread;
-text: .text%awt_MToolkit_loop: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%awt_pipe_init: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%awt_set_poll_timeout: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%awt_events_pending: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%processOneEvent: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%set_toolkit_busy;
-text: .text%waitForEvents;
-text: .text%performPoll: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%awt_get_poll_timeout: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%awtJNI_CleanupGlobalRefs;
-text: .text%Java_java_awt_AWTEvent_initIDs;
-text: .text%Java_sun_awt_SunToolkit_wakeupEventQueue;
-text: .text%Java_sun_awt_motif_MToolkit_shutdown;
-text: .text%X11SD_LibDispose;
-text: .text%LibDisposeStub: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-# Test LoadFrame
-text: .text%Java_java_awt_Component_initIDs;
-text: .text%Java_java_awt_Container_initIDs;
-text: .text%Java_java_awt_Window_initIDs;
-text: .text%Java_java_awt_Frame_initIDs;
-text: .text%Java_sun_awt_SunToolkit_getPrivateKey;
-text: .text%Java_java_awt_MenuComponent_initIDs;
-text: .text%Java_sun_awt_X11GraphicsConfig_pGetBounds;
-text: .text%Java_java_awt_Insets_initIDs;
-text: .text%Java_sun_awt_motif_MComponentPeer_initIDs;
-text: .text%Java_sun_awt_motif_MWindowPeer_initIDs;
-text: .text%Java_sun_awt_motif_MWindowAttributes_initIDs;
-text: .text%Java_sun_awt_motif_MWindowPeer_pCreate;
-text: .text%awtJNI_CreateAndSetGlobalRef;
-text: .text%copyGraphicsConfigToPeer;
-text: .text%awt_Frame_guessInsets;
-text: .text%awtJNI_ChangeInsets: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%getMotifFontList;
-text: .text%getMotifFontStruct;
-text: .text%setDeleteCallback: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%ColorProc;
-text: .text%awt_canvas_create;
-text: .text%awt_util_show;
-text: .text%addTopLevel;
-text: .text%Java_sun_awt_motif_MWindowPeer_pHide;
-text: .text%Java_sun_awt_motif_MComponentPeer_pInitialize;
-text: .text%awt_addWidget;
-text: .text%Java_sun_awt_motif_MComponentPeer_pSetCursor;
-text: .text%getCursor;
-text: .text%awt_util_setCursor;
-text: .text%Java_sun_awt_motif_MComponentPeer_getParent_1NoClientCode;
-text: .text%Java_sun_awt_motif_MWindowPeer_pReshape;
-text: .text%reshape: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%awtJNI_setMbAndWwHeightAndOffsets: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%awt_wm_configureGravityBuggy;
-text: .text%Java_sun_awt_X11SurfaceData_initIDs;
-text: .text%Java_sun_awt_motif_MToolkit_loadSystemColors;
-text: .text%colorToRGB: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
-text: .text%Java_sun_awt_X11GraphicsConfig_makeColorModel;
-text: .text%awtJNI_GetColorModel;
-text: .text%Java_sun_awt_X11SurfaceData_initOps;
-text: .text%Java_sun_awt_motif_MWindowPeer_pSetTitle;
-text: .text%Java_sun_awt_motif_MWindowPeer_setResizable;
-text: .text%Java_java_awt_Font_initIDs;
-text: .text%Java_sun_awt_motif_MComponentPeer_pSetFont;
-text: .text%awt_util_mapChildren;
-text: .text%changeFont: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_Component.o;
-text: .text%Java_sun_awt_motif_MComponentPeer_pSetBackground;
-text: .text%getGraphicsConfigFromComponentPeer;
-text: .text%awtJNI_GetColorForVis;
-text: .text%Java_sun_awt_motif_MComponentPeer_pSetForeground;
-text: .text%Java_sun_awt_motif_MWindowPeer_pShow;
-text: .text%Java_sun_awt_motif_MWindowPeer_pShowModal;
-text: .text%awt_wm_setExtendedState;
-text: .text%awt_wm_doStateProtocolNet: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_doStateProtocolWin: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_setShellDecor;
-text: .text%awt_wm_setMotifDecor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_setOLDecor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_normalizeMotifDecor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%awt_wm_removeSizeHints;
-text: .text%Java_sun_awt_motif_MGlobalCursorManager_cacheInit;
-text: .text%Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor;
-text: .text%getCurComponent;
-text: .text%shellEH: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%awt_wm_isStateChange;
-text: .text%awt_wm_getWMState;
-text: .text%innerCanvasEH: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%reconfigureOuterCanvas: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%outerCanvasResizeCB: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
-text: .text%awt_wm_getInsetsFromProp;
-text: .text%syncTopLevelPos;
-text: .text%raiseInputMethodWindow;
-text: .text%awt_canvas_event_handler;
-text: .text%awt_canvas_handleEvent;
-text: .text%HandleExposeEvent: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/canvas.o;
-text: .text%checkForExpose: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/canvas.o;
-text: .text%awt_wm_getExtendedState: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
-text: .text%expandDamageRect: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/canvas.o;
-text: .text%Java_java_awt_KeyboardFocusManager_initIDs;
-text: .text%Java_java_awt_event_InputEvent_initIDs;
-text: .text%Java_java_awt_event_KeyEvent_initIDs;
-text: .text%Java_java_awt_AWTKeyStroke_allocateNewInstance;
-text: .text%Java_sun_awt_motif_MComponentPeer_nativeHandleEvent;
-text: .text%Java_java_awt_Event_initIDs;
-# Test LoadJFrame
-text: .text%awtJNI_ThreadYield;
-text: .text%Java_sun_awt_motif_MToolkit_getScreenWidth;
-text: .text%Java_sun_awt_motif_MToolkit_getScreenHeight;
-text: .text%X11SD_Lock: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-text: .text%X11SD_InitWindow: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-text: .text%GetLockStub: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-text: .text%X11SD_GetRasInfo: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-text: .text%X11SD_Unlock: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-text: .text%X11SD_InitClip: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-text: .text%XRequestSentStub: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
-# Test JHello
-text: .text%AWTLoadFont;
-text: .text%AWTFontMaxByte1;
-text: .text%AWTFontMaxCharOrByte2;
-text: .text%AWTFontMaxBounds;
-text: .text%AWTCharAscent;
-text: .text%AWTCharDescent;
-text: .text%AWTCharWidth;
-text: .text%AWTFontMinByte1;
-text: .text%AWTFontMinCharOrByte2;
-text: .text%AWTFontPerChar;
-text: .text%AWTCharRBearing;
-text: .text%AWTCharLBearing;
-text: .text%Java_sun_awt_X11SurfaceData_setInvalid;
-# SwingSet
-text: .text%Java_sun_awt_motif_MWindowPeer_setSaveUnder;
-text: .text%Java_sun_awt_X11SurfaceData_nativeDispose;
-text: .text%X11SurfaceData_GetOps;
-text: .text%Java_sun_awt_motif_MCanvasPeer_create;
-text: .text%awt_util_insertCallback;
-text: .text%Java_sun_awt_motif_MComponentPeer_getComponents_1NoClientCode;
-text: .text%Java_sun_awt_motif_MComponentPeer_pReshape;
-text: .text%awt_util_reshape;
-text: .text%Java_sun_awt_motif_MComponentPeer_pShow;
-text: .text%Java_sun_awt_motif_MDataTransferer_getAtomForTarget;
-text: .text%Java_sun_awt_motif_MComponentPeer_addNativeDropTarget;
-text: .text%register_drop_site;
-text: .text%update_drop_site_hierarchy: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_XmDnD.o;
-text: .text%AWTFontDefaultChar;
-text: .text%isAncestor;
-text: .text%xerror_handler;
-text: .text%AWTFontGenerateImage;
-text: .text%CreatePixmapAndGC;
--- a/make/sun/motif12/reorder-sparcv9	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-data = R0x2000;
-text = LOAD ?RXO;
-# Test Null
-# Test Exit
-# Test Hello
-# Test Sleep
-# Test IntToString
-# Test LoadToolkit
-text: .text%JNI_OnLoad;
-text: .text%awt_util_debug_init;
-text: .text%Java_java_awt_Toolkit_initIDs;
-text: .text%Java_sun_awt_X11GraphicsEnvironment_initDisplay;
-text: .text%awt_init_Display;
-text: .text%makeDefaultConfig: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_GraphicsEnv.o;
-text: .text%awt_allocate_colors;
-text: .text%make_uns_ordered_dither_array;
-text: .text%checkFont: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_Font.o;
-text: .text%Java_sun_awt_X11GraphicsEnvironment_getNativeFonts;
-text: .text%Java_sun_awt_X11GraphicsEnvironment_getNumScreens;
-text: .text%Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum;
-text: .text%Java_sun_awt_X11GraphicsDevice_getConfigVisualId;
-text: .text%Java_sun_awt_X11GraphicsConfig_initIDs;
-text: .text%Java_sun_awt_X11GraphicsConfig_init;
-text: .text%getAllConfigs: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_GraphicsEnv.o;
-text: .text%awt_output_flush;
-text: .text%awtJNI_TimeMillis: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%Java_sun_awt_motif_MToolkit_init;
-text: .text%getDefaultConfig;
-text: .text%getScreenData;
-text: .text%Java_sun_awt_PlatformFont_initIDs;
-text: .text%Java_sun_awt_motif_MFontPeer_initIDs;
-text: .text%awt_color_matchTC;
-text: .text%setup_modifier_map: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%set_mod_mask: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%awt_initialize_Xm_DnD;
-text: .text%Java_java_awt_Cursor_initIDs;
-text: .text%Java_sun_awt_motif_X11CustomCursor_cacheInit;
-text: .text%Java_java_awt_Dimension_initIDs;
-text: .text%Java_sun_awt_motif_MToolkit_run;
-text: .text%awtJNI_GetCurrentThread;
-text: .text%awt_MToolkit_loop: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%awt_pipe_init: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%awt_set_poll_timeout: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%awt_events_pending: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%processOneEvent: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%waitForEvents: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%performPoll: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%awt_get_poll_timeout: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%awtJNI_CleanupGlobalRefs;
-# Test LoadFrame
-text: .text%Java_java_awt_Component_initIDs;
-text: .text%Java_java_awt_Container_initIDs;
-text: .text%Java_java_awt_Window_initIDs;
-text: .text%Java_java_awt_Frame_initIDs;
-text: .text%Java_sun_awt_SunToolkit_getPrivateKey;
-text: .text%Java_java_awt_MenuComponent_initIDs;
-text: .text%Java_sun_awt_X11GraphicsConfig_pGetBounds;
-text: .text%Java_java_awt_Rectangle_initIDs;
-text: .text%Java_sun_awt_motif_MComponentPeer_initIDs;
-text: .text%Java_sun_awt_motif_MWindowPeer_initIDs;
-text: .text%Java_java_awt_Insets_initIDs;
-text: .text%Java_sun_awt_motif_MWindowAttributes_initIDs;
-text: .text%Java_sun_awt_motif_MWindowPeer_create;
-text: .text%awtJNI_CreateAndSetGlobalRef;
-text: .text%copyGraphicsConfigToPeer;
-text: .text%awt_Frame_guessInsets;
-text: .text%awt_util_runningWindowManager;
-text: .text%awt_winmgrerr: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_util.o;
-text: .text%awtJNI_ChangeInsets: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
-text: .text%getMotifFontList;
-text: .text%getMotifFontStruct;
-text: .text%setDeleteCallback: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
-text: .text%ColorProc;
-text: .text%awt_canvas_create;
-text: .text%awt_util_show;
-text: .text%addTopLevel;
-text: .text%Java_sun_awt_motif_MWindowPeer_pHide;
-text: .text%Java_sun_awt_motif_MComponentPeer_pInitialize;
-text: .text%awt_addWidget;
-text: .text%Java_sun_awt_motif_MComponentPeer_setCursor;
-text: .text%getCursor;
-text: .text%awt_util_setCursor;
-text: .text%Java_sun_awt_motif_MComponentPeer_getParent_1NoClientCode;
-text: .text%Java_sun_awt_motif_MWindowPeer_pReshape;
-text: .text%reshape: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
-text: .text%awtJNI_setMbAndWwHeightAndOffsets: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
-text: .text%awt_util_wmPositionsShellXY;
-text: .text%Java_sun_awt_motif_MWindowPeer_pSetTitle;
-text: .text%Java_sun_awt_motif_MWindowPeer_setResizable;
-text: .text%Java_java_awt_Font_initIDs;
-text: .text%Java_sun_awt_motif_MComponentPeer_pSetFont;
-text: .text%awt_util_mapChildren;
-text: .text%changeFont: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_Component.o;
-text: .text%Java_java_awt_Color_initIDs;
-text: .text%Java_sun_awt_motif_MToolkit_loadSystemColors;
-text: .text%colorToRGB: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%Java_sun_awt_motif_MComponentPeer_pSetBackground;
-text: .text%getGraphicsConfigFromComponentPeer;
-text: .text%awtJNI_GetColorForVis;
-text: .text%Java_sun_awt_motif_MComponentPeer_pSetForeground;
-text: .text%Java_sun_awt_motif_MWindowPeer_pShow;
-text: .text%Java_sun_awt_motif_MWindowPeer_pShowModal;
-text: .text%setStateHints: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
-text: .text%awt_util_setMinMaxSizeProps;
-text: .text%innerCanvasEH: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
-text: .text%reconfigureOuterCanvas: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
-text: .text%Java_java_awt_AWTEvent_initIDs;
-text: .text%outerCanvasResizeCB: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
-text: .text%Java_sun_awt_motif_MGlobalCursorManager_cacheInit;
-text: .text%shellEH: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
-text: .text%Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor;
-text: .text%getCurComponent;
-text: .text%get_awt_TopLevelInsetsProp;
-text: .text%syncTopLevelPos;
-text: .text%Java_sun_awt_motif_MComponentPeer_nativeHandleEvent;
-text: .text%raiseInputMethodWindow;
-text: .text%getWindowState: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
-text: .text%awt_canvas_event_handler;
-text: .text%awt_canvas_handleEvent;
-text: .text%HandleExposeEvent: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/canvas.o;
-text: .text%checkForExpose: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/canvas.o;
-text: .text%Java_java_awt_Event_initIDs;
-text: .text%Java_java_awt_image_ColorModel_initIDs;
-text: .text%Java_sun_awt_motif_X11Graphics_cacheInit;
-text: .text%InitMITShm: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_Graphics.o;
-text: .text%Java_sun_java2d_loops_RasterOutputManager_getPlatformFontVar;
-text: .text%Java_sun_awt_motif_X11Graphics_createFromComponent;
-text: .text%Java_sun_awt_motif_X11Graphics_pSetForeground;
-text: .text%awt_init_gc;
-text: .text%Java_sun_awt_motif_X11Graphics_pSetFont;
-text: .text%awtJNI_GetFontData;
-text: .text%awtJNI_IsMultiFont;
-text: .text%Java_sun_awt_FontDescriptor_initIDs;
-text: .text%loadFont;
-text: .text%Java_sun_awt_motif_X11Graphics_setOrigin;
-text: .text%Java_sun_awt_motif_X11Graphics_setLineAttrs;
-text: .text%Java_sun_awt_motif_X11Graphics_changeClip;
-text: .text%Java_sun_awt_motif_X11Graphics_devClearRect;
-text: .text%Java_sun_awt_motif_X11Graphics_disposeImpl;
-# Test LoadJFrame
-text: .text%Java_java_awt_event_InputEvent_initIDs;
-text: .text%Java_java_awt_event_KeyEvent_initIDs;
-text: .text%expandDamageRect: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/canvas.o;
-text: .text%awtJNI_ThreadYield;
-text: .text%Java_sun_awt_motif_X11Graphics_createFromGraphics;
-text: .text%Java_sun_awt_motif_MToolkit_getScreenWidth;
-text: .text%Java_sun_awt_motif_MToolkit_getScreenHeight;
-text: .text%Java_sun_awt_X11GraphicsConfig_makeColorModel;
-text: .text%awtJNI_GetColorModel;
-text: .text%Java_java_awt_image_BufferedImage_initIDs;
-text: .text%Java_java_awt_image_Raster_initIDs;
-text: .text%Java_java_awt_image_SampleModel_initIDs;
-text: .text%Java_java_awt_image_SinglePixelPackedSampleModel_initIDs;
-text: .text%Java_sun_awt_image_IntegerComponentRaster_initIDs;
-text: .text%Java_sun_java2d_loops_ImageData_initIDs;
-text: .text%Java_sun_java2d_loops_IntDiscreteRenderer_devSetRect;
-text: .text%Java_sun_awt_motif_X11Graphics_X11LockViewResources;
-text: .text%X11DeferredLockViewResources: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_Graphics.o;
-text: .text%getLockMethod: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_Graphics.o;
-text: .text%DGA_DeferredLockViewResources;
-text: .text%setLockMethod: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_Graphics.o;
-text: .text%getPrimitiveType: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_Graphics.o;
-text: .text%Java_sun_awt_motif_X11Graphics_X11UnLockViewResources;
-text: .text%DGA_UnlockViewResources;
-text: .text%Java_sun_java2d_loops_DefaultComponent_IntIsomorphicCopy;
-text: .text%minImageWidths;
-text: .text%minImageRows;
-text: .text%getIntImageLockInfo;
-text: .text%lockIntImageData;
-text: .text%unlockIntImageData;
-# Test JHello
-text: .text%Java_java_awt_FontMetrics_initIDs;
-# SwingSet
-text: .text%Java_sun_awt_image_Image_initIDs;
-text: .text%Java_sun_awt_image_ImageRepresentation_initIDs;
-text: .text%Java_java_awt_image_IndexColorModel_initIDs;
-text: .text%Java_sun_awt_motif_MWindowPeer_setSaveUnder;
-text: .text%Java_java_awt_AWTEvent_freeNativeData;
-text: .text%Java_sun_java2d_loops_DefaultComponent_IntRgbToXbgr;
-text: .text%Java_sun_awt_motif_MCanvasPeer_create;
-text: .text%awt_util_insertCallback;
-text: .text%Java_sun_awt_motif_MComponentPeer_getComponents_1NoClientCode;
-text: .text%Java_sun_awt_motif_MComponentPeer_pReshape;
-text: .text%awt_util_reshape;
-text: .text%Java_sun_awt_motif_MComponentPeer_pShow;
-text: .text%Java_sun_java2d_loops_IntDiscreteRenderer_devDrawLine;
-text: .text%doDrawLine: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/IntDiscreteRenderer.o;
-text: .text%adjustLine: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/IntDiscreteRenderer.o;
-text: .text%Java_sun_awt_image_GifImageDecoder_initIDs;
-text: .text%Java_java_awt_image_ComponentSampleModel_initIDs;
-text: .text%Java_sun_awt_image_ByteComponentRaster_initIDs;
-text: .text%Java_sun_awt_image_GifImageDecoder_parseImage;
-text: .text%Java_sun_awt_image_ImageRepresentation_setBytePixels;
-text: .text%Java_sun_java2d_loops_IntDiscreteRenderer_devDrawRect;
-text: .text%outcode: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/IntDiscreteRenderer.o;
-text: .text%Java_sun_java2d_loops_ImageData_isAllOpaqueGrayICM;
-text: .text%Java_sun_java2d_loops_GIFAcceleratorLoops_LUTcopyTo32BitXBgr;
-text: .text%getByteIndexedImageLockInfo;
-text: .text%lockByteIndexedImageData;
-text: .text%unlockByteIndexedImageData;
-text: .text%Java_sun_java2d_loops_GIFAcceleratorLoops_LUTxparTo32BitXBgr;
-text: .text%shouldDispatchToWidget: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%awtMenuIsActive;
-text: .text%awt_util_focusIsOnMenu;
-text: .text%awt_isModal;
-text: .text%findWidgetInfo: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%awt_copyXEvent;
-text: .text%awt_post_java_mouse_event;
-text: .text%Java_java_awt_event_MouseEvent_initIDs;
-text: .text%sysTimeMillis;
-text: .text%updateCursor;
-text: .text%awt_setActivatedShell;
-text: .text%handleFocusEvent;
-text: .text%awt_post_java_focus_event;
-text: .text%getModifiers;
-text: .text%Java_java_awt_AWTEvent_copyDataFieldInto;
-text: .text%Java_sun_awt_motif_X11InputMethod_initIDs;
-text: .text%Java_sun_awt_motif_X11InputMethod_openXIM;
-text: .text%awt_put_back_event;
-text: .text%awt_get_next_put_back_event: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%null_event_handler: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
-text: .text%Java_sun_awt_motif_MGlobalCursorManager_getCursorPos;
-text: .text%Java_sun_awt_motif_MGlobalCursorManager_findComponentAt;
-text: .text%Java_sun_awt_motif_MWindowPeer_hasTextComponents;
-text: .text%Java_sun_awt_motif_X11InputMethod_createXICNative;
-text: .text%findClass: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_InputMethod.o;
-text: .text%createXIC: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_InputMethod.o;
-text: .text%Java_sun_awt_motif_X11InputMethod_setXICFocus;
-text: .text%setXICWindowFocus: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_InputMethod.o;
-text: .text%setXICFocus: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_InputMethod.o;
-text: .text%getAncestorShell;
-text: .text%Java_sun_awt_motif_X11InputMethod_turnoffStatusWindow;
-text: .text%Frame_quit: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
--- a/make/sun/xawt/mapfile-vers	Tue Dec 13 15:41:47 2011 -0800
+++ b/make/sun/xawt/mapfile-vers	Thu Dec 15 19:52:13 2011 -0800
@@ -256,8 +256,6 @@
 
         Java_sun_awt_X11_XToolkit_waitForEvents;
         Java_java_awt_Event_initIDs;
-        Java_sun_awt_motif_X11FontMetrics_initIDs;
-        Java_sun_awt_motif_X11FontMetrics_init;
         Java_sun_awt_X11_XWindow_x11inputMethodLookupString;
         Java_sun_awt_X11_XWindow_haveCurrentX11InputMethodInstance;
         Java_java_awt_AWTEvent_nativeSetSource;
@@ -265,7 +263,6 @@
         Java_sun_awt_PlatformFont_initIDs;
         Java_sun_awt_FontDescriptor_initIDs;
         Java_sun_awt_X11_XFontPeer_initIDs;
-        Java_sun_awt_motif_X11FontMetrics_getMFCharsWidth;
         Java_sun_awt_X11InputMethod_initIDs;
         Java_sun_awt_X11InputMethod_resetXIC;
         Java_sun_awt_X11InputMethod_disposeXIC;
@@ -322,6 +319,8 @@
         Java_sun_awt_X11_XlibWrapper_XSynchronize;
         Java_java_awt_FileDialog_initIDs;
         Java_sun_awt_X11_XWindow_initIDs;
+        Java_sun_awt_X11_XWindowPeer_getLocalHostname;
+        Java_sun_awt_X11_XWindowPeer_getJvmPID;
 
         Java_sun_java2d_opengl_OGLContext_getOGLIdString;
         Java_sun_java2d_opengl_OGLMaskFill_maskFill;
--- a/src/share/classes/com/sun/beans/finder/AbstractFinder.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/com/sun/beans/finder/AbstractFinder.java	Thu Dec 15 19:52:13 2011 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
@@ -54,7 +54,7 @@
 
     /**
      * Returns an array of {@code Class} objects
-     * that represent the formal parameter types of the method
+     * that represent the formal parameter types of the method.
      * Returns an empty array if the method takes no parameters.
      *
      * @param method  the object that represents method
--- a/src/share/classes/com/sun/beans/finder/ConstructorFinder.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/com/sun/beans/finder/ConstructorFinder.java	Thu Dec 15 19:52:13 2011 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
@@ -87,7 +87,7 @@
 
     /**
      * Returns an array of {@code Class} objects
-     * that represent the formal parameter types of the constructor
+     * that represent the formal parameter types of the constructor.
      * Returns an empty array if the constructor takes no parameters.
      *
      * @param constructor  the object that represents constructor
--- a/src/share/classes/com/sun/beans/finder/MethodFinder.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/com/sun/beans/finder/MethodFinder.java	Thu Dec 15 19:52:13 2011 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2011, 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
@@ -190,7 +190,7 @@
 
     /**
      * Returns an array of {@code Class} objects
-     * that represent the formal parameter types of the method
+     * that represent the formal parameter types of the method.
      * Returns an empty array if the method takes no parameters.
      *
      * @param method  the object that represents method
@@ -226,6 +226,6 @@
      */
     @Override
     protected boolean isValid(Method method) {
-        return Modifier.isPublic(method.getModifiers()) && method.getName().equals(this.name);
+        return !method.isBridge() && Modifier.isPublic(method.getModifiers()) && method.getName().equals(this.name);
     }
 }
--- a/src/share/classes/java/awt/Component.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/java/awt/Component.java	Thu Dec 15 19:52:13 2011 -0800
@@ -666,9 +666,10 @@
      * can lead to a deadlock if client code also uses synchronization
      * by a component object. For every such situation revealed we should
      * consider possibility of replacing "this" with the package private
-     * objectLock object introduced below. So far there're 2 issues known:
+     * objectLock object introduced below. So far there're 3 issues known:
      * - CR 6708322 (the getName/setName methods);
-     * - CR 6608764 (the PropertyChangeListener machinery).
+     * - CR 6608764 (the PropertyChangeListener machinery);
+     * - CR 7108598 (the Container.paint/KeyboardFocusManager.clearMostRecentFocusOwner methods).
      *
      * Note: this field is considered final, though readObject() prohibits
      * initializing final fields.
@@ -1158,6 +1159,10 @@
     boolean updateGraphicsData(GraphicsConfiguration gc) {
         checkTreeLock();
 
+        if (graphicsConfig == gc) {
+            return false;
+        }
+
         graphicsConfig = gc;
 
         ComponentPeer peer = getPeer();
--- a/src/share/classes/java/awt/Container.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/java/awt/Container.java	Thu Dec 15 19:52:13 2011 -0800
@@ -1950,7 +1950,7 @@
      */
     public void paint(Graphics g) {
         if (isShowing()) {
-            synchronized (this) {
+            synchronized (getObjectLock()) {
                 if (printing) {
                     if (printingThreads.contains(Thread.currentThread())) {
                         return;
@@ -2004,7 +2004,7 @@
         if (isShowing()) {
             Thread t = Thread.currentThread();
             try {
-                synchronized (this) {
+                synchronized (getObjectLock()) {
                     if (printingThreads == null) {
                         printingThreads = new HashSet();
                     }
@@ -2013,7 +2013,7 @@
                 }
                 super.print(g);  // By default, Component.print() calls paint()
             } finally {
-                synchronized (this) {
+                synchronized (getObjectLock()) {
                     printingThreads.remove(t);
                     printing = !printingThreads.isEmpty();
                 }
--- a/src/share/classes/java/awt/font/StyledParagraph.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/java/awt/font/StyledParagraph.java	Thu Dec 15 19:52:13 2011 -0800
@@ -34,6 +34,7 @@
 import java.awt.im.InputMethodHighlight;
 import java.text.Annotation;
 import java.text.AttributedCharacterIterator;
+import java.text.AttributedCharacterIterator.Attribute;
 import java.util.Vector;
 import java.util.HashMap;
 import java.util.Map;
@@ -65,7 +66,7 @@
     // If there are multiple Decorations in the paragraph, they are
     // stored in this Vector, in order.  Otherwise this vector and
     // the decorationStarts array are null.
-    private Vector decorations;
+    private Vector<Decoration> decorations;
     // If there are multiple Decorations in the paragraph,
     // decorationStarts[i] contains the index where decoration i
     // starts.  For convenience, there is an extra entry at the
@@ -76,7 +77,7 @@
     // they are
     // stored in this Vector, in order.  Otherwise this vector and
     // the fontStarts array are null.
-    private Vector fonts;
+    private Vector<Object> fonts;
     // If there are multiple Fonts/GraphicAttributes in the paragraph,
     // fontStarts[i] contains the index where decoration i
     // starts.  For convenience, there is an extra entry at the
@@ -104,7 +105,7 @@
             final int nextRunStart = aci.getRunLimit();
             final int localIndex = index-start;
 
-            Map attributes = aci.getAttributes();
+            Map<? extends Attribute, ?> attributes = aci.getAttributes();
             attributes = addInputMethodAttrs(attributes);
             Decoration d = Decoration.getDecoration(attributes);
             addDecoration(d, localIndex);
@@ -168,7 +169,8 @@
         char ch = aci.setIndex(insertPos);
         int relativePos = Math.max(insertPos - aci.getBeginIndex() - 1, 0);
 
-        Map attributes = addInputMethodAttrs(aci.getAttributes());
+        Map<? extends Attribute, ?> attributes =
+            addInputMethodAttrs(aci.getAttributes());
         Decoration d = Decoration.getDecoration(attributes);
         if (!oldParagraph.getDecorationAt(relativePos).equals(d)) {
             return new StyledParagraph(aci, chars);
@@ -297,7 +299,7 @@
             return decoration;
         }
         int run = findRunContaining(index, decorationStarts);
-        return (Decoration) decorations.elementAt(run);
+        return decorations.elementAt(run);
     }
 
     /**
@@ -339,6 +341,7 @@
      * starts array does not have room for the index, a
      * new array is created and returned.
      */
+    @SuppressWarnings({"rawtypes", "unchecked"})
     private static int[] addToVector(Object obj,
                                      int index,
                                      Vector v,
@@ -374,7 +377,7 @@
         }
         else {
             if (!decoration.equals(d)) {
-                decorations = new Vector(INITIAL_SIZE);
+                decorations = new Vector<Decoration>(INITIAL_SIZE);
                 decorations.addElement(decoration);
                 decorations.addElement(d);
                 decorationStarts = new int[INITIAL_SIZE];
@@ -398,7 +401,7 @@
         }
         else {
             if (!font.equals(f)) {
-                fonts = new Vector(INITIAL_SIZE);
+                fonts = new Vector<Object>(INITIAL_SIZE);
                 fonts.addElement(font);
                 fonts.addElement(f);
                 fontStarts = new int[INITIAL_SIZE];
@@ -412,7 +415,8 @@
      * Resolve the given chars into Fonts using FontResolver, then add
      * font runs for each.
      */
-    private void addFonts(char[] chars, Map attributes, int start, int limit) {
+    private void addFonts(char[] chars, Map<? extends Attribute, ?> attributes,
+                          int start, int limit) {
 
         FontResolver resolver = FontResolver.getInstance();
         CodePointIterator iter = CodePointIterator.create(chars, start, limit);
@@ -426,7 +430,8 @@
      * Return a Map with entries from oldStyles, as well as input
      * method entries, if any.
      */
-    static Map addInputMethodAttrs(Map oldStyles) {
+    static Map<? extends Attribute, ?>
+           addInputMethodAttrs(Map<? extends Attribute, ?> oldStyles) {
 
         Object value = oldStyles.get(TextAttribute.INPUT_METHOD_HIGHLIGHT);
 
@@ -439,7 +444,7 @@
                 InputMethodHighlight hl;
                 hl = (InputMethodHighlight) value;
 
-                Map imStyles = null;
+                Map<? extends Attribute, ?> imStyles = null;
                 try {
                     imStyles = hl.getStyle();
                 } catch (NoSuchMethodError e) {
@@ -451,7 +456,8 @@
                 }
 
                 if (imStyles != null) {
-                    HashMap newStyles = new HashMap(5, (float)0.9);
+                    HashMap<Attribute, Object>
+                        newStyles = new HashMap<>(5, (float)0.9);
                     newStyles.putAll(oldStyles);
 
                     newStyles.putAll(imStyles);
@@ -471,7 +477,8 @@
      * If attributes does not contain a GraphicAttribute, Font, or
      * Font family entry this method returns null.
      */
-    private static Object getGraphicOrFont(Map attributes) {
+    private static Object getGraphicOrFont(
+            Map<? extends Attribute, ?> attributes) {
 
         Object value = attributes.get(TextAttribute.CHAR_REPLACEMENT);
         if (value != null) {
--- a/src/share/classes/java/awt/font/TextAttribute.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/java/awt/font/TextAttribute.java	Thu Dec 15 19:52:13 2011 -0800
@@ -257,7 +257,8 @@
 public final class TextAttribute extends Attribute {
 
     // table of all instances in this class, used by readResolve
-    private static final Map instanceMap = new HashMap(29);
+    private static final Map<String, TextAttribute>
+            instanceMap = new HashMap<String, TextAttribute>(29);
 
     /**
      * Constructs a <code>TextAttribute</code> with the specified name.
@@ -280,7 +281,7 @@
                 "subclass didn't correctly implement readResolve");
         }
 
-        TextAttribute instance = (TextAttribute) instanceMap.get(getName());
+        TextAttribute instance = instanceMap.get(getName());
         if (instance != null) {
             return instance;
         } else {
--- a/src/share/classes/java/awt/font/TextLayout.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/java/awt/font/TextLayout.java	Thu Dec 15 19:52:13 2011 -0800
@@ -55,6 +55,7 @@
 import java.text.AttributedString;
 import java.text.AttributedCharacterIterator;
 import java.text.AttributedCharacterIterator.Attribute;
+import java.text.CharacterIterator;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Hashtable;
@@ -382,7 +383,7 @@
             throw new IllegalArgumentException("Zero length string passed to TextLayout constructor.");
         }
 
-        Map attributes = null;
+        Map<? extends Attribute, ?> attributes = null;
         if (font.hasLayoutAttributes()) {
             attributes = font.getAttributes();
         }
@@ -451,7 +452,7 @@
     private static Font singleFont(char[] text,
                                    int start,
                                    int limit,
-                                   Map attributes) {
+                                   Map<? extends Attribute, ?> attributes) {
 
         if (attributes.get(TextAttribute.CHAR_REPLACEMENT) != null) {
             return null;
@@ -516,14 +517,17 @@
         text.first();
         char[] chars = new char[len];
         int n = 0;
-        for (char c = text.first(); c != text.DONE; c = text.next()) {
+        for (char c = text.first();
+             c != CharacterIterator.DONE;
+             c = text.next())
+        {
             chars[n++] = c;
         }
 
         text.first();
         if (text.getRunLimit() == limit) {
 
-            Map attributes = text.getAttributes();
+            Map<? extends Attribute, ?> attributes = text.getAttributes();
             Font font = singleFont(chars, 0, len, attributes);
             if (font != null) {
                 fastInit(chars, font, attributes, frc);
@@ -561,7 +565,9 @@
     /**
      * Initialize the paragraph-specific data.
      */
-    private void paragraphInit(byte aBaseline, CoreMetrics lm, Map paragraphAttrs, char[] text) {
+    private void paragraphInit(byte aBaseline, CoreMetrics lm,
+                               Map<? extends Attribute, ?> paragraphAttrs,
+                               char[] text) {
 
         baseline = aBaseline;
 
@@ -581,7 +587,10 @@
      * all renderable by one font (ie no embedded graphics)
      * all on one baseline
      */
-    private void fastInit(char[] chars, Font font, Map attrs, FontRenderContext frc) {
+    private void fastInit(char[] chars, Font font,
+                          Map<? extends Attribute, ?> attrs,
+                          FontRenderContext frc) {
+
         // Object vf = attrs.get(TextAttribute.ORIENTATION);
         // isVerticalLine = TextAttribute.ORIENTATION_VERTICAL.equals(vf);
         isVerticalLine = false;
@@ -619,7 +628,7 @@
             // and use it and its font to initialize the paragraph.
             // If not, use the first graphic to initialize.
 
-            Map paragraphAttrs = text.getAttributes();
+            Map<? extends Attribute, ?> paragraphAttrs = text.getAttributes();
 
             boolean haveFont = TextLine.advanceToFirstFont(text);
 
--- a/src/share/classes/java/awt/font/TextLine.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/java/awt/font/TextLine.java	Thu Dec 15 19:52:13 2011 -0800
@@ -43,6 +43,7 @@
 import java.awt.image.BufferedImage;
 import java.text.Annotation;
 import java.text.AttributedCharacterIterator;
+import java.text.AttributedCharacterIterator.Attribute;
 import java.text.Bidi;
 import java.text.CharacterIterator;
 import java.util.Hashtable;
@@ -318,7 +319,8 @@
             for (int i = 0, n = 0; i < fComponents.length; ++i, n += 2) {
                 tlc = fComponents[getComponentLogicalIndex(i)];
                 AffineTransform at = tlc.getBaselineTransform();
-                if (at != null && ((at.getType() & at.TYPE_TRANSLATION) != 0)) {
+                if (at != null &&
+                    ((at.getType() & AffineTransform.TYPE_TRANSLATION) != 0)) {
                     double dx = at.getTranslateX();
                     double dy = at.getTranslateY();
                     builder.moveTo(tx += dx, ty += dy);
@@ -903,7 +905,7 @@
                                               char[] chars,
                                               Font font,
                                               CoreMetrics lm,
-                                              Map attributes) {
+                                              Map<? extends Attribute, ?> attributes) {
 
         boolean isDirectionLTR = true;
         byte[] levels = null;
@@ -1250,7 +1252,10 @@
      */
     static boolean advanceToFirstFont(AttributedCharacterIterator aci) {
 
-        for (char ch = aci.first(); ch != aci.DONE; ch = aci.setIndex(aci.getRunLimit())) {
+        for (char ch = aci.first();
+             ch != CharacterIterator.DONE;
+             ch = aci.setIndex(aci.getRunLimit()))
+        {
 
             if (aci.getAttribute(TextAttribute.CHAR_REPLACEMENT) == null) {
                 return true;
--- a/src/share/classes/java/awt/font/TextMeasurer.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/java/awt/font/TextMeasurer.java	Thu Dec 15 19:52:13 2011 -0800
@@ -43,6 +43,7 @@
 import java.awt.Font;
 
 import java.text.AttributedCharacterIterator;
+import java.text.AttributedCharacterIterator.Attribute;
 import java.text.AttributedString;
 import java.text.Bidi;
 import java.text.BreakIterator;
@@ -176,7 +177,7 @@
             throw new Error();
         }
         if (fComponents != null) {
-            other.fComponents = (TextLineComponent[]) fComponents.clone();
+            other.fComponents = fComponents.clone();
         }
         return other;
     }
@@ -199,7 +200,10 @@
         fChars = new char[text.getEndIndex() - fStart];
 
         int n = 0;
-        for (char c = text.first(); c != text.DONE; c = text.next()) {
+        for (char c = text.first();
+             c != CharacterIterator.DONE;
+             c = text.next())
+        {
             fChars[n++] = c;
         }
 
@@ -211,7 +215,7 @@
         }
 
         text.first();
-        Map paragraphAttrs = text.getAttributes();
+        Map<? extends Attribute, ?> paragraphAttrs = text.getAttributes();
         NumericShaper shaper = AttributeValues.getNumericShaping(paragraphAttrs);
         if (shaper != null) {
             shaper.shape(fChars, 0, fChars.length);
@@ -243,7 +247,8 @@
                 GraphicAttribute graphic = (GraphicAttribute)
                                 paragraphAttrs.get(TextAttribute.CHAR_REPLACEMENT);
                 fBaseline = TextLayout.getBaselineFromGraphic(graphic);
-                Font dummyFont = new Font(new Hashtable(5, (float)0.9));
+                Hashtable<Attribute, ?> fmap = new Hashtable<>(5, (float)0.9);
+                Font dummyFont = new Font(fmap);
                 LineMetrics lm = dummyFont.getLineMetrics(" ", 0, 1, fFrc);
                 fBaselineOffsets = lm.getBaselineOffsets();
             }
--- a/src/share/classes/java/awt/geom/Path2D.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/java/awt/geom/Path2D.java	Thu Dec 15 19:52:13 2011 -0800
@@ -667,7 +667,8 @@
                         // Collapse out initial moveto/lineto
                         break;
                     }
-                    // NO BREAK;
+                    lineTo(coords[0], coords[1]);
+                    break;
                 case SEG_LINETO:
                     lineTo(coords[0], coords[1]);
                     break;
@@ -1392,7 +1393,8 @@
                         // Collapse out initial moveto/lineto
                         break;
                     }
-                    // NO BREAK;
+                    lineTo(coords[0], coords[1]);
+                    break;
                 case SEG_LINETO:
                     lineTo(coords[0], coords[1]);
                     break;
@@ -2456,7 +2458,7 @@
                 }
             }
         }
-        s.writeByte((byte) SERIAL_PATH_END);
+        s.writeByte(SERIAL_PATH_END);
     }
 
     final void readObject(java.io.ObjectInputStream s, boolean storedbl)
--- a/src/share/classes/java/beans/Beans.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/java/beans/Beans.java	Thu Dec 15 19:52:13 2011 -0800
@@ -32,7 +32,6 @@
 import java.applet.AppletStub;
 import java.applet.AudioClip;
 
-import java.awt.GraphicsEnvironment;
 import java.awt.Image;
 
 import java.beans.beancontext.BeanContext;
@@ -53,15 +52,11 @@
 import java.util.Iterator;
 import java.util.Vector;
 
-import sun.awt.AppContext;
-
 /**
  * This class provides some general purpose beans control methods.
  */
 
 public class Beans {
-    private static final Object DESIGN_TIME = new Object();
-    private static final Object GUI_AVAILABLE = new Object();
 
     /**
      * <p>
@@ -399,8 +394,7 @@
      * @see DesignMode
      */
     public static boolean isDesignTime() {
-        Object value = AppContext.getAppContext().get(DESIGN_TIME);
-        return (value instanceof Boolean) && (Boolean) value;
+        return ThreadGroupContext.getContext().isDesignTime();
     }
 
     /**
@@ -417,8 +411,7 @@
      *
      */
     public static boolean isGuiAvailable() {
-        Object value = AppContext.getAppContext().get(GUI_AVAILABLE);
-        return (value instanceof Boolean) ? (Boolean) value : !GraphicsEnvironment.isHeadless();
+        return ThreadGroupContext.getContext().isGuiAvailable();
     }
 
     /**
@@ -444,7 +437,7 @@
         if (sm != null) {
             sm.checkPropertiesAccess();
         }
-        AppContext.getAppContext().put(DESIGN_TIME, Boolean.valueOf(isDesignTime));
+        ThreadGroupContext.getContext().setDesignTime(isDesignTime);
     }
 
     /**
@@ -470,7 +463,7 @@
         if (sm != null) {
             sm.checkPropertiesAccess();
         }
-        AppContext.getAppContext().put(GUI_AVAILABLE, Boolean.valueOf(isGuiAvailable));
+        ThreadGroupContext.getContext().setGuiAvailable(isGuiAvailable);
     }
 }
 
--- a/src/share/classes/java/beans/Encoder.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/java/beans/Encoder.java	Thu Dec 15 19:52:13 2011 -0800
@@ -195,7 +195,13 @@
      */
     public PersistenceDelegate getPersistenceDelegate(Class<?> type) {
         PersistenceDelegate pd = this.finder.find(type);
-        return (pd != null) ? pd : MetaData.getPersistenceDelegate(type);
+        if (pd == null) {
+            pd = MetaData.getPersistenceDelegate(type);
+            if (pd != null) {
+                this.finder.register(type, pd);
+            }
+        }
+        return pd;
     }
 
     /**
--- a/src/share/classes/java/beans/Introspector.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/java/beans/Introspector.java	Thu Dec 15 19:52:13 2011 -0800
@@ -26,7 +26,6 @@
 package java.beans;
 
 import com.sun.beans.WeakCache;
-import com.sun.beans.finder.BeanInfoFinder;
 import com.sun.beans.finder.ClassFinder;
 
 import java.awt.Component;
@@ -44,9 +43,7 @@
 import java.util.EventObject;
 import java.util.List;
 import java.util.TreeMap;
-import java.util.WeakHashMap;
 
-import sun.awt.AppContext;
 import sun.reflect.misc.ReflectUtil;
 
 /**
@@ -98,10 +95,7 @@
     public final static int IGNORE_ALL_BEANINFO        = 3;
 
     // Static Caches to speed up introspection.
-    private static WeakCache<Class<?>, Method[]> declaredMethodCache =
-            new WeakCache<>();
-
-    private static final Object BEANINFO_CACHE = new Object();
+    private static final WeakCache<Class<?>, Method[]> declaredMethodCache = new WeakCache<>();
 
     private Class<?> beanClass;
     private BeanInfo explicitBeanInfo;
@@ -134,8 +128,6 @@
     static final String SET_PREFIX = "set";
     static final String IS_PREFIX = "is";
 
-    private static final Object FINDER_KEY = new Object();
-
     //======================================================================
     //                          Public methods
     //======================================================================
@@ -160,22 +152,15 @@
         if (!ReflectUtil.isPackageAccessible(beanClass)) {
             return (new Introspector(beanClass, null, USE_ALL_BEANINFO)).getBeanInfo();
         }
-        Map<Class<?>, BeanInfo> beanInfoCache;
+        ThreadGroupContext context = ThreadGroupContext.getContext();
         BeanInfo beanInfo;
-        synchronized (BEANINFO_CACHE) {
-            @SuppressWarnings("unchecked")
-            Map<Class<?>, BeanInfo> temp = beanInfoCache =
-                    (Map<Class<?>, BeanInfo>) AppContext.getAppContext().get(BEANINFO_CACHE);
-            if (beanInfoCache == null) {
-                beanInfoCache = new WeakHashMap<>();
-                AppContext.getAppContext().put(BEANINFO_CACHE, beanInfoCache);
-            }
-            beanInfo = beanInfoCache.get(beanClass);
+        synchronized (declaredMethodCache) {
+            beanInfo = context.getBeanInfo(beanClass);
         }
         if (beanInfo == null) {
             beanInfo = new Introspector(beanClass, null, USE_ALL_BEANINFO).getBeanInfo();
-            synchronized (BEANINFO_CACHE) {
-                beanInfoCache.put(beanClass, beanInfo);
+            synchronized (declaredMethodCache) {
+                context.putBeanInfo(beanClass, beanInfo);
             }
         }
         return beanInfo;
@@ -308,7 +293,7 @@
      */
 
     public static String[] getBeanInfoSearchPath() {
-        return getFinder().getPackages();
+        return ThreadGroupContext.getContext().getBeanInfoFinder().getPackages();
     }
 
     /**
@@ -332,7 +317,7 @@
         if (sm != null) {
             sm.checkPropertiesAccess();
         }
-        getFinder().setPackages(path);
+        ThreadGroupContext.getContext().getBeanInfoFinder().setPackages(path);
     }
 
 
@@ -344,11 +329,8 @@
      */
 
     public static void flushCaches() {
-        synchronized (BEANINFO_CACHE) {
-            Map<?,?> beanInfoCache = (Map) AppContext.getAppContext().get(BEANINFO_CACHE);
-            if (beanInfoCache != null) {
-                beanInfoCache.clear();
-            }
+        synchronized (declaredMethodCache) {
+            ThreadGroupContext.getContext().clearBeanInfoCache();
             declaredMethodCache.clear();
         }
     }
@@ -372,12 +354,8 @@
         if (clz == null) {
             throw new NullPointerException();
         }
-        synchronized (BEANINFO_CACHE) {
-            @SuppressWarnings("unchecked")
-            Map<Class<?>, ?> beanInfoCache = (Map<Class<?>, ?>) AppContext.getAppContext().get(BEANINFO_CACHE);
-            if (beanInfoCache != null) {
-                beanInfoCache.put(clz, null);
-            }
+        synchronized (declaredMethodCache) {
+            ThreadGroupContext.getContext().removeBeanInfo(clz);
             declaredMethodCache.put(clz, null);
         }
     }
@@ -455,7 +433,7 @@
      * @return Instance of an explicit BeanInfo class or null if one isn't found.
      */
     private static BeanInfo findExplicitBeanInfo(Class<?> beanClass) {
-        return getFinder().find(beanClass);
+        return ThreadGroupContext.getContext().getBeanInfoFinder().find(beanClass);
     }
 
     /**
@@ -1278,7 +1256,7 @@
         if (!ReflectUtil.isPackageAccessible(clz)) {
             return new Method[0];
         }
-        synchronized (BEANINFO_CACHE) {
+        synchronized (declaredMethodCache) {
             Method[] result = declaredMethodCache.get(clz);
             if (result == null) {
                 result = clz.getMethods();
@@ -1429,17 +1407,6 @@
         return false;
     }
 
-    private static BeanInfoFinder getFinder() {
-        AppContext context = AppContext.getAppContext();
-        Object object = context.get(FINDER_KEY);
-        if (object instanceof BeanInfoFinder) {
-            return (BeanInfoFinder) object;
-        }
-        BeanInfoFinder finder = new BeanInfoFinder();
-        context.put(FINDER_KEY, finder);
-        return finder;
-    }
-
     /**
      * Try to create an instance of a named class.
      * First try the classloader of "sibling", then try the system
--- a/src/share/classes/java/beans/PropertyChangeEvent.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/java/beans/PropertyChangeEvent.java	Thu Dec 15 19:52:13 2011 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, 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,6 +25,8 @@
 
 package java.beans;
 
+import java.util.EventObject;
+
 /**
  * A "PropertyChange" event gets delivered whenever a bean changes a "bound"
  * or "constrained" property.  A PropertyChangeEvent object is sent as an
@@ -42,21 +44,21 @@
  * arbitrary set of if its properties have changed.  In this case the
  * old and new values should also be null.
  */
-
-public class PropertyChangeEvent extends java.util.EventObject {
+public class PropertyChangeEvent extends EventObject {
     private static final long serialVersionUID = 7042693688939648123L;
 
     /**
-     * Constructs a new <code>PropertyChangeEvent</code>.
+     * Constructs a new {@code PropertyChangeEvent}.
      *
-     * @param source  The bean that fired the event.
-     * @param propertyName  The programmatic name of the property
-     *          that was changed.
-     * @param oldValue  The old value of the property.
-     * @param newValue  The new value of the property.
+     * @param source        the bean that fired the event
+     * @param propertyName  the programmatic name of the property that was changed
+     * @param oldValue      the old value of the property
+     * @param newValue      the new value of the property
+     *
+     * @throws IllegalArgumentException if {@code source} is {@code null}
      */
     public PropertyChangeEvent(Object source, String propertyName,
-                                     Object oldValue, Object newValue) {
+                               Object oldValue, Object newValue) {
         super(source);
         this.propertyName = propertyName;
         this.newValue = newValue;
--- a/src/share/classes/java/beans/PropertyDescriptor.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/java/beans/PropertyDescriptor.java	Thu Dec 15 19:52:13 2011 -0800
@@ -454,10 +454,7 @@
                     editor = ctor.newInstance(new Object[] { bean });
                 }
             } catch (Exception ex) {
-                // A serious error has occured.
-                // Proably due to an invalid property editor.
-                throw new RuntimeException("PropertyEditor not instantiated",
-                                           ex);
+                // Fall through
             }
         }
         return (PropertyEditor)editor;
--- a/src/share/classes/java/beans/PropertyEditorManager.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/java/beans/PropertyEditorManager.java	Thu Dec 15 19:52:13 2011 -0800
@@ -25,9 +25,6 @@
 
 package java.beans;
 
-import com.sun.beans.finder.PropertyEditorFinder;
-import sun.awt.AppContext;
-
 /**
  * The PropertyEditorManager can be used to locate a property editor for
  * any given type name.  This property editor must support the
@@ -55,8 +52,6 @@
 
 public class PropertyEditorManager {
 
-    private static final Object FINDER_KEY = new Object();
-
     /**
      * Registers an editor class to edit values of the given target class.
      * If the editor class is {@code null},
@@ -81,7 +76,7 @@
         if (sm != null) {
             sm.checkPropertiesAccess();
         }
-        getFinder().register(targetType, editorClass);
+        ThreadGroupContext.getContext().getPropertyEditorFinder().register(targetType, editorClass);
     }
 
     /**
@@ -92,7 +87,7 @@
      * The result is null if no suitable editor can be found.
      */
     public static PropertyEditor findEditor(Class<?> targetType) {
-        return getFinder().find(targetType);
+        return ThreadGroupContext.getContext().getPropertyEditorFinder().find(targetType);
     }
 
     /**
@@ -104,7 +99,7 @@
      *         e.g. Sun implementation initially sets to  {"sun.beans.editors"}.
      */
     public static String[] getEditorSearchPath() {
-        return getFinder().getPackages();
+        return ThreadGroupContext.getContext().getPropertyEditorFinder().getPackages();
     }
 
     /**
@@ -125,17 +120,6 @@
         if (sm != null) {
             sm.checkPropertiesAccess();
         }
-        getFinder().setPackages(path);
-    }
-
-    private static PropertyEditorFinder getFinder() {
-        AppContext context = AppContext.getAppContext();
-        Object object = context.get(FINDER_KEY);
-        if (object instanceof PropertyEditorFinder) {
-            return (PropertyEditorFinder) object;
-        }
-        PropertyEditorFinder finder = new PropertyEditorFinder();
-        context.put(FINDER_KEY, finder);
-        return finder;
+        ThreadGroupContext.getContext().getPropertyEditorFinder().setPackages(path);
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/beans/ThreadGroupContext.java	Thu Dec 15 19:52:13 2011 -0800
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2011, 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.
+ */
+
+package java.beans;
+
+import com.sun.beans.finder.BeanInfoFinder;
+import com.sun.beans.finder.PropertyEditorFinder;
+
+import java.awt.GraphicsEnvironment;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+/**
+ * The {@code ThreadGroupContext} is an application-dependent
+ * context referenced by the specific {@link ThreadGroup}.
+ * This is a replacement for the {@link sun.awt.AppContext}.
+ *
+ * @author  Sergey Malenkov
+ */
+final class ThreadGroupContext {
+
+    private static final Map<ThreadGroup, ThreadGroupContext> contexts = new WeakHashMap<>();
+
+    /**
+     * Returns the appropriate {@code AppContext} for the caller,
+     * as determined by its {@code ThreadGroup}.
+     *
+     * @return  the application-dependent context
+     */
+    static ThreadGroupContext getContext() {
+        ThreadGroup group = Thread.currentThread().getThreadGroup();
+        synchronized (contexts) {
+            ThreadGroupContext context = contexts.get(group);
+            if (context == null) {
+                context = new ThreadGroupContext();
+                contexts.put(group, context);
+            }
+            return context;
+        }
+    }
+
+    private volatile boolean isDesignTime;
+    private volatile Boolean isGuiAvailable;
+
+    private Map<Class<?>, BeanInfo> beanInfoCache;
+    private BeanInfoFinder beanInfoFinder;
+    private PropertyEditorFinder propertyEditorFinder;
+
+
+    boolean isDesignTime() {
+        return this.isDesignTime;
+    }
+
+    void setDesignTime(boolean isDesignTime) {
+        this.isDesignTime = isDesignTime;
+    }
+
+
+    boolean isGuiAvailable() {
+        Boolean isGuiAvailable = this.isGuiAvailable;
+        return (isGuiAvailable != null)
+                ? isGuiAvailable.booleanValue()
+                : !GraphicsEnvironment.isHeadless();
+    }
+
+    void setGuiAvailable(boolean isGuiAvailable) {
+        this.isGuiAvailable = Boolean.valueOf(isGuiAvailable);
+    }
+
+
+    BeanInfo getBeanInfo(Class<?> type) {
+        return (this.beanInfoCache != null)
+                ? this.beanInfoCache.get(type)
+                : null;
+    }
+
+    BeanInfo putBeanInfo(Class<?> type, BeanInfo info) {
+        if (this.beanInfoCache == null) {
+            this.beanInfoCache = new WeakHashMap<>();
+        }
+        return this.beanInfoCache.put(type, info);
+    }
+
+    void removeBeanInfo(Class<?> type) {
+        if (this.beanInfoCache != null) {
+            this.beanInfoCache.remove(type);
+        }
+    }
+
+    void clearBeanInfoCache() {
+        if (this.beanInfoCache != null) {
+            this.beanInfoCache.clear();
+        }
+    }
+
+
+    synchronized BeanInfoFinder getBeanInfoFinder() {
+        if (this.beanInfoFinder == null) {
+            this.beanInfoFinder = new BeanInfoFinder();
+        }
+        return this.beanInfoFinder;
+    }
+
+    synchronized PropertyEditorFinder getPropertyEditorFinder() {
+        if (this.propertyEditorFinder == null) {
+            this.propertyEditorFinder = new PropertyEditorFinder();
+        }
+        return this.propertyEditorFinder;
+    }
+}
--- a/src/share/classes/javax/swing/text/DefaultCaret.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/javax/swing/text/DefaultCaret.java	Thu Dec 15 19:52:13 2011 -0800
@@ -403,6 +403,10 @@
      * @see MouseListener#mouseClicked
      */
     public void mouseClicked(MouseEvent e) {
+        if (getComponent() == null) {
+            return;
+        }
+
         int nclicks = SwingUtilities2.getAdjustedClickCount(getComponent(), e);
 
         if (! e.isConsumed()) {
--- a/src/share/classes/sun/awt/image/BufImgSurfaceData.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/awt/image/BufImgSurfaceData.java	Thu Dec 15 19:52:13 2011 -0800
@@ -323,8 +323,8 @@
     }
 
     public RenderLoops getRenderLoops(SunGraphics2D sg2d) {
-        if (sg2d.paintState <= sg2d.PAINT_ALPHACOLOR &&
-            sg2d.compositeState <= sg2d.COMP_ISCOPY)
+        if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR &&
+            sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY)
         {
             return solidloops;
         }
--- a/src/share/classes/sun/java2d/SunGraphics2D.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/SunGraphics2D.java	Thu Dec 15 19:52:13 2011 -0800
@@ -941,7 +941,7 @@
                 }
             }
         }
-        Class paintClass = paint.getClass();
+        Class<? extends Paint> paintClass = paint.getClass();
         if (paintClass == GradientPaint.class) {
             paintState = PAINT_GRADIENT;
         } else if (paintClass == LinearGradientPaint.class) {
@@ -1280,7 +1280,7 @@
         interpolationHint = -1;
         interpolationType = AffineTransformOp.TYPE_NEAREST_NEIGHBOR;
         boolean customHintPresent = false;
-        Iterator iter = hints.keySet().iterator();
+        Iterator<?> iter = hints.keySet().iterator();
         while (iter.hasNext()) {
             Object key = iter.next();
             if (key == SunHints.KEY_RENDERING ||
@@ -1311,7 +1311,7 @@
      */
     public void addRenderingHints(Map<?,?> hints) {
         boolean customHintPresent = false;
-        Iterator iter = hints.keySet().iterator();
+        Iterator<?> iter = hints.keySet().iterator();
         while (iter.hasNext()) {
             Object key = iter.next();
             if (key == SunHints.KEY_RENDERING ||
--- a/src/share/classes/sun/java2d/SurfaceData.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/SurfaceData.java	Thu Dec 15 19:52:13 2011 -0800
@@ -520,8 +520,8 @@
     }
 
     public boolean canRenderParallelograms(SunGraphics2D sg2d) {
-        if (sg2d.paintState <= sg2d.PAINT_ALPHACOLOR) {
-            if (sg2d.compositeState == sg2d.COMP_XOR) {
+        if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) {
+            if (sg2d.compositeState == SunGraphics2D.COMP_XOR) {
                 if (havePgramXORLoop == LOOP_UNKNOWN) {
                     FillParallelogram loop =
                         FillParallelogram.locate(SurfaceType.AnyColor,
@@ -531,9 +531,9 @@
                         (loop != null) ? LOOP_FOUND : LOOP_NOTFOUND;
                 }
                 return havePgramXORLoop == LOOP_FOUND;
-            } else if (sg2d.compositeState <= sg2d.COMP_ISCOPY &&
+            } else if (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY &&
                        sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON &&
-                       sg2d.clipState != sg2d.CLIP_SHAPE)
+                       sg2d.clipState != SunGraphics2D.CLIP_SHAPE)
             {
                 if (havePgramSolidLoop == LOOP_UNKNOWN) {
                     FillParallelogram loop =
@@ -551,8 +551,8 @@
 
     public void validatePipe(SunGraphics2D sg2d) {
         sg2d.imagepipe = imagepipe;
-        if (sg2d.compositeState == sg2d.COMP_XOR) {
-            if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR) {
+        if (sg2d.compositeState == SunGraphics2D.COMP_XOR) {
+            if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR) {
                 sg2d.drawpipe = paintViaShape;
                 sg2d.fillpipe = paintViaShape;
                 sg2d.shapepipe = paintShape;
@@ -576,7 +576,7 @@
                     converter = colorViaShape;
                     sg2d.shapepipe = colorPrimitives;
                 }
-                if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+                if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                     sg2d.drawpipe = converter;
                     sg2d.fillpipe = converter;
                     // REMIND: We should not be changing text strategies
@@ -589,11 +589,11 @@
                     // which is not defined for XOR.
                     sg2d.textpipe = outlineTextRenderer;
                 } else {
-                    if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+                    if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
                         sg2d.drawpipe = converter;
                         sg2d.fillpipe = converter;
                     } else {
-                        if (sg2d.strokeState != sg2d.STROKE_THIN) {
+                        if (sg2d.strokeState != SunGraphics2D.STROKE_THIN) {
                             sg2d.drawpipe = converter;
                         } else {
                             sg2d.drawpipe = colorPrimitives;
@@ -604,9 +604,9 @@
                 }
                 // assert(sg2d.surfaceData == this);
             }
-        } else if (sg2d.compositeState == sg2d.COMP_CUSTOM) {
+        } else if (sg2d.compositeState == SunGraphics2D.COMP_CUSTOM) {
             if (sg2d.antialiasHint == SunHints.INTVAL_ANTIALIAS_ON) {
-                if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+                if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                     sg2d.drawpipe = AAClipCompViaShape;
                     sg2d.fillpipe = AAClipCompViaShape;
                     sg2d.shapepipe = AAClipCompViaShape;
@@ -621,7 +621,7 @@
                 sg2d.drawpipe = compViaShape;
                 sg2d.fillpipe = compViaShape;
                 sg2d.shapepipe = compShape;
-                if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+                if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                     sg2d.textpipe = clipCompText;
                 } else {
                     sg2d.textpipe = compText;
@@ -631,7 +631,7 @@
             sg2d.alphafill = getMaskFill(sg2d);
             // assert(sg2d.surfaceData == this);
             if (sg2d.alphafill != null) {
-                if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+                if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                     sg2d.drawpipe = AAClipColorViaShape;
                     sg2d.fillpipe = AAClipColorViaShape;
                     sg2d.shapepipe = AAClipColorViaShape;
@@ -644,8 +644,8 @@
                     sg2d.drawpipe = converter;
                     sg2d.fillpipe = converter;
                     sg2d.shapepipe = converter;
-                    if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR ||
-                        sg2d.compositeState > sg2d.COMP_ISCOPY)
+                    if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR ||
+                        sg2d.compositeState > SunGraphics2D.COMP_ISCOPY)
                     {
                         sg2d.textpipe = colorText;
                     } else {
@@ -653,7 +653,7 @@
                     }
                 }
             } else {
-                if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+                if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                     sg2d.drawpipe = AAClipPaintViaShape;
                     sg2d.fillpipe = AAClipPaintViaShape;
                     sg2d.shapepipe = AAClipPaintViaShape;
@@ -665,9 +665,9 @@
                     sg2d.textpipe = paintText;
                 }
             }
-        } else if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR ||
-                   sg2d.compositeState > sg2d.COMP_ISCOPY ||
-                   sg2d.clipState == sg2d.CLIP_SHAPE)
+        } else if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR ||
+                   sg2d.compositeState > SunGraphics2D.COMP_ISCOPY ||
+                   sg2d.clipState == SunGraphics2D.CLIP_SHAPE)
         {
             sg2d.drawpipe = paintViaShape;
             sg2d.fillpipe = paintViaShape;
@@ -675,13 +675,13 @@
             sg2d.alphafill = getMaskFill(sg2d);
             // assert(sg2d.surfaceData == this);
             if (sg2d.alphafill != null) {
-                if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+                if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                     sg2d.textpipe = clipColorText;
                 } else {
                     sg2d.textpipe = colorText;
                 }
             } else {
-                if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+                if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                     sg2d.textpipe = clipPaintText;
                 } else {
                     sg2d.textpipe = paintText;
@@ -700,11 +700,11 @@
                 converter = colorViaShape;
                 sg2d.shapepipe = colorPrimitives;
             }
-            if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+            if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
                 sg2d.drawpipe = converter;
                 sg2d.fillpipe = converter;
             } else {
-                if (sg2d.strokeState != sg2d.STROKE_THIN) {
+                if (sg2d.strokeState != SunGraphics2D.STROKE_THIN) {
                     sg2d.drawpipe = converter;
                 } else {
                     sg2d.drawpipe = colorPrimitives;
@@ -817,7 +817,7 @@
 
     private static CompositeType getFillCompositeType(SunGraphics2D sg2d) {
         CompositeType compType = sg2d.imageComp;
-        if (sg2d.compositeState == sg2d.COMP_ISCOPY) {
+        if (sg2d.compositeState == SunGraphics2D.COMP_ISCOPY) {
             if (compType == CompositeType.SrcOverNoEa) {
                 compType = CompositeType.OpaqueSrcOverNoEa;
             } else {
--- a/src/share/classes/sun/java2d/SurfaceDataProxy.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/SurfaceDataProxy.java	Thu Dec 15 19:52:13 2011 -0800
@@ -71,7 +71,7 @@
 
     static {
         cachingAllowed = true;
-        String manimg = (String)AccessController.doPrivileged(
+        String manimg = AccessController.doPrivileged(
             new GetPropertyAction("sun.java2d.managedimages"));
         if (manimg != null && manimg.equals("false")) {
             cachingAllowed = false;
@@ -79,7 +79,7 @@
         }
 
         defaultThreshold = 1;
-        String num = (String)AccessController.doPrivileged(
+        String num = AccessController.doPrivileged(
             new GetPropertyAction("sun.java2d.accthreshold"));
         if (num != null) {
             try {
--- a/src/share/classes/sun/java2d/loops/GraphicsPrimitive.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/loops/GraphicsPrimitive.java	Thu Dec 15 19:52:13 2011 -0800
@@ -328,7 +328,7 @@
 
     static {
         GetPropertyAction gpa = new GetPropertyAction("sun.java2d.trace");
-        String trace = (String)AccessController.doPrivileged(gpa);
+        String trace = AccessController.doPrivileged(gpa);
         if (trace != null) {
             boolean verbose = false;
             int traceflags = 0;
@@ -391,9 +391,9 @@
     private static PrintStream getTraceOutputFile() {
         if (traceout == null) {
             if (tracefile != null) {
-                Object o =
-                    AccessController.doPrivileged(new PrivilegedAction() {
-                        public Object run() {
+                FileOutputStream o = AccessController.doPrivileged(
+                    new PrivilegedAction<FileOutputStream>() {
+                        public FileOutputStream run() {
                             try {
                                 return new FileOutputStream(tracefile);
                             } catch (FileNotFoundException e) {
@@ -402,7 +402,7 @@
                         }
                     });
                 if (o != null) {
-                    traceout = new PrintStream((OutputStream) o);
+                    traceout = new PrintStream(o);
                 } else {
                     traceout = System.err;
                 }
@@ -415,8 +415,8 @@
 
     public static class TraceReporter extends Thread {
         public static void setShutdownHook() {
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
+            AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                public Void run() {
                     TraceReporter t = new TraceReporter();
                     t.setContextClassLoader(null);
                     Runtime.getRuntime().addShutdownHook(t);
--- a/src/share/classes/sun/java2d/loops/SurfaceType.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/loops/SurfaceType.java	Thu Dec 15 19:52:13 2011 -0800
@@ -56,7 +56,7 @@
 public final class SurfaceType {
 
     private static int unusedUID = 1;
-    private static HashMap surfaceUIDMap = new HashMap(100);
+    private static HashMap<String, Integer> surfaceUIDMap = new HashMap<>(100);
 
     /*
      * CONSTANTS USED BY ALL PRIMITIVES TO DESCRIBE THE SURFACES
@@ -402,7 +402,7 @@
     }
 
     public synchronized static final int makeUniqueID(String desc) {
-        Integer i = (Integer) surfaceUIDMap.get((Object) desc);
+        Integer i = surfaceUIDMap.get(desc);
 
         if (i == null) {
             if (unusedUID > 255) {
--- a/src/share/classes/sun/java2d/opengl/OGLBufImgOps.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/opengl/OGLBufImgOps.java	Thu Dec 15 19:52:13 2011 -0800
@@ -78,12 +78,12 @@
         }
 
         SurfaceData srcData =
-            dstData.getSourceSurfaceData(img, sg.TRANSFORM_ISIDENT,
+            dstData.getSourceSurfaceData(img, SunGraphics2D.TRANSFORM_ISIDENT,
                                          CompositeType.SrcOver, null);
         if (!(srcData instanceof OGLSurfaceData)) {
             // REMIND: this hack tries to ensure that we have a cached texture
             srcData =
-                dstData.getSourceSurfaceData(img, sg.TRANSFORM_ISIDENT,
+                dstData.getSourceSurfaceData(img, SunGraphics2D.TRANSFORM_ISIDENT,
                                              CompositeType.SrcOver, null);
             if (!(srcData instanceof OGLSurfaceData)) {
                 return false;
--- a/src/share/classes/sun/java2d/opengl/OGLDrawImage.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/opengl/OGLDrawImage.java	Thu Dec 15 19:52:13 2011 -0800
@@ -60,7 +60,7 @@
             SurfaceData dstData = sg.surfaceData;
             SurfaceData srcData =
                 dstData.getSourceSurfaceData(img,
-                                             sg.TRANSFORM_GENERIC,
+                                             SunGraphics2D.TRANSFORM_GENERIC,
                                              sg.imageComp,
                                              bgColor);
 
--- a/src/share/classes/sun/java2d/opengl/OGLPaints.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/opengl/OGLPaints.java	Thu Dec 15 19:52:13 2011 -0800
@@ -123,14 +123,16 @@
             }
 
             SurfaceData srcData =
-                dstData.getSourceSurfaceData(bi, sg2d.TRANSFORM_ISIDENT,
+                dstData.getSourceSurfaceData(bi,
+                                             SunGraphics2D.TRANSFORM_ISIDENT,
                                              CompositeType.SrcOver, null);
             if (!(srcData instanceof OGLSurfaceData)) {
                 // REMIND: this is a hack that attempts to cache the system
                 //         memory image from the TexturePaint instance into an
                 //         OpenGL texture...
                 srcData =
-                    dstData.getSourceSurfaceData(bi, sg2d.TRANSFORM_ISIDENT,
+                    dstData.getSourceSurfaceData(bi,
+                                                 SunGraphics2D.TRANSFORM_ISIDENT,
                                                  CompositeType.SrcOver, null);
                 if (!(srcData instanceof OGLSurfaceData)) {
                     return false;
--- a/src/share/classes/sun/java2d/opengl/OGLSurfaceData.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/opengl/OGLSurfaceData.java	Thu Dec 15 19:52:13 2011 -0800
@@ -428,18 +428,18 @@
         // by the CompositeType.SrcNoEa (any color) test below.)
 
         if (/* CompositeType.SrcNoEa (any color) */
-            (sg2d.compositeState <= sg2d.COMP_ISCOPY &&
-             sg2d.paintState <= sg2d.PAINT_ALPHACOLOR)        ||
+            (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY &&
+             sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR)         ||
 
             /* CompositeType.SrcOver (any color) */
-            (sg2d.compositeState == sg2d.COMP_ALPHA    &&
-             sg2d.paintState <= sg2d.PAINT_ALPHACOLOR &&
+            (sg2d.compositeState == SunGraphics2D.COMP_ALPHA   &&
+             sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR &&
              (((AlphaComposite)sg2d.composite).getRule() ==
-              AlphaComposite.SRC_OVER))                       ||
+              AlphaComposite.SRC_OVER))                                 ||
 
             /* CompositeType.Xor (any color) */
-            (sg2d.compositeState == sg2d.COMP_XOR &&
-             sg2d.paintState <= sg2d.PAINT_ALPHACOLOR))
+            (sg2d.compositeState == SunGraphics2D.COMP_XOR &&
+             sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR))
         {
             textpipe = oglTextPipe;
         } else {
@@ -454,12 +454,12 @@
         OGLRenderer nonTxPipe = null;
 
         if (sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON) {
-            if (sg2d.paintState <= sg2d.PAINT_ALPHACOLOR) {
-                if (sg2d.compositeState <= sg2d.COMP_XOR) {
+            if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) {
+                if (sg2d.compositeState <= SunGraphics2D.COMP_XOR) {
                     txPipe = oglTxRenderPipe;
                     nonTxPipe = oglRenderPipe;
                 }
-            } else if (sg2d.compositeState <= sg2d.COMP_ALPHA) {
+            } else if (sg2d.compositeState <= SunGraphics2D.COMP_ALPHA) {
                 if (OGLPaints.isValid(sg2d)) {
                     txPipe = oglTxRenderPipe;
                     nonTxPipe = oglRenderPipe;
@@ -467,7 +467,7 @@
                 // custom paints handled by super.validatePipe() below
             }
         } else {
-            if (sg2d.paintState <= sg2d.PAINT_ALPHACOLOR) {
+            if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) {
                 if (graphicsConfig.isCapPresent(CAPS_PS30) &&
                     (sg2d.imageComp == CompositeType.SrcOverNoEa ||
                      sg2d.imageComp == CompositeType.SrcOver))
@@ -484,7 +484,7 @@
                     sg2d.drawpipe = aaConverter;
                     sg2d.fillpipe = aaConverter;
                     sg2d.shapepipe = aaConverter;
-                } else if (sg2d.compositeState == sg2d.COMP_XOR) {
+                } else if (sg2d.compositeState == SunGraphics2D.COMP_XOR) {
                     // install the solid pipes when AA and XOR are both enabled
                     txPipe = oglTxRenderPipe;
                     nonTxPipe = oglRenderPipe;
@@ -494,10 +494,10 @@
         }
 
         if (txPipe != null) {
-            if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+            if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
                 sg2d.drawpipe = txPipe;
                 sg2d.fillpipe = txPipe;
-            } else if (sg2d.strokeState != sg2d.STROKE_THIN) {
+            } else if (sg2d.strokeState != SunGraphics2D.STROKE_THIN) {
                 sg2d.drawpipe = txPipe;
                 sg2d.fillpipe = nonTxPipe;
             } else {
@@ -524,7 +524,7 @@
 
     @Override
     protected MaskFill getMaskFill(SunGraphics2D sg2d) {
-        if (sg2d.paintState > sg2d.PAINT_ALPHACOLOR) {
+        if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR) {
             /*
              * We can only accelerate non-Color MaskFill operations if
              * all of the following conditions hold true:
@@ -548,8 +548,8 @@
     public boolean copyArea(SunGraphics2D sg2d,
                             int x, int y, int w, int h, int dx, int dy)
     {
-        if (sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE &&
-            sg2d.compositeState < sg2d.COMP_XOR)
+        if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE &&
+            sg2d.compositeState < SunGraphics2D.COMP_XOR)
         {
             x += sg2d.transX;
             y += sg2d.transY;
--- a/src/share/classes/sun/java2d/pipe/AAShapePipe.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/pipe/AAShapePipe.java	Thu Dec 15 19:52:13 2011 -0800
@@ -144,7 +144,7 @@
     public void renderPath(SunGraphics2D sg, Shape s, BasicStroke bs) {
         boolean adjust = (bs != null &&
                           sg.strokeHint != SunHints.INTVAL_STROKE_PURE);
-        boolean thin = (sg.strokeState <= sg.STROKE_THINDASHED);
+        boolean thin = (sg.strokeState <= SunGraphics2D.STROKE_THINDASHED);
 
         Region clip = sg.getCompClip();
         int abox[] = new int[4];
--- a/src/share/classes/sun/java2d/pipe/BufferedPaints.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/pipe/BufferedPaints.java	Thu Dec 15 19:52:13 2011 -0800
@@ -247,7 +247,7 @@
         BufferedImage bi = paint.getImage();
         SurfaceData dstData = sg2d.surfaceData;
         SurfaceData srcData =
-            dstData.getSourceSurfaceData(bi, sg2d.TRANSFORM_ISIDENT,
+            dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT,
                                          CompositeType.SrcOver, null);
         boolean filter =
             (sg2d.interpolationType !=
--- a/src/share/classes/sun/java2d/pipe/BufferedRenderPipe.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/pipe/BufferedRenderPipe.java	Thu Dec 15 19:52:13 2011 -0800
@@ -508,9 +508,9 @@
     }
 
     public void draw(SunGraphics2D sg2d, Shape s) {
-        if (sg2d.strokeState == sg2d.STROKE_THIN) {
+        if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
             if (s instanceof Polygon) {
-                if (sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE) {
+                if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
                     Polygon p = (Polygon)s;
                     drawPolygon(sg2d, p.xpoints, p.ypoints, p.npoints);
                     return;
@@ -518,7 +518,7 @@
             }
             Path2D.Float p2df;
             int transx, transy;
-            if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) {
+            if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
                 if (s instanceof Path2D.Float) {
                     p2df = (Path2D.Float)s;
                 } else {
@@ -532,7 +532,7 @@
                 transy = 0;
             }
             drawPath(sg2d, p2df, transx, transy);
-        } else if (sg2d.strokeState < sg2d.STROKE_CUSTOM) {
+        } else if (sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM) {
             ShapeSpanIterator si = LoopPipe.getStrokeSpans(sg2d, s);
             try {
                 fillSpans(sg2d, si, 0, 0);
@@ -547,11 +547,11 @@
     public void fill(SunGraphics2D sg2d, Shape s) {
         int transx, transy;
 
-        if (sg2d.strokeState == sg2d.STROKE_THIN) {
+        if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
             // Here we are able to use fillPath() for
             // high-quality fills.
             Path2D.Float p2df;
-            if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) {
+            if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
                 if (s instanceof Path2D.Float) {
                     p2df = (Path2D.Float)s;
                 } else {
@@ -569,7 +569,7 @@
         }
 
         AffineTransform at;
-        if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) {
+        if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
             // Transform (translation) will be done by FillSpans (we could
             // delegate to fillPolygon() here, but most hardware accelerated
             // libraries cannot handle non-convex polygons, so we will use
--- a/src/share/classes/sun/java2d/pipe/DrawImage.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/pipe/DrawImage.java	Thu Dec 15 19:52:13 2011 -0800
@@ -146,7 +146,7 @@
         int imgh = img.getHeight(null);
         boolean checkfinalxform;
 
-        if (sg.transformState <= sg.TRANSFORM_ANY_TRANSLATE &&
+        if (sg.transformState <= SunGraphics2D.TRANSFORM_ANY_TRANSLATE &&
             (txtype == AffineTransform.TYPE_IDENTITY ||
              txtype == AffineTransform.TYPE_TRANSLATION))
         {
@@ -166,7 +166,7 @@
                 return;
             }
             checkfinalxform = false;
-        } else if (sg.transformState <= sg.TRANSFORM_TRANSLATESCALE &&
+        } else if (sg.transformState <= SunGraphics2D.TRANSFORM_TRANSLATESCALE &&
                    ((txtype & (AffineTransform.TYPE_FLIP |
                                AffineTransform.TYPE_MASK_ROTATION |
                                AffineTransform.TYPE_GENERAL_TRANSFORM)) == 0))
@@ -344,14 +344,14 @@
         Region clip = sg.getCompClip();
         SurfaceData dstData = sg.surfaceData;
         SurfaceData srcData = dstData.getSourceSurfaceData(img,
-                                                           sg.TRANSFORM_GENERIC,
+                                                           SunGraphics2D.TRANSFORM_GENERIC,
                                                            sg.imageComp,
                                                            bgColor);
 
         if (srcData == null) {
             img = getBufferedImage(img);
             srcData = dstData.getSourceSurfaceData(img,
-                                                   sg.TRANSFORM_GENERIC,
+                                                   SunGraphics2D.TRANSFORM_GENERIC,
                                                    sg.imageComp,
                                                    bgColor);
             if (srcData == null) {
@@ -372,7 +372,7 @@
             sx1 = sy1 = 0;
 
             srcData = dstData.getSourceSurfaceData(img,
-                                                   sg.TRANSFORM_GENERIC,
+                                                   SunGraphics2D.TRANSFORM_GENERIC,
                                                    sg.imageComp,
                                                    bgColor);
         }
@@ -398,7 +398,7 @@
             sx1 = sy1 = 0;
 
             srcData = dstData.getSourceSurfaceData(img,
-                                                   sg.TRANSFORM_GENERIC,
+                                                   SunGraphics2D.TRANSFORM_GENERIC,
                                                    sg.imageComp,
                                                    null);
             srcType = srcData.getSurfaceType();
@@ -449,7 +449,7 @@
         SurfaceType dstType = dstData.getSurfaceType();
         MaskBlit maskblit;
         Blit blit;
-        if (sg.compositeState <= sg.COMP_ALPHA) {
+        if (sg.compositeState <= SunGraphics2D.COMP_ALPHA) {
             /* NOTE: We either have, or we can make,
              * a MaskBlit for any alpha composite type
              */
@@ -565,7 +565,7 @@
         while (true) {
             SurfaceData srcData =
                 dstData.getSourceSurfaceData(img,
-                                             sg.TRANSFORM_ISIDENT,
+                                             SunGraphics2D.TRANSFORM_ISIDENT,
                                              sg.imageComp,
                                              bgColor);
             if (srcData == null) {
@@ -628,7 +628,7 @@
         while (true) {
             SurfaceData srcData =
                 dstData.getSourceSurfaceData(img,
-                                             sg.TRANSFORM_TRANSLATESCALE,
+                                             SunGraphics2D.TRANSFORM_TRANSLATESCALE,
                                              sg.imageComp,
                                              bgColor);
 
@@ -800,11 +800,11 @@
 
     public static boolean isSimpleTranslate(SunGraphics2D sg) {
         int ts = sg.transformState;
-        if (ts <= sg.TRANSFORM_INT_TRANSLATE) {
+        if (ts <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
             // Integer translates are always "simple"
             return true;
         }
-        if (ts >= sg.TRANSFORM_TRANSLATESCALE) {
+        if (ts >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
             // Scales and beyond are always "not simple"
             return false;
         }
@@ -846,8 +846,11 @@
         }
         int type = tx.getType();
         boolean needTrans =
-            ((type&(tx.TYPE_MASK_ROTATION|tx.TYPE_GENERAL_TRANSFORM)) != 0);
-        if (! needTrans && type != tx.TYPE_TRANSLATION && type != tx.TYPE_IDENTITY)
+                ((type & (AffineTransform.TYPE_MASK_ROTATION |
+                          AffineTransform.TYPE_GENERAL_TRANSFORM)) != 0);
+        if (! needTrans &&
+              type != AffineTransform.TYPE_TRANSLATION &&
+              type != AffineTransform.TYPE_IDENTITY)
         {
             double[] mtx = new double[4];
             tx.getMatrix(mtx);
@@ -861,7 +864,7 @@
                 Raster raster = bImg.getRaster();
                 IndexColorModel icm = (IndexColorModel) cm;
                 // Just need to make sure that we have a transparent pixel
-                if (needTrans && cm.getTransparency() == cm.OPAQUE) {
+                if (needTrans && cm.getTransparency() == Transparency.OPAQUE) {
                     // Fix 4221407
                     if (raster instanceof sun.awt.image.BytePackedRaster) {
                         dstCM = ColorModel.getRGBdefault();
@@ -892,7 +895,7 @@
                     }   /* raster instanceof sun.awt.image.BytePackedRaster */
                 } /* if (cm.getTransparency() == cm.OPAQUE) */
             } /* if (cm instanceof IndexColorModel) */
-            else if (needTrans && cm.getTransparency() == cm.OPAQUE) {
+            else if (needTrans && cm.getTransparency() == Transparency.OPAQUE) {
                 // Need a bitmask transparency
                 // REMIND: for now, use full transparency since no loops
                 // for bitmask
@@ -902,7 +905,7 @@
         else {
 
             if (cm instanceof IndexColorModel ||
-                (needTrans && cm.getTransparency() == cm.OPAQUE))
+                (needTrans && cm.getTransparency() == Transparency.OPAQUE))
             {
                 // Need a bitmask transparency
                 // REMIND: for now, use full transparency since no loops
--- a/src/share/classes/sun/java2d/pipe/GlyphListPipe.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/pipe/GlyphListPipe.java	Thu Dec 15 19:52:13 2011 -0800
@@ -54,7 +54,7 @@
         }
 
         float devx, devy;
-        if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+        if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
             double origin[] = {x + info.originX, y + info.originY};
             sg2d.transform.transform(origin, 0, origin, 0, 1);
             devx = (float)origin[0];
@@ -90,7 +90,7 @@
                                         sg2d, data, offset, length, ix, iy);
             return;
         }
-        if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+        if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
             double origin[] = {ix + info.originX, iy + info.originY};
             sg2d.transform.transform(origin, 0, origin, 0, 1);
             x = (float) origin[0];
@@ -122,7 +122,7 @@
             SurfaceData.outlineTextRenderer.drawGlyphVector(sg2d, gv, x, y);
             return;
         }
-        if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+        if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
             double origin[] = {x, y};
             sg2d.transform.transform(origin, 0, origin, 0, 1);
             x = (float) origin[0];
--- a/src/share/classes/sun/java2d/pipe/LoopPipe.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/pipe/LoopPipe.java	Thu Dec 15 19:52:13 2011 -0800
@@ -171,11 +171,11 @@
 
 
     public void draw(SunGraphics2D sg2d, Shape s) {
-        if (sg2d.strokeState == sg2d.STROKE_THIN) {
+        if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
             Path2D.Float p2df;
             int transX;
             int transY;
-            if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) {
+            if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
                 if (s instanceof Path2D.Float) {
                     p2df = (Path2D.Float)s;
                 } else {
@@ -193,7 +193,7 @@
             return;
         }
 
-        if (sg2d.strokeState == sg2d.STROKE_CUSTOM) {
+        if (sg2d.strokeState == SunGraphics2D.STROKE_CUSTOM) {
             fill(sg2d, sg2d.stroke.createStrokedShape(s));
             return;
         }
@@ -271,7 +271,7 @@
             sr.setRule(PathIterator.WIND_NON_ZERO);
 
             BasicStroke bs = (BasicStroke) sg2d.stroke;
-            boolean thin = (sg2d.strokeState <= sg2d.STROKE_THINDASHED);
+            boolean thin = (sg2d.strokeState <= SunGraphics2D.STROKE_THINDASHED);
             boolean normalize =
                 (sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE);
 
@@ -288,11 +288,11 @@
     }
 
     public void fill(SunGraphics2D sg2d, Shape s) {
-        if (sg2d.strokeState == sg2d.STROKE_THIN) {
+        if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
             Path2D.Float p2df;
             int transX;
             int transY;
-            if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) {
+            if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
                 if (s instanceof Path2D.Float) {
                     p2df = (Path2D.Float)s;
                 } else {
@@ -314,7 +314,7 @@
         try {
             sr.setOutputArea(sg2d.getCompClip());
             AffineTransform at =
-                ((sg2d.transformState == sg2d.TRANSFORM_ISIDENT)
+                ((sg2d.transformState == SunGraphics2D.TRANSFORM_ISIDENT)
                  ? null
                  : sg2d.transform);
             sr.appendPath(s.getPathIterator(at));
@@ -328,7 +328,7 @@
         // REMIND: Eventually, the plan is that it will not be possible for
         // fs to be null since the FillSpans loop will be the fundamental
         // loop implemented for any destination type...
-        if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+        if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
             si = sg2d.clipRegion.filter(si);
             // REMIND: Region.filter produces a Java-only iterator
             // with no native counterpart...
--- a/src/share/classes/sun/java2d/pipe/RenderingEngine.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/share/classes/sun/java2d/pipe/RenderingEngine.java	Thu Dec 15 19:52:13 2011 -0800
@@ -117,16 +117,16 @@
             return reImpl;
         }
 
-        reImpl = (RenderingEngine)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
+        reImpl =
+            AccessController.doPrivileged(new PrivilegedAction<RenderingEngine>() {
+                public RenderingEngine run() {
                     final String ductusREClass = "sun.dc.DuctusRenderingEngine";
                     String reClass =
                         System.getProperty("sun.java2d.renderer", ductusREClass);
                     if (reClass.equals(ductusREClass)) {
                         try {
-                            Class cls = Class.forName(ductusREClass);
-                            return cls.newInstance();
+                            Class<?> cls = Class.forName(ductusREClass);
+                            return (RenderingEngine) cls.newInstance();
                         } catch (ReflectiveOperationException ignored) {
                             // not found
                         }
@@ -153,7 +153,7 @@
 
         GetPropertyAction gpa =
             new GetPropertyAction("sun.java2d.renderer.trace");
-        String reTrace = (String) AccessController.doPrivileged(gpa);
+        String reTrace = AccessController.doPrivileged(gpa);
         if (reTrace != null) {
             reImpl = new Tracer(reImpl);
         }
--- a/src/solaris/classes/sun/awt/X11/ListHelper.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/classes/sun/awt/X11/ListHelper.java	Thu Dec 15 19:52:13 2011 -0800
@@ -29,10 +29,8 @@
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseWheelEvent;
 import java.awt.event.AdjustmentEvent;
-import java.util.List;
 import java.util.ArrayList;
 import java.util.Iterator;
-import sun.awt.motif.X11FontMetrics;
 import sun.util.logging.PlatformLogger;
 
 // FIXME: implement multi-select
--- a/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java	Thu Dec 15 19:52:13 2011 -0800
@@ -35,7 +35,6 @@
 import java.awt.image.VolatileImage;
 import java.awt.peer.*;
 import sun.awt.*;
-import sun.awt.motif.X11FontMetrics;
 import java.lang.reflect.*;
 import sun.util.logging.PlatformLogger;
 import java.util.*;
--- a/src/solaris/classes/sun/awt/X11/XEmbedChildProxyPeer.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/classes/sun/awt/X11/XEmbedChildProxyPeer.java	Thu Dec 15 19:52:13 2011 -0800
@@ -34,8 +34,6 @@
 import java.awt.peer.*;
 import sun.java2d.pipe.Region;
 import sun.awt.*;
-import sun.awt.motif.MToolkit;
-import sun.awt.motif.X11FontMetrics;
 
 public class XEmbedChildProxyPeer implements ComponentPeer, XEventDispatcher{
     XEmbeddingContainer container;
--- a/src/solaris/classes/sun/awt/X11/XToolkit.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/classes/sun/awt/X11/XToolkit.java	Thu Dec 15 19:52:13 2011 -0800
@@ -51,6 +51,7 @@
 import sun.awt.*;
 import sun.font.FontConfigManager;
 import sun.font.FontManager;
+import sun.java2d.SunGraphicsEnvironment;
 import sun.misc.PerformanceLogger;
 import sun.print.PrintJob2D;
 import sun.security.action.GetBooleanAction;
@@ -109,7 +110,7 @@
     static int awt_multiclick_time;
     static boolean securityWarningEnabled;
 
-    private static int screenWidth = -1, screenHeight = -1; // Dimensions of default screen
+    private static volatile int screenWidth = -1, screenHeight = -1; // Dimensions of default screen
     static long awt_defaultFg; // Pixel
     private static XMouseInfoPeer xPeer;
     private static Method m_removeSourceEvents;
@@ -310,6 +311,19 @@
             System.setProperty("sun.awt.enableExtraMouseButtons", ""+areExtraMouseButtonsEnabled);
 
             saved_error_handler = XlibWrapper.SetToolkitErrorHandler();
+
+            // Detect display mode changes
+            XlibWrapper.XSelectInput(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(), XConstants.StructureNotifyMask);
+            XToolkit.addEventDispatcher(XToolkit.getDefaultRootWindow(), new XEventDispatcher() {
+                @Override
+                public void dispatchEvent(XEvent ev) {
+                    if (ev.get_type() == XConstants.ConfigureNotify) {
+                        ((X11GraphicsEnvironment)GraphicsEnvironment.
+                         getLocalGraphicsEnvironment()).
+                            displayChanged();
+                    }
+                }
+            });
         } finally {
             awtUnlock();
         }
@@ -684,29 +698,49 @@
         }
     }
 
-    static int getDefaultScreenWidth() {
-        if (screenWidth == -1) {
-            long display = getDisplay();
+    static {
+        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        if (ge instanceof SunGraphicsEnvironment) {
+            ((SunGraphicsEnvironment)ge).addDisplayChangedListener(
+                new DisplayChangedListener() {
+                    @Override
+                    public void displayChanged() {
+                        // 7045370: Reset the cached values
+                        XToolkit.screenWidth = -1;
+                        XToolkit.screenHeight = -1;
+                    }
+
+                    @Override
+                    public void paletteChanged() {}
+            });
+        }
+    }
+
+    private static void initScreenSize() {
+        if (screenWidth == -1 || screenHeight == -1) {
             awtLock();
             try {
-                screenWidth = (int) XlibWrapper.DisplayWidth(display, XlibWrapper.DefaultScreen(display));
+                XWindowAttributes pattr = new XWindowAttributes();
+                try {
+                    XlibWrapper.XGetWindowAttributes(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(), pattr.pData);
+                    screenWidth  = (int) pattr.get_width();
+                    screenHeight = (int) pattr.get_height();
+                } finally {
+                    pattr.dispose();
+                }
             } finally {
                 awtUnlock();
             }
         }
+    }
+
+    static int getDefaultScreenWidth() {
+        initScreenSize();
         return screenWidth;
     }
 
     static int getDefaultScreenHeight() {
-        if (screenHeight == -1) {
-            long display = getDisplay();
-            awtLock();
-            try {
-                screenHeight = (int) XlibWrapper.DisplayHeight(display, XlibWrapper.DefaultScreen(display));
-            } finally {
-                awtUnlock();
-            }
-        }
+        initScreenSize();
         return screenHeight;
     }
 
--- a/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Thu Dec 15 19:52:13 2011 -0800
@@ -208,12 +208,19 @@
         return name;
     }
 
+    private static native String getLocalHostname();
+    private static native int getJvmPID();
+
     void postInit(XCreateWindowParams params) {
         super.postInit(params);
 
         // Init WM_PROTOCOLS atom
         initWMProtocols();
 
+        // Set _NET_WM_PID and WM_CLIENT_MACHINE using this JVM
+        XAtom.get("WM_CLIENT_MACHINE").setProperty(getWindow(), getLocalHostname());
+        XAtom.get("_NET_WM_PID").setCard32Property(getWindow(), getJvmPID());
+
         // Set WM_TRANSIENT_FOR and group_leader
         Window t_window = (Window)target;
         Window owner = t_window.getOwner();
--- a/src/solaris/classes/sun/awt/X11GraphicsDevice.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/classes/sun/awt/X11GraphicsDevice.java	Thu Dec 15 19:52:13 2011 -0800
@@ -487,14 +487,9 @@
      * X11GraphicsEnvironment when the display mode has been changed.
      */
     public synchronized void displayChanged() {
-        // reset the list of configs (and default config)
-        defaultConfig = null;
-        configs = null;
-        doubleBufferVisuals = null;
-
-        // reset the native data structures associated with this device (they
-        // will be reinitialized when the GraphicsConfigs are configured)
-        resetNativeData(screen);
+        // On X11 the visuals do not change, and therefore we don't need
+        // to reset the defaultConfig, config, doubleBufferVisuals,
+        // neither do we need to reset the native data.
 
         // pass on to all top-level windows on this screen
         topLevels.notifyListeners();
--- a/src/solaris/classes/sun/awt/motif/AWTLockAccess.java	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 1998, 2000, 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.
- */
-
-package sun.awt.motif;
-
-final class AWTLockAccess {
-    static native void awtLock();
-    static native void awtUnlock();
-    static void awtWait() { awtWait(0); }
-    static native void awtWait(long timeout);
-    static native void awtNotifyAll();
-}
--- a/src/solaris/classes/sun/awt/motif/MFontConfiguration.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/classes/sun/awt/motif/MFontConfiguration.java	Thu Dec 15 19:52:13 2011 -0800
@@ -25,26 +25,19 @@
 
 package sun.awt.motif;
 
-import java.awt.Font;
-import java.io.BufferedReader;
+import sun.awt.FontConfiguration;
+import sun.awt.X11FontManager;
+import sun.font.FontUtilities;
+import sun.font.SunFontManager;
+import sun.util.logging.PlatformLogger;
+
 import java.io.File;
 import java.io.FileInputStream;
-import java.io.InputStreamReader;
 import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Locale;
 import java.util.Properties;
 import java.util.Scanner;
-import sun.awt.FontConfiguration;
-import sun.awt.X11FontManager;
-import sun.awt.X11GraphicsEnvironment;
-import sun.font.FontManager;
-import sun.font.SunFontManager;
-import sun.font.FontManagerFactory;
-import sun.font.FontUtilities;
-import sun.java2d.SunGraphicsEnvironment;
-import sun.util.logging.PlatformLogger;
 
 public class MFontConfiguration extends FontConfiguration {
 
@@ -258,47 +251,6 @@
         return Charset.forName("ISO8859_1");
     }
 
-    /* methods for Motif support *********************************************/
-
-    private String[][] motifFontSets = new String[NUM_FONTS][NUM_STYLES];
-
-    public String getMotifFontSet(String fontName, int style) {
-        assert isLogicalFontFamilyName(fontName);
-        fontName = fontName.toLowerCase(Locale.ENGLISH);
-        int fontIndex = getFontIndex(fontName);
-        int styleIndex = getStyleIndex(style);
-        return getMotifFontSet(fontIndex, styleIndex);
-    }
-
-    private String getMotifFontSet(int fontIndex, int styleIndex) {
-        String fontSet = motifFontSets[fontIndex][styleIndex];
-        if (fontSet == null) {
-            fontSet = buildMotifFontSet(fontIndex, styleIndex);
-            motifFontSets[fontIndex][styleIndex] = fontSet;
-        }
-        return fontSet;
-    }
-
-    private String buildMotifFontSet(int fontIndex, int styleIndex) {
-        StringBuilder buffer = new StringBuilder();
-        short[] scripts = getCoreScripts(fontIndex);
-        for (int i = 0; i < scripts.length; i++) {
-            short nameID = getComponentFontIDMotif(scripts[i], fontIndex, styleIndex);
-            if (nameID == 0) {
-                nameID = getComponentFontID(scripts[i], fontIndex, styleIndex);
-            }
-            String name = getComponentFontName(nameID);
-            if (name == null || name.endsWith("fontspecific")) {
-                continue;
-            }
-            if (buffer.length() > 0) {
-                buffer.append(',');
-            }
-            buffer.append(name);
-        }
-        return buffer.toString();
-    }
-
     protected String getFaceNameFromComponentFontName(String componentFontName) {
         return null;
     }
@@ -315,36 +267,6 @@
         return ((X11FontManager) fontManager).getFileNameFromXLFD(componentFontName);
     }
 
-    /**
-     * Get default font for Motif widgets to use, preventing them from
-     * wasting time accessing inappropriate X resources.  This is called
-     * only from native code.
-     *
-     * This is part of a Motif specific performance enhancement.  By
-     * default, when Motif widgets are created and initialized, Motif will
-     * set up default fonts for the widgets, which we ALWAYS override.
-     * This set up includes finding the default font in the widget's X
-     * resources and fairly expensive requests of the X server to identify
-     * the specific font or fontset.  We avoid all of this overhead by
-     * providing a well known font to use at the creation of widgets, where
-     * possible.
-     *
-     * The X11 fonts are specified by XLFD strings which have %d as a
-     * marker to indicate where the fontsize should be substituted.  [The
-     * libc function sprintf() is used to replace it.]  The value 140
-     * specifies a font size of 14 points.
-     */
-    private static String getDefaultMotifFontSet() {
-        String font = ((MFontConfiguration) getFontConfiguration()).getMotifFontSet("sansserif", Font.PLAIN);
-        if (font != null) {
-            int i;
-            while ((i = font.indexOf("%d")) >= 0) {
-                font = font.substring(0, i) + "140" + font.substring(i+2);
-            }
-        }
-        return font;
-    }
-
     public HashSet<String> getAWTFontPathSet() {
         HashSet<String> fontDirs = new HashSet<String>();
         short[] scripts = getCoreScripts(0);
--- a/src/solaris/classes/sun/awt/motif/MFontPeer.java	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 1996, 2003, 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.
- */
-package sun.awt.motif;
-
-import java.awt.GraphicsEnvironment;
-import sun.awt.PlatformFont;
-
-public class MFontPeer extends PlatformFont {
-
-    /*
-     * XLFD name for XFontSet.
-     */
-    private String xfsname;
-
-    /*
-     * converter name for this XFontSet encoding.
-     */
-    private String converter;
-
-    static {
-        if (!GraphicsEnvironment.isHeadless()) {
-            initIDs();
-        }
-    }
-
-    /**
-     * Initialize JNI field and method IDs for fields that may be
-       accessed from C.
-     */
-    private static native void initIDs();
-
-    public MFontPeer(String name, int style){
-        super(name, style);
-
-        if (fontConfig != null) {
-            xfsname = ((MFontConfiguration) fontConfig).getMotifFontSet(familyName, style);
-        }
-    }
-
-    protected char getMissingGlyphCharacter() {
-        return '\u274F';
-    }
-}
--- a/src/solaris/classes/sun/awt/motif/MToolkit.java	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,849 +0,0 @@
-/*
- * Copyright (c) 1995, 2011, 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.
- */
-
-package sun.awt.motif;
-
-import java.awt.*;
-import java.awt.im.InputMethodHighlight;
-import java.awt.im.spi.InputMethodDescriptor;
-import java.awt.image.*;
-import java.awt.peer.*;
-import java.awt.datatransfer.Clipboard;
-import java.awt.event.*;
-import java.lang.reflect.*;
-import java.lang.Math;
-import java.io.*;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-import java.util.Properties;
-import java.util.Map;
-import java.util.Iterator;
-
-import sun.awt.AppContext;
-import sun.awt.AWTAutoShutdown;
-import sun.awt.SunToolkit;
-import sun.awt.UNIXToolkit;
-import sun.awt.GlobalCursorManager;
-import sun.awt.datatransfer.DataTransferer;
-
-import java.awt.dnd.DragSource;
-import java.awt.dnd.DragGestureListener;
-import java.awt.dnd.DragGestureEvent;
-import java.awt.dnd.DragGestureRecognizer;
-import java.awt.dnd.MouseDragGestureRecognizer;
-import java.awt.dnd.InvalidDnDOperationException;
-import java.awt.dnd.peer.DragSourceContextPeer;
-
-//import sun.awt.motif.MInputMethod;
-import sun.awt.X11FontManager;
-import sun.awt.X11GraphicsConfig;
-import sun.awt.X11GraphicsEnvironment;
-import sun.awt.XSettings;
-
-//import sun.awt.motif.MDragSourceContextPeer;
-
-import sun.print.PrintJob2D;
-
-import sun.misc.PerformanceLogger;
-import sun.misc.Unsafe;
-
-import sun.security.action.GetBooleanAction;
-import sun.util.logging.PlatformLogger;
-
-public class MToolkit extends UNIXToolkit implements Runnable {
-
-    private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.motif.MToolkit");
-
-    // the system clipboard - CLIPBOARD selection
-    //X11Clipboard clipboard;
-    // the system selection - PRIMARY selection
-    //X11Clipboard selection;
-
-    // Dynamic Layout Resize client code setting
-    protected static boolean dynamicLayoutSetting = false;
-
-    /**
-     * True when the x settings have been loaded.
-     */
-    private boolean loadedXSettings;
-
-    /**
-     * XSETTINGS for the default screen.
-     * <p>
-     * <strong>XXX:</strong> see <code>MToolkit.parseXSettings</code>
-     * and <code>awt_xsettings_update</code> in
-     * <samp>awt_MToolkit.c</samp>
-     */
-    private XSettings xs;
-
-    /*
-     * Note: The MToolkit object depends on the static initializer
-     * of X11GraphicsEnvironment to initialize the connection to
-     * the X11 server.
-     */
-    static final X11GraphicsConfig config;
-
-    private static final boolean motifdnd;
-
-    static {
-        if (GraphicsEnvironment.isHeadless()) {
-            config = null;
-        } else {
-            config = (X11GraphicsConfig) (GraphicsEnvironment.
-                             getLocalGraphicsEnvironment().
-                             getDefaultScreenDevice().
-                             getDefaultConfiguration());
-        }
-
-        motifdnd = ((Boolean)java.security.AccessController.doPrivileged(
-            new GetBooleanAction("awt.dnd.motifdnd"))).booleanValue();
-    }
-
-    //public static final String DATA_TRANSFERER_CLASS_NAME = "sun.awt.motif.MDataTransferer";
-
-    public MToolkit() {
-        super();
-        if (PerformanceLogger.loggingEnabled()) {
-            PerformanceLogger.setTime("MToolkit construction");
-        }
-        if (!GraphicsEnvironment.isHeadless()) {
-            String mainClassName = null;
-
-            StackTraceElement trace[] = (new Throwable()).getStackTrace();
-            int bottom = trace.length - 1;
-            if (bottom >= 0) {
-                mainClassName = trace[bottom].getClassName();
-            }
-            if (mainClassName == null || mainClassName.equals("")) {
-                mainClassName = "AWT";
-            }
-
-            init(mainClassName);
-            //SunToolkit.setDataTransfererClassName(DATA_TRANSFERER_CLASS_NAME);
-
-            Thread toolkitThread = new Thread(this, "AWT-Motif");
-            toolkitThread.setPriority(Thread.NORM_PRIORITY + 1);
-            toolkitThread.setDaemon(true);
-
-            PrivilegedAction<Void> a = new PrivilegedAction<Void>() {
-                public Void run() {
-                    ThreadGroup mainTG = Thread.currentThread().getThreadGroup();
-                    ThreadGroup parentTG = mainTG.getParent();
-
-                    while (parentTG != null) {
-                        mainTG = parentTG;
-                        parentTG = mainTG.getParent();
-                    }
-                    Thread shutdownThread = new Thread(mainTG, new Runnable() {
-                            public void run() {
-                                shutdown();
-                            }
-                        }, "Shutdown-Thread");
-                    shutdownThread.setContextClassLoader(null);
-                    Runtime.getRuntime().addShutdownHook(shutdownThread);
-                    return null;
-                }
-            };
-            AccessController.doPrivileged(a);
-
-            /*
-             * Fix for 4701990.
-             * AWTAutoShutdown state must be changed before the toolkit thread
-             * starts to avoid race condition.
-             */
-            AWTAutoShutdown.notifyToolkitThreadBusy();
-
-            toolkitThread.start();
-        }
-    }
-
-    public native void init(String mainClassName);
-    public native void run();
-    private native void shutdown();
-
-    /*
-     * Create peer objects.
-     */
-
-    public ButtonPeer createButton(Button target) {
-        //ButtonPeer peer = new MButtonPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public TextFieldPeer createTextField(TextField target) {
-        //TextFieldPeer peer = new MTextFieldPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public LabelPeer createLabel(Label target) {
-        //LabelPeer peer = new MLabelPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public ListPeer createList(List target) {
-        //ListPeer peer = new MListPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public CheckboxPeer createCheckbox(Checkbox target) {
-        //CheckboxPeer peer = new MCheckboxPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public ScrollbarPeer createScrollbar(Scrollbar target) {
-        //ScrollbarPeer peer = new MScrollbarPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public ScrollPanePeer createScrollPane(ScrollPane target) {
-        //ScrollPanePeer peer = new MScrollPanePeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public TextAreaPeer createTextArea(TextArea target) {
-        //TextAreaPeer peer = new MTextAreaPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public ChoicePeer createChoice(Choice target) {
-        //ChoicePeer peer = new MChoicePeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public FramePeer  createFrame(Frame target) {
-        //FramePeer peer = new MFramePeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public CanvasPeer createCanvas(Canvas target) {
-        //CanvasPeer peer = (isXEmbedServerRequested() ? new MEmbedCanvasPeer(target) : new MCanvasPeer(target));
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public PanelPeer createPanel(Panel target) {
-        //PanelPeer peer = new MPanelPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public WindowPeer createWindow(Window target) {
-        //WindowPeer peer = new MWindowPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public DialogPeer createDialog(Dialog target) {
-        //DialogPeer peer = new MDialogPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public FileDialogPeer createFileDialog(FileDialog target) {
-        //FileDialogPeer peer = new MFileDialogPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public MenuBarPeer createMenuBar(MenuBar target) {
-        //MenuBarPeer peer = new MMenuBarPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public MenuPeer createMenu(Menu target) {
-        //MenuPeer peer = new MMenuPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public PopupMenuPeer createPopupMenu(PopupMenu target) {
-        //PopupMenuPeer peer = new MPopupMenuPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public MenuItemPeer createMenuItem(MenuItem target) {
-        //MenuItemPeer peer = new MMenuItemPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target) {
-        //CheckboxMenuItemPeer peer = new MCheckboxMenuItemPeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-        return null;
-    }
-
-    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
-        return null;
-    }
-
-    //public MEmbeddedFramePeer createEmbeddedFrame(MEmbeddedFrame target)
-    //{
-        //MEmbeddedFramePeer peer = new MEmbeddedFramePeer(target);
-        //targetCreatedPeer(target, peer);
-        //return peer;
-    //    return null;
-    //}
-
-
-    public FontPeer getFontPeer(String name, int style){
-        return new MFontPeer(name, style);
-    }
-
-    /*
-     * On X, support for dynamic layout on resizing is governed by the
-     * window manager.  If the window manager supports it, it happens
-     * automatically.  The setter method for this property is
-     * irrelevant on X.
-     */
-    public void setDynamicLayout(boolean b) {
-        dynamicLayoutSetting = b;
-    }
-
-    protected boolean isDynamicLayoutSet() {
-        return dynamicLayoutSetting;
-    }
-
-    /* Called from isDynamicLayoutActive() and from
-     * lazilyLoadDynamicLayoutSupportedProperty()
-     */
-    protected native boolean isDynamicLayoutSupportedNative();
-
-    public boolean isDynamicLayoutActive() {
-        return isDynamicLayoutSupportedNative();
-    }
-
-    public native boolean isFrameStateSupported(int state);
-
-    public TrayIconPeer createTrayIcon(TrayIcon target) throws HeadlessException {
-        return null;
-    }
-
-    public SystemTrayPeer createSystemTray(SystemTray target) throws HeadlessException {
-        return null;
-    }
-
-    public boolean isTraySupported() {
-        return false;
-    }
-
-    static native ColorModel makeColorModel();
-    static ColorModel screenmodel;
-
-    static ColorModel getStaticColorModel() {
-        if (screenmodel == null) {
-            screenmodel = config.getColorModel ();
-        }
-        return screenmodel;
-    }
-
-    public ColorModel getColorModel() {
-        return getStaticColorModel();
-    }
-
-    public native int getScreenResolution();
-
-    public Insets getScreenInsets(GraphicsConfiguration gc) {
-        return new Insets(0,0,0,0);
-    }
-
-    protected native int getScreenWidth();
-    protected native int getScreenHeight();
-
-    public FontMetrics getFontMetrics(Font font) {
-        /*
-        // REMIND: platform font flag should be obsolete soon
-        if (!RasterOutputManager.usesPlatformFont()) {
-            return super.getFontMetrics(font);
-        } else {
-            return X11FontMetrics.getFontMetrics(font);
-        }
-        */
-        return super.getFontMetrics(font);
-    }
-
-    public PrintJob getPrintJob(final Frame frame, final String doctitle,
-                                final Properties props) {
-
-        if (GraphicsEnvironment.isHeadless()) {
-            throw new IllegalArgumentException();
-        }
-
-        PrintJob2D printJob = new PrintJob2D(frame, doctitle, props);
-
-        if (printJob.printDialog() == false) {
-            printJob = null;
-        }
-
-        return printJob;
-    }
-
-    public PrintJob getPrintJob(final Frame frame, final String doctitle,
-                                final JobAttributes jobAttributes,
-                                final PageAttributes pageAttributes) {
-
-
-        if (GraphicsEnvironment.isHeadless()) {
-            throw new IllegalArgumentException();
-        }
-
-        PrintJob2D printJob = new PrintJob2D(frame, doctitle,
-                                             jobAttributes, pageAttributes);
-
-        if (printJob.printDialog() == false) {
-            printJob = null;
-        }
-
-        return printJob;
-    }
-
-    public native void beep();
-
-    public  Clipboard getSystemClipboard() {
-        //SecurityManager security = System.getSecurityManager();
-        //if (security != null) {
-        //  security.checkSystemClipboardAccess();
-        //}
-        //synchronized (this) {
-        //    if (clipboard == null) {
-        //        clipboard = new X11Clipboard("System", "CLIPBOARD");
-        //    }
-        //}
-        //return clipboard;
-        return null;
-    }
-
-    public Clipboard getSystemSelection() {
-        //SecurityManager security = System.getSecurityManager();
-        //if (security != null) {
-        //    security.checkSystemClipboardAccess();
-        //}
-        //synchronized (this) {
-        //    if (selection == null) {
-        //        selection = new X11Clipboard("Selection", "PRIMARY");
-        //    }
-        //}
-        //return selection;
-        return null;
-    }
-
-    public boolean getLockingKeyState(int key) {
-        if (! (key == KeyEvent.VK_CAPS_LOCK || key == KeyEvent.VK_NUM_LOCK ||
-               key == KeyEvent.VK_SCROLL_LOCK || key == KeyEvent.VK_KANA_LOCK)) {
-            throw new IllegalArgumentException("invalid key for Toolkit.getLockingKeyState");
-        }
-        return getLockingKeyStateNative(key);
-    }
-
-    public native boolean getLockingKeyStateNative(int key);
-
-    public native void loadSystemColors(int[] systemColors);
-
-    /**
-     * Give native peers the ability to query the native container
-     * given a native component (e.g. the direct parent may be lightweight).
-     */
-    public static Container getNativeContainer(Component c) {
-        return Toolkit.getNativeContainer(c);
-    }
-
-    protected static final Object targetToPeer(Object target) {
-        return SunToolkit.targetToPeer(target);
-    }
-
-    protected static final void targetDisposedPeer(Object target, Object peer) {
-        SunToolkit.targetDisposedPeer(target, peer);
-    }
-
-    public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException {
-        //if (MToolkit.useMotifDnD()) {
-        //    return MDragSourceContextPeer.createDragSourceContextPeer(dge);
-        //} else {
-        //    return X11DragSourceContextPeer.createDragSourceContextPeer(dge);
-        //}
-        return null;
-    }
-
-    public <T extends DragGestureRecognizer> T
-        createDragGestureRecognizer(Class<T> abstractRecognizerClass,
-                                    DragSource ds, Component c, int srcActions,
-                                    DragGestureListener dgl)
-    {
-        //if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass))
-        //    return (T)new MMouseDragGestureRecognizer(ds, c, srcActions, dgl);
-        //else
-            return null;
-    }
-
-    /**
-     * Returns a new input method adapter descriptor for native input methods.
-     */
-    public InputMethodDescriptor getInputMethodAdapterDescriptor() throws AWTException {
-        return null; // return new MInputMethodDescriptor();
-    }
-
-    /**
-     * Returns a style map for the input method highlight.
-     */
-    public Map mapInputMethodHighlight(InputMethodHighlight highlight) {
-        return null; //return MInputMethod.mapInputMethodHighlight(highlight);
-    }
-
-    /**
-     * Returns a new custom cursor.
-     */
-    public Cursor createCustomCursor(Image cursor, Point hotSpot, String name)
-        throws IndexOutOfBoundsException {
-        return null; //return new MCustomCursor(cursor, hotSpot, name);
-    }
-
-    /**
-     * Returns the supported cursor size
-     */
-    public Dimension getBestCursorSize(int preferredWidth, int preferredHeight) {
-        return null; //MCustomCursor.getBestCursorSize(
-            //java.lang.Math.max(1,preferredWidth), java.lang.Math.max(1,preferredHeight));
-    }
-
-    public int getMaximumCursorColors() {
-        return 2;  // Black and white.
-    }
-
-    private final static String prefix  = "DnD.Cursor.";
-    private final static String postfix = ".32x32";
-    private static final String dndPrefix  = "DnD.";
-
-    protected Object lazilyLoadDesktopProperty(String name) {
-        if (name.startsWith(prefix)) {
-            String cursorName = name.substring(prefix.length(), name.length()) + postfix;
-
-            try {
-                return Cursor.getSystemCustomCursor(cursorName);
-            } catch (AWTException awte) {
-                System.err.println("cannot load system cursor: " + cursorName);
-
-                return null;
-            }
-        }
-
-        if (name.equals("awt.dynamicLayoutSupported")) {
-            return lazilyLoadDynamicLayoutSupportedProperty(name);
-        }
-
-        if (!loadedXSettings &&
-            (name.startsWith("gnome.") ||
-             name.equals(SunToolkit.DESKTOPFONTHINTS) ||
-             name.startsWith(dndPrefix))) {
-            loadedXSettings = true;
-            if (!GraphicsEnvironment.isHeadless()) {
-                loadXSettings();
-                desktopProperties.put(SunToolkit.DESKTOPFONTHINTS,
-                                      SunToolkit.getDesktopFontHints());
-                return desktopProperties.get(name);
-            }
-        }
-
-        return super.lazilyLoadDesktopProperty(name);
-    }
-
-    /*
-     * Called from lazilyLoadDesktopProperty because we may not know if
-     * the user has quit the previous window manager and started another.
-     */
-    protected Boolean lazilyLoadDynamicLayoutSupportedProperty(String name) {
-        boolean nativeDynamic = isDynamicLayoutSupportedNative();
-
-        if (log.isLoggable(PlatformLogger.FINER)) {
-            log.finer("nativeDynamic == " + nativeDynamic);
-        }
-
-        return Boolean.valueOf(nativeDynamic);
-    }
-
-    private native int getMulticlickTime();
-
-    protected void initializeDesktopProperties() {
-        desktopProperties.put("DnD.Autoscroll.initialDelay",     Integer.valueOf(50));
-        desktopProperties.put("DnD.Autoscroll.interval",         Integer.valueOf(50));
-        desktopProperties.put("DnD.Autoscroll.cursorHysteresis", Integer.valueOf(5));
-
-        /* As of 1.4, no wheel mice are supported on Solaris
-         * however, they are on Linux, and there isn't a way to detect them,
-         * so we leave this property unset to indicate we're not sure if there's
-         * a wheel mouse or not.
-         */
-        //desktopProperties.put("awt.wheelMousePresent", Boolean.valueOf(false));
-
-        // We don't want to call getMultilclickTime() if we're headless
-        if (!GraphicsEnvironment.isHeadless()) {
-            desktopProperties.put("awt.multiClickInterval",
-                                  Integer.valueOf(getMulticlickTime()));
-            desktopProperties.put("awt.mouse.numButtons",
-                                  Integer.valueOf(getNumberOfButtons()));
-        }
-    }
-
-    public RobotPeer createRobot(Robot target, GraphicsDevice screen) {
-        /* 'target' is unused for now... */
-        //return new MRobotPeer(screen.getDefaultConfiguration());
-        return null;
-    }
-
-    static boolean useMotifDnD() {
-        return motifdnd;
-    }
-
-    //
-    // The following support Gnome's equivalent of desktop properties.
-    // A writeup of this can be found at:
-    // http://www.freedesktop.org/standards/xsettings/xsettings.html
-    //
-
-    /**
-     * Triggers a callback to parseXSettings with the x settings values
-     * from the window server. Note that this will NOT call
-     * parseXSettings if we are not running on a GNOME desktop.
-     */
-    private native void loadXSettings();
-
-    /**
-     * Callback from the native side indicating some, or all, of the
-     * desktop properties have changed and need to be reloaded.
-     * <code>data</code> is the byte array directly from the x server and
-     * may be in little endian format.
-     * <p>
-     * NB: This could be called from any thread if triggered by
-     * <code>loadXSettings</code>.  It is called from the toolkit
-     * thread if triggered by an XSETTINGS change.
-     */
-    private void parseXSettings(int screen_XXX_ignored, byte[] data) {
-        // XXX: notyet: map screen -> per screen XSettings object
-        // for now native code only calls us for default screen
-        // see awt_MToolkit.c awt_xsettings_update().
-        if (xs == null) {
-            xs = new XSettings();
-        }
-
-        Map updatedSettings = xs.update(data);
-        if (updatedSettings == null || updatedSettings.isEmpty()) {
-            return;
-        }
-
-        Iterator i = updatedSettings.entrySet().iterator();
-        while (i.hasNext()) {
-            Map.Entry e = (Map.Entry)i.next();
-            String name = (String)e.getKey();
-
-            name = "gnome." + name;
-            setDesktopProperty(name, e.getValue());
-
-            // XXX: we probably want to do something smarter.  In
-            // particular, "Net" properties are of interest to the
-            // "core" AWT itself.  E.g.
-            //
-            // Net/DndDragThreshold -> ???
-            // Net/DoubleClickTime  -> awt.multiClickInterval
-        }
-
-        setDesktopProperty(SunToolkit.DESKTOPFONTHINTS,
-                           SunToolkit.getDesktopFontHints());
-
-        Integer dragThreshold = null;
-        synchronized (this) {
-            dragThreshold = (Integer)desktopProperties.get("gnome.Net/DndDragThreshold");
-        }
-        if (dragThreshold != null) {
-            setDesktopProperty("DnD.gestureMotionThreshold", dragThreshold);
-        }
-    }
-
-    protected boolean needsXEmbedImpl() {
-        return true;
-    }
-
-    public boolean isModalityTypeSupported(Dialog.ModalityType modalityType) {
-        return (modalityType == Dialog.ModalityType.MODELESS) ||
-               (modalityType == Dialog.ModalityType.APPLICATION_MODAL);
-    }
-
-    public boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType exclusionType) {
-        return (exclusionType == Dialog.ModalExclusionType.NO_EXCLUDE);
-    }
-
-    private native boolean isSyncUpdated();
-    private native boolean isSyncFailed();
-    private native int getEventNumber();
-    private native void updateSyncSelection();
-    private static final long WORKAROUND_SLEEP = 100;
-
-    /**
-     * @inheritDoc
-     */
-    protected boolean syncNativeQueue(final long timeout) {
-        awtLock();
-        try {
-            long event_number = getEventNumber();
-            updateSyncSelection();
-
-            // Wait for selection notify for oops on win
-            long start = System.currentTimeMillis();
-            while (!isSyncUpdated() && !isSyncFailed()) {
-                try {
-                    awtLockWait(timeout);
-                } catch (InterruptedException e) {
-                    throw new RuntimeException(e);
-                }
-                // This "while" is a protection from spurious
-                // wake-ups.  However, we shouldn't wait for too long
-                if (((System.currentTimeMillis() - start) > timeout) && (timeout >= 0)) {
-                    throw new OperationTimedOut();
-                }
-            }
-            if (isSyncFailed() && getEventNumber() - event_number == 1) {
-                awtUnlock();
-                try {
-                    Thread.sleep(WORKAROUND_SLEEP);
-                } catch (InterruptedException ie) {
-                    throw new RuntimeException(ie);
-                } finally {
-                    awtLock();
-                }
-            }
-            return getEventNumber() - event_number > 2;
-        } finally {
-            awtUnlock();
-        }
-    }
-
-    public  void grab(Window w) {
-        WindowPeer peer = (WindowPeer)w.getPeer();
-        if (peer != null) {
-            nativeGrab(peer);
-        }
-    }
-
-    public void ungrab(Window w) {
-        WindowPeer peer = (WindowPeer)w.getPeer();
-        if (peer != null) {
-            nativeUnGrab(peer);
-        }
-    }
-    private native void nativeGrab(WindowPeer peer);
-    private native void nativeUnGrab(WindowPeer peer);
-
-
-    public boolean isDesktopSupported(){
-        return false;
-    }
-
-    public DesktopPeer createDesktopPeer(Desktop target)
-    throws HeadlessException{
-        throw new UnsupportedOperationException();
-    }
-
-    public final static int
-        UNDETERMINED_WM = 1,
-        NO_WM = 2,
-        OTHER_WM = 3,
-        OPENLOOK_WM = 4,
-        MOTIF_WM = 5,
-        CDE_WM = 6,
-        ENLIGHTEN_WM = 7,
-        KDE2_WM = 8,
-        SAWFISH_WM = 9,
-        ICE_WM = 10,
-        METACITY_WM = 11,
-        COMPIZ_WM = 12,
-        LG3D_WM = 13;
-
-    public static int getWMID() {
-        String wmName = getWMName();
-
-        if ("NO_WM".equals(wmName)) {
-            return NO_WM;
-        } else if ("OTHER_WM".equals(wmName)) {
-            return OTHER_WM;
-        } else if ("ENLIGHTEN_WM".equals(wmName)) {
-            return ENLIGHTEN_WM;
-        } else if ("KDE2_WM".equals(wmName)) {
-            return KDE2_WM;
-        } else if ("SAWFISH_WM".equals(wmName)) {
-            return SAWFISH_WM;
-        } else if ("ICE_WM".equals(wmName)) {
-            return ICE_WM;
-        } else if ("METACITY_WM".equals(wmName)) {
-            return METACITY_WM;
-        } else if ("OPENLOOK_WM".equals(wmName)) {
-            return OPENLOOK_WM;
-        } else if ("MOTIF_WM".equals(wmName)) {
-            return MOTIF_WM;
-        } else if ("CDE_WM".equals(wmName)) {
-            return CDE_WM;
-        } else if ("COMPIZ_WM".equals(wmName)) {
-            return COMPIZ_WM;
-        } else if ("LG3D_WM".equals(wmName)) {
-            return LG3D_WM;
-        }
-        return UNDETERMINED_WM;
-    }
-
-    private static native String getWMName();
-
-} // class MToolkit
--- a/src/solaris/classes/sun/awt/motif/MToolkitThreadBlockedHandler.java	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2001, 2005, 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.
- */
-
-package sun.awt.motif;
-
-import sun.awt.datatransfer.ToolkitThreadBlockedHandler;
-import sun.awt.SunToolkit;
-
-final class MToolkitThreadBlockedHandler implements
-                                 ToolkitThreadBlockedHandler {
-    private static ToolkitThreadBlockedHandler priveleged_lock = null;
-    static {
-        priveleged_lock = new MToolkitThreadBlockedHandler();
-    }
-    private MToolkitThreadBlockedHandler() {}
-    static ToolkitThreadBlockedHandler getToolkitThreadBlockedHandler() {
-        return priveleged_lock;
-    }
-    public void lock() {
-        SunToolkit.awtLock();
-    }
-    public void unlock() {
-        SunToolkit.awtUnlock();
-    }
-    public native void enter();
-    public native void exit();
-}
--- a/src/solaris/classes/sun/awt/motif/MWindowAttributes.java	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 1999, 2002, 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.
- */
-package sun.awt.motif;
-import java.awt.Image;
-
-class MWindowAttributes {
-    static int NORMAL           = 0;
-    static int ICONIC           = 1;
-    static int MAXIMIZED        = 2;
-
-    static int AWT_DECOR_NONE        = 0;
-    static int AWT_DECOR_ALL         = 1;
-    static int AWT_DECOR_BORDER      = 2;
-    static int AWT_DECOR_RESIZEH     = 4;
-    static int AWT_DECOR_TITLE       = 8;
-    static int AWT_DECOR_MENU        = 0x10;
-    static int AWT_DECOR_MINIMIZE    = 0x20;
-    static int AWT_DECOR_MAXIMIZE    = 0x40;
-    static int AWT_UNOBSCURED        = 0;   // X11 VisibilityUnobscured
-    static int AWT_PARTIALLY_OBSCURED = 1;  // X11 VisibilityPartiallyObscured
-    static int AWT_FULLY_OBSCURED    =  2;  // X11 VisibilityFullyObscured
-    static int AWT_UNKNOWN_OBSCURITY = 3;
-
-    boolean nativeDecor;
-    boolean initialFocus;
-    boolean isResizable;
-    int initialState;
-    int visibilityState; // updated by native X11 event handling code.
-    String title;
-    java.awt.Image icon;
-    int decorations;            // for future expansion to be able to
-                                // specify native decorations
-
-    private static native void initIDs();
-
-    static {
-        initIDs();
-    }
-
-    MWindowAttributes() {
-        nativeDecor = false;
-        initialFocus = false;
-        isResizable = false;
-        initialState = NORMAL;
-        visibilityState = AWT_UNKNOWN_OBSCURITY;
-        title = null;
-        icon = null;
-        decorations = 0;
-    }
-}
--- a/src/solaris/classes/sun/awt/motif/X11FontMetrics.java	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,230 +0,0 @@
-/*
- * Copyright (c) 1995, 2004, 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.
- */
-
-package sun.awt.motif;
-
-import java.awt.*;
-import java.util.Hashtable;
-import sun.awt.PlatformFont;
-
-/**
- * A font metrics object for a WServer font.
- *
- * @author Jim Graham
- */
-public class X11FontMetrics extends FontMetrics {
-    /**
-     * The widths of the first 256 characters.
-     */
-    int widths[];
-
-    /**
-     * The standard ascent of the font.  This is the logical height
-     * above the baseline for the Alphanumeric characters and should
-     * be used for determining line spacing.  Note, however, that some
-     * characters in the font may extend above this height.
-     */
-    int ascent;
-
-    /**
-     * The standard descent of the font.  This is the logical height
-     * below the baseline for the Alphanumeric characters and should
-     * be used for determining line spacing.  Note, however, that some
-     * characters in the font may extend below this height.
-     */
-    int descent;
-
-    /**
-     * The standard leading for the font.  This is the logical amount
-     * of space to be reserved between the descent of one line of text
-     * and the ascent of the next line.  The height metric is calculated
-     * to include this extra space.
-     */
-    int leading;
-
-    /**
-     * The standard height of a line of text in this font.  This is
-     * the distance between the baseline of adjacent lines of text.
-     * It is the sum of the ascent+descent+leading.  There is no
-     * guarantee that lines of text spaced at this distance will be
-     * disjoint; such lines may overlap if some characters overshoot
-     * the standard ascent and descent metrics.
-     */
-    int height;
-
-    /**
-     * The maximum ascent for all characters in this font.  No character
-     * will extend further above the baseline than this metric.
-     */
-    int maxAscent;
-
-    /**
-     * The maximum descent for all characters in this font.  No character
-     * will descend further below the baseline than this metric.
-     */
-    int maxDescent;
-
-    /**
-     * The maximum possible height of a line of text in this font.
-     * Adjacent lines of text spaced this distance apart will be
-     * guaranteed not to overlap.  Note, however, that many paragraphs
-     * that contain ordinary alphanumeric text may look too widely
-     * spaced if this metric is used to determine line spacing.  The
-     * height field should be preferred unless the text in a given
-     * line contains particularly tall characters.
-     */
-    int maxHeight;
-
-    /**
-     * The maximum advance width of any character in this font.
-     */
-    int maxAdvance;
-
-    static {
-        initIDs();
-    }
-
-    /**
-     * Initialize JNI field and method IDs for fields that may be
-       accessed from C.
-     */
-    private static native void initIDs();
-
-     /**
-     * Calculate the metrics from the given WServer and font.
-     */
-    public X11FontMetrics(Font font) {
-        super(font);
-        init();
-    }
-
-    /**
-     * Get leading
-     */
-    public int getLeading() {
-        return leading;
-    }
-
-    /**
-     * Get ascent.
-     */
-    public int getAscent() {
-        return ascent;
-    }
-
-    /**
-     * Get descent
-     */
-    public int getDescent() {
-        return descent;
-    }
-
-    /**
-     * Get height
-     */
-    public int getHeight() {
-        return height;
-    }
-
-    /**
-     * Get maxAscent
-     */
-    public int getMaxAscent() {
-        return maxAscent;
-    }
-
-    /**
-     * Get maxDescent
-     */
-    public int getMaxDescent() {
-        return maxDescent;
-    }
-
-    /**
-     * Get maxAdvance
-     */
-    public int getMaxAdvance() {
-        return maxAdvance;
-    }
-
-    /**
-     * Return the width of the specified string in this Font.
-     */
-    public int stringWidth(String string) {
-        return charsWidth(string.toCharArray(), 0, string.length());
-    }
-
-    /**
-     * Return the width of the specified char[] in this Font.
-     */
-    public int charsWidth(char chars[], int offset, int length) {
-        Font font = getFont();
-        PlatformFont pf = ((PlatformFont) font.getPeer());
-        if (pf.mightHaveMultiFontMetrics()) {
-            return getMFCharsWidth(chars, offset, length, font);
-        } else {
-            if (widths != null) {
-                int w = 0;
-                for (int i = offset; i < offset + length; i++) {
-                    int ch = chars[i];
-                    if (ch < 0 || ch >= widths.length) {
-                        w += maxAdvance;
-                    } else {
-                        w += widths[ch];
-                    }
-                }
-                return w;
-            } else {
-                return maxAdvance * length;
-            }
-        }
-    }
-
-    private native int getMFCharsWidth(char chars[], int offset, int length, Font font);
-
-    /**
-     * Return the width of the specified byte[] in this Font.
-     */
-    public native int bytesWidth(byte data[], int off, int len);
-
-    /**
-     * Get the widths of the first 256 characters in the font.
-     */
-    public int[] getWidths() {
-        return widths;
-    }
-
-    native void init();
-
-    static Hashtable table = new Hashtable();
-
-    static synchronized FontMetrics getFontMetrics(Font font) {
-        FontMetrics fm = (FontMetrics)table.get(font);
-        if (fm == null) {
-            table.put(font, fm = new X11FontMetrics(font));
-        }
-        return fm;
-    }
-}
--- a/src/solaris/classes/sun/java2d/x11/X11Renderer.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/classes/sun/java2d/x11/X11Renderer.java	Thu Dec 15 19:52:13 2011 -0800
@@ -299,7 +299,7 @@
     private void doPath(SunGraphics2D sg2d, Shape s, boolean isFill) {
         Path2D.Float p2df;
         int transx, transy;
-        if (sg2d.transformState <= sg2d.TRANSFORM_INT_TRANSLATE) {
+        if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
             if (s instanceof Path2D.Float) {
                 p2df = (Path2D.Float)s;
             } else {
@@ -323,10 +323,10 @@
     }
 
     public void draw(SunGraphics2D sg2d, Shape s) {
-        if (sg2d.strokeState == sg2d.STROKE_THIN) {
+        if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
             // Delegate to drawPolygon() if possible...
             if (s instanceof Polygon &&
-                sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE)
+                sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE)
             {
                 Polygon p = (Polygon) s;
                 drawPolygon(sg2d, p.xpoints, p.ypoints, p.npoints);
@@ -336,7 +336,7 @@
             // Otherwise we will use drawPath() for
             // high-quality thin paths.
             doPath(sg2d, s, false);
-        } else if (sg2d.strokeState < sg2d.STROKE_CUSTOM) {
+        } else if (sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM) {
             // REMIND: X11 can handle uniform scaled wide lines
             // and dashed lines itself if we set the appropriate
             // XGC attributes (TBD).
@@ -360,10 +360,10 @@
     }
 
     public void fill(SunGraphics2D sg2d, Shape s) {
-        if (sg2d.strokeState == sg2d.STROKE_THIN) {
+        if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
             // Delegate to fillPolygon() if possible...
             if (s instanceof Polygon &&
-                sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE)
+                sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE)
             {
                 Polygon p = (Polygon) s;
                 fillPolygon(sg2d, p.xpoints, p.ypoints, p.npoints);
@@ -378,7 +378,7 @@
 
         AffineTransform at;
         int transx, transy;
-        if (sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE) {
+        if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
             // Transform (translation) will be done by XFillSpans
             at = null;
             transx = sg2d.transX;
--- a/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	Thu Dec 15 19:52:13 2011 -0800
@@ -295,9 +295,9 @@
 
     public void validatePipe(SunGraphics2D sg2d) {
         if (sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON &&
-            sg2d.paintState <= sg2d.PAINT_ALPHACOLOR &&
-            (sg2d.compositeState <= sg2d.COMP_ISCOPY ||
-             sg2d.compositeState == sg2d.COMP_XOR))
+            sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR &&
+            (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY ||
+             sg2d.compositeState == SunGraphics2D.COMP_XOR))
         {
             if (x11txpipe == null) {
                 /*
@@ -315,7 +315,7 @@
                 return;
             }
 
-            if (sg2d.clipState == sg2d.CLIP_SHAPE) {
+            if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
                 // Do this to init textpipe correctly; we will override the
                 // other non-text pipes below
                 // REMIND: we should clean this up eventually instead of
@@ -329,7 +329,7 @@
                 case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
                     // Use X11 pipe even if DGA is available since DGA
                     // text slows everything down when mixed with X11 calls
-                    if (sg2d.compositeState == sg2d.COMP_ISCOPY) {
+                    if (sg2d.compositeState == SunGraphics2D.COMP_ISCOPY) {
                         sg2d.textpipe = x11textpipe;
                     } else {
                         sg2d.textpipe = solidTextRenderer;
@@ -353,7 +353,7 @@
                     case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
                     // Use X11 pipe even if DGA is available since DGA
                     // text slows everything down when mixed with X11 calls
-                    if (sg2d.compositeState == sg2d.COMP_ISCOPY) {
+                    if (sg2d.compositeState == SunGraphics2D.COMP_ISCOPY) {
                         sg2d.textpipe = x11textpipe;
                     } else {
                         sg2d.textpipe = solidTextRenderer;
@@ -370,10 +370,10 @@
                 }
             }
 
-            if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
+            if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
                 sg2d.drawpipe = x11txpipe;
                 sg2d.fillpipe = x11txpipe;
-            } else if (sg2d.strokeState != sg2d.STROKE_THIN){
+            } else if (sg2d.strokeState != SunGraphics2D.STROKE_THIN){
                 sg2d.drawpipe = x11txpipe;
                 sg2d.fillpipe = x11pipe;
             } else {
@@ -398,8 +398,8 @@
     }
 
     public RenderLoops getRenderLoops(SunGraphics2D sg2d) {
-        if (sg2d.paintState <= sg2d.PAINT_ALPHACOLOR &&
-            sg2d.compositeState <= sg2d.COMP_ISCOPY)
+        if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR &&
+            sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY)
         {
             return solidloops;
         }
@@ -488,7 +488,7 @@
             makePipes();
         }
         CompositeType comptype = sg2d.imageComp;
-        if (sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE &&
+        if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE &&
             (CompositeType.SrcOverNoEa.equals(comptype) ||
              CompositeType.SrcNoEa.equals(comptype)))
         {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/solaris/native/sun/awt/HeadlessToolkit.c	Thu Dec 15 19:52:13 2011 -0800
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2011, 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 <jni.h>
+#include <jni_util.h>
+
+#ifdef HEADLESS
+
+extern JavaVM *jvm;
+
+JNIEXPORT jint JNICALL
+JNI_OnLoad(JavaVM *vm, void *reserved)
+{
+    jvm = vm;
+    return JNI_VERSION_1_2;
+}
+
+JNIEXPORT jboolean JNICALL AWTIsHeadless() {
+    return JNI_TRUE;
+}
+
+#endif
--- a/src/solaris/native/sun/awt/MouseInfo.c	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2003, 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.
- */
-
-#ifdef HEADLESS
-    #error This file should not be included in headless library
-#endif
-
-#include "awt_p.h"
-#include "awt_Component.h"
-
-#include <jni.h>
-#include <jni_util.h>
-
-extern int awt_numScreens;
-extern AwtScreenDataPtr x11Screens;
-extern struct ComponentIDs componentIDs;
-extern struct MComponentPeerIDs mComponentPeerIDs;
-
-/*
- * Class:     sun_awt_DefaultMouseInfoPeer
- * Method:    fillPointWithCoords
- * Signature: (Ljava/awt/Point)I
- */
-JNIEXPORT jint JNICALL
-Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords(JNIEnv *env, jclass cls,
-                                                          jobject point)
-{
-     static jclass pointClass = NULL;
-     jclass pointClassLocal;
-     static jfieldID xID, yID;
-     Window rootWindow, childWindow;
-     int i;
-     int32_t xr, yr, xw, yw;
-     uint32_t keys;
-     Bool pointerFound;
-
-     AWT_LOCK();
-     if (pointClass == NULL) {
-         pointClassLocal = (*env)->FindClass(env, "java/awt/Point");
-         DASSERT(pointClassLocal != NULL);
-         if (pointClassLocal == NULL) {
-             AWT_UNLOCK();
-             return (jint)0;
-         }
-         pointClass = (jclass)(*env)->NewGlobalRef(env, pointClassLocal);
-         (*env)->DeleteLocalRef(env, pointClassLocal);
-         xID = (*env)->GetFieldID(env, pointClass, "x", "I");
-         yID = (*env)->GetFieldID(env, pointClass, "y", "I");
-     }
-
-     for (i = 0; i < awt_numScreens; i++) {
-         pointerFound = XQueryPointer(awt_display, x11Screens[i].root,
-                           &rootWindow, &childWindow,
-                           &xr, &yr, &xw, &yw, &keys);
-         if (pointerFound) {
-             (*env)->SetIntField(env, point, xID, xr);
-             (*env)->SetIntField(env, point, yID, yr);
-             AWT_UNLOCK();
-             return (jint)i;
-         }
-     }
-     /* This should never happen */
-     DASSERT(FALSE);
-     AWT_UNLOCK();
-     return (jint)0;
-}
-
-/*
- * Class:     sun_awt_DefaultMouseInfoPeer
- * Method:    isWindowUnderMouse
- * Signature: (Ljava/awt/Window)Z
- */
-JNIEXPORT jboolean JNICALL Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse
-  (JNIEnv * env, jclass cls, jobject window)
-{
-    Window rootWindow = None, parentWindow = None, siblingWindow = None;
-    Window * children = NULL;
-    int i = 0;
-    int is_the_same_screen = 0;
-    int32_t xr = 0, yr = 0, xw = 0, yw = 0;
-    uint32_t keys = 0;
-    uint32_t nchildren = 0;
-    Bool pointerFound = 0;
-    struct FrameData *wdata = NULL;
-    jobject winPeer = NULL;
-
-    if ((*env)->EnsureLocalCapacity(env, 1) < 0) {
-        return JNI_FALSE;
-    }
-    winPeer = (*env)->GetObjectField(env, window, componentIDs.peer);
-    if (JNU_IsNull(env, winPeer)) {
-        return JNI_FALSE;
-    }
-
-    wdata = (struct FrameData *)
-        JNU_GetLongFieldAsPtr(env, winPeer, mComponentPeerIDs.pData);
-    (*env)->DeleteLocalRef(env, winPeer);
-
-    if (wdata == NULL) {
-        return JNI_FALSE;
-    }
-
-    AWT_LOCK();
-
-    XQueryTree(awt_display, XtWindow(wdata->winData.comp.widget),
-                    &rootWindow, &parentWindow, &children, &nchildren);
-
-    is_the_same_screen = XQueryPointer(awt_display, parentWindow,
-            &rootWindow, &siblingWindow, &xr, &yr, &xw, &yw, &keys);
-
-    if (siblingWindow == XtWindow(wdata->winData.comp.widget) && is_the_same_screen) {
-        AWT_UNLOCK();
-        return JNI_TRUE;
-    }
-
-    AWT_UNLOCK();
-    return JNI_FALSE ;
-
-}
--- a/src/solaris/native/sun/awt/XDrawingArea.c	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,163 +0,0 @@
-/*
- * Copyright (c) 2002, 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 <X11/IntrinsicP.h>
-#include "XDrawingAreaP.h"
-#include <Xm/XmP.h>
-
-#include <stdio.h>
-#include <malloc.h>
-
-#ifdef DEBUG
-#include <jvm.h>  /* To get jio_fprintf() */
-#endif
-
-/******************************************************************
- *
- * Provides Canvas widget which allows the X11 visual to be
- * changed (the Motif DrawingArea restricts the visual to that
- * of the parent widget).
- *
- ******************************************************************/
-
-
-static XmNavigability WidgetNavigable();
-static void ClassInitialize();
-
-static XmBaseClassExtRec baseClassExtRec = {
-    NULL,
-    NULLQUARK,
-    XmBaseClassExtVersion,
-    sizeof(XmBaseClassExtRec),
-    NULL,                               /* InitializePrehook    */
-    NULL,                               /* SetValuesPrehook     */
-    NULL,                               /* InitializePosthook   */
-    NULL,                               /* SetValuesPosthook    */
-    NULL,                               /* secondaryObjectClass */
-    NULL,                               /* secondaryCreate      */
-    NULL,                               /* getSecRes data       */
-    { 0 },                              /* fastSubclass flags   */
-    NULL,                               /* getValuesPrehook     */
-    NULL,                               /* getValuesPosthook    */
-    NULL,                               /* classPartInitPrehook */
-    NULL,                               /* classPartInitPosthook*/
-    NULL,                               /* ext_resources        */
-    NULL,                               /* compiled_ext_resources*/
-    0,                                  /* num_ext_resources    */
-    FALSE,                              /* use_sub_resources    */
-    WidgetNavigable,                    /* widgetNavigable      */
-    NULL                                /* focusChange          */
-};
-
-XDrawingAreaClassRec xDrawingAreaClassRec = {
-{
-    /* Core class part */
-
-    /* superclass         */    (WidgetClass)&xmDrawingAreaClassRec,
-    /* class_name         */    "XDrawingArea",
-    /* widget_size        */    sizeof(XDrawingAreaRec),
-    /* class_initialize   */    ClassInitialize,
-    /* class_part_initialize*/  NULL,
-    /* class_inited       */    FALSE,
-    /* initialize         */    NULL,
-    /* initialize_hook    */    NULL,
-    /* realize            */    XtInheritRealize,
-    /* actions            */    NULL,
-    /* num_actions        */    0,
-    /* resources          */    NULL,
-    /* num_resources      */    0,
-    /* xrm_class          */    NULLQUARK,
-    /* compress_motion    */    FALSE,
-    /* compress_exposure  */    FALSE,
-    /* compress_enterleave*/    FALSE,
-    /* visible_interest   */    FALSE,
-    /* destroy            */    NULL,
-    /* resize             */    XtInheritResize,
-    /* expose             */    XtInheritExpose,
-    /* set_values         */    NULL,
-    /* set_values_hook    */    NULL,
-    /* set_values_almost  */    XtInheritSetValuesAlmost,
-    /* get_values_hook    */    NULL,
-    /* accept_focus       */    NULL,
-    /* version            */    XtVersion,
-    /* callback_offsets   */    NULL,
-    /* tm_table           */    NULL,
-    /* query_geometry       */  NULL,
-    /* display_accelerator  */  NULL,
-    /* extension            */  (XtPointer)&baseClassExtRec
-  },
-
-   {            /* composite_class fields */
-      XtInheritGeometryManager,                 /* geometry_manager   */
-      XtInheritChangeManaged,                   /* change_managed     */
-      XtInheritInsertChild,                     /* insert_child       */
-      XtInheritDeleteChild,                     /* delete_child       */
-      NULL,                                     /* extension          */
-   },
-
-   {            /* constraint_class fields */
-      NULL,                                     /* resource list        */
-      0,                                        /* num resources        */
-      0,                                        /* constraint size      */
-      NULL,                                     /* init proc            */
-      NULL,                                     /* destroy proc         */
-      NULL,                                     /* set values proc      */
-      NULL,                                     /* extension            */
-   },
-
-   {            /* manager_class fields */
-      XtInheritTranslations,                    /* translations           */
-      NULL,                                     /* syn_resources          */
-      0,                                        /* num_get_resources      */
-      NULL,                                     /* syn_cont_resources     */
-      0,                                        /* num_get_cont_resources */
-      XmInheritParentProcess,                   /* parent_process         */
-      NULL,                                     /* extension           */
-   },
-
-   {            /* drawingArea class */
-           /* extension */      NULL
-   },
-
-   /* XDrawingArea class part */
-   {
-        /* extension    */      NULL
-   }
-};
-
-WidgetClass xDrawingAreaClass = (WidgetClass)&xDrawingAreaClassRec;
-
-static void ClassInitialize( void )
-{
-    baseClassExtRec.record_type = XmQmotif ;
-}
-
-static XmNavigability WidgetNavigable(Widget wid)
-{
-    return XmCONTROL_NAVIGABLE;
-}
--- a/src/solaris/native/sun/awt/XDrawingArea.h	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2002, 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 _XDrawingArea_h_
-#define _XDrawingArea_h_
-
-extern WidgetClass xDrawingAreaClass;
-
-typedef struct _XDrawingAreaClassRec    *XDrawingAreaWidgetClass;
-typedef struct _XDrawingAreaRec         *XDrawingAreaWidget;
-
-#endif /* !_VDrawingArea_h_ */
--- a/src/solaris/native/sun/awt/XDrawingAreaP.h	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2002, 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 _XDrawingAreaP_h_
-#define _XDrawingAreaP_h_
-
-#include <Xm/DrawingAP.h>
-#include "XDrawingArea.h"
-
-
-/***************************************************************
- * VDrawingArea Widget Data Structures
- *
- *
- **************************************************************/
-
-/* Define part class structure */
-typedef struct _XDrawingAreaClass {
-        XtPointer                       extension;
-} XDrawingAreaClassPart;
-
-/* Define the full class record */
-typedef struct _XDrawingAreaClassRec {
-        CoreClassPart           core_class;
-        CompositeClassPart      composite_class;
-        ConstraintClassPart     constraint_class;
-        XmManagerClassPart      manager_class;
-        XmDrawingAreaClassPart  drawing_area_class;
-        XDrawingAreaClassPart   xdrawingarea_class;
-} XDrawingAreaClassRec;
-
-/* External definition for class record */
-extern XDrawingAreaClassRec xDrawingAreaClassRec;
-
-/****************************************************************
- *
-* Full instance record declaration
- *
- ****************************************************************/
-
-typedef struct _XDrawingAreaRec
-{
-        CorePart                core;
-        CompositePart           composite;
-        ConstraintPart          constraint;
-        XmManagerPart           manager;
-        XmDrawingAreaPart       drawing_area;
-} XDrawingAreaRec;
-
-
-
-#endif /* !_VDrawingAreaP_h_ */
--- a/src/solaris/native/sun/awt/awt.h	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/native/sun/awt/awt.h	Thu Dec 15 19:52:13 2011 -0800
@@ -90,74 +90,12 @@
  * Unfortunately AWT_LOCK debugging does not work with XAWT due to mixed
  * Java/C use of AWT lock.
  */
-#if defined(DEBUG_AWT_LOCK) && !defined(XAWT)
-extern int awt_locked;
-extern char *lastF;
-extern int lastL;
-
-#define AWT_LOCK() do {                                                 \
-    if (!awtLockInited) {                                               \
-        jio_fprintf(stderr, "AWT lock error, awt_lock is null\n");      \
-    }                                                                   \
-    if (awt_locked < 0) {                                               \
-        jio_fprintf(stderr,                                             \
-                    "AWT lock error (%s,%d) (last held by %s,%d) %d\n", \
-                    __FILE__, __LINE__, lastF, lastL, awt_locked);      \
-    }                                                                   \
-    lastF = __FILE__;                                                   \
-    lastL = __LINE__;                                                   \
-    AWT_LOCK_IMPL();                                                    \
-    ++awt_locked;                                                       \
-} while (0)
-
-#define AWT_NOFLUSH_UNLOCK() do {                               \
-    lastF = "";                                                 \
-    lastL = -1;                                                 \
-    if (awt_locked < 1) {                                       \
-        jio_fprintf(stderr, "AWT unlock error (%s,%d,%d)\n",    \
-                    __FILE__, __LINE__, awt_locked);            \
-    }                                                           \
-    --awt_locked;                                               \
-    AWT_NOFLUSH_UNLOCK_IMPL();                                  \
-} while (0)
-
-#define AWT_WAIT(tm) do {                                       \
-    int old_lockcount = awt_locked;                             \
-    if (awt_locked < 1) {                                       \
-        jio_fprintf(stderr, "AWT wait error (%s,%d,%d)\n",      \
-                    __FILE__, __LINE__, awt_locked);            \
-    }                                                           \
-    awt_locked = 0;                                             \
-    AWT_WAIT_IMPL(tm);                                          \
-    awt_locked = old_lockcount;                                 \
-} while (0)
-
-#define AWT_NOTIFY() do {                                       \
-    if (awt_locked < 1) {                                       \
-        jio_fprintf(stderr, "AWT notify error (%s,%d,%d)\n",    \
-                    __FILE__, __LINE__, awt_locked);            \
-    }                                                           \
-    AWT_NOTIFY_IMPL();                                          \
-} while(0)
-
-#define AWT_NOTIFY_ALL() do {                                           \
-    if (awt_locked < 1) {                                               \
-        jio_fprintf(stderr, "AWT notify all error (%s,%d,%d)\n",        \
-                    __FILE__, __LINE__, awt_locked);                    \
-    }                                                                   \
-    AWT_NOTIFY_ALL_IMPL();                                              \
-} while (0)
-
-#else
-
 #define AWT_LOCK()           AWT_LOCK_IMPL()
 #define AWT_NOFLUSH_UNLOCK() AWT_NOFLUSH_UNLOCK_IMPL()
 #define AWT_WAIT(tm)         AWT_WAIT_IMPL(tm)
 #define AWT_NOTIFY()         AWT_NOTIFY_IMPL()
 #define AWT_NOTIFY_ALL()     AWT_NOTIFY_ALL_IMPL()
 
-#endif /* DEBUG_AWT_LOCK && !XAWT */
-
 #ifndef HEADLESS
 extern Display         *awt_display; /* awt_GraphicsEnv.c */
 extern Boolean          awt_ModLockIsShiftLock; /* XToolkit.c */
--- a/src/solaris/native/sun/awt/awt_AWTEvent.c	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/native/sun/awt/awt_AWTEvent.c	Thu Dec 15 19:52:13 2011 -0800
@@ -40,14 +40,11 @@
 #include "java_awt_event_KeyEvent.h"
 #include "jni_util.h"
 
-#include "canvas.h"
 #include "awt_AWTEvent.h"
-#include "awt_Component.h"
 
 struct AWTEventIDs awtEventIDs;
 struct InputEventIDs inputEventIDs;
 struct KeyEventIDs keyEventIDs;
-struct MComponentPeerIDs mComponentPeerIDs;
 
 JNIEXPORT void JNICALL
 Java_java_awt_AWTEvent_initIDs(JNIEnv *env, jclass cls)
@@ -69,61 +66,10 @@
     keyEventIDs.keyCode = (*env)->GetFieldID(env, cls, "keyCode", "I");
     keyEventIDs.keyChar = (*env)->GetFieldID(env, cls, "keyChar", "C");
 }
-#ifndef XAWT
-JNIEXPORT void JNICALL
-Java_java_awt_AWTEvent_nativeSetSource(JNIEnv *env, jobject self,
-                                       jobject newSource)
-{
-    jbyteArray bdata;
 
-    AWT_LOCK();
-
-    bdata = (jbyteArray)(*env)->GetObjectField(env, self, awtEventIDs.bdata);
-
-    if (bdata != NULL) {
-        XEvent *xev;
-        Window w;
-        jboolean dummy;
-
-        /* get the widget out of the peer newSource */
-        struct ComponentData *cdata = (struct ComponentData *)
-            JNU_GetLongFieldAsPtr(env, newSource, mComponentPeerIDs.pData);
-        if (JNU_IsNull(env, cdata) || (cdata == NULL) ||
-            ((cdata->widget != NULL) && (XtIsObject(cdata->widget)) &&
-             (cdata->widget->core.being_destroyed))) {
-            JNU_ThrowNullPointerException(env, "null widget");
-            AWT_UNLOCK();
-            return;
-        }
-
-        /* get the Window out of the widget */
-        w = XtWindow(cdata->widget);
-
-        if (w == None) {
-            JNU_ThrowNullPointerException(env, "null window");
-            AWT_UNLOCK();
-            return;
-        }
-
-        /* reset the filed in the event */
-        xev = (XEvent *)(*env)->GetPrimitiveArrayCritical(env, bdata, &dummy);
-        if (xev == NULL) {
-            JNU_ThrowNullPointerException(env, "null data");
-            AWT_UNLOCK();
-            return;
-        }
-        xev->xany.window = w;
-        (*env)->ReleasePrimitiveArrayCritical(env, bdata, (void *)xev, 0);
-    }
-
-    AWT_UNLOCK();
-}
-#else
 JNIEXPORT void JNICALL
 Java_java_awt_AWTEvent_nativeSetSource(JNIEnv *env, jobject self,
                                        jobject newSource)
 {
 
 }
-
-#endif
--- a/src/solaris/native/sun/awt/awt_Component.h	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/native/sun/awt/awt_Component.h	Thu Dec 15 19:52:13 2011 -0800
@@ -42,25 +42,3 @@
     jmethodID getParent;
     jmethodID getLocationOnScreen;
 };
-
-/* field and method IDs for Container */
-struct ContainerIDs {
-    jfieldID layoutMgr;
-    jmethodID getComponents;
-    jmethodID findComponentAt;
-};
-
-/* fieldIDs for MComponentPeer fields that may be accessed from C */
-struct MComponentPeerIDs {
-    jfieldID pData;
-    jfieldID target;
-    jfieldID jniGlobalRef;
-    jfieldID graphicsConfig;
-    jfieldID drawState;
-    jmethodID isFocusableMID;
-};
-
-#ifndef HEADLESS
-extern void processTree(Widget from, Widget to, Boolean action);
-#endif // HEADLESS
-
--- a/src/solaris/native/sun/awt/awt_Cursor.h	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1998, 2005, 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 "jni_util.h"
-#include "awt_p.h"
-
-#define CACHE_UPDATE 0          /* cache the component and update cursor */
-#define UPDATE_ONLY  1          /* update cursor, but not cache component */
-#define CACHE_ONLY   2          /* cache the component, no cursor update */
-
-/* fieldIDs for Cursor fields that may be accessed from C */
-struct CursorIDs {
-  jfieldID type;
-  jmethodID mSetPData;
-  jfieldID pData;
-};
-
-#ifndef HEADLESS
-Cursor getCursor(JNIEnv *env, jobject jCur);
-void updateCursor(XPointer client_data, int32_t replace);
-#endif /* !HEADLESS */
--- a/src/solaris/native/sun/awt/awt_DrawingSurface.c	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/native/sun/awt/awt_DrawingSurface.c	Thu Dec 15 19:52:13 2011 -0800
@@ -29,30 +29,21 @@
 
 #include "awt_p.h"
 #include "java_awt_Component.h"
-//#include "sun_awt_motif_MComponentPeer.h"
 
 #include "awt_Component.h"
 
-
 #include <jni.h>
 #include <jni_util.h>
 #include <jawt_md.h>
 
-extern struct MComponentPeerIDs mComponentPeerIDs;
 extern struct ComponentIDs componentIDs;
-#ifndef XAWT
-extern AwtGraphicsConfigDataPtr
-getGraphicsConfigFromComponentPeer(JNIEnv *env, jobject this);
-#endif
 
-#ifdef XAWT
 #include "awt_GraphicsEnv.h"
 extern jfieldID windowID;
 extern jfieldID targetID;
 extern jfieldID graphicsConfigID;
 extern jfieldID drawStateID;
 extern struct X11GraphicsConfigIDs x11GraphicsConfigIDs;
-#endif
 
 /*
  * Lock the surface of the target component for native rendering.
@@ -109,13 +100,8 @@
         return (jint)JAWT_LOCK_ERROR;
     }
 
-#ifndef XAWT
-    drawState = (*env)->GetIntField(env, peer, mComponentPeerIDs.drawState);
-    (*env)->SetIntField(env, peer, mComponentPeerIDs.drawState, 0);
-#else
    drawState = (*env)->GetIntField(env, peer, drawStateID);
     (*env)->SetIntField(env, peer, drawStateID, 0);
-#endif
     return drawState;
 }
 
@@ -127,9 +113,7 @@
     jclass componentClass;
     AwtGraphicsConfigDataPtr adata;
     int32_t result;
-#ifdef XAWT
      jobject gc_object;
-#endif
     if (ds == NULL) {
 #ifdef DEBUG
         fprintf(stderr, "Drawing Surface is NULL\n");
@@ -164,9 +148,6 @@
         AWT_UNLOCK();
         return (int32_t) 0;
     }
-#ifndef XAWT
-    adata = getGraphicsConfigFromComponentPeer(env, peer);
-#else
      /* GraphicsConfiguration object of MComponentPeer */
     gc_object = (*env)->GetObjectField(env, peer, graphicsConfigID);
 
@@ -177,7 +158,6 @@
     } else {
         adata = getDefaultConfig(DefaultScreen(awt_display));
     }
-#endif
 
     result = adata->AwtColorMatch(r, g, b, adata);
         AWT_UNLOCK();
@@ -201,9 +181,6 @@
     jclass componentClass;
     JAWT_X11DrawingSurfaceInfo* px;
     JAWT_DrawingSurfaceInfo* p;
-#ifndef XAWT
-    struct ComponentData *cdata;
-#endif
     XWindowAttributes attrs;
 
     if (ds == NULL) {
@@ -241,31 +218,14 @@
         return NULL;
     }
 
-#ifndef XAWT
-    /* Get the component data from the peer */
-    cdata = (struct ComponentData *)
-        JNU_GetLongFieldAsPtr(env, peer, mComponentPeerIDs.pData);
-    if (cdata == NULL) {
-#ifdef DEBUG
-        fprintf(stderr, "Component data is NULL\n");
-#endif
-                AWT_UNLOCK();
-        return NULL;
-    }
-#endif
-
-        AWT_UNLOCK();
+    AWT_UNLOCK();
 
     /* Allocate platform-specific data */
     px = (JAWT_X11DrawingSurfaceInfo*)
         malloc(sizeof(JAWT_X11DrawingSurfaceInfo));
 
     /* Set drawable and display */
-#ifndef XAWT
-    px->drawable = XtWindow(cdata->widget);
-#else
     px->drawable = (*env)->GetLongField(env, peer, windowID);
-#endif
     px->display = awt_display;
 
     /* Get window attributes to set other values */
@@ -392,21 +352,7 @@
 
     AWT_LOCK();
 
-#ifndef XAWT
-    if (window != None) {
-        widget = XtWindowToWidget(awt_display, window);
-    }
-
-    if (widget != NULL) {
-        XtVaGetValues (widget, XmNuserData, &peer, NULL);
-    }
-
-    if (peer != NULL) {
-        target = (*env)->GetObjectField(env, peer, mComponentPeerIDs.target);
-    }
-#else
     target =  (*env)->GetObjectField(env, peer, targetID);
-#endif
 
     if (target == NULL) {
         JNU_ThrowNullPointerException(env, "NullPointerException");
--- a/src/solaris/native/sun/awt/awt_Font.c	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/native/sun/awt/awt_Font.c	Thu Dec 15 19:52:13 2011 -0800
@@ -30,8 +30,6 @@
 #include "java_awt_Component.h"
 #include "java_awt_Font.h"
 #include "java_awt_FontMetrics.h"
-#include "sun_awt_motif_MToolkit.h"
-#include "sun_awt_motif_X11FontMetrics.h"
 #include "sun_awt_X11GraphicsEnvironment.h"
 
 #include "awt_Font.h"
@@ -100,57 +98,6 @@
 }
 
 #ifndef HEADLESS
-
-/* fieldIDs for X11FontMetrics fields that may be accessed from C */
-static struct X11FontMetricsIDs {
-    jfieldID widths;
-    jfieldID font;
-    jfieldID ascent;
-    jfieldID descent;
-    jfieldID leading;
-    jfieldID height;
-    jfieldID maxAscent;
-    jfieldID maxDescent;
-    jfieldID maxHeight;
-    jfieldID maxAdvance;
-} x11FontMetricsIDs;
-
-/*
- * Class:     sun_awt_motif_X11FontMetrics
- * Method:    initIDs
- * Signature: ()V
- */
-
-/* This function gets called from the static initializer for
-   X11FontMetrics.java to initialize the fieldIDs for fields
-   that may be accessed from C */
-
-JNIEXPORT void JNICALL
-Java_sun_awt_motif_X11FontMetrics_initIDs
-  (JNIEnv *env, jclass cls)
-{
-    x11FontMetricsIDs.widths = (*env)->GetFieldID(env, cls, "widths", "[I");
-    x11FontMetricsIDs.font =
-      (*env)->GetFieldID(env, cls, "font", "Ljava/awt/Font;");
-    x11FontMetricsIDs.ascent =
-      (*env)->GetFieldID(env, cls, "ascent", "I");
-    x11FontMetricsIDs.descent =
-      (*env)->GetFieldID(env, cls, "descent", "I");
-    x11FontMetricsIDs.leading =
-      (*env)->GetFieldID(env, cls, "leading", "I");
-    x11FontMetricsIDs.height =
-      (*env)->GetFieldID(env, cls, "height", "I");
-    x11FontMetricsIDs.maxAscent =
-      (*env)->GetFieldID(env, cls, "maxAscent", "I");
-    x11FontMetricsIDs.maxDescent =
-      (*env)->GetFieldID(env, cls, "maxDescent", "I");
-    x11FontMetricsIDs.maxHeight =
-      (*env)->GetFieldID(env, cls, "maxHeight", "I");
-    x11FontMetricsIDs.maxAdvance =
-      (*env)->GetFieldID(env, cls, "maxAdvance", "I");
-}
-
-
 /* fieldIDs for FontDescriptor fields that may be accessed from C */
 static struct FontDescriptorIDs {
     jfieldID nativeName;
@@ -182,27 +129,6 @@
 #endif /* !HEADLESS */
 }
 
-#ifndef HEADLESS
-struct MFontPeerIDs mFontPeerIDs;
-/*
- * Class:     sun_awt_motif_MFontPeer
- * Method:    initIDs
- * Signature: ()V
- */
-
-/* This function gets called from the static initializer for
-   MFontPeer.java to initialize the fieldIDs for fields
-   that may be accessed from C */
-
-JNIEXPORT void JNICALL
-Java_sun_awt_motif_MFontPeer_initIDs
-  (JNIEnv *env, jclass cls)
-{
-    mFontPeerIDs.xfsname =
-      (*env)->GetFieldID(env, cls, "xfsname", "Ljava/lang/String;");
-}
-#endif /* !HEADLESS */
-
 /*
  * Class:     sun_awt_PlatformFont
  * Method:    initIDs
@@ -747,193 +673,6 @@
 }
 
 /*
- * Class:     sun_awt_motif_X11FontMetrics
- * Method:    getMFCharsWidth
- * Signature: ([CIILjava/awt/Font;)I
- */
-JNIEXPORT jint JNICALL Java_sun_awt_motif_X11FontMetrics_getMFCharsWidth
-  (JNIEnv *env, jobject this, jcharArray data, jint offset, jint length, jobject font)
-{
-    jint retVal = 0;
-
-    AWT_LOCK();
-
-    retVal = awtJNI_GetMFStringWidth(env, data, offset, length, font);
-
-    AWT_UNLOCK();
-    return retVal;
-}
-
-/*
- * Class:     sun_awt_motif_X11FontMetrics
- * Method:    bytesWidth
- * Signature: ([BII)I
- */
-JNIEXPORT jint JNICALL Java_sun_awt_motif_X11FontMetrics_bytesWidth
-  (JNIEnv *env, jobject this, jbyteArray str, jint off, jint len)
-{
-    jint w = 0;
-    unsigned char *s = NULL, *tmpPointer = NULL;
-    int32_t ch = 0;
-    int32_t cnt = 0;
-    jobject widths = NULL;
-    jint tempWidths[256];
-    jint maxAdvance = 0;
-    int32_t widlen = 0;
-
-    if (JNU_IsNull(env, str)) {
-        JNU_ThrowNullPointerException(env, "NullPointerException");
-        return 0;
-    }
-
-    cnt = (*env)->GetArrayLength(env, str);
-    if (cnt == 0) {
-        return 0;
-    }
-
-    widths = (*env)->GetObjectField(env, this, x11FontMetricsIDs.widths);
-    maxAdvance = (*env)->GetIntField(env, this, x11FontMetricsIDs.maxAdvance);
-    if (!JNU_IsNull(env, widths)) {
-        w = 0;
-        widlen = (*env)->GetArrayLength(env, widths);
-        (*env)->GetIntArrayRegion(env, widths, 0, widlen, (jint *) tempWidths);
-
-        s = tmpPointer = (unsigned char *) (*env)->GetPrimitiveArrayCritical(env, str, NULL);
-        if (s == NULL) {
-            return 0;
-        }
-
-        while (--cnt >= 0) {
-            ch = *tmpPointer++;
-            if (ch < widlen) {
-                w += tempWidths[ch];
-            } else {
-                w += maxAdvance;
-            }
-        }
-
-        (*env)->ReleasePrimitiveArrayCritical(env, str, (jchar *) s, JNI_ABORT);
-    } else {
-        w = maxAdvance * cnt;
-    }
-    return w;
-}
-
-/*
- * Class:     sun_awt_motif_X11FontMetrics
- * Method:    init
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_sun_awt_motif_X11FontMetrics_init
-  (JNIEnv *env, jobject this)
-{
-    jobject font = NULL;
-    struct FontData *fdata = NULL;
-    jint tempWidths[256];
-    jintArray widths = NULL;
-    int32_t ccount = 0;
-    int32_t i = 0;
-    int32_t tempWidthsIndex = 0;
-    char *err = NULL;
-
-    if (JNU_IsNull(env, this)) {
-        JNU_ThrowNullPointerException(env, "NullPointerException");
-        return;
-    }
-    AWT_LOCK();
-
-    font = (*env)->GetObjectField(env, this, x11FontMetricsIDs.font);
-    if (JNU_IsNull(env, this)) {
-        JNU_ThrowNullPointerException(env, "NullPointerException");
-        AWT_UNLOCK();
-        return;
-    }
-    fdata = awtJNI_GetFontData(env, font, &err);
-    if (fdata == NULL) {
-        JNU_ThrowInternalError(env, err);
-        AWT_UNLOCK();
-        return;
-    }
-
-    /*
-     * Bug 4103248, 4120310. We must take all of the fonts into
-     * consideration in providing the metrics, not just the 8859-1 font,
-     * because the underlying Motif widgets are.
-     */
-    if (awtJNI_IsMultiFont(env, font) && fdata->xfs == NULL) {
-        fdata->xfs = awtJNI_MakeFontSet(env, font);
-    }
-    if (fdata->xfs != NULL) {
-        XFontSetExtents *fs_extents = NULL;
-        fs_extents = XExtentsOfFontSet(fdata->xfs);
-
-        (*env)->SetIntField(env, this, x11FontMetricsIDs.maxAscent,
-                        (jint)(-fs_extents->max_logical_extent.y));
-        (*env)->SetIntField(env, this, x11FontMetricsIDs.maxDescent,
-                        (jint)(fs_extents->max_logical_extent.height +
-                               fs_extents->max_logical_extent.y));
-        (*env)->SetIntField(env, this, x11FontMetricsIDs.maxAdvance,
-                        (jint)(fs_extents->max_logical_extent.width));
-        (*env)->SetIntField(env, this, x11FontMetricsIDs.ascent,
-                        (jint)(-fs_extents->max_ink_extent.y));
-        (*env)->SetIntField(env, this, x11FontMetricsIDs.descent,
-                        (jint)(fs_extents->max_ink_extent.height +
-                         fs_extents->max_ink_extent.y));
-    } else {
-        (*env)->SetIntField(env, this, x11FontMetricsIDs.maxAscent,
-                        (jint) fdata->xfont->max_bounds.ascent);
-        (*env)->SetIntField(env, this, x11FontMetricsIDs.maxDescent,
-                        (jint) fdata->xfont->max_bounds.descent);
-        (*env)->SetIntField(env, this, x11FontMetricsIDs.maxAdvance,
-                        (jint) fdata->xfont->max_bounds.width);
-        (*env)->SetIntField(env, this, x11FontMetricsIDs.ascent,
-                        (jint) fdata->xfont->ascent);
-        (*env)->SetIntField(env, this, x11FontMetricsIDs.descent,
-                        (jint) fdata->xfont->descent);
-    }
-
-    (*env)->SetIntField(env, this, x11FontMetricsIDs.leading, (jint) 1);
-    (*env)->SetIntField(env, this, x11FontMetricsIDs.height,
-                        (jint) fdata->xfont->ascent + fdata->xfont->descent + 1);
-    (*env)->SetIntField(env, this, x11FontMetricsIDs.maxHeight,
-                        (jint) fdata->xfont->max_bounds.ascent
-                        + fdata->xfont->max_bounds.descent + 1);
-
-
-    widths = (*env)->NewIntArray(env, 256);
-    (*env)->SetObjectField(env, this, x11FontMetricsIDs.widths, widths);
-    if (JNU_IsNull(env, widths)) {
-        JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError");
-        AWT_UNLOCK();
-        return;
-    }
-    /*
-     * We could pin the array and then release it, but I believe this method
-     * is faster and perturbs the VM less
-     *
-     */
-    memset(tempWidths, 0, 256 * sizeof(jint));
-
-    tempWidthsIndex = fdata->xfont->min_char_or_byte2;
-
-    ccount = fdata->xfont->max_char_or_byte2 - fdata->xfont->min_char_or_byte2;
-
-    if (fdata->xfont->per_char) {
-        for (i = 0; i <= ccount; i++) {
-            tempWidths[tempWidthsIndex++] = (jint) fdata->xfont->per_char[i].width;
-        }
-    } else {
-        for (i = 0; i <= ccount; i++) {
-            tempWidths[tempWidthsIndex++] = (jint) fdata->xfont->max_bounds.width;
-        }
-    }
-
-    (*env)->SetIntArrayRegion(env, widths, 0, 256, (jint *) tempWidths);
-
-    AWT_UNLOCK();
-}
-
-/*
  * Registered with the 2D disposer to be called after the Font is GC'd.
  */
 static void pDataDisposeMethod(JNIEnv *env, jlong pData)
--- a/src/solaris/native/sun/awt/awt_Font.h	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/native/sun/awt/awt_Font.h	Thu Dec 15 19:52:13 2011 -0800
@@ -34,8 +34,8 @@
     jmethodID getFamily;
 };
 
-/* fieldIDs for MFontPeer fields that may be accessed from C */
-struct MFontPeerIDs {
+/* fieldIDs for XFontPeer fields that may be accessed from C */
+struct XFontPeerIDs {
     jfieldID xfsname;
 };
 
--- a/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Thu Dec 15 19:52:13 2011 -0800
@@ -45,7 +45,6 @@
 #include <stdlib.h>
 
 #include "awt_GraphicsEnv.h"
-#include "awt_Window.h"
 #include "awt_util.h"
 #include "gdefs.h"
 #include <dlfcn.h>
@@ -94,8 +93,6 @@
 
 struct X11GraphicsConfigIDs x11GraphicsConfigIDs;
 struct X11GraphicsDeviceIDs x11GraphicsDeviceIDs;
-extern struct WindowIDs mWindowIDs;
-extern struct MWindowPeerIDs mWindowPeerIDs;
 
 #ifndef HEADLESS
 int awtCreateX11Colormap(AwtGraphicsConfigDataPtr adata);
@@ -570,75 +567,6 @@
     AWT_UNLOCK ();
 }
 
-/*
- * Determing if this top-level has been moved onto another Xinerama screen.
- * Called from awt_TopLevel.c
- *
- * ASSUME: wdata != null
- */
-#ifndef HEADLESS
-void checkNewXineramaScreen(JNIEnv* env, jobject peer, struct FrameData* wdata,
-                            int32_t newX, int32_t newY,
-                            int32_t newWidth, int32_t newHeight) {
-    int i;
-    int amt;
-    int totAmt = 0;
-    int largestAmt = 0;
-    int largestAmtScr = 0;
-
-    int horiz;
-    int vert;
-
-    if (!usingXinerama) { return; }
-
-    totAmt = newWidth * newHeight;
-
-    /* assert that peer implements WindowPeer */
-    DASSERT(JNU_IsInstanceOfByName(env, peer, "java/awt/peer/WindowPeer"));
-
-    DTRACE_PRINTLN4("checkNewXineramaScreen() x=%i y=%i w=%i h=%i\n",newX, newY, newWidth, newHeight);
-
-    /* decide which screen we're on
-     * if we're spanning, figure out which screen we're most on
-     */
-    for (i = 0; i < awt_numScreens; i++) {
-        if (INTERSECTS(newX, newX + newWidth, newY, newY + newHeight,
-                       fbrects[i].x, fbrects[i].x + fbrects[i].width,
-                       fbrects[i].y, fbrects[i].y + fbrects[i].height)) {
-
-            /* calc how much of window is on this screen */
-            horiz = MIN(newX + newWidth, fbrects[i].x + fbrects[i].width) -
-                    MAX(newX, fbrects[i].x);
-            vert =  MIN(newY + newHeight, fbrects[i].y + fbrects[i].height) -
-                    MAX(newY, fbrects[i].y);
-            DASSERT(horiz > 0);
-            DASSERT(vert > 0);
-
-            amt = horiz * vert;
-            if (amt == totAmt) {
-                /* completely on this screen - done! */
-                largestAmtScr = i;
-                break;
-            }
-            if (amt > largestAmt) {
-                largestAmt = amt;
-                largestAmtScr = i;
-            }
-        }
-    }
-
-#ifndef XAWT
-    /* check if we're on a new screen */
-    if (largestAmtScr != wdata->screenNum) {
-        wdata->screenNum = largestAmtScr;
-        /* update peer, target Comp */
-        (*env)->CallVoidMethod(env, peer,
-                               mWindowPeerIDs.draggedToScreenMID, largestAmtScr);
-    }
-#endif /* XAWT */
-}
-#endif /* HEADLESS */
-
 #ifndef HEADLESS
 #ifdef __linux__
 static void xinerama_init_linux()
@@ -1434,11 +1362,17 @@
                                                         fbrects[screen].height);
         }
         else {
+            XWindowAttributes xwa;
+            memset(&xwa, 0, sizeof(xwa));
+
+            AWT_LOCK ();
+            XGetWindowAttributes(awt_display,
+                    RootWindow(awt_display, adata->awt_visInfo.screen),
+                    &xwa);
+            AWT_UNLOCK ();
+
             bounds = (*env)->NewObject(env, clazz, mid, 0, 0,
-                                   DisplayWidth(awt_display,
-                                                adata->awt_visInfo.screen),
-                                   DisplayHeight(awt_display,
-                                                 adata->awt_visInfo.screen));
+                    xwa.width, xwa.height);
         }
 
         if ((*env)->ExceptionOccurred(env)) {
--- a/src/solaris/native/sun/awt/awt_InputMethod.c	Tue Dec 13 15:41:47 2011 -0800
+++ b/src/solaris/native/sun/awt/awt_InputMethod.c	Thu Dec 15 19:52:13 2011 -0800
@@ -30,28 +30,14 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <X11/Xlib.h>
-#ifdef XAWT
 #include <sys/time.h>
-#else /* !XAWT */
-#include <Xm/Xm.h>
-#include <Xm/RowColumn.h>
-#include <Xm/MwmUtil.h>
-#include <Xm/MenuShell.h>
-#endif /* XAWT */
 
 #include "awt.h"
 #include "awt_p.h"
 
 #include <sun_awt_X11InputMethod.h>
-#ifdef XAWT
 #include <sun_awt_X11_XComponentPeer.h>
 #include <sun_awt_X11_XInputMethod.h>
-#else /* !XAWT */
-#include <sun_awt_motif_MComponentPeer.h>
-#include <sun_awt_motif_MInputMethod.h>
-
-#define MCOMPONENTPEER_CLASS_NAME       "sun/awt/motif/MComponentPeer"
-#endif /* XAWT */
 
 #define THROW_OUT_OF_MEMORY_ERROR() \
         JNU_ThrowOutOfMemoryError((JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2), NULL)
@@ -111,11 +97,7 @@
 typedef struct {
     Window   w;                /*status window id        */
     Window   root;             /*the root window id      */
-#ifdef XAWT
     Window   parent;           /*parent shell window     */
-#else
-    Widget   parent;           /*parent shell window     */
-#endif
     int      x, y;             /*parent's upperleft position */
     int      width, height;    /*parent's width, height  */
     GC       lightGC;          /*gc for light border     */
@@ -141,17 +123,10 @@
     XIC         ic_active;      /* X Input Context for active clients */
     XIC         ic_passive;     /* X Input Context for passive clients */
     XIMCallback *callbacks;     /* callback parameters */
-#ifndef XAWT
-    jobject     peer;           /* MComponentPeer of client Window */
-#endif /* XAWT */
     jobject     x11inputmethod; /* global ref to X11InputMethod instance */
                                 /* associated with the XIC */
 #ifdef __linux__
     StatusWindow *statusWindow; /* our own status window  */
-#else
-#ifndef XAWT
-    Widget      statusWidget;   /* IM status window widget */
-#endif /* XAWT */
 #endif
     char        *lookup_buf;    /* buffer used for XmbLookupString */
     int         lookup_buf_len; /* lookup buffer size in bytes */
@@ -191,12 +166,6 @@
 
 #define GetJNIEnv() (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2)
 
-#ifndef XAWT
-static jobject  mcompClass = NULL;
-static jobject  awteventClass = NULL;
-static jfieldID mcompPDataID = NULL;
-#endif /* XAWT */
-
 static void DestroyXIMCallback(XIM, XPointer, XPointer);
 static void OpenXIMCallback(Display *, XPointer, XPointer);
 /* Solaris XIM Extention */
@@ -261,28 +230,6 @@
     return mbs;
 }
 
-#ifndef XAWT
-/*
- * Find a class for the given class name and return a global reference to the
- * class.
- */
-static jobject
-findClass(const char *className)
-{
-    JNIEnv *env = GetJNIEnv();
-    jclass classClass;
-    jobject objectClass;
-
-    classClass = (*env)->FindClass(env, className);
-    objectClass = (*env)->NewGlobalRef(env,classClass);
-
-    if (JNU_IsNull(env, objectClass)) {
-        JNU_ThrowClassNotFoundException(env, className);
-    }
-    return objectClass;
-}
-#endif /* XAWT */
-
 /*
  * Returns True if the global reference is still in the list,
  * otherwise False.
@@ -444,9 +391,6 @@
         free((void *)pX11IMData->callbacks);
 
     if (env) {
-#ifndef XAWT
-        (*env)->DeleteGlobalRef(env, pX11IMData->peer);
-#endif /* XAWT */
         /* Remove the global reference from the list, so that
            the callback function or whoever refers to it could know.
         */
@@ -580,23 +524,10 @@
     /* Get keysym without taking modifiers into account first to map
      * to AWT keyCode table.
      */
-#ifndef XAWT
-    if (((event->state & ShiftMask) ||
-        (event->state & LockMask)) &&
-         keysym >= 'A' && keysym <= 'Z')
-    {
-        keysym = XLookupKeysym(event, 0);
-    }
-#endif
-
     switch (status) {
     case XLookupBoth:
         if (!composing) {
-#ifdef XAWT
             if (event->keycode != 0) {
-#else
-            if (keysym < 128 || ((keysym & 0xff00) == 0xff00)) {
-#endif
                 *keysymp = keysym;
                 result = False;
                 break;
@@ -650,11 +581,7 @@
 
 #ifdef __linux__
 static StatusWindow *createStatusWindow(
-#ifdef XAWT
                                 Window parent) {
-#else
-                                Widget parent) {
-#endif
     StatusWindow *statusWindow;
     XSetWindowAttributes attrib;
     unsigned long attribmask;
@@ -682,22 +609,12 @@
     Window *ignoreWindowPtr;
     unsigned int ignoreUnit;
 
-#ifdef XAWT
     XGetGeometry(dpy, parent, &rootWindow, &x, &y, &w, &h, &bw, &depth);
-#else
-    while (!XtIsShell(parent)){
-        parent = XtParent(parent);
-    }
-#endif
 
     attrib.override_redirect = True;
     attribmask = CWOverrideRedirect;
     for (i = 0; i < awt_numScreens; i++) {
-#ifdef XAWT
         if (RootWindow(dpy, i) == rootWindow) {
-#else
-        if (ScreenOfDisplay(dpy, i) == XtScreen(parent)) {
-#endif
             screen = i;
             break;
         }
@@ -798,11 +715,7 @@
 
 /* This method is to turn off or turn on the status window. */
 static void onoffStatusWindow(X11InputMethodData* pX11IMData,
-#ifdef XAWT
                                 Window parent,
-#else
-                                Widget parent,
-#endif
                                 Bool ON){
     XWindowAttributes xwa;
     Window child;
@@ -820,15 +733,9 @@
         statusWindow->on = False;
         return;
     }
-#ifdef XAWT
     parent = JNU_CallMethodByName(GetJNIEnv(), NULL, pX11IMData->x11inputmethod,
                                   "getCurrentParentWindow",
                                   "()J").j;
-#else
-    while (!XtIsShell(parent)){
-        parent = XtParent(parent);
-    }
-#endif
     if (statusWindow->parent != parent){
         statusWindow->parent = parent;
     }
@@ -941,11 +848,7 @@
   }
 }
 
-#ifdef XAWT
 static void adjustStatusWindow(Window shell){
-#else
-void adjustStatusWindow(Widget shell){
-#endif
     JNIEnv *env = GetJNIEnv();
     X11InputMethodData *pX11IMData = NULL;
     StatusWindow *statusWindow;
@@ -957,11 +860,7 @@
         || !statusWindow->on) {
         return;
     }
-#ifdef XAWT
     {
-#else
-    if (statusWindow->parent == shell) {
-#endif
         XWindowAttributes xwa;
         int x, y;
         Window child;
@@ -1009,12 +908,7 @@
  * fallback to None styles.
  */
 static Bool
-#ifdef XAWT
 createXIC(JNIEnv * env, X11InputMethodData *pX11IMData, Window w)
-#else /* !XAWT */
-createXIC(Widget w, X11InputMethodData *pX11IMData,
-          jobject tc, jobject peer)
-#endif /* XAWT */
 {
     XIC active_ic, passive_ic;
     XVaNestedList preedit = NULL;
@@ -1031,17 +925,9 @@
     if (X11im == NULL) {
         return False;
     }
-#ifdef XAWT
     if (!w) {
         return False;
     }
-#else /* !XAWT */
-    /*
-     * If the parent window has one or more TextComponents, the status
-     * area of Motif will be shared with the created XIC. Otherwise,
-     * root-window style status is used.
-     */
-#endif /* XAWT */
 
     ret = XGetIMValues(X11im, XNQueryInputStyle, &im_styles, NULL);
 
@@ -1064,28 +950,7 @@
         }
     }
 #else /*! __linux__ */
-#ifdef XAWT
     on_the_spot_styles |= XIMStatusNothing;
-#else /* !XAWT */
-    /*
-     * If the parent window has one or more TextComponents, the status
-     * area of Motif will be shared with the created XIC. Otherwise,
-     * root-window style status is used.
-     */
-    if (tc != NULL){
-        XVaNestedList status = NULL;
-        status = awt_motif_getXICStatusAreaList(w, tc);
-        if (status != NULL){
-            on_the_spot_styles |=  XIMStatusArea;
-            XFree(status);
-        }
-        else
-            on_the_spot_styles |= XIMStatusNothing;
-    }
-    else
-        on_the_spot_styles |= XIMStatusNothing;
-
-#endif /* XAWT */
 #endif /* __linux__ */
 
     for (i = 0; i < im_styles->count_styles; i++) {
@@ -1157,32 +1022,12 @@
             XFree((void *)preedit);
         }
 #else /* !__linux__ */
-#ifndef XAWT
-        if (on_the_spot_styles & XIMStatusArea) {
-            Widget parent;
-            status = awt_motif_getXICStatusAreaList(w, tc);
-            if (status == NULL)
-                goto err;
-            pX11IMData->statusWidget = awt_util_getXICStatusAreaWindow(w);
-            pX11IMData->ic_active = XCreateIC(X11im,
-                                              XNClientWindow, pX11IMData->statusWidget,
-                                              XNFocusWindow, w,
-                                              XNInputStyle, active_styles,
-                                              XNPreeditAttributes, preedit,
-                                              XNStatusAttributes, status,
-                                              NULL);
-            XFree((void *)status);
-        } else {
-#endif /* XAWT */
             pX11IMData->ic_active = XCreateIC(X11im,
                                               XNClientWindow, w,
                                               XNFocusWindow, w,
                                               XNInputStyle, active_styles,
                                               XNPreeditAttributes, preedit,
                                               NULL);
-#ifndef XAWT
-        }
-#endif /* XAWT */
         XFree((void *)preedit);
 #endif /* __linux__ */
         pX11IMData->ic_passive = XCreateIC(X11im,
@@ -1479,7 +1324,7 @@
 }
 
 /*
- * Class:     java_sun_awt_motif_X11InputMethod
+ * Class:     sun_awt_X11InputMethod
  * Method:    initIDs
  * Signature: ()V
  */
@@ -1495,24 +1340,15 @@
 
 
 JNIEXPORT jboolean JNICALL
-#ifdef XAWT
 Java_sun_awt_X11_XInputMethod_openXIMNative(JNIEnv *env,
                                           jobject this,
                                           jlong display)
-#else
-Java_sun_awt_motif_MInputMethod_openXIMNative(JNIEnv *env,
-                                          jobject this)
-#endif
 {
     Bool registered;
 
     AWT_LOCK();
 
-#ifdef XAWT
     dpy = (Display *)jlong_to_ptr(display);
-#else
-    dpy = awt_display;
-#endif
 
 /* Use IMInstantiate call back only on Linux, as there is a bug in Solaris
    (4768335)
@@ -1534,30 +1370,17 @@
 }
 
 JNIEXPORT jboolean JNICALL
-#ifdef XAWT
 Java_sun_awt_X11_XInputMethod_createXICNative(JNIEnv *env,
                                                   jobject this,
                                                   jlong window)
 {
-#else /* !XAWT */
-Java_sun_awt_motif_MInputMethod_createXICNative(JNIEnv *env,
-                                                  jobject this,
-                                                  jobject comp,
-                                                  jobject tc)
-{
-    struct ComponentData *cdata;
-#endif /* XAWT */
     X11InputMethodData *pX11IMData;
     jobject globalRef;
     XIC ic;
 
     AWT_LOCK();
 
-#ifdef XAWT
     if (!window) {
-#else /* !XAWT */
-    if (JNU_IsNull(env, comp)) {
-#endif /* XAWT */
         JNU_ThrowNullPointerException(env, "NullPointerException");
         AWT_UNLOCK();
         return JNI_FALSE;
@@ -1570,40 +1393,16 @@
         return JNI_FALSE;
     }
 
-#ifndef XAWT
-    if (mcompClass == NULL) {
-        mcompClass = findClass(MCOMPONENTPEER_CLASS_NAME);
-        mcompPDataID = (*env)->GetFieldID(env, mcompClass, "pData", "J");
-    }
-    cdata = (struct ComponentData *) JNU_GetLongFieldAsPtr(env,comp,mcompPDataID);
-
-    if (cdata == 0) {
-        free((void *)pX11IMData);
-        JNU_ThrowNullPointerException(env, "createXIC");
-        AWT_UNLOCK();
-        return JNI_FALSE;
-    }
-
-    pX11IMData->peer = (*env)->NewGlobalRef(env, comp);
-#endif /* XAWT */
     globalRef = (*env)->NewGlobalRef(env, this);
     pX11IMData->x11inputmethod = globalRef;
 #ifdef __linux__
     pX11IMData->statusWindow = NULL;
-#else /* __linux__ */
-#ifndef XAWT
-    pX11IMData->statusWidget = (Widget) NULL;
-#endif /* XAWT */
 #endif /* __linux__ */
 
     pX11IMData->lookup_buf = 0;
     pX11IMData->lookup_buf_len = 0;
 
-#ifdef XAWT
     if (createXIC(env, pX11IMData, (Window)window)
-#else /* !XAWT */
-    if (createXIC(cdata->widget, pX11IMData, tc, comp)
-#endif /* XAWT */
         == False) {
         destroyX11InputMethodData((JNIEnv *) NULL, pX11IMData);
         pX11IMData = (X11InputMethodData *) NULL;
@@ -1615,77 +1414,6 @@
     return (pX11IMData != NULL);
 }
 
-#ifndef XAWT
-JNIEXPORT void JNICALL
-Java_sun_awt_motif_MInputMethod_reconfigureXICNative(JNIEnv *env,
-                                                       jobject this,
-                                                       jobject comp,
-                                                       jobject tc)
-{
-    X11InputMethodData *pX11IMData;
-
-    AWT_LOCK();
-
-    pX11IMData = getX11InputMethodData(env, this);
-    if (pX11IMData == NULL) {
-        AWT_UNLOCK();
-        return;
-    }
-
-    if (pX11IMData->current_ic == (XIC)0) {
-        destroyX11InputMethodData(env, pX11IMData);
-        pX11IMData = (X11InputMethodData *)NULL;
-    } else {
-        Bool active;
-        struct ComponentData *cdata;
-
-        active = pX11IMData->current_ic == pX11IMData->ic_active;
-        if (mcompClass == NULL) {
-            mcompClass = findClass(MCOMPONENTPEER_CLASS_NAME);
-            mcompPDataID = (*env)->GetFieldID(env, mcompClass, "pData", "J");
-        }
-        cdata = (struct ComponentData *) JNU_GetLongFieldAsPtr(env,comp,mcompPDataID);
-        if (cdata == 0) {
-            JNU_ThrowNullPointerException(env, "reconfigureXICNative");
-            destroyX11InputMethodData(env, pX11IMData);
-            pX11IMData = (X11InputMethodData *)NULL;
-        }
-        XDestroyIC(pX11IMData->ic_active);
-        if (pX11IMData->ic_active != pX11IMData->ic_passive)
-            XDestroyIC(pX11IMData->ic_passive);
-        pX11IMData->current_ic = (XIC)0;
-        pX11IMData->ic_active = (XIC)0;
-        pX11IMData->ic_passive = (XIC)0;
-        if (createXIC(cdata->widget, pX11IMData, tc, comp)) {
-            pX11IMData->current_ic = active ?
-                        pX11IMData->ic_active : pX11IMData->ic_passive;
-            /*
-             * On Solaris2.6, setXICWindowFocus() has to be invoked
-             * before setting focus.
-             */
-            setXICWindowFocus(pX11IMData->current_ic, cdata->widget);
-            setXICFocus(pX11IMData->current_ic, True);
-        } else {
-            destroyX11InputMethodData((JNIEnv *) NULL, pX11IMData);
-            pX11IMData = (X11InputMethodData *)NULL;
-        }
-    }
-
-    setX11InputMethodData(env, this, pX11IMData);
-
-    AWT_UNLOCK();
-}
-
-JNIEXPORT void JNICALL
-Java_sun_awt_motif_MInputMethod_setXICFocusNative(JNIEnv *env,
-                                              jobject this,
-                                              jobject comp,
-                                              jboolean req,
-                                              jboolean active)
-{
-    struct ComponentData *cdata;
-    Widget w;
-#else /* !XAWT */
 JNIEXPORT void JNICALL
 Java_sun_awt_X11_XInputMethod_setXICFocusNative(JNIEnv *env,
                                               jobject this,
@@ -1693,7 +1421,6 @@
                                               jboolean req,
                                               jboolean active)
 {
-#endif /* XAWT */
     X11InputMethodData *pX11IMData;
     AWT_LOCK();
     pX11IMData = getX11InputMethodData(env, this);
@@ -1703,40 +1430,16 @@
     }
 
     if (req) {
-#ifdef XAWT
         if (!w) {
             AWT_UNLOCK();
             return;
         }
-#else /* !XAWT */
-        struct ComponentData *cdata;
-
-        if (JNU_IsNull(env, comp)) {
-            AWT_UNLOCK();
-            return;
-        }
-        if (mcompClass == NULL) {
-            mcompClass = findClass(MCOMPONENTPEER_CLASS_NAME);
-            mcompPDataID = (*env)->GetFieldID(env, mcompClass, "pData", "J");
-        }
-        cdata = (struct ComponentData *)JNU_GetLongFieldAsPtr(env, comp,
-                                                              mcompPDataID);
-        if (cdata == 0) {
-            JNU_ThrowNullPointerException(env, "setXICFocus pData");
-            AWT_UNLOCK();
-            return;
-        }
-#endif /* XAWT */
-
         pX11IMData->current_ic = active ?
                         pX11IMData->ic_active : pX11IMData->ic_passive;
         /*
          * On Solaris2.6, setXICWindowFocus() has to be invoked
          * before setting focus.
          */
-#ifndef XAWT
-        w = cdata->widget;
-#endif /* XAWT */
         setXICWindowFocus(pX11IMData->current_ic, w);
         setXICFocus(pX11IMData->current_ic, req);
         currentX11InputMethodInstance = pX11IMData->x11inputmethod;
@@ -1853,40 +1556,6 @@
     return jText;
 }
 
-#ifndef XAWT
-JNIEXPORT void JNICALL
-Java_sun_awt_motif_MInputMethod_configureStatusAreaNative(JNIEnv *env,
-                                                            jobject this,
-                                                            jobject tc)
-{
-    X11InputMethodData *pX11IMData;
-    XVaNestedList status;
-
-#ifdef __linux__
-      /*do nothing for linux? */
-#else
-    AWT_LOCK();
-    pX11IMData = getX11InputMethodData(env, this);
-
-    if ((pX11IMData == NULL) || (pX11IMData->ic_active == (XIC)0)) {
-        AWT_UNLOCK();
-        return;
-    }
-
-    if (pX11IMData->statusWidget) {
-        status = awt_motif_getXICStatusAreaList(pX11IMData->statusWidget, tc);
-        if (status != (XVaNestedList)NULL) {
-            XSetICValues(pX11IMData->ic_active,
-                         XNStatusAttributes, status,
-                         NULL);
-            XFree((void *)status);
-        }
-    }
-    AWT_UNLOCK();
-#endif
-}
-#endif /* XAWT */
-
 /*
  * Class:     sun_awt_X11InputMethod
  * Method:    setCompositionEnabledNative
@@ -1964,7 +1633,6 @@
     return (jboolean)(state == XIMPreeditEnable);
 }
 
-#ifdef XAWT
 JNIEXPORT void JNICALL Java_sun_awt_X11_XInputMethod_adjustStatusWindow
   (JNIEnv *env, jobject this, jlong window)
 {
@@ -1974,4 +1642,3 @@
     AWT_UNLOCK();
 #endif
 }
-#endif
--- a/src/solaris/native/sun/awt/awt_KeyboardFocusManager.h	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2001, 2002, 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 "jni.h"
-
-struct KeyboardFocusManagerIDs {
-    jclass keyboardFocusManagerCls;
-    jmethodID shouldNativelyFocusHeavyweightMID;
-    jmethodID heavyweightButtonDownMID;
-    jmethodID heavyweightButtonDownZMID;
-    jmethodID markClearGlobalFocusOwnerMID;
-    jmethodID processSynchronousTransferMID;
-    jfieldID isProxyActive;
-};
--- a/src/solaris/native/sun/awt/awt_MToolkit.c	Tue Dec 13 15:41:47 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3430 +0,0 @@
-/*
- * Copyright (c) 1995, 2007, 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 "awt_p.h"
-
-#include <sys/time.h>
-#include <limits.h>
-#include <locale.h>
-
-#ifndef HEADLESS
-#include <X11/cursorfont.h>
-#include <Xm/MenuShell.h>
-#include <Xm/RowColumn.h>
-#endif /* !HEADLESS */
-
-#include <jvm.h>
-#include <jni.h>
-#include <jlong.h>
-#include <jni_util.h>
-
-/* JNI headers */
-#include "java_awt_AWTEvent.h"
-#include "java_awt_Frame.h"
-#include "java_awt_SystemColor.h"
-#include "sun_awt_motif_MToolkit.h"
-
-/* JNI field and method ids */
-#include "awt_Component.h"
-//#include "awt_Cursor.h"
-#include "awt_MenuComponent.h"
-#include "awt_TopLevel.h"
-#include "canvas.h"
-#include "color.h"
-#include "awt_mgrsel.h"
-#include "awt_wm.h"
-#include "awt_DrawingSurface.h"
-#include "awt_Window.h"
-#include "awt_xembed.h"
-#include "awt_xembed_server.h"
-
-extern JavaVM *jvm;
-
-#ifndef HEADLESS
-#ifdef __linux__
-extern void statusWindowEventHandler(XEvent event);
-#endif
-#endif /* !HEADLESS */
-
-JNIEXPORT jint JNICALL
-JNI_OnLoad(JavaVM *vm, void *reserved)
-{
-#ifndef HEADLESS
-    awt_util_debug_init();
-#endif /* !HEADLESS */
-    jvm = vm;
-    return JNI_VERSION_1_2;
-}
-
-JNIEXPORT jboolean JNICALL AWTIsHeadless() {
-#ifdef HEADLESS
-    return JNI_TRUE;
-#else
-    return JNI_FALSE;
-#endif
-}
-
-#ifndef HEADLESS
-static jlong awtJNI_TimeMillis(void);
-extern void awt_initialize_Xm_DnD(Display*);
-extern void awt_initialize_DataTransferer();
-
-extern Display *awt_init_Display(JNIEnv *env);
-
-extern void X11SD_LibDispose(JNIEnv *env);
-
-extern Widget drag_source = NULL;
-
-extern struct ComponentIDs componentIDs;
-extern struct MenuComponentIDs menuComponentIDs;
-extern struct MComponentPeerIDs mComponentPeerIDs;
-extern struct WindowIDs windowIDs;
-
-static Atom _XA_XSETTINGS_SETTINGS = None;
-struct xsettings_callback_cookie {
-    jobject mtoolkit;
-    jmethodID upcallMID;
-};
-
-static struct xsettings_callback_cookie xsettings_callback_cookie;
-
-
-static XEvent focusOutEvent;
-
-static void awt_pipe_init(void);
-static void processOneEvent(XtInputMask iMask);
-extern void waitForEvents(JNIEnv *env, int32_t fdXPipe, int32_t fdAWTPipe);
-#ifdef USE_SELECT
-static void performSelect(JNIEnv *env, int32_t fdXPipe, int32_t fdAWTPipe);
-#else
-static void performPoll(JNIEnv *env,int32_t fdXPipe, int32_t fdAWTPipe);
-#endif
-
-
-#include <X11/Intrinsic.h>
-#include <dlfcn.h>
-#include <fcntl.h>
-
-#ifdef USE_SELECT
-#if defined(AIX)
-#include <sys/select.h>
-#endif
-#else
-#include <poll.h>
-#ifndef POLLRDNORM
-#define POLLRDNORM POLLIN
-#endif
-#endif
-
-#ifdef NDEBUG
-#undef DEBUG            /* NDEBUG overrides DEBUG */
-#endif
-
-static struct WidgetInfo *awt_winfo = (struct WidgetInfo *) NULL;
-static struct MenuList* menu_list = (struct MenuList*) NULL;
-
-#ifndef bzero
-#define bzero(a,b) memset(a, 0, b)
-#endif
-
-static jboolean syncUpdated = JNI_FALSE;
-static jboolean syncFailed = JNI_FALSE;
-static jint eventNumber = 0;
-static void syncWait_eventHandler(XEvent *);
-static Atom oops_atom = None;
-static Atom wm_selection = None;
-static Atom version_atom = None;
-
-static Boolean inSyncWait = False;
-
-Widget grabbed_widget = NULL;
-
-XtAppContext awt_appContext;
-Widget awt_root_shell;
-Pixel awt_defaultBg;
-Pixel awt_defaultFg;
-int32_t awt_multiclick_time;        /* milliseconds */
-uint32_t awt_MetaMask = 0;
-uint32_t awt_AltMask = 0;
-uint32_t awt_NumLockMask = 0;
-uint32_t awt_ModeSwitchMask = 0;
-Cursor awt_scrollCursor;
-Boolean  awt_ModLockIsShiftLock = False;
-extern Boolean awt_UseType4Patch;
-extern Boolean awt_UseXKB;
-
-#define SPECIAL_KEY_EVENT 2
-
-/* implement a "putback queue" -- see comments on awt_put_back_event() */
-#define PUTBACK_QUEUE_MIN_INCREMENT 5   /* min size increase */
-static XEvent *putbackQueue = NULL;     /* the queue -- next event is 0 */
-static int32_t putbackQueueCount = 0;   /* # of events available on queue */
-static int32_t putbackQueueCapacity = 0;        /* total capacity of queue */
-static XtInputMask awt_events_pending(XtAppContext appContext);
-static int32_t awt_get_next_put_back_event(XEvent *xev_out);
-
-#define AWT_FLUSH_TIMEOUT    ((uint32_t)100) /* milliseconds */
-#define AWT_MIN_POLL_TIMEOUT ((uint32_t)0) /* milliseconds */
-#define AWT_MAX_POLL_TIMEOUT ((uint32_t)250) /* milliseconds */
-
-#define AWT_POLL_BUFSIZE        100
-#define AWT_READPIPE            (awt_pipe_fds[0])
-#define AWT_WRITEPIPE           (awt_pipe_fds[1])
-#define AWT_FLUSHOUTPUT_NOW()  \
-{                              \
-    XFlush(awt_display);       \
-    awt_next_flush_time = 0LL; \
-}
-
-typedef XtIntervalId (*XTFUNC)();
-
-static jobject  awt_MainThread = NULL;
-static char     read_buf[AWT_POLL_BUFSIZE + 1];    /* dummy buf to empty pipe */
-static int32_t      awt_pipe_fds[2];                   /* fds for wkaeup pipe */
-static Boolean  awt_pipe_inited = False;           /* make sure pipe is initialized before write */
-static int32_t      def_poll_timeout = AWT_MAX_POLL_TIMEOUT;   /* default value for timeout */
-static jlong awt_next_flush_time = 0LL; /* 0 == no scheduled flush */
-static void     *xt_lib = NULL;
-static XTFUNC   xt_timeout = NULL;
-
-#ifdef DEBUG_AWT_LOCK
-
-int32_t awt_locked = 0;
-char *lastF = "";
-int32_t lastL = -1;
-
-#endif
-
-#ifndef NOMODALFIX
-extern Boolean awt_isModal();
-extern Boolean awt_isWidgetModal(Widget w);
-#endif
-
-Boolean keyboardGrabbed = False;
-
-static uint32_t curPollTimeout = AWT_MAX_POLL_TIMEOUT;
-
-/* Font information to feed Motif widgets. */
-static const char      *motifFontList;
-static XFontSet        defaultMotifFontSet;
-static XFontStruct     *defaultMotifFontStruct;
-static const char *defaultMotifFont =  /* a.k.a "fixed", known everywhere */
-        "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1";
-
-XFontSet getMotifFontSet() {
-    char    **missingList;
-    int32_t     missingCount;
-    char    *defChar;
-
-    return XCreateFontSet(awt_display, motifFontList,
-                          &missingList, &missingCount, &defChar);
-}
-
-XFontStruct *getMotifFontStruct() {
-    return XLoadQueryFont(awt_display, defaultMotifFont);
-}
-
-XmFontList getMotifFontList() {
-    XmFontListEntry motifFontListEntry;
-    XmFontList fontlist;
-
-    if (strchr(motifFontList, ',') == NULL) {
-        /* If the default font is a single font. */
-        if (defaultMotifFontStruct == NULL)
-            defaultMotifFontStruct = getMotifFontStruct();
-        motifFontListEntry = XmFontListEntryCreate(XmFONTLIST_DEFAULT_TAG,
-                                                   XmFONT_IS_FONT,
-                                           (XtPointer)defaultMotifFontStruct);
-    }
-    else {
-        /* If the default font is multiple fonts. */
-        if (defaultMotifFontSet == NULL)
-            defaultMotifFontSet = getMotifFontSet();
-            motifFontListEntry = XmFontListEntryCreate(XmFONTLIST_DEFAULT_TAG,
-                                               XmFONT_IS_FONTSET,
-                                               (XtPointer)defaultMotifFontSet);
-    }
-    fontlist = XmFontListAppendEntry(NULL, motifFontListEntry);
-    XmFontListEntryFree(&motifFontListEntry);
-    return fontlist;
-}
-
-static void
-awt_set_poll_timeout (uint32_t newTimeout)
-{
-    DTRACE_PRINTLN1("awt_set_poll_timeout(%lu)", newTimeout);
-
-    newTimeout = max(AWT_MIN_POLL_TIMEOUT, newTimeout);
-    newTimeout = min(AWT_MAX_POLL_TIMEOUT, newTimeout);
-    newTimeout = min(newTimeout, curPollTimeout);
-    curPollTimeout = newTimeout;
-
-} /* awt_set_poll_timeout */
-
-/*
- * Gets the best timeout for the next call to poll() or select().
- * If timedOut is True, we assume that our previous timeout elapsed
- * with no events/timers arriving. Therefore, we can increase the
- * next timeout slightly.
- */
-static uint32_t
-awt_get_poll_timeout( Boolean timedOut )
-{
-    uint32_t timeout = AWT_MAX_POLL_TIMEOUT;
-
-    DTRACE_PRINTLN2("awt_get_poll_timeout(%s), awt_next_flush_time:%ld",
-        (remove?"true":"false"),
-        awt_next_flush_time);
-
-    if (timedOut) {
-        /* add 1/16 (plus 1, in case the division truncates to 0) */
-        curPollTimeout += ((curPollTimeout>>4) + 1);
-        curPollTimeout = min(AWT_MAX_POLL_TIMEOUT, curPollTimeout);
-    }
-    if (awt_next_flush_time > 0) {
-        int32_t flushDiff = (int32_t)(awt_next_flush_time - awtJNI_TimeMillis());
-        timeout = min(curPollTimeout, flushDiff);
-    } else {
-        timeout = curPollTimeout;
-    }
-
-    return timeout;
-} /* awt_get_poll_timeout() */
-
-static jlong
-awtJNI_TimeMillis(void)
-{
-    struct timeval t;
-
-    gettimeofday(&t, 0);
-
-    return jlong_add(jlong_mul(jint_to_jlong(t.tv_sec), jint_to_jlong(1000)),
-                     jint_to_jlong(t.tv_usec / 1000));
-}
-
-static int32_t
-xtError()
-{
-#ifdef DEBUG
-    JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-
-    jio_fprintf(stderr, "Xt error\n");
-    JNU_ThrowNullPointerException(env, "NullPointerException");
-#endif
-    return 0;
-}
-
-static int32_t
-xIOError(Display *dpy)
-{
-    JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-    jclass cl = (*env)->FindClass(env, "java/lang/Thread");
-
-    if (errno == EPIPE) {
-        jio_fprintf(stderr, "X connection to %s host broken (explicit kill or server shutdown)\n", XDisplayName(NULL));
-    }
-    AWT_NOFLUSH_UNLOCK();
-    JVM_RaiseSignal(JVM_SIGTERM); /* Shut down cleanly */
-    if (cl != NULL) {
-        JVM_Sleep(env, cl, 20000);
-    }
-
-    return 0; /* to keep compiler happy */
-}
-
-/* Like XKeysymToKeycode, but ensures that keysym is the primary
- * symbol on the keycode returned.  Returns zero otherwise.
- */
-static int32_t
-keysym_to_keycode_if_primary(Display *dpy, KeySym sym)
-{
-    KeyCode code;
-    KeySym primary;
-
-    code = XKeysymToKeycode(dpy, sym);
-    if (code == 0) {
-        return 0;
-    }
-
-    primary = XKeycodeToKeysym(dpy, code, 0);
-    if (sym == primary) {
-        return code;
-    } else {
-        return 0;
-    }
-}
-/*
- * +kb or -kb ?
- */
-static Boolean
-isXKBenabled(Display *display) {
-    int mop, beve, berr;
-    /*
-     * NB: TODO: hope it will return False if XkbIgnoreExtension was called!
-     */
-    return XQueryExtension(display, "XKEYBOARD", &mop, &beve, &berr);
-}
-
-
-/* Assign meaning - alt, meta, etc. - to X modifiers mod1 ... mod5.
- * Only consider primary symbols on keycodes attached to modifiers.
- */
-static void
-setup_modifier_map(Display *disp)
-{
-    KeyCode metaL      = keysym_to_keycode_if_primary(disp, XK_Meta_L);
-    KeyCode metaR      = keysym_to_keycode_if_primary(disp, XK_Meta_R);
-    KeyCode altL       = keysym_to_keycode_if_primary(disp, XK_Alt_L);
-    KeyCode altR       = keysym_to_keycode_if_primary(disp, XK_Alt_R);
-    KeyCode numLock    = keysym_to_keycode_if_primary(disp, XK_Num_Lock);
-    KeyCode modeSwitch = keysym_to_keycode_if_primary(disp, XK_Mode_switch);
-    KeyCode shiftLock  = keysym_to_keycode_if_primary(disp, XK_Shift_Lock);
-    KeyCode capsLock   = keysym_to_keycode_if_primary(disp, XK_Caps_Lock);
-
-    XModifierKeymap *modmap = NULL;
-    int32_t nkeys, modn, i;
-    char *ptr = NULL;
-
-    DTRACE_PRINTLN("In setup_modifier_map");
-
-    modmap = XGetModifierMapping(disp);
-    nkeys = modmap->max_keypermod;
-
-    for (modn = Mod1MapIndex;
-         (modn <= Mod5MapIndex) &&
-             (awt_MetaMask == 0 || awt_AltMask == 0 ||
-              awt_NumLockMask == 0 || awt_ModeSwitchMask == 0);
-         ++modn)
-    {
-        static const uint32_t modmask[8] = {
-            ShiftMask, LockMask, ControlMask,
-            Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask
-        };
-
-
-        for (i = 0; i < nkeys; ++i) {
-            /* for each keycode attached to this modifier */
-            KeyCode keycode = modmap->modifiermap[modn * nkeys + i];
-            if (keycode == 0) {
-                continue;
-            }
-
-            if (awt_MetaMask == 0 && (keycode == metaL || keycode == metaR)) {
-                awt_MetaMask = modmask[modn];
-                DTRACE_PRINTLN2("    awt_MetaMask       = %d, modn = %d", awt_MetaMask, modn);
-                break;
-            } else if (awt_AltMask == 0 && (keycode == altL || keycode == altR)) {
-                awt_AltMask = modmask[modn];
-                DTRACE_PRINTLN2("    awt_AltMask        = %d, modn = %d", awt_AltMask, modn);
-                break;
-            } else if (awt_NumLockMask == 0 && keycode == numLock) {
-                awt_NumLockMask = modmask[modn];
-                DTRACE_PRINTLN2("    awt_NumLockMask    = %d, modn = %d", awt_NumLockMask, modn);
-                break;
-            } else if (awt_ModeSwitchMask == 0 && keycode == modeSwitch) {
-                awt_ModeSwitchMask = modmask[modn];
-                DTRACE_PRINTLN2("    awt_ModeSwitchMask = %d, modn = %d", awt_ModeSwitchMask, modn);
-                break;
-            }
-        }
-    }
-    for(i = 0; i < nkeys; i++) {
-        KeyCode keycode = modmap->modifiermap[LockMapIndex * nkeys + i];
-        if (keycode == 0) {
-            break;
-        }
-        if (keycode == shiftLock) {
-            awt_ModLockIsShiftLock = True;
-            break;
-        }
-        if (keycode == capsLock) {
-            break;
-        }
-    }
-
-    DTRACE_PRINTLN1("    ShiftMask          = %d", ShiftMask);
-    DTRACE_PRINTLN1("    ControlMask        = %d", ControlMask);
-
-    XFreeModifiermap(modmap);
-    ptr = getenv("_AWT_USE_TYPE4_PATCH");
-    if( ptr != NULL && ptr[0] != 0 ) {
-        if( strncmp("true", ptr, 4) == 0 ) {
-           awt_UseType4Patch = True;
-        }else if( strncmp("false", ptr, 5) == 0 ) {
-           awt_UseType4Patch = False;
-        }
-    }
-    awt_UseXKB = isXKBenabled(disp);
-
-}
-
-
-Boolean scrollBugWorkAround;
-
-
-void
-awt_output_flush()
-{
-    char c = 'p';
-
-    if (awt_next_flush_time == 0)
-    {
-        Boolean needsWakeup = False;
-        JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-        if (awt_pipe_inited && (awt_get_poll_timeout(False) > (2*AWT_FLUSH_TIMEOUT))){
-            needsWakeup = True;
-        }
-        /* awt_next_flush_time affects awt_get_poll_timeout(), so set
-         * the variable *after* calling the function.
-         */
-        awt_next_flush_time = awtJNI_TimeMillis() + AWT_FLUSH_TIMEOUT;
-        if (needsWakeup)
-        {
-            /* write to the utility pipe to wake up the event
-             * loop, if it's sleeping
-             */
-            write ( AWT_WRITEPIPE, &c, 1 );
-        }
-    }
-#ifdef FLUSHDEBUG
-else
-jio_fprintf(stderr, "!");
-#endif
-} /* awt_output_flush() */
-
-void
-null_event_handler(Widget w, XtPointer client_data,
-                   XEvent * event, Boolean * cont)
-{
-    /* do nothing */
-}
-
-struct WidgetInfo *
-findWidgetInfo(Widget widget)
-{
-    struct WidgetInfo *cw;
-
-    for (cw = awt_winfo; cw != NULL; cw = cw->next) {
-        if (cw->widget == widget || cw->origin == widget) {
-            return cw;
-        }
-    }
-    return NULL;
-}
-
-void
-awt_addWidget(Widget w, Widget origin, void *peer, jlong event_flags)
-{
-    if (findWidgetInfo(w) != NULL) return;
-
-    if (!XtIsSubclass(w, xmFileSelectionBoxWidgetClass)) {
-        struct WidgetInfo *nw = (struct WidgetInfo *) malloc(sizeof(struct WidgetInfo));
-
-        if (nw) {
-            nw->widget     = w;
-            nw->origin     = origin;
-            nw->peer       = peer;
-            nw->event_mask = event_flags;
-            nw->next       = awt_winfo;
-            awt_winfo      = nw;
-
-            if (event_flags & java_awt_AWTEvent_MOUSE_EVENT_MASK) {
-                XtAddEventHandler(w,
-                                  ButtonPressMask | ButtonReleaseMask |
-                                  EnterWindowMask | LeaveWindowMask,
-                                  False, null_event_handler, NULL);
-                if (w != origin) {
-                    XtAddEventHandler(origin,
-                                      ButtonPressMask | ButtonReleaseMask |
-                                      EnterWindowMask | LeaveWindowMask,
-                                      False, null_event_handler, NULL);
-                }
-            }
-            if (event_flags & java_awt_AWTEvent_MOUSE_MOTION_EVENT_MASK) {
-                XtAddEventHandler(w,
-                                  PointerMotionMask,
-                                  False, null_event_handler, NULL);
-                if (w != origin) {
-                    XtAddEventHandler(origin,
-                                      PointerMotionMask,
-                                      False, null_event_handler, NULL);
-                }
-            }
-            if (event_flags & java_awt_AWTEvent_KEY_EVENT_MASK) {
-                XtAddEventHandler(w,
-                                  KeyPressMask | KeyReleaseMask,
-                                  False, null_event_handler, NULL);
-                if (w != origin) {
-                    XtAddEventHandler(origin,
-                                      KeyPressMask | KeyReleaseMask,
-                                      False, null_event_handler, NULL);
-                }
-            }
-        } else {
-            JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-            JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError");
-        }
-
-    }
-}
-
-void
-awt_delWidget(Widget w)
-{
-    struct WidgetInfo *cw;
-
-    if (awt_winfo != NULL) {
-        if ((awt_winfo->widget == w) ||
-            (awt_winfo->origin == w)) {
-            cw = awt_winfo;
-            awt_winfo = awt_winfo->next;
-            free((void *) cw);
-        } else {
-            struct WidgetInfo *pw;
-
-            for (pw = awt_winfo, cw = awt_winfo->next;
-                 cw != NULL;
-                 pw = cw, cw = cw->next) {
-                if ((cw->widget == w) ||
-                    (cw->origin == w)) {
-                    pw->next = cw->next;
-                    free((void *) cw);
-                    break;
-                }
-            }
-        }
-    }
-}
-
-
-void *
-findPeer(Widget * pwidget)
-{
-    struct WidgetInfo   *cw;
-    Widget widgetParent;
-    void * peer;
-
-    if ((cw = findWidgetInfo(*pwidget)) != NULL) {
-        return cw->peer;
-    }
-    /* fix for 4053856, robi.khan@eng
-       couldn't find peer corresponding to widget
-       but the widget may be child of one with
-       a peer, so recurse up the hierarchy */
-    widgetParent = XtParent(*pwidget);
-    if (widgetParent != NULL ) {
-        peer = findPeer(&widgetParent);
-        if( peer != NULL ) {
-        /* found peer attached to ancestor of given
-           widget, so set widget return value as well */
-            *pwidget = widgetParent;
-            return peer;
-        }
-    }
-
-    return NULL;
-}
-
-Boolean
-awt_isAwtWidget(Widget widget)
-{
-    return (findWidgetInfo(widget) != NULL);
-}
-
-
-static Boolean
-awt_isAwtMenuWidget(Widget wdgt) {
-    struct MenuList* cur;
-
-    if (!XtIsSubclass(wdgt, xmRowColumnWidgetClass)) {
-        return False;
-    }
-    for (cur = menu_list; cur != NULL; cur = cur->next) {
-        if (cur->menu == wdgt) {
-            return True;
-        }
-    }
-    return False;
-}
-
-void
-awt_addMenuWidget(Widget wdgt) {
-    DASSERT(XtIsSubclass(wdgt, xmRowColumnWidgetClass));
-
-    if (!awt_isAwtMenuWidget(wdgt)) {
-        struct MenuList* ml = (struct MenuList*) malloc(sizeof(struct MenuList));
-        if (ml != NULL) {
-            ml->menu = wdgt;
-            ml->next = menu_list;
-            menu_list = ml;
-        } else {
-            JNIEnv* env = (JNIEnv*)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-            JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError");
-        }
-    }
-}
-
-void
-awt_delMenuWidget(Widget wdgt) {
-    struct MenuList** pp;
-    struct MenuList* p;
-
-    DASSERT(XtIsSubclass(wdgt, xmRowColumnWidgetClass));
-
-    for (pp = &menu_list; *pp != NULL; pp = &((*pp)->next)) {
-        if ((*pp)->menu == wdgt) {
-            p = *pp;
-            *pp = (*pp)->next;
-            free((void*)p);
-            break;
-        }
-    }
-}
-
-
-static Widget
-getShellWidgetByPart(Widget part) {
-    int i;
-    for (i = 0; i < 3; i++) {
-        if (part == NULL) return NULL;
-        if (XtIsShell(part)) return part;
-        part = XtParent(part);
-    }
-    return NULL;
-}
-
-static Boolean
-isTheSameShellWidget(Widget shell, Widget w) {
-    Widget s1, s2;
-    if (shell == NULL || w == NULL) return False;
-    s1 = getShellWidgetByPart(shell);
-    s2 = getShellWidgetByPart(w);
-    if (s1 == s2 && s1 != NULL) {
-        return True;
-    } else {
-        return False;
-    }
-}
-
-static Boolean
-shouldDispatchToWidget(XEvent * xev)
-{
-  /* If this function returns False, that means that it has not pre-posted
-     this event to Java. The caller will then dispatch the event to Motif,
-     and our handlers will be called to post it to Java.
-     If this function returns true, then this function has posted this event
-     to java before returning. The caller will not dispatch it to Motif;
-     it will be dispatched to Motif via the putbackQueue after it has been
-     processed by Java */
-
-    Window win;
-    Widget widget = NULL;
-    struct WidgetInfo *winfo;
-    void *peer = NULL;
-    Boolean cont = FALSE;
-
-    switch (xev->type) {
-        case KeyPress:
-        case KeyRelease:
-            win = xev->xkey.window;
-            break;
-        case FocusIn:
-        case FocusOut:
-            win = xev->xfocus.window;
-            break;
-        case ButtonPress:
-        case ButtonRelease:
-            win = xev->xbutton.window;
-            break;
-        case MotionNotify:
-            win = xev->xmotion.window;
-            break;
-        case EnterNotify:
-        case LeaveNotify:
-            win = xev->xcrossing.window;
-            break;
-        default:
-            return False;
-    }
-
-    if ((widget = XtWindowToWidget(awt_display, win)) == NULL) {
-        return False;
-    }
-
-    if (xev->type == KeyPress || xev->type == KeyRelease) {
-        Widget focusWidget = XmGetFocusWidget(widget);
-
-        /* Fix for 4328561 by ibd@sparc.spb.su
-           If the widget is a Choice, the widget with focus is probably lying
-           outside the current widget's sub-hierarchy, so we have to go up the
-           hierarchy to reach it */
-
-        if ((focusWidget == NULL) && XmIsMenuShell(widget)) {
-            if ((widget = XtParent(widget)) != NULL) {
-                focusWidget = XmGetFocusWidget(widget);
-            } else {
-                return False;
-            }
-
-            /* In this case, focus widget should be CascadeButtonGadget type,
-               but we should send the events to its parent */
-            if (focusWidget != NULL && XmIsCascadeButtonGadget(focusWidget)) {
-                widget = XtParent(focusWidget);
-            } else {
-                /* If something went wrong, restore the original status */
-                widget = XtWindowToWidget(awt_display, win);
-            }
-        }
-
-        /* if focus owner is null, redirect key events to focused window */
-        if (focusWidget == NULL && findWidgetInfo(widget) == NULL) {
-            focusWidget = findTopLevelByShell(widget);
-        }
-
-        /* If we are on a non-choice widget, process events in a normal way */
-        if ((focusWidget != NULL) && (focusWidget != widget)) {
-            if (isTheSameShellWidget(focusWidget, widget)) {
-                focusWidget = findTopLevelByShell(widget);
-            }
-            if (focusWidget != NULL) {
-                peer = findPeer(&focusWidget);
-            }
-            if (peer != NULL) {
-                widget = focusWidget;
-                win = xev->xkey.window = XtWindow(focusWidget);
-            }
-        }
-    }
-
-    if ((winfo = findWidgetInfo(widget)) == NULL) {
-        return False;
-    }
-
-    /*
-     * Fix for bug 4145193
-     *
-     * If a menu is up (not just a popup menu), prevent awt components from
-     * getting any events until the menu is popped down.
-     * Before this fix, the fact that mouse/button events were
-     * preposted to the Java event queue was causing the ButtonRelease
-     * (needed to pop menu down) to be seen by the menu's parent and
-     * not the menu.
-     */
-    if (awtMenuIsActive()) {
-        Widget focusWidget = XmGetFocusWidget(widget);
-
-        if (focusWidget == NULL) {
-            return False;
-        }
-
-        /* If we are on a choice, dispatch the events to widget, but do not
-         * dispatch the events if we are on popped up menu.
-         */
-        if (!XmIsRowColumn(widget) || !XmIsCascadeButtonGadget(focusWidget)) {
-            /* Fix for 4328557 by ibd@sparc.spb.su
-             * If we are dragging mouse from choice and are currently outside
-             * of it, dispatch events to the choice - the source of dragging.
-             */
-
-            if ((drag_source != NULL) && (widget != drag_source) &&
-                (peer = findPeer(&drag_source))) {
-                awt_canvas_handleEvent(drag_source, peer, xev, winfo, &cont, TRUE);
-            }
-            return False;
-        }
-    }
-
-    /* If the keyboard is grabbed by a popup (such as a choice) during
-       a time when a focus proxy is in effect, the abovefocusIsOnMenu
-       test will not detect the sitation because the focus will be on
-       the proxy. But we need events to go to Motif first, so that the
-       grab can be undone when appropriate. */
-    if (keyboardGrabbed) {
-        return False;
-    }
-
-    /* If it's a keyboard event, we need to find the peer associated */
-    /* with the widget that has the focus rather than the widget */
-    /* associated with the window in the X event. */
-
-    switch (xev->type) {
-      case KeyPress:
-      case KeyRelease:
-          if (!(winfo->event_mask & java_awt_AWTEvent_KEY_EVENT_MASK))
-              return False;
-          break;
-        case FocusIn:
-        case FocusOut:
-            if (!(winfo->event_mask & java_awt_AWTEvent_FOCUS_EVENT_MASK))
-                return False;
-            break;
-        case ButtonPress:
-        case ButtonRelease:
-            if (!(winfo->event_mask & java_awt_AWTEvent_MOUSE_EVENT_MASK)) {
-                return False;
-            }
-            break;
-        case EnterNotify:
-        case LeaveNotify:
-            /*
-             * Do not post the enter/leave event if it's on a subwidget
-             * within the component.
-             */
-            if (!(winfo->event_mask & java_awt_AWTEvent_MOUSE_EVENT_MASK) ||
-                widget != winfo->origin)
-                return False;
-            break;
-        case MotionNotify:
-            if (!(winfo->event_mask & java_awt_AWTEvent_MOUSE_MOTION_EVENT_MASK))
-                return False;
-            break;
-        default:
-            return False;
-    }
-
-    peer = winfo->peer;
-
-    /* If we found a widget and a suitable peer (either the focus
-       peer above or the one associated with the widget then we
-       dispatch to it. */
-    if (peer == NULL) {
-        return False;
-    }
-
-    /*
-     * Fix for bug 4173714 - java.awt.button behaves differently under
-     * Win32/Solaris.
-     * Component should not get any events when it's disabled.
-     */
-    if (!XtIsSensitive(widget)) {
-        if (xev->type == EnterNotify) {
-            updateCursor(peer, CACHE_UPDATE);
-        }
-        return False;
-    }
-
-    awt_canvas_handleEvent(widget, peer, xev, winfo, &cont, TRUE);
-    return (!cont);
-} /* shouldDispatchToWidget() */
-
-
-void set_toolkit_busy(Boolean busy) {
-
-    JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-
-    static jclass awtAutoShutdownClass = NULL;
-    static jmethodID notifyBusyMethodID = NULL;
-    static jmethodID notifyFreeMethodID = NULL;
-
-    if (awtAutoShutdownClass == NULL) {
-        jclass awtAutoShutdownClassLocal = (*env)->FindClass(env, "sun/awt/AWTAutoShutdown");
-        if ((*env)->ExceptionOccurred(env)) {
-            (*env)->ExceptionDescribe(env);
-            (*env)->ExceptionClear(env);
-        }
-        DASSERT(awtAutoShutdownClassLocal != NULL);
-        if (awtAutoShutdownClassLocal == NULL) {
-            return;
-        }
-
-        awtAutoShutdownClass = (jclass)(*env)->NewGlobalRef(env, awtAutoShutdownClassLocal);
-        (*env)->DeleteLocalRef(env, awtAutoShutdownClassLocal);
-
-        notifyBusyMethodID = (*env)->GetStaticMethodID(env, awtAutoShutdownClass,
-                                                    "notifyToolkitThreadBusy", "()V");
-        if ((*env)->ExceptionOccurred(env)) {
-            (*env)->ExceptionDescribe(env);
-            (*env)->ExceptionClear(env);
-        }
-        notifyFreeMethodID = (*env)->GetStaticMethodID(env, awtAutoShutdownClass,
-                                                    "notifyToolkitThreadFree", "()V");
-        if ((*env)->ExceptionOccurred(env)) {
-            (*env)->ExceptionDescribe(env);
-            (*env)->ExceptionClear(env);
-        }
-        DASSERT(notifyBusyMethodID != NULL);
-        DASSERT(notifyFreeMethodID != NULL);
-        if (notifyBusyMethodID == NULL || notifyFreeMethodID == NULL) {
-            return;
-        }
-    } /* awtAutoShutdownClass == NULL*/
-
-    if (busy) {
-        (*env)->CallStaticVoidMethod(env, awtAutoShutdownClass,
-                                     notifyBusyMethodID);
-    } else {
-        (*env)->CallStaticVoidMethod(env, awtAutoShutdownClass,
-                                     notifyFreeMethodID);
-    }
-
-    if ((*env)->ExceptionOccurred(env)) {
-        (*env)->ExceptionDescribe(env);
-        (*env)->ExceptionClear(env);
-    }
-}
-
-#ifdef DEBUG
-static int32_t debugPrintLineCount = 0;   /* limit debug output per line */
-#endif
-
-/*
- * This is the main Xt event loop for the AWT.
- *
- * Because java applications are multithreaded, but X and Xt
- * are thread-dumb, we must make special considerations to
- * make ensure that the X/Xt libraries are not entered by
- * multiple threads simultaneously.
- *
- * The biggest difference between the standard Xt loop
- * and this loop is that we go to great lengths never to block
- * in the X libraries. We poll() on the X event pipe, waiting
- * for events, rather than simply calling XtAppNextEvent() and
- * blocking. If this thread were to block in XtAppNextEvent(),
- * no other thread could enter (e.g., to perform a paint or
- * retrieve data).
- */
-/* #ifdef DEBUG */
-    int32_t  numEventsHandled = 0;
-/* #endif */
-static void
-awt_MToolkit_loop(JNIEnv *env)
-{
-    XtInputMask iMask;
-    int32_t  fdXPipe = -1;              /* pipe where X events arrive */
-
-    /* only privileged thread should be running here */
-    DASSERT(awt_currentThreadIsPrivileged(env));
-
-    /* The pipe where X events arrive */
-    fdXPipe = ConnectionNumber(awt_display) ;
-
-    /* We execute events while locked, unlocking only when waiting
-     * for an event
-     */
-    AWT_LOCK();
-
-    /* Create the AWT utility pipe. See the comments on awt_pipe_init() */
-    awt_pipe_init();
-
-    /*
-     * Need to flush here in case data on the connection was read
-     * before we acquired the monitor.
-     *
-     * I don't get this, but I'm too chicken to remove it. -jethro 2Sep98
-     */
-    AWT_FLUSHOUTPUT_NOW();
-
-    /*
-     * ACTUALLY PROCESS EVENTS
-     */
-    while(True) {
-
-        /* process all events in the queue */
-/*      #ifdef DEBUG */
-/*          numEventsHandled = 0; */
-/*      #endif */
-        while (((iMask = awt_events_pending(awt_appContext)) & XtIMAll) > 0) {
-
-/*          #ifdef DEBUG */
-                ++numEventsHandled;
-/*          #endif */
-            processOneEvent(iMask);
-
-        }  /* end while awt_events_pending() */
-        /* At this point, we have exhausted the event queue */
-
-        /* print the number of events handled in parens */
-        DTRACE_PRINT1("(%d events)",(int32_t)numEventsHandled);
-#ifdef DEBUG
-        if (++debugPrintLineCount > 8) {
-            DTRACE_PRINTLN("");
-            debugPrintLineCount = 0;
-        }
-#endif
-
-        AWT_NOTIFY_ALL();               /* wake up modalWait() */
-
-        set_toolkit_busy(False);
-
-        /* Here, we wait for X events, outside of the X libs. When
-         * it's likely that an event is waiting, we process the queue
-         */
-        waitForEvents(env, fdXPipe, AWT_READPIPE);
-
-        set_toolkit_busy(True);
-
-    } /* while(True) */
-
-    /* If we ever exit the loop, must unlock the toolkit */
-
-} /* awt_MToolkit_loop() */
-
-/*
- * Creates the AWT utility pipe. This pipe exists solely so that
- * we can cause the main event thread to wake up from a poll() or
- * select() by writing to this pipe.
- */
-static void
-awt_pipe_init(void) {
-
-    if (awt_pipe_inited) {
-        return;
-    }
-
-    if ( pipe ( awt_pipe_fds ) == 0 )
-    {
-        /*
-        ** the write wakes us up from the infinite sleep, which
-        ** then we cause a delay of AWT_FLUSHTIME and then we
-        ** flush.
-        */
-        int32_t flags = 0;
-        awt_set_poll_timeout (def_poll_timeout);
-        /* set the pipe to be non-blocking */
-        flags = fcntl ( AWT_READPIPE, F_GETFL, 0 );
-        fcntl( AWT_READPIPE, F_SETFL, flags | O_NDELAY | O_NONBLOCK );
-        flags = fcntl ( AWT_WRITEPIPE, F_GETFL, 0 );
-        fcntl( AWT_WRITEPIPE, F_SETFL, flags | O_NDELAY | O_NONBLOCK );
-        awt_pipe_inited = True;
-    }
-    else
-    {
-        AWT_READPIPE = -1;
-        AWT_WRITEPIPE = -1;
-        awt_pipe_inited = False;
-    }
-} /* awt_pipe_init() */
-
-static Window
-proxyTopLevel(Window proxyWindow) {
-    Window parent = None, root = None, *children = NULL, retvalue = None;
-    uint32_t nchildren = 0;
-    Status res = XQueryTree(awt_display, proxyWindow, &root, &parent,
-             &children, &nchildren);
-    if (res != 0) {
-        if (nchildren > 0) {
-            retvalue = children[0];
-        }
-        else retvalue = None;
-        if (children != NULL) {
-            XFree(children);
-        }
-        return retvalue;
-    } else {
-        return None;
-    }
-}
-
-static jclass clazzF, clazzD = NULL;
-
-static Boolean
-initClazzD(JNIEnv *env) {
-    jclass t_clazzD = (*env)->FindClass(env, "java/awt/Dialog");
-    if ((*env)->ExceptionOccurred(env)) {
-        (*env)->ExceptionDescribe(env);
-        (*env)->ExceptionClear(env);
-    }
-    DASSERT(t_clazzD != NULL);
-    if (t_clazzD == NULL) {
-        return False;
-    }
-    clazzD = (*env)->NewGlobalRef(env, t_clazzD);
-    DASSERT(clazzD != NULL);
-    (*env)->DeleteLocalRef(env, t_clazzD);
-    return True;
-}
-
-Boolean
-isFrameOrDialog(jobject target, JNIEnv *env) {
-    if ((*env)->EnsureLocalCapacity(env, 1) < 0) {
-        return False;
-    }
-
-    if (clazzF == NULL) {
-        jclass t_clazzF = (*env)->FindClass(env, "java/awt/Frame");
-        if ((*env)->ExceptionOccurred(env)) {
-            (*env)->ExceptionDescribe(env);
-            (*env)->ExceptionClear(env);
-        }
-        DASSERT(t_clazzF != NULL);
-        if (t_clazzF == NULL) {
-            return False;
-        }
-        clazzF = (*env)->NewGlobalRef(env, t_clazzF);
-        DASSERT(clazzF != NULL);
-        (*env)->DeleteLocalRef(env, t_clazzF);
-    }
-
-    if (clazzD == NULL && !initClazzD(env)) {
-        return False;
-    }
-
-    return (*env)->IsInstanceOf(env, target, clazzF) ||
-        (*env)->IsInstanceOf(env, target, clazzD);
-}
-
-Boolean
-isDialog(jobject target, JNIEnv *env) {
-    if (clazzD == NULL && !initClazzD(env)) {
-        return False;
-    }
-    return (*env)->IsInstanceOf(env, target, clazzD);
-}
-
-// Returns a local ref to a decorated owner of the target,
-// or NULL if the target is Frame or Dialog itself.
-// The local ref returned should be deleted by the caller.
-jobject
-getOwningFrameOrDialog(jobject target, JNIEnv *env) {
-    jobject _target = (*env)->NewLocalRef(env, target);
-    jobject parent = _target;
-    Boolean isSelfFrameOrDialog = True;
-
-    while (!isFrameOrDialog(parent, env)) {
-        isSelfFrameOrDialog = False;
-        parent = (*env)->CallObjectMethod(env, _target, componentIDs.getParent);
-        (*env)->DeleteLocalRef(env, _target);
-        _target = parent;
-    }
-
-    if (isSelfFrameOrDialog) {
-        (*env)->DeleteLocalRef(env, parent);
-        return NULL;
-    }
-    return parent;
-}
-
-Widget
-findWindowsProxy(jobject window, JNIEnv *env) {
-    struct ComponentData *cdata;
-    jobject tlPeer;
-    jobject owner_prev = NULL, owner_new = NULL;
-    /* the owner of a Window is in its parent field */
-    /* we may have a chain of Windows; go up the chain till we find the
-       owning Frame or Dialog */
-    if ((*env)->EnsureLocalCapacity(env, 4) < 0) {
-        return NULL;
-    }
-
-    if (window == NULL) return NULL;
-
-    owner_prev = (*env)->NewLocalRef(env, window);
-    while (!JNU_IsNull(env, owner_prev) && !(isFrameOrDialog(owner_prev, env))) {
-        owner_new = (*env)->CallObjectMethod(env, owner_prev, componentIDs.getParent);
-        (*env)->DeleteLocalRef(env, owner_prev);
-        owner_prev = owner_new;
-    }
-
-    if (owner_prev == NULL) return NULL;
-
-    tlPeer = (*env)->GetObjectField(env, owner_prev, componentIDs.peer);
-    (*env)->DeleteLocalRef(env, owner_prev);
-    if (tlPeer == NULL) return NULL;
-
-    cdata = (struct ComponentData *)
-        JNU_GetLongFieldAsPtr(env, tlPeer, mComponentPeerIDs.pData);
-    (*env)->DeleteLocalRef(env, tlPeer);
-
-    if (cdata == NULL) return NULL;
-    return(findFocusProxy(cdata->widget));
-}
-
-jobject
-findTopLevel(jobject peer, JNIEnv *env) {
-    jobject target_prev = NULL;
-    static jclass clazzW = NULL;
-
-    if ((*env)->EnsureLocalCapacity(env, 3) < 0) {
-        return NULL;
-    }
-
-    if (clazzW == NULL) {
-        jclass t_clazzW = (*env)->FindClass(env, "java/awt/Window");
-        if ((*env)->ExceptionOccurred(env)) {
-            (*env)->ExceptionDescribe(env);
-            (*env)->ExceptionClear(env);
-        }
-        DASSERT(t_clazzW != NULL);
-        if (t_clazzW == NULL) {
-            return NULL;
-        }
-        clazzW = (*env)->NewGlobalRef(env, t_clazzW);
-        DASSERT(clazzW != NULL);
-        (*env)->DeleteLocalRef(env, t_clazzW);
-    }
-    target_prev = (*env)->GetObjectField(env, peer, mComponentPeerIDs.target);
-    if (target_prev == NULL) {
-        return NULL;
-    }
-
-    while ((target_prev != NULL)
-           && !(*env)->IsInstanceOf(env, target_prev, clazzW) )
-    {
-        /* go up the hierarchy until we find a window */
-        jobject target_new = (*env)->CallObjectMethod(env, target_prev, componentIDs.getParent);
-        (*env)->DeleteLocalRef(env, target_prev);
-        target_prev = target_new;
-    }
-    return target_prev;
-}
-
-static Window
-rootWindow(Window w) {
-    Window root = None;
-    Window parent = None;
-    Window *children = NULL;
-    uint32_t nchildren = 0;
-
-    if (w != None) {
-        Status res = XQueryTree(awt_display, w, &root, &parent, &children, &nchildren);
-        if (res == 0) {
-            return None;
-        }
-        if (children != NULL) {
-            XFree(children);
-        }
-  return root;
-    } else {
-        return None;
-    }
-}
-
-Boolean IsRootOf(Window root, Window child) {
-    Window w_root = None, w_parent = None, * children = NULL;
-    uint32_t c_count = 0;
-    if (root == None || child == None) {
-        return False;
-    }
-    do {
-        w_root = None;
-        w_parent = None;
-        children = NULL;
-        c_count = 0;
-        if (XQueryTree(awt_display, child, &w_root, &w_parent,
-                       &children, &c_count)) {
-            if (children != NULL) {
-                XFree(children);
-            }
-            if (w_parent == None) {
-                return False;
-            }
-            if (w_parent == root) {
-                return True;
-            }
-        } else {
-            return False;
-        }
-        child = w_parent;
-    } while (True);
-}
-
-Window findShellByProxy(Window proxy) {
-    Widget proxy_wid = XtWindowToWidget(awt_display, proxy);
-    while (proxy_wid != NULL && !XtIsShell(proxy_wid)) {
-        proxy_wid = XtParent(proxy_wid);
-    }
-    if (proxy_wid == NULL) {
-        return None;
-    }
-    return XtWindow(proxy_wid);
-}
-
-// Window which contains focus owner when focus proxy is enabled
-Window trueFocusWindow = None;
-// Window which works as proxy for input events for real focus owner.
-Window focusProxyWindow = None;
-
-void clearFocusPathOnWindow(Window win) {
-    if (focusProxyWindow != None && IsRootOf(win, trueFocusWindow)) {
-        XEvent ev;
-        memset(&ev, 0, sizeof(ev));
-        ev.type = FocusOut;
-        ev.xany.send_event = True;
-        ev.xany.display = awt_display;
-        ev.xfocus.mode = NotifyNormal;
-        ev.xfocus.detail = NotifyNonlinear;
-        {
-            Window root = rootWindow(trueFocusWindow);
-            JNIEnv *env = (JNIEnv *) JNU_GetEnv(jvm, JNI_VERSION_1_2);
-            ev.xfocus.window = trueFocusWindow;
-            while (ev.xfocus.window != root &&
-                   ev.xfocus.window != None) {
-                Widget w = XtWindowToWidget(awt_display,
-                                            ev.xfocus.window);
-                awt_put_back_event(env, &ev);
-                if (w == NULL) {
-                    break;
-                }
-                if (XtParent(w) != NULL) {
-                    ev.xfocus.window = XtWindow(XtParent(w));
-                } else {
-                    ev.xfocus.window = None;
-                }
-            }
-        }
-        XSetInputFocus(awt_display, findShellByProxy(focusProxyWindow), RevertToPointerRoot, CurrentTime);
-        trueFocusWindow = None;
-        focusProxyWindow = None;
-    }
-}
-void clearFocusPath(Widget shell) {
-    Window w = None;
-    if (shell == NULL) {
-        return;
-    }
-    w = XtWindow(shell);
-    clearFocusPathOnWindow(w);
-}
-
-void globalClearFocusPath(Widget focusOwnerShell ) {
-    if (focusProxyWindow != None) {
-        Window shellWindow = findShellByProxy(trueFocusWindow);
-        if (shellWindow != None) {
-            Widget shell = XtWindowToWidget(awt_display, shellWindow);
-            if (shell != NULL && shell != focusOwnerShell) {
-                clearFocusPath(shell);
-            }
-        }
-    }
-}
-
-static void
-focusEventForProxy(XEvent xev,
-                   JNIEnv *env,
-                   Window *trueFocusWindow,
-                   Window *focusProxyWindow) {
-
-    DASSERT (trueFocusWindow != NULL && focusProxyWindow != NULL);
-  if (xev.type == FocusOut) {
-    if (xev.xfocus.window == *focusProxyWindow) {
-            if (*trueFocusWindow != None) {
-                Window root = rootWindow(*trueFocusWindow);
-      focusOutEvent.xfocus.window = *trueFocusWindow;
-#ifdef DEBUG_FOCUS
-      printf(" nulling out proxy; putting back event"
-             "\n");
-#endif
-
-      while (focusOutEvent.xfocus.window != root &&
-             focusOutEvent.xfocus.window != None) {
-        Widget w = XtWindowToWidget(awt_display,
-                                    focusOutEvent.xfocus.window);
-        awt_put_back_event(env, &focusOutEvent);
-        if (w != NULL && XtParent(w) != NULL) {
-          focusOutEvent.xfocus.window = XtWindow(XtParent(w));
-        } else {
-          focusOutEvent.xfocus.window = None;
-        }
-      }
-      *trueFocusWindow = None;
-      *focusProxyWindow = None;
-      return;
-    } else {
-#ifdef DEBUG_FOCUS
-      printf("\n");
-#endif
-      return;
-    }
-  } else {
-#ifdef DEBUG_FOCUS
-    printf("\n");
-#endif
-    return;
-  }
-    }
-}
-
-static void
-focusEventForFrame(XEvent xev, Window focusProxyWindow) {
-  if (xev.type == FocusIn) {
-    if (focusProxyWindow != None) {
-      /* eat it */
-      return;
-    } else /* FocusIn on Frame or Dialog */ {
-      XtDispatchEvent(&xev);
-    }
-  } else /* FocusOut on Frame or Dialog */{
-    XtDispatchEvent(&xev);
-  }
-}
-
-static void
-focusEventForWindow(XEvent xev, JNIEnv *env, Window *trueFocusWindow,
-                    Window *focusProxyWindow, jobject target) {
-  XEvent pev;
-  if (xev.type == FocusIn && xev.xfocus.mode == NotifyNormal) {
-    /* If it's a FocusIn, allow it to process, then set
-       focus to focus proxy */
-    Widget focusProxy;
-    focusProxy = findWindowsProxy(target, env);
-    if (focusProxy != NULL) {
-      XtDispatchEvent(&xev);
-      *focusProxyWindow = XtWindow(focusProxy);
-
-      XSetInputFocus(awt_display, *focusProxyWindow,
-                     RevertToParent,
-                     CurrentTime);
-
-      XPeekEvent(awt_display, &pev);
-      while (pev.type == FocusIn) {
-        XNextEvent(awt_display, &xev);
-        XPeekEvent(awt_display, &pev);
-      }
-      *trueFocusWindow = xev.xany.window;
-
-    } /* otherwise error */
-  } else /* FocusOut */ {
-    /* If it's a FocusOut on a Window, discard it unless
-       it's an event generated by us. */
-    if (xev.xany.send_event) {
-      XtDispatchEvent(&xev);
-    }
-  }
-}
-
-Boolean
-isAncestor(Window ancestor, Window child) {
-  Window *children;
-  uint32_t nchildren;
-  Boolean retvalue = False;
-
-  while (child != ancestor) {
-    Window parent, root;
-    Status status;
-
-    status = XQueryTree(awt_display, child, &root, &parent,
-                        &children, &nchildren);
-    if (status == 0) return False; /* should be an error of some sort? */
-
-    if (parent == root) {
-      if (child != ancestor) {
-        retvalue = False;
-        break;
-      } else {
-        retvalue = True;
-        break;
-      }
-    }
-    if (parent == ancestor) { retvalue = True; break; }
-    if (nchildren > 0) XFree(children);
-    child = parent;
-  }
-  if (nchildren > 0) XFree(children);
-  return retvalue;
-}
-
-/**
- * Returns focusability of the corresponding Java Window object
- */
-Boolean
-isFocusableWindow(Window w) {
-    Widget wid = NULL;
-    JNIEnv *env = (JNIEnv *) JNU_GetEnv(jvm, JNI_VERSION_1_2);
-
-    wid = XtWindowToWidget(awt_display, w);
-    while (wid != NULL && !XtIsShell(wid)) {
-        wid = XtParent(wid);
-    }
-
-    // If the window doesn't have shell consider it focusable as all windows
-    // are focusable by default
-    if (wid == NULL) return True;
-
-    return isFocusableWindowByShell(env, wid);
-}
-
-void postUngrabEvent(Widget shell) {
-    JNIEnv *env = (JNIEnv *) JNU_GetEnv(jvm, JNI_VERSION_1_2);
-    Widget canvas = findTopLevelByShell(shell);
-    if (canvas != NULL) {
-        jobject peer = findPeer(&canvas);
-        if (peer != NULL) {
-            JNU_CallMethodByName(env, NULL, peer, "postUngrabEvent", "()V", NULL);
-        }
-    }
-}
-
-Boolean eventInsideGrabbed(XEvent * ev) {
-    if (grabbed_widget == NULL) {
-        return False;
-    }
-
-    switch (ev->xany.type) {
-      case LeaveNotify:
-      case ButtonPress:
-      case ButtonRelease:
-      case MotionNotify:
-      case EnterNotify:
-      {
-          JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-          Widget grab = findTopLevelByShell(grabbed_widget);
-          if (grab != NULL) {
-              jobject peer = findPeer(&grab);
-              Widget target = XtWindowToWidget(awt_display, ev->xbutton.window);
-              jobject targetPeer = findPeer(&target);
-              if (peer != NULL) {
-                  return JNU_CallMethodByName(env, NULL, peer, "processUngrabMouseEvent", "(Lsun/awt/motif/MComponentPeer;III)Z",
-                                              targetPeer, ev->xbutton.x_root, ev->xbutton.y_root,
-                                              ev->xany.type, NULL).z;
-              }
-          }
-          return False;
-      }
-      case FocusOut:
-          if (ev->xfocus.window == XtWindow(grabbed_widget) ||
-              isAncestor(XtWindow(grabbed_widget), ev->xfocus.window))
-          {
-              postUngrabEvent(grabbed_widget);
-              return True;
-          }
-      default:
-          return True;
-    }
-}
-
-/**
- * Processes and removes one X/Xt event from the Xt event queue.
- * Handles events pushed back via awt_put_back_event() FIRST,
- * then new events on the X queue
- */
-static void
-processOneEvent(XtInputMask iMask) {
-            XEvent xev;
-            Boolean haveEvent = False;
-            if (putbackQueueCount > 0) {
-                // There is a pushed-back event - handle it first
-                if (awt_get_next_put_back_event(&xev) == 0) {
-                    if (xev.xany.send_event != SPECIAL_KEY_EVENT) {
-#ifdef DEBUG_FOCUS
-                        if (xev.type == FocusOut) {
-                            printf("putback FocusOut on window %d, mode %d, "
-                                   "detail %d, send_event  %d\n",
-                                   xev.xfocus.window, xev.xfocus.mode,
-                                   xev.xfocus.detail, xev.xfocus.send_event);
-                        }
-#endif
-                        eventNumber++;
-                        XtDispatchEvent(&xev);
-                        return;
-                    } else {
-                        haveEvent = True;
-                    }
-                }
-            }
-
-            if (haveEvent || XtAppPeekEvent(awt_appContext, &xev)) {
-             /*
-              * Fix for BugTraq ID 4041235, 4100167:
-              * First check that the event still has a widget, because
-              * the widget may have been destroyed by another thread.
-              */
-              Widget widget=XtWindowToWidget(awt_display, xev.xany.window);
-              eventNumber++;
-#ifdef __linux__
-              statusWindowEventHandler(xev);
-#endif
-              xembed_eventHandler(&xev);
-              xembed_serverEventHandler(&xev);
-              syncWait_eventHandler(&xev);
-
-              if (!haveEvent && awt_dnd_process_event(&xev)) {
-                  return;
-              }
-
-              if ((widget == NULL) || (!XtIsObject(widget)) ||
-                  (widget->core.being_destroyed)) {
-                /*
-                 * if we get here, the event could be one of
-                 * the following:
-                 * - notification that a "container" of
-                 *    any of our embedded frame has been moved
-                 * - event understandable by XFilterEvent
-                 * - for one of our old widget which has gone away
-                 */
-                XNextEvent(awt_display, &xev);
-
-                if (widget == NULL) {
-                    /* an embedded frame container has been moved? */
-                    if (awt_util_processEventForEmbeddedFrame(&xev)) {
-                        return;
-                    }
-
-                    /* manager selections related event? */
-                    if (awt_mgrsel_processEvent(&xev)) {
-                        return;
-                    }
-                }
-
-                /*
-                 * Fix for BugTraq ID 4196573:
-                 * Call XFilterEvent() to give a chance to X Input
-                 * Method to process this event before being
-                 * discarded.
-                 */
-                (void) XFilterEvent(&xev, NULL);
-                return;
-              }
-
-              /* There is an X event on the queue. */
-              switch (xev.type) {
-              case KeyPress:
-              case KeyRelease:
-              case ButtonPress:
-              case ButtonRelease:
-              case MotionNotify:
-              case EnterNotify:
-              case LeaveNotify:
-                /* Fix for BugTraq ID 4048060. Dispatch scrolling events
-                   immediately to the ScrollBar widget to prevent spurious
-                   continuous scrolling. Otherwise, if the application is busy,
-                   the ButtonRelease event is not dispatched in time to prevent
-                   a ScrollBar timeout from expiring, and restarting the
-                   continuous scrolling timer.
-                   */
-                  if ((xev.type == ButtonPress                          ||
-                       xev.type == ButtonRelease                                ||
-                       (xev.type == MotionNotify                                &&
-                        (xev.xmotion.state == Button1Mask                       ||
-                         xev.xmotion.state == Button2Mask                       ||
-                         xev.xmotion.state == Button3Mask)))            &&
-                      (XtIsSubclass(widget, xmScrollBarWidgetClass))) {
-                      /* Use XNextEvent instead of XtAppNextEvent, because
-                         XtAppNextEvent processes timers before getting the next X
-                         event, causing a race condition, since the TimerEvent
-                         callback in the ScrollBar widget restarts the continuous
-                         scrolling timer.
-                      */
-                      XNextEvent(awt_display, &xev);
-
-                      XtDispatchEvent(&xev);
-                      XSync(awt_display, False);
-
-                      // This is the event on scrollbar.  Key, Motion,
-                      // Enter/Leave dispatch as usual, Button should
-                      // generate Ungrab after Java mouse event
-                      if (xev.type == ButtonPress && grabbed_widget != NULL) {
-                          eventInsideGrabbed(&xev);
-                      }
-                  }
-                  else {
-                      if (!haveEvent) XtAppNextEvent(awt_appContext, &xev);
-
-                      // This is an event on one of our widgets.  Key,
-                      // Motion, Enter/Leave dispatch as usual, Button
-                      // should generate Ungrab after Java mouse event
-/*                       if (grabbed_widget != NULL && !eventInsideGrabbed(&xev)) { */
-/*                           return; */
-/*                       } */
-
-                      if (xev.type == ButtonPress) {
-                          Window window = findShellByProxy(xev.xbutton.window);
-                          if (window != None) {
-                              XWindowAttributes winAttr;
-                              memset(&winAttr, 0, sizeof(XWindowAttributes));
-                              XGetWindowAttributes(awt_display, window, &winAttr);
-                              if (winAttr.override_redirect == TRUE && isFocusableWindow(window)) {
-                                  XSetInputFocus(awt_display, window, RevertToPointerRoot, CurrentTime);
-                              }
-                          }
-                      }
-                      if(xev.type == KeyPress) {
-#ifdef DEBUG_FOCUS
-                          printf("KeyPress on window %d\n", xev.xany.window);
-#endif
-                      }
-
-                    /* this could be moved to shouldDispatchToWidget */
-                    /* if there is a proxy in effect, dispatch key events
-                       through the proxy */
-                    if ((xev.type == KeyPress || xev.type == KeyRelease) &&
-                        !keyboardGrabbed && !haveEvent) {
-                        if (focusProxyWindow != None) {
-                            Widget widget;
-                            struct WidgetInfo *winfo;
-                            Boolean cont;
-                            /* Key event should be posted to the top-level
-                               widget of the proxy */
-                            xev.xany.window = proxyTopLevel(focusProxyWindow);
-                            widget = XtWindowToWidget(awt_display,
-                                                      xev.xany.window);
-                            if (widget == NULL) return;
-                            if ((winfo = findWidgetInfo(widget)) == NULL) {
-                                return;
-                            }
-                            awt_canvas_handleEvent(widget, winfo->peer, &xev,
-                                                   winfo, &cont, TRUE);
-                            return;
-                        }
-                    }
-                    if (!shouldDispatchToWidget(&xev)) {
-                        XtDispatchEvent(&xev);
-                    }
-
-                    // See comment above - "after time" is here.
-                    if (grabbed_widget != NULL && xev.type == ButtonPress) {
-                        eventInsideGrabbed(&xev);
-                    }
-                }
-
-
-              break;
-
-              case FocusIn:
-              case FocusOut: {
-                  void *peer;
-                  jobject target;
-
-                  JNIEnv *env = (JNIEnv *) JNU_GetEnv(jvm, JNI_VERSION_1_2);
-
-#ifdef DEBUG_FOCUS
-                  if (xev.type == FocusIn) {
-
-                      fprintf(stderr, "FocusIn on window %x, mode %d, detail %d, "
-                             "send_event %d\n", xev.xfocus.window,
-                             xev.xfocus.mode, xev.xfocus.detail,
-                             xev.xfocus.send_event);
-                  } else {
-                      fprintf(stderr, "FocusOut on window %x, mode %d, detail %d, "
-                             "send_event %d\n", xev.xfocus.window,
-                             xev.xfocus.mode, xev.xfocus.detail,
-                             xev.xfocus.send_event);
-                  }
-#endif
-                  XtAppNextEvent(awt_appContext, &xev);
-
-                  if (xev.xfocus.detail == NotifyVirtual ||
-                      xev.xfocus.detail == NotifyNonlinearVirtual) {
-#ifdef DEBUG_FOCUS
-                      printf("discarding\n");
-#endif
-                      return;
-                  }
-
-                  // Check for xembed on this window. If it is active and this is not XEmbed focus
-                  // event(send_event = 0) then we should skip it
-                  if (isXEmbedActiveByWindow(xev.xfocus.window) && !xev.xfocus.send_event) {
-                      return;
-                  }
-
-                  /* In general, we need to to block out focus events
-                     that are caused by keybaord grabs initiated by
-                     dragging the title bar or the scrollbar. But we
-                     need to let through the ones that are aimed at
-                     choice boxes or menus. So we keep track of when
-                     the keyboard is grabbed by a popup. */
-
-                  if (awt_isAwtMenuWidget(widget)) {
-                    if (xev.type == FocusIn &&
-                        xev.xfocus.mode == NotifyGrab) {
-                          extern Boolean poppingDown;
-                          if (!poppingDown) {
-                      keyboardGrabbed = True;
-                           }
-                      } else /* FocusOut */ {
-                          if (xev.type == FocusOut &&
-                              xev.xfocus.mode == NotifyUngrab) {
-                        keyboardGrabbed = False;
-                      }
-                    }
-                  }
-
-                  if (focusProxyWindow != None) {
-#ifdef DEBUG_FOCUS
-                      printf("non-null proxy; proxy = %d ", focusProxyWindow);
-#endif
-                      if (trueFocusWindow != None) {
-                        /* trueFocusWindow should never be None here, but if
-                           things ever get skewed, we want to be able to
-                           recover rather than crash */
-                        focusEventForProxy(xev, env, &trueFocusWindow,
-                                           &focusProxyWindow);
-                      return;
-                      } else {
-                        /* beartrap -- remove before shipping */
-                        /* printf("trueFocusWindow None in processOneEvent;\n"); */
-                        /* printf("Please file a bug\n"); */
-                      }
-                  }
-
-                  peer = findPeer(&widget);
-                  if (peer == NULL) {
-#ifdef DEBUG_FOCUS
-                      printf("null peer -- shouldn't see in java handler\n");
-#endif
-                      XtDispatchEvent(&xev);
-                      return;
-                  }
-
-                  /* Find the top-level component */
-
-                  if ((*env)->EnsureLocalCapacity(env, 1) < 0) {
-                    return;
-                  }
-                  target = findTopLevel(peer, env);
-                  if (target == NULL) {
-                      JNU_ThrowNullPointerException(env, "component without a "
-                                                    "window");
-                      return;
-                  }
-
-                  if (isFrameOrDialog(target, env)) {
-#ifdef DEBUG_FOCUS
-                      printf("Focus event directed at a frame; frame = %d\n",
-                             xev.xany.window);
-#endif
-                      focusEventForFrame(xev, focusProxyWindow);
-                      (*env)->DeleteLocalRef(env, target);
-                      return;
-                  } else {
-#ifdef DEBUG_FOCUS
-                      printf("Focus event directed at a window; window = %d\n",
-                             xev.xany.window);
-#endif
-                      focusEventForWindow(xev, env, &trueFocusWindow,
-                                          &focusProxyWindow, target);
-                      (*env)->DeleteLocalRef(env, target);
-                      return;
-                  }
-              }
-
-              case UnmapNotify:
-#ifdef DEBUG_FOCUS
-                printf("Unmap on window %d\n", xev.xany.window);
-                printf("True focus window is %d\n", trueFocusWindow);
-#endif
-                clearFocusPathOnWindow(xev.xunmap.window);
-
-              default:
-                XtAppProcessEvent(awt_appContext, iMask);
-                break;
-              }
-            }
-            else {
-              /* There must be a timer, alternate input, or signal event. */
-              XtAppProcessEvent(awt_appContext, iMask & ~XtIMXEvent);
-            }
-
-} /* processOneEvent() */
-
-/*
- * Waits for X/Xt events to appear on the pipe. Returns only when
- * it is likely (but not definite) that there are events waiting to
- * be processed.
- *
- * This routine also flushes the outgoing X queue, when the
- * awt_next_flush_time has been reached.
- *
- * If fdAWTPipe is greater or equal than zero the routine also
- * checks if there are events pending on the putback queue.
- */
-void
-waitForEvents(JNIEnv *env, int32_t fdXPipe, int32_t fdAWTPipe) {
-
-        while ((fdAWTPipe >= 0 && awt_events_pending(awt_appContext) == 0) ||
-               (fdAWTPipe <  0 && XtAppPending(awt_appContext) == 0)) {
-#ifdef USE_SELECT
-            performSelect(env,fdXPipe,fdAWTPipe);
-#else
-            performPoll(env,fdXPipe,fdAWTPipe);
-#endif
-            if ((awt_next_flush_time > 0) &&
-                (awtJNI_TimeMillis() > awt_next_flush_time)) {
-                AWT_FLUSHOUTPUT_NOW();
-            }
-        }  /* end while awt_events_pending() == 0 */
-} /* waitForEvents() */
-
-/*************************************************************************
- **                                                                     **
- ** WE USE EITHER select() OR poll(), DEPENDING ON THE USE_SELECT       **
- ** COMPILE-TIME CONSTANT.                                              **
- **                                                                     **
- *************************************************************************/
-
-#ifdef USE_SELECT
-
-static struct fd_set rdset;
-struct timeval sel_time;
-
-/*
- * Performs select() on both the X pipe and our AWT utility pipe.
- * Returns when data arrives or the operation times out.
- *
- * Not all Xt events come across the X pipe (e.g., timers
- * and alternate inputs), so we must time out every now and
- * then to check the Xt event queue.
- *
- * The fdAWTPipe will be empty when this returns.
- */
-static void
-performSelect(JNIEnv *env, int32_t fdXPipe, int32_t fdAWTPipe) {
-
-            int32_t result;
-            int32_t count;
-            int32_t nfds = 1;
-            uint32_t timeout = awt_get_poll_timeout(False);
-
-            /* Fixed 4250354 7/28/99 ssi@sparc.spb.su
-             * Cleaning up Global Refs in case of No Events
-             */
-            awtJNI_CleanupGlobalRefs();
-
-            FD_ZERO( &rdset );
-            FD_SET(fdXPipe, &rdset);
-            if (fdAWTPipe >= 0) {
-                nfds++;
-                FD_SET(fdAWTPipe, &rdset);
-            }
-            if (timeout == 0) {
-                // be sure other threads get a chance
-                awtJNI_ThreadYield(env);
-            }
-            // set the appropriate time values. The DASSERT() in
-            // MToolkit_run() makes sure that this will not overflow
-            sel_time.tv_sec = (timeout * 1000) / (1000 * 1000);
-            sel_time.tv_usec = (timeout * 1000) % (1000 * 1000);
-            AWT_NOFLUSH_UNLOCK();
-            result = select(nfds, &rdset, 0, 0, &sel_time);
-            AWT_LOCK();
-
-            /* reset tick if this was not a time out */
-            if (result == 0) {
-                /* select() timed out -- update timeout value */
-                awt_get_poll_timeout(True);
-            }
-            if (fdAWTPipe >= 0 && FD_ISSET ( fdAWTPipe, &rdset ) )
-            {
-                /* There is data on the AWT pipe - empty it */
-                do {
-                    count = read(fdAWTPipe, read_buf, AWT_POLL_BUFSIZE );
-                } while (count == AWT_POLL_BUFSIZE );
-            }
-} /* performSelect() */
-
-#else /* !USE_SELECT */
-
-/*
- * Polls both the X pipe and our AWT utility pipe. Returns
- * when there is data on one of the pipes, or the operation times
- * out.
- *
- * Not all Xt events come across the X pipe (e.g., timers
- * and alternate inputs), so we must time out every now and
- * then to check the Xt event queue.
- *
- * The fdAWTPipe will be empty when this returns.
- */
-static void
-performPoll(JNIEnv *env, int32_t fdXPipe, int32_t fdAWTPipe) {
-
-            static struct pollfd pollFds[2];
-            uint32_t timeout = awt_get_poll_timeout(False);
-            int32_t result;
-            int32_t count;
-
-            /* Fixed 4250354 7/28/99 ssi@sparc.spb.su
-             * Cleaning up Global Refs in case of No Events
-             */
-            awtJNI_CleanupGlobalRefs();
-
-            pollFds[0].fd = fdXPipe;
-            pollFds[0].events = POLLRDNORM;
-            pollFds[0].revents = 0;
-
-            pollFds[1].fd = fdAWTPipe;
-            pollFds[1].events = POLLRDNORM;
-            pollFds[1].revents = 0;
-
-            AWT_NOFLUSH_UNLOCK();
-
-            /* print the poll timeout time in brackets */
-            DTRACE_PRINT1("[%dms]",(int32_t)timeout);
-#ifdef DEBUG
-            if (++debugPrintLineCount > 8) {
-                DTRACE_PRINTLN("");
-                debugPrintLineCount = 0;
-            }
-#endif
-            /* ACTUALLY DO THE POLL() */
-            if (timeout == 0) {
-                // be sure other threads get a chance
-                awtJNI_ThreadYield(env);
-            }
-            result = poll( pollFds, 2, (int32_t) timeout );
-
-#ifdef DEBUG
-            DTRACE_PRINT1("[poll()->%d]", result);
-            if (++debugPrintLineCount > 8) {
-                DTRACE_PRINTLN("");
-                debugPrintLineCount = 0;
-            }
-#endif
-            AWT_LOCK();
-            if (result == 0) {
-                /* poll() timed out -- update timeout value */
-                awt_get_poll_timeout(True);
-            }
-            if ( pollFds[1].revents )
-            {
-                /* There is data on the AWT pipe - empty it */
-                do {
-                    count = read(AWT_READPIPE, read_buf, AWT_POLL_BUFSIZE );
-                } while (count == AWT_POLL_BUFSIZE );
-                DTRACE_PRINTLN1("wokeup on AWTPIPE, timeout:%d", timeout);
-            }
-            return;
-
-} /* performPoll() */
-
-#endif /* !USE_SELECT */
-
-/*
- * Pushes an X event back on the queue to be handled
- * later.
- *
- * Ignores the request if event is NULL
- */
-void
-awt_put_back_event(JNIEnv *env, XEvent *event) {
-
-    Boolean addIt = True;
-    if (putbackQueueCount >= putbackQueueCapacity) {
-        /* not enough room - alloc 50% more space */
-        int32_t newCapacity;
-        XEvent *newQueue;
-        newCapacity = putbackQueueCapacity * 3 / 2;
-        if ((newCapacity - putbackQueueCapacity)
-                                        < PUTBACK_QUEUE_MIN_INCREMENT) {
-            /* always increase by at least min increment */
-            newCapacity = putbackQueueCapacity + PUTBACK_QUEUE_MIN_INCREMENT;
-        }
-        newQueue = (XEvent*)realloc(
-                        putbackQueue, newCapacity*(sizeof(XEvent)));
-        if (newQueue == NULL) {
-            JNU_ThrowOutOfMemoryError(env, "OutOfMemoryError");
-            addIt = False;
-        } else {
-            putbackQueue = newQueue;
-            putbackQueueCapacity = newCapacity;
-        }
-    }
-    if (addIt) {
-        char oneChar = 'p';
-        memcpy(&(putbackQueue[putbackQueueCount]), event, sizeof(XEvent));
-        putbackQueueCount++;
-
-        // wake up the event loop, if it's sleeping
-        write (AWT_WRITEPIPE, &oneChar, 1);
-    }
-
-    return;
-} /* awt_put_back_event() */
-
-/*
- * Gets the next event that has been pushed back onto the queue.
- * Returns 0 and fills in xev_out if successful
- */
-static int32_t
-awt_get_next_put_back_event(XEvent *xev_out) {
-
-    Boolean err = False;
-    if (putbackQueueCount < 1) {
-        err = True;
-    } else {
-        memcpy(xev_out, &(putbackQueue[0]), sizeof(XEvent));
-    }
-    if (!err) {
-        /* remove it from the queue */
-        if (putbackQueueCount == 1) {
-
-            // queue is now empty
-            if (putbackQueueCapacity > PUTBACK_QUEUE_MIN_INCREMENT) {
-
-                /* Too much space -- delete it and rebuild later */
-                free(putbackQueue);
-                putbackQueue = NULL;
-                putbackQueueCapacity = 0;
-            }
-        } else {
-            /* more than 1 event in queue - shift all events to the left */
-            /* We don't free the allocated memory until the queue
-               becomes empty, just 'cause it's easier that way. */
-            /* NOTE: use memmove(), because the memory blocks overlap */
-            memmove(&(putbackQueue[0]), &(putbackQueue[1]),
-                (putbackQueueCount-1)*sizeof(XEvent));
-        }
-        --putbackQueueCount;
-    }
-    DASSERT(putbackQueueCount >= 0);
-
-    return (err? -1:0);
-
-} /* awt_get_next_put_back_event() */
-
-/**
- * Determines whether or not there are X or Xt events pending.
- * Looks at the putbackQueue.
- */
-static XtInputMask
-awt_events_pending(XtAppContext appContext) {
-    XtInputMask imask = 0L;
-    imask = XtAppPending(appContext);
-    if (putbackQueueCount > 0) {
-        imask |= XtIMXEvent;
-    }
-    return imask;
-}
-
-
-#ifndef NOMODALFIX
-#define WIDGET_ARRAY_SIZE 5;
-static int32_t arraySize = 0;
-static int32_t arrayIndx = 0;
-static Widget *dShells = NULL;
-
-void
-awt_shellPoppedUp(Widget shell,
-                   XtPointer modal,
-                   XtPointer call_data)
-{
-    if (arrayIndx == arraySize ) {
-        /* if we have not allocate an array, do it first */
-        if (arraySize == 0) {
-            arraySize += WIDGET_ARRAY_SIZE;
-            dShells = (Widget *) malloc(sizeof(Widget) * arraySize);
-        } else {
-            arraySize += WIDGET_ARRAY_SIZE;
-            dShells = (Widget *) realloc((void *)dShells, sizeof(Widget) * arraySize);
-        }
-    }
-
-    dShells[arrayIndx] = shell;
-    arrayIndx++;
-}
-
-void
-awt_shellPoppedDown(Widget shell,
-                   XtPointer modal,
-                   XtPointer call_data)
-{
-    arrayIndx--;
-
-    if (dShells[arrayIndx] == shell) {
-        dShells[arrayIndx] = NULL;
-        return;
-    } else {
-        int32_t i;
-
-        /* find the position of the shell in the array */
-        for (i = arrayIndx; i >= 0; i--) {
-            if (dShells[i] == shell) {
-                break;
-            }
-        }
-
-        /* remove the found element */
-        while (i <= arrayIndx-1) {
-            dShells[i] = dShells[i+1];
-            i++;
-        }
-    }
-}
-
-Boolean
-awt_isWidgetModal(Widget widget)
-{
-    Widget w;
-
-    for (w = widget; !XtIsShell(w); w = XtParent(w)) { }
-
-    while (w != NULL) {
-        if (w == dShells[arrayIndx-1]) {
-            return True;
-        }
-        w = XtParent(w);
-    }
-    return False;
-}
-
-Boolean
-awt_isModal()
-{
-    return (arrayIndx > 0);
-}
-#endif // NOMODALFIX
-
-
-/*
- * Simply waits for terminateFn() to return True. Waits on the
- * awt lock and is notified to check its state by the main event
- * loop whenever the Xt event queue is empty.
- *
- * NOTE: when you use this routine check if it can be called on the event
- * dispatch thread during drag-n-drop operation and update
- * secondary_loop_event() predicate to prevent deadlock.
- */
-void
-awt_MToolkit_modalWait(int32_t (*terminateFn) (void *data), void *data )
-{
-    JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-
-    AWT_LOCK();
-    AWT_FLUSHOUTPUT_NOW();
-    while ((*terminateFn) (data) == 0) {
-        AWT_WAIT(AWT_MAX_POLL_TIMEOUT);
-        if ((*env)->ExceptionCheck(env)) {
-            (*env)->ExceptionClear(env);
-            break;
-        }
-    }
-    AWT_NOTIFY_ALL();
-    AWT_UNLOCK();
-}
-
-static uint32_t
-colorToRGB(XColor * color)
-{
-    int32_t rgb = 0;
-
-    rgb |= ((color->red >> 8) << 16);
-    rgb |= ((color->green >> 8) << 8);
-    rgb |= ((color->blue >> 8) << 0);
-
-    return rgb;
-}
-
-/*
- * fix for bug #4088106 - ugly text boxes and grayed out looking text
- */
-
-XmColorProc oldColorProc;
-
-void
-ColorProc(XColor* bg_color,
-          XColor* fg_color,
-          XColor* sel_color,
-          XColor* ts_color,
-          XColor* bs_color)
-{
-    unsigned long plane_masks[1];
-    unsigned long colors[5];
-
-    AwtGraphicsConfigDataPtr defaultConfig =
-        getDefaultConfig(DefaultScreen(awt_display));
-
-    /* use the default procedure to calculate colors */
-    oldColorProc(bg_color, fg_color, sel_color, ts_color, bs_color);
-
-    /* check if there is enought free color cells */
-    if (XAllocColorCells(awt_display, defaultConfig->awt_cmap, False,
-        plane_masks, 0, colors, 5)) {
-        XFreeColors(awt_display, defaultConfig->awt_cmap, colors, 5, 0);
-        return;
-    }
-
-    /* find the closest matches currently available */
-    fg_color->pixel = defaultConfig->AwtColorMatch(fg_color->red   >> 8,
-                                                   fg_color->green >> 8,
-                                                   fg_color->blue  >> 8,
-                                                   defaultConfig);
-    fg_color->flags = DoRed | DoGreen | DoBlue;
-    XQueryColor(awt_display, defaultConfig->awt_cmap, fg_color);
-    sel_color->pixel = defaultConfig->AwtColorMatch(sel_color->red   >> 8,
-                                                    sel_color->green >> 8,
-                                                    sel_color->blue  >> 8,
-                                                    defaultConfig);
-    sel_color->flags = DoRed | DoGreen | DoBlue;
-    XQueryColor(awt_display, defaultConfig->awt_cmap, sel_color);
-    ts_color->pixel = defaultConfig->AwtColorMatch(ts_color->red   >> 8,
-                                                   ts_color->green >> 8,
-                                                   ts_color->blue  >> 8,
-                                                   defaultConfig);
-    ts_color->flags = DoRed | DoGreen | DoBlue;
-    XQueryColor(awt_display, defaultConfig->awt_cmap, ts_color);
-    bs_color->pixel = defaultConfig->AwtColorMatch(bs_color->red   >> 8,
-                                                   bs_color->green >> 8,
-                                                   bs_color->blue  >> 8,
-                                                   defaultConfig);
-    bs_color->flags = DoRed | DoGreen | DoBlue;
-    XQueryColor(awt_display, defaultConfig->awt_cmap, bs_color);
-}
-
-
-/*
- * Read _XSETTINGS_SETTINGS property from _XSETTINGS selection owner
- * and pass its value to the java world for processing.
- */
-/*static*/ void
-awt_xsettings_update(int scr, Window owner, void *cookie)
-{
-    Display *dpy = awt_display;
-    int status;
-
-    JNIEnv *env;
-    jobject mtoolkit;
-    jmethodID upcall;
-    jbyteArray array;
-
-    struct xsettings_callback_cookie *upcall_cookie = cookie;
-
-    /* Returns of XGetWindowProperty */
-    Atom actual_type;
-    int actual_format;
-    unsigned long nitems;
-    unsigned long bytes_after;
-    unsigned char *xsettings;
-
-    DTRACE_PRINTLN2("XS: update screen %d, owner 0x%08lx",
-                    scr, owner);
-
-#if 1 /* XXX: kludge */
-    /*
-     * As toolkit cannot yet cope with per-screen desktop properties,
-     * only report XSETTINGS changes on the default screen.  This
-     * should be "good enough" for most cases.
-     */
-    if (scr != DefaultScreen(dpy)) {
-        DTRACE_PRINTLN2("XS: XXX: default screen is %d, update is for %d, ignoring", DefaultScreen(dpy), scr);
-        return;
-    }
-#endif /* kludge */
-
-    env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
-    DASSERT(env != NULL);
-
-    DASSERT(upcall_cookie != NULL);
-    mtoolkit = upcall_cookie->mtoolkit;
-    upcall = upcall_cookie->upcallMID;
-
-    DASSERT(!JNU_IsNull(env, mtoolkit));
-    DASSERT(upcall != NULL);
-
-    /*
-     * XXX: move awt_getPropertyFOO from awt_wm.c to awt_util.c and
-     * use the appropriate one.
-     */
-    status = XGetWindowProperty(dpy, owner,
-                 _XA_XSETTINGS_SETTINGS, 0, 0xFFFF, False,
-                 _XA_XSETTINGS_SETTINGS,
-                 &actual_type, &actual_format, &nitems, &bytes_after,
-                 &xsettings);
-
-    if (status != Success) {
-        DTRACE_PRINTLN("XS:   unable to read _XSETTINGS");
-        return;
-    }
-
-    if (xsettings == NULL) {
-        DTRACE_PRINTLN("XS:   reading _XSETTINGS, got NULL");
-        return;
-    }
-
-    if (actual_type != _XA_XSETTINGS_SETTINGS) {
-        XFree(xsettings);       /* NULL data already catched above */
-        DTRACE_PRINTLN("XS:   _XSETTINGS_SETTINGS is not of type _XSETTINGS_SETTINGS");
-        return;
-    }
-
-    DTRACE_PRINTLN1("XS:   read %lu bytes of _XSETTINGS_SETTINGS",
-                    nitems);
-
-    /* ok, propagate xsettings to the toolkit for processing */
-    if ((*env)->EnsureLocalCapacity(env, 1) < 0) {
-        DTRACE_PRINTLN("XS:   EnsureLocalCapacity failed");
-        XFree(xsettings);
-        return;
-    }
-
-    array = (*env)->NewByteArray(env, (jint)nitems);
-    if (JNU_IsNull(env, array)) {
-        DTRACE_PRINTLN("awt_xsettings_update: NewByteArray failed");
-        XFree(xsettings);
-        return;
-    }
-
-    (*env)->SetByteArrayRegion(env, array, 0, (jint)nitems,
-                               (jbyte *)xsettings);
-    XFree(xsettings);
-
-    (*env)->CallVoidMethod(env, mtoolkit, upcall, (jint)scr, array);
-    (*env)->DeleteLocalRef(env, array);
-}
-
-
-/*
- * Event handler for events on XSETTINGS selection owner.
- * We are interested in PropertyNotify only.
- */
-static void
-awt_xsettings_callback(int scr, XEvent *xev, void *cookie)
-{
-    Display *dpy = awt_display; /* xev->xany.display */
-    XPropertyEvent *ev;
-
-    if (xev->type != PropertyNotify) {
-        DTRACE_PRINTLN2("XS: awt_xsettings_callback(%d) event %d ignored",
-                        scr, xev->type);
-        return;
-    }
-
-    ev = &xev->xproperty;
-
-    if (ev->atom == None) {
-        DTRACE_PRINTLN("XS: awt_xsettings_callback(%d) atom == None");
-        return;
-    }
-
-#ifdef DEBUG
-    {
-        char *name;
-
-        DTRACE_PRINT2("XS: awt_xsettings_callback(%d) 0x%08lx ",
-                      scr, ev->window);
-        name = XGetAtomName(dpy, ev->atom);
-        if (name == NULL) {
-            DTRACE_PRINT1("atom #%d", ev->atom);
-        } else {
-            DTRACE_PRINT1("%s", name);
-            XFree(name);
-        }
-        DTRACE_PRINTLN1(" %s", ev->state == PropertyNewValue ?
-                                        "changed" : "deleted");
-    }
-#endif
-
-    if (ev->atom != _XA_XSETTINGS_SETTINGS) {
-        DTRACE_PRINTLN("XS:   property != _XSETTINGS_SETTINGS ...  ignoring");
-        return;
-    }
-
-
-    if (ev->state == PropertyDelete) {
-        /* XXX: notify toolkit to reset to "defaults"? */
-        return;
-    }
-
-    awt_xsettings_update(scr, ev->window, cookie);
-}
-
-
-/*
- * Owner of XSETTINGS selection changed on the given screen.
- */
-static void
-awt_xsettings_owner_callback(int scr, Window owner, long *data_unused,
-                             void *cookie)
-{
-    if (owner == None) {
-        DTRACE_PRINTLN("XS: awt_xsettings_owner_callback: owner = None");
-        /* XXX: reset to defaults??? */
-        return;
-    }
-
-    DTRACE_PRINTLN1("XS: awt_xsettings_owner_callback: owner = 0x%08lx",
-                    owner);
-
-    awt_xsettings_update(scr, owner, cookie);
-}
-
-/*
- * Returns a reference to the class java.awt.Component.
- */
-jclass
-getComponentClass(JNIEnv *env)
-{
-    static jclass componentCls = NULL;
-
-    // get global reference of java/awt/Component class (run only once)
-    if (componentCls == NULL) {
-        jclass componentClsLocal = (*env)->FindClass(env, "java/awt/Component");
-        DASSERT(componentClsLocal != NULL);
-        if (componentClsLocal == NULL) {
-            /* exception already thrown */
-            return NULL;
-        }
-        componentCls = (jclass)(*env)->NewGlobalRef(env, componentClsLocal);
-        (*env)->DeleteLocalRef(env, componentClsLocal);
-    }
-    return componentCls;
-}
-
-
-/*
- * Returns a reference to the class java.awt.MenuComponent.
- */
-jclass
-getMenuComponentClass(JNIEnv *env)
-{
-    static jclass menuComponentCls = NULL;
-
-    // get global reference of java/awt/MenuComponent class (run only once)
-    if (menuComponentCls == NULL) {
-        jclass menuComponentClsLocal = (*env)->FindClass(env, "java/awt/MenuComponent");
-        DASSERT(menuComponentClsLocal != NULL);
-        if (menuComponentClsLocal == NULL) {
-            /* exception already thrown */
-            return NULL;
-        }
-        menuComponentCls = (jclass)(*env)->NewGlobalRef(env, menuComponentClsLocal);
-        (*env)->DeleteLocalRef(env, menuComponentClsLocal);
-    }
-    return menuComponentCls;
-}
-
-/*
- * Class:     sun_awt_motif_MToolkit
- * Method:    init
- * Signature: (Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL
-Java_sun_awt_motif_MToolkit_init(JNIEnv *env, jobject this,
-    jstring mainClassName)
-{
-    char *appName = NULL;
-    char *mainChars = NULL;
-
-    int32_t   argc     = 0;
-    char *argv[10] = { NULL };
-
-    /*
-     * Note: The MToolkit object depends on the static initializer
-     * of X11GraphicsEnvironment to initialize the connection to
-     * the X11 server.
-     */
-    XFontStruct *xfont;
-    XmFontListEntry tmpFontListEntry;
-    char *multiclick_time_query;
-    AwtGraphicsConfigDataPtr defaultConfig =
-        getDefaultConfig(DefaultScreen(awt_display));
-    AwtScreenDataPtr defaultScreen =
-        getScreenData(DefaultScreen(awt_display));
-
-    static String fallback_resources[] =
-    {
-        "*enableThinThickness:                   True",
-        "*XmFileSelectionBox.fileFilterStyle:    XmFILTER_HIDDEN_FILES",
-        "*XmFileSelectionBox.pathMode:           XmPATH_MODE_RELATIVE",
-        "*XmFileSelectionBox.resizePolicy:       XmRESIZE_GROW",
-        "*XmFileSelectionBox*dirTextLabelString:         Enter path or folder name:",
-        "*XmFileSelectionBox*applyLabelString:           Update",
-        "*XmFileSelectionBox*selectionLabelString:       Enter file name:",
-        "*XmFileSelectionBox*dirListLabelString:         Folders",
-        NULL                        /* Must be NULL terminated */
-    };
-
-    focusOutEvent.type = FocusOut;
-    focusOutEvent.xfocus.send_event = True;
-    focusOutEvent.xfocus.display = awt_display;
-    focusOutEvent.xfocus.mode = NotifyNormal;
-    focusOutEvent.xfocus.detail = NotifyNonlinear;
-
-    /* Need to make sure this is deleted someplace! */
-    AWT_LOCK();
-
-    XSetIOErrorHandler(xIOError);
-
-    if (!XSupportsLocale()) {
-        jio_fprintf(stderr,
-                    "current locale is not supported in X11, locale is set to C");
-        setlocale(LC_ALL, "C");
-    }
-    if (!XSetLocaleModifiers("")) {
-        jio_fprintf(stderr, "X locale modifiers are not supported, using default");
-    }
-#ifdef NETSCAPE
-    if (awt_init_xt) {
-        XtToolkitInitialize();
-    }
-#else
-    XtToolkitInitialize();
-#endif
-
-    {
-        jclass  fontConfigClass;
-        jmethodID methID;
-        jstring jFontList;
-        char       *cFontRsrc;
-        char       *cFontRsrc2;
-
-        fontConfigClass = (*env)->FindClass(env, "sun/awt/motif/MFontConfiguration");
-        methID = (*env)->GetStaticMethodID(env, fontConfigClass,
-                                           "getDefaultMotifFontSet",
-                                           "()Ljava/lang/String;");
-        jFontList = (*env)->CallStaticObjectMethod(env, fontConfigClass, methID);
-        if (jFontList == NULL) {
-            motifFontList =
-                "-monotype-arial-regular-r-normal--*-140-*-*-p-*-iso8859-1";
-        } else {
-            motifFontList = JNU_GetStringPlatformChars(env, jFontList, NULL);
-        }
-
-        /* fprintf(stderr, "motifFontList: %s\n", motifFontList); */
-
-        cFontRsrc = malloc(strlen(motifFontList) + 20);
-        strcpy(cFontRsrc, "*fontList: ");
-        strcat(cFontRsrc, motifFontList);
-        cFontRsrc2 = malloc(strlen(motifFontList) + 20);
-        strcpy(cFontRsrc2, "*labelFontList: ");
-        strcat(cFontRsrc2, motifFontList);
-
-        argc = 1;
-        argv[argc++] = "-xrm";
-        argv[argc++] = cFontRsrc;
-        argv[argc++] = "-xrm";
-        argv[argc++] = cFontRsrc2;
-        argv[argc++] = "-font";
-        argv[argc++] = (char *)defaultMotifFont;
-    }
-
-    awt_appContext = XtCreateApplicationContext();
-    XtAppSetErrorHandler(awt_appContext, (XtErrorHandler) xtError);
-    XtAppSetFallbackResources(awt_appContext, fallback_resources);
-
-    appName = NULL;
-    mainChars = NULL;
-    if (!JNU_IsNull(env, mainClassName)) {
-        mainChars = (char *)JNU_GetStringPlatformChars(env, mainClassName, NULL);
-        appName = mainChars;
-    }
-    if (appName == NULL || appName[0] == '\0') {
-        appName = "AWT";
-    }
-
-    XtDisplayInitialize(awt_appContext, awt_display,
-                        appName, /* application name  */
-                        appName, /* application class */
-                        NULL, 0, &argc, argv);
-
-    /* Root shell widget that serves as a parent for all AWT top-levels.    */
-    awt_root_shell = XtVaAppCreateShell(appName, /* application name  */
-                                        appName, /* application class */
-                                        applicationShellWidgetClass,
-                                        awt_display,
-                                        /* va_list */
-                                        XmNmappedWhenManaged, False,
-                                        NULL);
-    XtRealizeWidget(awt_root_shell);
-
-    if (mainChars != NULL) {
-        JNU_ReleaseStringPlatformChars(env, mainClassName, mainChars);
-    }
-
-    awt_mgrsel_init();
-    awt_wm_init();
-    init_xembed();
-
-    /*
-     * Find the correct awt_multiclick_time to use. We normally
-     * would call XtMultiClickTime() and wouldn't have to do
-     * anything special, but because OpenWindows defines its own
-     * version (OpenWindows.MultiClickTimeout), we need to
-     * determine out which resource to use.
-     *
-     * We do this by searching in order for:
-     *
-     *   1) an explicit definition of multiClickTime
-     *      (this is the resource that XtGetMultiClickTime uses)
-     *
-     * if that fails, search for:
-     *
-     *   2) an explicit definition of Openwindows.MultiClickTimeout
-     *
-     * if both searches fail:
-     *
-     *   3) use the fallback provided by XtGetMultiClickTime()
-     *      (which is 200 milliseconds... I looked at the source :-)
-     *
-     */
-    multiclick_time_query = XGetDefault(awt_display, "*", "multiClickTime");
-    if (multiclick_time_query) {
-        awt_multiclick_time = XtGetMultiClickTime(awt_display);
-    } else {
-        multiclick_time_query = XGetDefault(awt_display,
-                                            "OpenWindows", "MultiClickTimeout");
-        if (multiclick_time_query) {
-            /* Note: OpenWindows.MultiClickTimeout is in tenths of
-               a second, so we need to multiply by 100 to convert to
-               milliseconds */
-            awt_multiclick_time = atoi(multiclick_time_query) * 100;
-        } else {
-            awt_multiclick_time = XtGetMultiClickTime(awt_display);
-        }
-    }
-
-    scrollBugWorkAround = TRUE;
-
-    /*
-     * Create the cursor for TextArea scrollbars...
-     */
-    awt_scrollCursor = XCreateFontCursor(awt_display, XC_left_ptr);
-
-    awt_defaultBg = defaultConfig->AwtColorMatch(200, 200, 200, defaultConfig);
-    awt_defaultFg = defaultScreen->blackpixel;
-    setup_modifier_map(awt_display);
-
-    awt_initialize_DataTransferer();
-    awt_initialize_Xm_DnD(awt_display);
-
-    /*
-     * fix for bug #4088106 - ugly text boxes and grayed out looking text
-     */
-    oldColorProc = XmGetColorCalculation();
-    XmSetColorCalculation(ColorProc);
-
-    AWT_UNLOCK();
-}
-
-/*
- * Class:     sun_awt_motif_MToolkit
- * Method:    run
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_sun_awt_motif_MToolkit_run
-  (JNIEnv *env, jobject this)
-{
-    /*
-     * in performSelect(), we multiply the timeout by 1000. Make sure
-     * that the maximum value will not cause an overflow.
-     */
-    DASSERT(AWT_MAX_POLL_TIMEOUT <= (ULONG_MAX/1000));
-
-    awt_MainThread = (*env)->NewGlobalRef(env, awtJNI_GetCurrentThread(env));
-    awt_MToolkit_loop(env); /* never returns */
-}
-
-/*
- * Class:     sun_awt_motif_MToolkit
- * Method:    makeColorModel
- * Signature: ()Ljava/awt/image/ColorModel;
- */
-JNIEXPORT jobject JNICALL Java_sun_awt_motif_MToolkit_makeColorModel
-  (JNIEnv *env, jclass this)
-{
-    AwtGraphicsConfigDataPtr defaultConfig =
-        getDefaultConfig(DefaultScreen(awt_display));
-
-    return awtJNI_GetColorModel(env, defaultConfig);
-}
-
-/*
- * Class:     sun_awt_motif_MToolkit
- * Method:    getScreenResolution
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL Java_sun_awt_motif_MToolkit_getScreenResolution
-  (JNIEnv *env, jobject this)
-{
-    return (jint) ((DisplayWidth(awt_display, DefaultScreen(awt_display))
-                    * 25.4) /
-                   DisplayWidthMM(awt_display, DefaultScreen(awt_display)));
-}
-
-/*
- * Class:     sun_awt_motif_MToolkit
- * Method:    getScreenWidth
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL Java_sun_awt_motif_MToolkit_getScreenWidth
-  (JNIEnv *env, jobject this)
-{
-    return DisplayWidth(awt_display, DefaultScreen(awt_display));
-}
-/*
- * Class:     sun_awt_motif_MToolkit
- * Method:    getScreenHeight
- * Signature: ()I
- */
-JNIEXPORT jint JNICALL Java_sun_awt_motif_MToolkit_getScreenHeight
-  (JNIEnv *env, jobject this)
-{
-    return DisplayHeight(awt_display, DefaultScreen(awt_display));
-}
-
-/*
- * Class:     sun_awt_motif_MToolkit
- * Method:    beep
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_sun_awt_motif_MToolkit_beep
-  (JNIEnv *env, jobject this)
-{
-    AWT_LOCK();
-    XBell(awt_display, 0);
-    AWT_FLUSH_UNLOCK();
-}
-
-/*
- * Class:     sun_awt_motif_MToolkit
- * Method:    shutdown
- * Signature: ()V
- */
-
-JNIEXPORT void JNICALL Java_sun_awt_motif_MToolkit_shutdown
-  (JNIEnv *env, jobject this)
-{
-    X11SD_LibDispose(env);
-}
-
-/*
- * Class:     sun_awt_motif_MToolkit
- * Method:    getLockingKeyStateNative
- * Signature: (I)B