提交 185375c6 编写于 作者: L lana

Merge

...@@ -205,3 +205,5 @@ dfb40f066c6ce129822f0f5dc2ac89173808781a jdk8-b80 ...@@ -205,3 +205,5 @@ dfb40f066c6ce129822f0f5dc2ac89173808781a jdk8-b80
c0f8022eba536dcdc8aae659005b33f3982b9368 jdk8-b81 c0f8022eba536dcdc8aae659005b33f3982b9368 jdk8-b81
624bcb4800065c6656171948e31ebb2925f25c7a jdk8-b82 624bcb4800065c6656171948e31ebb2925f25c7a jdk8-b82
ac519af51769e92c51b597a730974e8607357709 jdk8-b83 ac519af51769e92c51b597a730974e8607357709 jdk8-b83
7b4721e4edb4e1c65e9c839a70d7cc67f81c7632 jdk8-b84
296676d534c52888c36e305a2bf7f345c4ca70f8 jdk8-b85
...@@ -316,6 +316,8 @@ JAVA_JAVA_java = \ ...@@ -316,6 +316,8 @@ JAVA_JAVA_java = \
java/util/concurrent/BrokenBarrierException.java \ java/util/concurrent/BrokenBarrierException.java \
java/util/concurrent/Callable.java \ java/util/concurrent/Callable.java \
java/util/concurrent/CancellationException.java \ java/util/concurrent/CancellationException.java \
java/util/concurrent/CompletableFuture.java \
java/util/concurrent/CompletionException.java \
java/util/concurrent/CompletionService.java \ java/util/concurrent/CompletionService.java \
java/util/concurrent/ConcurrentHashMap.java \ java/util/concurrent/ConcurrentHashMap.java \
java/util/concurrent/ConcurrentLinkedDeque.java \ java/util/concurrent/ConcurrentLinkedDeque.java \
......
...@@ -136,8 +136,7 @@ define SetupDemo ...@@ -136,8 +136,7 @@ define SetupDemo
$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/$6share/demo/$2/$1/,$7))) $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/$6share/demo/$2/$1/,$7)))
ifneq ($7,) ifneq ($7,)
$(JDK_OUTPUTDIR)/demo/$2/$1/% : $(JDK_TOPDIR)/src/$6share/demo/$2/$1/% $(JDK_OUTPUTDIR)/demo/$2/$1/% : $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%
$(MKDIR) -p $$(@D) $$(call install-file)
$(CP) $$< $$@
$(CHMOD) -f ug+w $$@ $(CHMOD) -f ug+w $$@
BUILD_DEMOS += $$($1_COPY_TARGETS) BUILD_DEMOS += $$($1_COPY_TARGETS)
...@@ -190,8 +189,7 @@ ifndef OPENJDK ...@@ -190,8 +189,7 @@ ifndef OPENJDK
$(JDK_OUTPUTDIR)/demo/nbproject/%,\ $(JDK_OUTPUTDIR)/demo/nbproject/%,\
$(call CacheFind,$(JDK_TOPDIR)/src/closed/share/demo/nbproject)) $(call CacheFind,$(JDK_TOPDIR)/src/closed/share/demo/nbproject))
$(JDK_OUTPUTDIR)/demo/nbproject/% : $(JDK_TOPDIR)/src/closed/share/demo/nbproject/% $(JDK_OUTPUTDIR)/demo/nbproject/% : $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@
$(CHMOD) -f ug+w $@ $(CHMOD) -f ug+w $@
endif endif
...@@ -268,8 +266,7 @@ define SetupJVMTIDemo ...@@ -268,8 +266,7 @@ define SetupJVMTIDemo
ZIP:=$(JDK_OUTPUTDIR)/demo/jvmti/$1/src.zip)) ZIP:=$(JDK_OUTPUTDIR)/demo/jvmti/$1/src.zip))
$(JDK_OUTPUTDIR)/demo/jvmti/$1/README.txt : $(JDK_TOPDIR)/src/share/demo/jvmti/$1/README.txt $(JDK_OUTPUTDIR)/demo/jvmti/$1/README.txt : $(JDK_TOPDIR)/src/share/demo/jvmti/$1/README.txt
$(MKDIR) -p $$(@D) $$(call install-file)
$(CP) $$< $$@
$(CHMOD) -f ug+w $$@ $(CHMOD) -f ug+w $$@
ifneq (,$$(wildcard $(JDK_TOPDIR)/src/share/demo/jvmti/$1/*.java)) ifneq (,$$(wildcard $(JDK_TOPDIR)/src/share/demo/jvmti/$1/*.java))
...@@ -325,23 +322,22 @@ JPDA_SOURCES:=$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/tools/exa ...@@ -325,23 +322,22 @@ JPDA_SOURCES:=$(call CacheFind,$(JDK_TOPDIR)/src/share/classes/com/sun/tools/exa
JPDA_FILES:=$(subst $(JDK_TOPDIR)/src/share/classes/,,$(JPDA_SOURCES)) JPDA_FILES:=$(subst $(JDK_TOPDIR)/src/share/classes/,,$(JPDA_SOURCES))
$(JDK_OUTPUTDIR)/demo/jpda/src.zip : $(JPDA_SOURCES) $(JDK_OUTPUTDIR)/demo/jpda/src.zip : $(JPDA_SOURCES)
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
(cd $(JDK_TOPDIR)/src/share/classes && $(ZIP) -qru $@ com -i "com/sun/tools/example/*") (cd $(JDK_TOPDIR)/src/share/classes && $(ZIP) -qru $@ com -i "com/sun/tools/example/*")
$(JDK_OUTPUTDIR)/demo/jpda/examples.jar : $(JPDA_SOURCES) $(JDK_OUTPUTDIR)/demo/jpda/examples.jar : $(JPDA_SOURCES)
$(MKDIR) -p $(@D) $(MKDIR) -p $(@D)
$(RM) $(@D)/_the.sources $(RM) $(@D)/_the.sources
$(call ListPathsSafely,JPDA_FILES,\n, >> $(@D)/_the.sources) $(call ListPathsSafely,JPDA_FILES,\n, >> $(@D)/_the.sources)
$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \ $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
-e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $(JDK_TOPDIR)/make/tools/manifest.mf > $(@D)/_the.manifest -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $(JDK_TOPDIR)/make/tools/manifest.mf > $(@D)/_the.manifest
$(ECHO) "Main-Class: " >> $(@D)/_the.manifest $(ECHO) "Main-Class: " >> $(@D)/_the.manifest
(cd $(JDK_TOPDIR)/src/share/classes && $(JAR) cfm $@ $(@D)/_the.manifest @$(@D)/_the.sources) (cd $(JDK_TOPDIR)/src/share/classes && $(JAR) cfm $@ $(@D)/_the.manifest @$(@D)/_the.sources)
(cd $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example && $(JAR) uf $@ README) (cd $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example && $(JAR) uf $@ README)
$(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README : $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example/README $(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README : $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example/README
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@ $(CHMOD) -f ug+w $@
$(CHMOD) -f ug+w $@
BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jpda/src.zip $(JDK_OUTPUTDIR)/demo/jpda/examples.jar \ BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jpda/src.zip $(JDK_OUTPUTDIR)/demo/jpda/examples.jar \
$(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README $(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README
...@@ -349,14 +345,12 @@ BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jpda/src.zip $(JDK_OUTPUTDIR)/demo/jpda/exa ...@@ -349,14 +345,12 @@ BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jpda/src.zip $(JDK_OUTPUTDIR)/demo/jpda/exa
################################################################################################## ##################################################################################################
$(JDK_OUTPUTDIR)/demo/management/index.html : $(JDK_TOPDIR)/src/share/demo/management/index.html $(JDK_OUTPUTDIR)/demo/management/index.html : $(JDK_TOPDIR)/src/share/demo/management/index.html
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@ $(CHMOD) -f ug+w $@
$(CHMOD) -f ug+w $@
$(JDK_OUTPUTDIR)/demo/jvmti/index.html : $(JDK_TOPDIR)/src/share/demo/jvmti/index.html $(JDK_OUTPUTDIR)/demo/jvmti/index.html : $(JDK_TOPDIR)/src/share/demo/jvmti/index.html
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@ $(CHMOD) -f ug+w $@
$(CHMOD) -f ug+w $@
BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/management/index.html \ BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/management/index.html \
$(JDK_OUTPUTDIR)/demo/jvmti/index.html $(JDK_OUTPUTDIR)/demo/jvmti/index.html
...@@ -369,15 +363,13 @@ BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%,\ ...@@ -369,15 +363,13 @@ BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%,\
$(call CacheFind,$(JDK_TOPDIR)/src/share/demo/nbproject)) $(call CacheFind,$(JDK_TOPDIR)/src/share/demo/nbproject))
$(JDK_OUTPUTDIR)/demo/nbproject/% : $(JDK_TOPDIR)/src/share/demo/nbproject/% $(JDK_OUTPUTDIR)/demo/nbproject/% : $(JDK_TOPDIR)/src/share/demo/nbproject/%
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@
$(CHMOD) -f ug+w $@ $(CHMOD) -f ug+w $@
################################################################################################## ##################################################################################################
$(JDK_OUTPUTDIR)/demo/README: $(JDK_TOPDIR)/src/share/demo/README $(JDK_OUTPUTDIR)/demo/README: $(JDK_TOPDIR)/src/share/demo/README
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@
BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/README BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/README
...@@ -386,14 +378,12 @@ BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/README ...@@ -386,14 +378,12 @@ BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/README
ifeq ($(OPENJDK_TARGET_OS), solaris) ifeq ($(OPENJDK_TARGET_OS), solaris)
$(JDK_OUTPUTDIR)/democlasses/jni/Poller/% : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/% $(JDK_OUTPUTDIR)/democlasses/jni/Poller/% : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/%
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@ $(CHMOD) -f ug+w $@
$(CHMOD) -f ug+w $@
$(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/README.txt $(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/README.txt
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@ $(CHMOD) -f ug+w $@
$(CHMOD) -f ug+w $@
$(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar : \ $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar : \
$(JDK_OUTPUTDIR)/democlasses/jni/Poller/README.txt $(JDK_OUTPUTDIR)/democlasses/jni/Poller/Poller.c $(JDK_OUTPUTDIR)/democlasses/jni/Poller/README.txt $(JDK_OUTPUTDIR)/democlasses/jni/Poller/Poller.c
...@@ -433,8 +423,7 @@ $(JDK_OUTPUTDIR)/demoobjs/jni/Poller/Poller.o : $(JDK_OUTPUTDIR)/demo/jni/Poller ...@@ -433,8 +423,7 @@ $(JDK_OUTPUTDIR)/demoobjs/jni/Poller/Poller.o : $(JDK_OUTPUTDIR)/demo/jni/Poller
$(JDK_OUTPUTDIR)/demo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX) : \ $(JDK_OUTPUTDIR)/demo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX) : \
$(JDK_OUTPUTDIR)/demoobjs/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX) $(JDK_OUTPUTDIR)/demoobjs/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@
BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX) BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
...@@ -456,8 +445,8 @@ ifndef OPENJDK ...@@ -456,8 +445,8 @@ ifndef OPENJDK
$(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html: \ $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html: \
$(JDK_TOPDIR)/src/closed/share/db/README-JDK-DEMOS.html \ $(JDK_TOPDIR)/src/closed/share/db/README-JDK-DEMOS.html \
| $(JDK_OUTPUTDIR)/demo/_the.db.unzipped | $(JDK_OUTPUTDIR)/demo/_the.db.unzipped
$(MKDIR) -p $(@D) $(call install-file)
$(CP) '$<' '$@'
BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/_the.db.unzipped $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/_the.db.unzipped $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html
endif endif
......
...@@ -281,8 +281,7 @@ endif ...@@ -281,8 +281,7 @@ endif
# These resources violates the convention of having code and resources together under # These resources violates the convention of having code and resources together under
# $(JDK_TOPDIR)/src/.../classes directories # $(JDK_TOPDIR)/src/.../classes directories
$(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/%.gif: $(JDK_TOPDIR)/make/tools/swing-beans/beaninfo/images/%.gif $(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/%.gif: $(JDK_TOPDIR)/make/tools/swing-beans/beaninfo/images/%.gif
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@
# The JDK_USER_DEFINED_FILTER is a poor man's incremental build: by specifying # The JDK_USER_DEFINED_FILTER is a poor man's incremental build: by specifying
# JDK_FILTER at the make command line, only a subset of the JDK java files will # JDK_FILTER at the make command line, only a subset of the JDK java files will
......
...@@ -489,8 +489,7 @@ endif ...@@ -489,8 +489,7 @@ endif
# -link -incremental:no # -link -incremental:no
# like all other launchers. # like all other launchers.
$(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX): $(BUILD_UNPACKEXE) $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX): $(BUILD_UNPACKEXE)
$(MKDIR) -p $(@D) $(call install-file)
$(CP) '$<' '$@'
BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX) BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX)
...@@ -588,8 +587,7 @@ ifeq ($(OPENJDK_TARGET_OS),windows) ...@@ -588,8 +587,7 @@ ifeq ($(OPENJDK_TARGET_OS),windows)
$(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(OPENJDK_TARGET_CPU)))) $(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(OPENJDK_TARGET_CPU))))
else else
$(JAVA_RMI_CGI): $(JDK_TOPDIR)/src/solaris/bin/java-rmi.cgi.sh $(JAVA_RMI_CGI): $(JDK_TOPDIR)/src/solaris/bin/java-rmi.cgi.sh
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@
$(CHMOD) a+x $@ $(CHMOD) a+x $@
endif endif
......
...@@ -109,7 +109,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC,\ ...@@ -109,7 +109,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC,\
BUILD_LIBFDLIBM := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX) BUILD_LIBFDLIBM := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
$(BUILD_LIBFDLIBM) : $(BUILD_LIBFDLIBM_MAC) $(BUILD_LIBFDLIBM) : $(BUILD_LIBFDLIBM_MAC)
$(CP) -a $< $@ $(call install-file)
endif endif
BUILD_LIBRARIES += $(BUILD_LIBFDLIBM) BUILD_LIBRARIES += $(BUILD_LIBFDLIBM)
...@@ -1836,16 +1836,14 @@ BUILD_LIBRARIES += $(BUILD_LIBNET) ...@@ -1836,16 +1836,14 @@ BUILD_LIBRARIES += $(BUILD_LIBNET)
$(JDK_OUTPUTDIR)/lib/net.properties: $(JDK_TOPDIR)/src/share/lib/net.properties $(JDK_OUTPUTDIR)/lib/net.properties: $(JDK_TOPDIR)/src/share/lib/net.properties
$(ECHO) $(LOG_INFO) Copying $(@F) $(ECHO) $(LOG_INFO) Copying $(@F)
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@
COPY_FILES += $(JDK_OUTPUTDIR)/lib/net.properties COPY_FILES += $(JDK_OUTPUTDIR)/lib/net.properties
ifeq ($(OPENJDK_TARGET_OS), solaris) ifeq ($(OPENJDK_TARGET_OS), solaris)
$(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template : $(JDK_TOPDIR)/src/${OPENJDK_TARGET_OS_API_DIR}/lib/sdp/sdp.conf.template $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template : $(JDK_TOPDIR)/src/${OPENJDK_TARGET_OS_API_DIR}/lib/sdp/sdp.conf.template
$(ECHO) $(LOG_INFO) Copying $(@F) $(ECHO) $(LOG_INFO) Copying $(@F)
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@
COPY_FILES += $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template COPY_FILES += $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template
endif endif
...@@ -2166,7 +2164,7 @@ else ifeq ($(OPENJDK_TARGET_OS),macosx) ...@@ -2166,7 +2164,7 @@ else ifeq ($(OPENJDK_TARGET_OS),macosx)
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli_static)) OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjli_static))
$(JDK_OUTPUTDIR)/objs/libjli_static.a : $(BUILD_LIBJLI_STATIC) $(JDK_OUTPUTDIR)/objs/libjli_static.a : $(BUILD_LIBJLI_STATIC)
$(CP) -a $< $@ $(call install-file)
BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a
endif endif
...@@ -2384,18 +2382,23 @@ endif ...@@ -2384,18 +2382,23 @@ endif
ifndef BUILD_HEADLESS_ONLY ifndef BUILD_HEADLESS_ONLY
LIBSPLASHSCREEN_DIRS:=\ LIBSPLASHSCREEN_DIRS:=\
$(JDK_TOPDIR)/src/share/native/sun/awt/giflib \
$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \ $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
$(JDK_TOPDIR)/src/share/native/sun/awt/libpng \ $(JDK_TOPDIR)/src/share/native/sun/awt/libpng \
$(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen $(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen
ifeq ($(USE_EXTERNAL_LIBGIF),true)
GIFLIB_LDFLAGS := -lgif
else
LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/giflib
GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib
endif
ifneq ($(OPENJDK_TARGET_OS), macosx) ifneq ($(OPENJDK_TARGET_OS), macosx)
LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
else else
LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen
endif endif
LIBSPLASHSCREEN_CFLAGS:=-DSPLASHSCREEN -DPNG_NO_MMX_CODE \ LIBSPLASHSCREEN_CFLAGS:=-DSPLASHSCREEN -DPNG_NO_MMX_CODE \
$(foreach dir,$(LIBSPLASHSCREEN_DIRS),-I$(dir)) $(foreach dir,$(LIBSPLASHSCREEN_DIRS),-I$(dir))
...@@ -2447,11 +2450,11 @@ $(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN,\ ...@@ -2447,11 +2450,11 @@ $(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN,\
EXCLUDE_FILES:=imageioJPEG.c jpegdecoder.c pngtest.c,\ EXCLUDE_FILES:=imageioJPEG.c jpegdecoder.c pngtest.c,\
LANG:=C,\ LANG:=C,\
OPTIMIZATION:=LOW, \ OPTIMIZATION:=LOW, \
CFLAGS:=$(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB),\ CFLAGS:=$(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS),\
MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libsplashscreen/mapfile-vers, \ MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libsplashscreen/mapfile-vers, \
LDFLAGS:=$(LDFLAGS_JDKLIB) \ LDFLAGS:=$(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN),\ $(call SET_SHARED_LIBRARY_ORIGIN),\
LDFLAGS_SUFFIX:=$(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ),\ LDFLAGS_SUFFIX:=$(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) $(GIFLIB_LDFLAGS),\
LDFLAGS_SUFFIX_solaris:=-lc,\ LDFLAGS_SUFFIX_solaris:=-lc,\
VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\ VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
RC_FLAGS:=$(RC_FLAGS)\ RC_FLAGS:=$(RC_FLAGS)\
......
...@@ -46,14 +46,10 @@ H_TARGET_FILES =$(INCLUDEDIR)/jdwpTransport.h \ ...@@ -46,14 +46,10 @@ H_TARGET_FILES =$(INCLUDEDIR)/jdwpTransport.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
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
$(OPENJDK_TARGET_OS_INCLUDE)/%.h: $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export/%.h $(OPENJDK_TARGET_OS_INCLUDE)/%.h: $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export/%.h
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES = $(H_TARGET_FILES) COPY_FILES = $(H_TARGET_FILES)
...@@ -88,22 +84,16 @@ MGMT_SRC_FILES = $(wildcard $(MGMT_LIB_SRC)/*) ...@@ -88,22 +84,16 @@ MGMT_SRC_FILES = $(wildcard $(MGMT_LIB_SRC)/*)
MGMT_TARGET_FILES = $(subst $(MGMT_LIB_SRC),$(MGMT_LIBDIR),$(MGMT_SRC_FILES)) MGMT_TARGET_FILES = $(subst $(MGMT_LIB_SRC),$(MGMT_LIBDIR),$(MGMT_SRC_FILES))
$(MGMT_LIBDIR)/management.properties: $(MGMT_LIB_SRC)/management.properties $(MGMT_LIBDIR)/management.properties: $(MGMT_LIB_SRC)/management.properties
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
$(CHMOD) 644 $@ $(CHMOD) 644 $@
# this file has different permissions...don't know why... # this file has different permissions...don't know why...
$(MGMT_LIBDIR)/jmxremote.access: $(MGMT_LIB_SRC)/jmxremote.access $(MGMT_LIBDIR)/jmxremote.access: $(MGMT_LIB_SRC)/jmxremote.access
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
$(CHMOD) 644 $@ $(CHMOD) 644 $@
$(MGMT_LIBDIR)/%: $(MGMT_LIB_SRC)/% $(MGMT_LIBDIR)/%: $(MGMT_LIB_SRC)/%
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
$(CHMOD) 444 $@ $(CHMOD) 444 $@
COPY_FILES += $(MGMT_TARGET_FILES) COPY_FILES += $(MGMT_TARGET_FILES)
...@@ -113,9 +103,7 @@ COPY_FILES += $(MGMT_TARGET_FILES) ...@@ -113,9 +103,7 @@ COPY_FILES += $(MGMT_TARGET_FILES)
LOGGING_LIB_SRC = $(JDK_TOPDIR)/src/share/lib LOGGING_LIB_SRC = $(JDK_TOPDIR)/src/share/lib
$(LIBDIR)/logging.properties: $(LOGGING_LIB_SRC)/logging.properties $(LIBDIR)/logging.properties: $(LOGGING_LIB_SRC)/logging.properties
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(LIBDIR)/logging.properties COPY_FILES += $(LIBDIR)/logging.properties
...@@ -128,9 +116,7 @@ PSFONTPROPFILE_SRCS = $(wildcard $(PSFONTPROPFILE_SRC_DIR)/*.properties*) ...@@ -128,9 +116,7 @@ PSFONTPROPFILE_SRCS = $(wildcard $(PSFONTPROPFILE_SRC_DIR)/*.properties*)
PSFONTPROPFILE_TARGET_FILES = $(subst $(PSFONTPROPFILE_SRC_DIR),$(LIBDIR),$(PSFONTPROPFILE_SRCS)) PSFONTPROPFILE_TARGET_FILES = $(subst $(PSFONTPROPFILE_SRC_DIR),$(LIBDIR),$(PSFONTPROPFILE_SRCS))
$(LIBDIR)/%: $(PSFONTPROPFILE_SRC_DIR)/% $(LIBDIR)/%: $(PSFONTPROPFILE_SRC_DIR)/%
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(PSFONTPROPFILE_TARGET_FILES) COPY_FILES += $(PSFONTPROPFILE_TARGET_FILES)
...@@ -145,9 +131,7 @@ OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/macosx/lib ...@@ -145,9 +131,7 @@ OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/macosx/lib
endif endif
$(LIBDIR)/flavormap.properties: $(OPENJDK_TARGET_OS_LIB_SRC)/flavormap.properties $(LIBDIR)/flavormap.properties: $(OPENJDK_TARGET_OS_LIB_SRC)/flavormap.properties
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(LIBDIR)/flavormap.properties COPY_FILES += $(LIBDIR)/flavormap.properties
...@@ -155,9 +139,7 @@ CURSORS_DEST_DIR = $(LIBDIR)/images/cursors ...@@ -155,9 +139,7 @@ CURSORS_DEST_DIR = $(LIBDIR)/images/cursors
CURSORS_OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib/images/cursors CURSORS_OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib/images/cursors
$(CURSORS_DEST_DIR)/cursors.properties: $(CURSORS_OPENJDK_TARGET_OS_LIB_SRC)/cursors.properties $(CURSORS_DEST_DIR)/cursors.properties: $(CURSORS_OPENJDK_TARGET_OS_LIB_SRC)/cursors.properties
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(CURSORS_DEST_DIR)/cursors.properties COPY_FILES += $(CURSORS_DEST_DIR)/cursors.properties
...@@ -170,9 +152,7 @@ endif # OPENJDK_TARGET_OS ...@@ -170,9 +152,7 @@ endif # OPENJDK_TARGET_OS
CURSORS_TARGET_FILES = $(subst $(CURSORS_LIB_SRC),$(CURSORS_DEST_DIR),$(CURSORS_SRC_FILES)) CURSORS_TARGET_FILES = $(subst $(CURSORS_LIB_SRC),$(CURSORS_DEST_DIR),$(CURSORS_SRC_FILES))
$(CURSORS_DEST_DIR)/%: $(CURSORS_LIB_SRC)/% $(CURSORS_DEST_DIR)/%: $(CURSORS_LIB_SRC)/%
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(CURSORS_TARGET_FILES) COPY_FILES += $(CURSORS_TARGET_FILES)
...@@ -181,9 +161,7 @@ COPY_FILES += $(CURSORS_TARGET_FILES) ...@@ -181,9 +161,7 @@ COPY_FILES += $(CURSORS_TARGET_FILES)
CONTENT_TYPES_SRC=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib CONTENT_TYPES_SRC=$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib
$(LIBDIR)/content-types.properties: $(CONTENT_TYPES_SRC)/content-types.properties $(LIBDIR)/content-types.properties: $(CONTENT_TYPES_SRC)/content-types.properties
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(LIBDIR)/content-types.properties COPY_FILES += $(LIBDIR)/content-types.properties
...@@ -192,9 +170,7 @@ COPY_FILES += $(LIBDIR)/content-types.properties ...@@ -192,9 +170,7 @@ COPY_FILES += $(LIBDIR)/content-types.properties
CALENDARS_SRC := $(JDK_TOPDIR)/src/share/lib CALENDARS_SRC := $(JDK_TOPDIR)/src/share/lib
$(LIBDIR)/calendars.properties: $(CALENDARS_SRC)/calendars.properties $(LIBDIR)/calendars.properties: $(CALENDARS_SRC)/calendars.properties
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(LIBDIR)/calendars.properties COPY_FILES += $(LIBDIR)/calendars.properties
...@@ -205,9 +181,7 @@ ifeq ($(OPENJDK_TARGET_OS),windows) ...@@ -205,9 +181,7 @@ ifeq ($(OPENJDK_TARGET_OS),windows)
TZMAPPINGS_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib TZMAPPINGS_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib
$(LIBDIR)/tzmappings: $(TZMAPPINGS_SRC)/tzmappings $(LIBDIR)/tzmappings: $(TZMAPPINGS_SRC)/tzmappings
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(LIBDIR)/tzmappings COPY_FILES += $(LIBDIR)/tzmappings
...@@ -227,9 +201,7 @@ ICCPROFILE_SRCS:=$(wildcard $(ICCPROFILE_SRC_DIR)/*.pf) ...@@ -227,9 +201,7 @@ ICCPROFILE_SRCS:=$(wildcard $(ICCPROFILE_SRC_DIR)/*.pf)
ICCPROFILE_TARGET_FILES:=$(subst $(ICCPROFILE_SRC_DIR),$(ICCPROFILE_DEST_DIR),$(ICCPROFILE_SRCS)) ICCPROFILE_TARGET_FILES:=$(subst $(ICCPROFILE_SRC_DIR),$(ICCPROFILE_DEST_DIR),$(ICCPROFILE_SRCS))
$(ICCPROFILE_DEST_DIR)%.pf: $(ICCPROFILE_SRC_DIR)%.pf $(ICCPROFILE_DEST_DIR)%.pf: $(ICCPROFILE_SRC_DIR)%.pf
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
$(CHMOD) 444 $@ $(CHMOD) 444 $@
COPY_FILES += $(ICCPROFILE_TARGET_FILES) COPY_FILES += $(ICCPROFILE_TARGET_FILES)
...@@ -279,9 +251,7 @@ ifeq ($(OPENJDK_TARGET_OS),windows) ...@@ -279,9 +251,7 @@ 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. # Chmod to avoid permission issues if bundles are unpacked on unix platforms.
$(MSVCR_TARGET): $(MSVCR_DLL) $(MSVCR_TARGET): $(MSVCR_DLL)
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
$(CHMOD) a+rx $@ $(CHMOD) a+rx $@
COPY_FILES += $(MSVCR_TARGET) COPY_FILES += $(MSVCR_TARGET)
...@@ -292,9 +262,7 @@ endif ...@@ -292,9 +262,7 @@ endif
HPROF_SRC=$(JDK_TOPDIR)/src/share/demo/jvmti/hprof/jvm.hprof.txt HPROF_SRC=$(JDK_TOPDIR)/src/share/demo/jvmti/hprof/jvm.hprof.txt
$(LIBDIR)/jvm.hprof.txt : $(HPROF_SRC) $(LIBDIR)/jvm.hprof.txt : $(HPROF_SRC)
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(LIBDIR)/jvm.hprof.txt COPY_FILES += $(LIBDIR)/jvm.hprof.txt
...@@ -351,17 +319,13 @@ ifeq ($(OPENJDK_TARGET_CPU_BITS),32) ...@@ -351,17 +319,13 @@ ifeq ($(OPENJDK_TARGET_CPU_BITS),32)
else else
# Use the default jvm.cfg for this 32 bit setup. # Use the default jvm.cfg for this 32 bit setup.
$(JVMCFG): $(JVMCFG_SRC) $(JVMCFG): $(JVMCFG_SRC)
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
endif endif
endif endif
else else
# Use the default jvm.cfg for this 64 bit setup. # Use the default jvm.cfg for this 64 bit setup.
$(JVMCFG): $(JVMCFG_SRC) $(JVMCFG): $(JVMCFG_SRC)
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
endif endif
COPY_FILES += $(JVMCFG) COPY_FILES += $(JVMCFG)
...@@ -372,9 +336,7 @@ PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-$(OPENJDK_TARGET ...@@ -372,9 +336,7 @@ PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-$(OPENJDK_TARGET
PROPS_DST := $(JDK_OUTPUTDIR)/lib/security/java.security PROPS_DST := $(JDK_OUTPUTDIR)/lib/security/java.security
$(PROPS_DST): $(PROPS_SRC) $(PROPS_DST): $(PROPS_SRC)
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(PROPS_DST) COPY_FILES += $(PROPS_DST)
...@@ -384,9 +346,7 @@ POLICY_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.policy ...@@ -384,9 +346,7 @@ POLICY_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.policy
POLICY_DST := $(JDK_OUTPUTDIR)/lib/security/java.policy POLICY_DST := $(JDK_OUTPUTDIR)/lib/security/java.policy
$(POLICY_DST): $(POLICY_SRC) $(POLICY_DST): $(POLICY_SRC)
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(POLICY_DST) COPY_FILES += $(POLICY_DST)
...@@ -396,9 +356,7 @@ CACERTS_SRC := $(CACERTS_FILE) ...@@ -396,9 +356,7 @@ CACERTS_SRC := $(CACERTS_FILE)
CACERTS_DST := $(JDK_OUTPUTDIR)/lib/security/cacerts CACERTS_DST := $(JDK_OUTPUTDIR)/lib/security/cacerts
$(CACERTS_DST): $(CACERTS_SRC) $(CACERTS_DST): $(CACERTS_SRC)
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(CACERTS_DST) COPY_FILES += $(CACERTS_DST)
...@@ -413,16 +371,12 @@ TRUSTEDLIBS_SRC := $(JDK_TOPDIR)/src/closed/share/lib/security/trusted.libraries ...@@ -413,16 +371,12 @@ TRUSTEDLIBS_SRC := $(JDK_TOPDIR)/src/closed/share/lib/security/trusted.libraries
TRUSTEDLIBS_DST := $(JDK_OUTPUTDIR)/lib/security/trusted.libraries TRUSTEDLIBS_DST := $(JDK_OUTPUTDIR)/lib/security/trusted.libraries
$(BLACKLIST_DST): $(BLACKLIST_SRC) $(BLACKLIST_DST): $(BLACKLIST_SRC)
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(BLACKLIST_DST) COPY_FILES += $(BLACKLIST_DST)
$(TRUSTEDLIBS_DST): $(TRUSTEDLIBS_SRC) $(TRUSTEDLIBS_DST): $(TRUSTEDLIBS_SRC)
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(TRUSTEDLIBS_DST) COPY_FILES += $(TRUSTEDLIBS_DST)
...@@ -448,14 +402,10 @@ SHARED_FONTS_SRC := $(foreach F,$(SHARED_FONTS_FILES),$(SHARED_FONTS_SRC_DIR)/$( ...@@ -448,14 +402,10 @@ SHARED_FONTS_SRC := $(foreach F,$(SHARED_FONTS_FILES),$(SHARED_FONTS_SRC_DIR)/$(
SHARED_FONTS_DST := $(foreach F,$(SHARED_FONTS_FILES),$(SHARED_FONTS_DST_DIR)/$(F)) SHARED_FONTS_DST := $(foreach F,$(SHARED_FONTS_FILES),$(SHARED_FONTS_DST_DIR)/$(F))
$(SHARED_FONTS_DST_DIR)/%.ttf : $(SHARED_FONTS_SRC_DIR)/%.ttf $(SHARED_FONTS_DST_DIR)/%.ttf : $(SHARED_FONTS_SRC_DIR)/%.ttf
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
$(SHARED_FONTS_DST_DIR)/fonts.dir : $(JDK_TOPDIR)/src/solaris/classes/sun/awt/motif/java.fonts.dir $(SHARED_FONTS_DST_DIR)/fonts.dir : $(JDK_TOPDIR)/src/solaris/classes/sun/awt/motif/java.fonts.dir
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(SHARED_FONTS_DST) COPY_FILES += $(SHARED_FONTS_DST)
...@@ -476,14 +426,10 @@ OBL_FONTS_SRC := $(foreach F,$(OBL_FONTS_FILES),$(OBL_FONTS_SRC_DIR)/$(F)) ...@@ -476,14 +426,10 @@ OBL_FONTS_SRC := $(foreach F,$(OBL_FONTS_FILES),$(OBL_FONTS_SRC_DIR)/$(F))
OBL_FONTS_DST := $(foreach F,$(OBL_FONTS_FILES),$(OBL_FONTS_DST_DIR)/$(F)) OBL_FONTS_DST := $(foreach F,$(OBL_FONTS_FILES),$(OBL_FONTS_DST_DIR)/$(F))
$(OBL_FONTS_DST_DIR)/%.ttf : $(OBL_FONTS_SRC_DIR)/%.ttf $(OBL_FONTS_DST_DIR)/%.ttf : $(OBL_FONTS_SRC_DIR)/%.ttf
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
$(OBL_FONTS_DST_DIR)/fonts.dir : $(JDK_TOPDIR)/src/solaris/classes/sun/awt/motif/java.oblique-fonts.dir $(OBL_FONTS_DST_DIR)/fonts.dir : $(JDK_TOPDIR)/src/solaris/classes/sun/awt/motif/java.oblique-fonts.dir
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(OBL_FONTS_DST) $(OBL_FONTS_DST_DIR)/fonts.dir COPY_FILES += $(OBL_FONTS_DST) $(OBL_FONTS_DST_DIR)/fonts.dir
...@@ -502,9 +448,7 @@ JS_RESOURCES_SRC := $(foreach F,$(JS_RESOURCES_FILES),$(JS_RESOURCES_SRC_DIR)/$( ...@@ -502,9 +448,7 @@ JS_RESOURCES_SRC := $(foreach F,$(JS_RESOURCES_FILES),$(JS_RESOURCES_SRC_DIR)/$(
JS_RESOURCES_DST := $(foreach F,$(JS_RESOURCES_FILES),$(JS_RESOURCES_DST_DIR)/$(F)) JS_RESOURCES_DST := $(foreach F,$(JS_RESOURCES_FILES),$(JS_RESOURCES_DST_DIR)/$(F))
$(JS_RESOURCES_DST_DIR)/% : $(JS_RESOURCES_SRC_DIR)/% $(JS_RESOURCES_DST_DIR)/% : $(JS_RESOURCES_SRC_DIR)/%
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(JS_RESOURCES_DST) COPY_FILES += $(JS_RESOURCES_DST)
...@@ -539,15 +483,11 @@ _DGALIBS_amd64 = # no amd64 library yet ...@@ -539,15 +483,11 @@ _DGALIBS_amd64 = # no amd64 library yet
DGALIBS = $(_DGALIBS_$(OPENJDK_TARGET_CPU_LEGACY):%=$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/%) DGALIBS = $(_DGALIBS_$(OPENJDK_TARGET_CPU_LEGACY):%=$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/%)
$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libxinerama.so: $(JDK_TOPDIR)/src/closed/solaris/lib/$(OPENJDK_TARGET_CPU_LEGACY)/libxinerama.so $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libxinerama.so: $(JDK_TOPDIR)/src/closed/solaris/lib/$(OPENJDK_TARGET_CPU_LEGACY)/libxinerama.so
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
$(CHMOD) 755 $@ $(CHMOD) 755 $@
$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjdgaSUNW%.so: $(JDK_TOPDIR)/src/closed/solaris/lib/$(OPENJDK_TARGET_CPU_LEGACY)/libjdgaSUNW%.so $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjdgaSUNW%.so: $(JDK_TOPDIR)/src/closed/solaris/lib/$(OPENJDK_TARGET_CPU_LEGACY)/libjdgaSUNW%.so
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
$(CHMOD) 755 $@ $(CHMOD) 755 $@
$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjdgaSUNWafb.so: $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjdgaSUNWffb.so $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjdgaSUNWafb.so: $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjdgaSUNWffb.so
...@@ -567,9 +507,7 @@ SUNPKCS11_CFG_SRC := $(JDK_TOPDIR)/src/share/lib/security/sunpkcs11-solaris.cfg ...@@ -567,9 +507,7 @@ SUNPKCS11_CFG_SRC := $(JDK_TOPDIR)/src/share/lib/security/sunpkcs11-solaris.cfg
SUNPKCS11_CFG_DST := $(JDK_OUTPUTDIR)/lib/security/sunpkcs11-solaris.cfg SUNPKCS11_CFG_DST := $(JDK_OUTPUTDIR)/lib/security/sunpkcs11-solaris.cfg
$(SUNPKCS11_CFG_DST) : $(SUNPKCS11_CFG_SRC) $(SUNPKCS11_CFG_DST) : $(SUNPKCS11_CFG_SRC)
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(SUNPKCS11_CFG_DST) COPY_FILES += $(SUNPKCS11_CFG_DST)
...@@ -584,9 +522,7 @@ UCRYPTO_CFG_SRC := $(JDK_TOPDIR)/src/closed/share/lib/security/ucrypto-solaris.c ...@@ -584,9 +522,7 @@ UCRYPTO_CFG_SRC := $(JDK_TOPDIR)/src/closed/share/lib/security/ucrypto-solaris.c
UCRYPTO_CFG_DST := $(JDK_OUTPUTDIR)/lib/security/ucrypto-solaris.cfg UCRYPTO_CFG_DST := $(JDK_OUTPUTDIR)/lib/security/ucrypto-solaris.cfg
$(UCRYPTO_CFG_DST) : $(UCRYPTO_CFG_SRC) $(UCRYPTO_CFG_DST) : $(UCRYPTO_CFG_SRC)
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(UCRYPTO_CFG_DST) COPY_FILES += $(UCRYPTO_CFG_DST)
...@@ -596,9 +532,7 @@ endif ...@@ -596,9 +532,7 @@ endif
########################################################################################## ##########################################################################################
$(JDK_OUTPUTDIR)/lib/sound.properties : $(JDK_TOPDIR)/src/share/lib/sound.properties $(JDK_OUTPUTDIR)/lib/sound.properties : $(JDK_TOPDIR)/src/share/lib/sound.properties
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $(@)
COPY_FILES += $(JDK_OUTPUTDIR)/lib/sound.properties COPY_FILES += $(JDK_OUTPUTDIR)/lib/sound.properties
......
...@@ -223,9 +223,7 @@ COPY_EXTRA += $(OUT_SERVICES_FILES_PRINT) ...@@ -223,9 +223,7 @@ COPY_EXTRA += $(OUT_SERVICES_FILES_PRINT)
### ###
$(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat : $(JDK_OUTPUTDIR)/gensrc/sun/nio/cs/ext/sjis0213.dat $(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat : $(JDK_OUTPUTDIR)/gensrc/sun/nio/cs/ext/sjis0213.dat
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $(@)
COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat
......
...@@ -53,19 +53,13 @@ ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris macosx)) ...@@ -53,19 +53,13 @@ ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris macosx))
endif endif
$(SAMPLE_TARGET_DIR)/dtrace/%: $(SAMPLE_SOLARIS_SOURCE_DIR)/dtrace/% $(SAMPLE_TARGET_DIR)/dtrace/%: $(SAMPLE_SOLARIS_SOURCE_DIR)/dtrace/%
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
$(SAMPLE_TARGET_DIR)/webservices/%: $(SAMPLE_CLOSED_SOURCE_DIR)/webservices/% $(SAMPLE_TARGET_DIR)/webservices/%: $(SAMPLE_CLOSED_SOURCE_DIR)/webservices/%
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
$(SAMPLE_TARGET_DIR)/%: $(SAMPLE_SOURCE_DIR)/% $(SAMPLE_TARGET_DIR)/%: $(SAMPLE_SOURCE_DIR)/%
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
COPY_FILES += $(SAMPLE_TARGET) COPY_FILES += $(SAMPLE_TARGET)
......
...@@ -72,9 +72,7 @@ endif ...@@ -72,9 +72,7 @@ endif
$(GENDATA_FONT_CONFIG_DST)/%.src : \ $(GENDATA_FONT_CONFIG_DST)/%.src : \
$(GENDATA_FONT_CONFIG_SRC_DIR)/$(GENDATA_FONT_CONFIG_SRC_PREFIX)% $(GENDATA_FONT_CONFIG_SRC_DIR)/$(GENDATA_FONT_CONFIG_SRC_PREFIX)%
$(RM) $@ $(call install-file)
$(MKDIR) -p $(@D)
$(CP) $< $@
$(GENDATA_FONT_CONFIG_DST)/%.bfc : \ $(GENDATA_FONT_CONFIG_DST)/%.bfc : \
$(GENDATA_FONT_CONFIG_SRC_DIR)/$(GENDATA_FONT_CONFIG_SRC_PREFIX)%.properties $(GENDATA_FONT_CONFIG_SRC_DIR)/$(GENDATA_FONT_CONFIG_SRC_PREFIX)%.properties
......
...@@ -55,9 +55,8 @@ $(eval $(call SetupCharacterData,CharacterData0E,-plane 14,11 4 1)) ...@@ -55,9 +55,8 @@ $(eval $(call SetupCharacterData,CharacterData0E,-plane 14,11 4 1))
# Copy two Java files that need no preprocessing. # Copy two Java files that need no preprocessing.
$(JDK_OUTPUTDIR)/gensrc/java/lang/%.java : $(CHARACTERDATA)/%.java.template $(JDK_OUTPUTDIR)/gensrc/java/lang/%.java : $(CHARACTERDATA)/%.java.template
$(MKDIR) -p $(@D)
$(ECHO) $(LOG_INFO) Generating $(@F) $(ECHO) $(LOG_INFO) Generating $(@F)
$(CP) -f $< $@ $(call install-file)
GENSRC_CHARACTERDATA += $(JDK_OUTPUTDIR)/gensrc/java/lang/CharacterDataUndefined.java \ GENSRC_CHARACTERDATA += $(JDK_OUTPUTDIR)/gensrc/java/lang/CharacterDataUndefined.java \
$(JDK_OUTPUTDIR)/gensrc/java/lang/CharacterDataPrivateUse.java $(JDK_OUTPUTDIR)/gensrc/java/lang/CharacterDataPrivateUse.java
......
...@@ -72,9 +72,8 @@ ifeq ($(OPENJDK_TARGET_OS_API),posix) ...@@ -72,9 +72,8 @@ ifeq ($(OPENJDK_TARGET_OS_API),posix)
$(JDK_OUTPUTDIR)/gensrc/java/lang/UNIXProcess.java : \ $(JDK_OUTPUTDIR)/gensrc/java/lang/UNIXProcess.java : \
$(JDK_TOPDIR)/src/solaris/classes/java/lang/UNIXProcess.java.$(UPSUFFIX) $(JDK_TOPDIR)/src/solaris/classes/java/lang/UNIXProcess.java.$(UPSUFFIX)
$(MKDIR) -p $(@D)
$(ECHO) $(LOG_INFO) Copying UNIXProcess.java.$(OPENJDK_TARGET_OS) to java/lang/UNIXProcess.java $(ECHO) $(LOG_INFO) Copying UNIXProcess.java.$(OPENJDK_TARGET_OS) to java/lang/UNIXProcess.java
$(CP) $< $@ $(call install-file)
$(CHMOD) u+rw $@ $(CHMOD) u+rw $@
GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/java/lang/UNIXProcess.java GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc/java/lang/UNIXProcess.java
...@@ -114,9 +113,7 @@ $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java : $(BUILD_GENSRC_SO ...@@ -114,9 +113,7 @@ $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java : $(BUILD_GENSRC_SO
$(MV) $@.tmp $@ $(MV) $@.tmp $@
else else
$(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java : $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java $(JDK_OUTPUTDIR)/gensrc/sun/nio/ch/SocketOptionRegistry.java : $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
endif endif
########################################################################################## ##########################################################################################
...@@ -156,9 +153,7 @@ $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java : $(BUILD_GENSRC_UC_EXE) ...@@ -156,9 +153,7 @@ $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java : $(BUILD_GENSRC_UC_EXE)
$(MV) $@.tmp $@ $(MV) $@.tmp $@
else else
$(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java : $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java $(JDK_OUTPUTDIR)/gensrc/sun/nio/fs/UnixConstants.java : $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java
$(MKDIR) -p $(@D) $(call install-file)
$(RM) $@
$(CP) $< $@
endif endif
endif endif
......
...@@ -85,14 +85,12 @@ $(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo: $(BEANS_SRC) $(JDK_OU ...@@ -85,14 +85,12 @@ $(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo: $(BEANS_SRC) $(JDK_OU
# 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_no_srczip/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) $(call install-file)
$(CP) $< $@
# 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/sun/swing # For some reason it is under $(JDK_TOPDIR)/make/tools/swing-beans/sun/swing
# Should it be moved under $(JDK_TOPDIR)/src/share/classes/sun/swing instead? # Should it be moved under $(JDK_TOPDIR)/src/share/classes/sun/swing instead?
$(JDK_OUTPUTDIR)/gensrc/sun/swing/BeanInfoUtils.java: $(DOCLETSRC_DIR)/sun/swing/BeanInfoUtils.java $(JDK_OUTPUTDIR)/gensrc/sun/swing/BeanInfoUtils.java: $(DOCLETSRC_DIR)/sun/swing/BeanInfoUtils.java
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@
GENSRC_SWING_BEANINFO = $(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo GENSRC_SWING_BEANINFO = $(JDK_OUTPUTDIR)/gensrc_no_srczip/_the.generated_beaninfo
...@@ -649,7 +649,7 @@ ifneq ($(POST_STRIP_CMD),) ...@@ -649,7 +649,7 @@ ifneq ($(POST_STRIP_CMD),)
EXEC_LIST_BIN:=$(filter-out %$(notdir $(MSVCR_DLL)),$(filter %.exe %.dll,$(ALL_BIN_LIST))) EXEC_LIST_BIN:=$(filter-out %$(notdir $(MSVCR_DLL)),$(filter %.exe %.dll,$(ALL_BIN_LIST)))
else else
# Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed # Find all executables in JDK_OUTPUTDIR since they exist when this makefile is parsed
EXEC_LIST_BIN:=$(shell $(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX)` \ EXEC_LIST_BIN:=$(shell $(FILE) `$(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*$(EXE_SUFFIX) ! -name \*.debuginfo` \
| $(EGREP) 'ELF' | $(CUT) -d':' -f1) | $(EGREP) 'ELF' | $(CUT) -d':' -f1)
# On mac, the old build searches for static libraries for stripping instead of shared. # On mac, the old build searches for static libraries for stripping instead of shared.
# Not clear if it's intentional. # Not clear if it's intentional.
......
...@@ -93,8 +93,11 @@ ALL_JARS := $(FULL_JRE_JARS) \ ...@@ -93,8 +93,11 @@ ALL_JARS := $(FULL_JRE_JARS) \
$(IMAGES_OUTPUTDIR)/lib/dt.jar \ $(IMAGES_OUTPUTDIR)/lib/dt.jar \
$(IMAGES_OUTPUTDIR)/lib/tools.jar \ $(IMAGES_OUTPUTDIR)/lib/tools.jar \
$(IMAGES_OUTPUTDIR)/lib/ct.sym \ $(IMAGES_OUTPUTDIR)/lib/ct.sym \
$(IMAGES_OUTPUTDIR)/src.zip \ $(IMAGES_OUTPUTDIR)/src.zip
$(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar
ifeq ($(INCLUDE_SA),true)
ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/sa-jdi.jar
endif
ifeq ($(OPENJDK_TARGET_OS),solaris) ifeq ($(OPENJDK_TARGET_OS),solaris)
ifndef OPENJDK ifndef OPENJDK
......
...@@ -79,8 +79,7 @@ check-keystore: ...@@ -79,8 +79,7 @@ check-keystore:
fi fi
$(JCE_OUTPUTDIR)/%: $(IMAGES_OUTPUTDIR)/unsigned/% $(JCE_OUTPUTDIR)/%: $(IMAGES_OUTPUTDIR)/unsigned/%
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@
$(JARSIGNER) -keystore $(SIGNING_KEYSTORE) \ $(JARSIGNER) -keystore $(SIGNING_KEYSTORE) \
$@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE) $@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE)
@$(PRINTF) "\nJar codesigning finished.\n" @$(PRINTF) "\nJar codesigning finished.\n"
......
...@@ -47,17 +47,15 @@ $(eval $(call SetupJavaCompilation,BUILD_TOOLS,\ ...@@ -47,17 +47,15 @@ $(eval $(call SetupJavaCompilation,BUILD_TOOLS,\
endif endif
$(JDK_OUTPUTDIR)/btclasses/build/tools/generatenimbus/resources/%.template : \ $(JDK_OUTPUTDIR)/btclasses/build/tools/generatenimbus/resources/%.template : \
$(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/nimbus/%.template $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/nimbus/%.template
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@
BUILD_TOOLS += $(foreach i,$(wildcard $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/nimbus/*.template),$(JDK_OUTPUTDIR)/btclasses/build/tools/generatenimbus/resources/$(notdir $i)) BUILD_TOOLS += $(foreach i,$(wildcard $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/nimbus/*.template),$(JDK_OUTPUTDIR)/btclasses/build/tools/generatenimbus/resources/$(notdir $i))
# Resources used by CheckDeps tool # Resources used by CheckDeps tool
$(JDK_OUTPUTDIR)/btclasses/build/tools/deps/% : \ $(JDK_OUTPUTDIR)/btclasses/build/tools/deps/% : \
$(JDK_TOPDIR)/make/tools/src/build/tools/deps/% $(JDK_TOPDIR)/make/tools/src/build/tools/deps/%
$(MKDIR) -p $(@D) $(call install-file)
$(CP) $< $@
BUILD_TOOLS += $(JDK_OUTPUTDIR)/btclasses/build/tools/deps/refs.allowed BUILD_TOOLS += $(JDK_OUTPUTDIR)/btclasses/build/tools/deps/refs.allowed
......
/* /*
* 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
...@@ -33,17 +33,15 @@ import javax.swing.RootPaneContainer; ...@@ -33,17 +33,15 @@ import javax.swing.RootPaneContainer;
import com.apple.eawt.AppEvent.FullScreenEvent; import com.apple.eawt.AppEvent.FullScreenEvent;
import javax.tools.annotation.GenerateNativeHeader; import java.lang.annotation.Native;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
final class FullScreenHandler { final class FullScreenHandler {
private static final String CLIENT_PROPERTY = "com.apple.eawt.event.internalFullScreenHandler"; private static final String CLIENT_PROPERTY = "com.apple.eawt.event.internalFullScreenHandler";
static final int FULLSCREEN_WILL_ENTER = 1; @Native static final int FULLSCREEN_WILL_ENTER = 1;
static final int FULLSCREEN_DID_ENTER = 2; @Native static final int FULLSCREEN_DID_ENTER = 2;
static final int FULLSCREEN_WILL_EXIT = 3; @Native static final int FULLSCREEN_WILL_EXIT = 3;
static final int FULLSCREEN_DID_EXIT = 4; @Native static final int FULLSCREEN_DID_EXIT = 4;
// installs a private instance of the handler, if necessary // installs a private instance of the handler, if necessary
static void addFullScreenListenerTo(final RootPaneContainer window, final FullScreenListener listener) { static void addFullScreenListenerTo(final RootPaneContainer window, final FullScreenListener listener) {
......
/* /*
* 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
...@@ -31,18 +31,16 @@ import java.util.List; ...@@ -31,18 +31,16 @@ import java.util.List;
import javax.swing.*; import javax.swing.*;
import javax.tools.annotation.GenerateNativeHeader; import java.lang.annotation.Native;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
final class GestureHandler { final class GestureHandler {
private static final String CLIENT_PROPERTY = "com.apple.eawt.event.internalGestureHandler"; private static final String CLIENT_PROPERTY = "com.apple.eawt.event.internalGestureHandler";
// native constants for the supported types of high-level gestures // native constants for the supported types of high-level gestures
static final int PHASE = 1; @Native static final int PHASE = 1;
static final int ROTATE = 2; @Native static final int ROTATE = 2;
static final int MAGNIFY = 3; @Native static final int MAGNIFY = 3;
static final int SWIPE = 4; @Native static final int SWIPE = 4;
// installs a private instance of GestureHandler, if necessary // installs a private instance of GestureHandler, if necessary
static void addGestureListenerTo(final JComponent component, final GestureListener listener) { static void addGestureListenerTo(final JComponent component, final GestureListener listener) {
......
/* /*
* 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
...@@ -37,13 +37,11 @@ import sun.java2d.loops.*; ...@@ -37,13 +37,11 @@ import sun.java2d.loops.*;
import sun.java2d.pipe.*; import sun.java2d.pipe.*;
import sun.lwawt.macosx.*; import sun.lwawt.macosx.*;
import javax.tools.annotation.GenerateNativeHeader; import java.lang.annotation.Native;
/* /*
* This is the SurfaceData for a CGContextRef. * This is the SurfaceData for a CGContextRef.
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public abstract class OSXSurfaceData extends BufImgSurfaceData { public abstract class OSXSurfaceData extends BufImgSurfaceData {
final static float UPPER_BND = Float.MAX_VALUE / 2.0f; final static float UPPER_BND = Float.MAX_VALUE / 2.0f;
final static float LOWER_BND = -UPPER_BND; final static float LOWER_BND = -UPPER_BND;
...@@ -198,147 +196,147 @@ public abstract class OSXSurfaceData extends BufImgSurfaceData { ...@@ -198,147 +196,147 @@ public abstract class OSXSurfaceData extends BufImgSurfaceData {
// graphics primitives drawing implementation: // graphics primitives drawing implementation:
// certain primitives don't care about all the states (ex. drawing an image needs not involve setting current paint) // certain primitives don't care about all the states (ex. drawing an image needs not involve setting current paint)
static final int kPrimitive = 0; @Native static final int kPrimitive = 0;
static final int kImage = 1; @Native static final int kImage = 1;
static final int kText = 2; @Native static final int kText = 2;
static final int kCopyArea = 3; @Native static final int kCopyArea = 3;
static final int kExternal = 4; @Native static final int kExternal = 4;
static final int kLine = 5; // belongs to kPrimitive @Native static final int kLine = 5; // belongs to kPrimitive
static final int kRect = 6; // belongs to kPrimitive @Native static final int kRect = 6; // belongs to kPrimitive
static final int kRoundRect = 7; // belongs to kPrimitive @Native static final int kRoundRect = 7; // belongs to kPrimitive
static final int kOval = 8; // belongs to kPrimitive @Native static final int kOval = 8; // belongs to kPrimitive
static final int kArc = 9; // belongs to kPrimitive @Native static final int kArc = 9; // belongs to kPrimitive
static final int kPolygon = 10; // belongs to kPrimitive @Native static final int kPolygon = 10; // belongs to kPrimitive
static final int kShape = 11; // belongs to kPrimitive @Native static final int kShape = 11; // belongs to kPrimitive
// static final int kImage = 12; // belongs to kImage // static final int kImage = 12; // belongs to kImage
static final int kString = 13; // belongs to kText @Native static final int kString = 13; // belongs to kText
static final int kGlyphs = 14; // belongs to kText @Native static final int kGlyphs = 14; // belongs to kText
static final int kUnicodes = 15; // belongs to kText @Native static final int kUnicodes = 15; // belongs to kText
// static final int kCopyArea = 16; // belongs to kCopyArea // static final int kCopyArea = 16; // belongs to kCopyArea
// static final int kExternal = 17; // belongs to kExternal // static final int kExternal = 17; // belongs to kExternal
static final int kCommonParameterCount = 1 + 1 + 4 + 4; // type + change flags + color info (type(1) align(1) and @Native static final int kCommonParameterCount = 1 + 1 + 4 + 4; // type + change flags + color info (type(1) align(1) and
// value(2)) + parameters ((x1, y1, x2, y2) OR (x, y, w, h)) // value(2)) + parameters ((x1, y1, x2, y2) OR (x, y, w, h))
static final int kLineParametersCount = kCommonParameterCount; // kCommonParameterCount @Native static final int kLineParametersCount = kCommonParameterCount; // kCommonParameterCount
static final int kRectParametersCount = kCommonParameterCount + 1; // kCommonParameterCount + isfill @Native static final int kRectParametersCount = kCommonParameterCount + 1; // kCommonParameterCount + isfill
static final int kRoundRectParametersCount = kCommonParameterCount + 2 + 1; // kCommonParameterCount + arcW + arcH + @Native static final int kRoundRectParametersCount = kCommonParameterCount + 2 + 1; // kCommonParameterCount + arcW + arcH +
// isfill // isfill
static final int kOvalParametersCount = kCommonParameterCount + 1; // kCommonParameterCount + isfill @Native static final int kOvalParametersCount = kCommonParameterCount + 1; // kCommonParameterCount + isfill
static final int kArcParametersCount = kCommonParameterCount + 2 + 1 + 1;// kCommonParameterCount + startAngle + @Native static final int kArcParametersCount = kCommonParameterCount + 2 + 1 + 1;// kCommonParameterCount + startAngle +
// arcAngle + isfill + type // arcAngle + isfill + type
static final int kPolygonParametersCount = 0; // not supported @Native static final int kPolygonParametersCount = 0; // not supported
static final int kShapeParametersCount = 0; // not supported @Native static final int kShapeParametersCount = 0; // not supported
static final int kImageParametersCount = kCommonParameterCount + 2 + 2 + 4 + 4; // flip horz vert + w&h + src + dst @Native static final int kImageParametersCount = kCommonParameterCount + 2 + 2 + 4 + 4; // flip horz vert + w&h + src + dst
static final int kStringParametersCount = 0; // not supported @Native static final int kStringParametersCount = 0; // not supported
static final int kGlyphsParametersCount = 0; // not supported @Native static final int kGlyphsParametersCount = 0; // not supported
static final int kUnicodesParametersCount = 0; // not supported @Native static final int kUnicodesParametersCount = 0; // not supported
static final int kPixelParametersCount = 0; // not supported @Native static final int kPixelParametersCount = 0; // not supported
static final int kExternalParametersCount = 0; // not supported @Native static final int kExternalParametersCount = 0; // not supported
// for intParameters // for intParameters
// states info // states info
static final int kChangeFlagIndex = 0; // kBoundsChangedBit | .. | kFontChangedBit @Native static final int kChangeFlagIndex = 0; // kBoundsChangedBit | .. | kFontChangedBit
// bounds info // bounds info
static final int kBoundsXIndex = 1; @Native static final int kBoundsXIndex = 1;
static final int kBoundsYIndex = 2; @Native static final int kBoundsYIndex = 2;
static final int kBoundsWidthIndex = 3; @Native static final int kBoundsWidthIndex = 3;
static final int kBoundsHeightIndex = 4; @Native static final int kBoundsHeightIndex = 4;
// clip info // clip info
static final int kClipStateIndex = 5; @Native static final int kClipStateIndex = 5;
static final int kClipNumTypesIndex = 6; @Native static final int kClipNumTypesIndex = 6;
static final int kClipNumCoordsIndex = 7; @Native static final int kClipNumCoordsIndex = 7;
static final int kClipWindingRuleIndex = 8; @Native static final int kClipWindingRuleIndex = 8;
static final int kClipXIndex = 9; @Native static final int kClipXIndex = 9;
static final int kClipYIndex = 10; @Native static final int kClipYIndex = 10;
static final int kClipWidthIndex = 11; @Native static final int kClipWidthIndex = 11;
static final int kClipHeightIndex = 12; @Native static final int kClipHeightIndex = 12;
// ctm info // ctm info
static final int kCTMaIndex = 13; @Native static final int kCTMaIndex = 13;
static final int kCTMbIndex = 14; @Native static final int kCTMbIndex = 14;
static final int kCTMcIndex = 15; @Native static final int kCTMcIndex = 15;
static final int kCTMdIndex = 16; @Native static final int kCTMdIndex = 16;
static final int kCTMtxIndex = 17; @Native static final int kCTMtxIndex = 17;
static final int kCTMtyIndex = 18; @Native static final int kCTMtyIndex = 18;
// color info // color info
static final int kColorStateIndex = 19; // kColorSimple or kColorGradient or kColorTexture @Native static final int kColorStateIndex = 19; // kColorSimple or kColorGradient or kColorTexture
static final int kColorRGBValueIndex = 20; // if kColorSimple @Native static final int kColorRGBValueIndex = 20; // if kColorSimple
static final int kColorIndexValueIndex = 21; // if kColorSystem @Native static final int kColorIndexValueIndex = 21; // if kColorSystem
static final int kColorPointerIndex = 22; // @Native static final int kColorPointerIndex = 22; //
static final int kColorPointerIndex2 = 23; // @Native static final int kColorPointerIndex2 = 23; //
static final int kColorRGBValue1Index = 24; // if kColorGradient @Native static final int kColorRGBValue1Index = 24; // if kColorGradient
static final int kColorWidthIndex = 25; // if kColorTexture @Native static final int kColorWidthIndex = 25; // if kColorTexture
static final int kColorRGBValue2Index = 26; // if kColorGradient @Native static final int kColorRGBValue2Index = 26; // if kColorGradient
static final int kColorHeightIndex = 27; // if kColorTexture @Native static final int kColorHeightIndex = 27; // if kColorTexture
static final int kColorIsCyclicIndex = 28; // if kColorGradient (kColorNonCyclic or kColorCyclic) @Native static final int kColorIsCyclicIndex = 28; // if kColorGradient (kColorNonCyclic or kColorCyclic)
static final int kColorx1Index = 29; @Native static final int kColorx1Index = 29;
static final int kColortxIndex = 30; @Native static final int kColortxIndex = 30;
static final int kColory1Index = 31; @Native static final int kColory1Index = 31;
static final int kColortyIndex = 32; @Native static final int kColortyIndex = 32;
static final int kColorx2Index = 33; @Native static final int kColorx2Index = 33;
static final int kColorsxIndex = 34; @Native static final int kColorsxIndex = 34;
static final int kColory2Index = 35; @Native static final int kColory2Index = 35;
static final int kColorsyIndex = 36; @Native static final int kColorsyIndex = 36;
// composite info // composite info
static final int kCompositeRuleIndex = 37; // kCGCompositeClear or ... or kCGCompositeXor @Native static final int kCompositeRuleIndex = 37; // kCGCompositeClear or ... or kCGCompositeXor
static final int kCompositeValueIndex = 38; @Native static final int kCompositeValueIndex = 38;
// stroke info // stroke info
static final int kStrokeJoinIndex = 39; // see BasicStroke.java @Native static final int kStrokeJoinIndex = 39; // see BasicStroke.java
static final int kStrokeCapIndex = 40; // see BasicStroke.java @Native static final int kStrokeCapIndex = 40; // see BasicStroke.java
static final int kStrokeWidthIndex = 41; @Native static final int kStrokeWidthIndex = 41;
static final int kStrokeDashPhaseIndex = 42; @Native static final int kStrokeDashPhaseIndex = 42;
static final int kStrokeLimitIndex = 43; @Native static final int kStrokeLimitIndex = 43;
// hints info // hints info
static final int kHintsAntialiasIndex = 44; @Native static final int kHintsAntialiasIndex = 44;
static final int kHintsTextAntialiasIndex = 45; @Native static final int kHintsTextAntialiasIndex = 45;
static final int kHintsFractionalMetricsIndex = 46; @Native static final int kHintsFractionalMetricsIndex = 46;
static final int kHintsRenderingIndex = 47; @Native static final int kHintsRenderingIndex = 47;
static final int kHintsInterpolationIndex = 48; @Native static final int kHintsInterpolationIndex = 48;
// live resizing info // live resizing info
static final int kCanDrawDuringLiveResizeIndex = 49; @Native static final int kCanDrawDuringLiveResizeIndex = 49;
static final int kSizeOfParameters = kCanDrawDuringLiveResizeIndex + 1; @Native static final int kSizeOfParameters = kCanDrawDuringLiveResizeIndex + 1;
// for objectParameters // for objectParameters
static final int kClipCoordinatesIndex = 0; @Native static final int kClipCoordinatesIndex = 0;
static final int kClipTypesIndex = 1; @Native static final int kClipTypesIndex = 1;
static final int kTextureImageIndex = 2; @Native static final int kTextureImageIndex = 2;
static final int kStrokeDashArrayIndex = 3; @Native static final int kStrokeDashArrayIndex = 3;
static final int kFontIndex = 4; @Native static final int kFontIndex = 4;
static final int kFontPaintIndex = 5; @Native static final int kFontPaintIndex = 5;
// possible state changes // possible state changes
static final int kBoundsChangedBit = 1 << 0; @Native static final int kBoundsChangedBit = 1 << 0;
static final int kBoundsNotChangedBit = ~kBoundsChangedBit; @Native static final int kBoundsNotChangedBit = ~kBoundsChangedBit;
static final int kClipChangedBit = 1 << 1; @Native static final int kClipChangedBit = 1 << 1;
static final int kClipNotChangedBit = ~kClipChangedBit; @Native static final int kClipNotChangedBit = ~kClipChangedBit;
static final int kCTMChangedBit = 1 << 2; @Native static final int kCTMChangedBit = 1 << 2;
static final int kCTMNotChangedBit = ~kCTMChangedBit; @Native static final int kCTMNotChangedBit = ~kCTMChangedBit;
static final int kColorChangedBit = 1 << 3; @Native static final int kColorChangedBit = 1 << 3;
static final int kColorNotChangedBit = ~kColorChangedBit; @Native static final int kColorNotChangedBit = ~kColorChangedBit;
static final int kCompositeChangedBit = 1 << 4; @Native static final int kCompositeChangedBit = 1 << 4;
static final int kCompositeNotChangedBit = ~kCompositeChangedBit; @Native static final int kCompositeNotChangedBit = ~kCompositeChangedBit;
static final int kStrokeChangedBit = 1 << 5; @Native static final int kStrokeChangedBit = 1 << 5;
static final int kStrokeNotChangedBit = ~kStrokeChangedBit; @Native static final int kStrokeNotChangedBit = ~kStrokeChangedBit;
static final int kHintsChangedBit = 1 << 6; @Native static final int kHintsChangedBit = 1 << 6;
static final int kHintsNotChangedBit = ~kHintsChangedBit; @Native static final int kHintsNotChangedBit = ~kHintsChangedBit;
static final int kFontChangedBit = 1 << 7; @Native static final int kFontChangedBit = 1 << 7;
static final int kFontNotChangedBit = ~kFontChangedBit; @Native static final int kFontNotChangedBit = ~kFontChangedBit;
static final int kEverythingChangedFlag = 0xffffffff; @Native static final int kEverythingChangedFlag = 0xffffffff;
// possible color states // possible color states
static final int kColorSimple = 0; @Native static final int kColorSimple = 0;
static final int kColorSystem = 1; @Native static final int kColorSystem = 1;
static final int kColorGradient = 2; @Native static final int kColorGradient = 2;
static final int kColorTexture = 3; @Native static final int kColorTexture = 3;
// possible gradient color states // possible gradient color states
static final int kColorNonCyclic = 0; @Native static final int kColorNonCyclic = 0;
static final int kColorCyclic = 1; @Native static final int kColorCyclic = 1;
// possible clip states // possible clip states
static final int kClipRect = 0; @Native static final int kClipRect = 0;
static final int kClipShape = 1; @Native static final int kClipShape = 1;
static int getRendererTypeForPrimitive(int primitiveType) { static int getRendererTypeForPrimitive(int primitiveType) {
switch (primitiveType) { switch (primitiveType) {
......
...@@ -336,7 +336,7 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent> ...@@ -336,7 +336,7 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
return peerTreeLock; return peerTreeLock;
} }
final T getTarget() { public final T getTarget() {
return target; return target;
} }
......
...@@ -110,4 +110,12 @@ public class CClipboard extends SunClipboard { ...@@ -110,4 +110,12 @@ public class CClipboard extends SunClipboard {
public native void declareTypes(long[] formats, SunClipboard newOwner); public native void declareTypes(long[] formats, SunClipboard newOwner);
public native void setData(byte[] data, long format); public native void setData(byte[] data, long format);
/**
* Invokes native check whether a change count on the general pasteboard is different
* than when we set it. The different count value means the current owner lost
* pasteboard ownership and someone else put data on the clipboard.
* @since 1.7
*/
public native void checkPasteboard();
} }
...@@ -51,15 +51,6 @@ final class CCursorManager extends LWCursorManager { ...@@ -51,15 +51,6 @@ final class CCursorManager extends LWCursorManager {
@Override @Override
protected Point getCursorPosition() { protected Point getCursorPosition() {
synchronized(this) {
if (isDragging) {
// during the drag operation, the appkit thread is blocked,
// so nativeGetCursorPosition invocation may cause a deadlock.
// In order to avoid this, we returns last know cursor position.
return new Point(dragPos);
}
}
final Point2D nativePosition = nativeGetCursorPosition(); final Point2D nativePosition = nativeGetCursorPosition();
return new Point((int)nativePosition.getX(), (int)nativePosition.getY()); return new Point((int)nativePosition.getX(), (int)nativePosition.getY());
} }
...@@ -101,31 +92,4 @@ final class CCursorManager extends LWCursorManager { ...@@ -101,31 +92,4 @@ final class CCursorManager extends LWCursorManager {
// do something special // do something special
throw new RuntimeException("Unimplemented"); throw new RuntimeException("Unimplemented");
} }
// package private methods to handle cursor change during drag-and-drop
private boolean isDragging = false;
private Point dragPos = null;
synchronized void startDrag(int x, int y) {
if (isDragging) {
throw new RuntimeException("Invalid Drag state in CCursorManager!");
}
isDragging = true;
dragPos = new Point(x, y);
}
synchronized void updateDragPosition(int x, int y) {
if (!isDragging) {
throw new RuntimeException("Invalid Drag state in CCursorManager!");
}
dragPos.move(x, y);
}
synchronized void stopDrag() {
if (!isDragging) {
throw new RuntimeException("Invalid Drag state in CCursorManager!");
}
isDragging = false;
dragPos = null;
}
} }
...@@ -174,7 +174,7 @@ public class CDataTransferer extends DataTransferer { ...@@ -174,7 +174,7 @@ public class CDataTransferer extends DataTransferer {
bytes = Normalizer.normalize(new String(bytes, "UTF8"), Form.NFC).getBytes("UTF8"); bytes = Normalizer.normalize(new String(bytes, "UTF8"), Form.NFC).getBytes("UTF8");
} }
return super.translateBytesOrStream(stream, bytes, flavor, format, transferable); return super.translateBytes(bytes, flavor, format, transferable);
} }
...@@ -257,16 +257,13 @@ public class CDataTransferer extends DataTransferer { ...@@ -257,16 +257,13 @@ public class CDataTransferer extends DataTransferer {
private native byte[] imageDataToPlatformImageBytes(int[] rData, int nW, int nH); private native byte[] imageDataToPlatformImageBytes(int[] rData, int nW, int nH);
/** /**
* Translates either a byte array or an input stream which contain * Translates a byte array which contains
* platform-specific image data in the given format into an Image. * platform-specific image data in the given format into an Image.
*/ */
protected Image platformImageBytesOrStreamToImage(InputStream stream, byte[] bytes, long format) throws IOException { protected Image platformImageBytesToImage(byte[] bytes, long format)
byte[] imageData = bytes; throws IOException
{
if (imageData == null) return getImageForByteStream(bytes);
imageData = inputStreamToByteArray(stream);
return getImageForByteStream(imageData);
} }
private native Image getImageForByteStream(byte[] bytes); private native Image getImageForByteStream(byte[] bytes);
......
...@@ -38,8 +38,12 @@ import javax.swing.text.*; ...@@ -38,8 +38,12 @@ import javax.swing.text.*;
import javax.accessibility.*; import javax.accessibility.*;
import java.util.Map; import java.util.Map;
import java.util.concurrent.Callable;
import sun.awt.dnd.*; import sun.awt.dnd.*;
import sun.lwawt.LWComponentPeer; import sun.lwawt.LWComponentPeer;
import sun.lwawt.LWWindowPeer;
import sun.lwawt.PlatformWindow;
public final class CDragSourceContextPeer extends SunDragSourceContextPeer { public final class CDragSourceContextPeer extends SunDragSourceContextPeer {
...@@ -104,13 +108,8 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { ...@@ -104,13 +108,8 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer {
} }
//It sure will be LWComponentPeer instance as rootComponent is a Window //It sure will be LWComponentPeer instance as rootComponent is a Window
LWComponentPeer peer = (LWComponentPeer)rootComponent.getPeer(); PlatformWindow platformWindow = ((LWComponentPeer)rootComponent.getPeer()).getPlatformWindow();
//Get a pointer to a native window long nativeViewPtr = CPlatformWindow.getNativeViewPtr(platformWindow);
CPlatformWindow platformWindow = (CPlatformWindow) peer.getPlatformWindow();
long nativeWindowPtr = platformWindow.getNSWindowPtr();
// Get drag cursor:
Cursor cursor = this.getCursor();
// If there isn't any drag image make one of default appearance: // If there isn't any drag image make one of default appearance:
if (fDragImage == null) if (fDragImage == null)
...@@ -139,19 +138,15 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { ...@@ -139,19 +138,15 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer {
try { try {
// Create native dragging source: // Create native dragging source:
final long nativeDragSource = createNativeDragSource(component, peer, nativeWindowPtr, transferable, triggerEvent, final long nativeDragSource = createNativeDragSource(component, nativeViewPtr, transferable, triggerEvent,
(int) (dragOrigin.getX()), (int) (dragOrigin.getY()), extModifiers, (int) (dragOrigin.getX()), (int) (dragOrigin.getY()), extModifiers,
clickCount, timestamp, cursor, fDragCImage, dragImageOffset.x, dragImageOffset.y, clickCount, timestamp, fDragCImage, dragImageOffset.x, dragImageOffset.y,
getDragSourceContext().getSourceActions(), formats, formatMap); getDragSourceContext().getSourceActions(), formats, formatMap);
if (nativeDragSource == 0) if (nativeDragSource == 0)
throw new InvalidDnDOperationException(""); throw new InvalidDnDOperationException("");
setNativeContext(nativeDragSource); setNativeContext(nativeDragSource);
CCursorManager.getInstance().startDrag(
(int) (dragOrigin.getX()),
(int) (dragOrigin.getY()));
} }
catch (Exception e) { catch (Exception e) {
...@@ -160,6 +155,8 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { ...@@ -160,6 +155,8 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer {
SunDropTargetContextPeer.setCurrentJVMLocalSourceTransferable(transferable); SunDropTargetContextPeer.setCurrentJVMLocalSourceTransferable(transferable);
CCursorManager.getInstance().setCursor(getCursor());
// Create a new thread to run the dragging operation since it's synchronous, only coming back // Create a new thread to run the dragging operation since it's synchronous, only coming back
// after dragging is finished. This leaves the AWT event thread free to handle AWT events which // after dragging is finished. This leaves the AWT event thread free to handle AWT events which
// are posted during dragging by native event handlers. // are posted during dragging by native event handlers.
...@@ -173,8 +170,6 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { ...@@ -173,8 +170,6 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
CCursorManager.getInstance().stopDrag();
releaseNativeDragSource(nativeDragSource); releaseNativeDragSource(nativeDragSource);
fDragImage = null; fDragImage = null;
if (fDragCImage != null) { if (fDragCImage != null) {
...@@ -189,8 +184,6 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { ...@@ -189,8 +184,6 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer {
} }
catch (Exception e) { catch (Exception e) {
CCursorManager.getInstance().stopDrag();
final long nativeDragSource = getNativeContext(); final long nativeDragSource = getNativeContext();
setNativeContext(0); setNativeContext(0);
releaseNativeDragSource(nativeDragSource); releaseNativeDragSource(nativeDragSource);
...@@ -416,13 +409,24 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { ...@@ -416,13 +409,24 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer {
final int modifiers, final int modifiers,
final int x, final int y) { final int x, final int y) {
CCursorManager.getInstance().updateDragPosition(x, y); try {
Component componentAt = LWCToolkit.invokeAndWait(
new Callable<Component>() {
@Override
public Component call() {
LWWindowPeer mouseEventComponent = LWWindowPeer.getWindowUnderCursor();
if (mouseEventComponent == null) {
return null;
}
Component root = SwingUtilities.getRoot(mouseEventComponent.getTarget());
if (root == null) {
return null;
}
Point rootLocation = root.getLocationOnScreen();
return getDropTargetAt(root, x - rootLocation.x, y - rootLocation.y);
}
}, getComponent());
Component rootComponent = SwingUtilities.getRoot(getComponent());
if(rootComponent != null) {
Point componentPoint = new Point(x, y);
SwingUtilities.convertPointFromScreen(componentPoint, rootComponent);
Component componentAt = SwingUtilities.getDeepestComponentAt(rootComponent, componentPoint.x, componentPoint.y);
if(componentAt != hoveringComponent) { if(componentAt != hoveringComponent) {
if(hoveringComponent != null) { if(hoveringComponent != null) {
dragExit(x, y); dragExit(x, y);
...@@ -432,20 +436,36 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { ...@@ -432,20 +436,36 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer {
} }
hoveringComponent = componentAt; hoveringComponent = componentAt;
} }
postDragSourceDragEvent(targetActions, modifiers, x, y,
DISPATCH_MOUSE_MOVED);
} catch (Exception e) {
throw new InvalidDnDOperationException("Failed to handle DragMouseMoved event");
} }
postDragSourceDragEvent(targetActions, modifiers, x, y,
DISPATCH_MOUSE_MOVED);
} }
/** //Returns the first lightweight or heavyweight Component which has a dropTarget ready to accept the drag
* upcall from native code //Should be called from the EventDispatchThread
*/ private static Component getDropTargetAt(Component root, int x, int y) {
private void dragEnter(final int targetActions, if (!root.contains(x, y) || !root.isEnabled() || !root.isVisible()) {
final int modifiers, return null;
final int x, final int y) { }
CCursorManager.getInstance().updateDragPosition(x, y);
if (root.getDropTarget() != null && root.getDropTarget().isActive()) {
return root;
}
postDragSourceDragEvent(targetActions, modifiers, x, y, DISPATCH_ENTER); if (root instanceof Container) {
for (Component comp : ((Container) root).getComponents()) {
Point loc = comp.getLocation();
Component dropTarget = getDropTargetAt(comp, x - loc.x, y - loc.y);
if (dropTarget != null) {
return dropTarget;
}
}
}
return null;
} }
/** /**
...@@ -455,19 +475,15 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { ...@@ -455,19 +475,15 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer {
hoveringComponent = null; hoveringComponent = null;
} }
public void setCursor(Cursor c) throws InvalidDnDOperationException { @Override
// TODO : BG protected void setNativeCursor(long nativeCtxt, Cursor c, int cType) {
//AWTLockAccess.awtLock(); CCursorManager.getInstance().setCursor(c);
super.setCursor(c);
//AWTLockAccess.awtUnlock();
} }
protected native void setNativeCursor(long nativeCtxt, Cursor c, int cType);
// Native support: // Native support:
private native long createNativeDragSource(Component component, ComponentPeer peer, long nativePeer, Transferable transferable, private native long createNativeDragSource(Component component, long nativePeer, Transferable transferable,
InputEvent triggerEvent, int dragPosX, int dragPosY, int extModifiers, int clickCount, long timestamp, InputEvent triggerEvent, int dragPosX, int dragPosY, int extModifiers, int clickCount, long timestamp,
Cursor cursor, CImage nsDragImage, int dragImageOffsetX, int dragImageOffsetY, CImage nsDragImage, int dragImageOffsetX, int dragImageOffsetY,
int sourceActions, long[] formats, Map formatMap); int sourceActions, long[] formats, Map formatMap);
private native void doDragging(long nativeDragSource); private native void doDragging(long nativeDragSource);
......
...@@ -30,6 +30,7 @@ import java.awt.peer.ComponentPeer; ...@@ -30,6 +30,7 @@ import java.awt.peer.ComponentPeer;
import java.awt.dnd.DropTarget; import java.awt.dnd.DropTarget;
import sun.lwawt.LWComponentPeer; import sun.lwawt.LWComponentPeer;
import sun.lwawt.PlatformWindow;
public final class CDropTarget { public final class CDropTarget {
...@@ -50,21 +51,11 @@ public final class CDropTarget { ...@@ -50,21 +51,11 @@ public final class CDropTarget {
fComponent = component; fComponent = component;
fPeer = peer; fPeer = peer;
// Make sure the drop target is a ComponentModel: long nativePeer = CPlatformWindow.getNativeViewPtr(((LWComponentPeer) peer).getPlatformWindow());
if (!(peer instanceof LWComponentPeer)) // Create native dragging destination:
throw new IllegalArgumentException("CDropTarget's peer must be a LWComponentPeer."); fNativeDropTarget = this.createNativeDropTarget(dropTarget, component, peer, nativePeer);
if (fNativeDropTarget == 0) {
// Get model pointer (CButton.m and such) and its native peer: throw new IllegalStateException("CDropTarget.createNativeDropTarget() failed.");
LWComponentPeer model = (LWComponentPeer) peer;
if (model.getPlatformWindow() instanceof CPlatformWindow) {
CPlatformWindow platformWindow = (CPlatformWindow) model.getPlatformWindow();
long nativePeer = platformWindow.getNSWindowPtr();
// Create native dragging destination:
fNativeDropTarget = this.createNativeDropTarget(dropTarget, component, peer, nativePeer);
if (fNativeDropTarget == 0) {
throw new IllegalStateException("CDropTarget.createNativeDropTarget() failed.");
}
} }
} }
......
...@@ -112,6 +112,14 @@ public class CEmbeddedFrame extends EmbeddedFrame { ...@@ -112,6 +112,14 @@ public class CEmbeddedFrame extends EmbeddedFrame {
public void handleFocusEvent(boolean focused) { public void handleFocusEvent(boolean focused) {
this.focused = focused; this.focused = focused;
if (focused) {
// see bug 8010925
// we can't put this to handleWindowFocusEvent because
// it won't be invoced if focuse is moved to a html element
// on the same page.
CClipboard clipboard = (CClipboard) Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.checkPasteboard();
}
if (parentWindowActive) { if (parentWindowActive) {
responder.handleWindowFocusEvent(focused, null); responder.handleWindowFocusEvent(focused, null);
} }
......
...@@ -875,6 +875,21 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo ...@@ -875,6 +875,21 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
} }
} }
/**
* Helper method to get a pointer to the native view from the PlatformWindow.
*/
static long getNativeViewPtr(PlatformWindow platformWindow) {
long nativePeer = 0L;
if (platformWindow instanceof CPlatformWindow) {
nativePeer = ((CPlatformWindow) platformWindow).getContentView().getAWTView();
} else if (platformWindow instanceof CViewPlatformEmbeddedFrame){
nativePeer = ((CViewPlatformEmbeddedFrame) platformWindow).getNSViewPtr();
} else {
throw new IllegalArgumentException("Unsupported platformWindow implementation");
}
return nativePeer;
}
/************************************************************* /*************************************************************
* Callbacks from the AWTWindow and AWTView objc classes. * Callbacks from the AWTWindow and AWTView objc classes.
*************************************************************/ *************************************************************/
......
/* /*
* 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
...@@ -25,10 +25,7 @@ ...@@ -25,10 +25,7 @@
package sun.lwawt.macosx; package sun.lwawt.macosx;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public final class CocoaConstants { public final class CocoaConstants {
private CocoaConstants(){} private CocoaConstants(){}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{- {-
/* /*
* 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
...@@ -34,7 +34,7 @@ Otherwise, see http://www.haskell.org/ghc/ ...@@ -34,7 +34,7 @@ Otherwise, see http://www.haskell.org/ghc/
import Data.List import Data.List
import Data.Maybe import Data.Maybe
import Char import Data.Char
data Width = W32 | W64 data Width = W32 | W64
deriving (Show, Eq, Bounded, Enum) deriving (Show, Eq, Bounded, Enum)
...@@ -196,8 +196,6 @@ sizeofRet nt = ...@@ -196,8 +196,6 @@ sizeofRet nt =
c2java ntype = c2java ntype =
unlines [ unlines [
"// native " ++ ntypeS ++ " -> java " ++ jprimS, "// native " ++ ntypeS ++ " -> java " ++ jprimS,
"/* No native methods here, but the constants are needed in the supporting JNI code */",
"@GenerateNativeHeader",
"public static final class " ++ className ++ " extends PrimitiveCoder<" ++ jclassS ++ ">{", "public static final class " ++ className ++ " extends PrimitiveCoder<" ++ jclassS ++ ">{",
"\tpublic static final " ++ className ++ " INST = new " ++ className ++ "();", "\tpublic static final " ++ className ++ " INST = new " ++ className ++ "();",
"\tpublic " ++ className ++ "(){ super("++ffitypeVal ntype++", \"" ++ [encoding ntype] ++ "\", "++jclassS++".class, "++jprimS++".class); }", "\tpublic " ++ className ++ "(){ super("++ffitypeVal ntype++", \"" ++ [encoding ntype] ++ "\", "++jclassS++".class, "++jprimS++".class); }",
...@@ -248,13 +246,10 @@ main = do ...@@ -248,13 +246,10 @@ main = do
putStrLn "package com.apple.jobjc;" putStrLn "package com.apple.jobjc;"
putStrLn "import com.apple.jobjc.JObjCRuntime.Width;" putStrLn "import com.apple.jobjc.JObjCRuntime.Width;"
putStrLn "import javax.tools.annotation.GenerateNativeHeader;"
putStrLn "// Auto generated by PrimitiveCoder.hs" putStrLn "// Auto generated by PrimitiveCoder.hs"
putStrLn "// Do not edit by hand." putStrLn "// Do not edit by hand."
putStrLn "/* No native methods here, but the constants are needed in the supporting JNI code */"
putStrLn "@GenerateNativeHeader"
putStrLn "public abstract class PrimitiveCoder<T> extends Coder<T>{" putStrLn "public abstract class PrimitiveCoder<T> extends Coder<T>{"
putStrLn "\tpublic PrimitiveCoder(int ffiTypeCode, String objCEncoding, Class jclass, Class jprim){" putStrLn "\tpublic PrimitiveCoder(int ffiTypeCode, String objCEncoding, Class jclass, Class jprim){"
......
/* /*
* 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
...@@ -24,10 +24,7 @@ ...@@ -24,10 +24,7 @@
*/ */
package com.apple.jobjc; package com.apple.jobjc;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class CFType extends Pointer<Void> { public class CFType extends Pointer<Void> {
protected CFType(long ptr) { super(ptr); } protected CFType(long ptr) { super(ptr); }
protected CFType(Pointer<?> ptr) { super(ptr.ptr); } protected CFType(Pointer<?> ptr) { super(ptr.ptr); }
......
/* /*
* 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
...@@ -35,7 +35,6 @@ import com.apple.jobjc.PrimitiveCoder.SCharCoder; ...@@ -35,7 +35,6 @@ import com.apple.jobjc.PrimitiveCoder.SCharCoder;
import com.apple.jobjc.PrimitiveCoder.SIntCoder; import com.apple.jobjc.PrimitiveCoder.SIntCoder;
import com.apple.jobjc.PrimitiveCoder.SLongLongCoder; import com.apple.jobjc.PrimitiveCoder.SLongLongCoder;
import com.apple.jobjc.PrimitiveCoder.SShortCoder; import com.apple.jobjc.PrimitiveCoder.SShortCoder;
import javax.tools.annotation.GenerateNativeHeader;
public abstract class Coder<T> { public abstract class Coder<T> {
private static native long getNativeFFITypePtrForCode(final int code); private static native long getNativeFFITypePtrForCode(final int code);
...@@ -143,8 +142,6 @@ public abstract class Coder<T> { ...@@ -143,8 +142,6 @@ public abstract class Coder<T> {
// //
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class VoidCoder extends Coder<Object>{ public static final class VoidCoder extends Coder<Object>{
public static final VoidCoder INST = new VoidCoder(); public static final VoidCoder INST = new VoidCoder();
public VoidCoder(){ super(FFI_VOID, "v", Void.class, void.class); } public VoidCoder(){ super(FFI_VOID, "v", Void.class, void.class); }
...@@ -153,8 +150,6 @@ public abstract class Coder<T> { ...@@ -153,8 +150,6 @@ public abstract class Coder<T> {
@Override public void push(JObjCRuntime runtime, long addr, Object x) { throw new RuntimeException("Trying to push a Void."); } @Override public void push(JObjCRuntime runtime, long addr, Object x) { throw new RuntimeException("Trying to push a Void."); }
} }
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class UnknownCoder extends Coder<Object> { public static final class UnknownCoder extends Coder<Object> {
public static final UnknownCoder INST = new UnknownCoder(); public static final UnknownCoder INST = new UnknownCoder();
public UnknownCoder(){ super(-1, "?", null, null); } public UnknownCoder(){ super(-1, "?", null, null); }
...@@ -163,8 +158,6 @@ public abstract class Coder<T> { ...@@ -163,8 +158,6 @@ public abstract class Coder<T> {
@Override public Object pop(JObjCRuntime runtime, long addr) { throw new RuntimeException("Coder not implemented"); } @Override public Object pop(JObjCRuntime runtime, long addr) { throw new RuntimeException("Coder not implemented"); }
} }
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class PrimitivePointerCoder extends Coder<Long> { public static final class PrimitivePointerCoder extends Coder<Long> {
public static final PrimitivePointerCoder INST = new PrimitivePointerCoder(); public static final PrimitivePointerCoder INST = new PrimitivePointerCoder();
public PrimitivePointerCoder(){ super(Coder.FFI_PTR, "^?", Long.class, long.class); } public PrimitivePointerCoder(){ super(Coder.FFI_PTR, "^?", Long.class, long.class); }
...@@ -194,8 +187,6 @@ public abstract class Coder<T> { ...@@ -194,8 +187,6 @@ public abstract class Coder<T> {
@Override public void push(JObjCRuntime runtime, long addr, Long x) { push(runtime, addr, (long) x); } @Override public void push(JObjCRuntime runtime, long addr, Long x) { push(runtime, addr, (long) x); }
} }
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class PointerCoder extends Coder<Pointer> { public static final class PointerCoder extends Coder<Pointer> {
public static final PointerCoder INST = new PointerCoder(); public static final PointerCoder INST = new PointerCoder();
public PointerCoder(){ super(FFI_PTR, "^?", Pointer.class); } public PointerCoder(){ super(FFI_PTR, "^?", Pointer.class); }
...@@ -209,8 +200,6 @@ public abstract class Coder<T> { ...@@ -209,8 +200,6 @@ public abstract class Coder<T> {
} }
} }
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class SELCoder extends Coder<SEL> { public static final class SELCoder extends Coder<SEL> {
public static final SELCoder INST = new SELCoder(); public static final SELCoder INST = new SELCoder();
public SELCoder(){ super(FFI_PTR, ":", SEL.class); } public SELCoder(){ super(FFI_PTR, ":", SEL.class); }
...@@ -224,8 +213,6 @@ public abstract class Coder<T> { ...@@ -224,8 +213,6 @@ public abstract class Coder<T> {
} }
} }
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static abstract class StructCoder extends Coder<Struct> { public static abstract class StructCoder extends Coder<Struct> {
private final FFIType ffiType; private final FFIType ffiType;
final int sizeof; final int sizeof;
...@@ -267,8 +254,6 @@ public abstract class Coder<T> { ...@@ -267,8 +254,6 @@ public abstract class Coder<T> {
} }
} }
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class IDCoder extends Coder<ID>{ public static final class IDCoder extends Coder<ID>{
public static final IDCoder INST = new IDCoder(); public static final IDCoder INST = new IDCoder();
public IDCoder(){ super(FFI_PTR, "@", ID.class); } public IDCoder(){ super(FFI_PTR, "@", ID.class); }
...@@ -287,8 +272,6 @@ public abstract class Coder<T> { ...@@ -287,8 +272,6 @@ public abstract class Coder<T> {
} }
} }
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class NSClassCoder extends Coder<NSClass>{ public static final class NSClassCoder extends Coder<NSClass>{
public static final NSClassCoder INST = new NSClassCoder(); public static final NSClassCoder INST = new NSClassCoder();
public NSClassCoder(){ super(FFI_PTR, "#", NSClass.class); } public NSClassCoder(){ super(FFI_PTR, "#", NSClass.class); }
......
/* /*
* 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
...@@ -26,10 +26,7 @@ package com.apple.jobjc; ...@@ -26,10 +26,7 @@ package com.apple.jobjc;
import com.apple.jobjc.Coder.PrimitivePointerCoder; import com.apple.jobjc.Coder.PrimitivePointerCoder;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
class FFIType{ class FFIType{
private static native void makeFFIType(long ffi_type_buf, long elements_buf); private static native void makeFFIType(long ffi_type_buf, long elements_buf);
private static native int getFFITypeSizeof(); private static native int getFFITypeSizeof();
......
/* /*
* 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
...@@ -24,10 +24,7 @@ ...@@ -24,10 +24,7 @@
*/ */
package com.apple.jobjc; package com.apple.jobjc;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class Function { public class Function {
private static native long getFxnPtrForFunctionName(final String functionName); private static native long getFxnPtrForFunctionName(final String functionName);
private static native long getFxnPtrForFunctionNameAndLib(final long libPtr, final String functionName); private static native long getFxnPtrForFunctionNameAndLib(final long libPtr, final String functionName);
......
/* /*
* 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
...@@ -29,10 +29,7 @@ import java.lang.reflect.Constructor; ...@@ -29,10 +29,7 @@ import java.lang.reflect.Constructor;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class ID extends Pointer<Void>{ public class ID extends Pointer<Void>{
static native String getNativeDescription(final long objPtr); static native String getNativeDescription(final long objPtr);
......
/* /*
* 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
...@@ -30,18 +30,13 @@ import com.apple.jobjc.Coder.PrimitivePointerCoder; ...@@ -30,18 +30,13 @@ import com.apple.jobjc.Coder.PrimitivePointerCoder;
import com.apple.jobjc.Coder.SELCoder; import com.apple.jobjc.Coder.SELCoder;
import com.apple.jobjc.Coder.StructCoder; import com.apple.jobjc.Coder.StructCoder;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public abstract class Invoke { public abstract class Invoke {
public abstract void invoke(NativeArgumentBuffer argBuf); public abstract void invoke(NativeArgumentBuffer argBuf);
public abstract void invoke(NativeArgumentBuffer buffer, Struct retvalStruct); public abstract void invoke(NativeArgumentBuffer buffer, Struct retvalStruct);
// //
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class FunCall extends Invoke{ public static final class FunCall extends Invoke{
static native void invoke(long cifPtr, long fxnPtr, long retValPtr, long argsPtr); static native void invoke(long cifPtr, long fxnPtr, long retValPtr, long argsPtr);
...@@ -78,8 +73,6 @@ public abstract class Invoke { ...@@ -78,8 +73,6 @@ public abstract class Invoke {
} }
} }
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class MsgSend extends Invoke{ public static final class MsgSend extends Invoke{
static{ System.load("/usr/lib/libobjc.dylib"); } static{ System.load("/usr/lib/libobjc.dylib"); }
...@@ -165,8 +158,6 @@ public abstract class Invoke { ...@@ -165,8 +158,6 @@ public abstract class Invoke {
} }
} }
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class MsgSendSuper extends Invoke{ public static final class MsgSendSuper extends Invoke{
static{ System.load("/usr/lib/libobjc.dylib"); } static{ System.load("/usr/lib/libobjc.dylib"); }
......
/* /*
* 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
...@@ -31,16 +31,11 @@ import java.util.List; ...@@ -31,16 +31,11 @@ import java.util.List;
import sun.misc.Unsafe; import sun.misc.Unsafe;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public final class JObjCRuntime { public final class JObjCRuntime {
static { System.loadLibrary("JObjC"); } static { System.loadLibrary("JObjC"); }
@GenerateNativeHeader
public static enum Arch{ ppc, i386, x86_64 }; public static enum Arch{ ppc, i386, x86_64 };
@GenerateNativeHeader
public static enum Width{ W32, W64 }; public static enum Width{ W32, W64 };
public static final Arch ARCH = getArch(); public static final Arch ARCH = getArch();
......
/* /*
* 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
...@@ -25,10 +25,7 @@ ...@@ -25,10 +25,7 @@
package com.apple.jobjc; package com.apple.jobjc;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class MacOSXFramework { public class MacOSXFramework {
private static native long retainFramework(final String frameworkName); private static native long retainFramework(final String frameworkName);
private static native void releaseFramework(final long frameworkPtr); private static native void releaseFramework(final long frameworkPtr);
......
/* /*
* 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
...@@ -27,13 +27,8 @@ package com.apple.jobjc; ...@@ -27,13 +27,8 @@ package com.apple.jobjc;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class NSClass<T extends ID> extends ID { public class NSClass<T extends ID> extends ID {
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static class NSClassNotFoundException extends RuntimeException{ public static class NSClassNotFoundException extends RuntimeException{
public NSClassNotFoundException(String m){ super(m); } public NSClassNotFoundException(String m){ super(m); }
public NSClassNotFoundException(String m, Throwable cause){ super(m, cause); } public NSClassNotFoundException(String m, Throwable cause){ super(m, cause); }
......
/* /*
* 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
...@@ -28,10 +28,7 @@ import java.nio.ByteOrder; ...@@ -28,10 +28,7 @@ import java.nio.ByteOrder;
import com.apple.jobjc.Coder.PrimitivePointerCoder; import com.apple.jobjc.Coder.PrimitivePointerCoder;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public final class NativeArgumentBuffer{ public final class NativeArgumentBuffer{
private static final ThreadLocal<NativeArgumentBuffer> threadLocal = new ThreadLocal<NativeArgumentBuffer>(); private static final ThreadLocal<NativeArgumentBuffer> threadLocal = new ThreadLocal<NativeArgumentBuffer>();
......
/* /*
* 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
...@@ -27,13 +27,10 @@ package com.apple.jobjc; ...@@ -27,13 +27,10 @@ package com.apple.jobjc;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.ByteOrder; import java.nio.ByteOrder;
import javax.tools.annotation.GenerateNativeHeader;
/** /**
* A wrapper around a direct ByteBuffer and its native pointer. For documentation, @see java.nio.ByteBuffer * A wrapper around a direct ByteBuffer and its native pointer. For documentation, @see java.nio.ByteBuffer
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class NativeBuffer { public class NativeBuffer {
static native long getPtrOfBuffer(final ByteBuffer byteBuffer); static native long getPtrOfBuffer(final ByteBuffer byteBuffer);
......
/* /*
* 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
...@@ -24,10 +24,7 @@ ...@@ -24,10 +24,7 @@
*/ */
package com.apple.jobjc; package com.apple.jobjc;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public abstract class NativeObjectLifecycleManager { public abstract class NativeObjectLifecycleManager {
private static native void retainNativeObject(final long ptr); private static native void retainNativeObject(final long ptr);
private static native void releaseNativeObject(final long ptr); private static native void releaseNativeObject(final long ptr);
...@@ -37,8 +34,6 @@ public abstract class NativeObjectLifecycleManager { ...@@ -37,8 +34,6 @@ public abstract class NativeObjectLifecycleManager {
abstract void end(final long ptr); abstract void end(final long ptr);
boolean shouldPreRetain() { return false; } boolean shouldPreRetain() { return false; }
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static class CFRetainRelease extends NativeObjectLifecycleManager { public static class CFRetainRelease extends NativeObjectLifecycleManager {
public static final NativeObjectLifecycleManager INST = new CFRetainRelease(); public static final NativeObjectLifecycleManager INST = new CFRetainRelease();
@Override void begin(final long ptr) { retainNativeObject(ptr); } @Override void begin(final long ptr) { retainNativeObject(ptr); }
...@@ -46,16 +41,12 @@ public abstract class NativeObjectLifecycleManager { ...@@ -46,16 +41,12 @@ public abstract class NativeObjectLifecycleManager {
@Override boolean shouldPreRetain() { return true; } @Override boolean shouldPreRetain() { return true; }
} }
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static class Free extends NativeObjectLifecycleManager { public static class Free extends NativeObjectLifecycleManager {
public static final NativeObjectLifecycleManager INST = new Free(); public static final NativeObjectLifecycleManager INST = new Free();
@Override void begin(final long ptr) { } @Override void begin(final long ptr) { }
@Override void end(final long ptr) { freeNativeObject(ptr); } @Override void end(final long ptr) { freeNativeObject(ptr); }
} }
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static class Nothing extends NativeObjectLifecycleManager { public static class Nothing extends NativeObjectLifecycleManager {
public static final NativeObjectLifecycleManager INST = new Nothing(); public static final NativeObjectLifecycleManager INST = new Nothing();
@Override void begin(final long ptr) { } @Override void begin(final long ptr) { }
......
/* /*
* 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
...@@ -24,10 +24,7 @@ ...@@ -24,10 +24,7 @@
*/ */
package com.apple.jobjc; package com.apple.jobjc;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class Opaque extends Pointer<Void> { public class Opaque extends Pointer<Void> {
protected Opaque(long ptr) { super(ptr); } protected Opaque(long ptr) { super(ptr); }
protected Opaque(Pointer<?> ptr) { super(ptr.ptr); } protected Opaque(Pointer<?> ptr) { super(ptr.ptr); }
......
/* /*
* 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
...@@ -24,10 +24,7 @@ ...@@ -24,10 +24,7 @@
*/ */
package com.apple.jobjc; package com.apple.jobjc;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class Pointer <T> implements Comparable<Pointer<T>>{ public class Pointer <T> implements Comparable<Pointer<T>>{
long ptr; long ptr;
......
/* /*
* 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
...@@ -24,11 +24,8 @@ ...@@ -24,11 +24,8 @@
*/ */
package com.apple.jobjc; package com.apple.jobjc;
import com.apple.jobjc.JObjCRuntime.Width; import com.apple.jobjc.JObjCRuntime.Width;
import javax.tools.annotation.GenerateNativeHeader;
// Auto generated by PrimitiveCoder.hs // Auto generated by PrimitiveCoder.hs
// Do not edit by hand. // Do not edit by hand.
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public abstract class PrimitiveCoder<T> extends Coder<T>{ public abstract class PrimitiveCoder<T> extends Coder<T>{
public PrimitiveCoder(int ffiTypeCode, String objCEncoding, Class jclass, Class jprim){ public PrimitiveCoder(int ffiTypeCode, String objCEncoding, Class jclass, Class jprim){
super(ffiTypeCode, objCEncoding, jclass, jprim); super(ffiTypeCode, objCEncoding, jclass, jprim);
...@@ -130,8 +127,6 @@ public abstract class PrimitiveCoder<T> extends Coder<T>{ ...@@ -130,8 +127,6 @@ public abstract class PrimitiveCoder<T> extends Coder<T>{
// native BOOL -> java boolean // native BOOL -> java boolean
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class BoolCoder extends PrimitiveCoder<Boolean>{ public static final class BoolCoder extends PrimitiveCoder<Boolean>{
public static final BoolCoder INST = new BoolCoder(); public static final BoolCoder INST = new BoolCoder();
public BoolCoder(){ super(FFI_SINT8, "B", Boolean.class, boolean.class); } public BoolCoder(){ super(FFI_SINT8, "B", Boolean.class, boolean.class); }
...@@ -175,8 +170,6 @@ public static final class BoolCoder extends PrimitiveCoder<Boolean>{ ...@@ -175,8 +170,6 @@ public static final class BoolCoder extends PrimitiveCoder<Boolean>{
} }
// native schar -> java byte // native schar -> java byte
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class SCharCoder extends PrimitiveCoder<Byte>{ public static final class SCharCoder extends PrimitiveCoder<Byte>{
public static final SCharCoder INST = new SCharCoder(); public static final SCharCoder INST = new SCharCoder();
public SCharCoder(){ super(FFI_SINT8, "c", Byte.class, byte.class); } public SCharCoder(){ super(FFI_SINT8, "c", Byte.class, byte.class); }
...@@ -220,8 +213,6 @@ public static final class SCharCoder extends PrimitiveCoder<Byte>{ ...@@ -220,8 +213,6 @@ public static final class SCharCoder extends PrimitiveCoder<Byte>{
} }
// native uchar -> java byte // native uchar -> java byte
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class UCharCoder extends PrimitiveCoder<Byte>{ public static final class UCharCoder extends PrimitiveCoder<Byte>{
public static final UCharCoder INST = new UCharCoder(); public static final UCharCoder INST = new UCharCoder();
public UCharCoder(){ super(FFI_UINT8, "C", Byte.class, byte.class); } public UCharCoder(){ super(FFI_UINT8, "C", Byte.class, byte.class); }
...@@ -265,8 +256,6 @@ public static final class UCharCoder extends PrimitiveCoder<Byte>{ ...@@ -265,8 +256,6 @@ public static final class UCharCoder extends PrimitiveCoder<Byte>{
} }
// native sshort -> java short // native sshort -> java short
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class SShortCoder extends PrimitiveCoder<Short>{ public static final class SShortCoder extends PrimitiveCoder<Short>{
public static final SShortCoder INST = new SShortCoder(); public static final SShortCoder INST = new SShortCoder();
public SShortCoder(){ super(FFI_SINT16, "s", Short.class, short.class); } public SShortCoder(){ super(FFI_SINT16, "s", Short.class, short.class); }
...@@ -310,8 +299,6 @@ public static final class SShortCoder extends PrimitiveCoder<Short>{ ...@@ -310,8 +299,6 @@ public static final class SShortCoder extends PrimitiveCoder<Short>{
} }
// native ushort -> java short // native ushort -> java short
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class UShortCoder extends PrimitiveCoder<Short>{ public static final class UShortCoder extends PrimitiveCoder<Short>{
public static final UShortCoder INST = new UShortCoder(); public static final UShortCoder INST = new UShortCoder();
public UShortCoder(){ super(FFI_UINT16, "S", Short.class, short.class); } public UShortCoder(){ super(FFI_UINT16, "S", Short.class, short.class); }
...@@ -355,8 +342,6 @@ public static final class UShortCoder extends PrimitiveCoder<Short>{ ...@@ -355,8 +342,6 @@ public static final class UShortCoder extends PrimitiveCoder<Short>{
} }
// native sint -> java int // native sint -> java int
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class SIntCoder extends PrimitiveCoder<Integer>{ public static final class SIntCoder extends PrimitiveCoder<Integer>{
public static final SIntCoder INST = new SIntCoder(); public static final SIntCoder INST = new SIntCoder();
public SIntCoder(){ super(FFI_SINT32, "i", Integer.class, int.class); } public SIntCoder(){ super(FFI_SINT32, "i", Integer.class, int.class); }
...@@ -400,8 +385,6 @@ public static final class SIntCoder extends PrimitiveCoder<Integer>{ ...@@ -400,8 +385,6 @@ public static final class SIntCoder extends PrimitiveCoder<Integer>{
} }
// native uint -> java int // native uint -> java int
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class UIntCoder extends PrimitiveCoder<Integer>{ public static final class UIntCoder extends PrimitiveCoder<Integer>{
public static final UIntCoder INST = new UIntCoder(); public static final UIntCoder INST = new UIntCoder();
public UIntCoder(){ super(FFI_UINT32, "I", Integer.class, int.class); } public UIntCoder(){ super(FFI_UINT32, "I", Integer.class, int.class); }
...@@ -445,8 +428,6 @@ public static final class UIntCoder extends PrimitiveCoder<Integer>{ ...@@ -445,8 +428,6 @@ public static final class UIntCoder extends PrimitiveCoder<Integer>{
} }
// native slong -> java long // native slong -> java long
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class SLongCoder extends PrimitiveCoder<Long>{ public static final class SLongCoder extends PrimitiveCoder<Long>{
public static final SLongCoder INST = new SLongCoder(); public static final SLongCoder INST = new SLongCoder();
public SLongCoder(){ super((JObjCRuntime.IS64 ? (FFI_SINT64) : (FFI_SINT32)), "l", Long.class, long.class); } public SLongCoder(){ super((JObjCRuntime.IS64 ? (FFI_SINT64) : (FFI_SINT32)), "l", Long.class, long.class); }
...@@ -496,8 +477,6 @@ public static final class SLongCoder extends PrimitiveCoder<Long>{ ...@@ -496,8 +477,6 @@ public static final class SLongCoder extends PrimitiveCoder<Long>{
} }
// native ulong -> java long // native ulong -> java long
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class ULongCoder extends PrimitiveCoder<Long>{ public static final class ULongCoder extends PrimitiveCoder<Long>{
public static final ULongCoder INST = new ULongCoder(); public static final ULongCoder INST = new ULongCoder();
public ULongCoder(){ super((JObjCRuntime.IS64 ? (FFI_UINT64) : (FFI_UINT32)), "L", Long.class, long.class); } public ULongCoder(){ super((JObjCRuntime.IS64 ? (FFI_UINT64) : (FFI_UINT32)), "L", Long.class, long.class); }
...@@ -547,8 +526,6 @@ public static final class ULongCoder extends PrimitiveCoder<Long>{ ...@@ -547,8 +526,6 @@ public static final class ULongCoder extends PrimitiveCoder<Long>{
} }
// native slonglong -> java long // native slonglong -> java long
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class SLongLongCoder extends PrimitiveCoder<Long>{ public static final class SLongLongCoder extends PrimitiveCoder<Long>{
public static final SLongLongCoder INST = new SLongLongCoder(); public static final SLongLongCoder INST = new SLongLongCoder();
public SLongLongCoder(){ super(FFI_SINT64, "q", Long.class, long.class); } public SLongLongCoder(){ super(FFI_SINT64, "q", Long.class, long.class); }
...@@ -592,8 +569,6 @@ public static final class SLongLongCoder extends PrimitiveCoder<Long>{ ...@@ -592,8 +569,6 @@ public static final class SLongLongCoder extends PrimitiveCoder<Long>{
} }
// native ulonglong -> java long // native ulonglong -> java long
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class ULongLongCoder extends PrimitiveCoder<Long>{ public static final class ULongLongCoder extends PrimitiveCoder<Long>{
public static final ULongLongCoder INST = new ULongLongCoder(); public static final ULongLongCoder INST = new ULongLongCoder();
public ULongLongCoder(){ super(FFI_UINT64, "Q", Long.class, long.class); } public ULongLongCoder(){ super(FFI_UINT64, "Q", Long.class, long.class); }
...@@ -637,8 +612,6 @@ public static final class ULongLongCoder extends PrimitiveCoder<Long>{ ...@@ -637,8 +612,6 @@ public static final class ULongLongCoder extends PrimitiveCoder<Long>{
} }
// native float -> java float // native float -> java float
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class FloatCoder extends PrimitiveCoder<Float>{ public static final class FloatCoder extends PrimitiveCoder<Float>{
public static final FloatCoder INST = new FloatCoder(); public static final FloatCoder INST = new FloatCoder();
public FloatCoder(){ super(FFI_FLOAT, "f", Float.class, float.class); } public FloatCoder(){ super(FFI_FLOAT, "f", Float.class, float.class); }
...@@ -682,8 +655,6 @@ public static final class FloatCoder extends PrimitiveCoder<Float>{ ...@@ -682,8 +655,6 @@ public static final class FloatCoder extends PrimitiveCoder<Float>{
} }
// native double -> java double // native double -> java double
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public static final class DoubleCoder extends PrimitiveCoder<Double>{ public static final class DoubleCoder extends PrimitiveCoder<Double>{
public static final DoubleCoder INST = new DoubleCoder(); public static final DoubleCoder INST = new DoubleCoder();
public DoubleCoder(){ super(FFI_DOUBLE, "d", Double.class, double.class); } public DoubleCoder(){ super(FFI_DOUBLE, "d", Double.class, double.class); }
......
/* /*
* 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
...@@ -24,10 +24,7 @@ ...@@ -24,10 +24,7 @@
*/ */
package com.apple.jobjc; package com.apple.jobjc;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class SEL { public class SEL {
static native long getSelectorPtr(String selectorName); static native long getSelectorPtr(String selectorName);
static native String getSelectorName(long ptr); static native String getSelectorName(long ptr);
......
/* /*
* 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
...@@ -24,13 +24,10 @@ ...@@ -24,13 +24,10 @@
*/ */
package com.apple.jobjc; package com.apple.jobjc;
import javax.tools.annotation.GenerateNativeHeader;
/** /**
* A struct is malloced on the C heap and accessed in Java through a ByteBuffer. * A struct is malloced on the C heap and accessed in Java through a ByteBuffer.
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public abstract class Struct{ public abstract class Struct{
protected final NativeBuffer raw; protected final NativeBuffer raw;
private final JObjCRuntime runtime; private final JObjCRuntime runtime;
......
/* /*
* 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
...@@ -33,10 +33,7 @@ import com.apple.jobjc.Coder.PrimitivePointerCoder; ...@@ -33,10 +33,7 @@ import com.apple.jobjc.Coder.PrimitivePointerCoder;
import com.apple.jobjc.Coder.VoidCoder; import com.apple.jobjc.Coder.VoidCoder;
import com.apple.jobjc.Invoke.MsgSend; import com.apple.jobjc.Invoke.MsgSend;
import javax.tools.annotation.GenerateNativeHeader;
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
final class Subclassing { final class Subclassing {
static native long allocateClassPair(long superClass, String name); static native long allocateClassPair(long superClass, String name);
static native boolean addIVarForJObj(long clazz); static native boolean addIVarForJObj(long clazz);
......
/* /*
* 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
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
*/ */
#include "com_apple_jobjc_Invoke_FunCall.h" #include "com_apple_jobjc_Invoke_FunCall.h"
#include "com_apple_jobjc_Invoke_MsgSend.h"
#include "com_apple_jobjc_Invoke_MsgSendSuper.h"
#include <ffi/ffi.h> #include <ffi/ffi.h>
#include <objc/message.h> #include <objc/message.h>
#include <JavaNativeFoundation/JavaNativeFoundation.h> #include <JavaNativeFoundation/JavaNativeFoundation.h>
......
/* /*
* 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
...@@ -23,6 +23,5 @@ ...@@ -23,6 +23,5 @@
* questions. * questions.
*/ */
#include "com_apple_jobjc_JObjCRuntime.h"
#include "Cocoa/Cocoa.h" #include "Cocoa/Cocoa.h"
...@@ -189,18 +189,18 @@ static CClipboard *sClipboard = nil; ...@@ -189,18 +189,18 @@ static CClipboard *sClipboard = nil;
- (void) checkPasteboard:(id)application { - (void) checkPasteboard:(id)application {
AWT_ASSERT_APPKIT_THREAD; AWT_ASSERT_APPKIT_THREAD;
//NSLog(@"CClipboard checkPasteboard oldCount %d newCount %d newTypes %@", fChangeCount, [[NSPasteboard generalPasteboard] changeCount], [[NSPasteboard generalPasteboard] types]); //NSLog(@"CClipboard checkPasteboard oldCount %d newCount %d newTypes %@", fChangeCount, [[NSPasteboard generalPasteboard] changeCount], [[NSPasteboard generalPasteboard] types]);
// This is called via NSApplicationDidBecomeActiveNotification. // This is called via NSApplicationDidBecomeActiveNotification.
// If the change count on the general pasteboard is different than when we set it // If the change count on the general pasteboard is different than when we set it
// someone else put data on the clipboard. That means the current owner lost ownership. // someone else put data on the clipboard. That means the current owner lost ownership.
NSInteger newChangeCount = [[NSPasteboard generalPasteboard] changeCount]; NSInteger newChangeCount = [[NSPasteboard generalPasteboard] changeCount];
if (fChangeCount != newChangeCount) { if (fChangeCount != newChangeCount) {
fChangeCount = newChangeCount; fChangeCount = newChangeCount;
[self pasteboardChangedOwner:[NSPasteboard generalPasteboard]]; [self pasteboardChangedOwner:[NSPasteboard generalPasteboard]];
} }
} }
...@@ -371,4 +371,21 @@ JNF_COCOA_EXIT(env); ...@@ -371,4 +371,21 @@ JNF_COCOA_EXIT(env);
return returnValue; return returnValue;
} }
/*
* Class: sun_lwawt_macosx_CClipboard
* Method: checkPasteboard
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CClipboard_checkPasteboard
(JNIEnv *env, jobject inObject )
{
JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
[[CClipboard sharedClipboard] checkPasteboard:nil];
}];
JNF_COCOA_EXIT(env);
}
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
@private @private
NSView* fView; NSView* fView;
jobject fComponent; jobject fComponent;
jobject fComponentPeer;
jobject fDragSourceContextPeer; jobject fDragSourceContextPeer;
jobject fTransferable; jobject fTransferable;
...@@ -43,8 +42,6 @@ ...@@ -43,8 +42,6 @@
jint fClickCount; jint fClickCount;
jint fModifiers; jint fModifiers;
jobject fCursor;
NSImage* fDragImage; NSImage* fDragImage;
NSPoint fDragImageOffset; NSPoint fDragImageOffset;
...@@ -59,12 +56,22 @@ ...@@ -59,12 +56,22 @@
+ (CDragSource *) currentDragSource; + (CDragSource *) currentDragSource;
// Common methods: // Common methods:
- (id)init:(jobject)jdragsourcecontextpeer component:(jobject)jcomponent peer:(jobject)jpeer control:(id)control - (id) init:(jobject)jDragSourceContextPeer
transferable:(jobject)jtransferable triggerEvent:(jobject)jtrigger component:(jobject)jComponent
dragPosX:(jint)dragPosX dragPosY:(jint)dragPosY modifiers:(jint)extModifiers clickCount:(jint)clickCount timeStamp:(jlong)timeStamp control:(id)control
cursor:(jobject)jcursor transferable:(jobject)jTransferable
dragImage:(jobject)jnsdragimage dragImageOffsetX:(jint)jdragimageoffsetx dragImageOffsetY:(jint)jdragimageoffsety triggerEvent:(jobject)jTrigger
sourceActions:(jint)jsourceactions formats:(jlongArray)jformats formatMap:(jobject)jformatmap; dragPosX:(jint)dragPosX
dragPosY:(jint)dragPosY
modifiers:(jint)extModifiers
clickCount:(jint)clickCount
timeStamp:(jlong)timeStamp
dragImage:(jobject)jDragImage
dragImageOffsetX:(jint)jDragImageOffsetX
dragImageOffsetY:(jint)jDragImageOffsetY
sourceActions:(jint)jSourceActions
formats:(jlongArray)jFormats
formatMap:(jobject)jFormatMap;
- (void)removeFromView:(JNIEnv *)env; - (void)removeFromView:(JNIEnv *)env;
......
...@@ -84,12 +84,22 @@ static BOOL sNeedsEnter; ...@@ -84,12 +84,22 @@ static BOOL sNeedsEnter;
return sCurrentDragSource; return sCurrentDragSource;
} }
- (id)init:(jobject)jdragsourcecontextpeer component:(jobject)jcomponent peer:(jobject)jpeer control:(id)control - (id) init:(jobject)jDragSourceContextPeer
transferable:(jobject)jtransferable triggerEvent:(jobject)jtrigger component:(jobject)jComponent
dragPosX:(jint)dragPosX dragPosY:(jint)dragPosY modifiers:(jint)extModifiers clickCount:(jint)clickCount control:(id)control
timeStamp:(jlong)timeStamp cursor:(jobject)jcursor transferable:(jobject)jTransferable
dragImage:(jobject)jnsdragimage dragImageOffsetX:(jint)jdragimageoffsetx dragImageOffsetY:(jint)jdragimageoffsety triggerEvent:(jobject)jTrigger
sourceActions:(jint)jsourceactions formats:(jlongArray)jformats formatMap:(jobject)jformatmap dragPosX:(jint)dragPosX
dragPosY:(jint)dragPosY
modifiers:(jint)extModifiers
clickCount:(jint)clickCount
timeStamp:(jlong)timeStamp
dragImage:(jobject)jDragImage
dragImageOffsetX:(jint)jDragImageOffsetX
dragImageOffsetY:(jint)jDragImageOffsetY
sourceActions:(jint)jSourceActions
formats:(jlongArray)jFormats
formatMap:(jobject)jFormatMap
{ {
self = [super init]; self = [super init];
DLog2(@"[CDragSource init]: %@\n", self); DLog2(@"[CDragSource init]: %@\n", self);
...@@ -100,27 +110,25 @@ static BOOL sNeedsEnter; ...@@ -100,27 +110,25 @@ static BOOL sNeedsEnter;
// Construct the object if we have a valid model for it: // Construct the object if we have a valid model for it:
if (control != nil) { if (control != nil) {
JNIEnv *env = [ThreadUtilities getJNIEnv]; JNIEnv *env = [ThreadUtilities getJNIEnv];
fComponent = JNFNewGlobalRef(env, jcomponent); fComponent = JNFNewGlobalRef(env, jComponent);
fComponentPeer = JNFNewGlobalRef(env, jpeer); fDragSourceContextPeer = JNFNewGlobalRef(env, jDragSourceContextPeer);
fDragSourceContextPeer = JNFNewGlobalRef(env, jdragsourcecontextpeer);
fTransferable = JNFNewGlobalRef(env, jtransferable); fTransferable = JNFNewGlobalRef(env, jTransferable);
fTriggerEvent = JNFNewGlobalRef(env, jtrigger); fTriggerEvent = JNFNewGlobalRef(env, jTrigger);
fCursor = JNFNewGlobalRef(env, jcursor);
if (jnsdragimage) { if (jDragImage) {
JNF_MEMBER_CACHE(nsImagePtr, CImageClass, "ptr", "J"); JNF_MEMBER_CACHE(nsImagePtr, CImageClass, "ptr", "J");
jlong imgPtr = JNFGetLongField(env, jnsdragimage, nsImagePtr); jlong imgPtr = JNFGetLongField(env, jDragImage, nsImagePtr);
fDragImage = (NSImage*) jlong_to_ptr(imgPtr); // Double-casting prevents compiler 'd$|// fDragImage = (NSImage*) jlong_to_ptr(imgPtr); // Double-casting prevents compiler 'd$|//
[fDragImage retain]; [fDragImage retain];
} }
fDragImageOffset = NSMakePoint(jdragimageoffsetx, jdragimageoffsety); fDragImageOffset = NSMakePoint(jDragImageOffsetX, jDragImageOffsetY);
fSourceActions = jsourceactions; fSourceActions = jSourceActions;
fFormats = JNFNewGlobalRef(env, jformats); fFormats = JNFNewGlobalRef(env, jFormats);
fFormatMap = JNFNewGlobalRef(env, jformatmap); fFormatMap = JNFNewGlobalRef(env, jFormatMap);
fTriggerEventTimeStamp = timeStamp; fTriggerEventTimeStamp = timeStamp;
fDragPos = NSMakePoint(dragPosX, dragPosY); fDragPos = NSMakePoint(dragPosX, dragPosY);
...@@ -129,9 +137,8 @@ static BOOL sNeedsEnter; ...@@ -129,9 +137,8 @@ static BOOL sNeedsEnter;
// Set this object as a dragging source: // Set this object as a dragging source:
AWTView *awtView = [((NSWindow *) control) contentView]; fView = [(AWTView *) control retain];
fView = [awtView retain]; [fView setDragSource:self];
[awtView setDragSource:self];
// Let AWTEvent know Java drag is getting underway: // Let AWTEvent know Java drag is getting underway:
[NSEvent javaDraggingBegin]; [NSEvent javaDraggingBegin];
...@@ -158,11 +165,6 @@ static BOOL sNeedsEnter; ...@@ -158,11 +165,6 @@ static BOOL sNeedsEnter;
fComponent = NULL; fComponent = NULL;
} }
if (fComponentPeer != NULL) {
JNFDeleteGlobalRef(env, fComponentPeer);
fComponentPeer = NULL;
}
if (fDragSourceContextPeer != NULL) { if (fDragSourceContextPeer != NULL) {
JNFDeleteGlobalRef(env, fDragSourceContextPeer); JNFDeleteGlobalRef(env, fDragSourceContextPeer);
fDragSourceContextPeer = NULL; fDragSourceContextPeer = NULL;
...@@ -178,11 +180,6 @@ static BOOL sNeedsEnter; ...@@ -178,11 +180,6 @@ static BOOL sNeedsEnter;
fTriggerEvent = NULL; fTriggerEvent = NULL;
} }
if (fCursor != NULL) {
JNFDeleteGlobalRef(env, fCursor);
fCursor = NULL;
}
if (fFormats != NULL) { if (fFormats != NULL) {
JNFDeleteGlobalRef(env, fFormats); JNFDeleteGlobalRef(env, fFormats);
fFormats = NULL; fFormats = NULL;
...@@ -586,11 +583,6 @@ static BOOL sNeedsEnter; ...@@ -586,11 +583,6 @@ static BOOL sNeedsEnter;
{ {
AWT_ASSERT_NOT_APPKIT_THREAD; AWT_ASSERT_NOT_APPKIT_THREAD;
// Set the drag cursor (or not 3839999)
//JNIEnv *env = [ThreadUtilities getJNIEnv];
//jobject gCursor = JNFNewGlobalRef(env, fCursor);
//[EventFactory setJavaCursor:gCursor withEnv:env];
[self performSelectorOnMainThread:@selector(doDrag) withObject:nil waitUntilDone:YES]; // AWT_THREADING Safe (called from unique asynchronous thread) [self performSelectorOnMainThread:@selector(doDrag) withObject:nil waitUntilDone:YES]; // AWT_THREADING Safe (called from unique asynchronous thread)
} }
......
...@@ -34,12 +34,13 @@ ...@@ -34,12 +34,13 @@
/* /*
* Class: sun_lwawt_macosx_CDragSourceContextPeer * Class: sun_lwawt_macosx_CDragSourceContextPeer
* Method: createNativeDragSource * Method: createNativeDragSource
* Signature: (Ljava/awt/Component;Ljava/awt/peer/ComponentPeer;JLjava/awt/datatransfer/Transferable;Ljava/awt/event/InputEvent;IIIIJLjava/awt/Cursor;IJIII[JLjava/util/Map;)J * Signature: (Ljava/awt/Component;JLjava/awt/datatransfer/Transferable;
Ljava/awt/event/InputEvent;IIIIJIJIII[JLjava/util/Map;)J
*/ */
JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_createNativeDragSource JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_createNativeDragSource
(JNIEnv *env, jobject jthis, jobject jcomponent, jobject jpeer, jlong jnativepeer, jobject jtransferable, (JNIEnv *env, jobject jthis, jobject jcomponent, jlong jnativepeer, jobject jtransferable,
jobject jtrigger, jint jdragposx, jint jdragposy, jint jextmodifiers, jint jclickcount, jlong jtimestamp, jobject jtrigger, jint jdragposx, jint jdragposy, jint jextmodifiers, jint jclickcount, jlong jtimestamp,
jobject jcursor, jobject jnsdragimage, jint jdragimageoffsetx, jint jdragimageoffsety, jobject jnsdragimage, jint jdragimageoffsetx, jint jdragimageoffsety,
jint jsourceactions, jlongArray jformats, jobject jformatmap) jint jsourceactions, jlongArray jformats, jobject jformatmap)
{ {
id controlObj = (id) jlong_to_ptr(jnativepeer); id controlObj = (id) jlong_to_ptr(jnativepeer);
...@@ -47,12 +48,22 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_createNativ ...@@ -47,12 +48,22 @@ JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_createNativ
JNF_COCOA_ENTER(env); JNF_COCOA_ENTER(env);
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
dragSource = [[CDragSource alloc] init:jthis component:jcomponent peer:jpeer control:controlObj dragSource = [[CDragSource alloc] init:jthis
transferable:jtransferable triggerEvent:jtrigger dragPosX:jdragposx component:jcomponent
dragPosY:jdragposy modifiers:jextmodifiers clickCount:jclickcount timeStamp:jtimestamp control:controlObj
cursor:jcursor dragImage:jnsdragimage dragImageOffsetX:jdragimageoffsetx transferable:jtransferable
dragImageOffsetY:jdragimageoffsety sourceActions:jsourceactions triggerEvent:jtrigger
formats:jformats formatMap:jformatmap]; dragPosX:jdragposx
dragPosY:jdragposy
modifiers:jextmodifiers
clickCount:jclickcount
timeStamp:jtimestamp
dragImage:jnsdragimage
dragImageOffsetX:jdragimageoffsetx
dragImageOffsetY:jdragimageoffsety
sourceActions:jsourceactions
formats:jformats
formatMap:jformatmap];
}]; }];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
...@@ -94,19 +105,3 @@ JNF_COCOA_ENTER(env); ...@@ -94,19 +105,3 @@ JNF_COCOA_ENTER(env);
[dragSource removeFromView:env]; [dragSource removeFromView:env];
JNF_COCOA_EXIT(env); JNF_COCOA_EXIT(env);
} }
/*
* Class: sun_lwawt_macosx_CDragSourceContextPeer
* Method: setNativeCursor
* Signature: (JLjava/awt/Cursor;I)V
*/
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CDragSourceContextPeer_setNativeCursor
(JNIEnv *env, jobject jthis, jlong nativeDragSourceVal, jobject jcursor, jint jcursortype)
{
//AWT_ASSERT_NOT_APPKIT_THREAD;
//JNF_COCOA_ENTER(env);
// jobject gCursor = JNFNewGlobalRef(env, jcursor);
// [EventFactory setJavaCursor:gCursor withEnv:env];
//JNF_COCOA_EXIT(env);
}
...@@ -81,9 +81,8 @@ extern JNFClassInfo jc_CDropTargetContextPeer; ...@@ -81,9 +81,8 @@ extern JNFClassInfo jc_CDropTargetContextPeer;
fComponent = JNFNewGlobalRef(env, jcomponent); fComponent = JNFNewGlobalRef(env, jcomponent);
fDropTarget = JNFNewGlobalRef(env, jdropTarget); fDropTarget = JNFNewGlobalRef(env, jdropTarget);
AWTView *awtView = [((NSWindow *) control) contentView]; fView = [((AWTView *) control) retain];
fView = [awtView retain]; [fView setDropTarget:self];
[awtView setDropTarget:self];
} else { } else {
...@@ -177,6 +176,10 @@ extern JNFClassInfo jc_CDropTargetContextPeer; ...@@ -177,6 +176,10 @@ extern JNFClassInfo jc_CDropTargetContextPeer;
{ {
DLog2(@"[CDropTarget dealloc]: %@\n", self); DLog2(@"[CDropTarget dealloc]: %@\n", self);
if(sCurrentDropTarget == self) {
sCurrentDropTarget = nil;
}
[fView release]; [fView release];
fView = nil; fView = nil;
...@@ -490,7 +493,10 @@ extern JNFClassInfo jc_CDropTargetContextPeer; ...@@ -490,7 +493,10 @@ extern JNFClassInfo jc_CDropTargetContextPeer;
JNF_MEMBER_CACHE(handleEnterMessageMethod, jc_CDropTargetContextPeer, "handleEnterMessage", "(Ljava/awt/Component;IIII[JJ)I"); JNF_MEMBER_CACHE(handleEnterMessageMethod, jc_CDropTargetContextPeer, "handleEnterMessage", "(Ljava/awt/Component;IIII[JJ)I");
if (sDraggingError == FALSE) { if (sDraggingError == FALSE) {
// Double-casting self gets rid of 'different size' compiler warning: // Double-casting self gets rid of 'different size' compiler warning:
actions = JNFCallIntMethod(env, fDropTargetContextPeer, handleEnterMessageMethod, fComponent, (jint) javaLocation.x, (jint) javaLocation.y, dropAction, actions, formats, ptr_to_jlong(self)); // AWT_THREADING Safe (CToolkitThreadBlockedHandler) // AWT_THREADING Safe (CToolkitThreadBlockedHandler)
actions = JNFCallIntMethod(env, fDropTargetContextPeer, handleEnterMessageMethod,
fComponent, (jint) javaLocation.x, (jint) javaLocation.y,
dropAction, actions, formats, ptr_to_jlong(self));
} }
if (sDraggingError == FALSE) { if (sDraggingError == FALSE) {
...@@ -510,11 +516,6 @@ extern JNFClassInfo jc_CDropTargetContextPeer; ...@@ -510,11 +516,6 @@ extern JNFClassInfo jc_CDropTargetContextPeer;
// Remember the dragOp for no-op'd update messages: // Remember the dragOp for no-op'd update messages:
sUpdateOperation = dragOp; sUpdateOperation = dragOp;
} }
// If we are in the same process as the sender, make the sender post the appropriate message
if (sender) {
[[CDragSource currentDragSource] postDragEnter];
}
} }
// 9-11-02 Note: the native event thread would not handle an exception gracefully: // 9-11-02 Note: the native event thread would not handle an exception gracefully:
...@@ -608,11 +609,9 @@ extern JNFClassInfo jc_CDropTargetContextPeer; ...@@ -608,11 +609,9 @@ extern JNFClassInfo jc_CDropTargetContextPeer;
JNF_MEMBER_CACHE(handleExitMessageMethod, jc_CDropTargetContextPeer, "handleExitMessage", "(Ljava/awt/Component;J)V"); JNF_MEMBER_CACHE(handleExitMessageMethod, jc_CDropTargetContextPeer, "handleExitMessage", "(Ljava/awt/Component;J)V");
if (sDraggingError == FALSE) { if (sDraggingError == FALSE) {
DLog3(@" - dragExit: loc native %f, %f\n", sDraggingLocation.x, sDraggingLocation.y); DLog3(@" - dragExit: loc native %f, %f\n", sDraggingLocation.x, sDraggingLocation.y);
JNFCallVoidMethod(env, fDropTargetContextPeer, handleExitMessageMethod, fComponent, ptr_to_jlong(self)); // AWT_THREADING Safe (CToolkitThreadBlockedHandler) // AWT_THREADING Safe (CToolkitThreadBlockedHandler)
// If we are in the same process as the sender, make the sender post the appropriate message JNFCallVoidMethod(env, fDropTargetContextPeer,
if (sender) { handleExitMessageMethod, fComponent, ptr_to_jlong(self));
[[CDragSource currentDragSource] postDragExit];
}
} }
// 5-27-03 Note: [Radar 3270455] // 5-27-03 Note: [Radar 3270455]
......
/* /*
* 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
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#import "PrinterView.h" #import "PrinterView.h"
#import "java_awt_print_Pageable.h" #import "java_awt_print_Pageable.h"
#import "java_awt_print_Printable.h"
#import "java_awt_print_PageFormat.h" #import "java_awt_print_PageFormat.h"
#import <JavaNativeFoundation/JavaNativeFoundation.h> #import <JavaNativeFoundation/JavaNativeFoundation.h>
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
static CFDateFormatterStyle convertDateFormatterStyle(jint javaStyle); static CFDateFormatterStyle convertDateFormatterStyle(jint javaStyle);
static CFNumberFormatterStyle convertNumberFormatterStyle(jint javaStyle); static CFNumberFormatterStyle convertNumberFormatterStyle(jint javaStyle);
static void copyArrayElements(JNIEnv *env, CFArrayRef cfarray, jobjectArray jarray, CFIndex sindex, int dindex, int count); static void copyArrayElements(JNIEnv *env, CFArrayRef cfarray, jobjectArray jarray, CFIndex sindex, int dindex, int count);
static jstring getNumberSymbolString(JNIEnv *env, jstring jdefault, CFStringRef type); static jstring getNumberSymbolString(JNIEnv *env, jstring jlangtag, jstring jdefault, CFStringRef type);
static jchar getNumberSymbolChar(jchar jdefault, CFStringRef type); static jchar getNumberSymbolChar(JNIEnv *env, jstring jlangtag, jchar jdefault, CFStringRef type);
// from java_props_macosx.c // from java_props_macosx.c
extern char * getMacOSXLocale(int cat); extern char * getMacOSXLocale(int cat);
...@@ -322,7 +322,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte ...@@ -322,7 +322,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte
*/ */
JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getCurrencySymbol JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getCurrencySymbol
(JNIEnv *env, jclass cls, jstring jlangtag, jstring currencySymbol) { (JNIEnv *env, jclass cls, jstring jlangtag, jstring currencySymbol) {
return getNumberSymbolString(env, currencySymbol, kCFNumberFormatterCurrencySymbol); return getNumberSymbolString(env, jlangtag, currencySymbol, kCFNumberFormatterCurrencySymbol);
} }
/* /*
...@@ -332,7 +332,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte ...@@ -332,7 +332,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte
*/ */
JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getDecimalSeparator JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getDecimalSeparator
(JNIEnv *env, jclass cls, jstring jlangtag, jchar decimalSeparator) { (JNIEnv *env, jclass cls, jstring jlangtag, jchar decimalSeparator) {
return getNumberSymbolChar(decimalSeparator, kCFNumberFormatterDecimalSeparator); return getNumberSymbolChar(env, jlangtag, decimalSeparator, kCFNumberFormatterDecimalSeparator);
} }
/* /*
...@@ -342,7 +342,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI ...@@ -342,7 +342,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI
*/ */
JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getGroupingSeparator JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getGroupingSeparator
(JNIEnv *env, jclass cls, jstring jlangtag, jchar groupingSeparator) { (JNIEnv *env, jclass cls, jstring jlangtag, jchar groupingSeparator) {
return getNumberSymbolChar(groupingSeparator, kCFNumberFormatterGroupingSeparator); return getNumberSymbolChar(env, jlangtag, groupingSeparator, kCFNumberFormatterGroupingSeparator);
} }
/* /*
...@@ -352,7 +352,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI ...@@ -352,7 +352,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI
*/ */
JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getInfinity JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getInfinity
(JNIEnv *env, jclass cls, jstring jlangtag, jstring infinity) { (JNIEnv *env, jclass cls, jstring jlangtag, jstring infinity) {
return getNumberSymbolString(env, infinity, kCFNumberFormatterInfinitySymbol); return getNumberSymbolString(env, jlangtag, infinity, kCFNumberFormatterInfinitySymbol);
} }
/* /*
...@@ -362,7 +362,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte ...@@ -362,7 +362,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte
*/ */
JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getInternationalCurrencySymbol JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getInternationalCurrencySymbol
(JNIEnv *env, jclass cls, jstring jlangtag, jstring internationalCurrencySymbol) { (JNIEnv *env, jclass cls, jstring jlangtag, jstring internationalCurrencySymbol) {
return getNumberSymbolString(env, internationalCurrencySymbol, kCFNumberFormatterInternationalCurrencySymbol); return getNumberSymbolString(env, jlangtag, internationalCurrencySymbol, kCFNumberFormatterInternationalCurrencySymbol);
} }
/* /*
...@@ -372,7 +372,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte ...@@ -372,7 +372,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte
*/ */
JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getMinusSign JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getMinusSign
(JNIEnv *env, jclass cls, jstring jlangtag, jchar minusSign) { (JNIEnv *env, jclass cls, jstring jlangtag, jchar minusSign) {
return getNumberSymbolChar(minusSign, kCFNumberFormatterMinusSign); return getNumberSymbolChar(env, jlangtag, minusSign, kCFNumberFormatterMinusSign);
} }
/* /*
...@@ -382,7 +382,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI ...@@ -382,7 +382,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI
*/ */
JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getMonetaryDecimalSeparator JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getMonetaryDecimalSeparator
(JNIEnv *env, jclass cls, jstring jlangtag, jchar monetaryDecimalSeparator) { (JNIEnv *env, jclass cls, jstring jlangtag, jchar monetaryDecimalSeparator) {
return getNumberSymbolChar(monetaryDecimalSeparator, kCFNumberFormatterCurrencyDecimalSeparator); return getNumberSymbolChar(env, jlangtag, monetaryDecimalSeparator, kCFNumberFormatterCurrencyDecimalSeparator);
} }
/* /*
...@@ -392,7 +392,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI ...@@ -392,7 +392,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI
*/ */
JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getNaN JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getNaN
(JNIEnv *env, jclass cls, jstring jlangtag, jstring nan) { (JNIEnv *env, jclass cls, jstring jlangtag, jstring nan) {
return getNumberSymbolString(env, nan, kCFNumberFormatterNaNSymbol); return getNumberSymbolString(env, jlangtag, nan, kCFNumberFormatterNaNSymbol);
} }
/* /*
...@@ -402,7 +402,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte ...@@ -402,7 +402,7 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte
*/ */
JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getPercent JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getPercent
(JNIEnv *env, jclass cls, jstring jlangtag, jchar percent) { (JNIEnv *env, jclass cls, jstring jlangtag, jchar percent) {
return getNumberSymbolChar(percent, kCFNumberFormatterPercentSymbol); return getNumberSymbolChar(env, jlangtag, percent, kCFNumberFormatterPercentSymbol);
} }
/* /*
...@@ -412,7 +412,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI ...@@ -412,7 +412,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI
*/ */
JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getPerMill JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getPerMill
(JNIEnv *env, jclass cls, jstring jlangtag, jchar perMill) { (JNIEnv *env, jclass cls, jstring jlangtag, jchar perMill) {
return getNumberSymbolChar(perMill, kCFNumberFormatterPerMillSymbol); return getNumberSymbolChar(env, jlangtag, perMill, kCFNumberFormatterPerMillSymbol);
} }
/* /*
...@@ -422,7 +422,36 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI ...@@ -422,7 +422,36 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI
*/ */
JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getZeroDigit JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getZeroDigit
(JNIEnv *env, jclass cls, jstring jlangtag, jchar zeroDigit) { (JNIEnv *env, jclass cls, jstring jlangtag, jchar zeroDigit) {
return getNumberSymbolChar(zeroDigit, kCFNumberFormatterZeroSymbol); // The following code *should* work, but not for some reason :o
//
//return getNumberSymbolChar(env, jlangtag, zeroDigit, kCFNumberFormatterZeroSymbol);
//
// so here is a workaround.
jchar ret = zeroDigit;
CFLocaleRef cflocale = CFLocaleCopyCurrent();
if (cflocale != NULL) {
CFNumberFormatterRef nf = CFNumberFormatterCreate(kCFAllocatorDefault,
cflocale,
kCFNumberFormatterNoStyle);
if (nf != NULL) {
int zero = 0;
CFStringRef str = CFNumberFormatterCreateStringWithValue(kCFAllocatorDefault,
nf, kCFNumberIntType, &zero);
if (str != NULL) {
if (CFStringGetLength(str) > 0) {
ret = CFStringGetCharacterAtIndex(str, 0);
}
CFRelease(str);
}
CFRelease(nf);
}
CFRelease(cflocale);
}
return ret;
} }
/* /*
...@@ -432,7 +461,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI ...@@ -432,7 +461,7 @@ JNIEXPORT jchar JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterI
*/ */
JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getExponentSeparator JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getExponentSeparator
(JNIEnv *env, jclass cls, jstring jlangtag, jstring exponent) { (JNIEnv *env, jclass cls, jstring jlangtag, jstring exponent) {
return getNumberSymbolString(env, exponent, kCFNumberFormatterExponentSymbol); return getNumberSymbolString(env, jlangtag, exponent, kCFNumberFormatterExponentSymbol);
} }
/* /*
...@@ -625,7 +654,7 @@ static void copyArrayElements(JNIEnv *env, CFArrayRef cfarray, jobjectArray jarr ...@@ -625,7 +654,7 @@ static void copyArrayElements(JNIEnv *env, CFArrayRef cfarray, jobjectArray jarr
} }
} }
static jstring getNumberSymbolString(JNIEnv *env, jstring jdefault, CFStringRef type) { static jstring getNumberSymbolString(JNIEnv *env, jstring jlangtag, jstring jdefault, CFStringRef type) {
char buf[BUFLEN]; char buf[BUFLEN];
jstring ret = jdefault; jstring ret = jdefault;
CFLocaleRef cflocale = CFLocaleCopyCurrent(); CFLocaleRef cflocale = CFLocaleCopyCurrent();
...@@ -633,7 +662,7 @@ static jstring getNumberSymbolString(JNIEnv *env, jstring jdefault, CFStringRef ...@@ -633,7 +662,7 @@ static jstring getNumberSymbolString(JNIEnv *env, jstring jdefault, CFStringRef
if (cflocale != NULL) { if (cflocale != NULL) {
CFNumberFormatterRef nf = CFNumberFormatterCreate(kCFAllocatorDefault, CFNumberFormatterRef nf = CFNumberFormatterCreate(kCFAllocatorDefault,
cflocale, cflocale,
kCFNumberFormatterDecimalStyle); kCFNumberFormatterNoStyle);
if (nf != NULL) { if (nf != NULL) {
CFStringRef str = CFNumberFormatterCopyProperty(nf, type); CFStringRef str = CFNumberFormatterCopyProperty(nf, type);
if (str != NULL) { if (str != NULL) {
...@@ -651,21 +680,21 @@ static jstring getNumberSymbolString(JNIEnv *env, jstring jdefault, CFStringRef ...@@ -651,21 +680,21 @@ static jstring getNumberSymbolString(JNIEnv *env, jstring jdefault, CFStringRef
return ret; return ret;
} }
static jchar getNumberSymbolChar(jchar jdefault, CFStringRef type) { static jchar getNumberSymbolChar(JNIEnv *env, jstring jlangtag, jchar jdefault, CFStringRef type) {
char buf[BUFLEN];
jchar ret = jdefault; jchar ret = jdefault;
CFLocaleRef cflocale = CFLocaleCopyCurrent(); CFLocaleRef cflocale = CFLocaleCopyCurrent();
if (cflocale != NULL) { if (cflocale != NULL) {
CFNumberFormatterRef nf = CFNumberFormatterCreate(kCFAllocatorDefault, CFNumberFormatterRef nf = CFNumberFormatterCreate(kCFAllocatorDefault,
cflocale, cflocale,
kCFNumberFormatterDecimalStyle); kCFNumberFormatterNoStyle);
if (nf != NULL) { if (nf != NULL) {
CFStringRef str = CFNumberFormatterCopyProperty(nf, type); CFStringRef str = CFNumberFormatterCopyProperty(nf, type);
if (str != NULL) { if (str != NULL) {
CFStringGetCString(str, buf, BUFLEN, kCFStringEncodingUTF8); if (CFStringGetLength(str) > 0) {
ret = CFStringGetCharacterAtIndex(str, 0);
}
CFRelease(str); CFRelease(str);
ret = buf[0];
} }
CFRelease(nf); CFRelease(nf);
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
/* Implemented in linker_md.c */ /* Implemented in linker_md.c */
void dbgsysBuildLibName(char *, int, char *, char *); void dbgsysBuildLibName(char *, int, const char *, const char *);
void * dbgsysLoadLibrary(const char *, char *err_buf, int err_buflen); void * dbgsysLoadLibrary(const char *, char *err_buf, int err_buflen);
void dbgsysUnloadLibrary(void *); void dbgsysUnloadLibrary(void *);
void * dbgsysFindLibraryEntry(void *, const char *); void * dbgsysFindLibraryEntry(void *, const char *);
......
...@@ -97,12 +97,12 @@ findTransportOnLoad(void *handle) ...@@ -97,12 +97,12 @@ findTransportOnLoad(void *handle)
/* Load transport library (directory=="" means do system search) */ /* Load transport library (directory=="" means do system search) */
static void * static void *
loadTransportLibrary(char *libdir, char *name) loadTransportLibrary(const char *libdir, const char *name)
{ {
void *handle; void *handle;
char libname[MAXPATHLEN+2]; char libname[MAXPATHLEN+2];
char buf[MAXPATHLEN*2+100]; char buf[MAXPATHLEN*2+100];
char *plibdir; const char *plibdir;
/* Convert libdir from UTF-8 to platform encoding */ /* Convert libdir from UTF-8 to platform encoding */
plibdir = NULL; plibdir = NULL;
...@@ -131,12 +131,12 @@ loadTransportLibrary(char *libdir, char *name) ...@@ -131,12 +131,12 @@ loadTransportLibrary(char *libdir, char *name)
* JDK 1.2 javai.c v1.61 * JDK 1.2 javai.c v1.61
*/ */
static jdwpError static jdwpError
loadTransport(char *name, jdwpTransportEnv **transportPtr) loadTransport(const char *name, jdwpTransportEnv **transportPtr)
{ {
JNIEnv *env; JNIEnv *env;
jdwpTransport_OnLoad_t onLoad; jdwpTransport_OnLoad_t onLoad;
void *handle; void *handle;
char *libdir; const char *libdir;
/* Make sure library name is not empty */ /* Make sure library name is not empty */
if (name == NULL) { if (name == NULL) {
......
/* /*
* Copyright (c) 1996, 2003, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 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
...@@ -27,7 +27,7 @@ package java.awt; ...@@ -27,7 +27,7 @@ package java.awt;
import java.awt.event.*; import java.awt.event.*;
import javax.tools.annotation.GenerateNativeHeader; import java.lang.annotation.Native;
/** /**
* The interface for objects which have an adjustable numeric value * The interface for objects which have an adjustable numeric value
...@@ -36,24 +36,22 @@ import javax.tools.annotation.GenerateNativeHeader; ...@@ -36,24 +36,22 @@ import javax.tools.annotation.GenerateNativeHeader;
* @author Amy Fowler * @author Amy Fowler
* @author Tim Prinzing * @author Tim Prinzing
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public interface Adjustable { public interface Adjustable {
/** /**
* Indicates that the <code>Adjustable</code> has horizontal orientation. * Indicates that the <code>Adjustable</code> has horizontal orientation.
*/ */
public static final int HORIZONTAL = 0; @Native public static final int HORIZONTAL = 0;
/** /**
* Indicates that the <code>Adjustable</code> has vertical orientation. * Indicates that the <code>Adjustable</code> has vertical orientation.
*/ */
public static final int VERTICAL = 1; @Native public static final int VERTICAL = 1;
/** /**
* Indicates that the <code>Adjustable</code> has no orientation. * Indicates that the <code>Adjustable</code> has no orientation.
*/ */
public static final int NO_ORIENTATION = 2; @Native public static final int NO_ORIENTATION = 2;
/** /**
* Gets the orientation of the adjustable object. * Gets the orientation of the adjustable object.
......
/* /*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 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
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
package java.awt; package java.awt;
import java.awt.image.ColorModel; import java.awt.image.ColorModel;
import javax.tools.annotation.GenerateNativeHeader; import java.lang.annotation.Native;
import sun.java2d.SunCompositeContext; import sun.java2d.SunCompositeContext;
/** /**
...@@ -350,8 +350,6 @@ import sun.java2d.SunCompositeContext; ...@@ -350,8 +350,6 @@ import sun.java2d.SunCompositeContext;
* @see CompositeContext * @see CompositeContext
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public final class AlphaComposite implements Composite { public final class AlphaComposite implements Composite {
/** /**
* Both the color and the alpha of the destination are cleared * Both the color and the alpha of the destination are cleared
...@@ -364,7 +362,7 @@ public final class AlphaComposite implements Composite { ...@@ -364,7 +362,7 @@ public final class AlphaComposite implements Composite {
* <em>C<sub>r</sub></em> = 0 * <em>C<sub>r</sub></em> = 0
*</pre> *</pre>
*/ */
public static final int CLEAR = 1; @Native public static final int CLEAR = 1;
/** /**
* The source is copied to the destination * The source is copied to the destination
...@@ -377,7 +375,7 @@ public final class AlphaComposite implements Composite { ...@@ -377,7 +375,7 @@ public final class AlphaComposite implements Composite {
* <em>C<sub>r</sub></em> = <em>C<sub>s</sub></em> * <em>C<sub>r</sub></em> = <em>C<sub>s</sub></em>
*</pre> *</pre>
*/ */
public static final int SRC = 2; @Native public static final int SRC = 2;
/** /**
* The destination is left untouched * The destination is left untouched
...@@ -390,7 +388,7 @@ public final class AlphaComposite implements Composite { ...@@ -390,7 +388,7 @@ public final class AlphaComposite implements Composite {
*</pre> *</pre>
* @since 1.4 * @since 1.4
*/ */
public static final int DST = 9; @Native public static final int DST = 9;
// Note that DST was added in 1.4 so it is numbered out of order... // Note that DST was added in 1.4 so it is numbered out of order...
/** /**
...@@ -403,7 +401,7 @@ public final class AlphaComposite implements Composite { ...@@ -403,7 +401,7 @@ public final class AlphaComposite implements Composite {
* <em>C<sub>r</sub></em> = <em>C<sub>s</sub></em> + <em>C<sub>d</sub></em>*(1-<em>A<sub>s</sub></em>) * <em>C<sub>r</sub></em> = <em>C<sub>s</sub></em> + <em>C<sub>d</sub></em>*(1-<em>A<sub>s</sub></em>)
*</pre> *</pre>
*/ */
public static final int SRC_OVER = 3; @Native public static final int SRC_OVER = 3;
/** /**
* The destination is composited over the source and * The destination is composited over the source and
...@@ -416,7 +414,7 @@ public final class AlphaComposite implements Composite { ...@@ -416,7 +414,7 @@ public final class AlphaComposite implements Composite {
* <em>C<sub>r</sub></em> = <em>C<sub>s</sub></em>*(1-<em>A<sub>d</sub></em>) + <em>C<sub>d</sub></em> * <em>C<sub>r</sub></em> = <em>C<sub>s</sub></em>*(1-<em>A<sub>d</sub></em>) + <em>C<sub>d</sub></em>
*</pre> *</pre>
*/ */
public static final int DST_OVER = 4; @Native public static final int DST_OVER = 4;
/** /**
* The part of the source lying inside of the destination replaces * The part of the source lying inside of the destination replaces
...@@ -429,7 +427,7 @@ public final class AlphaComposite implements Composite { ...@@ -429,7 +427,7 @@ public final class AlphaComposite implements Composite {
* <em>C<sub>r</sub></em> = <em>C<sub>s</sub></em>*<em>A<sub>d</sub></em> * <em>C<sub>r</sub></em> = <em>C<sub>s</sub></em>*<em>A<sub>d</sub></em>
*</pre> *</pre>
*/ */
public static final int SRC_IN = 5; @Native public static final int SRC_IN = 5;
/** /**
* The part of the destination lying inside of the source * The part of the destination lying inside of the source
...@@ -442,7 +440,7 @@ public final class AlphaComposite implements Composite { ...@@ -442,7 +440,7 @@ public final class AlphaComposite implements Composite {
* <em>C<sub>r</sub></em> = <em>C<sub>d</sub></em>*<em>A<sub>s</sub></em> * <em>C<sub>r</sub></em> = <em>C<sub>d</sub></em>*<em>A<sub>s</sub></em>
*</pre> *</pre>
*/ */
public static final int DST_IN = 6; @Native public static final int DST_IN = 6;
/** /**
* The part of the source lying outside of the destination * The part of the source lying outside of the destination
...@@ -455,7 +453,7 @@ public final class AlphaComposite implements Composite { ...@@ -455,7 +453,7 @@ public final class AlphaComposite implements Composite {
* <em>C<sub>r</sub></em> = <em>C<sub>s</sub></em>*(1-<em>A<sub>d</sub></em>) * <em>C<sub>r</sub></em> = <em>C<sub>s</sub></em>*(1-<em>A<sub>d</sub></em>)
*</pre> *</pre>
*/ */
public static final int SRC_OUT = 7; @Native public static final int SRC_OUT = 7;
/** /**
* The part of the destination lying outside of the source * The part of the destination lying outside of the source
...@@ -468,7 +466,7 @@ public final class AlphaComposite implements Composite { ...@@ -468,7 +466,7 @@ public final class AlphaComposite implements Composite {
* <em>C<sub>r</sub></em> = <em>C<sub>d</sub></em>*(1-<em>A<sub>s</sub></em>) * <em>C<sub>r</sub></em> = <em>C<sub>d</sub></em>*(1-<em>A<sub>s</sub></em>)
*</pre> *</pre>
*/ */
public static final int DST_OUT = 8; @Native public static final int DST_OUT = 8;
// Rule 9 is DST which is defined above where it fits into the // Rule 9 is DST which is defined above where it fits into the
// list logically, rather than numerically // list logically, rather than numerically
...@@ -487,7 +485,7 @@ public final class AlphaComposite implements Composite { ...@@ -487,7 +485,7 @@ public final class AlphaComposite implements Composite {
*</pre> *</pre>
* @since 1.4 * @since 1.4
*/ */
public static final int SRC_ATOP = 10; @Native public static final int SRC_ATOP = 10;
/** /**
* The part of the destination lying inside of the source * The part of the destination lying inside of the source
...@@ -501,7 +499,7 @@ public final class AlphaComposite implements Composite { ...@@ -501,7 +499,7 @@ public final class AlphaComposite implements Composite {
*</pre> *</pre>
* @since 1.4 * @since 1.4
*/ */
public static final int DST_ATOP = 11; @Native public static final int DST_ATOP = 11;
/** /**
* The part of the source that lies outside of the destination * The part of the source that lies outside of the destination
...@@ -516,7 +514,7 @@ public final class AlphaComposite implements Composite { ...@@ -516,7 +514,7 @@ public final class AlphaComposite implements Composite {
*</pre> *</pre>
* @since 1.4 * @since 1.4
*/ */
public static final int XOR = 12; @Native public static final int XOR = 12;
/** /**
* <code>AlphaComposite</code> object that implements the opaque CLEAR rule * <code>AlphaComposite</code> object that implements the opaque CLEAR rule
...@@ -606,8 +604,8 @@ public final class AlphaComposite implements Composite { ...@@ -606,8 +604,8 @@ public final class AlphaComposite implements Composite {
*/ */
public static final AlphaComposite Xor = new AlphaComposite(XOR); public static final AlphaComposite Xor = new AlphaComposite(XOR);
private static final int MIN_RULE = CLEAR; @Native private static final int MIN_RULE = CLEAR;
private static final int MAX_RULE = XOR; @Native private static final int MAX_RULE = XOR;
float extraAlpha; float extraAlpha;
int rule; int rule;
......
/* /*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 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
...@@ -27,7 +27,7 @@ package java.awt; ...@@ -27,7 +27,7 @@ package java.awt;
import java.beans.ConstructorProperties; import java.beans.ConstructorProperties;
import javax.tools.annotation.GenerateNativeHeader; import java.lang.annotation.Native;
/** /**
* The <code>BasicStroke</code> class defines a basic set of rendering * The <code>BasicStroke</code> class defines a basic set of rendering
...@@ -111,47 +111,45 @@ import javax.tools.annotation.GenerateNativeHeader; ...@@ -111,47 +111,45 @@ import javax.tools.annotation.GenerateNativeHeader;
* @see Graphics2D * @see Graphics2D
* @author Jim Graham * @author Jim Graham
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class BasicStroke implements Stroke { public class BasicStroke implements Stroke {
/** /**
* Joins path segments by extending their outside edges until * Joins path segments by extending their outside edges until
* they meet. * they meet.
*/ */
public final static int JOIN_MITER = 0; @Native public final static int JOIN_MITER = 0;
/** /**
* Joins path segments by rounding off the corner at a radius * Joins path segments by rounding off the corner at a radius
* of half the line width. * of half the line width.
*/ */
public final static int JOIN_ROUND = 1; @Native public final static int JOIN_ROUND = 1;
/** /**
* Joins path segments by connecting the outer corners of their * Joins path segments by connecting the outer corners of their
* wide outlines with a straight segment. * wide outlines with a straight segment.
*/ */
public final static int JOIN_BEVEL = 2; @Native public final static int JOIN_BEVEL = 2;
/** /**
* Ends unclosed subpaths and dash segments with no added * Ends unclosed subpaths and dash segments with no added
* decoration. * decoration.
*/ */
public final static int CAP_BUTT = 0; @Native public final static int CAP_BUTT = 0;
/** /**
* Ends unclosed subpaths and dash segments with a round * Ends unclosed subpaths and dash segments with a round
* decoration that has a radius equal to half of the width * decoration that has a radius equal to half of the width
* of the pen. * of the pen.
*/ */
public final static int CAP_ROUND = 1; @Native public final static int CAP_ROUND = 1;
/** /**
* Ends unclosed subpaths and dash segments with a square * Ends unclosed subpaths and dash segments with a square
* projection that extends beyond the end of the segment * projection that extends beyond the end of the segment
* to a distance equal to half of the line width. * to a distance equal to half of the line width.
*/ */
public final static int CAP_SQUARE = 2; @Native public final static int CAP_SQUARE = 2;
float width; float width;
......
/* /*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * 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
...@@ -34,7 +34,6 @@ import java.io.IOException; ...@@ -34,7 +34,6 @@ import java.io.IOException;
import javax.accessibility.*; import javax.accessibility.*;
import javax.tools.annotation.GenerateNativeHeader;
/** /**
* The <code>Choice</code> class presents a pop-up menu of choices. * The <code>Choice</code> class presents a pop-up menu of choices.
...@@ -71,8 +70,6 @@ import javax.tools.annotation.GenerateNativeHeader; ...@@ -71,8 +70,6 @@ import javax.tools.annotation.GenerateNativeHeader;
* @author Arthur van Hoff * @author Arthur van Hoff
* @since JDK1.0 * @since JDK1.0
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class Choice extends Component implements ItemSelectable, Accessible { public class Choice extends Component implements ItemSelectable, Accessible {
/** /**
* The items for the <code>Choice</code>. * The items for the <code>Choice</code>.
......
/* /*
* Copyright (c) 2000, 2006, 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
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
package java.awt; package java.awt;
import javax.tools.annotation.GenerateNativeHeader; import java.lang.annotation.Native;
/** /**
* The <code>DisplayMode</code> class encapsulates the bit depth, height, * The <code>DisplayMode</code> class encapsulates the bit depth, height,
...@@ -46,8 +46,6 @@ import javax.tools.annotation.GenerateNativeHeader; ...@@ -46,8 +46,6 @@ import javax.tools.annotation.GenerateNativeHeader;
* @since 1.4 * @since 1.4
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public final class DisplayMode { public final class DisplayMode {
private Dimension size; private Dimension size;
...@@ -94,7 +92,7 @@ public final class DisplayMode { ...@@ -94,7 +92,7 @@ public final class DisplayMode {
* display mode. * display mode.
* @see #getBitDepth * @see #getBitDepth
*/ */
public final static int BIT_DEPTH_MULTI = -1; @Native public final static int BIT_DEPTH_MULTI = -1;
/** /**
* Returns the bit depth of the display, in bits per pixel. This may be * Returns the bit depth of the display, in bits per pixel. This may be
...@@ -112,7 +110,7 @@ public final class DisplayMode { ...@@ -112,7 +110,7 @@ public final class DisplayMode {
* Value of the refresh rate if not known. * Value of the refresh rate if not known.
* @see #getRefreshRate * @see #getRefreshRate
*/ */
public final static int REFRESH_RATE_UNKNOWN = 0; @Native public final static int REFRESH_RATE_UNKNOWN = 0;
/** /**
* Returns the refresh rate of the display, in hertz. This may be * Returns the refresh rate of the display, in hertz. This may be
......
/* /*
* Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * 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
...@@ -33,7 +33,6 @@ import java.awt.image.ReplicateScaleFilter; ...@@ -33,7 +33,6 @@ import java.awt.image.ReplicateScaleFilter;
import sun.awt.image.SurfaceManager; import sun.awt.image.SurfaceManager;
import javax.tools.annotation.GenerateNativeHeader;
/** /**
* The abstract class <code>Image</code> is the superclass of all * The abstract class <code>Image</code> is the superclass of all
...@@ -44,8 +43,6 @@ import javax.tools.annotation.GenerateNativeHeader; ...@@ -44,8 +43,6 @@ import javax.tools.annotation.GenerateNativeHeader;
* @author Arthur van Hoff * @author Arthur van Hoff
* @since JDK1.0 * @since JDK1.0
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public abstract class Image { public abstract class Image {
/** /**
......
/* /*
* Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * 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
...@@ -33,7 +33,6 @@ import java.io.ObjectOutputStream; ...@@ -33,7 +33,6 @@ import java.io.ObjectOutputStream;
import java.io.ObjectInputStream; import java.io.ObjectInputStream;
import java.io.IOException; import java.io.IOException;
import javax.accessibility.*; import javax.accessibility.*;
import javax.tools.annotation.GenerateNativeHeader;
/** /**
...@@ -107,8 +106,6 @@ import javax.tools.annotation.GenerateNativeHeader; ...@@ -107,8 +106,6 @@ import javax.tools.annotation.GenerateNativeHeader;
* @see java.awt.event.ActionListener * @see java.awt.event.ActionListener
* @since JDK1.0 * @since JDK1.0
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class List extends Component implements ItemSelectable, Accessible { public class List extends Component implements ItemSelectable, Accessible {
/** /**
* A vector created to contain items which will become * A vector created to contain items which will become
......
/* /*
* Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 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
...@@ -28,7 +28,6 @@ package java.awt; ...@@ -28,7 +28,6 @@ package java.awt;
import java.awt.peer.PopupMenuPeer; import java.awt.peer.PopupMenuPeer;
import javax.accessibility.*; import javax.accessibility.*;
import javax.tools.annotation.GenerateNativeHeader;
import sun.awt.AWTAccessor; import sun.awt.AWTAccessor;
...@@ -44,8 +43,6 @@ import sun.awt.AWTAccessor; ...@@ -44,8 +43,6 @@ import sun.awt.AWTAccessor;
* *
* @author Amy Fowler * @author Amy Fowler
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class PopupMenu extends Menu { public class PopupMenu extends Menu {
private static final String base = "popup"; private static final String base = "popup";
......
/* /*
* Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 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
...@@ -26,7 +26,7 @@ package java.awt; ...@@ -26,7 +26,7 @@ package java.awt;
import java.io.ObjectStreamException; import java.io.ObjectStreamException;
import javax.tools.annotation.GenerateNativeHeader; import java.lang.annotation.Native;
/** /**
* A class to encapsulate symbolic colors representing the color of * A class to encapsulate symbolic colors representing the color of
...@@ -49,8 +49,6 @@ import javax.tools.annotation.GenerateNativeHeader; ...@@ -49,8 +49,6 @@ import javax.tools.annotation.GenerateNativeHeader;
* @author Carl Quinn * @author Carl Quinn
* @author Amy Fowler * @author Amy Fowler
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public final class SystemColor extends Color implements java.io.Serializable { public final class SystemColor extends Color implements java.io.Serializable {
/** /**
...@@ -58,187 +56,187 @@ public final class SystemColor extends Color implements java.io.Serializable { ...@@ -58,187 +56,187 @@ public final class SystemColor extends Color implements java.io.Serializable {
* {@link #desktop} system color. * {@link #desktop} system color.
* @see SystemColor#desktop * @see SystemColor#desktop
*/ */
public final static int DESKTOP = 0; @Native public final static int DESKTOP = 0;
/** /**
* The array index for the * The array index for the
* {@link #activeCaption} system color. * {@link #activeCaption} system color.
* @see SystemColor#activeCaption * @see SystemColor#activeCaption
*/ */
public final static int ACTIVE_CAPTION = 1; @Native public final static int ACTIVE_CAPTION = 1;
/** /**
* The array index for the * The array index for the
* {@link #activeCaptionText} system color. * {@link #activeCaptionText} system color.
* @see SystemColor#activeCaptionText * @see SystemColor#activeCaptionText
*/ */
public final static int ACTIVE_CAPTION_TEXT = 2; @Native public final static int ACTIVE_CAPTION_TEXT = 2;
/** /**
* The array index for the * The array index for the
* {@link #activeCaptionBorder} system color. * {@link #activeCaptionBorder} system color.
* @see SystemColor#activeCaptionBorder * @see SystemColor#activeCaptionBorder
*/ */
public final static int ACTIVE_CAPTION_BORDER = 3; @Native public final static int ACTIVE_CAPTION_BORDER = 3;
/** /**
* The array index for the * The array index for the
* {@link #inactiveCaption} system color. * {@link #inactiveCaption} system color.
* @see SystemColor#inactiveCaption * @see SystemColor#inactiveCaption
*/ */
public final static int INACTIVE_CAPTION = 4; @Native public final static int INACTIVE_CAPTION = 4;
/** /**
* The array index for the * The array index for the
* {@link #inactiveCaptionText} system color. * {@link #inactiveCaptionText} system color.
* @see SystemColor#inactiveCaptionText * @see SystemColor#inactiveCaptionText
*/ */
public final static int INACTIVE_CAPTION_TEXT = 5; @Native public final static int INACTIVE_CAPTION_TEXT = 5;
/** /**
* The array index for the * The array index for the
* {@link #inactiveCaptionBorder} system color. * {@link #inactiveCaptionBorder} system color.
* @see SystemColor#inactiveCaptionBorder * @see SystemColor#inactiveCaptionBorder
*/ */
public final static int INACTIVE_CAPTION_BORDER = 6; @Native public final static int INACTIVE_CAPTION_BORDER = 6;
/** /**
* The array index for the * The array index for the
* {@link #window} system color. * {@link #window} system color.
* @see SystemColor#window * @see SystemColor#window
*/ */
public final static int WINDOW = 7; @Native public final static int WINDOW = 7;
/** /**
* The array index for the * The array index for the
* {@link #windowBorder} system color. * {@link #windowBorder} system color.
* @see SystemColor#windowBorder * @see SystemColor#windowBorder
*/ */
public final static int WINDOW_BORDER = 8; @Native public final static int WINDOW_BORDER = 8;
/** /**
* The array index for the * The array index for the
* {@link #windowText} system color. * {@link #windowText} system color.
* @see SystemColor#windowText * @see SystemColor#windowText
*/ */
public final static int WINDOW_TEXT = 9; @Native public final static int WINDOW_TEXT = 9;
/** /**
* The array index for the * The array index for the
* {@link #menu} system color. * {@link #menu} system color.
* @see SystemColor#menu * @see SystemColor#menu
*/ */
public final static int MENU = 10; @Native public final static int MENU = 10;
/** /**
* The array index for the * The array index for the
* {@link #menuText} system color. * {@link #menuText} system color.
* @see SystemColor#menuText * @see SystemColor#menuText
*/ */
public final static int MENU_TEXT = 11; @Native public final static int MENU_TEXT = 11;
/** /**
* The array index for the * The array index for the
* {@link #text} system color. * {@link #text} system color.
* @see SystemColor#text * @see SystemColor#text
*/ */
public final static int TEXT = 12; @Native public final static int TEXT = 12;
/** /**
* The array index for the * The array index for the
* {@link #textText} system color. * {@link #textText} system color.
* @see SystemColor#textText * @see SystemColor#textText
*/ */
public final static int TEXT_TEXT = 13; @Native public final static int TEXT_TEXT = 13;
/** /**
* The array index for the * The array index for the
* {@link #textHighlight} system color. * {@link #textHighlight} system color.
* @see SystemColor#textHighlight * @see SystemColor#textHighlight
*/ */
public final static int TEXT_HIGHLIGHT = 14; @Native public final static int TEXT_HIGHLIGHT = 14;
/** /**
* The array index for the * The array index for the
* {@link #textHighlightText} system color. * {@link #textHighlightText} system color.
* @see SystemColor#textHighlightText * @see SystemColor#textHighlightText
*/ */
public final static int TEXT_HIGHLIGHT_TEXT = 15; @Native public final static int TEXT_HIGHLIGHT_TEXT = 15;
/** /**
* The array index for the * The array index for the
* {@link #textInactiveText} system color. * {@link #textInactiveText} system color.
* @see SystemColor#textInactiveText * @see SystemColor#textInactiveText
*/ */
public final static int TEXT_INACTIVE_TEXT = 16; @Native public final static int TEXT_INACTIVE_TEXT = 16;
/** /**
* The array index for the * The array index for the
* {@link #control} system color. * {@link #control} system color.
* @see SystemColor#control * @see SystemColor#control
*/ */
public final static int CONTROL = 17; @Native public final static int CONTROL = 17;
/** /**
* The array index for the * The array index for the
* {@link #controlText} system color. * {@link #controlText} system color.
* @see SystemColor#controlText * @see SystemColor#controlText
*/ */
public final static int CONTROL_TEXT = 18; @Native public final static int CONTROL_TEXT = 18;
/** /**
* The array index for the * The array index for the
* {@link #controlHighlight} system color. * {@link #controlHighlight} system color.
* @see SystemColor#controlHighlight * @see SystemColor#controlHighlight
*/ */
public final static int CONTROL_HIGHLIGHT = 19; @Native public final static int CONTROL_HIGHLIGHT = 19;
/** /**
* The array index for the * The array index for the
* {@link #controlLtHighlight} system color. * {@link #controlLtHighlight} system color.
* @see SystemColor#controlLtHighlight * @see SystemColor#controlLtHighlight
*/ */
public final static int CONTROL_LT_HIGHLIGHT = 20; @Native public final static int CONTROL_LT_HIGHLIGHT = 20;
/** /**
* The array index for the * The array index for the
* {@link #controlShadow} system color. * {@link #controlShadow} system color.
* @see SystemColor#controlShadow * @see SystemColor#controlShadow
*/ */
public final static int CONTROL_SHADOW = 21; @Native public final static int CONTROL_SHADOW = 21;
/** /**
* The array index for the * The array index for the
* {@link #controlDkShadow} system color. * {@link #controlDkShadow} system color.
* @see SystemColor#controlDkShadow * @see SystemColor#controlDkShadow
*/ */
public final static int CONTROL_DK_SHADOW = 22; @Native public final static int CONTROL_DK_SHADOW = 22;
/** /**
* The array index for the * The array index for the
* {@link #scrollbar} system color. * {@link #scrollbar} system color.
* @see SystemColor#scrollbar * @see SystemColor#scrollbar
*/ */
public final static int SCROLLBAR = 23; @Native public final static int SCROLLBAR = 23;
/** /**
* The array index for the * The array index for the
* {@link #info} system color. * {@link #info} system color.
* @see SystemColor#info * @see SystemColor#info
*/ */
public final static int INFO = 24; @Native public final static int INFO = 24;
/** /**
* The array index for the * The array index for the
* {@link #infoText} system color. * {@link #infoText} system color.
* @see SystemColor#infoText * @see SystemColor#infoText
*/ */
public final static int INFO_TEXT = 25; @Native public final static int INFO_TEXT = 25;
/** /**
* The number of system colors in the array. * The number of system colors in the array.
*/ */
public final static int NUM_COLORS = 26; @Native public final static int NUM_COLORS = 26;
/******************************************************************************************/ /******************************************************************************************/
......
/* /*
* Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * 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
...@@ -35,7 +35,6 @@ import java.text.BreakIterator; ...@@ -35,7 +35,6 @@ import java.text.BreakIterator;
import javax.swing.text.AttributeSet; import javax.swing.text.AttributeSet;
import javax.accessibility.*; import javax.accessibility.*;
import java.awt.im.InputMethodRequests; import java.awt.im.InputMethodRequests;
import javax.tools.annotation.GenerateNativeHeader;
/** /**
* The <code>TextComponent</code> class is the superclass of * The <code>TextComponent</code> class is the superclass of
...@@ -57,8 +56,6 @@ import javax.tools.annotation.GenerateNativeHeader; ...@@ -57,8 +56,6 @@ import javax.tools.annotation.GenerateNativeHeader;
* @author Arthur van Hoff * @author Arthur van Hoff
* @since JDK1.0 * @since JDK1.0
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class TextComponent extends Component implements Accessible { public class TextComponent extends Component implements Accessible {
/** /**
......
/* /*
* Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 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
...@@ -25,34 +25,32 @@ ...@@ -25,34 +25,32 @@
package java.awt; package java.awt;
import javax.tools.annotation.GenerateNativeHeader; import java.lang.annotation.Native;
/** /**
* The <code>Transparency</code> interface defines the common transparency * The <code>Transparency</code> interface defines the common transparency
* modes for implementing classes. * modes for implementing classes.
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public interface Transparency { public interface Transparency {
/** /**
* Represents image data that is guaranteed to be completely opaque, * Represents image data that is guaranteed to be completely opaque,
* meaning that all pixels have an alpha value of 1.0. * meaning that all pixels have an alpha value of 1.0.
*/ */
public final static int OPAQUE = 1; @Native public final static int OPAQUE = 1;
/** /**
* Represents image data that is guaranteed to be either completely * Represents image data that is guaranteed to be either completely
* opaque, with an alpha value of 1.0, or completely transparent, * opaque, with an alpha value of 1.0, or completely transparent,
* with an alpha value of 0.0. * with an alpha value of 0.0.
*/ */
public final static int BITMASK = 2; @Native public final static int BITMASK = 2;
/** /**
* Represents image data that contains or might contain arbitrary * Represents image data that contains or might contain arbitrary
* alpha values between and including 0.0 and 1.0. * alpha values between and including 0.0 and 1.0.
*/ */
public final static int TRANSLUCENT = 3; @Native public final static int TRANSLUCENT = 3;
/** /**
* Returns the type of this <code>Transparency</code>. * Returns the type of this <code>Transparency</code>.
......
/* /*
* Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 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
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
package java.awt.color; package java.awt.color;
import javax.tools.annotation.GenerateNativeHeader; import java.lang.annotation.Native;
import sun.java2d.cmm.PCMM; import sun.java2d.cmm.PCMM;
import sun.java2d.cmm.CMSManager; import sun.java2d.cmm.CMSManager;
...@@ -95,8 +95,6 @@ import sun.java2d.cmm.CMSManager; ...@@ -95,8 +95,6 @@ import sun.java2d.cmm.CMSManager;
* @see ICC_ColorSpace * @see ICC_ColorSpace
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public abstract class ColorSpace implements java.io.Serializable { public abstract class ColorSpace implements java.io.Serializable {
static final long serialVersionUID = -409452704308689724L; static final long serialVersionUID = -409452704308689724L;
...@@ -115,127 +113,127 @@ public abstract class ColorSpace implements java.io.Serializable { ...@@ -115,127 +113,127 @@ public abstract class ColorSpace implements java.io.Serializable {
/** /**
* Any of the family of XYZ color spaces. * Any of the family of XYZ color spaces.
*/ */
public static final int TYPE_XYZ = 0; @Native public static final int TYPE_XYZ = 0;
/** /**
* Any of the family of Lab color spaces. * Any of the family of Lab color spaces.
*/ */
public static final int TYPE_Lab = 1; @Native public static final int TYPE_Lab = 1;
/** /**
* Any of the family of Luv color spaces. * Any of the family of Luv color spaces.
*/ */
public static final int TYPE_Luv = 2; @Native public static final int TYPE_Luv = 2;
/** /**
* Any of the family of YCbCr color spaces. * Any of the family of YCbCr color spaces.
*/ */
public static final int TYPE_YCbCr = 3; @Native public static final int TYPE_YCbCr = 3;
/** /**
* Any of the family of Yxy color spaces. * Any of the family of Yxy color spaces.
*/ */
public static final int TYPE_Yxy = 4; @Native public static final int TYPE_Yxy = 4;
/** /**
* Any of the family of RGB color spaces. * Any of the family of RGB color spaces.
*/ */
public static final int TYPE_RGB = 5; @Native public static final int TYPE_RGB = 5;
/** /**
* Any of the family of GRAY color spaces. * Any of the family of GRAY color spaces.
*/ */
public static final int TYPE_GRAY = 6; @Native public static final int TYPE_GRAY = 6;
/** /**
* Any of the family of HSV color spaces. * Any of the family of HSV color spaces.
*/ */
public static final int TYPE_HSV = 7; @Native public static final int TYPE_HSV = 7;
/** /**
* Any of the family of HLS color spaces. * Any of the family of HLS color spaces.
*/ */
public static final int TYPE_HLS = 8; @Native public static final int TYPE_HLS = 8;
/** /**
* Any of the family of CMYK color spaces. * Any of the family of CMYK color spaces.
*/ */
public static final int TYPE_CMYK = 9; @Native public static final int TYPE_CMYK = 9;
/** /**
* Any of the family of CMY color spaces. * Any of the family of CMY color spaces.
*/ */
public static final int TYPE_CMY = 11; @Native public static final int TYPE_CMY = 11;
/** /**
* Generic 2 component color spaces. * Generic 2 component color spaces.
*/ */
public static final int TYPE_2CLR = 12; @Native public static final int TYPE_2CLR = 12;
/** /**
* Generic 3 component color spaces. * Generic 3 component color spaces.
*/ */
public static final int TYPE_3CLR = 13; @Native public static final int TYPE_3CLR = 13;
/** /**
* Generic 4 component color spaces. * Generic 4 component color spaces.
*/ */
public static final int TYPE_4CLR = 14; @Native public static final int TYPE_4CLR = 14;
/** /**
* Generic 5 component color spaces. * Generic 5 component color spaces.
*/ */
public static final int TYPE_5CLR = 15; @Native public static final int TYPE_5CLR = 15;
/** /**
* Generic 6 component color spaces. * Generic 6 component color spaces.
*/ */
public static final int TYPE_6CLR = 16; @Native public static final int TYPE_6CLR = 16;
/** /**
* Generic 7 component color spaces. * Generic 7 component color spaces.
*/ */
public static final int TYPE_7CLR = 17; @Native public static final int TYPE_7CLR = 17;
/** /**
* Generic 8 component color spaces. * Generic 8 component color spaces.
*/ */
public static final int TYPE_8CLR = 18; @Native public static final int TYPE_8CLR = 18;
/** /**
* Generic 9 component color spaces. * Generic 9 component color spaces.
*/ */
public static final int TYPE_9CLR = 19; @Native public static final int TYPE_9CLR = 19;
/** /**
* Generic 10 component color spaces. * Generic 10 component color spaces.
*/ */
public static final int TYPE_ACLR = 20; @Native public static final int TYPE_ACLR = 20;
/** /**
* Generic 11 component color spaces. * Generic 11 component color spaces.
*/ */
public static final int TYPE_BCLR = 21; @Native public static final int TYPE_BCLR = 21;
/** /**
* Generic 12 component color spaces. * Generic 12 component color spaces.
*/ */
public static final int TYPE_CCLR = 22; @Native public static final int TYPE_CCLR = 22;
/** /**
* Generic 13 component color spaces. * Generic 13 component color spaces.
*/ */
public static final int TYPE_DCLR = 23; @Native public static final int TYPE_DCLR = 23;
/** /**
* Generic 14 component color spaces. * Generic 14 component color spaces.
*/ */
public static final int TYPE_ECLR = 24; @Native public static final int TYPE_ECLR = 24;
/** /**
* Generic 15 component color spaces. * Generic 15 component color spaces.
*/ */
public static final int TYPE_FCLR = 25; @Native public static final int TYPE_FCLR = 25;
/** /**
* The sRGB color space defined at * The sRGB color space defined at
...@@ -243,28 +241,28 @@ public abstract class ColorSpace implements java.io.Serializable { ...@@ -243,28 +241,28 @@ public abstract class ColorSpace implements java.io.Serializable {
* http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html
* </A>. * </A>.
*/ */
public static final int CS_sRGB = 1000; @Native public static final int CS_sRGB = 1000;
/** /**
* A built-in linear RGB color space. This space is based on the * A built-in linear RGB color space. This space is based on the
* same RGB primaries as CS_sRGB, but has a linear tone reproduction curve. * same RGB primaries as CS_sRGB, but has a linear tone reproduction curve.
*/ */
public static final int CS_LINEAR_RGB = 1004; @Native public static final int CS_LINEAR_RGB = 1004;
/** /**
* The CIEXYZ conversion color space defined above. * The CIEXYZ conversion color space defined above.
*/ */
public static final int CS_CIEXYZ = 1001; @Native public static final int CS_CIEXYZ = 1001;
/** /**
* The Photo YCC conversion color space. * The Photo YCC conversion color space.
*/ */
public static final int CS_PYCC = 1002; @Native public static final int CS_PYCC = 1002;
/** /**
* The built-in linear gray scale color space. * The built-in linear gray scale color space.
*/ */
public static final int CS_GRAY = 1003; @Native public static final int CS_GRAY = 1003;
/** /**
......
/* /*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 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
...@@ -58,7 +58,6 @@ import java.util.StringTokenizer; ...@@ -58,7 +58,6 @@ import java.util.StringTokenizer;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
import javax.tools.annotation.GenerateNativeHeader;
/** /**
* A representation of color profile data for device independent and * A representation of color profile data for device independent and
...@@ -90,8 +89,6 @@ import javax.tools.annotation.GenerateNativeHeader; ...@@ -90,8 +89,6 @@ import javax.tools.annotation.GenerateNativeHeader;
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class ICC_Profile implements Serializable { public class ICC_Profile implements Serializable {
private static final long serialVersionUID = -3938515861990936766L; private static final long serialVersionUID = -3938515861990936766L;
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
package java.awt.datatransfer; package java.awt.datatransfer;
import java.awt.Toolkit;
import java.io.*; import java.io.*;
import java.nio.*; import java.nio.*;
import java.util.*; import java.util.*;
...@@ -162,6 +161,18 @@ public class DataFlavor implements Externalizable, Cloneable { ...@@ -162,6 +161,18 @@ public class DataFlavor implements Externalizable, Cloneable {
} }
} }
/*
* private initializer
*/
static private DataFlavor initHtmlDataFlavor(String htmlFlavorType) {
try {
return new DataFlavor ("text/html; class=java.lang.String;document=" +
htmlFlavorType + ";charset=Unicode");
} catch (Exception e) {
return null;
}
}
/** /**
* The <code>DataFlavor</code> representing a Java Unicode String class, * The <code>DataFlavor</code> representing a Java Unicode String class,
* where: * where:
...@@ -245,6 +256,46 @@ public class DataFlavor implements Externalizable, Cloneable { ...@@ -245,6 +256,46 @@ public class DataFlavor implements Externalizable, Cloneable {
*/ */
public static final String javaRemoteObjectMimeType = "application/x-java-remote-object"; public static final String javaRemoteObjectMimeType = "application/x-java-remote-object";
/**
* Represents a piece of an HTML markup. The markup consists of the part
* selected on the source side. Therefore some tags in the markup may be
* unpaired. If the flavor is used to represent the data in
* a {@link Transferable} instance, no additional changes will be made.
* This DataFlavor instance represents the same HTML markup as DataFlavor
* instances which content MIME type does not contain document parameter
* and representation class is the String class.
* <pre>
* representationClass = String
* mimeType = "text/html"
* </pre>
*/
public static DataFlavor selectionHtmlFlavor = initHtmlDataFlavor("selection");
/**
* Represents a piece of an HTML markup. If possible, the markup received
* from a native system is supplemented with pair tags to be
* a well-formed HTML markup. If the flavor is used to represent the data in
* a {@link Transferable} instance, no additional changes will be made.
* <pre>
* representationClass = String
* mimeType = "text/html"
* </pre>
*/
public static DataFlavor fragmentHtmlFlavor = initHtmlDataFlavor("fragment");
/**
* Represents a piece of an HTML markup. If possible, the markup
* received from a native system is supplemented with additional
* tags to make up a well-formed HTML document. If the flavor is used to
* represent the data in a {@link Transferable} instance,
* no additional changes will be made.
* <pre>
* representationClass = String
* mimeType = "text/html"
* </pre>
*/
public static DataFlavor allHtmlFlavor = initHtmlDataFlavor("all");
/** /**
* Constructs a new <code>DataFlavor</code>. This constructor is * Constructs a new <code>DataFlavor</code>. This constructor is
* provided only for the purpose of supporting the * provided only for the purpose of supporting the
...@@ -949,24 +1000,35 @@ public class DataFlavor implements Externalizable, Cloneable { ...@@ -949,24 +1000,35 @@ public class DataFlavor implements Externalizable, Cloneable {
return false; return false;
} }
if ("text".equals(getPrimaryType()) && if ("text".equals(getPrimaryType())) {
DataTransferer.doesSubtypeSupportCharset(this) && if (DataTransferer.doesSubtypeSupportCharset(this) &&
representationClass != null && representationClass != null &&
!(isRepresentationClassReader() || !(isRepresentationClassReader() ||
String.class.equals(representationClass) || String.class.equals(representationClass) ||
isRepresentationClassCharBuffer() || isRepresentationClassCharBuffer() ||
DataTransferer.charArrayClass.equals(representationClass))) DataTransferer.charArrayClass.equals(representationClass)))
{ {
String thisCharset = String thisCharset =
DataTransferer.canonicalName(getParameter("charset")); DataTransferer.canonicalName(getParameter("charset"));
String thatCharset = String thatCharset =
DataTransferer.canonicalName(that.getParameter("charset")); DataTransferer.canonicalName(that.getParameter("charset"));
if (thisCharset == null) { if (thisCharset == null) {
if (thatCharset != null) { if (thatCharset != null) {
return false; return false;
}
} else {
if (!thisCharset.equals(thatCharset)) {
return false;
}
} }
} else { }
if (!thisCharset.equals(thatCharset)) {
if ("html".equals(getSubType()) &&
this.getParameter("document") != null )
{
if (!this.getParameter("document").
equals(that.getParameter("document")))
{
return false; return false;
} }
} }
......
/* /*
* Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 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
...@@ -27,7 +27,6 @@ package java.awt.datatransfer; ...@@ -27,7 +27,6 @@ package java.awt.datatransfer;
import java.io.*; import java.io.*;
import javax.tools.annotation.GenerateNativeHeader;
/** /**
* A <code>Transferable</code> which implements the capability required * A <code>Transferable</code> which implements the capability required
...@@ -43,8 +42,6 @@ import javax.tools.annotation.GenerateNativeHeader; ...@@ -43,8 +42,6 @@ import javax.tools.annotation.GenerateNativeHeader;
* @see java.awt.datatransfer.DataFlavor#stringFlavor * @see java.awt.datatransfer.DataFlavor#stringFlavor
* @see java.awt.datatransfer.DataFlavor#plainTextFlavor * @see java.awt.datatransfer.DataFlavor#plainTextFlavor
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class StringSelection implements Transferable, ClipboardOwner { public class StringSelection implements Transferable, ClipboardOwner {
private static final int STRING = 0; private static final int STRING = 0;
......
...@@ -41,7 +41,7 @@ import java.util.ArrayList; ...@@ -41,7 +41,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
...@@ -100,6 +100,11 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { ...@@ -100,6 +100,11 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable {
*/ */
private static final String TEXT_PLAIN_BASE_TYPE = "text/plain"; private static final String TEXT_PLAIN_BASE_TYPE = "text/plain";
/**
* A String representing text/html MIME type.
*/
private static final String HTML_TEXT_BASE_TYPE = "text/html";
/** /**
* This constant is passed to flavorToNativeLookup() to indicate that a * This constant is passed to flavorToNativeLookup() to indicate that a
* a native should be synthesized, stored, and returned by encoding the * a native should be synthesized, stored, and returned by encoding the
...@@ -113,7 +118,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { ...@@ -113,7 +118,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable {
* text DataFlavors). * text DataFlavors).
* Do not use the field directly, use getNativeToFlavor() instead. * Do not use the field directly, use getNativeToFlavor() instead.
*/ */
private Map nativeToFlavor = new HashMap(); private final Map<String, List<DataFlavor>> nativeToFlavor = new HashMap<>();
/** /**
* Accessor to nativeToFlavor map. Since we use lazy initialization we must * Accessor to nativeToFlavor map. Since we use lazy initialization we must
...@@ -122,7 +127,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { ...@@ -122,7 +127,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable {
* *
* @return nativeToFlavor * @return nativeToFlavor
*/ */
private Map getNativeToFlavor() { private Map<String, List<DataFlavor>> getNativeToFlavor() {
if (!isMapInitialized) { if (!isMapInitialized) {
initSystemFlavorMap(); initSystemFlavorMap();
} }
...@@ -134,7 +139,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { ...@@ -134,7 +139,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable {
* native Strings. * native Strings.
* Do not use the field directly, use getFlavorToNative() instead. * Do not use the field directly, use getFlavorToNative() instead.
*/ */
private Map flavorToNative = new HashMap(); private final Map flavorToNative = new HashMap();
/** /**
* Accessor to flavorToNative map. Since we use lazy initialization we must * Accessor to flavorToNative map. Since we use lazy initialization we must
...@@ -421,14 +426,17 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { ...@@ -421,14 +426,17 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable {
} }
} }
// For text/* flavors, store mappings in separate maps to final LinkedHashSet<DataFlavor> dfs = new LinkedHashSet<>();
// enable dynamic mapping generation at a run-time.
dfs.add(flavor);
if ("text".equals(flavor.getPrimaryType())) { if ("text".equals(flavor.getPrimaryType())) {
store(value, key, getFlavorToNative()); dfs.addAll(convertMimeTypeToDataFlavors(value));
store(key, value, getNativeToFlavor()); }
} else {
store(flavor, key, getFlavorToNative()); for (DataFlavor df : dfs) {
store(key, flavor, getNativeToFlavor()); store(df, key, getFlavorToNative());
store(key, df, getNativeToFlavor());
} }
} }
} }
...@@ -530,7 +538,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { ...@@ -530,7 +538,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable {
* only if the specified native is encoded as a Java MIME type. * only if the specified native is encoded as a Java MIME type.
*/ */
private List nativeToFlavorLookup(String nat) { private List nativeToFlavorLookup(String nat) {
List flavors = (List)getNativeToFlavor().get(nat); List<DataFlavor> flavors = getNativeToFlavor().get(nat);
if (nat != null && !disabledMappingGenerationKeys.contains(nat)) { if (nat != null && !disabledMappingGenerationKeys.contains(nat)) {
DataTransferer transferer = DataTransferer.getInstance(); DataTransferer transferer = DataTransferer.getInstance();
...@@ -625,7 +633,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { ...@@ -625,7 +633,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable {
getNativesForFlavorCache.remove(flav); getNativesForFlavorCache.remove(flav);
getNativesForFlavorCache.remove(null); getNativesForFlavorCache.remove(null);
List flavors = (List)getNativeToFlavor().get(encoded); List<DataFlavor> flavors = getNativeToFlavor().get(encoded);
if (flavors == null) { if (flavors == null) {
flavors = new ArrayList(1); flavors = new ArrayList(1);
getNativeToFlavor().put(encoded, flavors); getNativeToFlavor().put(encoded, flavors);
...@@ -681,7 +689,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { ...@@ -681,7 +689,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable {
} }
if (flav == null) { if (flav == null) {
retval = new ArrayList(getNativeToFlavor().keySet()); retval = new ArrayList<String>(getNativeToFlavor().keySet());
} else if (disabledMappingGenerationKeys.contains(flav)) { } else if (disabledMappingGenerationKeys.contains(flav)) {
// In this case we shouldn't synthesize a native for this flavor, // In this case we shouldn't synthesize a native for this flavor,
// since its mappings were explicitly specified. // since its mappings were explicitly specified.
...@@ -809,140 +817,162 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable { ...@@ -809,140 +817,162 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable {
} }
} }
LinkedList retval = new LinkedList(); final LinkedHashSet <DataFlavor> returnValue =
new LinkedHashSet<>();
if (nat == null) { if (nat == null) {
List natives = getNativesForFlavor(null); final List<String> natives = getNativesForFlavor(null);
HashSet dups = new HashSet(natives.size());
for (Iterator natives_iter = natives.iterator(); for (String n : natives)
natives_iter.hasNext(); )
{ {
List flavors = final List<DataFlavor> flavors = getFlavorsForNative(n);
getFlavorsForNative((String)natives_iter.next());
for (Iterator flavors_iter = flavors.iterator(); for (DataFlavor df : flavors)
flavors_iter.hasNext(); )
{ {
Object flavor = flavors_iter.next(); returnValue.add(df);
if (dups.add(flavor)) {
retval.add(flavor);
}
} }
} }
} else { } else {
List flavors = nativeToFlavorLookup(nat);
final List<DataFlavor> flavors = nativeToFlavorLookup(nat);
if (disabledMappingGenerationKeys.contains(nat)) { if (disabledMappingGenerationKeys.contains(nat)) {
return flavors; return flavors;
} }
HashSet dups = new HashSet(flavors.size()); final List<DataFlavor> flavorsAndBaseTypes =
nativeToFlavorLookup(nat);
List flavorsAndbaseTypes = nativeToFlavorLookup(nat); for (DataFlavor df : flavorsAndBaseTypes) {
returnValue.add(df);
if ("text".equals(df.getPrimaryType())) {
try {
returnValue.addAll(
convertMimeTypeToDataFlavors(
new MimeType(df.getMimeType()
).getBaseType()));
} catch (MimeTypeParseException e) {
e.printStackTrace();
}
}
}
for (Iterator flavorsAndbaseTypes_iter = }
flavorsAndbaseTypes.iterator();
flavorsAndbaseTypes_iter.hasNext(); ) final ArrayList arrayList = new ArrayList(returnValue);
getFlavorsForNativeCache.put(nat, new SoftReference(arrayList));
return (List)arrayList.clone();
}
private static LinkedHashSet<DataFlavor> convertMimeTypeToDataFlavors(
final String baseType) {
final LinkedHashSet<DataFlavor> returnValue =
new LinkedHashSet<DataFlavor>();
String subType = null;
try {
final MimeType mimeType = new MimeType(baseType);
subType = mimeType.getSubType();
} catch (MimeTypeParseException mtpe) {
// Cannot happen, since we checked all mappings
// on load from flavormap.properties.
assert(false);
}
if (DataTransferer.doesSubtypeSupportCharset(subType, null)) {
if (TEXT_PLAIN_BASE_TYPE.equals(baseType))
{ {
Object value = flavorsAndbaseTypes_iter.next(); returnValue.add(DataFlavor.stringFlavor);
if (value instanceof String) { }
String baseType = (String)value;
String subType = null; for (String unicodeClassName : UNICODE_TEXT_CLASSES) {
final String mimeType = baseType + ";charset=Unicode;class=" +
unicodeClassName;
final LinkedHashSet<String> mimeTypes =
handleHtmlMimeTypes(baseType, mimeType);
for (String mt : mimeTypes) {
DataFlavor toAdd = null;
try { try {
MimeType mimeType = new MimeType(baseType); toAdd = new DataFlavor(mt);
subType = mimeType.getSubType(); } catch (ClassNotFoundException cannotHappen) {
} catch (MimeTypeParseException mtpe) {
// Cannot happen, since we checked all mappings
// on load from flavormap.properties.
assert(false);
} }
if (DataTransferer.doesSubtypeSupportCharset(subType, returnValue.add(toAdd);
null)) { }
if (TEXT_PLAIN_BASE_TYPE.equals(baseType) && }
dups.add(DataFlavor.stringFlavor))
{
retval.add(DataFlavor.stringFlavor);
}
for (int i = 0; i < UNICODE_TEXT_CLASSES.length; i++) {
DataFlavor toAdd = null;
try {
toAdd = new DataFlavor
(baseType + ";charset=Unicode;class=" +
UNICODE_TEXT_CLASSES[i]);
} catch (ClassNotFoundException cannotHappen) {
}
if (dups.add(toAdd)) {
retval.add(toAdd);
}
}
for (Iterator charset_iter = for (String charset : DataTransferer.standardEncodings()) {
DataTransferer.standardEncodings();
charset_iter.hasNext(); )
{
String charset = (String)charset_iter.next();
for (int i = 0; i < ENCODED_TEXT_CLASSES.length; for (String encodedTextClass : ENCODED_TEXT_CLASSES) {
i++) final String mimeType =
{ baseType + ";charset=" + charset +
DataFlavor toAdd = null; ";class=" + encodedTextClass;
try {
toAdd = new DataFlavor
(baseType + ";charset=" + charset +
";class=" + ENCODED_TEXT_CLASSES[i]);
} catch (ClassNotFoundException cannotHappen) {
}
// Check for equality to plainTextFlavor so final LinkedHashSet<String> mimeTypes =
// that we can ensure that the exact charset of handleHtmlMimeTypes(baseType, mimeType);
// plainTextFlavor, not the canonical charset
// or another equivalent charset with a
// different name, is used.
if (toAdd.equals(DataFlavor.plainTextFlavor)) {
toAdd = DataFlavor.plainTextFlavor;
}
if (dups.add(toAdd)) { for (String mt : mimeTypes) {
retval.add(toAdd);
}
}
}
if (TEXT_PLAIN_BASE_TYPE.equals(baseType) && DataFlavor df = null;
dups.add(DataFlavor.plainTextFlavor))
{
retval.add(DataFlavor.plainTextFlavor);
}
} else {
// Non-charset text natives should be treated as
// opaque, 8-bit data in any of its various
// representations.
for (int i = 0; i < ENCODED_TEXT_CLASSES.length; i++) {
DataFlavor toAdd = null;
try {
toAdd = new DataFlavor(baseType +
";class=" + ENCODED_TEXT_CLASSES[i]);
} catch (ClassNotFoundException cannotHappen) {
}
if (dups.add(toAdd)) { try {
retval.add(toAdd); df = new DataFlavor(mt);
// Check for equality to plainTextFlavor so
// that we can ensure that the exact charset of
// plainTextFlavor, not the canonical charset
// or another equivalent charset with a
// different name, is used.
if (df.equals(DataFlavor.plainTextFlavor)) {
df = DataFlavor.plainTextFlavor;
} }
} catch (ClassNotFoundException cannotHappen) {
} }
}
} else { returnValue.add(df);
DataFlavor flavor = (DataFlavor)value;
if (dups.add(flavor)) {
retval.add(flavor);
} }
} }
} }
if (TEXT_PLAIN_BASE_TYPE.equals(baseType))
{
returnValue.add(DataFlavor.plainTextFlavor);
}
} else {
// Non-charset text natives should be treated as
// opaque, 8-bit data in any of its various
// representations.
for (String encodedTextClassName : ENCODED_TEXT_CLASSES) {
DataFlavor toAdd = null;
try {
toAdd = new DataFlavor(baseType +
";class=" + encodedTextClassName);
} catch (ClassNotFoundException cannotHappen) {
}
returnValue.add(toAdd);
}
} }
return returnValue;
}
ArrayList arrayList = new ArrayList(retval); private static final String [] htmlDocumntTypes =
getFlavorsForNativeCache.put(nat, new SoftReference(arrayList)); new String [] {"all", "selection", "fragment"};
return (List)arrayList.clone();
private static LinkedHashSet<String> handleHtmlMimeTypes(
String baseType, String mimeType) {
LinkedHashSet<String> returnValues = new LinkedHashSet<>();
if (HTML_TEXT_BASE_TYPE.equals(baseType)) {
for (String documentType : htmlDocumntTypes) {
returnValues.add(mimeType + ";document=" + documentType);
}
} else {
returnValues.add(mimeType);
}
return returnValues;
} }
/** /**
......
/* /*
* Copyright (c) 1997, 1999, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 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
...@@ -25,15 +25,13 @@ ...@@ -25,15 +25,13 @@
package java.awt.dnd; package java.awt.dnd;
import javax.tools.annotation.GenerateNativeHeader; import java.lang.annotation.Native;
/** /**
* This class contains constant values representing * This class contains constant values representing
* the type of action(s) to be performed by a Drag and Drop operation. * the type of action(s) to be performed by a Drag and Drop operation.
* @since 1.2 * @since 1.2
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public final class DnDConstants { public final class DnDConstants {
private DnDConstants() {} // define null private constructor. private DnDConstants() {} // define null private constructor.
...@@ -41,23 +39,23 @@ public final class DnDConstants { ...@@ -41,23 +39,23 @@ public final class DnDConstants {
/** /**
* An <code>int</code> representing no action. * An <code>int</code> representing no action.
*/ */
public static final int ACTION_NONE = 0x0; @Native public static final int ACTION_NONE = 0x0;
/** /**
* An <code>int</code> representing a &quot;copy&quot; action. * An <code>int</code> representing a &quot;copy&quot; action.
*/ */
public static final int ACTION_COPY = 0x1; @Native public static final int ACTION_COPY = 0x1;
/** /**
* An <code>int</code> representing a &quot;move&quot; action. * An <code>int</code> representing a &quot;move&quot; action.
*/ */
public static final int ACTION_MOVE = 0x2; @Native public static final int ACTION_MOVE = 0x2;
/** /**
* An <code>int</code> representing a &quot;copy&quot; or * An <code>int</code> representing a &quot;copy&quot; or
* &quot;move&quot; action. * &quot;move&quot; action.
*/ */
public static final int ACTION_COPY_OR_MOVE = ACTION_COPY | ACTION_MOVE; @Native public static final int ACTION_COPY_OR_MOVE = ACTION_COPY | ACTION_MOVE;
/** /**
* An <code>int</code> representing a &quot;link&quot; action. * An <code>int</code> representing a &quot;link&quot; action.
...@@ -75,12 +73,12 @@ public final class DnDConstants { ...@@ -75,12 +73,12 @@ public final class DnDConstants {
* results for the user. * results for the user.
*/ */
public static final int ACTION_LINK = 0x40000000; @Native public static final int ACTION_LINK = 0x40000000;
/** /**
* An <code>int</code> representing a &quot;reference&quot; * An <code>int</code> representing a &quot;reference&quot;
* action (synonym for ACTION_LINK). * action (synonym for ACTION_LINK).
*/ */
public static final int ACTION_REFERENCE = ACTION_LINK; @Native public static final int ACTION_REFERENCE = ACTION_LINK;
} }
...@@ -36,7 +36,7 @@ package java.awt.dnd; ...@@ -36,7 +36,7 @@ package java.awt.dnd;
public class InvalidDnDOperationException extends IllegalStateException { public class InvalidDnDOperationException extends IllegalStateException {
private static final long serialVersionUID = 5156676500247816278L; private static final long serialVersionUID = -6062568741193956678L;
static private String dft_msg = "The operation requested cannot be performed by the DnD system since it is not in the appropriate state"; static private String dft_msg = "The operation requested cannot be performed by the DnD system since it is not in the appropriate state";
......
/* /*
* Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 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
...@@ -27,7 +27,7 @@ package java.awt.event; ...@@ -27,7 +27,7 @@ package java.awt.event;
import java.awt.AWTEvent; import java.awt.AWTEvent;
import java.awt.Event; import java.awt.Event;
import javax.tools.annotation.GenerateNativeHeader; import java.lang.annotation.Native;
/** /**
* A semantic event which indicates that a component-defined action occurred. * A semantic event which indicates that a component-defined action occurred.
...@@ -57,8 +57,6 @@ import javax.tools.annotation.GenerateNativeHeader; ...@@ -57,8 +57,6 @@ import javax.tools.annotation.GenerateNativeHeader;
* @author Carl Quinn * @author Carl Quinn
* @since 1.1 * @since 1.1
*/ */
/* No native methods here, but the constants are needed in the supporting JNI code */
@GenerateNativeHeader
public class ActionEvent extends AWTEvent { public class ActionEvent extends AWTEvent {
/** /**
...@@ -99,7 +97,7 @@ public class ActionEvent extends AWTEvent { ...@@ -99,7 +97,7 @@ public class ActionEvent extends AWTEvent {
/** /**
* This event id indicates that a meaningful action occured. * This event id indicates that a meaningful action occured.
*/ */
public static final int ACTION_PERFORMED = ACTION_FIRST; //Event.ACTION_EVENT @Native public static final int ACTION_PERFORMED = ACTION_FIRST; //Event.ACTION_EVENT
/** /**
* The nonlocalized string that gives more details * The nonlocalized string that gives more details
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册