提交 69d8c25b 编写于 作者: L lana

Merge

...@@ -195,3 +195,4 @@ a996b57e554198f4592a5f3c30f2f9f4075e545d jdk8-b70 ...@@ -195,3 +195,4 @@ a996b57e554198f4592a5f3c30f2f9f4075e545d jdk8-b70
2a5af0f766d0acd68a81fb08fe11fd66795f86af jdk8-b71 2a5af0f766d0acd68a81fb08fe11fd66795f86af jdk8-b71
32a57e645e012a1f0665c075969ca598e0dbb948 jdk8-b72 32a57e645e012a1f0665c075969ca598e0dbb948 jdk8-b72
733885f57e14cc27f5a5ff0dffe641d2fa3c704a jdk8-b73 733885f57e14cc27f5a5ff0dffe641d2fa3c704a jdk8-b73
57d5d954462831ac353a1f40d3bb05ddb4620952 jdk8-b74
...@@ -237,6 +237,9 @@ SUBDIRS = tools java javax sun com jdk ...@@ -237,6 +237,9 @@ SUBDIRS = tools java javax sun com jdk
ifeq ($(PLATFORM), macosx) ifeq ($(PLATFORM), macosx)
SUBDIRS += apple SUBDIRS += apple
endif endif
ifeq ($(PLATFORM), windows)
SUBDIRS += bridge
endif
SUBDIRS_tools = launchers SUBDIRS_tools = launchers
SUBDIRS_misc = org jpda SUBDIRS_misc = org jpda
......
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Makefile for building AccessBridge
#
BUILDDIR = ../..
PRODUCT = java
PACKAGE = com.sun.java.accessibility
include $(BUILDDIR)/common/Defs.gmk
JARFILE = $(EXTDIR)/access-bridge$(ABSUFFIX).jar
ifeq ($(ARCH_DATA_MODEL), 64)
ABPLATFORM = 64bit
ABSUFFIX = -64
else
ifeq ($(ARCH_DATA_MODEL), 32)
ifdef ABLEGACY
ABSUFFIX =
ABPLATFORM = legacy
else
ABPLATFORM = 32bit
ABSUFFIX = -32
endif
endif
endif
#
# Java files to compile.
#
FILES_java = com/sun/java/accessibility/AccessBridge.java
#
# Location for the newly built classfiles.
#
CLASSDESTDIR = $(TEMPDIR)/classes
#
# Rules
#
CLASSDESTDIR = $(TEMPDIR)/classes
FILES_class = $(FILES_java:%.java=$(CLASSDESTDIR)/%.class)
build: prebuild
prebuild:
$(CP) $(CLOSED_PLATFORM_SRC)/classes/com/sun/java/accessibility/$(ABPLATFORM)/AccessBridge.java \
$(CLOSED_PLATFORM_SRC)/classes/com/sun/java/accessibility
all : build $(JARFILE)
#
# JAR file
#
$(JARFILE): \
$(FILES_class)
$(BOOT_JAR_CMD) -cf $(JARFILE) \
-C $(CLASSDESTDIR) com \
$(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup)
#
# Rules
#
include $(BUILDDIR)/common/Classes.gmk
clean clobber::
$(RM) -r $(CLASSDESTDIR) \
$(EXTDIR)/$(JARFILE)
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Native files to compile.
FILES_cpp = \
JAWTAccessBridge.cpp
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Makefile for building JAWTAccessBridge
#
BUILDDIR = ../..
LIBRARY = JAWTAccessBridge$(ABSUFFIX)
include $(BUILDDIR)/common/Defs.gmk
# Indicate we want the C++ compiler to do the linking.
CPLUSPLUSLIBRARY=true
ifeq ($(ARCH_DATA_MODEL), 64)
ABSUFFIX = -64
ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_64
ABRIDGE_MACHINE=X64
else
ifeq ($(ARCH_DATA_MODEL), 32)
ABRIDGE_MACHINE=I386
ifdef ABLEGACY
ABSUFFIX =
ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_LEGACY
else
ABSUFFIX = -32
ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_32
endif
endif
endif
include FILES_cpp.gmk
VERSIONINFO_RESOURCE = $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgeStatusWindow.rc
OTHER_CPPFLAGS += -D$(ACCESSBRIDGE_ARCH) -I "$(INCLUDEDIR)" -I "$(PLATFORM_INCLUDE)"
LDLIBS += kernel32.lib user32.lib gdi32.lib winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
uuid.lib odbc32.lib odbccp32.lib /subsystem:windows /dll /incremental:no /machine:$(ABRIDGE_MACHINE) \
/def:$(CLOSED_PLATFORM_SRC)/native/sun/bridge/JAWTAccessBridge.DEF /libpath:"$(LIBDIR)"
#
# Rules
#
include $(BUILDDIR)/common/Library.gmk
vpath %.cpp $(CLOSED_PLATFORM_SRC)/native/sun/bridge
vpath %.RC $(CLOSED_PLATFORM_SRC)/native/sun/bridge
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Makefile for building jabswitch.exe
#
BUILDDIR = ../..
PROGRAM = jabswitch
include $(BUILDDIR)/common/Defs.gmk
# Indicate we want the C++ compiler to do the linking.
CPLUSPLUSLIBRARY=true
VERSIONINFO_RESOURCE = $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgeStatusWindow.rc
VERSIONRES = $(TEMPDIR)/AccessBridgeStatusWindow.res
JAB_EXE= $(TEMPDIR)/jabswitch.exe
JAB_SRC = $(CLOSED_PLATFORM_SRC)/native/sun/bridge/jabswitch.cpp
JAB_MANIFEST_INP = $(CLOSED_PLATFORM_SRC)/native/sun/bridge/jabswitch.manifest
JAB_MANIFEST_OUT = $(TEMPDIR)/jabswitch.exe.intermediate.manifest
RC_FLAGS += /fo "$(VERSIONRES)"
OTHER_CPPFLAGS += /MD /Fo"$(TEMPDIR)/" /Fd"$(TEMPDIR)/" /analyze- /Od /Gd /nologo /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /RTC1 /W3 /ZI /Zc:wchar_t /EHsc
LDDFLAGS += Advapi32.lib Version.lib User32.lib
all: buildexe copyfilejab
buildexe :
$(CD) $(TEMPDIR)
$(RC) $(RC_FLAGS) $(VERSIONINFO_RESOURCE)
$(CC) $(CPPFLAGS) $(JAB_SRC) $(LDDFLAGS) $(VERSIONRES) -o $(JAB_EXE)
$(MT) /nologo /verbose /manifest $(JAB_MANIFEST_INP) /outputresource:$(JAB_EXE)
copyfilejab :
$(CP) $(JAB_EXE) $(BINDIR)
vpath %.cpp $(CLOSED_PLATFORM_SRC)/native/sun/bridge
vpath %.rc $(CLOSED_PLATFORM_SRC)/native/sun/bridge
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Makefile for building jaccess
#
BUILDDIR = ../..
PRODUCT = java
PACKAGE = com.sun.java.accessibility.jaccess
include $(BUILDDIR)/common/Defs.gmk
JARFILE = $(EXTDIR)/jaccess.jar
#
# Java files to compile.
#
#AUTO_FILES_JAVA_DIRS = $(CLOSED_PLATFORM_SRC)/bridge
FILES_java = \
com/sun/java/accessibility/util/AccessibilityEventMonitor.java \
com/sun/java/accessibility/util/AccessibilityListenerList.java \
com/sun/java/accessibility/util/AWTEventMonitor.java \
com/sun/java/accessibility/util/EventID.java \
com/sun/java/accessibility/util/EventQueueMonitor.java \
com/sun/java/accessibility/util/GUIInitializedListener.java \
com/sun/java/accessibility/util/GUIInitializedMulticaster.java \
com/sun/java/accessibility/util/SwingEventMonitor.java \
com/sun/java/accessibility/util/TopLevelWindowListener.java \
com/sun/java/accessibility/util/TopLevelWindowMulticaster.java \
com/sun/java/accessibility/util/Translator.java \
com/sun/java/accessibility/util/java/awt/ButtonTranslator.java \
com/sun/java/accessibility/util/java/awt/CheckboxTranslator.java \
com/sun/java/accessibility/util/java/awt/LabelTranslator.java \
com/sun/java/accessibility/util/java/awt/ListTranslator.java \
com/sun/java/accessibility/util/java/awt/TextComponentTranslator.java
#
# Rules
#
CLASSDESTDIR = $(TEMPDIR)/classes
FILES_class = $(FILES_java:%.java=$(CLASSDESTDIR)/%.class)
all : build $(JARFILE)
#
# JAR file
#
$(JARFILE): \
$(FILES_class)
$(BOOT_JAR_CMD) -cf $(JARFILE) \
-C $(CLASSDESTDIR) com \
$(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup)
#
# Rules
#
include $(BUILDDIR)/common/Classes.gmk
clean clobber::
$(RM) -r $(CLASSDESTDIR) \
$(EXTDIR)/$(JARFILE)
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Native files to compile.
FILES_cpp = \
AccessBridgeATInstance.cpp \
AccessBridgeDebug.cpp \
AccessBridgeJavaEntryPoints.cpp \
AccessBridgeMessages.cpp \
JavaAccessBridge.cpp
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Makefile for building JavaAccessBridge.DLL
#
BUILDDIR = ../..
LIBRARY = JavaAccessBridge$(ABSUFFIX)
include $(BUILDDIR)/common/Defs.gmk
# Indicate we want the C++ compiler to do the linking.
CPLUSPLUSLIBRARY=true
ifeq ($(ARCH_DATA_MODEL), 64)
ABSUFFIX = -64
ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_64
ABRIDGE_MACHINE=X64
else
ifeq ($(ARCH_DATA_MODEL), 32)
ABRIDGE_MACHINE=I386
ifdef ABLEGACY
ABSUFFIX =
ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_LEGACY
else
ABSUFFIX = -32
ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_32
endif
endif
endif
include FILES_cpp.gmk
PLATFORM_INCLUDE_BRIDGE = $(PLATFORM_INCLUDE)/bridge
VERSIONINFO_RESOURCE = $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgeStatusWindow.rc
OTHER_CPPFLAGS += -D$(ACCESSBRIDGE_ARCH) -I "$(INCLUDEDIR)" -I "$(PLATFORM_INCLUDE)"
LDLIBS += kernel32.lib user32.lib gdi32.lib winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \
odbc32.lib odbccp32.lib /subsystem:windows /dll /incremental:no /machine:$(ABRIDGE_MACHINE) \
/def:$(CLOSED_PLATFORM_SRC)/native/sun/bridge/JavaAccessBridge.DEF /libpath:"$(LIBDIR)"
all : build postbuild
postbuild :
$(MKDIR) -p $(PLATFORM_INCLUDE_BRIDGE)
$(CP) $(CLOSED_PLATFORM_SRC)/native/sun/bridge/accessibility.properties $(LIBDIR)
$(CP) $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgeCallbacks.h $(PLATFORM_INCLUDE_BRIDGE)
$(CP) $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgeCalls.h $(PLATFORM_INCLUDE_BRIDGE)
$(CP) $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgePackages.h $(PLATFORM_INCLUDE_BRIDGE)
$(CP) $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgeCalls.c $(PLATFORM_INCLUDE_BRIDGE)
#
# Rules
#
include $(BUILDDIR)/common/Library.gmk
vpath %.cpp $(CLOSED_PLATFORM_SRC)/native/sun/bridge
vpath %.DEF $(CLOSED_PLATFORM_SRC)/native/sun/bridge
vpath %.rc $(CLOSED_PLATFORM_SRC)/native/sun/bridge
vpath %.c $(CLOSED_PLATFORM_SRC)/native/sun/bridge
vpath %.h $(CLOSED_PLATFORM_SRC)/native/sun/bridge
#
# Extra clean rule.
#
clean clobber::
$(RM) $(FILES_h)
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Makefile for building Java Access Bridge
#
BUILDDIR = ..
include $(BUILDDIR)/common/Defs.gmk
#
#
ifndef OPENJDK
ifeq ($(PLATFORM), windows)
include $(BUILDDIR)/common/Subdirs.gmk
#
# build for 32 and 64 bit (new api)
#
SUBDIRS = Jaccess JavaAccessBridge WindowsAccessBridge JAWTAccessBridge AccessBridgeJava Jabswitch
#
# build for legacy
#
ifeq ($(ARCH_DATA_MODEL), 32)
OTHERSUBDIRS_MAKEFLAGS += ABLEGACY=true
OTHERSUBDIRS = JavaAccessBridge WindowsAccessBridge JAWTAccessBridge AccessBridgeJava
endif
ifeq ($(ARCH_DATA_MODEL), 32)
all build clean clobber ::
$(SUBDIRS-loop)
$(OTHERSUBDIRS-loop)
else
all build clean clobber ::
$(SUBDIRS-loop)
endif
clean::
$(RM) -r $(CLASSBINDIR) $(CLASSBINDIR)
endif # PLATFORM
endif #OPENJDK
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Native files to compile.
FILES_cpp = \
AccessBridgeJavaVMInstance.cpp \
AccessBridgeMessageQueue.cpp \
AccessBridgeMessages.cpp \
AccessBridgeWindowsEntryPoints.cpp \
WinAccessBridge.cpp \
AccessBridgeDebug.cpp \
AccessBridgeEventHandler.cpp
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Makefile for building WindowsAccessBridge.dll
#
BUILDDIR = ../..
LIBRARY = WindowsAccessBridge$(ABSUFFIX)
include $(BUILDDIR)/common/Defs.gmk
# Indicate we want the C++ compiler to do the linking.
CPLUSPLUSLIBRARY=true
ifeq ($(ARCH_DATA_MODEL), 64)
ABSUFFIX = -64
ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_64
ABRIDGE_MACHINE=X64
else
ifeq ($(ARCH_DATA_MODEL), 32)
ABRIDGE_MACHINE=I386
ifdef ABLEGACY
ABSUFFIX =
ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_LEGACY
else
ABSUFFIX = -32
ACCESSBRIDGE_ARCH = ACCESSBRIDGE_ARCH_32
endif
endif
endif
include FILES_cpp.gmk
VERSIONINFO_RESOURCE = $(CLOSED_PLATFORM_SRC)/native/sun/bridge/AccessBridgeStatusWindow.rc
OTHER_CPPFLAGS += -MT -D$(ACCESSBRIDGE_ARCH) -I "$(INCLUDEDIR)" -I "$(PLATFORM_INCLUDE)"
LDLIBS += kernel32.lib user32.lib gdi32.lib winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /subsystem:windows /dll /incremental:no /machine:$(ABRIDGE_MACHINE) \
/def:$(CLOSED_PLATFORM_SRC)/native/sun/bridge/WinAccessBridge.DEF /libpath:"$(LIBDIR)"
#
# Rules
#
include $(BUILDDIR)/common/Library.gmk
vpath %.cpp $(CLOSED_PLATFORM_SRC)/native/sun/bridge
vpath %.DEF $(CLOSED_PLATFORM_SRC)/native/sun/bridge
vpath %.rc $(CLOSED_PLATFORM_SRC)/native/sun/bridge
...@@ -68,24 +68,25 @@ else ...@@ -68,24 +68,25 @@ else
endif endif
JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR) ! -type d) JDK_FILE_LIST := $(shell $(FIND) $(JDK_IMAGE_DIR))
JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR) ! -type d) JRE_FILE_LIST := $(shell $(FIND) $(JRE_IMAGE_DIR))
JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR),$(JDK_BUNDLE_DIR)/Home,$(JDK_FILE_LIST)) JDK_TARGET_LIST := $(subst $(JDK_IMAGE_DIR)/,$(JDK_BUNDLE_DIR)/Home/,$(JDK_FILE_LIST))
JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR),$(JRE_BUNDLE_DIR)/Home,$(JRE_FILE_LIST)) JRE_TARGET_LIST := $(subst $(JRE_IMAGE_DIR)/,$(JRE_BUNDLE_DIR)/Home/,$(JRE_FILE_LIST))
# The old builds implementation of this did not preserve symlinks so # The old builds implementation of this did not preserve symlinks so
# make sure they are followed and the contents copied instead. # make sure they are followed and the contents copied instead.
# To fix this, just replace copy with install-file macro. # To fix this, remove -L
# Copy empty directories (jre/lib/applet).
$(JDK_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/% $(JDK_BUNDLE_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(CP) -f -R -L '$<' '$@' if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -L '$<' '$@'; fi
$(JRE_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/% $(JRE_BUNDLE_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(CP) -f -R -L '$<' '$@' if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -L '$<' '$@'; fi
$(JDK_BUNDLE_DIR)/MacOS/libjli.dylib: $(JDK_BUNDLE_DIR)/MacOS/libjli.dylib:
$(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(ECHO) Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@)
......
...@@ -59,6 +59,12 @@ ifndef OPENJDK ...@@ -59,6 +59,12 @@ ifndef OPENJDK
# This gets built on unix platforms implicitly in the old build even though # This gets built on unix platforms implicitly in the old build even though
# it's excluded in the closed build. # it's excluded in the closed build.
EXCLUDES+=sun/java2d/pisces EXCLUDES+=sun/java2d/pisces
# AccessBridge is compiled separately below.
EXFILES += AccessBridge.java \
com/sun/java/accessibility/util/java/awt/ChoiceTranslator.java
# This seems to never be built
EXCLUDES += com/sun/java/accessibility/extensions
endif endif
endif endif
...@@ -248,10 +254,8 @@ include CopyIntoClasses.gmk ...@@ -248,10 +254,8 @@ include CopyIntoClasses.gmk
# Now we have COPY_PATTERNS, COPY_FILES and COPY_EXTRA # Now we have COPY_PATTERNS, COPY_FILES and COPY_EXTRA
ifndef OPENJDK ifndef OPENJDK
CLOSED_SRC_DIRS:=$(JDK_TOPDIR)/src/closed/share/classes CLOSED_SRC_DIRS:=$(JDK_TOPDIR)/src/closed/share/classes \
ifneq ($(OPENJDK_TARGET_OS_API_DIR),windows) $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes
CLOSED_SRC_DIRS += $(JDK_TOPDIR)/src/closed/$(OPENJDK_TARGET_OS_API_DIR)/classes
endif
endif endif
MACOSX_SRC_DIRS := MACOSX_SRC_DIRS :=
...@@ -364,8 +368,44 @@ endif ...@@ -364,8 +368,44 @@ endif
########################################################################################## ##########################################################################################
# copy with -a to preserve timestamps so dependencies down the line aren't messed up ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
$(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_32,\
SETUP:=GENERATE_JDKBYTECODE,\
JAVAC_FLAGS:=-cp $(JDK_OUTPUTDIR)/classes,\
SRC:=$(JDK_OUTPUTDIR)/gensrc_ab/32bit,\
BIN:=$(JDK_OUTPUTDIR)/classes_ab/32bit))
$(BUILD_ACCESSBRIDGE_32): $(BUILD_JDK)
$(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_LEGACY,\
SETUP:=GENERATE_JDKBYTECODE,\
JAVAC_FLAGS:=-cp $(JDK_OUTPUTDIR)/classes,\
SRC:=$(JDK_OUTPUTDIR)/gensrc_ab/legacy,\
BIN:=$(JDK_OUTPUTDIR)/classes_ab/legacy))
$(BUILD_ACCESSBRIDGE_LEGACY): $(BUILD_JDK)
else
$(eval $(call SetupJavaCompilation,BUILD_ACCESSBRIDGE_64,\
SETUP:=GENERATE_JDKBYTECODE,\
JAVAC_FLAGS:=-cp $(JDK_OUTPUTDIR)/classes,\
SRC:=$(JDK_OUTPUTDIR)/gensrc_ab/64bit,\
BIN:=$(JDK_OUTPUTDIR)/classes_ab/64bit))
$(BUILD_ACCESSBRIDGE_64): $(BUILD_JDK)
endif
endif
endif
##########################################################################################
all: $(BUILD_JDK) $(BUILD_ALTCLASSES) $(BUILD_JOBJC) $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \ all: $(BUILD_JDK) $(BUILD_ALTCLASSES) $(BUILD_JOBJC) $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \
$(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \
$(BUILD_ACCESSBRIDGE_32) $(BUILD_ACCESSBRIDGE_64) \
$(BUILD_ACCESSBRIDGE_LEGACY)
.PHONY: all .PHONY: all
...@@ -590,6 +590,34 @@ else ...@@ -590,6 +590,34 @@ else
$(CHMOD) a+x $@ $(CHMOD) a+x $@
endif endif
##########################################################################################
# jabswitch
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS),windows)
$(eval $(call SetupNativeCompilation,BUILD_JABSWITCH,\
SRC:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge,\
INCLUDE_FILES:=jabswitch.cpp,\
LANG:=C++,\
CFLAGS:=$(filter-out -Zc:wchar_t-,$(CFLAGS_JDKEXE)) -Zc:wchar_t \
-analyze- -Od -Gd -D_WINDOWS \
-D_UNICODE -DUNICODE -RTC1 -EHsc,\
LDFLAGS:=$(LDFLAGS_JDKEXE) \
Advapi32.lib Version.lib User32.lib,\
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jabswitch,\
OUTPUT_DIR:=$(JDK_OUTPUTDIR)/bin,\
PROGRAM:=jabswitch,\
DEBUG_SYMBOLS:=true,\
VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/AccessBridgeStatusWindow.rc,\
RC_FLAGS:=$(RC_FLAGS),\
MANIFEST:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/jabswitch.manifest))
BUILD_LAUNCHERS += $(BUILD_JABSWITCH)
endif
endif
########################################################################################## ##########################################################################################
$(BUILD_LAUNCHERS) : $(JDK_TOPDIR)/makefiles/CompileLaunchers.gmk $(BUILD_LAUNCHERS) : $(JDK_TOPDIR)/makefiles/CompileLaunchers.gmk
......
...@@ -3294,6 +3294,97 @@ BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JObjC$(SHARED_LIBR ...@@ -3294,6 +3294,97 @@ BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JObjC$(SHARED_LIBR
endif endif
##########################################################################################
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
ACCESSBRIDGE_SRCDIR:=$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge
define SetupAccessBridge
# Parameter 1 Suffix
# Parameter 2 Machine
# Parameter 3 ACCESSBRIDGE_ARCH_ suffix
$(call SetupNativeCompilation,BUILD_JAWTACCESSBRIDGE$1,\
LIBRARY=JAWTAccessBridge$1,\
OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
SRC:=$(ACCESSBRIDGE_SRCDIR),\
INCLUDE_FILES:=JAWTAccessBridge.cpp,\
LANG:=C++,\
OPTIMIZATION:=LOW,\
CFLAGS:=$(CFLAGS_JDKLIB) \
-DACCESSBRIDGE_ARCH_$3,\
LDFLAGS:=$(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
-subsystem:windows -machine:$2 \
-def:$(ACCESSBRIDGE_SRCDIR)/JAWTAccessBridge.DEF,\
VERSIONINFO_RESOURCE:=$(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc,\
RC_FLAGS:=$(RC_FLAGS),\
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjawtaccessbridge$1,\
DEBUG_SYMBOLS:=true)
$$(BUILD_JAWTACCESSBRIDGE$1): $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
$(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1,\
LIBRARY=JavaAccessBridge$1,\
OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
SRC:=$(ACCESSBRIDGE_SRCDIR),\
INCLUDE_FILES:=AccessBridgeATInstance.cpp AccessBridgeDebug.cpp \
AccessBridgeJavaEntryPoints.cpp \
AccessBridgeMessages.cpp JavaAccessBridge.cpp,\
LANG:=C++,\
OPTIMIZATION:=LOW,\
CFLAGS:=$(CFLAGS_JDKLIB) \
-DACCESSBRIDGE_ARCH_$3,\
LDFLAGS:=$(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
winspool.lib comdlg32.lib advapi32.lib shell32.lib \
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
-subsystem:windows -machine:$2 \
-def:$(ACCESSBRIDGE_SRCDIR)/JavaAccessBridge.DEF,\
VERSIONINFO_RESOURCE:=$(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc,\
RC_FLAGS:=$(RC_FLAGS),\
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjavaaccessbridge$1,\
DEBUG_SYMBOLS:=true)
$(call SetupNativeCompilation,BUILD_WINDOWSACCESSBRIDGE$1,\
LIBRARY=WindowsAccessBridge$1,\
OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
SRC:=$(ACCESSBRIDGE_SRCDIR),\
INCLUDE_FILES:=AccessBridgeJavaVMInstance.cpp AccessBridgeMessageQueue.cpp \
AccessBridgeMessages.cpp AccessBridgeWindowsEntryPoints.cpp \
WinAccessBridge.cpp AccessBridgeDebug.cpp \
AccessBridgeEventHandler.cpp,\
LANG:=C++,\
OPTIMIZATION:=LOW,\
CFLAGS:=$(filter-out -MD,$(CFLAGS_JDKLIB)) -MT \
-DACCESSBRIDGE_ARCH_$3,\
LDFLAGS:=$(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
winspool.lib comdlg32.lib advapi32.lib shell32.lib \
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
-subsystem:windows -machine:$2 \
-def:$(ACCESSBRIDGE_SRCDIR)/WinAccessBridge.DEF,\
VERSIONINFO_RESOURCE:=$(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc,\
RC_FLAGS:=$(RC_FLAGS),\
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libwindowsaccessbridge$1,\
DEBUG_SYMBOLS:=true)
BUILD_LIBRARIES += $$(BUILD_JAWTACCESSBRIDGE$1) $$(BUILD_JAVAACCESSBRIDGE$1) \
$$(BUILD_WINDOWSACCESSBRIDGE$1)
endef
ifeq ($(OPENJDK_TARGET_CPU_BITS),32)
$(eval $(call SetupAccessBridge,-32,I386,32))
$(eval $(call SetupAccessBridge,,I386,LEGACY))
else
$(eval $(call SetupAccessBridge,-64,X64,64))
endif
endif
endif
########################################################################################## ##########################################################################################
all: $(COPY_FILES) $(BUILD_LIBRARIES) all: $(COPY_FILES) $(BUILD_LIBRARIES)
......
...@@ -42,7 +42,7 @@ H_TARGET_FILES =$(INCLUDEDIR)/jdwpTransport.h \ ...@@ -42,7 +42,7 @@ H_TARGET_FILES =$(INCLUDEDIR)/jdwpTransport.h \
$(INCLUDEDIR)/jvmticmlr.h \ $(INCLUDEDIR)/jvmticmlr.h \
$(INCLUDEDIR)/classfile_constants.h \ $(INCLUDEDIR)/classfile_constants.h \
$(INCLUDEDIR)/jawt.h \ $(INCLUDEDIR)/jawt.h \
$(OPENJDK_TARGET_OS_INCLUDE)/jni_md.h \ $(OPENJDK_TARGET_OS_INCLUDE)/jni_md.h \
$(OPENJDK_TARGET_OS_INCLUDE)/jawt_md.h $(OPENJDK_TARGET_OS_INCLUDE)/jawt_md.h
$(INCLUDEDIR)/%.h: $(JDK_TOPDIR)/src/share/javavm/export/%.h $(INCLUDEDIR)/%.h: $(JDK_TOPDIR)/src/share/javavm/export/%.h
...@@ -59,6 +59,27 @@ COPY_FILES = $(H_TARGET_FILES) ...@@ -59,6 +59,27 @@ COPY_FILES = $(H_TARGET_FILES)
########################################################################################## ##########################################################################################
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
COPY_FILES += $(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCallbacks.h \
$(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCalls.h \
$(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgePackages.h \
$(OPENJDK_TARGET_OS_INCLUDE)/bridge/AccessBridgeCalls.c \
$(JDK_OUTPUTDIR)/lib/accessibility.properties
$(OPENJDK_TARGET_OS_INCLUDE)/bridge/%: \
$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/%
$(install-file)
$(JDK_OUTPUTDIR)/lib/accessibility.properties: \
$(JDK_TOPDIR)/src/closed/windows/native/sun/bridge/accessibility.properties
$(install-file)
endif
endif
##########################################################################################
LIBDIR = $(JDK_OUTPUTDIR)/lib LIBDIR = $(JDK_OUTPUTDIR)/lib
SERVICETAG_LIBDIR = $(LIBDIR)/servicetag SERVICETAG_LIBDIR = $(LIBDIR)/servicetag
...@@ -267,10 +288,12 @@ endif ...@@ -267,10 +288,12 @@ endif
ifeq ($(OPENJDK_TARGET_OS),windows) ifeq ($(OPENJDK_TARGET_OS),windows)
MSVCR_TARGET := $(JDK_OUTPUTDIR)/bin/$(notdir $(MSVCR_DLL)) MSVCR_TARGET := $(JDK_OUTPUTDIR)/bin/$(notdir $(MSVCR_DLL))
# Chmod to avoid permission issues if bundles are unpacked on unix platforms.
$(MSVCR_TARGET): $(MSVCR_DLL) $(MSVCR_TARGET): $(MSVCR_DLL)
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(RM) $@ $(RM) $@
$(CP) $< $@ $(CP) $< $@
$(CHMOD) a+rx $@
COPY_FILES += $(MSVCR_TARGET) COPY_FILES += $(MSVCR_TARGET)
endif endif
...@@ -317,7 +340,7 @@ ifeq ($(OPENJDK_TARGET_CPU_BITS),32) ...@@ -317,7 +340,7 @@ ifeq ($(OPENJDK_TARGET_CPU_BITS),32)
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(RM) $(JVMCFG) $(RM) $(JVMCFG)
$(PRINTF) "-client KNOWN\n">$(JVMCFG) $(PRINTF) "-client KNOWN\n">$(JVMCFG)
$(PRINTF) "-server IGNORE\n">>$(JVMCFG) $(PRINTF) "-server ALIASED_TO -client\n">>$(JVMCFG)
$(PRINTF) "-hotspot ALIASED_TO -client\n">>$(JVMCFG) $(PRINTF) "-hotspot ALIASED_TO -client\n">>$(JVMCFG)
$(PRINTF) "-classic WARN\n">>$(JVMCFG) $(PRINTF) "-classic WARN\n">>$(JVMCFG)
$(PRINTF) "-native ERROR\n">>$(JVMCFG) $(PRINTF) "-native ERROR\n">>$(JVMCFG)
......
...@@ -141,6 +141,7 @@ RT_JAR_EXCLUDES := \ ...@@ -141,6 +141,7 @@ RT_JAR_EXCLUDES := \
com/sun/crypto/provider \ com/sun/crypto/provider \
com/sun/istack/internal/tools \ com/sun/istack/internal/tools \
com/sun/jarsigner \ com/sun/jarsigner \
com/sun/java/accessibility \
com/sun/javadoc \ com/sun/javadoc \
com/sun/jdi \ com/sun/jdi \
com/sun/net/ssl/internal/ssl \ com/sun/net/ssl/internal/ssl \
...@@ -941,6 +942,47 @@ JARS+=$(IMAGES_OUTPUTDIR)/src.zip ...@@ -941,6 +942,47 @@ JARS+=$(IMAGES_OUTPUTDIR)/src.zip
########################################################################################## ##########################################################################################
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
$(eval $(call SetupArchive,BUILD_JACCESS_JAR,,\
SRCS:=$(JDK_OUTPUTDIR)/classes,\
INCLUDES:=com/sun/java/accessibility/util,\
JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar,\
SKIP_METAINF:=true))
JARS += $(IMAGES_OUTPUTDIR)/lib/ext/jaccess.jar
ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
$(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_32_JAR,,\
SRCS:=$(JDK_OUTPUTDIR)/classes_ab/32bit $(JDK_OUTPUTDIR)/classes,\
INCLUDES:=com/sun/java/accessibility,\
JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-32.jar,\
SKIP_METAINF:=true))
$(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_LEGACY_JAR,,\
SRCS:=$(JDK_OUTPUTDIR)/classes_ab/legacy $(JDK_OUTPUTDIR)/classes,\
INCLUDES:=com/sun/java/accessibility,\
JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/access-bridge.jar,\
SKIP_METAINF:=true))
JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-32.jar \
$(IMAGES_OUTPUTDIR)/lib/ext/access-bridge.jar
else
$(eval $(call SetupArchive,BUILD_ACCESSBRIDGE_64_JAR,,\
SRCS:=$(JDK_OUTPUTDIR)/classes_ab/64bit $(JDK_OUTPUTDIR)/classes,\
INCLUDES:=com/sun/java/accessibility,\
EXCLUDES:=com/sun/java/accessibility/util/java,\
JAR:=$(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar,\
SKIP_METAINF:=true))
JARS += $(IMAGES_OUTPUTDIR)/lib/ext/access-bridge-64.jar
endif
endif
endif
##########################################################################################
# #
# This is an empty jar (only contains manifest) and fits poorly into framework... # This is an empty jar (only contains manifest) and fits poorly into framework...
# create simple rule instead # create simple rule instead
......
...@@ -190,3 +190,36 @@ $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java : $(BUILD_GENSRC_SOL_EX ...@@ -190,3 +190,36 @@ $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/SolarisConstants.java : $(BUILD_GENSRC_SOL_EX
endif endif
##########################################################################################
ifndef OPENJDK
ifeq ($(OPENJDK_TARGET_OS), windows)
AB_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc_ab
AB_SRC_DIR := $(JDK_TOPDIR)/src/closed/windows/classes/com/sun/java/accessibility
ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
$(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java: \
$(AB_SRC_DIR)/32bit/AccessBridge.java
$(install-file)
$(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java: \
$(AB_SRC_DIR)/legacy/AccessBridge.java
$(install-file)
GENSRC_MISC += $(AB_GENSRC_DIR)/32bit/com/sun/java/accessibility/AccessBridge.java \
$(AB_GENSRC_DIR)/legacy/com/sun/java/accessibility/AccessBridge.java
else
$(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java: \
$(AB_SRC_DIR)/64bit/AccessBridge.java
$(install-file)
GENSRC_MISC += $(AB_GENSRC_DIR)/64bit/com/sun/java/accessibility/AccessBridge.java
endif
endif
endif
##########################################################################################
\ No newline at end of file
...@@ -68,7 +68,7 @@ BEANS_SRC = $(BEANS:%=$(JDK_TOPDIR)/src/share/classes/javax/swing/%.java) \ ...@@ -68,7 +68,7 @@ BEANS_SRC = $(BEANS:%=$(JDK_TOPDIR)/src/share/classes/javax/swing/%.java) \
# Dummy variable so far, in the old build system it was false by default # Dummy variable so far, in the old build system it was false by default
SWINGBEAN_DEBUG_FLAG = false SWINGBEAN_DEBUG_FLAG = false
# GenDocletBeanInfo is compiled in Tools.gmk and picks up from $(JDK_OUTPUTDIR)/btclasses # GenDocletBeanInfo is compiled in Tools.gmk and picks up from $(JDK_OUTPUTDIR)/btclasses
$(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo: $(BEANS_SRC) $(JDK_OUTPUTDIR)/gensrc/javax/swing/SwingBeanInfoBase.java $(JDK_OUTPUTDIR)/gensrc/sun/swing/BeanInfoUtils.java $(BUILD_TOOLS) $(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo: $(BEANS_SRC) $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/SwingBeanInfoBase.java $(JDK_OUTPUTDIR)/gensrc/sun/swing/BeanInfoUtils.java $(BUILD_TOOLS)
$(ECHO) Generating beaninfo $(ECHO) Generating beaninfo
$(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing $(MKDIR) -p $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing
$(JAVA) -Djava.awt.headless=true -jar $(JAVADOC_JARS) -doclet GenDocletBeanInfo \ $(JAVA) -Djava.awt.headless=true -jar $(JAVADOC_JARS) -doclet GenDocletBeanInfo \
...@@ -84,7 +84,7 @@ $(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo: $(BEANS_SRC) $(JDK_OU ...@@ -84,7 +84,7 @@ $(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo: $(BEANS_SRC) $(JDK_OU
# This file is the part of dt.jar # This file is the part of dt.jar
# For some reason it is under $(JDK_TOPDIR)/make/tools/swing-beans/javax/swing # For some reason it is under $(JDK_TOPDIR)/make/tools/swing-beans/javax/swing
# Should it be moved under $(JDK_TOPDIR)/src/share/classes/javax/swing instead? # Should it be moved under $(JDK_TOPDIR)/src/share/classes/javax/swing instead?
$(JDK_OUTPUTDIR)/gensrc/javax/swing/SwingBeanInfoBase.java: $(DOCLETSRC_DIR)/javax/swing/SwingBeanInfoBase.java $(JDK_OUTPUTDIR)/gensrc_no_srczip/javax/swing/SwingBeanInfoBase.java: $(DOCLETSRC_DIR)/javax/swing/SwingBeanInfoBase.java
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(CP) $< $@ $(CP) $< $@
......
...@@ -23,84 +23,95 @@ ...@@ -23,84 +23,95 @@
# questions. # questions.
# #
# This file is responsible for extracting the x11 native struct offsets to # This file is responsible for extracting the x11 native struct offsets to
# the xawt Java library. This is done by compiling and running a native # the xawt Java library. The tool needs to be run on the os/arch that
# binary, which dumps output to a text file. The offsets differ on 32 and 64 # will host the final jvm, thus the tool cannot be used when cross compiling.
# bit systems, so care must be taken here.
# To enable cross compiling, the two versions of the generated offset file,
# sizes.32 and sizes.64 are committed into the source code repository.
# These are the ones used.
# Note: Some of the more complex logic here is most likely not needed anymore. # However when not cross compiling, the offset generator tool is built and
# run, to verify that it still generates the same sizes.32 and sizes.64.
GENSRC_X11WRAPPERS := GENSRC_X11WRAPPERS :=
# Put temporary c-code and executable to calculate offsets here.
# Also put verification offset file here as well.
GENSRC_X11WRAPPERS_TMP := $(JDK_OUTPUTDIR)/gensrc_x11wrappers GENSRC_X11WRAPPERS_TMP := $(JDK_OUTPUTDIR)/gensrc_x11wrappers
GENSRC_X11WRAPPERS_DST := $(JDK_OUTPUTDIR)/gensrc # Put the generated Java classes used to interface X11 from awt here.
GENSRC_X11WRAPPERS_DST := $(JDK_OUTPUTDIR)/gensrc/sun/awt/X11
GENSRC_SIZER_SRC := $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator # The pre-calculated offset file are stored here:
GENSRC_SIZER_DIR := $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator
# Normal case is to generate version according to target bits
GENSRC_SIZES := sizes.$(OPENJDK_TARGET_CPU_BITS)
# Normal case is to generate only according to target bits
GENSRC_X11_VERSION := $(OPENJDK_TARGET_CPU_BITS)
ifeq ($(OPENJDK_TARGET_CPU_BITS), 64) ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
ifneq ($(OPENJDK_TARGET_OS), linux) ifneq ($(OPENJDK_TARGET_OS), linux)
# On all 64-bit systems except Linux, generate both 32 and 64 bit versions # On all 64-bit systems except Linux, generate both 32 and 64 bit versions
GENSRC_SIZES := sizes.32 sizes.64 GENSRC_X11_VERSION := 32 64
endif endif
else else
ifeq ($(OPENJDK_TARGET_OS), solaris) ifeq ($(OPENJDK_TARGET_OS), solaris)
# As a special case, solaris 32-bit also generates the 64-bit version # As a special case, solaris 32-bit also generates the 64-bit version
GENSRC_SIZES := sizes.32 sizes.64 GENSRC_X11_VERSION := 32 64
endif endif
endif endif
########################################################################################## GENSRC_X11_SIZES_USED := $(addprefix $(GENSRC_X11WRAPPERS_TMP)/sizes.,$(GENSRC_X11_VERSION))
# Copy only the sizes.* files that are actually needed. WrapperGenerator picks up any it finds from the
# file prefix it is given so those not needed need to be hidden.
$(GENSRC_X11WRAPPERS_TMP)/sizes.%: $(GENSRC_SIZER_DIR)/sizes.%
$(MKDIR) -p $(@D)
$(RM) '$@'
$(SORT) $< > $@
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c : $(GENSRC_SIZER_SRC)/xlibtypes.txt $(BUILD_TOOLS) # Run the tool on the offset files copied from the source repository to generate several Java classes
# used in awt.
$(JDK_OUTPUTDIR)/gensrc/_the.generated.x11 : $(GENSRC_X11_SIZES_USED) $(BUILD_TOOLS)
$(MKDIR) -p $(GENSRC_X11WRAPPERS_DST)
$(TOOL_WRAPPERGENERATOR) $(GENSRC_X11WRAPPERS_DST) $(GENSRC_SIZER_DIR)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizes
$(TOUCH) $@
GENSRC_X11WRAPPERS += $(JDK_OUTPUTDIR)/gensrc/_the.generated.x11
ifneq ($(COMPILE_TYPE),cross)
# This is not a cross compile, regenerate the offset file, so that we
# can compare it with the version in the source code repository.
# Generate the C code for the program that will output the offset file.
$(GENSRC_X11WRAPPERS_TMP)/sizer.%.c : $(GENSRC_SIZER_DIR)/xlibtypes.txt $(BUILD_TOOLS)
$(ECHO) "Generating X11 wrapper ($*-bit version)" $(ECHO) "Generating X11 wrapper ($*-bit version)"
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(RM) $@ $(TOOL_WRAPPERGENERATOR) $(@D) $(GENSRC_SIZER_DIR)/xlibtypes.txt "sizer" $*
$(TOOL_WRAPPERGENERATOR) $(@D) $< "sizer" $*
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.exe : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c # Compile the C code into an executable.
$(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe : $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(RM) $@ $@.tmp (cd $(@D) && $(CC) -m$* -o $@ $< \
(cd $(@D) && $(BUILD_CC) -m$* -o $@.tmp $< \
$(X_CFLAGS) \ $(X_CFLAGS) \
$(X_LIBS) \ $(X_LIBS) \
-I$(JDK_OUTPUTDIR)/include \ -I$(JDK_OUTPUTDIR)/include \
-I$(JDK_TOPDIR)/src/share/javavm/export \ -I$(JDK_TOPDIR)/src/share/javavm/export \
-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \ -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \
-I$(JDK_TOPDIR)//src/share/native/common \ -I$(JDK_TOPDIR)/src/share/native/common \
-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \ -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \
-I$(JDK_TOPDIR)/src/solaris/native/sun/awt \ -I$(JDK_TOPDIR)/src/solaris/native/sun/awt \
-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \ -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils -lc) -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils -lc)
$(MV) $@.tmp $@
# Run the generated sizer binary to create the sizes text file .PRECIOUS: $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe $(GENSRC_X11WRAPPERS_TMP)/sizer.%.c
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.% : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.exe
$(MKDIR) -p $(@D) # Run the executable create the offset file and check that it is identical
$(RM) $@ $@.tmp # to the offset file in the source code repository.
$< > $@.tmp $(GENSRC_X11WRAPPERS_TMP)/sizes.%.verification : $(GENSRC_X11WRAPPERS_TMP)/sizer.%.exe
$(MV) $@.tmp $@
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-x86)
# On solaris-x86 we also need to create the 64-bit version, but we can't run a 64-bit binary
# As a workaround, copy this from a pre-generated file.
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 : $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator/sizes.64-solaris-i386
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(RM) $@ $(GENSRC_X11WRAPPERS_TMP)/sizer.$*.exe | $(SORT) > $@.tmp
$(CP) $< $@ $(ECHO) Verifying $(GENSRC_X11WRAPPERS_TMP)/sizes.$*.verification.tmp to $(GENSRC_X11WRAPPERS_TMP)/sizes.$*
endif $(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizes.$*.verification.tmp $(GENSRC_X11WRAPPERS_TMP)/sizes.$*
mv $@.tmp $@
$(GENSRC_X11WRAPPERS_DST)/_the.generated.x11 : $(foreach S,$(GENSRC_SIZES),$(GENSRC_X11WRAPPERS_TMP)/sizer/$(S)) $(BUILD_TOOLS) GENSRC_X11WRAPPERS += $(GENSRC_X11WRAPPERS_TMP)/sizes.$(OPENJDK_TARGET_CPU_BITS).verification
$(RM) $@
$(MKDIR) -p $(@D)/sun/awt/X11
$(TOOL_WRAPPERGENERATOR) $(@D)/sun/awt/X11 $(GENSRC_SIZER_SRC)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-x86_64)
# On solaris-x86_64, as a safety measure, compare the generated file with the checked-in version
$(ECHO) COMPARING $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 and $(GENSRC_SIZER_SRC)/sizes.64-solaris-i386
$(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 $(GENSRC_SIZER_SRC)/sizes.64-solaris-i386
endif endif
$(TOUCH) $@
GENSRC_X11WRAPPERS += $(GENSRC_X11WRAPPERS_DST)/_the.generated.x11
...@@ -142,6 +142,21 @@ public class AquaKeyBindings { ...@@ -142,6 +142,21 @@ public class AquaKeyBindings {
})); }));
} }
LateBoundInputMap getPasswordFieldInputMap() {
return new LateBoundInputMap(new SimpleBinding(getTextFieldInputMap().getBindings()),
// nullify all the bindings that may discover space characters in the text
new SimpleBinding(new String[] {
"alt LEFT", null,
"alt KP_LEFT", null,
"alt RIGHT", null,
"alt KP_RIGHT", null,
"shift alt LEFT", null,
"shift alt KP_LEFT", null,
"shift alt RIGHT", null,
"shift alt KP_RIGHT", null,
}));
}
LateBoundInputMap getMultiLineTextInputMap() { LateBoundInputMap getMultiLineTextInputMap() {
return new LateBoundInputMap(new SimpleBinding(commonTextEditorBindings), new SimpleBinding(new String[] { return new LateBoundInputMap(new SimpleBinding(commonTextEditorBindings), new SimpleBinding(new String[] {
"ENTER", DefaultEditorKit.insertBreakAction, "ENTER", DefaultEditorKit.insertBreakAction,
......
...@@ -697,7 +697,7 @@ public class AquaLookAndFeel extends BasicLookAndFeel { ...@@ -697,7 +697,7 @@ public class AquaLookAndFeel extends BasicLookAndFeel {
"Panel.foreground", black, "Panel.foreground", black,
"Panel.opaque", useOpaqueComponents, "Panel.opaque", useOpaqueComponents,
"PasswordField.focusInputMap", aquaKeyBindings.getTextFieldInputMap(), "PasswordField.focusInputMap", aquaKeyBindings.getPasswordFieldInputMap(),
"PasswordField.font", controlFont, "PasswordField.font", controlFont,
"PasswordField.background", textBackground, "PasswordField.background", textBackground,
"PasswordField.foreground", textForeground, "PasswordField.foreground", textForeground,
......
/* /*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -37,7 +37,6 @@ import sun.awt.image.*; ...@@ -37,7 +37,6 @@ import sun.awt.image.*;
import sun.java2d.*; import sun.java2d.*;
import sun.print.*; import sun.print.*;
import apple.laf.*; import apple.laf.*;
import apple.laf.JRSUIConstants.Widget;
import apple.laf.JRSUIUtils.NineSliceMetricsProvider; import apple.laf.JRSUIUtils.NineSliceMetricsProvider;
abstract class AquaPainter <T extends JRSUIState> { abstract class AquaPainter <T extends JRSUIState> {
...@@ -63,7 +62,7 @@ abstract class AquaPainter <T extends JRSUIState> { ...@@ -63,7 +62,7 @@ abstract class AquaPainter <T extends JRSUIState> {
} }
static <T extends JRSUIState> AquaPainter<T> create(final T state, final NineSliceMetricsProvider metricsProvider) { static <T extends JRSUIState> AquaPainter<T> create(final T state, final NineSliceMetricsProvider metricsProvider) {
return new AquaNineSlicingImagePainter<T>(state, metricsProvider); return new AquaNineSlicingImagePainter<>(state, metricsProvider);
} }
abstract void paint(final Graphics2D g, final T stateToPaint, final Component c); abstract void paint(final Graphics2D g, final T stateToPaint, final Component c);
...@@ -71,7 +70,7 @@ abstract class AquaPainter <T extends JRSUIState> { ...@@ -71,7 +70,7 @@ abstract class AquaPainter <T extends JRSUIState> {
final Rectangle boundsRect = new Rectangle(); final Rectangle boundsRect = new Rectangle();
final JRSUIControl control; final JRSUIControl control;
T state; T state;
public AquaPainter(final JRSUIControl control, final T state) { AquaPainter(final JRSUIControl control, final T state) {
this.control = control; this.control = control;
this.state = state; this.state = state;
} }
...@@ -94,14 +93,14 @@ abstract class AquaPainter <T extends JRSUIState> { ...@@ -94,14 +93,14 @@ abstract class AquaPainter <T extends JRSUIState> {
protected final HashMap<T, RecyclableJRSUISlicedImageControl> slicedControlImages; protected final HashMap<T, RecyclableJRSUISlicedImageControl> slicedControlImages;
protected final NineSliceMetricsProvider metricsProvider; protected final NineSliceMetricsProvider metricsProvider;
public AquaNineSlicingImagePainter(final T state) { AquaNineSlicingImagePainter(final T state) {
this(state, null); this(state, null);
} }
public AquaNineSlicingImagePainter(final T state, final NineSliceMetricsProvider metricsProvider) { AquaNineSlicingImagePainter(final T state, final NineSliceMetricsProvider metricsProvider) {
super(new JRSUIControl(false), state); super(new JRSUIControl(false), state);
this.metricsProvider = metricsProvider; this.metricsProvider = metricsProvider;
slicedControlImages = new HashMap<T, RecyclableJRSUISlicedImageControl>(); slicedControlImages = new HashMap<>();
} }
@Override @Override
...@@ -127,7 +126,7 @@ abstract class AquaPainter <T extends JRSUIState> { ...@@ -127,7 +126,7 @@ abstract class AquaPainter <T extends JRSUIState> {
} }
static class AquaSingleImagePainter<T extends JRSUIState> extends AquaPainter<T> { static class AquaSingleImagePainter<T extends JRSUIState> extends AquaPainter<T> {
public AquaSingleImagePainter(final T state) { AquaSingleImagePainter(final T state) {
super(new JRSUIControl(false), state); super(new JRSUIControl(false), state);
} }
...@@ -137,12 +136,12 @@ abstract class AquaPainter <T extends JRSUIState> { ...@@ -137,12 +136,12 @@ abstract class AquaPainter <T extends JRSUIState> {
} }
static void paintFromSingleCachedImage(final Graphics2D g, final JRSUIControl control, final JRSUIState controlState, final Component c, final Rectangle boundsRect) { static void paintFromSingleCachedImage(final Graphics2D g, final JRSUIControl control, final JRSUIState controlState, final Component c, final Rectangle boundsRect) {
Rectangle clipRect = g.getClipBounds(); final Rectangle clipRect = g.getClipBounds();
Rectangle intersection = boundsRect.intersection(clipRect); final Rectangle intersection = boundsRect.intersection(clipRect);
if (intersection.width <= 0 || intersection.height <= 0) return; if (intersection.width <= 0 || intersection.height <= 0) return;
int imgX1 = intersection.x - boundsRect.x; final int imgX1 = intersection.x - boundsRect.x;
int imgY1 = intersection.y - boundsRect.y; final int imgY1 = intersection.y - boundsRect.y;
final GraphicsConfiguration config = g.getDeviceConfiguration(); final GraphicsConfiguration config = g.getDeviceConfiguration();
final ImageCache cache = ImageCache.getInstance(); final ImageCache cache = ImageCache.getInstance();
...@@ -150,19 +149,14 @@ abstract class AquaPainter <T extends JRSUIState> { ...@@ -150,19 +149,14 @@ abstract class AquaPainter <T extends JRSUIState> {
if (image == null) { if (image == null) {
image = new BufferedImage(boundsRect.width, boundsRect.height, BufferedImage.TYPE_INT_ARGB_PRE); image = new BufferedImage(boundsRect.width, boundsRect.height, BufferedImage.TYPE_INT_ARGB_PRE);
cache.setImage(image, config, boundsRect.width, boundsRect.height, controlState); cache.setImage(image, config, boundsRect.width, boundsRect.height, controlState);
} else { final WritableRaster raster = image.getRaster();
g.drawImage(image, intersection.x, intersection.y, intersection.x + intersection.width, intersection.y + intersection.height, final DataBufferInt buffer = (DataBufferInt)raster.getDataBuffer();
imgX1, imgY1, imgX1 + intersection.width, imgY1 + intersection.height, null);
return;
}
final WritableRaster raster = image.getRaster(); control.set(controlState);
final DataBufferInt buffer = (DataBufferInt)raster.getDataBuffer(); control.paint(SunWritableRaster.stealData(buffer, 0),
image.getWidth(), image.getHeight(), 0, 0, boundsRect.width, boundsRect.height);
control.set(controlState); SunWritableRaster.markDirty(buffer);
control.paint(SunWritableRaster.stealData(buffer, 0), }
image.getWidth(), image.getHeight(), 0, 0, boundsRect.width, boundsRect.height);
SunWritableRaster.markDirty(buffer);
g.drawImage(image, intersection.x, intersection.y, intersection.x + intersection.width, intersection.y + intersection.height, g.drawImage(image, intersection.x, intersection.y, intersection.x + intersection.width, intersection.y + intersection.height,
imgX1, imgY1, imgX1 + intersection.width, imgY1 + intersection.height, null); imgX1, imgY1, imgX1 + intersection.width, imgY1 + intersection.height, null);
...@@ -173,7 +167,7 @@ abstract class AquaPainter <T extends JRSUIState> { ...@@ -173,7 +167,7 @@ abstract class AquaPainter <T extends JRSUIState> {
final JRSUIControl control; final JRSUIControl control;
final JRSUIState state; final JRSUIState state;
public RecyclableJRSUISlicedImageControl(final JRSUIControl control, final JRSUIState state, final NineSliceMetrics metrics) { RecyclableJRSUISlicedImageControl(final JRSUIControl control, final JRSUIState state, final NineSliceMetrics metrics) {
super(metrics); super(metrics);
this.control = control; this.control = control;
this.state = state; this.state = state;
......
/* /*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -30,6 +30,7 @@ import java.lang.ref.*; ...@@ -30,6 +30,7 @@ import java.lang.ref.*;
import java.util.*; import java.util.*;
import java.util.concurrent.locks.*; import java.util.concurrent.locks.*;
import apple.laf.JRSUIConstants;
import apple.laf.JRSUIState; import apple.laf.JRSUIState;
import com.apple.laf.AquaUtils.RecyclableSingleton; import com.apple.laf.AquaUtils.RecyclableSingleton;
...@@ -38,9 +39,9 @@ import com.apple.laf.AquaUtils.RecyclableSingleton; ...@@ -38,9 +39,9 @@ import com.apple.laf.AquaUtils.RecyclableSingleton;
* SoftReferences so they will be dropped by the GC if heap memory gets tight. When our size hits max pixel count least * SoftReferences so they will be dropped by the GC if heap memory gets tight. When our size hits max pixel count least
* recently requested images are removed first. * recently requested images are removed first.
*/ */
class ImageCache { final class ImageCache {
// Ordered Map keyed by args hash, ordered by most recent accessed entry. // Ordered Map keyed by args hash, ordered by most recent accessed entry.
private final LinkedHashMap<Integer, PixelCountSoftReference> map = new LinkedHashMap<Integer, PixelCountSoftReference>(16, 0.75f, true); private final LinkedHashMap<Integer, PixelCountSoftReference> map = new LinkedHashMap<>(16, 0.75f, true);
// Maximum number of pixels to cache, this is used if maxCount // Maximum number of pixels to cache, this is used if maxCount
private final int maxPixelCount; private final int maxPixelCount;
...@@ -50,7 +51,7 @@ class ImageCache { ...@@ -50,7 +51,7 @@ class ImageCache {
// Lock for concurrent access to map // Lock for concurrent access to map
private final ReadWriteLock lock = new ReentrantReadWriteLock(); private final ReadWriteLock lock = new ReentrantReadWriteLock();
// Reference queue for tracking lost softreferences to images in the cache // Reference queue for tracking lost softreferences to images in the cache
private final ReferenceQueue<Image> referenceQueue = new ReferenceQueue<Image>(); private final ReferenceQueue<Image> referenceQueue = new ReferenceQueue<>();
// Singleton Instance // Singleton Instance
private static final RecyclableSingleton<ImageCache> instance = new RecyclableSingleton<ImageCache>() { private static final RecyclableSingleton<ImageCache> instance = new RecyclableSingleton<ImageCache>() {
...@@ -63,11 +64,11 @@ class ImageCache { ...@@ -63,11 +64,11 @@ class ImageCache {
return instance.get(); return instance.get();
} }
public ImageCache(final int maxPixelCount) { ImageCache(final int maxPixelCount) {
this.maxPixelCount = maxPixelCount; this.maxPixelCount = maxPixelCount;
} }
public ImageCache() { ImageCache() {
this((8 * 1024 * 1024) / 4); // 8Mb of pixels this((8 * 1024 * 1024) / 4); // 8Mb of pixels
} }
...@@ -99,10 +100,13 @@ class ImageCache { ...@@ -99,10 +100,13 @@ class ImageCache {
* @param config The graphics configuration, needed if cached image is a Volatile Image. Used as part of cache key * @param config The graphics configuration, needed if cached image is a Volatile Image. Used as part of cache key
* @param w The image width, used as part of cache key * @param w The image width, used as part of cache key
* @param h The image height, used as part of cache key * @param h The image height, used as part of cache key
* @param args Other arguments to use as part of the cache key * @return true if the image could be cached, false otherwise.
* @return true if the image could be cached or false if the image is too big
*/ */
public boolean setImage(final Image image, final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) { public boolean setImage(final Image image, final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) {
if (state.is(JRSUIConstants.Animating.YES)) {
return false;
}
final int hash = hash(config, w, h, state); final int hash = hash(config, w, h, state);
lock.writeLock().lock(); lock.writeLock().lock();
...@@ -167,7 +171,7 @@ class ImageCache { ...@@ -167,7 +171,7 @@ class ImageCache {
private final int h; private final int h;
private final JRSUIState state; private final JRSUIState state;
public PixelCountSoftReference(final Image referent, final ReferenceQueue<? super Image> q, final int pixelCount, final int hash, final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) { PixelCountSoftReference(final Image referent, final ReferenceQueue<? super Image> q, final int pixelCount, final int hash, final GraphicsConfiguration config, final int w, final int h, final JRSUIState state) {
super(referent, q); super(referent, q);
this.pixelCount = pixelCount; this.pixelCount = pixelCount;
this.hash = hash; this.hash = hash;
......
...@@ -30,6 +30,7 @@ import java.awt.GraphicsDevice; ...@@ -30,6 +30,7 @@ import java.awt.GraphicsDevice;
import java.awt.Window; import java.awt.Window;
import java.awt.AWTPermission; import java.awt.AWTPermission;
import java.awt.DisplayMode; import java.awt.DisplayMode;
import java.util.Objects;
import sun.java2d.opengl.CGLGraphicsConfig; import sun.java2d.opengl.CGLGraphicsConfig;
...@@ -122,12 +123,12 @@ public final class CGraphicsDevice extends GraphicsDevice { ...@@ -122,12 +123,12 @@ public final class CGraphicsDevice extends GraphicsDevice {
boolean fsSupported = isFullScreenSupported(); boolean fsSupported = isFullScreenSupported();
if (fsSupported && old != null) { if (fsSupported && old != null) {
// enter windowed mode (and restore original display mode) // restore original display mode and enter windowed mode.
exitFullScreenExclusive(old);
if (originalMode != null) { if (originalMode != null) {
setDisplayMode(originalMode); setDisplayMode(originalMode);
originalMode = null; originalMode = null;
} }
exitFullScreenExclusive(old);
} }
super.setFullScreenWindow(w); super.setFullScreenWindow(w);
...@@ -186,13 +187,20 @@ public final class CGraphicsDevice extends GraphicsDevice { ...@@ -186,13 +187,20 @@ public final class CGraphicsDevice extends GraphicsDevice {
} }
@Override @Override
public void setDisplayMode(DisplayMode dm) { public void setDisplayMode(final DisplayMode dm) {
if (dm == null) { if (dm == null) {
throw new IllegalArgumentException("Invalid display mode"); throw new IllegalArgumentException("Invalid display mode");
} }
nativeSetDisplayMode(displayID, dm.getWidth(), dm.getHeight(), dm.getBitDepth(), dm.getRefreshRate()); if (!Objects.equals(dm, getDisplayMode())) {
if (isFullScreenSupported() && getFullScreenWindow() != null) { final Window w = getFullScreenWindow();
getFullScreenWindow().setSize(dm.getWidth(), dm.getHeight()); if (w != null) {
exitFullScreenExclusive(w);
}
nativeSetDisplayMode(displayID, dm.getWidth(), dm.getHeight(),
dm.getBitDepth(), dm.getRefreshRate());
if (isFullScreenSupported() && w != null) {
enterFullScreenExclusive(w);
}
} }
} }
......
...@@ -1226,7 +1226,7 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent> ...@@ -1226,7 +1226,7 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
sendEventToDelegate(e); sendEventToDelegate(e);
} }
private void sendEventToDelegate(final AWTEvent e) { protected void sendEventToDelegate(final AWTEvent e) {
synchronized (getDelegateLock()) { synchronized (getDelegateLock()) {
if (getDelegate() == null || !isShowing() || !isEnabled()) { if (getDelegate() == null || !isShowing() || !isEnabled()) {
return; return;
......
...@@ -29,6 +29,7 @@ import javax.swing.*; ...@@ -29,6 +29,7 @@ import javax.swing.*;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import java.awt.*; import java.awt.*;
import java.awt.event.MouseWheelEvent;
import java.awt.peer.ScrollPanePeer; import java.awt.peer.ScrollPanePeer;
import java.util.List; import java.util.List;
...@@ -51,6 +52,21 @@ final class LWScrollPanePeer extends LWContainerPeer<ScrollPane, JScrollPane> ...@@ -51,6 +52,21 @@ final class LWScrollPanePeer extends LWContainerPeer<ScrollPane, JScrollPane>
return sp; return sp;
} }
@Override
public void handleEvent(AWTEvent e) {
if (e instanceof MouseWheelEvent) {
MouseWheelEvent wheelEvent = (MouseWheelEvent) e;
//java.awt.ScrollPane consumes the event
// in case isWheelScrollingEnabled() is true,
// forcibly send the consumed event to the delegate
if (getTarget().isWheelScrollingEnabled() && wheelEvent.isConsumed()) {
sendEventToDelegate(wheelEvent);
}
} else {
super.handleEvent(e);
}
}
@Override @Override
public void stateChanged(final ChangeEvent e) { public void stateChanged(final ChangeEvent e) {
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
......
...@@ -34,7 +34,7 @@ import java.awt.event.ActionListener; ...@@ -34,7 +34,7 @@ import java.awt.event.ActionListener;
import java.awt.event.FocusEvent; import java.awt.event.FocusEvent;
import java.awt.peer.TextFieldPeer; import java.awt.peer.TextFieldPeer;
import javax.swing.JPasswordField; import javax.swing.*;
import javax.swing.text.JTextComponent; import javax.swing.text.JTextComponent;
final class LWTextFieldPeer final class LWTextFieldPeer
...@@ -48,7 +48,7 @@ final class LWTextFieldPeer ...@@ -48,7 +48,7 @@ final class LWTextFieldPeer
@Override @Override
protected JPasswordField createDelegate() { protected JPasswordField createDelegate() {
return new JTextAreaDelegate(); return new JPasswordFieldDelegate();
} }
@Override @Override
...@@ -69,9 +69,18 @@ final class LWTextFieldPeer ...@@ -69,9 +69,18 @@ final class LWTextFieldPeer
public void setEchoChar(final char echoChar) { public void setEchoChar(final char echoChar) {
synchronized (getDelegateLock()) { synchronized (getDelegateLock()) {
getDelegate().setEchoChar(echoChar); getDelegate().setEchoChar(echoChar);
getDelegate().putClientProperty("JPasswordField.cutCopyAllowed", final boolean cutCopyAllowed;
getDelegate().echoCharIsSet() final String focusInputMapKey;
? Boolean.FALSE : Boolean.TRUE); if (echoChar != 0) {
cutCopyAllowed = false;
focusInputMapKey = "PasswordField.focusInputMap";
} else {
cutCopyAllowed = true;
focusInputMapKey = "TextField.focusInputMap";
}
getDelegate().putClientProperty("JPasswordField.cutCopyAllowed", cutCopyAllowed);
InputMap inputMap = (InputMap) UIManager.get(focusInputMapKey);
SwingUtilities.replaceUIInputMap(getDelegate(), JComponent.WHEN_FOCUSED, inputMap);
} }
} }
...@@ -106,11 +115,11 @@ final class LWTextFieldPeer ...@@ -106,11 +115,11 @@ final class LWTextFieldPeer
super.handleJavaFocusEvent(e); super.handleJavaFocusEvent(e);
} }
private final class JTextAreaDelegate extends JPasswordField { private final class JPasswordFieldDelegate extends JPasswordField {
// Empty non private constructor was added because access to this // Empty non private constructor was added because access to this
// class shouldn't be emulated by a synthetic accessor method. // class shouldn't be emulated by a synthetic accessor method.
JTextAreaDelegate() { JPasswordFieldDelegate() {
super(); super();
} }
......
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -539,7 +539,7 @@ public abstract class LWToolkit extends SunToolkit implements Runnable { ...@@ -539,7 +539,7 @@ public abstract class LWToolkit extends SunToolkit implements Runnable {
@Override @Override
public void ungrab(Window w) { public void ungrab(Window w) {
if (w.getPeer() != null) { if (w.getPeer() != null) {
((LWWindowPeer)w.getPeer()).ungrab(); ((LWWindowPeer)w.getPeer()).ungrab(false);
} }
} }
} }
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -53,7 +53,7 @@ public class LWWindowPeer ...@@ -53,7 +53,7 @@ public class LWWindowPeer
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.lwawt.focus.LWWindowPeer"); private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.lwawt.focus.LWWindowPeer");
private PlatformWindow platformWindow; private final PlatformWindow platformWindow;
// Window bounds reported by the native system (as opposed to // Window bounds reported by the native system (as opposed to
// regular bounds inherited from LWComponentPeer which are // regular bounds inherited from LWComponentPeer which are
...@@ -554,12 +554,14 @@ public class LWWindowPeer ...@@ -554,12 +554,14 @@ public class LWWindowPeer
/** /**
* Called by the {@code PlatformWindow} when this window is moved/resized by * Called by the {@code PlatformWindow} when this window is moved/resized by
* user. There's no notifyReshape() in LWComponentPeer as the only * user or window insets are changed. There's no notifyReshape() in
* components which could be resized by user are top-level windows. * 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) { public final void notifyReshape(int x, int y, int w, int h) {
final boolean moved; final boolean moved;
final boolean resized; final boolean resized;
final boolean invalid = updateInsets(platformWindow.getInsets());
synchronized (getStateLock()) { synchronized (getStateLock()) {
moved = (x != sysX) || (y != sysY); moved = (x != sysX) || (y != sysY);
resized = (w != sysW) || (h != sysH); resized = (w != sysW) || (h != sysH);
...@@ -570,7 +572,7 @@ public class LWWindowPeer ...@@ -570,7 +572,7 @@ public class LWWindowPeer
} }
// Check if anything changed // Check if anything changed
if (!moved && !resized) { if (!moved && !resized && !invalid) {
return; return;
} }
// First, update peer's bounds // First, update peer's bounds
...@@ -584,10 +586,10 @@ public class LWWindowPeer ...@@ -584,10 +586,10 @@ public class LWWindowPeer
} }
// Third, COMPONENT_MOVED/COMPONENT_RESIZED/PAINT events // Third, COMPONENT_MOVED/COMPONENT_RESIZED/PAINT events
if (moved) { if (moved || invalid) {
handleMove(x, y, true); handleMove(x, y, true);
} }
if (resized) { if (resized || invalid) {
handleResize(w, h, true); handleResize(w, h, true);
repaintPeer(); repaintPeer();
} }
...@@ -999,27 +1001,21 @@ public class LWWindowPeer ...@@ -999,27 +1001,21 @@ public class LWWindowPeer
} }
} }
/* /**
* Request the window insets from the delegate and compares it * Request the window insets from the delegate and compares it with the
* with the current one. This method is mostly called by the * current one. This method is mostly called by the delegate, e.g. when the
* delegate, e.g. when the window state is changed and insets * window state is changed and insets should be recalculated.
* should be recalculated. * <p/>
*
* This method may be called on the toolkit thread. * This method may be called on the toolkit thread.
*/ */
public boolean updateInsets(Insets newInsets) { public final boolean updateInsets(final Insets newInsets) {
boolean changed = false;
synchronized (getStateLock()) { synchronized (getStateLock()) {
changed = (insets.equals(newInsets)); if (insets.equals(newInsets)) {
return false;
}
insets = newInsets; insets = newInsets;
} }
return true;
if (changed) {
replaceSurfaceData();
repaintPeer();
}
return changed;
} }
public static LWWindowPeer getWindowUnderCursor() { public static LWWindowPeer getWindowUnderCursor() {
...@@ -1208,13 +1204,19 @@ public class LWWindowPeer ...@@ -1208,13 +1204,19 @@ public class LWWindowPeer
grabbingWindow = this; grabbingWindow = this;
} }
void ungrab() { final void ungrab(boolean doPost) {
if (isGrabbing()) { if (isGrabbing()) {
grabbingWindow = null; grabbingWindow = null;
postEvent(new UngrabEvent(getTarget())); if (doPost) {
postEvent(new UngrabEvent(getTarget()));
}
} }
} }
void ungrab() {
ungrab(true);
}
private boolean isGrabbing() { private boolean isGrabbing() {
return this == grabbingWindow; return this == grabbingWindow;
} }
......
...@@ -273,8 +273,31 @@ public class CDataTransferer extends DataTransferer { ...@@ -273,8 +273,31 @@ public class CDataTransferer extends DataTransferer {
@Override @Override
protected ByteArrayOutputStream convertFileListToBytes(ArrayList<String> fileList) throws IOException { protected ByteArrayOutputStream convertFileListToBytes(ArrayList<String> fileList) throws IOException {
// TODO Auto-generated method stub ByteArrayOutputStream bos = new ByteArrayOutputStream();
return null; for (int i = 0; i < fileList.size(); i++)
{
byte[] bytes = fileList.get(i).getBytes();
bos.write(bytes, 0, bytes.length);
bos.write(0);
}
return bos;
}
@Override
protected boolean isURIListFormat(long format) {
String nat = getNativeForFormat(format);
if (nat == null) {
return false;
}
try {
DataFlavor df = new DataFlavor(nat);
if (df.getPrimaryType().equals("text") && df.getSubType().equals("uri-list")) {
return true;
}
} catch (Exception e) {
// Not a MIME format.
}
return false;
} }
} }
......
...@@ -27,7 +27,6 @@ package sun.lwawt.macosx; ...@@ -27,7 +27,6 @@ package sun.lwawt.macosx;
import java.awt.*; import java.awt.*;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.awt.image.VolatileImage;
import sun.awt.CGraphicsConfig; import sun.awt.CGraphicsConfig;
import sun.awt.CGraphicsEnvironment; import sun.awt.CGraphicsEnvironment;
...@@ -89,29 +88,8 @@ public class CPlatformView extends CFRetainedResource { ...@@ -89,29 +88,8 @@ public class CPlatformView extends CFRetainedResource {
return peer; return peer;
} }
public void enterFullScreenMode(final long nsWindowPtr) { public void enterFullScreenMode() {
CWrapper.NSView.enterFullScreenMode(ptr); CWrapper.NSView.enterFullScreenMode(ptr);
// REMIND: CGLSurfaceData expects top-level's size
// and therefore we need to account insets before
// recreating the surface data
Insets insets = peer.getInsets();
Rectangle screenBounds;
final long screenPtr = CWrapper.NSWindow.screen(nsWindowPtr);
try {
screenBounds = CWrapper.NSScreen.frame(screenPtr).getBounds();
} finally {
CWrapper.NSObject.release(screenPtr);
}
// the move/size notification from the underlying system comes
// but it contains a bounds smaller than the whole screen
// and therefore we need to create the synthetic notifications
peer.notifyReshape(screenBounds.x - insets.left,
screenBounds.y - insets.bottom,
screenBounds.width + insets.left + insets.right,
screenBounds.height + insets.top + insets.bottom);
} }
public void exitFullScreenMode() { public void exitFullScreenMode() {
......
...@@ -38,7 +38,6 @@ import sun.awt.*; ...@@ -38,7 +38,6 @@ import sun.awt.*;
import sun.java2d.SurfaceData; import sun.java2d.SurfaceData;
import sun.java2d.opengl.CGLSurfaceData; import sun.java2d.opengl.CGLSurfaceData;
import sun.lwawt.*; import sun.lwawt.*;
import sun.lwawt.LWWindowPeer.PeerType;
import sun.util.logging.PlatformLogger; import sun.util.logging.PlatformLogger;
import com.apple.laf.*; import com.apple.laf.*;
...@@ -58,7 +57,6 @@ public final class CPlatformWindow extends CFRetainedResource implements Platfor ...@@ -58,7 +57,6 @@ public final class CPlatformWindow extends CFRetainedResource implements Platfor
private static native void nativeRevalidateNSWindowShadow(long nsWindowPtr); private static native void nativeRevalidateNSWindowShadow(long nsWindowPtr);
private static native void nativeSetNSWindowMinimizedIcon(long nsWindowPtr, long nsImage); private static native void nativeSetNSWindowMinimizedIcon(long nsWindowPtr, long nsImage);
private static native void nativeSetNSWindowRepresentedFilename(long nsWindowPtr, String representedFilename); private static native void nativeSetNSWindowRepresentedFilename(long nsWindowPtr, String representedFilename);
private static native void nativeSetNSWindowSecurityWarningPositioning(long nsWindowPtr, double x, double y, float biasX, float biasY);
private static native void nativeSetEnabled(long nsWindowPtr, boolean isEnabled); private static native void nativeSetEnabled(long nsWindowPtr, boolean isEnabled);
private static native void nativeSynthesizeMouseEnteredExitedEvents(); private static native void nativeSynthesizeMouseEnteredExitedEvents();
private static native void nativeDispose(long nsWindowPtr); private static native void nativeDispose(long nsWindowPtr);
...@@ -197,7 +195,8 @@ public final class CPlatformWindow extends CFRetainedResource implements Platfor ...@@ -197,7 +195,8 @@ public final class CPlatformWindow extends CFRetainedResource implements Platfor
// 1) setting native bounds via nativeSetBounds() call // 1) setting native bounds via nativeSetBounds() call
// 2) getting notification from the native level via deliverMoveResizeEvent() // 2) getting notification from the native level via deliverMoveResizeEvent()
private Rectangle nativeBounds = new Rectangle(0, 0, 0, 0); private Rectangle nativeBounds = new Rectangle(0, 0, 0, 0);
private volatile boolean isFullScreenMode = false; private volatile boolean isFullScreenMode;
private boolean isFullScreenAnimationOn;
private Window target; private Window target;
private LWWindowPeer peer; private LWWindowPeer peer;
...@@ -415,8 +414,10 @@ public final class CPlatformWindow extends CFRetainedResource implements Platfor ...@@ -415,8 +414,10 @@ public final class CPlatformWindow extends CFRetainedResource implements Platfor
@Override // PlatformWindow @Override // PlatformWindow
public Insets getInsets() { public Insets getInsets() {
final Insets insets = nativeGetNSWindowInsets(getNSWindowPtr()); if (!isFullScreenMode) {
return insets; return nativeGetNSWindowInsets(getNSWindowPtr());
}
return new Insets(0, 0, 0, 0);
} }
@Override // PlatformWindow @Override // PlatformWindow
...@@ -728,7 +729,19 @@ public final class CPlatformWindow extends CFRetainedResource implements Platfor ...@@ -728,7 +729,19 @@ public final class CPlatformWindow extends CFRetainedResource implements Platfor
@Override @Override
public void enterFullScreenMode() { public void enterFullScreenMode() {
isFullScreenMode = true; isFullScreenMode = true;
contentView.enterFullScreenMode(getNSWindowPtr()); contentView.enterFullScreenMode();
// the move/size notification from the underlying system comes
// but it contains a bounds smaller than the whole screen
// and therefore we need to create the synthetic notifications
Rectangle screenBounds;
final long screenPtr = CWrapper.NSWindow.screen(getNSWindowPtr());
try {
screenBounds = CWrapper.NSScreen.frame(screenPtr).getBounds();
} finally {
CWrapper.NSObject.release(screenPtr);
}
peer.notifyReshape(screenBounds.x, screenBounds.y, screenBounds.width,
screenBounds.height);
} }
@Override @Override
...@@ -875,11 +888,10 @@ public final class CPlatformWindow extends CFRetainedResource implements Platfor ...@@ -875,11 +888,10 @@ public final class CPlatformWindow extends CFRetainedResource implements Platfor
final Rectangle oldB = nativeBounds; final Rectangle oldB = nativeBounds;
nativeBounds = new Rectangle(x, y, width, height); nativeBounds = new Rectangle(x, y, width, height);
peer.notifyReshape(x, y, width, height); peer.notifyReshape(x, y, width, height);
if (byUser && !oldB.getSize().equals(nativeBounds.getSize())) { if ((byUser && !oldB.getSize().equals(nativeBounds.getSize()))
|| isFullScreenAnimationOn) {
flushBuffers(); flushBuffers();
} }
//TODO validateSurface already called from notifyReshape
validateSurface();
} }
private void deliverWindowClosingEvent() { private void deliverWindowClosingEvent() {
...@@ -924,6 +936,10 @@ public final class CPlatformWindow extends CFRetainedResource implements Platfor ...@@ -924,6 +936,10 @@ public final class CPlatformWindow extends CFRetainedResource implements Platfor
return false; return false;
} }
if (blocker instanceof CPrinterDialogPeer) {
return true;
}
CPlatformWindow pWindow = (CPlatformWindow)blocker.getPlatformWindow(); CPlatformWindow pWindow = (CPlatformWindow)blocker.getPlatformWindow();
pWindow.orderAboveSiblings(); pWindow.orderAboveSiblings();
...@@ -975,27 +991,19 @@ public final class CPlatformWindow extends CFRetainedResource implements Platfor ...@@ -975,27 +991,19 @@ public final class CPlatformWindow extends CFRetainedResource implements Platfor
orderAboveSiblings(); orderAboveSiblings();
} }
private void updateDisplay() {
EventQueue.invokeLater(new Runnable() {
public void run() {
validateSurface();
}
});
}
private void updateWindowContent() {
ComponentEvent resizeEvent = new ComponentEvent(target, ComponentEvent.COMPONENT_RESIZED);
SunToolkit.postEvent(SunToolkit.targetToAppContext(target), resizeEvent);
}
private void windowWillEnterFullScreen() { private void windowWillEnterFullScreen() {
updateWindowContent(); isFullScreenAnimationOn = true;
} }
private void windowDidEnterFullScreen() { private void windowDidEnterFullScreen() {
updateDisplay(); isFullScreenAnimationOn = false;
} }
private void windowWillExitFullScreen() { private void windowWillExitFullScreen() {
updateWindowContent(); isFullScreenAnimationOn = true;
}
private void windowDidExitFullScreen() {
isFullScreenAnimationOn = false;
} }
private void windowDidExitFullScreen() {}
} }
...@@ -101,8 +101,7 @@ Java_sun_lwawt_macosx_CPlatformComponent_nativeCreateComponent ...@@ -101,8 +101,7 @@ Java_sun_lwawt_macosx_CPlatformComponent_nativeCreateComponent
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
AWT_ASSERT_APPKIT_THREAD;
CALayer *windowLayer = jlong_to_ptr(windowLayerPtr); CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
surfaceLayers = [[AWTSurfaceLayers alloc] initWithWindowLayer: windowLayer]; surfaceLayers = [[AWTSurfaceLayers alloc] initWithWindowLayer: windowLayer];
CFRetain(surfaceLayers); CFRetain(surfaceLayers);
...@@ -127,7 +126,6 @@ JNF_COCOA_ENTER(env); ...@@ -127,7 +126,6 @@ JNF_COCOA_ENTER(env);
AWTSurfaceLayers *surfaceLayers = OBJC(surfaceLayersPtr); AWTSurfaceLayers *surfaceLayers = OBJC(surfaceLayersPtr);
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
CGRect rect = CGRectMake(x, y, width, height); CGRect rect = CGRectMake(x, y, width, height);
[surfaceLayers setBounds: rect]; [surfaceLayers setBounds: rect];
......
...@@ -1243,8 +1243,7 @@ JNF_COCOA_ENTER(env); ...@@ -1243,8 +1243,7 @@ JNF_COCOA_ENTER(env);
jobject cPlatformView = (*env)->NewGlobalRef(env, obj); jobject cPlatformView = (*env)->NewGlobalRef(env, obj);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
AWT_ASSERT_APPKIT_THREAD;
CALayer *windowLayer = jlong_to_ptr(windowLayerPtr); CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
AWTView *view = [[AWTView alloc] initWithRect:rect AWTView *view = [[AWTView alloc] initWithRect:rect
platformView:cPlatformView platformView:cPlatformView
...@@ -1274,8 +1273,7 @@ JNF_COCOA_ENTER(env); ...@@ -1274,8 +1273,7 @@ JNF_COCOA_ENTER(env);
NSView *view = (NSView *)jlong_to_ptr(viewPtr); NSView *view = (NSView *)jlong_to_ptr(viewPtr);
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
if (toResize) { if (toResize) {
[view setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable]; [view setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
} else { } else {
...@@ -1308,8 +1306,7 @@ JNF_COCOA_ENTER(env); ...@@ -1308,8 +1306,7 @@ JNF_COCOA_ENTER(env);
NSWindow *window = [view window]; NSWindow *window = [view window];
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
AWT_ASSERT_APPKIT_THREAD;
ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue]; ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
}]; }];
...@@ -1336,8 +1333,7 @@ JNF_COCOA_ENTER(env); ...@@ -1336,8 +1333,7 @@ JNF_COCOA_ENTER(env);
NSView *view = (NSView *)jlong_to_ptr(viewPtr); NSView *view = (NSView *)jlong_to_ptr(viewPtr);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
AWT_ASSERT_APPKIT_THREAD;
NSRect viewBounds = [view bounds]; NSRect viewBounds = [view bounds];
NSRect frameInWindow = [view convertRect:viewBounds toView:nil]; NSRect frameInWindow = [view convertRect:viewBounds toView:nil];
rect = [[view window] convertRectToScreen:frameInWindow]; rect = [[view window] convertRectToScreen:frameInWindow];
...@@ -1366,9 +1362,7 @@ JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CPlatformView_nativeIsViewUnder ...@@ -1366,9 +1362,7 @@ JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CPlatformView_nativeIsViewUnder
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSView *nsView = OBJC(viewPtr); NSView *nsView = OBJC(viewPtr);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
AWT_ASSERT_APPKIT_THREAD;
NSPoint ptWindowCoords = [[nsView window] mouseLocationOutsideOfEventStream]; NSPoint ptWindowCoords = [[nsView window] mouseLocationOutsideOfEventStream];
NSPoint ptViewCoords = [nsView convertPoint:ptWindowCoords fromView:nil]; NSPoint ptViewCoords = [nsView convertPoint:ptWindowCoords fromView:nil];
underMouse = [nsView hitTest:ptViewCoords] != nil; underMouse = [nsView hitTest:ptViewCoords] != nil;
......
...@@ -738,14 +738,12 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeCreateNSWind ...@@ -738,14 +738,12 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeCreateNSWind
__block AWTWindow *window = nil; __block AWTWindow *window = nil;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
JNFWeakJObjectWrapper *platformWindow = [JNFWeakJObjectWrapper wrapperWithJObject:obj withEnv:env]; JNFWeakJObjectWrapper *platformWindow = [JNFWeakJObjectWrapper wrapperWithJObject:obj withEnv:env];
NSView *contentView = OBJC(contentViewPtr); NSView *contentView = OBJC(contentViewPtr);
NSRect frameRect = NSMakeRect(x, y, w, h); NSRect frameRect = NSMakeRect(x, y, w, h);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
AWT_ASSERT_APPKIT_THREAD;
window = [[AWTWindow alloc] initWithPlatformWindow:platformWindow window = [[AWTWindow alloc] initWithPlatformWindow:platformWindow
styleBits:styleBits styleBits:styleBits
...@@ -770,11 +768,9 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowSt ...@@ -770,11 +768,9 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowSt
(JNIEnv *env, jclass clazz, jlong windowPtr, jint mask, jint bits) (JNIEnv *env, jclass clazz, jlong windowPtr, jint mask, jint bits)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
NSWindow *nsWindow = OBJC(windowPtr); NSWindow *nsWindow = OBJC(windowPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; AWTWindow *window = (AWTWindow*)[nsWindow delegate];
...@@ -807,12 +803,10 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowMe ...@@ -807,12 +803,10 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowMe
(JNIEnv *env, jclass clazz, jlong windowPtr, jlong menuBarPtr) (JNIEnv *env, jclass clazz, jlong windowPtr, jlong menuBarPtr)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
NSWindow *nsWindow = OBJC(windowPtr); NSWindow *nsWindow = OBJC(windowPtr);
CMenuBar *menuBar = OBJC(menuBarPtr); CMenuBar *menuBar = OBJC(menuBarPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; AWTWindow *window = (AWTWindow*)[nsWindow delegate];
...@@ -838,14 +832,12 @@ JNIEXPORT jobject JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeGetNSWindo ...@@ -838,14 +832,12 @@ JNIEXPORT jobject JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeGetNSWindo
jobject ret = NULL; jobject ret = NULL;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
NSWindow *nsWindow = OBJC(windowPtr); NSWindow *nsWindow = OBJC(windowPtr);
__block NSRect contentRect = NSZeroRect; __block NSRect contentRect = NSZeroRect;
__block NSRect frame = NSZeroRect; __block NSRect frame = NSZeroRect;
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
AWT_ASSERT_APPKIT_THREAD;
frame = [nsWindow frame]; frame = [nsWindow frame];
contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[nsWindow styleMask]]; contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[nsWindow styleMask]];
...@@ -873,14 +865,12 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowBo ...@@ -873,14 +865,12 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowBo
(JNIEnv *env, jclass clazz, jlong windowPtr, jdouble originX, jdouble originY, jdouble width, jdouble height) (JNIEnv *env, jclass clazz, jlong windowPtr, jdouble originX, jdouble originY, jdouble width, jdouble height)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
NSRect jrect = NSMakeRect(originX, originY, width, height); NSRect jrect = NSMakeRect(originX, originY, width, height);
// TODO: not sure we need displayIfNeeded message in our view // TODO: not sure we need displayIfNeeded message in our view
NSWindow *nsWindow = OBJC(windowPtr); NSWindow *nsWindow = OBJC(windowPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; AWTWindow *window = (AWTWindow*)[nsWindow delegate];
...@@ -913,7 +903,6 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowMi ...@@ -913,7 +903,6 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowMi
(JNIEnv *env, jclass clazz, jlong windowPtr, jdouble minW, jdouble minH, jdouble maxW, jdouble maxH) (JNIEnv *env, jclass clazz, jlong windowPtr, jdouble minW, jdouble minH, jdouble maxW, jdouble maxH)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
if (minW < 1) minW = 1; if (minW < 1) minW = 1;
if (minH < 1) minH = 1; if (minH < 1) minH = 1;
...@@ -921,8 +910,7 @@ AWT_ASSERT_NOT_APPKIT_THREAD; ...@@ -921,8 +910,7 @@ AWT_ASSERT_NOT_APPKIT_THREAD;
if (maxH < 1) maxH = 1; if (maxH < 1) maxH = 1;
NSWindow *nsWindow = OBJC(windowPtr); NSWindow *nsWindow = OBJC(windowPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; AWTWindow *window = (AWTWindow*)[nsWindow delegate];
...@@ -949,12 +937,9 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativePushNSWindowT ...@@ -949,12 +937,9 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativePushNSWindowT
(JNIEnv *env, jclass clazz, jlong windowPtr) (JNIEnv *env, jclass clazz, jlong windowPtr)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
NSWindow *nsWindow = OBJC(windowPtr); NSWindow *nsWindow = OBJC(windowPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
[nsWindow orderBack:nil]; [nsWindow orderBack:nil];
}]; }];
...@@ -970,11 +955,9 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativePushNSWindowT ...@@ -970,11 +955,9 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativePushNSWindowT
(JNIEnv *env, jclass clazz, jlong windowPtr) (JNIEnv *env, jclass clazz, jlong windowPtr)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
NSWindow *nsWindow = OBJC(windowPtr); NSWindow *nsWindow = OBJC(windowPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
if (![nsWindow isKeyWindow]) { if (![nsWindow isKeyWindow]) {
[nsWindow makeKeyAndOrderFront:nsWindow]; [nsWindow makeKeyAndOrderFront:nsWindow];
...@@ -995,7 +978,6 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowTi ...@@ -995,7 +978,6 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowTi
(JNIEnv *env, jclass clazz, jlong windowPtr, jstring jtitle) (JNIEnv *env, jclass clazz, jlong windowPtr, jstring jtitle)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
NSWindow *nsWindow = OBJC(windowPtr); NSWindow *nsWindow = OBJC(windowPtr);
[nsWindow performSelectorOnMainThread:@selector(setTitle:) [nsWindow performSelectorOnMainThread:@selector(setTitle:)
...@@ -1016,15 +998,9 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeRevalidateNSW ...@@ -1016,15 +998,9 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeRevalidateNSW
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *nsWindow = OBJC(windowPtr); NSWindow *nsWindow = OBJC(windowPtr);
if ([NSThread isMainThread]) { [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[nsWindow invalidateShadow]; [nsWindow invalidateShadow];
} else { }];
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
AWT_ASSERT_APPKIT_THREAD;
[nsWindow invalidateShadow];
}];
}
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -1060,13 +1036,10 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowMi ...@@ -1060,13 +1036,10 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowMi
(JNIEnv *env, jclass clazz, jlong windowPtr, jlong nsImagePtr) (JNIEnv *env, jclass clazz, jlong windowPtr, jlong nsImagePtr)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
NSWindow *nsWindow = OBJC(windowPtr); NSWindow *nsWindow = OBJC(windowPtr);
NSImage *image = OBJC(nsImagePtr); NSImage *image = OBJC(nsImagePtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
[nsWindow setMiniwindowImage:image]; [nsWindow setMiniwindowImage:image];
}]; }];
...@@ -1082,35 +1055,16 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowRe ...@@ -1082,35 +1055,16 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowRe
(JNIEnv *env, jclass clazz, jlong windowPtr, jstring filename) (JNIEnv *env, jclass clazz, jlong windowPtr, jstring filename)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
NSWindow *nsWindow = OBJC(windowPtr); NSWindow *nsWindow = OBJC(windowPtr);
NSURL *url = (filename == NULL) ? nil : [NSURL fileURLWithPath:JNFNormalizedNSStringForPath(env, filename)]; NSURL *url = (filename == NULL) ? nil : [NSURL fileURLWithPath:JNFNormalizedNSStringForPath(env, filename)];
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
[nsWindow setRepresentedURL:url]; [nsWindow setRepresentedURL:url];
}]; }];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
/*
* Class: sun_lwawt_macosx_CPlatformWindow
* Method: nativeSetNSWindowSecurityWarningPositioning
* Signature: (JDDFF)V
*/
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowSecurityWarningPositioning
(JNIEnv *env, jclass clazz, jlong windowPtr, jdouble x, jdouble y, jfloat biasX, jfloat biasY)
{
JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
[JNFException raise:env as:kRuntimeException reason:"unimplemented"];
JNF_COCOA_EXIT(env);
}
/* /*
* Class: sun_lwawt_macosx_CPlatformWindow * Class: sun_lwawt_macosx_CPlatformWindow
* Method: nativeGetTopmostPlatformWindowUnderMouse * Method: nativeGetTopmostPlatformWindowUnderMouse
...@@ -1144,10 +1098,8 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSynthesizeMou ...@@ -1144,10 +1098,8 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSynthesizeMou
(JNIEnv *env, jclass clazz) (JNIEnv *env, jclass clazz)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
[AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows]; [AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows];
}]; }];
...@@ -1168,7 +1120,7 @@ JNF_COCOA_ENTER(env); ...@@ -1168,7 +1120,7 @@ JNF_COCOA_ENTER(env);
SEL toggleFullScreenSelector = @selector(toggleFullScreen:); SEL toggleFullScreenSelector = @selector(toggleFullScreen:);
if (![nsWindow respondsToSelector:toggleFullScreenSelector]) return; if (![nsWindow respondsToSelector:toggleFullScreenSelector]) return;
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[nsWindow performSelector:toggleFullScreenSelector withObject:nil]; [nsWindow performSelector:toggleFullScreenSelector withObject:nil];
}]; }];
...@@ -1181,7 +1133,7 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetEnabled ...@@ -1181,7 +1133,7 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetEnabled
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *nsWindow = OBJC(windowPtr); NSWindow *nsWindow = OBJC(windowPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; AWTWindow *window = (AWTWindow*)[nsWindow delegate];
[window setEnabled: isEnabled]; [window setEnabled: isEnabled];
...@@ -1196,7 +1148,7 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeDispose ...@@ -1196,7 +1148,7 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeDispose
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *nsWindow = OBJC(windowPtr); NSWindow *nsWindow = OBJC(windowPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; AWTWindow *window = (AWTWindow*)[nsWindow delegate];
if ([AWTWindow lastKeyWindow] == window) { if ([AWTWindow lastKeyWindow] == window) {
......
...@@ -515,10 +515,9 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -515,10 +515,9 @@ AWT_ASSERT_APPKIT_THREAD;
JNIEXPORT void JNICALL Java_com_apple_eawt_Application_nativeInitializeApplicationDelegate JNIEXPORT void JNICALL Java_com_apple_eawt_Application_nativeInitializeApplicationDelegate
(JNIEnv *env, jclass clz) (JNIEnv *env, jclass clz)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
// Force initialization to happen on AppKit thread! // Force initialization to happen on AppKit thread!
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[ApplicationDelegate sharedDelegate]; [ApplicationDelegate sharedDelegate];
}]; }];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
...@@ -532,10 +531,9 @@ JNF_COCOA_EXIT(env); ...@@ -532,10 +531,9 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_com_apple_eawt__1AppEventHandler_nativeOpenCocoaAboutWindow JNIEXPORT void JNICALL Java_com_apple_eawt__1AppEventHandler_nativeOpenCocoaAboutWindow
(JNIEnv *env, jclass clz) (JNIEnv *env, jclass clz)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[NSApp orderFrontStandardAboutPanel:nil]; [NSApp orderFrontStandardAboutPanel:nil];
}]; }];
...@@ -550,10 +548,9 @@ JNF_COCOA_EXIT(env); ...@@ -550,10 +548,9 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_com_apple_eawt__1AppEventHandler_nativeReplyToAppShouldTerminate JNIEXPORT void JNICALL Java_com_apple_eawt__1AppEventHandler_nativeReplyToAppShouldTerminate
(JNIEnv *env, jclass clz, jboolean doTerminate) (JNIEnv *env, jclass clz, jboolean doTerminate)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[NSApp replyToApplicationShouldTerminate:doTerminate]; [NSApp replyToApplicationShouldTerminate:doTerminate];
}]; }];
...@@ -568,7 +565,6 @@ JNF_COCOA_EXIT(env); ...@@ -568,7 +565,6 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_com_apple_eawt__1AppEventHandler_nativeRegisterForNotification JNIEXPORT void JNICALL Java_com_apple_eawt__1AppEventHandler_nativeRegisterForNotification
(JNIEnv *env, jclass clz, jint notificationType) (JNIEnv *env, jclass clz, jint notificationType)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThread:@selector(_registerForNotification:) [ThreadUtilities performOnMainThread:@selector(_registerForNotification:)
onObject:[ApplicationDelegate class] onObject:[ApplicationDelegate class]
...@@ -586,13 +582,10 @@ JNF_COCOA_EXIT(env); ...@@ -586,13 +582,10 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_com_apple_eawt__1AppDockIconHandler_nativeSetDockMenu JNIEXPORT void JNICALL Java_com_apple_eawt__1AppDockIconHandler_nativeSetDockMenu
(JNIEnv *env, jclass clz, jlong nsMenuPtr) (JNIEnv *env, jclass clz, jlong nsMenuPtr)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSMenu *menu = (NSMenu *)jlong_to_ptr(nsMenuPtr); NSMenu *menu = (NSMenu *)jlong_to_ptr(nsMenuPtr);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
AWT_ASSERT_APPKIT_THREAD;
[ApplicationDelegate sharedDelegate].fDockMenu = menu; [ApplicationDelegate sharedDelegate].fDockMenu = menu;
}]; }];
...@@ -607,14 +600,13 @@ JNF_COCOA_EXIT(env); ...@@ -607,14 +600,13 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_com_apple_eawt__1AppDockIconHandler_nativeSetDockIconImage JNIEXPORT void JNICALL Java_com_apple_eawt__1AppDockIconHandler_nativeSetDockIconImage
(JNIEnv *env, jclass clz, jlong nsImagePtr) (JNIEnv *env, jclass clz, jlong nsImagePtr)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSImage *_image = (NSImage *)jlong_to_ptr(nsImagePtr); NSImage *_image = (NSImage *)jlong_to_ptr(nsImagePtr);
[JNFRunLoop performOnMainThread:@selector(_setDockIconImage:) [ThreadUtilities performOnMainThread:@selector(_setDockIconImage:)
on:[ApplicationDelegate class] on:[ApplicationDelegate class]
withObject:_image withObject:_image
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -629,12 +621,9 @@ JNIEXPORT jlong JNICALL Java_com_apple_eawt__1AppDockIconHandler_nativeGetDockIc ...@@ -629,12 +621,9 @@ JNIEXPORT jlong JNICALL Java_com_apple_eawt__1AppDockIconHandler_nativeGetDockIc
{ {
__block NSImage *image = nil; __block NSImage *image = nil;
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
AWT_ASSERT_APPKIT_THREAD;
image = [ApplicationDelegate _dockIconImage]; image = [ApplicationDelegate _dockIconImage];
CFRetain(image); CFRetain(image);
}]; }];
...@@ -652,13 +641,10 @@ JNF_COCOA_EXIT(env); ...@@ -652,13 +641,10 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_com_apple_eawt__1AppDockIconHandler_nativeSetDockIconBadge JNIEXPORT void JNICALL Java_com_apple_eawt__1AppDockIconHandler_nativeSetDockIconBadge
(JNIEnv *env, jclass clz, jstring badge) (JNIEnv *env, jclass clz, jstring badge)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSString *badgeString = JNFJavaToNSString(env, badge); NSString *badgeString = JNFJavaToNSString(env, badge);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
NSDockTile *dockTile = [NSApp dockTile]; NSDockTile *dockTile = [NSApp dockTile];
[dockTile setBadgeLabel:badgeString]; [dockTile setBadgeLabel:badgeString];
[dockTile display]; [dockTile display];
...@@ -675,12 +661,9 @@ JNF_COCOA_EXIT(env); ...@@ -675,12 +661,9 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeRequestActivation JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeRequestActivation
(JNIEnv *env, jclass clz, jboolean allWindows) (JNIEnv *env, jclass clz, jboolean allWindows)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
NSApplicationActivationOptions options = allWindows ? NSApplicationActivateAllWindows : 0; NSApplicationActivationOptions options = allWindows ? NSApplicationActivateAllWindows : 0;
options |= NSApplicationActivateIgnoringOtherApps; // without this, nothing happens! options |= NSApplicationActivateIgnoringOtherApps; // without this, nothing happens!
[[NSRunningApplication currentApplication] activateWithOptions:options]; [[NSRunningApplication currentApplication] activateWithOptions:options];
...@@ -697,12 +680,9 @@ JNF_COCOA_EXIT(env); ...@@ -697,12 +680,9 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeRequestUserAttention JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeRequestUserAttention
(JNIEnv *env, jclass clz, jboolean critical) (JNIEnv *env, jclass clz, jboolean critical)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
[NSApp requestUserAttention:critical ? NSCriticalRequest : NSInformationalRequest]; [NSApp requestUserAttention:critical ? NSCriticalRequest : NSInformationalRequest];
}]; }];
...@@ -717,13 +697,12 @@ JNF_COCOA_EXIT(env); ...@@ -717,13 +697,12 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeOpenHelpViewer JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeOpenHelpViewer
(JNIEnv *env, jclass clz) (JNIEnv *env, jclass clz)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[JNFRunLoop performOnMainThread:@selector(showHelp:) [ThreadUtilities performOnMainThread:@selector(showHelp:)
on:NSApp on:NSApp
withObject:nil withObject:nil
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -736,7 +715,6 @@ JNF_COCOA_EXIT(env); ...@@ -736,7 +715,6 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeEnableSuddenTermination JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeEnableSuddenTermination
(JNIEnv *env, jclass clz) (JNIEnv *env, jclass clz)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[[NSProcessInfo processInfo] enableSuddenTermination]; // Foundation thread-safe [[NSProcessInfo processInfo] enableSuddenTermination]; // Foundation thread-safe
...@@ -752,7 +730,6 @@ JNF_COCOA_EXIT(env); ...@@ -752,7 +730,6 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeDisableSuddenTermination JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMiscHandlers_nativeDisableSuddenTermination
(JNIEnv *env, jclass clz) (JNIEnv *env, jclass clz)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[[NSProcessInfo processInfo] disableSuddenTermination]; // Foundation thread-safe [[NSProcessInfo processInfo] disableSuddenTermination]; // Foundation thread-safe
...@@ -768,12 +745,9 @@ JNF_COCOA_EXIT(env); ...@@ -768,12 +745,9 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMenuBarHandler_nativeSetMenuState JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMenuBarHandler_nativeSetMenuState
(JNIEnv *env, jclass clz, jint menuID, jboolean visible, jboolean enabled) (JNIEnv *env, jclass clz, jint menuID, jboolean visible, jboolean enabled)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
ApplicationDelegate *delegate = [ApplicationDelegate sharedDelegate]; ApplicationDelegate *delegate = [ApplicationDelegate sharedDelegate];
switch (menuID) { switch (menuID) {
case com_apple_eawt__AppMenuBarHandler_MENU_ABOUT: case com_apple_eawt__AppMenuBarHandler_MENU_ABOUT:
...@@ -796,12 +770,10 @@ JNF_COCOA_EXIT(env); ...@@ -796,12 +770,10 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMenuBarHandler_nativeSetDefaultMenuBar JNIEXPORT void JNICALL Java_com_apple_eawt__1AppMenuBarHandler_nativeSetDefaultMenuBar
(JNIEnv *env, jclass clz, jlong cMenuBarPtr) (JNIEnv *env, jclass clz, jlong cMenuBarPtr)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
CMenuBar *menu = (CMenuBar *)jlong_to_ptr(cMenuBarPtr); CMenuBar *menu = (CMenuBar *)jlong_to_ptr(cMenuBarPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
[ApplicationDelegate sharedDelegate].fDefaultMenuBar = menu; [ApplicationDelegate sharedDelegate].fDefaultMenuBar = menu;
}]; }];
......
...@@ -109,7 +109,6 @@ static CClipboard *sClipboard = nil; ...@@ -109,7 +109,6 @@ static CClipboard *sClipboard = nil;
} }
- (void) javaDeclareTypes:(NSArray *)inTypes withOwner:(jobject)inClipboard jniEnv:(JNIEnv *)inEnv { - (void) javaDeclareTypes:(NSArray *)inTypes withOwner:(jobject)inClipboard jniEnv:(JNIEnv *)inEnv {
AWT_ASSERT_NOT_APPKIT_THREAD;
//NSLog(@"CClipboard javaDeclareTypes %@ withOwner", inTypes); //NSLog(@"CClipboard javaDeclareTypes %@ withOwner", inTypes);
...@@ -134,7 +133,6 @@ static CClipboard *sClipboard = nil; ...@@ -134,7 +133,6 @@ static CClipboard *sClipboard = nil;
- (NSArray *) javaGetTypes { - (NSArray *) javaGetTypes {
AWT_ASSERT_NOT_APPKIT_THREAD;
NSMutableArray *args = [NSMutableArray arrayWithCapacity:1]; NSMutableArray *args = [NSMutableArray arrayWithCapacity:1];
[ThreadUtilities performOnMainThread:@selector(_nativeGetTypes:) onObject:self withObject:args waitUntilDone:YES awtMode:YES]; [ThreadUtilities performOnMainThread:@selector(_nativeGetTypes:) onObject:self withObject:args waitUntilDone:YES awtMode:YES];
...@@ -152,7 +150,6 @@ static CClipboard *sClipboard = nil; ...@@ -152,7 +150,6 @@ static CClipboard *sClipboard = nil;
} }
- (void) javaSetData:(NSData *)inData forType:(NSString *) inFormat { - (void) javaSetData:(NSData *)inData forType:(NSString *) inFormat {
AWT_ASSERT_NOT_APPKIT_THREAD;
CClipboardUpdate *newUpdate = [[CClipboardUpdate alloc] initWithData:inData withFormat:inFormat]; CClipboardUpdate *newUpdate = [[CClipboardUpdate alloc] initWithData:inData withFormat:inFormat];
[ThreadUtilities performOnMainThread:@selector(_nativeSetData:) onObject:self withObject:newUpdate waitUntilDone:YES awtMode:YES]; [ThreadUtilities performOnMainThread:@selector(_nativeSetData:) onObject:self withObject:newUpdate waitUntilDone:YES awtMode:YES];
...@@ -171,7 +168,6 @@ static CClipboard *sClipboard = nil; ...@@ -171,7 +168,6 @@ static CClipboard *sClipboard = nil;
} }
- (NSData *) javaGetDataForType:(NSString *) inFormat { - (NSData *) javaGetDataForType:(NSString *) inFormat {
AWT_ASSERT_NOT_APPKIT_THREAD;
NSMutableArray *args = [NSMutableArray arrayWithObject:inFormat]; NSMutableArray *args = [NSMutableArray arrayWithObject:inFormat];
[ThreadUtilities performOnMainThread:@selector(_nativeGetDataForType:) onObject:self withObject:args waitUntilDone:YES awtMode:YES]; [ThreadUtilities performOnMainThread:@selector(_nativeGetDataForType:) onObject:self withObject:args waitUntilDone:YES awtMode:YES];
......
...@@ -74,7 +74,6 @@ Java_sun_lwawt_macosx_CCursorManager_nativeSetBuiltInCursor ...@@ -74,7 +74,6 @@ Java_sun_lwawt_macosx_CCursorManager_nativeSetBuiltInCursor
(JNIEnv *env, jclass class, jint type, jstring name) (JNIEnv *env, jclass class, jint type, jstring name)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
NSString *cursorName = JNFJavaToNSString(env, name); NSString *cursorName = JNFJavaToNSString(env, name);
SEL cursorSelector = (type == sun_lwawt_macosx_CCursorManager_NAMED_CURSOR) ? lookupCursorSelectorForName(cursorName) : lookupCursorSelectorForType(type); SEL cursorSelector = (type == sun_lwawt_macosx_CCursorManager_NAMED_CURSOR) ? lookupCursorSelectorForName(cursorName) : lookupCursorSelectorForType(type);
...@@ -87,9 +86,7 @@ AWT_ASSERT_NOT_APPKIT_THREAD; ...@@ -87,9 +86,7 @@ AWT_ASSERT_NOT_APPKIT_THREAD;
[JNFException raise:env as:kNoSuchMethodException reason:"missing NSCursor selector"]; [JNFException raise:env as:kNoSuchMethodException reason:"missing NSCursor selector"];
} }
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
setCursorOnAppKitThread([[NSCursor class] performSelector:cursorSelector]); setCursorOnAppKitThread([[NSCursor class] performSelector:cursorSelector]);
}]; }];
...@@ -101,12 +98,9 @@ Java_sun_lwawt_macosx_CCursorManager_nativeSetCustomCursor ...@@ -101,12 +98,9 @@ Java_sun_lwawt_macosx_CCursorManager_nativeSetCustomCursor
(JNIEnv *env, jclass class, jlong imgPtr, jdouble x, jdouble y) (JNIEnv *env, jclass class, jlong imgPtr, jdouble x, jdouble y)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
NSImage *image = (NSImage *)jlong_to_ptr(imgPtr); NSImage *image = (NSImage *)jlong_to_ptr(imgPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
NSCursor *cursor = [[NSCursor alloc] initWithImage:image NSCursor *cursor = [[NSCursor alloc] initWithImage:image
hotSpot:(NSPoint){ x, y }]; hotSpot:(NSPoint){ x, y }];
setCursorOnAppKitThread(cursor); setCursorOnAppKitThread(cursor);
...@@ -127,8 +121,6 @@ JNF_COCOA_ENTER(env); ...@@ -127,8 +121,6 @@ JNF_COCOA_ENTER(env);
__block NSPoint pt = NSZeroPoint; __block NSPoint pt = NSZeroPoint;
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
AWT_ASSERT_APPKIT_THREAD;
pt = ConvertNSScreenPoint(env, [NSEvent mouseLocation]); pt = ConvertNSScreenPoint(env, [NSEvent mouseLocation]);
}]; }];
...@@ -144,13 +136,11 @@ JNIEXPORT void JNICALL ...@@ -144,13 +136,11 @@ JNIEXPORT void JNICALL
Java_sun_lwawt_macosx_CCursorManager_nativeSetAllowsCursorSetInBackground Java_sun_lwawt_macosx_CCursorManager_nativeSetAllowsCursorSetInBackground
(JNIEnv *env, jclass class, jboolean allows) (JNIEnv *env, jclass class, jboolean allows)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
SEL allowsSetInBackground_SEL = @selector(javaSetAllowsCursorSetInBackground:); SEL allowsSetInBackground_SEL = @selector(javaSetAllowsCursorSetInBackground:);
if ([[NSCursor class] respondsToSelector:allowsSetInBackground_SEL]) { if ([[NSCursor class] respondsToSelector:allowsSetInBackground_SEL]) {
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
NSMethodSignature *allowsSetInBackground_sig = NSMethodSignature *allowsSetInBackground_sig =
[[NSCursor class] methodSignatureForSelector:allowsSetInBackground_SEL]; [[NSCursor class] methodSignatureForSelector:allowsSetInBackground_SEL];
NSInvocation *invocation = NSInvocation *invocation =
......
...@@ -36,8 +36,6 @@ ...@@ -36,8 +36,6 @@
JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_CDesktopPeer__1lsOpenURI JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_CDesktopPeer__1lsOpenURI
(JNIEnv *env, jclass clz, jstring uri) (JNIEnv *env, jclass clz, jstring uri)
{ {
// AWT_ASSERT_ANY_THREAD
OSStatus status = noErr; OSStatus status = noErr;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
...@@ -63,8 +61,6 @@ JNF_COCOA_EXIT(env); ...@@ -63,8 +61,6 @@ JNF_COCOA_EXIT(env);
JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_CDesktopPeer__1lsOpenFile JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_CDesktopPeer__1lsOpenFile
(JNIEnv *env, jclass clz, jstring jpath, jboolean print) (JNIEnv *env, jclass clz, jstring jpath, jboolean print)
{ {
// AWT_ASSERT_ANY_THREAD
OSStatus status = noErr; OSStatus status = noErr;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
......
...@@ -46,7 +46,7 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_createNativ ...@@ -46,7 +46,7 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_createNativ
__block CDragSource* dragSource = nil; __block CDragSource* dragSource = nil;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
dragSource = [[CDragSource alloc] init:jthis component:jcomponent peer:jpeer control:controlObj dragSource = [[CDragSource alloc] init:jthis component:jcomponent peer:jpeer control:controlObj
transferable:jtransferable triggerEvent:jtrigger dragPosX:jdragposx transferable:jtransferable triggerEvent:jtrigger dragPosX:jdragposx
dragPosY:jdragposy modifiers:jextmodifiers clickCount:jclickcount timeStamp:jtimestamp dragPosY:jdragposy modifiers:jextmodifiers clickCount:jclickcount timeStamp:jtimestamp
...@@ -103,7 +103,7 @@ JNF_COCOA_EXIT(env); ...@@ -103,7 +103,7 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_setNativeCursor JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_setNativeCursor
(JNIEnv *env, jobject jthis, jlong nativeDragSourceVal, jobject jcursor, jint jcursortype) (JNIEnv *env, jobject jthis, jlong nativeDragSourceVal, jobject jcursor, jint jcursortype)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD; //AWT_ASSERT_NOT_APPKIT_THREAD;
//JNF_COCOA_ENTER(env); //JNF_COCOA_ENTER(env);
// jobject gCursor = JNFNewGlobalRef(env, jcursor); // jobject gCursor = JNFNewGlobalRef(env, jcursor);
......
...@@ -108,7 +108,6 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CImage_nativeCreateNSImageFromArra ...@@ -108,7 +108,6 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CImage_nativeCreateNSImageFromArra
jlong result = 0L; jlong result = 0L;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_ANY_THREAD;
NSBitmapImageRep* imageRep = CImage_CreateImageRep(env, buffer, width, height); NSBitmapImageRep* imageRep = CImage_CreateImageRep(env, buffer, width, height);
if (imageRep) { if (imageRep) {
...@@ -139,7 +138,6 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CImage_nativeCreateNSImageFromArra ...@@ -139,7 +138,6 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CImage_nativeCreateNSImageFromArra
jlong result = 0L; jlong result = 0L;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_ANY_THREAD;
jsize num = (*env)->GetArrayLength(env, buffers); jsize num = (*env)->GetArrayLength(env, buffers);
NSMutableArray * reps = [NSMutableArray arrayWithCapacity: num]; NSMutableArray * reps = [NSMutableArray arrayWithCapacity: num];
...@@ -187,7 +185,6 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CImage_nativeCreateNSImageFromIcon ...@@ -187,7 +185,6 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CImage_nativeCreateNSImageFromIcon
NSImage *image = nil; NSImage *image = nil;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_ANY_THREAD;
IconRef iconRef; IconRef iconRef;
if (noErr == GetIconRef(kOnSystemDisk, kSystemIconsCreator, selector, &iconRef)) { if (noErr == GetIconRef(kOnSystemDisk, kSystemIconsCreator, selector, &iconRef)) {
...@@ -212,7 +209,6 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CImage_nativeCreateNSImageFromFile ...@@ -212,7 +209,6 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CImage_nativeCreateNSImageFromFile
NSImage *image = nil; NSImage *image = nil;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_ANY_THREAD;
NSString *path = JNFNormalizedNSStringForPath(env, file); NSString *path = JNFNormalizedNSStringForPath(env, file);
image = [[NSImage alloc] initByReferencingFile:path]; image = [[NSImage alloc] initByReferencingFile:path];
...@@ -234,10 +230,9 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CImage_nativeCreateNSImageOfFileFr ...@@ -234,10 +230,9 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CImage_nativeCreateNSImageOfFileFr
__block NSImage *image = nil; __block NSImage *image = nil;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_ANY_THREAD;
NSString *path = JNFNormalizedNSStringForPath(env, file); NSString *path = JNFNormalizedNSStringForPath(env, file);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
image = [[NSWorkspace sharedWorkspace] iconForFile:path]; image = [[NSWorkspace sharedWorkspace] iconForFile:path];
[image setScalesWhenResized:TRUE]; [image setScalesWhenResized:TRUE];
if (image) CFRetain(image); // GC if (image) CFRetain(image); // GC
...@@ -259,7 +254,6 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CImage_nativeCreateNSImageFromImag ...@@ -259,7 +254,6 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CImage_nativeCreateNSImageFromImag
NSImage *image = nil; NSImage *image = nil;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_ANY_THREAD;
image = [NSImage imageNamed:JNFJavaToNSString(env, name)]; image = [NSImage imageNamed:JNFJavaToNSString(env, name)];
if (image) CFRetain(image); // GC if (image) CFRetain(image); // GC
...@@ -278,7 +272,6 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CImage_nativeCopyNSImageIntoArray ...@@ -278,7 +272,6 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CImage_nativeCopyNSImageIntoArray
(JNIEnv *env, jclass klass, jlong nsImgPtr, jintArray buffer, jint w, jint h) (JNIEnv *env, jclass klass, jlong nsImgPtr, jintArray buffer, jint w, jint h)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_ANY_THREAD;
NSImage *img = (NSImage *)jlong_to_ptr(nsImgPtr); NSImage *img = (NSImage *)jlong_to_ptr(nsImgPtr);
jint *dst = (*env)->GetPrimitiveArrayCritical(env, buffer, NULL); jint *dst = (*env)->GetPrimitiveArrayCritical(env, buffer, NULL);
...@@ -301,7 +294,6 @@ JNIEXPORT jobject JNICALL Java_sun_lwawt_macosx_CImage_nativeGetNSImageSize ...@@ -301,7 +294,6 @@ JNIEXPORT jobject JNICALL Java_sun_lwawt_macosx_CImage_nativeGetNSImageSize
jobject size = NULL; jobject size = NULL;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_ANY_THREAD;
size = NSToJavaSize(env, [(NSImage *)jlong_to_ptr(nsImgPtr) size]); size = NSToJavaSize(env, [(NSImage *)jlong_to_ptr(nsImgPtr) size]);
......
...@@ -153,7 +153,7 @@ JNIEXPORT jobject JNICALL Java_sun_lwawt_macosx_CInputMethod_nativeGetCurrentInp ...@@ -153,7 +153,7 @@ JNIEXPORT jobject JNICALL Java_sun_lwawt_macosx_CInputMethod_nativeGetCurrentInp
__block NSString *keyboardInfo = NULL; __block NSString *keyboardInfo = NULL;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
keyboardInfo = [inputMethodController performSelector:@selector(currentInputMethodName)]; keyboardInfo = [inputMethodController performSelector:@selector(currentInputMethodName)];
[keyboardInfo retain]; [keyboardInfo retain];
}]; }];
...@@ -177,7 +177,7 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CInputMethod_nativeNotifyPeer ...@@ -177,7 +177,7 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CInputMethod_nativeNotifyPeer
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWTView *view = (AWTView *)jlong_to_ptr(nativePeer); AWTView *view = (AWTView *)jlong_to_ptr(nativePeer);
JNFJObjectWrapper *inputMethodWrapper = [[JNFJObjectWrapper alloc] initWithJObject:inputMethod withEnv:env]; JNFJObjectWrapper *inputMethodWrapper = [[JNFJObjectWrapper alloc] initWithJObject:inputMethod withEnv:env];
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[CInputMethod _nativeNotifyPeerWithView:view inputMethod:inputMethodWrapper]; [CInputMethod _nativeNotifyPeerWithView:view inputMethod:inputMethodWrapper];
}]; }];
...@@ -196,7 +196,7 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CInputMethod_nativeEndComposition ...@@ -196,7 +196,7 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CInputMethod_nativeEndComposition
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWTView *view = (AWTView *)jlong_to_ptr(nativePeer); AWTView *view = (AWTView *)jlong_to_ptr(nativePeer);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[CInputMethod _nativeEndComposition:view]; [CInputMethod _nativeEndComposition:view];
}]; }];
...@@ -216,7 +216,7 @@ JNIEXPORT jobject JNICALL Java_sun_lwawt_macosx_CInputMethod_getNativeLocale ...@@ -216,7 +216,7 @@ JNIEXPORT jobject JNICALL Java_sun_lwawt_macosx_CInputMethod_getNativeLocale
__block NSString *isoAbbreviation; __block NSString *isoAbbreviation;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
isoAbbreviation = (NSString *) [inputMethodController performSelector:@selector(currentInputMethodLocale)]; isoAbbreviation = (NSString *) [inputMethodController performSelector:@selector(currentInputMethodLocale)];
[isoAbbreviation retain]; [isoAbbreviation retain];
}]; }];
...@@ -259,7 +259,7 @@ JNF_COCOA_ENTER(env); ...@@ -259,7 +259,7 @@ JNF_COCOA_ENTER(env);
NSString *localeStr = JNFJavaToNSString(env, locale); NSString *localeStr = JNFJavaToNSString(env, locale);
[localeStr retain]; [localeStr retain];
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
[CInputMethod setKeyboardLayout:localeStr]; [CInputMethod setKeyboardLayout:localeStr];
}]; }];
...@@ -293,7 +293,7 @@ JNIEXPORT jobject JNICALL Java_sun_lwawt_macosx_CInputMethodDescriptor_nativeGet ...@@ -293,7 +293,7 @@ JNIEXPORT jobject JNICALL Java_sun_lwawt_macosx_CInputMethodDescriptor_nativeGet
__block NSArray *selectableArray = nil; __block NSArray *selectableArray = nil;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
selectableArray = (NSArray *)[inputMethodController performSelector:@selector(availableInputMethodLocales)]; selectableArray = (NSArray *)[inputMethodController performSelector:@selector(availableInputMethodLocales)];
[selectableArray retain]; [selectableArray retain];
}]; }];
......
...@@ -55,12 +55,10 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -55,12 +55,10 @@ AWT_ASSERT_APPKIT_THREAD;
//- (void)finalize { [super finalize]; } //- (void)finalize { [super finalize]; }
- (void)addJavaSubmenu:(CMenu *)submenu { - (void)addJavaSubmenu:(CMenu *)submenu {
AWT_ASSERT_NOT_APPKIT_THREAD;
[ThreadUtilities performOnMainThread:@selector(addNativeItem_OnAppKitThread:) onObject:self withObject:submenu waitUntilDone:YES awtMode:YES]; [ThreadUtilities performOnMainThread:@selector(addNativeItem_OnAppKitThread:) onObject:self withObject:submenu waitUntilDone:YES awtMode:YES];
} }
- (void)addJavaMenuItem:(CMenuItem *)theMenuItem { - (void)addJavaMenuItem:(CMenuItem *)theMenuItem {
AWT_ASSERT_NOT_APPKIT_THREAD;
[ThreadUtilities performOnMainThread:@selector(addNativeItem_OnAppKitThread:) onObject:self withObject:theMenuItem waitUntilDone:YES awtMode:YES]; [ThreadUtilities performOnMainThread:@selector(addNativeItem_OnAppKitThread:) onObject:self withObject:theMenuItem waitUntilDone:YES awtMode:YES];
} }
...@@ -70,7 +68,6 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -70,7 +68,6 @@ AWT_ASSERT_APPKIT_THREAD;
} }
- (void)setJavaMenuTitle:(NSString *)title { - (void)setJavaMenuTitle:(NSString *)title {
AWT_ASSERT_NOT_APPKIT_THREAD;
if (title) { if (title) {
[ThreadUtilities performOnMainThread:@selector(setNativeMenuTitle_OnAppKitThread:) onObject:self withObject:title waitUntilDone:YES awtMode:YES]; [ThreadUtilities performOnMainThread:@selector(setNativeMenuTitle_OnAppKitThread:) onObject:self withObject:title waitUntilDone:YES awtMode:YES];
...@@ -95,7 +92,6 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -95,7 +92,6 @@ AWT_ASSERT_APPKIT_THREAD;
} }
- (void)deleteJavaItem:(jint)index { - (void)deleteJavaItem:(jint)index {
AWT_ASSERT_NOT_APPKIT_THREAD;
[ThreadUtilities performOnMainThread:@selector(deleteNativeJavaItem_OnAppKitThread:) onObject:self withObject:[NSNumber numberWithInt:index] waitUntilDone:YES awtMode:YES]; [ThreadUtilities performOnMainThread:@selector(deleteNativeJavaItem_OnAppKitThread:) onObject:self withObject:[NSNumber numberWithInt:index] waitUntilDone:YES awtMode:YES];
} }
......
...@@ -80,10 +80,10 @@ Java_sun_lwawt_macosx_CMenuComponent_nativeDispose ...@@ -80,10 +80,10 @@ Java_sun_lwawt_macosx_CMenuComponent_nativeDispose
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[JNFRunLoop performOnMainThread:@selector(disposer) [ThreadUtilities performOnMainThread:@selector(disposer)
on:((id)jlong_to_ptr(menuItemObj)) on:((id)jlong_to_ptr(menuItemObj))
withObject:nil withObject:nil
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -104,7 +104,6 @@ JNF_COCOA_EXIT(env); ...@@ -104,7 +104,6 @@ JNF_COCOA_EXIT(env);
} }
- (void) setJavaLabel:(NSString *)theLabel shortcut:(NSString *)theKeyEquivalent modifierMask:(jint)modifiers { - (void) setJavaLabel:(NSString *)theLabel shortcut:(NSString *)theKeyEquivalent modifierMask:(jint)modifiers {
AWT_ASSERT_NOT_APPKIT_THREAD;
NSUInteger modifierMask = 0; NSUInteger modifierMask = 0;
...@@ -126,8 +125,7 @@ AWT_ASSERT_NOT_APPKIT_THREAD; ...@@ -126,8 +125,7 @@ AWT_ASSERT_NOT_APPKIT_THREAD;
modifierMask = JavaModifiersToNsKeyModifiers(modifiers, NO); modifierMask = JavaModifiersToNsKeyModifiers(modifiers, NO);
} }
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
AWT_ASSERT_APPKIT_THREAD;
[fMenuItem setKeyEquivalent:theKeyEquivalent]; [fMenuItem setKeyEquivalent:theKeyEquivalent];
[fMenuItem setKeyEquivalentModifierMask:modifierMask]; [fMenuItem setKeyEquivalentModifierMask:modifierMask];
[fMenuItem setTitle:theLabel]; [fMenuItem setTitle:theLabel];
...@@ -135,32 +133,23 @@ AWT_ASSERT_NOT_APPKIT_THREAD; ...@@ -135,32 +133,23 @@ AWT_ASSERT_NOT_APPKIT_THREAD;
} }
- (void) setJavaImage:(NSImage *)theImage { - (void) setJavaImage:(NSImage *)theImage {
AWT_ASSERT_NOT_APPKIT_THREAD;
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
AWT_ASSERT_APPKIT_THREAD;
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[fMenuItem setImage:theImage]; [fMenuItem setImage:theImage];
}]; }];
} }
- (void) setJavaToolTipText:(NSString *)theText { - (void) setJavaToolTipText:(NSString *)theText {
AWT_ASSERT_NOT_APPKIT_THREAD;
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
AWT_ASSERT_APPKIT_THREAD;
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[fMenuItem setToolTip:theText]; [fMenuItem setToolTip:theText];
}]; }];
} }
- (void)setJavaEnabled:(BOOL) enabled { - (void)setJavaEnabled:(BOOL) enabled {
AWT_ASSERT_NOT_APPKIT_THREAD;
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
AWT_ASSERT_APPKIT_THREAD;
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
@synchronized(self) { @synchronized(self) {
fIsEnabled = enabled; fIsEnabled = enabled;
...@@ -173,7 +162,6 @@ AWT_ASSERT_NOT_APPKIT_THREAD; ...@@ -173,7 +162,6 @@ AWT_ASSERT_NOT_APPKIT_THREAD;
} }
- (BOOL)isEnabled { - (BOOL)isEnabled {
// AWT_ASSERT_ANY_THREAD;
BOOL enabled = NO; BOOL enabled = NO;
@synchronized(self) { @synchronized(self) {
...@@ -184,11 +172,8 @@ AWT_ASSERT_NOT_APPKIT_THREAD; ...@@ -184,11 +172,8 @@ AWT_ASSERT_NOT_APPKIT_THREAD;
- (void)setJavaState:(BOOL)newState { - (void)setJavaState:(BOOL)newState {
AWT_ASSERT_NOT_APPKIT_THREAD;
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
AWT_ASSERT_APPKIT_THREAD;
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[fMenuItem setState:(newState ? NSOnState : NSOffState)]; [fMenuItem setState:(newState ? NSOnState : NSOffState)];
}]; }];
} }
......
...@@ -64,7 +64,7 @@ JNF_COCOA_ENTER(env); ...@@ -64,7 +64,7 @@ JNF_COCOA_ENTER(env);
jobject cPeerObjGlobal = JNFNewGlobalRef(env, peer); jobject cPeerObjGlobal = JNFNewGlobalRef(env, peer);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
aCPopupMenu = [[CPopupMenu alloc] initWithPeer:cPeerObjGlobal]; aCPopupMenu = [[CPopupMenu alloc] initWithPeer:cPeerObjGlobal];
CFRetain(aCPopupMenu); CFRetain(aCPopupMenu);
[aCPopupMenu release]; [aCPopupMenu release];
...@@ -82,7 +82,7 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPopupMenu_nativeShowPopupMenu ...@@ -82,7 +82,7 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPopupMenu_nativeShowPopupMenu
CPopupMenu* cPopupMenu = (CPopupMenu*)jlong_to_ptr(menuPtr); CPopupMenu* cPopupMenu = (CPopupMenu*)jlong_to_ptr(menuPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
NSPoint loc = ConvertNSScreenPoint(env, NSMakePoint(x, y)); NSPoint loc = ConvertNSScreenPoint(env, NSMakePoint(x, y));
[[cPopupMenu menu] popUpMenuPositioningItem: nil [[cPopupMenu menu] popUpMenuPositioningItem: nil
......
...@@ -303,10 +303,9 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CTrayIcon_nativeCreate ...@@ -303,10 +303,9 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CTrayIcon_nativeCreate
__block AWTTrayIcon *trayIcon = nil; __block AWTTrayIcon *trayIcon = nil;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
jobject thePeer = JNFNewGlobalRef(env, peer); jobject thePeer = JNFNewGlobalRef(env, peer);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
trayIcon = [[AWTTrayIcon alloc] initWithPeer:thePeer]; trayIcon = [[AWTTrayIcon alloc] initWithPeer:thePeer];
}]; }];
...@@ -334,11 +333,10 @@ JNIEXPORT void JNICALL Java_java_awt_TrayIcon_initIDs ...@@ -334,11 +333,10 @@ JNIEXPORT void JNICALL Java_java_awt_TrayIcon_initIDs
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CTrayIcon_nativeSetToolTip JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CTrayIcon_nativeSetToolTip
(JNIEnv *env, jobject self, jlong model, jstring jtooltip) { (JNIEnv *env, jobject self, jlong model, jstring jtooltip) {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
AWTTrayIcon *icon = jlong_to_ptr(model); AWTTrayIcon *icon = jlong_to_ptr(model);
NSString *tooltip = JNFJavaToNSString(env, jtooltip); NSString *tooltip = JNFJavaToNSString(env, jtooltip);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[icon setTooltip:tooltip]; [icon setTooltip:tooltip];
}]; }];
...@@ -353,10 +351,9 @@ JNF_COCOA_EXIT(env); ...@@ -353,10 +351,9 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CTrayIcon_setNativeImage JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CTrayIcon_setNativeImage
(JNIEnv *env, jobject self, jlong model, jlong imagePtr, jboolean autosize) { (JNIEnv *env, jobject self, jlong model, jlong imagePtr, jboolean autosize) {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
AWTTrayIcon *icon = jlong_to_ptr(model); AWTTrayIcon *icon = jlong_to_ptr(model);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
[icon setImage:jlong_to_ptr(imagePtr) sizing:autosize]; [icon setImage:jlong_to_ptr(imagePtr) sizing:autosize];
}]; }];
...@@ -369,13 +366,10 @@ Java_sun_lwawt_macosx_CTrayIcon_nativeGetIconLocation ...@@ -369,13 +366,10 @@ Java_sun_lwawt_macosx_CTrayIcon_nativeGetIconLocation
jobject jpt = NULL; jobject jpt = NULL;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWT_ASSERT_NOT_APPKIT_THREAD;
__block NSPoint pt = NSZeroPoint; __block NSPoint pt = NSZeroPoint;
AWTTrayIcon *icon = jlong_to_ptr(model); AWTTrayIcon *icon = jlong_to_ptr(model);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
AWT_ASSERT_APPKIT_THREAD;
NSPoint loc = [icon getLocationOnScreen]; NSPoint loc = [icon getLocationOnScreen];
pt = ConvertNSScreenPoint(env, loc); pt = ConvertNSScreenPoint(env, loc);
}]; }];
......
...@@ -46,7 +46,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSObject_release ...@@ -46,7 +46,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSObject_release
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
id obj = (id)jlong_to_ptr(objectPtr); id obj = (id)jlong_to_ptr(objectPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
CFRelease(obj); CFRelease(obj);
}]; }];
...@@ -66,10 +66,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_makeKeyAndOrderFront ...@@ -66,10 +66,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_makeKeyAndOrderFront
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThread:@selector(makeKeyAndOrderFront:) [ThreadUtilities performOnMainThread:@selector(makeKeyAndOrderFront:)
on:window on:window
withObject:nil withObject:nil
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -86,10 +86,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_makeKeyWindow ...@@ -86,10 +86,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_makeKeyWindow
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThread:@selector(makeKeyWindow) [ThreadUtilities performOnMainThread:@selector(makeKeyWindow)
on:window on:window
withObject:nil withObject:nil
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -106,10 +106,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_makeMainWindow ...@@ -106,10 +106,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_makeMainWindow
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThread:@selector(makeMainWindow) [ThreadUtilities performOnMainThread:@selector(makeMainWindow)
on:window on:window
withObject:nil withObject:nil
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -128,7 +128,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_canBecomeMainWindow ...@@ -128,7 +128,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_canBecomeMainWindow
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
canBecomeMainWindow = [window canBecomeMainWindow]; canBecomeMainWindow = [window canBecomeMainWindow];
}]; }];
...@@ -151,7 +151,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_isKeyWindow ...@@ -151,7 +151,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_isKeyWindow
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
isKeyWindow = [window isKeyWindow]; isKeyWindow = [window isKeyWindow];
}]; }];
...@@ -172,10 +172,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_orderFront ...@@ -172,10 +172,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_orderFront
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThread:@selector(orderFront:) [ThreadUtilities performOnMainThread:@selector(orderFront:)
on:window on:window
withObject:window withObject:window
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -192,10 +192,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_orderOut ...@@ -192,10 +192,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_orderOut
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThread:@selector(orderOut:) [ThreadUtilities performOnMainThread:@selector(orderOut:)
on:window on:window
withObject:window withObject:window
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -212,10 +212,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_orderFrontRegardless ...@@ -212,10 +212,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_orderFrontRegardless
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThread:@selector(orderFrontRegardless) [ThreadUtilities performOnMainThread:@selector(orderFrontRegardless)
on:window on:window
withObject:nil withObject:nil
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -233,7 +233,7 @@ JNF_COCOA_ENTER(env); ...@@ -233,7 +233,7 @@ JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
NSWindow *relativeTo = (NSWindow *)jlong_to_ptr(relativeToPtr); NSWindow *relativeTo = (NSWindow *)jlong_to_ptr(relativeToPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[window orderWindow:(NSWindowOrderingMode)order relativeTo:[relativeTo windowNumber]]; [window orderWindow:(NSWindowOrderingMode)order relativeTo:[relativeTo windowNumber]];
}]; }];
...@@ -267,7 +267,7 @@ JNF_COCOA_ENTER(env); ...@@ -267,7 +267,7 @@ JNF_COCOA_ENTER(env);
initLevels(); initLevels();
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[window setLevel: LEVELS[level]]; [window setLevel: LEVELS[level]];
}]; }];
} else { } else {
...@@ -290,7 +290,7 @@ JNF_COCOA_ENTER(env); ...@@ -290,7 +290,7 @@ JNF_COCOA_ENTER(env);
NSWindow *parent = (NSWindow *)jlong_to_ptr(parentPtr); NSWindow *parent = (NSWindow *)jlong_to_ptr(parentPtr);
NSWindow *child = (NSWindow *)jlong_to_ptr(childPtr); NSWindow *child = (NSWindow *)jlong_to_ptr(childPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[parent addChildWindow:child ordered:order]; [parent addChildWindow:child ordered:order];
}]; }];
...@@ -310,10 +310,10 @@ JNF_COCOA_ENTER(env); ...@@ -310,10 +310,10 @@ JNF_COCOA_ENTER(env);
AWTWindow *parent = (AWTWindow *)jlong_to_ptr(parentPtr); AWTWindow *parent = (AWTWindow *)jlong_to_ptr(parentPtr);
AWTWindow *child = (AWTWindow *)jlong_to_ptr(childPtr); AWTWindow *child = (AWTWindow *)jlong_to_ptr(childPtr);
[JNFRunLoop performOnMainThread:@selector(removeChildWindow:) [ThreadUtilities performOnMainThread:@selector(removeChildWindow:)
on:parent on:parent
withObject:child withObject:child
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -331,7 +331,7 @@ JNF_COCOA_ENTER(env); ...@@ -331,7 +331,7 @@ JNF_COCOA_ENTER(env);
AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr); AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
NSRect frame = NSMakeRect(x, y, w, h); NSRect frame = NSMakeRect(x, y, w, h);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[window setFrame:frame display:display]; [window setFrame:frame display:display];
}]; }];
...@@ -350,7 +350,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_setAlphaValue ...@@ -350,7 +350,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_setAlphaValue
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr); AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[window setAlphaValue:(CGFloat)alpha]; [window setAlphaValue:(CGFloat)alpha];
}]; }];
...@@ -369,7 +369,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_setOpaque ...@@ -369,7 +369,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_setOpaque
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr); AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[window setOpaque:(BOOL)opaque]; [window setOpaque:(BOOL)opaque];
}]; }];
...@@ -389,7 +389,7 @@ JNF_COCOA_ENTER(env); ...@@ -389,7 +389,7 @@ JNF_COCOA_ENTER(env);
AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr); AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
NSColor *color = (NSColor *)jlong_to_ptr(colorPtr); NSColor *color = (NSColor *)jlong_to_ptr(colorPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[window setBackgroundColor:color]; [window setBackgroundColor:color];
}]; }];
...@@ -410,7 +410,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_screen ...@@ -410,7 +410,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_screen
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr); AWTWindow *window = (AWTWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
const NSScreen *screen = [window screen]; const NSScreen *screen = [window screen];
CFRetain(screen); // GC CFRetain(screen); // GC
screenPtr = ptr_to_jlong(screen); screenPtr = ptr_to_jlong(screen);
...@@ -432,10 +432,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_miniaturize ...@@ -432,10 +432,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_miniaturize
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThread:@selector(miniaturize:) [ThreadUtilities performOnMainThread:@selector(miniaturize:)
on:window on:window
withObject:nil withObject:nil
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -452,10 +452,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_deminiaturize ...@@ -452,10 +452,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_deminiaturize
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThread:@selector(deminiaturize:) [ThreadUtilities performOnMainThread:@selector(deminiaturize:)
on:window on:window
withObject:nil withObject:nil
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -472,10 +472,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_zoom ...@@ -472,10 +472,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSWindow_zoom
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
[JNFRunLoop performOnMainThread:@selector(zoom:) [ThreadUtilities performOnMainThread:@selector(zoom:)
on:window on:window
withObject:nil withObject:nil
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -493,10 +493,10 @@ JNF_COCOA_ENTER(env); ...@@ -493,10 +493,10 @@ JNF_COCOA_ENTER(env);
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr); NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
NSResponder *responder = (NSResponder *)jlong_to_ptr(responderPtr); NSResponder *responder = (NSResponder *)jlong_to_ptr(responderPtr);
[JNFRunLoop performOnMainThread:@selector(makeFirstResponder:) [ThreadUtilities performOnMainThread:@selector(makeFirstResponder:)
on:window on:window
withObject:responder withObject:responder
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -514,7 +514,7 @@ JNF_COCOA_ENTER(env); ...@@ -514,7 +514,7 @@ JNF_COCOA_ENTER(env);
NSView *view = (NSView *)jlong_to_ptr(viewPtr); NSView *view = (NSView *)jlong_to_ptr(viewPtr);
NSView *subview = (NSView *)jlong_to_ptr(subviewPtr); NSView *subview = (NSView *)jlong_to_ptr(subviewPtr);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
[view addSubview:subview]; [view addSubview:subview];
}]; }];
...@@ -533,10 +533,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSView_removeFromSuperview ...@@ -533,10 +533,10 @@ Java_sun_lwawt_macosx_CWrapper_00024NSView_removeFromSuperview
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSView *view = (NSView *)jlong_to_ptr(viewPtr); NSView *view = (NSView *)jlong_to_ptr(viewPtr);
[JNFRunLoop performOnMainThread:@selector(removeFromSuperview) [ThreadUtilities performOnMainThread:@selector(removeFromSuperview)
on:view on:view
withObject:nil withObject:nil
waitUntilDone:NO]; waitUntilDone:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
...@@ -553,7 +553,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSView_setFrame ...@@ -553,7 +553,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSView_setFrame
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSView *view = (NSView *)jlong_to_ptr(viewPtr); NSView *view = (NSView *)jlong_to_ptr(viewPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[view setFrame:NSMakeRect(x, y, w, h)]; [view setFrame:NSMakeRect(x, y, w, h)];
}]; }];
...@@ -576,7 +576,7 @@ JNF_COCOA_ENTER(env); ...@@ -576,7 +576,7 @@ JNF_COCOA_ENTER(env);
__block NSRect rect = NSZeroRect; __block NSRect rect = NSZeroRect;
NSView *view = (NSView *)jlong_to_ptr(viewPtr); NSView *view = (NSView *)jlong_to_ptr(viewPtr);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
rect = [view frame]; rect = [view frame];
}]; }];
...@@ -599,7 +599,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSView_enterFullScreenMode ...@@ -599,7 +599,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSView_enterFullScreenMode
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSView *view = (NSView *)jlong_to_ptr(viewPtr); NSView *view = (NSView *)jlong_to_ptr(viewPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
NSScreen *screen = [[view window] screen]; NSScreen *screen = [[view window] screen];
NSDictionary *opts = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], NSFullScreenModeAllScreens, nil]; NSDictionary *opts = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], NSFullScreenModeAllScreens, nil];
[view enterFullScreenMode:screen withOptions:opts]; [view enterFullScreenMode:screen withOptions:opts];
...@@ -620,7 +620,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSView_exitFullScreenMode ...@@ -620,7 +620,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSView_exitFullScreenMode
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSView *view = (NSView *)jlong_to_ptr(viewPtr); NSView *view = (NSView *)jlong_to_ptr(viewPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[view exitFullScreenModeWithOptions:nil]; [view exitFullScreenModeWithOptions:nil];
}]; }];
...@@ -641,7 +641,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSView_window ...@@ -641,7 +641,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSView_window
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSView *view = (NSView *)jlong_to_ptr(viewPtr); NSView *view = (NSView *)jlong_to_ptr(viewPtr);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
windowPtr = ptr_to_jlong([view window]); windowPtr = ptr_to_jlong([view window]);
}]; }];
...@@ -655,14 +655,14 @@ JNF_COCOA_EXIT(env); ...@@ -655,14 +655,14 @@ JNF_COCOA_EXIT(env);
* Method: setHidden * Method: setHidden
* Signature: (JZ)V * Signature: (JZ)V
*/ */
JNIEXPORT jlong JNICALL JNIEXPORT void JNICALL
Java_sun_lwawt_macosx_CWrapper_00024NSView_setHidden Java_sun_lwawt_macosx_CWrapper_00024NSView_setHidden
(JNIEnv *env, jclass cls, jlong viewPtr, jboolean toHide) (JNIEnv *env, jclass cls, jlong viewPtr, jboolean toHide)
{ {
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
NSView *view = (NSView *)jlong_to_ptr(viewPtr); NSView *view = (NSView *)jlong_to_ptr(viewPtr);
[JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
[view setHidden:(BOOL)toHide]; [view setHidden:(BOOL)toHide];
}]; }];
...@@ -686,7 +686,7 @@ JNF_COCOA_ENTER(env); ...@@ -686,7 +686,7 @@ JNF_COCOA_ENTER(env);
__block NSRect rect = NSZeroRect; __block NSRect rect = NSZeroRect;
NSScreen *screen = (NSScreen *)jlong_to_ptr(screenPtr); NSScreen *screen = (NSScreen *)jlong_to_ptr(screenPtr);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
rect = [screen frame]; rect = [screen frame];
}]; }];
...@@ -713,7 +713,7 @@ JNF_COCOA_ENTER(env); ...@@ -713,7 +713,7 @@ JNF_COCOA_ENTER(env);
__block NSRect rect = NSZeroRect; __block NSRect rect = NSZeroRect;
NSScreen *screen = (NSScreen *)jlong_to_ptr(screenPtr); NSScreen *screen = (NSScreen *)jlong_to_ptr(screenPtr);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
rect = [screen visibleFrame]; rect = [screen visibleFrame];
}]; }];
...@@ -737,7 +737,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSScreen_screenByDisplayId ...@@ -737,7 +737,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSScreen_screenByDisplayId
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
NSArray *screens = [NSScreen screens]; NSArray *screens = [NSScreen screens];
for (NSScreen *screen in screens) { for (NSScreen *screen in screens) {
NSDictionary *screenInfo = [screen deviceDescription]; NSDictionary *screenInfo = [screen deviceDescription];
...@@ -768,7 +768,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSColor_clearColor ...@@ -768,7 +768,7 @@ Java_sun_lwawt_macosx_CWrapper_00024NSColor_clearColor
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
clearColorPtr = ptr_to_jlong([NSColor clearColor]); clearColorPtr = ptr_to_jlong([NSColor clearColor]);
}]; }];
......
...@@ -1147,7 +1147,6 @@ static NSObject *sAttributeNamesLOCK = nil; ...@@ -1147,7 +1147,6 @@ static NSObject *sAttributeNamesLOCK = nil;
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessibility_focusChanged JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessibility_focusChanged
(JNIEnv *env, jobject jthis) (JNIEnv *env, jobject jthis)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThread:@selector(postFocusChanged:) onObject:[JavaComponentAccessibility class] withObject:nil waitUntilDone:NO awtMode:NO]; [ThreadUtilities performOnMainThread:@selector(postFocusChanged:) onObject:[JavaComponentAccessibility class] withObject:nil waitUntilDone:NO awtMode:NO];
...@@ -1164,7 +1163,6 @@ JNF_COCOA_EXIT(env); ...@@ -1164,7 +1163,6 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_valueChanged JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_valueChanged
(JNIEnv *env, jclass jklass, jlong element) (JNIEnv *env, jclass jklass, jlong element)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThread:@selector(postValueChanged) onObject:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO awtMode:NO]; [ThreadUtilities performOnMainThread:@selector(postValueChanged) onObject:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO awtMode:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
...@@ -1178,7 +1176,6 @@ JNF_COCOA_EXIT(env); ...@@ -1178,7 +1176,6 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_selectionChanged JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_selectionChanged
(JNIEnv *env, jclass jklass, jlong element) (JNIEnv *env, jclass jklass, jlong element)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThread:@selector(postSelectionChanged) onObject:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO awtMode:NO]; [ThreadUtilities performOnMainThread:@selector(postSelectionChanged) onObject:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO awtMode:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
...@@ -1193,7 +1190,6 @@ JNF_COCOA_EXIT(env); ...@@ -1193,7 +1190,6 @@ JNF_COCOA_EXIT(env);
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_unregisterFromCocoaAXSystem JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CAccessible_unregisterFromCocoaAXSystem
(JNIEnv *env, jclass jklass, jlong element) (JNIEnv *env, jclass jklass, jlong element)
{ {
AWT_ASSERT_NOT_APPKIT_THREAD;
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThread:@selector(unregisterFromCocoaAXSystem) onObject:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO awtMode:NO]; [ThreadUtilities performOnMainThread:@selector(unregisterFromCocoaAXSystem) onObject:(JavaComponentAccessibility *)jlong_to_ptr(element) withObject:nil waitUntilDone:NO awtMode:NO];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
......
...@@ -415,13 +415,9 @@ JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_LWCToolkit_isApplicationActive ...@@ -415,13 +415,9 @@ JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_LWCToolkit_isApplicationActive
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
if ([NSThread isMainThread]) { [ThreadUtilities performOnMainThreadWaiting:YES block:^() {
active = (jboolean)[NSRunningApplication currentApplication].active; active = (jboolean)[NSRunningApplication currentApplication].active;
} else { }];
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:^() {
active = (jboolean)[NSRunningApplication currentApplication].active;
}];
}
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
......
...@@ -42,6 +42,15 @@ ...@@ -42,6 +42,15 @@
// The symbol is defined in libosxapp.dylib (ThreadUtilities.m) // The symbol is defined in libosxapp.dylib (ThreadUtilities.m)
extern JavaVM *jvm; extern JavaVM *jvm;
// Indicates if AWT is running embedded (in SWT, FX, elsewhere)
static BOOL isEmbedded = NO;
// Indicates that the app has been started with -XstartOnFirstThread
// (directly or via WebStart settings), and AWT should not run its
// own event loop in this mode. Even if a loop isn't running yet,
// we expect an embedder (e.g. SWT) to start it some time later.
static BOOL forceEmbeddedMode = NO;
static bool ShouldPrintVerboseDebugging() { static bool ShouldPrintVerboseDebugging() {
static int debug = -1; static int debug = -1;
if (debug == -1) { if (debug == -1) {
...@@ -63,31 +72,29 @@ static void AWT_NSUncaughtExceptionHandler(NSException *exception); ...@@ -63,31 +72,29 @@ static void AWT_NSUncaughtExceptionHandler(NSException *exception);
static CFRunLoopObserverRef busyObserver = NULL; static CFRunLoopObserverRef busyObserver = NULL;
static CFRunLoopObserverRef notBusyObserver = NULL; static CFRunLoopObserverRef notBusyObserver = NULL;
static void setUpAWTAppKit(BOOL swt_mode, BOOL headless) { static void setUpAWTAppKit()
AWT_ASSERT_APPKIT_THREAD; {
BOOL verbose = ShouldPrintVerboseDebugging(); BOOL verbose = ShouldPrintVerboseDebugging();
if (verbose) AWT_DEBUG_LOG(@"setting up busy observers"); if (verbose) AWT_DEBUG_LOG(@"setting up busy observers");
JNIEnv *env = [ThreadUtilities getJNIEnv];
// Add CFRunLoopObservers to call into AWT so that AWT knows that the // Add CFRunLoopObservers to call into AWT so that AWT knows that the
// AWT thread (which is the AppKit main thread) is alive. This way AWT // AWT thread (which is the AppKit main thread) is alive. This way AWT
// will not automatically shutdown. // will not automatically shutdown.
busyObserver = CFRunLoopObserverCreate( busyObserver = CFRunLoopObserverCreate(
NULL, // CFAllocator NULL, // CFAllocator
kCFRunLoopAfterWaiting, // CFOptionFlags kCFRunLoopAfterWaiting, // CFOptionFlags
true, // repeats true, // repeats
NSIntegerMax, // order NSIntegerMax, // order
&BusyObserver, // CFRunLoopObserverCallBack &BusyObserver, // CFRunLoopObserverCallBack
NULL); // CFRunLoopObserverContext NULL); // CFRunLoopObserverContext
notBusyObserver = CFRunLoopObserverCreate( notBusyObserver = CFRunLoopObserverCreate(
NULL, // CFAllocator NULL, // CFAllocator
kCFRunLoopBeforeWaiting, // CFOptionFlags kCFRunLoopBeforeWaiting, // CFOptionFlags
true, // repeats true, // repeats
NSIntegerMin, // order NSIntegerMin, // order
&NotBusyObserver, // CFRunLoopObserverCallBack &NotBusyObserver, // CFRunLoopObserverCallBack
NULL); // CFRunLoopObserverContext NULL); // CFRunLoopObserverContext
CFRunLoopRef runLoop = [[NSRunLoop currentRunLoop] getCFRunLoop]; CFRunLoopRef runLoop = [[NSRunLoop currentRunLoop] getCFRunLoop];
CFRunLoopAddObserver(runLoop, busyObserver, kCFRunLoopDefaultMode); CFRunLoopAddObserver(runLoop, busyObserver, kCFRunLoopDefaultMode);
...@@ -95,29 +102,33 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -95,29 +102,33 @@ AWT_ASSERT_APPKIT_THREAD;
CFRelease(busyObserver); CFRelease(busyObserver);
CFRelease(notBusyObserver); CFRelease(notBusyObserver);
if (!headless) setBusy(YES); setBusy(YES);
}
static void setUpAppKitThreadName()
{
BOOL verbose = ShouldPrintVerboseDebugging();
JNIEnv *env = [ThreadUtilities getJNIEnv];
// Set the java name of the AppKit main thread appropriately. // Set the java name of the AppKit main thread appropriately.
jclass threadClass = NULL; jclass threadClass = NULL;
jstring name = NULL; jstring name = NULL;
jobject curThread = NULL; jobject curThread = NULL;
if (!swt_mode) { threadClass = (*env)->FindClass(env, "java/lang/Thread");
threadClass = (*env)->FindClass(env, "java/lang/Thread"); if (threadClass == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
if (threadClass == NULL || (*env)->ExceptionCheck(env)) goto cleanup; jmethodID currentThreadID = (*env)->GetStaticMethodID(env, threadClass, "currentThread", "()Ljava/lang/Thread;");
jmethodID currentThreadID = (*env)->GetStaticMethodID(env, threadClass, "currentThread", "()Ljava/lang/Thread;"); if (currentThreadID == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
if (currentThreadID == NULL || (*env)->ExceptionCheck(env)) goto cleanup; jmethodID setName = (*env)->GetMethodID(env, threadClass, "setName", "(Ljava/lang/String;)V");
jmethodID setName = (*env)->GetMethodID(env, threadClass, "setName", "(Ljava/lang/String;)V"); if (setName == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
if (setName == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
curThread = (*env)->CallStaticObjectMethod(env, threadClass, currentThreadID); // AWT_THREADING Safe (known object)
curThread = (*env)->CallStaticObjectMethod(env, threadClass, currentThreadID); // AWT_THREADING Safe (known object) if (curThread == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
if (curThread == NULL || (*env)->ExceptionCheck(env)) goto cleanup; name = (*env)->NewStringUTF(env, "AWT-AppKit");
name = (*env)->NewStringUTF(env, "AWT-AppKit"); if (name == NULL || (*env)->ExceptionCheck(env)) goto cleanup;
if (name == NULL || (*env)->ExceptionCheck(env)) goto cleanup; (*env)->CallVoidMethod(env, curThread, setName, name); // AWT_THREADING Safe (known object)
(*env)->CallVoidMethod(env, curThread, setName, name); // AWT_THREADING Safe (known object) if ((*env)->ExceptionCheck(env)) goto cleanup;
if ((*env)->ExceptionCheck(env)) goto cleanup;
}
cleanup: cleanup:
if (threadClass != NULL) { if (threadClass != NULL) {
...@@ -134,14 +145,10 @@ cleanup: ...@@ -134,14 +145,10 @@ cleanup:
(*env)->ExceptionClear(env); (*env)->ExceptionClear(env);
} }
// Add the exception handler of last resort
NSSetUncaughtExceptionHandler(AWT_NSUncaughtExceptionHandler);
if (verbose) AWT_DEBUG_LOG(@"finished setting thread name"); if (verbose) AWT_DEBUG_LOG(@"finished setting thread name");
} }
// Returns true if java believes it is running headless // Returns true if java believes it is running headless
BOOL isHeadless(JNIEnv *env) { BOOL isHeadless(JNIEnv *env) {
// Just access the property directly, instead of using GraphicsEnvironment.isHeadless. // Just access the property directly, instead of using GraphicsEnvironment.isHeadless.
...@@ -200,7 +207,7 @@ static void AWT_NSUncaughtExceptionHandler(NSException *exception) { ...@@ -200,7 +207,7 @@ static void AWT_NSUncaughtExceptionHandler(NSException *exception) {
// This is an empty Obj-C object just so that -peformSelectorOnMainThread can be used. // This is an empty Obj-C object just so that -peformSelectorOnMainThread can be used.
@interface AWTStarter : NSObject { } @interface AWTStarter : NSObject { }
+ (void)start:(BOOL)headless swtMode:(BOOL)swtMode swtModeForWebStart:(BOOL)swtModeForWebStart; + (void)start:(BOOL)headless;
- (void)starter:(NSArray*)args; - (void)starter:(NSArray*)args;
+ (void)appKitIsRunning:(id)arg; + (void)appKitIsRunning:(id)arg;
@end @end
...@@ -242,7 +249,7 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -242,7 +249,7 @@ AWT_ASSERT_APPKIT_THREAD;
if (verbose) AWT_DEBUG_LOG(@"finished messaging AppKit started"); if (verbose) AWT_DEBUG_LOG(@"finished messaging AppKit started");
} }
+ (void)start:(BOOL)headless swtMode:(BOOL)swtMode swtModeForWebStart:(BOOL)swtModeForWebStart + (void)start:(BOOL)headless
{ {
BOOL verbose = ShouldPrintVerboseDebugging(); BOOL verbose = ShouldPrintVerboseDebugging();
...@@ -258,7 +265,7 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -258,7 +265,7 @@ AWT_ASSERT_APPKIT_THREAD;
BOOL onMainThread = (pthread_main_np() != 0); BOOL onMainThread = (pthread_main_np() != 0);
if (verbose) { if (verbose) {
NSString *msg = [NSString stringWithFormat:@"+[AWTStarter start headless:%d swtMode:%d swtModeForWebStart:%d] { onMainThread:%d }", headless, swtMode, swtModeForWebStart, onMainThread]; NSString *msg = [NSString stringWithFormat:@"+[AWTStarter start headless:%d] { onMainThread:%d }", headless, onMainThread];
AWT_DEBUG_LOG(msg); AWT_DEBUG_LOG(msg);
} }
...@@ -280,9 +287,7 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -280,9 +287,7 @@ AWT_ASSERT_APPKIT_THREAD;
NSArray * args = [NSArray arrayWithObjects: NSArray * args = [NSArray arrayWithObjects:
[NSNumber numberWithBool: onMainThread], [NSNumber numberWithBool: onMainThread],
[NSNumber numberWithBool: swtMode],
[NSNumber numberWithBool: headless], [NSNumber numberWithBool: headless],
[NSNumber numberWithBool: swtModeForWebStart],
[NSNumber numberWithBool: verbose], [NSNumber numberWithBool: verbose],
nil]; nil];
...@@ -310,39 +315,38 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -310,39 +315,38 @@ AWT_ASSERT_APPKIT_THREAD;
// Don't set the delegate until the NSApplication has been created and // Don't set the delegate until the NSApplication has been created and
// its finishLaunching has initialized it. // its finishLaunching has initialized it.
// ApplicationDelegate is the support code for com.apple.eawt. // ApplicationDelegate is the support code for com.apple.eawt.
void (^setDelegateBlock)() = ^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
OSXAPP_SetApplicationDelegate([ApplicationDelegate sharedDelegate]); OSXAPP_SetApplicationDelegate([ApplicationDelegate sharedDelegate]);
}; }];
if (onMainThread) {
setDelegateBlock();
} else {
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:setDelegateBlock];
}
} }
- (void)starter:(NSArray*)args { - (void)starter:(NSArray*)args {
NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSAutoreleasePool *pool = [NSAutoreleasePool new];
BOOL onMainThread = [[args objectAtIndex:0] boolValue]; BOOL onMainThread = [[args objectAtIndex:0] boolValue];
BOOL swtMode = [[args objectAtIndex:1] boolValue]; BOOL headless = [[args objectAtIndex:1] boolValue];
BOOL headless = [[args objectAtIndex:2] boolValue]; BOOL verbose = [[args objectAtIndex:2] boolValue];
BOOL swtModeForWebStart = [[args objectAtIndex:3] boolValue];
BOOL verbose = [[args objectAtIndex:4] boolValue];
BOOL wasOnMainThread = onMainThread; BOOL wasOnMainThread = onMainThread;
setUpAWTAppKit(swtMode, headless); // Add the exception handler of last resort
NSSetUncaughtExceptionHandler(AWT_NSUncaughtExceptionHandler);
// Headless mode trumps either ordinary AWT or SWT-in-AWT mode. Declare us a daemon and return. // Headless mode trumps either ordinary AWT or SWT-in-AWT mode. Declare us a daemon and return.
if (headless) { if (headless) {
BOOL didBecomeDaemon = [AWTStarter markAppAsDaemon]; if (!forceEmbeddedMode) {
setUpAppKitThreadName();
}
[AWTStarter markAppAsDaemon];
return; return;
} }
if (swtMode || swtModeForWebStart) { if (forceEmbeddedMode) {
if (verbose) NSLog(@"in SWT or SWT/WebStart mode"); if (verbose) NSLog(@"in SWT or SWT/WebStart mode");
// The SWT should call NSApplicationLoad, but they don't know a priori that they will be using the AWT, so they don't. // Init a default NSApplication instance instead of the NSApplicationAWT.
// Note that [NSApp isRunning] will return YES after that, though
// this behavior isn't specified anywhere. We rely on that.
NSApplicationLoad(); NSApplicationLoad();
} }
...@@ -351,6 +355,13 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -351,6 +355,13 @@ AWT_ASSERT_APPKIT_THREAD;
// and -[NSApplication isRunning] returns YES, AWT is embedded inside another // and -[NSApplication isRunning] returns YES, AWT is embedded inside another
// AppKit Application. // AppKit Application.
NSApplication *app = [NSApplicationAWT sharedApplication]; NSApplication *app = [NSApplicationAWT sharedApplication];
isEmbedded = ![NSApp isKindOfClass:[NSApplicationAWT class]];
if (!isEmbedded) {
// Install run loop observers and set the AppKit Java thread name
setUpAWTAppKit();
setUpAppKitThreadName();
}
// AWT gets to this point BEFORE NSApplicationDidFinishLaunchingNotification is sent. // AWT gets to this point BEFORE NSApplicationDidFinishLaunchingNotification is sent.
if (![app isRunning]) { if (![app isRunning]) {
...@@ -360,17 +371,11 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -360,17 +371,11 @@ AWT_ASSERT_APPKIT_THREAD;
[NSApplicationAWT runAWTLoopWithApp: app]; [NSApplicationAWT runAWTLoopWithApp: app];
} else { } else {
// We're either embedded, or showing a splash screen // We're either embedded, or showing a splash screen
if (![NSApp isKindOfClass:[NSApplicationAWT class]]) { if (isEmbedded) {
if (verbose) AWT_DEBUG_LOG(@"running embedded"); if (verbose) AWT_DEBUG_LOG(@"running embedded");
// Since we're embedded, no need to be swamping the runloop with the observers.
CFRunLoopRef runLoop = [[NSRunLoop currentRunLoop] getCFRunLoop];
CFRunLoopRemoveObserver(runLoop, busyObserver, kCFRunLoopDefaultMode);
CFRunLoopRemoveObserver(runLoop, notBusyObserver, kCFRunLoopDefaultMode);
// We don't track if the runloop is busy, so set it free to let AWT finish when it needs // We don't track if the runloop is busy, so set it free to let AWT finish when it needs
setBusy(NO); setBusy(NO);
busyObserver = NULL;
notBusyObserver = NULL;
} else { } else {
if (verbose) AWT_DEBUG_LOG(@"running after showing a splash screen"); if (verbose) AWT_DEBUG_LOG(@"running after showing a splash screen");
} }
...@@ -408,49 +413,28 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { ...@@ -408,49 +413,28 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
return JNI_VERSION_1_4; return JNI_VERSION_1_4;
} }
// The following is true when AWT is attempting to connect to the window server
// when it isn't set up properly to do so.
// BOOL AWTLoadFailure = YES; For now we are skipping this check so i'm commenting out this variable as unused
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
// If -XstartOnFirstThread was used at invocation time, an environment variable will be set. // Launcher sets this env variable if -XstartOnFirstThread is specified
// (See java_md.c for the matching setenv call.) When that happens, we assume the SWT will be in use.
BOOL swt_compatible_mode = NO;
char envVar[80]; char envVar[80];
snprintf(envVar, sizeof(envVar), "JAVA_STARTED_ON_FIRST_THREAD_%d", getpid()); snprintf(envVar, sizeof(envVar), "JAVA_STARTED_ON_FIRST_THREAD_%d", getpid());
if (getenv(envVar) != NULL) { if (getenv(envVar) != NULL) {
swt_compatible_mode = YES; forceEmbeddedMode = YES;
unsetenv(envVar); unsetenv(envVar);
} }
BOOL swt_in_webstart = isSWTInWebStart(env); if (isSWTInWebStart(env)) {
BOOL headless = isHeadless(env); forceEmbeddedMode = YES;
// Make sure we're on the right thread. If not, we still need the JNIEnv to throw an exception.
if (pthread_main_np() != 0 && !swt_compatible_mode && !headless) {
AWT_DEBUG_LOG(@"Apple AWT Java VM was loaded on first thread -- can't start AWT.");
[JNFException raise:env as:kInternalError reason:"Can't start the AWT because Java was started on the first thread. Make sure StartOnFirstThread is "
"not specified in your application's Info.plist or on the command line"];
return JNI_VERSION_1_4;
} }
BOOL headless = isHeadless(env);
// We need to let Foundation know that this is a multithreaded application, if it isn't already. // We need to let Foundation know that this is a multithreaded application, if it isn't already.
if (![NSThread isMultiThreaded]) { if (![NSThread isMultiThreaded]) {
[NSThread detachNewThreadSelector:nil toTarget:nil withObject:nil]; [NSThread detachNewThreadSelector:nil toTarget:nil withObject:nil];
} }
// if (swt_compatible_mode || headless || [AWTStarter isConnectedToWindowServer] || [AWTStarter isRemoteSession]) { [AWTStarter start:headless];
// No need in this check - we will try to launch AWTStarter anyways - to be able to run GUI application remotely
// AWTLoadFailure = NO;
[AWTStarter start:headless swtMode:swt_compatible_mode swtModeForWebStart:swt_in_webstart];
// }
/* if (AWTLoadFailure) { // We will not reach this code anyways
[JNFException raise:env as:kInternalError reason:"Can't connect to window server - not enough permissions."];
} */
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
......
...@@ -98,8 +98,6 @@ do { \ ...@@ -98,8 +98,6 @@ do { \
} \ } \
} while (0) } while (0)
#define AWT_ASSERT_ANY_THREAD
#endif /* AWT_THREAD_ASSERTS_MESSAGES */ #endif /* AWT_THREAD_ASSERTS_MESSAGES */
#ifdef AWT_THREAD_ASSERTS_WAIT #ifdef AWT_THREAD_ASSERTS_WAIT
...@@ -114,15 +112,12 @@ do { \ ...@@ -114,15 +112,12 @@ do { \
while (pthread_main_np() != 0) {} \ while (pthread_main_np() != 0) {} \
} while (0) } while (0)
#define AWT_ASSERT_ANY_THREAD
#endif /* AWT_THREAD_ASSERTS_WAIT */ #endif /* AWT_THREAD_ASSERTS_WAIT */
#else /* AWT_THREAD_ASSERTS */ #else /* AWT_THREAD_ASSERTS */
#define AWT_ASSERT_APPKIT_THREAD do {} while (0) #define AWT_ASSERT_APPKIT_THREAD do {} while (0)
#define AWT_ASSERT_NOT_APPKIT_THREAD do {} while (0) #define AWT_ASSERT_NOT_APPKIT_THREAD do {} while (0)
#define AWT_ASSERT_ANY_THREAD
#endif /* AWT_THREAD_ASSERTS */ #endif /* AWT_THREAD_ASSERTS */
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
...@@ -139,7 +134,10 @@ __attribute__((visibility("default"))) ...@@ -139,7 +134,10 @@ __attribute__((visibility("default")))
+ (JNIEnv*)getJNIEnvUncached; + (JNIEnv*)getJNIEnvUncached;
+ (void)performOnMainThread:(SEL)aSelector onObject:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait awtMode:(BOOL)inAWT; + (void)performOnMainThread:(SEL)aSelector onObject:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait awtMode:(BOOL)inAWT;
//Wrappers for the corresponding JNFRunLoop methods with a check for main thread
+ (void)performOnMainThreadWaiting:(BOOL)wait block:(void (^)())block; + (void)performOnMainThreadWaiting:(BOOL)wait block:(void (^)())block;
+ (void)performOnMainThread:(SEL)aSelector on:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait;
@end @end
void OSXAPP_SetJavaVM(JavaVM *vm); void OSXAPP_SetJavaVM(JavaVM *vm);
......
...@@ -37,27 +37,13 @@ static JNIEnv *appKitEnv = NULL; ...@@ -37,27 +37,13 @@ static JNIEnv *appKitEnv = NULL;
static NSArray *sPerformModes = nil; static NSArray *sPerformModes = nil;
static NSArray *sAWTPerformModes = nil; static NSArray *sAWTPerformModes = nil;
static BOOL sCocoaComponentCompatibility = NO;
static NSTimeInterval sCocoaComponentCompatibilityTimeout = 0.5;
static BOOL sLoggingEnabled = YES; static BOOL sLoggingEnabled = YES;
#ifdef AWT_THREAD_ASSERTS_ENV_ASSERT #ifdef AWT_THREAD_ASSERTS_ENV_ASSERT
int sAWTThreadAsserts = 0; int sAWTThreadAsserts = 0;
#endif /* AWT_THREAD_ASSERTS_ENV_ASSERT */ #endif /* AWT_THREAD_ASSERTS_ENV_ASSERT */
// This is for backward compatibility for those people using CocoaComponent
// Since we've flipped the AWT threading model for Tiger (10.4), all the rules
// for CocoaComponent are wrong.
// So for existing CocoaComponent users, we can't be synchronous.
// Making things totally asynchronous breaks a _lot_, so we try to be
// synchronous and time out after a little bit.
#define NOT_READY 0
#define READY 1
#define IN_PROGRESS 2
BOOL sInPerformFromJava = NO; BOOL sInPerformFromJava = NO;
NSUInteger sPerformCount = 0;
// This class is used so that performSelectorOnMainThread can be // This class is used so that performSelectorOnMainThread can be
// controlled a little more easily by us. It has 2 roles. // controlled a little more easily by us. It has 2 roles.
...@@ -73,8 +59,6 @@ NSUInteger sPerformCount = 0; ...@@ -73,8 +59,6 @@ NSUInteger sPerformCount = 0;
- (id) initWithTarget:(id)target selector:(SEL)selector arg:(id)arg wait:(BOOL)wait; - (id) initWithTarget:(id)target selector:(SEL)selector arg:(id)arg wait:(BOOL)wait;
- (void) perform; - (void) perform;
- (void) performCompatible;
- (void) _performCompatible:(NSConditionLock *)resultLock;
@end @end
...@@ -113,8 +97,6 @@ NSUInteger sPerformCount = 0; ...@@ -113,8 +97,6 @@ NSUInteger sPerformCount = 0;
sInPerformFromJava = YES; sInPerformFromJava = YES;
} }
sPerformCount++;
// Actually do the work (cheat to avoid a method call) // Actually do the work (cheat to avoid a method call)
@try { @try {
objc_msgSend(fTarget, fSelector, fArg); objc_msgSend(fTarget, fSelector, fArg);
...@@ -128,69 +110,6 @@ NSUInteger sPerformCount = 0; ...@@ -128,69 +110,6 @@ NSUInteger sPerformCount = 0;
} }
} }
} }
- (void) performCompatible {
// We check if we are on the AppKit thread because frequently, apps
// using CocoaComponent are doing things on the wrong thread!
if (pthread_main_np()) {
[fTarget performSelector:fSelector withObject:fArg];
} else {
// Setup the lock
NSConditionLock *resultLock =
[[NSConditionLock alloc] initWithCondition:NOT_READY];
// Make sure that if we return early, nothing gets released out
// from under us
[resultLock retain];
[fTarget retain];
[fArg retain];
[self retain];
// Do an asynchronous perform to the main thread.
[self performSelectorOnMainThread:@selector(_performCompatible:)
withObject:resultLock waitUntilDone:NO modes:sAWTPerformModes];
// Wait for a little bit for it to finish
[resultLock lockWhenCondition:READY beforeDate:[NSDate dateWithTimeIntervalSinceNow:sCocoaComponentCompatibilityTimeout]];
// If the _performCompatible is actually in progress,
// we should let it finish
if ([resultLock condition] == IN_PROGRESS) {
[resultLock lockWhenCondition:READY];
}
if ([resultLock condition] == NOT_READY && sLoggingEnabled) {
NSLog(@"[Java CocoaComponent compatibility mode]: Operation timed out due to possible deadlock: selector '%@' on target '%@' with args '%@'", NSStringFromSelector(fSelector), fTarget, fArg);
}
[resultLock unlock];
[resultLock autorelease];
}
}
- (void) _performCompatible:(NSConditionLock *)resultLock {
// notify that the perform is in progress!
[resultLock lock];
[resultLock unlockWithCondition:IN_PROGRESS];
sPerformCount++;
// Actually do the work.
@try {
[fTarget performSelector:fSelector withObject:fArg];
} @catch (NSException *e) {
NSLog(@"*** CPerformer: ignoring exception '%@' raised during performCompatible of selector '%@' on target '%@' with args '%@'", e, NSStringFromSelector(fSelector), fTarget, fArg);
} @finally {
// notify done!
[resultLock lock];
[resultLock unlockWithCondition:READY];
// Clean up after ourselves
[resultLock autorelease];
[fTarget autorelease];
[fArg autorelease];
[self autorelease];
}
}
@end @end
...@@ -236,13 +155,8 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -236,13 +155,8 @@ AWT_ASSERT_APPKIT_THREAD;
// java event thread without deadlocking. See CToolkit.invokeAndWait. // java event thread without deadlocking. See CToolkit.invokeAndWait.
+ (void)performOnMainThread:(SEL)aSelector onObject:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait awtMode:(BOOL)inAWT { + (void)performOnMainThread:(SEL)aSelector onObject:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait awtMode:(BOOL)inAWT {
CPerformer *performer = [[CPerformer alloc] initWithTarget:target selector:aSelector arg:arg wait:wait]; CPerformer *performer = [[CPerformer alloc] initWithTarget:target selector:aSelector arg:arg wait:wait];
if (sCocoaComponentCompatibility && wait && inAWT) { [performer performSelectorOnMainThread:@selector(perform) withObject:nil waitUntilDone:wait modes:((inAWT) ? sAWTPerformModes : sPerformModes)]; // AWT_THREADING Safe (cover method)
[performer performCompatible]; [performer release];
[performer autorelease];
} else {
[performer performSelectorOnMainThread:@selector(perform) withObject:nil waitUntilDone:wait modes:((inAWT) ? sAWTPerformModes : sPerformModes)]; // AWT_THREADING Safe (cover method)
[performer release];
}
} }
+ (void)performOnMainThreadWaiting:(BOOL)wait block:(void (^)())block { + (void)performOnMainThreadWaiting:(BOOL)wait block:(void (^)())block {
...@@ -253,6 +167,14 @@ AWT_ASSERT_APPKIT_THREAD; ...@@ -253,6 +167,14 @@ AWT_ASSERT_APPKIT_THREAD;
} }
} }
+ (void)performOnMainThread:(SEL)aSelector on:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait {
if ([NSThread isMainThread] && wait == YES) {
[target performSelector:aSelector withObject:arg];
} else {
[JNFRunLoop performOnMainThread:aSelector on:target withObject:arg waitUntilDone:wait];
}
}
@end @end
......
...@@ -787,7 +787,6 @@ public class GTKLookAndFeel extends SynthLookAndFeel { ...@@ -787,7 +787,6 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
"List.font", new FontLazyValue(Region.LIST), "List.font", new FontLazyValue(Region.LIST),
"List.rendererUseUIBorder", Boolean.FALSE, "List.rendererUseUIBorder", Boolean.FALSE,
"Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK},
"Menu.arrowIcon", new GTKStyle.GTKLazyValue( "Menu.arrowIcon", new GTKStyle.GTKLazyValue(
"com.sun.java.swing.plaf.gtk.GTKIconFactory", "com.sun.java.swing.plaf.gtk.GTKIconFactory",
"getMenuArrowIcon"), "getMenuArrowIcon"),
......
...@@ -630,8 +630,10 @@ public class MotifLookAndFeel extends BasicLookAndFeel ...@@ -630,8 +630,10 @@ public class MotifLookAndFeel extends BasicLookAndFeel
"Menu.menuPopupOffsetY", new Integer(0), "Menu.menuPopupOffsetY", new Integer(0),
"Menu.submenuPopupOffsetX", new Integer(-2), "Menu.submenuPopupOffsetX", new Integer(-2),
"Menu.submenuPopupOffsetY", new Integer(3), "Menu.submenuPopupOffsetY", new Integer(3),
"Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK, "Menu.shortcutKeys", new int[]{
KeyEvent.META_MASK}, SwingUtilities2.getSystemMnemonicKeyMask(),
KeyEvent.META_MASK
},
"Menu.cancelMode", "hideMenuTree", "Menu.cancelMode", "hideMenuTree",
"MenuBar.border", menuBarBorder, "MenuBar.border", menuBarBorder,
......
...@@ -2619,13 +2619,15 @@ public class WindowsLookAndFeel extends BasicLookAndFeel ...@@ -2619,13 +2619,15 @@ public class WindowsLookAndFeel extends BasicLookAndFeel
private static class FocusColorProperty extends DesktopProperty { private static class FocusColorProperty extends DesktopProperty {
public FocusColorProperty () { public FocusColorProperty () {
// Fallback value is never used bacause of the configureValue method doesn't return null // Fallback value is never used because of the configureValue method doesn't return null
super("win.3d.backgroundColor", Color.BLACK); super("win.3d.backgroundColor", Color.BLACK);
} }
@Override @Override
protected Object configureValue(Object value) { protected Object configureValue(Object value) {
if (! ((Boolean)Toolkit.getDefaultToolkit().getDesktopProperty("win.highContrast.on")).booleanValue()){ Object highContrastOn = Toolkit.getDefaultToolkit().
getDesktopProperty("win.highContrast.on");
if (highContrastOn == null || !((Boolean) highContrastOn).booleanValue()) {
return Color.BLACK; return Color.BLACK;
} }
return Color.BLACK.equals(value) ? Color.WHITE : Color.BLACK; return Color.BLACK.equals(value) ? Color.WHITE : Color.BLACK;
......
...@@ -93,6 +93,11 @@ public class WindowsTreeUI extends BasicTreeUI { ...@@ -93,6 +93,11 @@ public class WindowsTreeUI extends BasicTreeUI {
counter = endRow; counter = endRow;
} }
} }
if (testRect == null) {
return;
}
tree.scrollRectToVisible(new Rectangle(visRect.x, beginY, 1, tree.scrollRectToVisible(new Rectangle(visRect.x, beginY, 1,
testRect.y + testRect.height- testRect.y + testRect.height-
beginY)); beginY));
......
...@@ -300,7 +300,7 @@ public class Button extends Component implements Accessible { ...@@ -300,7 +300,7 @@ public class Button extends Component implements Accessible {
* @since 1.4 * @since 1.4
*/ */
public synchronized ActionListener[] getActionListeners() { public synchronized ActionListener[] getActionListeners() {
return (ActionListener[]) (getListeners(ActionListener.class)); return getListeners(ActionListener.class);
} }
/** /**
......
...@@ -470,7 +470,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { ...@@ -470,7 +470,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible {
* @since 1.4 * @since 1.4
*/ */
public synchronized ItemListener[] getItemListeners() { public synchronized ItemListener[] getItemListeners() {
return (ItemListener[]) (getListeners(ItemListener.class)); return getListeners(ItemListener.class);
} }
/** /**
......
...@@ -85,7 +85,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { ...@@ -85,7 +85,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
* @see #insert(String, int) * @see #insert(String, int)
* @see #remove(String) * @see #remove(String)
*/ */
Vector pItems; Vector<String> pItems;
/** /**
* The index of the current choice for this <code>Choice</code> * The index of the current choice for this <code>Choice</code>
...@@ -129,7 +129,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { ...@@ -129,7 +129,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
*/ */
public Choice() throws HeadlessException { public Choice() throws HeadlessException {
GraphicsEnvironment.checkHeadless(); GraphicsEnvironment.checkHeadless();
pItems = new Vector(); pItems = new Vector<>();
} }
/** /**
...@@ -191,7 +191,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { ...@@ -191,7 +191,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
* be called on the toolkit thread. * be called on the toolkit thread.
*/ */
final String getItemImpl(int index) { final String getItemImpl(int index) {
return (String)pItems.elementAt(index); return pItems.elementAt(index);
} }
/** /**
...@@ -524,7 +524,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { ...@@ -524,7 +524,7 @@ public class Choice extends Component implements ItemSelectable, Accessible {
* @since 1.4 * @since 1.4
*/ */
public synchronized ItemListener[] getItemListeners() { public synchronized ItemListener[] getItemListeners() {
return (ItemListener[])(getListeners(ItemListener.class)); return getListeners(ItemListener.class);
} }
/** /**
......
...@@ -7287,6 +7287,7 @@ public abstract class Component implements ImageObserver, MenuContainer, ...@@ -7287,6 +7287,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
} }
final Set<AWTKeyStroke> getFocusTraversalKeys_NoIDCheck(int id) { final Set<AWTKeyStroke> getFocusTraversalKeys_NoIDCheck(int id) {
// Okay to return Set directly because it is an unmodifiable view // Okay to return Set directly because it is an unmodifiable view
@SuppressWarnings("unchecked")
Set<AWTKeyStroke> keystrokes = (focusTraversalKeys != null) Set<AWTKeyStroke> keystrokes = (focusTraversalKeys != null)
? focusTraversalKeys[id] ? focusTraversalKeys[id]
: null; : null;
......
...@@ -161,7 +161,7 @@ public class Container extends Component { ...@@ -161,7 +161,7 @@ public class Container extends Component {
private boolean focusTraversalPolicyProvider; private boolean focusTraversalPolicyProvider;
// keeps track of the threads that are printing this component // keeps track of the threads that are printing this component
private transient Set printingThreads; private transient Set<Thread> printingThreads;
// True if there is at least one thread that's printing this component // True if there is at least one thread that's printing this component
private transient boolean printing = false; private transient boolean printing = false;
...@@ -275,7 +275,7 @@ public class Container extends Component { ...@@ -275,7 +275,7 @@ public class Container extends Component {
*/ */
public Container() { public Container() {
} }
@SuppressWarnings({"unchecked","rawtypes"})
void initializeFocusTraversalKeys() { void initializeFocusTraversalKeys() {
focusTraversalKeys = new Set[4]; focusTraversalKeys = new Set[4];
} }
...@@ -2006,7 +2006,7 @@ public class Container extends Component { ...@@ -2006,7 +2006,7 @@ public class Container extends Component {
try { try {
synchronized (getObjectLock()) { synchronized (getObjectLock()) {
if (printingThreads == null) { if (printingThreads == null) {
printingThreads = new HashSet(); printingThreads = new HashSet<>();
} }
printingThreads.add(t); printingThreads.add(t);
printing = true; printing = true;
...@@ -2148,7 +2148,7 @@ public class Container extends Component { ...@@ -2148,7 +2148,7 @@ public class Container extends Component {
* @since 1.4 * @since 1.4
*/ */
public synchronized ContainerListener[] getContainerListeners() { public synchronized ContainerListener[] getContainerListeners() {
return (ContainerListener[]) (getListeners(ContainerListener.class)); return getListeners(ContainerListener.class);
} }
/** /**
...@@ -2599,9 +2599,9 @@ public class Container extends Component { ...@@ -2599,9 +2599,9 @@ public class Container extends Component {
if (GraphicsEnvironment.isHeadless()) { if (GraphicsEnvironment.isHeadless()) {
throw new HeadlessException(); throw new HeadlessException();
} }
PointerInfo pi = (PointerInfo)java.security.AccessController.doPrivileged( PointerInfo pi = java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() { new java.security.PrivilegedAction<PointerInfo>() {
public Object run() { public PointerInfo run() {
return MouseInfo.getPointerInfo(); return MouseInfo.getPointerInfo();
} }
} }
...@@ -2682,7 +2682,7 @@ public class Container extends Component { ...@@ -2682,7 +2682,7 @@ public class Container extends Component {
y - comp.y, y - comp.y,
ignoreEnabled); ignoreEnabled);
} else { } else {
comp = comp.locate(x - comp.x, y - comp.y); comp = comp.getComponentAt(x - comp.x, y - comp.y);
} }
if (comp != null && comp.visible && if (comp != null && comp.visible &&
(ignoreEnabled || comp.enabled)) (ignoreEnabled || comp.enabled))
...@@ -2700,7 +2700,7 @@ public class Container extends Component { ...@@ -2700,7 +2700,7 @@ public class Container extends Component {
y - comp.y, y - comp.y,
ignoreEnabled); ignoreEnabled);
} else { } else {
comp = comp.locate(x - comp.x, y - comp.y); comp = comp.getComponentAt(x - comp.x, y - comp.y);
} }
if (comp != null && comp.visible && if (comp != null && comp.visible &&
(ignoreEnabled || comp.enabled)) (ignoreEnabled || comp.enabled))
...@@ -4637,7 +4637,7 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener { ...@@ -4637,7 +4637,7 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
private void startListeningForOtherDrags() { private void startListeningForOtherDrags() {
//System.out.println("Adding AWTEventListener"); //System.out.println("Adding AWTEventListener");
java.security.AccessController.doPrivileged( java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() { new java.security.PrivilegedAction<Object>() {
public Object run() { public Object run() {
nativeContainer.getToolkit().addAWTEventListener( nativeContainer.getToolkit().addAWTEventListener(
LightweightDispatcher.this, LightweightDispatcher.this,
...@@ -4652,7 +4652,7 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener { ...@@ -4652,7 +4652,7 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
private void stopListeningForOtherDrags() { private void stopListeningForOtherDrags() {
//System.out.println("Removing AWTEventListener"); //System.out.println("Removing AWTEventListener");
java.security.AccessController.doPrivileged( java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() { new java.security.PrivilegedAction<Object>() {
public Object run() { public Object run() {
nativeContainer.getToolkit().removeAWTEventListener(LightweightDispatcher.this); nativeContainer.getToolkit().removeAWTEventListener(LightweightDispatcher.this);
return null; return null;
......
...@@ -1047,9 +1047,9 @@ public class Dialog extends Window { ...@@ -1047,9 +1047,9 @@ public class Dialog extends Window {
// if this dialog is toolkit-modal, the filter should be added // if this dialog is toolkit-modal, the filter should be added
// to all EDTs (for all AppContexts) // to all EDTs (for all AppContexts)
if (modalityType == ModalityType.TOOLKIT_MODAL) { if (modalityType == ModalityType.TOOLKIT_MODAL) {
Iterator it = AppContext.getAppContexts().iterator(); Iterator<AppContext> it = AppContext.getAppContexts().iterator();
while (it.hasNext()) { while (it.hasNext()) {
AppContext appContext = (AppContext)it.next(); AppContext appContext = it.next();
if (appContext == showAppContext) { if (appContext == showAppContext) {
continue; continue;
} }
...@@ -1084,9 +1084,9 @@ public class Dialog extends Window { ...@@ -1084,9 +1084,9 @@ public class Dialog extends Window {
// if this dialog is toolkit-modal, its filter must be removed // if this dialog is toolkit-modal, its filter must be removed
// from all EDTs (for all AppContexts) // from all EDTs (for all AppContexts)
if (modalityType == ModalityType.TOOLKIT_MODAL) { if (modalityType == ModalityType.TOOLKIT_MODAL) {
Iterator it = AppContext.getAppContexts().iterator(); Iterator<AppContext> it = AppContext.getAppContexts().iterator();
while (it.hasNext()) { while (it.hasNext()) {
AppContext appContext = (AppContext)it.next(); AppContext appContext = it.next();
if (appContext == showAppContext) { if (appContext == showAppContext) {
continue; continue;
} }
...@@ -1396,7 +1396,7 @@ public class Dialog extends Window { ...@@ -1396,7 +1396,7 @@ public class Dialog extends Window {
if (d.shouldBlock(this)) { if (d.shouldBlock(this)) {
Window w = d; Window w = d;
while ((w != null) && (w != this)) { while ((w != null) && (w != this)) {
w = (Window)(w.getOwner_NoClientCode()); w = w.getOwner_NoClientCode();
} }
if ((w == this) || !shouldBlock(d) || (modalityType.compareTo(d.getModalityType()) < 0)) { if ((w == this) || !shouldBlock(d) || (modalityType.compareTo(d.getModalityType()) < 0)) {
blockers.add(d); blockers.add(d);
...@@ -1611,7 +1611,7 @@ public class Dialog extends Window { ...@@ -1611,7 +1611,7 @@ public class Dialog extends Window {
setModal(modal); setModal(modal);
} }
blockedWindows = new IdentityArrayList(); blockedWindows = new IdentityArrayList<>();
} }
/* /*
......
...@@ -353,7 +353,7 @@ public class Frame extends Window implements MenuContainer { ...@@ -353,7 +353,7 @@ public class Frame extends Window implements MenuContainer {
* @serial * @serial
* @see java.awt.Window#ownedWindowList * @see java.awt.Window#ownedWindowList
*/ */
Vector ownedWindows; Vector<Window> ownedWindows;
private static final String base = "frame"; private static final String base = "frame";
private static int nameCounter = 0; private static int nameCounter = 0;
...@@ -1242,7 +1242,7 @@ public class Frame extends Window implements MenuContainer { ...@@ -1242,7 +1242,7 @@ public class Frame extends Window implements MenuContainer {
// //
if (ownedWindows != null) { if (ownedWindows != null) {
for (int i = 0; i < ownedWindows.size(); i++) { for (int i = 0; i < ownedWindows.size(); i++) {
connectOwnedWindow((Window) ownedWindows.elementAt(i)); connectOwnedWindow(ownedWindows.elementAt(i));
} }
ownedWindows = null; ownedWindows = null;
} }
......
...@@ -416,7 +416,7 @@ public abstract class KeyboardFocusManager ...@@ -416,7 +416,7 @@ public abstract class KeyboardFocusManager
} }
} }
static Set initFocusTraversalKeysSet(String value, Set targetSet) { static Set<AWTKeyStroke> initFocusTraversalKeysSet(String value, Set<AWTKeyStroke> targetSet) {
StringTokenizer tokens = new StringTokenizer(value, ","); StringTokenizer tokens = new StringTokenizer(value, ",");
while (tokens.hasMoreTokens()) { while (tokens.hasMoreTokens()) {
targetSet.add(AWTKeyStroke.getAWTKeyStroke(tokens.nextToken())); targetSet.add(AWTKeyStroke.getAWTKeyStroke(tokens.nextToken()));
......
...@@ -1012,7 +1012,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { ...@@ -1012,7 +1012,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible {
* @since 1.4 * @since 1.4
*/ */
public synchronized AdjustmentListener[] getAdjustmentListeners() { public synchronized AdjustmentListener[] getAdjustmentListeners() {
return (AdjustmentListener[])(getListeners(AdjustmentListener.class)); return getListeners(AdjustmentListener.class);
} }
/** /**
......
...@@ -123,7 +123,7 @@ public class TextArea extends TextComponent { ...@@ -123,7 +123,7 @@ public class TextArea extends TextComponent {
* Cache the Sets of forward and backward traversal keys so we need not * Cache the Sets of forward and backward traversal keys so we need not
* look them up each time. * look them up each time.
*/ */
private static Set forwardTraversalKeys, backwardTraversalKeys; private static Set<AWTKeyStroke> forwardTraversalKeys, backwardTraversalKeys;
/* /*
* JDK 1.1 serialVersionUID * JDK 1.1 serialVersionUID
...@@ -143,10 +143,10 @@ public class TextArea extends TextComponent { ...@@ -143,10 +143,10 @@ public class TextArea extends TextComponent {
} }
forwardTraversalKeys = KeyboardFocusManager.initFocusTraversalKeysSet( forwardTraversalKeys = KeyboardFocusManager.initFocusTraversalKeysSet(
"ctrl TAB", "ctrl TAB",
new HashSet()); new HashSet<AWTKeyStroke>());
backwardTraversalKeys = KeyboardFocusManager.initFocusTraversalKeysSet( backwardTraversalKeys = KeyboardFocusManager.initFocusTraversalKeysSet(
"ctrl shift TAB", "ctrl shift TAB",
new HashSet()); new HashSet<AWTKeyStroke>());
} }
/** /**
......
...@@ -606,7 +606,7 @@ public class TextComponent extends Component implements Accessible { ...@@ -606,7 +606,7 @@ public class TextComponent extends Component implements Accessible {
* @since 1.4 * @since 1.4
*/ */
public synchronized TextListener[] getTextListeners() { public synchronized TextListener[] getTextListeners() {
return (TextListener[])(getListeners(TextListener.class)); return getListeners(TextListener.class);
} }
/** /**
......
...@@ -507,7 +507,7 @@ public class TextField extends TextComponent { ...@@ -507,7 +507,7 @@ public class TextField extends TextComponent {
* @since 1.4 * @since 1.4
*/ */
public synchronized ActionListener[] getActionListeners() { public synchronized ActionListener[] getActionListeners() {
return (ActionListener[])(getListeners(ActionListener.class)); return getListeners(ActionListener.class);
} }
/** /**
......
...@@ -863,7 +863,7 @@ public abstract class Toolkit { ...@@ -863,7 +863,7 @@ public abstract class Toolkit {
new java.security.PrivilegedAction<Void>() { new java.security.PrivilegedAction<Void>() {
public Void run() { public Void run() {
String nm = null; String nm = null;
Class cls = null; Class<?> cls = null;
try { try {
nm = System.getProperty("awt.toolkit"); nm = System.getProperty("awt.toolkit");
try { try {
......
...@@ -441,7 +441,7 @@ public class Window extends Container implements Accessible { ...@@ -441,7 +441,7 @@ public class Window extends Container implements Accessible {
transient Object anchor = new Object(); transient Object anchor = new Object();
static class WindowDisposerRecord implements sun.java2d.DisposerRecord { static class WindowDisposerRecord implements sun.java2d.DisposerRecord {
final WeakReference<Window> owner; final WeakReference<Window> owner;
final WeakReference weakThis; final WeakReference<Window> weakThis;
final WeakReference<AppContext> context; final WeakReference<AppContext> context;
WindowDisposerRecord(AppContext context, Window victim) { WindowDisposerRecord(AppContext context, Window victim) {
owner = new WeakReference<Window>(victim.getOwner()); owner = new WeakReference<Window>(victim.getOwner());
...@@ -1542,6 +1542,7 @@ public class Window extends Container implements Accessible { ...@@ -1542,6 +1542,7 @@ public class Window extends Container implements Accessible {
private static Window[] getWindows(AppContext appContext) { private static Window[] getWindows(AppContext appContext) {
synchronized (Window.class) { synchronized (Window.class) {
Window realCopy[]; Window realCopy[];
@SuppressWarnings("unchecked")
Vector<WeakReference<Window>> windowList = Vector<WeakReference<Window>> windowList =
(Vector<WeakReference<Window>>)appContext.get(Window.class); (Vector<WeakReference<Window>>)appContext.get(Window.class);
if (windowList != null) { if (windowList != null) {
...@@ -1866,7 +1867,7 @@ public class Window extends Container implements Accessible { ...@@ -1866,7 +1867,7 @@ public class Window extends Container implements Accessible {
* @since 1.4 * @since 1.4
*/ */
public synchronized WindowListener[] getWindowListeners() { public synchronized WindowListener[] getWindowListeners() {
return (WindowListener[])(getListeners(WindowListener.class)); return getListeners(WindowListener.class);
} }
/** /**
...@@ -1882,7 +1883,7 @@ public class Window extends Container implements Accessible { ...@@ -1882,7 +1883,7 @@ public class Window extends Container implements Accessible {
* @since 1.4 * @since 1.4
*/ */
public synchronized WindowFocusListener[] getWindowFocusListeners() { public synchronized WindowFocusListener[] getWindowFocusListeners() {
return (WindowFocusListener[])(getListeners(WindowFocusListener.class)); return getListeners(WindowFocusListener.class);
} }
/** /**
...@@ -1898,7 +1899,7 @@ public class Window extends Container implements Accessible { ...@@ -1898,7 +1899,7 @@ public class Window extends Container implements Accessible {
* @since 1.4 * @since 1.4
*/ */
public synchronized WindowStateListener[] getWindowStateListeners() { public synchronized WindowStateListener[] getWindowStateListeners() {
return (WindowStateListener[])(getListeners(WindowStateListener.class)); return getListeners(WindowStateListener.class);
} }
...@@ -2014,7 +2015,6 @@ public class Window extends Container implements Accessible { ...@@ -2014,7 +2015,6 @@ public class Window extends Container implements Accessible {
break; break;
case WindowEvent.WINDOW_STATE_CHANGED: case WindowEvent.WINDOW_STATE_CHANGED:
processWindowStateEvent((WindowEvent)e); processWindowStateEvent((WindowEvent)e);
default:
break; break;
} }
return; return;
...@@ -2382,12 +2382,14 @@ public class Window extends Container implements Accessible { ...@@ -2382,12 +2382,14 @@ public class Window extends Container implements Accessible {
* KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
* @since 1.4 * @since 1.4
*/ */
@SuppressWarnings("unchecked")
public Set<AWTKeyStroke> getFocusTraversalKeys(int id) { public Set<AWTKeyStroke> getFocusTraversalKeys(int id) {
if (id < 0 || id >= KeyboardFocusManager.TRAVERSAL_KEY_LENGTH) { if (id < 0 || id >= KeyboardFocusManager.TRAVERSAL_KEY_LENGTH) {
throw new IllegalArgumentException("invalid focus traversal key identifier"); throw new IllegalArgumentException("invalid focus traversal key identifier");
} }
// Okay to return Set directly because it is an unmodifiable view // Okay to return Set directly because it is an unmodifiable view
@SuppressWarnings("rawtypes")
Set keystrokes = (focusTraversalKeys != null) Set keystrokes = (focusTraversalKeys != null)
? focusTraversalKeys[id] ? focusTraversalKeys[id]
: null; : null;
...@@ -2765,7 +2767,7 @@ public class Window extends Container implements Accessible { ...@@ -2765,7 +2767,7 @@ public class Window extends Container implements Accessible {
/* /*
* Support for tracking all windows owned by this window * Support for tracking all windows owned by this window
*/ */
void addOwnedWindow(WeakReference weakWindow) { void addOwnedWindow(WeakReference<Window> weakWindow) {
if (weakWindow != null) { if (weakWindow != null) {
synchronized(ownedWindowList) { synchronized(ownedWindowList) {
// this if statement should really be an assert, but we don't // this if statement should really be an assert, but we don't
...@@ -2777,7 +2779,7 @@ public class Window extends Container implements Accessible { ...@@ -2777,7 +2779,7 @@ public class Window extends Container implements Accessible {
} }
} }
void removeOwnedWindow(WeakReference weakWindow) { void removeOwnedWindow(WeakReference<Window> weakWindow) {
if (weakWindow != null) { if (weakWindow != null) {
// synchronized block not required since removeElement is // synchronized block not required since removeElement is
// already synchronized // already synchronized
...@@ -2792,6 +2794,7 @@ public class Window extends Container implements Accessible { ...@@ -2792,6 +2794,7 @@ public class Window extends Container implements Accessible {
private void addToWindowList() { private void addToWindowList() {
synchronized (Window.class) { synchronized (Window.class) {
@SuppressWarnings("unchecked")
Vector<WeakReference<Window>> windowList = (Vector<WeakReference<Window>>)appContext.get(Window.class); Vector<WeakReference<Window>> windowList = (Vector<WeakReference<Window>>)appContext.get(Window.class);
if (windowList == null) { if (windowList == null) {
windowList = new Vector<WeakReference<Window>>(); windowList = new Vector<WeakReference<Window>>();
...@@ -2801,8 +2804,9 @@ public class Window extends Container implements Accessible { ...@@ -2801,8 +2804,9 @@ public class Window extends Container implements Accessible {
} }
} }
private static void removeFromWindowList(AppContext context, WeakReference weakThis) { private static void removeFromWindowList(AppContext context, WeakReference<Window> weakThis) {
synchronized (Window.class) { synchronized (Window.class) {
@SuppressWarnings("unchecked")
Vector<WeakReference<Window>> windowList = (Vector<WeakReference<Window>>)context.get(Window.class); Vector<WeakReference<Window>> windowList = (Vector<WeakReference<Window>>)context.get(Window.class);
if (windowList != null) { if (windowList != null) {
windowList.remove(weakThis); windowList.remove(weakThis);
...@@ -2945,7 +2949,7 @@ public class Window extends Container implements Accessible { ...@@ -2945,7 +2949,7 @@ public class Window extends Container implements Accessible {
// Deserialized Windows are not yet visible. // Deserialized Windows are not yet visible.
visible = false; visible = false;
weakThis = new WeakReference(this); weakThis = new WeakReference<>(this);
anchor = new Object(); anchor = new Object();
sun.java2d.Disposer.addRecord(anchor, new WindowDisposerRecord(appContext, this)); sun.java2d.Disposer.addRecord(anchor, new WindowDisposerRecord(appContext, this));
...@@ -2956,7 +2960,7 @@ public class Window extends Container implements Accessible { ...@@ -2956,7 +2960,7 @@ public class Window extends Container implements Accessible {
private void deserializeResources(ObjectInputStream s) private void deserializeResources(ObjectInputStream s)
throws ClassNotFoundException, IOException, HeadlessException { throws ClassNotFoundException, IOException, HeadlessException {
ownedWindowList = new Vector(); ownedWindowList = new Vector<>();
if (windowSerializedDataVersion < 2) { if (windowSerializedDataVersion < 2) {
// Translate old-style focus tracking to new model. For 1.4 and // Translate old-style focus tracking to new model. For 1.4 and
......
...@@ -1153,7 +1153,9 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab ...@@ -1153,7 +1153,9 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
"Menu.menuPopupOffsetY", new Integer(0), "Menu.menuPopupOffsetY", new Integer(0),
"Menu.submenuPopupOffsetX", new Integer(0), "Menu.submenuPopupOffsetX", new Integer(0),
"Menu.submenuPopupOffsetY", new Integer(0), "Menu.submenuPopupOffsetY", new Integer(0),
"Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK}, "Menu.shortcutKeys", new int[]{
SwingUtilities2.getSystemMnemonicKeyMask()
},
"Menu.crossMenuMnemonic", Boolean.TRUE, "Menu.crossMenuMnemonic", Boolean.TRUE,
// Menu.cancelMode affects the cancel menu action behaviour; // Menu.cancelMode affects the cancel menu action behaviour;
// currently supports: // currently supports:
......
...@@ -1879,6 +1879,20 @@ public class BasicTreeUI extends TreeUI ...@@ -1879,6 +1879,20 @@ public class BasicTreeUI extends TreeUI
visRect.x -= i.left; visRect.x -= i.left;
visRect.y -= i.top; visRect.y -= i.top;
} }
// we should consider a non-visible area above
Component component = SwingUtilities.getUnwrappedParent(tree);
if (component instanceof JViewport) {
component = component.getParent();
if (component instanceof JScrollPane) {
JScrollPane pane = (JScrollPane) component;
JScrollBar bar = pane.getHorizontalScrollBar();
if ((bar != null) && bar.isVisible()) {
int height = bar.getHeight();
visRect.y -= height;
visRect.height += height;
}
}
}
preferredSize.width = treeState.getPreferredWidth(visRect); preferredSize.width = treeState.getPreferredWidth(visRect);
} }
else { else {
...@@ -4504,7 +4518,7 @@ public class BasicTreeUI extends TreeUI ...@@ -4504,7 +4518,7 @@ public class BasicTreeUI extends TreeUI
} }
} }
private void home(JTree tree, BasicTreeUI ui, int direction, private void home(JTree tree, final BasicTreeUI ui, int direction,
boolean addToSelection, boolean changeSelection) { boolean addToSelection, boolean changeSelection) {
// disable moving of lead unless in discontiguous mode // disable moving of lead unless in discontiguous mode
...@@ -4514,7 +4528,7 @@ public class BasicTreeUI extends TreeUI ...@@ -4514,7 +4528,7 @@ public class BasicTreeUI extends TreeUI
changeSelection = true; changeSelection = true;
} }
int rowCount = ui.getRowCount(tree); final int rowCount = ui.getRowCount(tree);
if (rowCount > 0) { if (rowCount > 0) {
if(direction == -1) { if(direction == -1) {
...@@ -4566,6 +4580,13 @@ public class BasicTreeUI extends TreeUI ...@@ -4566,6 +4580,13 @@ public class BasicTreeUI extends TreeUI
ui.setLeadSelectionPath(ui.getPathForRow(tree, ui.setLeadSelectionPath(ui.getPathForRow(tree,
rowCount - 1), true); rowCount - 1), true);
} }
if (ui.isLargeModel()){
SwingUtilities.invokeLater(new Runnable() {
public void run() {
ui.ensureRowsAreVisible(rowCount - 1, rowCount - 1);
}
});
}
} }
} }
} }
......
...@@ -88,7 +88,7 @@ public abstract class SurfaceManager { ...@@ -88,7 +88,7 @@ public abstract class SurfaceManager {
imgaccessor.setSurfaceManager(img, mgr); imgaccessor.setSurfaceManager(img, mgr);
} }
private ConcurrentHashMap cacheMap; private ConcurrentHashMap<Object,Object> cacheMap;
/** /**
* Return an arbitrary cached object for an arbitrary cache key. * Return an arbitrary cached object for an arbitrary cache key.
...@@ -123,7 +123,7 @@ public abstract class SurfaceManager { ...@@ -123,7 +123,7 @@ public abstract class SurfaceManager {
if (cacheMap == null) { if (cacheMap == null) {
synchronized (this) { synchronized (this) {
if (cacheMap == null) { if (cacheMap == null) {
cacheMap = new ConcurrentHashMap(2); cacheMap = new ConcurrentHashMap<>(2);
} }
} }
} }
...@@ -245,7 +245,7 @@ public abstract class SurfaceManager { ...@@ -245,7 +245,7 @@ public abstract class SurfaceManager {
synchronized void flush(boolean deaccelerate) { synchronized void flush(boolean deaccelerate) {
if (cacheMap != null) { if (cacheMap != null) {
Iterator i = cacheMap.values().iterator(); Iterator<Object> i = cacheMap.values().iterator();
while (i.hasNext()) { while (i.hasNext()) {
Object o = i.next(); Object o = i.next();
if (o instanceof FlushableCacheData) { if (o instanceof FlushableCacheData) {
......
/*
* 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.misc;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* This annotation marks classes and fields as considered to be contended.
* @since 1.8
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE})
public @interface Contended {
/**
Defines the contention group tag.
*/
String value() default "";
}
/* /*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -147,37 +147,53 @@ class ISO_8859_1 ...@@ -147,37 +147,53 @@ class ISO_8859_1
private final Surrogate.Parser sgp = new Surrogate.Parser(); private final Surrogate.Parser sgp = new Surrogate.Parser();
// JVM may replace this method with intrinsic code.
private static int encodeISOArray(char[] sa, int sp,
byte[] da, int dp, int len)
{
int i = 0;
for (; i < len; i++) {
char c = sa[sp++];
if (c > '\u00FF')
break;
da[dp++] = (byte)c;
}
return i;
}
private CoderResult encodeArrayLoop(CharBuffer src, private CoderResult encodeArrayLoop(CharBuffer src,
ByteBuffer dst) ByteBuffer dst)
{ {
char[] sa = src.array(); char[] sa = src.array();
int sp = src.arrayOffset() + src.position(); int soff = src.arrayOffset();
int sl = src.arrayOffset() + src.limit(); int sp = soff + src.position();
int sl = soff + src.limit();
assert (sp <= sl); assert (sp <= sl);
sp = (sp <= sl ? sp : sl); sp = (sp <= sl ? sp : sl);
byte[] da = dst.array(); byte[] da = dst.array();
int dp = dst.arrayOffset() + dst.position(); int doff = dst.arrayOffset();
int dl = dst.arrayOffset() + dst.limit(); int dp = doff + dst.position();
int dl = doff + dst.limit();
assert (dp <= dl); assert (dp <= dl);
dp = (dp <= dl ? dp : dl); dp = (dp <= dl ? dp : dl);
int dlen = dl - dp;
int slen = sl - sp;
int len = (dlen < slen) ? dlen : slen;
try { try {
while (sp < sl) { int ret = encodeISOArray(sa, sp, da, dp, len);
char c = sa[sp]; sp = sp + ret;
if (c <= '\u00FF') { dp = dp + ret;
if (dp >= dl) if (ret != len) {
return CoderResult.OVERFLOW; if (sgp.parse(sa[sp], sa, sp, sl) < 0)
da[dp++] = (byte)c;
sp++;
continue;
}
if (sgp.parse(c, sa, sp, sl) < 0)
return sgp.error(); return sgp.error();
return sgp.unmappableResult(); return sgp.unmappableResult();
} }
if (len < slen)
return CoderResult.OVERFLOW;
return CoderResult.UNDERFLOW; return CoderResult.UNDERFLOW;
} finally { } finally {
src.position(sp - src.arrayOffset()); src.position(sp - soff);
dst.position(dp - dst.arrayOffset()); dst.position(dp - doff);
} }
} }
...@@ -221,22 +237,25 @@ class ISO_8859_1 ...@@ -221,22 +237,25 @@ class ISO_8859_1
public int encode(char[] src, int sp, int len, byte[] dst) { public int encode(char[] src, int sp, int len, byte[] dst) {
int dp = 0; int dp = 0;
int sl = sp + Math.min(len, dst.length); int slen = Math.min(len, dst.length);
int sl = sp + slen;
while (sp < sl) { while (sp < sl) {
char c = src[sp++]; int ret = encodeISOArray(src, sp, dst, dp, slen);
if (c <= '\u00FF') { sp = sp + ret;
dst[dp++] = (byte)c; dp = dp + ret;
continue; if (ret != slen) {
} char c = src[sp++];
if (Character.isHighSurrogate(c) && sp < sl && if (Character.isHighSurrogate(c) && sp < sl &&
Character.isLowSurrogate(src[sp])) { Character.isLowSurrogate(src[sp])) {
if (len > dst.length) { if (len > dst.length) {
sl++; sl++;
len--; len--;
}
sp++;
} }
sp++; dst[dp++] = repl;
slen = Math.min((sl - sp), (dst.length - dp));
} }
dst[dp++] = repl;
} }
return dp; return dp;
} }
......
...@@ -1879,4 +1879,12 @@ public class SwingUtilities2 { ...@@ -1879,4 +1879,12 @@ public class SwingUtilities2 {
} }
return -1; return -1;
} }
public static int getSystemMnemonicKeyMask() {
Toolkit toolkit = Toolkit.getDefaultToolkit();
if (toolkit instanceof SunToolkit) {
return ((SunToolkit) toolkit).getFocusAcceleratorKeyMask();
}
return InputEvent.ALT_MASK;
}
} }
/* /*
* Copyright (c) 2003, 2011, 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -116,9 +116,6 @@ public class WindowsPlacesBar extends JToolBar ...@@ -116,9 +116,6 @@ public class WindowsPlacesBar extends JToolBar
icon = fsv.getSystemIcon(files[i]); icon = fsv.getSystemIcon(files[i]);
} }
buttons[i] = new JToggleButton(folderName, icon); buttons[i] = new JToggleButton(folderName, icon);
if (isXPPlatform) {
buttons[i].setText("<html><center>"+folderName+"</center></html>");
}
if (isXPStyle) { if (isXPStyle) {
buttons[i].putClientProperty("XPStyle.subAppName", "placesbar"); buttons[i].putClientProperty("XPStyle.subAppName", "placesbar");
} else { } else {
......
# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
# language names # language names
# key is ISO 639 language code # key is ISO 639 language code
sq=shqipe sq=shqip
# country names # country names
# key is ISO 3166 country code # key is ISO 3166 country code
......
long 4
int 4
short 2
ptr 4
Bool 4
Atom 4
Window 4
XExtData.number 0
XExtData.next 4
XExtData.free_private 8
XExtData.private_data 12
XExtData 16
XIMStringConversionCallbackStruct.position 0
XIMStringConversionCallbackStruct.direction 4
XIMStringConversionCallbackStruct.operation 8
XIMStringConversionCallbackStruct.factor 10
XIMStringConversionCallbackStruct.text 12
XIMStringConversionCallbackStruct 16
XkbNewKeyboardNotifyEvent.type 0
XkbNewKeyboardNotifyEvent.serial 4
XkbNewKeyboardNotifyEvent.send_event 8
XkbNewKeyboardNotifyEvent.display 12
XkbNewKeyboardNotifyEvent.time 16
XkbNewKeyboardNotifyEvent.xkb_type 20
XkbNewKeyboardNotifyEvent.device 24
XkbNewKeyboardNotifyEvent.old_device 28
XkbNewKeyboardNotifyEvent.min_key_code 32
XkbNewKeyboardNotifyEvent.max_key_code 36
XkbNewKeyboardNotifyEvent.old_min_key_code 40
XkbNewKeyboardNotifyEvent.old_max_key_code 44
XkbNewKeyboardNotifyEvent.changed 48
XkbNewKeyboardNotifyEvent.req_major 52
XkbNewKeyboardNotifyEvent.req_minor 53
XkbNewKeyboardNotifyEvent 56
XTimeCoord.time 0
XTimeCoord.x 4
XTimeCoord.y 6
XTimeCoord 8
XkbCompatMapNotifyEvent.type 0
XkbCompatMapNotifyEvent.serial 4
XkbCompatMapNotifyEvent.send_event 8
XkbCompatMapNotifyEvent.display 12
XkbCompatMapNotifyEvent.time 16
XkbCompatMapNotifyEvent.xkb_type 20
XkbCompatMapNotifyEvent.device 24
XkbCompatMapNotifyEvent.changed_groups 28
XkbCompatMapNotifyEvent.first_si 32
XkbCompatMapNotifyEvent.num_si 36
XkbCompatMapNotifyEvent.num_total_si 40
XkbCompatMapNotifyEvent 44
XIMStatusDrawCallbackStruct.type 0
XIMStatusDrawCallbackStruct.data 4
XIMStatusDrawCallbackStruct 8
XKeyboardControl.key_click_percent 0
XKeyboardControl.bell_percent 4
XKeyboardControl.bell_pitch 8
XKeyboardControl.bell_duration 12
XKeyboardControl.led 16
XKeyboardControl.led_mode 20
XKeyboardControl.key 24
XKeyboardControl.auto_repeat_mode 28
XKeyboardControl 32
XSelectionClearEvent.type 0
XSelectionClearEvent.serial 4
XSelectionClearEvent.send_event 8
XSelectionClearEvent.display 12
XSelectionClearEvent.window 16
XSelectionClearEvent.selection 20
XSelectionClearEvent.time 24
XSelectionClearEvent 28
XWindowChanges.x 0
XWindowChanges.y 4
XWindowChanges.width 8
XWindowChanges.height 12
XWindowChanges.border_width 16
XWindowChanges.sibling 20
XWindowChanges.stack_mode 24
XWindowChanges 28
XIMPreeditCaretCallbackStruct.position 0
XIMPreeditCaretCallbackStruct.direction 4
XIMPreeditCaretCallbackStruct.style 8
XIMPreeditCaretCallbackStruct 12
XOMCharSetList.charset_count 0
XOMCharSetList.charset_list 4
XOMCharSetList 8
XOMFontInfo.num_font 0
XOMFontInfo.font_struct_list 4
XOMFontInfo.font_name_list 8
XOMFontInfo 12
AwtScreenData.numConfigs 0
AwtScreenData.root 4
AwtScreenData.whitepixel 8
AwtScreenData.blackpixel 12
AwtScreenData.defaultConfig 16
AwtScreenData.configs 20
AwtScreenData 24
XIMHotKeyTrigger.keysym 0
XIMHotKeyTrigger.modifier 4
XIMHotKeyTrigger.modifier_mask 8
XIMHotKeyTrigger 12
XCirculateEvent.type 0
XCirculateEvent.serial 4
XCirculateEvent.send_event 8
XCirculateEvent.display 12
XCirculateEvent.event 16
XCirculateEvent.window 20
XCirculateEvent.place 24
XCirculateEvent 28
Screen.ext_data 0
Screen.display 4
Screen.root 8
Screen.width 12
Screen.height 16
Screen.mwidth 20
Screen.mheight 24
Screen.ndepths 28
Screen.depths 32
Screen.root_depth 36
Screen.root_visual 40
Screen.default_gc 44
Screen.cmap 48
Screen.white_pixel 52
Screen.black_pixel 56
Screen.max_maps 60
Screen.min_maps 64
Screen.backing_store 68
Screen.save_unders 72
Screen.root_input_mask 76
Screen 80
XMapRequestEvent.type 0
XMapRequestEvent.serial 4
XMapRequestEvent.send_event 8
XMapRequestEvent.display 12
XMapRequestEvent.parent 16
XMapRequestEvent.window 20
XMapRequestEvent 24
XIMText.length 0
XIMText.feedback 4
XIMText.encoding_is_wchar 8
XIMText.string 12
XIMText 16
XGraphicsExposeEvent.type 0
XGraphicsExposeEvent.serial 4
XGraphicsExposeEvent.send_event 8
XGraphicsExposeEvent.display 12
XGraphicsExposeEvent.drawable 16
XGraphicsExposeEvent.x 20
XGraphicsExposeEvent.y 24
XGraphicsExposeEvent.width 28
XGraphicsExposeEvent.height 32
XGraphicsExposeEvent.count 36
XGraphicsExposeEvent.major_code 40
XGraphicsExposeEvent.minor_code 44
XGraphicsExposeEvent 48
XEvent.type 0
XEvent.xany 0
XEvent.xkey 0
XEvent.xbutton 0
XEvent.xmotion 0
XEvent.xcrossing 0
XEvent.xfocus 0
XEvent.xexpose 0
XEvent.xgraphicsexpose 0
XEvent.xnoexpose 0
XEvent.xvisibility 0
XEvent.xcreatewindow 0
XEvent.xdestroywindow 0
XEvent.xunmap 0
XEvent.xmap 0
XEvent.xmaprequest 0
XEvent.xreparent 0
XEvent.xconfigure 0
XEvent.xgravity 0
XEvent.xresizerequest 0
XEvent.xconfigurerequest 0
XEvent.xcirculate 0
XEvent.xcirculaterequest 0
XEvent.xproperty 0
XEvent.xselectionclear 0
XEvent.xselectionrequest 0
XEvent.xselection 0
XEvent.xcolormap 0
XEvent.xclient 0
XEvent.xmapping 0
XEvent.xerror 0
XEvent.xkeymap 0
XEvent.pad 0
XEvent 96
XRenderDirectFormat.red 0
XRenderDirectFormat.redMask 2
XRenderDirectFormat.green 4
XRenderDirectFormat.greenMask 6
XRenderDirectFormat.blue 8
XRenderDirectFormat.blueMask 10
XRenderDirectFormat.alpha 12
XRenderDirectFormat.alphaMask 14
XRenderDirectFormat 16
ColorData.awt_Colors 0
ColorData.awt_numICMcolors 4
ColorData.awt_icmLUT 8
ColorData.awt_icmLUT2Colors 12
ColorData.img_grays 16
ColorData.img_clr_tbl 20
ColorData.img_oda_red 24
ColorData.img_oda_green 28
ColorData.img_oda_blue 32
ColorData.pGrayInverseLutData 36
ColorData.screendata 40
ColorData 44
XFontStruct.ext_data 0
XFontStruct.fid 4
XFontStruct.direction 8
XFontStruct.min_char_or_byte2 12
XFontStruct.max_char_or_byte2 16
XFontStruct.min_byte1 20
XFontStruct.max_byte1 24
XFontStruct.all_chars_exist 28
XFontStruct.n_properties 36
XFontStruct.properties 40
XFontStruct.min_bounds 44
XFontStruct.max_bounds 56
XFontStruct.per_char 68
XFontStruct.ascent 72
XFontStruct.descent 76
XFontStruct 80
XExtCodes.extension 0
XExtCodes.major_opcode 4
XExtCodes.first_event 8
XExtCodes.first_error 12
XExtCodes 16
XFontSetExtents.max_ink_extent 0
XFontSetExtents.max_logical_extent 8
XFontSetExtents 16
XSelectionEvent.type 0
XSelectionEvent.serial 4
XSelectionEvent.send_event 8
XSelectionEvent.display 12
XSelectionEvent.requestor 16
XSelectionEvent.selection 20
XSelectionEvent.target 24
XSelectionEvent.property 28
XSelectionEvent.time 32
XSelectionEvent 36
XArc.x 0
XArc.y 2
XArc.width 4
XArc.height 6
XArc.angle1 8
XArc.angle2 10
XArc 12
XErrorEvent.type 0
XErrorEvent.display 4
XErrorEvent.resourceid 8
XErrorEvent.serial 12
XErrorEvent.error_code 16
XErrorEvent.request_code 17
XErrorEvent.minor_code 18
XErrorEvent 20
XConfigureRequestEvent.type 0
XConfigureRequestEvent.serial 4
XConfigureRequestEvent.send_event 8
XConfigureRequestEvent.display 12
XConfigureRequestEvent.parent 16
XConfigureRequestEvent.window 20
XConfigureRequestEvent.x 24
XConfigureRequestEvent.y 28
XConfigureRequestEvent.width 32
XConfigureRequestEvent.height 36
XConfigureRequestEvent.border_width 40
XConfigureRequestEvent.above 44
XConfigureRequestEvent.detail 48
XConfigureRequestEvent.value_mask 52
XConfigureRequestEvent 56
ScreenFormat.ext_data 0
ScreenFormat.depth 4
ScreenFormat.bits_per_pixel 8
ScreenFormat.scanline_pad 12
ScreenFormat 16
XButtonEvent.type 0
XButtonEvent.serial 4
XButtonEvent.send_event 8
XButtonEvent.display 12
XButtonEvent.window 16
XButtonEvent.root 20
XButtonEvent.subwindow 24
XButtonEvent.time 28
XButtonEvent.x 32
XButtonEvent.y 36
XButtonEvent.x_root 40
XButtonEvent.y_root 44
XButtonEvent.state 48
XButtonEvent.button 52
XButtonEvent.same_screen 56
XButtonEvent 60
XFontProp.name 0
XFontProp.card32 4
XFontProp 8
XIMValuesList.count_values 0
XIMValuesList.supported_values 4
XIMValuesList 8
XKeymapEvent.type 0
XKeymapEvent.serial 4
XKeymapEvent.send_event 8
XKeymapEvent.display 12
XKeymapEvent.window 16
XKeymapEvent.key_vector 20
XKeymapEvent 52
XTextItem16.chars 0
XTextItem16.nchars 4
XTextItem16.delta 8
XTextItem16.font 12
XTextItem16 16
XIMPreeditDrawCallbackStruct.caret 0
XIMPreeditDrawCallbackStruct.chg_first 4
XIMPreeditDrawCallbackStruct.chg_length 8
XIMPreeditDrawCallbackStruct.text 12
XIMPreeditDrawCallbackStruct 16
XVisualInfo.visual 0
XVisualInfo.visualid 4
XVisualInfo.screen 8
XVisualInfo.depth 12
XVisualInfo.class 16
XVisualInfo.red_mask 20
XVisualInfo.green_mask 24
XVisualInfo.blue_mask 28
XVisualInfo.colormap_size 32
XVisualInfo.bits_per_rgb 36
XVisualInfo 40
XkbControlsNotifyEvent.type 0
XkbControlsNotifyEvent.serial 4
XkbControlsNotifyEvent.send_event 8
XkbControlsNotifyEvent.display 12
XkbControlsNotifyEvent.time 16
XkbControlsNotifyEvent.xkb_type 20
XkbControlsNotifyEvent.device 24
XkbControlsNotifyEvent.changed_ctrls 28
XkbControlsNotifyEvent.enabled_ctrls 32
XkbControlsNotifyEvent.enabled_ctrl_changes 36
XkbControlsNotifyEvent.num_groups 40
XkbControlsNotifyEvent.keycode 44
XkbControlsNotifyEvent.event_type 45
XkbControlsNotifyEvent.req_major 46
XkbControlsNotifyEvent.req_minor 47
XkbControlsNotifyEvent 48
PropMwmHints.flags 0
PropMwmHints.functions 4
PropMwmHints.decorations 8
PropMwmHints.inputMode 12
PropMwmHints.status 16
PropMwmHints 20
XClientMessageEvent.type 0
XClientMessageEvent.serial 4
XClientMessageEvent.send_event 8
XClientMessageEvent.display 12
XClientMessageEvent.window 16
XClientMessageEvent.message_type 20
XClientMessageEvent.format 24
XClientMessageEvent.data 28
XClientMessageEvent 48
XAnyEvent.type 0
XAnyEvent.serial 4
XAnyEvent.send_event 8
XAnyEvent.display 12
XAnyEvent.window 16
XAnyEvent 20
XkbIndicatorNotifyEvent.type 0
XkbIndicatorNotifyEvent.serial 4
XkbIndicatorNotifyEvent.send_event 8
XkbIndicatorNotifyEvent.display 12
XkbIndicatorNotifyEvent.time 16
XkbIndicatorNotifyEvent.xkb_type 20
XkbIndicatorNotifyEvent.device 24
XkbIndicatorNotifyEvent.changed 28
XkbIndicatorNotifyEvent.state 32
XkbIndicatorNotifyEvent 36
XIMPreeditStateNotifyCallbackStruct.state 0
XIMPreeditStateNotifyCallbackStruct 4
XkbAnyEvent.type 0
XkbAnyEvent.serial 4
XkbAnyEvent.send_event 8
XkbAnyEvent.display 12
XkbAnyEvent.time 16
XkbAnyEvent.xkb_type 20
XkbAnyEvent.device 24
XkbAnyEvent 28
XMotionEvent.type 0
XMotionEvent.serial 4
XMotionEvent.send_event 8
XMotionEvent.display 12
XMotionEvent.window 16
XMotionEvent.root 20
XMotionEvent.subwindow 24
XMotionEvent.time 28
XMotionEvent.x 32
XMotionEvent.y 36
XMotionEvent.x_root 40
XMotionEvent.y_root 44
XMotionEvent.state 48
XMotionEvent.is_hint 52
XMotionEvent.same_screen 56
XMotionEvent 60
XIMHotKeyTriggers.num_hot_key 0
XIMHotKeyTriggers.key 4
XIMHotKeyTriggers 8
XIMStyles.count_styles 0
XIMStyles.supported_styles 4
XIMStyles 8
XkbExtensionDeviceNotifyEvent.type 0
XkbExtensionDeviceNotifyEvent.serial 4
XkbExtensionDeviceNotifyEvent.send_event 8
XkbExtensionDeviceNotifyEvent.display 12
XkbExtensionDeviceNotifyEvent.time 16
XkbExtensionDeviceNotifyEvent.xkb_type 20
XkbExtensionDeviceNotifyEvent.device 24
XkbExtensionDeviceNotifyEvent.reason 28
XkbExtensionDeviceNotifyEvent.supported 32
XkbExtensionDeviceNotifyEvent.unsupported 36
XkbExtensionDeviceNotifyEvent.first_btn 40
XkbExtensionDeviceNotifyEvent.num_btns 44
XkbExtensionDeviceNotifyEvent.leds_defined 48
XkbExtensionDeviceNotifyEvent.led_state 52
XkbExtensionDeviceNotifyEvent.led_class 56
XkbExtensionDeviceNotifyEvent.led_id 60
XkbExtensionDeviceNotifyEvent 64
XwcTextItem.chars 0
XwcTextItem.nchars 4
XwcTextItem.delta 8
XwcTextItem.font_set 12
XwcTextItem 16
XClassHint.res_name 0
XClassHint.res_class 4
XClassHint 8
XChar2b.byte1 0
XChar2b.byte2 1
XChar2b 2
XSetWindowAttributes.background_pixmap 0
XSetWindowAttributes.background_pixel 4
XSetWindowAttributes.border_pixmap 8
XSetWindowAttributes.border_pixel 12
XSetWindowAttributes.bit_gravity 16
XSetWindowAttributes.win_gravity 20
XSetWindowAttributes.backing_store 24
XSetWindowAttributes.backing_planes 28
XSetWindowAttributes.backing_pixel 32
XSetWindowAttributes.save_under 36
XSetWindowAttributes.event_mask 40
XSetWindowAttributes.do_not_propagate_mask 44
XSetWindowAttributes.override_redirect 48
XSetWindowAttributes.colormap 52
XSetWindowAttributes.cursor 56
XSetWindowAttributes 60
XRenderPictFormat.id 0
XRenderPictFormat.type 4
XRenderPictFormat.depth 8
XRenderPictFormat.direct 12
XRenderPictFormat.colormap 28
XRenderPictFormat 32
XReparentEvent.type 0
XReparentEvent.serial 4
XReparentEvent.send_event 8
XReparentEvent.display 12
XReparentEvent.event 16
XReparentEvent.window 20
XReparentEvent.parent 24
XReparentEvent.x 28
XReparentEvent.y 32
XReparentEvent.override_redirect 36
XReparentEvent 40
XCirculateRequestEvent.type 0
XCirculateRequestEvent.serial 4
XCirculateRequestEvent.send_event 8
XCirculateRequestEvent.display 12
XCirculateRequestEvent.parent 16
XCirculateRequestEvent.window 20
XCirculateRequestEvent.place 24
XCirculateRequestEvent 28
XImage.width 0
XImage.height 4
XImage.xoffset 8
XImage.format 12
XImage.data 16
XImage.byte_order 20
XImage.bitmap_unit 24
XImage.bitmap_bit_order 28
XImage.bitmap_pad 32
XImage.depth 36
XImage.bytes_per_line 40
XImage.bits_per_pixel 44
XImage.red_mask 48
XImage.green_mask 52
XImage.blue_mask 56
XImage.obdata 60
XImage.f.create_image 64
XImage.f.destroy_image 68
XImage.f.get_pixel 72
XImage.f.put_pixel 76
XImage.f.sub_image 80
XImage.f.add_pixel 84
XImage 88
XKeyEvent.type 0
XKeyEvent.serial 4
XKeyEvent.send_event 8
XKeyEvent.display 12
XKeyEvent.window 16
XKeyEvent.root 20
XKeyEvent.subwindow 24
XKeyEvent.time 28
XKeyEvent.x 32
XKeyEvent.y 36
XKeyEvent.x_root 40
XKeyEvent.y_root 44
XKeyEvent.state 48
XKeyEvent.keycode 52
XKeyEvent.same_screen 56
XKeyEvent 60
XkbActionMessageEvent.type 0
XkbActionMessageEvent.serial 4
XkbActionMessageEvent.send_event 8
XkbActionMessageEvent.display 12
XkbActionMessageEvent.time 16
XkbActionMessageEvent.xkb_type 20
XkbActionMessageEvent.device 24
XkbActionMessageEvent.keycode 28
XkbActionMessageEvent.press 32
XkbActionMessageEvent.key_event_follows 36
XkbActionMessageEvent.group 40
XkbActionMessageEvent.mods 44
XkbActionMessageEvent.message 48
XkbActionMessageEvent 56
XdbeSwapInfo.swap_window 0
XdbeSwapInfo.swap_action 4
XdbeSwapInfo 8
XTextItem.chars 0
XTextItem.nchars 4
XTextItem.delta 8
XTextItem.font 12
XTextItem 16
XModifierKeymap.max_keypermod 0
XModifierKeymap.modifiermap 4
XModifierKeymap 8
XCharStruct.lbearing 0
XCharStruct.rbearing 2
XCharStruct.width 4
XCharStruct.ascent 6
XCharStruct.descent 8
XCharStruct.attributes 10
XCharStruct 12
XGravityEvent.type 0
XGravityEvent.serial 4
XGravityEvent.send_event 8
XGravityEvent.display 12
XGravityEvent.event 16
XGravityEvent.window 20
XGravityEvent.x 24
XGravityEvent.y 28
XGravityEvent 32
Visual.ext_data 0
Visual.visualid 4
Visual.class 8
Visual.red_mask 12
Visual.green_mask 16
Visual.blue_mask 20
Visual.bits_per_rgb 24
Visual.map_entries 28
Visual 32
XOMOrientation.num_orientation 0
XOMOrientation.orientation 4
XOMOrientation 8
XkbAccessXNotifyEvent.type 0
XkbAccessXNotifyEvent.serial 4
XkbAccessXNotifyEvent.send_event 8
XkbAccessXNotifyEvent.display 12
XkbAccessXNotifyEvent.time 16
XkbAccessXNotifyEvent.xkb_type 20
XkbAccessXNotifyEvent.device 24
XkbAccessXNotifyEvent.detail 28
XkbAccessXNotifyEvent.keycode 32
XkbAccessXNotifyEvent.sk_delay 36
XkbAccessXNotifyEvent.debounce_delay 40
XkbAccessXNotifyEvent 44
XWindowAttributes.x 0
XWindowAttributes.y 4
XWindowAttributes.width 8
XWindowAttributes.height 12
XWindowAttributes.border_width 16
XWindowAttributes.depth 20
XWindowAttributes.visual 24
XWindowAttributes.root 28
XWindowAttributes.class 32
XWindowAttributes.bit_gravity 36
XWindowAttributes.win_gravity 40
XWindowAttributes.backing_store 44
XWindowAttributes.backing_planes 48
XWindowAttributes.backing_pixel 52
XWindowAttributes.save_under 56
XWindowAttributes.colormap 60
XWindowAttributes.map_installed 64
XWindowAttributes.map_state 68
XWindowAttributes.all_event_masks 72
XWindowAttributes.your_event_mask 76
XWindowAttributes.do_not_propagate_mask 80
XWindowAttributes.override_redirect 84
XWindowAttributes.screen 88
XWindowAttributes 92
XmbTextItem.chars 0
XmbTextItem.nchars 4
XmbTextItem.delta 8
XmbTextItem.font_set 12
XmbTextItem 16
XMappingEvent.type 0
XMappingEvent.serial 4
XMappingEvent.send_event 8
XMappingEvent.display 12
XMappingEvent.window 16
XMappingEvent.request 20
XMappingEvent.first_keycode 24
XMappingEvent.count 28
XMappingEvent 32
XSizeHints.flags 0
XSizeHints.x 4
XSizeHints.y 8
XSizeHints.width 12
XSizeHints.height 16
XSizeHints.min_width 20
XSizeHints.min_height 24
XSizeHints.max_width 28
XSizeHints.max_height 32
XSizeHints.width_inc 36
XSizeHints.height_inc 40
XSizeHints.min_aspect.x 44
XSizeHints.min_aspect.y 48
XSizeHints.max_aspect.x 52
XSizeHints.max_aspect.y 56
XSizeHints.base_width 60
XSizeHints.base_height 64
XSizeHints.win_gravity 68
XSizeHints 72
XUnmapEvent.type 0
XUnmapEvent.serial 4
XUnmapEvent.send_event 8
XUnmapEvent.display 12
XUnmapEvent.event 16
XUnmapEvent.window 20
XUnmapEvent.from_configure 24
XUnmapEvent 28
awtImageData.Depth 0
awtImageData.wsImageFormat 4
awtImageData.clrdata 16
awtImageData.convert 48
awtImageData 304
XkbStateNotifyEvent.type 0
XkbStateNotifyEvent.serial 4
XkbStateNotifyEvent.send_event 8
XkbStateNotifyEvent.display 12
XkbStateNotifyEvent.time 16
XkbStateNotifyEvent.xkb_type 20
XkbStateNotifyEvent.device 24
XkbStateNotifyEvent.changed 28
XkbStateNotifyEvent.group 32
XkbStateNotifyEvent.base_group 36
XkbStateNotifyEvent.latched_group 40
XkbStateNotifyEvent.locked_group 44
XkbStateNotifyEvent.mods 48
XkbStateNotifyEvent.base_mods 52
XkbStateNotifyEvent.latched_mods 56
XkbStateNotifyEvent.locked_mods 60
XkbStateNotifyEvent.compat_state 64
XkbStateNotifyEvent.grab_mods 68
XkbStateNotifyEvent.compat_grab_mods 69
XkbStateNotifyEvent.lookup_mods 70
XkbStateNotifyEvent.compat_lookup_mods 71
XkbStateNotifyEvent.ptr_buttons 72
XkbStateNotifyEvent.keycode 76
XkbStateNotifyEvent.event_type 77
XkbStateNotifyEvent.req_major 78
XkbStateNotifyEvent.req_minor 79
XkbStateNotifyEvent 80
XExposeEvent.type 0
XExposeEvent.serial 4
XExposeEvent.send_event 8
XExposeEvent.display 12
XExposeEvent.window 16
XExposeEvent.x 20
XExposeEvent.y 24
XExposeEvent.width 28
XExposeEvent.height 32
XExposeEvent.count 36
XExposeEvent 40
XkbMapNotifyEvent.type 0
XkbMapNotifyEvent.serial 4
XkbMapNotifyEvent.send_event 8
XkbMapNotifyEvent.display 12
XkbMapNotifyEvent.time 16
XkbMapNotifyEvent.xkb_type 20
XkbMapNotifyEvent.device 24
XkbMapNotifyEvent.changed 28
XkbMapNotifyEvent.flags 32
XkbMapNotifyEvent.first_type 36
XkbMapNotifyEvent.num_types 40
XkbMapNotifyEvent.min_key_code 44
XkbMapNotifyEvent.max_key_code 45
XkbMapNotifyEvent.first_key_sym 46
XkbMapNotifyEvent.first_key_act 47
XkbMapNotifyEvent.first_key_behavior 48
XkbMapNotifyEvent.first_key_explicit 49
XkbMapNotifyEvent.first_modmap_key 50
XkbMapNotifyEvent.first_vmodmap_key 51
XkbMapNotifyEvent.num_key_syms 52
XkbMapNotifyEvent.num_key_acts 56
XkbMapNotifyEvent.num_key_behaviors 60
XkbMapNotifyEvent.num_key_explicit 64
XkbMapNotifyEvent.num_modmap_keys 68
XkbMapNotifyEvent.num_vmodmap_keys 72
XkbMapNotifyEvent.vmods 76
XkbMapNotifyEvent 80
XGCValues.function 0
XGCValues.plane_mask 4
XGCValues.foreground 8
XGCValues.background 12
XGCValues.line_width 16
XGCValues.line_style 20
XGCValues.cap_style 24
XGCValues.join_style 28
XGCValues.fill_style 32
XGCValues.fill_rule 36
XGCValues.arc_mode 40
XGCValues.tile 44
XGCValues.stipple 48
XGCValues.ts_x_origin 52
XGCValues.ts_y_origin 56
XGCValues.font 60
XGCValues.subwindow_mode 64
XGCValues.graphics_exposures 68
XGCValues.clip_x_origin 72
XGCValues.clip_y_origin 76
XGCValues.clip_mask 80
XGCValues.dash_offset 84
XGCValues.dashes 88
XGCValues 92
XFocusChangeEvent.type 0
XFocusChangeEvent.serial 4
XFocusChangeEvent.send_event 8
XFocusChangeEvent.display 12
XFocusChangeEvent.window 16
XFocusChangeEvent.mode 20
XFocusChangeEvent.detail 24
XFocusChangeEvent 28
XPixmapFormatValues.depth 0
XPixmapFormatValues.bits_per_pixel 4
XPixmapFormatValues.scanline_pad 8
XPixmapFormatValues 12
XMapEvent.type 0
XMapEvent.serial 4
XMapEvent.send_event 8
XMapEvent.display 12
XMapEvent.event 16
XMapEvent.window 20
XMapEvent.override_redirect 24
XMapEvent 28
XkbBellNotifyEvent.type 0
XkbBellNotifyEvent.serial 4
XkbBellNotifyEvent.send_event 8
XkbBellNotifyEvent.display 12
XkbBellNotifyEvent.time 16
XkbBellNotifyEvent.xkb_type 20
XkbBellNotifyEvent.device 24
XkbBellNotifyEvent.percent 28
XkbBellNotifyEvent.pitch 32
XkbBellNotifyEvent.duration 36
XkbBellNotifyEvent.bell_class 40
XkbBellNotifyEvent.bell_id 44
XkbBellNotifyEvent.name 48
XkbBellNotifyEvent.window 52
XkbBellNotifyEvent.event_only 56
XkbBellNotifyEvent 60
XIMStringConversionText.length 0
XIMStringConversionText.feedback 4
XIMStringConversionText.encoding_is_wchar 8
XIMStringConversionText.string 12
XIMStringConversionText 16
XKeyboardState.key_click_percent 0
XKeyboardState.bell_percent 4
XKeyboardState.bell_pitch 8
XKeyboardState.bell_duration 12
XKeyboardState.led_mask 16
XKeyboardState.global_auto_repeat 20
XKeyboardState.auto_repeats 24
XKeyboardState 56
XkbEvent.type 0
XkbEvent.any 0
XkbEvent.new_kbd 0
XkbEvent.map 0
XkbEvent.state 0
XkbEvent.ctrls 0
XkbEvent.indicators 0
XkbEvent.names 0
XkbEvent.compat 0
XkbEvent.bell 0
XkbEvent.message 0
XkbEvent.accessx 0
XkbEvent.device 0
XkbEvent.core 0
XkbEvent 96
XPoint.x 0
XPoint.y 2
XPoint 4
XSegment.x1 0
XSegment.y1 2
XSegment.x2 4
XSegment.y2 6
XSegment 8
XIconSize.min_width 0
XIconSize.min_height 4
XIconSize.max_width 8
XIconSize.max_height 12
XIconSize.width_inc 16
XIconSize.height_inc 20
XIconSize 24
XIMCallback.client_data 0
XIMCallback.callback 4
XIMCallback 8
XConfigureEvent.type 0
XConfigureEvent.serial 4
XConfigureEvent.send_event 8
XConfigureEvent.display 12
XConfigureEvent.event 16
XConfigureEvent.window 20
XConfigureEvent.x 24
XConfigureEvent.y 28
XConfigureEvent.width 32
XConfigureEvent.height 36
XConfigureEvent.border_width 40
XConfigureEvent.above 44
XConfigureEvent.override_redirect 48
XConfigureEvent 52
XRectangle.x 0
XRectangle.y 2
XRectangle.width 4
XRectangle.height 6
XRectangle 8
XkbNamesNotifyEvent.type 0
XkbNamesNotifyEvent.serial 4
XkbNamesNotifyEvent.send_event 8
XkbNamesNotifyEvent.display 12
XkbNamesNotifyEvent.time 16
XkbNamesNotifyEvent.xkb_type 20
XkbNamesNotifyEvent.device 24
XkbNamesNotifyEvent.changed 28
XkbNamesNotifyEvent.first_type 32
XkbNamesNotifyEvent.num_types 36
XkbNamesNotifyEvent.first_lvl 40
XkbNamesNotifyEvent.num_lvls 44
XkbNamesNotifyEvent.num_aliases 48
XkbNamesNotifyEvent.num_radio_groups 52
XkbNamesNotifyEvent.changed_vmods 56
XkbNamesNotifyEvent.changed_groups 60
XkbNamesNotifyEvent.changed_indicators 64
XkbNamesNotifyEvent.first_key 68
XkbNamesNotifyEvent.num_keys 72
XkbNamesNotifyEvent 76
XCreateWindowEvent.type 0
XCreateWindowEvent.serial 4
XCreateWindowEvent.send_event 8
XCreateWindowEvent.display 12
XCreateWindowEvent.parent 16
XCreateWindowEvent.window 20
XCreateWindowEvent.x 24
XCreateWindowEvent.y 28
XCreateWindowEvent.width 32
XCreateWindowEvent.height 36
XCreateWindowEvent.border_width 40
XCreateWindowEvent.override_redirect 44
XCreateWindowEvent 48
XVisibilityEvent.type 0
XVisibilityEvent.serial 4
XVisibilityEvent.send_event 8
XVisibilityEvent.display 12
XVisibilityEvent.window 16
XVisibilityEvent.state 20
XVisibilityEvent 24
XWMHints.flags 0
XWMHints.initial_state 8
XWMHints.icon_pixmap 12
XWMHints.icon_window 16
XWMHints.icon_x 20
XWMHints.icon_y 24
XWMHints.icon_mask 28
XWMHints.input 4
XWMHints.window_group 32
XWMHints 36
XCrossingEvent.type 0
XCrossingEvent.serial 4
XCrossingEvent.send_event 8
XCrossingEvent.display 12
XCrossingEvent.window 16
XCrossingEvent.root 20
XCrossingEvent.subwindow 24
XCrossingEvent.time 28
XCrossingEvent.x 32
XCrossingEvent.y 36
XCrossingEvent.x_root 40
XCrossingEvent.y_root 44
XCrossingEvent.mode 48
XCrossingEvent.detail 52
XCrossingEvent.same_screen 56
XCrossingEvent.focus 60
XCrossingEvent.state 64
XCrossingEvent 68
XSelectionRequestEvent.type 0
XSelectionRequestEvent.serial 4
XSelectionRequestEvent.send_event 8
XSelectionRequestEvent.display 12
XSelectionRequestEvent.owner 16
XSelectionRequestEvent.requestor 20
XSelectionRequestEvent.selection 24
XSelectionRequestEvent.target 28
XSelectionRequestEvent.property 32
XSelectionRequestEvent.time 36
XSelectionRequestEvent 40
XNoExposeEvent.type 0
XNoExposeEvent.serial 4
XNoExposeEvent.send_event 8
XNoExposeEvent.display 12
XNoExposeEvent.drawable 16
XNoExposeEvent.major_code 20
XNoExposeEvent.minor_code 24
XNoExposeEvent 28
XHostAddress.family 0
XHostAddress.length 4
XHostAddress.address 8
XHostAddress 12
XColormapEvent.type 0
XColormapEvent.serial 4
XColormapEvent.send_event 8
XColormapEvent.display 12
XColormapEvent.window 16
XColormapEvent.colormap 20
XColormapEvent.new 24
XColormapEvent.state 28
XColormapEvent 32
ColorEntry.r 0
ColorEntry.g 1
ColorEntry.b 2
ColorEntry.flags 3
ColorEntry 4
XResizeRequestEvent.type 0
XResizeRequestEvent.serial 4
XResizeRequestEvent.send_event 8
XResizeRequestEvent.display 12
XResizeRequestEvent.window 16
XResizeRequestEvent.width 20
XResizeRequestEvent.height 24
XResizeRequestEvent 28
Depth.depth 0
Depth.nvisuals 4
Depth.visuals 8
Depth 12
XPropertyEvent.type 0
XPropertyEvent.serial 4
XPropertyEvent.send_event 8
XPropertyEvent.display 12
XPropertyEvent.window 16
XPropertyEvent.atom 20
XPropertyEvent.time 24
XPropertyEvent.state 28
XPropertyEvent 32
XDestroyWindowEvent.type 0
XDestroyWindowEvent.serial 4
XDestroyWindowEvent.send_event 8
XDestroyWindowEvent.display 12
XDestroyWindowEvent.event 16
XDestroyWindowEvent.window 20
XDestroyWindowEvent 24
XStandardColormap.colormap 0
XStandardColormap.red_max 4
XStandardColormap.red_mult 8
XStandardColormap.green_max 12
XStandardColormap.green_mult 16
XStandardColormap.blue_max 20
XStandardColormap.blue_mult 24
XStandardColormap.base_pixel 28
XStandardColormap.visualid 32
XStandardColormap.killid 36
XStandardColormap 40
XComposeStatus.compose_ptr 0
XComposeStatus.chars_matched 4
XComposeStatus 8
AwtGraphicsConfigData.awt_depth 0
AwtGraphicsConfigData.awt_cmap 4
AwtGraphicsConfigData.awt_visInfo 8
AwtGraphicsConfigData.awt_num_colors 48
AwtGraphicsConfigData.awtImage 52
AwtGraphicsConfigData.AwtColorMatch 56
AwtGraphicsConfigData.monoImage 60
AwtGraphicsConfigData.monoPixmap 64
AwtGraphicsConfigData.monoPixmapWidth 68
AwtGraphicsConfigData.monoPixmapHeight 72
AwtGraphicsConfigData.monoPixmapGC 76
AwtGraphicsConfigData.pixelStride 80
AwtGraphicsConfigData.color_data 84
AwtGraphicsConfigData.glxInfo 88
AwtGraphicsConfigData.isTranslucencySupported 92
AwtGraphicsConfigData.renderPictFormat 96
AwtGraphicsConfigData 128
XColor.pixel 0
XColor.red 4
XColor.green 6
XColor.blue 8
XColor.flags 10
XColor.pad 11
XColor 12
XTextProperty.value 0
XTextProperty.encoding 4
XTextProperty.format 8
XTextProperty.nitems 12
XTextProperty 16
long 8
int 4
short 2
ptr 8
Bool 4
Atom 8
Window 8
XExtData.number 0
XExtData.next 8
XExtData.free_private 16
XExtData.private_data 24
XExtData 32
XIMStringConversionCallbackStruct.position 0
XIMStringConversionCallbackStruct.direction 4
XIMStringConversionCallbackStruct.operation 8
XIMStringConversionCallbackStruct.factor 10
XIMStringConversionCallbackStruct.text 16
XIMStringConversionCallbackStruct 24
XkbNewKeyboardNotifyEvent.type 0
XkbNewKeyboardNotifyEvent.serial 8
XkbNewKeyboardNotifyEvent.send_event 16
XkbNewKeyboardNotifyEvent.display 24
XkbNewKeyboardNotifyEvent.time 32
XkbNewKeyboardNotifyEvent.xkb_type 40
XkbNewKeyboardNotifyEvent.device 44
XkbNewKeyboardNotifyEvent.old_device 48
XkbNewKeyboardNotifyEvent.min_key_code 52
XkbNewKeyboardNotifyEvent.max_key_code 56
XkbNewKeyboardNotifyEvent.old_min_key_code 60
XkbNewKeyboardNotifyEvent.old_max_key_code 64
XkbNewKeyboardNotifyEvent.changed 68
XkbNewKeyboardNotifyEvent.req_major 72
XkbNewKeyboardNotifyEvent.req_minor 73
XkbNewKeyboardNotifyEvent 80
XTimeCoord.time 0
XTimeCoord.x 8
XTimeCoord.y 10
XTimeCoord 16
XkbCompatMapNotifyEvent.type 0
XkbCompatMapNotifyEvent.serial 8
XkbCompatMapNotifyEvent.send_event 16
XkbCompatMapNotifyEvent.display 24
XkbCompatMapNotifyEvent.time 32
XkbCompatMapNotifyEvent.xkb_type 40
XkbCompatMapNotifyEvent.device 44
XkbCompatMapNotifyEvent.changed_groups 48
XkbCompatMapNotifyEvent.first_si 52
XkbCompatMapNotifyEvent.num_si 56
XkbCompatMapNotifyEvent.num_total_si 60
XkbCompatMapNotifyEvent 64
XIMStatusDrawCallbackStruct.type 0
XIMStatusDrawCallbackStruct.data 8
XIMStatusDrawCallbackStruct 16
XKeyboardControl.key_click_percent 0
XKeyboardControl.bell_percent 4
XKeyboardControl.bell_pitch 8
XKeyboardControl.bell_duration 12
XKeyboardControl.led 16
XKeyboardControl.led_mode 20
XKeyboardControl.key 24
XKeyboardControl.auto_repeat_mode 28
XKeyboardControl 32
XSelectionClearEvent.type 0
XSelectionClearEvent.serial 8
XSelectionClearEvent.send_event 16
XSelectionClearEvent.display 24
XSelectionClearEvent.window 32
XSelectionClearEvent.selection 40
XSelectionClearEvent.time 48
XSelectionClearEvent 56
XWindowChanges.x 0
XWindowChanges.y 4
XWindowChanges.width 8
XWindowChanges.height 12
XWindowChanges.border_width 16
XWindowChanges.sibling 24
XWindowChanges.stack_mode 32
XWindowChanges 40
XIMPreeditCaretCallbackStruct.position 0
XIMPreeditCaretCallbackStruct.direction 4
XIMPreeditCaretCallbackStruct.style 8
XIMPreeditCaretCallbackStruct 12
XOMCharSetList.charset_count 0
XOMCharSetList.charset_list 8
XOMCharSetList 16
XOMFontInfo.num_font 0
XOMFontInfo.font_struct_list 8
XOMFontInfo.font_name_list 16
XOMFontInfo 24
AwtScreenData.numConfigs 0
AwtScreenData.root 8
AwtScreenData.whitepixel 16
AwtScreenData.blackpixel 24
AwtScreenData.defaultConfig 32
AwtScreenData.configs 40
AwtScreenData 48
XIMHotKeyTrigger.keysym 0
XIMHotKeyTrigger.modifier 8
XIMHotKeyTrigger.modifier_mask 12
XIMHotKeyTrigger 16
XCirculateEvent.type 0
XCirculateEvent.serial 8
XCirculateEvent.send_event 16
XCirculateEvent.display 24
XCirculateEvent.event 32
XCirculateEvent.window 40
XCirculateEvent.place 48
XCirculateEvent 56
Screen.ext_data 0
Screen.display 8
Screen.root 16
Screen.width 24
Screen.height 28
Screen.mwidth 32
Screen.mheight 36
Screen.ndepths 40
Screen.depths 48
Screen.root_depth 56
Screen.root_visual 64
Screen.default_gc 72
Screen.cmap 80
Screen.white_pixel 88
Screen.black_pixel 96
Screen.max_maps 104
Screen.min_maps 108
Screen.backing_store 112
Screen.save_unders 116
Screen.root_input_mask 120
Screen 128
XMapRequestEvent.type 0
XMapRequestEvent.serial 8
XMapRequestEvent.send_event 16
XMapRequestEvent.display 24
XMapRequestEvent.parent 32
XMapRequestEvent.window 40
XMapRequestEvent 48
XIMText.length 0
XIMText.feedback 8
XIMText.encoding_is_wchar 16
XIMText.string 24
XIMText 32
XGraphicsExposeEvent.type 0
XGraphicsExposeEvent.serial 8
XGraphicsExposeEvent.send_event 16
XGraphicsExposeEvent.display 24
XGraphicsExposeEvent.drawable 32
XGraphicsExposeEvent.x 40
XGraphicsExposeEvent.y 44
XGraphicsExposeEvent.width 48
XGraphicsExposeEvent.height 52
XGraphicsExposeEvent.count 56
XGraphicsExposeEvent.major_code 60
XGraphicsExposeEvent.minor_code 64
XGraphicsExposeEvent 72
XEvent.type 0
XEvent.xany 0
XEvent.xkey 0
XEvent.xbutton 0
XEvent.xmotion 0
XEvent.xcrossing 0
XEvent.xfocus 0
XEvent.xexpose 0
XEvent.xgraphicsexpose 0
XEvent.xnoexpose 0
XEvent.xvisibility 0
XEvent.xcreatewindow 0
XEvent.xdestroywindow 0
XEvent.xunmap 0
XEvent.xmap 0
XEvent.xmaprequest 0
XEvent.xreparent 0
XEvent.xconfigure 0
XEvent.xgravity 0
XEvent.xresizerequest 0
XEvent.xconfigurerequest 0
XEvent.xcirculate 0
XEvent.xcirculaterequest 0
XEvent.xproperty 0
XEvent.xselectionclear 0
XEvent.xselectionrequest 0
XEvent.xselection 0
XEvent.xcolormap 0
XEvent.xclient 0
XEvent.xmapping 0
XEvent.xerror 0
XEvent.xkeymap 0
XEvent.pad 0
XEvent 192
XRenderDirectFormat.red 0
XRenderDirectFormat.redMask 2
XRenderDirectFormat.green 4
XRenderDirectFormat.greenMask 6
XRenderDirectFormat.blue 8
XRenderDirectFormat.blueMask 10
XRenderDirectFormat.alpha 12
XRenderDirectFormat.alphaMask 14
XRenderDirectFormat 16
ColorData.awt_Colors 0
ColorData.awt_numICMcolors 8
ColorData.awt_icmLUT 16
ColorData.awt_icmLUT2Colors 24
ColorData.img_grays 32
ColorData.img_clr_tbl 40
ColorData.img_oda_red 48
ColorData.img_oda_green 56
ColorData.img_oda_blue 64
ColorData.pGrayInverseLutData 72
ColorData.screendata 80
ColorData 88
XFontStruct.ext_data 0
XFontStruct.fid 8
XFontStruct.direction 16
XFontStruct.min_char_or_byte2 20
XFontStruct.max_char_or_byte2 24
XFontStruct.min_byte1 28
XFontStruct.max_byte1 32
XFontStruct.all_chars_exist 36
XFontStruct.n_properties 44
XFontStruct.properties 48
XFontStruct.min_bounds 56
XFontStruct.max_bounds 68
XFontStruct.per_char 80
XFontStruct.ascent 88
XFontStruct.descent 92
XFontStruct 96
XExtCodes.extension 0
XExtCodes.major_opcode 4
XExtCodes.first_event 8
XExtCodes.first_error 12
XExtCodes 16
XFontSetExtents.max_ink_extent 0
XFontSetExtents.max_logical_extent 8
XFontSetExtents 16
XSelectionEvent.type 0
XSelectionEvent.serial 8
XSelectionEvent.send_event 16
XSelectionEvent.display 24
XSelectionEvent.requestor 32
XSelectionEvent.selection 40
XSelectionEvent.target 48
XSelectionEvent.property 56
XSelectionEvent.time 64
XSelectionEvent 72
XArc.x 0
XArc.y 2
XArc.width 4
XArc.height 6
XArc.angle1 8
XArc.angle2 10
XArc 12
XErrorEvent.type 0
XErrorEvent.display 8
XErrorEvent.resourceid 16
XErrorEvent.serial 24
XErrorEvent.error_code 32
XErrorEvent.request_code 33
XErrorEvent.minor_code 34
XErrorEvent 40
XConfigureRequestEvent.type 0
XConfigureRequestEvent.serial 8
XConfigureRequestEvent.send_event 16
XConfigureRequestEvent.display 24
XConfigureRequestEvent.parent 32
XConfigureRequestEvent.window 40
XConfigureRequestEvent.x 48
XConfigureRequestEvent.y 52
XConfigureRequestEvent.width 56
XConfigureRequestEvent.height 60
XConfigureRequestEvent.border_width 64
XConfigureRequestEvent.above 72
XConfigureRequestEvent.detail 80
XConfigureRequestEvent.value_mask 88
XConfigureRequestEvent 96
ScreenFormat.ext_data 0
ScreenFormat.depth 8
ScreenFormat.bits_per_pixel 12
ScreenFormat.scanline_pad 16
ScreenFormat 24
XButtonEvent.type 0
XButtonEvent.serial 8
XButtonEvent.send_event 16
XButtonEvent.display 24
XButtonEvent.window 32
XButtonEvent.root 40
XButtonEvent.subwindow 48
XButtonEvent.time 56
XButtonEvent.x 64
XButtonEvent.y 68
XButtonEvent.x_root 72
XButtonEvent.y_root 76
XButtonEvent.state 80
XButtonEvent.button 84
XButtonEvent.same_screen 88
XButtonEvent 96
XFontProp.name 0
XFontProp.card32 8
XFontProp 16
XIMValuesList.count_values 0
XIMValuesList.supported_values 8
XIMValuesList 16
XKeymapEvent.type 0
XKeymapEvent.serial 8
XKeymapEvent.send_event 16
XKeymapEvent.display 24
XKeymapEvent.window 32
XKeymapEvent.key_vector 40
XKeymapEvent 72
XTextItem16.chars 0
XTextItem16.nchars 8
XTextItem16.delta 12
XTextItem16.font 16
XTextItem16 24
XIMPreeditDrawCallbackStruct.caret 0
XIMPreeditDrawCallbackStruct.chg_first 4
XIMPreeditDrawCallbackStruct.chg_length 8
XIMPreeditDrawCallbackStruct.text 16
XIMPreeditDrawCallbackStruct 24
XVisualInfo.visual 0
XVisualInfo.visualid 8
XVisualInfo.screen 16
XVisualInfo.depth 20
XVisualInfo.class 24
XVisualInfo.red_mask 32
XVisualInfo.green_mask 40
XVisualInfo.blue_mask 48
XVisualInfo.colormap_size 56
XVisualInfo.bits_per_rgb 60
XVisualInfo 64
XkbControlsNotifyEvent.type 0
XkbControlsNotifyEvent.serial 8
XkbControlsNotifyEvent.send_event 16
XkbControlsNotifyEvent.display 24
XkbControlsNotifyEvent.time 32
XkbControlsNotifyEvent.xkb_type 40
XkbControlsNotifyEvent.device 44
XkbControlsNotifyEvent.changed_ctrls 48
XkbControlsNotifyEvent.enabled_ctrls 52
XkbControlsNotifyEvent.enabled_ctrl_changes 56
XkbControlsNotifyEvent.num_groups 60
XkbControlsNotifyEvent.keycode 64
XkbControlsNotifyEvent.event_type 65
XkbControlsNotifyEvent.req_major 66
XkbControlsNotifyEvent.req_minor 67
XkbControlsNotifyEvent 72
PropMwmHints.flags 0
PropMwmHints.functions 8
PropMwmHints.decorations 16
PropMwmHints.inputMode 24
PropMwmHints.status 32
PropMwmHints 40
XClientMessageEvent.type 0
XClientMessageEvent.serial 8
XClientMessageEvent.send_event 16
XClientMessageEvent.display 24
XClientMessageEvent.window 32
XClientMessageEvent.message_type 40
XClientMessageEvent.format 48
XClientMessageEvent.data 56
XClientMessageEvent 96
XAnyEvent.type 0
XAnyEvent.serial 8
XAnyEvent.send_event 16
XAnyEvent.display 24
XAnyEvent.window 32
XAnyEvent 40
XkbIndicatorNotifyEvent.type 0
XkbIndicatorNotifyEvent.serial 8
XkbIndicatorNotifyEvent.send_event 16
XkbIndicatorNotifyEvent.display 24
XkbIndicatorNotifyEvent.time 32
XkbIndicatorNotifyEvent.xkb_type 40
XkbIndicatorNotifyEvent.device 44
XkbIndicatorNotifyEvent.changed 48
XkbIndicatorNotifyEvent.state 52
XkbIndicatorNotifyEvent 56
XIMPreeditStateNotifyCallbackStruct.state 0
XIMPreeditStateNotifyCallbackStruct 8
XkbAnyEvent.type 0
XkbAnyEvent.serial 8
XkbAnyEvent.send_event 16
XkbAnyEvent.display 24
XkbAnyEvent.time 32
XkbAnyEvent.xkb_type 40
XkbAnyEvent.device 44
XkbAnyEvent 48
XMotionEvent.type 0
XMotionEvent.serial 8
XMotionEvent.send_event 16
XMotionEvent.display 24
XMotionEvent.window 32
XMotionEvent.root 40
XMotionEvent.subwindow 48
XMotionEvent.time 56
XMotionEvent.x 64
XMotionEvent.y 68
XMotionEvent.x_root 72
XMotionEvent.y_root 76
XMotionEvent.state 80
XMotionEvent.is_hint 84
XMotionEvent.same_screen 88
XMotionEvent 96
XIMHotKeyTriggers.num_hot_key 0
XIMHotKeyTriggers.key 8
XIMHotKeyTriggers 16
XIMStyles.count_styles 0
XIMStyles.supported_styles 8
XIMStyles 16
XkbExtensionDeviceNotifyEvent.type 0
XkbExtensionDeviceNotifyEvent.serial 8
XkbExtensionDeviceNotifyEvent.send_event 16
XkbExtensionDeviceNotifyEvent.display 24
XkbExtensionDeviceNotifyEvent.time 32
XkbExtensionDeviceNotifyEvent.xkb_type 40
XkbExtensionDeviceNotifyEvent.device 44
XkbExtensionDeviceNotifyEvent.reason 48
XkbExtensionDeviceNotifyEvent.supported 52
XkbExtensionDeviceNotifyEvent.unsupported 56
XkbExtensionDeviceNotifyEvent.first_btn 60
XkbExtensionDeviceNotifyEvent.num_btns 64
XkbExtensionDeviceNotifyEvent.leds_defined 68
XkbExtensionDeviceNotifyEvent.led_state 72
XkbExtensionDeviceNotifyEvent.led_class 76
XkbExtensionDeviceNotifyEvent.led_id 80
XkbExtensionDeviceNotifyEvent 88
XwcTextItem.chars 0
XwcTextItem.nchars 8
XwcTextItem.delta 12
XwcTextItem.font_set 16
XwcTextItem 24
XClassHint.res_name 0
XClassHint.res_class 8
XClassHint 16
XChar2b.byte1 0
XChar2b.byte2 1
XChar2b 2
XSetWindowAttributes.background_pixmap 0
XSetWindowAttributes.background_pixel 8
XSetWindowAttributes.border_pixmap 16
XSetWindowAttributes.border_pixel 24
XSetWindowAttributes.bit_gravity 32
XSetWindowAttributes.win_gravity 36
XSetWindowAttributes.backing_store 40
XSetWindowAttributes.backing_planes 48
XSetWindowAttributes.backing_pixel 56
XSetWindowAttributes.save_under 64
XSetWindowAttributes.event_mask 72
XSetWindowAttributes.do_not_propagate_mask 80
XSetWindowAttributes.override_redirect 88
XSetWindowAttributes.colormap 96
XSetWindowAttributes.cursor 104
XSetWindowAttributes 112
XRenderPictFormat.id 0
XRenderPictFormat.type 8
XRenderPictFormat.depth 12
XRenderPictFormat.direct 16
XRenderPictFormat.colormap 32
XRenderPictFormat 40
XReparentEvent.type 0
XReparentEvent.serial 8
XReparentEvent.send_event 16
XReparentEvent.display 24
XReparentEvent.event 32
XReparentEvent.window 40
XReparentEvent.parent 48
XReparentEvent.x 56
XReparentEvent.y 60
XReparentEvent.override_redirect 64
XReparentEvent 72
XCirculateRequestEvent.type 0
XCirculateRequestEvent.serial 8
XCirculateRequestEvent.send_event 16
XCirculateRequestEvent.display 24
XCirculateRequestEvent.parent 32
XCirculateRequestEvent.window 40
XCirculateRequestEvent.place 48
XCirculateRequestEvent 56
XImage.width 0
XImage.height 4
XImage.xoffset 8
XImage.format 12
XImage.data 16
XImage.byte_order 24
XImage.bitmap_unit 28
XImage.bitmap_bit_order 32
XImage.bitmap_pad 36
XImage.depth 40
XImage.bytes_per_line 44
XImage.bits_per_pixel 48
XImage.red_mask 56
XImage.green_mask 64
XImage.blue_mask 72
XImage.obdata 80
XImage.f.create_image 88
XImage.f.destroy_image 96
XImage.f.get_pixel 104
XImage.f.put_pixel 112
XImage.f.sub_image 120
XImage.f.add_pixel 128
XImage 136
XKeyEvent.type 0
XKeyEvent.serial 8
XKeyEvent.send_event 16
XKeyEvent.display 24
XKeyEvent.window 32
XKeyEvent.root 40
XKeyEvent.subwindow 48
XKeyEvent.time 56
XKeyEvent.x 64
XKeyEvent.y 68
XKeyEvent.x_root 72
XKeyEvent.y_root 76
XKeyEvent.state 80
XKeyEvent.keycode 84
XKeyEvent.same_screen 88
XKeyEvent 96
XkbActionMessageEvent.type 0
XkbActionMessageEvent.serial 8
XkbActionMessageEvent.send_event 16
XkbActionMessageEvent.display 24
XkbActionMessageEvent.time 32
XkbActionMessageEvent.xkb_type 40
XkbActionMessageEvent.device 44
XkbActionMessageEvent.keycode 48
XkbActionMessageEvent.press 52
XkbActionMessageEvent.key_event_follows 56
XkbActionMessageEvent.group 60
XkbActionMessageEvent.mods 64
XkbActionMessageEvent.message 68
XkbActionMessageEvent 80
XdbeSwapInfo.swap_window 0
XdbeSwapInfo.swap_action 8
XdbeSwapInfo 16
XTextItem.chars 0
XTextItem.nchars 8
XTextItem.delta 12
XTextItem.font 16
XTextItem 24
XModifierKeymap.max_keypermod 0
XModifierKeymap.modifiermap 8
XModifierKeymap 16
XCharStruct.lbearing 0
XCharStruct.rbearing 2
XCharStruct.width 4
XCharStruct.ascent 6
XCharStruct.descent 8
XCharStruct.attributes 10
XCharStruct 12
XGravityEvent.type 0
XGravityEvent.serial 8
XGravityEvent.send_event 16
XGravityEvent.display 24
XGravityEvent.event 32
XGravityEvent.window 40
XGravityEvent.x 48
XGravityEvent.y 52
XGravityEvent 56
Visual.ext_data 0
Visual.visualid 8
Visual.class 16
Visual.red_mask 24
Visual.green_mask 32
Visual.blue_mask 40
Visual.bits_per_rgb 48
Visual.map_entries 52
Visual 56
XOMOrientation.num_orientation 0
XOMOrientation.orientation 8
XOMOrientation 16
XkbAccessXNotifyEvent.type 0
XkbAccessXNotifyEvent.serial 8
XkbAccessXNotifyEvent.send_event 16
XkbAccessXNotifyEvent.display 24
XkbAccessXNotifyEvent.time 32
XkbAccessXNotifyEvent.xkb_type 40
XkbAccessXNotifyEvent.device 44
XkbAccessXNotifyEvent.detail 48
XkbAccessXNotifyEvent.keycode 52
XkbAccessXNotifyEvent.sk_delay 56
XkbAccessXNotifyEvent.debounce_delay 60
XkbAccessXNotifyEvent 64
XWindowAttributes.x 0
XWindowAttributes.y 4
XWindowAttributes.width 8
XWindowAttributes.height 12
XWindowAttributes.border_width 16
XWindowAttributes.depth 20
XWindowAttributes.visual 24
XWindowAttributes.root 32
XWindowAttributes.class 40
XWindowAttributes.bit_gravity 44
XWindowAttributes.win_gravity 48
XWindowAttributes.backing_store 52
XWindowAttributes.backing_planes 56
XWindowAttributes.backing_pixel 64
XWindowAttributes.save_under 72
XWindowAttributes.colormap 80
XWindowAttributes.map_installed 88
XWindowAttributes.map_state 92
XWindowAttributes.all_event_masks 96
XWindowAttributes.your_event_mask 104
XWindowAttributes.do_not_propagate_mask 112
XWindowAttributes.override_redirect 120
XWindowAttributes.screen 128
XWindowAttributes 136
XmbTextItem.chars 0
XmbTextItem.nchars 8
XmbTextItem.delta 12
XmbTextItem.font_set 16
XmbTextItem 24
XMappingEvent.type 0
XMappingEvent.serial 8
XMappingEvent.send_event 16
XMappingEvent.display 24
XMappingEvent.window 32
XMappingEvent.request 40
XMappingEvent.first_keycode 44
XMappingEvent.count 48
XMappingEvent 56
XSizeHints.flags 0
XSizeHints.x 8
XSizeHints.y 12
XSizeHints.width 16
XSizeHints.height 20
XSizeHints.min_width 24
XSizeHints.min_height 28
XSizeHints.max_width 32
XSizeHints.max_height 36
XSizeHints.width_inc 40
XSizeHints.height_inc 44
XSizeHints.min_aspect.x 48
XSizeHints.min_aspect.y 52
XSizeHints.max_aspect.x 56
XSizeHints.max_aspect.y 60
XSizeHints.base_width 64
XSizeHints.base_height 68
XSizeHints.win_gravity 72
XSizeHints 80
XUnmapEvent.type 0
XUnmapEvent.serial 8
XUnmapEvent.send_event 16
XUnmapEvent.display 24
XUnmapEvent.event 32
XUnmapEvent.window 40
XUnmapEvent.from_configure 48
XUnmapEvent 56
awtImageData.Depth 0
awtImageData.wsImageFormat 4
awtImageData.clrdata 16
awtImageData.convert 48
awtImageData 560
XkbStateNotifyEvent.type 0
XkbStateNotifyEvent.serial 8
XkbStateNotifyEvent.send_event 16
XkbStateNotifyEvent.display 24
XkbStateNotifyEvent.time 32
XkbStateNotifyEvent.xkb_type 40
XkbStateNotifyEvent.device 44
XkbStateNotifyEvent.changed 48
XkbStateNotifyEvent.group 52
XkbStateNotifyEvent.base_group 56
XkbStateNotifyEvent.latched_group 60
XkbStateNotifyEvent.locked_group 64
XkbStateNotifyEvent.mods 68
XkbStateNotifyEvent.base_mods 72
XkbStateNotifyEvent.latched_mods 76
XkbStateNotifyEvent.locked_mods 80
XkbStateNotifyEvent.compat_state 84
XkbStateNotifyEvent.grab_mods 88
XkbStateNotifyEvent.compat_grab_mods 89
XkbStateNotifyEvent.lookup_mods 90
XkbStateNotifyEvent.compat_lookup_mods 91
XkbStateNotifyEvent.ptr_buttons 92
XkbStateNotifyEvent.keycode 96
XkbStateNotifyEvent.event_type 97
XkbStateNotifyEvent.req_major 98
XkbStateNotifyEvent.req_minor 99
XkbStateNotifyEvent 104
XExposeEvent.type 0
XExposeEvent.serial 8
XExposeEvent.send_event 16
XExposeEvent.display 24
XExposeEvent.window 32
XExposeEvent.x 40
XExposeEvent.y 44
XExposeEvent.width 48
XExposeEvent.height 52
XExposeEvent.count 56
XExposeEvent 64
XkbMapNotifyEvent.type 0
XkbMapNotifyEvent.serial 8
XkbMapNotifyEvent.send_event 16
XkbMapNotifyEvent.display 24
XkbMapNotifyEvent.time 32
XkbMapNotifyEvent.xkb_type 40
XkbMapNotifyEvent.device 44
XkbMapNotifyEvent.changed 48
XkbMapNotifyEvent.flags 52
XkbMapNotifyEvent.first_type 56
XkbMapNotifyEvent.num_types 60
XkbMapNotifyEvent.min_key_code 64
XkbMapNotifyEvent.max_key_code 65
XkbMapNotifyEvent.first_key_sym 66
XkbMapNotifyEvent.first_key_act 67
XkbMapNotifyEvent.first_key_behavior 68
XkbMapNotifyEvent.first_key_explicit 69
XkbMapNotifyEvent.first_modmap_key 70
XkbMapNotifyEvent.first_vmodmap_key 71
XkbMapNotifyEvent.num_key_syms 72
XkbMapNotifyEvent.num_key_acts 76
XkbMapNotifyEvent.num_key_behaviors 80
XkbMapNotifyEvent.num_key_explicit 84
XkbMapNotifyEvent.num_modmap_keys 88
XkbMapNotifyEvent.num_vmodmap_keys 92
XkbMapNotifyEvent.vmods 96
XkbMapNotifyEvent 104
XGCValues.function 0
XGCValues.plane_mask 8
XGCValues.foreground 16
XGCValues.background 24
XGCValues.line_width 32
XGCValues.line_style 36
XGCValues.cap_style 40
XGCValues.join_style 44
XGCValues.fill_style 48
XGCValues.fill_rule 52
XGCValues.arc_mode 56
XGCValues.tile 64
XGCValues.stipple 72
XGCValues.ts_x_origin 80
XGCValues.ts_y_origin 84
XGCValues.font 88
XGCValues.subwindow_mode 96
XGCValues.graphics_exposures 100
XGCValues.clip_x_origin 104
XGCValues.clip_y_origin 108
XGCValues.clip_mask 112
XGCValues.dash_offset 120
XGCValues.dashes 124
XGCValues 128
XFocusChangeEvent.type 0
XFocusChangeEvent.serial 8
XFocusChangeEvent.send_event 16
XFocusChangeEvent.display 24
XFocusChangeEvent.window 32
XFocusChangeEvent.mode 40
XFocusChangeEvent.detail 44
XFocusChangeEvent 48
XPixmapFormatValues.depth 0
XPixmapFormatValues.bits_per_pixel 4
XPixmapFormatValues.scanline_pad 8
XPixmapFormatValues 12
XMapEvent.type 0
XMapEvent.serial 8
XMapEvent.send_event 16
XMapEvent.display 24
XMapEvent.event 32
XMapEvent.window 40
XMapEvent.override_redirect 48
XMapEvent 56
XkbBellNotifyEvent.type 0
XkbBellNotifyEvent.serial 8
XkbBellNotifyEvent.send_event 16
XkbBellNotifyEvent.display 24
XkbBellNotifyEvent.time 32
XkbBellNotifyEvent.xkb_type 40
XkbBellNotifyEvent.device 44
XkbBellNotifyEvent.percent 48
XkbBellNotifyEvent.pitch 52
XkbBellNotifyEvent.duration 56
XkbBellNotifyEvent.bell_class 60
XkbBellNotifyEvent.bell_id 64
XkbBellNotifyEvent.name 72
XkbBellNotifyEvent.window 80
XkbBellNotifyEvent.event_only 88
XkbBellNotifyEvent 96
XIMStringConversionText.length 0
XIMStringConversionText.feedback 8
XIMStringConversionText.encoding_is_wchar 16
XIMStringConversionText.string 24
XIMStringConversionText 32
XKeyboardState.key_click_percent 0
XKeyboardState.bell_percent 4
XKeyboardState.bell_pitch 8
XKeyboardState.bell_duration 12
XKeyboardState.led_mask 16
XKeyboardState.global_auto_repeat 24
XKeyboardState.auto_repeats 28
XKeyboardState 64
XkbEvent.type 0
XkbEvent.any 0
XkbEvent.new_kbd 0
XkbEvent.map 0
XkbEvent.state 0
XkbEvent.ctrls 0
XkbEvent.indicators 0
XkbEvent.names 0
XkbEvent.compat 0
XkbEvent.bell 0
XkbEvent.message 0
XkbEvent.accessx 0
XkbEvent.device 0
XkbEvent.core 0
XkbEvent 192
XPoint.x 0
XPoint.y 2
XPoint 4
XSegment.x1 0
XSegment.y1 2
XSegment.x2 4
XSegment.y2 6
XSegment 8
XIconSize.min_width 0
XIconSize.min_height 4
XIconSize.max_width 8
XIconSize.max_height 12
XIconSize.width_inc 16
XIconSize.height_inc 20
XIconSize 24
XIMCallback.client_data 0
XIMCallback.callback 8
XIMCallback 16
XConfigureEvent.type 0
XConfigureEvent.serial 8
XConfigureEvent.send_event 16
XConfigureEvent.display 24
XConfigureEvent.event 32
XConfigureEvent.window 40
XConfigureEvent.x 48
XConfigureEvent.y 52
XConfigureEvent.width 56
XConfigureEvent.height 60
XConfigureEvent.border_width 64
XConfigureEvent.above 72
XConfigureEvent.override_redirect 80
XConfigureEvent 88
XRectangle.x 0
XRectangle.y 2
XRectangle.width 4
XRectangle.height 6
XRectangle 8
XkbNamesNotifyEvent.type 0
XkbNamesNotifyEvent.serial 8
XkbNamesNotifyEvent.send_event 16
XkbNamesNotifyEvent.display 24
XkbNamesNotifyEvent.time 32
XkbNamesNotifyEvent.xkb_type 40
XkbNamesNotifyEvent.device 44
XkbNamesNotifyEvent.changed 48
XkbNamesNotifyEvent.first_type 52
XkbNamesNotifyEvent.num_types 56
XkbNamesNotifyEvent.first_lvl 60
XkbNamesNotifyEvent.num_lvls 64
XkbNamesNotifyEvent.num_aliases 68
XkbNamesNotifyEvent.num_radio_groups 72
XkbNamesNotifyEvent.changed_vmods 76
XkbNamesNotifyEvent.changed_groups 80
XkbNamesNotifyEvent.changed_indicators 84
XkbNamesNotifyEvent.first_key 88
XkbNamesNotifyEvent.num_keys 92
XkbNamesNotifyEvent 96
XCreateWindowEvent.type 0
XCreateWindowEvent.serial 8
XCreateWindowEvent.send_event 16
XCreateWindowEvent.display 24
XCreateWindowEvent.parent 32
XCreateWindowEvent.window 40
XCreateWindowEvent.x 48
XCreateWindowEvent.y 52
XCreateWindowEvent.width 56
XCreateWindowEvent.height 60
XCreateWindowEvent.border_width 64
XCreateWindowEvent.override_redirect 68
XCreateWindowEvent 72
XVisibilityEvent.type 0
XVisibilityEvent.serial 8
XVisibilityEvent.send_event 16
XVisibilityEvent.display 24
XVisibilityEvent.window 32
XVisibilityEvent.state 40
XVisibilityEvent 48
XWMHints.flags 0
XWMHints.initial_state 12
XWMHints.icon_pixmap 16
XWMHints.icon_window 24
XWMHints.icon_x 32
XWMHints.icon_y 36
XWMHints.icon_mask 40
XWMHints.input 8
XWMHints.window_group 48
XWMHints 56
XCrossingEvent.type 0
XCrossingEvent.serial 8
XCrossingEvent.send_event 16
XCrossingEvent.display 24
XCrossingEvent.window 32
XCrossingEvent.root 40
XCrossingEvent.subwindow 48
XCrossingEvent.time 56
XCrossingEvent.x 64
XCrossingEvent.y 68
XCrossingEvent.x_root 72
XCrossingEvent.y_root 76
XCrossingEvent.mode 80
XCrossingEvent.detail 84
XCrossingEvent.same_screen 88
XCrossingEvent.focus 92
XCrossingEvent.state 96
XCrossingEvent 104
XSelectionRequestEvent.type 0
XSelectionRequestEvent.serial 8
XSelectionRequestEvent.send_event 16
XSelectionRequestEvent.display 24
XSelectionRequestEvent.owner 32
XSelectionRequestEvent.requestor 40
XSelectionRequestEvent.selection 48
XSelectionRequestEvent.target 56
XSelectionRequestEvent.property 64
XSelectionRequestEvent.time 72
XSelectionRequestEvent 80
XNoExposeEvent.type 0
XNoExposeEvent.serial 8
XNoExposeEvent.send_event 16
XNoExposeEvent.display 24
XNoExposeEvent.drawable 32
XNoExposeEvent.major_code 40
XNoExposeEvent.minor_code 44
XNoExposeEvent 48
XHostAddress.family 0
XHostAddress.length 4
XHostAddress.address 8
XHostAddress 16
XColormapEvent.type 0
XColormapEvent.serial 8
XColormapEvent.send_event 16
XColormapEvent.display 24
XColormapEvent.window 32
XColormapEvent.colormap 40
XColormapEvent.new 48
XColormapEvent.state 52
XColormapEvent 56
ColorEntry.r 0
ColorEntry.g 1
ColorEntry.b 2
ColorEntry.flags 3
ColorEntry 4
XResizeRequestEvent.type 0
XResizeRequestEvent.serial 8
XResizeRequestEvent.send_event 16
XResizeRequestEvent.display 24
XResizeRequestEvent.window 32
XResizeRequestEvent.width 40
XResizeRequestEvent.height 44
XResizeRequestEvent 48
Depth.depth 0
Depth.nvisuals 4
Depth.visuals 8
Depth 16
XPropertyEvent.type 0
XPropertyEvent.serial 8
XPropertyEvent.send_event 16
XPropertyEvent.display 24
XPropertyEvent.window 32
XPropertyEvent.atom 40
XPropertyEvent.time 48
XPropertyEvent.state 56
XPropertyEvent 64
XDestroyWindowEvent.type 0
XDestroyWindowEvent.serial 8
XDestroyWindowEvent.send_event 16
XDestroyWindowEvent.display 24
XDestroyWindowEvent.event 32
XDestroyWindowEvent.window 40
XDestroyWindowEvent 48
XStandardColormap.colormap 0
XStandardColormap.red_max 8
XStandardColormap.red_mult 16
XStandardColormap.green_max 24
XStandardColormap.green_mult 32
XStandardColormap.blue_max 40
XStandardColormap.blue_mult 48
XStandardColormap.base_pixel 56
XStandardColormap.visualid 64
XStandardColormap.killid 72
XStandardColormap 80
XComposeStatus.compose_ptr 0
XComposeStatus.chars_matched 8
XComposeStatus 16
AwtGraphicsConfigData.awt_depth 0
AwtGraphicsConfigData.awt_cmap 8
AwtGraphicsConfigData.awt_visInfo 16
AwtGraphicsConfigData.awt_num_colors 80
AwtGraphicsConfigData.awtImage 88
AwtGraphicsConfigData.AwtColorMatch 96
AwtGraphicsConfigData.monoImage 104
AwtGraphicsConfigData.monoPixmap 112
AwtGraphicsConfigData.monoPixmapWidth 120
AwtGraphicsConfigData.monoPixmapHeight 124
AwtGraphicsConfigData.monoPixmapGC 128
AwtGraphicsConfigData.pixelStride 136
AwtGraphicsConfigData.color_data 144
AwtGraphicsConfigData.glxInfo 152
AwtGraphicsConfigData.isTranslucencySupported 160
AwtGraphicsConfigData.renderPictFormat 168
AwtGraphicsConfigData 208
XColor.pixel 0
XColor.red 8
XColor.green 10
XColor.blue 12
XColor.flags 14
XColor.pad 15
XColor 16
XTextProperty.value 0
XTextProperty.encoding 8
XTextProperty.format 16
XTextProperty.nitems 24
XTextProperty 32
/*
* 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.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.awt.AWTException;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.DisplayMode;
import java.awt.Frame;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Insets;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.Window;
import java.awt.image.BufferedImage;
import sun.awt.SunToolkit;
/**
* @test
* @bug 8003173 7019055
* @summary Full-screen windows should have the proper insets.
* @author Sergey Bylokhov
*/
public final class FullScreenInsets {
private static boolean passed = true;
public static void main(final String[] args) {
final GraphicsEnvironment ge = GraphicsEnvironment
.getLocalGraphicsEnvironment();
final GraphicsDevice[] devices = ge.getScreenDevices();
final Window wGreen = new Frame();
wGreen.setBackground(Color.GREEN);
wGreen.setSize(300, 300);
wGreen.setVisible(true);
sleep();
final Insets iGreen = wGreen.getInsets();
final Dimension sGreen = wGreen.getSize();
final Window wRed = new Frame();
wRed.setBackground(Color.RED);
wRed.setSize(300, 300);
wRed.setVisible(true);
sleep();
final Insets iRed = wGreen.getInsets();
final Dimension sRed = wGreen.getSize();
for (final GraphicsDevice device : devices) {
if (!device.isFullScreenSupported()) {
continue;
}
device.setFullScreenWindow(wGreen);
sleep();
testWindowBounds(device.getDisplayMode(), wGreen);
testColor(wGreen, Color.GREEN);
device.setFullScreenWindow(wRed);
sleep();
testWindowBounds(device.getDisplayMode(), wRed);
testColor(wRed, Color.RED);
device.setFullScreenWindow(null);
sleep();
testInsets(wGreen.getInsets(), iGreen);
testInsets(wRed.getInsets(), iRed);
testSize(wGreen.getSize(), sGreen);
testSize(wRed.getSize(), sRed);
}
wGreen.dispose();
wRed.dispose();
if (!passed) {
throw new RuntimeException("Test failed");
}
}
private static void testSize(final Dimension actual, final Dimension exp) {
if (!exp.equals(actual)) {
System.err.println(" Wrong window size:" +
" Expected: " + exp + " Actual: " + actual);
passed = false;
}
}
private static void testInsets(final Insets actual, final Insets exp) {
if (!actual.equals(exp)) {
System.err.println(" Wrong window insets:" +
" Expected: " + exp + " Actual: " + actual);
passed = false;
}
}
private static void testWindowBounds(final DisplayMode dm, final Window w) {
if (w.getWidth() != dm.getWidth() || w.getHeight() != dm.getHeight()) {
System.err.println(" Wrong window bounds:" +
" Expected: width = " + dm.getWidth()
+ ", height = " + dm.getHeight() + " Actual: "
+ w.getSize());
passed = false;
}
}
private static void testColor(final Window w, final Color color) {
final Robot r;
try {
r = new Robot(w.getGraphicsConfiguration().getDevice());
} catch (AWTException e) {
e.printStackTrace();
passed = false;
return;
}
final BufferedImage bi = r.createScreenCapture(w.getBounds());
for (int y = 0; y < bi.getHeight(); y++) {
for (int x = 0; x < bi.getWidth(); x++) {
if (bi.getRGB(x, y) != color.getRGB()) {
System.err.println(
"Incorrect pixel at " + x + "x" + y + " : " +
Integer.toHexString(bi.getRGB(x, y)) +
" ,expected : " + Integer.toHexString(
color.getRGB()));
passed = false;
return;
}
}
}
}
private static void sleep() {
((SunToolkit) Toolkit.getDefaultToolkit()).realSync();
try {
Thread.sleep(2000);
} catch (InterruptedException ignored) {
}
}
}
...@@ -36,6 +36,7 @@ import java.applet.Applet; ...@@ -36,6 +36,7 @@ import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import test.java.awt.regtesthelpers.Util; import test.java.awt.regtesthelpers.Util;
import sun.awt.OSInfo;
public class SubMenuShowTest extends Applet { public class SubMenuShowTest extends Applet {
Robot robot; Robot robot;
...@@ -86,6 +87,11 @@ public class SubMenuShowTest extends Applet { ...@@ -86,6 +87,11 @@ public class SubMenuShowTest extends Applet {
frame.setVisible(true); frame.setVisible(true);
Util.waitForIdle(robot); Util.waitForIdle(robot);
boolean isMacOSX = (OSInfo.getOSType() == OSInfo.OSType.MACOSX);
if (isMacOSX) {
robot.keyPress(KeyEvent.VK_CONTROL);
robot.delay(20);
}
robot.keyPress(KeyEvent.VK_ALT); robot.keyPress(KeyEvent.VK_ALT);
robot.delay(20); robot.delay(20);
robot.keyPress(KeyEvent.VK_F); robot.keyPress(KeyEvent.VK_F);
...@@ -93,6 +99,10 @@ public class SubMenuShowTest extends Applet { ...@@ -93,6 +99,10 @@ public class SubMenuShowTest extends Applet {
robot.keyRelease(KeyEvent.VK_F); robot.keyRelease(KeyEvent.VK_F);
robot.delay(20); robot.delay(20);
robot.keyRelease(KeyEvent.VK_ALT); robot.keyRelease(KeyEvent.VK_ALT);
if (isMacOSX) {
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.delay(20);
}
Util.waitForIdle(robot); Util.waitForIdle(robot);
robot.keyPress(KeyEvent.VK_M); robot.keyPress(KeyEvent.VK_M);
......
...@@ -180,10 +180,22 @@ public class TestTypeResolver { ...@@ -180,10 +180,22 @@ public class TestTypeResolver {
return null; // not used return null; // not used
} }
public <T extends Annotation> T[] getAnnotations(Class<T> annotationClass) {
return null; // not used
}
public Annotation[] getAnnotations() { public Annotation[] getAnnotations() {
return null; // not used return null; // not used
} }
public <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass) {
return null; // not used
}
public <T extends Annotation> T[] getDeclaredAnnotations(Class<T> annotationClass) {
return null; // not used
}
public Annotation[] getDeclaredAnnotations() { public Annotation[] getDeclaredAnnotations() {
return null; // not used return null; // not used
} }
......
/*
* 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.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
@bug 8006417
@summary JComboBox.showPopup(), hidePopup() fails in JRE 1.7 on OS X
@author Anton Litvinov
*/
import java.awt.*;
import javax.swing.*;
import javax.swing.plaf.metal.*;
import sun.awt.SunToolkit;
public class ShowPopupAfterHidePopupTest {
private static JFrame frame = null;
private static JComboBox comboBox = null;
private static boolean popupIsVisible = false;
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(new MetalLookAndFeel());
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
frame = new JFrame("Popup Menu of JComboBox");
comboBox = new JComboBox(new String[]{"Item1", "Item2", "Item3"});
frame.getContentPane().add(comboBox);
frame.pack();
frame.setVisible(true);
}
});
final SunToolkit toolkit = (SunToolkit)Toolkit.getDefaultToolkit();
toolkit.realSync();
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
comboBox.showPopup();
comboBox.hidePopup();
comboBox.showPopup();
}
});
toolkit.realSync();
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
popupIsVisible = comboBox.isPopupVisible();
frame.dispose();
}
});
if (!popupIsVisible) {
throw new RuntimeException("Calling hidePopup() affected the next call to showPopup().");
}
}
}
/*
* 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.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6817933
* @summary Tests that HTMLEditorKit does not affect JFileChooser
* @author Sergey Malenkov
*/
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Point;
import java.awt.Robot;
import java.awt.Toolkit;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JToggleButton;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.StyleSheet;
import sun.awt.SunToolkit;
import sun.swing.WindowsPlacesBar;
public class Test6817933 {
private static final String STYLE = "BODY {background:red}";
private static final Color COLOR = Color.RED;
private static JFileChooser chooser;
public static void main(String[] args) throws Exception {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
}
catch (Exception exception) {
exception.printStackTrace();
return; // ignore test on non-Windows machines
}
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
StyleSheet css = new StyleSheet();
css.addRule(STYLE);
HTMLEditorKit kit = new HTMLEditorKit();
kit.setStyleSheet(css);
JFrame frame = new JFrame(STYLE);
frame.add(chooser = new JFileChooser());
frame.setSize(640, 480);
frame.setVisible(true);
}
});
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
toolkit.realSync(500);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
try {
JToggleButton button = get(JToggleButton.class,
get(WindowsPlacesBar.class, chooser));
int width = button.getWidth();
int height = button.getHeight() / 3;
Point point = new Point(0, height * 2);
SwingUtilities.convertPointToScreen(point, button);
width += point.x;
height += point.y;
int count = 0;
Robot robot = new Robot();
for (int x = point.x; x < width; x++) {
for (int y = point.y; y < height; y++) {
count += COLOR.equals(robot.getPixelColor(x, y)) ? -2 : 1;
}
}
if (count < 0) {
throw new Exception("TEST ERROR: a lot of red pixels");
}
}
catch (Exception exception) {
throw new Error(exception);
}
finally {
SwingUtilities.getWindowAncestor(chooser).dispose();
}
}
});
}
private static <T> T get(Class<? extends T> type, Container container) {
Component component = container.getComponent(0);
if (!type.isAssignableFrom(component.getClass())) {
throw new IllegalStateException("expected " + type + "; expected " + component.getClass());
}
return (T) component;
}
}
/*
* 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.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8003400
* @summary Tests that JTree shows the last row
* @author Sergey Malenkov
* @run main/othervm Test8003400
* @run main/othervm Test8003400 reverse
* @run main/othervm Test8003400 system
* @run main/othervm Test8003400 system reverse
*/
import sun.awt.SunToolkit;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.tree.DefaultMutableTreeNode;
public class Test8003400 {
private static final String TITLE = "Test JTree with a large model";
private static List<String> OBJECTS = Arrays.asList(TITLE, "x", "y", "z");
private static JScrollPane pane;
public static void main(String[] args) throws Exception {
for (String arg : args) {
if (arg.equals("reverse")) {
Collections.reverse(OBJECTS);
}
if (arg.equals("system")) {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
}
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
DefaultMutableTreeNode root = new DefaultMutableTreeNode();
JTree tree = new JTree(root);
tree.setLargeModel(true);
tree.setRowHeight(16);
JFrame frame = new JFrame(TITLE);
frame.add(pane = new JScrollPane(tree));
frame.setSize(200, 100);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setVisible(true);
for (String object : OBJECTS) {
root.add(new DefaultMutableTreeNode(object));
}
tree.expandRow(0);
}
});
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
toolkit.realSync(500);
new Robot().keyPress(KeyEvent.VK_END);
toolkit.realSync(500);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
JTree tree = (JTree) pane.getViewport().getView();
Rectangle inner = tree.getRowBounds(tree.getRowCount() - 1);
Rectangle outer = SwingUtilities.convertRectangle(tree, inner, pane);
outer.y += tree.getRowHeight() - 1 - pane.getVerticalScrollBar().getHeight();
// error reporting only for automatic testing
if (null != System.getProperty("test.src", null)) {
SwingUtilities.getWindowAncestor(pane).dispose();
if (outer.y != 0) {
throw new Error("TEST FAILED: " + outer.y);
}
}
}
});
}
}
/*
* 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.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8004298
* @summary NPE in WindowsTreeUI.ensureRowsAreVisible
* @author Alexander Scherbatiy
* @library ../../regtesthelpers
* @build Util
* @run main bug8004298
*/
import java.awt.*;
import java.awt.event.InputEvent;
import javax.swing.*;
import javax.swing.tree.*;
import java.util.concurrent.Callable;
import sun.awt.SunToolkit;
import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import com.sun.java.swing.plaf.windows.WindowsTreeUI;
public class bug8004298 {
private static JTree tree;
public static void main(String[] args) throws Exception {
Robot robot = new Robot();
robot.setAutoDelay(50);
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
UIManager.setLookAndFeel(new WindowsLookAndFeel());
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
createAndShowGUI();
}
});
toolkit.realSync();
Point point = Util.invokeOnEDT(new Callable<Point>() {
@Override
public Point call() throws Exception {
Rectangle rect = tree.getRowBounds(2);
Point p = new Point(rect.x + rect.width / 2, rect.y + rect.height / 2);
SwingUtilities.convertPointToScreen(p, tree);
return p;
}
});
robot.mouseMove(point.x, point.y);
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
toolkit.realSync();
}
private static void createAndShowGUI() {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
root.add(new DefaultMutableTreeNode("colors"));
DefaultMutableTreeNode sports = new DefaultMutableTreeNode("sports");
sports.add(new DefaultMutableTreeNode("basketball"));
sports.add(new DefaultMutableTreeNode("football"));
root.add(sports);
tree = new JTree(root);
tree.setUI(new NullReturningTreeUI());
frame.getContentPane().add(tree);
frame.pack();
frame.setVisible(true);
}
private static final class NullReturningTreeUI extends WindowsTreeUI {
@Override
public Rectangle getPathBounds(JTree tree, TreePath path) {
// the method can return null and callers have to be ready for
// that. Simulate the case by returning null for unknown reason.
if (path != null && path.toString().contains("football")) {
return null;
}
return super.getPathBounds(tree, path);
}
}
}
\ No newline at end of file
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4726194 7124209
* @summary Tests for 4726194
* @author Phil Milne
*/
import java.awt.*;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
import java.util.List;
import javax.swing.*;
public class bug4726194 {
private static String[] hConstraints = {SpringLayout.WEST, "Width", SpringLayout.EAST, SpringLayout.HORIZONTAL_CENTER};
private static String[] vConstraints = {SpringLayout.NORTH, "Height", SpringLayout.SOUTH, SpringLayout.VERTICAL_CENTER, SpringLayout.BASELINE};
private static int[] FAIL = new int[3];
private static boolean TEST_DUPLICATES = false;
public static void main(String[] args) {
try {
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
int minLevel = 2;
int maxLevel = 2;
for (int i = minLevel; i <= maxLevel; i++) {
test(i, true);
test(i, false);
}
}
});
} catch (InterruptedException | InvocationTargetException ex) {
ex.printStackTrace();
throw new RuntimeException("FAILED: SwingUtilities.invokeAndWait method failed!");
}
}
public static void test(int level, boolean horizontal) {
List result = new ArrayList();
String[] constraints = horizontal ? hConstraints : vConstraints;
test(level, constraints, result, Arrays.asList(new Object[level]));
JTextField tf = new JTextField("");
tf.setFont(new Font("Dialog", Font.PLAIN, 6));
System.out.print("\t\t");
for (int j = 0; j < constraints.length; j++) {
String constraint = constraints[j];
System.out.print(constraint + " ".substring(constraint.length()));
}
System.out.println("");
for (int i = 0; i < result.size(); i++) {
SpringLayout.Constraints c = new SpringLayout.Constraints(tf);
List cc = (List) result.get(i);
for (int j = 0; j < cc.size(); j++) {
String constraint = (String) cc.get(j);
c.setConstraint(constraint, Spring.constant((j + 1) * 10));
}
System.out.print(" Input:\t\t");
for (int j = 0; j < constraints.length; j++) {
String constraint = constraints[j];
int jj = cc.indexOf(constraint);
String val = cc.contains(constraint) ? Integer.toString((jj + 1) * 10) : "?";
System.out.print(val + "\t\t");
}
System.out.println("");
System.out.print("Output:\t\t");
for (int j = 0; j < constraints.length; j++) {
String constraint = constraints[j];
Spring spring = c.getConstraint(constraint);
String springVal = (spring == null) ? "?" : Integer.toString(spring.getValue());
System.out.print(springVal);
System.out.print("\t\t");
}
for (int j = 0; j < cc.size(); j++) {
String constraint = (String) cc.get(j);
Spring con = c.getConstraint(constraint);
if (con == null || con.getValue() != (j + 1) * 10) {
throw new RuntimeException("Values are wrong!!! ");
}
}
if (horizontal) {
int[] a1 = getValues(c, new String[]{SpringLayout.WEST, SpringLayout.WIDTH, SpringLayout.EAST});
if (a1[0] + a1[1] != a1[2]) {
throw new RuntimeException("WEST + WIDTH != EAST!!! ");
}
int[] a2 = getValues(c, new String[]{SpringLayout.WEST, SpringLayout.WIDTH, SpringLayout.HORIZONTAL_CENTER});
if (a2[0] + a2[1] / 2 != a2[2]) {
throw new RuntimeException("WEST + WIDTH/2 != HORIZONTAL_CENTER!!! ");
}
} else {
int[] a3 = getValues(c, new String[]{SpringLayout.NORTH, SpringLayout.HEIGHT, SpringLayout.SOUTH});
if (a3[0] + a3[1] != a3[2]) {
throw new RuntimeException("NORTH + HEIGHT != SOUTH!!! ");
}
int[] a4 = getValues(c, new String[]{SpringLayout.NORTH, SpringLayout.HEIGHT, SpringLayout.VERTICAL_CENTER});
int vcDiff = Math.abs(a4[0] + a4[1] / 2 - a4[2]);
if (vcDiff > 1) {
throw new RuntimeException("NORTH + HEIGHT/2 != VERTICAL_CENTER!!! ");
}
int[] a5 = getValues(c, new String[]{SpringLayout.NORTH, SpringLayout.BASELINE, SpringLayout.SOUTH});
if (a5[0] > a5[1] != a5[1] > a5[2]) {
throw new RuntimeException("BASELINE is not in the range: [NORTH, SOUTH]!!!");
}
}
System.out.println("");
}
System.out.println("");
}
private static int[] getValues(SpringLayout.Constraints con, String[] cNames) {
int[] result = new int[cNames.length];
for (int i = 0; i < cNames.length; i++) {
String name = cNames[i];
Spring s = con.getConstraint(name);
if (s == null) {
System.out.print("Warning: " + name + " is undefined. ");
return FAIL;
}
result[i] = s.getValue();
}
return result;
}
public static void test(int level, String[] constraints, List result, List soFar) {
if (level == 0) {
result.add(soFar);
return;
}
for (int i = 0; i < constraints.length; i++) {
if (soFar.contains(constraints[i]) && !TEST_DUPLICATES) {
continue;
}
List child = new ArrayList(soFar);
child.set(level - 1, constraints[i]);
test(level - 1, constraints, result, child);
}
}
}
...@@ -8794,3 +8794,6 @@ FormatData/zh_TW/islamic.DatePatterns/0=GGGGy\u5e74M\u6708d\u65e5EEEE ...@@ -8794,3 +8794,6 @@ FormatData/zh_TW/islamic.DatePatterns/0=GGGGy\u5e74M\u6708d\u65e5EEEE
FormatData/zh_TW/islamic.DatePatterns/1=GGGGy\u5e74M\u6708d\u65e5 FormatData/zh_TW/islamic.DatePatterns/1=GGGGy\u5e74M\u6708d\u65e5
FormatData/zh_TW/islamic.DatePatterns/2=GGGGy/M/d FormatData/zh_TW/islamic.DatePatterns/2=GGGGy/M/d
FormatData/zh_TW/islamic.DatePatterns/3=GGGGy/M/d FormatData/zh_TW/islamic.DatePatterns/3=GGGGy/M/d
# bug 7114053
LocaleNames/sq/sq=shqip
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
* 6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 6916787 * 6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 6916787
* 6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495 * 6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495
* 7003124 7085757 7028073 7171028 7189611 8000983 7195759 8004489 8006509 * 7003124 7085757 7028073 7171028 7189611 8000983 7195759 8004489 8006509
* 7114053
* @summary Verify locale data * @summary Verify locale data
* *
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册