# HG changeset patch # User leonidr # Date 1364387820 -14400 # Node ID 3e009b5be1232971595b755fc5ed5484cf9c63fd # Parent c47c078f91b8b3e8a4539efda4628f72da99d44f 8003559: Update display of applet windows Summary: Implemented applet security warning for OS X port Reviewed-by: art, anthony, serb, skoivu diff -r c47c078f91b8 -r 3e009b5be123 jdk/make/sun/awt/Makefile --- a/jdk/make/sun/awt/Makefile Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/make/sun/awt/Makefile Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1995, 2013, 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 @@ -38,6 +38,10 @@ OTHER_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES +ifneq ($(PLATFORM), windows) +CLASSES_INIT += $(TEMPDIR)/.gen_icons +endif + # # Files # @@ -208,6 +212,79 @@ endif build: fontconfigs +ifneq ($(PLATFORM), windows) + +GEN_DIR=$(GENSRCDIR)/sun/awt/ + +ifdef OPENJDK + ICONS_PATH_PREFIX=$(PLATFORM_SRC) +else + ICONS_PATH_PREFIX=$(CLOSED_SRC)/solaris +endif + +ICONS = \ + $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \ + $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \ + $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \ + $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png + +ICONPATH=$(SHARE_SRC)/classes/sun/awt/resources + +ICONS += \ + $(ICONPATH)/security-icon-bw16.png \ + $(ICONPATH)/security-icon-interim16.png \ + $(ICONPATH)/security-icon-yellow16.png \ + $(ICONPATH)/security-icon-bw24.png \ + $(ICONPATH)/security-icon-interim24.png \ + $(ICONPATH)/security-icon-yellow24.png \ + $(ICONPATH)/security-icon-bw32.png \ + $(ICONPATH)/security-icon-interim32.png \ + $(ICONPATH)/security-icon-yellow32.png \ + $(ICONPATH)/security-icon-bw48.png \ + $(ICONPATH)/security-icon-interim48.png \ + $(ICONPATH)/security-icon-yellow48.png + +TEMPDIR_CLASSES = $(TEMPDIR)/classes + +generated.clean: + $(RM) -r $(GEN_DIR)/*.java + $(RM) -r $(TEMPDIR)/.gen_icons + +$(TEMPDIR_CLASSES)/sun/awt/ToBin.class: ToBin.java + @$(prep-target) + $(BOOT_JAVAC_CMD) -d $(TEMPDIR_CLASSES) $< + +$(TEMPDIR)/.gen_icons: $(TEMPDIR_CLASSES)/sun/awt/ToBin.class $(ICONS) + $(prep-target) + for i in $(ICONS); do \ + filename=`basename $$i`; \ + name=`$(ECHO) $$filename | $(TR) '\-.' '__'`; \ + classname=$(GEN_DIR)/AWTIcon32_$$name.java; \ + $(RM) $$classname; \ + $(ECHO) "package sun.awt;" >> $$classname ; \ + $(ECHO) "public class AWTIcon32_$$name {" >> $$classname; \ + $(ECHO) "public final static int[] $$name = { " >> $$classname; \ + $(CAT) $$i | \ + $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \ + -Djava.awt.headless=true \ + sun.awt.ToBin >> $$classname; \ + $(ECHO) "}; }" >> $$classname; \ + classname=$(GEN_DIR)/AWTIcon64_$$name.java; \ + $(RM) $$classname; \ + $(ECHO) "package sun.awt;" >> $$classname ; \ + $(ECHO) "public class AWTIcon64_$$name {" >> $$classname; \ + $(ECHO) "public final static long[] $$name = { " >> $$classname; \ + $(CAT) $$i | \ + $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \ + -Djava.awt.headless=true \ + sun.awt.ToBin >> $$classname; \ + $(ECHO) "}; }" >> $$classname; \ + done + $(TOUCH) $@ + +clean clobber:: generated.clean +endif + ifeq ($(PLATFORM), windows) # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv WINDOWS @@ -565,5 +642,5 @@ java.lang.Integer \ java.lang.ThreadGroup -.PHONY: dgalibs dgalib.clean fontconfigs fontconfigs.clean +.PHONY: dgalibs dgalib.clean fontconfigs fontconfigs.clean generated.clean diff -r c47c078f91b8 -r 3e009b5be123 jdk/make/sun/awt/ToBin.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/make/sun/awt/ToBin.java Wed Mar 27 16:37:00 2013 +0400 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2005, 2013, 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; + +import java.io.*; +import java.awt.image.*; +import javax.imageio.*; +import java.awt.*; + +public class ToBin { + public static void main(String[] args) throws Exception { + BufferedImage im = ImageIO.read(System.in); + BufferedImage bi = null; + int iconWidth = im.getWidth(null); + int iconHeight = im.getHeight(null); + if (im != null && iconHeight != 0 && iconWidth != 0) { + bi = new BufferedImage(iconWidth, iconHeight, BufferedImage.TYPE_INT_ARGB); + Graphics g = bi.getGraphics(); + try { + g.drawImage(im, 0, 0, iconWidth, iconHeight, null); + } finally { + g.dispose(); + } + } + DataBuffer srcBuf = bi.getData().getDataBuffer(); + int[] buf = ((DataBufferInt)srcBuf).getData(); + System.out.print(iconWidth + ","); + System.out.println(iconHeight + ","); + for (int i = 0; i < buf.length; i++) { + System.out.print("0x" + Integer.toHexString(buf[i]) + ", "); + if (i % 10 == 0) { + System.out.println(); + } + } + } +} diff -r c47c078f91b8 -r 3e009b5be123 jdk/make/sun/lwawt/FILES_export_macosx.gmk --- a/jdk/make/sun/lwawt/FILES_export_macosx.gmk Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/make/sun/lwawt/FILES_export_macosx.gmk Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, 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 @@ -109,6 +109,7 @@ sun/lwawt/LWToolkit.java \ sun/lwawt/LWWindowPeer.java \ sun/lwawt/PlatformWindow.java \ + sun/lwawt/SecurityWarningWindow.java \ sun/lwawt/SelectionClearListener.java \ sun/lwawt/macosx/CPrinterDevice.java \ sun/lwawt/macosx/CPrinterDialog.java \ @@ -143,6 +144,7 @@ sun/lwawt/macosx/CMouseInfoPeer.java \ sun/lwawt/macosx/CPlatformView.java \ sun/lwawt/macosx/CPlatformWindow.java \ + sun/lwawt/macosx/CWarningWindow.java \ sun/lwawt/macosx/CPlatformComponent.java \ sun/lwawt/macosx/CEmbeddedFrame.java \ sun/lwawt/macosx/CPlatformEmbeddedFrame.java \ diff -r c47c078f91b8 -r 3e009b5be123 jdk/make/sun/xawt/Makefile --- a/jdk/make/sun/xawt/Makefile Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/make/sun/xawt/Makefile Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ GEN_DIR=$(GENSRCDIR)/sun/awt/X11 -CLASSES_INIT += $(TEMPDIR)/.gen.wrappers $(TEMPDIR)/.gen_icons touch.wrappers +CLASSES_INIT += $(TEMPDIR)/.gen.wrappers touch.wrappers .PHONY: generated.clean @@ -317,70 +317,7 @@ $(RM) -r $(WRAPPER_GENERATOR_TEMPDIR) $(RM) -r $(WRAPPER_GENERATOR_DIR) $(RM) -r $(GEN_DIR)/*.java - $(RM) -r $(TEMPDIR)/.gen_icons -ifdef OPENJDK - ICONS_PATH_PREFIX=$(PLATFORM_SRC) -else - ICONS_PATH_PREFIX=$(CLOSED_SRC)/solaris -endif - -ICONS = \ - $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \ - $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \ - $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \ - $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png - - -ICONPATH=$(PLATFORM_SRC)/classes/sun/awt/X11 - -ICONS += \ - $(ICONPATH)/security-icon-bw16.png \ - $(ICONPATH)/security-icon-interim16.png \ - $(ICONPATH)/security-icon-yellow16.png \ - $(ICONPATH)/security-icon-bw24.png \ - $(ICONPATH)/security-icon-interim24.png \ - $(ICONPATH)/security-icon-yellow24.png \ - $(ICONPATH)/security-icon-bw32.png \ - $(ICONPATH)/security-icon-interim32.png \ - $(ICONPATH)/security-icon-yellow32.png \ - $(ICONPATH)/security-icon-bw48.png \ - $(ICONPATH)/security-icon-interim48.png \ - $(ICONPATH)/security-icon-yellow48.png - -TEMPDIR_CLASSES = $(TEMPDIR)/classes - -$(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class: ToBin.java - @$(prep-target) - $(BOOT_JAVAC_CMD) -d $(TEMPDIR_CLASSES) $< - -$(TEMPDIR)/.gen_icons: $(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class $(ICONS) - $(prep-target) - for i in $(ICONS); do \ - filename=`basename $$i`; \ - name=`$(ECHO) $$filename | $(TR) '\-.' '__'`; \ - classname=$(GEN_DIR)/XAWTIcon32_$$name.java; \ - $(RM) $$classname; \ - $(ECHO) "package sun.awt.X11;" >> $$classname ; \ - $(ECHO) "public class XAWTIcon32_$$name {" >> $$classname; \ - $(ECHO) "public static int[] $$name = { " >> $$classname; \ - $(CAT) $$i | \ - $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \ - -Djava.awt.headless=true \ - sun.awt.X11.ToBin >> $$classname; \ - $(ECHO) "}; }" >> $$classname; \ - classname=$(GEN_DIR)/XAWTIcon64_$$name.java; \ - $(RM) $$classname; \ - $(ECHO) "package sun.awt.X11;" >> $$classname ; \ - $(ECHO) "public class XAWTIcon64_$$name {" >> $$classname; \ - $(ECHO) "public static long[] $$name = { " >> $$classname; \ - $(CAT) $$i | \ - $(BOOT_JAVA_CMD) -cp $(TEMPDIR_CLASSES) \ - -Djava.awt.headless=true \ - sun.awt.X11.ToBin >> $$classname; \ - $(ECHO) "}; }" >> $$classname; \ - done - $(TOUCH) $@ clean clobber:: generated.clean diff -r c47c078f91b8 -r 3e009b5be123 jdk/make/sun/xawt/ToBin.java --- a/jdk/make/sun/xawt/ToBin.java Tue Feb 19 22:23:34 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* - * Copyright (c) 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.X11; - -import java.io.*; -import java.awt.image.*; -import javax.imageio.*; -import java.awt.*; - -public class ToBin { - public static void main(String[] args) throws Exception { - BufferedImage im = ImageIO.read(System.in); - BufferedImage bi = null; - int iconWidth = im.getWidth(null); - int iconHeight = im.getHeight(null); - if (im != null && iconHeight != 0 && iconWidth != 0) { - bi = new BufferedImage(iconWidth, iconHeight, BufferedImage.TYPE_INT_ARGB); - Graphics g = bi.getGraphics(); - try { - g.drawImage(im, 0, 0, iconWidth, iconHeight, null); - } finally { - g.dispose(); - } - } - DataBuffer srcBuf = bi.getData().getDataBuffer(); - int[] buf = ((DataBufferInt)srcBuf).getData(); - System.out.print(iconWidth + ","); - System.out.println(iconHeight + ","); - for (int i = 0; i < buf.length; i++) { - System.out.print("0x" + Integer.toHexString(buf[i]) + ", "); - if (i % 10 == 0) { - System.out.println(); - } - } - } -} diff -r c47c078f91b8 -r 3e009b5be123 jdk/makefiles/GenerateJavaSources.gmk --- a/jdk/makefiles/GenerateJavaSources.gmk Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/makefiles/GenerateJavaSources.gmk Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, 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 @@ -67,7 +67,7 @@ ifneq ($(OPENJDK_TARGET_OS),windows) include GensrcIcons.gmk -GENSRC += $(GENSRC_X11_ICONS) +GENSRC += $(GENSRC_AWT_ICONS) ifeq ($(OPENJDK_TARGET_OS),macosx) GENSRC += $(GENSRC_OSX_ICONS) diff -r c47c078f91b8 -r 3e009b5be123 jdk/makefiles/GensrcIcons.gmk --- a/jdk/makefiles/GensrcIcons.gmk Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/makefiles/GensrcIcons.gmk Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,10 +23,10 @@ # questions. # -GENSRC_X11_ICONS := -GENSRC_X11_ICONS_SRC := -GENSRC_X11_ICONS_TMP := $(JDK_OUTPUTDIR)/gensrc -GENSRC_X11_ICONS_DST := $(GENSRC_X11_ICONS_TMP)/sun/awt/X11 +GENSRC_AWT_ICONS := +GENSRC_AWT_ICONS_SRC := +GENSRC_AWT_ICONS_TMP := $(JDK_OUTPUTDIR)/gensrc +GENSRC_AWT_ICONS_DST := $(GENSRC_AWT_ICONS_TMP)/sun/awt/ ifdef OPENJDK X11_ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR) @@ -34,76 +34,76 @@ X11_ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/closed/solaris endif -GENSRC_X11_ICONS_SRC += \ +GENSRC_AWT_ICONS_SRC += \ $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon16.png \ $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon24.png \ $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \ $(X11_ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png -X11_ICONPATH := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/awt/X11 +AWT_ICONPATH := $(JDK_TOPDIR)/src/share/classes/sun/awt/resources -GENSRC_X11_ICONS_SRC += \ - $(X11_ICONPATH)/security-icon-bw16.png \ - $(X11_ICONPATH)/security-icon-interim16.png \ - $(X11_ICONPATH)/security-icon-yellow16.png \ - $(X11_ICONPATH)/security-icon-bw24.png \ - $(X11_ICONPATH)/security-icon-interim24.png \ - $(X11_ICONPATH)/security-icon-yellow24.png \ - $(X11_ICONPATH)/security-icon-bw32.png \ - $(X11_ICONPATH)/security-icon-interim32.png \ - $(X11_ICONPATH)/security-icon-yellow32.png \ - $(X11_ICONPATH)/security-icon-bw48.png \ - $(X11_ICONPATH)/security-icon-interim48.png \ - $(X11_ICONPATH)/security-icon-yellow48.png +GENSRC_AWT_ICONS_SRC += \ + $(AWT_ICONPATH)/security-icon-bw16.png \ + $(AWT_ICONPATH)/security-icon-interim16.png \ + $(AWT_ICONPATH)/security-icon-yellow16.png \ + $(AWT_ICONPATH)/security-icon-bw24.png \ + $(AWT_ICONPATH)/security-icon-interim24.png \ + $(AWT_ICONPATH)/security-icon-yellow24.png \ + $(AWT_ICONPATH)/security-icon-bw32.png \ + $(AWT_ICONPATH)/security-icon-interim32.png \ + $(AWT_ICONPATH)/security-icon-yellow32.png \ + $(AWT_ICONPATH)/security-icon-bw48.png \ + $(AWT_ICONPATH)/security-icon-interim48.png \ + $(AWT_ICONPATH)/security-icon-yellow48.png -GENSRC_X11_ICONS_FILES := $(notdir $(GENSRC_X11_ICONS_SRC)) +GENSRC_AWT_ICONS_FILES := $(notdir $(GENSRC_AWT_ICONS_SRC)) -GENSRC_X11_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1))) -GENSRC_X11_ICONS_DST_NAME = XAWTIcon$(2)_$(subst .,_,$(subst -,_,$(1))) +GENSRC_AWT_ICONS_SHORT_NAME = $(subst .,_,$(subst -,_,$(1))) +GENSRC_AWT_ICONS_DST_NAME = AWTIcon$(2)_$(subst .,_,$(subst -,_,$(1))) ### -$(GENSRC_X11_ICONS_TMP)/_the.icons.dir : +$(GENSRC_AWT_ICONS_TMP)/_the.icons.dir : $(ECHO) Generating icon classes - $(MKDIR) -p $(GENSRC_X11_ICONS_DST) + $(MKDIR) -p $(GENSRC_AWT_ICONS_DST) $(TOUCH) $@ ### -define SetupGensrcX11Icon +define SetupGensrcAWTIcon # param 1 is for src-file # param 2 is for src-dir - $1_SHORTNAME := $(call GENSRC_X11_ICONS_SHORT_NAME,$1) - $1_NAME32 := $(call GENSRC_X11_ICONS_DST_NAME,$1,32) - $1_TARGET32 := $(GENSRC_X11_ICONS_DST)/$$($1_NAME32).java - $1_NAME64 := $(call GENSRC_X11_ICONS_DST_NAME,$1,64) - $1_TARGET64 := $(GENSRC_X11_ICONS_DST)/$$($1_NAME64).java + $1_SHORTNAME := $(call GENSRC_AWT_ICONS_SHORT_NAME,$1) + $1_NAME32 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,32) + $1_TARGET32 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME32).java + $1_NAME64 := $(call GENSRC_AWT_ICONS_DST_NAME,$1,64) + $1_TARGET64 := $(GENSRC_AWT_ICONS_DST)/$$($1_NAME64).java -$$($1_TARGET32) : $2/$1 $(GENSRC_X11_ICONS_TMP)/_the.icons.dir +$$($1_TARGET32) : $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir $(RM) $$@ $$@.tmp - $(ECHO) "package sun.awt.X11;" > $$@.tmp + $(ECHO) "package sun.awt;" > $$@.tmp $(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp $(ECHO) "public static int[] $$($1_SHORTNAME) = { " >> $$@.tmp - $(CAT) $$< | $(TOOL_X11_TOBIN) >> $$@.tmp + $(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp $(ECHO) "}; }" >> $$@.tmp $(MV) $$@.tmp $$@ -GENSRC_X11_ICONS += $$($1_TARGET32) +GENSRC_AWT_ICONS += $$($1_TARGET32) -$$($1_TARGET64) : $2/$1 $(GENSRC_X11_ICONS_TMP)/_the.icons.dir +$$($1_TARGET64) : $2/$1 $(GENSRC_AWT_ICONS_TMP)/_the.icons.dir $(RM) $$@ $$@.tmp - $(ECHO) "package sun.awt.X11;" > $$@.tmp + $(ECHO) "package sun.awt;" > $$@.tmp $(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp $(ECHO) "public static long[] $$($1_SHORTNAME) = { " >> $$@.tmp - $(CAT) $$< | $(TOOL_X11_TOBIN) >> $$@.tmp + $(CAT) $$< | $(TOOL_AWT_TOBIN) >> $$@.tmp $(ECHO) "}; }" >> $$@.tmp $(MV) $$@.tmp $$@ -GENSRC_X11_ICONS += $$($1_TARGET64) +GENSRC_AWT_ICONS += $$($1_TARGET64) endef -$(foreach I,$(GENSRC_X11_ICONS_SRC), $(eval $(call SetupGensrcX11Icon,$(notdir $(I)),$(dir $(I))))) +$(foreach I,$(GENSRC_AWT_ICONS_SRC), $(eval $(call SetupGensrcAWTIcon,$(notdir $(I)),$(dir $(I))))) ### diff -r c47c078f91b8 -r 3e009b5be123 jdk/makefiles/Tools.gmk --- a/jdk/makefiles/Tools.gmk Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/makefiles/Tools.gmk Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ $(JDK_TOPDIR)/makefiles/sun)) TOOLS_SRC:=$(JDK_TOPDIR)/make/tools/src \ - $(JDK_TOPDIR)/makefiles/sun/awt/X11 \ + $(JDK_TOPDIR)/makefiles/sun/awt/ \ $(JDK_TOPDIR)/makefiles/sun/osxapp \ $(JDK_TOPDIR)/make/tools/swing-beans @@ -128,8 +128,8 @@ TOOL_WRAPPERGENERATOR=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \ WrapperGenerator -TOOL_X11_TOBIN=$(JAVA) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \ - sun.awt.X11.ToBin +TOOL_AWT_TOBIN=$(JAVA) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \ + sun.awt.ToBin TOOL_OSX_TOBIN=$(JAVA) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \ sun.osxapp.ToBin diff -r c47c078f91b8 -r 3e009b5be123 jdk/makefiles/sun/awt/ToBin.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/makefiles/sun/awt/ToBin.java Wed Mar 27 16:37:00 2013 +0400 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2005, 2013 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; + +import java.io.*; +import java.awt.image.*; +import javax.imageio.*; +import java.awt.*; + +public class ToBin { + public static void main(String[] args) throws Exception { + BufferedImage im = ImageIO.read(System.in); + BufferedImage bi = null; + int iconWidth = im.getWidth(null); + int iconHeight = im.getHeight(null); + if (im != null && iconHeight != 0 && iconWidth != 0) { + bi = new BufferedImage(iconWidth, iconHeight, BufferedImage.TYPE_INT_ARGB); + Graphics g = bi.getGraphics(); + try { + g.drawImage(im, 0, 0, iconWidth, iconHeight, null); + } finally { + g.dispose(); + } + } + DataBuffer srcBuf = bi.getData().getDataBuffer(); + int[] buf = ((DataBufferInt)srcBuf).getData(); + System.out.print(iconWidth + ","); + System.out.println(iconHeight + ","); + for (int i = 0; i < buf.length; i++) { + System.out.print("0x" + Integer.toHexString(buf[i]) + ", "); + if (i % 10 == 0) { + System.out.println(); + } + } + } +} diff -r c47c078f91b8 -r 3e009b5be123 jdk/makefiles/sun/awt/X11/ToBin.java --- a/jdk/makefiles/sun/awt/X11/ToBin.java Tue Feb 19 22:23:34 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* - * Copyright (c) 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.X11; - -import java.io.*; -import java.awt.image.*; -import javax.imageio.*; -import java.awt.*; - -public class ToBin { - public static void main(String[] args) throws Exception { - BufferedImage im = ImageIO.read(System.in); - BufferedImage bi = null; - int iconWidth = im.getWidth(null); - int iconHeight = im.getHeight(null); - if (im != null && iconHeight != 0 && iconWidth != 0) { - bi = new BufferedImage(iconWidth, iconHeight, BufferedImage.TYPE_INT_ARGB); - Graphics g = bi.getGraphics(); - try { - g.drawImage(im, 0, 0, iconWidth, iconHeight, null); - } finally { - g.dispose(); - } - } - DataBuffer srcBuf = bi.getData().getDataBuffer(); - int[] buf = ((DataBufferInt)srcBuf).getData(); - System.out.print(iconWidth + ","); - System.out.println(iconHeight + ","); - for (int i = 0; i < buf.length; i++) { - System.out.print("0x" + Integer.toHexString(buf[i]) + ", "); - if (i % 10 == 0) { - System.out.println(); - } - } - } -} diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/java2d/opengl/CGLLayer.java --- a/jdk/src/macosx/classes/sun/java2d/opengl/CGLLayer.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/macosx/classes/sun/java2d/opengl/CGLLayer.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, 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 @@ -72,8 +72,7 @@ } public int getTransparency() { - return peer.isTranslucent() ? Transparency.TRANSLUCENT : - Transparency.OPAQUE; + return isOpaque() ? Transparency.OPAQUE : Transparency.TRANSLUCENT; } public Object getDestination() { @@ -81,14 +80,14 @@ } public SurfaceData replaceSurfaceData() { - if (peer.getBounds().isEmpty()) { + if (getBounds().isEmpty()) { surfaceData = NullSurfaceData.theInstance; return surfaceData; } // the layer redirects all painting to the buffer's graphics // and blits the buffer to the layer surface (in drawInCGLContext callback) - CGraphicsConfig gc = (CGraphicsConfig)peer.getGraphicsConfiguration(); + CGraphicsConfig gc = (CGraphicsConfig)getGraphicsConfiguration(); surfaceData = gc.createSurfaceData(this); // the layer holds a reference to the buffer, which in diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java --- a/jdk/src/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/macosx/classes/sun/lwawt/LWKeyboardFocusManagerPeer.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, 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 @@ -44,9 +44,26 @@ @Override public void setCurrentFocusedWindow(Window win) { + LWWindowPeer from, to; + synchronized (this) { + if (focusedWindow == win) { + return; + } + + from = (LWWindowPeer)LWToolkit.targetToPeer(focusedWindow); + to = (LWWindowPeer)LWToolkit.targetToPeer(win); + focusedWindow = win; } + + if (from != null) { + from.updateSecurityWarningVisibility(); + } + + if (to != null) { + to.updateSecurityWarningVisibility(); + } } @Override diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/LWToolkit.java --- a/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java Wed Mar 27 16:37:00 2013 +0400 @@ -491,6 +491,8 @@ return clipboard; } + protected abstract SecurityWarningWindow createSecurityWarning(Window ownerWindow, LWWindowPeer ownerPeer); + // ---- DELEGATES ---- // public abstract Clipboard createPlatformClipboard(); diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java --- a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java Wed Mar 27 16:37:00 2013 +0400 @@ -41,8 +41,7 @@ public class LWWindowPeer extends LWContainerPeer - implements WindowPeer, FramePeer, DialogPeer, FullScreenCapable -{ + implements WindowPeer, FramePeer, DialogPeer, FullScreenCapable, PlatformEventNotifier { public static enum PeerType { SIMPLEWINDOW, FRAME, @@ -111,6 +110,8 @@ private final PeerType peerType; + private final SecurityWarningWindow warningWindow; + /** * Current modal blocker or null. * @@ -157,11 +158,26 @@ } platformWindow.initialize(target, this, ownerDelegate); + + // Init warning window(for applets) + SecurityWarningWindow warn = null; + if (((Window)target).getWarningString() != null) { + // accessSystemTray permission allows to display TrayIcon, TrayIcon tooltip + // and TrayIcon balloon windows without a warning window. + if (!AWTAccessor.getWindowAccessor().isTrayIconWindow((Window)target)) { + LWToolkit toolkit = (LWToolkit)Toolkit.getDefaultToolkit(); + warn = toolkit.createSecurityWarning(target, this); + } + } + + warningWindow = warn; } @Override void initializeImpl() { super.initializeImpl(); + + if (getTarget() instanceof Frame) { setTitle(((Frame) getTarget()).getTitle()); setState(((Frame) getTarget()).getExtendedState()); @@ -219,12 +235,20 @@ if (isGrabbing()) { ungrab(); } + if (warningWindow != null) { + warningWindow.dispose(); + } + platformWindow.dispose(); super.disposeImpl(); } @Override protected void setVisibleImpl(final boolean visible) { + if (!visible && warningWindow != null) { + warningWindow.setVisible(false, false); + } + super.setVisibleImpl(visible); // TODO: update graphicsConfig, see 4868278 platformWindow.setVisible(visible); @@ -455,7 +479,15 @@ @Override public void repositionSecurityWarning() { - throw new RuntimeException("not implemented"); + if (warningWindow != null) { + AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); + Window target = getTarget(); + int x = compAccessor.getX(target); + int y = compAccessor.getY(target); + int width = compAccessor.getWidth(target); + int height = compAccessor.getHeight(target); + warningWindow.reposition(x, y, width, height); + } } // ---- FRAME PEER METHODS ---- // @@ -515,6 +547,7 @@ // ---- PEER NOTIFICATIONS ---- // + @Override public void notifyIconify(boolean iconify) { //The toplevel target is Frame and states are applicable to it. //Otherwise, the target is Window and it don't have state property. @@ -539,6 +572,7 @@ } } + @Override public void notifyZoom(boolean isZoomed) { int newWindowState = isZoomed ? Frame.MAXIMIZED_BOTH : Frame.NORMAL; postWindowStateChangedEvent(newWindowState); @@ -548,7 +582,8 @@ * Called by the {@code PlatformWindow} when any part of the window should * be repainted. */ - public final void notifyExpose(final Rectangle r) { + @Override + public void notifyExpose(final Rectangle r) { repaintPeer(r); } @@ -558,7 +593,8 @@ * LWComponentPeer as the only components which could be resized by user are * top-level windows. */ - public final void notifyReshape(int x, int y, int w, int h) { + @Override + public void notifyReshape(int x, int y, int w, int h) { final boolean moved; final boolean resized; final boolean invalid = updateInsets(platformWindow.getInsets()); @@ -593,6 +629,8 @@ handleResize(w, h, true); repaintPeer(); } + + repositionSecurityWarning(); } private void clearBackground(final int w, final int h) { @@ -620,16 +658,19 @@ } } + @Override public void notifyUpdateCursor() { getLWToolkit().getCursorManager().updateCursorLater(this); } + @Override public void notifyActivation(boolean activation, LWWindowPeer opposite) { Window oppositeWindow = (opposite == null)? null : opposite.getTarget(); changeFocusedWindow(activation, oppositeWindow); } // MouseDown in non-client area + @Override public void notifyNCMouseDown() { // Ungrab except for a click on a Dialog with the grabbing owner if (grabbingWindow != null && @@ -646,10 +687,11 @@ * coordinates are relative to non-client window are, i.e. the top-left * point of the client area is (insets.top, insets.left). */ - public void dispatchMouseEvent(int id, long when, int button, - int x, int y, int screenX, int screenY, - int modifiers, int clickCount, boolean popupTrigger, - byte[] bdata) + @Override + public void notifyMouseEvent(int id, long when, int button, + int x, int y, int screenX, int screenY, + int modifiers, int clickCount, boolean popupTrigger, + byte[] bdata) { // TODO: fill "bdata" member of AWTEvent Rectangle r = getBounds(); @@ -662,11 +704,9 @@ if (lastMouseEventPeer.isEnabled()) { Point lp = lastMouseEventPeer.windowToLocal(x, y, this); - postEvent(new MouseEvent(lastMouseEventPeer.getTarget(), - MouseEvent.MOUSE_EXITED, when, - modifiers, lp.x, lp.y, screenX, - screenY, clickCount, popupTrigger, - button)); + Component target = lastMouseEventPeer.getTarget(); + postMouseExitedEvent(target, when, modifiers, lp, + screenX, screenY, clickCount, popupTrigger, button); } // Sometimes we may get MOUSE_EXITED after lastCommonMouseEventPeer is switched @@ -682,11 +722,9 @@ if (targetPeer != null) { if (targetPeer.isEnabled()) { Point lp = targetPeer.windowToLocal(x, y, this); - postEvent(new MouseEvent(targetPeer.getTarget(), - MouseEvent.MOUSE_ENTERED, when, - modifiers, lp.x, lp.y, screenX, - screenY, clickCount, popupTrigger, - button)); + Component target = targetPeer.getTarget(); + postMouseEnteredEvent(target, when, modifiers, lp, + screenX, screenY, clickCount, popupTrigger, button); } lastCommonMouseEventPeer = targetPeer; lastMouseEventPeer = targetPeer; @@ -813,11 +851,9 @@ // Generate Mouse Exit for components if (lastMouseEventPeer != null && lastMouseEventPeer.isEnabled()) { Point oldp = lastMouseEventPeer.windowToLocal(x, y, this); - postEvent(new MouseEvent(lastMouseEventPeer.getTarget(), - MouseEvent.MOUSE_EXITED, - when, modifiers, - oldp.x, oldp.y, screenX, screenY, - clickCount, popupTrigger, button)); + Component target = lastMouseEventPeer.getTarget(); + postMouseExitedEvent(target, when, modifiers, oldp, screenX, screenY, + clickCount, popupTrigger, button); } lastCommonMouseEventPeer = targetPeer; lastMouseEventPeer = targetPeer; @@ -825,18 +861,42 @@ // Generate Mouse Enter for components if (targetPeer != null && targetPeer.isEnabled()) { Point newp = targetPeer.windowToLocal(x, y, this); - postEvent(new MouseEvent(targetPeer.getTarget(), - MouseEvent.MOUSE_ENTERED, - when, modifiers, - newp.x, newp.y, screenX, screenY, - clickCount, popupTrigger, button)); + Component target = targetPeer.getTarget(); + postMouseEnteredEvent(target, when, modifiers, newp, screenX, screenY, clickCount, popupTrigger, button); } } - public void dispatchMouseWheelEvent(long when, int x, int y, int modifiers, - int scrollType, int scrollAmount, - int wheelRotation, double preciseWheelRotation, - byte[] bdata) + private void postMouseEnteredEvent(Component target, long when, int modifiers, + Point loc, int xAbs, int yAbs, + int clickCount, boolean popupTrigger, int button) { + + updateSecurityWarningVisibility(); + + postEvent(new MouseEvent(target, + MouseEvent.MOUSE_ENTERED, + when, modifiers, + loc.x, loc.y, xAbs, yAbs, + clickCount, popupTrigger, button)); + } + + private void postMouseExitedEvent(Component target, long when, int modifiers, + Point loc, int xAbs, int yAbs, + int clickCount, boolean popupTrigger, int button) { + + updateSecurityWarningVisibility(); + + postEvent(new MouseEvent(target, + MouseEvent.MOUSE_EXITED, + when, modifiers, + loc.x, loc.y, xAbs, yAbs, + clickCount, popupTrigger, button)); + } + + @Override + public void notifyMouseWheelEvent(long when, int x, int y, int modifiers, + int scrollType, int scrollAmount, + int wheelRotation, double preciseWheelRotation, + byte[] bdata) { // TODO: could we just use the last mouse event target here? Rectangle r = getBounds(); @@ -862,8 +922,9 @@ /* * Called by the delegate when a key is pressed. */ - public void dispatchKeyEvent(int id, long when, int modifiers, - int keyCode, char keyChar, int keyLocation) + @Override + public void notifyKeyEvent(int id, long when, int modifiers, + int keyCode, char keyChar, int keyLocation) { LWKeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance(); Component focusOwner = kfmPeer.getCurrentFocusOwner(); @@ -877,7 +938,6 @@ postEvent(new KeyEvent(focusOwner, id, when, modifiers, keyCode, keyChar, keyLocation)); } - // ---- UTILITY METHODS ---- // private void postWindowStateChangedEvent(int newWindowState) { @@ -885,11 +945,14 @@ AWTAccessor.getFrameAccessor().setExtendedState( (Frame)getTarget(), newWindowState); } + WindowEvent stateChangedEvent = new WindowEvent(getTarget(), WindowEvent.WINDOW_STATE_CHANGED, windowState, newWindowState); postEvent(stateChangedEvent); windowState = newWindowState; + + updateSecurityWarningVisibility(); } private static int getGraphicsConfigScreen(GraphicsConfiguration gc) { @@ -1187,10 +1250,12 @@ public void enterFullScreenMode() { platformWindow.enterFullScreenMode(); + updateSecurityWarningVisibility(); } public void exitFullScreenMode() { platformWindow.exitFullScreenMode(); + updateSecurityWarningVisibility(); } public long getLayerPtr() { @@ -1225,6 +1290,33 @@ return peerType; } + public void updateSecurityWarningVisibility() { + if (warningWindow == null) { + return; + } + + if (!isVisible()) { + return; // The warning window should already be hidden. + } + + boolean show = false; + + if (!platformWindow.isFullScreenMode()) { + if (isVisible()) { + if (LWKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() == + getTarget()) { + show = true; + } + + if (platformWindow.isUnderMouse() || warningWindow.isUnderMouse()) { + show = true; + } + } + } + + warningWindow.setVisible(show, true); + } + @Override public String toString() { return super.toString() + " [target is " + getTarget() + "]"; diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/PlatformEventNotifier.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/src/macosx/classes/sun/lwawt/PlatformEventNotifier.java Wed Mar 27 16:37:00 2013 +0400 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2013, 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.lwawt; + +import java.awt.Rectangle; + +public interface PlatformEventNotifier { + void notifyIconify(boolean iconify); + + void notifyZoom(boolean isZoomed); + + void notifyExpose(Rectangle r); + + void notifyReshape(int x, int y, int w, int h); + + void notifyUpdateCursor(); + + void notifyActivation(boolean activation, LWWindowPeer opposite); + + // MouseDown in non-client area + void notifyNCMouseDown(); + + /* + * Called by the delegate to dispatch the event to Java. Event + * coordinates are relative to non-client window are, i.e. the top-left + * point of the client area is (insets.top, insets.left). + */ + void notifyMouseEvent(int id, long when, int button, + int x, int y, int screenX, int screenY, + int modifiers, int clickCount, boolean popupTrigger, + byte[] bdata); + + void notifyMouseWheelEvent(long when, int x, int y, int modifiers, + int scrollType, int scrollAmount, + int wheelRotation, double preciseWheelRotation, + byte[] bdata); + /* + * Called by the delegate when a key is pressed. + */ + void notifyKeyEvent(int id, long when, int modifiers, + int keyCode, char keyChar, int keyLocation); +} diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/PlatformWindow.java --- a/jdk/src/macosx/classes/sun/lwawt/PlatformWindow.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/macosx/classes/sun/lwawt/PlatformWindow.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, 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 @@ -146,6 +146,8 @@ public void exitFullScreenMode(); + public boolean isFullScreenMode(); + public void setWindowState(int windowState); public long getLayerPtr(); diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/SecurityWarningWindow.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/src/macosx/classes/sun/lwawt/SecurityWarningWindow.java Wed Mar 27 16:37:00 2013 +0400 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2013, 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.lwawt; + +public interface SecurityWarningWindow extends PlatformWindow { + /** + * @param x,y,w,h coordinates of the untrusted window + */ + public void reposition(int x, int y, int w, int h); + + public void setVisible(boolean visible, boolean doSchedule); +} diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java Wed Mar 27 16:37:00 2013 +0400 @@ -186,6 +186,11 @@ public void exitFullScreenMode() {} @Override + public boolean isFullScreenMode() { + return false; + } + + @Override public void setWindowState(int windowState) {} @Override diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ import sun.awt.SunToolkit; import sun.lwawt.LWWindowPeer; +import sun.lwawt.PlatformEventNotifier; import sun.lwawt.macosx.event.NSEvent; import java.awt.Toolkit; import java.awt.event.MouseEvent; @@ -39,11 +40,12 @@ */ final class CPlatformResponder { - private final LWWindowPeer peer; + private final PlatformEventNotifier eventNotifier; private final boolean isNpapiCallback; - CPlatformResponder(final LWWindowPeer peer, final boolean isNpapiCallback) { - this.peer = peer; + CPlatformResponder(final PlatformEventNotifier eventNotifier, + final boolean isNpapiCallback) { + this.eventNotifier = eventNotifier; this.isNpapiCallback = isNpapiCallback; } @@ -77,9 +79,9 @@ modifierFlags); boolean jpopupTrigger = NSEvent.isPopupTrigger(jmodifiers); - peer.dispatchMouseEvent(jeventType, System.currentTimeMillis(), jbuttonNumber, - x, y, absoluteX, absoluteY, jmodifiers, jclickCount, - jpopupTrigger, null); + eventNotifier.notifyMouseEvent(jeventType, System.currentTimeMillis(), jbuttonNumber, + x, y, absoluteX, absoluteY, jmodifiers, jclickCount, + jpopupTrigger, null); } /** @@ -115,8 +117,8 @@ wheelRotation = signum; } // invert the wheelRotation for the peer - peer.dispatchMouseWheelEvent(when, x, y, modifiers, scrollType, - scrollAmount, -wheelRotation, -delta, null); + eventNotifier.notifyMouseWheelEvent(when, x, y, modifiers, scrollType, + scrollAmount, -wheelRotation, -delta, null); } /** @@ -183,8 +185,8 @@ int jmodifiers = NSEvent.nsToJavaKeyModifiers(modifierFlags); long when = System.currentTimeMillis(); - peer.dispatchKeyEvent(jeventType, when, jmodifiers, - jkeyCode, javaChar, jkeyLocation); + eventNotifier.notifyKeyEvent(jeventType, when, jmodifiers, + jkeyCode, javaChar, jkeyLocation); // Current browser may be sending input events, so don't // post the KEY_TYPED here. @@ -197,9 +199,9 @@ // for clipboard related shortcuts like Meta + [CVX] boolean isMetaDown = (jmodifiers & KeyEvent.META_DOWN_MASK) != 0; if (jeventType == KeyEvent.KEY_PRESSED && postsTyped && !isMetaDown) { - peer.dispatchKeyEvent(KeyEvent.KEY_TYPED, when, jmodifiers, - KeyEvent.VK_UNDEFINED, javaChar, - KeyEvent.KEY_LOCATION_UNKNOWN); + eventNotifier.notifyKeyEvent(KeyEvent.KEY_TYPED, when, jmodifiers, + KeyEvent.VK_UNDEFINED, javaChar, + KeyEvent.KEY_LOCATION_UNKNOWN); } } @@ -209,16 +211,16 @@ char c; while (index < length) { c = text.charAt(index); - peer.dispatchKeyEvent(KeyEvent.KEY_TYPED, - System.currentTimeMillis(), - 0, KeyEvent.VK_UNDEFINED, c, - KeyEvent.KEY_LOCATION_UNKNOWN); + eventNotifier.notifyKeyEvent(KeyEvent.KEY_TYPED, + System.currentTimeMillis(), + 0, KeyEvent.VK_UNDEFINED, c, + KeyEvent.KEY_LOCATION_UNKNOWN); index++; } } } void handleWindowFocusEvent(boolean gained, LWWindowPeer opposite) { - peer.notifyActivation(gained, opposite); + eventNotifier.notifyActivation(gained, opposite); } } diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, 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 @@ -58,14 +58,18 @@ this.responder = responder; if (!LWCToolkit.getSunAwtDisableCALayers()) { - this.windowLayer = new CGLLayer(peer); + this.windowLayer = createCGLayer(); } setPtr(nativeCreateView(0, 0, 0, 0, getWindowLayerPtr())); } + public CGLLayer createCGLayer() { + return new CGLLayer(peer); + } + public long getAWTView() { return ptr; - } + } public boolean isOpaque() { return !peer.isTranslucent(); @@ -96,6 +100,10 @@ CWrapper.NSView.exitFullScreenMode(ptr); } + public void setToolTip(String msg) { + CWrapper.NSView.setToolTip(ptr, msg); + } + // ---------------------------------------------------------------------- // PAINTING METHODS // ---------------------------------------------------------------------- @@ -104,7 +112,7 @@ surfaceData = windowLayer.replaceSurfaceData(); } else { if (surfaceData == null) { - CGraphicsConfig graphicsConfig = (CGraphicsConfig)peer.getGraphicsConfiguration(); + CGraphicsConfig graphicsConfig = (CGraphicsConfig)getGraphicsConfiguration(); surfaceData = graphicsConfig.createSurfaceData(this); } else { validateSurface(); diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, 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 @@ -44,7 +44,7 @@ import com.apple.laf.ClientPropertyApplicator.Property; import com.sun.awt.AWTUtilities; -public final class CPlatformWindow extends CFRetainedResource implements PlatformWindow { +public class CPlatformWindow extends CFRetainedResource implements PlatformWindow { private native long nativeCreateNSWindow(long nsViewPtr, long styleBits, double x, double y, double w, double h); private static native void nativeSetNSWindowStyleBits(long nsWindowPtr, int mask, int data); private static native void nativeSetNSWindowMenuBar(long nsWindowPtr, long menuBarPtr); @@ -200,9 +200,9 @@ private Window target; private LWWindowPeer peer; - private CPlatformView contentView; - private CPlatformWindow owner; - private boolean visible = false; // visibility status from native perspective + protected CPlatformView contentView; + protected CPlatformWindow owner; + protected boolean visible = false; // visibility status from native perspective private boolean undecorated; // initialized in getInitialStyleBits() private Rectangle normalBounds = null; // not-null only for undecorated maximized windows private CPlatformResponder responder; @@ -226,20 +226,13 @@ final int styleBits = getInitialStyleBits(); - // TODO: handle these misc properties - final long parentNSWindowPtr = (owner != null ? owner.getNSWindowPtr() : 0); - String warningString = target.getWarningString(); - - responder = new CPlatformResponder(peer, false); - contentView = new CPlatformView(); + responder = createPlatformResponder(); + contentView = createContentView(); contentView.initialize(peer, responder); final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(), styleBits, 0, 0, 0, 0); setPtr(nativeWindowPtr); - // TODO: implement on top of JObjC bridged class - // NSWindow window = JObjC.getInstance().AppKit().NSWindow().getInstance(nativeWindowPtr, JObjCRuntime.getInstance()); - if (target instanceof javax.swing.RootPaneContainer) { final javax.swing.JRootPane rootpane = ((javax.swing.RootPaneContainer)target).getRootPane(); if (rootpane != null) rootpane.addPropertyChangeListener("ancestor", new PropertyChangeListener() { @@ -253,7 +246,15 @@ validateSurface(); } - private int getInitialStyleBits() { + protected CPlatformResponder createPlatformResponder() { + return new CPlatformResponder(peer, false); + } + + protected CPlatformView createContentView() { + return new CPlatformView(); + } + + protected int getInitialStyleBits() { // defaults style bits int styleBits = DECORATED | HAS_SHADOW | CLOSEABLE | MINIMIZABLE | ZOOMABLE | RESIZABLE; @@ -452,7 +453,7 @@ } private void maximize() { - if (isMaximized()) { + if (peer == null || isMaximized()) { return; } if (!undecorated) { @@ -487,7 +488,7 @@ } } - private boolean isVisible() { + public boolean isVisible() { return this.visible; } @@ -519,7 +520,7 @@ updateFocusabilityForAutoRequestFocus(false); // Actually show or hide the window - LWWindowPeer blocker = peer.getBlocker(); + LWWindowPeer blocker = (peer == null)? null : peer.getBlocker(); if (blocker == null || !visible) { // If it ain't blocked, or is being hidden, go regular way if (visible) { @@ -711,7 +712,8 @@ @Override public void setOpaque(boolean isOpaque) { CWrapper.NSWindow.setOpaque(getNSWindowPtr(), isOpaque); - if (!isOpaque && !peer.isTextured()) { + boolean isTextured = (peer == null)? false : peer.isTextured(); + if (!isOpaque && !isTextured) { long clearColor = CWrapper.NSColor.clearColor(); CWrapper.NSWindow.setBackgroundColor(getNSWindowPtr(), clearColor); } @@ -751,8 +753,13 @@ } @Override + public boolean isFullScreenMode() { + return isFullScreenMode; + } + + @Override public void setWindowState(int windowState) { - if (!peer.isVisible()) { + if (peer == null || !peer.isVisible()) { // setVisible() applies the state return; } @@ -875,7 +882,7 @@ responder.handleWindowFocusEvent(gained, oppositePeer); } - private void deliverMoveResizeEvent(int x, int y, int width, int height, + protected void deliverMoveResizeEvent(int x, int y, int width, int height, boolean byUser) { // when the content view enters the full-screen mode, the native // move/resize notifications contain a bounds smaller than @@ -887,7 +894,11 @@ final Rectangle oldB = nativeBounds; nativeBounds = new Rectangle(x, y, width, height); - peer.notifyReshape(x, y, width, height); + + if (peer != null) { + peer.notifyReshape(x, y, width, height); + } + if ((byUser && !oldB.getSize().equals(nativeBounds.getSize())) || isFullScreenAnimationOn) { flushBuffers(); @@ -895,21 +906,29 @@ } private void deliverWindowClosingEvent() { - if (peer.getBlocker() == null) { - peer.postEvent(new WindowEvent(target, WindowEvent.WINDOW_CLOSING)); + if (peer != null) { + if (peer.getBlocker() == null) { + peer.postEvent(new WindowEvent(target, WindowEvent.WINDOW_CLOSING)); + } } } private void deliverIconify(final boolean iconify) { - peer.notifyIconify(iconify); + if (peer != null) { + peer.notifyIconify(iconify); + } } private void deliverZoom(final boolean isZoomed) { - peer.notifyZoom(isZoomed); + if (peer != null) { + peer.notifyZoom(isZoomed); + } } private void deliverNCMouseDown() { - peer.notifyNCMouseDown(); + if (peer != null) { + peer.notifyNCMouseDown(); + } } /* @@ -917,6 +936,10 @@ * may become natively focusable window. */ private boolean isNativelyFocusableWindow() { + if (peer == null) { + return false; + } + return !peer.isSimpleWindow() && target.getFocusableWindowState(); } @@ -931,7 +954,7 @@ } private boolean checkBlocking() { - LWWindowPeer blocker = peer.getBlocker(); + LWWindowPeer blocker = (peer == null)? null : peer.getBlocker(); if (blocker == null) { return false; } diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/macosx/CTrayIcon.java --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CTrayIcon.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CTrayIcon.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, 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,7 @@ package sun.lwawt.macosx; +import sun.awt.AWTAccessor; import sun.awt.SunToolkit; import sun.lwawt.macosx.event.NSEvent; @@ -339,6 +340,9 @@ dialog.addWindowListener(handler); + // suppress security warning for untrusted windows + AWTAccessor.getWindowAccessor().setTrayIconWindow(dialog, true); + dialog.pack(); return dialog; diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/macosx/CViewPlatformEmbeddedFrame.java --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CViewPlatformEmbeddedFrame.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CViewPlatformEmbeddedFrame.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, 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 @@ -201,6 +201,11 @@ } @Override + public boolean isFullScreenMode() { + return false; + } + + @Override public void setWindowState(int windowState) { } diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/macosx/CWarningWindow.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CWarningWindow.java Wed Mar 27 16:37:00 2013 +0400 @@ -0,0 +1,444 @@ +/* + * Copyright (c) 2013, 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.lwawt.macosx; + +import sun.awt.AWTAccessor; +import sun.awt.IconInfo; +import sun.awt.SunToolkit; +import sun.java2d.SunGraphics2D; +import sun.java2d.SurfaceData; +import sun.java2d.opengl.CGLLayer; +import sun.lwawt.LWWindowPeer; +import sun.lwawt.PlatformEventNotifier; +import sun.lwawt.SecurityWarningWindow; + +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.geom.Point2D; +import java.lang.ref.WeakReference; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + +public final class CWarningWindow extends CPlatformWindow + implements SecurityWarningWindow, PlatformEventNotifier { + + private static class Lock {}; + private final Lock lock = new Lock(); + + private final static int SHOWING_DELAY = 300; + private final static int HIDING_DELAY = 2000; + + private Rectangle bounds = new Rectangle(); + private final WeakReference ownerPeer; + private final Window ownerWindow; + + /** + * Animation stage. + */ + private volatile int currentIcon = 0; + + /* -1 - uninitialized. + * 0 - 16x16 + * 1 - 24x24 + * 2 - 32x32 + * 3 - 48x48 + */ + private int currentSize = -1; + private static IconInfo[][] icons; + private static IconInfo getSecurityIconInfo(int size, int num) { + synchronized (CWarningWindow.class) { + if (icons == null) { + icons = new IconInfo[4][3]; + icons[0][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw16_png.security_icon_bw16_png); + icons[0][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim16_png.security_icon_interim16_png); + icons[0][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow16_png.security_icon_yellow16_png); + icons[1][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw24_png.security_icon_bw24_png); + icons[1][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim24_png.security_icon_interim24_png); + icons[1][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow24_png.security_icon_yellow24_png); + icons[2][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw32_png.security_icon_bw32_png); + icons[2][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim32_png.security_icon_interim32_png); + icons[2][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow32_png.security_icon_yellow32_png); + icons[3][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw48_png.security_icon_bw48_png); + icons[3][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim48_png.security_icon_interim48_png); + icons[3][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow48_png.security_icon_yellow48_png); + } + } + final int sizeIndex = size % icons.length; + return icons[sizeIndex][num % icons[sizeIndex].length]; + } + + public CWarningWindow(final Window _ownerWindow, final LWWindowPeer _ownerPeer) { + super(); + + this.ownerPeer = new WeakReference(_ownerPeer); + this.ownerWindow = _ownerWindow; + + initialize(null, null, _ownerPeer.getPlatformWindow()); + + setOpaque(false); + + String warningString = ownerWindow.getWarningString(); + if (warningString != null) { + contentView.setToolTip(ownerWindow.getWarningString()); + } + + updateIconSize(); + } + + /** + * @param x,y,w,h coordinates of the untrusted window + */ + public void reposition(int x, int y, int w, int h) { + final Point2D point = AWTAccessor.getWindowAccessor(). + calculateSecurityWarningPosition(ownerWindow, x, y, w, h); + setBounds((int)point.getX(), (int)point.getY(), getWidth(), getHeight()); + } + + public void setVisible(boolean visible, boolean doSchedule) { + synchronized (scheduler) { + if (showingTaskHandle != null) { + showingTaskHandle.cancel(false); + showingTaskHandle = null; + } + + if (hidingTaskHandle != null) { + hidingTaskHandle.cancel(false); + hidingTaskHandle = null; + } + + if (visible) { + if (isVisible()) { + currentIcon = 0; + } else { + currentIcon = 2; + } + + showingTaskHandle = scheduler.schedule(showingTask, 50, + TimeUnit.MILLISECONDS); + + } else { + if (!isVisible()) { + return; + } + + if (doSchedule) { + hidingTaskHandle = scheduler.schedule(hidingTask, HIDING_DELAY, + TimeUnit.MILLISECONDS); + } else { + hidingTaskHandle = scheduler.schedule(hidingTask, 50, + TimeUnit.MILLISECONDS); + } + } + } + } + + @Override + public void notifyIconify(boolean iconify) { + } + + @Override + public void notifyZoom(boolean isZoomed) { + } + + @Override + public void notifyExpose(final Rectangle r) { + repaint(); + } + + @Override + public void notifyReshape(int x, int y, int w, int h) { + } + + @Override + public void notifyUpdateCursor() { + } + + @Override + public void notifyActivation(boolean activation, LWWindowPeer opposite) { + } + + @Override + public void notifyNCMouseDown() { + } + + @Override + public void notifyMouseEvent(int id, long when, int button, int x, int y, + int screenX, int screenY, int modifiers, + int clickCount, boolean popupTrigger, + byte[] bdata) { + LWWindowPeer peer = ownerPeer.get(); + if (id == MouseEvent.MOUSE_EXITED) { + if (peer != null) { + peer.updateSecurityWarningVisibility(); + } + } else if(id == MouseEvent.MOUSE_ENTERED) { + if (peer != null) { + peer.updateSecurityWarningVisibility(); + } + } + } + + public Rectangle getBounds() { + synchronized (lock) { + return bounds.getBounds(); + } + } + + @Override + public boolean isVisible() { + synchronized (lock) { + return visible; + } + } + + @Override + public void setVisible(boolean visible) { + synchronized (lock) { + final long nsWindowPtr = getNSWindowPtr(); + + // Process parent-child relationship when hiding + if (!visible) { + // Unparent myself + if (owner != null && owner.isVisible()) { + CWrapper.NSWindow.removeChildWindow( + owner.getNSWindowPtr(), nsWindowPtr); + } + } + + // Actually show or hide the window + if (visible) { + CWrapper.NSWindow.orderFront(nsWindowPtr); + } else { + CWrapper.NSWindow.orderOut(nsWindowPtr); + } + + this.visible = visible; + + // Manage parent-child relationship when showing + if (visible) { + // Add myself as a child + if (owner != null && owner.isVisible()) { + CWrapper.NSWindow.addChildWindow(owner.getNSWindowPtr(), + nsWindowPtr, CWrapper.NSWindow.NSWindowAbove); + + // do not allow security warning to be obscured by other windows + if (ownerWindow.isAlwaysOnTop()) { + CWrapper.NSWindow.setLevel(nsWindowPtr, + CWrapper.NSWindow.NSFloatingWindowLevel); + } + } + } + } + } + + @Override + public void notifyMouseWheelEvent(long when, int x, int y, int modifiers, + int scrollType, int scrollAmount, + int wheelRotation, double preciseWheelRotation, + byte[] bdata) { + } + + @Override + public void notifyKeyEvent(int id, long when, int modifiers, int keyCode, + char keyChar, int keyLocation) { + } + + protected int getInitialStyleBits() { + int styleBits = 0; + CPlatformWindow.SET(styleBits, CPlatformWindow.UTILITY, true); + return styleBits; + } + + protected void deliverMoveResizeEvent(int x, int y, int width, int height, + boolean byUser) { + + boolean isResize; + synchronized (lock) { + isResize = (bounds.width != width || bounds.height != height); + bounds = new Rectangle(x, y, width, height); + } + + if (isResize) { + replaceSurface(); + } + + super.deliverMoveResizeEvent(x, y, width, height, byUser); + } + + protected CPlatformResponder createPlatformResponder() { + return new CPlatformResponder(this, false); + } + + protected CPlatformView createContentView() { + return new CPlatformView() { + public GraphicsConfiguration getGraphicsConfiguration() { + LWWindowPeer peer = ownerPeer.get(); + return peer.getGraphicsConfiguration(); + } + + public Rectangle getBounds() { + return CWarningWindow.this.getBounds(); + } + + public CGLLayer createCGLayer() { + return new CGLLayer(null) { + public Rectangle getBounds() { + return CWarningWindow.this.getBounds(); + } + + public GraphicsConfiguration getGraphicsConfiguration() { + LWWindowPeer peer = ownerPeer.get(); + return peer.getGraphicsConfiguration(); + } + + public boolean isOpaque() { + return false; + } + }; + } + }; + } + + private void updateIconSize() { + int newSize = -1; + + if (ownerWindow != null) { + Insets insets = ownerWindow.getInsets(); + int max = Math.max(insets.top, Math.max(insets.bottom, + Math.max(insets.left, insets.right))); + if (max < 24) { + newSize = 0; + } else if (max < 32) { + newSize = 1; + } else if (max < 48) { + newSize = 2; + } else { + newSize = 3; + } + } + // Make sure we have a valid size + if (newSize == -1) { + newSize = 0; + } + + synchronized (lock) { + if (newSize != currentSize) { + currentSize = newSize; + IconInfo ico = getSecurityIconInfo(currentSize, 0); + AWTAccessor.getWindowAccessor().setSecurityWarningSize( + ownerWindow, ico.getWidth(), ico.getHeight()); + } + } + } + + private final Graphics getGraphics() { + SurfaceData sd = contentView.getSurfaceData(); + if (ownerWindow == null || sd == null) { + return null; + } + + return transformGraphics(new SunGraphics2D(sd, SystemColor.windowText, + SystemColor.window, ownerWindow.getFont())); + } + + + private void repaint() { + final Graphics g = getGraphics(); + if (g != null) { + try { + ((Graphics2D) g).setComposite(AlphaComposite.Src); + g.drawImage(getSecurityIconInfo().getImage(), 0, 0, null); + } finally { + g.dispose(); + } + } + } + + private void replaceSurface() { + SurfaceData oldData = contentView.getSurfaceData(); + + replaceSurfaceData(); + + if (oldData != null && oldData != contentView.getSurfaceData()) { + oldData.flush(); + } + } + + private int getWidth() { + return getSecurityIconInfo().getWidth(); + } + + private int getHeight() { + return getSecurityIconInfo().getHeight(); + } + + private IconInfo getSecurityIconInfo() { + return getSecurityIconInfo(currentSize, currentIcon); + } + + private final Runnable hidingTask = new Runnable() { + public void run() { + synchronized (lock) { + setVisible(false); + } + + synchronized (scheduler) { + hidingTaskHandle = null; + } + } + }; + + private final Runnable showingTask = new Runnable() { + public void run() { + synchronized (lock) { + if (!isVisible()) { + setVisible(true); + } + + repaint(); + } + + synchronized (scheduler) { + if (currentIcon > 0) { + currentIcon--; + showingTaskHandle = scheduler.schedule(showingTask, SHOWING_DELAY, + TimeUnit.MILLISECONDS); + } else { + showingTaskHandle = null; + } + } + } + }; + + private final ScheduledExecutorService scheduler = + Executors.newSingleThreadScheduledExecutor(); + + private ScheduledFuture hidingTaskHandle; + private ScheduledFuture showingTaskHandle; +} + diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, 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,6 +87,8 @@ public static native void exitFullScreenMode(long view); public static native void setHidden(long view, boolean hidden); + + public static native void setToolTip(long view, String msg); } public static final class NSObject { diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java --- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java Wed Mar 27 16:37:00 2013 +0400 @@ -167,6 +167,11 @@ } @Override + protected SecurityWarningWindow createSecurityWarning(Window ownerWindow, LWWindowPeer ownerPeer) { + return new CWarningWindow(ownerWindow, ownerPeer); + } + + @Override protected PlatformComponent createPlatformComponent() { return new CPlatformComponent(); } diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/macosx/native/sun/awt/CWrapper.m --- a/jdk/src/macosx/native/sun/awt/CWrapper.m Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/macosx/native/sun/awt/CWrapper.m Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, 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 @@ -669,6 +669,27 @@ JNF_COCOA_EXIT(env); } +/* + * Class: sun_lwawt_macosx_CWrapper$NSView + * Method: setToolTip + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_sun_lwawt_macosx_CWrapper_00024NSView_setToolTip +(JNIEnv *env, jclass cls, jlong viewPtr, jstring msg) +{ + +JNF_COCOA_ENTER(env); + + NSView *view = (NSView *)jlong_to_ptr(viewPtr); + NSString* s = JNFJavaToNSString(env, msg); + [ThreadUtilities performOnMainThreadWaiting:NO block:^(){ + [view setToolTip: s]; + }]; + +JNF_COCOA_EXIT(env); +} + /* * Class: sun_lwawt_macosx_CWrapper$NSScreen @@ -735,7 +756,7 @@ { __block jlong screenPtr = 0L; -JNF_COCOA_ENTER(env); +JNF_COCOA_ENTER(env); [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ NSArray *screens = [NSScreen screens]; diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/share/classes/sun/awt/IconInfo.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/src/share/classes/sun/awt/IconInfo.java Wed Mar 27 16:37:00 2013 +0400 @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2006, 2013, 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; +import java.awt.*; +import java.awt.color.*; +import java.awt.image.*; +import sun.awt.image.ToolkitImage; +import sun.awt.image.ImageRepresentation; +import java.util.Arrays; + +public class IconInfo { + /** + * Representation of image as an int array. + * It's used on platforms where icon data + * is expected to be in 32-bit format. + */ + private int[] intIconData; + /** + * Representation of image as an long array. + * It's used on platforms where icon data + * is expected to be in 64-bit format. + */ + private long[] longIconData; + /** + * Icon image. + */ + private Image image; + /** + * Width of icon image. Being set in constructor. + */ + private final int width; + /** + * Height of icon image. Being set in constructor. + */ + private final int height; + /** + * Width of scaled icon image. Can be set in setScaledDimension. + */ + private int scaledWidth; + /** + * Height of scaled icon image. Can be set in setScaledDimension. + */ + private int scaledHeight; + /** + * Length of raw data. Being set in constructor / setScaledDimension. + */ + private int rawLength; + + public IconInfo(int[] intIconData) { + this.intIconData = + (null == intIconData) ? null : Arrays.copyOf(intIconData, intIconData.length); + this.width = intIconData[0]; + this.height = intIconData[1]; + this.scaledWidth = width; + this.scaledHeight = height; + this.rawLength = width * height + 2; + } + + public IconInfo(long[] longIconData) { + this.longIconData = + (null == longIconData) ? null : Arrays.copyOf(longIconData, longIconData.length); + this.width = (int)longIconData[0]; + this.height = (int)longIconData[1]; + this.scaledWidth = width; + this.scaledHeight = height; + this.rawLength = width * height + 2; + } + + public IconInfo(Image image) { + this.image = image; + if (image instanceof ToolkitImage) { + ImageRepresentation ir = ((ToolkitImage)image).getImageRep(); + ir.reconstruct(ImageObserver.ALLBITS); + this.width = ir.getWidth(); + this.height = ir.getHeight(); + } else { + this.width = image.getWidth(null); + this.height = image.getHeight(null); + } + this.scaledWidth = width; + this.scaledHeight = height; + this.rawLength = width * height + 2; + } + + /* + * It sets size of scaled icon. + */ + public void setScaledSize(int width, int height) { + this.scaledWidth = width; + this.scaledHeight = height; + this.rawLength = width * height + 2; + } + + public boolean isValid() { + return (width > 0 && height > 0); + } + + public int getWidth() { + return width; + } + + public int getHeight() { + return height; + } + + public String toString() { + return "IconInfo[w=" + width + ",h=" + height + ",sw=" + scaledWidth + ",sh=" + scaledHeight + "]"; + } + + public int getRawLength() { + return rawLength; + } + + public int[] getIntData() { + if (this.intIconData == null) { + if (this.longIconData != null) { + this.intIconData = longArrayToIntArray(longIconData); + } else if (this.image != null) { + this.intIconData = imageToIntArray(this.image, scaledWidth, scaledHeight); + } + } + return this.intIconData; + } + + public long[] getLongData() { + if (this.longIconData == null) { + if (this.intIconData != null) { + this.longIconData = intArrayToLongArray(this.intIconData); + } else if (this.image != null) { + int[] intIconData = imageToIntArray(this.image, scaledWidth, scaledHeight); + this.longIconData = intArrayToLongArray(intIconData); + } + } + return this.longIconData; + } + + public Image getImage() { + if (this.image == null) { + if (this.intIconData != null) { + this.image = intArrayToImage(this.intIconData); + } else if (this.longIconData != null) { + int[] intIconData = longArrayToIntArray(this.longIconData); + this.image = intArrayToImage(intIconData); + } + } + return this.image; + } + + private static int[] longArrayToIntArray(long[] longData) { + int[] intData = new int[longData.length]; + for (int i = 0; i < longData.length; i++) { + // Such a conversion is valid since the + // original data (see + // make/sun/xawt/ToBin.java) were ints + intData[i] = (int)longData[i]; + } + return intData; + } + + private static long[] intArrayToLongArray(int[] intData) { + long[] longData = new long[intData.length]; + for (int i = 0; i < intData.length; i++) { + longData[i] = (int)intData[i]; + } + return longData; + } + + static Image intArrayToImage(int[] raw) { + ColorModel cm = + new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), 32, + 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000, + false, DataBuffer.TYPE_INT); + DataBuffer buffer = new DataBufferInt(raw, raw.length-2, 2); + WritableRaster raster = + Raster.createPackedRaster(buffer, raw[0], raw[1], + raw[0], + new int[] {0x00ff0000, 0x0000ff00, + 0x000000ff, 0xff000000}, + null); + BufferedImage im = new BufferedImage(cm, raster, false, null); + return im; + } + + /* + * Returns array of integers which holds data for the image. + * It scales the image if necessary. + */ + static int[] imageToIntArray(Image image, int width, int height) { + if (width <= 0 || height <= 0) { + return null; + } + ColorModel cm = + new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), 32, + 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000, + false, DataBuffer.TYPE_INT); + DataBufferInt buffer = new DataBufferInt(width * height); + WritableRaster raster = + Raster.createPackedRaster(buffer, width, height, + width, + new int[] {0x00ff0000, 0x0000ff00, + 0x000000ff, 0xff000000}, + null); + BufferedImage im = new BufferedImage(cm, raster, false, null); + Graphics g = im.getGraphics(); + g.drawImage(image, 0, 0, width, height, null); + g.dispose(); + int[] data = buffer.getData(); + int[] raw = new int[width * height + 2]; + raw[0] = width; + raw[1] = height; + System.arraycopy(data, 0, raw, 2, width * height); + return raw; + } + +} diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/share/classes/sun/awt/resources/security-icon-bw16.png Binary file jdk/src/share/classes/sun/awt/resources/security-icon-bw16.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/share/classes/sun/awt/resources/security-icon-bw24.png Binary file jdk/src/share/classes/sun/awt/resources/security-icon-bw24.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/share/classes/sun/awt/resources/security-icon-bw32.png Binary file jdk/src/share/classes/sun/awt/resources/security-icon-bw32.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/share/classes/sun/awt/resources/security-icon-bw48.png Binary file jdk/src/share/classes/sun/awt/resources/security-icon-bw48.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/share/classes/sun/awt/resources/security-icon-interim16.png Binary file jdk/src/share/classes/sun/awt/resources/security-icon-interim16.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/share/classes/sun/awt/resources/security-icon-interim24.png Binary file jdk/src/share/classes/sun/awt/resources/security-icon-interim24.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/share/classes/sun/awt/resources/security-icon-interim32.png Binary file jdk/src/share/classes/sun/awt/resources/security-icon-interim32.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/share/classes/sun/awt/resources/security-icon-interim48.png Binary file jdk/src/share/classes/sun/awt/resources/security-icon-interim48.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/share/classes/sun/awt/resources/security-icon-yellow16.png Binary file jdk/src/share/classes/sun/awt/resources/security-icon-yellow16.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/share/classes/sun/awt/resources/security-icon-yellow24.png Binary file jdk/src/share/classes/sun/awt/resources/security-icon-yellow24.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/share/classes/sun/awt/resources/security-icon-yellow32.png Binary file jdk/src/share/classes/sun/awt/resources/security-icon-yellow32.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/share/classes/sun/awt/resources/security-icon-yellow48.png Binary file jdk/src/share/classes/sun/awt/resources/security-icon-yellow48.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java --- a/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ import java.awt.event.InvocationEvent; import java.awt.event.WindowEvent; +import sun.awt.IconInfo; import sun.util.logging.PlatformLogger; import sun.awt.AWTAccessor; @@ -106,7 +107,7 @@ focusProxy = createFocusProxy(); } - void setIconHints(java.util.List icons) { + void setIconHints(java.util.List icons) { if (!XWM.getWM().setNetWMIcon(this, icons)) { if (icons.size() > 0) { if (iconWindow == null) { diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/XIconInfo.java --- a/jdk/src/solaris/classes/sun/awt/X11/XIconInfo.java Tue Feb 19 22:23:34 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,237 +0,0 @@ -/* - * Copyright (c) 2006, 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. - */ -package sun.awt.X11; -import java.awt.*; -import java.awt.color.*; -import java.awt.image.*; -import sun.awt.image.ToolkitImage; -import sun.awt.image.ImageRepresentation; -import java.util.Arrays; - -class XIconInfo { - /** - * Representation of image as an int array - * It's being used for _NET_WM_ICON hint - * with 32-bit X data model - */ - private int[] intIconData; - /** - * Representation of image as an int array - * It's being used for _NET_WM_ICON hint - * with 64-bit X data model - */ - private long[] longIconData; - /** - * Icon image. - */ - private Image image; - /** - * Width of icon image. Being set in constructor. - */ - private final int width; - /** - * Height of icon image. Being set in constructor. - */ - private final int height; - /** - * Width of scaled icon image. Can be set in setScaledDimension. - */ - private int scaledWidth; - /** - * Height of scaled icon image. Can be set in setScaledDimension. - */ - private int scaledHeight; - /** - * Length of raw data. Being set in constructor / setScaledDimension. - */ - private int rawLength; - - XIconInfo(int[] intIconData) { - this.intIconData = - (null == intIconData) ? null : Arrays.copyOf(intIconData, intIconData.length); - this.width = intIconData[0]; - this.height = intIconData[1]; - this.scaledWidth = width; - this.scaledHeight = height; - this.rawLength = width * height + 2; - } - - XIconInfo(long[] longIconData) { - this.longIconData = - (null == longIconData) ? null : Arrays.copyOf(longIconData, longIconData.length); - this.width = (int)longIconData[0]; - this.height = (int)longIconData[1]; - this.scaledWidth = width; - this.scaledHeight = height; - this.rawLength = width * height + 2; - } - - XIconInfo(Image image) { - this.image = image; - if (image instanceof ToolkitImage) { - ImageRepresentation ir = ((ToolkitImage)image).getImageRep(); - ir.reconstruct(ImageObserver.ALLBITS); - this.width = ir.getWidth(); - this.height = ir.getHeight(); - } else { - this.width = image.getWidth(null); - this.height = image.getHeight(null); - } - this.scaledWidth = width; - this.scaledHeight = height; - this.rawLength = width * height + 2; - } - - /* - * It sets size of scaled icon. - */ - void setScaledSize(int width, int height) { - this.scaledWidth = width; - this.scaledHeight = height; - this.rawLength = width * height + 2; - } - - boolean isValid() { - return (width > 0 && height > 0); - } - - int getWidth() { - return width; - } - - int getHeight() { - return height; - } - - public String toString() { - return "XIconInfo[w=" + width + ",h=" + height + ",sw=" + scaledWidth + ",sh=" + scaledHeight + "]"; - } - - int getRawLength() { - return rawLength; - } - - int[] getIntData() { - if (this.intIconData == null) { - if (this.longIconData != null) { - this.intIconData = longArrayToIntArray(longIconData); - } else if (this.image != null) { - this.intIconData = imageToIntArray(this.image, scaledWidth, scaledHeight); - } - } - return this.intIconData; - } - - long[] getLongData() { - if (this.longIconData == null) { - if (this.intIconData != null) { - this.longIconData = intArrayToLongArray(this.intIconData); - } else if (this.image != null) { - int[] intIconData = imageToIntArray(this.image, scaledWidth, scaledHeight); - this.longIconData = intArrayToLongArray(intIconData); - } - } - return this.longIconData; - } - - Image getImage() { - if (this.image == null) { - if (this.intIconData != null) { - this.image = intArrayToImage(this.intIconData); - } else if (this.longIconData != null) { - int[] intIconData = longArrayToIntArray(this.longIconData); - this.image = intArrayToImage(intIconData); - } - } - return this.image; - } - - private static int[] longArrayToIntArray(long[] longData) { - int[] intData = new int[longData.length]; - for (int i = 0; i < longData.length; i++) { - // Such a conversion is valid since the - // original data (see - // make/sun/xawt/ToBin.java) were ints - intData[i] = (int)longData[i]; - } - return intData; - } - - private static long[] intArrayToLongArray(int[] intData) { - long[] longData = new long[intData.length]; - for (int i = 0; i < intData.length; i++) { - longData[i] = (int)intData[i]; - } - return longData; - } - - static Image intArrayToImage(int[] raw) { - ColorModel cm = - new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), 32, - 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000, - false, DataBuffer.TYPE_INT); - DataBuffer buffer = new DataBufferInt(raw, raw.length-2, 2); - WritableRaster raster = - Raster.createPackedRaster(buffer, raw[0], raw[1], - raw[0], - new int[] {0x00ff0000, 0x0000ff00, - 0x000000ff, 0xff000000}, - null); - BufferedImage im = new BufferedImage(cm, raster, false, null); - return im; - } - - /* - * Returns array of integers which holds data for the image. - * It scales the image if necessary. - */ - static int[] imageToIntArray(Image image, int width, int height) { - if (width <= 0 || height <= 0) { - return null; - } - ColorModel cm = - new DirectColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), 32, - 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000, - false, DataBuffer.TYPE_INT); - DataBufferInt buffer = new DataBufferInt(width * height); - WritableRaster raster = - Raster.createPackedRaster(buffer, width, height, - width, - new int[] {0x00ff0000, 0x0000ff00, - 0x000000ff, 0xff000000}, - null); - BufferedImage im = new BufferedImage(cm, raster, false, null); - Graphics g = im.getGraphics(); - g.drawImage(image, 0, 0, width, height, null); - g.dispose(); - int[] data = buffer.getData(); - int[] raw = new int[width * height + 2]; - raw[0] = width; - raw[1] = height; - System.arraycopy(data, 0, raw, 2, width * height); - return raw; - } - -} diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/XIconWindow.java --- a/jdk/src/solaris/classes/sun/awt/X11/XIconWindow.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/solaris/classes/sun/awt/X11/XIconWindow.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,8 @@ import java.awt.*; import java.awt.image.*; -import sun.awt.X11GraphicsConfig; + +import sun.awt.IconInfo; import sun.awt.image.ToolkitImage; import sun.awt.image.ImageRepresentation; @@ -398,12 +399,12 @@ * Sets icon image by selecting one of the images from the list. * The selected image is the one having the best matching size. */ - void setIconImages(java.util.List icons) { + void setIconImages(java.util.List icons) { if (icons == null || icons.size() == 0) return; int minDiff = Integer.MAX_VALUE; Image min = null; - for (XIconInfo iconInfo : icons) { + for (IconInfo iconInfo : icons) { if (iconInfo.isValid()) { Image image = iconInfo.getImage(); Dimension dim = calcIconSize(image.getWidth(null), image.getHeight(null)); diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java --- a/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,8 @@ package sun.awt.X11; import java.awt.Frame; + +import sun.awt.IconInfo; import sun.util.logging.PlatformLogger; final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProtocol @@ -350,10 +352,10 @@ } /** - * Sets _NET_WM_ICON property on the window using the List of XIconInfo + * Sets _NET_WM_ICON property on the window using the List of IconInfo * If icons is null or empty list, removes _NET_WM_ICON property */ - public void setWMIcons(XWindowPeer window, java.util.List icons) { + public void setWMIcons(XWindowPeer window, java.util.List icons) { if (window == null) return; XAtom iconsAtom = XAtom.get("_NET_WM_ICON"); @@ -363,7 +365,7 @@ } int length = 0; - for (XIconInfo ii : icons) { + for (IconInfo ii : icons) { length += ii.getRawLength(); } int cardinalSize = (XlibWrapper.dataModel == 32) ? 4 : 8; @@ -373,7 +375,7 @@ long buffer = XlibWrapper.unsafe.allocateMemory(bufferSize); try { long ptr = buffer; - for (XIconInfo ii : icons) { + for (IconInfo ii : icons) { int size = ii.getRawLength() * cardinalSize; if (XlibWrapper.dataModel == 32) { XlibWrapper.copyIntArray(ptr, ii.getIntData(), size); diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/XWM.java --- a/jdk/src/solaris/classes/sun/awt/X11/XWM.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/solaris/classes/sun/awt/X11/XWM.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ */ package sun.awt.X11; +import sun.awt.IconInfo; import sun.misc.Unsafe; import java.awt.Insets; import java.awt.Frame; @@ -1670,7 +1671,7 @@ * * @return true if hint was modified successfully, false otherwise */ - public boolean setNetWMIcon(XWindowPeer window, java.util.List icons) { + public boolean setNetWMIcon(XWindowPeer window, java.util.List icons) { if (g_net_protocol != null && g_net_protocol.active()) { g_net_protocol.setWMIcons(window, icons); return getWMID() != ICE_WM; diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/XWarningWindow.java --- a/jdk/src/solaris/classes/sun/awt/X11/XWarningWindow.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/solaris/classes/sun/awt/X11/XWarningWindow.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,11 +25,10 @@ package sun.awt.X11; import java.awt.*; -import java.awt.event.*; import java.awt.geom.Point2D; import java.lang.ref.WeakReference; -import sun.java2d.SunGraphics2D; -import sun.java2d.pipe.Region; + +import sun.awt.IconInfo; import sun.awt.AWTAccessor; import sun.awt.SunToolkit; @@ -56,37 +55,37 @@ * 3 - 48x48 */ private int currentSize = -1; - private static XIconInfo[][] icons; - private static XIconInfo getSecurityIconInfo(int size, int num) { + private static IconInfo[][] icons; + private static IconInfo getSecurityIconInfo(int size, int num) { synchronized (XWarningWindow.class) { if (icons == null) { - icons = new XIconInfo[4][3]; + icons = new IconInfo[4][3]; if (XlibWrapper.dataModel == 32) { - icons[0][0] = new XIconInfo(XAWTIcon32_security_icon_bw16_png.security_icon_bw16_png); - icons[0][1] = new XIconInfo(XAWTIcon32_security_icon_interim16_png.security_icon_interim16_png); - icons[0][2] = new XIconInfo(XAWTIcon32_security_icon_yellow16_png.security_icon_yellow16_png); - icons[1][0] = new XIconInfo(XAWTIcon32_security_icon_bw24_png.security_icon_bw24_png); - icons[1][1] = new XIconInfo(XAWTIcon32_security_icon_interim24_png.security_icon_interim24_png); - icons[1][2] = new XIconInfo(XAWTIcon32_security_icon_yellow24_png.security_icon_yellow24_png); - icons[2][0] = new XIconInfo(XAWTIcon32_security_icon_bw32_png.security_icon_bw32_png); - icons[2][1] = new XIconInfo(XAWTIcon32_security_icon_interim32_png.security_icon_interim32_png); - icons[2][2] = new XIconInfo(XAWTIcon32_security_icon_yellow32_png.security_icon_yellow32_png); - icons[3][0] = new XIconInfo(XAWTIcon32_security_icon_bw48_png.security_icon_bw48_png); - icons[3][1] = new XIconInfo(XAWTIcon32_security_icon_interim48_png.security_icon_interim48_png); - icons[3][2] = new XIconInfo(XAWTIcon32_security_icon_yellow48_png.security_icon_yellow48_png); + icons[0][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw16_png.security_icon_bw16_png); + icons[0][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim16_png.security_icon_interim16_png); + icons[0][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow16_png.security_icon_yellow16_png); + icons[1][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw24_png.security_icon_bw24_png); + icons[1][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim24_png.security_icon_interim24_png); + icons[1][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow24_png.security_icon_yellow24_png); + icons[2][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw32_png.security_icon_bw32_png); + icons[2][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim32_png.security_icon_interim32_png); + icons[2][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow32_png.security_icon_yellow32_png); + icons[3][0] = new IconInfo(sun.awt.AWTIcon32_security_icon_bw48_png.security_icon_bw48_png); + icons[3][1] = new IconInfo(sun.awt.AWTIcon32_security_icon_interim48_png.security_icon_interim48_png); + icons[3][2] = new IconInfo(sun.awt.AWTIcon32_security_icon_yellow48_png.security_icon_yellow48_png); } else { - icons[0][0] = new XIconInfo(XAWTIcon64_security_icon_bw16_png.security_icon_bw16_png); - icons[0][1] = new XIconInfo(XAWTIcon64_security_icon_interim16_png.security_icon_interim16_png); - icons[0][2] = new XIconInfo(XAWTIcon64_security_icon_yellow16_png.security_icon_yellow16_png); - icons[1][0] = new XIconInfo(XAWTIcon64_security_icon_bw24_png.security_icon_bw24_png); - icons[1][1] = new XIconInfo(XAWTIcon64_security_icon_interim24_png.security_icon_interim24_png); - icons[1][2] = new XIconInfo(XAWTIcon64_security_icon_yellow24_png.security_icon_yellow24_png); - icons[2][0] = new XIconInfo(XAWTIcon64_security_icon_bw32_png.security_icon_bw32_png); - icons[2][1] = new XIconInfo(XAWTIcon64_security_icon_interim32_png.security_icon_interim32_png); - icons[2][2] = new XIconInfo(XAWTIcon64_security_icon_yellow32_png.security_icon_yellow32_png); - icons[3][0] = new XIconInfo(XAWTIcon64_security_icon_bw48_png.security_icon_bw48_png); - icons[3][1] = new XIconInfo(XAWTIcon64_security_icon_interim48_png.security_icon_interim48_png); - icons[3][2] = new XIconInfo(XAWTIcon64_security_icon_yellow48_png.security_icon_yellow48_png); + icons[0][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw16_png.security_icon_bw16_png); + icons[0][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim16_png.security_icon_interim16_png); + icons[0][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow16_png.security_icon_yellow16_png); + icons[1][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw24_png.security_icon_bw24_png); + icons[1][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim24_png.security_icon_interim24_png); + icons[1][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow24_png.security_icon_yellow24_png); + icons[2][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw32_png.security_icon_bw32_png); + icons[2][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim32_png.security_icon_interim32_png); + icons[2][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow32_png.security_icon_yellow32_png); + icons[3][0] = new IconInfo(sun.awt.AWTIcon64_security_icon_bw48_png.security_icon_bw48_png); + icons[3][1] = new IconInfo(sun.awt.AWTIcon64_security_icon_interim48_png.security_icon_interim48_png); + icons[3][2] = new IconInfo(sun.awt.AWTIcon64_security_icon_yellow48_png.security_icon_yellow48_png); } } } @@ -125,7 +124,7 @@ try { if (newSize != currentSize) { currentSize = newSize; - XIconInfo ico = getSecurityIconInfo(currentSize, 0); + IconInfo ico = getSecurityIconInfo(currentSize, 0); XlibWrapper.SetBitmapShape(XToolkit.getDisplay(), getWindow(), ico.getWidth(), ico.getHeight(), ico.getIntData()); AWTAccessor.getWindowAccessor().setSecurityWarningSize( @@ -136,7 +135,7 @@ } } - private XIconInfo getSecurityIconInfo() { + private IconInfo getSecurityIconInfo() { updateIconSize(); return getSecurityIconInfo(currentSize, currentIcon); } diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/XWindowAttributesData.java --- a/jdk/src/solaris/classes/sun/awt/X11/XWindowAttributesData.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowAttributesData.java Wed Mar 27 16:37:00 2013 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,7 @@ * questions. */ package sun.awt.X11; -import java.awt.Image; -import java.util.ArrayList; +import sun.awt.IconInfo; class XWindowAttributesData { static int NORMAL = 0; @@ -51,7 +50,7 @@ boolean initialResizability; int visibilityState; // updated by native X11 event handling code. String title; - java.util.List icons; + java.util.List icons; boolean iconsInherited; int decorations; // for future expansion to be able to // specify native decorations diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java --- a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java Tue Feb 19 22:23:34 2013 -0800 +++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java Wed Mar 27 16:37:00 2013 +0400 @@ -30,8 +30,6 @@ import java.awt.event.FocusEvent; import java.awt.event.WindowEvent; -import java.awt.image.BufferedImage; - import java.awt.peer.ComponentPeer; import java.awt.peer.WindowPeer; @@ -55,6 +53,7 @@ import sun.awt.SunToolkit; import sun.awt.X11GraphicsDevice; import sun.awt.X11GraphicsEnvironment; +import sun.awt.IconInfo; import sun.java2d.pipe.Region; @@ -292,7 +291,7 @@ Window target = (Window)this.target; java.util.List iconImages = ((Window)target).getIconImages(); XWindowPeer ownerPeer = getOwnerPeer(); - winAttr.icons = new ArrayList(); + winAttr.icons = new ArrayList(); if (iconImages.size() != 0) { //read icon images from target winAttr.iconsInherited = false; @@ -304,9 +303,9 @@ } continue; } - XIconInfo iconInfo; + IconInfo iconInfo; try { - iconInfo = new XIconInfo(image); + iconInfo = new IconInfo(image); } catch (Exception e){ if (log.isLoggable(PlatformLogger.FINEST)) { log.finest("XWindowPeer.updateIconImages: Perhaps the image passed into Java is broken. Skipping this icon."); @@ -344,12 +343,12 @@ * It does scale some of these icons to appropriate size * if it's necessary. */ - static java.util.List normalizeIconImages(java.util.List icons) { - java.util.List result = new ArrayList(); + static java.util.List normalizeIconImages(java.util.List icons) { + java.util.List result = new ArrayList(); int totalLength = 0; boolean haveLargeIcon = false; - for (XIconInfo icon : icons) { + for (IconInfo icon : icons) { int width = icon.getWidth(); int height = icon.getHeight(); int length = icon.getRawLength(); @@ -390,16 +389,16 @@ /* * Dumps each icon from the list */ - static void dumpIcons(java.util.List icons) { + static void dumpIcons(java.util.List icons) { if (iconLog.isLoggable(PlatformLogger.FINEST)) { iconLog.finest(">>> Sizes of icon images:"); - for (Iterator i = icons.iterator(); i.hasNext(); ) { + for (Iterator i = icons.iterator(); i.hasNext(); ) { iconLog.finest(" {0}", i.next()); } } } - public void recursivelySetIcon(java.util.List icons) { + public void recursivelySetIcon(java.util.List icons) { dumpIcons(winAttr.icons); setIconHints(icons); Window target = (Window)this.target; @@ -416,28 +415,28 @@ } } - java.util.List getIconInfo() { + java.util.List getIconInfo() { return winAttr.icons; } - void setIconHints(java.util.List icons) { + void setIconHints(java.util.List icons) { //This does nothing for XWindowPeer, //It's overriden in XDecoratedPeer } - private static ArrayList defaultIconInfo; - protected synchronized static java.util.List getDefaultIconInfo() { + private static ArrayList defaultIconInfo; + protected synchronized static java.util.List getDefaultIconInfo() { if (defaultIconInfo == null) { - defaultIconInfo = new ArrayList(); + defaultIconInfo = new ArrayList(); if (XlibWrapper.dataModel == 32) { - defaultIconInfo.add(new XIconInfo(XAWTIcon32_java_icon16_png.java_icon16_png)); - defaultIconInfo.add(new XIconInfo(XAWTIcon32_java_icon24_png.java_icon24_png)); - defaultIconInfo.add(new XIconInfo(XAWTIcon32_java_icon32_png.java_icon32_png)); - defaultIconInfo.add(new XIconInfo(XAWTIcon32_java_icon48_png.java_icon48_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon16_png.java_icon16_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon24_png.java_icon24_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon32_png.java_icon32_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon32_java_icon48_png.java_icon48_png)); } else { - defaultIconInfo.add(new XIconInfo(XAWTIcon64_java_icon16_png.java_icon16_png)); - defaultIconInfo.add(new XIconInfo(XAWTIcon64_java_icon24_png.java_icon24_png)); - defaultIconInfo.add(new XIconInfo(XAWTIcon64_java_icon32_png.java_icon32_png)); - defaultIconInfo.add(new XIconInfo(XAWTIcon64_java_icon48_png.java_icon48_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon16_png.java_icon16_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon24_png.java_icon24_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon32_png.java_icon32_png)); + defaultIconInfo.add(new IconInfo(sun.awt.AWTIcon64_java_icon48_png.java_icon48_png)); } } return defaultIconInfo; diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/security-icon-bw16.png Binary file jdk/src/solaris/classes/sun/awt/X11/security-icon-bw16.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/security-icon-bw24.png Binary file jdk/src/solaris/classes/sun/awt/X11/security-icon-bw24.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/security-icon-bw32.png Binary file jdk/src/solaris/classes/sun/awt/X11/security-icon-bw32.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/security-icon-bw48.png Binary file jdk/src/solaris/classes/sun/awt/X11/security-icon-bw48.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/security-icon-interim16.png Binary file jdk/src/solaris/classes/sun/awt/X11/security-icon-interim16.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/security-icon-interim24.png Binary file jdk/src/solaris/classes/sun/awt/X11/security-icon-interim24.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/security-icon-interim32.png Binary file jdk/src/solaris/classes/sun/awt/X11/security-icon-interim32.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/security-icon-interim48.png Binary file jdk/src/solaris/classes/sun/awt/X11/security-icon-interim48.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow16.png Binary file jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow16.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow24.png Binary file jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow24.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow32.png Binary file jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow32.png has changed diff -r c47c078f91b8 -r 3e009b5be123 jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow48.png Binary file jdk/src/solaris/classes/sun/awt/X11/security-icon-yellow48.png has changed