提交 cd2f7acc 编写于 作者: A asaha

Merge

...@@ -70,3 +70,5 @@ f2dce7210cc00453c23e53edeec7156f112ca382 jdk7-b92 ...@@ -70,3 +70,5 @@ f2dce7210cc00453c23e53edeec7156f112ca382 jdk7-b92
219b84b9533ae4fe3c6c2083f8a8962cb579f1de jdk7-b93 219b84b9533ae4fe3c6c2083f8a8962cb579f1de jdk7-b93
cf44386c8fe3fbdb9da14346be25d19fd1092f71 jdk7-b94 cf44386c8fe3fbdb9da14346be25d19fd1092f71 jdk7-b94
db951e984ccf50756160fee3078c791300b0917e jdk7-b95 db951e984ccf50756160fee3078c791300b0917e jdk7-b95
51b9e5dbc2da0631414484b934ac3fb62e48a2c6 jdk7-b96
b1903d7528d33b521df42bc9291bdcdd2f444a29 jdk7-b97
...@@ -42,7 +42,7 @@ endif ...@@ -42,7 +42,7 @@ endif
SUBDIRS = java security net/ssl jarsigner SUBDIRS = java security net/ssl jarsigner
SUBDIRS_management = jmx SUBDIRS_management = jmx
SUBDIRS_desktop = image inputmethods SUBDIRS_desktop = image
SUBDIRS_enterprise = crypto/provider jndi \ SUBDIRS_enterprise = crypto/provider jndi \
org xml rowset net/httpserver org xml rowset net/httpserver
SUBDIRS_misc = $(SCRIPT_SUBDIR) tracing servicetag nio demo SUBDIRS_misc = $(SCRIPT_SUBDIR) tracing servicetag nio demo
......
#
# Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Makefile for building Java input methods
#
BUILDDIR = ../../..
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = indicim thaiim
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
$(SUBDIRS-loop)
#
# Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Makefile for thai input method.
#
BUILDDIR = ../../../..
PACKAGE = com.sun.inputmethods.internal.thaiim
PRODUCT = sun
CLASSDESTDIR = $(TEMPDIR)/classes
SERVICESDIR=META-INF/services
IMJAR = $(IMJARDIR)/thaiim.jar
IMJARDIR=$(LIBDIR)/im
include $(BUILDDIR)/common/Defs.gmk
#
# Files
#
AUTO_FILES_JAVA_DIRS = com/sun/inputmethods/internal/thaiim
FILES_copy = \
$(CLASSDESTDIR)/com/sun/inputmethods/internal/thaiim/resources/DisplayNames.properties
PROVIDER_CONF_FILE = \
$(CLASSDESTDIR)/$(SERVICESDIR)/java.awt.im.spi.InputMethodDescriptor
#
# Rules
#
include $(BUILDDIR)/common/Classes.gmk
build: $(IMJAR)
#
# Extra rules to build im.
#
$(CLASSDESTDIR)/com/sun/inputmethods/internal/thaiim/resources/% : $(SHARE_SRC)/classes/com/sun/inputmethods/internal/thaiim/resources/%
$(install-file)
$(CLASSDESTDIR)/$(SERVICESDIR)/java.awt.im.spi.InputMethodDescriptor : $(SHARE_SRC)/classes/com/sun/inputmethods/internal/thaiim/java.awt.im.spi.InputMethodDescriptor
$(install-file)
$(IMJAR): $(FILES_class) $(FILES_copy) $(PROVIDER_CONF_FILE)
$(prep-target)
$(BOOT_JAR_CMD) -cf $@ \
-C $(CLASSDESTDIR) com \
-C $(CLASSDESTDIR) $(SERVICESDIR) \
$(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup)
clean::
$(RM) -r $(CLASSDESTDIR)
$(RM) $(IMJAR)
...@@ -194,7 +194,16 @@ ifeq ($(FASTDEBUG), true) ...@@ -194,7 +194,16 @@ ifeq ($(FASTDEBUG), true)
CXXFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) CXXFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
endif endif
CPPFLAGS_COMMON = -D$(ARCH) -DARCH='"$(ARCH)"' -DLINUX $(VERSION_DEFINES) \ CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"'
# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here)
ifneq ($(ARCH),alpha)
CPP_ARCH_FLAGS += -D$(ARCH)
else
CPP_ARCH_FLAGS += -D_$(ARCH)_
endif
CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -DLINUX $(VERSION_DEFINES) \
-D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
ifeq ($(ARCH_DATA_MODEL), 64) ifeq ($(ARCH_DATA_MODEL), 64)
......
...@@ -639,21 +639,8 @@ AWT_RUNPATH = -R/usr/dt/lib$(ISA_DIR) -R$(OPENWIN_RUNTIME_LIB) ...@@ -639,21 +639,8 @@ AWT_RUNPATH = -R/usr/dt/lib$(ISA_DIR) -R$(OPENWIN_RUNTIME_LIB)
# in general this is ok to continue to do. # in general this is ok to continue to do.
LIBCXX = /usr/lib$(ISA_DIR)/libCrun.so.1 LIBCXX = /usr/lib$(ISA_DIR)/libCrun.so.1
# Math Library (libm.so), do not use -lm. # JDK now requires Solaris 10, so pick up libm.so.2
# There might be two versions of libm.so on the build system: LIBM = /usr/lib$(ISA_DIR)/libm.so.2
# libm.so.1 and libm.so.2, and we want libm.so.1.
# Depending on the Solaris release being used to build with,
# /usr/lib/libm.so could point at a libm.so.2, so we are
# explicit here so that the libjvm.so you have built will work on an
# older Solaris release that might not have libm.so.2.
# This is a critical factor in allowing builds on Solaris 10 or newer
# to run on Solaris 8 or 9.
#
# Note: Historically there was also a problem picking up a static version
# of libm.a from the compiler area, but that problem has gone away
# with the newer compilers. Use of libm.a would cause .so bloat.
#
LIBM = /usr/lib$(ISA_DIR)/libm.so.1
# Socket library # Socket library
LIBSOCKET = -lsocket LIBSOCKET = -lsocket
......
...@@ -47,14 +47,20 @@ IMAGE_BINDIR = bin ...@@ -47,14 +47,20 @@ IMAGE_BINDIR = bin
# Swing has taken this approach only as a temporary measure to avoid # Swing has taken this approach only as a temporary measure to avoid
# the compiler warnings until we can properly document these packages. # the compiler warnings until we can properly document these packages.
# This is covered under 6491853. # This is covered under 6491853.
EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf \ EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf.windows \
com.sun.java.swing.plaf.windows \
com.sun.java.swing.plaf.motif \ com.sun.java.swing.plaf.motif \
com.sun.java.swing.plaf.gtk com.sun.java.swing.plaf.gtk
# This is a stopgap until 6839872 is fixed. # This is a stopgap until 6839872 is fixed.
EXCLUDE_PROPWARN_PKGS += sun.dyn EXCLUDE_PROPWARN_PKGS += sun.dyn
#
# Include the exported private packages in ct.sym.
# This is an interim solution until the ct.sym is replaced
# with a new module system (being discussed for JDK 7).
#
EXPORTED_PRIVATE_PKGS = com.sun.servicetag
# 64-bit solaris has a few special cases. We define the variable # 64-bit solaris has a few special cases. We define the variable
# SOLARIS64 for use in this Makefile to easily test those cases # SOLARIS64 for use in this Makefile to easily test those cases
ifeq ($(PLATFORM), solaris) ifeq ($(PLATFORM), solaris)
...@@ -543,6 +549,7 @@ DIRDIFF_JARFILE = $(BUILDTOOLJARDIR)/dirdiff.jar ...@@ -543,6 +549,7 @@ DIRDIFF_JARFILE = $(BUILDTOOLJARDIR)/dirdiff.jar
###################################################### ######################################################
# List of directories in classes directory that should NOT be in rt.jar # List of directories in classes directory that should NOT be in rt.jar
# sun/nio/cs/ext/ will go into charsets.jar
###################################################### ######################################################
NOT_RT_JAR_LIST = $(ABS_TEMPDIR)/not_rt_jar.list NOT_RT_JAR_LIST = $(ABS_TEMPDIR)/not_rt_jar.list
...@@ -565,6 +572,7 @@ $(NOT_RT_JAR_LIST): FRC ...@@ -565,6 +572,7 @@ $(NOT_RT_JAR_LIST): FRC
$(ECHO) "META-INF/services/com.sun.tools.xjc.Plugin" >> $@ $(ECHO) "META-INF/services/com.sun.tools.xjc.Plugin" >> $@
$(ECHO) "com/sun/tools/" >> $@ $(ECHO) "com/sun/tools/" >> $@
$(ECHO) "sun/jvmstat/" >> $@ $(ECHO) "sun/jvmstat/" >> $@
$(ECHO) "sun/nio/cs/ext/" >> $@
$(ECHO) "sun/rmi/rmic/" >> $@ $(ECHO) "sun/rmi/rmic/" >> $@
$(ECHO) "sun/tools/asm/" >> $@ $(ECHO) "sun/tools/asm/" >> $@
$(ECHO) "sun/tools/java/" >> $@ $(ECHO) "sun/tools/java/" >> $@
...@@ -648,7 +656,9 @@ $(RT_JAR_FILELIST) + $(RES_JAR_FILELIST): \ ...@@ -648,7 +656,9 @@ $(RT_JAR_FILELIST) + $(RES_JAR_FILELIST): \
JAR_MANIFEST_FILE=$(ABS_TEMPDIR)/manifest.tmp JAR_MANIFEST_FILE=$(ABS_TEMPDIR)/manifest.tmp
$(JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST) $(JAR_MANIFEST_FILE): $(MAINMANIFEST) $(BEANMANIFEST)
$(prep-target) $(prep-target)
$(SED) -e "s/@@RELEASE@@/$(RELEASE)/" $(MAINMANIFEST) >> $@ $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
-e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
$(MAINMANIFEST) >> $@
$(ECHO) >> $@ $(ECHO) >> $@
$(CAT) $(BEANMANIFEST) >> $@ $(CAT) $(BEANMANIFEST) >> $@
...@@ -981,7 +991,7 @@ initial-image-jdk:: initial-image-jdk-setup \ ...@@ -981,7 +991,7 @@ initial-image-jdk:: initial-image-jdk-setup \
-processor com.sun.tools.javac.sym.CreateSymbols \ -processor com.sun.tools.javac.sym.CreateSymbols \
-Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \ -Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \
-Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \ -Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
$(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
$(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \ $(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \
-C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS) -C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS)
@$(java-vm-cleanup) @$(java-vm-cleanup)
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
# #
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any # or visit www.oracle.com if you need additional information or have any
# have any questions # questions.
# #
# #
......
...@@ -35,9 +35,6 @@ ifndef JDK_MAKE_SHARED_DIR ...@@ -35,9 +35,6 @@ ifndef JDK_MAKE_SHARED_DIR
JDK_MAKE_SHARED_DIR = $(JDK_TOPDIR)/make/common/shared JDK_MAKE_SHARED_DIR = $(JDK_TOPDIR)/make/common/shared
endif endif
ifndef CONTROL_TOPDIR
CONTROL_TOPDIR=$(TOPDIR)
endif
ifndef HOTSPOT_TOPDIR ifndef HOTSPOT_TOPDIR
HOTSPOT_TOPDIR=$(TOPDIR)/hotspot HOTSPOT_TOPDIR=$(TOPDIR)/hotspot
endif endif
......
# #
# Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 1997, 2010, 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,57 +23,71 @@ ...@@ -23,57 +23,71 @@
# questions. # questions.
# #
# # Copyright year for beginning of Java and some of the apis
# Makefile for indic input method. # (Needed when creating the javadocs)
# FIRST_COPYRIGHT_YEAR = 1993
DOMAPI_FIRST_COPYRIGHT_YEAR = 2005
BUILDDIR = ../../../.. MIRROR_FIRST_COPYRIGHT_YEAR = 2004
DOCLETAPI_FIRST_COPYRIGHT_YEAR = 1993
PACKAGE = com.sun.inputmethods.internal.indicim TAGLETAPI_FIRST_COPYRIGHT_YEAR = 1993
PRODUCT = sun JDI_FIRST_COPYRIGHT_YEAR = 1999
JAAS_FIRST_COPYRIGHT_YEAR = 1998
CLASSDESTDIR = $(TEMPDIR)/classes JGSS_FIRST_COPYRIGHT_YEAR = 2000
SERVICESDIR=META-INF/services SMARTCARDIO_FIRST_COPYRIGHT_YEAR = 2005
IMJAR = $(IMJARDIR)/indicim.jar HTTPSERVER_FIRST_COPYRIGHT_YEAR = 2005
IMJARDIR=$(LIBDIR)/im MGMT_FIRST_COPYRIGHT_YEAR = 2003
include $(BUILDDIR)/common/Defs.gmk ATTACH_FIRST_COPYRIGHT_YEAR = 2005
JCONSOLE_FIRST_COPYRIGHT_YEAR = 2006
# SCTPAPI_FIRST_COPYRIGHT_YEAR = 2009
# Files TRACING_FIRST_COPYRIGHT_YEAR = 2008
# TREEAPI_FIRST_COPYRIGHT_YEAR = 2005
AUTO_FILES_JAVA_DIRS = com/sun/inputmethods/internal/indicim JNLP_FIRST_COPYRIGHT_YEAR = 1998
PLUGIN2_FIRST_COPYRIGHT_YEAR = 2007
FILES_copy = \ # Oracle name
$(CLASSDESTDIR)/com/sun/inputmethods/internal/indicim/resources/DisplayNames.properties COMPANY_NAME = Oracle and/or its affiliates
PROVIDER_CONF_FILE = \
$(CLASSDESTDIR)/$(SERVICESDIR)/java.awt.im.spi.InputMethodDescriptor
#
# Rules
#
include $(BUILDDIR)/common/Classes.gmk
build: $(IMJAR)
#
# Extra rules to build im.
#
$(CLASSDESTDIR)/com/sun/inputmethods/internal/indicim/resources/% : $(SHARE_SRC)/classes/com/sun/inputmethods/internal/indicim/resources/% # Copyright address
$(install-file) COMPANY_ADDRESS = 500 Oracle Parkway<br>Redwood Shores, CA 94065 USA.
$(CLASSDESTDIR)/$(SERVICESDIR)/java.awt.im.spi.InputMethodDescriptor : $(SHARE_SRC)/classes/com/sun/inputmethods/internal/indicim/java.awt.im.spi.InputMethodDescriptor # The trademark symbol
$(install-file) TRADEMARK = &trade;
$(IMJAR): $(FILES_class) $(FILES_copy) $(PROVIDER_CONF_FILE) # Common copyright lines used
$(prep-target) # The word "Copyright" might optionally be a link to the file cpyr.html.
$(BOOT_JAR_CMD) -cf $@ \ # The first year of copyright may vary or not be available.
-C $(CLASSDESTDIR) com \ # The address to the company might be optional.
-C $(CLASSDESTDIR) $(SERVICESDIR) \ COMMA:= ,
$(BOOT_JAR_JFLAGS) EMPTY:=
@$(java-vm-cleanup) SPACE:=$(EMPTY) $(EMPTY)
COPYRIGHT_SYMBOL = &\#x00a9;
# Macros to handle the optional empty args.
# (The GNU make 3.78.1 "if" conditional is broken, fixed in GNU make 3.81)
define OptionalCopyrightUrl # url
$(shell \
if [ "$1" != "" ] ; then \
printf "<a href=\"%s\">Copyright</a>" "$1"; \
else \
printf "Copyright"; \
fi)
endef
define OptionalCopyrightFirstYear # year
$(shell \
if [ "$1" != "" ] ; then \
printf "%s," "$1";\
fi)
endef
define OptionalCompanyAddress # address
$(shell \
if [ "$1" != "" ] ; then \
printf "%s" "$1";\
fi)
endef
define CopyrightLine # optionalurl optionalfirstyear optionaladdress
$(call OptionalCopyrightUrl,$1) $(COPYRIGHT_SYMBOL)\
$(call OptionalCopyrightFirstYear,$2) $(COPYRIGHT_YEAR),\
$(COMPANY_NAME).\
$(call OptionalCompanyAddress,$3)\
All rights reserved.
endef
clean::
$(RM) -r $(CLASSDESTDIR)
$(RM) $(IMJAR)
...@@ -214,7 +214,7 @@ else ...@@ -214,7 +214,7 @@ else
PRODUCT_NAME = Java(TM) PRODUCT_NAME = Java(TM)
PRODUCT_SUFFIX = SE Runtime Environment PRODUCT_SUFFIX = SE Runtime Environment
JDK_RC_PLATFORM_NAME = Platform SE JDK_RC_PLATFORM_NAME = Platform SE
COMPANY_NAME = Sun Microsystems, Inc. COMPANY_NAME = Oracle
endif endif
RUNTIME_NAME = $(PRODUCT_NAME) $(PRODUCT_SUFFIX) RUNTIME_NAME = $(PRODUCT_NAME) $(PRODUCT_SUFFIX)
......
...@@ -234,6 +234,7 @@ CORE_PKGS = \ ...@@ -234,6 +234,7 @@ CORE_PKGS = \
javax.xml.ws.http \ javax.xml.ws.http \
javax.xml.ws.soap \ javax.xml.ws.soap \
javax.xml.ws.spi \ javax.xml.ws.spi \
javax.xml.ws.spi.http \
javax.xml.ws.wsaddressing \ javax.xml.ws.wsaddressing \
javax.xml.transform \ javax.xml.transform \
javax.xml.transform.sax \ javax.xml.transform.sax \
......
此差异已折叠。
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
# #
JAVA_JAVA_java = \ JAVA_JAVA_java = \
java/lang/Object.java \ java/lang/Object.java \
java/lang/AutoCloseable.java \
java/lang/Class.java \ java/lang/Class.java \
java/lang/Thread.java \ java/lang/Thread.java \
java/lang/Character.java \ java/lang/Character.java \
......
...@@ -818,7 +818,7 @@ GENSOR_SRC = $(SHARE_SRC)/native/sun/nio/ch/genSocketOptionRegistry.c ...@@ -818,7 +818,7 @@ GENSOR_SRC = $(SHARE_SRC)/native/sun/nio/ch/genSocketOptionRegistry.c
GENSOR_EXE = $(TEMPDIR)/genSocketOptionRegistry$(EXE_SUFFIX) GENSOR_EXE = $(TEMPDIR)/genSocketOptionRegistry$(EXE_SUFFIX)
SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSOR_SRC) | \ SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSOR_SRC) | \
$(NAWK) '/^.*Copyright.*Sun/ { print $$3 }') $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
$(TEMPDIR)/$(GENSOR_SRC) : $(GENSOR_SRC) $(TEMPDIR)/$(GENSOR_SRC) : $(GENSOR_SRC)
$(install-non-module-file) $(install-non-module-file)
...@@ -830,7 +830,7 @@ $(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC) ...@@ -830,7 +830,7 @@ $(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
$(SCH_GEN)/SocketOptionRegistry.java: $(GENSOR_EXE) $(SCH_GEN)/SocketOptionRegistry.java: $(GENSOR_EXE)
$(prep-target) $(prep-target)
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh $(SOR_COPYRIGHT_YEARS) > $@ NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@
$(GENSOR_EXE) >> $@ $(GENSOR_EXE) >> $@
# #
...@@ -852,7 +852,7 @@ GENUC_SRC = $(PLATFORM_SRC)/native/sun/nio/fs/genUnixConstants.c ...@@ -852,7 +852,7 @@ GENUC_SRC = $(PLATFORM_SRC)/native/sun/nio/fs/genUnixConstants.c
GENUC_EXE = $(TEMPDIR)/genUnixConstants GENUC_EXE = $(TEMPDIR)/genUnixConstants
GENUC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENUC_SRC) | \ GENUC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENUC_SRC) | \
$(NAWK) '/^.*Copyright.*Sun/ { print $$3 }') $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
$(GENUC_EXE) : $(GENUC_SRC) $(GENUC_EXE) : $(GENUC_SRC)
$(prep-target) $(prep-target)
...@@ -860,7 +860,7 @@ $(GENUC_EXE) : $(GENUC_SRC) ...@@ -860,7 +860,7 @@ $(GENUC_EXE) : $(GENUC_SRC)
$(SFS_GEN)/UnixConstants.java: $(GENUC_EXE) $(SFS_GEN)/UnixConstants.java: $(GENUC_EXE)
$(prep-target) $(prep-target)
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh $(GENUC_COPYRIGHT_YEARS) > $@ NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(GENUC_COPYRIGHT_YEARS)" > $@
$(GENUC_EXE) >> $@ $(GENUC_EXE) >> $@
GENSC_SRC = $(PLATFORM_SRC)/native/sun/nio/fs/genSolarisConstants.c GENSC_SRC = $(PLATFORM_SRC)/native/sun/nio/fs/genSolarisConstants.c
...@@ -868,7 +868,7 @@ GENSC_SRC = $(PLATFORM_SRC)/native/sun/nio/fs/genSolarisConstants.c ...@@ -868,7 +868,7 @@ GENSC_SRC = $(PLATFORM_SRC)/native/sun/nio/fs/genSolarisConstants.c
GENSC_EXE = $(TEMPDIR)/genSolarisConstants GENSC_EXE = $(TEMPDIR)/genSolarisConstants
GENSC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSC_SRC) | \ GENSC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSC_SRC) | \
$(NAWK) '/^.*Copyright.*Sun/ { print $$3 }') $(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
$(GENSC_EXE) : $(GENSC_SRC) $(GENSC_EXE) : $(GENSC_SRC)
$(prep-target) $(prep-target)
...@@ -876,7 +876,7 @@ $(GENSC_EXE) : $(GENSC_SRC) ...@@ -876,7 +876,7 @@ $(GENSC_EXE) : $(GENSC_SRC)
$(SFS_GEN)/SolarisConstants.java: $(GENSC_EXE) $(SFS_GEN)/SolarisConstants.java: $(GENSC_EXE)
$(prep-target) $(prep-target)
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh $(GENSC_COPYRIGHT_YEARS) > $@ NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(GENSC_COPYRIGHT_YEARS)" > $@
$(GENSC_EXE) >> $@ $(GENSC_EXE) >> $@
.PHONY: sources .PHONY: sources
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
# a java comment block. If this script is invoked with a copyright # a java comment block. If this script is invoked with a copyright
# year/year range, the java comment block will contain a Sun copyright. # year/year range, the java comment block will contain a Sun copyright.
COPYRIGHT_YEARS=$1 COPYRIGHT_YEARS="$1"
cat <<__END__ cat <<__END__
/* /*
...@@ -36,10 +36,10 @@ __END__ ...@@ -36,10 +36,10 @@ __END__
if [ "x$COPYRIGHT_YEARS" != x ]; then if [ "x$COPYRIGHT_YEARS" != x ]; then
cat <<__END__ cat <<__END__
* Copyright $COPYRIGHT_YEARS Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) $COPYRIGHT_YEARS Oracle and/or its affiliates. All rights reserved.
__END__ __END__
fi fi
$NAWK ' /^#.*Copyright.*Sun/ { next } $NAWK ' /^#.*Copyright.*Oracle/ { next }
/^#([^!]|$)/ { sub(/^#/, " *"); print } /^#([^!]|$)/ { sub(/^#/, " *"); print }
/^$/ { print " */"; exit } ' $0 /^$/ { print " */"; exit } ' $0
...@@ -36,7 +36,7 @@ SPEC=$1; shift ...@@ -36,7 +36,7 @@ SPEC=$1; shift
DST=$1; shift DST=$1; shift
eval `$NAWK <$SPEC ' eval `$NAWK <$SPEC '
/^[ \t]*copyright / { printf "COPYRIGHT_YEARS=%s\n", $2; } /^[ \t]*copyright / { printf "COPYRIGHT_YEARS=\"%s %s\"\n", $2, $3; }
/^[ \t]*package / { printf "PKG=%s\n", $2; } /^[ \t]*package / { printf "PKG=%s\n", $2; }
/^[ \t]*class / { printf "CLASS=%s\n", $2; } /^[ \t]*class / { printf "CLASS=%s\n", $2; }
'` '`
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
MISC_FILES = \ MISC_FILES = \
$(CLASSBINDIR)/javax/swing/text/html/default.css \ $(CLASSBINDIR)/javax/swing/text/html/default.css \
$(CLASSBINDIR)/javax/swing/text/html/parser/html32.bdtd \
$(CLASSBINDIR)/javax/swing/text/rtf/charsets/NeXT.txt \ $(CLASSBINDIR)/javax/swing/text/rtf/charsets/NeXT.txt \
$(CLASSBINDIR)/javax/swing/text/rtf/charsets/ansi.txt \ $(CLASSBINDIR)/javax/swing/text/rtf/charsets/ansi.txt \
$(CLASSBINDIR)/javax/swing/text/rtf/charsets/cpg437.txt \ $(CLASSBINDIR)/javax/swing/text/rtf/charsets/cpg437.txt \
......
...@@ -59,9 +59,6 @@ $(CLASSBINDIR)/%.gif: $(SHARE_SRC)/classes/%.gif ...@@ -59,9 +59,6 @@ $(CLASSBINDIR)/%.gif: $(SHARE_SRC)/classes/%.gif
$(CLASSBINDIR)/%.css: $(SHARE_SRC)/classes/%.css $(CLASSBINDIR)/%.css: $(SHARE_SRC)/classes/%.css
$(install-file) $(install-file)
$(CLASSBINDIR)/%.bdtd: $(SHARE_SRC)/classes/%.bdtd
$(install-file)
$(CLASSBINDIR)/%.txt: $(SHARE_SRC)/classes/%.txt $(CLASSBINDIR)/%.txt: $(SHARE_SRC)/classes/%.txt
$(install-file) $(install-file)
...@@ -174,7 +174,7 @@ else ...@@ -174,7 +174,7 @@ else
# Check CYGWIN (should have already been done) # Check CYGWIN (should have already been done)
# Assumption here is that you are in a shell window via cygwin. # Assumption here is that you are in a shell window via cygwin.
proc_arch=`echo "$(PROCESSOR_IDENTIFIER)" | expand | cut -d' ' -f1 | sed -e 's@x86@X86@g' -e 's@Intel64@X64@g' -e 's@em64t@X64@g' -e 's@EM64T@X64@g' -e 's@amd64@X64@g' -e 's@AMD64@X64@g' -e 's@ia64@IA64@g'` proc_arch=`echo "${PROCESSOR_IDENTIFIER}" | expand | cut -d' ' -f1 | sed -e 's@x86@X86@g' -e 's@Intel64@X64@g' -e 's@em64t@X64@g' -e 's@EM64T@X64@g' -e 's@amd64@X64@g' -e 's@AMD64@X64@g' -e 's@ia64@IA64@g'`
if [ "${proc_arch}" = "X64" ] ; then if [ "${proc_arch}" = "X64" ] ; then
windows_arch=amd64 windows_arch=amd64
else else
......
...@@ -204,8 +204,8 @@ Provided NetBeans projects ...@@ -204,8 +204,8 @@ Provided NetBeans projects
note that pretty much regardless of your hardware, this *will* take note that pretty much regardless of your hardware, this *will* take
a long time, and use *lots* of disk space (more than 3GB). The a long time, and use *lots* of disk space (more than 3GB). The
results of the build are in results of the build are in
*install-dir*/control/build/*platform*-*arch* and *install-dir*/build/*platform*-*arch* and
*install-dir*/control/build/*platform*-*arch*-fastdebug. *install-dir*/build/*platform*-*arch*-fastdebug.
Consult the project's README file for details. Consult the project's README file for details.
......
...@@ -10,6 +10,6 @@ project code, you might prefer to build it from the command line using ant. ...@@ -10,6 +10,6 @@ project code, you might prefer to build it from the command line using ant.
Please note: the results of building this project are *not* put in the place Please note: the results of building this project are *not* put in the place
used by other projects. In this case, the results are place in used by other projects. In this case, the results are place in
<install-dir>/control/build/<platform>-<arch> <install-dir>/build/<platform>-<arch>
and and
<install-dir>/control/build/<platform>-<arch>-fastdebug <install-dir>/build/<platform>-<arch>-fastdebug
...@@ -34,11 +34,11 @@ ...@@ -34,11 +34,11 @@
<import file="../common/shared.xml"/> <import file="../common/shared.xml"/>
<target name="-build-make" depends="-make.init" if="use.make"> <target name="-build-make" depends="-make.init" if="use.make">
<make-run target="dev" dir="${root}/../control/make" opts="SKIP_COMPARE_IMAGES=true"/> <make-run target="dev" dir="${root}/.." opts="SKIP_COMPARE_IMAGES=true"/>
</target> </target>
<target name="-clean-make" depends="-make.init" if="use.make"> <target name="-clean-make" depends="-make.init" if="use.make">
<make-run target="clean" dir="${root}/../control/make"/> <make-run target="clean" dir="${root}/.."/>
</target> </target>
</project> </project>
...@@ -312,6 +312,7 @@ SUNWprivate_1.1 { ...@@ -312,6 +312,7 @@ SUNWprivate_1.1 {
Java_sun_awt_X11GraphicsEnvironment_initGLX; Java_sun_awt_X11GraphicsEnvironment_initGLX;
Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama; Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama;
Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint; Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint;
Java_sun_awt_X11GraphicsEnvironment_initXRender;
#Java_sun_awt_motif_MEmbedCanvasPeer_initXEmbedServer; #Java_sun_awt_motif_MEmbedCanvasPeer_initXEmbedServer;
#Java_sun_awt_motif_MEmbedCanvasPeer_destroyXEmbedServer; #Java_sun_awt_motif_MEmbedCanvasPeer_destroyXEmbedServer;
#Java_sun_awt_motif_MEmbedCanvasPeer_isXEmbedActive; #Java_sun_awt_motif_MEmbedCanvasPeer_isXEmbedActive;
...@@ -406,18 +407,53 @@ SUNWprivate_1.1 { ...@@ -406,18 +407,53 @@ SUNWprivate_1.1 {
Java_sun_java2d_x11_X11SurfaceData_initIDs; Java_sun_java2d_x11_X11SurfaceData_initIDs;
Java_sun_java2d_x11_X11SurfaceData_initOps; Java_sun_java2d_x11_X11SurfaceData_initOps;
Java_sun_java2d_x11_X11SurfaceData_initSurface; Java_sun_java2d_x11_X11SurfaceData_initSurface;
Java_sun_java2d_x11_X11SurfaceData_isDrawableValid;
Java_sun_java2d_x11_X11SurfaceData_isDgaAvailable; Java_sun_java2d_x11_X11SurfaceData_isDgaAvailable;
Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable; Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable;
Java_sun_java2d_x11_X11SurfaceData_setInvalid;
Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface;
Java_sun_java2d_x11_X11SurfaceData_XCreateGC;
Java_sun_java2d_x11_X11SurfaceData_XResetClip;
Java_sun_java2d_x11_X11SurfaceData_XSetClip;
Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode; Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode;
Java_sun_java2d_x11_X11SurfaceData_XSetXorMode; Java_sun_java2d_x11_X11SurfaceData_XSetXorMode;
Java_sun_java2d_x11_X11SurfaceData_XSetForeground; Java_sun_java2d_x11_X11SurfaceData_XSetForeground;
Java_sun_java2d_x11_X11SurfaceData_XSetGraphicsExposures;
Java_sun_java2d_x11_XSurfaceData_initOps;
Java_sun_java2d_x11_XSurfaceData_XCreateGC;
Java_sun_java2d_x11_XSurfaceData_XResetClip;
Java_sun_java2d_x11_XSurfaceData_XSetClip;
Java_sun_java2d_x11_XSurfaceData_flushNativeSurface;
Java_sun_java2d_x11_XSurfaceData_isDrawableValid;
Java_sun_java2d_x11_XSurfaceData_setInvalid;
Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures;
Java_sun_java2d_xr_XRSurfaceData_initXRPicture;
Java_sun_java2d_xr_XRSurfaceData_initIDs;
Java_sun_java2d_xr_XRSurfaceData_XRInitSurface;
Java_sun_java2d_xr_XRBackendNative_initIDs;
Java_sun_java2d_xr_XIDGenerator_bufferXIDs;
Java_sun_java2d_xr_XRBackendNative_freeGC;
Java_sun_java2d_xr_XRBackendNative_createGC;
Java_sun_java2d_xr_XRBackendNative_createPixmap;
Java_sun_java2d_xr_XRBackendNative_createPictureNative;
Java_sun_java2d_xr_XRBackendNative_freePicture;
Java_sun_java2d_xr_XRBackendNative_freePixmap;
Java_sun_java2d_xr_XRBackendNative_setPictureRepeat;
Java_sun_java2d_xr_XRBackendNative_setGCExposures;
Java_sun_java2d_xr_XRBackendNative_setGCForeground;
Java_sun_java2d_xr_XRBackendNative_copyArea;
Java_sun_java2d_xr_XRBackendNative_renderComposite;
Java_sun_java2d_xr_XRBackendNative_renderRectangle;
Java_sun_java2d_xr_XRBackendNative_XRenderRectanglesNative;
Java_sun_java2d_xr_XRBackendNative_XRSetTransformNative;
Java_sun_java2d_xr_XRBackendNative_XRCreateLinearGradientPaintNative;
Java_sun_java2d_xr_XRBackendNative_XRCreateRadialGradientPaintNative;
Java_sun_java2d_xr_XRBackendNative_setFilter;
Java_sun_java2d_xr_XRBackendNative_XRSetClipNative;
Java_sun_java2d_xr_XRBackendNative_putMaskNative;
Java_sun_java2d_xr_XRBackendNative_XRAddGlyphsNative;
Java_sun_java2d_xr_XRBackendNative_XRFreeGlyphsNative;
Java_sun_java2d_xr_XRBackendNative_XRenderCreateGlyphSetNative;
Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative;
Java_sun_java2d_xr_XRBackendNative_setGCMode;
Java_sun_java2d_xr_XRBackendNative_GCRectanglesNative;
Java_sun_java2d_xr_XRUtils_initFormatPtrs;
Java_sun_java2d_xr_XRBackendNative_renderCompositeTrapezoidsNative;
XRT_DrawGlyphList;
Java_sun_java2d_opengl_OGLContext_getOGLIdString; Java_sun_java2d_opengl_OGLContext_getOGLIdString;
Java_sun_java2d_opengl_OGLMaskFill_maskFill; Java_sun_java2d_opengl_OGLMaskFill_maskFill;
......
...@@ -425,6 +425,7 @@ SUNWprivate_1.1 { ...@@ -425,6 +425,7 @@ SUNWprivate_1.1 {
Java_sun_awt_X11GraphicsEnvironment_initDisplay; Java_sun_awt_X11GraphicsEnvironment_initDisplay;
Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama; Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama;
Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint; Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint;
Java_sun_awt_X11GraphicsEnvironment_initXRender;
......
...@@ -46,17 +46,20 @@ SUNWprivate_1.1 { ...@@ -46,17 +46,20 @@ SUNWprivate_1.1 {
Java_sun_java2d_x11_X11Renderer_XFillRoundRect; Java_sun_java2d_x11_X11Renderer_XFillRoundRect;
Java_sun_java2d_x11_X11Renderer_devCopyArea; Java_sun_java2d_x11_X11Renderer_devCopyArea;
Java_sun_java2d_x11_X11SurfaceData_initIDs; Java_sun_java2d_x11_X11SurfaceData_initIDs;
Java_sun_java2d_x11_X11SurfaceData_initOps;
Java_sun_java2d_x11_X11SurfaceData_isDrawableValid;
Java_sun_java2d_x11_X11SurfaceData_initSurface; Java_sun_java2d_x11_X11SurfaceData_initSurface;
Java_sun_java2d_x11_X11SurfaceData_setInvalid;
Java_sun_java2d_x11_X11SurfaceData_XCreateGC;
Java_sun_java2d_x11_X11SurfaceData_XResetClip;
Java_sun_java2d_x11_X11SurfaceData_XSetClip;
Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode; Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode;
Java_sun_java2d_x11_X11SurfaceData_XSetXorMode; Java_sun_java2d_x11_X11SurfaceData_XSetXorMode;
Java_sun_java2d_x11_X11SurfaceData_XSetForeground; Java_sun_java2d_x11_X11SurfaceData_XSetForeground;
Java_sun_java2d_x11_XSurfaceData_initOps;
Java_sun_java2d_x11_XSurfaceData_XCreateGC;
Java_sun_java2d_x11_XSurfaceData_XResetClip;
Java_sun_java2d_x11_XSurfaceData_XSetClip;
Java_sun_java2d_x11_XSurfaceData_flushNativeSurface;
Java_sun_java2d_x11_XSurfaceData_isDrawableValid;
Java_sun_java2d_x11_XSurfaceData_setInvalid;
Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures;
X11SurfaceData_GetOps; X11SurfaceData_GetOps;
Java_java_awt_Font_initIDs; Java_java_awt_Font_initIDs;
Java_sun_font_FontConfigManager_getFontConfig; Java_sun_font_FontConfigManager_getFontConfig;
......
...@@ -113,7 +113,7 @@ CPPFLAGS += -I$(OPENWIN_HOME)/include \ ...@@ -113,7 +113,7 @@ CPPFLAGS += -I$(OPENWIN_HOME)/include \
# Libraries to link in. # Libraries to link in.
# #
ifeq ($(PLATFORM), solaris) ifeq ($(PLATFORM), solaris)
OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -L$(OPENWIN_LIB) -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -L$(OPENWIN_LIB) -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt -L/usr/openwin/sfw/lib$(ISA_DIR) -lXrender
endif # PLATFORM endif # PLATFORM
ifeq ($(PLATFORM), linux) ifeq ($(PLATFORM), linux)
......
...@@ -80,4 +80,6 @@ FILES_c = \ ...@@ -80,4 +80,6 @@ FILES_c = \
swing_GTKEngine.c \ swing_GTKEngine.c \
swing_GTKStyle.c \ swing_GTKStyle.c \
rect.c \ rect.c \
sun_awt_X11_GtkFileDialogPeer.c sun_awt_X11_GtkFileDialogPeer.c \
XRSurfaceData.c \
XRBackendNative.c
...@@ -49,6 +49,11 @@ AUTO_JAVA_PRUNE = WrapperGenerator.java ...@@ -49,6 +49,11 @@ AUTO_JAVA_PRUNE = WrapperGenerator.java
LDFLAGS += -L$(OPENWIN_LIB) LDFLAGS += -L$(OPENWIN_LIB)
# For Xrender extension.
ifeq ($(PLATFORM), solaris)
LDFLAGS += -L/usr/openwin/sfw/lib$(ISA_DIR) -R/usr/openwin/sfw/lib$(ISA_DIR)
endif
ifeq ($(PLATFORM), linux) ifeq ($(PLATFORM), linux)
LDFLAGS += -lpthread LDFLAGS += -lpthread
dummy := $(shell $(MKDIR) -p $(LIB_LOCATION)) dummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
...@@ -88,7 +93,7 @@ vpath %.c $(SHARE_SRC)/native/sun/java2d/opengl ...@@ -88,7 +93,7 @@ vpath %.c $(SHARE_SRC)/native/sun/java2d/opengl
vpath %.c $(PLATFORM_SRC)/native/sun/java2d/opengl vpath %.c $(PLATFORM_SRC)/native/sun/java2d/opengl
vpath %.c $(PLATFORM_SRC)/native/sun/java2d/x11 vpath %.c $(PLATFORM_SRC)/native/sun/java2d/x11
OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -ldl \ OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -lXrender -ldl \
$(LDFLAGS_COMMON) $(AWT_RUNPATH) $(OTHER_LDFLAGS) -lXtst -lXi $(LDFLAGS_COMMON) $(AWT_RUNPATH) $(OTHER_LDFLAGS) -lXtst -lXi
ifeq ($(PLATFORM), solaris) ifeq ($(PLATFORM), solaris)
...@@ -122,7 +127,7 @@ CPPFLAGS += -DXAWT -DXAWT_HACK \ ...@@ -122,7 +127,7 @@ CPPFLAGS += -DXAWT -DXAWT_HACK \
-I$(PLATFORM_SRC)/native/sun/awt/medialib \ -I$(PLATFORM_SRC)/native/sun/awt/medialib \
-I$(PLATFORM_SRC)/native/sun/font \ -I$(PLATFORM_SRC)/native/sun/font \
-I$(SHARE_SRC)/native/sun/awt \ -I$(SHARE_SRC)/native/sun/awt \
-I$(PLATFORM_SRC)/native/sun/awt -I$(PLATFORM_SRC)/native/sun/awt
ifeq ($(PLATFORM), linux) ifeq ($(PLATFORM), linux)
# Allows for builds on Debian GNU Linux, X11 is in a different place # Allows for builds on Debian GNU Linux, X11 is in a different place
......
...@@ -192,6 +192,7 @@ SUNWprivate_1.1 { ...@@ -192,6 +192,7 @@ SUNWprivate_1.1 {
Java_sun_font_X11FontManager_setNativeFontPath; Java_sun_font_X11FontManager_setNativeFontPath;
Java_sun_awt_X11GraphicsEnvironment_initDisplay; Java_sun_awt_X11GraphicsEnvironment_initDisplay;
Java_sun_awt_X11GraphicsEnvironment_initGLX; Java_sun_awt_X11GraphicsEnvironment_initGLX;
Java_sun_awt_X11GraphicsEnvironment_initXRender;
Java_sun_awt_X11GraphicsEnvironment_checkShmExt; Java_sun_awt_X11GraphicsEnvironment_checkShmExt;
Java_sun_awt_X11GraphicsEnvironment_getNumScreens; Java_sun_awt_X11GraphicsEnvironment_getNumScreens;
Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum; Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum;
...@@ -355,21 +356,52 @@ SUNWprivate_1.1 { ...@@ -355,21 +356,52 @@ SUNWprivate_1.1 {
Java_sun_java2d_x11_X11Renderer_XFillRect; Java_sun_java2d_x11_X11Renderer_XFillRect;
Java_sun_java2d_x11_X11Renderer_XFillRoundRect; Java_sun_java2d_x11_X11Renderer_XFillRoundRect;
Java_sun_java2d_x11_X11Renderer_devCopyArea; Java_sun_java2d_x11_X11Renderer_devCopyArea;
Java_sun_java2d_x11_X11SurfaceData_setInvalid;
Java_sun_java2d_x11_X11SurfaceData_initIDs; Java_sun_java2d_x11_X11SurfaceData_initIDs;
Java_sun_java2d_x11_X11SurfaceData_isDrawableValid;
Java_sun_java2d_x11_X11SurfaceData_isDgaAvailable; Java_sun_java2d_x11_X11SurfaceData_isDgaAvailable;
Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable; Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable;
Java_sun_java2d_x11_X11SurfaceData_initOps;
Java_sun_java2d_x11_X11SurfaceData_initSurface; Java_sun_java2d_x11_X11SurfaceData_initSurface;
Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface;
Java_sun_java2d_x11_X11SurfaceData_XCreateGC;
Java_sun_java2d_x11_X11SurfaceData_XResetClip;
Java_sun_java2d_x11_X11SurfaceData_XSetClip;
Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode; Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode;
Java_sun_java2d_x11_X11SurfaceData_XSetXorMode; Java_sun_java2d_x11_X11SurfaceData_XSetXorMode;
Java_sun_java2d_x11_X11SurfaceData_XSetForeground; Java_sun_java2d_x11_X11SurfaceData_XSetForeground;
Java_sun_java2d_x11_X11SurfaceData_XSetGraphicsExposures;
Java_sun_java2d_x11_XSurfaceData_initOps;
Java_sun_java2d_x11_XSurfaceData_XCreateGC;
Java_sun_java2d_x11_XSurfaceData_XResetClip;
Java_sun_java2d_x11_XSurfaceData_XSetClip;
Java_sun_java2d_x11_XSurfaceData_flushNativeSurface;
Java_sun_java2d_x11_XSurfaceData_isDrawableValid;
Java_sun_java2d_x11_XSurfaceData_setInvalid;
Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures;
Java_sun_java2d_xr_XRSurfaceData_initXRPicture;
Java_sun_java2d_xr_XRSurfaceData_initIDs;
Java_sun_java2d_xr_XRSurfaceData_XRInitSurface;
Java_sun_java2d_xr_XRBackendNative_initIDs;
Java_sun_java2d_xr_XRBackendNative_freeGC;
Java_sun_java2d_xr_XRBackendNative_createGC;
Java_sun_java2d_xr_XRBackendNative_createPixmap;
Java_sun_java2d_xr_XRBackendNative_createPictureNative;
Java_sun_java2d_xr_XRBackendNative_freePicture;
Java_sun_java2d_xr_XRBackendNative_freePixmap;
Java_sun_java2d_xr_XRBackendNative_setPictureRepeat;
Java_sun_java2d_xr_XRBackendNative_setGCExposures;
Java_sun_java2d_xr_XRBackendNative_setGCForeground;
Java_sun_java2d_xr_XRBackendNative_copyArea;
Java_sun_java2d_xr_XRBackendNative_renderComposite;
Java_sun_java2d_xr_XRBackendNative_renderRectangle;
Java_sun_java2d_xr_XRBackendNative_XRenderRectanglesNative;
Java_sun_java2d_xr_XRBackendNative_XRSetTransformNative;
Java_sun_java2d_xr_XRBackendNative_XRCreateLinearGradientPaintNative;
Java_sun_java2d_xr_XRBackendNative_XRCreateRadialGradientPaintNative;
Java_sun_java2d_xr_XRBackendNative_setFilter;
Java_sun_java2d_xr_XRBackendNative_XRSetClipNative;
Java_sun_java2d_xr_XRBackendNative_putMaskNative;
Java_sun_java2d_xr_XRBackendNative_XRAddGlyphsNative;
Java_sun_java2d_xr_XRBackendNative_XRFreeGlyphsNative;
Java_sun_java2d_xr_XRBackendNative_XRenderCreateGlyphSetNative;
Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative;
Java_sun_java2d_xr_XRBackendNative_setGCMode;
Java_sun_java2d_xr_XRBackendNative_GCRectanglesNative;
Java_sun_java2d_xr_XRBackendNative_renderCompositeTrapezoidsNative;
Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1arrow; Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1arrow;
Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1box; Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1box;
...@@ -397,8 +429,8 @@ SUNWprivate_1.1 { ...@@ -397,8 +429,8 @@ SUNWprivate_1.1 {
Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetClassValue; Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetClassValue;
Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetPangoFontName; Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetPangoFontName;
Java_sun_awt_X11_GtkFileDialogPeer_run; Java_sun_awt_X11_GtkFileDialogPeer_run;
Java_sun_awt_X11_GtkFileDialogPeer_quit; Java_sun_awt_X11_GtkFileDialogPeer_quit;
Java_sun_print_CUPSPrinter_initIDs; Java_sun_print_CUPSPrinter_initIDs;
Java_sun_print_CUPSPrinter_getCupsServer; Java_sun_print_CUPSPrinter_getCupsServer;
......
Manifest-Version: 1.0 Manifest-Version: 1.0
Specification-Title: Java Platform API Specification Specification-Title: Java Platform API Specification
Specification-Version: 1.6 Specification-Version: 1.6
Specification-Vendor: Sun Microsystems, Inc. Specification-Vendor: Oracle
Implementation-Title: Java Runtime Environment Implementation-Title: Java Runtime Environment
Implementation-Version: @@RELEASE@@ Implementation-Version: @@RELEASE@@
Implementation-Vendor: Sun Microsystems, Inc. Implementation-Vendor: @@COMPANY_NAME@@
...@@ -2259,7 +2259,6 @@ com/sun/java/swing/plaf/gtk/GTKLookAndFeel$1FontLazyValue ...@@ -2259,7 +2259,6 @@ com/sun/java/swing/plaf/gtk/GTKLookAndFeel$1FontLazyValue
com/sun/java/swing/plaf/gtk/GTKLookAndFeel$2 com/sun/java/swing/plaf/gtk/GTKLookAndFeel$2
com/sun/java/swing/plaf/gtk/GTKLookAndFeel$3 com/sun/java/swing/plaf/gtk/GTKLookAndFeel$3
javax/swing/plaf/synth/SynthPanelUI javax/swing/plaf/synth/SynthPanelUI
sun/swing/plaf/synth/SynthUI
javax/swing/plaf/synth/SynthConstants javax/swing/plaf/synth/SynthConstants
javax/swing/plaf/synth/SynthContext javax/swing/plaf/synth/SynthContext
javax/swing/plaf/synth/SynthBorder javax/swing/plaf/synth/SynthBorder
...@@ -2271,6 +2270,7 @@ javax/swing/plaf/basic/BasicBorders$FieldBorder ...@@ -2271,6 +2270,7 @@ javax/swing/plaf/basic/BasicBorders$FieldBorder
javax/swing/plaf/synth/SynthMenuBarUI javax/swing/plaf/synth/SynthMenuBarUI
javax/swing/plaf/synth/DefaultMenuLayout javax/swing/plaf/synth/DefaultMenuLayout
javax/swing/plaf/synth/SynthMenuUI javax/swing/plaf/synth/SynthMenuUI
javax/swing/plaf/synth/SynthUI
com/sun/java/swing/plaf/gtk/GTKIconFactory com/sun/java/swing/plaf/gtk/GTKIconFactory
com/sun/java/swing/plaf/gtk/GTKIconFactory$MenuArrowIcon com/sun/java/swing/plaf/gtk/GTKIconFactory$MenuArrowIcon
com/sun/java/swing/plaf/gtk/GTKIconFactory$DelegatingIcon com/sun/java/swing/plaf/gtk/GTKIconFactory$DelegatingIcon
......
...@@ -2360,7 +2360,6 @@ com/sun/java/swing/plaf/gtk/GTKLookAndFeel$1FontLazyValue ...@@ -2360,7 +2360,6 @@ com/sun/java/swing/plaf/gtk/GTKLookAndFeel$1FontLazyValue
com/sun/java/swing/plaf/gtk/GTKLookAndFeel$2 com/sun/java/swing/plaf/gtk/GTKLookAndFeel$2
com/sun/java/swing/plaf/gtk/GTKLookAndFeel$3 com/sun/java/swing/plaf/gtk/GTKLookAndFeel$3
javax/swing/plaf/synth/SynthPanelUI javax/swing/plaf/synth/SynthPanelUI
sun/swing/plaf/synth/SynthUI
javax/swing/plaf/synth/SynthConstants javax/swing/plaf/synth/SynthConstants
javax/swing/plaf/synth/SynthContext javax/swing/plaf/synth/SynthContext
javax/swing/plaf/synth/SynthBorder javax/swing/plaf/synth/SynthBorder
...@@ -2373,6 +2372,7 @@ javax/swing/plaf/basic/BasicBorders$FieldBorder ...@@ -2373,6 +2372,7 @@ javax/swing/plaf/basic/BasicBorders$FieldBorder
javax/swing/plaf/synth/SynthMenuBarUI javax/swing/plaf/synth/SynthMenuBarUI
javax/swing/plaf/synth/DefaultMenuLayout javax/swing/plaf/synth/DefaultMenuLayout
javax/swing/plaf/synth/SynthMenuUI javax/swing/plaf/synth/SynthMenuUI
javax/swing/plaf/synth/SynthUI
com/sun/java/swing/plaf/gtk/GTKIconFactory com/sun/java/swing/plaf/gtk/GTKIconFactory
com/sun/java/swing/plaf/gtk/GTKIconFactory$MenuArrowIcon com/sun/java/swing/plaf/gtk/GTKIconFactory$MenuArrowIcon
com/sun/java/swing/plaf/gtk/GTKIconFactory$DelegatingIcon com/sun/java/swing/plaf/gtk/GTKIconFactory$DelegatingIcon
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
* combine with an argument list of files and directories, and * combine with an argument list of files and directories, and
* write a list of items to be included in a jar file. * write a list of items to be included in a jar file.
*/ */
package build.tools.jarreorder; package build.tools.jarreorder;
import java.io.BufferedReader; import java.io.BufferedReader;
...@@ -36,74 +35,68 @@ import java.io.File; ...@@ -36,74 +35,68 @@ import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileReader; import java.io.FileReader;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Vector;
import java.io.PrintStream; import java.io.PrintStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
public class JarReorder { public class JarReorder {
// To deal with output // To deal with output
private static PrintStream out; private PrintStream out;
private final static boolean useTopDir = false;
private static void usage() { private void usage() {
String help; String help;
help = help =
"Usage: jar JarReorder [-o <outputfile>] <order_list> <exclude_list> <file> ...\n" "Usage: jar JarReorder [-o <outputfile>] <order_list> <exclude_list> <file> ...\n"
+ " order_list is a file containing names of files to load\n" + " order_list is a file containing names of files to load\n"
+ " in order at the end of a jar file.\n" + " in order at the end of a jar file unless\n"
+ " exclude_list is a file containing names of files/directories\n" + " excluded in the exclude list.\n"
+ " NOT to be included in a jar file.\n"; + " exclude_list is a file containing names of files/directories\n"
if (useTopDir) + " NOT to be included in a jar file.\n"
help += + "\n"
" top_dir is the top of the directory structure to be searched;\n" + "The order_list or exclude_list may be replaced by a \"-\" if no\n"
+ " the contents of the lists and remaining arguments are\n" + "data is to be provided.\n"
+ " relative to this.\n"; + "\n"
help += + " The remaining arguments are files or directories to be included\n"
"\n" + " in a jar file, from which will be excluded those entries which\n"
+ "The order_list or exclude_list may be replaced by a \"_\" if no\n" + " appear in the exclude list.\n";
+ "data is to be provided.\n"
+ "\n"
+ " The remaining arguments are files or directories to be included\n"
+ " in a jar file, from which will be excluded thse entries which\n"
+ " appear in the exclude list.\n";
System.err.println(help); System.err.println(help);
System.exit(1);
} }
/* /*
* Create a list of files to be included in a jar file, such that the * Create the file list to be included in a jar file, such that the
* some the files will appear in a specific order, and allowing certain * list will appear in a specific order, and allowing certain
* files and directories to be excluded. * files and directories to be excluded.
* *
* Command line arguments are * Command path arguments are
* - optional -o outputfile * - optional -o outputfile
* - name of a file containing a list of files to be included in a jar file. * - name of a file containing a set of files to be included in a jar file.
* - name of a file containing a list of files (or directories) to be * - name of a file containing a set of files (or directories) to be
* excluded from the jar file. * excluded from the jar file.
* - names of files or directories to be searched for files to include * - names of files or directories to be searched for files to include
* in the jar file. * in the jar file.
*/ */
public static void main(String[] args) { public static void main(String[] args) {
JarReorder jr = new JarReorder();
jr.run(args);
}
private void run(String args[]) {
HashMap filesExcluded = new HashMap();
Vector filesIncluded = new Vector();
int fileArgs;
String topDirName = "";
int arglen = args.length; int arglen = args.length;
int argpos = 0; int argpos = 0;
// Look for "-o outputfilename" option // Look for "-o outputfilename" option
if ( arglen > 0 ) { if (arglen > 0) {
if ( arglen >= 2 && args[0].equals("-o") ) { if (arglen >= 2 && args[0].equals("-o")) {
try { try {
out = new PrintStream(new FileOutputStream(args[1])); out = new PrintStream(new FileOutputStream(args[1]));
} catch ( FileNotFoundException e ) { } catch (FileNotFoundException e) {
System.err.println("Error: " + e.getMessage()); System.err.println("Error: " + e.getMessage());
e.printStackTrace(System.err); e.printStackTrace(System.err);
System.exit(1); System.exit(1);
...@@ -118,128 +111,111 @@ public class JarReorder { ...@@ -118,128 +111,111 @@ public class JarReorder {
out = System.out; out = System.out;
} }
fileArgs = useTopDir ? 3 : 2; // Should be 2 or more args left
if (arglen <= 2) {
if (arglen <= fileArgs) {
usage(); usage();
System.exit(1);
} }
// Read the ordered list of files to be included in rt.jar. // Read the ordered set of files to be included in rt.jar.
// Read the list of files/directories to be excluded from rt.jar. // Read the set of files/directories to be excluded from rt.jar.
String classListFile = args[argpos];
String excludeListFile = args[argpos + 1];
argpos += 2;
arglen -= 2;
Vector orderList = readListFromFile(args[argpos], true); // Create 2 lists and a set of processed files
Vector excludeList = readListFromFile(args[argpos+1], false); List<String> orderList = readListFromFile(classListFile, true);
if (useTopDir) { List<String> excludeList = readListFromFile(excludeListFile, false);
topDirName = args[argpos+2]; Set<String> processed = new HashSet<String>();
if (!topDirName.endsWith(File.separator))
topDirName = topDirName + File.separator;
}
// Copy these lists into filesExcluded so that these files will be excluded // Create set of all files and directories excluded, then expand
// from the file list. (The orderList files will be appended later.) // that list completely
Set<String> excludeSet = new HashSet<String>(excludeList);
Set<String> allFilesExcluded = expand(null, excludeSet, processed);
for (int i = 0; i < orderList.size(); ++i) { // Indicate all these have been processed, orderList too, kept to end.
String s = (String) orderList.elementAt(i); processed.addAll(orderList);
filesExcluded.put(s, s);
}
for (int i = 0; i < excludeList.size(); ++i) {
String s = (String) excludeList.elementAt(i);
filesExcluded.put(s, s);
}
// The remaining arguments are names of files/directories to be included // The remaining arguments are names of files/directories to be included
// in the jar file. // in the jar file.
Set<String> inputSet = new HashSet<String>();
String[] files = new String[arglen - fileArgs]; for (int i = 0; i < arglen; ++i) {
for (int i = fileArgs; i < arglen; ++i) { String name = args[argpos + i];
files[i-fileArgs] = args[argpos+i]; name = cleanPath(new File(name));
filesExcluded.put(args[argpos+i], args[argpos+i]); if ( name != null && name.length() > 0 && !inputSet.contains(name) ) {
inputSet.add(name);
}
} }
// Expand file/directory list to file list excluding those // Expand file/directory input so we get a complete set (except ordered)
// read from the class list. // Should be everything not excluded and not in order list.
Set<String> allFilesIncluded = expand(null, inputSet, processed);
if (useTopDir) // Create simple sorted list so we can add ordered items at end.
expand(new File(topDirName), files, filesIncluded, filesExcluded, topDirName); List<String> allFiles = new ArrayList<String>(allFilesIncluded);
else Collections.sort(allFiles);
expand(null, files, filesIncluded, filesExcluded, null);
// Now add the ordered list to the end of the expanded list. // Now add the ordered set to the end of the list.
// Add in REVERSE ORDER, so that the first element is closest to // Add in REVERSE ORDER, so that the first element is closest to
// the end (and the index). // the end (and the index).
HashSet excludeSet = new HashSet(excludeList);
for (int i = orderList.size() - 1; i >= 0; --i) { for (int i = orderList.size() - 1; i >= 0; --i) {
String s = (String) orderList.elementAt(i); String s = orderList.get(i);
if (excludeSet.contains(s)) { if (allFilesExcluded.contains(s)) {
System.err.println("Included file " + s + " is also excluded, skipping."); System.err.println("Included order file " + s
continue; + " is also excluded, skipping.");
} else if (new File(s).exists()) {
allFiles.add(s);
} else {
System.err.println("Included order file " + s
+ " missing, skipping.");
} }
if (new File(topDirName + s).exists())
filesIncluded.addElement(s);
else
System.err.println("Included file "+s+" missing, skipping.");
} }
// Print results. // Print final results.
for (String str : allFiles) {
for (int i = 0; i < filesIncluded.size(); ++i) { out.println(str);
if (useTopDir) {
out.print("-C ");
out.print(topDirName);
out.print(" ");
}
out.println((String)filesIncluded.elementAt(i));
} }
out.flush(); out.flush();
out.close(); out.close();
} }
/* /*
* Read a file containing a list of files into a Vector. * Read a file containing a list of files and directories into a List.
*/ */
private static Vector readListFromFile(String fileName, private List<String> readListFromFile(String fileName,
boolean addClassSuffix) { boolean addClassSuffix) {
BufferedReader br = null; BufferedReader br = null;
Vector v = new Vector(2000); List<String> list = new ArrayList<String>();
// If you see "-" for the name, just assume nothing was provided.
if ("-".equals(fileName)) if ("-".equals(fileName)) {
return v; return list;
}
try { try {
br = new BufferedReader(new FileReader(fileName)); br = new BufferedReader(new FileReader(fileName));
// Read the input file a path at a time. # in column 1 is a comment.
// Read the input file a line at a time. # in column 1 is a comment.
while (true) { while (true) {
String line = null; String path = br.readLine();
line = br.readLine(); if (path == null) {
if (line == null)
break; break;
}
if (line.length() == 0 || // Look for comments
line.charAt(0) == '#') path = path.trim();
if (path.length() == 0
|| path.charAt(0) == '#') {
continue; continue;
// Convert forward or back slashes to the type expected for
// the current platform.
if (File.separatorChar == '/')
line = line.replace('\\', '/');
else
line = line.replace('/', '\\');
line = line.trim();
if (addClassSuffix) {
if (!line.endsWith(".class")) {
line = line + ".class";
}
} }
v.addElement(line); // Add trailing .class if necessary
if (addClassSuffix && !path.endsWith(".class")) {
path = path + ".class";
}
// Normalize the path
path = cleanPath(new File(path));
// Add to list
if (path != null && path.length() > 0 && !list.contains(path)) {
list.add(path);
}
} }
br.close(); br.close();
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
...@@ -249,68 +225,89 @@ public class JarReorder { ...@@ -249,68 +225,89 @@ public class JarReorder {
e.printStackTrace(); e.printStackTrace();
System.exit(2); System.exit(2);
} }
return v; return list;
} }
/* /*
* Expands list of files to process into full list of all files that * Expands inputSet (files or dirs) into full set of all files that
* can be found by recursively descending directories. * can be found by recursively descending directories.
* @param dir root directory
* @param inputSet set of files or dirs to look into
* @param processed files or dirs already processed
* @return set of files
*/ */
private static void expand(File dir, String[] files, private Set<String> expand(File dir,
Vector includedFiles, HashMap excludedFiles, Set<String> inputSet,
String topDirName) { Set<String> processed) {
if (files == null) { Set<String> includedFiles = new HashSet<String>();
return; if (inputSet.isEmpty()) {
return includedFiles;
} }
for (int i = 0; i < files.length; i++) { for (String name : inputSet) {
File f = (dir == null) ? new File(files[i]) // Depending on start location
: new File(dir, files[i]); File f = (dir == null) ? new File(name)
if (f.isFile()) { : new File(dir, name);
String filePath = f.getPath(); // Normalized path to use
String path = cleanPath(f);
if (useTopDir) { if (path != null && path.length() > 0
if (filePath.startsWith(topDirName)) && !processed.contains(path)) {
filePath = filePath.substring(topDirName.length()); if (f.isFile()) {
} // Not in the excludeList, add it to both lists
includedFiles.add(path);
if (filePath.length() >= 2 && processed.add(path);
filePath.charAt(0) == '.' && } else if (f.isDirectory()) {
filePath.charAt(1) == File.separatorChar) // Add the directory entries
filePath = filePath.substring(2); String[] dirList = f.list();
Set<String> dirInputSet = new HashSet<String>();
if (!excludedFiles.containsKey(filePath)) { for (String x : dirList) {
excludedFiles.put(filePath, filePath); dirInputSet.add(x);
includedFiles.addElement(filePath); }
} // Process all entries in this directory
} else if (f.isDirectory()) { Set<String> subList = expand(f, dirInputSet, processed);
String dirPath = f.getPath(); includedFiles.addAll(subList);
dirPath = (dirPath.endsWith(File.separator)) ? dirPath : processed.add(path);
(dirPath + File.separator);
if (useTopDir) {
if (dirPath.startsWith(topDirName))
dirPath = dirPath.substring(topDirName.length());
} }
}
}
return includedFiles;
}
if (dirPath.length() >= 2 && private String cleanPath(File f) {
dirPath.charAt(0) == '.' && String path = f.getPath();
dirPath.charAt(1) == File.separatorChar) if (f.isFile()) {
dirPath = dirPath.substring(2); path = cleanFilePath(path);
} else if (f.isDirectory()) {
if (!excludedFiles.containsKey(dirPath)) { path = cleanDirPath(path);
} else {
System.err.println("WARNING: Path does not exist as file or directory: " + path);
path = null;
}
return path;
}
// Sort the directory list so that entries in the jar file private String cleanFilePath(String path) {
// are in a repeatable order. The order itself is not particularly // Remove leading and trailing whitespace
// important. [File.list() is unpredictable.] path = path.trim();
// Make all / and \ chars one
if (File.separatorChar == '/') {
path = path.replace('\\', '/');
} else {
path = path.replace('/', '\\');
}
// Remove leading ./
if (path.startsWith("." + File.separator)) {
path = path.substring(2);
}
return path;
}
String[] dirList = f.list(); private String cleanDirPath(String path) {
Arrays.sort(dirList); path = cleanFilePath(path);
expand(f, dirList, includedFiles, excludedFiles, topDirName); // Make sure it ends with a file separator
} if (!path.endsWith(File.separator)) {
} else { path = path + File.separator;
System.err.println("Error accessing: " + f.getPath());
}
} }
return path;
} }
} }
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* (C) Copyright IBM Corp. 2000 - All Rights Reserved
*
* The original version of this source code and documentation is
* copyrighted and owned by IBM. These materials are provided
* under terms of a License Agreement between IBM and Sun.
* This technology is protected by multiple US and International
* patents. This notice and attribution to IBM may not be removed.
*
*/
package com.sun.inputmethods.internal.indicim;
import java.awt.Image;
import java.awt.im.spi.InputMethod;
import java.awt.im.spi.InputMethodDescriptor;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class DevanagariInputMethodDescriptor implements InputMethodDescriptor {
static final Locale HINDI = new Locale("hi", "IN");
public DevanagariInputMethodDescriptor() {
}
/**
* @see java.awt.im.spi.InputMethodDescriptor#getAvailableLocales
*/
public Locale[] getAvailableLocales() {
return new Locale[] { HINDI };
}
/**
* @see java.awt.im.spi.InputMethodDescriptor#hasDynamicLocaleList
*/
public boolean hasDynamicLocaleList() {
return false;
}
/**
* @see java.awt.im.spi.InputMethodDescriptor#getInputMethodDisplayName
*/
public synchronized String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage) {
try {
ResourceBundle resources = ResourceBundle.getBundle("com.sun.inputmethods.internal.indicim.resources.DisplayNames", displayLanguage);
return resources.getString("DisplayName.Devanagari");
} catch (MissingResourceException mre) {
return "Devanagari Input Method";
}
}
/**
* @see java.awt.im.spi.InputMethodDescriptor#getInputMethodIcon
*/
public Image getInputMethodIcon(Locale inputLocale) {
return null;
}
/**
* @see java.awt.im.spi.InputMethodDescriptor#createInputMethod
*/
public InputMethod createInputMethod() throws Exception {
IndicInputMethodImpl impl = new IndicInputMethodImpl(
DevanagariTables.keyboardMap,
DevanagariTables.joinWithNukta,
DevanagariTables.nuktaForm,
DevanagariTables.substitutionTable);
return new IndicInputMethod(HINDI, impl);
}
public String toString() {
return getClass().getName();
}
}
/*
* Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* (C) Copyright IBM Corp. 2000 - All Rights Reserved
*
* The original version of this source code and documentation is
* copyrighted and owned by IBM. These materials are provided
* under terms of a License Agreement between IBM and Sun.
* This technology is protected by multiple US and International
* patents. This notice and attribution to IBM may not be removed.
*
*/
package com.sun.inputmethods.internal.indicim;
class DevanagariTables {
static final char[] keyboardMap = {
/* 00 */ '\u0000',
/* 01 */ '\u0001',
/* 02 */ '\u0002',
/* 03 */ '\u0003',
/* 04 */ '\u0004',
/* 05 */ '\u0005',
/* 06 */ '\u0006',
/* 07 */ '\u0007',
/* 08 */ '\u0008',
/* 09 */ '\u0009',
/* 0A */ '\012',
/* 0B */ '\u000B',
/* 0C */ '\u000C',
/* 0D */ '\015',
/* 0E */ '\u000E',
/* 0F */ '\u000F',
/* 10 */ '\u0010',
/* 11 */ '\u0011',
/* 12 */ '\u0012',
/* 13 */ '\u0013',
/* 14 */ '\u0014',
/* 15 */ '\u0015',
/* 16 */ '\u0016',
/* 17 */ '\u0017',
/* 18 */ '\u0018',
/* 19 */ '\u0019',
/* 1A */ '\u001A',
/* 1B */ '\u001B',
/* 1C */ '\u001C',
/* 1D */ '\u001D',
/* 1E */ '\u001E',
/* 1F */ '\u001F',
/* 20 */ '\u0020',
/* 21 */ '\u090D', // '!'
/* 22 */ '\u0920', // '"'
/* 23 */ '\uFF00', // '#'
/* 24 */ '\uFF01', // '$'
/* 25 */ '\uFF02', // '%'
/* 26 */ '\uFF04', // '&'
/* 27 */ '\u091F', // '''
/* 28 */ '\u0028', // '('
/* 29 */ '\u0029', // ')'
/* 2A */ '\uFF05', // '*'
/* 2B */ '\u090B', // '+'
/* 2C */ '\u002C', // ','
/* 2D */ '\u002D', // '-'
/* 2E */ '\u002E', // '.'
/* 2F */ '\u092F', // '/'
/* 30 */ '\u0966', // '0'
/* 31 */ '\u0967', // '1'
/* 32 */ '\u0968', // '2'
/* 33 */ '\u0969', // '3'
/* 34 */ '\u096A', // '4'
/* 35 */ '\u096B', // '5'
/* 36 */ '\u096C', // '6'
/* 37 */ '\u096D', // '7'
/* 38 */ '\u096E', // '8'
/* 39 */ '\u096F', // '9'
/* 3A */ '\u091B', // ':'
/* 3B */ '\u091A', // ';'
/* 3C */ '\u0937', // '<'
/* 3D */ '\u0943', // '='
/* 3E */ '\u0964', // '>'
/* 3F */ '\u095F', // '?'
/* 40 */ '\u0945', // '@'
/* 41 */ '\u0913', // 'A'
/* 42 */ '\u0934', // 'B'
/* 43 */ '\u0923', // 'C'
/* 44 */ '\u0905', // 'D'
/* 45 */ '\u0906', // 'E'
/* 46 */ '\u0907', // 'F'
/* 47 */ '\u0909', // 'G'
/* 48 */ '\u092B', // 'H'
/* 49 */ '\u0918', // 'I'
/* 4A */ '\u0931', // 'J'
/* 4B */ '\u0916', // 'K'
/* 4C */ '\u0925', // 'L'
/* 4D */ '\u0936', // 'M'
/* 4E */ '\u0933', // 'N'
/* 4F */ '\u0927', // 'O'
/* 50 */ '\u091D', // 'P'
/* 51 */ '\u0914', // 'Q'
/* 52 */ '\u0908', // 'R'
/* 53 */ '\u090F', // 'S'
/* 54 */ '\u090A', // 'T'
/* 55 */ '\u0919', // 'U'
/* 56 */ '\u0929', // 'V'
/* 57 */ '\u0910', // 'W'
/* 58 */ '\u0901', // 'X'
/* 59 */ '\u092D', // 'Y'
/* 5A */ '\u090E', // 'Z'
/* 5B */ '\u0921', // '['
/* 5C */ '\u0949', // '\'
/* 5D */ '\u093C', // ']'
/* 5E */ '\uFF03', // '^'
/* 5F */ '\u0903', // '_'
/* 60 */ '\u094A', // '`'
/* 61 */ '\u094B', // 'a'
/* 62 */ '\u0935', // 'b'
/* 63 */ '\u092E', // 'c'
/* 64 */ '\u094D', // 'd'
/* 65 */ '\u093E', // 'e'
/* 66 */ '\u093F', // 'f'
/* 67 */ '\u0941', // 'g'
/* 68 */ '\u092A', // 'h'
/* 69 */ '\u0917', // 'i'
/* 6A */ '\u0930', // 'j'
/* 6B */ '\u0915', // 'k'
/* 6C */ '\u0924', // 'l'
/* 6D */ '\u0938', // 'm'
/* 6E */ '\u0932', // 'n'
/* 6F */ '\u0926', // 'o'
/* 70 */ '\u091C', // 'p'
/* 71 */ '\u094C', // 'q'
/* 72 */ '\u0940', // 'r'
/* 73 */ '\u0947', // 's'
/* 74 */ '\u0942', // 't'
/* 75 */ '\u0939', // 'u'
/* 76 */ '\u0928', // 'v'
/* 77 */ '\u0948', // 'w'
/* 78 */ '\u0902', // 'x'
/* 79 */ '\u092C', // 'y'
/* 7A */ '\u0946', // 'z'
/* 7B */ '\u0922', // '{'
/* 7C */ '\u0911', // '|'
/* 7D */ '\u091E', // '}'
/* 7E */ '\u0912', // '~'
/* 7F */ '\u007F' //
};
// the character substitutions for the meta characters.
static final char[] RA_SUB = {'\u094D', '\u0930'};
static final char[] RA_SUP = {'\u0930', '\u094D'};
static final char[] CONJ_JA_NYA = {'\u091C', '\u094D', '\u091E'};
static final char[] CONJ_TA_RA = {'\u0924', '\u094D', '\u0930'};
static final char[] CONJ_KA_SSA = {'\u0915', '\u094D', '\u0937'};
static final char[] CONJ_SHA_RA = {'\u0936', '\u094D', '\u0930'};
static final char[][] substitutionTable = {
RA_SUB, RA_SUP, CONJ_JA_NYA, CONJ_TA_RA, CONJ_KA_SSA, CONJ_SHA_RA
};
// The following characters followed by Nukta should be replaced
// by the corresponding character as defined in ISCII91
static final char SIGN_CANDRABINDU = '\u0901';
static final char LETTER_I = '\u0907';
static final char LETTER_II = '\u0908';
static final char LETTER_VOCALIC_R = '\u090B';
static final char LETTER_KA = '\u0915';
static final char LETTER_KHA = '\u0916';
static final char LETTER_GA = '\u0917';
static final char LETTER_JA = '\u091C';
static final char LETTER_DDA = '\u0921';
static final char LETTER_DDHA = '\u0922';
static final char LETTER_PHA = '\u092B';
static final char VOWEL_SIGN_I = '\u093F';
static final char VOWEL_SIGN_II = '\u0940';
static final char VOWEL_SIGN_VOCALIC_R = '\u0943';
static final char DANDA = '\u0964';
// The follwing characters replace the above characters followed by Nukta. These
// are defined in one to one correspondence order.
static final char SIGN_OM = '\u0950';
static final char LETTER_VOCALIC_L = '\u090C';
static final char LETTER_VOCALIC_LL = '\u0961';
static final char LETTER_VOCALIC_RR = '\u0960';
static final char LETTER_QA = '\u0958';
static final char LETTER_KHHA = '\u0959';
static final char LETTER_GHHA = '\u095A';
static final char LETTER_ZA = '\u095B';
static final char LETTER_DDDHA = '\u095C';
static final char LETTER_RHA = '\u095D';
static final char LETTER_FA = '\u095E';
static final char VOWEL_SIGN_VOCALIC_L = '\u0962';
static final char VOWEL_SIGN_VOCALIC_LL = '\u0963';
static final char VOWEL_SIGN_VOCALIC_RR = '\u0944';
static final char SIGN_AVAGRAHA = '\u093D';
static final char[] joinWithNukta = {
SIGN_CANDRABINDU,
LETTER_I,
LETTER_II,
LETTER_VOCALIC_R ,
LETTER_KA,
LETTER_KHA,
LETTER_GA,
LETTER_JA,
LETTER_DDA,
LETTER_DDHA,
LETTER_PHA,
VOWEL_SIGN_I,
VOWEL_SIGN_II,
VOWEL_SIGN_VOCALIC_R,
DANDA
};
static final char[] nuktaForm = {
SIGN_OM,
LETTER_VOCALIC_L,
LETTER_VOCALIC_LL,
LETTER_VOCALIC_RR,
LETTER_QA,
LETTER_KHHA,
LETTER_GHHA,
LETTER_ZA,
LETTER_DDDHA,
LETTER_RHA,
LETTER_FA,
VOWEL_SIGN_VOCALIC_L,
VOWEL_SIGN_VOCALIC_LL,
VOWEL_SIGN_VOCALIC_RR,
SIGN_AVAGRAHA
};
}
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* (C) Copyright IBM Corp. 2000 - All Rights Reserved
*
* The original version of this source code and documentation is
* copyrighted and owned by IBM. These materials are provided
* under terms of a License Agreement between IBM and Sun.
* This technology is protected by multiple US and International
* patents. This notice and attribution to IBM may not be removed.
*
*/
package com.sun.inputmethods.internal.indicim;
import java.awt.im.spi.InputMethod;
import java.awt.im.spi.InputMethodContext;
import java.awt.AWTEvent;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.lang.Character.Subset;
import java.util.Locale;
class IndicInputMethod implements InputMethod {
private IndicInputMethodImpl impl;
private Locale locale;
IndicInputMethod(Locale theLocale, IndicInputMethodImpl theImplementation) {
locale = theLocale;
impl = theImplementation;
}
/**
* Sets the input method context, which is used to dispatch input method
* events to the client component and to request information from
* the client component.
* <p>
* This method is called once immediately after instantiating this input
* method.
*
* @param context the input method context for this input method
* @exception NullPointerException if <code>context</code> is null
*/
public void setInputMethodContext(InputMethodContext context) {
impl.setInputMethodContext(context);
}
/**
* Attempts to set the input locale. If the input method supports the
* desired locale, it changes its behavior to support input for the locale
* and returns true.
* Otherwise, it returns false and does not change its behavior.
* <p>
* This method is called
* <ul>
* <li>by {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
* <li>when switching to this input method through the user interface if the user
* specified a locale or if the previously selected input method's
* {@link java.awt.im.spi.InputMethod#getLocale getLocale} method
* returns a non-null value.
* </ul>
*
* @param locale locale to input
* @return whether the specified locale is supported
* @exception NullPointerException if <code>locale</code> is null
*/
public boolean setLocale(Locale locale) {
if (locale.getLanguage().equals(this.locale.getLanguage())) {
//System.out.println("returning true for locale " + locale);
return true;
}
else {
//System.out.println("returning false for locale " + locale);
return false;
}
}
/**
* Returns the current input locale. Might return null in exceptional cases.
* <p>
* This method is called
* <ul>
* <li>by {@link java.awt.im.InputContext#getLocale InputContext.getLocale} and
* <li>when switching from this input method to a different one through the
* user interface.
* </ul>
*
* @return the current input locale, or null
*/
public Locale getLocale() {
return locale;
}
/**
* Sets the subsets of the Unicode character set that this input method
* is allowed to input. Null may be passed in to indicate that all
* characters are allowed.
* <p>
* This method is called
* <ul>
* <li>immediately after instantiating this input method,
* <li>when switching to this input method from a different one, and
* <li>by {@link java.awt.im.InputContext#setCharacterSubsets InputContext.setCharacterSubsets}.
* </ul>
*
* @param subsets the subsets of the Unicode character set from which
* characters may be input
*/
public void setCharacterSubsets(Subset[] subsets) {
}
/**
* Enables or disables this input method for composition,
* depending on the value of the parameter <code>enable</code>.
* <p>
* An input method that is enabled for composition interprets incoming
* events for both composition and control purposes, while a
* disabled input method does not interpret events for composition.
* Note however that events are passed on to the input method regardless
* whether it is enabled or not, and that an input method that is disabled
* for composition may still interpret events for control purposes,
* including to enable or disable itself for composition.
* <p>
* This method is called
* <ul>
* <li>by {@link java.awt.im.InputContext#setCompositionEnabled InputContext.setCompositionEnabled},
* <li>when switching to this input method from a different one using the
* user interface or
* {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
* if the previously selected input method's
* {@link java.awt.im.spi.InputMethod#isCompositionEnabled isCompositionEnabled}
* method returns without throwing an exception.
* </ul>
*
* @param enable whether to enable the input method for composition
* @throws UnsupportedOperationException if this input method does not
* support the enabling/disabling operation
* @see #isCompositionEnabled
*/
public void setCompositionEnabled(boolean enable) {
throw new UnsupportedOperationException();
}
/**
* Determines whether this input method is enabled.
* An input method that is enabled for composition interprets incoming
* events for both composition and control purposes, while a
* disabled input method does not interpret events for composition.
* <p>
* This method is called
* <ul>
* <li>by {@link java.awt.im.InputContext#isCompositionEnabled InputContext.isCompositionEnabled} and
* <li>when switching from this input method to a different one using the
* user interface or
* {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
* </ul>
*
* @return <code>true</code> if this input method is enabled for
* composition; <code>false</code> otherwise.
* @throws UnsupportedOperationException if this input method does not
* support checking whether it is enabled for composition
* @see #setCompositionEnabled
*/
public boolean isCompositionEnabled() {
return true;
}
/**
* Starts the reconversion operation. The input method obtains the
* text to be reconverted from the current client component using the
* {@link java.awt.im.InputMethodRequests#getSelectedText InputMethodRequests.getSelectedText}
* method. It can use other <code>InputMethodRequests</code>
* methods to request additional information required for the
* reconversion operation. The composed and committed text
* produced by the operation is sent to the client component as a
* sequence of <code>InputMethodEvent</code>s. If the given text
* cannot be reconverted, the same text should be sent to the
* client component as committed text.
* <p>
* This method is called by
* {@link java.awt.im.InputContext#reconvert() InputContext.reconvert}.
*
* @throws UnsupportedOperationException if the input method does not
* support the reconversion operation.
*/
public void reconvert() {
throw new UnsupportedOperationException("This input method does not reconvert.");
}
/**
* Dispatches the event to the input method. If input method support is
* enabled for the focussed component, incoming events of certain types
* are dispatched to the current input method for this component before
* they are dispatched to the component's methods or event listeners.
* The input method decides whether it needs to handle the event. If it
* does, it also calls the event's <code>consume</code> method; this
* causes the event to not get dispatched to the component's event
* processing methods or event listeners.
* <p>
* Events are dispatched if they are instances of InputEvent or its
* subclasses.
* This includes instances of the AWT classes KeyEvent and MouseEvent.
* <p>
* This method is called by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}.
*
* @param event the event being dispatched to the input method
* @exception NullPointerException if <code>event</code> is null
*/
public void dispatchEvent(AWTEvent event) {
if (event instanceof KeyEvent) {
KeyEvent keyEvent = (KeyEvent) event;
if (event.getID() == KeyEvent.KEY_TYPED) {
impl.handleKeyTyped(keyEvent);
}
//System.out.println("handled event " + event);
}
else {
//System.out.println("did not handle event " + event);
}
}
/**
* Notifies this input method of changes in the client window
* location or state. This method is called while this input
* method is the current input method of its input context and
* notifications for it are enabled (see {@link
* InputMethodContext#enableClientWindowNotification
* InputMethodContext.enableClientWindowNotification}). Calls
* to this method are temporarily suspended if the input context's
* {@link java.awt.im.InputContext#removeNotify removeNotify}
* method is called, and resume when the input method is activated
* for a new client component. It is called in the following
* situations:
* <ul>
* <li>
* when the window containing the current client component changes
* in location, size, visibility, iconification state, or when the
* window is closed.</li>
* <li>
* from <code> enableClientWindowNotification(inputMethod,
* true)</code> if the current client component exists,</li>
* <li>
* when activating the input method for the first time after it
* called
* <code>enableClientWindowNotification(inputMethod,
* true)</code> if during the call no current client component was
* available,</li>
* <li>
* when activating the input method for a new client component
* after the input context's removeNotify method has been
* called.</li>
* </ul>
* @param bounds client window's {@link
* java.awt.Component#getBounds bounds} on the screen; or null if
* the client window is iconified or invisible
*/
public void notifyClientWindowChange(Rectangle bounds) {
}
/**
* Activates the input method for immediate input processing.
* <p>
* If an input method provides its own windows, it should make sure
* at this point that all necessary windows are open and visible.
* <p>
* This method is called
* <ul>
* <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
* when a client component receives a FOCUS_GAINED event,
* <li>when switching to this input method from a different one using the
* user interface or
* {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
* </ul>
* The method is only called when the input method is inactive.
* A newly instantiated input method is assumed to be inactive.
*/
public void activate() {
//System.out.println("activated");
}
/**
* Deactivates the input method.
* The isTemporary argument has the same meaning as in
* {@link java.awt.event.FocusEvent#isTemporary FocusEvent.isTemporary}.
* <p>
* If an input method provides its own windows, only windows that relate
* to the current composition (such as a lookup choice window) should be
* closed at this point.
* It is possible that the input method will be immediately activated again
* for a different client component, and closing and reopening more
* persistent windows (such as a control panel) would create unnecessary
* screen flicker.
* Before an instance of a different input method class is activated,
* {@link #hideWindows} is called on the current input method.
* <p>
* This method is called
* <ul>
* <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
* when a client component receives a FOCUS_LOST event,
* <li>when switching from this input method to a different one using the
* user interface or
* {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
* <li>before {@link #removeNotify removeNotify} if the current client component is
* removed.
* </ul>
* The method is only called when the input method is active.
*
* @param isTemporary whether the focus change is temporary
*/
public void deactivate(boolean isTemporary) {
//System.out.println("deactivated");
}
/**
* Closes or hides all windows opened by this input method instance or
* its class.
* <p>
* This method is called
* <ul>
* <li>before calling {@link #activate activate} on an instance of a different input
* method class,
* <li>before calling {@link #dispose dispose} on this input method.
* </ul>
* The method is only called when the input method is inactive.
*/
public void hideWindows() {
}
/**
* Notifies the input method that a client component has been
* removed from its containment hierarchy, or that input method
* support has been disabled for the component.
* <p>
* This method is called by {@link java.awt.im.InputContext#removeNotify InputContext.removeNotify}.
* <p>
* The method is only called when the input method is inactive.
*/
public void removeNotify() {
}
/**
* Ends any input composition that may currently be going on in this
* context. Depending on the platform and possibly user preferences,
* this may commit or delete uncommitted text. Any changes to the text
* are communicated to the active component using an input method event.
*
* <p>
* A text editing component may call this in a variety of situations,
* for example, when the user moves the insertion point within the text
* (but outside the composed text), or when the component's text is
* saved to a file or copied to the clipboard.
* <p>
* This method is called
* <ul>
* <li>by {@link java.awt.im.InputContext#endComposition InputContext.endComposition},
* <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
* when switching to a different client component
* <li>when switching from this input method to a different one using the
* user interface or
* {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
* </ul>
*/
public void endComposition() {
impl.endComposition();
}
/**
* Disposes of the input method and releases the resources used by it.
* In particular, the input method should dispose windows and close files that are no
* longer needed.
* <p>
* This method is called by {@link java.awt.im.InputContext#dispose InputContext.dispose}.
* <p>
* The method is only called when the input method is inactive.
* No method of this interface is called on this instance after dispose.
*/
public void dispose() {
}
/**
* Returns a control object from this input method, or null. A
* control object provides methods that control the behavior of the
* input method or obtain information from the input method. The type
* of the object is an input method specific class. Clients have to
* compare the result against known input method control object
* classes and cast to the appropriate class to invoke the methods
* provided.
* <p>
* This method is called by
* {@link java.awt.im.InputContext#getInputMethodControlObject InputContext.getInputMethodControlObject}.
*
* @return a control object from this input method, or null
*/
public Object getControlObject() {
return null;
}
}
/*
* Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* (C) Copyright IBM Corp. 2000 - All Rights Reserved
*
* The original version of this source code and documentation is
* copyrighted and owned by IBM. These materials are provided
* under terms of a License Agreement between IBM and Sun.
* This technology is protected by multiple US and International
* patents. This notice and attribution to IBM may not be removed.
*
*/
package com.sun.inputmethods.internal.indicim;
import java.awt.im.spi.InputMethodContext;
import java.awt.event.KeyEvent;
import java.awt.event.InputMethodEvent;
import java.awt.font.TextAttribute;
import java.awt.font.TextHitInfo;
import java.text.AttributedCharacterIterator;
import java.util.Hashtable;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
class IndicInputMethodImpl {
protected char[] KBD_MAP;
private static final char SUBSTITUTION_BASE = '\uff00';
// Indexed by map value - SUBSTITUTION_BASE
protected char[][] SUBSTITUTION_TABLE;
// Invalid character.
private static final char INVALID_CHAR = '\uffff';
// Unmapped versions of some interesting characters.
private static final char KEY_SIGN_VIRAMA = '\u0064'; // or just 'd'??
private static final char KEY_SIGN_NUKTA = '\u005d'; // or just ']'??
// Two succeeding viramas are replaced by one virama and one ZWNJ.
// Viram followed by Nukta is replaced by one VIRAMA and one ZWJ
private static final char ZWJ = '\u200d';
private static final char ZWNJ = '\u200c';
// Backspace
private static final char BACKSPACE = '\u0008';
// Sorted list of characters which can be followed by Nukta
protected char[] JOIN_WITH_NUKTA;
// Nukta form of the above characters
protected char[] NUKTA_FORM;
private int log2;
private int power;
private int extra;
// cached TextHitInfo. Only one type of TextHitInfo is required.
private static final TextHitInfo ZERO_TRAILING_HIT_INFO = TextHitInfo.trailing(0);
/**
* Returns the index of the given character in the JOIN_WITH_NUKTA array.
* If character is not found, -1 is returned.
*/
private int nuktaIndex(char ch) {
if (JOIN_WITH_NUKTA == null) {
return -1;
}
int probe = power;
int index = 0;
if (JOIN_WITH_NUKTA[extra] <= ch) {
index = extra;
}
while (probe > (1 << 0)) {
probe >>= 1;
if (JOIN_WITH_NUKTA[index + probe] <= ch) {
index += probe;
}
}
if (JOIN_WITH_NUKTA[index] != ch) {
index = -1;
}
return index;
}
/**
* Returns the equivalent character for hindi locale.
* @param originalChar The original character.
*/
private char getMappedChar( char originalChar )
{
if (originalChar <= KBD_MAP.length) {
return KBD_MAP[originalChar];
}
return originalChar;
}//getMappedChar()
// Array used to hold the text to be sent.
// If the last character was not committed it is stored in text[0].
// The variable totalChars give an indication of whether the last
// character was committed or not. If at any time ( but not within a
// a call to dispatchEvent ) totalChars is not equal to 0 ( it can
// only be 1 otherwise ) the last character was not committed.
private char [] text = new char[4];
// this is always 0 before and after call to dispatchEvent. This character assumes
// significance only within a call to dispatchEvent.
private int committedChars = 0;// number of committed characters
// the total valid characters in variable text currently.
private int totalChars = 0;//number of total characters ( committed + composed )
private boolean lastCharWasVirama = false;
private InputMethodContext context;
//
// Finds the high bit by binary searching
// through the bits in n.
//
private static byte highBit(int n)
{
if (n <= 0) {
return -32;
}
byte bit = 0;
if (n >= 1 << 16) {
n >>= 16;
bit += 16;
}
if (n >= 1 << 8) {
n >>= 8;
bit += 8;
}
if (n >= 1 << 4) {
n >>= 4;
bit += 4;
}
if (n >= 1 << 2) {
n >>= 2;
bit += 2;
}
if (n >= 1 << 1) {
n >>= 1;
bit += 1;
}
return bit;
}
IndicInputMethodImpl(char[] keyboardMap, char[] joinWithNukta, char[] nuktaForm,
char[][] substitutionTable) {
KBD_MAP = keyboardMap;
JOIN_WITH_NUKTA = joinWithNukta;
NUKTA_FORM = nuktaForm;
SUBSTITUTION_TABLE = substitutionTable;
if (JOIN_WITH_NUKTA != null) {
int log2 = highBit(JOIN_WITH_NUKTA.length);
power = 1 << log2;
extra = JOIN_WITH_NUKTA.length - power;
} else {
power = extra = 0;
}
}
void setInputMethodContext(InputMethodContext context) {
this.context = context;
}
void handleKeyTyped(KeyEvent kevent) {
char keyChar = kevent.getKeyChar();
char currentChar = getMappedChar(keyChar);
// The Explicit and Soft Halanta case.
if ( lastCharWasVirama ) {
switch (keyChar) {
case KEY_SIGN_NUKTA:
currentChar = ZWJ;
break;
case KEY_SIGN_VIRAMA:
currentChar = ZWNJ;
break;
default:
}//endSwitch
}//endif
if (currentChar == INVALID_CHAR) {
kevent.consume();
return;
}
if (currentChar == BACKSPACE) {
lastCharWasVirama = false;
if (totalChars > 0) {
totalChars = committedChars = 0;
} else {
return;
}
}
else if (keyChar == KEY_SIGN_NUKTA) {
int nuktaIndex = nuktaIndex(text[0]);
if (nuktaIndex != -1) {
text[0] = NUKTA_FORM[nuktaIndex];
} else {
// the last character was committed, commit just Nukta.
// Note : the lastChar must have been committed if it is not one of
// the characters which combine with nukta.
// the state must be totalChars = committedChars = 0;
text[totalChars++] = currentChar;
}
committedChars += 1;
}
else {
int nuktaIndex = nuktaIndex(currentChar);
if (nuktaIndex != -1) {
// Commit everything but currentChar
text[totalChars++] = currentChar;
committedChars = totalChars-1;
} else {
if (currentChar >= SUBSTITUTION_BASE) {
char[] sub = SUBSTITUTION_TABLE[currentChar - SUBSTITUTION_BASE];
System.arraycopy(sub, 0, text, totalChars, sub.length);
totalChars += sub.length;
} else {
text[totalChars++] = currentChar;
}
committedChars = totalChars;
}
}
ACIText aText = new ACIText( text, 0, totalChars, committedChars );
int composedCharLength = totalChars - committedChars;
TextHitInfo caret=null,visiblePosition=null;
switch( composedCharLength ) {
case 0:
break;
case 1:
visiblePosition = caret = ZERO_TRAILING_HIT_INFO;
break;
default:
assert false : "The code should not reach here. There is no case where there can be more than one character pending.";
}
context.dispatchInputMethodEvent(InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
aText,
committedChars,
caret,
visiblePosition);
if (totalChars == 0) {
text[0] = INVALID_CHAR;
} else {
text[0] = text[totalChars - 1];// make text[0] hold the last character
}
lastCharWasVirama = keyChar == KEY_SIGN_VIRAMA && !lastCharWasVirama;
totalChars -= committedChars;
committedChars = 0;
// state now text[0] = last character
// totalChars = ( last character committed )? 0 : 1;
// committedChars = 0;
kevent.consume();// prevent client from getting this event.
}//dispatchEvent()
void endComposition() {
if( totalChars != 0 ) {// if some character is not committed.
ACIText aText = new ACIText( text, 0, totalChars, totalChars );
context.dispatchInputMethodEvent( InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
aText, totalChars, null, null );
totalChars = committedChars = 0;
text[0] = INVALID_CHAR;
lastCharWasVirama = false;
}//end if
}//endComposition()
// custom AttributedCharacterIterator -- much lightweight since currently there is no
// attribute defined on the text being generated by the input method.
private class ACIText implements AttributedCharacterIterator {
private char [] text = null;
private int committed = 0;
private int index = 0;
ACIText( char [] chArray, int offset, int length, int committed ) {
this.text = new char[length];
this.committed = committed;
System.arraycopy( chArray, offset, text, 0, length );
}//c'tor
// CharacterIterator methods.
public char first() {
return _setIndex( 0 );
}
public char last() {
if( text.length == 0 ) {
return _setIndex( text.length );
}
return _setIndex( text.length - 1 );
}
public char current() {
if( index == text.length )
return DONE;
return text[index];
}
public char next() {
if( index == text.length ) {
return DONE;
}
return _setIndex( index + 1 );
}
public char previous() {
if( index == 0 )
return DONE;
return _setIndex( index - 1 );
}
public char setIndex(int position) {
if( position < 0 || position > text.length ) {
throw new IllegalArgumentException();
}
return _setIndex( position );
}
public int getBeginIndex() {
return 0;
}
public int getEndIndex() {
return text.length;
}
public int getIndex() {
return index;
}
public Object clone() {
try {
ACIText clone = (ACIText) super.clone();
return clone;
} catch (CloneNotSupportedException e) {
throw new InternalError();
}
}
// AttributedCharacterIterator methods.
public int getRunStart() {
return index >= committed ? committed : 0;
}
public int getRunStart(AttributedCharacterIterator.Attribute attribute) {
return (index >= committed &&
attribute == TextAttribute.INPUT_METHOD_UNDERLINE) ? committed : 0;
}
public int getRunStart(Set<? extends Attribute> attributes) {
return (index >= committed &&
attributes.contains(TextAttribute.INPUT_METHOD_UNDERLINE)) ? committed : 0;
}
public int getRunLimit() {
return index < committed ? committed : text.length;
}
public int getRunLimit(AttributedCharacterIterator.Attribute attribute) {
return (index < committed &&
attribute == TextAttribute.INPUT_METHOD_UNDERLINE) ? committed : text.length;
}
public int getRunLimit(Set<? extends Attribute> attributes) {
return (index < committed &&
attributes.contains(TextAttribute.INPUT_METHOD_UNDERLINE)) ? committed : text.length;
}
public Map getAttributes() {
Hashtable result = new Hashtable();
if (index >= committed && committed < text.length) {
result.put(TextAttribute.INPUT_METHOD_UNDERLINE,
TextAttribute.UNDERLINE_LOW_ONE_PIXEL);
}
return result;
}
public Object getAttribute(AttributedCharacterIterator.Attribute attribute) {
if (index >= committed &&
committed < text.length &&
attribute == TextAttribute.INPUT_METHOD_UNDERLINE) {
return TextAttribute.UNDERLINE_LOW_ONE_PIXEL;
}
return null;
}
public Set getAllAttributeKeys() {
HashSet result = new HashSet();
if (committed < text.length) {
result.add(TextAttribute.INPUT_METHOD_UNDERLINE);
}
return result;
}
// private methods
/**
* This is always called with valid i ( 0 < i <= text.length )
*/
private char _setIndex( int i ) {
index = i;
if( i == text.length ) {
return DONE;
}
return text[i];
}//_setIndex()
}//end of inner class
}
#
# Default Input method display names for Indic input methods
#
DisplayName.Devanagari = Devanagari Input Method
#
# Default Input method display names for Indic input methods
#
DisplayName.Devanagari = Devanagari Input Method
#
# Default Input method display names for Indic input methods
#
DisplayName.Devanagari = Devanagari Input Method
#
# Default Input method display names for Indic input methods
#
DisplayName.Devanagari = Devanagari Input Method
#
# Default Input method display names for Indic input methods
#
DisplayName.Devanagari = Devanagari Input Method
#
# Default Input method display names for Indic input methods
#
DisplayName.Devanagari = \u30c7\u30fc\u30f4\u30a1\u30ca\u30fc\u30ac\u30ea\u30fc\u30a4\u30f3\u30d7\u30c3\u30c8\u30e1\u30bd\u30c3\u30c9
#
# Default Input method display names for Indic input methods
#
DisplayName.Devanagari = Devanagari \uc785\ub825 \uba54\uc18c\ub4dc
#
# Default Input method display names for Indic input methods
#
DisplayName.Devanagari = Devanagari Input Method
#
# Default Input method display names for Indic input methods
#
DisplayName.Devanagari = Devanagari \u8f93\u5165\u6cd5
#
# Default Input method display names for Indic input methods
#
DisplayName.Devanagari = Devanagari \u8f38\u5165\u6cd5
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*
* (C) Copyright IBM Corp. 2000 - All Rights Reserved
*
* The original version of this source code and documentation is
* copyrighted and owned by IBM. These materials are provided
* under terms of a License Agreement between IBM and Sun.
* This technology is protected by multiple US and International
* patents. This notice and attribution to IBM may not be removed.
*
*/
package com.sun.inputmethods.internal.thaiim;
import java.awt.im.spi.InputMethod;
import java.awt.im.spi.InputMethodContext;
import java.awt.AWTEvent;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.lang.Character.Subset;
import java.util.Locale;
class ThaiInputMethod implements InputMethod {
private ThaiInputMethodImpl impl;
private Locale locale;
ThaiInputMethod(Locale theLocale, ThaiInputMethodImpl theImplementation) {
locale = theLocale;
impl = theImplementation;
}
/**
* Sets the input method context, which is used to dispatch input method
* events to the client component and to request information from
* the client component.
* <p>
* This method is called once immediately after instantiating this input
* method.
*
* @param context the input method context for this input method
* @exception NullPointerException if <code>context</code> is null
*/
public void setInputMethodContext(InputMethodContext context) {
impl.setInputMethodContext(context);
}
/**
* Attempts to set the input locale. If the input method supports the
* desired locale, it changes its behavior to support input for the locale
* and returns true.
* Otherwise, it returns false and does not change its behavior.
* <p>
* This method is called
* <ul>
* <li>by {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
* <li>when switching to this input method through the user interface if the user
* specified a locale or if the previously selected input method's
* {@link java.awt.im.spi.InputMethod#getLocale getLocale} method
* returns a non-null value.
* </ul>
*
* @param locale locale to input
* @return whether the specified locale is supported
* @exception NullPointerException if <code>locale</code> is null
*/
public boolean setLocale(Locale locale) {
if (locale.getLanguage().equals(this.locale.getLanguage())) {
//System.out.println("returning true for locale " + locale);
return true;
}
else {
//System.out.println("returning false for locale " + locale);
return false;
}
}
/**
* Returns the current input locale. Might return null in exceptional cases.
* <p>
* This method is called
* <ul>
* <li>by {@link java.awt.im.InputContext#getLocale InputContext.getLocale} and
* <li>when switching from this input method to a different one through the
* user interface.
* </ul>
*
* @return the current input locale, or null
*/
public Locale getLocale() {
return locale;
}
/**
* Sets the subsets of the Unicode character set that this input method
* is allowed to input. Null may be passed in to indicate that all
* characters are allowed.
* <p>
* This method is called
* <ul>
* <li>immediately after instantiating this input method,
* <li>when switching to this input method from a different one, and
* <li>by {@link java.awt.im.InputContext#setCharacterSubsets InputContext.setCharacterSubsets}.
* </ul>
*
* @param subsets the subsets of the Unicode character set from which
* characters may be input
*/
public void setCharacterSubsets(Subset[] subsets) {
}
/**
* Enables or disables this input method for composition,
* depending on the value of the parameter <code>enable</code>.
* <p>
* An input method that is enabled for composition interprets incoming
* events for both composition and control purposes, while a
* disabled input method does not interpret events for composition.
* Note however that events are passed on to the input method regardless
* whether it is enabled or not, and that an input method that is disabled
* for composition may still interpret events for control purposes,
* including to enable or disable itself for composition.
* <p>
* This method is called
* <ul>
* <li>by {@link java.awt.im.InputContext#setCompositionEnabled InputContext.setCompositionEnabled},
* <li>when switching to this input method from a different one using the
* user interface or
* {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
* if the previously selected input method's
* {@link java.awt.im.spi.InputMethod#isCompositionEnabled isCompositionEnabled}
* method returns without throwing an exception.
* </ul>
*
* @param enable whether to enable the input method for composition
* @throws UnsupportedOperationException if this input method does not
* support the enabling/disabling operation
* @see #isCompositionEnabled
*/
public void setCompositionEnabled(boolean enable) {
throw new UnsupportedOperationException();
}
/**
* Determines whether this input method is enabled.
* An input method that is enabled for composition interprets incoming
* events for both composition and control purposes, while a
* disabled input method does not interpret events for composition.
* <p>
* This method is called
* <ul>
* <li>by {@link java.awt.im.InputContext#isCompositionEnabled InputContext.isCompositionEnabled} and
* <li>when switching from this input method to a different one using the
* user interface or
* {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
* </ul>
*
* @return <code>true</code> if this input method is enabled for
* composition; <code>false</code> otherwise.
* @throws UnsupportedOperationException if this input method does not
* support checking whether it is enabled for composition
* @see #setCompositionEnabled
*/
public boolean isCompositionEnabled() {
return true;
}
/**
* Starts the reconversion operation. The input method obtains the
* text to be reconverted from the current client component using the
* {@link java.awt.im.InputMethodRequests#getSelectedText InputMethodRequests.getSelectedText}
* method. It can use other <code>InputMethodRequests</code>
* methods to request additional information required for the
* reconversion operation. The composed and committed text
* produced by the operation is sent to the client component as a
* sequence of <code>InputMethodEvent</code>s. If the given text
* cannot be reconverted, the same text should be sent to the
* client component as committed text.
* <p>
* This method is called by
* {@link java.awt.im.InputContext#reconvert() InputContext.reconvert}.
*
* @throws UnsupportedOperationException if the input method does not
* support the reconversion operation.
*/
public void reconvert() {
throw new UnsupportedOperationException("This input method does not reconvert.");
}
/**
* Dispatches the event to the input method. If input method support is
* enabled for the focussed component, incoming events of certain types
* are dispatched to the current input method for this component before
* they are dispatched to the component's methods or event listeners.
* The input method decides whether it needs to handle the event. If it
* does, it also calls the event's <code>consume</code> method; this
* causes the event to not get dispatched to the component's event
* processing methods or event listeners.
* <p>
* Events are dispatched if they are instances of InputEvent or its
* subclasses.
* This includes instances of the AWT classes KeyEvent and MouseEvent.
* <p>
* This method is called by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}.
*
* @param event the event being dispatched to the input method
* @exception NullPointerException if <code>event</code> is null
*/
public void dispatchEvent(AWTEvent event) {
if (event instanceof KeyEvent) {
KeyEvent keyEvent = (KeyEvent) event;
if (event.getID() == KeyEvent.KEY_TYPED) {
//System.out.println("handled event " + event);
impl.handleKeyTyped(keyEvent);
}
}
else {
//System.out.println("did not handle event " + event);
}
}
/**
* Notifies this input method of changes in the client window
* location or state. This method is called while this input
* method is the current input method of its input context and
* notifications for it are enabled (see {@link
* InputMethodContext#enableClientWindowNotification
* InputMethodContext.enableClientWindowNotification}). Calls
* to this method are temporarily suspended if the input context's
* {@link java.awt.im.InputContext#removeNotify removeNotify}
* method is called, and resume when the input method is activated
* for a new client component. It is called in the following
* situations:
* <ul>
* <li>
* when the window containing the current client component changes
* in location, size, visibility, iconification state, or when the
* window is closed.</li>
* <li>
* from <code> enableClientWindowNotification(inputMethod,
* true)</code> if the current client component exists,</li>
* <li>
* when activating the input method for the first time after it
* called
* <code>enableClientWindowNotification(inputMethod,
* true)</code> if during the call no current client component was
* available,</li>
* <li>
* when activating the input method for a new client component
* after the input context's removeNotify method has been
* called.</li>
* </ul>
* @param bounds client window's {@link
* java.awt.Component#getBounds bounds} on the screen; or null if
* the client window is iconified or invisible
*/
public void notifyClientWindowChange(Rectangle bounds) {
}
/**
* Activates the input method for immediate input processing.
* <p>
* If an input method provides its own windows, it should make sure
* at this point that all necessary windows are open and visible.
* <p>
* This method is called
* <ul>
* <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
* when a client component receives a FOCUS_GAINED event,
* <li>when switching to this input method from a different one using the
* user interface or
* {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
* </ul>
* The method is only called when the input method is inactive.
* A newly instantiated input method is assumed to be inactive.
*/
public void activate() {
//System.out.println("activated");
}
/**
* Deactivates the input method.
* The isTemporary argument has the same meaning as in
* {@link java.awt.event.FocusEvent#isTemporary FocusEvent.isTemporary}.
* <p>
* If an input method provides its own windows, only windows that relate
* to the current composition (such as a lookup choice window) should be
* closed at this point.
* It is possible that the input method will be immediately activated again
* for a different client component, and closing and reopening more
* persistent windows (such as a control panel) would create unnecessary
* screen flicker.
* Before an instance of a different input method class is activated,
* {@link #hideWindows} is called on the current input method.
* <p>
* This method is called
* <ul>
* <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
* when a client component receives a FOCUS_LOST event,
* <li>when switching from this input method to a different one using the
* user interface or
* {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
* <li>before {@link #removeNotify removeNotify} if the current client component is
* removed.
* </ul>
* The method is only called when the input method is active.
*
* @param isTemporary whether the focus change is temporary
*/
public void deactivate(boolean isTemporary) {
//System.out.println("deactivated");
}
/**
* Closes or hides all windows opened by this input method instance or
* its class.
* <p>
* This method is called
* <ul>
* <li>before calling {@link #activate activate} on an instance of a different input
* method class,
* <li>before calling {@link #dispose dispose} on this input method.
* </ul>
* The method is only called when the input method is inactive.
*/
public void hideWindows() {
}
/**
* Notifies the input method that a client component has been
* removed from its containment hierarchy, or that input method
* support has been disabled for the component.
* <p>
* This method is called by {@link java.awt.im.InputContext#removeNotify InputContext.removeNotify}.
* <p>
* The method is only called when the input method is inactive.
*/
public void removeNotify() {
}
/**
* Ends any input composition that may currently be going on in this
* context. Depending on the platform and possibly user preferences,
* this may commit or delete uncommitted text. Any changes to the text
* are communicated to the active component using an input method event.
*
* <p>
* A text editing component may call this in a variety of situations,
* for example, when the user moves the insertion point within the text
* (but outside the composed text), or when the component's text is
* saved to a file or copied to the clipboard.
* <p>
* This method is called
* <ul>
* <li>by {@link java.awt.im.InputContext#endComposition InputContext.endComposition},
* <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
* when switching to a different client component
* <li>when switching from this input method to a different one using the
* user interface or
* {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
* </ul>
*/
public void endComposition() {
impl.endComposition();
}
/**
* Disposes of the input method and releases the resources used by it.
* In particular, the input method should dispose windows and close files that are no
* longer needed.
* <p>
* This method is called by {@link java.awt.im.InputContext#dispose InputContext.dispose}.
* <p>
* The method is only called when the input method is inactive.
* No method of this interface is called on this instance after dispose.
*/
public void dispose() {
}
/**
* Returns a control object from this input method, or null. A
* control object provides methods that control the behavior of the
* input method or obtain information from the input method. The type
* of the object is an input method specific class. Clients have to
* compare the result against known input method control object
* classes and cast to the appropriate class to invoke the methods
* provided.
* <p>
* This method is called by
* {@link java.awt.im.InputContext#getInputMethodControlObject InputContext.getInputMethodControlObject}.
*
* @return a control object from this input method, or null
*/
public Object getControlObject() {
return null;
}
}
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*
* (C) Copyright IBM Corp. 2000 - All Rights Reserved
*
* The original version of this source code and documentation is
* copyrighted and owned by IBM. These materials are provided
* under terms of a License Agreement between IBM and Sun.
* This technology is protected by multiple US and International
* patents. This notice and attribution to IBM may not be removed.
*
*/
package com.sun.inputmethods.internal.thaiim;
import java.awt.im.InputMethodRequests;
import java.awt.im.spi.InputMethodContext;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import java.awt.event.InputMethodEvent;
import java.awt.font.TextAttribute;
import java.awt.font.TextHitInfo;
import java.text.AttributedCharacterIterator;
import java.text.AttributedString;
class ThaiInputMethodImpl {
private static final char[] keyboardMap = {
/* 00 */ '\u0000',
/* 01 */ '\u0001',
/* 02 */ '\u0002',
/* 03 */ '\u0003',
/* 04 */ '\u0004',
/* 05 */ '\u0005',
/* 06 */ '\u0006',
/* 07 */ '\u0007',
/* 08 */ '\u0008',
/* 09 */ '\u0009',
/* 0A */ '\012',
/* 0B */ '\u000B',
/* 0C */ '\u000C',
/* 0D */ '\015',
/* 0E */ '\u000E',
/* 0F */ '\u000F',
/* 10 */ '\u0010',
/* 11 */ '\u0011',
/* 12 */ '\u0012',
/* 13 */ '\u0013',
/* 14 */ '\u0014',
/* 15 */ '\u0015',
/* 16 */ '\u0016',
/* 17 */ '\u0017',
/* 18 */ '\u0018',
/* 19 */ '\u0019',
/* 1A */ '\u001A',
/* 1B */ '\u001B',
/* 1C */ '\u001C',
/* 1D */ '\u001D',
/* 1E */ '\u001E',
/* 1F */ '\u001F',
/* 20 */ '\u0020',
/* 21 */ '\u0e45', // '!'
/* 22 */ '\u002e', // '"'
/* 23 */ '\u0e52', // '#'
/* 24 */ '\u0e53', // '$'
/* 25 */ '\u0e54', // '%'
/* 26 */ '\u0e4e', // '&'
/* 27 */ '\u0e07', // '''
/* 28 */ '\u0e56', // '('
/* 29 */ '\u0e57', // ')'
/* 2A */ '\u0e55', // '*'
/* 2B */ '\u0e59', // '+'
/* 2C */ '\u0e21', // ','
/* 2D */ '\u0e02', // '-'
/* 2E */ '\u0e43', // '.'
/* 2F */ '\u0e1d', // '/'
/* 30 */ '\u0e08', // '0'
/* 31 */ '\u0e3f', // '1'
/* 32 */ '\u002f', // '2'
/* 33 */ '\u002d', // '3'
/* 34 */ '\u0e20', // '4'
/* 35 */ '\u0e16', // '5'
/* 36 */ '\u0e38', // '6'
/* 37 */ '\u0e36', // '7'
/* 38 */ '\u0e04', // '8'
/* 39 */ '\u0e15', // '9'
/* 3A */ '\u0e0b', // ':'
/* 3B */ '\u0e27', // ';'
/* 3C */ '\u0e12', // '<'
/* 3D */ '\u0e0a', // '='
/* 3E */ '\u0e2c', // '>'
/* 3F */ '\u0e26', // '?'
/* 40 */ '\u0e51', // '@'
/* 41 */ '\u0e24', // 'A'
/* 42 */ '\u0e3a', // 'B'
/* 43 */ '\u0e09', // 'C'
/* 44 */ '\u0e0f', // 'D'
/* 45 */ '\u0e0e', // 'E'
/* 46 */ '\u0e42', // 'F'
/* 47 */ '\u0e0c', // 'G'
/* 48 */ '\u0e47', // 'H'
/* 49 */ '\u0e13', // 'I'
/* 4A */ '\u0e4b', // 'J'
/* 4B */ '\u0e29', // 'K'
/* 4C */ '\u0e28', // 'L'
/* 4D */ '\u003f', // 'M'
/* 4E */ '\u0e4c', // 'N'
/* 4F */ '\u0e2f', // 'O'
/* 50 */ '\u0e0d', // 'P'
/* 51 */ '\u0e50', // 'Q'
/* 52 */ '\u0e11', // 'R'
/* 53 */ '\u0e06', // 'S'
/* 54 */ '\u0e18', // 'T'
/* 55 */ '\u0e4a', // 'U'
/* 56 */ '\u0e2e', // 'V'
/* 57 */ '\u0022', // 'W'
/* 58 */ '\u0029', // 'X'
/* 59 */ '\u0e4d', // 'Y'
/* 5A */ '\u0028', // 'Z'
/* 5B */ '\u0e1a', // '['
/* 5C */ '\u0e05', // '\'
/* 5D */ '\u0e25', // ']'
/* 5E */ '\u0e39', // '^'
/* 5F */ '\u0e58', // '_'
/* 60 */ '\u0e4f', // '`'
/* 61 */ '\u0e1f', // 'a'
/* 62 */ '\u0e34', // 'b'
/* 63 */ '\u0e41', // 'c'
/* 64 */ '\u0e01', // 'd'
/* 65 */ '\u0e33', // 'e'
/* 66 */ '\u0e14', // 'f'
/* 67 */ '\u0e40', // 'g'
/* 68 */ '\u0e49', // 'h'
/* 69 */ '\u0e23', // 'i'
/* 6A */ '\u0e48', // 'j'
/* 6B */ '\u0e32', // 'k'
/* 6C */ '\u0e2a', // 'l'
/* 6D */ '\u0e17', // 'm'
/* 6E */ '\u0e37', // 'n'
/* 6F */ '\u0e19', // 'o'
/* 70 */ '\u0e22', // 'p'
/* 71 */ '\u0e46', // 'q'
/* 72 */ '\u0e1e', // 'r'
/* 73 */ '\u0e2b', // 's'
/* 74 */ '\u0e30', // 't'
/* 75 */ '\u0e35', // 'u'
/* 76 */ '\u0e2d', // 'v'
/* 77 */ '\u0e44', // 'w'
/* 78 */ '\u0e1b', // 'x'
/* 79 */ '\u0e31', // 'y'
/* 7A */ '\u0e1c', // 'z'
/* 7B */ '\u0e10', // '{'
/* 7C */ '\u0e03', // '|'
/* 7D */ '\u002c', // '}'
/* 7E */ '\u0e5b', // '~'
/* 7F */ '\u007F' //
};
// cached TextHitInfo. Only one type of TextHitInfo is required.
private static final TextHitInfo ZERO_TRAILING_HIT_INFO = TextHitInfo.trailing(0);
private ThaiRules rules;
/**
* Returns the equivalent character for thai locale.
* @param originalChar The original character.
*/
private char getMappedChar( char originalChar )
{
if (originalChar <= keyboardMap.length) {
return keyboardMap[originalChar];
}
return originalChar;
}//getMappedChar()
private InputMethodContext context;
void setInputMethodContext(InputMethodContext context) {
this.context = context;
rules = new ThaiRules((InputMethodRequests)context);
}
void handleKeyTyped(KeyEvent kevent) {
char keyChar = kevent.getKeyChar();
char currentChar = getMappedChar(keyChar);
if (!Character.UnicodeBlock.THAI.equals(Character.UnicodeBlock.of(currentChar))) {
// don't care
return;
} else if (rules.isInputValid(currentChar)) {
Character tmp = new Character(currentChar);
String tmp2 = tmp.toString();
context.dispatchInputMethodEvent(InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
(new AttributedString(tmp2)).getIterator(),
1,
ZERO_TRAILING_HIT_INFO,
ZERO_TRAILING_HIT_INFO);
} else {
// input sequence is not allowed
Toolkit.getDefaultToolkit().beep();
}
kevent.consume();// prevent client from getting this event.
return;
}//dispatchEvent()
void endComposition() {
}//endComposition()
}
#
# Default Input method display names for Thai input methods
#
DisplayName.Thai = Thai Input Method
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
SINCE=1.4 SINCE=1.4
PACKAGE=java.nio.channels PACKAGE=java.nio.channels
# This year should only change if the generated source is modified. # This year should only change if the generated source is modified.
COPYRIGHT_YEARS=2000-2007 COPYRIGHT_YEARS="2000, 2007,"
SUPER=java.io.IOException SUPER=java.io.IOException
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册