diff --git a/INSTALL.txt b/INSTALL.txt new file mode 100644 index 0000000..e8c5629 --- /dev/null +++ b/INSTALL.txt @@ -0,0 +1,90 @@ + +LDBlockShow: A new simple and efficient software for Linkage Disequilibrium Decay analysis based Variant Call Format + +1) Introduction +----------------------------------------------------------------------------------------------------------------- +################################################################################################################# + +This software relies on the zlib library packages [zlib] + +----------------------- zlib infomation ---------------------- +if Lib [zlib] do not work +you can download form this website and install it +http://www.zlib.net/ + +2) INSTALL Method1 +---------------------------------------------------------------------------------------------------------------- +################################################################################################################ + +Just execute as follows : + git clone https://github.com/BGI-shenzhen/LDBlockShow.git + chmod 755 configure ; ./configure ; + make; + mv LDBlockShow bin/ ; + + +**Note:** If fail to link,try to re-install the libraries [**_zlib_**](https://zlib.net/) + + +3) INSTALL Method2 +---------------------------------------------------------------------------------------------------------------- +################################################################################################################ +A) Method2 For linux/Unix + For linux/Unix , execute as follows : + tar -zxvf LDBlockShowXXX.tar.gz + cd LDBlockShowXXX; + cd src; + make ; make clean + ../bin/LDBlockShow + + #I had compiled and installed these gz library packages [zlib] on the linux X64 platform + if Link do not work ,try Re-install the gz library and copy them to the library Dir + + LDBlockShowXX/src/include/zlib + + +B) Method2 For macOS platform INSTALL + you should must pre-install the library [zlib] and copy them to the corresponding library directory + + #step1 :Should must re-install the gz library [zlib] + see [zlib] website + + #step2 : # Copy these gz library file into the corresponding library directory + + cp libz.a libz.so* LDBlockShowXX/src/include/zlib + + #step3 : + sh make.sh # or [make && make clean] + + + +C) Other Method +Note if it can't work . follow below B1-B6 or use the static Compiled [BamDeal_Linux ] +############################################ + #autoscan ./ + #cp configure.scan configure.ac + +# if can't work, follow below 6 commands + B1: aclocal #// src/automake-1.9/aclocal + B2: autoconf #// src/automake-1.9/autoconf + B3: autoheader #// src/automake-1.9/autoheader + B4: automake --add-missing #// src/automake-1.9/automake --add-missing + B5: ./configure + B6: make +############################################# +#swimming in the sky & flying in the sea# + + + +4) Contact +---------------------------------------------------------------------------------------------------------------- +################################################################################################################ +email: hewm2008@gmail.com / hewm2008@qq.com +join the QQ Group : 125293663 + + + +######################swimming in the sky and flying in the sea ########################### ## + + + diff --git a/LDBlockShow_Manual_Chinese.pdf b/LDBlockShow_Manual_Chinese.pdf new file mode 100644 index 0000000..5270bcf Binary files /dev/null and b/LDBlockShow_Manual_Chinese.pdf differ diff --git a/LDBlockShow_Manual_English.pdf b/LDBlockShow_Manual_English.pdf new file mode 100644 index 0000000..6d683ed Binary files /dev/null and b/LDBlockShow_Manual_English.pdf differ diff --git a/LICENSE b/LICENSE index b7028d2..8527ff4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 BGI-shenzhen +Copyright (c) 2018 BGI-shenzhen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..59ffde6 --- /dev/null +++ b/Makefile @@ -0,0 +1,635 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + + +pkgdatadir = $(datadir)/bin/LDBlockShow +pkgincludedir = $(includedir)/bin/LDBlockShow +pkglibdir = $(libdir)/bin/LDBlockShow +pkglibexecdir = $(libexecdir)/bin/LDBlockShow +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = LDBlockShow$(EXEEXT) +subdir = . +DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure depcomp install-sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_LDBlockShow_OBJECTS = LDBlockShow.$(OBJEXT) +LDBlockShow_OBJECTS = $(am_LDBlockShow_OBJECTS) +LDBlockShow_DEPENDENCIES = +LDBlockShow_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(LDBlockShow_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +SOURCES = $(LDBlockShow_SOURCES) +DIST_SOURCES = $(LDBlockShow_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = ${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.39/missing --run aclocal-1.11 +AMTAR = ${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.39/missing --run tar +AUTOCONF = ${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.39/missing --run autoconf +AUTOHEADER = ${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.39/missing --run autoheader +AUTOMAKE = ${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.39/missing --run automake-1.11 +AWK = gawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include +CPP = gcc -E +CPPFLAGS = +CXX = g++ +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +GREP = /bin/grep +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LDFLAGS = -L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib +LIBOBJS = +LIBS = -lz +LN_S = ln -s +LTLIBOBJS = +MAKEINFO = ${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.39/missing --run makeinfo +MKDIR_P = /bin/mkdir -p +OBJEXT = o +PACKAGE = bin/LDBlockShow +PACKAGE_BUGREPORT = hewm2008@gmail.com +PACKAGE_NAME = bin/LDBlockShow +PACKAGE_STRING = bin/LDBlockShow 1.39 +PACKAGE_TARNAME = bin-ldblockshow +PACKAGE_URL = +PACKAGE_VERSION = 1.39 +PATH_SEPARATOR = : +RANLIB = ranlib +SET_MAKE = +SHELL = /bin/sh +STRIP = +VERSION = 1.39 +abs_builddir = /ldfssz3/PUB/01.Soft/LDBlockShow-1.39 +abs_srcdir = /ldfssz3/PUB/01.Soft/LDBlockShow-1.39 +abs_top_builddir = /ldfssz3/PUB/01.Soft/LDBlockShow-1.39 +abs_top_srcdir = /ldfssz3/PUB/01.Soft/LDBlockShow-1.39 +ac_ct_CC = gcc +ac_ct_CXX = g++ +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build_alias = +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host_alias = +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.39/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = +top_builddir = . +top_srcdir = . +AUTOMAKE_OPTIONS = foreign +LDBlockShow_SOURCES = src/LDBlockShow.cpp +LDBlockShow_LDFLAGS = -g -O2 +LDBlockShow_LDADD = -lz +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .cpp .o .obj +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) && echo chmod 755 bin/\* >> $(top_srcdir)/configure +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +LDBlockShow$(EXEEXT): $(LDBlockShow_OBJECTS) $(LDBlockShow_DEPENDENCIES) + @rm -f LDBlockShow$(EXEEXT) + $(LDBlockShow_LINK) $(LDBlockShow_OBJECTS) $(LDBlockShow_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/LDBlockShow.Po + +.cpp.o: + $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: + $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +LDBlockShow.o: src/LDBlockShow.cpp + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT LDBlockShow.o -MD -MP -MF $(DEPDIR)/LDBlockShow.Tpo -c -o LDBlockShow.o `test -f 'src/LDBlockShow.cpp' || echo '$(srcdir)/'`src/LDBlockShow.cpp + $(am__mv) $(DEPDIR)/LDBlockShow.Tpo $(DEPDIR)/LDBlockShow.Po +# source='src/LDBlockShow.cpp' object='LDBlockShow.o' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o LDBlockShow.o `test -f 'src/LDBlockShow.cpp' || echo '$(srcdir)/'`src/LDBlockShow.cpp + +LDBlockShow.obj: src/LDBlockShow.cpp + $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT LDBlockShow.obj -MD -MP -MF $(DEPDIR)/LDBlockShow.Tpo -c -o LDBlockShow.obj `if test -f 'src/LDBlockShow.cpp'; then $(CYGPATH_W) 'src/LDBlockShow.cpp'; else $(CYGPATH_W) '$(srcdir)/src/LDBlockShow.cpp'; fi` + $(am__mv) $(DEPDIR)/LDBlockShow.Tpo $(DEPDIR)/LDBlockShow.Po +# source='src/LDBlockShow.cpp' object='LDBlockShow.obj' libtool=no \ +# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ +# $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o LDBlockShow.obj `if test -f 'src/LDBlockShow.cpp'; then $(CYGPATH_W) 'src/LDBlockShow.cpp'; else $(CYGPATH_W) '$(srcdir)/src/LDBlockShow.cpp'; fi` + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod u+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @$(am__cd) '$(distuninstallcheck_dir)' \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) config.h +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: all install-am install-strip + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-compile distclean-generic \ + distclean-hdr distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS + +#CPPFLAGS = --std=c++11 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..790ae88 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,6 @@ +AUTOMAKE_OPTIONS = foreign +bin_PROGRAMS = LDBlockShow +LDBlockShow_SOURCES = src/LDBlockShow.cpp +LDBlockShow_LDFLAGS = -g -O2 +LDBlockShow_LDADD = -lz +#CPPFLAGS = --std=c++11 diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..a28231e --- /dev/null +++ b/Makefile.in @@ -0,0 +1,635 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = LDBlockShow$(EXEEXT) +subdir = . +DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure depcomp install-sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_LDBlockShow_OBJECTS = LDBlockShow.$(OBJEXT) +LDBlockShow_OBJECTS = $(am_LDBlockShow_OBJECTS) +LDBlockShow_DEPENDENCIES = +LDBlockShow_LINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(LDBlockShow_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +SOURCES = $(LDBlockShow_SOURCES) +DIST_SOURCES = $(LDBlockShow_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign +LDBlockShow_SOURCES = src/LDBlockShow.cpp +LDBlockShow_LDFLAGS = -g -O2 +LDBlockShow_LDADD = -lz +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .cpp .o .obj +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +LDBlockShow$(EXEEXT): $(LDBlockShow_OBJECTS) $(LDBlockShow_DEPENDENCIES) + @rm -f LDBlockShow$(EXEEXT) + $(LDBlockShow_LINK) $(LDBlockShow_OBJECTS) $(LDBlockShow_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LDBlockShow.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +LDBlockShow.o: src/LDBlockShow.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT LDBlockShow.o -MD -MP -MF $(DEPDIR)/LDBlockShow.Tpo -c -o LDBlockShow.o `test -f 'src/LDBlockShow.cpp' || echo '$(srcdir)/'`src/LDBlockShow.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/LDBlockShow.Tpo $(DEPDIR)/LDBlockShow.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='src/LDBlockShow.cpp' object='LDBlockShow.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o LDBlockShow.o `test -f 'src/LDBlockShow.cpp' || echo '$(srcdir)/'`src/LDBlockShow.cpp + +LDBlockShow.obj: src/LDBlockShow.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT LDBlockShow.obj -MD -MP -MF $(DEPDIR)/LDBlockShow.Tpo -c -o LDBlockShow.obj `if test -f 'src/LDBlockShow.cpp'; then $(CYGPATH_W) 'src/LDBlockShow.cpp'; else $(CYGPATH_W) '$(srcdir)/src/LDBlockShow.cpp'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/LDBlockShow.Tpo $(DEPDIR)/LDBlockShow.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='src/LDBlockShow.cpp' object='LDBlockShow.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o LDBlockShow.obj `if test -f 'src/LDBlockShow.cpp'; then $(CYGPATH_W) 'src/LDBlockShow.cpp'; else $(CYGPATH_W) '$(srcdir)/src/LDBlockShow.cpp'; fi` + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod u+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @$(am__cd) '$(distuninstallcheck_dir)' \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) config.h +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: all install-am install-strip + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-compile distclean-generic \ + distclean-hdr distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS + +#CPPFLAGS = --std=c++11 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/README.md b/README.md index 2696def..028a4e5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,318 @@ -# LDBlocksShow ->LDBlockShow: a fast and effective tool for Show Region Linkage disequilibrium heatmap Figure analysis based on variant call format files +# LDBlockShow +### 1 Introduction +LDBlockShow is a fast and effective tool to generate linkage disequilibrium (LD) heatmap from VCF files. It is more time and memory saving than other current tools. LDBlockShow can generate the plots of LD heatmap and interested statistics or annotation results simultaneously. In addition, it also supports subgroup analysis. + +The [LDBlockShow article](https://doi.org/10.1093/bib/bbaa227) has been published in [briefings in bioinformatics]( https://doi.org/10.1093/bib/bbaa227), please cited this article if possible + + +PMID: [33126247](https://pubmed.ncbi.nlm.nih.gov/33126247)             DOI:[10.1093/bib/bbaa227]( https://doi.org/10.1093/bib/bbaa227) + +### 2 Download and Install +------------ + + 2.1. linux/MaxOS    [Download](https://github.com/BGI-shenzhen/LDBlockShow/archive/v1.39.tar.gz) + +
2.2 Pre-install +
LDblockshow is for Linux/Unix/macOS only. Before installing, please make sure the following pre-requirements are ready to use. +
1) g++ : g++ with [--std=c++11](https://gcc.gnu.org/) > 4.8+ is recommended +
2) zlib : [zlib](https://zlib.net/) > 1.2.3 is recommended +
3) Perl : The [SVG.pm](https://metacpan.org/release/SVG) in Perl should be installed. LDBlockShow uses this module to plot figures. We have provided a built-in SVG module in the package. + + +
2.3 Install +
Users can install it with the following options: +
Option 1: +
+        git clone https://github.com/BGI-shenzhen/LDBlockShow.git
+        chmod 755 configure  ;  ./configure;
+        make;
+        mv LDBlockShow  bin/;    #     [rm *.o]
+
+ +
**Note:** If failed to link,try to re-install the libraries [**_zlib_**](https://zlib.net/) + +
Option 2: +
+        tar -zxvf  LDBlockShowXXX.tar.gz
+        cd LDBlockShowXXX;  cd src;
+        sh  make.sh                         ## Linux :  [ make ; make clean ]
+        ../bin/LDBlockShow
+
+**Note:** For macOS, if plink doesn't work, please re-download [**mac _plinks_**](https://www.cog-genomics.org/plink2/) and put it into the directory [LDBlockShowXXX/bin] +
**Note:** If failed to link,try to re-install the libraries [**_zlib_**](https://zlib.net/) + +### 3 Parameter description +------------ +
3.1 LDBlockShow +
3.1.1 Main parameter + +```php + ./bin/LDBlockShow + + Usage: LDBlockShow -InVCF -OutPut -Region chr1:10000-20000 + + -InVCF Input SNP VCF Format + -OutPut OutPut File of LD Blocks + -Region In One Region to show LD info svg Figure + + + -SeleVar Select statistic for deal. 1: D' 2: R^2 3/4: Both [1] + -SubPop SubGroup Sample File List[ALLsample] + -BlockType method to detect Block [beta] [1] + 1. Block by PLINK (Gabriel method) + 2. Solid Spine of LD RR/D' 3. Blockcut with self-defined RR/D' + 4. FixBlock by input blocks files 5. No Block + + -InGWAS InPut GWAS Pvalue File(chr site Pvalue) + -InGFF InPut GFF3 file to show Gene CDS and name + + -BlockCut 'Strong LD' cutoff and ratio for BlockType3[0.85:0.90] + -FixBlock Input fixed block region + -MerMinSNPNum merger color grids when SNPnumber over N[50] + + -help Show more Parameters and help [hewm2008 v1.37] + +``` +
Details for above parameters: +
+-InVCF          The input file in VCF format
+-OutPut         The output file directory and output file name prefix (e.g., /path/pop1)
+-Region         The defined region to show the LD heatmap (format: chr:start:end)
+
+-SeleVar        The LD measurement (1: D' 2: R^2 3/4: Both R^2 and D'), the default is 1.
+-SubPop         A sample list for subgroup analysis
+-BlockType      The definition of blocks. The default 1 is called by PLINK1 to generate the block defined by Gabriel et al.2. Solid spine of LD3 is also supported [2]. Users can also define their own cutoff of r2 and D' for blocks [3] combined with the option of "-BlockCut" or supply their own block region definition [4] combined with the option of "-FixBlock". 5 can be used as input if users prefer to not show the block region.
+
+-InGWAS         The statistics file (e.g., association statistics, but other values such as Tajima's D can also be accepted) for generate plot together with the LD plot. File formatted as: [chr position Pvalue]
+-InGFF          Input GFF3 format file for genomic region annotation
+
+-BlockCut       For block type 3, the defined cutoff for strong LD, and the ratio of strong LD SNP in one block. Default is 0.85:0.9. That's, if the user chose D' in the -SeleVar option, then in one block, the ratio of SNP pairs with' over 0.85 is 0.9.
+-FixBlock       For block type 4, users can use this option to supply a self-defined block region. The file contains three columns, including chromosome, block region start position, and block region end position.
+-MerMinSNPNum   The minimum SNP number to merge color grids with the same color. Default is 50. Details please see Fig 1 in this manual.
+
+-help           Show more parameters
+
+ +
3.1.2 Other parameters +```php +./bin/LDBlockShow -h + + Para [-i] is show for [-InVCF], Para [-o] is show for [-OutPut], Para [-r] is show for [-Region] + + -InGenotype InPut SNP Genotype Format + -InPlink InPut Plink [bed+bim+fam] or [ped+map] file prefix + + -MAF Min minor allele frequency filter [0.05] + -Het Max ratio of het allele filter [0.90] + -Miss Max ratio of miss allele filter [0.25] + + -TagSNPCut 'Strong LD' cutoff for TagSNP [0.80] + -OutPng convert svg 2 png file + -OutPdf convert svg 2 pdf file + +``` +
Details for above parameters: +
+-InGenotype   Input file in genotype format.
+-InPlink      The prefix of input file in PLINK format.
+-MAF          Filter SNPs with low minor allele frequency (default <=0.05)
+-Het          Filter SNPs with high heterozygosis ratio (default >=0.9)
+-Miss         Filter SNPs with high missing rate (default >=0.25)
+
+-TagSNPCut    The LD cutoff for selecting tag SNPs. Default is 0.8.
+-OutPng       Convert the SVG file to PNG file
+-OutPdf       Convert SVG file to Pdf file.
+
+Note: If users failed to open small SVG files, please use the "-Outpdf" option to use the PDF file. For large SVG files, "-OutPng" can be used to get a relatively small figure file. + +
3.2 ShowLDSVG +
This program is designed for users to optimize the figure (e.g., change colors) generated by LDBlockShow. +
3.2.1 Brief parameters +```php +./bin/ShowLDSVG + Options + -InPreFix : InPut Region LD Result Frefix + -OutPut : OutPut svg file result + + -help : Show more help with more parameter +``` +
+-InPreFix     The prefix of input file (i.e., the output file of LDBlockShow)
+-OutPut       The out file (svg, png and pdf format plot files)
+-help         More parameters in detail
+
+ +
3.2.2 Detail parameters +```php +./bin/ShowLDSVG -h + -InGWAS : InPut GWAS Pvalue File(chr site Pvalue) + -NoLogP : Do not get the log Pvalue + -Cutline : show the cut off line of Pvalue + -TopSite : InPut the Special Site as the peak site(chr:pos) + -PointSize : set the GWAS point size number + -SpeSNPName : In File for Special SNP Name(chr site Name) + -ShowGWASSpeSNP : show Special SNP Name in GWAS plot with [-SpeSNPName] + + -InGFF : InPut GFF3 file to show Gene CDS and name + -NoGeneName : No show Gene name,only show stuct + -crGene : InColor for Gene Stuct [CDS:Intron:UTR:Intergenic] + default: [#e7298a:lightblue:#7570b3:#a6cee3] + + -crBegin : In Start Color RGB [255,255,255] + -crMiddle : In Middle Color RGB [240,235,75] + -crEnd : In End Color RGB [255,0,0] + -NumGradien : In Number of gradien of color + -crTagSNP : Color for TagSNP [31,120,180] + + -CrGrid : the color of grid edge [white] + -WidthGrid : the edge-width of gird [1] + -NoGrid : No Show the gird edge + + -ShowNum : Show the R^2/D' in the heatmap + -NoShowLDist : NoShow long physical distance pairwise[1000000] + -MerMinSNPNum : merge color grids when SNPnumber over N[50] + + -OutPng : convert svg 2 png file + -OutPdf : convert svg 2 pdf file + -ResizeH : resize image height; Width be resize in ratio[4096] +``` +
Details for above parameters: +
+-InGWAS         The statistics file (e.g., association statistics, but other values such as Tajima's D can also be accepted) for generate plot together with the LD plot. File formatted as: [chr position Pvalue]
+-NoLogP         By default, the P value from the -InGWAS file will be -log10 transformed, with this option, the P value will not be transformed.
+-Cutline        The significance cutline of the -InGWAS file.
+-TopSite        Users can use this option to assign one interested SNP in the GWAS plot (Default is the most significant SNP, can be changed with chr:pos).
+-PointSize      Users can use this option (any number over 0) to set the point size.
+
+-InGFF          The GFF file for genomic region annotation. By default, the gene name will be shown in the plot;
+-NoGeneName     Gene name will not be shown in the plot with this option.
+-SpeSNPName     With this option, users can input a file to indicate the names for interested SNPs, these names will be shown in the heatmap.
+-ShowGWASSpeSNP Users can use this option together with the file assigned by '-SpeSNPName' to show the names of interested SNPs in GWAS plot.
+-crGene         Define the colors of different genomic regions. By default, CDS, intron, UTR and intergenic regions will be shown in #e7298a, light blue, #7570b3, and #a6cee3, respectively.
+
+
+Parameters to optimize the color of the heatmap:
+-crBegin        Color for no LD (R^2/D'=0) default: white
+-crMiddle       Color for R^2/D'=0.5, default: yellow
+-crEnd          Color for complete LD (R^2/D'=1), default: red
+-NumGradien     The number of gradients from crBegin to crEnd
+-crTagSNP       Color for the tag SNP.
+
+Parameters to optimize the grids in the heatmap:
+-CrGrid         Border color of the grids, default: white
+-WidthGrid      The width of the border, default = 1
+-NoGrid         No border
+
+-ShowNum        Show the LD measurement value in the grids (not recommended when SNP number is over 50).
+-NoShowLDist    When the distance between SNPs over this number, their pairwise LD will not be showed in the figure. Default is 10,000,000.
+-MerMinSNPNum   When number of SNPs over the default 50, ShowLDSVG will merge adjacent same color grids. User can change this number to any integer numbers.
+-OutPng         Convert the SVG file to PNG file
+-OutPdf         Convert SVG file to Pdf file.
+-ResizeH        Set the height of the image (default 4096), which can be used to adjust the resolution for PNG file. The width will be adjusted automatically.
+
+ +
Note: When SNP number is large (e.g., over 100), the output SVG file might be very large. ShowLDSVG will merge adjacent same color grids. With smaller number of gradients (set by -NumGradien), the figure will be compressed to be smaller. -MerMinSNPNum is used to set the minimum number of SNPs, that's, if there is more SNPs than this number (default 50), the output SVG will be compressed. + +
3.3 Output files +
+out.site.gz: Remained SNPs after filtering [chr site]
+out.blocks.gz: Block file [chr start end block_length SNP_number SNPs]
+out.TriangleV.gz: Region Pairwise R^2/D'
+out.svg: Output plot in SVG format
+out.png: Output plot in png format
+out.pdf: Output plot in pdf format
+
+ + +### 4 Example +------------ + +
See more detailed usage in the             [Chinese Documentation](https://github.com/BGI-shenzhen/LDBlockShow/blob/master/LDBlockShow_Manual_Chinese.pdf) +
See more detailed usage in the             [English Documentation](https://github.com/BGI-shenzhen/LDBlockShow/blob/master/LDBlockShow_Manual_English.pdf) +
See the example directory and Manual.pdf for more detail. + + +* Example 1) show Figure with Defaut LD Blocks + +
+#../../bin/LDBlockShow   -InVCF Test.vcf.gz   -OutPut  out   -Region  chr11:24100000:24200000  -OutPng -SeleVar 1
+../../bin/LDBlockShow   -InVCF Test.vcf.gz   -OutPut  out   -Region  chr11:24100000:24200000  -OutPng -SeleVar 2
+# [-SeleVar 1] is D',[-SeleVar 2] is RR ,[-SeleVar 3] are RR and D',[-SeleVar 4] are D' and RR # the default is D'
+
+ +![out.png](https://github.com/BGI-shenzhen/LDBlockShow/blob/master/example/Example1/out.png) + + +* Example 2) Output LDHeatMap combined with GWAS statistics +``` +#../../bin/LDBlockShow -InVCF ../Example1/Test.vcf.gz -OutPut out -Region chr11:24100000:24200000 -InGWAS gwas.pvalue -OutPng +../../bin/LDBlockShow -InVCF ../Example1/Test.vcf.gz -OutPut out -Region chr11:24100000:24200000 -InGWAS gwas.pvalue -OutPng -SeleVar 4 +## you can run ShowLDSVG with more parameters to optimize the plot ## +# ../../bin/ShowLDSVG -InPreFix out -OutPut out -InGWAS gwas.pvalue -Cutline 7 -ShowNum -PointSize 3 -OutPng +``` + +![out.png](https://github.com/BGI-shenzhen/LDBlockShow/blob/master/example/Example2/out.png) + + +* Example 3) show Figure with genomic annotation +``` +#../../bin/LDBlockShow -InVCF ../Example1/Test.vcf.gz -OutPut out -InGWAS gwas.pvalue -InGFF In.gff -Region chr11:24100000:24200000 -OutPng -SeleVar 1 +../../bin/LDBlockShow -InVCF ../Example1/Test.vcf.gz -OutPut out -InGWAS gwas.pvalue -InGFF In.gff -Region chr11:24100000:24200000 -OutPng -SeleVar 2 +## you can run ShowLDSVG with more parameters to optimize the plot ## +#../../bin/ShowLDSVG -InPreFix out -OutPut out.svg -InGWAS gwas.pvalue -Cutline 7 -InGFF In.gff -crGene yellow:lightblue:pink:orange -showNum -OutPng +#../../bin/ShowLDSVG -InPreFix out -OutPut out.svg -InGFF In.gff +#../../bin/ShowLDSVG -InPreFix out -OutPut out.svg -InGWAS gwas.pvalue -Cutline 7 -InGFF In.gff -crGene yellow:lightblue:pink:orange -showNum -OutPng -SpeSNPName Spe.snp -ShowGWASSpeSNP +``` + +![out.png](https://github.com/BGI-shenzhen/LDBlockShow/blob/master/example/Example3/out.png) + + +* Example 4) show Figure (heatmap+Annotation+GWAS similar to LocusZoom) +``` +../../bin/LDBlockShow -InVCF ../Example1/Test.vcf.gz -OutPut out -InGWAS ../Example3/gwas.pvalue -InGFF ../Example3/In.gff -Region chr11:24100000:24200000 -OutPng -SeleVar 4 -TopSite +# [-SeleVar 3]: GWAS with RR ,heatmap with D'. [-SeleVar 4]: GWAS with D' ,heatmap with RR. +## you can run ShowLDSVG with more parameters to optimize the plot with para [-TopSite] ## +../../bin/ShowLDSVG -InPreFix out -OutPut out.svg -InGWAS ../Example3/gwas.pvalue -Cutline 7 -InGFF ../Example3/In.gff -crGene yellow:lightblue:pink:orange -showNum -OutPng -SpeSNPName ../Example3/Spe.snp -ShowGWASSpeSNP -TopSite +#../../bin/ShowLDSVG -InPreFix out -OutPut out.svg -InGWAS ../Example3/gwas.pvalue -Cutline 7 -InGFF ../Example3/In.gff -crGene yellow:lightblue:pink:orange -showNum -OutPng -SpeSNPName ../Example3/Spe.snp -ShowGWASSpeSNP -TopSite chr11:24142660 + +``` + +![out.png](https://github.com/BGI-shenzhen/LDBlockShow/blob/master/example/Example4/out.png) + + +### 5 Advantages +To evaluate the performance of LDBlockShow, we used test VCF files to generate the LD heatmap by using LDBlockShow, Haploview[4], LDheatmap[5] and gpart. The calculated r2 and D’values of LDBlockShow is the same with other tools. As shown in Figure below, LDBlockShow is more time and memory saving than other tools. +

+![Advantages](https://github.com/BGI-shenzhen/LDBlockShow/blob/master/example/Fig/out2.png) +
The above figure shows the comparison of computing cost for LDBlockShow, Ldheatmap, Haploview and gpart. CPU time (A) and memory cost (B) for different methods are shown with a fixed SNP number of 100 and sample size ranging from 2,000 to 60,000. CPU time (C) and memory cost (D) for different methods are shown with a fixed sample size of 2,000 and SNP number ranged from 100 to 1,200. When testing datasets in A-D, both LDBlockShow and gpart finished the analyses within reasonable time and memory. We further tested their performance when handling large dataset. CPU time (E) and memory cost (F) for these two methods are shown with a fixed sample size of 100,000 and SNP number ranged from 300 to 2,500. Computation is performed with one thread of an Intel Xeon CPU E5-2630 v4. +

As shown in Table below, LDBlockShow can generate the plots of LD heatmap and interested statistics or annotation results simultaneously. In addition, LDBlockShow also supports subgroup analysis. +
+| Performance | LDBlockShow | Haploview | LDheatmap | gpart | +|:-----------------------------------------|:-----------------------:|:---------------------:|:---------------------:|:---------------------:| +|Input | | | | | +|Compressed VCF file | √ | × | × | × | +|Uncompressed VCF file | √ | × | × | √ | +|Support subgroup analysis | √ | × | × | × | +|Output | | | | | +|Visualize additional statistics | √ | × | × | × | +|Visualize genomic annotation | √ | × | × | √ | +|Compressed SVG | √ | × | × | × | +|PNG file | √ | √ | × | √ | +|Block region | √ | √ | × | √ | +|LD measurement | R2/D' | R2/D' | R2 | R2/D' | + + +### 6 An example image generated by LDBlockShow. +------------ + +![heatmap](https://github.com/BGI-shenzhen/LDBlockShow/blob/master/example/Fig/out1.png) + +### 7 Discussing +------------ +- [:email:](https://github.com/BGI-shenzhen/LDBlockShow) hewm2008@gmail.com / hewm2008@qq.com +- join the QQ Group : 125293663 +- The [LDBlockShow article](https://doi.org/10.1093/bib/bbaa227) has been published in [briefings in bioinformatics]( https://doi.org/10.1093/bib/bbaa227), please cited this article if possible +- PMID: [33126247](https://pubmed.ncbi.nlm.nih.gov/33126247)             DOI:[10.1093/bib/bbaa227]( https://doi.org/10.1093/bib/bbaa227) + +######################swimming in the sky and flying in the sea ############################# + diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..65f291f --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,951 @@ +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 10 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/bin/LDBlockShow b/bin/LDBlockShow new file mode 100644 index 0000000..ea367cc Binary files /dev/null and b/bin/LDBlockShow differ diff --git a/bin/ShowLDSVG b/bin/ShowLDSVG new file mode 100644 index 0000000..6758b13 --- /dev/null +++ b/bin/ShowLDSVG @@ -0,0 +1,1858 @@ +#!/usr/bin/perl -w +use strict; +## you also can find the path of[svg.pm] then Replace the path below +use lib "/hwfssz4/BC_PUB/Software/03.Soft_ALL/PerlInfo/lib/perl5/"; +use Getopt::Long; +use FindBin qw($Bin); +use Data::Dumper; +################## Test systerm perl svg package exist ################ +my $SVGTest=` perl -MSVG -e " print\\\"SVG\\\" " 2> /dev/null `; +if (!((defined $SVGTest) && ($SVGTest eq "SVG" )) ) +{ + print "Warining: SVG module in Perl is missing, trying to loading the built-in [SVG.pm]...\n"; + $SVGTest=` perl -I$Bin/svg_kit -MSVG -e "print\\\"SVG\\\"" 2> /dev/null `; + + if ( !((defined $SVGTest) && ($SVGTest eq "SVG" )) ) + { + print "Warining: Can't load the [SVG.pm] Modules in myself,please install the SVG module from this URL [ https://metacpan.org/release/SVG ]\n"; + print "Pre-installations perl SVG.pm before installing/run ShowLDSVG\n"; + exit ; + } + else + { + use lib "$Bin/svg_kit"; + use SVG; + print "Loading SVG module done\n"; + } +} +else +{ + use SVG; +} +############# ######################## +my $indata; +my $OutPut; +my $help; +my $NoLogP; + +my $crBegin="255,255,255"; +my $crMiddle="240,235,75"; +my $crEnd="255,0,0"; +my $crTagSNP="231,138,195"; +my $NumGradien=100; +my $polygonbin=50; +my $grid_color="white"; +my $strokewidth=1; +my $NoGrid; +my $InGWAS; +my $Cutline; +my $InGFF; +my $ShowRR; +my $NoGeneName; +my $NoShowLDist=1000000; +my $crGene=""; +my $MerMinSNPNum=50; +my $OutPng; +my $OutPdf; +my $SpeSNPName; +my $ShowGWASSpeSNP; +my $PointSize=-1; +my $GeneLimtNum=30; +my $ResizeH=4096; +my $SNPNameSizeRatio=1.0; +my $XYLabFontSizeRatio=1.0; +my $PointSizeRatio=1.0; +my $PeakSite; +my $adjHeatmap=0; +my $WidthBlock; +my $InYName=""; +my $ShiftYName=0; +my $ShiftYGWAS=0; +my $ShiftXEndTxt=0; +my $MoreHelp; +my $YLabNumSizeRatio=1; +my $GWASSpeSNPSizeRatio=1; + +sub usage2 +{ + print STDERR < : InPut Region LD Result Frefix + -OutPut : OutPut svg/png/pdf file result + + -InGWAS : InPut GWAS Pvalue File(chr site Pvalue) + -NoLogP : Do not get the log Pvalue + -Cutline : show the cut off line of Pvalue + -TopSite : InPut the Special Site as the top site(chr:pos) + -PointSize : set the GWAS point size number + -SpeSNPName : In File for Special SNP Name(chr site Name) + -ShowGWASSpeSNP : show Special SNP Name in GWAS plot with [-SpeSNPName] + + -InGFF : InPut GFF3 file to show Gene CDS and name + -NoGeneName : No show Gene name,only show stuct + -GeneLimtNum : No show Gene structure on a new line when too many genes[30] + -crGene : InColor for Gene Stuct [CDS:Intron:UTR:Intergenic] + default ['#e7298a:lightblue:#7570b3:#a6cee3'] + + -crBegin : In Start Color RGB [255,255,255] + -crMiddle : In Middle Color RGB [240,235,75] + -crEnd : In End Color RGB [255,0,0] + -NumGradien : Number of Gradien col [auto] + -crTagSNP : Color for TagSNP [231,138,195] + + -CrGrid : the color of grid edge [white] + -WidthGrid : the edge-width of gird [1] + -NoGrid : No Show the gird edge + -ShowNum : Show the R^2/D' in the heatmap + -NoShowLDist : NoShow long physical distance pairwise[1000000] + -MerMinSNPNum : merger color grids when SNPnumber over N[50] + + -OutPng : convert svg 2 png file + -OutPdf : convert svg 2 pdf file + -ResizeH : resize image height; Width be resize in ratio[4096] + + -MoreHelp : Show some hidden para to adjust figure(less use) +USAGE +} + +sub usage3 +{ + print STDERR < : Zoom the Spe SNP Name Size [1.0] + -XYLabFontSizeRatio : Zoom the XYlab Font Size [1.0] + -PointSizeRatio : Zoom the GWAS point size [1.0] + -adjHeatmap : The ratio[-0.250,0.25] to Up[-0.25,0] or Down[0,0.25] the HeatMap in canvas [0] + -ShiftYGWAS : up or down the GWAS Figture[0] + -InYName : Show The GWAS Y lab Name(auto) + -WidthBlock : the edge-width of LD Blocks [1] + -ShiftXEndTxt : shift the X of End txt [0] + -ShiftYName : up or down the GWAS Y-lab Name [0] + -NoHeatMapPlot : Not plot the LD heatMap part + + -YLabNumSizeRatio [1.0] / -GWASSpeSNPSizeRatio [1.0] /-GFFGeneSizeRatio [1.0] + -GFFGeneNameSizeRatio [1.0] / -SNPCirSizeRatio [1.0] + +USAGE +} + +# -ShiftXShowNum [0.0] / -ShiftYShowNum [0.0] / -ShowNumSizeRatio [1.0] -ShiftYSNPNameRatio [1.0] +# -ShiftYGWASSpeSNP/ShiftXGWASSpeSNP [0.0] / -ShiftXStartTxt /-ShiftYGWASXLabTxt +# + +my $NoHeatMapPlot ; +my $ShiftXShowNum=0; +my $ShiftYShowNum=0; +my $ShiftXGWASSpeSNP=0; +my $ShiftYGWASSpeSNP=0; +my $ShiftXStartTxt=0; +my $ShowNumSizeRatio=1; +my $ShiftYGWASXLabTxt=0; +my $GFFGeneSizeRatio=1; +my $GFFGeneNameSizeRatio=1; +my $SNPCirSizeRatio=1; +my $ShiftYSNPNameRatio=1; + +GetOptions( + "InPreFix:s"=>\$indata, + "OutPut:s"=>\$OutPut, + "crBegin:s"=>\$crBegin, + "crEnd:s"=>\$crEnd, + "OutPng"=>\$OutPng, + "OutPdf"=>\$OutPdf, + "WidthBlock:s"=>\$WidthBlock, + "crMiddle:s"=>\$crMiddle, + "ShiftYGWAS:f"=>\$ShiftYGWAS, + "crTagSNP:s"=>\$crTagSNP, + "PeakSite:s"=>\$PeakSite, + "TopSite:s"=>\$PeakSite, + "MerMinSNPNum:i"=>\$MerMinSNPNum, + "SNPNameSizeRatio:f"=>\$SNPNameSizeRatio, + "XYLabFontSizeRatio:f"=>\$XYLabFontSizeRatio, + "PointSizeRatio:f"=>\$PointSizeRatio, + "CrGrid:s"=>\$grid_color, + "InGWAS:s"=>\$InGWAS, + "InGFF:s"=>\$InGFF, + "crGene:s"=>\$crGene, + "Cutline:s"=>\$Cutline, + "NumGradien:i"=>\$NumGradien, + "WidthGrid:s"=>\$strokewidth, + "PointSize:i"=>\$PointSize, + "NoShowLDist:s"=>\$NoShowLDist, + "InYName:s"=>\$InYName, + "ShiftYName:f"=>\$ShiftYName, + "SpeSNPName:s"=>\$SpeSNPName, + "ShowGWASSpeSNP"=>\$ShowGWASSpeSNP, + "help"=>\$help, + "MoreHelp"=>\$MoreHelp, + "NoGeneName"=>\$NoGeneName, + "ShowRR"=>\$ShowRR, + "ShowNum"=>\$ShowRR, + "NoLogP"=>\$NoLogP, + "NoGrid"=>\$NoGrid, + "GeneLimtNum:s"=>\$GeneLimtNum, + "ResizeH:i"=>\$ResizeH, + "adjHeatmap:f"=>\$adjHeatmap, + "YLabNumSizeRatio:f"=>\$YLabNumSizeRatio, + "GWASSpeSNPSizeRatio:f"=>\$GWASSpeSNPSizeRatio, + "ShiftXShowNum:f"=>\$ShiftXShowNum, + "ShiftYShowNum:f"=>\$ShiftYShowNum, + "ShowNumSizeRatio:f"=>\$ShowNumSizeRatio, + "ShiftXGWASSpeSNP:f"=>\$ShiftXGWASSpeSNP, + "ShiftYGWASSpeSNP:f"=>\$ShiftYGWASSpeSNP, + "ShiftXEndTxt:f"=>\$ShiftXEndTxt, + "ShiftXStartTxt:f"=>\$ShiftXStartTxt, + "ShiftYGWASXLabTxt:f"=>\$ShiftYGWASXLabTxt, + "GFFGeneSizeRatio:f"=>\$GFFGeneSizeRatio, + "GFFGeneNameSizeRatio:f"=>\$GFFGeneNameSizeRatio, + "SNPCirSizeRatio:f"=>\$SNPCirSizeRatio, + "ShiftYSNPNameRatio:f"=>\$ShiftYSNPNameRatio, + "NoHeatMapPlot"=>\$NoHeatMapPlot, +); + +sub usage +{ + print STDERR < : InPut Region LD Result Frefix + + -OutPut : OutPut svg file result + + -help : Show more help with more parameter + +USAGE +} + + +#############swimming in the sky and flying in the sea ######### +if ( defined($MoreHelp) ) +{ + usage3 ; + exit(1) ; +} + + +if ( defined($help) ) +{ + usage2 ; + exit(1) ; +} + +if( !defined($indata) ) +{ + usage ; + exit(1) ; +} + +my $SiteFInfo="$indata.site.gz"; +my $SiteLD="$indata.TriangleV.gz"; +my $SiteLDB="$indata.TriangleB.gz"; + +if (!(-e $SiteFInfo )) +{ + print "\t\tCan't Found the Site file : $SiteFInfo \n"; + exit ; +} +if (!(-e $SiteLD )) +{ + print "\t\tCan't Found the Site file : $SiteLD \n"; + exit ; +} + +if (($adjHeatmap > 0.25) || ($adjHeatmap < -0.25)) +{ + print "\t\t-adjHeatmap should be [-0.25,0.25]. [-0.25,0] for move up; 0 no move ; [0, 0.25] move down\n "; + exit; +} + +my $crCDS="#e7298a"; +my $crIntron="lightblue"; +my $crUTR="#7570b3"; +my $crIntergenic ="#a6cee3"; + +if ($crGene ne "") +{ + if ($crGene=~/:/) + { + my @EEcor=split /\:/,$crGene; + if ($#EEcor<2) + { + print "Para -crGene format should be [lightblue:pink:yellow]\n"; + exit; + } + $crCDS=$EEcor[0]; + $crIntron=$EEcor[1]; + $crUTR=$EEcor[2]; + if ($#EEcor==3) + { + $crIntergenic=$EEcor[3]; + } + } + else + { + print "Para -crGene format should be [lightblue:pink:yellow]\n"; + exit; + } +} + +open (IA,"gzip -cd $SiteFInfo | ") || die "input file can't open $!"; +my @ArrSNP ; +my $SNPNumber=0; +my %hashSNP=(); +my $chrName=""; +while() +{ + chomp ; + my @inf=split ; + $ArrSNP[$SNPNumber]=$inf[1]; + $hashSNP{$inf[1]}=$SNPNumber; + $SNPNumber++; + $chrName=$inf[0]; +} +close IA ; +my $Accu="%.2f"; + +if (defined ($PeakSite)) +{ + if ($PeakSite ne "") + { + $PeakSite=(split(/[\:-]/,$PeakSite))[-1]; + if (!exists $hashSNP{$PeakSite}) + { + print "InPut Peak Site must be one of the SNP datas in LDheat, however $PeakSite is not\n"; + exit; + } + } +} + +my $tmpNumGradien=$NumGradien ; + +if ( $SNPNumber>10000) +{ + print "Too many SNP site $SNPNumber , I suggest that you randomly select fewer sites to reshow , and here I try to draw ...\n"; + $polygonbin=int($polygonbin/20); + $Accu="%.0f"; + $strokewidth=0; + $tmpNumGradien=10; + if ( !(defined($OutPng)) ) + { + print "Too many SNP site $SNPNumber , I suggest that you add the Para [-OutPng] to see the png File\n"; + } +} +elsif ($SNPNumber>5000) +{ + print "Too many SNP site $SNPNumber , I suggest that you randomly select fewer sites to reshow , and here I try to draw ...\n"; + $polygonbin=int($polygonbin/15); + $Accu="%.0f"; + $strokewidth=0; + $tmpNumGradien=10; + if ( !(defined($OutPng)) ) + { + print "Too many SNP site $SNPNumber , I suggest that you add the Para [-OutPng] to see the png File\n"; + } +} +elsif ($SNPNumber>=1000) +{ + $polygonbin=int($polygonbin/10); + $Accu="%.0f"; + $strokewidth=0; + $tmpNumGradien=10; + if ( !(defined($OutPng)) ) + { + print "Too many SNP site $SNPNumber , I suggest that you add the Para [-OutPng] to see the png File\n"; + } +} +elsif ($SNPNumber>=500) +{ + $polygonbin=int($polygonbin/5); + $Accu="%.1f"; + $strokewidth=0; + $tmpNumGradien=20; +} +elsif ($SNPNumber>=100) +{ + $strokewidth=0; + $tmpNumGradien=32; +} +elsif ($SNPNumber>50) +{ + $strokewidth=0; + $tmpNumGradien=40; +} + +if ( $tmpNumGradien < $NumGradien ) +{ + $NumGradien=$tmpNumGradien; + print "In Big SNP Number :$SNPNumber ,Para -NumGradien suggest be maxValue : $NumGradien ,auto be it\n"; +} + +if ( ($SNPNumber> 400) && ($MerMinSNPNum>=$SNPNumber) ) +{ + print "In Big SNP Number :$SNPNumber ,Para -MerMinSNPNum suggest shoule be biger than SNPNumber $SNPNumber.\n"; +} + +if (defined $NoGrid) +{ + $strokewidth=0; +} + +#my $NoShowWhite=0;if ( $strokewidth==0 && $crBegin eq "255,255,255" ){ $NoShowWhite=1;} + +my $halfbin=sprintf ($Accu,$polygonbin*1.0/2); +$polygonbin=sprintf ($Accu,$halfbin*2.0); + +my $Fig=$SNPNumber*$polygonbin; + +my $sdlf=$Fig*0.05; +my $LineH=$Fig*0.25; +my $LingGG=$Fig*0.38; + +my ($up, $down, $left, $right) = ($sdlf,$sdlf,$sdlf*2, $sdlf); +if ($SNPNumber<5) +{ + $up=$sdlf*3; $LineH=$Fig*0.8; $left=$sdlf*4; $right=$sdlf*2; +} +elsif ($SNPNumber<10) +{ + $up=$sdlf*3; $LineH=$Fig*0.4; $left=$sdlf*3; $right=$sdlf*3; +} + + +my @StartRGB=split /\,/,$crBegin ; +my @EndRGB=split /\,/,$crEnd ; +my @MidRGB=split /\,/,$crMiddle ; + +my $Atmp=$Fig/40; +my $Btmp=$Fig/3; + +my $SedHH=$LineH/2; +if ($SedHH< $polygonbin*2) {$SedHH=$polygonbin*2;} + +my $fontsize=$SedHH/10; + + +if ( defined($InGWAS)) +{ + $up+=$LingGG; + if (defined $PeakSite) + { + $right+=$fontsize*2; + } +} + + +my $height=$up+$down+$Fig/2+$LineH; +my $width=$left+$right+$Fig; + +my $ZoomRatio=1; +if ($height>$ResizeH) +{ + my $aa=$ResizeH*1.0/$height; + $ZoomRatio=sprintf ("%.1f",$ResizeH*1.0/$height+0.045); + if ($ZoomRatio<0.1) + { + $ZoomRatio=sprintf ("%.2f",$ResizeH*1.0/$height); + if ($ZoomRatio<0.04) {$ZoomRatio=0.04;} + } + if ($ZoomRatio>0.98) {$ZoomRatio=1;} + $ShiftYName=$ShiftYName/$ZoomRatio; + $ShiftYGWAS=$ShiftYGWAS/$ZoomRatio; + $PointSize=$PointSize/$ZoomRatio; + +} + +my $StrokeWidthV2=$fontsize*$ZoomRatio/8; if ($StrokeWidthV2<1) {$StrokeWidthV2=1;} + +my $widthNew=$width*$ZoomRatio; +my $heightNew=$height*$ZoomRatio; + +print STDERR "Start draw... SVG info: SNPNumber :$SNPNumber , SVG (width,height) = ($widthNew,$heightNew)\n"; + + +my $svg=SVG->new('width',$widthNew,'height',$heightNew); + + + +$SNPNumber--; + +my @ArryCol=(); +if ($NumGradien<10) +{ + print "Color Gradien Numner must > 10 : $NumGradien\n"; + exit ; +} + + + + + + +my $X1=$left+$Fig*2/3+$Btmp*0/$NumGradien; +my $X2=$left+$Fig*2/3+$Btmp*($NumGradien+1)/$NumGradien; +my $Y2=$height-$down; +my $Y1= $Y2-$Atmp; + +my $path = $svg->get_path( + x => [$X1*$ZoomRatio, $X1*$ZoomRatio, $X2*$ZoomRatio,$X2*$ZoomRatio], + y => [$Y1*$ZoomRatio, $Y2*$ZoomRatio, $Y2*$ZoomRatio,$Y1*$ZoomRatio], + -type => 'polygon'); + +$svg->polygon( + %$path, + style => { + 'fill' =>'none', + 'stroke' => 'black', + 'stroke-width' => $StrokeWidthV2, + 'stroke-opacity' => 1, + 'fill-opacity' => 1, + }, +); + +if ( ( -e $SiteLDB ) && (defined($InGWAS) ) && (defined $PeakSite)) +{ + $SiteLD=$SiteLDB; +} +#open (IB,"$SiteLD") || die "input file can't open $!"; +open (IB,"gzip -cd $SiteLD | ") || die "input file can't open $!"; +$_=; chomp $_; +my $CalV=(split(/\s+/,$_))[-1]; + +my $XXXNew=int ($left+$Fig*2/3)*$ZoomRatio; +my $YYYNew=($height-$down+$Atmp)*$ZoomRatio; + +$svg->text('text-anchor','middle','x',$XXXNew,'y',$YYYNew,'-cdata',"0.0",'font-family','Arial','font-size',$Atmp*$ZoomRatio); +$XXXNew=int ($left+$Fig*2/3+$Btmp)*$ZoomRatio; +$YYYNew=($height-$down+$Atmp)*$ZoomRatio; +$svg->text('text-anchor','middle','x',$XXXNew,'y',$YYYNew,'-cdata',"1.0",'font-family','Arial','font-size',$Atmp*$ZoomRatio); + +$tmpNumGradien=int($NumGradien*0.5); + +foreach my $k (0..$tmpNumGradien) +{ + my $RR=int($StartRGB[0]+($MidRGB[0]-$StartRGB[0])*$k*2.0/$NumGradien); + my $GG=int($StartRGB[1]+($MidRGB[1]-$StartRGB[1])*$k*2.0/$NumGradien); + my $BB=int($StartRGB[2]+($MidRGB[2]-$StartRGB[2])*$k*2.0/$NumGradien); + $ArryCol[$k]="$RR,$GG,$BB"; + my $X1=$left+$Fig*2/3+$Btmp*$k/$NumGradien; + my $X2=$left+$Fig*2/3+$Btmp*($k+1)/$NumGradien; + my $Y2=$height-$down; + my $Y1= $Y2-$Atmp; + + my $path = $svg->get_path( + x => [$X1*$ZoomRatio, $X1*$ZoomRatio, $X2*$ZoomRatio,$X2*$ZoomRatio], + y => [$Y1*$ZoomRatio, $Y2*$ZoomRatio, $Y2*$ZoomRatio,$Y1*$ZoomRatio], + -type => 'polygon'); + + $svg->polygon( + %$path, + style => { + 'fill' => "rgb($RR,$GG,$BB)", + 'stroke' => 'black', + 'stroke-width' => 0, + 'stroke-opacity' => 1, + 'fill-opacity' => 1, + }, + ); +} + +$tmpNumGradien++; +foreach my $k ($tmpNumGradien..$NumGradien) +{ + my $RR=int($MidRGB[0]+($EndRGB[0]-$MidRGB[0])*($k-$tmpNumGradien+1)*2.0/$NumGradien); + my $GG=int($MidRGB[1]+($EndRGB[1]-$MidRGB[1])*($k-$tmpNumGradien+1)*2.0/$NumGradien); + my $BB=int($MidRGB[2]+($EndRGB[2]-$MidRGB[2])*($k-$tmpNumGradien+1)*2.0/$NumGradien); + $ArryCol[$k]="$RR,$GG,$BB"; + + my $X1=$left+$Fig*2/3+$Btmp*$k/$NumGradien; + my $X2=$left+$Fig*2/3+$Btmp*($k+1)/$NumGradien; + my $Y2=$height-$down; + my $Y1= $Y2-$Atmp; + + my $path = $svg->get_path( + x => [$X1*$ZoomRatio, $X1*$ZoomRatio, $X2*$ZoomRatio,$X2*$ZoomRatio], + y => [$Y1*$ZoomRatio, $Y2*$ZoomRatio, $Y2*$ZoomRatio,$Y1*$ZoomRatio], + -type => 'polygon'); + + $svg->polygon( + %$path, + style => { + 'fill' => "rgb($RR,$GG,$BB)", + 'stroke' => 'black', + 'stroke-width' => 0, + 'stroke-opacity' => 1, + 'fill-opacity' => 1, + }, + ); +} + + + + + +my $BlcokLength=$ArrSNP[$SNPNumber]-$ArrSNP[0]; +if ($BlcokLength> $NoShowLDist ) +{ + print "\tTip: The region you inputed is greater than the Para [-NoShowLDist], and this will call LDheatmap to be a not-complete triangle. You can modify the parameter [-NoShowLDist] according to your needs.\n"; +} + +my $XX1=$left; my $XX2=$left+$SNPNumber*$polygonbin; + +my $YY1=$up+$LineH-$SedHH; +my $YY2=$YY1+$sdlf*0.8; + +$path = $svg->get_path( + x => [$XX1*$ZoomRatio, $XX1*$ZoomRatio, $XX2*$ZoomRatio,$XX2*$ZoomRatio], + y => [$YY1*$ZoomRatio, $YY2*$ZoomRatio, $YY2*$ZoomRatio,$YY1*$ZoomRatio], + -type => 'polygon'); +$svg->polygon( + %$path, + style => { + 'fill' => "$crIntergenic", + 'stroke' => 'black', + 'stroke-width' => 0, + 'stroke-opacity' => 1, + 'fill-opacity' => 1, + }, +); + + +my $ratio=($XX2-$XX1)*1.0/($ArrSNP[$SNPNumber]-$ArrSNP[0]); + +my $GeneNameUp=$fontsize; + + +############################################ Deal the InGFF Result ############## +if ( defined($InGFF) ) +{ + + open (INGFF,"$InGFF") || die "input file can't open $!"; + + my $mRNANum=0; + my %hashCDS_End=(); + + while() + { + chomp ; + my @inf=split ; + next if ($#inf<5); + next if ($inf[0] ne $chrName ); + next if ($inf[3] > $ArrSNP[$SNPNumber]); + next if ($inf[3] < $ArrSNP[0]); + my $CDSX1=$left+($inf[3]-$ArrSNP[0])*$ratio; + my $CDSX2=$left+($inf[4]-$ArrSNP[0])*$ratio; + my $rgbV=$crCDS; + if ($inf[2] eq "mRNA" ) + { + $rgbV=$crIntron; + $mRNANum++; + if (defined($NoGeneName)) + { + } + else + { + my @temBB=split /\;/,$inf[-1]; + my @temCC=split /\=/,$temBB[0]; + my @temDD=split /\:/,$temCC[-1]; + my $GeneName=$temDD[0]; + $XXXNew=int(($CDSX1+$CDSX2)/2)*$ZoomRatio; + $YYYNew=($YY1-$fontsize)*$ZoomRatio; + $svg->text('text-anchor','middle','x',$XXXNew,'y',$YYYNew,'-cdata',"$GeneName",'font-family','Arial','font-size',$fontsize*$ZoomRatio*$GFFGeneNameSizeRatio); + $GeneNameUp=$fontsize*2; + } + } + elsif ($inf[2] eq "CDS") + { + my @temBB=split /\;/,$inf[-1]; + my @temCC=split /\=/,$temBB[0]; + my @temDD=split /\:/,$temCC[-1]; + my $GeneName=$temDD[0]; + $hashCDS_End{$GeneName}=$inf[3]; + } + elsif ($inf[2] =~ "UTR") + { + $rgbV=$crUTR; + } + else + { + next; + } + + $path = $svg->get_path( + x => [$CDSX1*$ZoomRatio, $CDSX1*$ZoomRatio, $CDSX2*$ZoomRatio,$CDSX2*$ZoomRatio], + y => [$YY1*$ZoomRatio,$YY2*$ZoomRatio,$YY2*$ZoomRatio,$YY1*$ZoomRatio], + -type => 'polygon'); + $svg->polygon( + %$path, + style => { + 'fill' => "$rgbV", + 'stroke' => 'black', + 'stroke-width' => 0, + 'stroke-opacity' => 1, + 'fill-opacity' => 1, + }, + ); + + } + close INGFF ; + + if ( ($mRNANum>1) && ($mRNANum<$GeneLimtNum) ) + { + open (INGFF2,"$InGFF") || die "input file can't open $!"; + + my %hashCDS_Start=(); + my $YmRNAline=$YY1-$fontsize*$GFFGeneSizeRatio*0.5; + my $YCDSA=$YmRNAline-$fontsize*$GFFGeneSizeRatio*0.25; + my $YCDSB=$YmRNAline+$fontsize*$GFFGeneSizeRatio*0.25; + + my $YCDSAA=$YmRNAline-$fontsize*$GFFGeneSizeRatio*0.125; + my $YCDSBB=$YmRNAline+$fontsize*$GFFGeneSizeRatio*0.125; + + my $YmRNAstrokewidth = int ($fontsize*$ZoomRatio/10); + if ($YmRNAstrokewidth<1) {$YmRNAstrokewidth=1;} + + while() + { + chomp ; + my @inf=split ; + next if ($#inf<5); + next if ($inf[0] ne $chrName ); + next if ($inf[3] > $ArrSNP[$SNPNumber]); + next if ($inf[3] < $ArrSNP[0]); + my $CDSX1=$left+($inf[3]-$ArrSNP[0])*$ratio; + my $CDSX2=$left+($inf[4]-$ArrSNP[0])*$ratio; + my $rgbV=$crCDS; + next if ( ($inf[2] ne "mRNA") && ( $inf[2] ne "CDS" ) ); + if ($inf[2] eq "mRNA" ) + { + $rgbV=$crIntron; + $svg->line('x1',$CDSX1*$ZoomRatio,'y1',$YmRNAline*$ZoomRatio,'x2',$CDSX2*$ZoomRatio,'y2',$YmRNAline*$ZoomRatio,'stroke',"$rgbV",'stroke-width',$YmRNAstrokewidth); #X + } + else + { + #hashCDS_End + $path = $svg->get_path( + x => [$CDSX1*$ZoomRatio, $CDSX1*$ZoomRatio, $CDSX2*$ZoomRatio,$CDSX2*$ZoomRatio], + y => [$YCDSA*$ZoomRatio,$YCDSB*$ZoomRatio,$YCDSB*$ZoomRatio,$YCDSA*$ZoomRatio], + -type => 'polygon'); + + my @temBB=split /\;/,$inf[-1]; + my @temCC=split /\=/,$temBB[0]; + my @temDD=split /\:/,$temCC[-1]; + my $GeneName=$temDD[0]; + if (!exists $hashCDS_Start{$GeneName}) + { + if ( $inf[6] eq '+') + { + $path = $svg->get_path( + x => [$CDSX1*$ZoomRatio,$CDSX1*$ZoomRatio, $CDSX2*$ZoomRatio,$CDSX2*$ZoomRatio], + y => [$YCDSAA*$ZoomRatio,$YCDSBB*$ZoomRatio, $YCDSB*$ZoomRatio,$YCDSA*$ZoomRatio], + -type => 'polygon'); + } + $hashCDS_Start{$GeneName}=1; + } + + if ( $hashCDS_End{$GeneName} == $inf[3] ) + { + if ( $inf[6] eq '-') + { + $path = $svg->get_path( + x => [$CDSX1*$ZoomRatio, $CDSX1*$ZoomRatio, $CDSX2*$ZoomRatio,$CDSX2*$ZoomRatio], + y => [$YCDSA*$ZoomRatio,$YCDSB*$ZoomRatio,$YCDSBB*$ZoomRatio,$YCDSAA*$ZoomRatio], + -type => 'polygon'); + } + } + + $svg->polygon( + %$path, + style => { + 'fill' => "$rgbV", + 'stroke' => "$rgbV", + 'stroke-width' => 0, + 'stroke-opacity' => 1, + 'fill-opacity' => 1, + }, + ); + + + } + } + close INGFF2; + } + + +} + + + +my $Textbin=1000000; my $label="Mb"; +my $TextEnd=$BlcokLength; +if (($TextEnd/$Textbin)<1) +{ + $Textbin=1000; $label="kb"; + if (( $TextEnd/$Textbin)<1 ) + { + $Textbin=1;$label="bp"; + } +} +$TextEnd=sprintf ("%.2f",$TextEnd/$Textbin); +$XXXNew=int (($XX1+$XX2)/2)*$ZoomRatio; +$YYYNew=($YY1-$GeneNameUp+$ShiftYGWAS)*$ZoomRatio; +$svg->text('text-anchor','middle','x',$XXXNew,'y',$YYYNew,'-cdata',"$chrName Region:$TextEnd ($label)",'font-family','Arial','font-size',$fontsize*$XYLabFontSizeRatio*$ZoomRatio); + +$Textbin=1000000; $label="Mb"; +$TextEnd=$ArrSNP[$SNPNumber]; +my $AccuV2="%.3f"; +if (($TextEnd/$Textbin)<1) +{ + $Textbin=1000; $label="kb"; + $AccuV2="%.2f"; + if (( $TextEnd/$Textbin)<1 ) + { + $Textbin=1;$label="bp"; + $AccuV2="%.0f"; + } +} +$TextEnd=sprintf ($AccuV2,$TextEnd/$Textbin); +$XXXNew=(int($XX2))*$ZoomRatio+$ShiftXEndTxt; +$YYYNew=($YY1-$GeneNameUp+$ShiftYGWAS)*$ZoomRatio+$ShiftYGWASXLabTxt; + +$svg->text('text-anchor','middle','x',$XXXNew,'y',$YYYNew,'-cdata',"End:$TextEnd ($label)",'font-family','Arial','font-size',$fontsize*$XYLabFontSizeRatio*$ZoomRatio); +$TextEnd=sprintf ($AccuV2,$ArrSNP[0]/$Textbin); +$XXXNew=(int ($XX1))*$ZoomRatio+$ShiftXStartTxt; +$svg->text('text-anchor','middle','x',$XXXNew,'y',$YYYNew,'-cdata',"Start:$TextEnd ",'font-family','Arial','font-size',$fontsize*$XYLabFontSizeRatio*$ZoomRatio); + + + + + + + +my @LDdata=(); +my $count=0; +my $spilitBin=1.00/$NumGradien; + +while() +{ + chomp ; + my @inf=split ; + $LDdata[$count][$count]=$NumGradien; + foreach my $k (0..$#inf) + { + my $RRcol=int($inf[$k]/$spilitBin); + my $keyX=$k+1+$count; + $LDdata[$keyX][$count]=$RRcol; + } + $count++; +} +close IB; + + + +$StrokeWidthV2=$fontsize*$ZoomRatio/16; if ($StrokeWidthV2<1) {$StrokeWidthV2=1;} +my $tempYYA=$up+$LineH-$polygonbin; +if ( defined($SpeSNPName)) +{ + $tempYYA=$YY2+($tempYYA-$YY2)/2; +} + + +my $cirsize=$fontsize/2; +if ($SNPNumber<10 ) {$cirsize=$fontsize/2.5;} +if ($PointSize>0 ) { $cirsize=$PointSize;} +$cirsize=$cirsize*$PointSizeRatio; + +###################### Plot Special SNP infomation ###################### + +my %hashSpeSNP=(); +my $MaxSpeNameLength=0; + +if ( defined($SpeSNPName)) +{ + if ($SpeSNPName=~s/.gz$/.gz/g) + { + open (ISS,"gzip -cd $SpeSNPName | ") || die "input file can't open $!"; + } + else + { + open (ISS,"$SpeSNPName") || die "input file can't open $!"; + } + + my $XX; + my $NameFortSize=$SNPNameSizeRatio*$fontsize*$ZoomRatio; + my $cirsizeZoomRatio=$SNPCirSizeRatio*$cirsize*$ZoomRatio; + my $labYY=$tempYYA+$cirsize*$ShiftYSNPNameRatio; + $YYYNew=sprintf ($Accu,$tempYYA*$ZoomRatio); + $labYY=sprintf ($Accu,$labYY*$ZoomRatio); + while() + { + chomp ; + my @inf=split ; + next if ($#inf<1); + next if ($inf[0] ne $chrName ); + next if ($inf[1] > $ArrSNP[$SNPNumber]); + next if ($inf[1] < $ArrSNP[0]); + if (exists $hashSNP{$inf[1]}) + { + $XX=$left+$hashSNP{$inf[1]}*$polygonbin; + } + else + { + $XX=$left+(($inf[1]-$ArrSNP[0])*$ratio); + } + $XXXNew=sprintf ($Accu,$XX*$ZoomRatio); + $svg->circle(cx=>$XXXNew, cy=>$YYYNew, r=>$cirsizeZoomRatio, fill => "rgb($crTagSNP)"); + + $XX=$XX-$cirsize; + if ( ($#inf>1) && ($inf[2] ne "")) + { + $svg->text('x',$XXXNew,'y',$labYY,'-cdata',"$inf[2]",'font-size',$NameFortSize,'font-family','Arial','transform',"rotate(90,$XXXNew,$labYY)"); + $hashSpeSNP{$inf[1]}=$inf[2]; + if (length($inf[2]) > $MaxSpeNameLength) + { + $MaxSpeNameLength=length($inf[2]); + } + } + } + close ISS ; +} + + + + + + + + + + + + + +################# Deal the GWAS Result ############## + +if ( defined($InGWAS)) +{ + my $tmp_up=$up; + $up-=$LingGG; + $LingGG=$LingGG-$sdlf-$fontsize-$GeneNameUp; + + my $Beww=($YY1-$fontsize*5)-($up+$LingGG); + if ($Beww>0) + { + $up=$up+$Beww; + } + $up+=$ShiftYGWAS; + my $cutoffGWAS=7.2; + open (IE,"$InGWAS") || die "input file can't open $!"; + my %hashPvalue=(); + my $MaxP=""; + my $MinP=""; + my $MinSite=""; + while() + { + chomp ; + my @inf=split ; + next if ($#inf<2); + next if ($inf[0] ne $chrName ); + next if ($inf[1] > $ArrSNP[$SNPNumber]); + next if ($inf[1] < $ArrSNP[0]); + $hashPvalue{$inf[1]}=$inf[2]; + if ($MaxP eq "" ) + { + $MaxP=$inf[2]; + } + elsif ($MaxP < $inf[2]) + { + $MaxP=$inf[2]; + } + if ($MinP eq "" ) + { + $MinP=$inf[2]; + $MinSite=$inf[1]; + } + elsif ($MinP > $inf[2]) + { + $MinP=$inf[2]; + $MinSite=$inf[1]; + } + } + + close IE; + + my $strokewidthGWAS = int ($fontsize*$ZoomRatio/8); + if ($strokewidthGWAS<1) {$strokewidthGWAS=1;} + $YYYNew=($up+$LingGG)*$ZoomRatio; + $svg->line('x1',$left*$ZoomRatio,'y1',$YYYNew,'x2',$XX2*$ZoomRatio,'y2',$YYYNew,'stroke','black','stroke-width',$strokewidthGWAS); #X + $svg->line('x1',$left*$ZoomRatio,'y1',$YYYNew,'x2',$left*$ZoomRatio,'y2',$up*$ZoomRatio,'stroke','black','stroke-width',$strokewidthGWAS); # Y + + my $binYcut=5; + + my $cutXXBin=($XX2-$left)/$binYcut; + foreach my $k (0..$binYcut) + { + my $tmpXX=$k*$cutXXBin+$left; + $svg->line('x1',$tmpXX*$ZoomRatio,'y1',$YYYNew,'x2',$tmpXX*$ZoomRatio,'y2',($up+$LingGG+$cirsize)*$ZoomRatio,'stroke','black','stroke-width',$strokewidthGWAS); + } + + my $yltmp=$left/5; + + my $Msx; + + if (defined $NoLogP) + { + my $TextXX=$left/3 ; my $TextYY=$up+$LingGG*2/3+$ShiftYName; + if ( $InYName eq "") { $InYName ="Pvalue";} + $XXXNew=$TextXX*$ZoomRatio; + $YYYNew=$TextYY*$ZoomRatio; + $svg->text('x',$XXXNew,'y',$YYYNew,'-cdata',$InYName,'font-size',$fontsize*$XYLabFontSizeRatio*$ZoomRatio,'font-family','Arial','transform',"rotate(-90,$XXXNew,$YYYNew)"); + $Msx=$LingGG/($MaxP-$MinP); + + foreach my $k (0..$binYcut) + { + my $AHHtmp=$LingGG*$k/$binYcut; + my $YV=$up+$LingGG-$AHHtmp; + my $Ynum=$MinP+($MaxP-$MinP)*$k/$binYcut; + my $bb=length((split(/\./,$Ynum))[-1]); + if ($bb>3) + { + $Ynum=sprintf ("%.2f",$Ynum); + } + $svg->line('x1',($left-$yltmp)*$ZoomRatio,'y1',$YV*$ZoomRatio,'x2',$left*$ZoomRatio,'y2',$YV*$ZoomRatio,'stroke','black','stroke-width',$strokewidthGWAS); + $svg->text('x',($left-$yltmp-$yltmp)*$ZoomRatio,'y',$YV*$ZoomRatio,'-cdata',"$Ynum",'font-size',$fontsize*$ZoomRatio*$YLabNumSizeRatio,'font-family','Arial'); + } + } + else + { + foreach my $key (keys %hashPvalue) + { + $hashPvalue{$key}=0-((log($hashPvalue{$key}))/log(10)); + } + my $temp=$MinP; + $MinP=0-sprintf ("%.2f",(log($MaxP)/log(10))); + $MaxP=0-sprintf ("%.2f",(log($temp)/log(10))); + + my $sliYbin=1; + if ($MinP>0) { $MinP=0;} + if ($MaxP>4) {$MaxP=int($MaxP)+1; $sliYbin=int($MaxP/5+0.48); if ($sliYbin>5) {$sliYbin=(int($sliYbin/5))*5;} } + if ($MaxP<4) { $MaxP=4;} + $Msx=$LingGG/($MaxP-$MinP); + my $shiftlen=length($MaxP)+0.88; if ($shiftlen>3.1) {$shiftlen=3.5;} + $shiftlen=$yltmp*$shiftlen; + + for(my $Ynum=0 ; $Ynum<=$MaxP ; $Ynum+=$sliYbin) + { + my $YV=$up+$LingGG-$Ynum*$Msx; + $svg->line('x1',($left-$yltmp)*$ZoomRatio,'y1',$YV*$ZoomRatio,'x2',$left*$ZoomRatio,'y2',$YV*$ZoomRatio,'stroke','black','stroke-width',$strokewidthGWAS); + $svg->text('x',($left-$shiftlen)*$ZoomRatio,'y',$YV*$ZoomRatio,'-cdata',"$Ynum",'font-size',$fontsize*$ZoomRatio*$YLabNumSizeRatio,'font-family','Arial'); + } + $shiftlen+=$yltmp/2; + my $TextXX=$left-$shiftlen ; my $TextYY=$up+$LingGG*21/30+$ShiftYName; + if ( $InYName eq "") { $InYName ="-lg(Pvalue)";} + $XXXNew=$TextXX*$ZoomRatio; + $YYYNew=$TextYY*$ZoomRatio; + $svg->text('x',$XXXNew,'y',$YYYNew,'-cdata',$InYName,'font-size',$fontsize*$XYLabFontSizeRatio*$ZoomRatio,'font-family','Arial','transform',"rotate(-90,$XXXNew,$YYYNew)"); + } + + + + + if (defined $Cutline ) + { + $cutoffGWAS=$Cutline; + if ( ($Cutline > $MinP) && ($Cutline < $MaxP) ) + { + my $labYY=$up+$LingGG-($Cutline-$MinP)*$Msx; + my $AA=$strokewidthGWAS*3; my $BB=$strokewidthGWAS*2; + $svg->line('x1',$left*$ZoomRatio,'y1',$labYY*$ZoomRatio,'x2',$XX2*$ZoomRatio,'y2',$labYY*$ZoomRatio,'stroke','red','stroke-width',$strokewidthGWAS,'stroke-dasharray',"$AA $BB"); #cut off + } + } + + + + + + + my @ColArrTmp=(); + $ColArrTmp[0]="#D43F3A"; $ColArrTmp[1]="#EEA236"; + $ColArrTmp[2]="#5CB85C"; $ColArrTmp[3]="#46B8DA"; + $ColArrTmp[4]="#357EBD"; $ColArrTmp[5]="#B8B8B8"; + + my $cirsizeZoomRatio=$cirsize*$ZoomRatio; + ############# locusroom ########## + + if (defined $PeakSite) + { + + my $tmpFB=2*$fontsize; + $binYcut++; + if( ($tmpFB*$binYcut*2) > $LingGG ) + { + $tmpFB=$LingGG/($binYcut*2); + } + my $CX1=$XX2; my $CX2=$CX1+$tmpFB; my $CX3=$CX2+$tmpFB*0.2; + $binYcut--; + foreach my $thiscol (0..$binYcut) + { + my $CY1=$up+$thiscol*$tmpFB; + my $CY2= $CY1+$tmpFB; + + my $path = $svg->get_path( + x => [$CX1*$ZoomRatio, $CX1*$ZoomRatio, $CX2*$ZoomRatio,$CX2*$ZoomRatio], + y => [$CY1*$ZoomRatio, $CY2*$ZoomRatio, $CY2*$ZoomRatio,$CY1*$ZoomRatio], + -type => 'polygon'); + + $svg->polygon( + %$path, + style => { + 'fill' => "$ColArrTmp[$thiscol]", + 'stroke' => 'black', + 'stroke-width' => 0, + 'stroke-opacity' => 1, + 'fill-opacity' => 1, + }, + ); + my $text=sprintf ("%.1f",1.0-0.2*$thiscol); + $svg->line('x1',$CX2*$ZoomRatio,'y1',$CY1*$ZoomRatio,'x2',($CX3+$CX2)*0.5*$ZoomRatio,'y2',$CY1*$ZoomRatio,'stroke','grey','stroke-width',$strokewidthGWAS*0.7); + $CY1+=$tmpFB*0.5; + $svg->text('x',$CX3*$ZoomRatio,'y',$CY1*$ZoomRatio,'-cdata',$text,'font-size',$tmpFB*$ZoomRatio,'font-family','Arial'); + } + my $CY1=$up+($binYcut+1.5)*$tmpFB; + $svg->text('x',$CX3*$ZoomRatio,'y',$CY1*$ZoomRatio,'-cdata',"NA",'font-size',$tmpFB*$ZoomRatio,'font-family','Arial'); + $svg->text('x',$CX1*$ZoomRatio,'y',($up-$tmpFB/2)*$ZoomRatio,'-cdata',$CalV,'font-size',$tmpFB*$ZoomRatio,'font-family','Arial'); + + my $peakNum=$hashSNP{$MinSite};$peakNum||=int($SNPNumber/2); + if ($PeakSite ne "" ) {$peakNum = $hashSNP{$PeakSite};} + + $MinSite=$ArrSNP[$peakNum]; + my $labXX=$left+($MinSite-$ArrSNP[0])*$ratio; + $MaxP=$hashPvalue{$MinSite}; + my $labYY=$up+$LingGG-($MaxP-$MinP)*$Msx; + $CX1=$labXX-$cirsize; $CX3=$labXX+$cirsize; + $CY1=$labYY-$cirsize ; my $CY2=$labYY+$cirsize ; + my $path = $svg->get_path( + x => [$CX1*$ZoomRatio, $labXX*$ZoomRatio, $CX3*$ZoomRatio,$labXX*$ZoomRatio], + y => [$labYY*$ZoomRatio, $CY1*$ZoomRatio, $labYY*$ZoomRatio,$CY2*$ZoomRatio], + -type => 'polygon'); + + $svg->polygon( + %$path, + style => { + 'fill' => "$ColArrTmp[0]", + 'stroke' => 'black', + 'stroke-width' => 0, + 'stroke-opacity' => 1, + 'fill-opacity' => 1, + }, + ); + + delete $hashPvalue{$MinSite}; + foreach $MinSite ( keys %hashPvalue) + { + $labXX=$left+($MinSite-$ArrSNP[0])*$ratio; + $labYY=$up+$LingGG-($hashPvalue{$MinSite}-$MinP)*$Msx; + my $cirCor=$ColArrTmp[5]; if ($hashPvalue{$MinSite}>$cutoffGWAS) { $cirCor=$ColArrTmp[0];} + + if (exists $hashSNP{$MinSite} ) + { + my $NowSiteNum=$hashSNP{$MinSite}; + my $ValueNow; + if ($peakNum<=$NowSiteNum) + { + $ValueNow=$LDdata[$NowSiteNum][$peakNum]; + } + else + { + $ValueNow=$LDdata[$peakNum][$NowSiteNum]; + } + my $AA= int($binYcut-0.1-($ValueNow*$binYcut/($NumGradien))); + $cirCor=$ColArrTmp[$AA]; + } + $XXXNew=sprintf ($Accu,$labXX*$ZoomRatio); + $YYYNew=sprintf ($Accu,$labYY*$ZoomRatio); + $svg->circle(cx=>$XXXNew, cy=>$YYYNew, r=>$cirsizeZoomRatio, fill => $cirCor ); + } + $MinSite=$ArrSNP[$peakNum]; + $hashPvalue{$MinSite}=$MaxP; + } + else + { + foreach $MinSite (keys %hashPvalue) + { + my $labXX=$left+($MinSite-$ArrSNP[0])*$ratio; + my $labYY=$up+$LingGG-($hashPvalue{$MinSite}-$MinP)*$Msx; + my $cirCor=$ColArrTmp[4]; if ($hashPvalue{$MinSite}>$cutoffGWAS ) { $cirCor=$ColArrTmp[0];} + $XXXNew=sprintf ($Accu,$labXX*$ZoomRatio); + $YYYNew=sprintf ($Accu,$labYY*$ZoomRatio); + $svg->circle(cx=>$XXXNew, cy=>$YYYNew, r=>$cirsizeZoomRatio, fill => $cirCor ); + } + + } + + if ( defined ($ShowGWASSpeSNP)) + { + my $GWASSpeSNPSize=$GWASSpeSNPSizeRatio*$fontsize*$ZoomRatio; + foreach $MinSite( keys %hashSpeSNP) + { + next if (!exists $hashPvalue{$MinSite}); + my $labXX=$left+($MinSite-$ArrSNP[0])*$ratio+($ShiftXGWASSpeSNP+1)*$cirsize; + my $labYY=$up+$LingGG-($hashPvalue{$MinSite}-$MinP)*$Msx+$ShiftYGWASSpeSNP*$cirsize; + $XXXNew=sprintf ($Accu,$labXX*$ZoomRatio); + $YYYNew=sprintf ($Accu,$labYY*$ZoomRatio); + $svg->text('x',$XXXNew,'y',$YYYNew,'-cdata',"$hashSpeSNP{$MinSite}",'font-size',$GWASSpeSNPSize,'font-family','Arial'); + } + } + + $up=$tmp_up; + + if (( -e $SiteLDB ) && (defined($InGWAS) ) && (defined $PeakSite)) + { + $SiteLD="$indata.TriangleV.gz"; + open (IV,"gzip -cd $SiteLD | ") || die "input file can't open $!"; + $_=; chomp $_; + $CalV=(split(/\s+/,$_))[-1]; + $count=0; + + while() + { + chomp ; + my @inf=split ; + $LDdata[$count][$count]=$NumGradien; + foreach my $k (0..$#inf) + { + my $RRcol=int($inf[$k]/$spilitBin); + my $keyX=$k+1+$count; + $LDdata[$keyX][$count]=$RRcol; + } + $count++; + } + close IV; + } + +} + +########################### + + +$svg->text('text-anchor','middle','x',(int($left+$Fig*2/3+$Btmp*0.5))*$ZoomRatio,'y',($height-$down-$Atmp*2)*$ZoomRatio,'-cdata',"$CalV Color Key",'font-family','Arial','font-size',$Atmp*$ZoomRatio); + + + + + + + + + + + +if ($MaxSpeNameLength> 7) +{ + $up=$up+($MaxSpeNameLength-7)*$fontsize; +} +$up=$up+$adjHeatmap*$Fig ; +if ( (($up+ ($SNPNumber-1)*$halfbin+$LineH)) > $height) +{ + $up=$height-((($SNPNumber-1)*$halfbin+$LineH)); +} +# if (($up+$LineH) > ($height-$down-($Fig/2))) { $up=($height-$down-($Fig/2))-$LineH ; } + + + + +################### heatMap RR ######################### + +my %hashBlock=(); +my $CountNumber=0; + +sub isBlock +{ + (my $x,my $y)=@_; + if ( ($x>$y) && ($y>= 0) && ($x<=$SNPNumber) && ($LDdata[$x][$y]==$_[2] ) ) + { + return 1; + } + else + { + return 0 ; + } +} + +####### 不递归 找相同的block块 ########## + +sub MergeSamBlock2 +{ + (my $k,my $x,my $y)=@_; + my @tmpSampleXX; $tmpSampleXX[0]=$x; + my @tmpSampleYY; $tmpSampleYY[0]=$y; + my $NowCount=0; my $MaxCount=1; + my $ThisXX ; my $ThisYY ; + + while($NowCount<$MaxCount) + { + $ThisXX=$tmpSampleXX[$NowCount]; + $ThisYY=$tmpSampleYY[$NowCount]; + if ( (isBlock($ThisXX,$ThisYY,$k)==1)) + { + $LDdata[$ThisXX][$ThisYY]=0; + $hashBlock{$ThisXX}{$ThisYY}=1; + $CountNumber++; + push @tmpSampleXX,$ThisXX ; push @tmpSampleYY,$ThisYY+1 ; + push @tmpSampleXX,$ThisXX+1 ; push @tmpSampleYY,$ThisYY ; + push @tmpSampleXX,$ThisXX ; push @tmpSampleYY,$ThisYY-1 ; + push @tmpSampleXX,$ThisXX-1 ; push @tmpSampleYY,$ThisYY ; + $MaxCount+=4; + } + $NowCount++; + } +} + +my @vectorXX; +my @vectorYY; +$vectorXX[0]=1; $vectorYY[0]=-1; +$vectorXX[1]=1; $vectorYY[1]=1; +$vectorXX[2]=-1; $vectorYY[2]=1; +$vectorXX[3]=-1; $vectorYY[3]=-1; + + +sub GetPath +{ + (my $PathXX,my $PathYY)=@_; + + my %RoutePath=(); + my $ThisXX=$width; + my $ThisYY=$height; + + foreach my $key1 (keys %hashBlock) + { + my $SedH=$hashBlock{$key1}; + foreach my $key2 ( keys %$SedH ) + { + my $XX=sprintf ($Accu, $left+$key2*$polygonbin +($key1-$key2)*$halfbin); + my $YY=sprintf ($Accu, $up+ ($key1-$key2-1)*$halfbin+$LineH); + my $X1=sprintf ($Accu,$XX) ; my $Y1=sprintf ($Accu,$YY-$halfbin); + my $X2=sprintf ($Accu,$XX+$halfbin); my $Y2=sprintf ($Accu,$YY); + my $X3=sprintf ($Accu,$XX); my $Y3=sprintf ($Accu,$YY+$halfbin); + my $X4=sprintf ($Accu,$XX-$halfbin); my $Y4=sprintf ($Accu,$YY); + my $Point1="$X1\_$Y1"; my $Point2="$X2\_$Y2"; + my $Point3="$X3\_$Y3"; my $Point4="$X4\_$Y4"; + + $RoutePath{$Point1}{$Point2}++; + $RoutePath{$Point4}{$Point3}++; + $RoutePath{$Point2}{$Point3}++; + $RoutePath{$Point1}{$Point4}++; + if ($ThisXX>$X4) + { + $ThisXX=$X4; + $ThisYY=$Y4; + } + elsif ($ThisXX==$X4 && $ThisYY> $Y4 ) + { + $ThisYY=$Y4; + } + } + } + + + my $XiabiaoArr=0; + $PathXX->[$XiabiaoArr]=sprintf ($Accu,$ThisXX*$ZoomRatio); + $PathYY->[$XiabiaoArr]=sprintf ($Accu,$ThisYY*$ZoomRatio); + + my $Count=0; + my $SedXX=$ThisXX; + my $SedYY=$ThisYY; + + my $lastCount=-1; + while(1) + { + if ($Count>3) + { + print "Something wrong at get Path\n"; + exit; + } + my $ThirdXX=sprintf ($Accu,$SedXX+$vectorXX[$Count]*$halfbin); + my $ThirdYY=sprintf ($Accu,$SedYY+$vectorYY[$Count]*$halfbin); + my $PointA="$SedXX\_$SedYY"; + my $PointB="$ThirdXX\_$ThirdYY"; + my $AA=0; my $BB=0; + if (exists $RoutePath{$PointA}{$PointB}) + { + $AA=$RoutePath{$PointA}{$PointB}; + } + + if (exists $RoutePath{$PointB}{$PointA}) + { + $BB=$RoutePath{$PointB}{$PointA}; + } + if (($AA+$BB)!=1) + { + $Count++; + next ; + } + if ($Count==$lastCount) + { + $PathXX->[$XiabiaoArr]=sprintf ($Accu,$ThirdXX*$ZoomRatio); + $PathYY->[$XiabiaoArr]=sprintf ($Accu,$ThirdYY*$ZoomRatio); + $RoutePath{$PointA}{$PointB}++; + $Count=0; + $SedXX=$ThirdXX; $SedYY=$ThirdYY; + } + else + { + $XiabiaoArr++; + $PathXX->[$XiabiaoArr]=sprintf ($Accu,$ThirdXX*$ZoomRatio); + $PathYY->[$XiabiaoArr]=sprintf ($Accu,$ThirdYY*$ZoomRatio); + $RoutePath{$PointA}{$PointB}++; + $lastCount=$Count; + $Count=0; + $SedXX=$ThirdXX; $SedYY=$ThirdYY; + } + if ( $SedXX==$ThisXX && $SedYY==$ThisYY) + { + pop @$PathXX; pop @$PathYY; + last ; + } + } +} + + +my %RmdupSite1=(); +my %RmdupSite2=(); + + + +if (($SNPNumber>$MerMinSNPNum) && (!defined($NoHeatMapPlot)) ) # merge same col block +{ + my @PathXX=(); my @PathYY=(); + + foreach my $key2 (0..$SNPNumber) + { + my $Start=$key2+1; + my $XStart=$left+$key2*$polygonbin+$halfbin; + + my $ThisXX=$left+($ArrSNP[$key2]-$ArrSNP[0])*$ratio; + my $tempXXA=$XStart-$halfbin; + my $keyRm="$ThisXX\_$YY2\_$tempXXA\_$tempYYA"; + + if ( !exists $RmdupSite1{$keyRm}) + { + $svg->line('x1',$ThisXX*$ZoomRatio,'y1',$YY2*$ZoomRatio,'x2',$tempXXA*$ZoomRatio,'y2',$tempYYA*$ZoomRatio,'stroke','green','stroke-width',$StrokeWidthV2); + $RmdupSite1{$keyRm}=1; + } + + $keyRm="$ThisXX\_$YY1\_$ThisXX\_$YY2"; + if (!exists $RmdupSite2{$keyRm}) + { + $svg->line('x1',$ThisXX*$ZoomRatio,'y1',$YY1*$ZoomRatio,'x2',$ThisXX*$ZoomRatio,'y2',$YY2*$ZoomRatio,'stroke','grey','stroke-width',$StrokeWidthV2); + $RmdupSite2{$keyRm}=1; + } + + foreach my $key1 ($Start..$SNPNumber) + { + if ( $LDdata[$key1][$key2] ==0 ) { next; } + if ( abs($ArrSNP[$key2]-$ArrSNP[$key1]) > $NoShowLDist) { next; } + $CountNumber=0; + my $ColValue=$LDdata[$key1][$key2]; + %hashBlock=(); + MergeSamBlock2($ColValue,$key1,$key2); + if ( $CountNumber==0) + { + next ; + } + else + { + @PathXX=(); @PathYY=(); + GetPath(\@PathXX,\@PathYY); + my $path = $svg->get_path( + x => \@PathXX, + y => \@PathYY, + -type => 'polygon'); + $svg->polygon( + %$path, + style => { + 'fill' => "rgb($ArryCol[$ColValue])", + 'stroke' => $grid_color, + 'stroke-width' => $strokewidth, + 'stroke-opacity' => 1, + 'fill-opacity' => 1, + }, + ) + } + } + } +} +elsif(!defined($NoHeatMapPlot)) +{ + + foreach my $key2 (0..$SNPNumber) + { + my $Start=$key2+1; + my $XStart=$left+$key2*$polygonbin+$halfbin; + my $ThisXX=$left+($ArrSNP[$key2]-$ArrSNP[0])*$ratio; + + my $tempXXA=$XStart-$halfbin; + my $keyRm="$ThisXX\_$YY2\_$tempXXA\_$tempYYA"; + + if ( !exists $RmdupSite1{$keyRm}) + { + $svg->line('x1',$ThisXX*$ZoomRatio,'y1',$YY2*$ZoomRatio,'x2',$tempXXA*$ZoomRatio,'y2',$tempYYA*$ZoomRatio,'stroke','green','stroke-width',$StrokeWidthV2); + $RmdupSite1{$keyRm}=1; + } + + $keyRm="$ThisXX\_$YY1\_$ThisXX\_$YY2"; + if (!exists $RmdupSite2{$keyRm}) + { + $svg->line('x1',$ThisXX*$ZoomRatio,'y1',$YY1*$ZoomRatio,'x2',$ThisXX*$ZoomRatio,'y2',$YY2*$ZoomRatio,'stroke','grey','stroke-width',$StrokeWidthV2); + $RmdupSite2{$keyRm}=1; + } + + foreach my $key1 ($Start..$SNPNumber) + { + if ( $LDdata[$key1][$key2] ==0 ) {next;} + my $YY=sprintf ( $Accu, $up+ ($key1-$key2-1)*$halfbin+$LineH); + my $XX=sprintf ( $Accu, $XStart + ($key1-$key2-1)*$halfbin); + $keyRm="$XX\_$YY"; + if (exists $RmdupSite1{$keyRm}){next;} + $RmdupSite1{$keyRm}=1; + + my $X1=$XX; my $Y1=$YY-$halfbin ; + my $X2=$XX-$halfbin; my $Y2=$YY ; + my $X3=$XX; my $Y3=$YY+$halfbin ; + my $X4=$XX+$halfbin; my $Y4=$YY ; + my $path = $svg->get_path( + x => [$X1*$ZoomRatio, $X2*$ZoomRatio, $X3*$ZoomRatio,$X4*$ZoomRatio], + y => [$Y1*$ZoomRatio, $Y2*$ZoomRatio, $Y3*$ZoomRatio,$Y4*$ZoomRatio], + -type => 'polygon'); + $svg->polygon( + %$path, + style => { + 'fill' => "rgb($ArryCol[$LDdata[$key1][$key2]])", + 'stroke' => $grid_color, + 'stroke-width' => $strokewidth*$ZoomRatio, + 'stroke-opacity' => 1, + 'fill-opacity' => 1, + }, + ) + } + } +} + +@LDdata=(); +undef(@LDdata); + + + +$SiteLD="$indata.blocks.gz"; + +if ( -e ($SiteLD) ) +{ + open (IC,"gzip -cd $SiteLD | ") || die "input file can't open $!"; + my $crblocks="black"; + ; + if (!defined ($WidthBlock)) + { + $WidthBlock=$StrokeWidthV2; + } + + + + while() + { + chomp ; + if ($_=~/#/) + { + $crblocks="blue"; + next; + } + my @inf=split ; + next if ($#inf<2); + next if ( ($inf[1] eq "BP1") || ($inf[1] eq "Start" )); + my $SNPStart=$hashSNP{$inf[1]}; + if (!defined $SNPStart ) + { + foreach my $kt (1..10000) + { + my $Sttmpkk=$inf[1]+$kt; + if (exists $hashSNP{$Sttmpkk}) + { + $SNPStart=$hashSNP{$Sttmpkk}; + last; + } + } + } + my $SNPEnd=$hashSNP{$inf[2]}; + if ( !defined $SNPEnd ) + { + foreach my $kt (1..10000) + { + my $Sttmpkk=$inf[1]-$kt; + if (exists $hashSNP{$Sttmpkk}) + { + $SNPEnd=$hashSNP{$Sttmpkk}; + last; + } + } + } + next if ( ( !defined $SNPStart ) || ( !defined $SNPEnd ) ); + + my $X1=$left+$SNPStart*$polygonbin; + my $X2=$left+$SNPEnd*$polygonbin; + my $YY=sprintf ("%.1f", $up+$LineH); + my $X3=($X1+$X2)/2.0; + my $Y3=sprintf ("%.1f", $up+ ($SNPEnd-$SNPStart)*$halfbin+$LineH); + + my $path = $svg->get_path( + x => [$X1*$ZoomRatio, $X3*$ZoomRatio, $X2*$ZoomRatio], + y => [$YY*$ZoomRatio, $Y3*$ZoomRatio, $YY*$ZoomRatio], + -type => 'polygon'); + + $svg->polygon( + %$path, + style => { + 'fill' =>'none', + 'stroke' => $crblocks, + 'stroke-width' => $WidthBlock, + 'stroke-opacity' => 1, + 'fill-opacity' => 1, + }, + ); + # crTagSNP + my @SSS=split /[\,\|]/,$inf[-1]; + foreach my $k (0..$#SSS) + { + next if ($SSS[$k] eq "."); + my $ThisXX=$left+($SSS[$k]-$ArrSNP[0])*$ratio; + $svg->line('x1',$ThisXX*$ZoomRatio,'y1',$YY1*$ZoomRatio,'x2',$ThisXX*$ZoomRatio,'y2',$YY2*$ZoomRatio,'stroke',"rgb($crTagSNP)",'stroke-width',$StrokeWidthV2); + } + } + close IC; +} + + + + + + + + + + + +###################### Show RR for small SNPNumber ################### + +if ( defined ($ShowRR) ) +{ + if ( $SNPNumber<99 ) + { + $SiteLD="$indata.TriangleV.gz"; + open (IU,"gzip -cd $SiteLD | ") || die "input file can't open $!"; + $count=0; + ; + my $fontsizeText=$halfbin*0.48; + my $ShowNumSize=$ShowNumSizeRatio*$fontsizeText*$ZoomRatio; + + while() + { + chomp ; + my @inf=split ; + foreach my $k (0..$#inf) + { + my $RRcol=sprintf("%.2f",$inf[$k]); + my $key1=$k+1+$count; + my $key2=$count; + my $XX=sprintf ($Accu, ($left+$key2*$polygonbin +($key1-$key2+$ShiftXShowNum-0.325)*$halfbin)*$ZoomRatio); + my $YY=sprintf ($Accu, ($up+ ($key1-$key2-1+$ShiftYShowNum)*$halfbin+$LineH+$fontsizeText/2)*$ZoomRatio); + $svg->text('x',$XX,'y',$YY,'-cdata',"$RRcol",'font-size',$ShowNumSize,'font-family','Arial','fill','grey'); + } + $count++; + } + close IU; + } + else + { + print "\t\tWarning : Para [-ShowRR] only for small SNP Number(<99) to show\n"; + } +} + + + + + +################# Out Put the Result ############## + + +if ( defined($OutPut)) +{ + my @TmpOutFix=split /\./,$OutPut ; + if ( ($TmpOutFix[-1] eq "png" ) || ($TmpOutFix[-1] eq "PNG" )) + { + $OutPng=1; + } + elsif ( ($TmpOutFix[-1] eq "pdf" ) || ($TmpOutFix[-1] eq "PDF" )) + { + $OutPdf=1; + } + + if (($OutPut=~s/.svg$/.svg/) || ($OutPut=~s/.png$/.svg/) || ($OutPut=~s/.pdf$/.svg/) ) + { + } + else + { + $OutPut=$OutPut.".svg"; + } + + open (OUT,">$OutPut") || die "input file can't open $!"; + print OUT $svg->xmlify(); + close OUT ; + + + if ( defined($OutPng)) + { + print "convert SVG ---> PNG ...\n"; + + my $convert="/usr/bin/convert"; + if ( !(-e $convert) ) + { + $convert=`which convert 2> /dev/null `;chomp $convert; + } + + my $SVG2XXX="$Bin/svg_kit/svg2xxx.pl"; + + + my $png=$OutPut ; + if ($png=~s/.svg$/.png/) + { + } + else + { + $png=$png.".png"; + } + + + if ( ( $SNPNumber < 200) && ( (-e $convert) ) ) + { + system (" $convert $OutPut $png "); + } + elsif ( ( $SNPNumber < 500) && ( (-e $convert) ) ) + { + $ResizeH=$ResizeH/2; + system (" $convert -resize $ResizeH $OutPut $png "); + } + elsif ( ( $SNPNumber < 1000) && ( (-e $convert) ) ) + { + system (" $convert -resize $ResizeH $OutPut $png "); + } + else + { + if ( !(-e $convert) ) + { + if ( -e $SVG2XXX ) + { + print "Can't find the [ convert ] bin in your \$PATH, I try to convert svg by $SVG2XXX \n"; + if ( $SNPNumber < 500 ) + { + $ResizeH=int($ResizeH/162); + system (" perl $SVG2XXX $OutPut -t png --height $ResizeH " ); + } + else + { + $ResizeH=int($ResizeH/81); + system (" perl $SVG2XXX $OutPut -t png --height $ResizeH " ); + } + } + else + { + print "Can't find the [ convert ] bin, You shoud install the [convert] First,then:\t\t"; + print " convert -resize $ResizeH $OutPut $png \n"; + exit(1); + } + } + else + { + system (" $convert -resize $ResizeH $OutPut $png "); + } + } + } + + + if (defined($OutPdf)) + { + print "convert SVG ---> PDF ...\n"; + + my $convert="/usr/bin/convert"; + if ( !(-e $convert) ) + { + $convert=`which convert 2> /dev/null `;chomp $convert; + } + + my $SVG2XXX="$Bin/svg_kit/svg2xxx.pl"; + + my $pdf=$OutPut ; + if ($pdf=~s/.svg$/.pdf/) + { + } + else + { + $pdf=$pdf.".pdf"; + } + + if ( ( $SNPNumber < 200) && ( (-e $convert) ) ) + { + system (" $convert $OutPut $pdf "); + exit(1); + } + elsif ( ( $SNPNumber < 500) && ( (-e $convert) ) ) + { + $ResizeH=$ResizeH/2; + system (" $convert -resize $ResizeH $OutPut $pdf "); + exit(1); + } + elsif ( ( $SNPNumber < 1000) && ( (-e $convert) ) ) + { + system (" $convert -resize $ResizeH $OutPut $pdf "); + exit(1); + } + + if ( !(-e $convert) ) + { + if ( -e $SVG2XXX ) + { + print "Can't find the [ convert ] bin, I try to convert svg by $SVG2XXX \n"; + if ( $SNPNumber < 500 ) + { + $ResizeH=int($ResizeH/162); + system (" perl $SVG2XXX $OutPut -t pdf --height $ResizeH " ); + } + else + { + $ResizeH=int($ResizeH/81); + system (" perl $SVG2XXX $OutPut -t pdf --height $ResizeH " ); + } + exit(1); + } + print "Can't find the [ convert ] bin, You shoud install the [convert] First,then:\t\t"; + print " convert -resize $ResizeH $OutPut $pdf \n"; + exit(1); + } + else + { + system (" $convert -resize $ResizeH $OutPut $pdf "); + } + + } + +} +else +{ + print $svg->xmlify(); +} +print "ALL done\n"; +######################swimming in the sky and flying in the sea ########################### + diff --git a/bin/plink b/bin/plink new file mode 100644 index 0000000..6ecf4ce Binary files /dev/null and b/bin/plink differ diff --git a/bin/svg_kit/FontSize.pm b/bin/svg_kit/FontSize.pm new file mode 100644 index 0000000..e5cadec --- /dev/null +++ b/bin/svg_kit/FontSize.pm @@ -0,0 +1,1602 @@ +## caculate string height and width in SVG +## Creat on: 2007-9-12 + +package FontSize; +use strict; +use Data::Dumper; + +## creat a new obejct, and set the parameters +sub new +{ + my $invocant = shift; + my $class = ref($invocant) || $invocant; + my $self = {'font'=>undef,@_ } ; + bless($self, $class); + $self->initial(); + return $self; +} + + + +sub stringHeight { + my ($self,$size) = @_; + return int($size*0.72); +} + +sub stringWidth{ + my ($self,$family,$size,$string) = @_; + $family =~ s/Courier/CourierNew/ if($family eq "Courier" || $family =~ /Courier-/); + $family =~ s/Times/TimesNewRoman/ if($family eq "Times" || $family =~ /Times-/); + my $family_p = $self->{font}{$family}; + my @char = split //,$string; + my $width; + for (my $i=0; $i<@char; $i++) { + $width += $family_p->{$char[$i]}; + } + return int($width*$size*0.00048820179); +} + + +sub initial { + my $self = shift; + $self->{font} = { + 'ArialNarrow-BoldItalic' => { + 'S' => '1120', + '/' => '467', + 'K' => '1212', + '7' => '934', + 'd' => '1026', + ',' => '467', + 'Y' => '1120', + 'E' => '1120', + 'y' => '934', + '"' => '797', + 'g' => '1026', + 'e' => '934', + 'J' => '934', + '|' => '471', + '^' => '981', + 'q' => '1026', + 'b' => '1026', + 'D' => '1212', + 'z' => '840', + 'w' => '1307', + '$' => '934', + '\\' => '467', + '~' => '981', + '-' => '559', + 'Q' => '1307', + 'M' => '1399', + 'C' => '1212', + '[' => '559', + 'L' => '1026', + '!' => '559', + ' ' => '467', + '{' => '653', + 'X' => '1120', + 'P' => '1120', + '%' => '1493', + '#' => '934', + '_' => '934', + '+' => '981', + ')' => '559', + '\'' => '399', + '}' => '653', + 'a' => '934', + 'T' => '1026', + '=' => '981', + 'N' => '1212', + '2' => '934', + 'j' => '467', + 'Z' => '1026', + 'u' => '1026', + '1' => '934', + 'k' => '934', + '<' => '981', + 't' => '559', + 'W' => '1585', + 'v' => '934', + '>' => '981', + 's' => '934', + 'B' => '1212', + '?' => '1026', + 'H' => '1212', + 'c' => '934', + '&' => '1212', + 'I' => '467', + 'G' => '1307', + '(' => '559', + '`' => '559', + 'U' => '1212', + 'F' => '1026', + 'r' => '653', + ':' => '559', + 'x' => '934', + '*' => '653', + 'V' => '1120', + 'h' => '1026', + '0' => '934', + '.' => '467', + '@' => '1638', + 'f' => '559', + ';' => '559', + 'i' => '467', + '6' => '934', + 'A' => '1212', + 'n' => '1026', + 'O' => '1307', + '3' => '934', + ']' => '559', + 'm' => '1493', + '9' => '934', + 'l' => '467', + '8' => '934', + 'p' => '1026', + '4' => '934', + 'R' => '1212', + 'o' => '1026', + '5' => '934' + }, + 'Arial-BoldItalic' => { + 'S' => '1366', + '/' => '569', + 'K' => '1479', + '7' => '1139', + 'd' => '1251', + ',' => '569', + 'Y' => '1366', + 'E' => '1366', + 'y' => '1139', + '"' => '971', + 'g' => '1251', + 'e' => '1139', + 'J' => '1139', + '|' => '573', + '^' => '1196', + 'q' => '1251', + 'b' => '1251', + 'D' => '1479', + 'z' => '1024', + 'w' => '1593', + '$' => '1139', + '\\' => '569', + '~' => '1196', + '-' => '682', + 'Q' => '1593', + 'M' => '1706', + 'C' => '1479', + '[' => '682', + 'L' => '1251', + '!' => '682', + ' ' => '569', + '{' => '797', + 'X' => '1366', + 'P' => '1366', + '%' => '1821', + '#' => '1139', + '_' => '1139', + '+' => '1196', + ')' => '682', + '\'' => '487', + '}' => '797', + 'a' => '1139', + 'T' => '1251', + '=' => '1196', + 'N' => '1479', + '2' => '1139', + 'j' => '569', + 'Z' => '1251', + 'u' => '1251', + '1' => '1139', + 'k' => '1139', + '<' => '1196', + 't' => '682', + 'W' => '1933', + 'v' => '1139', + '>' => '1196', + 's' => '1139', + 'B' => '1479', + '?' => '1251', + 'H' => '1479', + 'c' => '1139', + '&' => '1479', + 'I' => '569', + 'G' => '1593', + '(' => '682', + '`' => '682', + 'U' => '1479', + 'F' => '1251', + 'r' => '797', + ':' => '682', + 'x' => '1139', + '*' => '797', + 'V' => '1366', + 'h' => '1251', + '0' => '1139', + '.' => '569', + '@' => '1997', + 'f' => '682', + ';' => '682', + 'i' => '569', + '6' => '1139', + 'A' => '1479', + 'n' => '1251', + 'O' => '1593', + '3' => '1139', + ']' => '682', + 'm' => '1821', + '9' => '1139', + 'l' => '569', + '8' => '1139', + 'p' => '1251', + '4' => '1139', + 'R' => '1479', + 'o' => '1251', + '5' => '1139' + }, + 'Arial-Bold' => { + 'S' => '1366', + '/' => '569', + 'K' => '1479', + '7' => '1139', + 'd' => '1251', + ',' => '569', + 'Y' => '1366', + 'E' => '1366', + 'y' => '1139', + '"' => '971', + 'g' => '1251', + 'e' => '1139', + 'J' => '1139', + '|' => '573', + '^' => '1196', + 'q' => '1251', + 'b' => '1251', + 'D' => '1479', + 'z' => '1024', + 'w' => '1593', + '$' => '1139', + '\\' => '569', + '~' => '1196', + '-' => '682', + 'Q' => '1593', + 'M' => '1706', + 'C' => '1479', + '[' => '682', + 'L' => '1251', + '!' => '682', + ' ' => '569', + '{' => '797', + 'X' => '1366', + 'P' => '1366', + '%' => '1821', + '#' => '1139', + '_' => '1139', + '+' => '1196', + ')' => '682', + '\'' => '487', + '}' => '797', + 'a' => '1139', + 'T' => '1251', + '=' => '1196', + 'N' => '1479', + '2' => '1139', + 'j' => '569', + 'Z' => '1251', + 'u' => '1251', + '1' => '1139', + 'k' => '1139', + '<' => '1196', + 't' => '682', + 'W' => '1933', + 'v' => '1139', + '>' => '1196', + 's' => '1139', + 'B' => '1479', + '?' => '1251', + 'H' => '1479', + 'c' => '1139', + '&' => '1479', + 'I' => '569', + 'G' => '1593', + '(' => '682', + '`' => '682', + 'U' => '1479', + 'F' => '1251', + 'r' => '797', + ':' => '682', + 'x' => '1139', + '*' => '797', + 'V' => '1366', + 'h' => '1251', + '0' => '1139', + '.' => '569', + '@' => '1997', + 'f' => '682', + ';' => '682', + 'i' => '569', + '6' => '1139', + 'A' => '1479', + 'n' => '1251', + 'O' => '1593', + '3' => '1139', + ']' => '682', + 'm' => '1821', + '9' => '1139', + 'l' => '569', + '8' => '1139', + 'p' => '1251', + '4' => '1139', + 'R' => '1479', + 'o' => '1251', + '5' => '1139' + }, + 'ArialNarrow-Italic' => { + 'S' => '1120', + '/' => '467', + 'K' => '1120', + '7' => '934', + 'd' => '934', + ',' => '467', + 'Y' => '1120', + 'E' => '1120', + 'y' => '840', + '"' => '596', + 'g' => '934', + 'e' => '934', + 'J' => '840', + '|' => '436', + '^' => '788', + 'q' => '934', + 'b' => '934', + 'D' => '1212', + 'z' => '840', + 'w' => '1212', + '$' => '934', + '\\' => '467', + '~' => '981', + '-' => '559', + 'Q' => '1307', + 'M' => '1399', + 'C' => '1212', + '[' => '467', + 'L' => '934', + '!' => '467', + ' ' => '467', + '{' => '561', + 'X' => '1120', + 'P' => '1120', + '%' => '1493', + '#' => '934', + '_' => '934', + '+' => '981', + ')' => '559', + '\'' => '322', + '}' => '561', + 'a' => '934', + 'T' => '1026', + '=' => '981', + 'N' => '1212', + '2' => '934', + 'j' => '373', + 'Z' => '1026', + 'u' => '934', + '1' => '934', + 'k' => '840', + '<' => '981', + 't' => '467', + 'W' => '1585', + 'v' => '840', + '>' => '981', + 's' => '840', + 'B' => '1120', + '?' => '934', + 'H' => '1212', + 'c' => '840', + '&' => '1120', + 'I' => '467', + 'G' => '1307', + '(' => '559', + '`' => '559', + 'U' => '1212', + 'F' => '1026', + 'r' => '559', + ':' => '467', + 'x' => '840', + '*' => '653', + 'V' => '1120', + 'h' => '934', + '0' => '934', + '.' => '467', + '@' => '1704', + 'f' => '467', + ';' => '467', + 'i' => '373', + '6' => '934', + 'A' => '1120', + 'n' => '934', + 'O' => '1307', + '3' => '934', + ']' => '467', + 'm' => '1399', + '9' => '934', + 'l' => '373', + '8' => '934', + 'p' => '934', + '4' => '934', + 'R' => '1212', + 'o' => '934', + '5' => '934' + }, + 'Arial-Italic' => { + 'S' => '1366', + '/' => '569', + 'K' => '1366', + '7' => '1139', + 'd' => '1139', + ',' => '569', + 'Y' => '1366', + 'E' => '1366', + 'y' => '1024', + '"' => '727', + 'g' => '1139', + 'e' => '1139', + 'J' => '1024', + '|' => '532', + '^' => '961', + 'q' => '1139', + 'b' => '1139', + 'D' => '1479', + 'z' => '1024', + 'w' => '1479', + '$' => '1139', + '\\' => '569', + '~' => '1196', + '-' => '682', + 'Q' => '1593', + 'M' => '1706', + 'C' => '1479', + '[' => '569', + 'L' => '1139', + '!' => '569', + ' ' => '569', + '{' => '684', + 'X' => '1366', + 'P' => '1366', + '%' => '1821', + '#' => '1139', + '_' => '1139', + '+' => '1196', + ')' => '682', + '\'' => '391', + '}' => '684', + 'a' => '1139', + 'T' => '1251', + '=' => '1196', + 'N' => '1479', + '2' => '1139', + 'j' => '455', + 'Z' => '1251', + 'u' => '1139', + '1' => '1139', + 'k' => '1024', + '<' => '1196', + 't' => '569', + 'W' => '1933', + 'v' => '1024', + '>' => '1196', + 's' => '1024', + 'B' => '1366', + '?' => '1139', + 'H' => '1479', + 'c' => '1024', + '&' => '1366', + 'I' => '569', + 'G' => '1593', + '(' => '682', + '`' => '682', + 'U' => '1479', + 'F' => '1251', + 'r' => '682', + ':' => '569', + 'x' => '1024', + '*' => '797', + 'V' => '1366', + 'h' => '1139', + '0' => '1139', + '.' => '569', + '@' => '2079', + 'f' => '569', + ';' => '569', + 'i' => '455', + '6' => '1139', + 'A' => '1366', + 'n' => '1139', + 'O' => '1593', + '3' => '1139', + ']' => '569', + 'm' => '1706', + '9' => '1139', + 'l' => '455', + '8' => '1139', + 'p' => '1139', + '4' => '1139', + 'R' => '1479', + 'o' => '1139', + '5' => '1139' + }, + 'CourierNew' => { + 'S' => '1229', + '/' => '1229', + 'K' => '1229', + '7' => '1229', + 'd' => '1229', + ',' => '1229', + 'Y' => '1229', + 'E' => '1229', + 'y' => '1229', + '"' => '1229', + 'g' => '1229', + 'e' => '1229', + 'J' => '1229', + '|' => '1229', + '^' => '1229', + 'q' => '1229', + 'b' => '1229', + 'D' => '1229', + 'z' => '1229', + 'w' => '1229', + '$' => '1229', + '\\' => '1229', + '~' => '1229', + '-' => '1229', + 'Q' => '1229', + 'M' => '1229', + 'C' => '1229', + '[' => '1229', + 'L' => '1229', + '!' => '1229', + ' ' => '1229', + '{' => '1229', + 'X' => '1229', + 'P' => '1229', + '%' => '1229', + '#' => '1229', + '_' => '1229', + '+' => '1229', + ')' => '1229', + '\'' => '1229', + '}' => '1229', + 'a' => '1229', + 'T' => '1229', + '=' => '1229', + 'N' => '1229', + '2' => '1229', + 'j' => '1229', + 'Z' => '1229', + 'u' => '1229', + '1' => '1229', + 'k' => '1229', + '<' => '1229', + 't' => '1229', + 'W' => '1229', + 'v' => '1229', + '>' => '1229', + 's' => '1229', + 'B' => '1229', + '?' => '1229', + 'H' => '1229', + 'c' => '1229', + '&' => '1229', + 'I' => '1229', + 'G' => '1229', + '(' => '1229', + '`' => '1229', + 'U' => '1229', + 'F' => '1229', + 'r' => '1229', + ':' => '1229', + 'x' => '1229', + '*' => '1229', + 'V' => '1229', + 'h' => '1229', + '0' => '1229', + '.' => '1229', + '@' => '1229', + 'f' => '1229', + ';' => '1229', + 'i' => '1229', + '6' => '1229', + 'A' => '1229', + 'n' => '1229', + 'O' => '1229', + '3' => '1229', + ']' => '1229', + 'm' => '1229', + '9' => '1229', + 'l' => '1229', + '8' => '1229', + 'p' => '1229', + '4' => '1229', + 'R' => '1229', + 'o' => '1229', + '5' => '1229' + }, + 'Arial' => { + 'S' => '1366', + '/' => '569', + 'K' => '1366', + '7' => '1139', + 'd' => '1139', + ',' => '569', + 'Y' => '1366', + 'E' => '1366', + 'y' => '1024', + '"' => '727', + 'g' => '1139', + 'e' => '1139', + 'J' => '1024', + '|' => '532', + '^' => '961', + 'q' => '1139', + 'b' => '1139', + 'D' => '1479', + 'z' => '1024', + 'w' => '1479', + '$' => '1139', + '\\' => '569', + '~' => '1196', + '-' => '682', + 'Q' => '1593', + 'M' => '1706', + 'C' => '1479', + '[' => '569', + 'L' => '1139', + '!' => '569', + ' ' => '569', + '{' => '684', + 'X' => '1366', + 'P' => '1366', + '%' => '1821', + '#' => '1139', + '_' => '1139', + '+' => '1196', + ')' => '682', + '\'' => '391', + '}' => '684', + 'a' => '1139', + 'T' => '1251', + '=' => '1196', + 'N' => '1479', + '2' => '1139', + 'j' => '455', + 'Z' => '1251', + 'u' => '1139', + '1' => '1139', + 'k' => '1024', + '<' => '1196', + 't' => '569', + 'W' => '1933', + 'v' => '1024', + '>' => '1196', + 's' => '1024', + 'B' => '1366', + '?' => '1139', + 'H' => '1479', + 'c' => '1024', + '&' => '1366', + 'I' => '569', + 'G' => '1593', + '(' => '682', + '`' => '682', + 'U' => '1479', + 'F' => '1251', + 'r' => '682', + ':' => '569', + 'x' => '1024', + '*' => '797', + 'V' => '1366', + 'h' => '1139', + '0' => '1139', + '.' => '569', + '@' => '2079', + 'f' => '569', + ';' => '569', + 'i' => '455', + '6' => '1139', + 'A' => '1366', + 'n' => '1139', + 'O' => '1593', + '3' => '1139', + ']' => '569', + 'm' => '1706', + '9' => '1139', + 'l' => '455', + '8' => '1139', + 'p' => '1139', + '4' => '1139', + 'R' => '1479', + 'o' => '1139', + '5' => '1139' + }, + 'TimesNewRoman-Italic' => { + 'S' => '1024', + '/' => '569', + 'K' => '1366', + '7' => '1024', + 'd' => '1024', + ',' => '512', + 'Y' => '1139', + 'E' => '1251', + 'y' => '909', + '"' => '860', + 'g' => '1024', + 'e' => '909', + 'J' => '909', + '|' => '563', + '^' => '864', + 'q' => '1024', + 'b' => '1024', + 'D' => '1479', + 'z' => '797', + 'w' => '1366', + '$' => '1024', + '\\' => '569', + '~' => '1108', + '-' => '682', + 'Q' => '1479', + 'M' => '1706', + 'C' => '1366', + '[' => '797', + 'L' => '1139', + '!' => '682', + ' ' => '512', + '{' => '819', + 'X' => '1251', + 'P' => '1251', + '%' => '1706', + '#' => '1024', + '_' => '1024', + '+' => '1382', + ')' => '682', + '\'' => '438', + '}' => '819', + 'a' => '1024', + 'T' => '1139', + '=' => '1382', + 'N' => '1366', + '2' => '1024', + 'j' => '569', + 'Z' => '1139', + 'u' => '1024', + '1' => '1024', + 'k' => '909', + '<' => '1382', + 't' => '569', + 'W' => '1706', + 'v' => '909', + '>' => '1382', + 's' => '797', + 'B' => '1251', + '?' => '1024', + 'H' => '1479', + 'c' => '909', + '&' => '1593', + 'I' => '682', + 'G' => '1479', + '(' => '682', + '`' => '682', + 'U' => '1479', + 'F' => '1251', + 'r' => '797', + ':' => '682', + 'x' => '909', + '*' => '1024', + 'V' => '1251', + 'h' => '1024', + '0' => '1024', + '.' => '512', + '@' => '1884', + 'f' => '569', + ';' => '682', + 'i' => '569', + '6' => '1024', + 'A' => '1251', + 'n' => '1024', + 'O' => '1479', + '3' => '1024', + ']' => '797', + 'm' => '1479', + '9' => '1024', + 'l' => '569', + '8' => '1024', + 'p' => '1024', + '4' => '1024', + 'R' => '1251', + 'o' => '1024', + '5' => '1024' + }, + 'TimesNewRoman-BoldItalic' => { + 'S' => '1139', + '/' => '569', + 'K' => '1366', + '7' => '1024', + 'd' => '1024', + ',' => '512', + 'Y' => '1251', + 'E' => '1366', + 'y' => '909', + '"' => '1137', + 'g' => '1024', + 'e' => '909', + 'J' => '1024', + '|' => '451', + '^' => '1167', + 'q' => '1024', + 'b' => '1024', + 'D' => '1479', + 'z' => '797', + 'w' => '1366', + '$' => '1024', + '\\' => '569', + '~' => '1167', + '-' => '682', + 'Q' => '1479', + 'M' => '1821', + 'C' => '1366', + '[' => '682', + 'L' => '1251', + '!' => '797', + ' ' => '512', + '{' => '713', + 'X' => '1366', + 'P' => '1251', + '%' => '1706', + '#' => '1024', + '_' => '1024', + '+' => '1167', + ')' => '682', + '\'' => '569', + '}' => '713', + 'a' => '1024', + 'T' => '1251', + '=' => '1167', + 'N' => '1479', + '2' => '1024', + 'j' => '569', + 'Z' => '1251', + 'u' => '1139', + '1' => '1024', + 'k' => '1024', + '<' => '1167', + 't' => '569', + 'W' => '1821', + 'v' => '909', + '>' => '1167', + 's' => '797', + 'B' => '1366', + '?' => '1024', + 'H' => '1593', + 'c' => '909', + '&' => '1593', + 'I' => '797', + 'G' => '1479', + '(' => '682', + '`' => '682', + 'U' => '1479', + 'F' => '1366', + 'r' => '797', + ':' => '682', + 'x' => '1024', + '*' => '1024', + 'V' => '1366', + 'h' => '1139', + '0' => '1024', + '.' => '512', + '@' => '1704', + 'f' => '682', + ';' => '682', + 'i' => '569', + '6' => '1024', + 'A' => '1366', + 'n' => '1139', + 'O' => '1479', + '3' => '1024', + ']' => '682', + 'm' => '1593', + '9' => '1024', + 'l' => '569', + '8' => '1024', + 'p' => '1024', + '4' => '1024', + 'R' => '1366', + 'o' => '1024', + '5' => '1024' + }, + 'CourierNew-Italic' => { + 'S' => '1229', + '/' => '1229', + 'K' => '1229', + '7' => '1229', + 'd' => '1229', + ',' => '1229', + 'Y' => '1229', + 'E' => '1229', + 'y' => '1229', + '"' => '1229', + 'g' => '1229', + 'e' => '1229', + 'J' => '1229', + '|' => '1229', + '^' => '1229', + 'q' => '1229', + 'b' => '1229', + 'D' => '1229', + 'z' => '1229', + 'w' => '1229', + '$' => '1229', + '\\' => '1229', + '~' => '1229', + '-' => '1229', + 'Q' => '1229', + 'M' => '1229', + 'C' => '1229', + '[' => '1229', + 'L' => '1229', + '!' => '1229', + ' ' => '1229', + '{' => '1229', + 'X' => '1229', + 'P' => '1229', + '%' => '1229', + '#' => '1229', + '_' => '1229', + '+' => '1229', + ')' => '1229', + '\'' => '1229', + '}' => '1229', + 'a' => '1229', + 'T' => '1229', + '=' => '1229', + 'N' => '1229', + '2' => '1229', + 'j' => '1229', + 'Z' => '1229', + 'u' => '1229', + '1' => '1229', + 'k' => '1229', + '<' => '1229', + 't' => '1229', + 'W' => '1229', + 'v' => '1229', + '>' => '1229', + 's' => '1229', + 'B' => '1229', + '?' => '1229', + 'H' => '1229', + 'c' => '1229', + '&' => '1229', + 'I' => '1229', + 'G' => '1229', + '(' => '1229', + '`' => '1229', + 'U' => '1229', + 'F' => '1229', + 'r' => '1229', + ':' => '1229', + 'x' => '1229', + '*' => '1229', + 'V' => '1229', + 'h' => '1229', + '0' => '1229', + '.' => '1229', + '@' => '1229', + 'f' => '1229', + ';' => '1229', + 'i' => '1229', + '6' => '1229', + 'A' => '1229', + 'n' => '1229', + 'O' => '1229', + '3' => '1229', + ']' => '1229', + 'm' => '1229', + '9' => '1229', + 'l' => '1229', + '8' => '1229', + 'p' => '1229', + '4' => '1229', + 'R' => '1229', + 'o' => '1229', + '5' => '1229' + }, + 'CourierNew-BoldItalic' => { + 'S' => '1229', + '/' => '1229', + 'K' => '1229', + '7' => '1229', + 'd' => '1229', + ',' => '1229', + 'Y' => '1229', + 'E' => '1229', + 'y' => '1229', + '"' => '1229', + 'g' => '1229', + 'e' => '1229', + 'J' => '1229', + '|' => '1229', + '^' => '1229', + 'q' => '1229', + 'b' => '1229', + 'D' => '1229', + 'z' => '1229', + 'w' => '1229', + '$' => '1229', + '\\' => '1229', + '~' => '1229', + '-' => '1229', + 'Q' => '1229', + 'M' => '1229', + 'C' => '1229', + '[' => '1229', + 'L' => '1229', + '!' => '1229', + ' ' => '1229', + '{' => '1229', + 'X' => '1229', + 'P' => '1229', + '%' => '1229', + '#' => '1229', + '_' => '1229', + '+' => '1229', + ')' => '1229', + '\'' => '1229', + '}' => '1229', + 'a' => '1229', + 'T' => '1229', + '=' => '1229', + 'N' => '1229', + '2' => '1229', + 'j' => '1229', + 'Z' => '1229', + 'u' => '1229', + '1' => '1229', + 'k' => '1229', + '<' => '1229', + 't' => '1229', + 'W' => '1229', + 'v' => '1229', + '>' => '1229', + 's' => '1229', + 'B' => '1229', + '?' => '1229', + 'H' => '1229', + 'c' => '1229', + '&' => '1229', + 'I' => '1229', + 'G' => '1229', + '(' => '1229', + '`' => '1229', + 'U' => '1229', + 'F' => '1229', + 'r' => '1229', + ':' => '1229', + 'x' => '1229', + '*' => '1229', + 'V' => '1229', + 'h' => '1229', + '0' => '1229', + '.' => '1229', + '@' => '1229', + 'f' => '1229', + ';' => '1229', + 'i' => '1229', + '6' => '1229', + 'A' => '1229', + 'n' => '1229', + 'O' => '1229', + '3' => '1229', + ']' => '1229', + 'm' => '1229', + '9' => '1229', + 'l' => '1229', + '8' => '1229', + 'p' => '1229', + '4' => '1229', + 'R' => '1229', + 'o' => '1229', + '5' => '1229' + }, + 'TimesNewRoman-Bold' => { + 'S' => '1139', + '/' => '569', + 'K' => '1593', + '7' => '1024', + 'd' => '1139', + ',' => '512', + 'Y' => '1479', + 'E' => '1366', + 'y' => '1024', + '"' => '1137', + 'g' => '1024', + 'e' => '909', + 'J' => '1024', + '|' => '451', + '^' => '1190', + 'q' => '1139', + 'b' => '1139', + 'D' => '1479', + 'z' => '909', + 'w' => '1479', + '$' => '1024', + '\\' => '569', + '~' => '1065', + '-' => '682', + 'Q' => '1593', + 'M' => '1933', + 'C' => '1479', + '[' => '682', + 'L' => '1366', + '!' => '682', + ' ' => '512', + '{' => '807', + 'X' => '1479', + 'P' => '1251', + '%' => '2048', + '#' => '1024', + '_' => '1024', + '+' => '1167', + ')' => '682', + '\'' => '569', + '}' => '807', + 'a' => '1024', + 'T' => '1366', + '=' => '1167', + 'N' => '1479', + '2' => '1024', + 'j' => '682', + 'Z' => '1366', + 'u' => '1139', + '1' => '1024', + 'k' => '1139', + '<' => '1167', + 't' => '682', + 'W' => '2048', + 'v' => '1024', + '>' => '1167', + 's' => '797', + 'B' => '1366', + '?' => '1024', + 'H' => '1593', + 'c' => '909', + '&' => '1706', + 'I' => '797', + 'G' => '1593', + '(' => '682', + '`' => '682', + 'U' => '1479', + 'F' => '1251', + 'r' => '909', + ':' => '682', + 'x' => '1024', + '*' => '1024', + 'V' => '1479', + 'h' => '1139', + '0' => '1024', + '.' => '512', + '@' => '1905', + 'f' => '682', + ';' => '682', + 'i' => '569', + '6' => '1024', + 'A' => '1479', + 'n' => '1139', + 'O' => '1593', + '3' => '1024', + ']' => '682', + 'm' => '1706', + '9' => '1024', + 'l' => '569', + '8' => '1024', + 'p' => '1139', + '4' => '1024', + 'R' => '1479', + 'o' => '1024', + '5' => '1024' + }, + 'ArialNarrow-Bold' => { + 'S' => '1120', + '/' => '467', + 'K' => '1212', + '7' => '934', + 'd' => '1026', + ',' => '467', + 'Y' => '1120', + 'E' => '1120', + 'y' => '934', + '"' => '797', + 'g' => '1026', + 'e' => '934', + 'J' => '934', + '|' => '471', + '^' => '981', + 'q' => '1026', + 'b' => '1026', + 'D' => '1212', + 'z' => '840', + 'w' => '1307', + '$' => '934', + '\\' => '467', + '~' => '981', + '-' => '559', + 'Q' => '1307', + 'M' => '1399', + 'C' => '1212', + '[' => '559', + 'L' => '1026', + '!' => '559', + ' ' => '467', + '{' => '653', + 'X' => '1120', + 'P' => '1120', + '%' => '1493', + '#' => '934', + '_' => '934', + '+' => '981', + ')' => '559', + '\'' => '399', + '}' => '653', + 'a' => '934', + 'T' => '1026', + '=' => '981', + 'N' => '1212', + '2' => '934', + 'j' => '467', + 'Z' => '1026', + 'u' => '1026', + '1' => '934', + 'k' => '934', + '<' => '981', + 't' => '559', + 'W' => '1585', + 'v' => '934', + '>' => '981', + 's' => '934', + 'B' => '1212', + '?' => '1026', + 'H' => '1212', + 'c' => '934', + '&' => '1212', + 'I' => '467', + 'G' => '1307', + '(' => '559', + '`' => '559', + 'U' => '1212', + 'F' => '1026', + 'r' => '653', + ':' => '559', + 'x' => '934', + '*' => '653', + 'V' => '1120', + 'h' => '1026', + '0' => '934', + '.' => '467', + '@' => '1638', + 'f' => '559', + ';' => '559', + 'i' => '467', + '6' => '934', + 'A' => '1212', + 'n' => '1026', + 'O' => '1307', + '3' => '934', + ']' => '559', + 'm' => '1493', + '9' => '934', + 'l' => '467', + '8' => '934', + 'p' => '1026', + '4' => '934', + 'R' => '1212', + 'o' => '1026', + '5' => '934' + }, + 'CourierNew-Bold' => { + 'S' => '1229', + '/' => '1229', + 'K' => '1229', + '7' => '1229', + 'd' => '1229', + ',' => '1229', + 'Y' => '1229', + 'E' => '1229', + 'y' => '1229', + '"' => '1229', + 'g' => '1229', + 'e' => '1229', + 'J' => '1229', + '|' => '1229', + '^' => '1229', + 'q' => '1229', + 'b' => '1229', + 'D' => '1229', + 'z' => '1229', + 'w' => '1229', + '$' => '1229', + '\\' => '1229', + '~' => '1229', + '-' => '1229', + 'Q' => '1229', + 'M' => '1229', + 'C' => '1229', + '[' => '1229', + 'L' => '1229', + '!' => '1229', + ' ' => '1229', + '{' => '1229', + 'X' => '1229', + 'P' => '1229', + '%' => '1229', + '#' => '1229', + '_' => '1229', + '+' => '1229', + ')' => '1229', + '\'' => '1229', + '}' => '1229', + 'a' => '1229', + 'T' => '1229', + '=' => '1229', + 'N' => '1229', + '2' => '1229', + 'j' => '1229', + 'Z' => '1229', + 'u' => '1229', + '1' => '1229', + 'k' => '1229', + '<' => '1229', + 't' => '1229', + 'W' => '1229', + 'v' => '1229', + '>' => '1229', + 's' => '1229', + 'B' => '1229', + '?' => '1229', + 'H' => '1229', + 'c' => '1229', + '&' => '1229', + 'I' => '1229', + 'G' => '1229', + '(' => '1229', + '`' => '1229', + 'U' => '1229', + 'F' => '1229', + 'r' => '1229', + ':' => '1229', + 'x' => '1229', + '*' => '1229', + 'V' => '1229', + 'h' => '1229', + '0' => '1229', + '.' => '1229', + '@' => '1229', + 'f' => '1229', + ';' => '1229', + 'i' => '1229', + '6' => '1229', + 'A' => '1229', + 'n' => '1229', + 'O' => '1229', + '3' => '1229', + ']' => '1229', + 'm' => '1229', + '9' => '1229', + 'l' => '1229', + '8' => '1229', + 'p' => '1229', + '4' => '1229', + 'R' => '1229', + 'o' => '1229', + '5' => '1229' + }, + 'ArialNarrow' => { + 'S' => '1120', + '/' => '467', + 'K' => '1120', + '7' => '934', + 'd' => '934', + ',' => '467', + 'Y' => '1120', + 'E' => '1120', + 'y' => '840', + '"' => '596', + 'g' => '934', + 'e' => '934', + 'J' => '840', + '|' => '436', + '^' => '788', + 'q' => '934', + 'b' => '934', + 'D' => '1212', + 'z' => '840', + 'w' => '1212', + '$' => '934', + '\\' => '467', + '~' => '981', + '-' => '559', + 'Q' => '1307', + 'M' => '1399', + 'C' => '1212', + '[' => '467', + 'L' => '934', + '!' => '467', + ' ' => '467', + '{' => '561', + 'X' => '1120', + 'P' => '1120', + '%' => '1493', + '#' => '934', + '_' => '934', + '+' => '981', + ')' => '559', + '\'' => '322', + '}' => '561', + 'a' => '934', + 'T' => '1026', + '=' => '981', + 'N' => '1212', + '2' => '934', + 'j' => '373', + 'Z' => '1026', + 'u' => '934', + '1' => '934', + 'k' => '840', + '<' => '981', + 't' => '467', + 'W' => '1585', + 'v' => '840', + '>' => '981', + 's' => '840', + 'B' => '1120', + '?' => '934', + 'H' => '1212', + 'c' => '840', + '&' => '1120', + 'I' => '467', + 'G' => '1307', + '(' => '559', + '`' => '559', + 'U' => '1212', + 'F' => '1026', + 'r' => '559', + ':' => '467', + 'x' => '840', + '*' => '653', + 'V' => '1120', + 'h' => '934', + '0' => '934', + '.' => '467', + '@' => '1704', + 'f' => '467', + ';' => '467', + 'i' => '373', + '6' => '934', + 'A' => '1120', + 'n' => '934', + 'O' => '1307', + '3' => '934', + ']' => '467', + 'm' => '1399', + '9' => '934', + 'l' => '373', + '8' => '934', + 'p' => '934', + '4' => '934', + 'R' => '1212', + 'o' => '934', + '5' => '934' + }, + 'TimesNewRoman' => { + 'S' => '1139', + '/' => '569', + 'K' => '1479', + '7' => '1024', + 'd' => '1024', + ',' => '512', + 'Y' => '1479', + 'E' => '1251', + 'y' => '1024', + '"' => '836', + 'g' => '1024', + 'e' => '909', + 'J' => '797', + '|' => '410', + '^' => '961', + 'q' => '1024', + 'b' => '1024', + 'D' => '1479', + 'z' => '909', + 'w' => '1479', + '$' => '1024', + '\\' => '569', + '~' => '1108', + '-' => '682', + 'Q' => '1479', + 'M' => '1821', + 'C' => '1366', + '[' => '682', + 'L' => '1251', + '!' => '682', + ' ' => '512', + '{' => '983', + 'X' => '1479', + 'P' => '1139', + '%' => '1706', + '#' => '1024', + '_' => '1024', + '+' => '1155', + ')' => '682', + '\'' => '369', + '}' => '983', + 'a' => '909', + 'T' => '1251', + '=' => '1155', + 'N' => '1479', + '2' => '1024', + 'j' => '569', + 'Z' => '1251', + 'u' => '1024', + '1' => '1024', + 'k' => '1024', + '<' => '1155', + 't' => '569', + 'W' => '1933', + 'v' => '1024', + '>' => '1155', + 's' => '797', + 'B' => '1366', + '?' => '909', + 'H' => '1479', + 'c' => '909', + '&' => '1593', + 'I' => '682', + 'G' => '1479', + '(' => '682', + '`' => '682', + 'U' => '1479', + 'F' => '1139', + 'r' => '682', + ':' => '569', + 'x' => '1024', + '*' => '1024', + 'V' => '1479', + 'h' => '1024', + '0' => '1024', + '.' => '512', + '@' => '1886', + 'f' => '682', + ';' => '569', + 'i' => '569', + '6' => '1024', + 'A' => '1479', + 'n' => '1024', + 'O' => '1479', + '3' => '1024', + ']' => '682', + 'm' => '1593', + '9' => '1024', + 'l' => '569', + '8' => '1024', + 'p' => '1024', + '4' => '1024', + 'R' => '1366', + 'o' => '1024', + '5' => '1024' + } + }; + +} + + +1; + +__END__ diff --git a/bin/svg_kit/SVG.pm b/bin/svg_kit/SVG.pm new file mode 100644 index 0000000..6c6f4e8 --- /dev/null +++ b/bin/svg_kit/SVG.pm @@ -0,0 +1,1595 @@ +package SVG; + +use strict; +use warnings; + +use SVG::XML; +use parent qw(SVG::Element SVG::Extension); +use Scalar::Util qw/weaken/; + +our $VERSION = '2.78'; + +=pod + +=encoding UTF-8 + +=head1 NAME + +SVG - Perl extension for generating Scalable Vector Graphics (SVG) documents. + +=head1 SYNOPSIS + + #!/usr/bin/perl + use strict; + use warnings; + use SVG; + + # create an SVG object + my $svg= SVG->new( width => 200, height => 200); + + # use explicit element constructor to generate a group element + my $y = $svg->group( + id => 'group_y', + style => { + stroke => 'red', + fill => 'green' + }, + ); + + # add a circle to the group + $y->circle( cx => 100, cy => 100, r => 50, id => 'circle_in_group_y' ); + + # or, use the generic 'tag' method to generate a group element by name + my $z = $svg->tag('g', + id => 'group_z', + style => { + stroke => 'rgb(100,200,50)', + fill => 'rgb(10,100,150)' + } + ); + + # create and add a circle using the generic 'tag' method + $z->tag('circle', cx => 50, cy => 50, r => 100, id => 'circle_in_group_z'); + + # create an anchor on a rectangle within a group within the group z + my $k = $z->anchor( + id => 'anchor_k', + -href => 'http://test.hackmare.com/', + target => 'new_window_0' + )->rectangle( + x => 20, y => 50, + width => 20, height => 30, + rx => 10, ry => 5, + id => 'rect_k_in_anchor_k_in_group_z' + ); + + # now render the SVG object, implicitly use svg namespace + print $svg->xmlify; + + # or render a child node of the SVG object without rendering the entire object + print $k->xmlify; #renders the anchor $k above containing a rectangle, but does not + #render any of the ancestor nodes of $k + + + # or, explicitly use svg namespace and generate a document with its own DTD + print $svg->xmlify(-namespace=>'svg'); + + # or, explicitly use svg namespace and generate an inline docunent + print $svg->xmlify( + -namespace => "svg", + -pubid => "-//W3C//DTD SVG 1.0//EN", + -inline => 1 + ); + + +See the other modules in this distribution: +L, +L, +L, +L, +L + +=head2 Converting SVG to PNG and other raster image formats + +The B command of L (also via L ) can convert SVG files to PNG +and other formats. + +L can convert SVG to other format. + +=head1 EXAMPLES + +examples/circle.pl generates the following image: + + + + + I am a title + + + + + + +That you can either embed directly into HTML or can include it using: + + + +=for HTML

SVG example circle

+ +(The image was converted to png using L. See the svg2png.pl script in the examples directory.) + +=for HTML

SVG example circle

+ +See also the B directory in this distribution which contain several fully documented examples. + +=head1 DESCRIPTION + +SVG is a 100% Perl module which generates a nested data structure containing the +DOM representation of an SVG (Scalable Vector Graphics) image. Using SVG, you +can generate SVG objects, embed other SVG instances into it, access the DOM +object, create and access javascript, and generate SMIL animation content. + +=head2 General Steps to generating an SVG document + +Generating SVG is a simple three step process: + +=over 4 + +=item 1 Construct a new SVG object with L<"new">. + +=item 2 Call element constructors such as L<"circle"> and L<"path"> to create SVG elements. + +=item 3 Render the SVG object into XML using the L<"xmlify"> method. + +=back + +The L<"xmlify"> method takes a number of optional arguments that control how SVG +renders the object into XML, and in particular determine whether a standalone +SVG document or an inline SVG document fragment is generated: + +=head2 -standalone + +A complete SVG document with its own associated DTD. A namespace for the SVG +elements may be optionally specified. + +=head2 -inline + +An inline SVG document fragment with no DTD that be embedded within other XML +content. As with standalone documents, an alternate namespace may be specified. + +No XML content is generated until the third step is reached. Up until this +point, all constructed element definitions reside in a DOM-like data structure +from which they can be accessed and modified. + +=head2 EXPORTS + +None. However, SVG permits both options and additional element methods to be +specified in the import list. These options and elements are then available +for all SVG instances that are created with the L<"new"> constructor. For example, +to change the indent string to two spaces per level: + + use SVG (-indent => " "); + +With the exception of -auto, all options may also be specified to the L<"new"> +constructor. The currently supported options and their default value are: + + # processing options + -auto => 0, # permit arbitrary autoloading of all unrecognised elements + -printerror => 1, # print error messages to STDERR + -raiseerror => 1, # die on errors (implies -printerror) + + # rendering options + -indent => "\t", # what to indent with + -elsep => "\n", # element line (vertical) separator + # (note that not all agents ignor trailing blanks) + -nocredits => 0, # enable/disable credit note comment + -namespace => '', # The root element's (and it's children's) namespace prefix + + # XML and Doctype declarations + -inline => 0, # inline or stand alone + -docroot => 'svg', # The document's root element + -version => '1.0', + -extension => '', + -encoding => 'UTF-8', + -xml_svg => 'http://www.w3.org/2000/svg', # the svg xmlns attribute + -xml_xlink => 'http://www.w3.org/1999/xlink', # the svg tag xmlns:xlink attribute + -standalone => 'yes', + -pubid => "-//W3C//DTD SVG 1.0//EN", # formerly -identifier + -sysid => 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd', # the system id + +SVG also allows additional element generation methods to be specified in the +import list. For example to generate 'star' and 'planet' element methods: + + use SVG qw(star planet); + +or: + + use SVG ("star","planet"); + +This will add 'star' to the list of elements supported by SVG.pm (but not of +course other SVG parsers...). Alternatively the '-auto' option will allow +any unknown method call to generate an element of the same name: + + use SVG (-auto => 1, "star", "planet"); + +Any elements specified explicitly (as 'star' and 'planet' are here) are +predeclared; other elements are defined as and when they are seen by Perl. Note +that enabling '-auto' effectively disables compile-time syntax checking for +valid method names. + + use SVG ( + -auto => 0, + -indent => " ", + -raiseerror => 0, + -printerror => 1, + "star", "planet", "moon" + ); + +=head2 Default SVG tag + +The Default SVG tag will generate the following XML: + + $svg = SVG->new; + print $svg->xmlify; + +Resulting XML snippet: + + + + + + +=head1 METHODS + +SVG provides both explicit and generic element constructor methods. Explicit +generators are generally (with a few exceptions) named for the element they +generate. If a tag method is required for a tag containing hyphens, the method +name replaces the hyphen with an underscore. ie: to generate tag +you would use method $svg->column_heading(id=>'new'). + + +All element constructors take a hash of element attributes and options; +element attributes such as 'id' or 'border' are passed by name, while options for the +method (such as the type of an element that supports multiple alternate forms) +are passed preceded by a hyphen, e.g '-type'. Both types may be freely +intermixed; see the L<"fe"> method and code examples throughout the documentation +for more examples. + +=head2 new (constructor) + +$svg = SVG->new(%attributes) + +Creates a new SVG object. Attributes of the document SVG element be passed as +an optional list of key value pairs. Additionally, SVG options (prefixed with +a hyphen) may be set on a per object basis: + + my $svg1 = SVG->new; + + my $svg2 = SVG->new(id => 'document_element'); + + my $svg3 = SVG->new( + -printerror => 1, + -raiseerror => 0, + -indent => ' ', + -docroot => 'svg', #default document root element (SVG specification assumes svg). Defaults to 'svg' if undefined + -sysid => 'abc', #optional system identifyer + -pubid => "-//W3C//DTD SVG 1.0//EN", #public identifyer default value is "-//W3C//DTD SVG 1.0//EN" if undefined + -namespace => 'mysvg', + -inline => 1 + id => 'document_element', + width => 300, + height => 200, + ); + +BsvgE> root element.> + +Default SVG options may also be set in the import list. See L<"EXPORTS"> above +for more on the available options. + +Furthermore, the following options: + + + -version + -encoding + -standalone + -namespace Defines the document or element level namespace. The order of assignment priority is element,document . + -inline + -identifier + -nostub + -dtd (standalone) + +may also be set in xmlify, overriding any corresponding values set in the SVG->new declaration + + +=head2 xmlify (alias: to_xml render serialise serialize) + +$string = $svg->xmlify(%attributes); + +Returns xml representation of svg document. + +B + + Name Default Value + -version '1.0' + -encoding 'UTF-8' + -standalone 'yes' + -namespace 'svg' - namespace for elements + -inline '0' - If '1', then this is an inline document. + -pubid '-//W3C//DTD SVG 1.0//EN'; + -dtd (standalone) 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd' + + +=head2 tag (alias: element) + +$tag = $svg->tag($name, %attributes) + +Generic element generator. Creates the element named $name with the attributes +specified in %attributes. This method is the basis of most of the explicit +element generators. + + my $tag = $svg->tag('g', transform=>'rotate(-45)'); + + +=head2 anchor + +$tag = $svg->anchor(%attributes) + +Generate an anchor element. Anchors are put around objects to make them +'live' (i.e. clickable). It therefore requires a drawn object or group element +as a child. + +=head3 optional anchor attributes + +the following attributes are expected for anchor tags (any any tags which use -href links): + +=head2 -href required + +=head2 -type optional + +=head2 -role optional + +=head2 -title optional + +=head2 -show optional + +=head2 -arcrole optional + +=head2 -actuate optional + +=head2 target optional + +For more information on the options, refer to the w3c XLink specification at +L + +B + + # generate an anchor + $tag = $SVG->anchor( + -href=>'http://here.com/some/simpler/SVG.SVG' + -title => 'new window 2 example title', + -actuate => 'onLoad', + -show=> 'embed', + + ); + +for more information about the options above, refer to Link section in the SVG recommendation: L + + # add a circle to the anchor. The circle can be clicked on. + $tag->circle(cx => 10, cy => 10, r => 1); + + # more complex anchor with both URL and target + $tag = $SVG->anchor( + -href => 'http://somewhere.org/some/other/page.html', + target => 'new_window' + ); + + + # generate an anchor + $tag = $svg->anchor( + -href=>'http://here.com/some/simpler/svg.svg' + ); + # add a circle to the anchor. The circle can be clicked on. + $tag->circle(cx => 10, cy => 10, r => 1); + + # more complex anchor with both URL and target + $tag = $svg->anchor( + -href => 'http://somewhere.org/some/other/page.html', + target => 'new_window' + ); + +=head2 circle + +$tag = $svg->circle(%attributes) + +Draw a circle at (cx,cy) with radius r. + + my $tag = $svg->circle(cx => 4, cy => 2, r => 1); + +=head2 ellipse + +$tag = $svg->ellipse(%attributes) + +Draw an ellipse at (cx,cy) with radii rx,ry. + + use SVG; + + # create an SVG object + my $svg= SVG->new( width => 200, height => 200); + + my $tag = $svg->ellipse( + cx => 10, + cy => 10, + rx => 5, + ry => 7, + id => 'ellipse', + style => { + 'stroke' => 'red', + 'fill' => 'green', + 'stroke-width' => '4', + 'stroke-opacity' => '0.5', + 'fill-opacity' => '0.2', + } + ); + +See The B + +=for HTML

SVG example ellipse

+ +=head2 rectangle (alias: rect) + +$tag = $svg->rectangle(%attributes) + +Draw a rectangle at (x,y) with width 'width' and height 'height' and side radii +'rx' and 'ry'. + + $tag = $svg->rectangle( + x => 10, + y => 20, + width => 4, + height => 5, + rx => 5.2, + ry => 2.4, + id => 'rect_1' + ); + +=head2 image + + $tag = $svg->image(%attributes) + +Draw an image at (x,y) with width 'width' and height 'height' linked to image +resource '-href'. See also L<"use">. + + $tag = $svg->image( + x => 100, + y => 100, + width => 300, + height => 200, + '-href' => "image.png", #may also embed SVG, e.g. "image.svg" + id => 'image_1' + ); + +B + + + +=head2 use + +$tag = $svg->use(%attributes) + +Retrieve the content from an entity within an SVG document and apply it at +(x,y) with width 'width' and height 'height' linked to image resource '-href'. + + $tag = $svg->use( + x => 100, + y => 100, + width => 300, + height => 200, + '-href' => "pic.svg#image_1", + id => 'image_1' + ); + +B + + + +According to the SVG specification, the 'use' element in SVG can point to a +single element within an external SVG file. + +=head2 polygon + +$tag = $svg->polygon(%attributes) + +Draw an n-sided polygon with vertices at points defined by a string of the form +'x1,y1,x2,y2,x3,y3,... xy,yn'. The L<"get_path"> method is provided as a +convenience to generate a suitable string from coordinate data. + + # a five-sided polygon + my $xv = [0, 2, 4, 5, 1]; + my $yv = [0, 0, 2, 7, 5]; + + my $points = $svg->get_path( + x => $xv, + y => $yv, + -type =>'polygon' + ); + + my $poly = $svg->polygon( + %$points, + id => 'pgon1', + style => \%polygon_style + ); + +SEE ALSO: + +L<"polyline">, L<"path">, L<"get_path">. + +=head2 polyline + +$tag = $svg->polyline(%attributes) + +Draw an n-point polyline with points defined by a string of the form +'x1,y1,x2,y2,x3,y3,... xy,yn'. The L<"get_path"> method is provided as a +convenience to generate a suitable string from coordinate data. + + # a 10-pointsaw-tooth pattern + my $xv = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + my $yv = [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]; + + my $points = $svg->get_path( + x => $xv, + y => $yv, + -type => 'polyline', + -closed => 'true' #specify that the polyline is closed. + ); + + my $tag = $svg->polyline ( + %$points, + id =>'pline_1', + style => { + 'fill-opacity' => 0, + 'stroke' => 'rgb(250,123,23)' + } + ); + +=head2 line + +$tag = $svg->line(%attributes) + +Draw a straight line between two points (x1,y1) and (x2,y2). + + my $tag = $svg->line( + id => 'l1', + x1 => 0, + y1 => 10, + x2 => 10, + y2 => 0, + ); + +To draw multiple connected lines, use L<"polyline">. + +=head2 text + +$text = $svg->text(%attributes)->cdata(); + +$text_path = $svg->text(-type=>'path'); +$text_span = $text_path->text(-type=>'span')->cdata('A'); +$text_span = $text_path->text(-type=>'span')->cdata('B'); +$text_span = $text_path->text(-type=>'span')->cdata('C'); + +Define the container for a text string to be drawn in the image. + +B + + -type = path type (path | polyline | polygon) + -type = text element type (path | span | normal [default]) + + my $text1 = $svg->text( + id => 'l1', + x => 10, + y => 10 + )->cdata('hello, world'); + + my $text2 = $svg->text( + id => 'l1', + x => 10, + y => 10, + -cdata => 'hello, world', + ); + + my $text = $svg->text( + id => 'tp', + x => 10, + y => 10, + -type => path, + ) + ->text(id=>'ts' -type=>'span') + ->cdata('hello, world'); + +SEE ALSO: + +L<"desc">, L<"cdata">. + +=head2 title + +$tag = $svg->title(%attributes) + +Generate the title of the image. + + my $tag = $svg->title(id=>'document-title')->cdata('This is the title'); + +=head2 desc + +$tag = $svg->desc(%attributes) + +Generate the description of the image. + + my $tag = $svg->desc(id=>'document-desc')->cdata('This is a description'); + +=head2 comment + +$tag = $svg->comment(@comments) + +Generate the description of the image. + + my $tag = $svg->comment('comment 1','comment 2','comment 3'); + +=head2 pi (Processing Instruction) + +$tag = $svg->pi(@pi) + +Generate a set of processing instructions + + my $tag = $svg->pi('instruction one','instruction two','instruction three'); + + returns: + ?instruction one? + ?instruction two? + ?instruction three? + +=head2 script + +$tag = $svg->script(%attributes) + +Generate a script container for dynamic (client-side) scripting using +ECMAscript, Javascript or other compatible scripting language. + + my $tag = $svg->script(-type=>"text/ecmascript"); + #or my $tag = $svg->script(); + #note that type ecmascript is not Mozilla compliant + + # populate the script tag with cdata + # be careful to manage the javascript line ends. + # Use qq{text} or q{text} as appropriate. + # make sure to use the CAPITAL CDATA to poulate the script. + $tag->CDATA(qq{ + function d() { + //simple display function + for(cnt = 0; cnt < d.length; cnt++) + document.write(d[cnt]);//end for loop + document.write("
");//write a line break + } + }); + +=head2 path + +$tag = $svg->path(%attributes) + +Draw a path element. The path vertices may be provided as a parameter or +calculated using the L<"get_path"> method. + + # a 10-pointsaw-tooth pattern drawn with a path definition + my $xv = [0,1,2,3,4,5,6,7,8,9]; + my $yv = [0,1,0,1,0,1,0,1,0,1]; + + $points = $svg->get_path( + x => $xv, + y => $yv, + -type => 'path', + -closed => 'true' #specify that the polyline is closed + ); + + $tag = $svg->path( + %$points, + id => 'pline_1', + style => { + 'fill-opacity' => 0, + 'fill' => 'green', + 'stroke' => 'rgb(250,123,23)' + } + ); + + +SEE ALSO: L<"get_path">. + +=head2 get_path + +$path = $svg->get_path(%attributes) + +Returns the text string of points correctly formatted to be incorporated into +the multi-point SVG drawing object definitions (path, polyline, polygon) + +B attributes including: + + -type = path type (path | polyline | polygon) + x = reference to array of x coordinates + y = reference to array of y coordinates + +B a hash reference consisting of the following key-value pair: + + points = the appropriate points-definition string + -type = path|polygon|polyline + -relative = 1 (define relative position rather than absolute position) + -closed = 1 (close the curve - path and polygon only) + + #generate an open path definition for a path. + my ($points,$p); + $points = $svg->get_path(x=>\@x,y=>\@y,-relative=>1,-type=>'path'); + + #add the path to the SVG document + my $p = $svg->path(%$path, style=>\%style_definition); + + #generate an closed path definition for a a polyline. + $points = $svg->get_path( + x=>\@x, + y=>\@y, + -relative=>1, + -type=>'polyline', + -closed=>1 + ); # generate a closed path definition for a polyline + + # add the polyline to the SVG document + $p = $svg->polyline(%$points, id=>'pline1'); + +B get_path set_path + + +=head2 animate + +$tag = $svg->animate(%attributes) + +Generate an SMIL animation tag. This is allowed within any nonempty tag. Refer +to the W3C for detailed information on the subtleties of the animate SMIL +commands. + +B -method = Transform | Motion | Color + + my $an_ellipse = $svg->ellipse( + cx => 30, + cy => 150, + rx => 10, + ry => 10, + id => 'an_ellipse', + stroke => 'rgb(130,220,70)', + fill =>'rgb(30,20,50)' + ); + + $an_ellipse-> animate( + attributeName => "cx", + values => "20; 200; 20", + dur => "10s", + repeatDur => 'indefinite' + ); + + $an_ellipse-> animate( + attributeName => "rx", + values => "10;30;20;100;50", + dur => "10s", + repeatDur => 'indefinite', + ); + + $an_ellipse-> animate( + attributeName => "ry", + values => "30;50;10;20;70;150", + dur => "15s", + repeatDur => 'indefinite', + ); + + $an_ellipse-> animate( + attributeName=>"rx",values=>"30;75;10;100;20;20;150", + dur=>"20s", repeatDur=>'indefinite'); + + $an_ellipse-> animate( + attributeName=>"fill",values=>"red;green;blue;cyan;yellow", + dur=>"5s", repeatDur=>'indefinite'); + + $an_ellipse-> animate( + attributeName=>"fill-opacity",values=>"0;1;0.5;0.75;1", + dur=>"20s",repeatDur=>'indefinite'); + + $an_ellipse-> animate( + attributeName=>"stroke-width",values=>"1;3;2;10;5", + dur=>"20s",repeatDur=>'indefinite'); + +=head2 group + +$tag = $svg->group(%attributes) + +Define a group of objects with common properties. Groups can have style, +animation, filters, transformations, and mouse actions assigned to them. + + $tag = $svg->group( + id => 'xvs000248', + style => { + 'font' => [ qw( Arial Helvetica sans ) ], + 'font-size' => 10, + 'fill' => 'red', + }, + transform => 'rotate(-45)' + ); + +=head2 defs + +$tag = $svg->defs(%attributes) + +define a definition segment. A Defs requires children when defined using SVG.pm + + $tag = $svg->defs(id => 'def_con_one',); + +=head2 style + +$svg->tag('style', %styledef); + +Sets/Adds style-definition for the following objects being created. + +Style definitions apply to an object and all its children for all properties for +which the value of the property is not redefined by the child. + + $tag = $SVG->style(%attributes) + +Generate a style container for inline or xlink:href based styling instructions + + my $tag = $SVG->style(type=>"text/css"); + + # Populate the style tag with cdata. + # Be careful to manage the line ends. + # Use qq{text}, where text is the script + + $tag1->CDATA(qq{ + rect fill:red;stroke:green; + circle fill:red;stroke:orange; + ellipse fill:none;stroke:yellow; + text fill:black;stroke:none; + }); + + # Create a external CSS stylesheet reference + my $tag2 = $SVG->style(type=>"text/css", -href="/resources/example.css"); + +=pod + + +=head2 mouseaction + +$svg->mouseaction(%attributes) + +Sets/Adds mouse action definitions for tag + +=head2 attrib + + $svg->attrib($name, $value) + +Sets/Adds attributes of an element. + +Retrieve an attribute: + + $svg->attrib($name); + +Set a scalar attribute: + + $SVG->attrib $name, $value + +Set a list attribute: + + $SVG->attrib $name, \@value + +Set a hash attribute (i.e. style definitions): + + $SVG->attrib $name, \%value + +Remove an attribute: + + $svg->attrib($name,undef); + +B attr attribute + +Sets/Replaces attributes for a tag. + +=head2 cdata + +$svg->cdata($text) + +Sets cdata to $text. SVG.pm allows you to set cdata for any tag. If the tag is +meant to be an empty tag, SVG.pm will not complain, but the rendering agent will +fail. In the SVG DTD, cdata is generally only meant for adding text or script +content. + + $svg->text( + style => { + 'font' => 'Arial', + 'font-size' => 20 + })->cdata('SVG.pm is a perl module on CPAN!'); + + my $text = $svg->text( style => { 'font' => 'Arial', 'font-size' => 20 } ); + $text->cdata('SVG.pm is a perl module on CPAN!'); + +B + + SVG.pm is a perl module on CPAN! + +SEE ALSO: + +L<"CDATA">, L<"desc">, L<"title">, L<"text">, L<"script">. + +=head2 cdata_noxmlesc + + $script = $svg->script(); + $script->cdata_noxmlesc($text); + +Generates cdata content for text and similar tags which do not get xml-escaped. +In othe words, does not parse the content and inserts the exact string into the cdata location. + +=head2 CDATA + + $script = $svg->script(); + $script->CDATA($text); + +Generates a tag with the contents of $text rendered exactly as supplied. SVG.pm allows you to set cdata for any tag. If the tag is +meant to be an empty tag, SVG.pm will not complain, but the rendering agent will +fail. In the SVG DTD, cdata is generally only meant for adding text or script +content. + + my $text = qq{ + var SVGDoc; + var groups = new Array(); + var last_group; + + /***** + * + * init + * + * Find this SVG's document element + * Define members of each group by id + * + *****/ + function init(e) { + SVGDoc = e.getTarget().getOwnerDocument(); + append_group(1, 4, 6); // group 0 + append_group(5, 4, 3); // group 1 + append_group(2, 3); // group 2 + }}; + $svg->script()->CDATA($text); + + +B + + Escript E + ![CDATA[ + var SVGDoc; + var groups = new Array(); + var last_group; + + /***** + * + * init + * + * Find this SVG's document element + * Define members of each group by id + * + *****/ + function init(e) { + SVGDoc = e.getTarget().getOwnerDocument(); + append_group(1, 4, 6); // group 0 + append_group(5, 4, 3); // group 1 + append_group(2, 3); // group 2 + } + ]]E + +SEE ALSO: L<"cdata">, L<"script">. + +=head2 xmlescp and xmlescape + +$string = $svg->xmlescp($string) +$string = $svg->xmlesc($string) +$string = $svg->xmlescape($string) + +SVG module does not xml-escape characters that are incompatible with the XML specification. B and B provides this functionality. It is a helper function which generates an XML-escaped string for reserved characters such as ampersand, open and close brackets, etcetera. + +The behaviour of xmlesc is to apply the following transformation to the input string $s: + + $s=~s/&(?!#(x\w\w|\d+?);)/&/g; + $s=~s/>/>/g; + $s=~s/filter(%attributes) + +Generate a filter. Filter elements contain L<"fe"> filter sub-elements. + + my $filter = $svg->filter( + filterUnits=>"objectBoundingBox", + x=>"-10%", + y=>"-10%", + width=>"150%", + height=>"150%", + filterUnits=>'objectBoundingBox' + ); + + $filter->fe(); + +SEE ALSO: L<"fe">. + +=head2 fe + +$tag = $svg->fe(-type=>'type', %attributes) + +Generate a filter sub-element. Must be a child of a L<"filter"> element. + + my $fe = $svg->fe( + -type => 'DiffuseLighting' # required - element name omitting 'fe' + id => 'filter_1', + style => { + 'font' => [ qw(Arial Helvetica sans) ], + 'font-size' => 10, + 'fill' => 'red', + }, + transform => 'rotate(-45)' + ); + +Note that the following filter elements are currently supported: +Also note that the elelemts are defined in lower case in the module, but as of version 2.441, any case combination is allowed. + + +=head2 * feBlend + +=head2 * feColorMatrix + +=head2 * feComponentTransfer + +=head2 * feComposite + +=head2 * feConvolveMatrix + +=head2 * feDiffuseLighting + +=head2 * feDisplacementMap + +=head2 * feDistantLight + +=head2 * feFlood + +=head2 * feFuncA + +=head2 * feFuncB + +=head2 * feFuncG + +=head2 * feFuncR + +=head2 * feGaussianBlur + +=head2 * feImage + +=head2 * feMerge + +=head2 * feMergeNode + +=head2 * feMorphology + +=head2 * feOffset + +=head2 * fePointLight + +=head2 * feSpecularLighting + +=head2 * feSpotLight + +=head2 * feTile + +=head2 * feTurbulence + + +SEE ALSO: L<"filter">. + +=head2 pattern + +$tag = $svg->pattern(%attributes) + +Define a pattern for later reference by url. + + + my $pattern = $svg->pattern( + id => "Argyle_1", + width => "50", + height => "50", + patternUnits => "userSpaceOnUse", + patternContentUnits => "userSpaceOnUse" + ); + +=head2 set + +$tag = $svg->set(%attributes) + +Set a definition for an SVG object in one section, to be referenced in other +sections as needed. + + my $set = $svg->set( + id => "Argyle_1", + width => "50", + height => "50", + patternUnits => "userSpaceOnUse", + patternContentUnits => "userSpaceOnUse" + ); + +=head2 stop + +$tag = $svg->stop(%attributes) + +Define a stop boundary for L<"gradient"> + + my $pattern = $svg->stop( + id => "Argyle_1", + width => "50", + height => "50", + patternUnits => "userSpaceOnUse", + patternContentUnits => "userSpaceOnUse" + ); + +=head2 gradient + +$tag = $svg->gradient(%attributes) + +Define a color gradient. Can be of type B or B + + my $gradient = $svg->gradient( + -type => "linear", + id => "gradient_1" + ); + +=head1 GENERIC ELEMENT METHODS + +The following elements are generically supported by SVG: + + +=head2 * altGlyph + +=head2 * altGlyphDef + +=head2 * altGlyphItem + +=head2 * clipPath + +=head2 * color-profile + +=head2 * cursor + +=head2 * definition-src + +=head2 * font-face-format + +=head2 * font-face-name + +=head2 * font-face-src + +=head2 * font-face-url + +=head2 * foreignObject + +=head2 * glyph + +=head2 * glyphRef + +=head2 * hkern + +=head2 * marker + +=head2 * mask + +=head2 * metadata + +=head2 * missing-glyph + +=head2 * mpath + +=head2 * switch + +=head2 * symbol + +=head2 * tref + +=head2 * view + +=head2 * vkern + +See e.g. L<"pattern"> for an example of the use of these methods. + +=head1 METHODS IMPORTED BY SVG::DOM + +The following L elements are accessible through SVG: + +=head2 * getChildren + +=head2 * getFirstChild + +=head2 * getNextChild + +=head2 * getLastChild + +=head2 * getParent + +=head2 * getParentElement + +=head2 * getSiblings + +=head2 * getElementByID + +=head2 * getElementID + +=head2 * getElements + +=head2 * getElementName + +=head2 * getType + +=head2 * getAttributes + +=head2 * getAttribute + +=head2 * setAttributes + +=head2 * setAttribute + +=head2 * insertBefore + +=head2 * insertAfter + +=head2 * insertSiblingBefore + +=head2 * insertSiblingAfter + +=head2 * replaceChild + +=head2 * removeChild + +=head2 * cloneNode + + +=cut + +#------------------------------------------------------------------------------- + +my %default_attrs = ( + + # processing options + -auto => 0, # permit arbitrary autoloads (only at import) + -printerror => 1, # print error messages to STDERR + -raiseerror => 1, # die on errors (implies -printerror) + + # rendering options + -indent => "\t", # what to indent with + -elsep => "\n", # element line (vertical) separator + -nocredits => 0, # enable/disable credit note comment + -namespace => + '', # The root element's (and it's children's) namespace prefix + + # XML and Doctype declarations + -inline => 0, # inline or stand alone + -docroot => 'svg', # The document's root element + -version => '1.0', + -extension => '', + -encoding => 'UTF-8', + -xml_svg => 'http://www.w3.org/2000/svg', + -xml_xlink => 'http://www.w3.org/1999/xlink', + -standalone => 'yes', + -pubid => '-//W3C//DTD SVG 1.0//EN', # formerly -identifier + -sysid => 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd', +); + +sub import { + my $package = shift; + + my $attr = undef; + foreach (@_) { + if ($attr) { + $default_attrs{$attr} = $_; + undef $attr; + } + elsif ( exists $default_attrs{$_} ) { + $attr = $_; + } + else { + /^-/ and die "Unknown attribute '$_' in import list\n"; + $SVG::Element::autosubs{$_} + = 1; # add to list of autoloadable tags + } + } + + # switch on AUTOLOADer, if asked. + if ( $default_attrs{'-auto'} ) { + *SVG::Element::AUTOLOAD = \&SVG::Element::autoload; + } + + # predeclare any additional elements asked for by the user + foreach my $sub ( keys %SVG::Element::autosubs ) { + $SVG::Element::AUTOLOAD = ("SVG::Element::$sub"); + SVG::Element::autoload(); + } + + delete $default_attrs{-auto}; # -auto is only allowed here, not in new + + return (); +} + +#------------------------------------------------------------------------------- + +=pod + +=head1 Methods + +SVG provides both explicit and generic element constructor methods. Explicit +generators are generally (with a few exceptions) named for the element they +generate. If a tag method is required for a tag containing hyphens, the method +name replaces the hyphen with an underscore. ie: to generate tag +you would use method $svg->column_heading(id=>'new'). + + +All element constructors take a hash of element attributes and options; +element attributes such as 'id' or 'border' are passed by name, while options for the +method (such as the type of an element that supports multiple alternate forms) +are passed preceded by a hyphen, e.g '-type'. Both types may be freely +intermixed; see the L<"fe"> method and code examples throughout the documentation +for more examples. + +=head2 new (constructor) + +$svg = SVG->new(%attributes) + +Creates a new SVG object. Attributes of the document SVG element be passed as +an optional list of key value pairs. Additionally, SVG options (prefixed with +a hyphen) may be set on a per object basis: + + my $svg1 = SVG->new; + + my $svg2 = SVG->new(id => 'document_element'); + + my $svg3 = SVG->new( + -printerror => 1, + -raiseerror => 0, + -indent => ' ', + -elsep => "\n", # element line (vertical) separator + -docroot => 'svg', # default document root element (SVG specification assumes svg). Defaults to 'svg' if undefined + -xml_xlink => 'http://www.w3.org/1999/xlink', # required by Mozilla's embedded SVG engine + -sysid => 'abc', # optional system identifier + -pubid => "-//W3C//DTD SVG 1.0//EN", # public identifier default value is "-//W3C//DTD SVG 1.0//EN" if undefined + -namespace => 'mysvg', + -inline => 1 + id => 'document_element', + width => 300, + height => 200, + ); + +Default SVG options may also be set in the import list. See L<"EXPORTS"> above +for more on the available options. + +Furthermore, the following options: + + -version + -encoding + -standalone + -namespace + -inline + -pubid (formerly -identifier) + -sysid (standalone) + +may also be set in xmlify, overriding any corresponding values set in the SVG->new declaration + +=cut + +#------------------------------------------------------------------------------- +# +# constructor for the SVG data model. +# +# the new constructor creates a new data object with a document tag at its base. +# this document tag then has either: +# a child entry parent with its child svg generated (when -inline = 1) +# or +# a child entry svg created. +# +# Because the new method returns the $self reference and not the +# latest child to be created, a hash key -document with the reference to the hash +# entry of its already-created child. hence the document object has a -document reference +# to parent or svg if inline is 1 or 0, and parent will have a -document entry +# pointing to the svg child. +# +# This way, the next tag constructor will descend the +# tree until it finds no more tags with -document, and will add +# the next tag object there. +# refer to the SVG::tag method + +sub new { + my ( $proto, %attrs ) = @_; + + my $class = ref $proto || $proto; + my $self; + + # establish defaults for unspecified attributes + foreach my $attr ( keys %default_attrs ) { + $attrs{$attr} = $default_attrs{$attr} unless exists $attrs{$attr}; + } + $self = $class->SUPER::new('document'); + if ( not $self->{-docref} ) { + $self->{-docref} = $self; + weaken( $self->{-docref} ); + } + unless ( $attrs{-namespace} ) { + $attrs{'xmlns'} = $attrs{'xmlns'} || $attrs{'-xml_svg'}; + } + $attrs{'xmlns:xlink'} + = $attrs{'xmlns:xlink'} + || $attrs{'-xml_xlink'} + || 'http://www.w3.org/1999/xlink'; + $attrs{'xmlns:svg'} + = $attrs{'xmlns:svg'} + || $attrs{'-xml_svg'} + || 'http://www.w3.org/2000/svg'; + + $self->{-level} = 0; + $self->{$_} = $attrs{$_} foreach keys %default_attrs; + + # create SVG object according to nostub attribute + my $svg; + unless ( $attrs{-nostub} ) { + $svg = $self->svg(%attrs); + $self->{-document} = $svg; + weaken( $self->{-document} ); + } + + # add -attributes to SVG object + # $self->{-elrefs}->{$self}->{name} = 'document'; + # $self->{-elrefs}->{$self}->{id} = ''; + + return $self; +} + +#------------------------------------------------------------------------------- + +=pod + +=head2 xmlify (alias: to_xml render serialize serialise ) + +$string = $svg->xmlify(%attributes); + +Returns xml representation of svg document. + +B + + Name Default Value + -version '1.0' + -encoding 'UTF-8' + -standalone 'yes' + -namespace 'svg' - namespace prefix for elements. + Can also be used in any element method to over-ride + the current namespace prefix. Make sure to have + declared the prefix before using it. + -inline '0' - If '1', then this is an inline document. + -pubid '-//W3C//DTD SVG 1.0//EN'; + -sysid 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd' + +=cut + +sub xmlify { + my ( $self, %attrs ) = @_; + + my ( $decl, $ns ); + + my $credits = ''; + + # Give the module and myself credit unless explicitly turned off + unless ( $self->{-docref}->{-nocredits} + or $self->{-docref}{-creditsinserted} ) + { + $self->comment( + "\n\tGenerated using the Perl SVG Module V$VERSION\n\tby Ronan Oger\n\tInfo: http://www.roitsystems.com/\n" + ); + $self->{-docref}{-creditsinserted} = 1; + } + + foreach my $key ( keys %attrs ) { + next if $key !~ /^-/; + $self->{$key} = $attrs{$key}; + } + + foreach my $key ( keys %$self ) { + next if $key !~ /^-/; + $attrs{$key} ||= $self->{$key}; + } + + return $self->SUPER::xmlify( $self->{-namespace} ); +} + +*render = \&xmlify; +*to_xml = \&xmlify; +*serialise = \&xmlify; +*serialize = \&xmlify; + +=head2 perlify () + +return the perl code which generates the SVG document as it currently exists. + +=cut + +sub perlify { + return shift->SUPER::perlify(); +} + +=head2 toperl () + +Alias for method perlify() + +=cut + +*toperl = \&perlify; + +1; + +=pod + +=head1 AUTHOR + +Ronan Oger, RO IT Systemms GmbH, cpan@roitsystems.com + +=head1 MAINTAINER + +L + +=head1 CREDITS + +I would like to thank the following people for contributing to this module with +patches, testing, suggestions, and other nice tidbits: + +Peter Wainwright, Excellent ideas, beta-testing, writing SVG::Parser and much of SVG::DOM. +Fredo, http://www.penguin.at0.net/~fredo/ - provided example code and initial feedback for early SVG.pm versions and the idea of a simplified svg generator. +Adam Schneider, +Brial Pilpré, +Ian Hickson +Steve Lihn, +Allen Day +Martin Owens - SVG::DOM improvements in version 3.34 + +=head1 COPYRIGHT & LICENSE + +Copyright 2001- Ronan Oger + +The modules in the SVG distribution are distributed under the same license +as Perl itself. It is provided free of warranty and may be re-used freely. + +=head1 ARTICLES + +L + +L + +L + +=head1 SEE ALSO + +L, +L, +L, +L, +L + +For Commercial Perl/SVG development, refer to the following sites: +L, +L, +L + +=cut diff --git a/bin/svg_kit/SVG/DOM.pm b/bin/svg_kit/SVG/DOM.pm new file mode 100644 index 0000000..c3edc90 --- /dev/null +++ b/bin/svg_kit/SVG/DOM.pm @@ -0,0 +1,806 @@ +package SVG::DOM; +use strict; +use warnings; + +use Scalar::Util qw/weaken/; + +our $VERSION = '2.78'; + +# this module extends SVG::Element +package SVG::Element; + +#----------------- +# sub getFirstChild + +sub getFirstChild { + my $self = shift; + + if ( my @children = $self->getChildren ) { + return $children[0]; + } + return; +} + +#----------------- +# sub getChildIndex +# return the array index of this element in the parent +# or the passed list (if there is one). + +sub getChildIndex { + my ( $self, @children ) = @_; + + unless (@children) { + my $parent = $self->getParent(); + @children = $parent->getChildren(); + return unless @children; + } + + for my $index ( 0 .. $#children ) { + return $index if $children[$index] == $self; + } + + return; +} + +#----------------- +# sub getChildAtIndex +# return the element at the specified index +# (the index can be negative) + +sub getChildAtIndex { + my ( $self, $index, @children ) = @_; + + unless (@children) { + my $parent = $self->getParent(); + @children = $parent->getChildren(); + return unless @children; + } + + return $children[$index]; +} + +#----------------- +# sub getNextSibling + +sub getNextSibling { + my $self = shift; + + if ( my $parent = $self->getParent ) { + my @children = $parent->getChildren(); + my $index = $self->getChildIndex(@children); + if ( defined $index and scalar(@children) > $index ) { + return $children[ $index + 1 ]; + } + } + + return; +} + +#----------------- +# sub getPreviousSibling + +sub getPreviousSibling { + my $self = shift; + + if ( my $parent = $self->getParent ) { + my @children = $parent->getChildren(); + my $index = $self->getChildIndex(@children); + if ($index) { + return $children[ $index - 1 ]; + } + } + + return; +} + +#----------------- +# sub getLastChild + +sub getLastChild { + my $self = shift; + + if ( my @children = $self->getChildren ) { + return $children[-1]; + } + + return; +} + +#----------------- +# sub getChildren + +sub getChildren { + my $self = shift; + + if ( $self->{-childs} ) { + if (wantarray) { + return @{ $self->{-childs} }; + } + return $self->{-childs}; + } + + return; +} +*getChildElements = \&getChildren; +*getChildNodes = \&getChildren; + +#----------------- + +sub hasChildren { + my $self = shift; + + if ( exists $self->{-childs} ) { + if ( scalar @{ $self->{-childs} } ) { + return 1; + } + } + + return 0; +} +*hasChildElements = \&hasChildren; +*hasChildNodes = \&hasChildren; + +#----------------- +# sub getParent / getParentElement +# return the ref of the parent of the current node + +sub getParent { + my $self = shift; + + if ( $self->{-parent} ) { + return $self->{-parent}; + } + + return; +} +*getParentElement = \&getParent; +*getParentNode = \&getParent; + +#----------------- +# sub getParents / getParentElements + +sub getParents { + my $self = shift; + + my $parent = $self->{-parent}; + return unless $parent; + + my @parents; + while ($parent) { + push @parents, $parent; + $parent = $parent->{-parent}; + } + + return @parents; +} +*getParentElements = \&getParents; +*getParentNodes = \&getParents; +*getAncestors = \&getParents; + +#----------------- +# sub isAncestor + +sub isAncestor { + my ( $self, $descendant ) = @_; + + my @parents = $descendant->getParents(); + foreach my $parent (@parents) { + return 1 if $parent == $self; + } + + return 0; +} + +#----------------- +# sub isDescendant + +sub isDescendant { + my ( $self, $ancestor ) = @_; + + my @parents = $self->getParents(); + foreach my $parent (@parents) { + return 1 if $parent == $ancestor; + } + + return 0; +} + +#----------------- +# sub getSiblings + +sub getSiblings { + my $self = shift; + + if ( my $parent = $self->getParent ) { + return $parent->getChildren(); + } + + return; +} + +#----------------- +# sub hasSiblings + +sub hasSiblings { + my $self = shift; + + if ( my $parent = $self->getParent ) { + my $siblings = scalar( $parent->getChildren ); + return 1 if $siblings >= 2; + } + + return; +} + +#----------------- +# sub getElementName / getType + +sub getElementName { + my $self = shift; + + if ( exists $self->{-name} ) { + return $self->{-name}; + } + + return; +} +*getType = \&getElementName; +*getElementType = \&getElementName; +*getTagName = \&getElementName; +*getTagType = \&getElementName; +*getNodeName = \&getElementName; +*getNodeType = \&getElementName; + +#----------------- +# sub getElements +# get all elements of the specified type +# if none is specified, get all elements in document. + +sub getElements { + my ( $self, $element ) = @_; + + return unless exists $self->{-docref}; + return unless exists $self->{-docref}->{-elist}; + + my $elist = $self->{-docref}->{-elist}; + if ( defined $element ) { + if ( exists $elist->{$element} ) { + return wantarray ? @{ $elist->{$element} } : $elist->{$element}; + } + return; + } + else { + my @elements; + foreach my $element_type ( keys %$elist ) { + push @elements, @{ $elist->{$element_type} }; + } + return wantarray ? @elements : \@elements; + } +} + +# forces the use of the second argument for element name +sub getElementsByName { + return shift->getElements(shift); +} +*getElementsByType = \&getElementsByName; + +#----------------- +sub getElementNames { + my $self = shift; + + my @types = keys %{ $self->{-docref}->{-elist} }; + + return wantarray ? @types : \@types; +} +*getElementTypes = \&getElementNames; + +#----------------- +# sub getElementID + +sub getElementID { + my $self = shift; + + if ( exists $self->{id} ) { + return $self->{id}; + } + + return; +} + +#----------------- +# sub getElementByID / getElementbyID + +sub getElementByID { + my ( $self, $id ) = @_; + + return unless defined($id); + my $idlist = $self->{-docref}->{-idlist}; + if ( exists $idlist->{$id} ) { + return $idlist->{$id}; + } + + return; +} +*getElementbyID = \&getElementByID; + +#----------------- +# sub getAttribute +# see also SVG::attrib() + +sub getAttribute { + my ( $self, $attr ) = @_; + + if ( exists $self->{$attr} ) { + return $self->{$attr}; + } + + return; +} + +#----------------- +# sub getAttributes + +sub getAttributes { + my $self = shift; + + my $out = {}; + foreach my $i ( keys %$self ) { + $out->{$i} = $self->{$i} unless $i =~ /^-/; + } + + return wantarray ? %{$out} : $out; +} + +#----------------- +# sub setAttribute + +sub setAttributes { + my ( $self, $attr ) = @_; + foreach my $i ( keys %$attr ) { + $self->attrib( $i, $attr->{$i} ); + } +} + +#----------------- +# sub setAttribute + +sub setAttribute { + my ( $self, $att, $val ) = @_; + $self->attrib( $att, $val ); +} + +#----------------- +# sub getCDATA / getCdata / getData + +sub getCDATA { + my $self = shift; + + if ( exists $self->{-cdata} ) { + return $self->{-cdata}; + } + + return; +} +*getCdata = \&getCDATA; +*getData = \&getCDATA; + +# ---------------- +# 2005-12-30 - Martin Owens, apply greater DOM specification (write) +# http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html + +# ---------------- +# sub document +sub document { + my ($self) = @_; + return $self->{-docref}; +} + +# DOM specified method names +*createElement = \&tag; +*firstChild = \&getFirstChild; +*lastChild = \&getLastChild; +*previousSibling = \&getPreviousSibling; +*nextSibling = \&getNextSibling; + +# ---------------- +# sub insertBefore +sub insertBefore { + my ( $self, $newChild, $refChild ) = @_; + return $self->appendElement($newChild) if not $refChild; + my $index = $self->findChildIndex($refChild); + return 0 if $index < 0; # NO_FOUND_ERR + return $self->insertAtIndex( $newChild, $index ); +} +*insertChildBefore = \&insertBefore; +*insertNodeBefore = \&insertBefore; +*insertElementBefore = \&insertBefore; + +# ---------------- +# sub insertAfter +sub insertAfter { + my ( $self, $newChild, $refChild ) = @_; + return $self->appendElement($newChild) if not $refChild; + my $index = $self->findChildIndex($refChild); + return 0 if $index < 0; # NO_FOUND_ERR + return $self->insertAtIndex( $newChild, $index + 1 ); +} +*insertChildAfter = \&insertAfter; +*insertNodeAfter = \&insertAfter; +*insertElementAfter = \&insertAfter; + +# ---------------- +# sub insertSiblingAfter (Not in W3C DOM) +sub insertSiblingAfter { + my ( $self, $newChild ) = @_; + return $self->getParent->insertAfter( $newChild, $self ) + if $self->getParent; + return 0; +} + +# ---------------- +# sub insertSiblingBefore (Not in W3C DOM) +sub insertSiblingBefore { + my ( $self, $newChild ) = @_; + return $self->getParent->insertBefore( $newChild, $self ) + if $self->getParent; + return 0; +} + +# ---------------- +# sub replaceChild +sub replaceChild { + my ( $self, $newChild, $oldChild ) = @_; + + # Replace newChild if it is in this list of children already + $self->removeChild($newChild) if $newChild->{-parent} eq $self; + + # We need the index of the node to replace + my $index = $self->findChildIndex($oldChild); + return 0 if ( $index < 0 ); # NOT_FOUND_ERR + # Replace and bind new node with its family + $self->removeChildAtIndex($index); + $self->insertChildAtIndex($index); + return $oldChild; +} +*replaceElement = \&replaceChild; +*replaceNode = \&replaceChild; + +# ---------------- +# sub removeChild +sub removeChild { + my ( $self, $oldChild ) = @_; + my $index = $self->findChildIndex($oldChild); + return 0 if ( $index < 0 ); # NOT_FOUND_ERR + return $self->removeChildAtIndex($index); +} +*removeElement = \&removeChild; +*removeNode = \&removeChild; + +# ---------------- +# sub appendChild +sub appendChild { + my ( $self, $element ) = @_; + my $index + = ( defined $self->{-childs} && scalar @{ $self->{-childs} } ) || 0; + $self->insertAtIndex( $element, $index ); + return 1; +} +*appendElement = \&appendChild; +*appendNode = \&appendChild; + +# ---------------- +# sub cloneNode +sub cloneNode { + my ( $self, $deep ) = @_; + my $clone = new SVG::Element; + foreach my $key ( keys( %{$self} ) ) { + next if $key eq '-childs' or $key eq '-parent'; + if ( $key eq '-docref' ) { + + # need to forge a docref based on the docref of the template element + foreach my $dockey ( keys( %{ $self->{-docref} } ) ) { + next + if $dockey eq '-childs' + or $dockey eq '-parent' + or $dockey eq '-idlist' + or $dockey eq '-elist' + or $dockey eq '-document' + or $dockey eq '-docref'; + $clone->{-docref}->{$dockey} = $self->{-docref}->{$dockey}; + } + } + else { + $clone->{$key} = $self->{$key}; + } + } + + # We need to clone the children if deep is specified. + if ($deep) { + foreach my $child ( @{ $self->{-childs} } ) { + my $childClone = $child->cloneNode($deep); + $clone->appendChild($childClone); + } + } + + return $clone; +} +*cloneElement = \&cloneNode; + +# --------------------------------------- +# NONE DOM Supporting methodss + +# ---------------- +# sub findChildIndex +sub findChildIndex { + my ( $self, $refChild ) = @_; + + my $index = 0; + foreach my $child ( @{ $self->{-childs} } ) { + if ( $child eq $refChild ) { + return $index; # Child found + } + $index++; + } + + return -1; # Child not found +} + +# --------------- +# sub insertAtIndex +sub insertAtIndex { + my ( $self, $newChild, $index ) = @_; + + # add child + splice @{ $self->{-childs} }, $index, 0, $newChild; + + # update parent and document reference + $newChild->{-docref} = $self->{-docref}; + weaken( $newChild->{-docref} ); + $newChild->{-parent} = $self; + weaken( $newChild->{-parent} ); + + # update ID and element list + if ( defined( $newChild->{id} ) ) { + $self->{-docref}->{-idlist}->{ $newChild->{id} } = $newChild; + } + $self->{-docref}->{-elist} = {} + unless ( defined $self->{-docref}->{-elist} ); + $self->{-docref}->{-elist}->{ $newChild->{-name} } = [] + unless ( defined $self->{-docref}->{-elist}->{ $newChild->{-name} } ); + unshift @{ $self->{-docref}->{-elist}->{ $newChild->{-name} } }, + $newChild; + + return 1; +} +*insertChildAtIndex = \&insertAtIndex; + +# ---------------- +# sub removeChildAtIndex +sub removeChildAtIndex { + my ( $self, $index ) = @_; + + # remove child + my $oldChild = splice @{ $self->{-childs} }, $index, 1; + if ( not @{ $self->{-childs} } ) { + delete $self->{-childs}; + } + + # update parent and document reference + $oldChild->{-docref} = undef; + $oldChild->{-parent} = undef; + + # update ID and element list + if ( defined( $oldChild->{id} ) + && exists $self->{-docref}->{-idlist}->{ $oldChild->{id} } ) + { + delete $self->{-docref}->{-idlist}->{ $oldChild->{id} }; + } + if ( exists $self->{-docref}->{-elist}->{ $oldChild->{-name} } ) { + delete $self->{-docref}->{-elist}->{ $oldChild->{-name} }; + } + + return $oldChild; +} +*removeAtIndex = \&removeChildAtIndex; + +#------------------------------------------------------------------------------- + +=pod + +=head1 NAME + +SVG::DOM - A library of DOM (Document Object Model) methods for SVG objects. + +=head1 SUMMARY + +SVG::DOM provides a selection of methods for accessing and manipulating SVG +elements through DOM-like methods such as getElements, getChildren, getNextSibling +and so on. + +=head1 SYNOPSIS + + my $svg=new SVG(id=>"svg_dom_synopsis", width=>"100", height=>"100"); + my %attributes=$svg->getAttributes; + + my $group=$svg->group(id=>"group_1"); + my $name=$group->getElementName; + my $id=$group->getElementID; + + $group->circle(id=>"circle_1", cx=>20, cy=>20, r=>5, fill=>"red"); + my $rect=$group->rect(id=>"rect_1", x=>10, y=>10, width=>20, height=>30); + my $width=$rect->getAttribute("width"); + + my $has_children=$group->hasChildren(); + my @children=$group->getChildren(); + + my $kid=$group->getFirstChild(); + do { + print $kid->xmlify(); + } while ($kid=$kid->getNextSibling); + + my @ancestors=$rect->getParents(); + my $is_ancestor=$group->isAncestor($rect); + my $is_descendant=$rect->isDescendant($svg); + + my @rectangles=$svg->getElements("rect"); + my $allelements_arrayref=$svg->getElements(); + + $group->insertBefore($newChild,$rect); + $group->insertAfter($newChild,$rect); + $rect = $group->replaceChild($newChild,$rect); + $group->removeChild($newChild); + my $newRect = $rect->cloneNode($deep); + + ...and so on... + +=head1 METHODS + +=head2 @elements = $obj->getElements($element_name) + +Return a list of all elements with the specified name (i.e. type) in the document. If +no element name is provided, returns a list of all elements in the document. +In scalar context returns an array reference. + +=head2 @children = $obj->getChildren() + +Return a list of all children defined on the current node, or undef if there are no children. +In scalar context returns an array reference. + +Alias: getChildElements(), getChildNodes() + +=head2 @children = $obj->hasChildren() + +Return 1 if the current node has children, or 0 if there are no children. + +Alias: hasChildElements, hasChildNodes() + +=head2 $ref = $obj->getFirstChild() + +Return the first child element of the current node, or undef if there are no children. + +=head2 $ref = $obj->getLastChild() + +Return the last child element of the current node, or undef if there are no children. + +=head2 $ref = $obj->getSiblings() + +Return a list of all children defined on the parent node, containing the current node. + +=head2 $ref = $obj->getNextSibling() + +Return the next child element of the parent node, or undef if this is the last child. + +=head2 $ref = $obj->getPreviousSibling() + +Return the previous child element of the parent node, or undef if this is the first child. + +=head2 $index = $obj->getChildIndex() + +Return the place of this element in the parent node's list of children, starting from 0. + +=head2 $element = $obj->getChildAtIndex($index) + +Returns the child element at the specified index in the parent node's list of children. + +=head2 $ref = $obj->getParentElement() + +Return the parent of the current node. + +Alias: getParent() + +=head2 @refs = $obj->getParentElements() + +Return a list of the parents of the current node, starting from the immediate parent. The +last member of the list should be the document element. + +Alias: getParents() + +=head2 $name = $obj->getElementName() + +Return a string containing the name (i.e. the type, not the ID) of an element. + +Alias: getType(), getTagName(), getNodeName() + +=head2 $ref = $svg->getElementByID($id) + +Alias: getElementbyID() + +Return a reference to the element which has ID $id, or undef if no element with this ID exists. + +=head2 $id = $obj->getElementID() + +Return a string containing the ID of the current node, or undef if it has no ID. + +=head2 $ref = $obj->getAttributes() + +Return a hash reference of attribute names and values for the current node. + +=head2 $value = $obj->getAttribute($name); + +Return the string value attribute value for an attribute of name $name. + +=head2 $ref = $obj->setAttributes({name1=>$value1,name2=>undef,name3=>$value3}) + +Set a set of attributes. If $value is undef, deletes the attribute. + +=head2 $value = $obj->setAttribute($name,$value); + +Set attribute $name to $value. If $value is undef, deletes the attribute. + +=head2 $cdata = $obj->getCDATA() + +Return the canonical data (i.e. textual content) of the current node. + +Alias: getCdata(), getData() + +=head2 $boolean = $obj->isAncestor($element) + +Returns 1 if the current node is an ancestor of the specified element, otherwise 0. + +=head2 $boolean = $obj->isDescendant($element) + +Returns 1 if the current node is a descendant of the specified element, otherwise 0. + +=head2 $boolean = $obj->insertBefore( $element, $child ); + +Returns 1 if $element was successfully inserted before $child in $obj + +=head2 $boolean = $obj->insertAfter( $element, $child ); + +Returns 1 if $element was successfully inserted after $child in $obj + +=head2 $boolean = $obj->insertSiblingBefore( $element ); + +Returns 1 if $element was successfully inserted before $obj + +=head2 $boolean = $obj->insertSiblingAfter( $element ); + +Returns 1 if $element was successfully inserted after $obj + +=head2 $element = $obj->replaceChild( $element, $child ); + +Returns $child if $element successfully replaced $child in $obj + +=head2 $element = $obj->removeChild( $child ); + +Returns $child if it was removed successfully from $obj + +=head2 $element = $obj->cloneNode( $deep ); + +Returns a new $element clone of $obj, without parents or children. If deep is set to 1, all children are included recursively. + +=head1 AUTHOR + +Ronan Oger, ronan@roitsystems.com +Martin Owens, doctormo@postmaster.co.uk + +=head1 SEE ALSO + +perl(1), L, L, L, L + +L ROIT Systems: Commercial SVG perl solutions +L SVG at the W3C + +=cut + +1; diff --git a/bin/svg_kit/SVG/Element.pm b/bin/svg_kit/SVG/Element.pm new file mode 100644 index 0000000..0526c05 --- /dev/null +++ b/bin/svg_kit/SVG/Element.pm @@ -0,0 +1,723 @@ +package SVG::Element; + +use strict; +use warnings; + +our $VERSION = '2.78'; + +=pod + +=encoding UTF-8 + +=head1 NAME + +SVG::Element - Generate the element bits for SVG.pm + +=head1 AUTHOR + +Ronan Oger, cpan@roitsystems.com + +=head1 SEE ALSO + +For descreption of the methods see L + +L ROASP.com: Serverside SVG server +L ROIT Systems: Commercial SVG perl solutions +L SVG at the W3C + +=cut + +use SVG::XML; +use SVG::DOM; +use SVG::Extension; +use Scalar::Util qw/weaken/; + +our $AUTOLOAD; + +my @autosubs = qw( + animateMotion animateColor animateTransform circle ellipse rect polyline + path polygon line title desc defs + altGlyph altGlyphDef altGlyphItem clipPath color-profile + cursor definition-src font-face-format font-face-name + font-face-src font-face-url foreignObject glyph + glyphRef hkern marker mask metadata missing-glyph + mpath switch symbol textPath tref tspan view vkern marker textbox + flowText style script + image a g +); + +our %autosubs = map { $_ => 1 } @autosubs; + +#------------------------------------------------------------------------------- + +sub new { + my ( $proto, $name, %attrs ) = @_; + my $class = ref($proto) || $proto; + my $self = { -name => $name }; + foreach my $key ( keys %attrs ) { + + #handle escapes for special elements such as anchor + if ( $key =~ /^-/ ) { + if ( $key eq '-href' ) { + $self->{'xlink:href'} = $attrs{$key}; + $self->{'xlink:type'} = $attrs{-type} if $attrs{-type}; + $self->{'xlink:role'} = $attrs{-role} if $attrs{-role}; + $self->{'xlink:title'} = $attrs{-title} if $attrs{-title}; + $self->{'xlink:show'} = $attrs{-show} if $attrs{-show}; + $self->{'xlink:arcrole'} = $attrs{-arcrole} + if $attrs{-arcrole}; + $self->{'xlink:actuate'} = $attrs{-actuate} + if $attrs{-actuate}; + next; + } + } + $self->{$key} = $attrs{$key}; + } + + return bless( $self, $class ); +} + +#------------------------------------------------------------------------------- + +sub release { + my $self = shift; + + foreach my $key ( keys( %{$self} ) ) { + next if $key =~ /^-/; + if ( ref( $self->{$key} ) =~ /^SVG/ ) { + eval { $self->{$key}->release; }; + } + delete( $self->{$key} ); + } + + return $self; +} + +sub xmlify { + my $self = shift; + my $ns = $self->{-namespace} || $self->{-docref}->{-namespace} || undef; + my $xml = ''; + + #prep the attributes + my %attrs; + foreach my $k ( keys( %{$self} ) ) { + if ( $k =~ /^-/ ) { next; } + if ( ref( $self->{$k} ) eq 'ARRAY' ) { + $attrs{$k} = join( ', ', @{ $self->{$k} } ); + } + elsif ( ref( $self->{$k} ) eq 'HASH' ) { + $attrs{$k} = cssstyle( %{ $self->{$k} } ); + } + elsif ( ref( $self->{$k} ) eq '' ) { + $attrs{$k} = $self->{$k}; + } + } + + #prep the tag + if ( $self->{-comment} ) { + $xml .= $self->xmlcomment( $self->{-comment} ); + return $xml; + } + elsif ( $self->{-name} eq 'document' ) { + + #write the xml header + $xml .= $self->xmldecl unless $self->{-inline}; + + $xml .= $self->xmlpi( $self->{-document}->{-pi} ) + if $self->{-document}->{-pi}; + + #and write the dtd if this is inline + $xml .= $self->dtddecl unless $self->{-inline}; + + #rest of the xml + foreach my $k ( @{ $self->{-childs} } ) { + if ( ref($k) =~ /^SVG::Element/ ) { + $xml .= $k->xmlify($ns); + } + } + + return $xml; + } + my $is_cdataish + = defined $self->{-cdata} + || defined $self->{-CDATA} + || defined $self->{-cdata_noxmlesc}; + if ( defined $self->{-childs} || $is_cdataish ) { + $xml .= $self->{-docref}->{-elsep} + unless ( $self->{-inline} && $self->{-name} ); + $xml .= $self->{-docref}->{-indent} x $self->{-docref}->{-level}; + $xml .= xmltagopen_ln( $self->{-name}, $ns, %attrs ); + $self->{-docref}->{-level}++; + foreach my $k ( @{ $self->{-childs} } ) { + if ( ref($k) =~ /^SVG::Element/ ) { + $xml .= $k->xmlify($ns); + } + } + + if ( defined $self->{-cdata} ) { + $xml .= $self->xmlescp( $self->{-cdata} ); + } + if ( defined $self->{-CDATA} ) { + $xml .= '' . $self->{-CDATA} . ''; + } + if ( defined $self->{-cdata_noxmlesc} ) { + $xml .= $self->{-cdata_noxmlesc}; + } + + #return without writing the tag out if it the document tag + $self->{-docref}->{-level}--; + unless ($is_cdataish) { + $xml .= $self->{-docref}->{-elsep}; + $xml .= $self->{-docref}->{-indent} x $self->{-docref}->{-level}; + } + $xml .= xmltagclose_ln( $self->{-name}, $ns ); + } + else { + $xml .= $self->{-docref}->{-elsep}; + $xml .= $self->{-docref}->{-indent} x $self->{-docref}->{-level}; + $xml .= xmltag_ln( $self->{-name}, $ns, %attrs ); + } + + #return the finished tag + return $xml; +} + +sub perlify { + my $self = shift; + my $code = ''; + + #prep the attributes + my %attrs; + foreach my $k ( keys( %{$self} ) ) { + next if $k =~ /^-/; + if ( ref( $self->{$k} ) eq 'ARRAY' ) { + $attrs{$k} = join( ', ', @{ $self->{$k} } ); + } + elsif ( ref( $self->{$k} ) eq 'HASH' ) { + $attrs{$k} = cssstyle( %{ $self->{$k} } ); + } + elsif ( ref( $self->{$k} ) eq '' ) { + $attrs{$k} = $self->{$k}; + } + } + + if ( $self->{-comment} ) { + $code .= "->comment($self->{-comment})"; + return $code; + } + elsif ( $self->{-pi} ) { + $code .= "->pi($self->{-pi})"; + return $code; + } + elsif ( $self->{-name} eq 'document' ) { + + #write the xml header + #$xml .= $self->xmldecl; + #and write the dtd if this is inline + #$xml .= $self->dtddecl unless $self->{-inline}; + foreach my $k ( @{ $self->{-childs} } ) { + if ( ref($k) =~ /^SVG::Element/ ) { + $code .= $k->perlify(); + } + } + return $code; + } + + if ( defined $self->{-childs} ) { + $code .= $self->{-docref}->{-elsep}; + $code .= $self->{-docref}->{-indent} x $self->{-docref}->{-level}; + $code + .= $self->{-name} . '(' + . ( join ', ', ( map {"$_=>'$attrs{$_}'"} sort keys %attrs ) ) + . ')'; + if ( $self->{-cdata} ) { + $code .= "->cdata($self->{-cdata})"; + } + elsif ( $self->{-CDATA} ) { + $code .= "->CDATA($self->{-CDATA})"; + } + elsif ( $self->{-cdata_noxmlesc} ) { + $code .= "->cdata_noxmlesc($self->{-cdata_noxmlesc})"; + } + + $self->{-docref}->{-level}++; + foreach my $k ( @{ $self->{-childs} } ) { + if ( ref($k) =~ /^SVG::Element/ ) { + $code .= $k->perlify(); + } + } + $self->{-docref}->{-level}--; + } + else { + $code .= $self->{-docref}->{-elsep}; + $code .= $self->{-docref}->{-indent} x $self->{-docref}->{-level}; + $code + .= $self->{-name} . '(' + . ( join ', ', ( map {"$_=>'$attrs{$_}'"} sort keys %attrs ) ) + . ')'; + } + + return $code; +} +*toperl = \&perlify; + +sub addchilds { + my $self = shift; + push @{ $self->{-childs} }, @_; + return $self; +} + +sub tag { + my ( $self, $name, %attrs ) = @_; + + unless ( $self->{-parent} ) { + + #traverse down the tree until you find a non-document entry + while ( $self->{-document} ) { $self = $self->{-document} } + } + my $tag = new SVG::Element( $name, %attrs ); + + #define the element namespace + $tag->{-namespace} = $attrs{-namespace} if ( $attrs{-namespace} ); + + #add the tag to the document element + $tag->{-docref} = $self->{-docref}; + weaken( $tag->{-docref} ); + + #create the empty idlist hash ref unless it already exists + $tag->{-docref}->{-idlist} = {} + unless ( defined $tag->{-docref}->{-idlist} ); + + #verify that the current id is unique. compain on exception + #>>>TBD: add -strictids option to disable this check if desired + if ( $tag->{id} ) { + if ( $self->getElementByID( $tag->{id} ) ) { + $self->error( $tag->{id} => 'ID already exists in document' ); + return; + } + } + + #add the current id reference to the document id hash + if ( defined( $tag->{id} ) ) { + $tag->{-docref}->{-idlist}->{ $tag->{id} } = $tag; + } + + #create the empty idlist hash ref unless it already exists + $tag->{-docref}->{-elist} = {} + unless ( defined $tag->{-docref}->{-elist} ); + + #create the empty idlist hash ref unless it already exists + $tag->{-docref}->{-elist}->{ $tag->{-name} } = [] + unless ( defined $tag->{-docref}->{-elist}->{ $tag->{-name} } ); + +#add the current element ref to the corresponding element-hash array +# -elist is a hash of element names. key name is element, content is object ref. + + # add the reference to $tag to the array of refs that belong to the + # key $tag->{-name}. + unshift @{ $tag->{-docref}->{-elist}->{ $tag->{-name} } }, $tag; + + # attach element to the DOM of the document + $tag->{-parent} = $self; + weaken( $tag->{-parent} ); + $tag->{-parentname} = $self->{-name}; + $self->addchilds($tag); + + return ($tag); +} + +*element = \&tag; + +sub anchor { + my ( $self, %attrs ) = @_; + my $an = $self->tag( 'a', %attrs ); + + #$an->{'xlink:href'}=$attrs{-href} if(defined $attrs{-href}); + #$an->{'target'}=$attrs{-target} if(defined $attrs{-target}); + return ($an); +} + +sub svg { + my ( $self, %attrs ) = @_; + my $svg = $self->tag( 'svg', %attrs ); + $svg->{'height'} = '100%' unless ( $svg->{'height'} ); + $svg->{'width'} = '100%' unless ( $svg->{'width'} ); + return ($svg); +} + +sub rectangle { + my ( $self, %attrs ) = @_; + return $self->tag( 'rect', %attrs ); +} + +#sub image { +# my ($self,%attrs)=@_; +# my $im=$self->tag('image',%attrs); +# #$im->{'xlink:href'}=$attrs{-href} if(defined $attrs{-href}); +# return $im; +#} + +sub use { + my ( $self, %attrs ) = @_; + my $u = $self->tag( 'use', %attrs ); + $u->{'xlink:href'} = $attrs{-href} if ( defined $attrs{-href} ); + return $u; +} + +sub text { + my ( $self, %attrs ) = @_; + my $pre = ''; + $pre = $attrs{-type} || 'std'; + my %get_pre = ( + std => 'text', + path => 'textPath', + span => 'tspan', + ); + + $pre = $get_pre{ lc($pre) }; + my $text = $self->tag( $pre, %attrs ); + $text->{'xlink:href'} = $attrs{-href} if ( defined $attrs{-href} ); + $text->{'target'} = $attrs{-target} if ( defined $attrs{-target} ); + return ($text); +} + +sub comment { + my ( $self, @text ) = @_; + my $tag = $self->tag('comment'); + $tag->{-comment} = [@text]; + return $tag; +} + +sub pi { + my ( $self, @text ) = @_; + return $self->{-document}->{-pi} unless scalar @text; + my @pi; + @pi = @{ $self->{-document}->{-pi} } if $self->{-document}->{-pi}; + unshift( @text, @pi ) if @pi; + $self->{-document}->{-pi} = \@text; + my $tag = $self->tag('pi'); + return $tag; +} + +=pod + +=head2 get_path + +Documented as L. + +=cut + +sub get_path { + my ( $self, %attrs ) = @_; + + my $type = $attrs{-type} || 'path'; + my @x = @{ $attrs{x} }; + my @y = @{ $attrs{y} }; + my $points; + + # we need a path-like point string returned + if ( lc($type) eq 'path' ) { + my $char = 'M'; + $char = ' m ' + if ( defined $attrs{-relative} && lc( $attrs{-relative} ) ); + while (@x) { + + #scale each value + my $x = shift @x; + my $y = shift @y; + + #append the scaled value to the graph + $points .= "$char $x $y "; + $char = ' L '; + $char = ' l ' + if ( defined $attrs{-relative} + && lc( $attrs{-relative} ) ); + } + $points .= ' z ' + if ( defined $attrs{-closed} && lc( $attrs{-closed} ) ); + my %out = ( d => $points ); + return \%out; + } + elsif ( lc($type) =~ /^poly/ ) { + while (@x) { + + #scale each value + my $x = shift @x; + my $y = shift @y; + + #append the scaled value to the graph + $points .= "$x,$y "; + } + } + my %out = ( points => $points ); + return \%out; +} + +sub make_path { + my ( $self, %attrs ) = @_; + return get_path(%attrs); +} + +sub set_path { + my ( $self, %attrs ) = @_; + return get_path(%attrs); +} + +sub animate { + my ( $self, %attrs ) = @_; + my %rtr = %attrs; + my $method = $rtr{'-method'}; # Set | Transform | Motion | Color + + $method = lc($method); + + # we do not want this to pollute the generation of the tag + delete $rtr{-method}; #bug report from briac. + + my %animation_method = ( + transform => 'animateTransform', + motion => 'animateMotion', + color => 'animateColor', + set => 'set', + attribute => 'animate', + ); + + my $name = $animation_method{$method} || 'animate'; + + #list of legal entities for each of the 5 methods of animations + my %legal = ( + animate => q{ begin dur end min max restart repeatCount + repeatDur fill attributeType attributeName additive + accumulate calcMode values keyTimes keySplines + from to by }, + animateTransform => q{ begin dur end min max restart repeatCount + repeatDur fill additive accumulate calcMode values + keyTimes keySplines from to by calcMode path keyPoints + rotate origin type attributeName attributeType }, + animateMotion => q{ begin dur end min max restart repeatCount + repeatDur fill additive accumulate calcMode values + to by keyTimes keySplines from path keyPoints + rotate origin }, + animateColor => q{ begin dur end min max restart repeatCount + repeatDur fill additive accumulate calcMode values + keyTimes keySplines from to by }, + set => q{ begin dur end min max restart repeatCount repeatDur + fill to }, + ); + + foreach my $k ( keys %rtr ) { + next if ( $k =~ /\-/ ); + + if ( $legal{$name} !~ /\b$k\b/ ) { + $self->error( "$name.$k" => 'Illegal animation command' ); + } + } + + return $self->tag( $name, %rtr ); +} + +sub group { + my ( $self, %attrs ) = @_; + return $self->tag( 'g', %attrs ); +} + +sub STYLE { + my ( $self, %attrs ) = @_; + + $self->{style} = $self->{style} || {}; + foreach my $k ( keys %attrs ) { + $self->{style}->{$k} = $attrs{$k}; + } + + return $self; +} + +sub mouseaction { + my ( $self, %attrs ) = @_; + + $self->{mouseaction} = $self->{mouseaction} || {}; + foreach my $k ( keys %attrs ) { + $self->{mouseaction}->{$k} = $attrs{$k}; + } + + return $self; +} + +sub attrib { + my ( $self, $name, $val ) = @_; + + #verify that the current id is unique. compain on exception + if ( $name eq 'id' ) { + if ( $self->getElementByID($val) ) { + $self->error( $val => 'ID already exists in document' ); + return; + } + } + + if ( not defined $val ) { + if ( scalar(@_) == 2 ) { + + # two arguments only - retrieve + return $self->{$name}; + } + else { + + # 3rd argument is undef - delete + delete $self->{$name}; + } + } + else { + + # 3 defined arguments - set + $self->{$name} = $val; + } + + return $self; +} +*attr = \&attrib; +*attribute = \&attrib; + +sub cdata { + my ( $self, @txt ) = @_; + $self->{-cdata} = join( ' ', @txt ); + return ($self); +} + +sub CDATA { + my ( $self, @txt ) = @_; + $self->{-CDATA} = join( '\n', @txt ); + return ($self); +} + +sub cdata_noxmlesc { + my ( $self, @txt ) = @_; + $self->{-cdata_noxmlesc} = join( '\n', @txt ); + return ($self); +} + +sub filter { + my ( $self, %attrs ) = @_; + return $self->tag( 'filter', %attrs ); +} + +sub fe { + my ( $self, %attrs ) = @_; + + return 0 unless ( $attrs{'-type'} ); + my %allowed = ( + blend => 'feBlend', + colormatrix => 'feColorMatrix', + componenttrans => 'feComponentTrans', + Componenttrans => 'feComponentTrans', + composite => 'feComposite', + convolvematrix => 'feConvolveMatrix', + diffuselighting => 'feDiffuseLighting', + displacementmap => 'feDisplacementMap', + distantlight => 'feDistantLight', + flood => 'feFlood', + funca => 'feFuncA', + funcb => 'feFuncB', + funcg => 'feFuncG', + funcr => 'feFuncR', + gaussianblur => 'feGaussianBlur', + image => 'feImage', + merge => 'feMerge', + mergenode => 'feMergeNode', + morphology => 'feMorphology', + offset => 'feOffset', + pointlight => 'fePointLight', + specularlighting => 'feSpecularLighting', + spotlight => 'feSpotLight', + tile => 'feTile', + turbulence => 'feTurbulence', + ); + + my $key = lc( $attrs{'-type'} ); + my $fe_name = $allowed{ lc($key) } || 'error:illegal_filter_element'; + delete $attrs{'-type'}; + + return $self->tag( $fe_name, %attrs ); +} + +sub pattern { + my ( $self, %attrs ) = @_; + return $self->tag( 'pattern', %attrs ); +} + +sub set { + my ( $self, %attrs ) = @_; + return $self->tag( 'set', %attrs ); +} + +sub stop { + my ( $self, %attrs ) = @_; + return $self->tag( 'stop', %attrs ); +} + +sub gradient { + my ( $self, %attrs ) = @_; + + my $type = $attrs{'-type'} || 'linear'; + unless ( $type =~ /^(linear|radial)$/ ) { + $type = 'linear'; + } + delete $attrs{'-type'}; + + return $self->tag( $type . 'Gradient', %attrs ); +} + +#------------------------------------------------------------------------------- +# Internal methods + +sub error { + my ( $self, $command, $error ) = @_; + + if ( $self->{-docref}->{-raiseerror} ) { + die "$command: $error\n"; + } + elsif ( $self->{-docref}->{-printerror} ) { + print STDERR "$command: $error\n"; + } + + $self->{errors}{$command} = $error; +} + +# This AUTOLOAD method is activated when '-auto' is passed to SVG.pm +sub autoload { + my $self = shift; + my ( $package, $sub ) = ( $AUTOLOAD =~ /(.*)::([^:]+)$/ ); + + if ( $sub eq 'DESTROY' ) { + return $self->release(); + } + else { + + # the import routine may call us with a tag name involving '-'s + my $tag = $sub; + $sub =~ tr/-/_/; + + # N.B.: The \ on \@_ makes sure that the incoming arguments are + # used and not the ones passed when the subroutine was created. + # eval "sub $package\:\:$sub (\$;\@) { return shift->tag('$tag',\@_) }"; + #per rt.perl.org comment by slaven. + + if ( !$package->can($sub) ) { + ## no critic (TestingAndDebugging::ProhibitNoStrict) + no strict 'refs'; + *{ $package . '::' . $sub } + = sub { return shift->tag( $tag, @_ ) }; + } + return $self->$sub(@_) if $self; + } +} + +#------------------------------------------------------------------------------- +# GD Routines + +sub colorAllocate { + my ( $self, $red, $green, $blue ) = @_; + return 'rgb(' . int($red) . ',' . int($green) . ',' . int($blue) . ')'; +} + +#------------------------------------------------------------------------------- + +1; diff --git a/bin/svg_kit/SVG/Extension.pm b/bin/svg_kit/SVG/Extension.pm new file mode 100644 index 0000000..3a77ed6 --- /dev/null +++ b/bin/svg_kit/SVG/Extension.pm @@ -0,0 +1,477 @@ +package SVG::Extension; +use strict; +use warnings; + +our $VERSION = '2.78'; + +=head1 NAME + +SVG::Extension - additional methods + +=cut + +# although DTD declarations are not elements, we use the same API so we can +# manipulate the internal DTD subset using the same methods available for +# elements. At this state, all extensions are the same object class, but +# may be subclassed in the future to e.g. SVG::Extension::ELEMENT. Use +# e.g. isElementDecl() to determine types; this API will be retained +# irrespective. + +use parent qw/SVG::Element/; + +# DTD declarations handled in this module +use constant ELEMENT => 'ELEMENT'; +use constant ATTLIST => 'ATTLIST'; +use constant NOTATION => 'NOTATION'; +use constant ENTITY => 'ENTITY'; + +our @TYPES = ( ELEMENT, ATTLIST, NOTATION, ENTITY ); +our %TYPES = map { $_ => 1 } @TYPES; + +#----------------- + +sub new { + return shift->SUPER::new(@_); +} + +sub internal_subset { + my $self = shift; + + my $document = $self->{-docref}; + unless ( exists $document->{-internal} ) { + $document->{-internal} = new SVG::Extension('internal'); + $document->{-internal}{-docref} = $document; + } + + return $document->{-internal}; +} + +=head2 extension + +return the element object + +=cut + +sub extension { + my $self = shift; + my $class = ref($self) || $self; + + return bless $self->SUPER::element(@_), $class; +} + +#----------------- + +=head2 element_decl + +generate an element declaration in the DTD + +=cut + +sub element_decl { + my ( $self, %attrs ) = @_; + my $subset = $self->internal_subset(); + + return $subset->extension( 'ELEMENT', %attrs ); +} + +=head2 attribute_decl + +return generate an attribute list for an element + +=cut + +sub attribute_decl { + my ( $element_decl, %attrs ) = @_; + + unless ( $element_decl->getElementType eq 'ELEMENT' ) { + $element_decl->error( + $element_decl => 'is not an ELEMENT declaration' ); + return; + } + + return $element_decl->extension( 'ATTLIST', %attrs ); +} + +=head2 attlist_decl + +=cut + +sub attlist_decl { + my ( $self, %attrs ) = @_; + my $subset = $self->internal_subset(); + + my $element_decl = $subset->getElementDeclByName( $attrs{name} ); + unless ($element_decl) { + $subset->error( "ATTLIST declaration '$attrs{attr}'" => + "ELEMENT declaration '$attrs{name}' does not exist" ); + return; + } + + return $element_decl->attribute_decl(%attrs); +} + +=head2 notation_decl(%attrs) + +return an extension object of type NOTATION + +=cut + +sub notation_decl { + my ( $self, %attrs ) = @_; + my $subset = $self->internal_subset(); + + return $subset->extension( 'NOTATION', %attrs ); +} + +=head2 entity_decl(%attrs) + +return an extension object of type 'ENTITY' + +=cut + +sub entity_decl { + my ( $self, %attrs ) = @_; + my $subset = $self->internal_subset(); + + return $subset->extension( 'ENTITY', %attrs ); +} + +#----------------- + +# this interim version of xmlify handles the vanilla extension +# format of one parent 'internal' element containing a list of +# extension elements. A hierarchical model will follow in time +# with the same render API. + +=head2 xmilfy + +=cut + +sub xmlify { + my $self = shift; + my $decl = q{}; + + if ( $self->{-name} ne 'internal' ) { + $decl = '{-name} ) { + /^ELEMENT$/ and do { + $decl .= "ELEMENT $self->{name}"; + + $decl .= q{ } . $self->{model} if exists $self->{model}; + + last SWITCH; + }; + /^ATTLIST$/ and do { + $decl .= "ATTLIST $self->{name} $self->{attr}"; + + $decl + .= " $self->{type} " + . ( $self->{fixed} ? '#FIXED ' : q{} ) + . $self->{default}; + + last SWITCH; + }; + /^NOTATION$/ and do { + $decl .= "NOTATION $self->{name}"; + + $decl .= q{ } . $self->{base} if exists $self->{base}; + if ( exists $self->{pubid} ) { + $decl .= "PUBLIC $self->{pubid} "; + $decl .= q{ } . $self->{sysid} if exists $self->{sysid}; + } + elsif ( exists $self->{sysid} ) { + $decl .= ' SYSTEM ' . $self->{sysid} + if exists $self->{sysid}; + } + + last SWITCH; + }; + /^ENTITY$/ and do { + $decl + .= 'ENTITY ' + . ( $self->{isp} ? '% ' : q{} ) + . $self->{name}; + + if ( exists $self->{value} ) { + $decl .= ' "' . $self->{value} . '"'; + } + elsif ( exists $self->{pubid} ) { + $decl .= "PUBLIC $self->{pubid} "; + $decl .= q{ } . $self->{sysid} if exists $self->{sysid}; + $decl .= q{ } . $self->{ndata} if $self->{ndata}; + } + else { + $decl .= ' SYSTEM ' . $self->{sysid} + if exists $self->{sysid}; + $decl .= q{ } . $self->{ndata} if $self->{ndata}; + } + + last SWITCH; + DEFAULT: + + # we don't know what this is, but the underlying parser allowed it + $decl .= "$self->{-name} $self->{name}"; + }; + } + $decl .= '>' . $self->{-docref}{-elsep}; + } + + my $result = q{}; + if ( $self->hasChildren ) { + $self->{-docref}->{-level}++; + foreach my $child ( $self->getChildren ) { + $result + .= ( $self->{-docref}{-indent} x $self->{-docref}->{-level} ) + . $child->render(); + } + $self->{-docref}->{-level}--; + } + + return $decl . $result; +} + +#some aliases for xmilfy + +=head2 render + +alias for xmlify + +=head2 to_xml + +alias for xmlify + +=head2 serialise + +alias for xmlify + +=head2 serialise + +alias for xmlify + +=cut + +*render = \&xmlify; +*to_xml = \&xmlify; +*serialise = \&xmlify; +*serialize = \&xmlify; + +#----------------- + +=head2 getDeclName + +Simply an alias for the general method for SVG::Extension objects + +=head2 getExtensionName + +alias to getDeclName + +=cut + +# simply an alias for the general method for SVG::Extension objects +sub getDeclName { + return shift->SUPER::getElementName(); +} +*getExtensionName = \&getDeclName; + +=head2 getDeclNames + +return list of existing decl types by extracting it from the overall list +of existing element types + +sub getDeclNames { + +=head2 getExtensionNames + +alias to getDeclNames + +=cut + +# return list of existing decl types by extracting it from the overall list +# of existing element types +sub getDeclNames { + my $self = shift; + + return grep { exists $TYPES{$_} } $self->SUPER::getElementNames(); +} +*getExtensionNames = \&getDeclNames; + +#----------------- + +# we can have only one element decl of a given name... +sub getElementDeclByName { + my ( $self, $name ) = @_; + my $subset = $self->internal_subset(); + + my @element_decls = $subset->getElementsByName('ELEMENT'); + foreach my $element_decl (@element_decls) { + return $element_decl if $element_decl->{name} eq $name; + } + + return; +} + +# ...but we can have multiple attributes. Note that this searches the master list +# which is not what you are likely to want in most cases. See getAttributeDeclByName +# (no 's') below, to search for an attribute decl on a particular element decl. +# You can use the result of this method along with getParent to find the list of +# all element decls that define a given attribute. +sub getAttributeDeclsByName { + my ( $self, $name ) = @_; + my $subset = $self->internal_subset(); + + my @element_decls = $subset->getElementsByName('ELEMENT'); + foreach my $element_decl (@element_decls) { + return $element_decl if $element_decl->{name} eq $name; + } + + return; +} + +#----------------- + +sub getElementDecls { + return shift->SUPER::getElements('ELEMENT'); +} + +sub getNotations { + return shift->SUPER::getElements('NOTATION'); +} +*getNotationDecls = \&getNotations; + +sub getEntities { + return shift->SUPER::getElements('ENTITY'); +} +*getEntityDecls = \&getEntities; + +sub getAttributeDecls { + return shift->SUPER::getElements('ATTLIST'); +} + +#----------------- +# until/unless we subclass these, use the name. After (if) we +# subclass, will use the object class. + +sub isElementDecl { + return ( shift->getElementName eq ELEMENT ) ? 1 : 0; +} + +sub isNotation { + return ( shift->getElementName eq NOTATION ) ? 1 : 0; +} + +sub isEntity { + return ( shift->getElementName eq ENTITY ) ? 1 : 0; +} + +sub isAttributeDecl { + return ( shift->getElementName eq ATTLIST ) ? 1 : 0; +} + +#----------------- + +# the Decl 'name' is an attribute, the name is e.g. 'ELEMENT' +# use getElementName if you want the actual decl type +sub getElementDeclName { + my $self = shift; + + if ( exists $self->{name} ) { + return $self->{name}; + } + + return; +} + +# identical to the above; will be smarter as and when we subclass +# as above, the name is ATTLIST, the 'name' is a property of the decl +sub getAttributeDeclName { + my $self = shift; + + if ( exists $self->{name} ) { + return $self->{name}; + } + + return; +} + +# unlike other 'By' methods, attribute searches work from their parent element +# del only. Multiple element decls with the same attribute name is more than +# likely, so searching the master ATTLIST is not very useful. If you really want +# to do that, use getAttributeDeclsByName (with an 's') above. +sub getAttributeDeclByName { + my ( $self, $name ) = @_; + + my @attribute_decls = $self->getElementAttributeDecls(); + foreach my $attribute_decl (@attribute_decls) { + return $attribute_decl if $attribute_decl->{name} eq $name; + } + + return; +} + +# as this is element specific, we allow a 'ElementAttribute' name too, +# for those that like consistency at the price of brevity. Not that +# the shorter name is all that brief to start with... +*getElementAttributeDeclByName = \&getAttributeDeclByName; + +# ...and for those who live their brevity: +*getAttributeDecl = \&getAttributeDeclByName; + +sub hasAttributeDecl { + return ( shift->getElementDeclByName(shift) ) ? 1 : 0; +} + +#----------------- +# directly map to Child/Siblings: we presume this is being called from an +# element decl. You can use 'getChildIndex', 'getChildAtIndex' etc. as well + +sub getElementAttributeAtIndex { + my ( $self, $index, @children ) = @_; + + return $self->SUPER::getChildAtIndex( $index, @children ); +} + +sub getElementAttributeIndex { + return shift->SUPER::getChildIndex(@_); +} + +sub getFirstAttributeDecl { + return shift->SUPER::getFirstChild(); +} + +sub getNextAttributeDecl { + return shift->SUPER::getNextSibling(); +} + +sub getLastAttributeDecl { + return shift->SUPER::getLastChild(); +} + +sub getPreviousAttributeDecl { + return shift->SUPER::getPreviousSibling(); +} + +sub getElementAttributeDecls { + return shift->SUPER::getChildren(); +} + +#------------------------------------------------------------------------------- + +# These methods are slated for inclusion in a future release of SVG.pm. They +# will allow programmatic advance determination of the validity of various DOM +# manipulations. If you are in a hurry for this feature, get in touch! +# +# example: +# if ($svg_object->allowsElement("symbol")) { ... } +# +#package SVG::Element; +# +#sub allowedElements {} +#sub allowedAttributes {} +# +#sub allowsElement {} +#sub allowsAttribute {} +# + +#------------------------------------------------------------------------------- + +1; diff --git a/bin/svg_kit/SVG/XML.pm b/bin/svg_kit/SVG/XML.pm new file mode 100644 index 0000000..47e0ece --- /dev/null +++ b/bin/svg_kit/SVG/XML.pm @@ -0,0 +1,206 @@ +package SVG::XML; +use strict; +use warnings; + +our $VERSION = '2.78'; + +=pod + +=head1 NAME + +SVG::XML - Handle the XML generation bits for SVG.pm + +=head1 AUTHOR + +Ronan Oger, cpan@roitsystems.com + +=head1 SEE ALSO + +L, +L, +L, +L, +L + +For Commercial Perl/SVG development, refer to the following sites: +L, +L, +L + +=cut + +use Exporter; +use vars qw(@ISA @EXPORT); +@ISA = ('Exporter'); + +@EXPORT = qw( + xmlesc + xmlescape + xmlescp + cssstyle + xmlattrib + xmlcomment + xmlpi + xmltag + xmltagopen + xmltagclose + xmltag_ln + xmltagopen_ln + xmltagclose_ln + processtag + xmldecl + dtddecl +); + +sub xmlescp { + my ( $self, $s ) = @_; + + $s = '0' unless defined $s; + $s = join( ', ', @{$s} ) if ( ref($s) eq 'ARRAY' ); + + # Special XML entities are escaped + $s =~ s/&(?!#(x\w\w|\d+?);)/&/g; + $s =~ s/>/>/g; + $s =~ s/error( $char => 'This forbidden XML character was removed' ); + } + + # Per suggestion from Adam Schneider + $s =~ s/([\200-\377])/'&#'.ord($1).';'/ge; + + return $s; +} + +*xmlesc = \&xmlescp; + +*xmlescape = \&xmlescp; + +sub cssstyle { + my %attrs = @_; + return ( join( '; ', map { qq($_: ) . $attrs{$_} } sort keys(%attrs) ) ); +} + +# Per suggestion from Adam Schneider +sub xmlattrib { + my %attrs = @_; + return '' unless ( scalar( keys %attrs ) ); + return ( + ' ' + . join( ' ', + map { qq($_=") . $attrs{$_} . q(") } sort keys(%attrs) ) + ); +} + +sub xmltag { + my ( $name, $ns, %attrs ) = @_; + $ns = $ns ? "$ns:" : ''; + my $at = xmlattrib(%attrs) || ''; + return qq(<$ns$name$at />); +} + +sub xmltag_ln { + my ( $name, $ns, %attrs ) = @_; + return xmltag( $name, $ns, %attrs ); +} + +sub xmltagopen { + my ( $name, $ns, %attrs ) = @_; + $ns = $ns ? "$ns:" : ''; + my $at = xmlattrib(%attrs) || ''; + return qq(<$ns$name$at>); +} + +sub xmltagopen_ln { + my ( $name, $ns, %attrs ) = @_; + return xmltagopen( $name, $ns, %attrs ); +} + +sub xmlcomment { + my ( $self, $r_comment ) = @_; + my $ind = $self->{-docref}->{-elsep} + . $self->{-docref}->{-indent} x $self->{-docref}->{-level}; + return ( $ind . join( $ind, map {qq()} @$r_comment ) ); +} + +sub xmlpi { + my ( $self, $r_pi ) = @_; + my $ind = $self->{-docref}->{-elsep} + . $self->{-docref}->{-indent} x $self->{-docref}->{-level}; + return ( join( $ind, map {qq()} @$r_pi ) ); +} + +*processinginstruction = \&xmlpi; + +sub xmltagclose { + my ( $name, $ns ) = @_; + $ns = $ns ? "$ns:" : ''; + return qq(); +} + +sub xmltagclose_ln { + my ( $name, $ns ) = @_; + return xmltagclose( $name, $ns ); +} + +sub dtddecl { + my $self = shift; + my $docroot = $self->{-docroot} || 'svg'; + my $id; + + if ( $self->{-pubid} ) { + $id = 'PUBLIC "' . $self->{-pubid} . '"'; + $id .= ' "' . $self->{-sysid} . '"' if ( $self->{-sysid} ); + } + elsif ( $self->{-sysid} ) { + $id = 'SYSTEM "' . $self->{-sysid} . '"'; + } + else { + $id + = 'PUBLIC "-//W3C//DTD SVG 1.0//EN"' + . $self->{-docref}->{-elsep} + . "\"$self->{-docref}->{-dtd}\""; + } + + my $at = join( ' ', ( $docroot, $id ) ); + + #>>>TBD: add internal() method to return this + my $extension + = ( exists $self->{-internal} ) + ? $self->{-internal}->render() + : q{}; + if ( exists $self->{-extension} and $self->{-extension} ) { + $extension + .= $self->{-docref}{-elsep} + . $self->{-extension} + . $self->{-docref}{-elsep}; + } + $extension = ' [' . $self->{-docref}{-elsep} . $extension . ']' + if $extension; + + return qq[$self->{-docref}{-elsep}]; +} + +sub xmldecl { + my $self = shift; + + my $version = $self->{-version} || '1.0'; + my $encoding = $self->{-encoding} || 'UTF-8'; + my $standalone = $self->{-standalone} || 'yes'; + + return + qq{}; +} + +#------------------------------------------------------------------------------- + +1; diff --git a/bin/svg_kit/batik-1.7/LICENSE b/bin/svg_kit/batik-1.7/LICENSE new file mode 100644 index 0000000..3e4e3d0 --- /dev/null +++ b/bin/svg_kit/batik-1.7/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/bin/svg_kit/batik-1.7/NOTICE b/bin/svg_kit/batik-1.7/NOTICE new file mode 100644 index 0000000..662188f --- /dev/null +++ b/bin/svg_kit/batik-1.7/NOTICE @@ -0,0 +1,18 @@ +Apache Batik +Copyright 1999-2007 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + +This software contains code from the World Wide Web Consortium (W3C) for the +Document Object Model API (DOM API) and SVG Document Type Definition (DTD). + +This software contains code from the International Organisation for +Standardization for the definition of character entities used in the software's +documentation. + +This product includes images from the Tango Desktop Project +(http://tango.freedesktop.org/). + +This product includes images from the Pasodoble Icon Theme +(http://www.jesusda.com/projects/pasodoble). diff --git a/bin/svg_kit/batik-1.7/README b/bin/svg_kit/batik-1.7/README new file mode 100644 index 0000000..f855cb6 --- /dev/null +++ b/bin/svg_kit/batik-1.7/README @@ -0,0 +1,77 @@ + + A P A C H E B A T I K + + What is it? + ----------- + + Batik is a Java based toolkit for applications which handle + images in the Scalable Vector Graphics (SVG) format for + various purposes, such as viewing, generation or + manipulation. + + The project's ambition is to give developers a set of core + modules which can be used together or individually to + support specific SVG solutions. Examples of modules are + an SVG parser, an SVG generator and an SVG DOM + implementation. Another ambition of the Batik project is to + make it highly extensible (for example, Batik allows the + developer to handle custom SVG tags). Even though the + goal of the project is to provide a set of core modules, one + of the deliveries is a full fledged SVG Viewer + implementation which validates the various modules and + their inter-operability. + + In a nutshell, Batik provides building blocks that developers + can assemble in various ways in their Java technology + applications to generate, parse, view or convert SVG + contents. For example, Batik contains a Swing component + that can add SVG viewing capability to all Java technology + applications. Batik can also be used to generate SVG on a + client or on a server, and Batik can convert SVG content + into other formats such as JPEG or PNG. Batik's goal is to + make it easy for application developers to handle SVG + content for various purposes, client-side or server-side. + + + Where is it? + ------------ + + The home page for the Apache Batik project can be found in the Apache XML + Project web site (http://xmlgraphics.apache.org/batik/). There you also find + information on how to download the latest release as well as all the other + information you might need regarding this project. + + + Requirements + ------------ + + o A Java 1.3 or later compatible virtual machine for your operating system. + + Optional Libraries + ------------------ + + By default, Batik includes a scripting engine for ECMAScript. It is possible + to add support for additional scripting languages (Python and TCL). + + See http://xmlgraphics.apache.org/batik/install.html#optionalComponents for + details. + + Installation Instructions and Documentation + ------------------------------------------- + + Read the Install page at http://xmlgraphics.apache.org/batik/install.html + for the installation instructions. + + Look for the most updated documentation on the Apache Batik web site under + the Apache XML Graphics Project (http://xmlgraphics.apache.org/batik/). + + + Licensing and legal issues + -------------------------- + + For legal and licensing issues, please read the LICENSE and NOTICE files. + + Thanks for using Apache Batik. + + The Apache XML Graphics Project + http://xmlgraphics.apache.org/ diff --git a/bin/svg_kit/batik-1.7/batik-rasterizer.jar b/bin/svg_kit/batik-1.7/batik-rasterizer.jar new file mode 100644 index 0000000..64f8fa3 Binary files /dev/null and b/bin/svg_kit/batik-1.7/batik-rasterizer.jar differ diff --git a/bin/svg_kit/batik-1.7/batik-slideshow.jar b/bin/svg_kit/batik-1.7/batik-slideshow.jar new file mode 100644 index 0000000..b4aa614 Binary files /dev/null and b/bin/svg_kit/batik-1.7/batik-slideshow.jar differ diff --git a/bin/svg_kit/batik-1.7/batik-squiggle.jar b/bin/svg_kit/batik-1.7/batik-squiggle.jar new file mode 100644 index 0000000..5b19e6d Binary files /dev/null and b/bin/svg_kit/batik-1.7/batik-squiggle.jar differ diff --git a/bin/svg_kit/batik-1.7/batik-svgpp.jar b/bin/svg_kit/batik-1.7/batik-svgpp.jar new file mode 100644 index 0000000..f44de04 Binary files /dev/null and b/bin/svg_kit/batik-1.7/batik-svgpp.jar differ diff --git a/bin/svg_kit/batik-1.7/batik-ttf2svg.jar b/bin/svg_kit/batik-1.7/batik-ttf2svg.jar new file mode 100644 index 0000000..bc35198 Binary files /dev/null and b/bin/svg_kit/batik-1.7/batik-ttf2svg.jar differ diff --git a/bin/svg_kit/batik-1.7/batik.jar b/bin/svg_kit/batik-1.7/batik.jar new file mode 100644 index 0000000..a031acc Binary files /dev/null and b/bin/svg_kit/batik-1.7/batik.jar differ diff --git a/bin/svg_kit/batik-1.7/buildInFont b/bin/svg_kit/batik-1.7/buildInFont new file mode 100644 index 0000000..cdc73f4 --- /dev/null +++ b/bin/svg_kit/batik-1.7/buildInFont @@ -0,0 +1,1471 @@ +#!/usr/bin/perl -w +#Author:Li Shengting +#E-mail:lishengting@genomics.org.cn +#Program Date:2002-12-2015:53 +#Last Update:2006-11-14 0:19 +#Describe:add fonts defs to svg for batik +my $ver=1.00; # +use strict; +#use diagnostics; +#use Getopt::Long; + +###################################################################################################################### +# Usage +###################################################################################################################### +my $usage=<<"USAGE"; +#$ver Usage: buildInFont [font-name] +USAGE +my $argvNumber=3; +die $usage if (@ARGV<$argvNumber); +undef($usage); +undef($argvNumber); +###################################################################################################################### +#my %opts; +#GetOptions(\%opts,"a!","b:s"); +###################################################################################################################### +# Constant +###################################################################################################################### +#use constant PI => 3.1415926535897932384626433832795; +###################################################################################################################### +# Variable +###################################################################################################################### +my ($svgF,$fontF,$outSvg)=@ARGV; +my ($font,$defs); +#///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +# Begin +#///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +open(F,"$svgF") || die "Can't open $svgF!\n"; +open(O,">$outSvg") || die "Can't write $outSvg!\n"; +if ($fontF eq "x") { + $fontF=$0; +} +$defs=0; +while () { + next if (//); + next if (//); + next if (//); + next if (//); + next if (//); + print O; + if (/) { + if ($font=~//) { + $defs=1; + } + if ($defs) { + print O $font; + } + if ($font=~/<\/defs>/) { + $defs=0; + } + } + } +} +close(F); +#///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +# Subprogram +#///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +# End +#///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +=pod + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +=cut diff --git a/bin/svg_kit/batik-1.7/docs/.htaccess b/bin/svg_kit/batik-1.7/docs/.htaccess new file mode 100644 index 0000000..1054b82 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/.htaccess @@ -0,0 +1,23 @@ +# redirections from the old site +Redirect /batik/faqs.html http://xmlgraphics.apache.org/batik/faq.html +Redirect /batik/batikDemo.html http://xmlgraphics.apache.org/batik/demo.html +Redirect /batik/toolsAndApps.html http://xmlgraphics.apache.org/batik/tools/ +Redirect /batik/svgviewer.html http://xmlgraphics.apache.org/batik/tools/browser.html +Redirect /batik/svgrasterizer.html http://xmlgraphics.apache.org/batik/tools/rasterizer.html +Redirect /batik/ttf2svg.html http://xmlgraphics.apache.org/batik/tools/font-converter.html +Redirect /batik/svgpp.html http://xmlgraphics.apache.org/batik/tools/pretty-printer.html +Redirect /batik/architecture.html http://xmlgraphics.apache.org/batik/using/architecture.html +Redirect /batik/svggen.html http://xmlgraphics.apache.org/batik/using/svg-generator.html +Redirect /batik/domapi.html http://xmlgraphics.apache.org/batik/using/dom-api.html +Redirect /batik/svgcanvas.html http://xmlgraphics.apache.org/batik/using/swing.html +Redirect /batik/rasterizerTutorial.html http://xmlgraphics.apache.org/batik/using/transcoder.html +Redirect /batik/scripting.html http://xmlgraphics.apache.org/batik/using/scripting/ecmascript.html +Redirect /batik/scriptingFeatures.html http://xmlgraphics.apache.org/batik/status.html +Redirect /batik/javaScripting.html http://xmlgraphics.apache.org/batik/using/scripting/java.html +Redirect /batik/security.html http://xmlgraphics.apache.org/batik/using/scripting/security.html +Redirect /batik/extendingBatik.html http://xmlgraphics.apache.org/batik/using/extending.html +Redirect /batik/test.html http://xmlgraphics.apache.org/batik/dev/test.html +Redirect /batik/whoAreWe.html http://xmlgraphics.apache.org/batik/contributors.html +Redirect /batik/mailList.html http://xmlgraphics.apache.org/batik/mailing-lists.html +Redirect /batik/svn.html http://xmlgraphics.apache.org/batik/download.cgi + diff --git a/bin/svg_kit/batik-1.7/docs/broken-links.xml b/bin/svg_kit/batik-1.7/docs/broken-links.xml new file mode 100644 index 0000000..f95aa9b --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/broken-links.xml @@ -0,0 +1,2 @@ + + diff --git a/bin/svg_kit/batik-1.7/docs/contributors.html b/bin/svg_kit/batik-1.7/docs/contributors.html new file mode 100644 index 0000000..e33ee63 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/contributors.html @@ -0,0 +1,809 @@ + + + + + + + +Batik contributors + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Batik contributors

+ + +

+ This page contains information about the current Batik developers and + the features they are working on at the moment. +

+ + + +

Committers

+
+

+ This section lists all developers with commit access to the Batik + subversion repository. +

+

+ The following people are active Batik developers: +

+
+ +
Thomas DeWeese (TD)
+ +
+ +

+Thomas.DeWeese@Kodak.com +

+ +

+ Thomas DeWeese is a Senior Software Engineer at Eastman Kodak Company, + in Rochester New York where he has worked for the Image Science + Division’s image application development group since 1994. Thomas + has made contributions to the imaging portions of the Java2D API, + and was a major contributor to the Java Advanced Image API (version + 1.0). Since then he has participated in the Jini Printing Working + group and has recently become a member of Kodak’s SVG Working Group + team. +

+ +
+ + +
Cameron McCormack (CM)
+ +
+ +

+cam@mcc.id.au +

+ +

+ Cameron McCormack is a postgraduate student at Monash University in + Melbourne, Australia, where he is undertaking his PhD. His thesis + relates to adaptive layout of diagrams, and he has worked on an + extension to SVG to allow expressions as attribute values. He also + represents National ICT Australia on the SVG Working Group. Cameron + has been a committer since 2004, and has contributed code mostly + related to SMIL animation and upcoming SVG 1.2 support. +

+ +
+ + +
Dieter von Holten (DH)
+ +
+ +

+ Dieter is a freelance programmer living in Hamburg, Germany. He + spends his time on projects in refineries and tankfarms, chasing + bits from ERP to PLC and back. Although not specifically an expert + with graphics, he tries to help out “maintaining and enhancing this + interesting, non-trivial piece of code”. +

+ +
+ +
+

+ The following people are some of the Batik project founders and + helped define and implement the initial Batik architecture: +

+
+ +
Bill Haneman
+ +
+ +

+bill.haneman@ireland.sun.com +

+ +

+ Bill Haneman works for Sun Microsystems’ Desktop Enabling Middleware + group in Dublin, Ireland, and implemented much of the Batik’s text + support (though not SVG Fonts, thanks Bella, Dean, and David!). He is + also technical lead for the + GNOME + Accessibility Project, an open project to provide an + accessibility framework for Linux and Solaris(TM) desktops. A + twenty-year veteran of scientific programming and application + development, he is a US expatriate who plays traditional Irish music + on the uilleann pipes. +

+ +
+ + +
Vincent Hardy
+ +
+ +

+vincent.hardy@eng.sun.com +

+ +

+ Vincent is one of the founders of the SVG Batik project at Apache. + He is a Senior Staff Engineer at Sun Microsystems Inc., where he is + part of the XML technology center. Vincent represented Sun in the + W3C’s SVG Working Group and is currently a W3C fellow in the W3C + office in Sophia Antipolis, France. Vincent is the author of papers + and a book on the Java 2D API. +

+ +
+ + +
Stephane Hillion
+ +
+ +

+shillion@ilog.fr +

+ +

+ Stephane is a software engineer at the Koala project, part of + ILOG’s visualization R&D team, located in Sophia-Antipolis, + France. His main interests are in programming languages and web + standards. He wrote the Apache Batik’s DOM, CSS and Swing modules. +

+ +
+ + +
Dean Jackson
+ +
+ +

+dean.jackson@cmis.csiro.au +

+ +

+ Dean is employed by CSIRO Australia and is currently working at + the World Wide Web Consortium (W3C) full time on SVG. He is a member + of the W3C’s SVG working group, and was a developer + of the CSIRO SVG Toolkit, one of the first and most complete open source + SVG libraries. +

+ +
+ + +
Christophe Jolif
+ +
+ +

+cjolif@ilog.fr +

+ +

+ Christophe Jolif is a Software Architect mainly working on the ILOG + JViews Component Suite, the ILOG Java visualization framework. He has + been working for ILOG since 1997, and is representing the company in the + Scalable Vector Graphics (SVG) W3C Working Group since 1999. He has + implemented SVG import and export features in ILOG JViews and is now + also working on the SVG Batik project at Apache. +

+ +
+ + +
Thierry Kormann
+ +
+ +

+tkormann@ilog.fr +

+ +

+ Thierry is a software engineer, at the Koala project of ILOG located at + Sophia-Antipolis, France and a member of the SVG working group. Thierry has + contributed to most of Koala’s projects involving Java and XML. Since + then, he co-founded the Apache Batik project. His daytime job is focused on + Graphics and XML related technologies. Prior to joining ILOG, Thierry worked + as a software engineer for Bull. +

+ +
+ + +
Nicolas Socheleau
+ +
+ +

+nicolas.socheleau@bitflash.com +

+ +

+ Nicolas Socheleau is a software engineer at BitFlash Inc, Ottawa, Canada + where he worked on different SVG related projects. He joined the Batik + team in June 2002. His interests include XML technologies and Graphics. He + contributed some text functionality and SVG DOM interface implementations. +

+ +
+ + +
Emmanuel Tissandier
+ +
+ +

+tissandi@ilog.fr +

+ +

+ Emmanuel Tissandier has been working for 10 years as a software engineer + in object oriented environments. He started with the development of CASE + tools at Rank Xerox and joined the visualization R&D team of ILOG in + 1995. Since 1997, he has been the R&D Project Manager for the ILOG + JViews Component Suite, a product for delivering two-dimensional + structured graphics, cartography, diagrams, and Gantt charts in Java. +

+ +
+ +
+

+ Bella Robinson implemented the SVG font support in Batik: +

+
+ +
Bella Robinson
+ +
+ +

+bella.robinson@cmis.csiro.au +

+ +

+ Bella is a Software Engineer working for CSIRO Australia. She was one + of the main developers of the CSIRO SVG Toolkit and has also been working + on a Pocket SVG Viewer for handheld devices. Her interests include + graphics and XML programming. +

+ +
+ +
+

+ In addition, James + Davidson and Stefano + Mazzochi, two Apache veterans who helped the Batik team start the + project at Apache, also have commit access to the Subversion repository. +

+
+ + + +

Batik contributors

+
+

+ The following people have contributed to Batik: +

+
    + +
  • + +Curt + Arnold—Contributed many bug reports and fixes. +
  • + +
  • + +Robert A. + DiBlasi—Contributed a lot of feedback on the Batik + documentation and suggestions on how to improve it. +
  • + +
  • + +Archie + Cobbs—Contributed a thread deadlocking fix. +
  • + +
  • + +Paul + Evenblij—Contributed an improvement to the way images are + handled by the SVGGraphics2D component. Also contributed bug fixes on + the SVGGraphics2D component. +
  • + +
  • + +Pier + Fumagalli—Helped with the Batik web site and mailing + lists. +
  • + +
  • + +Hervé + Girod—Contributed many improvements to the WMF + transcoder. +
  • + +
  • + +Christophe + Held—Contributed a math formula in SVG generated from + MathML. +
  • + +
  • + +Clay Leeds—Helped + getting Batik’s new site set up. +
  • + +
  • + +Keiron Liddle—A + FOP member who worked + on an SVG to PDF transcoder that is a part of FOP but works in the + Batik infrastructure. +
  • + +
  • + +Jeremias + Märki—Another FOP member who contributed code to improve + compatibility with GNU Classpath. +
  • + +
  • + +John + Morrison—Contributed a set of XSL stylesheets to generate + SVG charts, such as line graphs, bar charts or pie charts. +
  • + +
  • + +Andreas + Neumann—Contributed two SVG maps which + Bert Bos has internationalized + (adding an English version to the original German text). +
  • + +
  • + +Luan O’Carroll—Contributed + the original WMF transcoder. +
  • + +
  • + +Sheng Pei—Contributed + to filter support and the regard tool. +
  • + +
  • + +Neeme + Praks—Contributed patches, feedback and scripts for + building charts from John Morrisson’s XSL stylesheets. +
  • + +
  • + +Henri Ruini—Contributed to + a rewrite of the rasterizer application. +
  • + +
  • + +David + Schweinsberg—Contributed the True Type Font to SVG Font + converter. +
  • + +
  • + +Eric Suen—Tracked + down some memory leaks. +
  • + +
  • + +Nicholas + Talian—Contributed on gradients. +
  • + +
  • + +Andres + Toussaint—Contributed SVGAnimatedPathData functionality. +
  • + +
+
+ + + +

Areas of expertise

+
+

+ The following table summarizes the areas of expertise of each active + committer. It allows better coordination of both internal and + external development efforts. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TDCMDH
Team ContactX
BridgeX
BrowserX
CSSXX
DocumentationXX
SVG DOMX
GVT CoreX
GVT FiltersX
GVT RendererX
GVT TextX
SVGGraphics2DX
SMIL AnimationX
Micro ParsersX
RasterizerX
ScriptingX
Swing ComponentsX
TestXX
+ +
+
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/demo.html b/bin/svg_kit/batik-1.7/docs/demo.html new file mode 100644 index 0000000..dbfbf00 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/demo.html @@ -0,0 +1,347 @@ + + + + + + + +Batik Demo + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Batik Demo

+ +

+ This page demonstrates the use of Batik’s + JSVGCanvas swing component in a Java applet. +

+ + + + + + + + + + + + +
+ + [Your browser doesn’t seem to support Java applets, which is required + for this demo.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExpenseAmount
Shoe
Car
Travel
Computer
+ +

+ + + +

+ +
+ + + + + +

+ The applet (view source) displays + the + barChart.svg + sample from the Batik distribution using a JSVGCanvas. + Script in the web page then interacts with the applet, by calling the + updateBar method of the applet object when the + Update chart button is pressed. This method modifies the + SVG document being displayed to update the heights of the bars. +

+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/demo/AppletDemo$1.class b/bin/svg_kit/batik-1.7/docs/demo/AppletDemo$1.class new file mode 100644 index 0000000..b5e3c81 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/AppletDemo$1.class differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/AppletDemo$2.class b/bin/svg_kit/batik-1.7/docs/demo/AppletDemo$2.class new file mode 100644 index 0000000..610e257 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/AppletDemo$2.class differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/AppletDemo.class b/bin/svg_kit/batik-1.7/docs/demo/AppletDemo.class new file mode 100644 index 0000000..d123a6c Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/AppletDemo.class differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/AppletDemo.java b/bin/svg_kit/batik-1.7/docs/demo/AppletDemo.java new file mode 100644 index 0000000..132760e --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/demo/AppletDemo.java @@ -0,0 +1,151 @@ +/* + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +import java.io.IOException; +import java.net.URL; + +import javax.swing.JApplet; + +import org.apache.batik.dom.svg.SAXSVGDocumentFactory; +import org.apache.batik.swing.JSVGCanvas; +import org.apache.batik.util.XMLResourceDescriptor; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; + +/** + * A applet demonstrating the JSVGCanvas. + * + * @version $Id$ + */ +public class AppletDemo extends JApplet { + + protected JSVGCanvas canvas; + + protected Document doc; + + protected Element svg; + + public void init() { + // Create a new JSVGCanvas. + canvas = new JSVGCanvas(); + getContentPane().add(canvas); + + try { + // Parse the barChart.svg file into a Document. + String parser = XMLResourceDescriptor.getXMLParserClassName(); + SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser); + URL url = new URL(getCodeBase(), "barChart.svg"); + doc = f.createDocument(url.toString()); + + svg = doc.getDocumentElement(); + + // Change the document viewBox. + svg.setAttributeNS(null, "viewBox", "40 95 370 265"); + + // Make the text look nice. + svg.setAttributeNS(null, "text-rendering", "geometricPrecision"); + + // Remove the xml-stylesheet PI. + for (Node n = svg.getPreviousSibling(); + n != null; + n = n.getPreviousSibling()) { + if (n.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) { + doc.removeChild(n); + break; + } + } + + // Remove the Batik sample mark 'use' element. + for (Node n = svg.getLastChild(); + n != null; + n = n.getPreviousSibling()) { + if (n.getNodeType() == Node.ELEMENT_NODE + && n.getLocalName().equals("use")) { + svg.removeChild(n); + break; + } + } + } catch (Exception ex) { + } + } + + public void start() { + // Display the document. + canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC); + canvas.setDocument(doc); + } + + public void stop() { + // Remove the document. + canvas.setDocument(null); + } + + public void destroy() { + canvas.dispose(); + } + + public void updateBar(final String name, final float value) { + canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater + (new Runnable() { + public void run() { + Element bar = doc.getElementById(name); + if (bar == null) { + return; + } + + Node n; + Element path1, path2, path3; + for (n = bar.getFirstChild(); + n.getNodeType() != Node.ELEMENT_NODE; + n = n.getNextSibling()) { + } + path1 = (Element) n; + for (n = n.getNextSibling(); + n.getNodeType() != Node.ELEMENT_NODE; + n = n.getNextSibling()) { + } + path2 = (Element) n; + for (n = n.getNextSibling(); + n.getNodeType() != Node.ELEMENT_NODE; + n = n.getNextSibling()) { + } + path3 = (Element) n; + + int offset; + if (name.equals("ShoeBar")) { + offset = 0; + } else if (name.equals("CarBar")) { + offset = 79; + } else if (name.equals("TravelBar")) { + offset = 158; + } else { + offset = 237; + } + + String d = + "M " + (offset + 86) + ",240 v -" + (3.7 * value) + " l 15,-15 v " + (3.7 * value) + " l -15,15 z"; + path1.setAttributeNS(null, "d", d); + d = "M " + (offset + 86) + "," + (240 - 3.7 * value) + " h -39 l 15,-15 h 39 l -15,15 z"; + path2.setAttributeNS(null, "d", d); + d = "M " + (offset + 47) + "," + (240 - 3.7 * value) + " v " + (3.7 * value) + " h 39 v -" + (3.7 * value) + " h -39 z"; + path3.setAttributeNS(null, "d", d); + } + }); + } +} diff --git a/bin/svg_kit/batik-1.7/docs/demo/Makefile b/bin/svg_kit/batik-1.7/docs/demo/Makefile new file mode 100644 index 0000000..0c6630a --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/demo/Makefile @@ -0,0 +1,2 @@ +AppletDemo.class : AppletDemo.java + javac -classpath .:batik-awt-util.jar:batik-bridge.jar:batik-css.jar:batik-dom.jar:batik-ext.jar:batik-gvt.jar:batik-parser.jar:batik-script.jar:batik-svg-dom.jar:batik-swing.jar:batik-util.jar:batik-xml.jar:xml-apis-dom3.jar AppletDemo.java diff --git a/bin/svg_kit/batik-1.7/docs/demo/barChart.svg b/bin/svg_kit/batik-1.7/docs/demo/barChart.svg new file mode 100644 index 0000000..e86c428 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/demo/barChart.svg @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + Bar Chart + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shoe + Car + Travel + Computer + + 0 + 10 + 20 + 30 + 40 + 50 + 60 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/svg_kit/batik-1.7/docs/demo/batik-awt-util.jar b/bin/svg_kit/batik-1.7/docs/demo/batik-awt-util.jar new file mode 100644 index 0000000..2ddfc70 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/batik-awt-util.jar differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/batik-bridge.jar b/bin/svg_kit/batik-1.7/docs/demo/batik-bridge.jar new file mode 100644 index 0000000..e3166ea Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/batik-bridge.jar differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/batik-css.jar b/bin/svg_kit/batik-1.7/docs/demo/batik-css.jar new file mode 100644 index 0000000..4393bf2 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/batik-css.jar differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/batik-dom.jar b/bin/svg_kit/batik-1.7/docs/demo/batik-dom.jar new file mode 100644 index 0000000..fe91114 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/batik-dom.jar differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/batik-ext.jar b/bin/svg_kit/batik-1.7/docs/demo/batik-ext.jar new file mode 100644 index 0000000..1cf9e8d Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/batik-ext.jar differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/batik-gvt.jar b/bin/svg_kit/batik-1.7/docs/demo/batik-gvt.jar new file mode 100644 index 0000000..fff2dc8 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/batik-gvt.jar differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/batik-parser.jar b/bin/svg_kit/batik-1.7/docs/demo/batik-parser.jar new file mode 100644 index 0000000..2c36ef5 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/batik-parser.jar differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/batik-script.jar b/bin/svg_kit/batik-1.7/docs/demo/batik-script.jar new file mode 100644 index 0000000..203fe96 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/batik-script.jar differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/batik-svg-dom.jar b/bin/svg_kit/batik-1.7/docs/demo/batik-svg-dom.jar new file mode 100644 index 0000000..a392d3d Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/batik-svg-dom.jar differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/batik-swing.jar b/bin/svg_kit/batik-1.7/docs/demo/batik-swing.jar new file mode 100644 index 0000000..ce747ea Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/batik-swing.jar differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/batik-util.jar b/bin/svg_kit/batik-1.7/docs/demo/batik-util.jar new file mode 100644 index 0000000..240e893 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/batik-util.jar differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/batik-xml.jar b/bin/svg_kit/batik-1.7/docs/demo/batik-xml.jar new file mode 100644 index 0000000..e1b3c5e Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/batik-xml.jar differ diff --git a/bin/svg_kit/batik-1.7/docs/demo/demo.html b/bin/svg_kit/batik-1.7/docs/demo/demo.html new file mode 100644 index 0000000..252060d --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/demo/demo.html @@ -0,0 +1,83 @@ + + + Batik demo + + + + + + + + + + + + diff --git a/bin/svg_kit/batik-1.7/docs/demo/xml-apis-dom3.jar b/bin/svg_kit/batik-1.7/docs/demo/xml-apis-dom3.jar new file mode 100644 index 0000000..e77c35f Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/demo/xml-apis-dom3.jar differ diff --git a/bin/svg_kit/batik-1.7/docs/dev/branches.html b/bin/svg_kit/batik-1.7/docs/dev/branches.html new file mode 100644 index 0000000..a77250a --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/dev/branches.html @@ -0,0 +1,211 @@ + + + + + + + +Subversion repository branches + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Subversion repository branches

+ +

+ This page contains information on the current work that is being done + in Batik’s Subversion repository. There are currently three main branches + in use in the repository: +

+ +
+ +
trunk
+ +
+ +

+ The + trunk + is the main development branch. All bug fixes and most new + non-experimental features are checked in to this branch. While it is + the bleeding edge of the available Batik code, it is generally stable + enough to use. For more information on SVG 1.2 features that are + supported by the trunk, see the + SVG 1.2 support page. +

+ +
+ +
webapi
+ +
+ +

+ The + webapi + branch is where some experimental support for some of the work being + produced by the Web API + WG (specifically, support for + XMLHttpRequest and + the Window object). When + the specifications and the implementation mature enough, the + code will be folded back into the trunk. +

+ +
+ +
svg11
+ +
+ +

+ The + svg11 + branch contains the code that was the trunk before the old svg12 + branch became the trunk. Bug fixes that are made on the trunk are + also ported to the svg11 branch. This branch will be deprecated at + some point in the future. +

+ +
+ +
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/dev/index.html b/bin/svg_kit/batik-1.7/docs/dev/index.html new file mode 100644 index 0000000..38368a4 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/dev/index.html @@ -0,0 +1,201 @@ + + + + + + + +Batik Development + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Batik Development

+ +

+ This section has information on the working on Batik, and on the + features that are supported by the code in the Subversion repository + that haven’t yet made it to a release. +

+ +
+ +
Branches
+ +
+ +

+ The branches page lists the branches + of development that are in the Subversion repository and their + purpose. +

+ +
+ +
SVG 1.2 support
+ +
+ +

+ Some features of SVG 1.2 Tiny and Full are supported in the + trunk, and these are listed on the SVG 1.2 + support page. +

+ +
+ +
Test infrastructure
+ +
+ +

+ Finally, there is a description of Regard, the + test infrastructure used to test Batik + functionality and avoid regressions. +

+ +
+ +
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/dev/svg12.html b/bin/svg_kit/batik-1.7/docs/dev/svg12.html new file mode 100644 index 0000000..a24c82a --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/dev/svg12.html @@ -0,0 +1,451 @@ + + + + + + + +SVG 1.2 support + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

SVG 1.2 support

+ + +

+ This page details information atbout Batik’s implementation of + features from SVG 1.2, Tiny and + Full. Note that the information on + this page is based on the code in the Subversion repository + trunk. +

+ + + +

DOM Level 3

+
+

+ DOM Level 3 Core, + Events and XPath + are all supported. These features are available regardless of whether + the document has version="1.1" or + version="1.2" set on the root svg element. +

+

+ There are a few issues with the DOM Level 3 Core implementation: +

+
    + +
  1. + The Document.compareDocumentPosition method does not give + the correct result when used on DTD notation or entity nodes in the + document. +
  2. + +
  3. + +Node.renameNode always creates a new node and replaces + the old node with it. This is technically allowed, but sub-optimal. +
  4. + +
  5. + XML Schema information is never used. Batik does not implement XML + Schema, so any methods or attributes that would utilise or expose + schema information (such as the schemaTypeInfo attribute + on the Attr and Element interfaces) do not + do so. +
  6. + +
  7. + +Document.normalizeDocument ignores the + "entities" parameter in the document’s + DOMConfiguration. +
  8. + +
+ +

Using DOM Level 3 functionality from Java

+

+ JREs before 1.5 include the DOM Level 2 interfaces and this can cause + problems when trying to use the DOM Level 3 versions of these same interface + files (org.w3c.dom.*). Though the concrete Batik DOM + classes implement the DOM Level 3 functionality, you won’t be able to access + those methods through the org.w3c.dom interfaces on these + earlier JREs. +

+

+ There are two ways to overcome this problem. The first + is to install the DOM Level 3 interfaces using the + Endorsed + Standards Override Mechanism. Copy the file + lib/xml-apis-ext.jar into the endorsed standards override + directory and the DOM Level 3 interfaces will be visible. You can then write + code against them (for example, call Document.renameNode + directly). However, this will mean that other people cannot run or + compile your code unless they have JRE 1.5 or later, or they have also + installed the xml-apis-ext.jar in the same way. +

+

+ The second method, which requires less messing about with the JRE, is + to cast your DOM objects to the concrete Batik DOM objects and call + your DOM Level 3 methods directly on them. The Batik DOM classes are in the + org.apache.batik.dom package. The classes named + Abstract* implement the DOM interfaces, and also contain + the DOM Level 3 methods. The advantage of this method is that for your code + to compile and run in others’ environments, they need not install any + jars with the endorsed standards overrides. +

+

+ Here is an example of using the second method to get access to DOM + Level 3 specific methods: +

+
import org.apache.batik.dom.AbstractDocument;
+import org.apache.batik.dom.svg.SVGDOMImplementation;
+
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class C {
+    public void f() {
+        // Create a new SVG document
+        DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
+        Document doc = impl.createDocument("http://www.w3.org/2000/svg", "svg", null);
+
+        // Create a 'g' element and append it to the root 'svg' element
+        Element e = doc.createElementNS("http://www.w3.org/2000/svg", "g");
+        doc.getDocumentElement().appendChild(e);
+
+        // Cast the document object to org.apache.batik.dom.AbstractDocument,
+        // so that DOM 3 methods will be guaranteed to be visible
+        AbstractDocument document = (AbstractDocument) doc;
+
+        // Now a DOM 3 method can be used
+        document.renameNode(e, "http://www.w3.org/2000/svg", "text");
+    }
+}
+

+ For cases where the DOM Level 3 versions of these interfaces contain + constants that you wish to use, the constants have been copied into + the Batik DOM classes. For example: +

+
import org.apache.batik.dom.AbstractNode;
+import org.apache.batik.dom.svg.SVGDOMImplementation;
+
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class C {
+    public void f() {
+        // Create a new SVG document
+        DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
+        Document doc = impl.createDocument("http://www.w3.org/2000/svg", "svg", null);
+
+        // Create a 'g' element and append it to the root 'svg' element
+        Element svg = doc.getDocumentElement();
+        Element e = doc.createElementNS("http://www.w3.org/2000/svg", "g");
+        svg.appendChild(e);
+
+        AbstractNode n1 = (AbstractNode) svg;
+        AbstractNode n2 = (AbstractNode) e;
+        int position = n1.compareDocumentPosition(n2);
+        if (position == AbstractNode.DOCUMENT_POSITION_PRECEDING
+                      | AbstractNode.DOCUMENT_POSITION_CONTAINS) {
+            System.out.println("The svg element contains the g element.");
+        } else {
+            System.out.println("Something is wrong!");
+        }
+    }
+}
+

+ Note that using these org.apache.batik.dom interfaces is only needed + for the DOM Level 3 Core and Events interfaces. There were no earlier + versions of the DOM XPath interfaces to conflict with, so these can be + used directly (org.w3c.dom.xpath). +

+

+ Of course, none of this matters if you are just using the DOM 3 + functionality in ECMAScript, as the matter of interfaces is hidden + from the scripting environment. +

+
+ + + +

XML Binding Language for SVG (sXBL)

+
+

+ sXBL is supported in documents with version="1.2". However, + the following issues exist: +

+
    + +
  1. + sXBL cannot be used for + SVG + resources or + visual + effects. +
  2. + +
  3. + The traitDef element is not implemented. +
  4. + +
  5. + The handling of CSS + is probably not quite correct. +
  6. + +
+

+ Two content selector languages are supported: XPath 1.0 Patterns and the + drastically reduced XPath subset. XPath Patterns is the default + language. To change the language used to the XPath subset, put an + attribute batik:selectorLanguage="XPathSubset" on the + xbl:content element or on the svg document + element. (The batik extension namespace prefix should be + declared with + xmlns:batik="http://xml.apache.org/batik/ext".) +

+

+ Note that sXBL is likely to be dropped in favor of + XBL 2.0 in + SVG 1.2 Full. +

+
+ + + +

Flowing text and graphics

+
+

+ The flowRoot, flowRegion, + flowDiv, flowPara, flowSpan, + flowRegionBreak and flowLine elements + from SVG 1.2 Full’s + Flowing + Text and Graphics chapter are supported in documents with + version="1.2". +

+

+ The more recent SVG 1.2 Tiny draft specifies + a different syntax for (a more restricted version of) flowing text, + and the full flowing text syntax is therefore likely to change. +

+
+ + + +

Other SVG 1.2 features

+
+

+ The following other features from SVG 1.2 are supported: +

+ +
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/dev/test.html b/bin/svg_kit/batik-1.7/docs/dev/test.html new file mode 100644 index 0000000..0528a44 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/dev/test.html @@ -0,0 +1,821 @@ + + + + + + + +Test infrastructure + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Test infrastructure

+ + +

+ This document describes the Batik test infrastructure whose goals + are to: +

+ +
    + +
  • make it easy to detect regressions,
  • + +
  • make it easy to run test suites, and
  • + +
  • make it easy to write new tests and add them + to an existing test suite.
  • + +
+ +

+ The intent for the test infrastructure is that it grows + along with Batik and keeps monitoring the health of + the code base. +

+ +

+ While the test suites in the infrastructure will be + run every day by build/test machines, they are also + intended to help the commiters and developers get confident + that their code modifications did not introduce regressions. +

+ + + +

The test infrastructure

+
+ +

High-level interfaces

+

+ The following are the high level interfaces in the infrastructure. +

+
+ +
+Test +
+ +
+ +

+ A Test is performing whatever check is needed in its + run method, and each run produces a + TestReport. +

+ +
+ +
+TestReport +
+ +
+ +

+ A TestReport describes whether a Test + run passed or failed and provides a description of the failure in + terms of an error code (unique in the context of a given + Test) and a set of key/value pairs. +

+ +
+ +
+TestSuite +
+ +
+ +

+ A TestSuite is a test aggregation which can run a set + of Test instances. +

+ +
+ +
+TestReportProcessor +
+ +
+ +

+ A TestReportProcessor is used to analyze a + TestReport. A specific implementation can choose to + create graphs, send an email or write an HTML file. +

+ +
+ +
+ +

Default implementations

+

+ The test infrastructure comes with a number of default + implementations for the interfaces described above. + Specifically: +

+
+ +
+AbstractTest +
+ +
+ +

+ This implementation of the Test interface is + intended to make it easier to write a “safe” Test + implementation. See the Writing new + tests section for a description of how to use that class. +

+ +
+ +
+DefaultTestReport +
+ +
+ +

+ This class provides a simple implementation of the + TestReport interface that most Test + implementations will be able to use. See the + Writing new tests section for + more details. +

+ +
+ +
+DefaultTestSuite +
+ +
+ +

+ This class provides an implementation of the + TestSuite interface and makes it + easy to aggregate Test instances. +

+ +
+ +
+SimpleTestReportProcessor +
+ +
+ +

+ This class is a sample TestReportProcessor + implementation that simply traces the content of a + TestReport to an output stream. +

+ +
+ +
+TestReportMailer +
+ +
+ +

+ This is another implementation of the + TestReportProcessor interface that emails a test + report to a list of destination e-mail addresses. +

+ +
+ +
+ +

XML implementations

+

+ The test infrastructure is using XML-out (and XML-in + too, see the Running a test suite + section) as a favorite way to generate test reports. The + XMLTestReportProcessor + implementation of the TestReportProcessor interface. + It outputs reports in XML in a configurable directory. +

+

+ The XMLTestReportProcessor can notify an + XMLReportConsumer + when it has created a new report. There is one implementation of + that interface that can run an XSL stylesheet on the + XML report (e.g., to generate an HTML report), called + XSLXMLReportConsumer. + This is used by the regard rule in the Batik build to produce an + HTML report for the default regression test suite. +

+
+ + + +

Managing test suites

+
+

+ The infrastructure is designed to make it easy to create, update + and modify test suites. This section describes how to describe a + set of tests to be run and how to actually run that test suite. +

+ +

Describing a test suite

+

+ Test suites can be described in XML (XML-in refered to earlier + in this document). The general format for describing a test suite is: +

+
<testSuite id="testSuiteA" name="MyFavoriteTestSuite">
+  <!-- Set of tests to be run -->
+  <test id="t1" class="myFavoriteTestClassA"/>
+  <test id="t2" class="myFavoriteTestClassB"/>
+  <test id="t3" class="myFavoriteTestClassC"/>
+</testSuite>
+

+ Note that tests can be grouped in testGroup elements, + which can have their own id and class + attributes. This is useful because it allows developers to run + specific tests or test groups by specifying their IDs. In addition, + because the class attribute is inherited by a test element + from its parent, testGroups allow the developers to + group tests which use the same class and specify that class on the + group. +

+

+ +Test instances listed in a test suite can have arguments + passed to them, as defined by the test class. These arguments are + passed in using arg child elements. +

+

+ The following example shows a test suite with two tests: +

+
<testSuite id="sampleTestSuite" name="SAMPLE TEST SUITE">
+
+  <!-- ========================================================================== -->
+  <!-- Validates that the SVGRenderingAccuracyTest class is operating as expected -->
+  <!-- ========================================================================== -->
+  <test id="renderingAccuracyTest" class="org.apache.batik.test.svg.SVGRenderingAccuracyTestValidator"/>
+
+  <!-- ========================================================================== -->
+  <!-- Rendering regression tests                                                 -->
+  <!-- ========================================================================== -->
+  <test id="anne.svg" class="org.apache.batik.test.svg.SVGRenderingAccuracyTest">
+    <arg class="java.net.URL" 
+         value="file:samples/anne.svg"/>
+    <arg class="java.net.URL" 
+         value="file:test-references/samples/solaris/anne.png"/>
+    <property name="VariationURL" 
+           class="java.net.URL" 
+           value="file:test-references/samples/variation/anne.png"/>
+    <property name="SaveVariation" 
+           class="java.io.File" 
+           value="test-references/samples/variation-candidate/anne.png"/>
+  </test>
+
+</testSuite>
+ +

Running a test suite

+

+ Yet another XML file describes which test to run and how to process + the generated test reports. The general syntax is something + like: +

+
<testRun id="regard" name="Test Run Name Here">
+
+  <!-- =================================== -->
+  <!-- Descriptions of processors that     -->
+  <!-- will process the results of the     -->
+  <!-- test suite                          -->
+  <!-- =================================== -->
+  <testReportProcessor class="myFavoriteReportProcessorA"/>
+  <testReportProcessor class="myFavoriteReportProcessorB"/>
+
+  <!-- =================================== -->
+  <!-- Set of test suite to run. They will -->
+  <!-- produce TestReports.                -->
+  <!-- =================================== -->
+  <testSuite href="http://url.to.my.first.test.suite"/>
+  <testSuite href="http://url.to.my.second.test.suite"/>
+
+</testRun>
+

+ +testRun elements can be nested. In a nutshell, you can + specify a set of TestReportProcessors which should + process the TestReport generated by the + TestSuite built from the list of Test + instances described in the files referenced by the + testSuite elements. +

+

+ For example: +

+
<testRun name="Batik Standard Regression Test Run">
+
+  <testRun name="REGARD">
+    <testReportProcessor class="org.apache.batik.test.xml.XMLTestReportProcessor"> 
+      <arg class="org.apache.batik.test.xml.XSLXMLReportConsumer">
+        <!-- Stylesheet -->
+        <arg class="java.lang.String" value="file:test-resources/org/apache/batik/test/svg/HTMLReport.xsl"/>
+        <!-- Ouput Directory -->
+        <arg class="java.lang.String" value="test-reports/html"/>
+        <!-- Output file prefix -->
+        <arg class="java.lang.String" value="RegardResult"/>
+        <!-- Output file suffix -->
+        <arg class="java.lang.String" value=".html"/>
+      </arg>
+    </testReportProcessor>
+
+    <testSuite href="file:test-resources/org/apache/batik/test/samplesRendering.xml"/> 
+    <testSuite href="file:test-resources/org/apache/batik/svggen/regsvggen.xml"/>
+    <testSuite href="file:test-resources/org/apache/batik/test/unitTesting.xml"/> 
+  </testRun>
+
+</testRun>
+

+ There is a rule in Batik's build.xml file to run a test + suite defined in an XML file as the one above. At the command line, + type the following, for Windows: +

+
build runtestsuite path/to/my/newly/created/testSuite.xml
+

+ and for Unix: +

+
build.sh runtestsuite path/to/my/newly/created/testSuite.xml
+

+ In addition, the regard rule runs a specific set of + tests by default, so that you do not need to pass any + testRun file argument. +

+

+ +regard is the project’s safeguard against + regressions.

+
+ + + +

regard: the Batik regression test suite

+
+

+ The regard test suite contains all the regression tests for the Batik + project. The regard tool is a specific test suite + description, regard.xml (which you can find in the + test-resources/org/apache/batik/test directory). That + file contains a set of test suite files which sould be run. +

+

+ The following describes how to use the regard tool and some of the + most important tests in the regard test suite. +

+ +

Running regard

+

+ The regard tool lets you run either all the tests or any specific + test you want in the test suite. To run all the tests in the regard + test suite, type the following at the command line, for Windows: +

+
build regard
+

+ and for Unix: +

+
build.sh regard
+

+ To run a specific test in the test suite, type the qualified test ID + or any substring of that ID: +

+
build.sh regard id-list
+
+

For example:

+
build.sh regard unitTesting.ts batikFX.svg
+

+ will run all the tests with an ID containing + unitTesting.ts (i.e., all the test selection unit + testing, see + test-resources/org/apache/batik/gvt/unitTesting.xml) + and the accuracy rendering test on batikFX.svg (because + it is the only test with batikFX.svg in its ID). +

+ +

Rendering accuracy tests

+

+ There is a Test implementation, + SVGRenderingAccuracyTest, + which checks that Batik’s rendering of an SVG document stays accurate. + It compares reference images with the rendering Batik produces and + reports any discrepency. +

+

+ An SVGRenderingAccuracyTest’s constructor configuration + is made of: +

+
    + +
  • the URL to the SVG it should render, and
  • + +
  • the URL to a reference PNG file.
  • + +
+

+ The default behavior for the test is to render the SVG into a PNG + file and compare with the reference image. If there is not + difference, the test passes. Otherwise, it fails. +

+

+ In addition to this default behavior, the + SVGRenderingAccuracyTest can take an optional + configuration parameter, an image URL defined as an “accepted” + variation around the reference image. If such a variation image is + specified, then the test will pass if: +

+
    + +
  • the rasterized SVG is equal to the reference image, or
  • + +
  • + the difference between the rasterized SVG and the reference image + is exactly the same as the accepted variation image. +
  • + +
+

+ Finally, to ease the process of creating “accepted” variation + images, SVGRenderingAccuracyTest can take an optional + file name (called saveVariation) describing where the + variation between the rasterized SVG and the reference image will be + stored in case the rasterized SVG is different from the reference + image and the difference is not equal to the variation image, if any + was defined. That way, it becomes possible to run a test, and if that + test fails, the developer can review the saveVariation + image and decide whether it is an acceptable variation or not and + use it in subsequent test run as the “accepted” variation image, which + will allow the test to pass if that exact same variation remains + constant. +

+ +

Day to day use of regard

+ +

Initial set up

+

+ To set up the test environment the first time, you need to: +

+
    + +
  • + check out the latest version of the code, including the + test-* directories (sources, resources and + references) and the build.xml file, and +
  • + +
  • + run the regard test suite once: +
    build regard
    + +
  • + +
+

+ This will generate an HTML test report (report.html) + in the + test-reports/yyyy.mm.dd-HHhMMmSSs/html + directory. Depending on how much different text rendering is + between your work environment and the environment used to create + the reference images, you will get more or less test that will + fail, because of differences in the way text is rendered on various + platforms and because of fonts not being available on some + platforms. For example, a running the test on a Windows 2000 + laptop against images generated on the Solaris platform caused 16 + tests out of 71 to fail. +

+

+ Review the HTML report to make sure that the differences are + really due to text variations. This will usually be the case and + you can make sure by clicking on the diff images contained in the + report to see them at full scale. You can you can then turn the + “candidate” variations generated by the test into “accepted” + variations by moving files from one directory to another: +

+
mv test-references/samples/candidate-variations/*.png test-references/samples/accepted-variations/*.png
+mv test-references/samples/tests/candidate-variations/*.png test-references/samples/tests/accepted-variations/*.png
+

You can now run the test again:

+
build regard
+

+ Check the newly generated HTML report in the + test-reports/html directory: there should no + longer be any test failure. +

+ +

Daily usage

+

+ Once the intial set up has been done, you can use regard by simply + updating your SVN copy, including the test-references. If no + change occurs, your test will keep passing with your reference + images. If a test fails (e.g., if someone checks in a new reference + image from a platform different than the one you are using, you + will have to check if it is because of system specific reasons or + if there is a bigger problem. +

+ +

SVG generator tests

+

+ Regard contains over 100 tests for checking regressions on the SVG + generator. If you use svggen as an argument to regard, + all the SVG generator tests will be run (because + regard.xml points to + test-resources/org/apache/batik/svggen/regsvggen.xml, + which is a test suite description for the SVG generator and that + file’s root testSuite element has the “svggen” ID). +

+
+ + + +

Writing new tests

+
+

+ Writing a new test involves either configuring a new test or writing a + new Test class. In both cases, you will need to add an + entry to a test suite’s XML description. This section uses two test + suites as an example: the “regard” test suite to show how to configure + a new test and the “unitTests” test suite to show how to add a new + Test implementation. +

+ +

Adding a new test configuration

+

+ Imagine that you add a cool new test case to the + samples directory, such as + linking-viewBox.svg. In order to check for regressions + on that file you can add the following entry: +

+
  <test id="anne.svg" class="org.apache.batik.test.svg.SVGRenderingAccuracyTest">
+    <arg class="java.net.URL" 
+        value="file:samples/tests/linkingViewBox.svg"/>
+    <arg class="java.net.URL" 
+         value="file:test-references/samples/tests/solaris/linkingViewBox.png"/>
+    <property name="VariationURL" 
+              class="java.net.URL" 
+              value="file:test-references/samples/tests/variation/linkingViewBox.png"/>
+    <property name="SaveVariation" 
+              class="java.io.File" 
+              value="test-references/samples/tests/variation-candidate/linkingViewBox.png"/>
+  </test>
+

+ to the + test-resources/org/apache/batik/test/samplesRendering.xml + test suite description, the description of the regard test suite. If + you have access to the build machine where the reference images are + typically generated, you can check 0n the reference image in + test-references/samples/tests. Otherwise (and this is + OK), you can let the test fail the first time it is run on the + build/test machine and that will be a reminder for whoever is + responsible for that machine that a valid reference image should be + checked in. +

+ +

Writing a new test

+

+ Imagine you want to validate some aspect of your code, and let's take + the bridge error handling as an example. You could create a new + class in the test-sources directory, in + test-sources/org/apache/batik/bridge in our example, + and let's call it ErrorHandlingTest. To simplify the + implementation of the Test interface, you can choose + to derive from the AbstractTest class and generate a + DefaultTestReport. +

+

+ While writing the Test you may want to use your own XML + file with just your test, for example: +

+
  <testReportProcessor class="org.apache.batik.test.SimpleTestReportProcessor"/> 
+
+  <test class="org.apache.batik.bridge.ErrorHandlingTest">
+    <!-- Expected error code -->
+    <arg class="java.lang.String" value="expected.error.code"/>
+    <!-- Input SVG that this test manipulates to generate error conditions -->
+    <arg class="java.net.URL" value="file:test-resources/org/apache/batik/bridge/ErrorHandlingBase.svg"/>
+    <!-- Id of the element to test -->
+    <arg class="java.lang.String value="rectangle6"/>
+    <!-- Attribute to test -->
+    <arg class="java.lang.String value="x"/>
+    <!-- Value to test on the attribute -->
+    <arg class="java.lang.String value="abcd"/>
+  </test>
+

+ This is just an example and does not pretend to be the right way to go + about implementing or specifying this specific type of test. Once done + with tuning the test, one or multiple configurations for the test can + be added to the relevant test suite’s XML description. In some cases, + it will be interesting to create a separate test suite. +

+
+ + +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/download.html b/bin/svg_kit/batik-1.7/docs/download.html new file mode 100644 index 0000000..642a88a --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/download.html @@ -0,0 +1,293 @@ + + + + + + + + +Download Batik + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Download Batik

+ +

Download Batik

+
+

There are several ways you can obtain Batik's binary or sources:

+ + +

Download a distribution

+

Every Batik release provides three distributions: a binary distribution (named batik-version.zip), a source distribution (named batik-src-version,zip) and a documentation distribution (named batik-docs-version.zip). These distributions are provided as ZIP files on the Apache mirrors. Note that it is good practice to verify the integrity of the distribution files.

+

After downloading the distribution, consult the installation notes for details on how to install.

+ +

Current official release (closest mirror site selected automatically)

+

You are currently using [preferred]. If you encounter a problem with this mirror, then please select another. If all mirrors are failing, there are backup mirrors at the end of the list. See status of mirrors.

+ +
Other mirrors: + +

The current release is Apache Batik 1.6 (see the release change log).

+
+
Binary distribution
+
+batik-1.6.zip [PGP] [MD5]
+
+
+
Source distribution
+
+batik-src-1.6.zip [PGP] [MD5]
+
+
+
Documentation distribution
+
+batik-docs-1.6.zip [PGP] [MD5]
+
+

Older releases are available from the Apache archives. However, we strongly recommend using the current release of Batik.

+ +

Current development snapshot

+

Nightly snapshots of the source tree are available from the Apache build server. These snapshots represent the current state of development and may or may not be as stable as releases. There are two distributions provided: a complete copy of the Subversion repository trunk (named batik-svn-date.zip), including Batik's regression testing utility and reference images; and a snapshot of the aforementioned source code without any of the testing facilities (named batik-src-date.zip).

+ +

Subversion repository

+

To fetch the latest Subversion repository trunk, just run the following command:

+
svn checkout http://svn.apache.org/repos/asf/xmlgraphics/batik/trunk/
+

You can also browse the Subversion repository using ViewCVS at http://svn.apache.org/viewcvs.cgi/xmlgraphics/batik/.

+
+
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/faq.html b/bin/svg_kit/batik-1.7/docs/faq.html new file mode 100644 index 0000000..ee9cfd7 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/faq.html @@ -0,0 +1,1115 @@ + + + + + + + +Frequently Asked Questions + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Frequently Asked Questions

+ +

Questions

+
+ +

1. General questions

+ +

1.1. What is Batik?

+
+^ +
+
+

+ Batik is a Java-based toolkit for applications or applets that want + to use images in the Scalable + Vector Graphics (SVG) format for various purposes, such as + display, generation or manipulation. +

+
+ +

1.2. What is SVG?

+
+^ +
+
+

+ +SVG (Scalable Vector + Graphics) is an open-standard language for describing + two-dimensional (2D) graphics in XML. It is a Recommendation from the + W3C. SVG lets you describe rich images + with features such as gradients, transparency, filter effects and animation. +

+

+ SVG has three types of graphic objects: shapes (e.g., paths consisting + of straight lines and curves), images and text. Graphical objects can be grouped, + styled, transformed and composited (e.g., drawn with transparency). SVG has a + large set of static features which includes nested transformations, clipping + paths, masking and filter effects. +

+

+ In addition, SVG images can be dynamic and interactive. A rich set of event + handlers such as for mouse movement and clicks can be assigned to any SVG + graphical object. These handlers can invoke scripts, which, in response to an + event, can dynamically modify the SVG graphic through the SVG Document Object Model + (DOM) API, allowing, for example scripts to change the color or location of graphical + elements. +

+

+ SVG graphical elements can be animated through scripting. Alternatively, + animation sequences can be expressed directly in XML because SVG leverages the + SMIL Animation + specification for multimedia, another + W3C specification. +

+
+ +

1.3. What can I do with Batik?

+
+^ +
+
+

+ Batik contains several core modules + which can be used independently or jointly to generate SVG + content (see the SVG Generator + and SVG DOM implementation documentation) + view SVG content (see the JSVGCanvas) + or convert to and from the SVG format (see the + SVG Transcoder page). +

+

+ In addition, Batik contains + low level + modules, such as an object-oriented Graphic Vector Toolkit + (GVT), a set of low level parsers specific to the SVG syntax and a + set of extensions to the Java 2D API + (such as sophisticated fill types and filter effects). +

+

+ Finally, Batik comes with packaged applications to help developers get + familiar with the code and be quickly able to use the various modules: Squiggle, an + SVG browser (in the + org.apache.batik.apps.svgbrowser package) an + SVG rasterizer (in the + org.apache.batik.apps.rasterizer package), a + Font converter (in the + org.apache.batik.apps.ttf2svg package) and an + SVG pretty printer (in the + org.apache.batik.apps.svgpp package).

+

+ Squiggle, the SVG browser can display SVG + documents and lets the user zoom, pan and rotate any SVG document, + view the SVG source, link between SVG documents, view a tree + representation of the SVG DOM and more. One important component of + the SVG viewer is the org.apache.batik.swing.JSVGCanvas + component, which can be plugged in to any Java application or applet + to provide SVG viewing capability. +

+

+ The SVG rasterizer + lets the user convert + SVG files to raster formats such as JPEG, PNG or TIFF . It + contains an extensible mechanism so that arbitrary raster + formats can be added. For example, the rasterizer lets you + create one SVG file with a special effect (e.g., shadows, + gradients, etc.), turn it into a PNG image, then modify the + SVG source (e.g., modify a piece of text or a color), and + generate another PNG image from it. This way, you can easily + generate a series of images sharing a common theme or look and + feel to post on a web site. (Note that the rasterizer can also + be used on a web server to do this conversion automatically). +

+

+ The SVG Font Converter + lets the user easily create + an SVG + Font for a set of characters from a TrueType Font + file. That SVG Font definition can be embedded in a document + using the characters. This allows users to create SVG + documents that are self contained and do not rely on system + fonts, and guarantees that the SVG file will be displayed + exactly as it was authored on all platforms. +

+

+ The SVG Pretty Printer + is a convenience tool to + pretty print an SVG document, which means that you can + reformat any existing SVG document to produce a nicely + formatted and highly legible version. +

+

+ These applications show that Batik can be used client side + (the browser can be used on any client machine) and server + side (the rasterizer can be used to serve SVG images to client + machines that do not have SVG support). +

+
+ +

1.4. Why do we have such a project at Apache?

+
+^ +
+
+

+ The mission + of the Apache XML Graphics Project is to promote the use of + XML-based graphics by “providing robust, full-featured, + commercial-quality, and freely available software packages for the + conversion of XML to graphical output and for related components”. + Batik as an open source implementation of a key format for today’s + and tomorrow’s web fits well in this mission. +

+
+ +

1.5. How does Batik relate to other Apache projects?

+
+^ +
+
+

+ Batik is used in Cocoon + for server side rasterization of SVG images. In addition, the Batik is used in the + FOP project to convert + SVG images to PDF format. +

+
+ +

1.6. How did it start?

+
+^ +
+
+

+ Batik started out because several teams doing SVG related projects decided to join + efforts with the idea that the whole will be greater than the sum of the parts. The + following companies or institutions are part of the team that contributed and/or + created the initial Batik project, during the fall of 2000: +

+ +

+ In addition, the Batik project is supported by IBM. +

+

+ We encourage anyone to participate. As with all ASF projects, all efforts are + volunteer-based. We are looking for individuals to work with us on + fulfilling our goals for Batik in the spirit of collaborative open-source + software development. +

+
+ +

1.7. Where is Batik going? What is next?

+
+^ +
+
+

+ The SVG implementation is not complete (see the current + status), and there is more work to + do to achieve a fully functional viewer. +

+

+ Batik 1.1 supports all static SVG features, + linking and a limited support for scripting, and the 1.5 release + completed support for scripting and dynamic documents. + With Batik 1.6 came many improvements to + the implementation of SVG DOM functions, bug fixes, performance + improvements, and the beginning of some SVG 1.2 support. + Declarative animation and further SVG 1.2 features + should be supported in the 2.0 release. +

+

+ The type of applications (e.g., transcoding applications) + that can or will be added to Batik depends on contributions + and feedback. +

+
+ +

1.8. How can I create and author SVG content?

+
+^ +
+
+

+ Well, you can always use a plain text editor such as vi or + xemacs, but there are many graphic authoring packages that can + export SVG documents and that will let you author SVG content + visually. +

+

+ You can get a list of tools exporting SVG from the SVG + implementation section of the SVG Home page on the W3C + web site. You can also imagine building a tool on top of + Batik: feel free to contribute! +

+

+ Authoring is one way of creating SVG content, and graphic + authoring packages are useful for that purpose. However, there + are many types of graphics which can be generated, such as + stock quotes, statistical data, etc. For these types of + graphics, there are many ways to generate SVG content. For + example, if your data (say stock information) is contained in + an XML document, you could use XSLT to transform your XML data + into SVG. If your data comes from a database and you retrieve + that data in a servlet on a Web server (e.g., using JDBC), you + could use the Java binding for the DOM API to generate an SVG + document from the database data. You could also use Batik’s + SVG generator and use the Java 2D API to generate that + graphic. +

+

+ The following URLs will be useful to learn more about each of + these solutions: +

+ +
+ +

1.9. What other SVG products are out there?

+
+^ +
+
+

+ There are many companies supporting SVG and you will find a list of + available implementations on the + W3C’s SVG + implementation page. +

+
+ +

1.10. Where can I find the SVG specification?

+
+^ +
+
+

+ The SVG specification is + available from the W3C web site. +

+
+ +

1.11. How much of SVG does Batik implement?

+
+^ +
+
+

+ The status page shows how much of the SVG + specification Batik implements by showing which of the tests in the + SVG Basic Effectivity test + suite Batik successfully passes. +

+
+ +

1.12. What are the benefits of SVG being an XML grammar?

+
+^ +
+
+

+ Being an XML grammar means SVG can leverage work done around + XML, and SVG actually leverages other grammars such as + XLink, + for linking and + SMIL + for the animation. +

+

+ Beyond the use and mix with other XML syntaxes, being an XML grammar + lets SVG benefit from the plethora of XML tools that make it so easy + to manipulate, generate, search and edit XML files. +

+
+ +

1.13. Where does the name come from?

+
+^ +
+
+

+ Batik is a highly evolved art tradition that developed in Java + (one of the islands comprising what is now called + Indonesia). Batik is generally thought of as the quintessentially + Indonesian textile. Motifs of flowers, twining plants, leaves, + buds, birds, butterflies, fish, insects and geometric forms are + rich in symbolic association and variety; there are about three + thousand recorded batik patterns. +

+

+ We think that Batik gracefully evokes Java, graphics and + high-quality, terms that constitute the core of the toolkit. +

+

+ +This page + shows examples of what Batik textures look like. +

+
+ +

2. Getting started with Apache Batik/SVG

+ +

2.1. What are the system requirements to run Batik?

+
+^ +
+
+

+ Batik is written in the Java language and requires a version 1.3 + implementation at this time. +

+
+ +

2.2. How do I install Batik?

+
+^ +
+
+

+ You will need the JDK 1.3 to run + Batik. +

+

+ To install Batik you need to download + the binary or source distribution and unzip it on your computer. +

+

+ You can have a look at the installation + instructions for more information. +

+
+ +

2.3. How can I see a demo?

+
+^ +
+
+

+ You can see an online demonstration of Squiggle the SVG + browser on the demo page. Alternatively, you + can download Batik or see + screenshots of the Batik SVG viewer, + images created from the rasterizer and + an example of how to use the + SVGGraphics2D generator. +

+
+ +

2.4. What scripting languages can I use in my SVG files?

+
+^ +
+
+

+ A limited support of scripting in SVG files is provided with + the current version of Batik (script are executed but dynamic + update is not supported). +

+

+ Batik can recognize the following scripting languages: +

+
    + +
  • + ECMAScript thanks to the + Mozilla Rhino JavaScript + engine included in the distribution, +
  • + +
  • + Python for which you need to download the + Jython engine, and +
  • + +
  • + Tcl for which you need to download the + Jacl engine. +
  • + +
+

+ To get more information on how to install optional + scripting languages you can have a look at the + installation instructions. +

+
+ +

3. Troubleshooting Apache Batik

+ +

3.1. + When I try to run Batik it results in a NoSuchMethodException. What + is the problem? +

+
+^ +
+
+

+ There is certainly something wrong with your classpath. Clear your + CLASSPATH environment variable and be sure to remove + all the libraries which use the W3C’s DOM bindings from + jre/lib/ext before running any of the Batik’s + applications. +

+
+ +

3.2. + When I change the document in Java it doesn’t update the + display, even if I call repaint? +

+
+^ +
+
+

+ There are two common causes for this. The first is that the + JSVGCanvas + doesn’t know it’s a dynamic document. Normally + Batik detects this by looking for script elements but when you + modify the document from Java it can’t tell. So call +

+
myJSVGCanvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
+

+ before loading the document (with setURI, + setDocument, setSVGDocument, etc.). +

+

+ The second common reason is that the changes aren’t made in + the + UpdateManager’s + thread. You can run code in the UpdateManager’s thread + with the following: +

+
UpdateManager um = JSVGCanvas.getUpdateManager();
+um.getUpdateRunnableQueue().invokeLater(Runnable);
+

+ +NOTE: The update manager only becomes + available after the first rendering completes. You can + be notified when this happens by registering a + GVTTreeRendererListener. +

+
+ +

3.3. + When I change the document in Java it only updates if I + move the mouse over the canvas? +

+
+^ +
+
+

+ The most common causes for this, is that the changes are not made in + the UpdateManager’s thread. See previous FAQ for + example code to run code in the Update Manager’s thread. Moving the + mouse works because it delivers the mouse move events in the update + thread, and after a runnable completes in the + UpdateManager’s thread it checks if the canvas needs + repainting. +

+
+ +

3.4. + When I create new SVG elements or modify some SVG attributes through + the DOM API, from ECMAScript, nothing happens, the changes are not + rendered. Why not? +

+
+^ +
+
+

+ A common problem is that script contain the wrong DOM calls + to create elements or modify attributes. +

+

+ SVG elements need to be created in the SVG namespace. For example, + to create a rect element, you should use +

+
document.createElementNS(svgNS, "rect");
+

+ (where svgNS is equal to + "http://www.w3.org/2000/svg"), which appropriately + creates the rect element in the SVG namespace. A call to +

+
document.createElement("rect")
+

+ creates an element with the name rect but which does not + belong to the SVG namespace. As such, it is ignored by Batik. +

+

+ Most SVG attributes belong to what is called the “per element type + partition namespace” (see the + Namespaces in XML + specification). The appropriate way to set attributes on an SVG + element is a call to setAttributeNS with a namespace + value of null, for example: +

+
elt.setAttributeNS(null, "width", "40");
+

+ In the Batik SVG DOM implementation, you can also use a call to + setAttribute and you can write +

+
elt.setAttribute("width", "40")
+

+ However, it is important to know that some implementations make a + difference between setAttribute(x, y) and + setAttributeNS(null, x, y), so it is goo practice + to use setAttributeNS which is the only guaranteed + interoperable way of setting attributes in a namespace aware DOM + implementation. +

+

+ Finally, for attributes which belong to a specific namespace, like the + the href attribute on the image element, + you have to use the setAttributeNS method with the + XLink namespace. For example, assuming img references an + image DOM Element, you can modify the + href as follows: +

+
img.setAttributeNS(xlinkNS, "xlink:href", "myImage.jpg");
+

+ where xlinkNS is equal to + "http://www.w3.org/1999/xlink". +

+

+ For more information on common authoring pitfalls, see Jonathan Watt’s + SVG Authoring + Guidelines. +

+
+ +

3.5. + When I get the UpdateManager from the canvas sometimes + it is null, why? +

+
+^ +
+
+

+ The JSVGCanvas is highly asynchronous so when you call + setURI, setDocument or + setSVGDocument they return essentially immediately. + Behind the scenes, the canvas creates the rendering tree and does a + first rendering after dispatching the document SVGLoad + event. Only after this first rendering does the + UpdateManger become available. +

+
+ +

3.6. + Why do I have to go through the UpdateManager to + run my code? Can’t you just synchronize the DOM? +

+
+^ +
+
+

+ It would be possible to synchronize individual calls to + the DOM, however in general this is almost useless for the + way DOM works. For example creating a single rectangle + element takes approximately 6 individual DOM calls. So + higher level synchronization is needed. +

+

+ The use of a + Runnable + is a common way of accomplishing synchronization for a block of code. + This is essentially the approach that Swing takes (all Swing + modification should take place in the Swing thread). It was + considered to use the Swing event thread, but this would lock the + user interface while scripts were working. +

+
+ +

3.7. + I can use the Batik extension tags with the source distribution + but not with the binary distribution. What am I missing? +

+
+^ +
+
+

+ When running from the source distribution you automatically get the + service provider entries for the Batik extension elements + (such as regularPolygon and star). + We chose not to include these by default in the + binary distribution for the Batik applications. +

+

+ There is a subdirectory called extensions that has jar + files that enable the extended elements from Batik. +

+
+ +

3.8. + Why do I get red circles when I view the samples/extensions files? +

+
+^ +
+
+

+ You are using the binary distribution. This distribution does not + include support for our example extensions (they are just examples + and other people can do more sophisticated things). +

+

+ If you want to view these examples you need to use the extension + enabled versions of the applications in the extensions + subdirectory. +

+
+ +

3.9. + I am modifying the DOM after displaying it in the JSVGCanvas, + but my changes aren’t shown (even if I call repaint). +

+
+^ +
+
+

+ For efficiency, if Batik loads a static document it doesn’t + set up any dynamic support. Batik normally decides whether a + document is dynamic by checking if it contains any + script elements or event handler attributes. However, + if your Java application is modifying the DOM directly there may be + no script elements. In this case you need to tell Batik to set up + dynamic support regardless. +

+

+ You can inform the JSVGCanvas that a document should + be handled dynamically by calling the setDocumentState + method, just before loading the document: +

+
JSVGCanvas myCanvas = ...;
+myCanvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
+myCanvas.setURI("myFile.svg");
+
+ +

3.10. + I am trying to use Batik and FOP together but Batik does not work and + fails on the org.w3c.* packages. What is happening? +

+
+^ +
+
+

+ Both FOP and Batik use the org.w3c.* packages. + Depending on the version of FOP and Batik, Batik has been using a + version of these packages which is more recent than the one in the + xml-apis.jar file FOP uses. However, if the + xml-apis.jar file that comes with the FOP distribution + is loaded before the Batik jar files, then the version coming with + FOP takes precedence (i.e., that is the version the Java Virtual + Machine loads). Because that version is incompatible with Batik, you + encounter this problem. +

+

+ The solution is to either repackage the xml-apis.jar file + with the classes in the Batik distribution (you will need the Batik + source distribution to do that), or you will need to make sure the + Batik jars are loaded before FOP’s xml-apis.jar, for + example by putting Batik’s jar file before FOP’s in your classpath. + If you are copying your jar files to .../jre/lib/ext, + you can simply remove the FOP xml-apis.jar file from + that directory. +

+
+ +

3.11. + How do I checkout the latest SVN version of Batik? +

+
+^ +
+
+

+ You just have to follow the instructions on the + download page. +

+
+ +

3.12. + I’m using Mac OS X, and some of the SVG files I view are messed up + (things appear clipped or out of place). What do I need to do to fix + this? +

+
+^ +
+
+

+ As of Mac OS X release 10.1.1 there still appears to be + problems in the Apple implementation of the Java 2D APIs. The + true source of these problems and/or workarounds have yet to be + identified (although the problems appear to be closely tied to a + “gstack underflow” error message from the Apple JVM). We are + interested in finding the source of these problems and + reasonable workarounds, so if you know what causes these errors + the Batik team would be very interested in hearing from you + (either directly or through the user/developer mailing lists). +

+

+ Other things to be aware of on Mac OS X, due to fixes for + other problems with Java 2D under Mac OS X, you may find that + some filtering operations take significantly more memory than on + other platforms. This will be especially true for deeply nested + filter trees (where the result of one filtering operation is + filtered by another filtering operation). +

+

+ Finally a few hints on avoiding problems under Mac OS X. The + bugs seems to be triggered by filters, and pure raster SVG documents + have not been found to cause problems. The use of the + filterRes attribute on the filter element + seems especially problematic. The bug isn’t 100% reproducible, so + while some content exhibits the problem, if you play with the + document enough it will often “fix” itself for a while, then later + it will go back to being broken (which indicates that the problem may + be some sort of race condition in the JVM). +

+
+ +

3.13. + I cannot run the Batik demo on Mac OS X (10.1.1). The Batik splash + screen hangs. What is happening? +

+
+^ +
+
+

+ The Batik demo uses Java Web Start. Java Web + Start (under the Applications/Utilities folder), lets + you start a Java application from a web browser. You can see the + debug traces by enabling the Java console for Java Web Start. If you + do, you will see that there is a + java.lang.NoSuchMethodError exception thrown. +

+

+ This is happening because the Java Web Start jar file + (javaws.jar in /Applications/Utilities/Java Web + Start/Content/MacOS) contains an older version of the DOM + bindings. +

+

+ One work around is to manually patch the javaws.jar + file to remove the DOM bindings so that they do not take precedence + over the Batik ones. +

+
+ +

4. How do I contribute to Batik Development?

+ +

4.1. How can I contribute to Apache Batik development?

+
+^ +
+
+

+ The Batik Project is an open volunteer project in the + spirit of the Apache + Software Foundation (ASF). This means that there are + many ways to contribute to the project, either with direct + participation (coding, documenting, answering questions, + proposing ideas, reporting bugs, suggesting bug-fixes, etc.) + or by resource donation (publicity, hardware, software, + conference presentations, speeches, etc.). Applications that + use the Batik modules, such as tools or extensions, are of special + interest to the project. +

+

+ The process for contributing to Batik is the same as for other + Java projects at Apache. A formal description of that process + can be found on the Jakarta + web site. You can also view a list of + who has contributed to Batik. +

+

+ For direct participation, we suggest that you subscribe to the + Batik mailing lists and to + checkout the + latest + code. +

+
+ +

4.2. How do I submit patches or bug fixes?

+
+^ +
+
+

+ You can submit bug fixes and patches to the + Batik developers + mailing list and you can enter bugs in + Bugzilla. +

+
+
+
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/images/batik.png b/bin/svg_kit/batik-1.7/docs/images/batik.png new file mode 100644 index 0000000..02c7008 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/images/batik.png differ diff --git a/bin/svg_kit/batik-1.7/docs/images/batikUses.jpg b/bin/svg_kit/batik-1.7/docs/images/batikUses.jpg new file mode 100644 index 0000000..67ae75b Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/images/batikUses.jpg differ diff --git a/bin/svg_kit/batik-1.7/docs/images/built-with-forrest-button.png b/bin/svg_kit/batik-1.7/docs/images/built-with-forrest-button.png new file mode 100644 index 0000000..4a787ab Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/images/built-with-forrest-button.png differ diff --git a/bin/svg_kit/batik-1.7/docs/images/group-logo.png b/bin/svg_kit/batik-1.7/docs/images/group-logo.png new file mode 100644 index 0000000..70eb879 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/images/group-logo.png differ diff --git a/bin/svg_kit/batik-1.7/docs/images/instruction_arrow.png b/bin/svg_kit/batik-1.7/docs/images/instruction_arrow.png new file mode 100644 index 0000000..0fbc724 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/images/instruction_arrow.png differ diff --git a/bin/svg_kit/batik-1.7/docs/index.html b/bin/svg_kit/batik-1.7/docs/index.html new file mode 100644 index 0000000..4f7c248 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/index.html @@ -0,0 +1,460 @@ + + + + + + + +Batik SVG Toolkit + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Batik SVG Toolkit

+ + + +

Overview

+
+

+ Batik is a Java-based toolkit for applications or applets that want to + use images in the Scalable Vector + Graphics (SVG) format for various purposes, such as display, + generation or manipulation. +

+

+ The project’s ambition is to give developers a set of + core modules that can be + used together or individually to support specific SVG solutions. + Examples of modules are the + SVG Parser, the + SVG Generator and the + SVG DOM. Another ambition for the Batik + project is to make it highly + extensible—for example, Batik + allows the developer to handle custom SVG elements. Even though the goal + of the project is to provide a set of core modules, one of the + deliverables is a full fledged SVG + browser implementation which validates the various modules and + their inter-operability. +

+
+ + + +

What Batik can be used for

+
+

+ +Batik use cases + With Batik, you can manipulate SVG documents anywhere Java is + available. You can also use the various + Batik modules to + generate, + manipulate and + transcode SVG images in your + applications or applets. +

+

+ Batik makes it easy for Java based applications or applets to + deal with SVG content. For example, using Batik’s + SVG generator module, + a Java application or applet can very easily export its + graphics into the SVG format. Using Batik’s + SVG viewing component, an application or + applet can very easily integrate SVG viewing and interaction + capabilities. Another possibility is to use Batik’s modules to convert + SVG to various formats, such as raster images + (JPEG, + PNG or + TIFF) or + other vector formats (WMF or + PDF, the latter two due + to the transcoder provided by + Apache FOP). +

+

+ The Batik toolkit includes the following: +

+

+Modules +

+ +

+Tools and applications +

+ +

+ See examples of projects and products using + Batik for real-life example of how Batik is already integrated in + projects and products. +

+
+ + + +

The SVG specification

+
+

+ Scalable Vector Graphics, SVG, is a W3C + Recommendation. It defines an XML grammar for rich 2D graphics + which includes features such as transparency, arbitrary geometry, filter + effects (shadows, lighting effects, etc.), scripting and animation. +

+

+ The SVG specification states: +

+

+ This specification defines the features and syntax for Scalable Vector + Graphics (SVG). SVG is a language for describing two-dimensional + graphics in XML [XML10]. SVG + allows for three types of graphic objects: vector graphic shapes (e.g., + paths consisting of straight lines and curves), images and text. + Graphical objects can be grouped, styled, transformed and composited + into previously rendered objects. The feature set includes nested + transformations, clipping paths, alpha masks, filter effects and + template objects. +

+

+ SVG documents can be interactive and dynamic. Animations can be defined + and triggered either declaratively (i.e., by embedding SVG animation + elements in SVG content) or via scripting. +

+
+ + + +

Implementation status

+
+

+ The latest revision of Batik, release 1.6, is a conformant + static + SVG implementation and supports + interactivity, + linking and + scripting features + of the SVG specification. The Batik project does not currently support + declarative + animation, + however work is currently underway to add it. +

+

+ See the status page for a detailed description + of the set of SVG features Batik supports. +

+
+ + + +

Download Batik

+
+

+ You can get the Batik distribution, source and binary, from the + download page. +

+
+
Note
+
+ All other libraries needed by Batik are included in the distribution. + As a consequence the Batik archive is quite big, but after you have + downloaded it, you will not need anything else. +
+
+ +
+
Security warning
+
+ +

+ This is a warning that a script security issue was reported in + the Batik Squiggle browser. Squiggle uses the Rhino scripting + engine and some features of that engine can be leveraged by + malicious scripts to gain access to otherwise protected + resources (like the file system). This issue was fixed in the + 1.5.1 release of Batik. If you are using a version of Batik older than + 1.5.1, you should upgrade. +

+ +
+
+
+ + +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/install.html b/bin/svg_kit/batik-1.7/docs/install.html new file mode 100644 index 0000000..5a7e171 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/install.html @@ -0,0 +1,630 @@ + + + + + + + +Installing Batik + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Installing Batik

+ + + +

System requirements

+
+

+ Batik requires the following to be already installed in your system: +

+
+ +
Java Runtime Environment
+ +
+ +

+ A Java 1.3 or above compatible runtime environment must be present. + Note that to support the following features a Java 1.4 or above + JRE is required: +

+ + + +
+ +
+
+ + + +

Choosing a distribution to download

+
+

+ To install Batik, you will need to go to the + download page and download one or more ZIP + file containing the distribution of your choice. It is good practice to + verify the integrity of the distribution files, + especially if you are using one of our mirror sites. Here are the + various components you will find in the download area and their intended + use: +

+
    + +
  • + +

    + +batik-version.zip (e.g., + batik-1.6.zip) +

    + +

    + The binary distribution contains compiled executable JAR + files that let you get started with Batik easily. This is the + recommended distribution if you want to look at Batik’s features, + or you want to experiment with SVG and see the fun things you can + do with Batik. The binary distribution comes with a set of sample + SVG files. +

    + +
  • + + +
  • + +

    + +batik-src-version.zip + (e.g., batik-src-1.6.zip) +

    + +

    + The source distribution contains a complete snapshot of the + Batik source code, documentation, regression tools and utilities as + well as the script for building Batik. That distribution is a + snapshot of the SVN repository. This is the recommended distribution + for developers who want to dive into the code and understand how + Batik can be integrated in their applications or how Batik can be + extended. +

    + +
  • + + +
  • + +

    + +batik-docs-version.zip + (e.g., batik-docs-1.6.zip) +

    + +

    + The documentation bundle contains a copy of + the Javadoc for the Batik source code. +

    + +
  • + +
+

+ We make nightly copies of the source tree available from the + Apache + build server. These builds represent the current state of + development and may or may not be as stable as releases. + There are two types of distributions provided: +

+
    + +
  • + +

    + +batik-svn-date.zip + (e.g., batik-svn-06-03-29.zip) +

    + +

    + This contains a complete copy of the Subversion repository trunk, + including support for running regard, + Batik’s regression testing utility. In particular this includes all + the reference images for testing. Developers are encouraged to get + these or better use Subversion + directly. +

    + +
  • + +
  • + +

    + +batik-src-date.zip + (e.g., batik-src-06-03-29.zip) +

    + +

    + This contains all the source code and libraries needed to + build and run Batik from source, but does not include the + testing facilities. +

    + +
  • + +
+

+ Older releases are available from the + Apache archives. + However, we strongly recommend using the current release of Batik. +

+

In all cases, the user should:

+
    + +
  • + Make sure a Java Development Kit (JDK) is installed on the computer + where Batik will be installed. See the + system requirements. Make sure + that the java runtime is in the PATH + environment variable. +
  • + +
  • + Select the directory where he/she wants to download the distribution. +
  • + +
  • + Download the desired distribution from the + download page. +
  • + +
  • + Download the associated PGP signature (.asc) and KEYS file + (preferable) or MD5 hash (.md5). This must be done directly from the + Apache + download area to mean anything. +
  • + +
  • + Open a console and go to the directory where the distribution was + downloaded. +
  • + +
  • + +Verify the integrity of the distribution. +
  • + +
  • + +

    + Unpack the distribution with Java’s JAR utility: +

    + +
    jar xvf <distribution>
    + +

    + For example, if you have downloaded batik-1.6.zip into + /home/IamHere, type the following at the command prompt: +

    + +
    cd /home/IamHere
    +jar xvf batik-1.6.zip
    + +

    + +IMPORTANT: UNIX users, do not use the + unzip utility to unpack the various Batik zip files, + as this would not set the directories access rights properly. +

    + +
  • + +
  • + +

    + If you are using Mac OS X, you can now generate an application + bundle for Squiggle, Batik's SVG browser: +

    + +
    sh lib/make-squiggle-app.sh
    + +

    + After running this script, a Finder window will be opened where + you can find the generated Squiggle application bundle. Drag + this to your Applications folder to install it. +

    + +
  • + +
  • + Now you can follow the instructions specific to the application you + want to use. For example, see the SVG + Browser page or the SVG + Rasterizer page for an explanation on how to use these tools. +
  • + +
+
+ + + +

Optional components

+
+

+ By default, the Batik source distribution comes with the + Mozilla Rhino JavaScript + Engine (js.jar). +

+

+ To enable other scripting languages support, you will only need to + install the correct jar files in lib directory of Batik and + recompile your distribution. +

+
    + +
  • + For Python, you need to download Jython distribution at + http://www.jython.org/. Then + you put the jython.jar file in the Batik lib + directory. +
  • + +
  • + For Tcl, you need to download Jacl & TclBlend distribution at + http://dev.scriptics.com/software/java/. + Then you put the jacl.jar and tcljava.jar + files in the Batik lib directory. +
  • + +
+

+ Conversely, you can remove the js.jar of the Batik + lib directory to remove JavaScript support and have a + smaller distribution. +

+
+ + + +

Jar file dependency graph

+
+

+ The Batik distribution comes with many jar files. Not all of them are + needed in every case (although the provided applications tend to use + most of them). The following is a diagram showing the dependencies + between the various jar files in the Batik binary distribution (it also + shows the major package interdependencies for source developers). +

+

+ Jar files in white boxes are library jar files that Batik includes from + external sources. The light blue boxes correspond to library jar files + (those found in the lib directory of a binary distribution) + built from Batik source code. The dark blue boxes represent the + application jar files. +

+

+ When boxes touch, the box on top depends on the box below it (there is + no horizontal touching). Arrows also indicate dependencies (the source + of the arrow depends on the destination). In some cases a thick + underline with an arrow is used to indicate that a large number of jar + files share a common dependency, this however does not indicate any + dependency between the jar files underlined. +

+
+Batik jar file dependency graph
+
+
Note
+
+ Some jar file names are shortened for clarity. All batik + package references are short for org.apache.batik. +
+
+

+ It is worth pointing out that a determined/clever programmer may be able + to pare down some of these dependencies. For example the + batik-dom.jar depends on xerces.jar because of + the SAXDocumentFactory class in + org.apache.batik.dom.util. If you didn’t need to parse XML + it would be possible to ignore or break this dependency and still use + the batik-dom.jar file for its DOM implementation. +

+
+ + + +

Verify releases

+
+

+ It is essential that you verify the integrity of the downloaded files + using the PGP or MD5 signatures. +

+

+ The PGP signatures can be verified using PGP or GPG. First download the + KEYS as well as + the asc signature file for the particular distribution you + choose. Make sure you get these files from the + main distribution + directory, rather than from a mirror. Then verify the signatures + using: +

+
pgpk -a KEYS
+pgpv batik-1.6.zip.asc
+

+or +

+
pgp -ka KEYS
+pgp batik-1.6.zip.asc
+or +
+
gpg --import KEYS
+pgp batik-1.6.zip.asc
+

+or +

+
gpg --import KEYS
+gpg --verify batik-1.6.zip.asc
+

+ Alternatively, you can verify the MD5 signature on the files. A UNIX + program called md5 or md5sum is included in + many UNIX distributions. It is also available as part of + GNU + Textutils. Windows users can get binary md5 programs + from here, + here, + or here. +

+

+ We recommend using PGP signatures as they can provide a much higher + level of assurance compared with MD5. +

+
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/jarDependImg.png b/bin/svg_kit/batik-1.7/docs/jarDependImg.png new file mode 100644 index 0000000..6e27d70 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/jarDependImg.png differ diff --git a/bin/svg_kit/batik-1.7/docs/license.html b/bin/svg_kit/batik-1.7/docs/license.html new file mode 100644 index 0000000..8c57df1 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/license.html @@ -0,0 +1,448 @@ + + + + + + + +Batik License + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Batik License

+ +

+ Batik is licensed according to the Apache License, Version 2.0, the + text of which is included below. +

+ +
+ +
+                                  Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ +
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/linkmap.html b/bin/svg_kit/batik-1.7/docs/linkmap.html new file mode 100644 index 0000000..459e16b --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/linkmap.html @@ -0,0 +1,705 @@ + + + + + + + +Site Linkmap + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Site Linkmap

+ +

Table of Contents

+
+
    +
  • +Batik   _________________________  site +
  • +
      + + +
        +
      • +Project   _________________________  project +
      • +
          + +
            +
          • +Overview   _________________________  index +
          • +
          + + +
            +
          • +License   _________________________  license +
          • +
          + +
            +
          • +Download   _________________________  download +
          • +
          + + + +
            +
          • +Status   _________________________  status +
          • +
          + +
            +
          • +Demo   _________________________  demo +
          • +
          + +
            +
          • +FAQs   _________________________  faq +
          • +
          + +
            +
          • +Mailing lists   _________________________  mailing-lists +
          • +
          + +
            +
          • +Contributors   _________________________  contributors +
          • +
          + + + + + +
        +
      + + + + + +
        +
      • +Tools   _________________________  tools +
      • +
          + + + +
            +
          • +Browser   _________________________  browser +
          • +
          + +
            +
          • +Rasterizer   _________________________  rasterizer +
          • +
          + +
            +
          • +Font converter   _________________________  font-converter +
          • +
          + +
            +
          • +Pretty printer   _________________________  pretty-printer +
          • +
          + +
        +
      + + +
        +
      • +Using Batik   _________________________  using +
      • +
          + +
            +
          • +Index   _________________________  modules +
          • +
          + +
            +
          • +Architecture   _________________________  architecture +
          • +
          + +
            +
          • +Javadoc APIs   _________________________  javadoc +
          • +
          + + +
            +
          • +DOM API   _________________________  dom-api +
          • +
          + +
            +
          • +Parsers   _________________________  parsers +
          • +
          + + + +
            +
          • +SVG generator   _________________________  generator +
          • +
          + + + + + + + + +
        +
      + + +
        +
      • +Development   _________________________  development +
      • +
          + +
            +
          • +Index   _________________________  current +
          • +
          + +
            +
          • +Branches   _________________________  branches +
          • +
          + + + + + + +
        +
      + +
    +
+
+
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/mailing-lists.html b/bin/svg_kit/batik-1.7/docs/mailing-lists.html new file mode 100644 index 0000000..0240657 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/mailing-lists.html @@ -0,0 +1,351 @@ + + + + + + + +Mailing Lists + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Mailing Lists

+ + +
+
Important notice
+
+ +

+ Before posting a question or problem to any mailing list, please first + look at the following resources in this order: +

+ +
    + +
  1. +Batik FAQs +
  2. + +
  3. Batik users list archive (check links below)
  4. + +
  5. Batik development list archive (check links below)
  6. + +
+ +
+
+ + + +

Batik users list

+
+

+ +batik-users@xmlgraphics.apache.org + +

+

+ (Subscribe, + Unsubscribe) +

+

+Archives: +

+ +

+ This is the general Batik list, for problems using Batik, bug reports, + etc. This is not an appropriate list for general SVG questions. You + might try the public SVG mailing + list for specification related questions, or the + SVG Developers list + for general help with SVG. +

+

+ +Important: If you are posting about a problem you are + having (as most people do), please provide details about the system + configuration (operating system, JDK version, window manager, etc.), + and detailed information about the problem such as any available stack + trace or, ideally, a test case that isolates the problem. This will help + get a quick resolution. +

+
+ + + +

Batik development list

+
+

+ +batik-dev@xmlgraphics.apache.org + +

+

+ (Subscribe, + Unsubscribe) +

+

+Archives: +

+ +

+ This list is for developers working on or wanting to work on + Batik itself (not developers merely working with Batik), for + patches to Batik to be posted, etc. +

+
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/skin/CommonMessages_de.xml b/bin/svg_kit/batik-1.7/docs/skin/CommonMessages_de.xml new file mode 100644 index 0000000..bc46119 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/CommonMessages_de.xml @@ -0,0 +1,23 @@ + + + + Schriftgrsse: + Zuletzt verffentlicht: + Suche: + Suche auf der Seite mit + diff --git a/bin/svg_kit/batik-1.7/docs/skin/CommonMessages_en_US.xml b/bin/svg_kit/batik-1.7/docs/skin/CommonMessages_en_US.xml new file mode 100644 index 0000000..88dfe14 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/CommonMessages_en_US.xml @@ -0,0 +1,23 @@ + + + + Font size: + Last Published: + Search + Search site with + diff --git a/bin/svg_kit/batik-1.7/docs/skin/CommonMessages_es.xml b/bin/svg_kit/batik-1.7/docs/skin/CommonMessages_es.xml new file mode 100644 index 0000000..a3bdc49 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/CommonMessages_es.xml @@ -0,0 +1,24 @@ + + + + Tamao del texto: + Fecha de publicacin: + Buscar + Buscar en + + diff --git a/bin/svg_kit/batik-1.7/docs/skin/CommonMessages_fr.xml b/bin/svg_kit/batik-1.7/docs/skin/CommonMessages_fr.xml new file mode 100644 index 0000000..622569a --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/CommonMessages_fr.xml @@ -0,0 +1,23 @@ + + + + Taille : + Dernire publication : + Rechercher + Rechercher sur le site avec + diff --git a/bin/svg_kit/batik-1.7/docs/skin/basic.css b/bin/svg_kit/batik-1.7/docs/skin/basic.css new file mode 100644 index 0000000..eb24c32 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/basic.css @@ -0,0 +1,166 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** + * General + */ + +img { border: 0; } + +#content table { + border: 0; + width: 100%; +} +/*Hack to get IE to render the table at 100%*/ +* html #content table { margin-left: -3px; } + +#content th, +#content td { + margin: 0; + padding: 0; + vertical-align: top; +} + +.clearboth { + clear: both; +} + +.note, .warning, .fixme { + border: solid black 1px; + margin: 1em 3em; +} + +.note .label { + background: #369; + color: white; + font-weight: bold; + padding: 5px 10px; +} +.note .content { + background: #F0F0FF; + color: black; + line-height: 120%; + font-size: 90%; + padding: 5px 10px; +} +.warning .label { + background: #C00; + color: white; + font-weight: bold; + padding: 5px 10px; +} +.warning .content { + background: #FFF0F0; + color: black; + line-height: 120%; + font-size: 90%; + padding: 5px 10px; +} +.fixme .label { + background: #C6C600; + color: black; + font-weight: bold; + padding: 5px 10px; +} +.fixme .content { + padding: 5px 10px; +} + +/** + * Typography + */ + +body { + font-family: verdana, "Trebuchet MS", arial, helvetica, sans-serif; + font-size: 100%; +} + +#content { + font-family: Georgia, Palatino, Times, serif; + font-size: 95%; +} +#tabs { + font-size: 70%; +} +#menu { + font-size: 80%; +} +#footer { + font-size: 70%; +} + +h1, h2, h3, h4, h5, h6 { + font-family: "Trebuchet MS", verdana, arial, helvetica, sans-serif; + font-weight: bold; + margin-top: 1em; + margin-bottom: .5em; +} + +h1 { + margin-top: 0; + margin-bottom: 1em; + font-size: 1.4em; +} +#content h1 { + font-size: 160%; + margin-bottom: .5em; +} +#menu h1 { + margin: 0; + padding: 10px; + background: #336699; + color: white; +} +h2 { font-size: 120%; } +h3 { font-size: 100%; } +h4 { font-size: 90%; } +h5 { font-size: 80%; } +h6 { font-size: 75%; } + +p { + line-height: 120%; + text-align: left; + margin-top: .5em; + margin-bottom: 1em; +} + +#content li, +#content th, +#content td, +#content li ul, +#content li ol{ + margin-top: .5em; + margin-bottom: .5em; +} + + +#content li li, +#minitoc-area li{ + margin-top: 0em; + margin-bottom: 0em; +} + +#content .attribution { + text-align: right; + font-style: italic; + font-size: 85%; + margin-top: 1em; +} + +.codefrag { + font-family: "Courier New", Courier, monospace; + font-size: 110%; +} \ No newline at end of file diff --git a/bin/svg_kit/batik-1.7/docs/skin/breadcrumbs-optimized.js b/bin/svg_kit/batik-1.7/docs/skin/breadcrumbs-optimized.js new file mode 100644 index 0000000..507612a --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/breadcrumbs-optimized.js @@ -0,0 +1,90 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +var PREPREND_CRUMBS=new Array(); +var link1="@skinconfig.trail.link1.name@"; +var link2="@skinconfig.trail.link2.name@"; +var link3="@skinconfig.trail.link3.name@"; +if(!(link1=="")&&!link1.indexOf( "@" ) == 0){ + PREPREND_CRUMBS.push( new Array( link1, @skinconfig.trail.link1.href@ ) ); } +if(!(link2=="")&&!link2.indexOf( "@" ) == 0){ + PREPREND_CRUMBS.push( new Array( link2, @skinconfig.trail.link2.href@ ) ); } +if(!(link3=="")&&!link3.indexOf( "@" ) == 0){ + PREPREND_CRUMBS.push( new Array( link3, @skinconfig.trail.link3.href@ ) ); } +var DISPLAY_SEPARATOR=" > "; +var DISPLAY_PREPREND=" > "; +var DISPLAY_POSTPREND=":"; +var CSS_CLASS_CRUMB="breadcrumb"; +var CSS_CLASS_TRAIL="breadcrumbTrail"; +var CSS_CLASS_SEPARATOR="crumbSeparator"; +var FILE_EXTENSIONS=new Array( ".html", ".htm", ".jsp", ".php", ".php3", ".php4" ); +var PATH_SEPARATOR="/"; + +function sc(s) { + var l=s.toLowerCase(); + return l.substr(0,1).toUpperCase()+l.substr(1); +} +function getdirs() { + var t=document.location.pathname.split(PATH_SEPARATOR); + var lc=t[t.length-1]; + for(var i=0;i < FILE_EXTENSIONS.length;i++) + { + if(lc.indexOf(FILE_EXTENSIONS[i])) + return t.slice(1,t.length-1); } + return t.slice(1,t.length); +} +function getcrumbs( d ) +{ + var pre = "/"; + var post = "/"; + var c = new Array(); + if( d != null ) + { + for(var i=0;i < d.length;i++) { + pre+=d[i]+postfix; + c.push(new Array(d[i],pre)); } + } + if(PREPREND_CRUMBS.length > 0 ) + return PREPREND_CRUMBS.concat( c ); + return c; +} +function gettrail( c ) +{ + var h=DISPLAY_PREPREND; + for(var i=0;i < c.length;i++) + { + h+=''+sc(c[i][0])+''; + if(i!=(c.length-1)) + h+=DISPLAY_SEPARATOR; } + return h+DISPLAY_POSTPREND; +} + +function gettrailXHTML( c ) +{ + var h=''+DISPLAY_PREPREND; + for(var i=0;i < c.length;i++) + { + h+=''+sc(c[i][0])+''; + if(i!=(c.length-1)) + h+=''+DISPLAY_SEPARATOR+''; } + return h+DISPLAY_POSTPREND+''; +} + +if(document.location.href.toLowerCase().indexOf("http://")==-1) + document.write(gettrail(getcrumbs())); +else + document.write(gettrail(getcrumbs(getdirs()))); + diff --git a/bin/svg_kit/batik-1.7/docs/skin/breadcrumbs.js b/bin/svg_kit/batik-1.7/docs/skin/breadcrumbs.js new file mode 100644 index 0000000..aea80ec --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/breadcrumbs.js @@ -0,0 +1,237 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** + * This script, when included in a html file, builds a neat breadcrumb trail + * based on its url. That is, if it doesn't contains bugs (I'm relatively + * sure it does). + * + * Typical usage: + * + */ + +/** + * IE 5 on Mac doesn't know Array.push. + * + * Implement it - courtesy to fritz. + */ +var abc = new Array(); +if (!abc.push) { + Array.prototype.push = function(what){this[this.length]=what} +} + +/* ======================================================================== + CONSTANTS + ======================================================================== */ + +/** + * Two-dimensional array containing extra crumbs to place at the front of + * the trail. Specify first the name of the crumb, then the URI that belongs + * to it. You'll need to modify this for every domain or subdomain where + * you use this script (you can leave it as an empty array if you wish) + */ +var PREPREND_CRUMBS = new Array(); + +var link1 = "@skinconfig.trail.link1.name@"; +var link2 = "@skinconfig.trail.link2.name@"; +var link3 = "@skinconfig.trail.link3.name@"; + +var href1 = "@skinconfig.trail.link1.href@"; +var href2 = "@skinconfig.trail.link2.href@"; +var href3 = "@skinconfig.trail.link3.href@"; + + if(!(link1=="")&&!link1.indexOf( "@" ) == 0){ + PREPREND_CRUMBS.push( new Array( link1, href1 ) ); + } + if(!(link2=="")&&!link2.indexOf( "@" ) == 0){ + PREPREND_CRUMBS.push( new Array( link2, href2 ) ); + } + if(!(link3=="")&&!link3.indexOf( "@" ) == 0){ + PREPREND_CRUMBS.push( new Array( link3, href3 ) ); + } + +/** + * String to include between crumbs: + */ +var DISPLAY_SEPARATOR = " > "; +/** + * String to include at the beginning of the trail + */ +var DISPLAY_PREPREND = " > "; +/** + * String to include at the end of the trail + */ +var DISPLAY_POSTPREND = ""; + +/** + * CSS Class to use for a single crumb: + */ +var CSS_CLASS_CRUMB = "breadcrumb"; + +/** + * CSS Class to use for the complete trail: + */ +var CSS_CLASS_TRAIL = "breadcrumbTrail"; + +/** + * CSS Class to use for crumb separator: + */ +var CSS_CLASS_SEPARATOR = "crumbSeparator"; + +/** + * Array of strings containing common file extensions. We use this to + * determine what part of the url to ignore (if it contains one of the + * string specified here, we ignore it). + */ +var FILE_EXTENSIONS = new Array( ".html", ".htm", ".jsp", ".php", ".php3", ".php4" ); + +/** + * String that separates parts of the breadcrumb trail from each other. + * When this is no longer a slash, I'm sure I'll be old and grey. + */ +var PATH_SEPARATOR = "/"; + +/* ======================================================================== + UTILITY FUNCTIONS + ======================================================================== */ +/** + * Capitalize first letter of the provided string and return the modified + * string. + */ +function sentenceCase( string ) +{ return string; + //var lower = string.toLowerCase(); + //return lower.substr(0,1).toUpperCase() + lower.substr(1); +} + +/** + * Returns an array containing the names of all the directories in the + * current document URL + */ +function getDirectoriesInURL() +{ + var trail = document.location.pathname.split( PATH_SEPARATOR ); + + // check whether last section is a file or a directory + var lastcrumb = trail[trail.length-1]; + for( var i = 0; i < FILE_EXTENSIONS.length; i++ ) + { + if( lastcrumb.indexOf( FILE_EXTENSIONS[i] ) ) + { + // it is, remove it and send results + return trail.slice( 1, trail.length-1 ); + } + } + + // it's not; send the trail unmodified + return trail.slice( 1, trail.length ); +} + +/* ======================================================================== + BREADCRUMB FUNCTIONALITY + ======================================================================== */ +/** + * Return a two-dimensional array describing the breadcrumbs based on the + * array of directories passed in. + */ +function getBreadcrumbs( dirs ) +{ + var prefix = "/"; + var postfix = "/"; + + // the array we will return + var crumbs = new Array(); + + if( dirs != null ) + { + for( var i = 0; i < dirs.length; i++ ) + { + prefix += dirs[i] + postfix; + crumbs.push( new Array( dirs[i], prefix ) ); + } + } + + // preprend the PREPREND_CRUMBS + if(PREPREND_CRUMBS.length > 0 ) + { + return PREPREND_CRUMBS.concat( crumbs ); + } + + return crumbs; +} + +/** + * Return a string containing a simple text breadcrumb trail based on the + * two-dimensional array passed in. + */ +function getCrumbTrail( crumbs ) +{ + var xhtml = DISPLAY_PREPREND; + + for( var i = 0; i < crumbs.length; i++ ) + { + xhtml += ''; + xhtml += unescape( crumbs[i][0] ) + ''; + if( i != (crumbs.length-1) ) + { + xhtml += DISPLAY_SEPARATOR; + } + } + + xhtml += DISPLAY_POSTPREND; + + return xhtml; +} + +/** + * Return a string containing an XHTML breadcrumb trail based on the + * two-dimensional array passed in. + */ +function getCrumbTrailXHTML( crumbs ) +{ + var xhtml = ''; + xhtml += DISPLAY_PREPREND; + + for( var i = 0; i < crumbs.length; i++ ) + { + xhtml += ''; + xhtml += unescape( crumbs[i][0] ) + ''; + if( i != (crumbs.length-1) ) + { + xhtml += '' + DISPLAY_SEPARATOR + ''; + } + } + + xhtml += DISPLAY_POSTPREND; + xhtml += ''; + + return xhtml; +} + +/* ======================================================================== + PRINT BREADCRUMB TRAIL + ======================================================================== */ + +// check if we're local; if so, only print the PREPREND_CRUMBS +if( document.location.href.toLowerCase().indexOf( "http://" ) == -1 ) +{ + document.write( getCrumbTrail( getBreadcrumbs() ) ); +} +else +{ + document.write( getCrumbTrail( getBreadcrumbs( getDirectoriesInURL() ) ) ); +} + diff --git a/bin/svg_kit/batik-1.7/docs/skin/fontsize.js b/bin/svg_kit/batik-1.7/docs/skin/fontsize.js new file mode 100644 index 0000000..11722bf --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/fontsize.js @@ -0,0 +1,166 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +function init() +{ //embedded in the doc + //ndeSetTextSize(); +} + +function checkBrowser(){ + if (!document.getElementsByTagName){ + return true; + } + else{ + return false; + } +} + + +function ndeSetTextSize(chgsize,rs) +{ + var startSize; + var newSize; + + if (!checkBrowser) + { + return; + } + + startSize = parseInt(ndeGetDocTextSize()); + + if (!startSize) + { + startSize = 16; + } + + switch (chgsize) + { + case 'incr': + newSize = startSize + 2; + break; + + case 'decr': + newSize = startSize - 2; + break; + + case 'reset': + if (rs) {newSize = rs;} else {newSize = 16;} + break; + + default: + try{ + newSize = parseInt(ndeReadCookie("nde-textsize")); + } + catch(e){ + alert(e); + } + + if (!newSize || newSize == 'NaN') + { + newSize = startSize; + } + break; + + } + + if (newSize < 10) + { + newSize = 10; + } + + newSize += 'px'; + + document.getElementsByTagName('html')[0].style.fontSize = newSize; + document.getElementsByTagName('body')[0].style.fontSize = newSize; + + ndeCreateCookie("nde-textsize", newSize, 365); +} + +function ndeGetDocTextSize() +{ + if (!checkBrowser) + { + return 0; + } + + var size = 0; + var body = document.getElementsByTagName('body')[0]; + + if (body.style && body.style.fontSize) + { + size = body.style.fontSize; + } + else if (typeof(getComputedStyle) != 'undefined') + { + size = getComputedStyle(body,'').getPropertyValue('font-size'); + } + else if (body.currentStyle) + { + size = body.currentStyle.fontSize; + } + + //fix IE bug + if( isNaN(size)){ + if(size.substring(size.length-1)=="%"){ + return + } + + } + + return size; + +} + + + +function ndeCreateCookie(name,value,days) +{ + var cookie = name + "=" + value + ";"; + + if (days) + { + var date = new Date(); + date.setTime(date.getTime()+(days*24*60*60*1000)); + cookie += " expires=" + date.toGMTString() + ";"; + } + cookie += " path=/"; + + document.cookie = cookie; + +} + +function ndeReadCookie(name) +{ + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + + + for(var i = 0; i < ca.length; i++) + { + var c = ca[i]; + while (c.charAt(0) == ' ') + { + c = c.substring(1, c.length); + } + + ctest = c.substring(0,name.length); + + if(ctest == name){ + return c.substring(nameEQ.length,c.length); + } + } + return null; +} diff --git a/bin/svg_kit/batik-1.7/docs/skin/getBlank.js b/bin/svg_kit/batik-1.7/docs/skin/getBlank.js new file mode 100644 index 0000000..d9978c0 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/getBlank.js @@ -0,0 +1,40 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** + * getBlank script - when included in a html file and called from a form text field, will set the value of this field to "" + * if the text value is still the standard value. + * getPrompt script - when included in a html file and called from a form text field, will set the value of this field to the prompt + * if the text value is empty. + * + * Typical usage: + * + * + */ + diff --git a/bin/svg_kit/batik-1.7/docs/skin/getMenu.js b/bin/svg_kit/batik-1.7/docs/skin/getMenu.js new file mode 100644 index 0000000..b17aad6 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/getMenu.js @@ -0,0 +1,45 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** + * This script, when included in a html file, can be used to make collapsible menus + * + * Typical usage: + * + */ + +if (document.getElementById){ + document.write('') +} + + +function SwitchMenu(obj, thePath) +{ +var open = 'url("'+thePath + 'images/chapter_open.gif")'; +var close = 'url("'+thePath + 'images/chapter.gif")'; + if(document.getElementById) { + var el = document.getElementById(obj); + var title = document.getElementById(obj+'Title'); + + if(el.style.display != "block"){ + title.style.backgroundImage = open; + el.style.display = "block"; + }else{ + title.style.backgroundImage = close; + el.style.display = "none"; + } + }// end - if(document.getElementById) +}//end - function SwitchMenu(obj) diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/README.txt b/bin/svg_kit/batik-1.7/docs/skin/images/README.txt new file mode 100644 index 0000000..e0932f4 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/images/README.txt @@ -0,0 +1 @@ +The images in this directory are used if the current skin lacks them. diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/add.jpg b/bin/svg_kit/batik-1.7/docs/skin/images/add.jpg new file mode 100644 index 0000000..06831ee Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/add.jpg differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/built-with-forrest-button.png b/bin/svg_kit/batik-1.7/docs/skin/images/built-with-forrest-button.png new file mode 100644 index 0000000..4a787ab Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/built-with-forrest-button.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/chapter.gif b/bin/svg_kit/batik-1.7/docs/skin/images/chapter.gif new file mode 100644 index 0000000..d3d8245 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/chapter.gif differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/chapter_open.gif b/bin/svg_kit/batik-1.7/docs/skin/images/chapter_open.gif new file mode 100644 index 0000000..eecce18 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/chapter_open.gif differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/current.gif b/bin/svg_kit/batik-1.7/docs/skin/images/current.gif new file mode 100644 index 0000000..fd82c08 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/current.gif differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/error.png b/bin/svg_kit/batik-1.7/docs/skin/images/error.png new file mode 100644 index 0000000..b4fe06e Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/error.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/external-link.gif b/bin/svg_kit/batik-1.7/docs/skin/images/external-link.gif new file mode 100644 index 0000000..ff2f7b2 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/external-link.gif differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/fix.jpg b/bin/svg_kit/batik-1.7/docs/skin/images/fix.jpg new file mode 100644 index 0000000..1d6820b Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/fix.jpg differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/forrest-credit-logo.png b/bin/svg_kit/batik-1.7/docs/skin/images/forrest-credit-logo.png new file mode 100644 index 0000000..8a63e42 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/forrest-credit-logo.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/hack.jpg b/bin/svg_kit/batik-1.7/docs/skin/images/hack.jpg new file mode 100644 index 0000000..f38d50f Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/hack.jpg differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/header_white_line.gif b/bin/svg_kit/batik-1.7/docs/skin/images/header_white_line.gif new file mode 100644 index 0000000..369cae8 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/header_white_line.gif differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/info.png b/bin/svg_kit/batik-1.7/docs/skin/images/info.png new file mode 100644 index 0000000..2e53447 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/info.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/instruction_arrow.png b/bin/svg_kit/batik-1.7/docs/skin/images/instruction_arrow.png new file mode 100644 index 0000000..0fbc724 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/instruction_arrow.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/label.gif b/bin/svg_kit/batik-1.7/docs/skin/images/label.gif new file mode 100644 index 0000000..c83a389 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/label.gif differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/page.gif b/bin/svg_kit/batik-1.7/docs/skin/images/page.gif new file mode 100644 index 0000000..a144d32 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/page.gif differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/pdfdoc.gif b/bin/svg_kit/batik-1.7/docs/skin/images/pdfdoc.gif new file mode 100644 index 0000000..ec13eb5 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/pdfdoc.gif differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/poddoc.png b/bin/svg_kit/batik-1.7/docs/skin/images/poddoc.png new file mode 100644 index 0000000..a393df7 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/poddoc.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/printer.gif b/bin/svg_kit/batik-1.7/docs/skin/images/printer.gif new file mode 100644 index 0000000..a8d0d41 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/printer.gif differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/rc-b-l-15-1body-2menu-3menu.png b/bin/svg_kit/batik-1.7/docs/skin/images/rc-b-l-15-1body-2menu-3menu.png new file mode 100644 index 0000000..06bd7f3 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/rc-b-l-15-1body-2menu-3menu.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/rc-b-r-15-1body-2menu-3menu.png b/bin/svg_kit/batik-1.7/docs/skin/images/rc-b-r-15-1body-2menu-3menu.png new file mode 100644 index 0000000..4e11e03 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/rc-b-r-15-1body-2menu-3menu.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/rc-b-r-5-1header-2tab-selected-3tab-selected.png b/bin/svg_kit/batik-1.7/docs/skin/images/rc-b-r-5-1header-2tab-selected-3tab-selected.png new file mode 100644 index 0000000..da5d64d Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/rc-b-r-5-1header-2tab-selected-3tab-selected.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-l-5-1header-2searchbox-3searchbox.png b/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-l-5-1header-2searchbox-3searchbox.png new file mode 100644 index 0000000..aef23cf Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-l-5-1header-2searchbox-3searchbox.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-l-5-1header-2tab-selected-3tab-selected.png b/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-l-5-1header-2tab-selected-3tab-selected.png new file mode 100644 index 0000000..aef23cf Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-l-5-1header-2tab-selected-3tab-selected.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-l-5-1header-2tab-unselected-3tab-unselected.png b/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-l-5-1header-2tab-unselected-3tab-unselected.png new file mode 100644 index 0000000..298b291 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-l-5-1header-2tab-unselected-3tab-unselected.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-r-15-1body-2menu-3menu.png b/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-r-15-1body-2menu-3menu.png new file mode 100644 index 0000000..5c19262 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-r-15-1body-2menu-3menu.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-r-5-1header-2searchbox-3searchbox.png b/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-r-5-1header-2searchbox-3searchbox.png new file mode 100644 index 0000000..9057db2 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-r-5-1header-2searchbox-3searchbox.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-r-5-1header-2tab-selected-3tab-selected.png b/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-r-5-1header-2tab-selected-3tab-selected.png new file mode 100644 index 0000000..9057db2 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-r-5-1header-2tab-selected-3tab-selected.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-r-5-1header-2tab-unselected-3tab-unselected.png b/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-r-5-1header-2tab-unselected-3tab-unselected.png new file mode 100644 index 0000000..09212c2 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/rc-t-r-5-1header-2tab-unselected-3tab-unselected.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/remove.jpg b/bin/svg_kit/batik-1.7/docs/skin/images/remove.jpg new file mode 100644 index 0000000..8c9b9ef Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/remove.jpg differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/rss.png b/bin/svg_kit/batik-1.7/docs/skin/images/rss.png new file mode 100644 index 0000000..f0796ac Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/rss.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/spacer.gif b/bin/svg_kit/batik-1.7/docs/skin/images/spacer.gif new file mode 100644 index 0000000..35d42e8 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/spacer.gif differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/success.png b/bin/svg_kit/batik-1.7/docs/skin/images/success.png new file mode 100644 index 0000000..96fcfea Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/success.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/txtdoc.png b/bin/svg_kit/batik-1.7/docs/skin/images/txtdoc.png new file mode 100644 index 0000000..bf8b374 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/txtdoc.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/update.jpg b/bin/svg_kit/batik-1.7/docs/skin/images/update.jpg new file mode 100644 index 0000000..beb9207 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/update.jpg differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/valid-html401.png b/bin/svg_kit/batik-1.7/docs/skin/images/valid-html401.png new file mode 100644 index 0000000..3855210 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/valid-html401.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/vcss.png b/bin/svg_kit/batik-1.7/docs/skin/images/vcss.png new file mode 100644 index 0000000..9b2f596 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/vcss.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/warning.png b/bin/svg_kit/batik-1.7/docs/skin/images/warning.png new file mode 100644 index 0000000..b81b2ce Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/warning.png differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/images/xmldoc.gif b/bin/svg_kit/batik-1.7/docs/skin/images/xmldoc.gif new file mode 100644 index 0000000..c92d9b9 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/skin/images/xmldoc.gif differ diff --git a/bin/svg_kit/batik-1.7/docs/skin/menu.js b/bin/svg_kit/batik-1.7/docs/skin/menu.js new file mode 100644 index 0000000..06ea471 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/menu.js @@ -0,0 +1,48 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +/** + * This script, when included in a html file, can be used to make collapsible menus + * + * Typical usage: + * + */ + +if (document.getElementById){ + document.write('') +} + +function SwitchMenu(obj) +{ + if(document.getElementById) { + var el = document.getElementById(obj); + var title = document.getElementById(obj+'Title'); + + if(obj.indexOf("_selected_")==0&&el.style.display == ""){ + el.style.display = "block"; + title.className = "pagegroupselected"; + } + + if(el.style.display != "block"){ + el.style.display = "block"; + title.className = "pagegroupopen"; + } + else{ + el.style.display = "none"; + title.className = "pagegroup"; + } + }// end - if(document.getElementById) +}//end - function SwitchMenu(obj) diff --git a/bin/svg_kit/batik-1.7/docs/skin/note.txt b/bin/svg_kit/batik-1.7/docs/skin/note.txt new file mode 100644 index 0000000..d34c8db --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/note.txt @@ -0,0 +1,50 @@ +Notes for developer: + +--Legend------------------- +TODO -> blocker +DONE -> blocker +ToDo -> enhancement bug +done -> enhancement bug + +--Issues------------------- +- the corner images should be rendered through svg with the header color. +-> DONE +-> ToDo: get rid of the images and use only divs! + +- the menu points should be displayed "better". +-> DONE +-- Use the krysalis-site menu approach for the overall menu display. +-> DONE +-- Use the old lenya innermenu approch to further enhance the menu . +-> DONE + +- the content area needs some attention. +-> DONE +-- introduce the heading scheme from krysalis () +-> DONE +-> ToDo: make box with round corners +-> done: make underlined with variable border height +-> ToDo: make underline with bottom round corner +-- introduce the toc for each html-page +-> DONE +-- introduce the external-link-images. +-> DONE + +- the publish note should be where now only a border is. +Like
+-> DONE +, but make it configurable. +-> DONE +- footer needs some attention +-> DONE +-- the footer do not have the color profile! Enable it! +-> DONE +-- the footer should as well contain a feedback link. +See http://issues.apache.org/eyebrowse/ReadMsg?listName=forrest-user@xml.apache.org&msgNo=71 +-> DONE + +- introduce credits alternativ location +-> DONE + +- border for published / breadtrail / menu /tab divs +-> ToDo \ No newline at end of file diff --git a/bin/svg_kit/batik-1.7/docs/skin/print.css b/bin/svg_kit/batik-1.7/docs/skin/print.css new file mode 100644 index 0000000..aaa9931 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/print.css @@ -0,0 +1,54 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +body { + font-family: Georgia, Palatino, serif; + font-size: 12pt; + background: white; +} + +#tabs, +#menu, +#content .toc { + display: none; +} + +#content { + width: auto; + padding: 0; + float: none !important; + color: black; + background: inherit; +} + +a:link, a:visited { + color: #336699; + background: inherit; + text-decoration: underline; +} + +#top .logo { + padding: 0; + margin: 0 0 2em 0; +} + +#footer { + margin-top: 4em; +} + +acronym { + border: 0; +} \ No newline at end of file diff --git a/bin/svg_kit/batik-1.7/docs/skin/profile.css b/bin/svg_kit/batik-1.7/docs/skin/profile.css new file mode 100644 index 0000000..68c7aa2 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/profile.css @@ -0,0 +1,470 @@ + + +/* ==================== aural ============================ */ + +@media aural { + h1, h2, h3, h4, h5, h6 { voice-family: paul, male; stress: 20; richness: 90 } + h1 { pitch: x-low; pitch-range: 90 } + h2 { pitch: x-low; pitch-range: 80 } + h3 { pitch: low; pitch-range: 70 } + h4 { pitch: medium; pitch-range: 60 } + h5 { pitch: medium; pitch-range: 50 } + h6 { pitch: medium; pitch-range: 40 } + li, dt, dd { pitch: medium; richness: 60 } + dt { stress: 80 } + pre, code, tt { pitch: medium; pitch-range: 0; stress: 0; richness: 80 } + em { pitch: medium; pitch-range: 60; stress: 60; richness: 50 } + strong { pitch: medium; pitch-range: 60; stress: 90; richness: 90 } + dfn { pitch: high; pitch-range: 60; stress: 60 } + s, strike { richness: 0 } + i { pitch: medium; pitch-range: 60; stress: 60; richness: 50 } + b { pitch: medium; pitch-range: 60; stress: 90; richness: 90 } + u { richness: 0 } + + :link { voice-family: harry, male } + :visited { voice-family: betty, female } + :active { voice-family: betty, female; pitch-range: 80; pitch: x-high } +} + +a.external { + padding: 0 20px 0px 0px; + display:inline; + background-repeat: no-repeat; + background-position: center right; + background-image: url(images/external-link.gif); +} + +.heading { background-color: #a5b6c6;} + +.boxed { background-color: #482980;} +.underlined_5 {border-bottom: solid 5px #482980;} +.underlined_10 {border-bottom: solid 10px #482980;} +table caption { +background-color: #482980; +color: #000000; +} + +body{ +background-color: #ffffff; +color: #000000; +} +a:link { color:maroon} +a:visited { color:#400} +a:hover { color:maroon} + + +#publishedStrip { +color: #DDCCFF; +background: #482980; +} + +#footer { background-color: #eae3f9;} + +.ForrestTable { background-color: #9f7ae1;} + +.ForrestTable td { background-color: #f8f5ff;} + +#menu { background-color: #482980;} +#menu { color: #dfceef;} +#menu a:link { color: #ffffff;} +#menu a:visited { color: #ffffff;} +#menu a:hover { +background-color: #482980; +color: #ffcf00;} + +#top .header .current { background-color: #482980;} +#top .header .current a:link { color: white; } +#top .header .current a:visited { color: white; } +#top .header .current a:hover { color: white; } + +#tabs li { background-color: #eae3f9 ;} +#tabs li a:link { color: #000000; } +#tabs li a:visited { color: #000000; } +#tabs li a:hover { color: #000000; } + +#level2tabs a.selected { background-color: #482980 ;} +#level2tabs a:link { color: #DDCCFF; } +#level2tabs a:visited { color: #DDCCFF; } +#level2tabs a:hover { color: #AAAAEE; } + +#level2tabs { background-color: #482980;} +#level2tabs a.unselected:link { color: #DDCCFF; } +#level2tabs a.unselected:visited { color: #DDCCFF; } +#level2tabs a.unselected:hover { color: #AAAAEE; } + +#publishedStrip { +color: #ffffff; +background: #482980; +} + +#menu .menupagetitle { background-color: #6f569e; + color: #ffcf00;} + +#menu .menupageitemgroup { +background-color: #482980; +} +#menu .menupageitem { +color: #000000; +} +#menu .menupageitem a:link { color: #0000ff;} +#menu .menupageitem a:visited { color: #009999;} +#menu .menupageitem a:hover { +background-color: #482980; +color: #6587ff; +} + +#top .searchbox { +background-color: #482980 ; +color: #000000; +} + +#main .breadtrail { +background: #eae3f9; +color: #000000; +} +#main .breadtrail a:link { color: #482980; } +#main .breadtrail a:visited { color: #482980; } +#main .breadtrail a:hover { color: #000066; } +#top .breadtrail { +background: #eae3f9; +color: #000000; +} +#top .breadtrail a:link { color: #482980; } +#top .breadtrail a:visited { color: #482980; } +#top .breadtrail a:hover { color: #000066; } + +#top { background-color: #FFFFFF;} + +#feedback { +color: #FFFFFF; +background: #4C6C8F; +text-align: center; +} +#feedback #feedbackto { +color: #FFFFFF; +} + +#menu { border-color: #999999;} +#menu .menupagetitle { border-color: #999999;} +#menu .menupageitemgroup { border-color: #999999;} + +#menu h1 { +color: #000000; +background-color: #cfdced; +} + +.highlight { background-color: #ffff00;} + +.fixme { border-color: #c60;} + +.note { border-color: #069;} + +.warning { border-color: #900;} + +.code { border-color: #a5b6c6;} +/* extra-css */ + #content a:link { + text-decoration: none; + border-bottom: 1px solid #ccc; + } + #content a:visited { + text-decoration: none; + border-bottom: 1px solid #ccc; + } + #content ul.minitoc a:visited { + color: maroon; + } + #content a:hover { + background-color: #ffffdd; + border-bottom: 1px solid #aaa; + } + body, table, p { + font-family: Verdana, "Bitstream Vera Sans", Arial, Helvetica, sans-serif; + } + body, p, div, dl, ul, ol { + font-size: 9pt; + } + p, #content ul.minitoc, .note .content, .warning .content { + line-height: 1.5em; + } + #main .breadtrail { + display: none; + } + #top .grouplogo { + position: absolute; + left: 0; + float: none; + } + #top .projectlogoA1 { + text-align: center; + float: none; + margin: 0 auto; + width: 256px; + } + #menu { + padding-top: 2em; + } + #menu hr { + border: 0; + border-top: 1px solid #6f569e; + } + #menu .menupage { + background-position: center left; + margin-top: 2px; + margin-bottom: 2px; + position: relative; + } + #menu .menupagetitle { + border: 0; + padding-top: 2px; + padding-bottom: 2px; + position: relative; + font-weight: bold; + } + #menu .menuitem { + position: relative; + } + #menu .menuitem, #menu .menupagetitle, #menu .menutitle { + font-size: 8pt; + } + + + + + p.quote { + margin-left: 2em; + padding: .5em; + background-color: #f0f0f0; + border: 1px solid #ddd; + } + #content ul { + list-style-image: url('images/current.gif'); + } + .boxed { + color: white; + padding: 0.25em; + } + #content h1 { + font-size: 15pt; + } + #content h2 { + clear: right; + font-size: 12pt; + } + #content h3.boxed { + background: #9f7ae1; + } + #content h3, #content h4 { + font-size: 11pt; + } + a.broken { + background: orange; + } + img.floating { + float: right; + margin-left: 2em; + position: relative; + } + dl dt { + font-weight: bold; + } + dl.options { + margin: 0em 3em; + } + dl.options dt { + font-weight: inherit; + font-family: monospace; + } + dl.classes dt { + font-weight: normal; + } + #content { + margin: 0 1em; + } + #content li { + margin-top: 0.5em; + } + #content ul, #content ol, #content dl { + margin-bottom: 1em; + } + #content ul.minitoc { + margin-bottom: 0; + } + #content ul.minitoc li { + margin-top: 0; + } + #content ul.minitoc li ul { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + pre.code { + background: #eee; + border: 1px solid #ccc; + padding: 0.5em; + margin: 1em 3em; + } + .codefrag { + font-family: monospace; + font-size: inherit; + } + .expertise td { + text-align: center; + } + .expertise td.area { + text-align: left; + } + .expertise th.tick { + width: 6em; + } + #content td, #content th { + padding: 0.25em; + } + #minitoc-area ul.minitoc { + margin: 0; + } + strong.cont { + color: maroon; + } + a.class { + font-family: monospace; + } + h4 { + font-weight: bold; + } + .figure { + display: block; + text-align: center; + margin-top: 0.5em; + margin-bottom: 0.5em; + } + #tabs { + font-size: 80%; + } + #publishedStrip { + font-size: 80%; + height: 1.5em; + } + #top .searchbox { + font-size: 80%; + } + #footer { + border-top: solid 1px #482980; + } + + + table.elements { + border-collapse: collapse; + font-size: 10pt; + width: auto ! important; + margin-left: 2em; + margin-right: 2em; + } + table.elements td, table.elements th { + padding: 4px; + } + table.elements .attribute-name, table.elements .attribute-note, div.object { + background: #eef; + } + div.object { + margin-left: 2em; + margin-right: 2em; + } + div.object-header, div.object-section-header, div.object-property-header, div.object-property-desc { + padding: 4px; + } + .object-property-func-params { + font-weight: normal; + padding-left: 0.5em; + font-style: italic; + } + table.elements .elements-header { + background: navy; + color: white; + } + table.elements .supported, table.elements .yes, table.elements .partial, table.elements .no { + text-align: center; + } + .yes { + background: #35b92c; + color: white; + } + .partial { + background: #e29e1f; + color: white; + } + .no { + background: #cf1f1f; + color: white; + } + table.elements .section-header th, div.object-section-header { + padding-left: 2em ! important; + text-align: left; + font-style: italic; + font-weight: normal; + background: #eef; + } + table.elements .attribute th, div.object-property-header { + padding-left: 4em ! important; + padding-right: 2em ! important; + text-align: left; + font-weight: normal; + } + div.object-property-header { + font-weight: bold; + } + div.object-property-desc { + padding-left: 6em; + } + table.elements .vertical-bar { + width: 4px; + } + table.elements .element-header { + border-top: 3px solid white; + } + table.elements .element-header th, div.object-header { + background: #ccf; + padding-right: 2em; + text-align: left; + font-weight: bold; + } + table.elements .attribute-note { + padding-left: 1em ! important; + padding-right: 1em ! important; + } + + + .license pre { + width: 85ex; + } + + + #layout #data { + border-collapse: collapse; + width: auto; + } + #layout #data td, #layout #data th { + padding: 4px; + vertical-align: middle; + text-align: left ! important; + } + #layout { + text-align: center ! important; + width: inherit ! important; + border-collapse: collapse; + border: none ! important; + background: none ! important; + } + table#data tbody { + border: 1px solid #9f7ae1 ! important; + } + #layout td { + background: none ! important; + vertical-align: middle; + } + #layout #data td { + background: #f8f5ff ! important; + } + #layout td p { + text-align: center ! important; + } + \ No newline at end of file diff --git a/bin/svg_kit/batik-1.7/docs/skin/prototype.js b/bin/svg_kit/batik-1.7/docs/skin/prototype.js new file mode 100644 index 0000000..ed7d920 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/prototype.js @@ -0,0 +1,1257 @@ +/* Prototype JavaScript framework, version 1.4.0_pre4 + * (c) 2005 Sam Stephenson + * + * THIS FILE IS AUTOMATICALLY GENERATED. When sending patches, please diff + * against the source tree, available from the Prototype darcs repository. + * + * Prototype is freely distributable under the terms of an MIT-style license. + * + * For details, see the Prototype web site: http://prototype.conio.net/ + * +/*--------------------------------------------------------------------------*/ + +var Prototype = { + Version: '1.4.0_pre4', + + emptyFunction: function() {}, + K: function(x) {return x} +} + +var Class = { + create: function() { + return function() { + this.initialize.apply(this, arguments); + } + } +} + +var Abstract = new Object(); + +Object.extend = function(destination, source) { + for (property in source) { + destination[property] = source[property]; + } + return destination; +} + +Function.prototype.bind = function(object) { + var __method = this; + return function() { + return __method.apply(object, arguments); + } +} + +Function.prototype.bindAsEventListener = function(object) { + var __method = this; + return function(event) { + return __method.call(object, event || window.event); + } +} + +Number.prototype.toColorPart = function() { + var digits = this.toString(16); + if (this < 16) return '0' + digits; + return digits; +} + +var Try = { + these: function() { + var returnValue; + + for (var i = 0; i < arguments.length; i++) { + var lambda = arguments[i]; + try { + returnValue = lambda(); + break; + } catch (e) {} + } + + return returnValue; + } +} + +/*--------------------------------------------------------------------------*/ + +var PeriodicalExecuter = Class.create(); +PeriodicalExecuter.prototype = { + initialize: function(callback, frequency) { + this.callback = callback; + this.frequency = frequency; + this.currentlyExecuting = false; + + this.registerCallback(); + }, + + registerCallback: function() { + setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + onTimerEvent: function() { + if (!this.currentlyExecuting) { + try { + this.currentlyExecuting = true; + this.callback(); + } finally { + this.currentlyExecuting = false; + } + } + } +} + +/*--------------------------------------------------------------------------*/ + +function $() { + var elements = new Array(); + + for (var i = 0; i < arguments.length; i++) { + var element = arguments[i]; + if (typeof element == 'string') + element = document.getElementById(element); + + if (arguments.length == 1) + return element; + + elements.push(element); + } + + return elements; +} + +if (!Array.prototype.push) { + Array.prototype.push = function() { + var startLength = this.length; + for (var i = 0; i < arguments.length; i++) + this[startLength + i] = arguments[i]; + return this.length; + } +} + +if (!Function.prototype.apply) { + // Based on code from http://www.youngpup.net/ + Function.prototype.apply = function(object, parameters) { + var parameterStrings = new Array(); + if (!object) object = window; + if (!parameters) parameters = new Array(); + + for (var i = 0; i < parameters.length; i++) + parameterStrings[i] = 'parameters[' + i + ']'; + + object.__apply__ = this; + var result = eval('object.__apply__(' + + parameterStrings.join(', ') + ')'); + object.__apply__ = null; + + return result; + } +} + +Object.extend(String.prototype, { + stripTags: function() { + return this.replace(/<\/?[^>]+>/gi, ''); + }, + + escapeHTML: function() { + var div = document.createElement('div'); + var text = document.createTextNode(this); + div.appendChild(text); + return div.innerHTML; + }, + + unescapeHTML: function() { + var div = document.createElement('div'); + div.innerHTML = this.stripTags(); + return div.childNodes[0].nodeValue; + }, + + parseQuery: function() { + var str = this; + if (str.substring(0,1) == '?') { + str = this.substring(1); + } + var result = {}; + var pairs = str.split('&'); + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i].split('='); + result[pair[0]] = pair[1]; + } + return result; + } +}); + + +var _break = new Object(); +var _continue = new Object(); + +var Enumerable = { + each: function(iterator) { + var index = 0; + try { + this._each(function(value) { + try { + iterator(value, index++); + } catch (e) { + if (e != _continue) throw e; + } + }); + } catch (e) { + if (e != _break) throw e; + } + }, + + all: function(iterator) { + var result = true; + this.each(function(value, index) { + if (!(result &= (iterator || Prototype.K)(value, index))) + throw _break; + }); + return result; + }, + + any: function(iterator) { + var result = true; + this.each(function(value, index) { + if (result &= (iterator || Prototype.K)(value, index)) + throw _break; + }); + return result; + }, + + collect: function(iterator) { + var results = []; + this.each(function(value, index) { + results.push(iterator(value, index)); + }); + return results; + }, + + detect: function (iterator) { + var result; + this.each(function(value, index) { + if (iterator(value, index)) { + result = value; + throw _break; + } + }); + return result; + }, + + findAll: function(iterator) { + var results = []; + this.each(function(value, index) { + if (iterator(value, index)) + results.push(value); + }); + return results; + }, + + grep: function(pattern, iterator) { + var results = []; + this.each(function(value, index) { + var stringValue = value.toString(); + if (stringValue.match(pattern)) + results.push((iterator || Prototype.K)(value, index)); + }) + return results; + }, + + include: function(object) { + var found = false; + this.each(function(value) { + if (value == object) { + found = true; + throw _break; + } + }); + return found; + }, + + inject: function(memo, iterator) { + this.each(function(value, index) { + memo = iterator(memo, value, index); + }); + return memo; + }, + + invoke: function(method) { + var args = $A(arguments).slice(1); + return this.collect(function(value) { + return value[method].apply(value, args); + }); + }, + + max: function(iterator) { + var result; + this.each(function(value, index) { + value = (iterator || Prototype.K)(value, index); + if (value >= (result || value)) + result = value; + }); + return result; + }, + + min: function(iterator) { + var result; + this.each(function(value, index) { + value = (iterator || Prototype.K)(value, index); + if (value <= (result || value)) + result = value; + }); + return result; + }, + + partition: function(iterator) { + var trues = [], falses = []; + this.each(function(value, index) { + ((iterator || Prototype.K)(value, index) ? + trues : falses).push(value); + }); + return [trues, falses]; + }, + + pluck: function(property) { + var results = []; + this.each(function(value, index) { + results.push(value[property]); + }); + return results; + }, + + reject: function(iterator) { + var results = []; + this.each(function(value, index) { + if (!iterator(value, index)) + results.push(value); + }); + return results; + }, + + sortBy: function(iterator) { + return this.collect(function(value, index) { + return {value: value, criteria: iterator(value, index)}; + }).sort(function(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }).pluck('value'); + }, + + toArray: function() { + return this.collect(Prototype.K); + }, + + zip: function() { + var iterator = Prototype.K, args = $A(arguments); + if (typeof args.last() == 'function') + iterator = args.pop(); + + var collections = [this].concat(args).map($A); + return this.map(function(value, index) { + iterator(value = collections.pluck(index)); + return value; + }); + } +} + +Object.extend(Enumerable, { + map: Enumerable.collect, + find: Enumerable.detect, + select: Enumerable.findAll, + member: Enumerable.include, + entries: Enumerable.toArray +}); + +$A = Array.from = function(iterable) { + var results = []; + for (var i = 0; i < iterable.length; i++) + results.push(iterable[i]); + return results; +} + +Object.extend(Array.prototype, { + _each: function(iterator) { + for (var i = 0; i < this.length; i++) + iterator(this[i]); + }, + + first: function() { + return this[0]; + }, + + last: function() { + return this[this.length - 1]; + } +}); + +Object.extend(Array.prototype, Enumerable); + + +var Ajax = { + getTransport: function() { + return Try.these( + function() {return new ActiveXObject('Msxml2.XMLHTTP')}, + function() {return new ActiveXObject('Microsoft.XMLHTTP')}, + function() {return new XMLHttpRequest()} + ) || false; + } +} + +Ajax.Base = function() {}; +Ajax.Base.prototype = { + setOptions: function(options) { + this.options = { + method: 'post', + asynchronous: true, + parameters: '' + } + Object.extend(this.options, options || {}); + }, + + responseIsSuccess: function() { + return this.transport.status == undefined + || this.transport.status == 0 + || (this.transport.status >= 200 && this.transport.status < 300); + }, + + responseIsFailure: function() { + return !this.responseIsSuccess(); + } +} + +Ajax.Request = Class.create(); +Ajax.Request.Events = + ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; + +Ajax.Request.prototype = Object.extend(new Ajax.Base(), { + initialize: function(url, options) { + this.transport = Ajax.getTransport(); + this.setOptions(options); + this.request(url); + }, + + request: function(url) { + var parameters = this.options.parameters || ''; + if (parameters.length > 0) parameters += '&_='; + + try { + if (this.options.method == 'get') + url += '?' + parameters; + + this.transport.open(this.options.method, url, + this.options.asynchronous); + + if (this.options.asynchronous) { + this.transport.onreadystatechange = this.onStateChange.bind(this); + setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10); + } + + this.setRequestHeaders(); + + var body = this.options.postBody ? this.options.postBody : parameters; + this.transport.send(this.options.method == 'post' ? body : null); + + } catch (e) { + } + }, + + setRequestHeaders: function() { + var requestHeaders = + ['X-Requested-With', 'XMLHttpRequest', + 'X-Prototype-Version', Prototype.Version]; + + if (this.options.method == 'post') { + requestHeaders.push('Content-type', + 'application/x-www-form-urlencoded'); + + /* Force "Connection: close" for Mozilla browsers to work around + * a bug where XMLHttpReqeuest sends an incorrect Content-length + * header. See Mozilla Bugzilla #246651. + */ + if (this.transport.overrideMimeType) + requestHeaders.push('Connection', 'close'); + } + + if (this.options.requestHeaders) + requestHeaders.push.apply(requestHeaders, this.options.requestHeaders); + + for (var i = 0; i < requestHeaders.length; i += 2) + this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i+1]); + }, + + onStateChange: function() { + var readyState = this.transport.readyState; + if (readyState != 1) + this.respondToReadyState(this.transport.readyState); + }, + + respondToReadyState: function(readyState) { + var event = Ajax.Request.Events[readyState]; + + if (event == 'Complete') + (this.options['on' + this.transport.status] + || this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')] + || Prototype.emptyFunction)(this.transport); + + (this.options['on' + event] || Prototype.emptyFunction)(this.transport); + + /* Avoid memory leak in MSIE: clean up the oncomplete event handler */ + if (event == 'Complete') + this.transport.onreadystatechange = Prototype.emptyFunction; + } +}); + +Ajax.Updater = Class.create(); +Ajax.Updater.ScriptFragment = '(?:)((\n|.)*?)(?:<\/script>)'; + +Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), { + initialize: function(container, url, options) { + this.containers = { + success: container.success ? $(container.success) : $(container), + failure: container.failure ? $(container.failure) : + (container.success ? null : $(container)) + } + + this.transport = Ajax.getTransport(); + this.setOptions(options); + + var onComplete = this.options.onComplete || Prototype.emptyFunction; + this.options.onComplete = (function() { + this.updateContent(); + onComplete(this.transport); + }).bind(this); + + this.request(url); + }, + + updateContent: function() { + var receiver = this.responseIsSuccess() ? + this.containers.success : this.containers.failure; + + var match = new RegExp(Ajax.Updater.ScriptFragment, 'img'); + var response = this.transport.responseText.replace(match, ''); + var scripts = this.transport.responseText.match(match); + + if (receiver) { + if (this.options.insertion) { + new this.options.insertion(receiver, response); + } else { + receiver.innerHTML = response; + } + } + + if (this.responseIsSuccess()) { + if (this.onComplete) + setTimeout((function() {this.onComplete( + this.transport)}).bind(this), 10); + } + + if (this.options.evalScripts && scripts) { + match = new RegExp(Ajax.Updater.ScriptFragment, 'im'); + setTimeout((function() { + for (var i = 0; i < scripts.length; i++) + eval(scripts[i].match(match)[1]); + }).bind(this), 10); + } + } +}); + +Ajax.PeriodicalUpdater = Class.create(); +Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), { + initialize: function(container, url, options) { + this.setOptions(options); + this.onComplete = this.options.onComplete; + + this.frequency = (this.options.frequency || 2); + this.decay = 1; + + this.updater = {}; + this.container = container; + this.url = url; + + this.start(); + }, + + start: function() { + this.options.onComplete = this.updateComplete.bind(this); + this.onTimerEvent(); + }, + + stop: function() { + this.updater.onComplete = undefined; + clearTimeout(this.timer); + (this.onComplete || Ajax.emptyFunction).apply(this, arguments); + }, + + updateComplete: function(request) { + if (this.options.decay) { + this.decay = (request.responseText == this.lastText ? + this.decay * this.options.decay : 1); + + this.lastText = request.responseText; + } + this.timer = setTimeout(this.onTimerEvent.bind(this), + this.decay * this.frequency * 1000); + }, + + onTimerEvent: function() { + this.updater = new Ajax.Updater(this.container, this.url, this.options); + } +}); + +document.getElementsByClassName = function(className) { + var children = document.getElementsByTagName('*') || document.all; + var elements = new Array(); + + for (var i = 0; i < children.length; i++) { + var child = children[i]; + var classNames = child.className.split(' '); + for (var j = 0; j < classNames.length; j++) { + if (classNames[j] == className) { + elements.push(child); + break; + } + } + } + + return elements; +} + +/*--------------------------------------------------------------------------*/ + +if (!window.Element) { + var Element = new Object(); +} + +Object.extend(Element, { + toggle: function() { + for (var i = 0; i < arguments.length; i++) { + var element = $(arguments[i]); + element.style.display = + (element.style.display == 'none' ? '' : 'none'); + } + }, + + hide: function() { + for (var i = 0; i < arguments.length; i++) { + var element = $(arguments[i]); + element.style.display = 'none'; + } + }, + + show: function() { + for (var i = 0; i < arguments.length; i++) { + var element = $(arguments[i]); + element.style.display = ''; + } + }, + + remove: function(element) { + element = $(element); + element.parentNode.removeChild(element); + }, + + getHeight: function(element) { + element = $(element); + return element.offsetHeight; + }, + + hasClassName: function(element, className) { + element = $(element); + if (!element) + return; + var a = element.className.split(' '); + for (var i = 0; i < a.length; i++) { + if (a[i] == className) + return true; + } + return false; + }, + + addClassName: function(element, className) { + element = $(element); + Element.removeClassName(element, className); + element.className += ' ' + className; + }, + + removeClassName: function(element, className) { + element = $(element); + if (!element) + return; + var newClassName = ''; + var a = element.className.split(' '); + for (var i = 0; i < a.length; i++) { + if (a[i] != className) { + if (i > 0) + newClassName += ' '; + newClassName += a[i]; + } + } + element.className = newClassName; + }, + + // removes whitespace-only text node children + cleanWhitespace: function(element) { + var element = $(element); + for (var i = 0; i < element.childNodes.length; i++) { + var node = element.childNodes[i]; + if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) + Element.remove(node); + } + } +}); + +var Toggle = new Object(); +Toggle.display = Element.toggle; + +/*--------------------------------------------------------------------------*/ + +Abstract.Insertion = function(adjacency) { + this.adjacency = adjacency; +} + +Abstract.Insertion.prototype = { + initialize: function(element, content) { + this.element = $(element); + this.content = content; + + if (this.adjacency && this.element.insertAdjacentHTML) { + this.element.insertAdjacentHTML(this.adjacency, this.content); + } else { + this.range = this.element.ownerDocument.createRange(); + if (this.initializeRange) this.initializeRange(); + this.fragment = this.range.createContextualFragment(this.content); + this.insertContent(); + } + } +} + +var Insertion = new Object(); + +Insertion.Before = Class.create(); +Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), { + initializeRange: function() { + this.range.setStartBefore(this.element); + }, + + insertContent: function() { + this.element.parentNode.insertBefore(this.fragment, this.element); + } +}); + +Insertion.Top = Class.create(); +Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), { + initializeRange: function() { + this.range.selectNodeContents(this.element); + this.range.collapse(true); + }, + + insertContent: function() { + this.element.insertBefore(this.fragment, this.element.firstChild); + } +}); + +Insertion.Bottom = Class.create(); +Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), { + initializeRange: function() { + this.range.selectNodeContents(this.element); + this.range.collapse(this.element); + }, + + insertContent: function() { + this.element.appendChild(this.fragment); + } +}); + +Insertion.After = Class.create(); +Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), { + initializeRange: function() { + this.range.setStartAfter(this.element); + }, + + insertContent: function() { + this.element.parentNode.insertBefore(this.fragment, + this.element.nextSibling); + } +}); + +var Field = { + clear: function() { + for (var i = 0; i < arguments.length; i++) + $(arguments[i]).value = ''; + }, + + focus: function(element) { + $(element).focus(); + }, + + present: function() { + for (var i = 0; i < arguments.length; i++) + if ($(arguments[i]).value == '') return false; + return true; + }, + + select: function(element) { + $(element).select(); + }, + + activate: function(element) { + $(element).focus(); + $(element).select(); + } +} + +/*--------------------------------------------------------------------------*/ + +var Form = { + serialize: function(form) { + var elements = Form.getElements($(form)); + var queryComponents = new Array(); + + for (var i = 0; i < elements.length; i++) { + var queryComponent = Form.Element.serialize(elements[i]); + if (queryComponent) + queryComponents.push(queryComponent); + } + + return queryComponents.join('&'); + }, + + getElements: function(form) { + var form = $(form); + var elements = new Array(); + + for (tagName in Form.Element.Serializers) { + var tagElements = form.getElementsByTagName(tagName); + for (var j = 0; j < tagElements.length; j++) + elements.push(tagElements[j]); + } + return elements; + }, + + getInputs: function(form, typeName, name) { + var form = $(form); + var inputs = form.getElementsByTagName('input'); + + if (!typeName && !name) + return inputs; + + var matchingInputs = new Array(); + for (var i = 0; i < inputs.length; i++) { + var input = inputs[i]; + if ((typeName && input.type != typeName) || + (name && input.name != name)) + continue; + matchingInputs.push(input); + } + + return matchingInputs; + }, + + disable: function(form) { + var elements = Form.getElements(form); + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + element.blur(); + element.disabled = 'true'; + } + }, + + enable: function(form) { + var elements = Form.getElements(form); + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + element.disabled = ''; + } + }, + + focusFirstElement: function(form) { + var form = $(form); + var elements = Form.getElements(form); + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + if (element.type != 'hidden' && !element.disabled) { + Field.activate(element); + break; + } + } + }, + + reset: function(form) { + $(form).reset(); + } +} + +Form.Element = { + serialize: function(element) { + var element = $(element); + var method = element.tagName.toLowerCase(); + var parameter = Form.Element.Serializers[method](element); + + if (parameter) + return encodeURIComponent(parameter[0]) + '=' + + encodeURIComponent(parameter[1]); + }, + + getValue: function(element) { + var element = $(element); + var method = element.tagName.toLowerCase(); + var parameter = Form.Element.Serializers[method](element); + + if (parameter) + return parameter[1]; + } +} + +Form.Element.Serializers = { + input: function(element) { + switch (element.type.toLowerCase()) { + case 'submit': + case 'hidden': + case 'password': + case 'text': + return Form.Element.Serializers.textarea(element); + case 'checkbox': + case 'radio': + return Form.Element.Serializers.inputSelector(element); + } + return false; + }, + + inputSelector: function(element) { + if (element.checked) + return [element.name, element.value]; + }, + + textarea: function(element) { + return [element.name, element.value]; + }, + + select: function(element) { + var value = ''; + if (element.type == 'select-one') { + var index = element.selectedIndex; + if (index >= 0) + value = element.options[index].value || element.options[index].text; + } else { + value = new Array(); + for (var i = 0; i < element.length; i++) { + var opt = element.options[i]; + if (opt.selected) + value.push(opt.value || opt.text); + } + } + return [element.name, value]; + } +} + +/*--------------------------------------------------------------------------*/ + +var $F = Form.Element.getValue; + +/*--------------------------------------------------------------------------*/ + +Abstract.TimedObserver = function() {} +Abstract.TimedObserver.prototype = { + initialize: function(element, frequency, callback) { + this.frequency = frequency; + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + this.registerCallback(); + }, + + registerCallback: function() { + setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + onTimerEvent: function() { + var value = this.getValue(); + if (this.lastValue != value) { + this.callback(this.element, value); + this.lastValue = value; + } + } +} + +Form.Element.Observer = Class.create(); +Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.Observer = Class.create(); +Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { + getValue: function() { + return Form.serialize(this.element); + } +}); + +/*--------------------------------------------------------------------------*/ + +Abstract.EventObserver = function() {} +Abstract.EventObserver.prototype = { + initialize: function(element, callback) { + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + if (this.element.tagName.toLowerCase() == 'form') + this.registerFormCallbacks(); + else + this.registerCallback(this.element); + }, + + onElementEvent: function() { + var value = this.getValue(); + if (this.lastValue != value) { + this.callback(this.element, value); + this.lastValue = value; + } + }, + + registerFormCallbacks: function() { + var elements = Form.getElements(this.element); + for (var i = 0; i < elements.length; i++) + this.registerCallback(elements[i]); + }, + + registerCallback: function(element) { + if (element.type) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + element.target = this; + element.prev_onclick = element.onclick || Prototype.emptyFunction; + element.onclick = function() { + this.prev_onclick(); + this.target.onElementEvent(); + } + break; + case 'password': + case 'text': + case 'textarea': + case 'select-one': + case 'select-multiple': + element.target = this; + element.prev_onchange = element.onchange || Prototype.emptyFunction; + element.onchange = function() { + this.prev_onchange(); + this.target.onElementEvent(); + } + break; + } + } + } +} + +Form.Element.EventObserver = Class.create(); +Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.EventObserver = Class.create(); +Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { + getValue: function() { + return Form.serialize(this.element); + } +}); + + +if (!window.Event) { + var Event = new Object(); +} + +Object.extend(Event, { + KEY_BACKSPACE: 8, + KEY_TAB: 9, + KEY_RETURN: 13, + KEY_ESC: 27, + KEY_LEFT: 37, + KEY_UP: 38, + KEY_RIGHT: 39, + KEY_DOWN: 40, + KEY_DELETE: 46, + + element: function(event) { + return event.target || event.srcElement; + }, + + isLeftClick: function(event) { + return (((event.which) && (event.which == 1)) || + ((event.button) && (event.button == 1))); + }, + + pointerX: function(event) { + return event.pageX || (event.clientX + + (document.documentElement.scrollLeft || document.body.scrollLeft)); + }, + + pointerY: function(event) { + return event.pageY || (event.clientY + + (document.documentElement.scrollTop || document.body.scrollTop)); + }, + + stop: function(event) { + if (event.preventDefault) { + event.preventDefault(); + event.stopPropagation(); + } else { + event.returnValue = false; + } + }, + + // find the first node with the given tagName, starting from the + // node the event was triggered on; traverses the DOM upwards + findElement: function(event, tagName) { + var element = Event.element(event); + while (element.parentNode && (!element.tagName || + (element.tagName.toUpperCase() != tagName.toUpperCase()))) + element = element.parentNode; + return element; + }, + + observers: false, + + _observeAndCache: function(element, name, observer, useCapture) { + if (!this.observers) this.observers = []; + if (element.addEventListener) { + this.observers.push([element, name, observer, useCapture]); + element.addEventListener(name, observer, useCapture); + } else if (element.attachEvent) { + this.observers.push([element, name, observer, useCapture]); + element.attachEvent('on' + name, observer); + } + }, + + unloadCache: function() { + if (!Event.observers) return; + for (var i = 0; i < Event.observers.length; i++) { + Event.stopObserving.apply(this, Event.observers[i]); + Event.observers[i][0] = null; + } + Event.observers = false; + }, + + observe: function(element, name, observer, useCapture) { + var element = $(element); + useCapture = useCapture || false; + + if (name == 'keypress' && + ((/Konqueror|Safari|KHTML/.test(navigator.userAgent)) + || element.attachEvent)) + name = 'keydown'; + + this._observeAndCache(element, name, observer, useCapture); + }, + + stopObserving: function(element, name, observer, useCapture) { + var element = $(element); + useCapture = useCapture || false; + + if (name == 'keypress' && + ((/Konqueror|Safari|KHTML/.test(navigator.userAgent)) + || element.detachEvent)) + name = 'keydown'; + + if (element.removeEventListener) { + element.removeEventListener(name, observer, useCapture); + } else if (element.detachEvent) { + element.detachEvent('on' + name, observer); + } + } +}); + +/* prevent memory leaks in IE */ +Event.observe(window, 'unload', Event.unloadCache, false); + +var Position = { + + // set to true if needed, warning: firefox performance problems + // NOT neeeded for page scrolling, only if draggable contained in + // scrollable elements + includeScrollOffsets: false, + + // must be called before calling withinIncludingScrolloffset, every time the + // page is scrolled + prepare: function() { + this.deltaX = window.pageXOffset + || document.documentElement.scrollLeft + || document.body.scrollLeft + || 0; + this.deltaY = window.pageYOffset + || document.documentElement.scrollTop + || document.body.scrollTop + || 0; + }, + + realOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.scrollTop || 0; + valueL += element.scrollLeft || 0; + element = element.parentNode; + } while (element); + return [valueL, valueT]; + }, + + cumulativeOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + } while (element); + return [valueL, valueT]; + }, + + // caches x/y coordinate pair to use with overlap + within: function(element, x, y) { + if (this.includeScrollOffsets) + return this.withinIncludingScrolloffsets(element, x, y); + this.xcomp = x; + this.ycomp = y; + this.offset = this.cumulativeOffset(element); + + return (y >= this.offset[1] && + y < this.offset[1] + element.offsetHeight && + x >= this.offset[0] && + x < this.offset[0] + element.offsetWidth); + }, + + withinIncludingScrolloffsets: function(element, x, y) { + var offsetcache = this.realOffset(element); + + this.xcomp = x + offsetcache[0] - this.deltaX; + this.ycomp = y + offsetcache[1] - this.deltaY; + this.offset = this.cumulativeOffset(element); + + return (this.ycomp >= this.offset[1] && + this.ycomp < this.offset[1] + element.offsetHeight && + this.xcomp >= this.offset[0] && + this.xcomp < this.offset[0] + element.offsetWidth); + }, + + // within must be called directly before + overlap: function(mode, element) { + if (!mode) return 0; + if (mode == 'vertical') + return ((this.offset[1] + element.offsetHeight) - this.ycomp) / + element.offsetHeight; + if (mode == 'horizontal') + return ((this.offset[0] + element.offsetWidth) - this.xcomp) / + element.offsetWidth; + }, + + clone: function(source, target) { + source = $(source); + target = $(target); + target.style.position = 'absolute'; + var offsets = this.cumulativeOffset(source); + target.style.top = offsets[1] + 'px'; + target.style.left = offsets[0] + 'px'; + target.style.width = source.offsetWidth + 'px'; + target.style.height = source.offsetHeight + 'px'; + } +} diff --git a/bin/svg_kit/batik-1.7/docs/skin/screen.css b/bin/svg_kit/batik-1.7/docs/skin/screen.css new file mode 100644 index 0000000..c6084f8 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/skin/screen.css @@ -0,0 +1,587 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +body { margin: 0px 0px 0px 0px; font-family: Verdana, Helvetica, sans-serif; } + +h1 { font-size : 160%; margin: 0px 0px 0px 0px; padding: 0px; } +h2 { font-size : 140%; margin: 1em 0px 0.8em 0px; padding: 0px; font-weight : bold;} +h3 { font-size : 130%; margin: 0.8em 0px 0px 0px; padding: 0px; font-weight : bold; } +.h3 { margin: 22px 0px 3px 0px; } +h4 { font-size : 120%; margin: 0.7em 0px 0px 0px; padding: 0px; font-weight : normal; text-align: left; } +.h4 { margin: 18px 0px 0px 0px; } +h4.faq { font-size : 120%; margin: 18px 0px 0px 0px; padding: 0px; font-weight : bold; text-align: left; } +h5 { font-size : 100%; margin: 14px 0px 0px 0px; padding: 0px; font-weight : normal; text-align: left; } + +/** +* table +*/ +table .title { background-color: #000000; } +.ForrestTable { + color: #ffffff; + background-color: #7099C5; + width: 100%; + font-size : 100%; + empty-cells: show; +} +table caption { + padding-left: 5px; + color: white; + text-align: left; + font-weight: bold; + background-color: #000000; +} +.ForrestTable td { + color: black; + background-color: #f0f0ff; +} +.ForrestTable th { text-align: center; } +/** + * Page Header + */ + +#top { + position: relative; + float: left; + width: 100%; + background: #294563; /* if you want a background in the header, put it here */ +} + +#top .breadtrail { + background: #CFDCED; + color: black; + border-bottom: solid 1px white; + padding: 3px 10px; + font-size: 75%; +} +#top .breadtrail a { color: black; } + +#top .header { + float: left; + width: 100%; + background: url("images/header_white_line.gif") repeat-x bottom; +} + +#top .grouplogo { + padding: 7px 0 10px 10px; + float: left; + text-align: left; +} +#top .projectlogo { + padding: 7px 0 10px 10px; + float: left; + width: 33%; + text-align: right; +} +#top .projectlogoA1 { + padding: 7px 0 10px 10px; + float: right; +} +html>body #top .searchbox { + bottom: 0px; +} +#top .searchbox { + position: absolute; + right: 10px; + height: 42px; + font-size: 70%; + white-space: nowrap; + text-align: right; + color: white; + background-color: #000000; + z-index:0; + background-image: url(images/rc-t-l-5-1header-2searchbox-3searchbox.png); + background-repeat: no-repeat; + background-position: top left; + bottom: -1px; /* compensate for IE rendering issue */ +} + +#top .searchbox form { + padding: 5px 10px; + margin: 0; +} +#top .searchbox p { + padding: 0 0 2px 0; + margin: 0; +} +#top .searchbox input { + font-size: 100%; +} + +#tabs { + clear: both; + padding-left: 10px; + margin: 0; + list-style: none; +} +/* background: #CFDCED url("images/tab-right.gif") no-repeat right top;*/ +#tabs li { + float: left; + background-image: url(images/rc-t-r-5-1header-2tab-unselected-3tab-unselected.png); + background-repeat: no-repeat; + background-position: top right; + background-color: #000000; + margin: 0 3px 0 0; + padding: 0; +} + +/*background: url("images/tab-left.gif") no-repeat left top;*/ +#tabs li a { + float: left; + display: block; + font-family: verdana, arial, sans-serif; + text-decoration: none; + color: black; + white-space: nowrap; + background-image: url(images/rc-t-l-5-1header-2tab-unselected-3tab-unselected.png); + background-repeat: no-repeat; + background-position: top left; + padding: 5px 15px 4px; + width: .1em; /* IE/Win fix */ +} + +#tabs li a:hover { + + cursor: pointer; + text-decoration:underline; +} + +#tabs > li a { width: auto; } /* Rest of IE/Win fix */ + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +#tabs a { float: none; } +/* End IE5-Mac hack */ + +#top .header .current { + background-color: #4C6C8F; + background-image: url(images/rc-t-r-5-1header-2tab-selected-3tab-selected.png); + background-repeat: no-repeat; + background-position: top right; +} +#top .header .current a { + font-weight: bold; + padding-bottom: 5px; + color: white; + background-image: url(images/rc-t-l-5-1header-2tab-selected-3tab-selected.png); + background-repeat: no-repeat; + background-position: top left; +} +#publishedStrip { + padding-right: 10px; + padding-left: 20px; + padding-top: 3px; + padding-bottom:3px; + color: #ffffff; + font-size : 60%; + font-weight: bold; + background-color: #4C6C8F; + text-align:right; +} + +#level2tabs { +margin: 0; +float:left; +position:relative; + +} + + + +#level2tabs a:hover { + + cursor: pointer; + text-decoration:underline; + +} + +#level2tabs a{ + + cursor: pointer; + text-decoration:none; + background-image: url('images/chapter.gif'); + background-repeat: no-repeat; + background-position: center left; + padding-left: 6px; + margin-left: 6px; +} + +/* +* border-top: solid #4C6C8F 15px; +*/ +#main { + position: relative; + background: white; + clear:both; +} +#main .breadtrail { + clear:both; + position: relative; + background: #CFDCED; + color: black; + border-bottom: solid 1px black; + border-top: solid 1px black; + padding: 0px 180px; + font-size: 75%; + z-index:10; +} +/** +* Round corner +*/ +#roundtop { + background-image: url(images/rc-t-r-15-1body-2menu-3menu.png); + background-repeat: no-repeat; + background-position: top right; +} + +#roundbottom { + background-image: url(images/rc-b-r-15-1body-2menu-3menu.png); + background-repeat: no-repeat; + background-position: top right; +} + +img.corner { + width: 15px; + height: 15px; + border: none; + display: block !important; +} + +.roundtopsmall { + background-image: url(images/rc-t-r-5-1header-2searchbox-3searchbox.png); + background-repeat: no-repeat; + background-position: top right; +} + +#roundbottomsmall { + background-image: url(images/rc-b-r-5-1header-2tab-selected-3tab-selected.png); + background-repeat: no-repeat; + background-position: top right; +} + +img.cornersmall { + width: 5px; + height: 5px; + border: none; + display: block !important; +} +/** + * Side menu + */ +#menu a { font-weight: normal; text-decoration: none;} +#menu a:visited { font-weight: normal; } +#menu a:active { font-weight: normal; } +#menu a:hover { font-weight: normal; text-decoration:underline;} + +#menuarea { width:10em;} +#menu { + position: relative; + float: left; + width: 160px; + padding-top: 0px; + top:-18px; + left:10px; + z-index: 20; + background-color: #f90; + font-size : 70%; + +} + +.menutitle { + cursor:pointer; + padding: 3px 12px; + margin-left: 10px; + background-image: url('images/chapter.gif'); + background-repeat: no-repeat; + background-position: center left; + font-weight : bold; + + +} + +.menutitle:hover{text-decoration:underline;cursor: pointer;} + +#menu .menuitemgroup { + margin: 0px 0px 6px 8px; + padding: 0px; + font-weight : bold; } + +#menu .selectedmenuitemgroup{ + margin: 0px 0px 0px 8px; + padding: 0px; + font-weight : normal; + + } + +#menu .menuitem { + padding: 2px 0px 1px 13px; + background-image: url('images/page.gif'); + background-repeat: no-repeat; + background-position: center left; + font-weight : normal; + margin-left: 10px; +} + +#menu .menupage { + margin: 2px 0px 1px 10px; + padding: 0px 3px 0px 12px; + background-image: url('images/page.gif'); + background-repeat: no-repeat; + background-position: center left; + font-style : normal; +} +#menu .menupagetitle { + padding: 0px 0px 0px 1px; + font-style : normal; + border-style: solid; + border-width: 1px; + margin-right: 10px; + +} +#menu .menupageitemgroup { + padding: 3px 0px 4px 6px; + font-style : normal; + border-bottom: 1px solid ; + border-left: 1px solid ; + border-right: 1px solid ; + margin-right: 10px; +} +#menu .menupageitem { + font-style : normal; + font-weight : normal; + border-width: 0px; + font-size : 90%; +} +#menu #credit { + text-align: center; +} +#menu #credit2 { + text-align: center; + padding: 3px 3px 3px 3px; + background-color: #ffffff; +} +#menu .searchbox { + text-align: center; +} +#menu .searchbox form { + padding: 3px 3px; + margin: 0; +} +#menu .searchbox input { + font-size: 100%; +} + +#content { + padding: 20px 20px 20px 180px; + margin: 0; + font : small Verdana, Helvetica, sans-serif; + font-size : 80%; +} + +#content ul { + margin: 0; + padding: 0 25px; +} +#content li { + padding: 0 5px; +} +#feedback { + color: black; + background: #CFDCED; + text-align:center; + margin-top: 5px; +} +#feedback #feedbackto { + font-size: 90%; + color: black; +} +#footer { + clear: both; + position: relative; /* IE bugfix (http://www.dracos.co.uk/web/css/ie6floatbug/) */ + width: 100%; + background: #CFDCED; + border-top: solid 1px #4C6C8F; + color: black; +} +#footer .copyright { + position: relative; /* IE bugfix cont'd */ + padding: 5px; + margin: 0; + width: 45%; +} +#footer .lastmodified { + position: relative; /* IE bugfix cont'd */ + float: right; + width: 45%; + padding: 5px; + margin: 0; + text-align: right; +} +#footer a { color: white; } + +#footer #logos { + text-align: left; +} + + +/** + * Misc Styles + */ + +acronym { cursor: help; } +.boxed { background-color: #a5b6c6;} +.underlined_5 {border-bottom: solid 5px #4C6C8F;} +.underlined_10 {border-bottom: solid 10px #4C6C8F;} +/* ==================== snail trail ============================ */ + +.trail { + position: relative; /* IE bugfix cont'd */ + font-size: 70%; + text-align: right; + float: right; + margin: -10px 5px 0px 5px; + padding: 0; +} + +#motd-area { + position: relative; /* IE bugfix cont'd */ + float: right; + width: 35%; + background-color: #f0f0ff; + border-top: solid 1px #4C6C8F; + border-bottom: solid 1px #4C6C8F; + margin-bottom: 15px; + margin-left: 15px; + margin-right: 10%; + padding-bottom: 5px; + padding-top: 5px; +} + +#minitoc-area { + border-top: solid 1px #4C6C8F; + border-bottom: solid 1px #4C6C8F; + margin: 15px 10% 5px 15px; + /* margin-bottom: 15px; + margin-left: 15px; + margin-right: 10%;*/ + padding-bottom: 7px; + padding-top: 5px; +} +.minitoc { + list-style-image: url('images/current.gif'); + font-weight: normal; +} + +li p { + margin: 0; + padding: 0; +} + +.pdflink { + position: relative; /* IE bugfix cont'd */ + float: right; + margin: 0px 5px; + padding: 0; +} +.pdflink br { + margin-top: -10px; + padding-left: 1px; +} +.pdflink a { + display: block; + font-size: 70%; + text-align: center; + margin: 0; + padding: 0; +} + +.pdflink img { + display: block; + height: 16px; + width: 16px; +} +.xmllink { + position: relative; /* IE bugfix cont'd */ + float: right; + margin: 0px 5px; + padding: 0; +} +.xmllink br { + margin-top: -10px; + padding-left: 1px; +} +.xmllink a { + display: block; + font-size: 70%; + text-align: center; + margin: 0; + padding: 0; +} + +.xmllink img { + display: block; + height: 16px; + width: 16px; +} +.podlink { + position: relative; /* IE bugfix cont'd */ + float: right; + margin: 0px 5px; + padding: 0; +} +.podlink br { + margin-top: -10px; + padding-left: 1px; +} +.podlink a { + display: block; + font-size: 70%; + text-align: center; + margin: 0; + padding: 0; +} + +.podlink img { + display: block; + height: 16px; + width: 16px; +} + +.printlink { + position: relative; /* IE bugfix cont'd */ + float: right; +} +.printlink br { + margin-top: -10px; + padding-left: 1px; +} +.printlink a { + display: block; + font-size: 70%; + text-align: center; + margin: 0; + padding: 0; +} +.printlink img { + display: block; + height: 16px; + width: 16px; +} + +p.instruction { + display: list-item; + list-style-image: url('../images/instruction_arrow.png'); + list-style-position: outside; + margin-left: 2em; +} \ No newline at end of file diff --git a/bin/svg_kit/batik-1.7/docs/status.html b/bin/svg_kit/batik-1.7/docs/status.html new file mode 100644 index 0000000..a1a58e2 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/status.html @@ -0,0 +1,9527 @@ + + + + + + + +Batik implementation status + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Batik implementation status

+ + +

+ This page details information about Batik’s implementation of the + SVG 1.1 and related specifications. The features + of the implementation are annotated with their level of support, which + can be at one of three levels: +

+ + +
+ +
Not supported
+ +
+ +

+ If a feature is not supported, this means that Batik performs + no useful processing for it. This feature could be silently ignored or + an exception might be thrown when trying to use it. +

+ +
+ +
Partially supported
+ +
+ +

+ If a feature is partially suppored, this means that Batik performs + some processing for it, but there are known bugs with this processing. +

+ +
+ +
Fully supported
+ +
+ +

+ If a feature is fully supported, this means that Batik performs + the correct processing for it, as detailed in the relevant specification. +

+ +
+ + +

+ Note that the information on this page is based on the code in the + Subversion repository trunk. +

+ +
+ + + +

Elements, attributes and properties

+
+

+ The table below lists the SVG elements and the attributes and properties + on them that are supported by Batik. For an element to be fully + supported, its attributes and the properties that apply to it must also + be fully supported. If an attribute of the element or a property that + applies to the element is only partially supported or is not supported, + the element can be at most partially supported. An element is not + supported if it is not processed by Batik, even if some of its + attributes are supported (such as the core attributes id + or xml:base). +

+

+ Note that all presentation attributes are supported on all stylable + elements. These attributes are not listed in the table. Only those + properties that apply to a given element are listed. +

+
+ + Your browser doesn't seem to support Java applets, which is required + for this demo. + + + + + + + + + + + + + + + + + + +
ExpenseAmount
Shoe +
Car +
Travel +
Computer +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
svg:a
Attributes
classyes
externalResourcesRequiredno
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
targetnoWhile target is not supported, new windows can be opened with xlink:show="new".
transformyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
color-interpolationyes
color-renderingyes
cursoryes
displayyes
enable-backgroundyes
filteryes
maskyes
opacityyes
svg:altGlyph
Attributes
classyes
dxyes
dyyes
externalResourcesRequiredno
formatno
glyphRefno
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
requiredExtensionsyes
requiredFeaturesyes
rotateyes
styleyes
systemLanguageyes
xyes
yyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
Properties
alignment-baselineno
baseline-shiftyes
coloryes
directionyes
displayyes
dominant-baselineno
fillyes
fill-opacityyes
fill-ruleyes
fontyes
font-familyyes
font-sizeyes
font-size-adjustno
font-stretchno
font-styleyes
font-variantno
font-weightyes
glyph-orientation-horizontalyes
glyph-orientation-verticalyes
kerningyes
letter-spacingyes
strokeyes
stroke-dasharrayyes
stroke-dashoffsetyes
stroke-linecapyes
stroke-linejoinyes
stroke-miterlimityes
stroke-opacityyes
stroke-widthyes
text-anchoryes
text-decorationyes
unicode-bidiyes
visibilityyes
word-spacingyes
svg:altGlyphDef
Attributes
idyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:altGlyphItem
Attributes
idyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:animate
Attributes
accumulateyes
additiveyes
attributeNameyes
attributeTypeyes
beginyes
byyes
calcModeyes
duryes
endyes
externalResourcesRequiredno
fillyes
fromyes
idyes
keySplinesyes
keyTimesyes
maxyes
minyes
onbeginyes
onendyes
onloadyes
onrepeatyes
repeatCountyes
repeatDuryes
requiredExtensionsno
requiredFeaturesno
restartyes
systemLanguageno
toyes
valuesyes
svg:animateColor
Attributes
accumulateyes
additiveyes
attributeNameyes
attributeTypeyes
beginyes
byyes
calcModeyes
duryes
endyes
externalResourcesRequiredno
fillyes
fromyes
idyes
keySplinesyes
keyTimesyes
maxyes
minyes
onbeginyes
onendyes
onloadyes
onrepeatyes
repeatCountyes
repeatDuryes
requiredExtensionsno
requiredFeaturesno
restartyes
systemLanguageno
toyes
valuesyes
Properties
color-interpolationyes
color-renderingyes
svg:animateMotion
Attributes
accumulateyes
additiveyes
attributeNameyes
attributeTypeyes
beginyes
byyes
calcModeyes
duryes
endyes
externalResourcesRequiredno
fillyes
fromyes
idyes
keyPointsyes
keySplinesyes
keyTimesyes
maxyes
minyes
onbeginyes
onendyes
onloadyes
onrepeatyes
originyes
pathyes
repeatCountyes
repeatDuryes
requiredExtensionsno
requiredFeaturesno
restartyes
rotateyes
systemLanguageno
toyes
valuesyes
svg:animateTransform
Attributes
accumulateyes
additiveyes
attributeNameyes
attributeTypeyes
beginyes
byyes
calcModeyes
duryes
endyes
externalResourcesRequiredno
fillyes
fromyes
idyes
keySplinesyes
keyTimesyes
maxyes
minyes
onbeginyes
onendyes
onloadyes
onrepeatyes
repeatCountyes
repeatDuryes
requiredExtensionsno
requiredFeaturesno
restartyes
systemLanguageno
toyes
typeyes
valuesyes
svg:circle
Attributes
classyes
cxyes
cyyes
externalResourcesRequiredno
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
ryes
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
transformyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
clip-ruleyes
coloryes
color-interpolationyes
color-renderingyes
cursoryes
fillyes
fill-opacityyes
fill-ruleyes
filteryes
maskyes
opacityyes
pointer-eventsyes
shape-renderingyes
strokeyes
stroke-dasharrayyes
stroke-dashoffsetyes
stroke-linecapyes
stroke-linejoinyes
stroke-miterlimityes
stroke-opacityyes
stroke-widthyes
visibilityyes
svg:clipPath
Attributes
classyes
clipPathUnitsyes
externalResourcesRequiredno
idyes
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
transformyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
color-interpolationyes
color-renderingyes
cursoryes
enable-backgroundno
filteryes
maskyes
opacityyes
svg:color-profile
Attributes
idyes
localno
nameyes
rendering-intentyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
svg:cursor
Attributes
externalResourcesRequiredno
idyes
requiredExtensionsyes
requiredFeaturesyes
systemLanguageyes
xyes
yyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
svg:definition-src
Attributes
idyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefno
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
svg:defs
Attributes
classyes
externalResourcesRequiredno
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
transformyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
color-interpolationyes
color-renderingyes
cursoryes
enable-backgroundno
filteryes
maskyes
opacityyes
svg:desc
Attributes
classyes
idyes
styleyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:ellipse
Attributes
classyes
cxyes
cyyes
externalResourcesRequiredno
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
requiredExtensionsyes
requiredFeaturesyes
rxyes
ryyes
styleyes
systemLanguageyes
transformyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
clip-ruleyes
coloryes
color-interpolationyes
color-renderingyes
cursoryes
fillyes
fill-opacityyes
fill-ruleyes
filteryes
maskyes
opacityyes
pointer-eventsyes
shape-renderingyes
strokeyes
stroke-dasharrayyes
stroke-dashoffsetyes
stroke-linecapyes
stroke-linejoinyes
stroke-miterlimityes
stroke-opacityyes
stroke-widthyes
visibilityyes
svg:feBlend
Attributes
heightyes
idyes
inyes
in2yes
modeyes
resultyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
color-interpolation-filtersyes
svg:feColorMatrix
Attributes
heightyes
idyes
inyes
resultyes
typeyes
valuesyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
color-interpolation-filtersyes
svg:feComponentTransfer
Attributes
heightyes
idyes
inyes
resultyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
color-interpolation-filtersyes
svg:feComposite
Attributes
heightyes
idyes
inyes
in2yes
k1yes
k2yes
k3yes
k4yes
operatoryes
resultyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
color-interpolation-filtersyes
svg:feConvolveMatrix
Attributes
biasyes
divisoryes
edgeModeyes
heightyes
idyes
inyes
kernelMatrixyes
kernelUnitLengthyes
orderyes
preserveAlphayes
resultyes
targetXyes
targetYyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
color-interpolation-filtersyes
svg:feDiffuseLighting
Attributes
classyes
diffuseConstantyes
heightyes
idyes
inyes
kernelUnitLengthno
resultyes
styleyes
surfaceScaleyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
coloryes
color-interpolation-filtersyes
lighting-coloryes
svg:feDisplacementMap
Attributes
heightyes
idyes
inyes
in2yes
resultyes
scaleyes
widthyes
xyes
xChannelSelectoryes
yyes
yChannelSelectoryes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
color-interpolation-filtersyes
svg:feDistantLight
Attributes
azimuthyes
elevationyes
idyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:feFlood
Attributes
classyes
heightyes
idyes
inyes
resultyes
styleyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
coloryes
color-interpolation-filtersyes
flood-coloryes
flood-opacityyes
svg:feFuncA
Attributes
amplitudeyes
exponentyes
idyes
interceptyes
offsetyes
slopeyes
tableValuesyes
typeyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:feFuncB
Attributes
amplitudeyes
exponentyes
idyes
interceptyes
offsetyes
slopeyes
tableValuesyes
typeyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:feFuncG
Attributes
amplitudeyes
exponentyes
idyes
interceptyes
offsetyes
slopeyes
tableValuesyes
typeyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:feFuncR
Attributes
amplitudeyes
exponentyes
idyes
interceptyes
offsetyes
slopeyes
tableValuesyes
typeyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:feGaussianBlur
Attributes
heightyes
idyes
inyes
resultyes
stdDeviationyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
color-interpolation-filtersyes
svg:feImage
Attributes
classyes
externalResourcesRequiredno
heightyes
idyes
preserveAspectRationo
resultyes
styleyes
widthyes
xyes
yyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clipno
clip-pathyes
clip-ruleyes
color-interpolationyes
color-interpolation-filtersyes
color-profileyes
color-renderingyes
cursoryes
filteryes
image-renderingyes
maskyes
opacityyes
overflowyes
pointer-eventsyes
visibilityyes
svg:feMerge
Attributes
heightyes
idyes
resultyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
color-interpolation-filtersyes
svg:feMergeNode
Attributes
idyes
inyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:feMorphology
Attributes
heightyes
idyes
inyes
operatoryes
radiusyes
resultyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
color-interpolation-filtersyes
svg:feOffset
Attributes
dxyes
dyyes
heightyes
idyes
inyes
resultyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
color-interpolation-filtersyes
svg:fePointLight
Attributes
idyes
xyes
yyes
zyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:feSpecularLighting
Attributes
classyes
heightyes
idyes
inyes
kernelUnitLengthyes
resultyes
specularConstantyes
specularExponentyes
styleyes
surfaceScaleyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
coloryes
color-interpolation-filtersyes
lighting-coloryes
svg:feSpotLight
Attributes
idyes
limitingConeAngleyes
pointsAtXyes
pointsAtYyes
pointsAtZyes
specularExponentyes
xyes
yyes
zyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:feTile
Attributes
heightyes
idyes
inyes
resultyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
color-interpolation-filtersyes
svg:feTurbulence
Attributes
baseFrequencyyes
heightyes
idyes
numOctavesyes
resultyes
seedyes
stitchTilesyes
typeyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
color-interpolation-filtersyes
svg:filter
Attributes
classyes
externalResourcesRequiredno
filterResyes
filterUnitsyes
heightyes
idyes
primitiveUnitsyes
styleyes
widthyes
xyes
yyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
svg:font
Attributes
classyes
externalResourcesRequiredno
horiz-adv-xyes
horiz-origin-xyes
horiz-origin-yyes
idyes
styleyes
vert-adv-yyes
vert-origin-xyes
vert-origin-yyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:font-face
Attributes
accent-heightno
alphabeticno
ascentyes
bboxno
cap-heightno
descentyes
font-familyyes
font-sizeno
font-styleyes
font-weightyes
hangingno
idyes
ideographicno
mathematicalno
overline-positionyes
overline-thicknessyes
panose-1yes
slopeyes
stemhno
stemvno
strikethrough-positionyes
strikethrough-thicknessyes
underline-positionyes
underline-thicknessyes
unicode-rangeno
units-per-emyes
v-alphabeticno
v-hangingno
v-ideographicno
v-mathematicalno
widthsno
x-heightno
xml:baseyes
xml:langyes
xml:spaceyes
svg:font-face-format
Attributes
idyes
stringno
xml:baseyes
xml:langyes
xml:spaceyes
svg:font-face-name
Attributes
idyes
nameyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:font-face-src
Attributes
idyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:font-face-uri
Attributes
idyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
svg:foreignObject
Attributes
classno
heightno
idyes
onactivateno
onclickno
onfocusinno
onfocusoutno
onloadno
onmousedownno
onmousemoveno
onmouseoutno
onmouseoverno
onmouseupno
requiredExtensionsno
requiredFeaturesno
styleno
systemLanguageno
transformno
widthno
xno
yno
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clipno
displayno
overflowno
svg:g
Attributes
classyes
externalResourcesRequiredno
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
transformyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
color-interpolationyes
color-renderingyes
cursoryes
displayyes
enable-backgroundyes
filteryes
maskyes
opacityyes
svg:glyph
Attributes
arabic-formyes
classyes
dyes
glyph-nameyes
horiz-adv-xyes
idyes
langyes
orientationyes
styleyes
unicodeyes
vert-adv-yyes
vert-origin-xyes
vert-origin-yyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:glyphRef
Attributes
classyes
dxno
dyno
font-familyno[2]
font-sizeno[2]
font-size-adjustno[2]
font-stretchno[2]
font-styleno[2]
font-variantno[2]
font-weightno[2]
formatno
glyphRefno
idyes
styleyes
xno
yno
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
svg:hkern
Attributes
g1yes
g2yes
idyes
kyes
u1yes
u2yes
xml:baseyes
xml:langyes
xml:spaceyes
svg:image
Attributes
classyes
externalResourcesRequiredno
heightyes
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
preserveAspectRatioyes
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
transformyes
widthyes
xyes
yyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clipno
clip-pathyes
clip-ruleyes
color-interpolationyes
color-profileyes
color-renderingyes
cursoryes
filteryes
image-renderingyes
maskyes
opacityyes
overflowyes
pointer-eventsyes
visibilityyes
svg:line
Attributes
classyes
externalResourcesRequiredno
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
transformyes
x1yes
x2yes
y1yes
y2yes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
clip-ruleyes
coloryes
color-interpolationyes
color-renderingyes
cursoryes
fillyes
fill-opacityyes
fill-ruleyes
filteryes
markeryes
marker-endyes
marker-midyes
marker-startyes
maskyes
opacityyes
pointer-eventsyes
shape-renderingyes
strokeyes
stroke-dasharrayyes
stroke-dashoffsetyes
stroke-linecapyes
stroke-linejoinyes
stroke-miterlimityes
stroke-opacityyes
stroke-widthyes
visibilityyes
svg:linearGradient
Attributes
classyes
coloryes
color-interpolationyes
color-renderingyes
externalResourcesRequiredno
gradientTransformyes
gradientUnitsyes
idyes
spreadMethodyes
stop-coloryes
stop-opacityyes
styleyes
x1yes
x2yes
y1yes
y2yes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
svg:marker
Attributes
classyes
externalResourcesRequiredno
idyes
markerHeightyes
markerUnitsyes
markerWidthyes
orientyes
preserveAspectRatioyes
refXyes
refYyes
styleyes
viewBoxyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
color-interpolationyes
color-renderingyes
cursoryes
enable-backgroundno
filteryes
maskyes
opacityyes
svg:mask
Attributes
classyes
externalResourcesRequiredno
heightyes
idyes
maskContentUnitsyes
maskUnitsyes
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
color-interpolationyes
color-renderingyes
cursoryes
enable-backgroundno
filteryes
maskyes
opacityyes
svg:metadata
Attributes
idyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:missing-glyph
Attributes
classyes
dyes
horiz-adv-xyes
idyes
styleyes
vert-adv-yyes
vert-origin-xyes
vert-origin-yyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:mpath
Attributes
externalResourcesRequiredno
idyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
svg:path
Attributes
classyes
dyes
externalResourcesRequiredno
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
pathLengthnoAuthor specified path length is ignored.
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
transformyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
clip-ruleyes
coloryes
color-interpolationyes
color-renderingyes
cursoryes
fillyes
fill-opacityyes
fill-ruleyes
filteryes
markeryes
marker-endyes
marker-midyes
marker-startyes
maskyes
opacityyes
pointer-eventsyes
shape-renderingyes
strokeyes
stroke-dasharrayyes
stroke-dashoffsetyes
stroke-linecapyes
stroke-linejoinyes
stroke-miterlimityes
stroke-opacityyes
stroke-widthyes
visibilityyes
svg:pattern
Attributes
classyes
externalResourcesRequiredno
heightyes
idyes
patternContentUnitsyes
patternTransformyes
patternUnitsyes
preserveAspectRatioyes
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
viewBoxyes
widthyes
xyes
yyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
color-interpolationyes
color-renderingyes
cursoryes
enable-backgroundno
filteryes
maskyes
opacityyes
svg:polygon
Attributes
classyes
externalResourcesRequiredno
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
pointsyes
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
transformyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
clip-ruleyes
coloryes
color-interpolationyes
color-renderingyes
cursoryes
fillyes
fill-opacityyes
fill-ruleyes
filteryes
markeryes
marker-endyes
marker-midyes
marker-startyes
maskyes
opacityyes
pointer-eventsyes
shape-renderingyes
strokeyes
stroke-dasharrayyes
stroke-dashoffsetyes
stroke-linecapyes
stroke-linejoinyes
stroke-miterlimityes
stroke-opacityyes
stroke-widthyes
visibilityyes
svg:polyline
Attributes
classyes
externalResourcesRequiredno
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
pointsyes
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
transformyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
clip-ruleyes
coloryes
color-interpolationyes
color-renderingyes
cursoryes
fillyes
fill-opacityyes
fill-ruleyes
filteryes
markeryes
marker-endyes
marker-midyes
marker-startyes
maskyes
opacityyes
pointer-eventsyes
shape-renderingyes
strokeyes
stroke-dasharrayyes
stroke-dashoffsetyes
stroke-linecapyes
stroke-linejoinyes
stroke-miterlimityes
stroke-opacityyes
stroke-widthyes
visibilityyes
svg:radialGradient
Attributes
classyes
cxyes
cyyes
externalResourcesRequiredno
fxyes
fyyes
gradientTransformyes
gradientUnitsyes
idyes
ryes
spreadMethodyes
styleyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
svg:rect
Attributes
classyes
externalResourcesRequiredno
heightyes
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
requiredExtensionsyes
requiredFeaturesyes
rxyes
ryyes
styleyes
systemLanguageyes
transformyes
widthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
clip-ruleyes
coloryes
color-interpolationyes
color-renderingyes
cursoryes
fillyes
fill-opacityyes
fill-ruleyes
filteryes
maskyes
opacityyes
pointer-eventsyes
shape-renderingyes
strokeyes
stroke-dasharrayyes
stroke-dashoffsetyes
stroke-linecapyes
stroke-linejoinyes
stroke-miterlimityes
stroke-opacityyes
stroke-widthyes
visibilityyes
svg:script
Attributes
externalResourcesRequiredno
idyes
typeyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
svg:set
Attributes
attributeNameyes
attributeTypeyes
beginyes
duryes
endyes
externalResourcesRequiredno
fillyes
fromyes
idyes
maxyes
minyes
onbeginyes
onendyes
onloadyes
onrepeatyes
repeatCountyes
repeatDuryes
requiredExtensionsno
requiredFeaturesno
restartyes
systemLanguageno
xml:baseyes
xml:langyes
xml:spaceyes
svg:stop
Attributes
classyes
idyes
offsetyes
styleyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
coloryes
stop-coloryes
stop-opacityyes
svg:style
Attributes
idyes
mediayes
titleyes
typeyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:svg
Attributes
baseProfileno
classyes
contentScriptTypeyes
contentStyleTypenotext/css is always the default style type.
externalResourcesRequiredno
heightyes
idyes
onabortyes
onclickyes
onerroryesThe event listener is added, but the error event is never fired by the implementation.
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
onresizeyes
onscrollyes
onunloadyes
onzoomyes
preserveAspectRatioyes
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
versionyes
viewBoxyes
widthyes
xyes
yyes
zoomAndPanyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clipno
clip-pathyes
color-interpolationyes
color-renderingyes
cursoryes
displayyes
enable-backgroundyes
filteryes
maskyes
opacityyes
overflowyes
svg:switch
Attributes
classyes
externalResourcesRequiredno
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
transformyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
color-interpolationyes
color-renderingyes
cursoryes
displayyes
enable-backgroundno
filteryes
maskyes
opacityyes
svg:symbol
Attributes
classyes
externalResourcesRequiredno
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
preserveAspectRatioyes
styleyes
viewBoxyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clipno
clip-pathyes
color-interpolationyes
color-renderingyes
cursoryes
enable-backgroundno
filteryes
maskyes
opacityyes
overflowyes
svg:text
Attributes
classyes
dxyes
dyyes
externalResourcesRequiredno
idyes
lengthAdjustyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
requiredExtensionsyes
requiredFeaturesyes
rotateyes
styleyes
systemLanguageyes
textLengthyes
transformyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
clip-ruleyes
coloryes
color-interpolationyes
color-renderingyes
cursoryes
directionyes
displayyes
dominant-baselineno
fillyes
fill-opacityyes
fill-ruleyes
filteryes
fontyes
font-familyyes
font-sizeyes
font-size-adjustno
font-stretchno
font-styleyes
font-variantno
font-weightyes
glyph-orientation-horizontalyes
glyph-orientation-verticalyes
kerningyes
letter-spacingyes
maskyes
opacityyes
pointer-eventsyes
strokeyes
stroke-dasharrayyes
stroke-dashoffsetyes
stroke-linecapyes
stroke-linejoinyes
stroke-miterlimityes
stroke-opacityyes
stroke-widthyes
text-anchoryes
text-decorationyes
text-renderingyes
unicode-bidiyes
visibilityyes
word-spacingyes
writing-modeyes
svg:textPath
Attributes
classyes
externalResourcesRequiredno
idyes
lengthAdjustyes
methodnoalign is always used.
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
requiredExtensionsyes
requiredFeaturesyes
spacingnoexact is always used.
startOffsetyes
styleyes
systemLanguageyes
textLengthyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
Properties
alignment-baselineno
baseline-shiftyes
coloryes
directionyes
displayyes
dominant-baselineno
fillyes
fill-opacityyes
fill-ruleyes
fontyes
font-familyyes
font-sizeyes
font-size-adjustno
font-stretchno
font-styleyes
font-variantno
font-weightyes
glyph-orientation-horizontalyes
glyph-orientation-verticalyes
kerningyes
letter-spacingyes
strokeyes
stroke-dasharrayyes
stroke-dashoffsetyes
stroke-linecapyes
stroke-linejoinyes
stroke-miterlimityes
stroke-opacityyes
stroke-widthyes
text-anchoryes
text-decorationyes
unicode-bidiyes
visibilityyes
word-spacingyes
svg:title
Attributes
classyes
idyes
styleyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:tref
Attributes
classyes
dxyes
dyyes
externalResourcesRequiredno
idyes
lengthAdjustyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
requiredExtensionsyes
requiredFeaturesyes
rotateyes
styleyes
systemLanguageyes
textLengthyes
xyes
yyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
Properties
alignment-baselineno
baseline-shiftyes
coloryes
directionyes
displayyes
dominant-baselineno
fillyes
fill-opacityyes
fill-ruleyes
fontyes
font-familyyes
font-sizeyes
font-size-adjustno
font-stretchno
font-styleyes
font-variantno
font-weightyes
glyph-orientation-horizontalyes
glyph-orientation-verticalyes
kerningyes
letter-spacingyes
strokeyes
stroke-dasharrayyes
stroke-dashoffsetyes
stroke-linecapyes
stroke-linejoinyes
stroke-miterlimityes
stroke-opacityyes
stroke-widthyes
text-anchoryes
text-decorationyes
unicode-bidiyes
visibilityyes
word-spacingyes
svg:tspan
Attributes
classyes
dxyes
dyyes
externalResourcesRequiredno
idyes
lengthAdjustyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
requiredExtensionsyes
requiredFeaturesyes
rotateyes
styleyes
systemLanguageyes
textLengthyes
xyes
yyes
xml:baseyes
xml:langyes
xml:spaceyes
Properties
alignment-baselineno
baseline-shiftyes
coloryes
directionyes
displayyes
dominant-baselineno
fillyes
fill-opacityyes
fill-ruleyes
fontyes
font-familyyes
font-sizeyes
font-size-adjustno
font-stretchno
font-styleyes
font-variantno
font-weightyes
glyph-orientation-horizontalyes
glyph-orientation-verticalyes
kerningyes
letter-spacingyes
strokeyes
stroke-dasharrayyes
stroke-dashoffsetyes
stroke-linecapyes
stroke-linejoinyes
stroke-miterlimityes
stroke-opacityyes
stroke-widthyes
text-anchoryes
text-decorationyes
unicode-bidiyes
visibilityyes
word-spacingyes
svg:use
Attributes
classyes
externalResourcesRequiredno
heightyes
idyes
onclickyes
onfocusinyes
onfocusoutyes
onloadyes
onmousedownyes
onmousemoveyes
onmouseoutyes
onmouseoveryes
onmouseupyes
requiredExtensionsyes
requiredFeaturesyes
styleyes
systemLanguageyes
transformyes
widthyes
xyes
yyes
xlink:actuateyes[1]
xlink:arcroleyes[1]
xlink:hrefyes
xlink:roleyes[1]
xlink:showyes[1]
xlink:titleyes[1]
xlink:typeyes[1]
xml:baseyes
xml:langyes
xml:spaceyes
Properties
clip-pathyes
clip-ruleyes
color-interpolationyes
color-renderingyes
cursoryes
filteryes
maskyes
opacityyes
pointer-eventsyes
visibilityyes
svg:view
Attributes
externalResourcesRequiredno
idyes
preserveAspectRatioyes
viewBoxyes
viewTargetnoNo highlighting is performed.
zoomAndPanyes
xml:baseyes
xml:langyes
xml:spaceyes
svg:vkern
Attributes
g1yes
g2yes
idyes
kyes
u1yes
u2yes
xml:baseyes
xml:langyes
xml:spaceyes
+

+ Notes: +

+
    + +
  1. + + + +

    + Values for the XLink attributes other than xlink:href + that are not those required by SVG are ignored. For example, + setting xlink:title="Something" or + xlink:actuate="other" has no effect. +

    + +
  2. + +
  3. + + + +

    + +glyphRef elements can reference glyphs only by + URI, not by font properties. +

    + +
  4. + +
+ + + + +

DOM interfaces

+
+

+ The table below lists the SVG DOM interfaces that are supported + by Batik. For each interface, the name of each IDL attribute and + operation introduced on the interface is given, along with its level + of support. For cases where the implementation of an attribute or + operation introduced in a superinterface may differ depending on which + subinterface has inherited it, this is noted next to that attribute + or operation. Both the ECMAScript and Java bindings have the same + implementation level as specified for the IDL interfaces in the table. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GetSVGDocument
Operations
getSVGDocumentnoNo objects implement this interface.
SVGAElement
Attributes
targetyes
SVGAltGlyphDefElement
SVGAltGlyphElement
Attributes
formatyes
glyphRefyes
SVGAltGlyphItemElement
SVGAngle
Attributes
unitTypeyes
valueyes
valueAsStringyes
valueInSpecifiedUnitsyes
Operations
newValueSpecifiedUnitsyes
convertToSpecifiedUnitsyes
SVGAnimateColorElement
SVGAnimatedAngle
Attributes
animValyes
baseValyes
SVGAnimatedBoolean
Attributes
animValyes
baseValyes
SVGAnimatedEnumeration
Attributes
animValyes
baseValyes
SVGAnimatedInteger
Attributes
animValyes
baseValyes
SVGAnimatedLength
Attributes
animValyes
baseValyes
SVGAnimatedLengthList
Attributes
animValyes
baseValyes
SVGAnimatedNumber
Attributes
animValyes
baseValyes
SVGAnimatedNumberList
Attributes
animValyes
baseValyes
SVGAnimatedPathData
Attributes
animatedNormalizedPathSegListno
animatedPathSegListyes
normalizedPathSegListyes
pathSegListyes
SVGAnimatedPoints
Attributes
animatedPointsyes
pointsyes
SVGAnimatedPreserveAspectRatio
Attributes
animValyes
baseValyes
SVGAnimatedRect
Attributes
animValyes
baseValyes
SVGAnimatedString
Attributes
animValyes
baseValyes
SVGAnimatedTransformList
Attributes
animValyes
baseValyes
SVGAnimateElement
SVGAnimateMotionElement
SVGAnimateTransformElement
SVGAnimationElement
Attributes
targetElementyes
Operations
getStartTimeyes
getCurrentTimeyes
getSimpleDurationyes
SVGCircleElement
Attributes
cxyes
cyyes
ryes
SVGClipPathElement
Attributes
clipPathUnitsyes
SVGColor
Attributes
colorTypeyes
iccColoryes
rgbColoryes
Operations
setRGBColoryes
setRGBColorICCColoryes
setColoryes
SVGColorProfileElement
Attributes
localyes
nameyes
renderingIntentyes
SVGColorProfileRule
Attributes
nameno
renderingIntentno
srcno
SVGComponentTransferFunctionElement
Attributes
amplitudeyes
exponentyes
interceptyes
offsetyes
slopeyes
tableValuesno
typeyes
SVGCSSRule
SVGCursorElement
Attributes
xyes
yyes
SVGDefinitionSrcElement
SVGDefinitionSrcElement
SVGDefsElement
SVGDescElement
SVGDocument
Attributes
domainyes
referreryes
rootElementyes
titleyes
URLyes
SVGElement
Attributes
idyes
ownerSVGElementyes
viewportElementyes
xmlbaseyes
SVGElementInstance
Attributes
childNodesno
correspondingElementno
correspondingUseElementno
firstChildno
lastChildno
nextSiblingno
parentNodeno
previousSiblingno
SVGElementInstanceList
Attributes
lengthno
Operations
itemno
SVGEllipseElement
Attributes
cxyes
cyyes
rxyes
ryyes
SVGEvent
SVGExternalResourcesRequired
Attributes
externalResourcesRequiredyes
SVGFEBlendElement
Attributes
in1yes
in2yes
modeyes
SVGFEColorMatrixElement
Attributes
in1yes
typeyes
valuesno
SVGFEComponentTransferElement
Attributes
in1yes
SVGFECompositeElement
Attributes
in1yes
in2yes
k1yes
k2yes
k3yes
k4yes
operatoryes
SVGFEConvolveMatrixElement
Attributes
biasyes
divisorno
edgeModeyes
kernelMatrixno
kernelUnitLengthXno
kernelUnitLengthYno
orderXno
orderYno
preserveAlphayes
targetXno
targetYno
SVGFEDiffuseLightingElement
Attributes
diffuseConstantyes
in1yes
kernelUnitLengthXyes
kernelUnitLengthYyes
surfaceScaleyes
SVGFEDisplacementMapElement
Attributes
in1yes
in2yes
scaleyes
xChannelSelectoryes
yChannelSelectoryes
SVGFEDistantLightElement
Attributes
azimuthyes
elevationyes
SVGFEFloodElement
Attributes
in1yes
SVGFEFuncAElement
SVGFEFuncBElement
SVGFEFuncGElement
SVGFEFuncRElement
SVGFEGaussianBlurElement
Attributes
in1yes
stdDeviationXno
stdDeviationYno
Operations
setStdDeviationyes
SVGFEImageElement
Attributes
preserveAspectRationo
SVGFEMergeElement
SVGFEMergeNodeElement
Attributes
in1yes
SVGFEMorphologyElement
Attributes
in1yes
operatoryes
radiusXno
radiusYno
SVGFEOffsetElement
Attributes
dxyes
dyyes
in1yes
SVGFEPointLightElement
Attributes
xyes
yyes
zyes
SVGFESpecularLightingElement
Attributes
in1yes
specularConstantyes
specularExponentyes
surfaceScaleyes
SVGFESpotLightElement
Attributes
limitingConeAngleyes
pointsAtXyes
pointsAtYyes
pointsAtZyes
specularExponentyes
xyes
yyes
zyes
SVGFETileElement
Attributes
in1yes
SVGFETurbulenceElement
Attributes
baseFrequencyXno
baseFrequencyYno
numOctavesyes
seedyes
stitchTilesyes
typeyes
SVGFilterElement
Attributes
filterResXno
filterResYno
filterUnitsyes
heightyes
primitiveUnitsyes
widthyes
xyes
yyes
Operations
setFilterResno
SVGFilterPrimitiveStandardAttributes
Attributes
heightyes
resultyes
widthyes
xyes
yyes
SVGFitToViewBox
Attributes
preserveAspectRatioyes
viewBoxno
SVGFontElement
SVGFontFaceElement
SVGFontFaceFormatElement
SVGFontFaceNameElement
SVGFontFaceSrcElement
SVGFontFaceUriElement
SVGForeignObjectElement
Attributes
heightyes
widthyes
xyes
yyes
SVGGElement
SVGGlyphElement
SVGGlyphRefElement
Attributes
dxyes
dyyes
formatyes
glyphRefyes
xyes
yyes
SVGGradientElement
Attributes
gradientTransformyes
gradientUnitsyes
spreadMethodyes
SVGHKernElement
SVGICCColor
Attributes
colorProfileyes
colorsyes
SVGImageElement
Attributes
heightyes
preserveAspectRatioyes
widthyes
xyes
yyes
SVGLangSpace
Attributes
xmllangyes
xmlspaceyes
SVGLength
Attributes
unitTypeyes
valueyes
valueAsStringyes
valueInSpecifiedUnitsyes
Operations
newValueSpecifiedUnitsyes
convertToSpecifiedUnitsyes
SVGLengthList
Attributes
numberOfItemsyes
Operations
clearyes
initializeyes
getItemyes
insertItemBeforeyes
replaceItemyes
removeItemyes
appendItemyes
SVGLinearGradientElement
Attributes
x1yes
x2yes
y1yes
y2yes
SVGLineElement
Attributes
x1yes
x2yes
y1yes
y2yes
SVGLocatable
Attributes
farthestViewportElementyes
nearestViewportElementyes
Operations
getBBoxyes
getCTMyes
getScreenCTMyes
getTransformToElementyes
SVGMarkerElement
Attributes
markerHeightyes
markerUnitsyes
markerWidthyes
orientAngleyes
orientTypeyes
refXyes
refYyes
Operations
setOrientToAutoyes
setOrientToAngleyes
SVGMaskElement
Attributes
heightyes
maskContentUnitsyes
maskUnitsyes
widthyes
xyes
yyes
SVGMatrix
Attributes
ayes
byes
cyes
dyes
eyes
fyes
Operations
multiplyyes
inverseyes
translateyes
scaleyes
scaleNonUniformyes
rotateyes
rotateFromVectoryes
flipXyes
flipYyes
skewXyes
skewYyes
SVGMetadataElement
SVGMissingGlyphElement
SVGMPathElement
SVGNumber
Attributes
valueyes
SVGNumberList
Attributes
numberOfItemsyes
Operations
clearyes
initializeyes
getItemyes
insertItemBeforeyes
replaceItemyes
removeItemyes
appendItemyes
SVGPaint
Attributes
paintTypeyes
uriyes
Operations
setUriyes
setPaintyes
SVGPathElement
Attributes
pathLengthno
Operations
getTotalLengthyes
getPointAtLengthyes
getPathSegAtLengthyes
createSVGPathSegClosePathyes
createSVGPathSegMovetoAbsyes
createSVGPathSegMovetoRelyes
createSVGPathSegLinetoAbsyes
createSVGPathSegLinetoRelyes
createSVGPathSegCurvetoCubicAbsyes
createSVGPathSegCurvetoCubicRelyes
createSVGPathSegCurvetoQuadraticAbsyes
createSVGPathSegCurvetoQuadraticRelyes
createSVGPathSegArcAbsyes
createSVGPathSegArcRelyes
createSVGPathSegLinetoHorizontalAbsyes
createSVGPathSegLinetoHorizontalRelyes
createSVGPathSegLinetoVerticalAbsyes
createSVGPathSegLinetoVerticalRelyes
createSVGPathSegCurvetoCubicSmoothAbsyes
createSVGPathSegCurvetoCubicSmoothRelyes
createSVGPathSegCurvetoQuadraticSmoothAbsyes
createSVGPathSegCurvetoQuadraticSmoothRelyes
SVGPathSeg
Attributes
pathSegTypeyes
pathSegTypeAsLetteryes
SVGPathSegArcAbs
Attributes
angleyes
largeArcFlagyes
r1yes
r2yes
sweepFlagyes
xyes
yyes
SVGPathSegArcRel
Attributes
angleyes
largeArcFlagyes
r1yes
r2yes
sweepFlagyes
xyes
yyes
SVGPathSegClosePath
SVGPathSegCurvetoCubicAbs
Attributes
xyes
x1yes
x2yes
yyes
y1yes
y2yes
SVGPathSegCurvetoCubicRel
Attributes
xyes
x1yes
x2yes
yyes
y1yes
y2yes
SVGPathSegCurvetoCubicSmoothAbs
Attributes
xyes
x2yes
yyes
y2yes
SVGPathSegCurvetoCubicSmoothRel
Attributes
xyes
x2yes
yyes
y2yes
SVGPathSegCurvetoQuadraticAbs
Attributes
xyes
x1yes
yyes
y1yes
SVGPathSegCurvetoQuadraticRel
Attributes
xyes
x1yes
yyes
y1yes
SVGPathSegCurvetoQuadraticSmoothAbs
Attributes
xyes
yyes
SVGPathSegCurvetoQuadraticSmoothRel
Attributes
xyes
yyes
SVGPathSegLinetoAbs
Attributes
xyes
yyes
SVGPathSegLinetoHorizontalAbs
Attributes
xyes
SVGPathSegLinetoHorizontalRel
Attributes
xyes
SVGPathSegLinetoRel
Attributes
xyes
yyes
SVGPathSegLinetoVerticalAbs
Attributes
yyes
SVGPathSegLinetoVerticalRel
Attributes
yyes
SVGPathSegList
Attributes
numberOfItemsyes
Operations
clearyes
initializeyes
getItemyes
insertItemBeforeyes
replaceItemyes
removeItemyes
appendItemyes
SVGPathSegMovetoAbs
Attributes
xyes
yyes
SVGPathSegMovetoRel
Attributes
xyes
yyes
SVGPatternElement
Attributes
heightyes
patternContentUnitsyes
patternTransformno
patternUnitsyes
widthyes
xyes
yyes
SVGPoint
Attributes
xyes
yyes
Operations
matrixTransformpartialNot implemented for any SVGPoint in an SVGPointList.
SVGPointList
Attributes
numberOfItemsyes
Operations
clearyes
initializeyes
getItemyes
insertItemBeforeyes
replaceItemyes
removeItemyes
appendItemyes
SVGPolygonElement
SVGPolylineElement
SVGPreserveAspectRatio
Attributes
alignyes
meetOrSliceyes
SVGRadialGradientElement
Attributes
cxyes
cyyes
fxyes
fyyes
ryes
SVGRect
Attributes
heightyes
widthyes
xyes
yyes
SVGRectElement
Attributes
heightyes
rxyes
ryyes
widthyes
xyes
yyes
SVGRenderingIntent
SVGScriptElement
Attributes
typeyes
SVGSetElement
SVGStopElement
Attributes
offsetyes
SVGStringList
Attributes
numberOfItemsno
Operations
clearno
initializeno
getItemno
insertItemBeforeno
replaceItemno
removeItemno
appendItemno
SVGStylable
Attributes
classNameyes
styleyes
Operations
getPresentationAttributeyes
SVGStyleElement
Attributes
mediayes
titleyes
typeyes
xmlspaceyes
SVGSVGElement
Attributes
contentScriptTypeyes
contentStyleTypeyes
currentScaleyes
currentTranslateyes
currentViewno
heightyes
pixelUnitToMillimeterXyes
pixelUnitToMillimeterYyes
screenPixelToMillimeterXyes
screenPixelToMillimeterYyes
useCurrentViewno
viewportyes
widthyes
xyes
yyes
Operations
suspendRedrawyes
unsuspendRedrawyes
unsuspendRedrawAllyes
forceRedrawyes
pauseAnimationsyes
unpauseAnimationsyes
animationsPausedyes
getCurrentTimeyes
setCurrentTimeyes
getIntersectionListyes
getEnclosureListyes
checkIntersectionyes
checkEnclosureyes
deselectAllyes
createSVGNumberyes
createSVGLengthyes
createSVGAngleyes
createSVGPointyes
createSVGMatrixyes
createSVGRectyes
createSVGTransformyes
createSVGTransformFromMatrixyes
getElementByIdyes
SVGSwitchElement
SVGSymbolElement
SVGTests
Attributes
requiredExtensionsno
requiredFeaturesno
systemLanguageno
Operations
hasExtensionno
SVGTextContentElement
Attributes
lengthAdjustyes
textLengthyes
Operations
getNumberOfCharsyes
getComputedTextLengthyes
getSubStringLengthyes
getStartPositionOfCharyes
getEndPositionOfCharyes
getExtentOfCharyes
getRotationOfCharyes
getCharNumAtPositionyes
selectSubStringyes
SVGTextElement
SVGTextPathElement
Attributes
methodyes
spacingyes
startOffsetyes
SVGTextPositioningElement
Attributes
dxyes
dyyes
rotateyes
xyes
yyes
SVGTitleElement
SVGTransform
Attributes
angleyes
matrixyes
typeyes
Operations
setMatrixyes
setTranslateyes
setScaleyes
setRotateyes
setSkewXyes
setSkewYyes
SVGTransformable
Attributes
transformyes
SVGTransformList
Attributes
numberOfItemsyes
Operations
clearyes
initializeyes
getItemyes
insertItemBeforeyes
replaceItemyes
removeItemyes
appendItemyes
createSVGTransformFromMatrixyes
consolidateyes
SVGTRefElement
SVGTSpanElement
SVGUnitTypes
SVGURIReference
Attributes
hrefyes
SVGUseElement
Attributes
animatedInstanceRootno
heightyes
instanceRootno
widthyes
xyes
yyes
SVGViewElement
Attributes
viewTargetno
SVGViewSpec
Attributes
preserveAspectRatioStringno
transformno
transformStringno
viewBoxStringno
viewTargetno
viewTargetStringno
SVGVKernElement
SVGZoomAndPan
Attributes
zoomAndPanyes
SVGZoomEvent
Attributes
newScaleno
newTranslateno
previousScaleno
previousTranslateno
zoomRectScreenno
+
+ + + +

ECMAScript objects

+
+

+ In addition to the host objects exposed to ECMAScript that implement + the SVG DOM, the following objects are also available. +

+
+
Global object
+
Properties
+
document
+
+ +

+ The current SVG document. +

+ +
+
event
+
+ +

+ The most recently dispatched event object. +

+ +
+
evt
+
+ +

+ An alias for event. +

+ +
+
window
+
+ +

+ The global object (a self-reference). +

+ +
+
Function properties
+
alert(message) +
+
+ +

+ Displays an alert dialog with the specified message. +

+ +
+
clearInterval(intervalID) +
+
+ +

+ Cancels an interval that was set by a call to + setInterval. The intervalID + must be an object that has been returned by a previous + setInterval call. +

+ +
+
clearTimeout(timeoutID) +
+
+ +

+ Cancels a timeout that was set by a call to + setTimeout. The timeoutID must be + an object that has been returned by a previous + clearTimeout call. +

+ +
+
confirm(message) +
+
+ +

+ Displays a confirmation dialog with the specified + message. The window has an OK and a Cancel button. + The function returns true if the user clicks on the OK + button, and false otherwise. +

+ +
+
getURL(uri, function[, encoding]) +
+
+ +

+ Gets data from the given uri. This method returns + immediately and the given function is called when the + data is fully downloaded. The optional encoding + argument is the encoding to assume the data is in, defaulting to + UTF-8. The argument passed to the function is an object with + three properties: +

+ +
+ +
success
+ +
+true if the data is available, false otherwise.
+ +
contentType
+ +
The content type of the data, if it is known by the implementation.
+ +
content
+ +
A string holding the data.
+ +
+ +
+
parseXML(text, document) +
+
+ +

+ Parses and returns a DocumentFragment object. + text is the string that is to be parsed as XML + data, and document is a Document + that will be used for creating new DOM objects. +

+ +
+
prompt(message[, defaultValue]) +
+
+ +

+ Displays an input dialog with the specified message. + The defaultValue parameter specifies the initial + contents of the text box in the window. The function returns the + string entered by the user, or null if the window was cancelled. +

+ +
+
setInterval(script, interval) +
+
+ +

+ Evaluates the given script repeatedly after the + specified amount of time. The value for script must + be either a string, which is evaluated by eval + every interval, or an ECMAScript function object, which is called + every interval. This method does not stall the script: the + evaluation is scheduled and the script continues its execution. + The function returns an object that can be passed to the + clearInterval function. +

+ +
+
setTimeout(script, timeout) +
+
+ +

+ Evaluates the given script after the + specified amount of time. The value for script must + be either a string, which is evaluated by eval + after the timeout, or an ECMAScript function object, which is called + after the timeout. This method does not stall the script: the + evaluation is scheduled and the script continues its execution. + The function returns an object that can be passed to the + clearInterval function. The function returns an object + that can be passed to the clearTimeout function. +

+ +
+
+
+ + + +
 
+ + + + diff --git a/bin/svg_kit/batik-1.7/docs/tools/browser.html b/bin/svg_kit/batik-1.7/docs/tools/browser.html new file mode 100644 index 0000000..8848761 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/tools/browser.html @@ -0,0 +1,871 @@ + + + + + + + +Squiggle, the SVG Browser + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Squiggle, the SVG Browser

+ + +

+ This page describes the main features of Squiggle, the SVG browser that + comes with Batik. +

+ + + +

Downloading the browser

+
+

+ Refer to the download page to find out + how to download Batik. Refer to the + installation page for + instructions on how to install the Batik download on your system. +

+
+ + + +

Starting the browser

+
+

+ The method for starting the browser depends on the distribution of Batik + that you chose to download. The following describes how to start the + browser for each distribution (binary and source). +

+ +

Starting the browser for the binary distribution

+

+ If you downloaded the binary + distribution of Batik, you should have a file called + batik-1.6.zip (or similar), which, when expanded, + created a batik-squiggle.jar file. To start the browser, + type the following on the command line: +

+
cd installation-directory
+java -jar batik-squiggle.jar
+

You can pass options on the command line:

+
java -jar batik-squiggle.jar [-font-size font-size] [URIs]
+
+

where:

+
+ +
+-font-size font-size +
+ +
+ +

specifies the font size to use in windows and menus, and

+ +
+ +
+[URIs] +
+ +
+ +

specifies the URIs for the SVG documents the browser should open + when it starts.

+ +
+ +
+

For example:

+
java -jar batik-squiggle.jar -font-size 10
+

starts the browser with a small widget text font size, and:

+
java -jar batik-squiggle.jar -font-size 10 samples/batikLogo.svg
+

starts the browser with the batikLogo.svg file open and + uses a small widget text font size.

+

+ If you are using Mac OS X, and you have generated the Squiggle + application bundle, you can use its icon to start the browser. + This is the preferred way to start the browser under Mac OS X, + as it ensures better integration with the operating system + (a nicer looking menu and dock icon). +

+ +

Starting the browser for the source distribution

+

+ If you downloaded the source + distribution of Batik, you should have a zip file + called batik-src-1.6.zip (or similar) that expanded into + a directory called xml-batik or + batik-version. In that directory, you can find + build scripts for the platform you are running on. For example, there + is a build.bat script for users of the Windows platform + and there is a build.sh script for UNIX users. +

+

+ To start the browser you should: +

+
    + +
  • + Make sure that your JAVA_HOME environment variable is + set to your JDK installation directory +
  • + +
  • + Open a command line window and change to the xml-batik + or batik-version directory where the Batik + distribution was expanded +
  • + +
  • + +

    + For Windows, type the following at the command prompt: +

    + +
    build squiggle
    + +

    + and for Unix and Mac OS X: +

    + +
    ./build.sh squiggle
    + +

    This will start the browser.

    + +
  • + +
+

You can pass options to the browser as follows, for Windows:

+
build squiggle [-font-size font-size] [URIs]
+
+

and for Unix:

+
./build.sh squiggle [-font-size font-size] [URIs]
+
+

+ Refer to “Starting the browser for the + binary distribution” for an explanation of these options. +

+

+ Note that the number of files that can be opened on Windows from the + command line is limited because batch files take at most 9 + parameters. +

+ +

Squiggle screenshot

+

+ The following image shows the result of starting the browser, from the + binary or source distribution, with the -font-size 10 + samples/batikFX.svg options. +

+
+Screenshot of Squiggle showing the batikFX.svg sample +
+
+ + + +

Viewing SVG documents

+
+

+ The browser has several features to view and browse SVG documents: +

+ + +

Opening a local SVG file

+

+ In situations where you want to open SVG files locally on the machine + where you are running Squiggle, you can use File→Open + File menu item to open that file, or use the + Ctrl-F key accelerator. Doing so brings up a file + chooser that lets you select the file you want to view. +

+
+Screenshot of Squiggle showing the 'File→Open' menu and file chooser +
+ +

Opening an SVG file from the web

+

+ There are many situations where the SVG content you want to view is + not local to the machine where Squiggle is running. In that case, you + can use the File→Open Location menu item, or + use the Ctrl-A key accelerator to open that page. + Doing so brings up a dialog box where you can type in the URL for the + file you want to view. +

+
+Screenshot of Squiggle showing the 'File→Open Location' menu and window +
+ +

Using the location bar text field to view an SVG file

+

+ When you know the URL of the document you want to view, + you can enter it directly in the location bar text field + at the top of Squiggle, the same way you can enter a URL + in an HTML browser. +

+
+Screenshot of Squiggle showing the location bar +
+ +

Browsing SVG files

+

+ As with HTML content, it is common to navigate back and forth between + SVG files (remember that SVG files contain hyperlinks, just like HTML + does) and, as described later in this document, it is possible to + zoom into SVG documents, + pan and rotate. +

+
+Screnshot of Squiggle showing the 'Go' menu +
+

+ Squiggle offers multiple features to help you browse SVG files: +

+
+ +
Navigating between files
+ +
+ +

+ The Go→Back menu item (or the + Ctrl-left arrow keyboard accelerator) and the + Go→Forward menu item (or the + Ctrl-right arrow keyboard accelerator) let you + move to the previous and next visited SVG documents. +

+ +
+ +
History
+ +
+ +

+ The Go menu also contains a list of previously + viewed SVG documents, which gives you a way to randomly access any + document you have already visited. +

+ +
+ +
Navigating between views
+ +
+ +

+ The View→Previous Transform menu item + (Ctrl-K) and the View→Next + Transform menu item (Ctrl-L) let you go + to the previous or next view of the document. This is useful when, + for example, you pan or + rotate the document and want to go back to + the previous view you had of the document (i.e., before you panned + or rotated it). +

+ +
+ +
+ +

Viewing multiple SVG files

+
+Screenshot of Squiggle with two windows open +
+

+ Squiggle can display multiple files simultaneously in different + windows. To view a new file in a separate window, simply select the + File→New Window menu item or use the + Ctrl-N keyboard accelerator. +

+ +

Reloading an SVG document

+

+ When working on an SVG document, you may want the browser to reprocess + a document that you have modified. The File→Reload + Document menu item or the Ctrl-R keyboard + accelerator will cause the document to be reprocessed by the browser. +

+
+ + + +

Exporting and printing SVG documents

+
+

+ The File→Print menu item or + Ctrl-P will print the currently displayed SVG document. +

+

+ The File→Export As menu item offers the option + to export the currently displayed SVG document to various raster + formats. Currently, the browser supports the + PNG, + JPEG and + TIFF formats. +

+
+ + + +

Inspecting the SVG source

+
+

+ The browser offers two ways to inspect the source of an SVG document: + viewing the plain source or + viewing the document tree. Both are explained + below. +

+ +

Viewing the source

+
+Screenshot of Squiggle showing the 'View→View Source' menu item and the source window +
+

+ When the browser displays an SVG file, you can select the + View→View Source... menu item or use the + Ctrl-U keyboard accelerator to view the source code. +

+ +

Viewing the document tree

+
+Screenshot of Squiggle showing the 'View→DOM Viewer...' menu item and the DOM viewer window +
+

+ When the browser displays an SVG file, you can select the + View→DOM Viewer... menu item or use the + Ctrl-D keyboard accelerator to open a window that + shows the SVG document in the form of a tree. The window lets you + navigate the tree, select individual elements, such as a path + elements, and view the attributes and CSS values that apply to these + elements. While the View Source window shows the SVG source as it + was when it was loaded, the DOM Viewer window reflects the current + state of the document, including any modifications that have occurred + due to script. +

+
+ + + +

Configuring Squiggle

+
+

+ The Edit→Preferences menu item or + Ctrl-G brings up the dialog box shown in the following + figure. +

+
+Screenshot of Squiggle with the Preferences window open +
+

+ This dialog contains several types of options, which can be selected + with the left-hand side list. For each type of option, a panel lets you + configure various browser parameters: +

+
+ +
General panel
+ +
+ +

+ This panel lets you choose some optional behavior: +

+ +
+ +
Enable double buffering
+ +
+ When on, the browser uses additional memory resources + which improves the quality of effects such as zooming and panning. +
+ +
Show Rendering
+ +
+ When on, the browser will update the canvas while processing an + SVG document. This turns on progressive rendering. +
+ +
Automatically resize window to document size
+ +
+ When on, the browser window is resized to fit any newly loaded + document. +
+ +
Animation rate limiting
+ +
+ This set of radio buttons determines how often animation + updates are performed. This can be set as a maximum percentage + of CPU time to use, a maximum number of frames per second, or + to perform as many updates as possible (unlimited). +
+ +
Print debugging information to console
+ +
+ When on, some debug messages will be printed to the standard + output. This is will likely interest only developers. +
+ +
Use a validating XML parser
+ +
+ When on, the XML parser used to load documents will be in + validating mode. This means that the document will be validated + against the DTD when it is loaded, and external DTD subsets + will be fetched. +
+ +
+ +
+ + +
Security panel
+ +
+ +

+ This panel has options relating to the script and resource + access in documents. +

+ +
+ + +
Language panel
+ +
+ +

+ This is the panel shown in the above figure. That panel lets you + select your languages. The user language can be used in SVG documents + to choose between alternate contents. For example, open the + samples/moonPhases.svg example. Then, change the user + language to French and reload the document + (Ctrl-R). You will see that the text is now + displayed in French. You can do the same with Japanese and the text + will be shown in Japanese. +

+ +
+ + +
Stylesheet panel
+ +
+ This panel lets you specify a user stylesheet which can override some + of the default settings in viewed SVG documents. This might be useful + if you want, for example, to override the font size used in text + elements. +
+ + +
Network panel
+ +
+ +

+ This panel lets you configure the proxy server to use if you are + working from behind a firewall. +

+ +
+ +
+
+ + + +

Navigating SVG documents: zooming, panning, rotating, transform and thumbnail

+
+

+ The Batik browser offers multiple way to navigate SVG documents: +

+ + +

Zooming in and out

+

+ There are several methods to zoom in or out an SVG document: +

+
    + +
  • + You can select the View→Zoom In or + View→Zoom Out menu item. +
  • + +
  • + You can click on the Zoom In/Out + tool bar buttons (the ones that show a magnifying glass with + +/- signs). +
  • + +
  • + You can use the Ctrl+I and Ctrl+O + keyboard accelerators. +
  • + +
  • + If the mouse is over the document in the display area, you can press + the Ctrl key then click the left mouse + button and drag to select the area of interest in the + document. This can only be used to zoom into a document. +
  • + +
  • + If the mouse is over the document in the display area, you can press + the Shift key then click the right mouse + button and drag it. This is called the real time + zoom and can be used both for zooming in and out. +
  • + +
+
+Screenshot of Squiggle showing the Zoom In and Zoom Out menu items and tool bar buttons +
+
+Screenshot of Squiggle zooming to an area of interest +
+ +

Panning a document

+

+ Some documents are too big to fit into the browser, especially when + you zoom in with a large zoom factor. In + these circumstances, it is useful to be able to move around the + document and pan to view different parts of the documents. Again, + there are multiple ways to do this: +

+
    + +
  • + With the mouse cursor over the SVG document, press the Shift + key and then click and drag the left mouse + button to a new location. When you release the mouse, the + document will be translated to the new mouse location. +
  • + +
  • + If you have the thumbnail open, you can + select the marker showing the current area of interest and move it + to the desired location. +
  • + +
+
+Screenshot of Squiggle illustrating the panning gesture +
+ +

Rotating a document

+

+ It is sometimes useful to be able to rotate a document (maps for + example). You can do this in the Batik browser by first pressing the + Ctrl key and then clicking and dragging + the right mouse button to a new location. The browser will + dynamically rotate the image as you move your cursor. When you are + satisfied with that angle, you can release the mouse button and the + document will be displayed with that new angle. +

+ +

Using the Transform dialog

+

+ While the mouse and keyboard interactions give interactive way to + navigate an SVG document, it is sometimes desirable to be able to + define precisely the amount of zoom, + pan or rotation + desired. The Transform dialog, available through the + View→Transform menu (Ctrl-E) + offers that feature. +

+ +

Thumbnail

+

+ Panning in the document window can be difficult after you have zoomed + into a document because you cannot see the whole document. Panning on + large documents (or with a large zoom factor) is made easy by the + thumbnail that you can bring up through the + View→Thumbnail menu item or + the Ctrl-Y keyboard accelerator. The thumbnail shows + a rectangular marker that represents the “Area of Interest”, i.e., + the region currently displayed in the window (the visible portion of + the document). You can drag out a rectangular marker with the + left mouse button pushed down to select a new area of + interest which will then be shown in the main window. +

+
+Screenshot of Squiggle showing the Thumbnail window +
+
+ + +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/tools/font-converter.html b/bin/svg_kit/batik-1.7/docs/tools/font-converter.html new file mode 100644 index 0000000..5a54021 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/tools/font-converter.html @@ -0,0 +1,299 @@ + + + + + + + +SVG Font Converter + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

SVG Font Converter

+ + +

+ The TrueType Font to SVG (ttf2svg) application lets you + convert a range of characters from a TrueType Font into the SVG font + format. +

+ + + +

Running the font converter

+
+

+ If you are using the Batik binary distribution, type the following at + the command line: +

+
java -jar batik-ttf2svg.jar OPTIONS
+
+

+ If you are using the Batik source distribution, type the following at + the command line: +

+
build ttf2svg OPTIONS
+
+

+ In both cases, the options are the same: +

+
+ttf-path [-l range-begin] [-h range-end] [-ascii] [-id id] [-o output-path] [-testcard]
+
+

+ where: +

+
+ +
+ttf-path +
+ +
+ +

specifies the TrueType Font file containing the characters to be + converted,

+ +
+ +
+-l range-begin -h range-end +
+ +
+ +

specifies the range of characters (by codepoint, in decimal) to be + converted,

+ +
+ +
+-ascii +
+ +
+ +

forces usage of the ASCII character map in the font, instead of the + Unicode character map,

+ +
+ +
+-id id +
+ +
+ +

specifies the value for the id attribute of the generated + font element,

+ +
+ +
+-o output-path +
+ +
+ +

specifies the pathname of the output SVG document containing the + generated SVG font, and

+ +
+ +
+-testcard +
+ +
+ +

specifies that a sequence of SVG text elements should be + appended to the output SVG file to test the characters in the SVG + font, providing an easy way to validate that generated SVG + font visually.

+ +
+ +
+

+ For example: +

+
java -jar batik-ttf2svg.jar /usr/home/myFont.ttf -l 48 -h 57 -id MySVGFont -o mySVGFont.svg -testcard
+

+ will convert characters 48 to 57, i.e., '0' to + '9', in the myFont.ttf file into their SVG + equivalent in the mySVGFont.svg file, appending a test + card so that the font can be visualized. +

+
+ + + + + +

Use cases

+
+

+ The TrueType Font converter application is helpful to be able to embed + font definitions in SVG files. This will ensure that the SVG document + will look exactly the same on all platform by not relying on system + fonts. +

+

+ Note that users of the tool should make sure that they have the right + to embed the font before embedding it in an SVG file and should refer + to the font license for information. Note that TrueType Font files + contain a flag that defines the “embeddability” of a font and there are + tools for checking that flag. +

+
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerAOI.png b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerAOI.png new file mode 100644 index 0000000..0965503 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerAOI.png differ diff --git a/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerBrowsing.png b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerBrowsing.png new file mode 100644 index 0000000..24fe17c Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerBrowsing.png differ diff --git a/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerDefaultRegular.png b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerDefaultRegular.png new file mode 100644 index 0000000..bb8680a Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerDefaultRegular.png differ diff --git a/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerFileOpen.png b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerFileOpen.png new file mode 100644 index 0000000..57df57a Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerFileOpen.png differ diff --git a/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerLocationBar.png b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerLocationBar.png new file mode 100644 index 0000000..373b96c Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerLocationBar.png differ diff --git a/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerMultipleFiles.png b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerMultipleFiles.png new file mode 100644 index 0000000..23862df Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerMultipleFiles.png differ diff --git a/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerOpenPage.png b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerOpenPage.png new file mode 100644 index 0000000..ff97c9a Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerOpenPage.png differ diff --git a/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerPan.png b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerPan.png new file mode 100644 index 0000000..0402743 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerPan.png differ diff --git a/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerPreferences.png b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerPreferences.png new file mode 100644 index 0000000..0a86766 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerPreferences.png differ diff --git a/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerThumbnail.png b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerThumbnail.png new file mode 100644 index 0000000..9741e6d Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerThumbnail.png differ diff --git a/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerViewSource.png b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerViewSource.png new file mode 100644 index 0000000..b7ba7d8 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerViewSource.png differ diff --git a/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerViewTree.png b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerViewTree.png new file mode 100644 index 0000000..dd8f460 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerViewTree.png differ diff --git a/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerZoomin.png b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerZoomin.png new file mode 100644 index 0000000..4245408 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/tools/images/svgviewerZoomin.png differ diff --git a/bin/svg_kit/batik-1.7/docs/tools/index.html b/bin/svg_kit/batik-1.7/docs/tools/index.html new file mode 100644 index 0000000..ebd0020 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/tools/index.html @@ -0,0 +1,223 @@ + + + + + + + +About the tools + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

About the tools

+ +

+ The Batik distribution contains several pre-packaged demos: +

+ +
+ +
Squiggle SVG Browser
+ +
+ +

+ The Squiggle SVG Browser lets you view SVG + file, zoom, pan and rotate in the content and select text items in the + image and much more. +

+ +
+ +
SVG Rasterizer
+ +
+ +

+ The SVG Rasterizer is a utility that can + convert SVG files to a raster format. The tool can convert individual + files or sets of files, making it easy to convert entire directories + of SVG files. The supported formats are JPEG, + PNG, and + TIFF, however the design + allows new formats to be added easily. In addition (and despite the + name) the rasterizer tool can also convert SVG files into + PDF. +

+ +
+ +
SVG Font Converter
+ +
+ +

+ The SVG Font Converter lets + developers convert character ranges from the True Type Font format to + the SVG Font format to embed in SVG documents. This allows SVG + document to be fully self-contained and have their rendered + identically on all systems. +

+ +
+ +
SVG Pretty Printer
+ +
+ +

+ The SVG Pretty Printer lets + developers “pretty-up” their SVG files and get their tabulations and + other cosmetic parameters in order. It can also be used to modify the + DOCTYPE declaration on SVG files. +

+ +
+ +
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/tools/pretty-printer.html b/bin/svg_kit/batik-1.7/docs/tools/pretty-printer.html new file mode 100644 index 0000000..21c4768 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/tools/pretty-printer.html @@ -0,0 +1,378 @@ + + + + + + + +SVG Pretty Printer + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

SVG Pretty Printer

+ + +

+ This page describes the features of the SVG pretty printer utility that + comes with the Batik distribution. The SVG pretty printer is a utility + that can format SVG files. The tool formats an SVG document according to + the arguments passed on the command line. +

+ + + +

Downloading the pretty printer

+
+

+ Refer to the install page and the + download page to find out what to + download and how to download it. Remember that you can get either the + source or binary distribution. +

+
+ + + +

Pretty printing an SVG file

+
+

+ The method for starting the pretty-printer depends on the distribution + of Batik that you chose to download. The following describes how to + run the pretty printer for each distribution. +

+ +

Using the binary distribution

+

+ If you downloaded the binary distribution of Batik, you should have + a file called batik-1.6.zip (or similar), and, after + expanding that file, a jar file called batik-svgpp.jar. + To start the pretty printer, open a console, change to the directory + where you expanded the distribution (and where + batik-svgpp.jar is located) and simply type the following + at the command prompt: +

+
java -jar batik-svgpp.jar [OPTIONS] FILES
+
+

For example, if you type:

+

+java -jar batik-svgpp.jar samples/batikFX.svg +

+

you will see the indented document written to standard output.

+

For the options:

+
+ +
+-newline cr|cr-lf|lf +
+ +
+ +

specifies the newline character(s) generated in the printed + document, the default being lf (Unix-style + newlines),

+ +
+ +
+-tab-width number +
+ +
+ +

specifies the tabulation width, the default being 4,

+ +
+ +
+-doc-width number +
+ +
+ +

specifies the maximum number of columns for the whole document, + the default being 80,

+ +
+ +
+-no-format +
+ +
+ +

specifies that the current indentation should be preserved, + useful for performing doctype or newline substitutions,

+ +
+ +
+-xml-decl string +
+ +
+ +

specifies the XML declaration,

+ +
+ +
+-doctype change|remove +
+ +
+ +

specifies whether the doctype should be changed or removed,

+ +
+ +
+-publid-id string +
+ +
+ +

specifies the public ID to in the doctype declaration, when + -doctype change is specified, and

+ +
+ +
+-system-id string +
+ +
+ +

specifies the system ID to in the doctype declaration, when + -doctype change is specified.

+ +
+ +
+

For example:

+
java -jar batik-svgpp.jar -tab-width 2 -newline cr-lf src.svg dest.svg
+

+ will format src.svg and write it to + dest.svg using a tabulation width of 2 and Windows-style + newlines, and: +

+
java -jar batik-svgpp.jar -no-format -doctype change -public-id "-//W3C//DTD SVG 1.1//EN" \
+     -system-id "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" src.svg dest.svg
+

+ will format src.svg and write it to + dest.svg unchanged, except for the doctype public and + system IDs, which will be replaced by those specified. +

+ +

Using the source distribution

+

+ If you downloaded the source distribution of Batik, you will have a + zip or tar file that expanded into a directory called + xml-batik or batik-version. In that + directory, you can find build scripts for the platform you are running + on. For example, there is a build.bat script for users of + the Windows platform and there is a build.sh script for + UNIX users. +

+

+ To start the pretty printer you should: +

+
    + +
  • + +

    Make sure that your JAVA_HOME environment + variable is set to your JDK installation directory.

    + +
  • + +
  • + +

    Open a command line window and go to the xml-batik + or batik-version directory where the Batik + distribution was expanded.

    + +
  • + +
  • + +

    For windows, type the following at the command prompt:

    + +
    build svgpp
    + +

    and for Unix:

    + +
    ./build.sh svgpp
    + +

    This will print out a help message for the pretty printer.

    + +
  • + +
+

You can pass options to the rasterizer as follows, for Windows:

+
build svgpp [OPTIONS] FILES
+
+

and for Unix:

+
./build.sh svgpp [OPTIONS] FILES
+
+

Refer to “Using the binary distribution” + for an explanation of these options.

+
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/tools/rasterizer.html b/bin/svg_kit/batik-1.7/docs/tools/rasterizer.html new file mode 100644 index 0000000..9ebbeb6 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/tools/rasterizer.html @@ -0,0 +1,869 @@ + + + + + + + +SVG Rasterizer + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

SVG Rasterizer

+ + +

+ This page describes the features of the SVG Rasterizer utility that + comes with the Batik distribution. The SVG Rasterizer is a utility that + can convert SVG files to a raster format. The tool can convert individual + files or sets of files, making it easy to convert entire directories of + SVG files. The provided formats are + JPEG, + PNG and + TIFF, however the design + allows new formats to be added easily. In addition, the rasterizer can + (despite its name) transcode to + PDF. +

+ + + +

Downloading the rasterizer

+
+

+ Refer to the install page and + the download area to find out what to + download and how to install it. Remember that you can get either the + source or binary distribution. +

+
+ + + +

Rasterizing one or several SVG files

+
+

+ The method for starting the rasterizer depends on the distribution of Batik + that you chose to download. The following describes how to start the viewer + for each distribution. +

+ +

Using the binary distribution

+

+ If you downloaded the binary distribution of Batik, you should have + a file called batik-1.6.zip (or similar), and, after + expanding that file, a jar file called + batik-rasterizer.jar. To start the rasterizer, open a + console, go to the directory where you expanded the distribution (and + where batik-rasterizer.jar is located) and simply type + the following at the command prompt: +

+
java -jar batik-rasterizer.jar FILES
+
+

+ For example, if you type: +

+
java -jar batik-rasterizer.jar samples/batikFX.svg
+

+ you will see the following printout: +

+
Converting file: samples/BatikFX.svg to samples/BatikFX.png
+

+ Once the conversion is complete, you will find a + batikFX.png file in the samples directory. +

+

+ You can pass options on the command line: +

+
java -jar batik-rasterizer.jar [OPTIONS] FILES
+
+

+ where, as options: +

+
+ +
+-d dir|file +
+ +
+ +

+ specifies the output directory, or the output file if there is + only a single input file, +

+ +
+ +
+-m mime-type +
+ +
+ +

+ specifies the output MIME type, which must be one of + image/png, image/jpeg, + image/tiff or application/pdf, +

+ +
+ +
+-w width +
+ +
+ +

+ specifies the output width as a floating point value, +

+ +
+ +
+-h height +
+ +
+ +

+ specifies the output height as a floating point value, +

+ +
+ +
+-maxw width +
+ +
+ +

+ specifies the maximum output width as a floating point value, +

+ +
+ +
+-maxh height +
+ +
+ +

+ specifies the maximum output height as a floating point value, +

+ +
+ +
+-a x,y,width,height +
+ +
+ +

specifies the area of interest (as floating point values) of the + SVG file to rasterize (and if not specified, will be determined + by the width/height/viewBox + attributes if specified in the document, and be 0,0,400,400 otherwise),

+ +
+ +
+-bg alpha.red.green.blue +
+ +
+ +

specifies the background fill color as an ARGB quadruple, where + each component is an integer in the range 0—255,

+ +
+ +
+-cssMedia media +
+ +
+ +

specifies the CSS media type used for matching CSS rules,

+ +
+ +
+-cssAlternate file|uri +
+ +
+ +

specifies the CSS alternate stylesheet to use,

+ +
+ +
+-cssUser file|uri +
+ +
+ +

specifies the CSS user stylesheet to use in addition to any + other referenced or embedded stylesheets,

+ +
+ +
+-lang language-code +
+ +
+ +

specifies the + RFC 3066 + language code to use,

+ +
+ +
+-q quality +
+ +
+ +

specifies the quality of the output image, as a floating point + number in the range 0 < quality < 1 when generating + JPEG images,

+ +
+ +
+-dpi resolution +
+ +
+ +

specifies the resolution of the output image in dots per inch,

+ +
+ +
+-validate +
+ +
+ +

specifies that the source SVG files must be validated against + their DTDs,

+ +
+ +
+-onload +
+ +
+ +

specifies that the SVG files should be rasterized after + dispatching the SVG load event,

+ +
+ +
+-scriptSecurityOff +
+ +
+ +

specifies that any security checks on the scripts running as a + result of dispatching the SVG load event will be bypassed, and

+ +
+ +
+-scripts allowed-script-types +
+ +
+ +

specifies a list of script types (i.e., values for the + type attribute on script elements) + that should be loaded.

+ +
+ +
+

+ For example: +

+
java -jar batik-rasterizer.jar -d myDir -m image/jpeg samples/*.svg
+

+ will generate JPEG images for all the SVG files found in the samples + directory. +

+ +

Using the source distribution

+

+ If you downloaded the source distribution of Batik, you got a zip or + tar file that expanded into a directory called xml-batik + or batik-version. In that directory, you can + find build scripts for the platform you are running on. For example, + there is a build.bat script for users of the Windows + platform and there is a build.sh script for UNIX users. +

+

+ To start the rasterizer you should: +

+
    + +
  • + Make sure that your JAVA_HOME environment variable is + set to your JDK installation directory. +
  • + +
  • + Open a command line window and go to the xml-batik + or batik-version directory where the Batik + distribution was expanded. +
  • + +
  • + +

    For windows, type the following at the command prompt:

    + +
    build svgrasterizer
    + +

    and for Unix:

    + +
    ./build.sh svgrasterizer
    + +

    This will print out a help message for the rasterizer.

    + +
  • + +
+

+ You can pass options to the rasterizer as follows, for Windows: +

+
build svgrasterizer [OPTIONS] FILES
+
+

+ and for Unix: +

+
./build.sh svgrasterizer [OPTIONS] FILES
+
+

+ Refer to “Using the binary distribution” + for an explanation of the options. +

+
+ + + +

Rasterizer Ant task

+
+

+ The Rasterizer task is an Ant + version of the rasterizer utility. It fulfills the same basic + purpose as the utility but has a different syntax and a + slightly different set of features. +

+

+ The task is able to produce four raster formats: + PNG, + JPEG, + TIFF and + PDF. +

+ +

Using the rasterizer task

+

+ The first thing to do is to compile rasterizer task classes. + Download the source distribution of Batik and see the + README file in the + contrib/rasterizertask directory for more + instructions. The build procedure works the same way as when building + Batik itself. +

+

+ After building, ensure that the generated + batik-rasterizer.jar and the classes (or jar file) of the + rasterizer task are in your CLASSPATH. +

+

+ Next you have to define the task in your Ant project. To do this, add + the following line either after the project start tag or + after the target start tag in the target you are using + the rasterizer task: +

+
  <taskdef name="rasterize" 
+           classname="org.apache.tools.ant.taskdefs.optional.RasterizerTask"/>
+

+ Now you can use the rasterizer task in your project. See the + parameters section for an explanation of + the available parameters or the + examples section to see few usage examples. +

+ +

Parameters of the Ant task

+

+ The following table lists the attributes that may be specified on + the rasterize task element. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
result + Sets the type of the result image. Only one of the + following values must be used: image/png, + image/jpeg, image/tiff and + application/pdf. The value must be in + lowercase letters. + Yes
height + Sets the height of the result image in pixels. The task + calculates the height from the SVG file if this parameter has not + been set. The rasterizer keeps the aspect ratio of the SVG file + even if the both height and width have + been set. + No
width + Sets the width of the result image in pixels. The task calculates + the width from the SVG file if this parameter has not been set. + The rasterizer keeps the aspect ratio of the SVG file even if the + both height and width have been set. + No
maxheight + Sets the maximum height of the result image in pixels. The image + won’t be higher than defined in this parameter, regardless of the + size set in the image itself or in other parameters. This is a + floating point value. + No
maxwidth + Sets the maximum width of the result image in pixels. The image + won’t be wider than defined in this parameter, regardless of the + size set in the image itself or in other parameters. This is a + floating point value. + No
quality + Sets the quality of the produced image. The value must be + greater than 0 but smaller than 1, larger numbers meaning higher + quality. The quality value is used only with JPEG images. + The default quality value is 0.99. + No
area + Defines the area in the SVG file which will be rasterized. Parts + outside this area are discarded and don’t show in the result + image. The area attribute value has four integers separated by + commas. The first two integers set the x and y coordinates of + the upper left corner of the area, respectively. The last two + integers set the width and height of the area, respectively. For + example, 10, 20, 100, 200 sets the + rectangular area from point 10, 10 to point + 110, 220. The specified area is applied to all + images if more than one file is rasterized during one task. + No
bg + Sets the background color of the result image. The + bg attribute value is either three or four integers + separated with commas. The four values are alpha channel, red, + green, and blue, respectively. If only three values are given, + then the values are red, green, and blue and the alpha channel + is automatically set to 255 (opaque). All values have to between + 0 and 255. The default value is none which means that background + is transparent and not filled with any color. + No
media + CSS media type that is used to select a CSS stylesheet. The + selected stylesheet is then used to rasterize the SVG files. Only + the visual media group is supported (see the + CSS2 specification for more information + about media groups). The default value is screen. + No
dpi + Resolution for the result image. The attribute value is used to + compute the “pixel to millimeter” ratio used when processing SVG + files. The default value is 96. + No
lang + Language which is used select language specific areas from the + SVG file during the rasterizing process. The valid values are + defined in + RFC3066. The + default value is en. + No
src + Name of a one input file. Use this parameter to convert just one + file whose name and location are known. The dest + parameter must also be given. + + One of the following is required: src attribute, + srcdir attribute or fileset element(s). +
dest + Name of a one output file. Used this with src + parameter only. The output directory is created if it doesn’t + exist. + Required if src is used.
srcdir + Name of the input directory. srcdir and + fileset elements can be combined and + srcdir can be omitted if there is at least one + fileset child element. srcdir file + selection can be controlled with include, + exclude, etc. child elements. Note that without + control parameters the task tries to rasterize all files + in the given directory. + + One of the following is required: src attribute, + srcdir attribute or fileset element(s). +
destdir + Name of an output directory. Use this with the srcdir + attribute or fileset elements. The task generates + the names of the output images by changing the suffix of the + input file names to correspond the result image type. A suffix is + added if the input file doesn’t have one. Output directories are + created if they don’t exist. + + Required if srcdir attribute or + fileset elements are used. +
classname + Class name of the XML parser used to parse SVG images. The value + can be either the complete classname with package information + included or the special name jaxp, which means any + available parser in the CLASSPATH that supports JAXP. + See the Batik code for the default value. + No
+

+ You can use fileset elements to select input + files and directories. See the + Ant documentation to learn how + to use + filesets. +

+ +

Examples of using the rasterizer task

+

+ The following example is the complete Ant project that converts an SVG + image (called input.svg) to a PNG image (called + output.png): +

+
<?xml version="1.0"?>
+
+<project name="RasterizerExample" default="main" basedir=".">
+
+  <taskdef name="rasterize" 
+           classname="org.apache.tools.ant.taskdefs.optional.RasterizerTask"/>
+
+  <target name="main">
+    <rasterize result="image/png" src="input.svg" dest="output.png"/>
+  </target>
+</project>
+

+ The next example is just one task in a project. It converts all files + with a .svg suffix in the images directory and + all files in the images2 directory to TIFF images. The + resulting image files are placed in the results directory. +

+
  <rasterize result="image/tiff" destdir="results">
+    <fileset dir="images">
+      <include name="**/*.svg"/>
+    </fileset>
+    <fileset dir="images2"/>
+  </rasterize>
+
+ + +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/uses.html b/bin/svg_kit/batik-1.7/docs/uses.html new file mode 100644 index 0000000..3f1ac7c --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/uses.html @@ -0,0 +1,393 @@ + + + + + + + +Projects using Batik + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Projects using Batik

+ + +

Examples of projects and products using Batik

+
+

+ While it is hard to track projects and products which are using Batik, + here are a few that are known of: +

+
    + +
  • + +The Apache Cocoon project uses + Batik to rasterize SVG images. +
  • + +
  • + +The Apache FOP + project uses Batik to handle SVG images. It uses the SVG + rasterizer and extends the Batik transcoder architecture to offer + SVG to PDF conversion. +
  • + + +
  • + +eDoc Studio, a page layout + package, uses the Batik SVG generator to export pages to SVG. +
  • + +
  • + +ElixirTech’s + ElixirReport uses Batik for charting and for its SVG component. +
  • + +
  • + +GLIPS Graffiti is + an Open Source Extensible Full Feature Native SVG Editor. +
  • + +
  • + +ILOG Discovery + Preview, a free visual data analysis tool letting you visualize + and edit data sets in a very wide variety of views (2D graphs and + charts, various kinds of treemaps, parallel coordinates, parallel + histograms and much more), uses the Batik SVG export module. +
  • + +
  • + +ILOG JViews Component + Suite, a product for advanced visualization, uses and extends + the Batik SVG export module. +
  • + +
  • + +The + JFreeChart Project uses Batik to export charts in the SVG + format. +
  • + +
  • + +Lagoon, an XML-based + framework for web site maintenance, uses the Batik SVG Rasterizer to + render SVG as bitmap graphics for web publishing. +
  • + +
  • + +Lords Map + is a program to allow players and visitors to view the current map of + various campaigns. Lords Map uses Batik’s SVG DOM and SVG Generator. +
  • + +
  • + +Luxor XUL + is a free, open-source XML User Interface Language (XUL) toolkit in + Java released under the GNU GPL that supports hand-picked Mozilla XUL + goodies and also includes a ultra-lightweight, multi-threaded web + server, a portal engine, a scripting engine, a template engine and + much more. Gerard Bauer, the Luxor project lead, has written an + extensive + SVG + presentation. +
  • + +
  • + +OptimalJ, a UML Class Diagram + Editor for NetBeans, uses Batik to export SVG. +
  • + +
  • + +Oracle + Corp.’s JDeveloper10i uses Batik to export class diagrams in + SVG. It uses the SVG export module. +
  • + +
  • + +Sketsa is a vector drawing + application based on Batik. With Sketsa, you can create vector + graphics that can be scaled and printed at any resolution, without + losing detail or clarity. +
  • + +
  • + +Svolgo, a + Graph Visualisation/Transformation Framework for the Semantic Web + Cross-model transformation, node and arc diagrams, representation in + SVG. This project uses Batik’s SVG DOM implementation. +
  • + + +
  • + +Volity is an open platform for + Internet-based multiplayer casual gaming. Its official client, + Gamut, uses Batik, + allowing developers to create game UI files that use + ECMAScript-driven SVG. +
  • + +
  • + +XML_svg2image + is a PHP class which translates SVG files to PNG or JPEG using Batik. +
  • + +
  • + +XWeb, a tool to create websites + automatically out of XML input. Uses the Batik SVG Rasterizer. +
  • + +
+
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/using/architecture.html b/bin/svg_kit/batik-1.7/docs/using/architecture.html new file mode 100644 index 0000000..fbe9a9e --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/using/architecture.html @@ -0,0 +1,302 @@ + + + + + + + +Architecture overview + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Architecture overview

+ + +

This document briefly describes the Batik architecture and the role of each of + its modules. For detailed module design, you can refer to the + Batik UML diagrams Object by Design + or yWorks.

+ +

The Batik modules are of one of three types: + application modules, core modules and low level modules. + The following figure illustrates these three module types.

+ +
+Batik Architecture +
+ +

+Application modules illustrate how to use + the core modules and let users evaluate the Batik software by experimenting + with its features.

+ +

The Core modules are the heart of Batik and the primary deliverables for the + projects. These are the modules developers use to manipulate, generate, create, + convert, render and view SVG content.

+ +

Finally, the Low level modules are used internally by the core modules to + accomplish their work. These modules are not typically used by developers directly.

+ + + +

Application modules

+
+

As mentioned earlier, the application modules illustrate the functionality that Batik + offers.

+

For example, the SVG browser is built using several + Batik core modules (such as the JSVGCanvas GUI component and the ImageTranscoders) + and illustrates how Batik lets you not only view, zoom, pan and rotate SVG documents, but also search them + and convert them to other formats (such as JPEG, TIFF or PNG).

+

The SVG pretty printer is another example that shows how Batik + lets you manipulate and transform SVG content, here for the purposed of tidying up potentially + disorganized SVG files.

+

The SVG font converter illustrates how Batik can help you embed + SVG font definitions in an SVG file by providing an application that converts ranges of + characters from a TrueType Font format to the SVG font format.

+

Finally, the SVG rasterizer shows how to leverage the + transcoder API to convert to and from SVG content.

+

+ Note that even though the application modules are meant to be useful and fun to use, they + are not the primary deliverables of the Batik project. Instead, they are illustrations of how the + Batik core modules might be used and combined.

+
+ + + +

Core modules

+
+

The Batik core modules are the heart of the Batik architecture. They can be used individually + or in combination for various purposes, and the application modules + offer some usage examples. +

+
    + +
  • The SVG generator is a module containing + SVGGraphics2D + class, that lets all Java applications or applets easily convert their + graphics to the SVG format, as easily as they draw to a screen or a printer, + by leveraging the Java 2D API’s extensible design.
  • + +
  • +SVG DOM an implementation of the SVG DOM API defined + in the SVG recommendation. It lets the programmer manipulate SVG documents in a Java program.
  • + +
  • The Swing components module includes, primarily, the + JSVGCanvas + class, a UI component that can display SVG content and let the user + interact with that content (zoom, pan, rotate, select text, etc.).
  • + +
  • The Bridge module is rarely used directly. It is responsible for creating + and maintaining an appropriate object corresponding to an SVG element. The bridge converts an + SVG document into the internal representation Batik uses for graphics (GVT, the + Graphic Vector Toolkit).
  • + +
  • The transcoder is a module that provides a generic API for + transcoding an input to an output. This module transcodes an input stream or a document + into a particular ouput format, used for converting SVG documents to other types.
  • + +
+
+ + + +

Low level modules

+
+

The low level modules are not expected to be used directly by developers using the Batik + API. Rather, they support the operation of the core modules. The low level modules + include:

+
    + +
  • The Graphic Vector Toolkit (GVT) module, which represents a view of the DOM tree + that is more suitable for for rendering and event handling purposes. This module describes + DOM tree in terms of a tree of Java graphics objects.
  • + +
  • The Renderer module is responsible for rendering a GVT tree and any + related task. For example, a raster based renderer may perform + some caching (the default renderer in Batik does that). However, a renderer could perform + any task deemed necessary and does not have to be raster based.
  • + +
  • The SVG parser module contains parser classes for complex + SVG attributes such as the transform or color attributes. Higher level modules + rely on the SVG parser module.
  • + +
+
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/using/dom-api.html b/bin/svg_kit/batik-1.7/docs/using/dom-api.html new file mode 100644 index 0000000..28777eb --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/using/dom-api.html @@ -0,0 +1,407 @@ + + + + + + + +SVG DOM API + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

SVG DOM API

+ + +

+ The Document Object Model (DOM) + is an API for XML documents. It defines the logical structure of documents and + the way a document is accessed and manipulated. This page shows how to create + an SVG document using the DOM API. +

+ + + +

Getting started

+
+

+ The DOM API defines an interface called + DOMImplementation, + which represents the boostrap of any DOM implementation. The role of + this class is to bootstrap a particular implementation of the DOM by + providing a method to create a + Document. + Then, the concrete Document represents an XML document and + also acts like a factory for the various DOM objects such as + Element, + Attr + and + Text. +

+

+ How to get an instance of the DOMImplementation interface depends + on the DOM implementation you are using. In Batik, the DOM implementation is + located in the package org.apache.batik.dom.svg and the class is + named + SVGDOMImplementation. + The following example shows how to get a concrete + DOMImplementation object. +

+
import org.w3c.dom.DOMImplementation;
+import org.apache.batik.dom.svg.SVGDOMImplementation;
+
+DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
+

+ Once you have an instance of a DOMImplementation, you are not + relying on Batik-specific code any more and ready to use the DOM API. +

+
+ + + +

Creating a Document

+
+

+ Using the DOMImplementation, you are now able to create a + Document. The following example illustrates how to create an SVG + document. Note that the Batik’s DOM implementation can be + used to represent either an SVG document fragment or any kind of XML + document. Note that by choosing the namespace URI and the local name of + the root element of SVG, we are creating an SVG document. +

+
import org.apache.batik.dom.svg.SVGDOMImplementation;
+import org.w3c.dom.Document;
+
+// We are using a constant available on the SVGDOMImplementation,
+// but we could have used "http://www.w3.org/2000/svg".
+String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
+DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
+Document doc = impl.createDocument(svgNS, "svg", null);
+      
+
+

+ As we have created an SVG Document, we can cast this document to an + SVGDocument + (defined in the org.w3c.dom.svg package) if needed. +

+
+ + + +

Building an SVG Document

+
+

+ Finally, using the Document object, we are now able to + construct SVG content. Note that the document created before supports both + generic XML and SVG. Though the DOM implementation of Batik is an SVG DOM + implementation, the SVG-specific methods that rely on the document having + been rendered (particularly geometry related methods, such as + SVGLocatable.getBBox) + cannot be used at this point. +

+

+ The document can be built using DOM Level 2 Core methods. The following + example shows how to create a red rectangle located at (10, 20), with a + size of (100, 50) placed in a (400, 450) SVG canvas: +

+
+import org.apache.batik.dom.svg.SVGDOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
+String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
+Document doc = impl.createDocument(svgNS, "svg", null);
+
+// Get the root element (the 'svg' element).
+Element svgRoot = doc.getDocumentElement();
+
+// Set the width and height attributes on the root 'svg' element.
+svgRoot.setAttributeNS(null, "width", "400");
+svgRoot.setAttributeNS(null, "height", "450");
+
+// Create the rectangle.
+Element rectangle = doc.createElementNS(svgNS, "rect");
+rectangle.setAttributeNS(null, "x", "10");
+rectangle.setAttributeNS(null, "y", "20");
+rectangle.setAttributeNS(null, "width", "100");
+rectangle.setAttributeNS(null, "height", "50");
+rectangle.setAttributeNS(null, "fill", "red");
+
+// Attach the rectangle to the root 'svg' element.
+svgRoot.appendChild(rectangle);
+      
+
+

+ The example given constructs a document equivalent to parsing the + following SVG file: +

+
<svg xmlns="http://www.w3.org/2000/svg" width="400" height="450">
+  <rect x="10" y="20" width="100" height="50" fill="red"/>
+</svg>
+
+ + + +

Creating a Document from an SVG file

+
+

+ With Batik, you can also create an SVG DOM tree from a URI, an + InputStream, + or a + Reader, + using the + SAXSVGDocumentFactory. + The following example illustrates how to create an SVG document from a + URI using the SAXSVGDocumentFactory class. +

+
import java.io.IOException;
+
+import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
+import org.apache.batik.util.XMLResourceDescriptor;
+
+import org.w3c.dom.Document;
+
+try {
+    String parser = XMLResourceDescriptor.getXMLParserClassName();
+    SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
+    String uri = "http://www.example.org/diagram.svg";
+    Document doc = f.createDocument(uri);
+} catch (IOException ex) {
+    // ...
+}
+    
+

+ As we have created an SVG Document, we can cast this document to an + SVGDocument (defined in the org.w3c.dom.svg package) + if needed. +

+
+ + + +

Rendering an SVG Document

+
+

+ Batik provides several ways to use an SVG DOM tree. Two modules can be + immediately used to render your SVG document. +

+
+ +
JSVGCanvas
+ +
+ +

+ The + JSVGCanvas + is a Swing component that can display SVG document. A SVG document can + be specified using a URI or an SVG DOM tree (using the + setSVGDocument + method). For futher information about the JSVGCanvas, + see the Swing components module + documentation. +

+ +
+ +
ImageTranscoder
+ +
+ The + ImageTranscoder + is a transcoder that can take a URI, an InputStream or an + SVG DOM tree and produces a raster image (such JPEG, PNG or TIFF). + By creating a + TranscoderInput + object with the SVG DOM tree, you will be able to transform your SVG + content to a raster image. For futher information, see the + transcoder module documentation. +
+ +
+
+ + +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/using/extending.html b/bin/svg_kit/batik-1.7/docs/using/extending.html new file mode 100644 index 0000000..a95890c --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/using/extending.html @@ -0,0 +1,1062 @@ + + + + + + + +Extending Batik + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Extending Batik

+ + +

+ This page provides an overview of the built in extension mechanisms of + Batik. As an open source project, people can of course make any + extension they feel is interesting, however Batik has been + designed with several forms of extension in mind. +

+ + +

+ In general, extensions are added through the Service + Provider Interface mechanism as described in the + jar + file documentation. This allows for the extension of Batik + simply by adding a new jar file(s) to the class path, and thus no + modification of the Batik source is required! +

+ +
+
Note
+
+ If you feel that the Batik team has overlooked an + important area for extension please let your feelings be + known on the mailing lists. +
+
+ + + +

Custom XML elements

+
+

+ First one must ask what it means to support custom + XML elements? There are three basic options Batik considers: +

+
+ +
Having your elements appear in the DOM tree
+ +
+ +

+ As long as your custom elements are well formed + XML they will appear in the SVG DOM tree. When rendering Batik + will skip branches of the tree that use elements it doesn’t know + about (so even if standard SVG elements are child nodes they will + not be displayed). Note that you must make use of XML namespaces + for your personal elements even if you are not planning on + validating the XML. +

+ +

+ This can be useful if you want to add extra pieces of + data into the standard SVG drawing. These might be + annotations, or other application specific data. In + general this wouldn’t be particularly useful with + squiggle (the SVG browser) or the rasterizer, but + might be very useful if you were writing a custom + browser, rasterizer, or pre/post processing tools. +

+ +
+ + +
Adding functionality to your custom element DOM objects
+ +
+ +

+ If you need your elements to use a custom element subclass + in the DOM tree (for behavioral or performance reasons) then you + need to provide an extension to the Batik + DOM. +

+ +

+ Doing this gives you the opportunity to override the standard + methods on DOM elements, or to provide additional methods to + your DOM elements. For example, you may wish to add specialized + get and set methods for attributes on your custom elements, so + that they can be manipulated more easily than just using the + string-based getAttribute and + setAttribute methods provided by DOM Core. +

+ +
+ + +
Having your custom elements be rendered
+ +
+ +

+ Probably the most common reason to develop custom elements is to + add new rendering primitives to the SVG language. In this case + you must provide an extension to the + Batik bridge. The bridge extension is resposible + for constructing the class(es) that will handle the rendering of + the new primitive in Batik. +

+ +

+ In most cases it will also be necessary to write a DOM + extension to make the element behave like other SVG elements + (most notably for support of styling). +

+ +
+ +
+ +

Writing a Batik DOM extension

+

+ The ability to extend the elements used in the SVG DOM tree allows + users to provide implementations for nodes that can be used in + place of Batik’s default implementation of a node. This may be + done for a variety of reasons, but is most commonly done to + extend the behavior of standard node calls (such as + to include styling in attribute lookup), or to + implement the DOM interface for an element. +

+

+ The key class for building the DOM tree is + org.apache.batik.dom.ExtensibleSVGDOMImplementation. + When an instance of this class is constructed it searches for + instances of the + org.apache.batik.dom.svg.DomExtension + Service Provider Interface. It then calls the + registerTags method, passing itself as the only + parameter. This method typically would typically call + registerCustomElementFactory for each element that + it wishes to handle. +

+

+ With Batik the most likely reason to extend a node is to provide + proper CSS styling of the node attributes. To this end Batik + provides a class you can extend: + org.apache.batik.extension.PrefixableStylableExtensionElement. + If you derive a new DOM class from this class you are only + required to implement three methods: getLocalName, + getNamespaceURI, and newNode + (plus constructors). If all you want is proper style support + (commonly the case) then you are done implementing your element + at this point. +

+

+ The distribution comes with a number of examples: +

+
    + +
  • +org.apache.batik.extension.svg.BatikStarElement +
  • + +
  • +org.apache.batik.extension.svg.BatikRegularPolygonElement +
  • + +
  • +org.apache.batik.extension.svg.BatikHistogramNormalizationElement +
  • + +
  • +org.apache.batik.extension.svg.SolidColorElement +
  • + +
  • +org.apache.batik.extension.svg.ColorSwitchElement +
  • + +
+

+ Included with these examples is + org.apache.batik.extension.svg.BatikDomExtension, + which is the required instance of DomExtension + used to register the elements with the + ExtensibleSVGDOMImplementation. +

+

+ If your new element requires new “presentation attributes” + (XML attributes that can be modified through CSS, or, depending + on your viewpoint, the other way around—CSS properties that + can be specified using XML attributes), you will also need to + extend the CSS engine. This can be done by registering a + custom CSS value factory. Both of the color examples do + this (see BatikDomExtension). +

+ +

Writing a Batik bridge extension

+

+ Before you write a bridge extension it may be useful to + understand what role the bridge package plays in + Batik. The bridge package is responsible for creating and + maintaining elements in the Graphics Vector Toolkit (GVT) + tree based on the corresponding element in the SVG DOM. This + is done because, for a variety of reasons, the SVG DOM is not + well suited for rendering, thus the GVT tree is used for all + rendering and transcoding operations. +

+

+ The key class for managing this link is the + BridgeContext. + This class maintains an association between a element name + with namespace and a particular bridge instance that will + handle it. The work of constructing the proper entity or + entities in the GVT tree is then deferred to the + Bridge + registered for a particular element. If no bridge is + regiestered nothing is done. +

+

+ New associations can be added by implementors of the + BridgeExtension + Service Provider Interface. This interface has a number + of methods that provide information about the particular + extension being registered (including contact information, + and the list of implemented extensions). It also has a + registerTags method which is responsible for + registering the bridge instances with a + BridgeContext. All the built-in + bridges are bundled together with a + BridgeExtension (the + org.apache.batik.bridge.SVGBridgeExtension + class), as are the example extensions + (org.apache.batik.extension.svg), + so these are both good places to start. +

+

+ The Bridge interface itself is very simple. + It only includes methods to get the namespace and local + name of the element the bridge is responsible for. This + interface is then extended for each of the major + concepts present in SVG: +

+
+ +
+GraphicsNodeBridge +
+ +
+ +

+ These are probably the most common SVG elements, as + they represent graphic elements in the “visible” SVG tree. + These are the elements most other bridges modify in some way + (by clipping, masking, filtering, etc). +

+ +

+ +Example SVG elements: + svg, g, path, + rect. +

+ +

+ +Example extension bridges: + BatikRegularPolygonElementBridge, + BatikStarElementBridge. +

+ +
+ +
FilterBridge
+ +
+ +

+ This handles the SVG filter element. If you + wanted to implement a new element that could be + referenced from the filter attribute on an SVG + graphics node then you would need to subclass this + bridge. However, adding new types of filters to the + existing SVG filter element is accomplished via the + FilterPrimitiveBridge. +

+ +

+ +Example SVG element: filter + +

+ +
+ +
+FilterPrimitiveBridge +
+ +
+ +

+ This constructs an element in the filter chain + applied to an SVG graphics node. +

+ +

+ +Example SVG elements: + feBlend, feCompose, + feGaussianBlur. +

+ +

+ +Example extension bridge: + BatikHistogramNormalizationElementBridge + +

+ +
+ +
+PaintBridge +
+ +
+ +

+ This constructs a Java + Paint + object to be used in filling or stroking graphic elements. +

+ +

+ +Example SVG elements: + gradient, pattern. +

+ +

+ +Example extension bridge: + ColorSwitchBridge. +

+ +
+ +
ClipBridge
+ +
+ +

+ This constructs a + ClipRable + to apply to a graphics node. This provides a path that data + is clipped to. +

+ +

+ +Example SVG element: clipPath. +

+ +
+ +
MarkerBridge
+ +
+ +

+ This constructs a + Marker + for annotating the path of a graphics node. +

+ +

+ +Example SVG element: marker. +

+ +
+ +
MaskBridge
+ +
+ +

+ This constructs a mask filter to apply to a graphics + node. Mask filters typically modify the alpha channel of the + graphics node output to make portions fully or partially + transparent that wouldn’t be otherwise. +

+ +

+ +Example SVG element: mask. +

+ +
+ +
+

+ Extension writers are free to work with any of the + above bridges, however the three most common are + likely to be the GraphicsNodeBridge, the + FilterPrimitiveBridge, and the + PaintBridge (each of which has example + extensions available for inspection). Each of these interfaces + has several very useful subclasses that handle much of the + common behavior among elements. +

+

+ In some simple cases it is possible to provide only an + extension to the bridge and achieve your desired effect, + however in most cases you will find that for your + element to behave like a normal SVG element (for + example, to support styling) you will need to provide + a DOM extension as well. +

+ +

GraphicsNodeBridge

+

+ The graphics node bridge is oriented around + constructing a new + GraphicsNode + in the GVT tree. The GraphicsNode is the basic + object that makes up the GVT tree. Each + GraphicsNode has a paint method that + is responsible for painting the object (including considering + clipping, masking, filtering, and opacity for the + node). +

+

+ If you want to you can implement the + GraphicsNodeBridge + interface directly, or you can subclass the + AbstractGraphicsNodeBridge + class. This gives you the most flexibility since you can + construct your new subclass of GraphicsNode, where + you can implement the paint method to do essentially anything + you want. This is quite involved, however, and the steps + necessary to create a full GraphicsNodeBridge + are not detailed here. +

+

+ However, if you just want to generate a custom + filled or stroked shape the easiest way is to + subclass one of the following two classes. In this + case you are essentially only responsible for + constructing a standard Java + Shape + object to describe the desired area to operate on: +

+
+ +
SVGShapeElementBridge
+ +
+ +

+ Subclasses of this class only need to implement + buildShape, getNamespaceURI, + and getLocalName. buildShape + generally constructs a Shape object and sets it + on the provided shapeNode object, however it + may adjust other features of the given shape node. +

+ +
+ +
SVGDecoratedShapeElementBridge
+ +
+ +

+ This is very similar to SVGShapeElementBridge, + except that it also handles the standard marker properties. + Markers will be placed at the end of each segment of + the path that describes the shape. +

+ +
+ +
+

+ If you decide that you need to implement a new subclass + of GraphicsNode it is strongly suggested that + you extend + AbstractGraphicsNode, + as this class does much of the work to behave like other + rendered elements in SVG (like clipping, filtering and + masking). In this case you implement the + primitivePaint method instead of the + paint method. +

+ +

FilterPrimitiveBridge

+

+ The + FilterPrimitiveBridge + is concerned with the construction of individual elements of the + filter chain. Unlike graphics nodes, which generally just + draw new objects on top of the destination, filters take + existing image data and modify it to apply effects. +

+

+ This part of GVT rendering is based on the Java2D + java.awt.image.renderable.RenderableImage + and java.awt.image.RenderedImage + interfaces. These provide a convenient framework to handle + image processing (an inherently resolution dependent + operation) in the resolution independent system defined by + SVG. +

+

+ The org.apache.batik.ext.awt.image package + hierarchy contains a large set of generally useful extensions + to the core JDK classes and methods, that help to implement + SVG-related graphics operations. +

+

+ Note that the FilterPrimitiveBridge is invoked + once for each reference to the filter element that + the filter primitive is part of. So if a filter effect is used + a half dozen times the createFilter method will be + called a half dozen times, even though the element may only + appear once in the file. This means that it is safe for the + filters returned to be “fixed” for a particular + GraphicsNode being filtered. +

+

+ You will notice that Batik uses extended versions of + the standard RenderableImage and RenderedImage + interfaces to provide additional information about + surrounding requirements for operations as well as a few + convenience methods. These interfaces are called: + org.apache.batik.ext.awt.image.renderable.Filter + and + org.apache.batik.ext.awt.image.rendered.CacheableRed. + Batik contains simple wrapper classes that can take the default + JDK RenderableImage and RenderedImage + interfaces. Within the codebase the naming convention “Red” for + classes implementing RenderedImage and “Rable” for classes + implementing RenderableImage is commonly + used (“Red” is to be pronounced like the color, and + “Rable” is to be pronounced like “horrible” with a + silent “h”). +

+

+ The FilterPrimitiveBridge has only + one method, createFilter, that must + construct an instance of Filter to perform + the required operation. This is still a fairly complex task + given the general need to support accessing the various + standard sources of image data. To this end there is + a provided subclass, + AbstractSVGFilterPrimitiveElementBridge, + that provides convenience methods to handle many common tasks. +

+

+ Generally the bulk of the work in writing a filter + extension is the writing of the concrete Filter + class, not tying it into the GVT tree. Batik does contain + several base classes that make this processes a bit + easier: + org.apache.batik.ext.awt.image.renderable.AbstractRable, + org.apache.batik.ext.awt.image.rendered.AbstractRed, + and + org.apache.batik.ext.awt.image.rendered.AbstractTiledRed, + TiledRed + ties into the Batik tile cache (use this with caution as it is a + complex area of the Batik code). +

+

+ The org.apache.batik.ext.awt.image.rendered + and org.apache.batik.ext.awt.image.renderable + packages contain quite a number of fairly general examples + covering most common cases, please refer to them for more detail. +

+ +

PaintBridge

+

+ The + PaintBridge + constructs an instance of java.awt.Paint to be used + to fill or stroke shapes/text (part of the paint server + architecture of SVG). +

+

+ Like the filter primitive bridge, the PaintBridge + is invoked for each reference to the paint. This makes + it possible to customize the Paint returned for the + particular element to be painted. +

+

+ This is how gradients and patterns are implemented + in Batik, so it is possible to construct rather + complex paint effects through this mechanism. +

+

+ For paints you are mostly on your own, because unlike + the other cases there aren’t any really generally useful + base classes to derive off, the closest is the + AbstractSVGGradientElementBridge, + which is used to handle most of the radial and linear gradient + attributes. +

+

+ The existing gradient paint implementations are in the + org.apache.batik.ext.awt, and the pattern + implementation is in org.apache.batik.gvt since it + requires access to GVT internals. +

+
+ + + +

New image file formats

+
+

+ When Batik encounters an image element and it + determines the element does not reference an SVG file, it defers + the loading of the referenced image to + org.apache.batik.ext.awt.image.spi.ImageTagRegistry. + This class maintains a list of + RegistryEntrys, + generally one for each format. +

+

+ Since the formats supported natively by Batik are also + implemented through this mechanism. The + JPEGRegistryEntry + and + PNGRegistryEntry + classes should be used as good references for extensions. +

+ +

RegistryEntry

+

+ There are currently two flavors of RegistryEntry: +

+
+ +
URLRegistryEntry
+ +
+ +

+ A + URLRegistryEntry + takes a + ParsedURL + and tries to decide if the URL is intended for it. This group + of entries is mostly intended to handle alternate network + protocols. It can also be useful for interfacing with + libraries that want a URL instead of a stream. +

+ +
+ +
StreamRegistryEntry
+ +
+ +

+ A + StreamRegistryEntry + works with a markable + InputStream. + This is the preferred form of registry entry as it generally + avoids opening a potentially expensive connection multiple + times, instead it opens the stream once and relies on mark and + reset to allow entries to check the stream. +

+ +
+ +
+ +

Helper classes

+

+ There exists quite a number of classes to assist in + implementing a RegistryEntry. It is strongly + recommended that you review these classes and make use + of them where appropriate. They will likely save you + time and improve the integration with Batik. +

+
+ +
MagicNumberRegistryEntry
+ +
+ +

+ +MagicNumberRegistryEntry + is an abstract class that can handle the + isCompatibleStream method for formats that + make use of “magic numbers.” Magic numbers are a well + known sequence of bytes at a well known offset in the + file, that are commonly used to identify image file formats. +

+ +
+ +
RedRable
+ +
+ +

+ +RedRable + takes any java.awt.image.RenderedImage and wraps it + into a Filter (Batik’s subinterface of + RenderableImage). This is very useful for + single resolution file formats. +

+ +
+ +
DeferRable
+ +
+ +

+ +DeferRable + allows one to load the image in a background + thread, rather than hold up the construction of the + GVT tree while reading the image (useful since + reading the image is generally I/O bound, so it + makes a good background task). This is used by most of + the current image readers. +

+ +
+ +
AbstractRable
+ +
+ +

+ +AbstractRable + is an abstract base class that makes it relatively + easy to implement the Filter interface. +

+ +
+ +
AbstractRed
+ +
+ +

+ +AbstractRed + is an abstract base class that makes it relatively + easy to implement the + CacheableRed + interface (Batik's subclass of RenderedImage). +

+ +
+ +
+
+ + + +

New URL protocols

+
+

+ For a variety of reasons (not the least of which is the + heavy use of the data: URL protocol in SVG), several + parts of Batik use a + ParsedURL + instead of the JDK’s + java.net.URL + class. +

+

+ +ParsedURL offers a few advantages over the JDK’s + URL class. First, it is designed to make minimal use of + exceptions, so it is possible to use it to parse a malformed + URL and get “the good parts”. Second, it is extensible, so + support for new URL protocols can be added, even those that + change the normal parsing rules for URLs (such as our friend the + data: protocol). Third, it can automatically check a + when a stream can be opened for common compression types and decode + them for you (this behavior can also be bypassed if needed). +

+

+ The service class is + org.apache.batik.util.ParsedURLProtocolHandler. + This interface consists of three methods: one returns the protocol + to be handled, one is for parsing an absolute URL string and + one is for parsing relative URL strings. Both the parsing + methods return an object of type + ParsedURLData + (the instance may of course be a subclass of + ParsedURLData). +

+

+ The ParsedURLData class holds all the data and + implements all the stream handling commands for the + ParsedURL class. This allows + ParsedURLProtocolHandlers to return custom subclasses + for particular protocols. +

+
+ + + +

Additional script interpreters

+
+

+ While conforming SVG browsers need support only ECMAScript as a scripting + language, Batik can support any scripting language given the right glue + to connect it to the rest of the system. +

+

+ Script interpreters are also handled via the Service Provider Interface, + The interface that needs to be implemented to expose a new interpreter + to Batik is + InterpreterFactory. + This class has two methods: getMimeType, which returns + a string that specifies what script type this intepreter handles + (specifically, what the type attribute of + script elements must be for them to be handled by this + intepreter), and createInterpreter, which creates an + instance of the + Interpreter + interface. +

+

+ Batik comes with implementations of Interpreter and + IntepreterFactory to support TCL and Python script in + SVG documents, if the Jacl and Jython distributions are installed, + respectively. See the classes in the + org.apache.batik.script.jacl and + org.apache.batik.script.jython packages to guidance + on how to implement the interpreter interfaces, and the + installation notes on what jar files are + needed for TCL and Python support. +

+
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/using/images/HighLevelArchitecture.png b/bin/svg_kit/batik-1.7/docs/using/images/HighLevelArchitecture.png new file mode 100644 index 0000000..943f0b9 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/using/images/HighLevelArchitecture.png differ diff --git a/bin/svg_kit/batik-1.7/docs/using/images/svgapplication.png b/bin/svg_kit/batik-1.7/docs/using/images/svgapplication.png new file mode 100644 index 0000000..fe8cf2c Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/using/images/svgapplication.png differ diff --git a/bin/svg_kit/batik-1.7/docs/using/images/svggen.jpg b/bin/svg_kit/batik-1.7/docs/using/images/svggen.jpg new file mode 100644 index 0000000..0413543 Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/using/images/svggen.jpg differ diff --git a/bin/svg_kit/batik-1.7/docs/using/images/svggenHighLevelArchi.jpg b/bin/svg_kit/batik-1.7/docs/using/images/svggenHighLevelArchi.jpg new file mode 100644 index 0000000..7ab7bce Binary files /dev/null and b/bin/svg_kit/batik-1.7/docs/using/images/svggenHighLevelArchi.jpg differ diff --git a/bin/svg_kit/batik-1.7/docs/using/index.html b/bin/svg_kit/batik-1.7/docs/using/index.html new file mode 100644 index 0000000..129812c --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/using/index.html @@ -0,0 +1,320 @@ + + + + + + + +Using Batik + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Using Batik

+ +

+ The Batik toolkit has a number of modules that can be used to provide + SVG support to your application. This section includes resources for + explaining how to use these modules. +

+ +
+ +
Architecture
+ +
+ +

+ The architecture page gives an + overview of how the various modules in Batik fit together. +

+ +
+ +
Javadoc APIs
+ +
+ +

+ The Javadoc APIs document all + of the classes packaged with Batik. +

+ +
+ + +
DOM API
+ +
+ +

+ The DOM API page explains how to use the + DOM interfaces to create and render SVG documents. +

+ +
+ +
Parsers
+ +
+ +

+ The Parsers page describes the parser + classes that can be used for parsing the microsyntaxes of SVG + (such as path data and transform lists). +

+ +
+ +
Scripting
+ +
+ +

+ The scripting pages (Scriping with + ECMAScript, Scripting with + Java and Security) + document how to programmatically manipulate SVG documents, and how + script interpreters can be used and extended in Batik. +

+ +
+ +
SVG generator
+ +
+ +

+ The SVG Generator page documents the + SVGGraphics2D class, which can be used to construct + SVG documents from Java2D drawing commands. +

+ +
+ +
Swing components
+ +
+ +

+ The Swing components page describes the + SVG canvas component, the primary method for displaying SVG content + in Swing applications. +

+ +
+ +
Transcoder API
+ +
+ +

+ The Transcoder API page explains how + to use the transcoder classes to convert SVG content to other formats + (raster or vector). +

+ +
+ +
Extending Batik
+ +
+ +

+ The Extending Batik page lists the parts + of the Batik API that are extensible and explains how to add + functionality to the existing modules. +

+ +
+ + +
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/using/parsers.html b/bin/svg_kit/batik-1.7/docs/using/parsers.html new file mode 100644 index 0000000..dd06824 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/using/parsers.html @@ -0,0 +1,461 @@ + + + + + + + +Parser module + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Parser module

+ + +

+ SVG has a number of microsyntaxes that are used within attribute values, + such as the transform attribute on + SVGTransformable elements, and the path data d + attribute on path elements. Since these are not trivial to + parse, this functionality has been factored out into a separate package + that can be used by other SVG-processing applications if needed. +

+ + + +

Parsers, handlers and producers

+
+

+ In the parser module, each microsyntax is supported by a pair of classes: + a parser and a handler. The parser is a class that implements the + Parser + interface, which has methods to parse values from a + Reader + or a + String. + The handler is an interface specific to the microsyntax that will have + its methods called whenever the corresponding element in the input is + parsed. For those handler interfaces that have more than one method, + adapter classes are provided (named Default*). +

+

+ Parsers can also have an error handler associated with them, whose + single method error will be called when there is a + problem parsing the input. If an error handler is not associated with + a parser, a + ParseException + will be thrown if an error occurs. +

+

+ The microsyntaxes supported by the parser module are: +

+
+ +
Angles
+ +
+ +

+ Implemented by + AngleParser, + handled with + AngleHandler. + This parser is used for parsing angles formed by a floating point + number followed by deg, grad or + rad. It is not currently used by the rest of the Batik + codebase. +

+ +
+ +
Clock values
+ +
+ +

+ Implemented by + ClockParser, + handled with + ClockHandler. + This parser is used for parsing SMIL + clock values. +

+ +
+ +
Fragment identifiers
+ +
+ +

+ Implemented by + FragmentIdentifierParser, + handled with + FragmentIdentifierHandler. + This parser is used for parsing the various formats of + fragment + identifier that SVG allows. +

+ +
+ +
Lengths
+ +
+ +

+ Implemented by + LengthParser, + handled with + LengthHandler. + This parser is used for parsing SVG length values. +

+ +
+ +
Length lists
+ +
+ +

+ Implemented by + LengthListParser, + handled with + LengthListHandler. + This parser is used for parsing lists of comma or space separated + SVG lengths. +

+ +
+ +
Numbers
+ +
+ +

+ Implemented by + NumberListParser, + handled with + NumberListHandler. + This parser is used for parsing SVG number values. +

+ +
+ +
Number lists
+ +
+ +

+ Implemented by + NumberListParser, + handled with + NumberListHandler. + This parser is used for parsing lists of comma or space separated + SVG numbers. +

+ +
+ +
Path data
+ +
+ +

+ Implemented by + PathParser, + handled with + PathHandler. + This parser is used for parsing SVG path data, as found in + path element d attributes. +

+ +
+ +
Points
+ +
+ +

+ Implemented by + PointsParser, + handled with + PointsHandler. + This parser is used for parsing point lists, as found in + polygon element points attributes. +

+ +
+ +
Preserve aspect ratio values
+ +
+ +

+ Implemented by + PreserveAspectRatioParser, + handled with + PreserveAspectRatioHandler. + This parser is used for parsing the values found in the + preserveAspectRatio attribute of svg + elements. +

+ +
+ +
Transform lists
+ +
+ +

+ Implemented by + TransformListParser, + handled with + TransformListHandler. + This parser is used for parsing transform lists, as found in the + transform attribute of any transformable element. +

+ +
+ +
+

+ Some microsyntaxes also have a corresponding producer class, which is + an implementation of the handler interface that generates an object + while parsing. +

+
+ + + +

Examples

+
+

+ The following example code demonstrates how to use the parser classes + to parse a list of points: +

+
import java.awt.geom.Point2D;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.batik.parser.DefaultPointsHandler;
+import org.apache.batik.parser.ParseException;
+import org.apache.batik.parser.PointsHandler;
+import org.apache.batik.parser.PointsParser;
+
+public class PointsParserExample {
+
+    public List extractPoints(String s) throws ParseException {
+        final LinkedList points = new LinkedList();
+        PointsParser pp = new PointsParser();
+        PointsHandler ph = new DefaultPointsHandler() {
+            public void point(float x, float y) throws ParseException {
+                Point2D p = new Point2D.Float(x, y);
+                points.add(p);
+            }
+        };
+        pp.setPointsHandler(ph);
+        pp.parse(s);
+        return points;
+    }
+}
+

+ This example uses the + AWTTransformProducer + class to generate an + AffineTransform + object from an SVG transform list: +

+
import java.awt.geom.AffineTransform;
+
+import org.apache.batik.parser.AWTTransformProducer;
+import org.apache.batik.parser.ParseException;
+import org.apache.batik.parser.TransformListParser;
+
+public class TransformParserExample {
+
+    public AffineTransform parseTransformList(String s) throws ParseException {
+        TransformListParser p = new TransformListParser();
+        AWTTransformProducer tp = new AWTTransformProducer();
+        p.setTransformListHandler(tp);
+        p.parse(s);
+        return tp.getAffineTransform();
+    }
+}
+
+
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/using/scripting/ecmascript.html b/bin/svg_kit/batik-1.7/docs/using/scripting/ecmascript.html new file mode 100644 index 0000000..eacd145 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/using/scripting/ecmascript.html @@ -0,0 +1,431 @@ + + + + + + + +Scripting with ECMAScript + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Scripting with ECMAScript

+ + +

+ This page is a brief introduction to scripting SVG documents with + ECMAScript, and how Batik’s ECMAScript environment can be extended. +

+ + + +

Scripting basics

+
+

+ As the ECMAScript language (the standardised version of JavaScript) + is one of the most popular scripting languages, and as the SVG + specification states that an SVG conforming implementation must + support it, SVG documents processed by Batik support scripting + with ECMAScript using Mozilla’s ECMAScript interpreter, + Rhino. +

+

+ There are two places in an SVG file where you can put scripts. +

+

+ The first one is in the script + element, where you can place any code, including function + definitions, to be executed just before the document + SVGLoad event is fired. +

+
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
+  <script type="text/ecmascript">
+    // ECMAScript code to be executed 
+  </script>
+
+  <!-- Remainder of the document... -->
+</svg>
+

+ You can also attach script to respond to user or document + events using attributes on SVG elements. As shown in the + previous example, the scripting language must be set on + the script element. However, for event handling + the default language type text/ecmascript + is assumed. If you want to change it you can use + the contentScriptType attribute on the + svg element. +

+

+ The event attribute can contain any script code to execute when the + event reaches the element (as described by the + DOM event flow) + in either the bubbling or at-target phases. The following example + will change the rect to be filled in blue when it is + clicked. +

+
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
+  <rect x="0" y="0" width="10" height="10"
+        onclick="evt.target.setAttribute('fill', 'blue')"/>
+</svg>
+

+ Note that inside the event attribute script, there is a variable + called evt that is a reference to the + Event + object that represents the event that is being handled. +

+

+ For more information on using scripting in SVG you can have a look at: +

+ +
+ + + +

Using Rhino features

+
+

+ Rhino has a number of features beyond those supported by standard + ECMAScript interpreters, and these can be used with Batik. One + useful feature is that ECMAScript code can use Java classes and + objects, and not just the standard ECMAScript primitive types and + host objects exposed by Batik. +

+

+ To create an instance of a Java class from ECMAScript, you first need + to import the package in which it resides. This is done using the + importPackage global function that Rhino provides. + For example, to import the javax.swing.JFrame class, + you use: +

+
importPackage(Packages.javax.swing);
+

+ This then exposes a global property for each class in the + javax.swing package that you can use to create a new + object of this class, similar to a import javax.swing.*; + statement in Java. We can use the exposed JFrame + property to create a new instance of this class: +

+
var frame = new JFrame("My test frame");
+

+ Note how an ECMAScript string value is passed as the parameter to + JFrame’s constructor. Rhino will attempt to convert + ECMAScript values into appropriate Java primitive types or objects + to make underlying constructor or method calls. In this instance, + the ECMAScript string value is converted into a + java.lang.String object to be passed to the constructor. +

+

+ Now that we have a reference to this Java object, we can call any + method on it as we usually would from Java code. The following + complete example demonstrates this, where clicking the green + circle will pop up a frame: +

+
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
+  <circle cx="50" cy="50" r="50" fill="green" onclick="showFrame()"/>
+  <script type="text/ecmascript">
+    importPackage(Packages.javax.swing);
+
+    function showFrame() {
+      var frame = new JFrame("My test frame");
+      var label = new JLabel("Hello from Java objects created in ECMAScript!");
+      label.setHorizontalAlignment(SwingConstants.CENTER);
+      frame.getContentPane().add(label);
+      frame.setSize(400, 100);
+      frame.setVisible(true);
+      frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+    }
+  </script>
+</svg>
+

+ For more information on scripting Java classes from ECMAScript code, + see Rhino's + Scripting + Java document. +

+
+ + + +

Customizing the Rhino interpreter

+
+

+ A useful example of customization of the Rhino interpreter comes from + the fact that the ECMAScript specification doesn’t provide any + predefined I/O facilities to interact with the console. However, it is + very common for ECMAScript compatible languages to provide a function + named print to output messages to the console. We will + describe here an example of cutomization of the Batik Rhino + interpreter to add such functionality to it. +

+

+ You should first subclass the default Batik ECMAScript interpreter to + add the functionality to it as below. +

+
import org.apache.batik.script.rhino.RhinoInterpreter;
+
+import org.mozilla.javascript.Context;
+import org.mozilla.javascript.Function;
+import org.mozilla.javascript.Scriptable;
+import org.mozilla.javascript.ScriptableObject;
+import org.mozilla.javascript.PropertyException;
+
+public class ExtendedRhinoInterpreter extends RhinoIntepreter {
+
+    public ExtendedRhinoInterpreter() {
+
+        // Array of functions to put in the global object.
+        final String[] names = { "print" }
+        try {
+            // Add the functions to the global object.
+            getGlobalObject().defineFunctionProperties
+                (names, ExtendedRhinoIntepreter.class,
+                 ScriptableObject.DONTENUM);
+        } catch (PropertyException e) {
+            throw new Error(e);
+        }
+    }
+    
+    public static void print(Context cx, Scriptable thisObj,
+                             Object[] args, Function funObj) {
+        for (int i = 0; i < args.length; i++) {
+            if (i > 0) {
+                System.out.print(" ");
+            }
+	    
+            // Convert the ECMAScript value into a string form.
+            String s = Context.toString(args[i]);
+            System.out.print(s);
+        }
+        System.out.println();
+    }
+}
+

+ Now, you need to tell to Batik to use this interpreter instead of the + default one. For that, you must first define a factory to create + instances of your interpreter. +

+
import org.apache.batik.script.Interpreter;
+import org.apache.batik.script.InterpreterFactory;
+
+public class ExtendedRhinoInterpreterFactory implements InterpreterFactory {
+
+    public Interpreter createInterpreter() {
+        return new ExtendedRhinoInterpreter();
+    }
+}
+

+ Then, you must build an + IntepreterPool + that will use this factory, and then set the pool on the + BridgeContext + of your application. +

+
org.apache.batik.bridge.BridgeContext ctx = ...;
+org.apache.batik.script.InterpreterPool pool =
+    new org.apache.batik.script.InterpreterPool();
+pool.putInterpreterFactory("text/ecmascript", 
+                           new ExtendedRhinoInterpreterFactory());
+ctx.setIntepreterPool(pool);
+

+ For example if you are using the Batik SVG browser application you + should be able to use the previous piece of code on a subclass of the + JSVGCanvas + class in the createBridgeContext() method. +

+

+ For further information on working with Rhino, consult the + Rhino website. +

+
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/using/scripting/java.html b/bin/svg_kit/batik-1.7/docs/using/scripting/java.html new file mode 100644 index 0000000..2ddda80 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/using/scripting/java.html @@ -0,0 +1,475 @@ + + + + + + + +Scripting With Java + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Scripting With Java

+ + +

+ This page explains how to manipulate the DOM tree of an SVG + document from a Java program. +

+ + + +

How to manipulate a document in a JSVGCanvas

+
+

+ The follow code template demonstrates how to manipulate an SVG + document displayed in a + JSVGCanvas + directly from a Java program. +

+
+
Note
+
+ You don’t have to worry about graphics updates; after each event + listener invocation the canvas is updated if needed. +
+
+
import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import javax.swing.JFrame;
+
+import org.apache.batik.swing.JSVGCanvas;
+import org.apache.batik.swing.svg.SVGLoadEventDispatcherAdapter;
+import org.apache.batik.swing.svg.SVGLoadEventDispatcherEvent;
+import org.apache.batik.script.Window;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.events.Event;
+import org.w3c.dom.events.EventListener;
+import org.w3c.dom.events.EventTarget;
+
+public class SVGApplication {
+
+    public static void main(String[] args) {
+        new SVGApplication();
+    }
+
+    JFrame frame;
+    JSVGCanvas canvas;
+    Document document;
+    Window window;
+
+    public SVGApplication() {
+        frame = new JFrame();
+        canvas = new JSVGCanvas();
+        // Forces the canvas to always be dynamic even if the current
+        // document does not contain scripting or animation.
+        canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
+        canvas.addSVGLoadEventDispatcherListener
+            (new SVGLoadEventDispatcherAdapter() {
+                    public void svgLoadEventDispatchStarted
+                        (SVGLoadEventDispatcherEvent e) {
+                        // At this time the document is available...
+                        document = canvas.getSVGDocument();
+                        // ...and the window object too.
+                        window = canvas.getUpdateManager().
+                            getScriptingEnvironment().createWindow();
+                        // Registers the listeners on the document
+                        // just before the SVGLoad event is
+                        // dispatched.
+                        registerListeners();
+                        // It is time to pack the frame.
+                        frame.pack();
+                    }
+                });
+        
+        frame.addWindowListener(new WindowAdapter() {
+                public void windowOpened(WindowEvent e) {
+                    // The canvas is ready to load the base document
+                    // now, from the AWT thread.
+                    canvas.setURI("doc.svg");
+                }
+            });
+
+        frame.getContentPane().add(canvas);
+        frame.setSize(800, 600);
+        frame.show();
+    }
+
+    public void registerListeners() {
+        // Gets an element from the loaded document.
+        Element elt = document.getElementById("elt-id");
+        EventTarget t = (EventTarget)elt;
+
+        // Adds a 'onload' listener
+        t.addEventListener("SVGLoad", new OnLoadAction(), false);
+
+        // Adds a 'onclick' listener
+        t.addEventListener("click", new OnClickAction(), false);
+    }
+
+    public class OnLoadAction implements EventListener {
+        public void handleEvent(Event evt) {
+            // Perform some actions here...
+            
+            // ...for example start an animation loop:
+            window.setInterval(new Animation(), 50);
+        }
+    }
+
+    public class OnClickAction implements EventListener {
+        public void handleEvent(Event evt) {
+            // Perform some actions here...
+
+            // ...for example schedule an action for later:
+            window.setTimeout(new DelayedTask(), 500);
+        }
+    }
+
+    public class Animation implements Runnable {
+        public void run() {
+            // Insert animation code here...
+        }
+    }
+
+    public class DelayedTask implements Runnable {
+        public void run() {
+            // Perform some actions here...
+
+            // ...for example displays an alert dialog:
+            window.alert("Delayed Action invoked!");
+        }
+    }
+}
+
+
+ + + +

Writing thread-safe code

+
+

+ The DOM listeners registered on the SVG document are called from + the canvas update thread. To avoid race conditions, do not manipulate + the DOM tree from another thread. +

+

+ The way to switch from an external thread to the canvas update + thread is to use the following code: +

+
// Returns immediately
+canvas.getUpdateManager().getUpdateRunnableQueue().
+    invokeLater(new Runnable() {
+        public void run() {
+            // Insert some actions on the DOM here
+        }
+    });
+

or:

+
// Waits until the Runnable is invoked
+canvas.getUpdateManager().getUpdateRunnableQueue().
+    invokeAndWait(new Runnable() {
+        public void run() {
+            // Insert some actions on the DOM here
+        }
+    });
+

+ Like with event listeners, when a + Runnable + is invoked from the update thread, the graphics are updated. +

+
+
Note
+
+ It is very dangerous to call invokeAndWait from the + Swing event thread. This is the only thread that can be + used to interact with Swing components. In some cases + DOM calls may need to query the canvas for information + (such as actual Swing component size, etc). If this + happens you will get a thread deadlock. You should + only make invokeAndWait calls from “third party” threads. +
+
+
+ + + +

Using the SVG DOM

+
+

+ Batik provides a fairly complete implementation of the + SVG DOM. The SVG DOM provides all the functionality most + applications require. In particular, the DOM implements + DOM Events, including mutation and UI Events. As an example, + DOM events allow you to get notified when the cursor moves over + elements of interest: +

+
// Element of Interest.
+Element theElem = ...;
+((EventTarget) theElem).addEventListener("mouseover", mouseOverListener, true);
+

+ where mouseOverListener implements the + org.w3c.dom.events.EventListener + interface. This interface consists of the method: +

+
void handleEvent(Event evt);
+

+ This is called whenever the event occurs with the + element it is registered on. It is worth reviewing the + DOM Events specification as there are many useful features + to this interface that are not immediately obvious. +

+

+ It is also worth looking at the DOM interfaces defined + by the SVG specification as they provide a large number + of useful methods, in particular those of + SVGLocatable: +

+
// Returns Bounding box of SVG Element.
+public SVGRect   getBBox (  );
+// Returns the transformation matrix to the screen.
+public SVGMatrix getScreenCTM (  );
+// Returns the transformation matrix to the given element.
+public SVGMatrix getTransformToElement ( SVGElement element )
+                throws SVGException;
+

+ In particular, getScreenCTM is very useful for + taking the clientX and clientY attributes of + the DOM + UIEvent + and mapping them to the coordinate system of an element in the SVG + document: +

+
SVGMatrix mat  = elem.getScreenCTM();
+SVGMatrix imat = mat.inverse();
+SVGPoint  cPt  = document.getRootElement().createSVGPoint();
+cPt.setX(uiEvt.getClientX());
+cPt.setY(uiEvt.getClientY());
+cPt = cPt.matrixTransform(imat);
+
+ + + +

Referencing Java code from a document

+
+

+ Batik implements the Java bindings for SVG, and thus allows Java + code to be referenced from script elements. + This feature is available to any application of Batik that uses + the bridge module (for example the Swing component and the + transcoders). +

+

+ In order to use this extension, the type attribute + of a script element must be set to + application/java-archive. In addition, the + xlink:href attribute must be the URI of a jar file + that contains the code to run. +

+

+ The manifest of this jar file must contains an entry of the form: +

+
SVG-Handler-Class: classname
+
+

+ where classname must be the name of a class that + implements the + org.w3c.dom.svg.EventListenerInitializer + interface. Just before the document SVGLoad event + is fired, an instance of this class is created, and this instance has + its initializeEventListeners method invoked. Note that + there is no way to specify Java handlers in event attributes on + SVG elements, so having the initializeEventListeners + call addEventListener on a node is the only way to + attach a Java listener from within the document. +

+

+ The class specified by SVG-Handler-Class can be contained + directly in the jar file, but it is also possible for it to be + contained in a jar file added to the classpath using the + Class-Path entry of the manifest. +

+
+ + +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/using/scripting/security.html b/bin/svg_kit/batik-1.7/docs/using/scripting/security.html new file mode 100644 index 0000000..886397a --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/using/scripting/security.html @@ -0,0 +1,496 @@ + + + + + + + +Script security + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Script security

+ + +

+ With the addition of scripting support in Batik 1.5, security features + have also been added to enable users of the Batik toolkit to run + scripts in a secure manner. +

+ +

+ If you are using script, please make sure you have reviewed the + Script Security + Warning with regards to the Batik 1.5 release. +

+ + + +

Running scripts securely

+
+

+ The Java platform offers a lot of options for running applications + securely. Running an application securely requires that it runs in a + so-called security sand-box which controls all the access the + application makes to restricted resources (such as the file system). +

+

+ The concept of Java security is an application-wide concept. As such, + it has to be applied at the application level (and not at the + framework level). In the Batik distribution, the sample applications + (such as the Squiggle Browser and the + SVG rasterizer) apply + security (or disable it) but the framework does not apply it: it is + security-aware (meaning that it is able to handle security + exceptions). +

+ +

Enforcing security in a Batik application

+

+ Enforcing security in a Batik application is done by setting a + java.lang.SecurityManager. + This security manager will apply the security settings of the Java + platform (as defined by the + jre-dir/lib/security/java.policy and, + optionally, by the policy file whose URL is defined in the + java.security.policy system property). +

+

+ The + org.apache.batik.util.ApplicationSecurityEnforcer + helper class makes it easier for Batik application + developers to add security support in their applications. That + helper class is used by the sample Batik applications. +

+ +

Squiggle security

+

+ The Squiggle browser lets the user decide whether or not scripts + should be run securely (see the “Browser Options” in the + preference dialog box). When scripts are run securely, Squiggle + will enforce the security settings as follows: +

+
    + +
  • + The default policy is defined by the policy file found + in the distribution: org/apache/batik/apps/svgbrowser/svgbrowser.policy. + In the binary distribution, that file would be in the + batik-squiggle.jar file. In the source + distribution, that file would be in the + resources directory. The default policy + file gives appropriate permissions to the Batik code, + the XML parser and the Rhino scripting engine and very + limited permissions to scripts. +
  • + +
  • + At startup time, and whenever the preference settings are + modified, Squiggle makes a copy of the default policy + and appends any additional permissions granted to + scripts by the user through the preference + settings. This policy file can be found in the + [user.home]/.batik directory, and is + called __svgbrowser.policy. Note that + this file is automatically generated and should not be + modified manually (as any edits would be lost). +
  • + +
  • + The policy defined as described above is enforced + unless the java.security.policy system + property is defined. In that case, the policy defined + by the system property takes precedence and the policy + file generated from the Squiggle preferences is + ignored. +
  • + +
+

+ +Important note: + The default policy files assume that the applications use the + Xerces parser and give appropriate permissions to its + lib/xerces-2_5_0.jar jar file. If you are using + a different XML parser, you need to modify the policy files to + grant the propser permissions to your XML parser instead of + Xerces. You will have to replace: +

+
grant codeBase "${app.dev.base}/lib/xerces_2_5_0.jar" {
+  permission java.security.AllPermission;
+};
+

with:

+
grant codeBase "${app.dev.base}/lib/myXMLParser.jar" {
+  permission java.security.AllPermission;
+};
+

+ in the resources/org/apache/batik/apps/svgbrowser/resources/svgbrowser.policy + file (for the source distribution) and do the same in + resources/org/apache/batik/apps/svgbrowser/resources/svgbrowser.bin.policy (for + the binary distribution which will then need to be rebuilt with the build dist-zip + command. +

+

+ Alternatively, you can write your own policy file and specify its + URL through the java.security.policy system property (which you can + specify through the -Djava.security.policy=url command line + option). +

+
+ + + +

Controlling access to external resources

+
+

+ SVG makes a very powerful use of external resources in many elements + such as image, use, font, + script and radialGradient. There are over + fifteen SVG elements that may reference external resources that way. +

+

+ In some environments, and typically for security reasons, it is + important to control the resources referenced by an SVG document + and be able to accept or reject these resources. +

+

+ In the Batik toolkit, this flexibility is provided by the + org.apache.batik.bridge.UserAgent + interface which can define various strategies with regards to external + resources. By providing a new implementation of the + UserAgent interface, it is possible to apply the desired + security strategy for scripts and external resources. +

+

+ The following UserAgent methods are provided for + that purpose: +

+
    + +
  • + +getScriptSecurity(scriptType, scriptURL, docURL) + should return the + ScriptSecurity + strategy for a script of type scriptType (e.g., + text/ecmascript) coming from scriptURL, + when referenced from the document whose URL is docURL. +
  • + +
  • + +getExternalResourceSecurity(resourceURL, docURL) + should return the + ExternalResourceSecurity + strategry for a resource coming from resourceURL + referenced from the document at URL docURL. +
  • + +
+

+ The ScriptSecurity and ExternalResourceSecurity + interfaces have methods (checkLoadScript and + checkLoadExternalResource respectively) which should + throw a + SecurityException + if accessing the script or resource is considered a security violation. +

+
+
Note
+
+ The UserAgent interface has two additional methods + (checkLoadScript and checkLoadExternalResource + which are meant to provide a short hand for getting a security strategy + object and calling the checkLoad* method on that object. + This is how the + org.apache.batik.bridge.UserAgentAdapter + class implements this method. +
+
+

+ Batik provides the following set of ScriptSecurity + implementations: +

+
+ +
NoLoadScriptSecurity
+ +
+ +

The script resource should not be loaded.

+ +
+ +
EmbededScriptSecurity
+ +
+ +

+ The script resource will only be loaded if it is embeded in the SVG + document referencing it. This means that script attributes (such as + onclick on a rect element), + inline script elements and script elements + using a data: URL as its xlink:href attribute + value will be allowed. All other script resources should not be + loaded. +

+ +
+ +
DefaultScriptSecurity
+ +
+ +

+ The script resource will only + be loaded if it is embeded in the SVG document (see the description + of EmbededScriptSecurity) or if it is coming from the same + location as the document referencing the script. If the document comes + from a network server, then any script coming from that server will + be allowed. If the document comes from the file system, then only + scripts under the same directory root as the SVG document will be allowed. +

+ +
+ +
RelaxedScriptSecurity
+ +
+ +

+ Scripts from any location can be loaded. +

+ +
+ +
+

+ In addition, Batik provides the following set of + ExternalResourceSecurity implementations: +

+
+ +
NoLoadExternalResourceSecurity
+ +
+ +

No external references are allowed.

+ +
+ +
EmbededExternalResourceSecurity
+ +
+ +

+ Only resources embeded into the file are allowed (i.e., references + through the data: protocol). +

+ +
+ +
DefaultExternalResourceSecurity
+ +
+ +

+ Embeded external resources (see above) and resources coming from + the same location as the document referencing them are allowed. +

+ +
+ +
RelaxedExternalResourceSecurity
+ +
+ +

Resources from any location can be loaded.

+ +
+ +
+
+ + +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/using/svg-generator.html b/bin/svg_kit/batik-1.7/docs/using/svg-generator.html new file mode 100644 index 0000000..9ff3cbd --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/using/svg-generator.html @@ -0,0 +1,754 @@ + + + + + + + +SVG Generator: SVGGraphics2D + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

SVG Generator: SVGGraphics2D

+ + +
+Flow diagram illustrating that Java programs can have their graphics converted to SVG and then viewed in any SVG viewer +
+ +

+ As SVG is emerging as a promising graphics format for a wide range of + domains and applications, bridging it with Java becomes important. This + page explains how Batik’s + SVGGraphics2D, + referred to as the SVG Generator, makes this possible. +

+ + + +

The SVGGraphics2D class

+
+

+ On the Java platform, all rendering goes through the + Graphics2D + abstract class, which offers methods such as drawRect, + fillRect, and drawString. There are + specialized implementations of this abstract class for each type of + output, such as a screen or a printer. SVGGraphics2D is + a new implementation of that interface that generates SVG content + instead of drawing to a screen or a printer. +

+

+ +SVGGraphics2D has the following features: +

+
    + +
  • + it allows applications to export their graphics into SVG format, +
  • + +
  • + it does not require any modification of the graphics code to export + to SVG, and +
  • + +
  • + it offers the user the ability to use the DOM API to manipulate the + generated document. +
  • + +
+
+Diagram illustrating how the SVGGraphics2D inherits from Graphics2D, and uses Document to generate a DOM tree +
+

+ The above figure shows how the generator works with the DOM API. The W3C + has defined an API for representing XML content with a Java object. + That API allows programmers to manipulate, create, and/or modify XML + content in memory. The DOM API contains interfaces such as + Document, + Element, + and + Attr, + which model the Java programming language equivalent of XML documents, + elements and attributes. +

+

+ The generator manages a tree of DOM objects that represent the SVG + content corresponding to the rendering calls made on the + SVGGraphics2D instance. In other words, every time a + program invokes a rendering method, such as fillRect, on a + SVGGraphics2D instance, a new DOM object, + representing the SVG equivalent, is appended to the DOM tree. For + example, a rect element will be appended after the + fillRect method has been invoked). +

+

+ The programmer, using this generator, can then access the DOM tree to + further manipulate it or can directly write the content to an output + stream, as we see in the following section. +

+
+ + + +

How to use SVGGraphics2D

+
+

+ From the figure in the previous section we can see that in order for an + instance of SVGGraphics2D to build the SVG content (the + DOM tree), an instance of a Document class is needed. The + DOM tree is an in-memory representation of the SVG document, which can + be further manipulated by the user using DOM API or be streamed + out by a + Writer + object. +

+

+ The following example program demonstrates how to generate SVG content + from Java graphics. +

+
import java.awt.Rectangle;
+import java.awt.Graphics2D;
+import java.awt.Color;
+import java.io.Writer;
+import java.io.OutputStreamWriter;
+import java.io.IOException;
+
+import org.apache.batik.svggen.SVGGraphics2D;
+import org.apache.batik.dom.GenericDOMImplementation;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DOMImplementation;
+
+public class TestSVGGen {
+
+    public void paint(Graphics2D g2d) {
+        g2d.setPaint(Color.red);
+        g2d.fill(new Rectangle(10, 10, 100, 100));
+    }
+
+    public static void main(String[] args) throws IOException {
+
+        // Get a DOMImplementation.
+        DOMImplementation domImpl =
+            GenericDOMImplementation.getDOMImplementation();
+
+        // Create an instance of org.w3c.dom.Document.
+        String svgNS = "http://www.w3.org/2000/svg";
+        Document document = domImpl.createDocument(svgNS, "svg", null);
+
+        // Create an instance of the SVG Generator.
+        SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
+
+        // Ask the test to render into the SVG Graphics2D implementation.
+        TestSVGGen test = new TestSVGGen();
+        test.paint(svgGenerator);
+
+        // Finally, stream out SVG to the standard output using
+        // UTF-8 encoding.
+        boolean useCSS = true; // we want to use CSS style attributes
+        Writer out = new OutputStreamWriter(System.out, "UTF-8");
+        svgGenerator.stream(out, useCSS);
+    }
+}
+

+ We can see that generating SVG content from our TestSVGGen + instance is a three step process: +

+
    + +
  1. + +

    + Create an instance of org.w3c.dom.Document that the + generator will use to build its XML content, and create an SVG generator + using the Document instance. +

    + +
            // Get a DOMImplementation.
    +        DOMImplementation domImpl =
    +            GenericDOMImplementation.getDOMImplementation();
    +
    +        // Create an instance of org.w3c.dom.Document.
    +        String svgNS = "http://www.w3.org/2000/svg";
    +        Document document = domImpl.createDocument(svgNS, "svg", null);
    +
    +        // Create an instance of the SVG Generator.
    +        SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
    + +
  2. + +
  3. + +

    + Invoke the rendering code on our SVG generator. In our example, we + invoke TestSVGGen‘s paint method: +

    + +
            // Ask the test to render into the SVG Graphics2D implementation.
    +        TestSVGGen test = new TestSVGGen();
    +        test.paint(svgGenerator);
    + +
  4. + +
  5. + +

    + Stream out the SVG content. The SVG generator can stream its content + into any java.io.Writer. In our example, we stream the + content to the standard output stream: +

    + +
            // Finally, stream out SVG to the standard output using
    +        // UTF-8 encoding.
    +        boolean useCSS = true; // we want to use CSS style attributes
    +        Writer out = new OutputStreamWriter(System.out, "UTF-8");
    +        svgGenerator.stream(out, useCSS);
    + +
  6. + +
+

+ SVG has + two + ways to specify styling properties, such as the fill color: + presentation attributes (one XML attribute per property) or the CSS + style attribute (any number of properties in one CSS + inline stylesheet). The useCss parameter allows the user + to control that option. +

+
+ + + +

SVG Generator customization

+
+

+ In the previous section, we have just seen that the SVG generation + process can be customized to output SVG styling properties as + presentation attributes or CSS inline stylesheets. In this section we + will talk about some examples of more advanced customizations. +

+

+ Instead of creating the SVGGraphics2D just by using the + Document that will be used as a factory for creating the + SVG elements, we can use the constructor that uses an + SVGGeneratorContext + instance. By providing your own SVGGeneratorContext + instance, you will be able to do advanced customization. You will find + below several examples of possible customizations. +

+ +

Have your own comment in the generated SVG file

+

+ We begin with the simplest possible example. If you integrate the + Batik SVG generator in your own Java application, you may want to + specialize the comment generated in the XML code. +

+
DOMImplementation impl =
+    GenericDOMImplementation.getDOMImplementation();
+String svgNS = "http://www.w3.org/2000/svg";
+Document myFactory = impl.createDocument(svgNS, "svg", null);
+
+SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(myFactory);
+ctx.setComment("Generated by FooApplication with Batik SVG Generator");
+SVGGraphics2D g2d = new SVGGraphics2D(ctx, false);
+ +

Use embedded SVG Fonts in the generated SVG file

+

+ In order to have a self-contained SVG file that doesn't have to use + system fonts to be displayed, you can embed the fonts you used for + drawing strings in the SVG file through the SVG fonts facility. +

+
DOMImplementation impl =
+    GenericDOMImplementation.getDOMImplementation();
+String svgNS = "http://www.w3.org/2000/svg";
+Document myFactory = impl.createDocument(svgNS, "svg", null);
+
+SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(myFactory);
+ctx.setEmbeddedFontsOn(true);
+SVGGraphics2D g2d = new SVGGraphics2D(ctx, true);
+ +

Customizing the way images are stored

+

+ Every time you call one of the drawImage methods + provided by the Graphics2D interface, a default + representation of your image is created in a location and put in a + default file. For instance, a base64 encoding is created and embedded + in the SVG file by default. Alternatively, you can choose to have your + images written to separate files in a predefined directory, in one of + the two raster formats required by the SVG specification: JPEG or PNG. +

+

+ You can change the default behavior by explicitly providing the + image handler to be used by the SVG generator. Once again, you use + the SVGGeneratorContext for this. In the example below, + all images are converted to PNG format and written to directory + res/images. +

+
DOMImplementation impl =
+    GenericDOMImplementation.getDOMImplementation();
+String svgNS = "http://www.w3.org/2000/svg";
+Document myFactory = impl.createDocument(svgNS, "svg", null);
+
+SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(myFactory);
+GenericImageHandler ihandler = new ImageHandlerPNGEncoder("res/images", null);
+ctx.setImageHandler(ihandler);
+SVGGraphics2D g2d = new SVGGraphics2D(ctx, false);
+

+ Using the default image handlers results in a new copy of the image + data being written to the SVG file or an external file, for every + single drawImage call. If you use the same images over + and over again, then this may result in an SVG file containing a lot + of redundant data. At the price of a slight performance penalty + during initial generation of the SVG DOM tree, you can choose to + have your image data reused. For this you use a specialized image + handler, as shown below. +

+
DOMImplementation impl =
+    GenericDOMImplementation.getDOMImplementation();
+String svgNS = "http://www.w3.org/2000/svg";
+Document myFactory = impl.createDocument(svgNS, "svg", null);
+
+SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(myFactory);
+
+// Reuse our embedded base64-encoded image data.
+GenericImageHandler ihandler = new CachedImageHandlerBase64Encoder();
+ctx.setGenericImageHandler(ihandler);
+
+SVGGraphics2D g2d = new SVGGraphics2D(ctx, false);
+

+ With the caching image handlers, it is even possible to reuse the + same copy of your image data across several different SVG documents. + Just keep a reference to the image handler, and pass it to the + SVGGraphics2D instance used for generating the SVG DOM + tree. The following simplified example shows how different SVG trees + might be created by separate SVG generators, efficiently storing any + common images just once. +

+
class MySVGGenerator {
+
+    // The image handler will write all images files to "res/images".
+    private static ImageHandler ihandler =
+        new CachedImageHandlerPNGEncoder("res/images", null);
+
+    public void generateSVG(JPanel myCanvas, OutputStream outStream) {
+        DOMImplementation domImpl =
+            GenericDOMImplementation.getDOMImplementation();
+        Document myFactory = domImpl.createDocument(svgNS, "svg", null);
+        SVGGeneratorContext ctx =
+            SVGGeneratorContext.createDefault(myFactory);
+        ctx.setGenericImageHandler(ihandler);
+
+        SVGGraphics2D svgGenerator = new SVGGraphics2D(ctx, false);
+
+        // Create the SVG DOM tree.
+        myCanvas.paintComponent(svgGenerator);
+
+        Writer out = new OutputStreamWriter(outStream, "UTF-8");
+        svgGenerator.stream(out, true);
+    }
+}
+ +

Customizing the generated SVG style

+

+ Your needs in matter of styling may be different from the two + provided options (XML presentation attributes or CSS inline + stylesheets). For example, you may want to put the CSS properties in + a SVG style element section and reference them through + the class attribute. In this case you will need to define a new + StyleHandler + as below. +

+
public class StyleSheetStyleHandler implements StyleHandler {
+
+    // The CDATA section that holds the CSS stylesheet.
+    private CDATASection styleSheet;
+
+    // Build the handler with a reference to the stylesheet section.
+    public StyleSheetStyleHandler(CDATASection styleSheet) {
+        this.styleSheet = styleSheet;
+    }
+
+    public void setStyle(Element element, Map styleMap,
+                         SVGGeneratorContext generatorContext) {
+        Iterator iter = styleMap.keySet().iterator();
+
+        // Create a new class in the style sheet.
+        String id = generatorContext.getIDGenerator().generateID("C");
+        styleSheet.appendData("."+ id +" {");
+
+        // Append each key/value pair.
+        while (iter.hasNext()) {
+            String key = (String) iter.next();
+            String value = (String) styleMap.get(key);
+            styleSheet.appendData(key + ":" + value + ";");
+        }
+
+        styleSheet.appendData("}\n");
+
+        // Reference the stylesheet class on the element to be styled.
+        element.setAttributeNS(null, "class", id);
+    }
+}
+

+ Then you can create and use an SVGGraphics2D with a + correctly configured SVGGeneratorContext. +

+
+// Configure the SVGGraphics2D for a given Document myFactory.
+SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(myFactory);
+CDATASection styleSheet = myFactory.createCDATASection("");
+ctx.setStyleHandler(new StyleSheetStyleHandler(styleSheet));
+SVGGraphics2D g2d = new SVGGraphics2D(ctx, false);
+
+// Use the g2d to draw (e.g., component.paint(g2d)).
+
+// Add a stylesheet to the definition section.
+SVGSVGElement root = (SVGSVGElement) g2d.getRoot();
+Element defs = root.getElementById(SVGSyntax.ID_PREFIX_GENERIC_DEFS);
+Element style = myFactory.createElementNS
+    (SVGSyntax.SVG_NAMESPACE_URI, SVGSyntax.SVG_STYLE_TAG);
+style.setAttributeNS(null, SVGSyntax.SVG_TYPE_ATTRIBUTE, "text/css");
+style.appendChild(styleSheet);
+defs.appendChild(style);
+
+// Dump the root content to a given Writer myWriter.
+g2d.stream(root, myWriter);
+ +

Extending Paint object to SVG element translation

+

+ The SVGGraphics2D is able to generate SVG elements for + generic Java 2D objects, but you sometimes have your own classes such + as implementations of the Java 2D + Paint + interface. In this case, you will need to write an + ExtensionHandler + that you will set on your SVGGeneratorContext. +

+

+ In the following example we define the first draft of an + ExtensionHandler allowing to translate a Batik + implementation of the Paint interface named + LinearGradientPaint. +

+
class MyExtensionHandler extends DefaultExtensionHandler {
+
+    public SVGPaintDescriptor handlePaint(Paint paint,
+                                          SVGGeneratorContext generatorCtx) {
+        if (paint instanceof LinearGradientPaint) {
+            LinearGradientPaint gradient = (LinearGradientPaint) paint;
+
+            // Create a new SVG 'linearGradient' element to represent the
+            // LinearGradientPaint being used.
+            String id = generatorCtx.getIDGenerator().generateID("gradient");
+            Document doc = generatorCtx.getDOMFactory();
+            Element grad = doc.createElementNS
+                (SVGSyntax.SVG_NAMESPACE_URI,
+                 SVGSyntax.SVG_LINEAR_GRADIENT_TAG);
+
+            // Set the relevant attributes on the 'linearGradient' element.
+            grad.setAttributeNS(null, SVGSyntax.SVG_ID_ATTRIBUTE, id);
+            grad.setAttributeNS(null, SVGSyntax.SVG_GRADIENT_UNITS_ATTRIBUTE,
+                                SVGSyntax.SVG_USER_SPACE_ON_USE_VALUE);
+            Point2D pt = gradient.getStartPoint();
+            grad.setAttributeNS(null, "x1", pt.getX());
+            grad.setAttributeNS(null, "y1", pt.getY());
+            pt = gradient.getEndPoint();
+            grad.setAttributeNS(null, "x2", pt.getX());
+            grad.setAttributeNS(null, "y2", pt.getY());
+
+            switch (gradient.getCycleMethod()) {
+            case MultipleGradientPaint.REFLECT:
+                grad.setAttributeNS
+                    (null, SVGSyntax.SVG_SPREAD_METHOD_ATTRIBUTE,
+                     SVGSyntax.SVG_REFLECT_VALUE);
+                break;
+            case MultipleGradientPaint.REPEAT:
+                grad.setAttributeNS
+                    (null, SVGSyntax.SVG_SPREAD_METHOD_ATTRIBUTE,
+                     SVGSyntax.SVG_REPEAT_VALUE);
+                break;
+            // 'pad' is the default...
+            }
+
+            // Here we should write the transform of the gradient
+            // in the transform attribute...
+
+            // Here we should write the stops of the gradients as 
+            // children elements...
+
+            return new SVGPaintDescriptor
+                ("url(#" + ref + ")", SVGSyntax.SVG_OPAQUE_VALUE, grad);
+        } else {
+            // Let the default mechanism do its job.
+            return null;
+        }
+    }
+}
+

+ You should then set it on the SVGGeneratorContext by + using the setExtensionHandler method. +

+
SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(myFactory);
+ctx.setExtensionHandler(new MyExtensionHandler());
+SVGGraphics2D g2d = new SVGGraphics2D(ctx, false);
+
+ + + +

How to view the generated SVG document

+
+

+ The following code example illustrates how to view the SVG content + generated + by an SVGGraphics2D object.

+
import java.awt.*;
+import java.awt.geom.*;
+
+import javax.swing.*;
+
+import org.apache.batik.swing.*;
+import org.apache.batik.svggen.*;
+import org.apache.batik.dom.svg.SVGDOMImplementation;
+
+import org.w3c.dom.*;
+import org.w3c.dom.svg.*;
+
+public class ViewGeneratedSVGDemo {
+
+    public static void main(String[] args) {
+        // Create an SVG document.
+        DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
+        String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
+        SVGDocument doc = (SVGDocument) impl.createDocument(svgNS, "svg", null);
+
+        // Create a converter for this document.
+        SVGGraphics2D g = new SVGGraphics2D(doc);
+
+        // Do some drawing.
+        Shape circle = new Ellipse2D.Double(0, 0, 50, 50);
+        g.setPaint(Color.red);
+        g.fill(circle);
+        g.translate(60, 0);
+        g.setPaint(Color.green);
+        g.fill(circle);
+        g.translate(60, 0);
+        g.setPaint(Color.blue);
+        g.fill(circle);
+        g.setSVGCanvasSize(new Dimension(180, 50));
+
+        // Populate the document root with the generated SVG content.
+        Element root = doc.getDocumentElement();
+        g.getRoot(root);
+
+        // Display the document.
+        JSVGCanvas canvas = new JSVGCanvas();
+        JFrame f = new JFrame();
+        f.getContentPane().add(canvas);
+        canvas.setSVGDocument(doc);
+        f.pack();
+        f.setVisible(true);
+    }
+}
+
+ +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/using/swing.html b/bin/svg_kit/batik-1.7/docs/using/swing.html new file mode 100644 index 0000000..f0defde --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/using/swing.html @@ -0,0 +1,508 @@ + + + + + + + +Batik Swing components + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Batik Swing components

+ + +

+ The goal of the Batik Swing component module is to provide a Swing + component that can used to display SVG documents. + With the + JSVGCanvas + class, you can easily display an SVG document (from a URI or a DOM tree) + and allow the user to manipulate it, such as rotating, zooming, panning, + selecting text or activating hyperlinks. First this document explains how + to create a JSVGCanvas and integrate it in to a Swing + application. Then, it descibes some advanced features such as the listener + mechanism used to track all events that occurred while displaying or + manipulating an SVG document. +

+ + + +

Creating a JSVGCanvas

+
+

+ The following example illustrates how to create a + JSVGCanvas, which is a Swing component that follows the + Swing design rule. This means that the component is not thread safe and + all operations on the component or the document it is displaying must + be performed as described in + the + Swing tutorial. The JSVGCanvas is also a + JavaBean, so it + can be used in visual application builders. +

+
+
Note
+
+ If you try this example, do not forget to set your + CLASSPATH so that it contains the Batik classes and + resources, as well as Xerces (lib/xerces_2_5_0.jar) + and the XML APIs jars (lib/xml-apis.jar and + lib/xml-apis-ext.jar). +
+
+
import java.awt.*;
+import java.awt.event.*;
+import java.io.*;
+
+import javax.swing.*;
+
+import org.apache.batik.swing.JSVGCanvas;
+import org.apache.batik.swing.gvt.GVTTreeRendererAdapter;
+import org.apache.batik.swing.gvt.GVTTreeRendererEvent;
+import org.apache.batik.swing.svg.SVGDocumentLoaderAdapter;
+import org.apache.batik.swing.svg.SVGDocumentLoaderEvent;
+import org.apache.batik.swing.svg.GVTTreeBuilderAdapter;
+import org.apache.batik.swing.svg.GVTTreeBuilderEvent;
+
+public class SVGApplication {
+
+    public static void main(String[] args) {
+        // Create a new JFrame.
+        JFrame f = new JFrame("Batik");
+        SVGApplication app = new SVGApplication(f);
+
+        // Add components to the frame.
+        f.getContentPane().add(app.createComponents());
+
+        // Display the frame.
+        f.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent e) {
+                System.exit(0);
+            }
+        });
+        f.setSize(400, 400);
+        f.setVisible(true);
+    }
+    
+    // The frame.
+    protected JFrame frame;
+
+    // The "Load" button, which displays up a file chooser upon clicking.
+    protected JButton button = new JButton("Load...");
+
+    // The status label.
+    protected JLabel label = new JLabel();
+
+    // The SVG canvas.
+    protected JSVGCanvas svgCanvas = new JSVGCanvas();
+
+    public SVGApplication(JFrame f) {
+        frame = f;
+    }
+
+    public JComponent createComponents() {
+        // Create a panel and add the button, status label and the SVG canvas.
+        final JPanel panel = new JPanel(new BorderLayout());
+
+        JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
+        p.add(button);
+        p.add(label);
+
+        panel.add("North", p);
+        panel.add("Center", svgCanvas);
+
+        // Set the button action.
+        button.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent ae) {
+                JFileChooser fc = new JFileChooser(".");
+                int choice = fc.showOpenDialog(panel);
+                if (choice == JFileChooser.APPROVE_OPTION) {
+                    File f = fc.getSelectedFile();
+                    try {
+                        svgCanvas.setURI(f.toURL().toString());
+                    } catch (IOException ex) {
+                        ex.printStackTrace();
+                    }
+                }
+            }
+        });
+
+        // Set the JSVGCanvas listeners.
+        svgCanvas.addSVGDocumentLoaderListener(new SVGDocumentLoaderAdapter() {
+            public void documentLoadingStarted(SVGDocumentLoaderEvent e) {
+                label.setText("Document Loading...");
+            }
+            public void documentLoadingCompleted(SVGDocumentLoaderEvent e) {
+                label.setText("Document Loaded.");
+            }
+        });
+
+        svgCanvas.addGVTTreeBuilderListener(new GVTTreeBuilderAdapter() {
+            public void gvtBuildStarted(GVTTreeBuilderEvent e) {
+                label.setText("Build Started...");
+            }
+            public void gvtBuildCompleted(GVTTreeBuilderEvent e) {
+                label.setText("Build Done.");
+                frame.pack();
+            }
+        });
+
+        svgCanvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
+            public void gvtRenderingPrepare(GVTTreeRendererEvent e) {
+                label.setText("Rendering Started...");
+            }
+            public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
+                label.setText("");
+            }
+        });
+
+        return panel;
+    }
+}
+
+Screenshot of the example SVGApplication program +
+
+ + + +

Handling events

+
+

+ Each time you set a URI or an SVG DOM tree to be displayed in a + JSVGCanvas (using the setURI or + setSVGDocument method), the specified document is first + parsed (in case of a URI), built, rendered and optionally updated. The + proper way to be notified of these different phases is to implement a + listener and attach it to the component. There are five types + of listener: +

+
+ +
+SVGDocumentLoaderListener +
+ +
+ +

+ The + SVGDocumentLoaderListener + provides a set of methods that can be used to track + SVGDocumentLoaderEvent + events. It describes the loading phase: contructing an SVG + DOM tree using an SVG file. +

+ +
+ +
+GVTTreeBuilderListener +
+ +
+ +

+ The + GVTTreeBuilderListener + provides a set of methods that can be used to track + GVTTreeBuilderEvent + events. It describes the building phase: contructing a GVT + (Graphics Vector Toolkit) tree using an SVG DOM tree. The GVT tree + will then be used to render the document. +

+ +
+ +
+SVGLoadEventDispatcherListener +
+ +
+ +

+ The + SVGLoadEventDispatcherListener + provides a set of methods that can be used to track + SVGLoadEventDispatcherEvent + events. It describes the DOM SVGLoad event dispatch phase. +

+ +

+ This event is triggered only in dynamic documents. +

+ +
+ +
+GVTTreeRendererListener +
+ +
+ +

+ The + GVTTreeRendererListener + provides a set of methods that can be used to track + GVTTreeRendererEvent + events. It describes the rendering phase: constructing an image using + a GVT tree. +

+ +

+ In dynamic documents this event is fired only once for the initial rendering. +

+ +
+ +
+UpdateManagerListener +
+ +
+ +

+ The + UpdateManagerListener + provides a set of methods that can be used to track + UpdateManagerEvent + events. It describes the running phase: the update manager is + started and then it can be suspended, resumed or stopped, and + graphics updates can be tracked. +

+ +

+ This event is triggered only in dynamic documents. +

+ +
+ +
+

+ These listeners give a complete description of the different steps of + the five phases (including error states). Adapter classes are available + to ease the creation of new listener implementation—SVGDocumentLoaderAdapter, + GVTTreeBuilderListenerAdapter, + SVGLoadEventDispatcherAdapter, + GVTTreeRendererAdapter + and + UpdateManagerAdapter, +

+

+ For static documents, you can assume that the JSVGCanvas has completed + its job (parsing, building and rendering) when the + gvtRenderingCompleted method call is called, following a + setURI or a setSVGDocument method call. +

+

+ In the case of dynamic documents, the end of the computation (parsing, + building, SVGLoad dispatch, initial rendering and updates) is marked + by a call to the updateManagerStopped method. +

+
+ + + +

Adding an Interactor

+
+

+ The JSVGCanvas provides a set of build-in interactors that + let the users manipulate the displayed document, including ones for + zooming, panning and rotating. Interactors catch user input to the + JSVGCanvas component and translate them into behaviour. + If you want to add new behaviors to the JSVGCanvas, you + can implement the + Interactor + interface. Then, you can register this new interactor to the component + by adding an element to the List returned by the + getInteractors() method of the canvas. +

+
+ + + +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/docs/using/transcoder.html b/bin/svg_kit/batik-1.7/docs/using/transcoder.html new file mode 100644 index 0000000..d7d9186 --- /dev/null +++ b/bin/svg_kit/batik-1.7/docs/using/transcoder.html @@ -0,0 +1,811 @@ + + + + + + + +Transcoder API + + + + + + + + + +
+ + + +
+ + + + +
+Apache Batik +
+ + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

Transcoder API

+ + +

+ The goal of the transcoder API (package + org.apache.batik.transcoder) is to provide a generic + API for transcoding an input to an output. First, this document + explains the basic transcoder API that + Transcoder, + TranscoderInput + and + TranscoderOutput + define, and thus all transcoders have in common. Next, it describes + how to use the image transcoder API (package + org.apache.batik.transcoder.image), which lets you + rasterize an SVG document fragment to a raster image such as JPEG, + PNG or TIFF. +

+ + + +

The transcoder API

+
+

+ The org.apache.batik.transcoder package defines 5 major + classes: +

+
+ +
Transcoder
+ +
+ +

+ The + Transcoder + interface defines the interface that all transcoders implement. You can + transcode a specific input using a specific output by invoking the + transcode method. Although there is no assumption on the + input and output format, a specific transcoder may or may not support + a particular type of input or output. For example, the image + transcoders accept an SVG + Document, + a + Reader, + an + InputStream, + or a + URI + as an input but only supports a byte stream for the output. +

+ +
+ + +
TranscoderInput
+ +
+ +

+ The + TranscoderInput + interface defines the input of a transcoder. There are various ways to create an + input and the most common are already part of the API. The default + implementation lets you create an input using a + org.w3c.dom.Document, a Reader, an + InputStream, a org.xml.sax.XMLReader, or a + URI. +

+ +
+ + +
TranscoderOutput
+ +
+ +

+ The + TranscoderOutput + interface defines the output of a transcoder. There are various ways to create an + output and the most commons are already part of the API. The default + implementation lets you create an output using a + Document, + a + Writer, + an + OutputStream, + a + XMLFilter, + or a + URI. +

+ +
+ + +
TranscodingHints
+ +
+ +

+ The + TranscodingHints + class contains different hints that can be used to control + the various options or parameters of a transcoder. Each transcoder + provides its own set of hints. A hint is specified by (key, value) + pair. For example, the + JPEGTranscoder + provides a hint to control the encoding quality. +

+ +
+ + +
ErrorHandler
+ +
+ +

+ The + ErrorHandler + class provides a way to get any errors or warnings that might + occur while transcoding. A default implementation is provided but + you can, for example, implement your own handler that displays a dialog + instead of stack trace. +

+ +
+ +
+
+ + + +

How to use the image transcoder API

+
+

+ The org.apache.batik.transcoder.image package provides an + easy way to transcode an SVG document to a raster image such as JPEG, + PNG or TIFF. Additional raster image formats can be added by + subclassing the ImageTranscoder class and implementing the + writeImage method. Although, in next sections, the + examples will use the JPEG transcoder, the PNG transcoder works the + same way. +

+ +

Creating an image

+

+ The following example, using the JPEGTranscoder, shows how to + transform an SVG document to a JPEG image. +

+
import java.io.*;
+
+import org.apache.batik.transcoder.image.JPEGTranscoder;
+import org.apache.batik.transcoder.TranscoderInput;
+import org.apache.batik.transcoder.TranscoderOutput;
+
+public class SaveAsJPEG {
+
+    public static void main(String[] args) throws Exception {
+
+        // Create a JPEG transcoder
+        JPEGTranscoder t = new JPEGTranscoder();
+
+        // Set the transcoding hints.
+        t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,
+                             new Float(.8));
+
+        // Create the transcoder input.
+        String svgURI = new File(args[0]).toURL().toString();
+        TranscoderInput input = new TranscoderInput(svgURI);
+
+        // Create the transcoder output.
+        OutputStream ostream = new FileOutputStream("out.jpg");
+        TranscoderOutput output = new TranscoderOutput(ostream);
+
+        // Save the image.
+        t.transcode(input, output);
+
+        // Flush and close the stream.
+        ostream.flush();
+        ostream.close();
+        System.exit(0);
+    }
+}
+

+ The code creates a JPEGTranscoder and sets a + transcoding hint. The hint indicates the encoding quality. Then, an + input and an output are created. The input is created using the first + command line argument, which should be a URI. The output is a byte + stream for a file called out.jpg. Finally, the + transcode method is invoked and the byte stream is + closed. +

+

+ Although not shown above, the program might have specified additional + hints to indicate a user stylesheet, the preferred language of the + document or the background color. +

+

+ To try this program: +

+
    + +
  1. + +

    Save the above program as SaveAsJPEG.java.

    + +
  2. + +
  3. + +

    Compile the program.

    + +
  4. + +
  5. + +

    Choose an SVG file to transcode, and perform the transcoding by running:

    + +
    java SaveAsJPEG filename.svg
    + +
  6. + +
  7. + +

    Inspect the output file out.jpg.

    + +
  8. + +
+ +

Defining the size of the image

+

+ By adding the following line of code to the previous example, you will + specify the raster image size (in pixels). The transcoding hint + KEY_WIDTH lets you specify the raster image width. If the + raster image height is not provided (using the KEY_HEIGHT), + the transcoder will compute the raster image height by keeping the + aspect ratio of the SVG document. +

+
t.addTranscodingHint(JPEGTranscoder.KEY_WIDTH, new Float(100));
+

+ The transcoder will have the same behavior if you specify the + KEY_HEIGHT without initializing the + KEY_WIDTH. In all cases (even if both keys are provided), + the transcoder will preserve the apsect ratio of the SVG document. +

+ +

Selecting an area of interest

+

+ The image transcoder lets you specify an area of interest (that is, a + part of the SVG document). The key KEY_AOI allows you to + select the region of the SVG document to render. The value of this key must + be a + java.awt.Rectangle + specified in pixels, using the coordinate space of the SVG document. The + following example shows how you can split an SVG document into 4 tiles. +

+
import java.io.*;
+import java.awt.*;
+
+import org.apache.batik.transcoder.image.JPEGTranscoder;
+import org.apache.batik.transcoder.TranscoderInput;
+import org.apache.batik.transcoder.TranscoderOutput;
+
+public class SaveAsJPEGTiles {
+
+    JPEGTranscoder trans = new JPEGTranscoder();
+
+    public SaveAsJPEGTiles() {
+        trans.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,
+                                 new Float(.8));
+    }
+
+    public void tile(String inputFilename,
+                     String outputFilename,
+                     Rectangle aoi) throws Exception {
+        // Set hints to indicate the dimensions of the output image
+        // and the input area of interest.
+        trans.addTranscodingHint(JPEGTranscoder.KEY_WIDTH,
+                                 new Float(aoi.width));
+        trans.addTranscodingHint(JPEGTranscoder.KEY_HEIGHT,
+                                 new Float(aoi.height));
+        trans.addTranscodingHint(JPEGTranscoder.KEY_AOI, aoi);
+
+        // Transcode the file.
+        String svgURI = new File(inputFilename).toURL().toString();
+        TranscoderInput input = new TranscoderInput(svgURI);
+        OutputStream ostream = new FileOutputStream(outputFilename);
+        TranscoderOutput output = new TranscoderOutput(ostream);
+        trans.transcode(input, output);
+
+        // Flush and close the output.
+        ostream.flush();
+        ostream.close();
+    }
+
+    public static void main(String[] args) throws Exception {
+        // Rasterize the samples/anne.svg document and save it
+        // as four tiles.
+        SaveAsJPEGTiles p = new SaveAsJPEGTiles();
+        String in = "samples/anne.svg";
+        int documentWidth = 450;
+        int documentHeight = 500;
+        int dw2 = documentWidth / 2;
+        int dh2 = documentHeight / 2;
+        p.tile(in, "tileTopLeft.jpg", new Rectangle(0, 0, dw2, dh2));
+        p.tile(in, "tileTopRight.jpg", new Rectangle(dw2, 0, dw2, dh2));
+        p.tile(in, "tileBottomLeft.jpg", new Rectangle(0, dh2, dw2, dh2));
+        p.tile(in, "tileBottomRight.jpg", new Rectangle(dw2, dh2, dw2, dh2));
+        System.exit(0);
+    }
+}
+

+ This code splits the same document anne.svg into four + tiles of the same size. Considering the document and its original + size, we can determine four regions. Then we rasterize each region + using the KEY_AOI key. Note that we also specify the + image width and height to be the same as the area of interest width and + height (so we keep a 1:1 zoom factor). You can of course use different + values for the KEY_WIDTH and KEY_HEIGHT, that + do not match the dimensions of the KEY_AOI key. In that + case, first the area of interest will determine which part of the SVG + document has to be rendered, then that part could be zoomed in or out + depending on the specified raster image size. +

+

+ To try this program: +

+
    + +
  1. +

    Save the above program as SaveAsJPEGTiles.java.

    +
  2. + +
  3. +

    Compile the program.

    +
  4. + +
  5. +

    Copy the samples/anne.svg document from the Batik + distribution into the current directory.

    +
  6. + +
  7. + +

    Run the program by typing:

    + +
    java SaveAsJPEGTiles
    + +
  8. + +
  9. + +

    + Inspect the output files tileTopRight.jpg, + tileTopRight.jpg, tileBottomRight.jpg + and tileBottomLeft.jpg. +

    + +
  10. + +
+ +

Other transcoding hints

+

+ The ImageTranscoder provides additional + TranscodingHints that let you customize the generated + images. +

+
+ +
+ImageTranscoder.KEY_MEDIA +
+ +
+ +

+ This hint lets you choose the CSS medium to use. The author of the SVG document + to transcode can control CSS media using the + CSS media rule. + For example: +

+ +
trans.addTranscodingHint(ImageTranscoder.KEY_MEDIA, "print");
+ +
+ + +
+ImageTranscoder.KEY_ALTERNATE_STYLESHEET +
+ +
+ +

+ This hint lets you choose an alternate stylesheet the author of the SVG + document to transcode might have provided using the + xml-stylesheet + processing instruction. For exxample: +

+ +
trans.addTranscodingHint(ImageTranscoder.KEY_ALTERNATE_STYLESHEET,
+                         alternateStylesheetName);
+ +
+ + +
+ImageTranscoder.KEY_USER_STYLESHEET_URI +
+ +
+ +

+ This hint lets you use a user stylesheet. A user stylesheet can override some + styles of the SVG document to transcode. For example: +

+ +
trans.addTranscodingHint(ImageTranscoder.KEY_USER_STYLESHEET_URI, "http://...");
+ +
+ + +
+ImageTranscoder.KEY_PIXEL_TO_MM +
+ +
+ +

+ This hint lets you use the pixel to millimeter conversion factor. + This factor is used to determine how units are converted into + pixels. For example: +

+ +
// 96dpi
+trans.addTranscodingHint(ImageTranscoder.KEY_PIXEL_TO_MM, new Float(0.2645833f));
+ +

or

+ +
// 72pi
+trans.addTranscodingHint(ImageTranscoder.KEY_PIXEL_TO_MM, new Float(0.3528f));
+ +
+ + +
+ImageTranscoder.KEY_BACKGROUND_COLOR +
+ +
+ +

+ This hint lets you choose a background color. For example: +

+ +
trans.addTranscodingHint(ImageTranscoder.KEY_BACKGROUND_COLOR, Color.white);
+ +
+ +
+ +

Generating an image from an SVG DOM tree

+

+ The following code creates and saves an SVG DOM tree to + a raster image. +

+
import java.io.*;
+
+import org.apache.batik.transcoder.image.JPEGTranscoder;
+import org.apache.batik.transcoder.TranscoderInput;
+import org.apache.batik.transcoder.TranscoderOutput;
+import org.apache.batik.dom.svg.SVGDOMImplementation;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.DOMImplementation;
+
+public class DOMRasterizer {
+
+    public Document createDocument() {
+
+        // Create a new document.
+        DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
+        String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
+        Document document =
+            impl.createDocument(svgNS, "svg", null);
+        Element root = document.getDocumentElement();
+        root.setAttributeNS(null, "width", "450");
+        root.setAttributeNS(null, "height", "500");
+
+        // Add some content to the document.
+        Element e;
+        e = document.createElementNS(svgNS, "rect");
+        e.setAttributeNS(null, "x", "10");
+        e.setAttributeNS(null, "y", "10");
+        e.setAttributeNS(null, "width", "200");
+        e.setAttributeNS(null, "height", "300");
+        e.setAttributeNS(null, "style", "fill:red;stroke:black;stroke-width:4");
+        root.appendChild(e);
+
+        e = document.createElementNS(svgNS, "circle");
+        e.setAttributeNS(null, "cx", "225");
+        e.setAttributeNS(null, "cy", "250");
+        e.setAttributeNS(null, "r", "100");
+        e.setAttributeNS(null, "style", "fill:green;fill-opacity:.5");
+        root.appendChild(e);
+
+        return document;
+    }
+
+    public void save(Document document) throws Exception {
+
+        // Create a JPEGTranscoder and set its quality hint.
+        JPEGTranscoder t = new JPEGTranscoder();
+        t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,
+                             new Float(.8));
+
+        // Set the transcoder input and output.
+        TranscoderInput input = new TranscoderInput(document);
+        OutputStream ostream = new FileOutputStream("out.jpg");
+        TranscoderOutput output = new TranscoderOutput(ostream);
+
+        // Perform the transcoding.
+        t.transcode(input, output);
+        ostream.flush();
+        ostream.close();
+    }
+
+    public static void main(String[] args) throws Exception {
+        // Runs the example.
+        DOMRasterizer rasterizer = new DOMRasterizer();
+        Document document = rasterizer.createDocument();
+        rasterizer.save(document);
+        System.exit(0);
+    }
+}
+
+

+ This code is divided into two distinct parts. +

+
+ +
Creating an SVG DOM tree
+ +
+ +

See the createDocument method.

+ +

+ Three steps are required at this time. The first step is to + get the Batik SVG DOM implementation (via the + SVGDOMImplementation class). Then, you can create a + org.w3c.dom.Document (which also implements the + SVGDocument interface) by invoking the + createDocument method with the SVG namespace URI and + the svg document element name. Finally, you can get + the document element and start building your DOM tree. +

+ +
+ +
Rasterizing the DOM
+ +
+ +

See the save method.

+ +

+ Similar to the previous examples, you can transcode an SVG + document to a raster image by creating a + TranscoderInput, but passing to it the SVG Document + this time. +

+ +
+ +
+

+ To try this example: +

+
    + +
  1. +

    Save the code as DOMRasterizer.java.

    +
  2. + +
  3. +

    Compile the program.

    +
  4. + +
  5. +

    Run it, by typingL

    + +
    java DOMRasterizer
    +
  6. + +
  7. +

    Inspect the output file out.jpg.

    +
  8. + +
+
+ + +
+ +
 
+
+ + + diff --git a/bin/svg_kit/batik-1.7/extensions/README.txt b/bin/svg_kit/batik-1.7/extensions/README.txt new file mode 100644 index 0000000..c256cf9 --- /dev/null +++ b/bin/svg_kit/batik-1.7/extensions/README.txt @@ -0,0 +1,13 @@ +The Jar files in this directory start the same application as in the +parent directory, except they include the Batik Extensions on the jar +file class path. This means that that the Batik Extensions will work +with the applications started by these jar files. + +Great care should be used when using the Batik Extensions as these are +not part of the SVG standard. If you write content that uses these +extensions you must be aware that this is not conformant SVG content +and other SVG renderers will not render these documents. These +extensions should only be used in content used in closed systems. + +The primary purpose of these extensions is demonstrative and to +generate feedback to the development of the SVG standard. diff --git a/bin/svg_kit/batik-1.7/extensions/batik-rasterizer-ext.jar b/bin/svg_kit/batik-1.7/extensions/batik-rasterizer-ext.jar new file mode 100644 index 0000000..65ae798 Binary files /dev/null and b/bin/svg_kit/batik-1.7/extensions/batik-rasterizer-ext.jar differ diff --git a/bin/svg_kit/batik-1.7/extensions/batik-squiggle-ext.jar b/bin/svg_kit/batik-1.7/extensions/batik-squiggle-ext.jar new file mode 100644 index 0000000..26233f0 Binary files /dev/null and b/bin/svg_kit/batik-1.7/extensions/batik-squiggle-ext.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/LICENSE.dom-documentation.txt b/bin/svg_kit/batik-1.7/lib/LICENSE.dom-documentation.txt new file mode 100644 index 0000000..966651b --- /dev/null +++ b/bin/svg_kit/batik-1.7/lib/LICENSE.dom-documentation.txt @@ -0,0 +1,86 @@ +xml-commons/java/external/LICENSE.dom-documentation.txt $Id: LICENSE.dom-documentation.txt 201084 2002-12-09 16:15:21Z vhardy $ + + +This license came from: http://www.w3.org/Consortium/Legal/copyright-documents-19990405 + + +W3C DOCUMENT NOTICE AND LICENSE +Copyright 1994-2001 World +Wide Web Consortium, World +Wide Web Consortium, (Massachusetts Institute of +Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. +http://www.w3.org/Consortium/Legal/ + +Public documents on the W3C site are provided by the copyright +holders under the following license. The software or Document Type +Definitions (DTDs) associated with W3C specifications are governed +by the Software Notice. By using and/or copying this document, or the +W3C document from which this statement is linked, you (the +licensee) agree that you have read, understood, and will comply +with the following terms and conditions: + +Permission to use, copy, and distribute the contents of this +document, or the W3C document from which this statement is linked, +in any medium for any purpose and without fee or royalty is hereby +granted, provided that you include the following on ALL +copies of the document, or portions thereof, that you use: + +A link or URL to the original W3C document. + +The pre-existing copyright notice of the original author, or if +it doesn't exist, a notice of the form: "Copyright [$date-of-document] World Wide Web +Consortium, (Massachusetts +Institute of Technology, Institut National de Recherche en Informatique et en +Automatique, Keio +University). All Rights Reserved. +http://www.w3.org/Consortium/Legal/" (Hypertext is preferred, but a +textual representation is permitted.) + +If it exists, the STATUS of the W3C document. + +When space permits, inclusion of the full text of this NOTICE +should be provided. We request that authorship +attribution be provided in any software, documents, or other items +or products that you create pursuant to the implementation of the +contents of this document, or any portion thereof. + +No right to create modifications or derivatives of W3C documents +is granted pursuant to this license. However, if additional +requirements (documented in the Copyright +FAQ) are satisfied, the right to create modifications or +derivatives issometimes granted by the W3C to individuals +complying with those requirements. + +THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO +REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT +NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS +OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE +IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY +PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, +SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE +DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS +THEREOF. + +The name and trademarks of copyright holders may NOT be used in +advertising or publicity pertaining to this document or its +contents without specific, written prior permission. Title to +copyright in this document will at all times remain with copyright +holders. + +---------------------------------------------------------------------------- +This formulation of W3C's notice and license became active on +April 05 1999 so as to account for the treatment of DTDs, schema's and +bindings. See the older formulation for the policy prior to this date. +Please see +our Copyright FAQ for common questions +about using materials from our site, including specific terms and +conditions for packages like libwww, Amaya, and Jigsaw. +Other questions about this notice can be directed to site-policy@w3.org. + +webmaster +(last updated by reagle on 1999/04/99.) \ No newline at end of file diff --git a/bin/svg_kit/batik-1.7/lib/LICENSE.dom-software.txt b/bin/svg_kit/batik-1.7/lib/LICENSE.dom-software.txt new file mode 100644 index 0000000..2b5bfeb --- /dev/null +++ b/bin/svg_kit/batik-1.7/lib/LICENSE.dom-software.txt @@ -0,0 +1,74 @@ +xml-commons/java/external/LICENSE.dom-software.txt $Id: LICENSE.dom-software.txt 201084 2002-12-09 16:15:21Z vhardy $ + + +This license came from: http://www.w3.org/Consortium/Legal/copyright-software-19980720 + + +W3C SOFTWARE NOTICE AND LICENSE +Copyright 1994-2001 World +Wide Web Consortium, World +Wide Web Consortium, (Massachusetts Institute of +Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. +http://www.w3.org/Consortium/Legal/ + +This W3C work (including software, documents, or other related +items) is being provided by the copyright holders under the +following license. By obtaining, using and/or copying this work, +you (the licensee) agree that you have read, understood, and will +comply with the following terms and conditions: +Permission to use, copy, modify, and distribute this software +and its documentation, with or without modification, for any +purpose and without fee or royalty is hereby granted, provided that +you include the following on ALL copies of the software and +documentation or portions thereof, including modifications, that +you make: + +The full text of this NOTICE in a location viewable to users of +the redistributed or derivative work. + +Any pre-existing intellectual property disclaimers, notices, or +terms and conditions. If none exist, a short notice of the +following form (hypertext is preferred, text is permitted) should +be used within the body of any redistributed or derivative code: +"Copyright [$date-of-software] World Wide Web Consortium, (Massachusetts Institute of +Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. +http://www.w3.org/Consortium/Legal/" + +Notice of any changes or modifications to the W3C files, +including the date changes were made. (We recommend you provide +URIs to the location from which the code is derived.) + +THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND +COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF +MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE +USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD +PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, +SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE +SOFTWARE OR DOCUMENTATION. + +The name and trademarks of copyright holders may NOT be used in +advertising or publicity pertaining to the software without +specific, written prior permission. Title to copyright in this +software and any associated documentation will at all times remain +with copyright holders. +____________________________________ +This formulation of W3C's notice and license became active on +August 14 1998 so as to improve compatibility with GPL. This +version ensures that W3C software licensing terms are no more +restrictive than GPL and consequently W3C software may be +distributed in GPL packages. See the older formulation for the +policy prior to this date. Please see our Copyright FAQ for common +questions about using materials from +our site, including specific terms and conditions for packages like +libwww, Amaya, and Jigsaw. +Other questions about this notice can be +directed to site-policy@w3.org. + +webmaster +(last updated $Date: 2002-12-10 03:15:21 +1100 (Tue, 10 Dec 2002) $) \ No newline at end of file diff --git a/bin/svg_kit/batik-1.7/lib/LICENSE.js.txt b/bin/svg_kit/batik-1.7/lib/LICENSE.js.txt new file mode 100644 index 0000000..1e7c812 --- /dev/null +++ b/bin/svg_kit/batik-1.7/lib/LICENSE.js.txt @@ -0,0 +1,890 @@ +This distribution includes a binary distribution of Mozilla Rhino 1.6 release 5 +plus one patch. + +You can get the unpatched 1.6R5 release of Rhino from the following URL: + + ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_6R5.zip + +To obtain the source code for the 1.6R5 release of Rhino, issue the following +commands: + + cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot \ + co -D2006-11-20 mozilla/js/rhino + +The patch is available here: + + https://bugzilla.mozilla.org/attachment.cgi?id=252418 + +which is attached to this bug: + + https://bugzilla.mozilla.org/show_bug.cgi?id=367627 + +Rhino is licensed under both the MPL (Mozilla Public License) 1.1 and the +GPL (GNU General Public License) 2.0, which are duplicated below. + +The Rhino jar also includes four classes: + org.mozilla.javascript.tools.debugger.downloaded.AbstractCellEditor.java + org.mozilla.javascript.tools.debugger.downloaded.JTreeTable.java + org.mozilla.javascript.tools.debugger.downloaded.TreeTableModel.java + org.mozilla.javascript.tools.debugger.downloaded.TreeTableModelAdapter.java +Which come from: + http://java.sun.com/products/jfc/tsc/articles/treetable2 + +Under the following license: + +Code sample +License +Copyright 1994-2006 Sun Microsystems, Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + + * Redistribution of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistribution in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + +Neither the name of Sun Microsystems, Inc. or the names of +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +This software is provided "AS IS," without a warranty of any kind. ALL +EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, +INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN +MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR +ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR +DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR +ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR +DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE +DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, +ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF +SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +You acknowledge that this software is not designed, licensed or +intended for use in the design, construction, operation or maintenance +of any nuclear facility. + + + +============================================================================== + + MOZILLA PUBLIC LICENSE + Version 1.1 + + --------------- + +1. Definitions. + + 1.0.1. "Commercial Use" means distribution or otherwise making the + Covered Code available to a third party. + + 1.1. "Contributor" means each entity that creates or contributes to + the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original + Code, prior Modifications used by a Contributor, and the Modifications + made by that particular Contributor. + + 1.3. "Covered Code" means the Original Code or Modifications or the + combination of the Original Code and Modifications, in each case + including portions thereof. + + 1.4. "Electronic Distribution Mechanism" means a mechanism generally + accepted in the software development community for the electronic + transfer of data. + + 1.5. "Executable" means Covered Code in any form other than Source + Code. + + 1.6. "Initial Developer" means the individual or entity identified + as the Initial Developer in the Source Code notice required by Exhibit + A. + + 1.7. "Larger Work" means a work which combines Covered Code or + portions thereof with code not governed by the terms of this License. + + 1.8. "License" means this document. + + 1.8.1. "Licensable" means having the right to grant, to the maximum + extent possible, whether at the time of the initial grant or + subsequently acquired, any and all of the rights conveyed herein. + + 1.9. "Modifications" means any addition to or deletion from the + substance or structure of either the Original Code or any previous + Modifications. When Covered Code is released as a series of files, a + Modification is: + A. Any addition to or deletion from the contents of a file + containing Original Code or previous Modifications. + + B. Any new file that contains any part of the Original Code or + previous Modifications. + + 1.10. "Original Code" means Source Code of computer software code + which is described in the Source Code notice required by Exhibit A as + Original Code, and which, at the time of its release under this + License is not already Covered Code governed by this License. + + 1.10.1. "Patent Claims" means any patent claim(s), now owned or + hereafter acquired, including without limitation, method, process, + and apparatus claims, in any patent Licensable by grantor. + + 1.11. "Source Code" means the preferred form of the Covered Code for + making modifications to it, including all modules it contains, plus + any associated interface definition files, scripts used to control + compilation and installation of an Executable, or source code + differential comparisons against either the Original Code or another + well known, available Covered Code of the Contributor's choice. The + Source Code can be in a compressed or archival form, provided the + appropriate decompression or de-archiving software is widely available + for no charge. + + 1.12. "You" (or "Your") means an individual or a legal entity + exercising rights under, and complying with all of the terms of, this + License or a future version of this License issued under Section 6.1. + For legal entities, "You" includes any entity which controls, is + controlled by, or is under common control with You. For purposes of + this definition, "control" means (a) the power, direct or indirect, + to cause the direction or management of such entity, whether by + contract or otherwise, or (b) ownership of more than fifty percent + (50%) of the outstanding shares or beneficial ownership of such + entity. + +2. Source Code License. + + 2.1. The Initial Developer Grant. + The Initial Developer hereby grants You a world-wide, royalty-free, + non-exclusive license, subject to third party intellectual property + claims: + (a) under intellectual property rights (other than patent or + trademark) Licensable by Initial Developer to use, reproduce, + modify, display, perform, sublicense and distribute the Original + Code (or portions thereof) with or without Modifications, and/or + as part of a Larger Work; and + + (b) under Patents Claims infringed by the making, using or + selling of Original Code, to make, have made, use, practice, + sell, and offer for sale, and/or otherwise dispose of the + Original Code (or portions thereof). + + (c) the licenses granted in this Section 2.1(a) and (b) are + effective on the date Initial Developer first distributes + Original Code under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is + granted: 1) for code that You delete from the Original Code; 2) + separate from the Original Code; or 3) for infringements caused + by: i) the modification of the Original Code or ii) the + combination of the Original Code with other software or devices. + + 2.2. Contributor Grant. + Subject to third party intellectual property claims, each Contributor + hereby grants You a world-wide, royalty-free, non-exclusive license + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Contributor, to use, reproduce, modify, + display, perform, sublicense and distribute the Modifications + created by such Contributor (or portions thereof) either on an + unmodified basis, with other Modifications, as Covered Code + and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or + selling of Modifications made by that Contributor either alone + and/or in combination with its Contributor Version (or portions + of such combination), to make, use, sell, offer for sale, have + made, and/or otherwise dispose of: 1) Modifications made by that + Contributor (or portions thereof); and 2) the combination of + Modifications made by that Contributor with its Contributor + Version (or portions of such combination). + + (c) the licenses granted in Sections 2.2(a) and 2.2(b) are + effective on the date Contributor first makes Commercial Use of + the Covered Code. + + (d) Notwithstanding Section 2.2(b) above, no patent license is + granted: 1) for any code that Contributor has deleted from the + Contributor Version; 2) separate from the Contributor Version; + 3) for infringements caused by: i) third party modifications of + Contributor Version or ii) the combination of Modifications made + by that Contributor with other software (except as part of the + Contributor Version) or other devices; or 4) under Patent Claims + infringed by Covered Code in the absence of Modifications made by + that Contributor. + +3. Distribution Obligations. + + 3.1. Application of License. + The Modifications which You create or to which You contribute are + governed by the terms of this License, including without limitation + Section 2.2. The Source Code version of Covered Code may be + distributed only under the terms of this License or a future version + of this License released under Section 6.1, and You must include a + copy of this License with every copy of the Source Code You + distribute. You may not offer or impose any terms on any Source Code + version that alters or restricts the applicable version of this + License or the recipients' rights hereunder. However, You may include + an additional document offering the additional rights described in + Section 3.5. + + 3.2. Availability of Source Code. + Any Modification which You create or to which You contribute must be + made available in Source Code form under the terms of this License + either on the same media as an Executable version or via an accepted + Electronic Distribution Mechanism to anyone to whom you made an + Executable version available; and if made available via Electronic + Distribution Mechanism, must remain available for at least twelve (12) + months after the date it initially became available, or at least six + (6) months after a subsequent version of that particular Modification + has been made available to such recipients. You are responsible for + ensuring that the Source Code version remains available even if the + Electronic Distribution Mechanism is maintained by a third party. + + 3.3. Description of Modifications. + You must cause all Covered Code to which You contribute to contain a + file documenting the changes You made to create that Covered Code and + the date of any change. You must include a prominent statement that + the Modification is derived, directly or indirectly, from Original + Code provided by the Initial Developer and including the name of the + Initial Developer in (a) the Source Code, and (b) in any notice in an + Executable version or related documentation in which You describe the + origin or ownership of the Covered Code. + + 3.4. Intellectual Property Matters + (a) Third Party Claims. + If Contributor has knowledge that a license under a third party's + intellectual property rights is required to exercise the rights + granted by such Contributor under Sections 2.1 or 2.2, + Contributor must include a text file with the Source Code + distribution titled "LEGAL" which describes the claim and the + party making the claim in sufficient detail that a recipient will + know whom to contact. If Contributor obtains such knowledge after + the Modification is made available as described in Section 3.2, + Contributor shall promptly modify the LEGAL file in all copies + Contributor makes available thereafter and shall take other steps + (such as notifying appropriate mailing lists or newsgroups) + reasonably calculated to inform those who received the Covered + Code that new knowledge has been obtained. + + (b) Contributor APIs. + If Contributor's Modifications include an application programming + interface and Contributor has knowledge of patent licenses which + are reasonably necessary to implement that API, Contributor must + also include this information in the LEGAL file. + + (c) Representations. + Contributor represents that, except as disclosed pursuant to + Section 3.4(a) above, Contributor believes that Contributor's + Modifications are Contributor's original creation(s) and/or + Contributor has sufficient rights to grant the rights conveyed by + this License. + + 3.5. Required Notices. + You must duplicate the notice in Exhibit A in each file of the Source + Code. If it is not possible to put such notice in a particular Source + Code file due to its structure, then You must include such notice in a + location (such as a relevant directory) where a user would be likely + to look for such a notice. If You created one or more Modification(s) + You may add your name as a Contributor to the notice described in + Exhibit A. You must also duplicate this License in any documentation + for the Source Code where You describe recipients' rights or ownership + rights relating to Covered Code. You may choose to offer, and to + charge a fee for, warranty, support, indemnity or liability + obligations to one or more recipients of Covered Code. However, You + may do so only on Your own behalf, and not on behalf of the Initial + Developer or any Contributor. You must make it absolutely clear than + any such warranty, support, indemnity or liability obligation is + offered by You alone, and You hereby agree to indemnify the Initial + Developer and every Contributor for any liability incurred by the + Initial Developer or such Contributor as a result of warranty, + support, indemnity or liability terms You offer. + + 3.6. Distribution of Executable Versions. + You may distribute Covered Code in Executable form only if the + requirements of Section 3.1-3.5 have been met for that Covered Code, + and if You include a notice stating that the Source Code version of + the Covered Code is available under the terms of this License, + including a description of how and where You have fulfilled the + obligations of Section 3.2. The notice must be conspicuously included + in any notice in an Executable version, related documentation or + collateral in which You describe recipients' rights relating to the + Covered Code. You may distribute the Executable version of Covered + Code or ownership rights under a license of Your choice, which may + contain terms different from this License, provided that You are in + compliance with the terms of this License and that the license for the + Executable version does not attempt to limit or alter the recipient's + rights in the Source Code version from the rights set forth in this + License. If You distribute the Executable version under a different + license You must make it absolutely clear that any terms which differ + from this License are offered by You alone, not by the Initial + Developer or any Contributor. You hereby agree to indemnify the + Initial Developer and every Contributor for any liability incurred by + the Initial Developer or such Contributor as a result of any such + terms You offer. + + 3.7. Larger Works. + You may create a Larger Work by combining Covered Code with other code + not governed by the terms of this License and distribute the Larger + Work as a single product. In such a case, You must make sure the + requirements of this License are fulfilled for the Covered Code. + +4. Inability to Comply Due to Statute or Regulation. + + If it is impossible for You to comply with any of the terms of this + License with respect to some or all of the Covered Code due to + statute, judicial order, or regulation then You must: (a) comply with + the terms of this License to the maximum extent possible; and (b) + describe the limitations and the code they affect. Such description + must be included in the LEGAL file described in Section 3.4 and must + be included with all distributions of the Source Code. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Application of this License. + + This License applies to code to which the Initial Developer has + attached the notice in Exhibit A and to related Covered Code. + +6. Versions of the License. + + 6.1. New Versions. + Netscape Communications Corporation ("Netscape") may publish revised + and/or new versions of the License from time to time. Each version + will be given a distinguishing version number. + + 6.2. Effect of New Versions. + Once Covered Code has been published under a particular version of the + License, You may always continue to use it under the terms of that + version. You may also choose to use such Covered Code under the terms + of any subsequent version of the License published by Netscape. No one + other than Netscape has the right to modify the terms applicable to + Covered Code created under this License. + + 6.3. Derivative Works. + If You create or use a modified version of this License (which you may + only do in order to apply it to code which is not already Covered Code + governed by this License), You must (a) rename Your license so that + the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", + "MPL", "NPL" or any confusingly similar phrase do not appear in your + license (except to note that your license differs from this License) + and (b) otherwise make it clear that Your version of the license + contains terms which differ from the Mozilla Public License and + Netscape Public License. (Filling in the name of the Initial + Developer, Original Code or Contributor in the notice described in + Exhibit A shall not of themselves be deemed to be modifications of + this License.) + +7. DISCLAIMER OF WARRANTY. + + COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF + DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. + THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE + IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, + YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE + COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER + OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF + ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +8. TERMINATION. + + 8.1. This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to cure + such breach within 30 days of becoming aware of the breach. All + sublicenses to the Covered Code which are properly granted shall + survive any termination of this License. Provisions which, by their + nature, must remain in effect beyond the termination of this License + shall survive. + + 8.2. If You initiate litigation by asserting a patent infringement + claim (excluding declatory judgment actions) against Initial Developer + or a Contributor (the Initial Developer or Contributor against whom + You file such action is referred to as "Participant") alleging that: + + (a) such Participant's Contributor Version directly or indirectly + infringes any patent, then any and all rights granted by such + Participant to You under Sections 2.1 and/or 2.2 of this License + shall, upon 60 days notice from Participant terminate prospectively, + unless if within 60 days after receipt of notice You either: (i) + agree in writing to pay Participant a mutually agreeable reasonable + royalty for Your past and future use of Modifications made by such + Participant, or (ii) withdraw Your litigation claim with respect to + the Contributor Version against such Participant. If within 60 days + of notice, a reasonable royalty and payment arrangement are not + mutually agreed upon in writing by the parties or the litigation claim + is not withdrawn, the rights granted by Participant to You under + Sections 2.1 and/or 2.2 automatically terminate at the expiration of + the 60 day notice period specified above. + + (b) any software, hardware, or device, other than such Participant's + Contributor Version, directly or indirectly infringes any patent, then + any rights granted to You by such Participant under Sections 2.1(b) + and 2.2(b) are revoked effective as of the date You first made, used, + sold, distributed, or had made, Modifications made by that + Participant. + + 8.3. If You assert a patent infringement claim against Participant + alleging that such Participant's Contributor Version directly or + indirectly infringes any patent where such claim is resolved (such as + by license or settlement) prior to the initiation of patent + infringement litigation, then the reasonable value of the licenses + granted by such Participant under Sections 2.1 or 2.2 shall be taken + into account in determining the amount or value of any payment or + license. + + 8.4. In the event of termination under Sections 8.1 or 8.2 above, + all end user license agreements (excluding distributors and resellers) + which have been validly granted by You or any distributor hereunder + prior to termination shall survive termination. + +9. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL + DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, + OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR + ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY + CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, + WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY + RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW + PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE + EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO + THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +10. U.S. GOVERNMENT END USERS. + + The Covered Code is a "commercial item," as that term is defined in + 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer + software" and "commercial computer software documentation," as such + terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 + C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), + all U.S. Government End Users acquire Covered Code with only those + rights set forth herein. + +11. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed by + California law provisions (except to the extent applicable law, if + any, provides otherwise), excluding its conflict-of-law provisions. + With respect to disputes in which at least one party is a citizen of, + or an entity chartered or registered to do business in the United + States of America, any litigation relating to this License shall be + subject to the jurisdiction of the Federal Courts of the Northern + District of California, with venue lying in Santa Clara County, + California, with the losing party responsible for costs, including + without limitation, court costs and reasonable attorneys' fees and + expenses. The application of the United Nations Convention on + Contracts for the International Sale of Goods is expressly excluded. + Any law or regulation which provides that the language of a contract + shall be construed against the drafter shall not apply to this + License. + +12. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or indirectly, + out of its utilization of rights under this License and You agree to + work with Initial Developer and Contributors to distribute such + responsibility on an equitable basis. Nothing herein is intended or + shall be deemed to constitute any admission of liability. + +13. MULTIPLE-LICENSED CODE. + + Initial Developer may designate portions of the Covered Code as + "Multiple-Licensed". "Multiple-Licensed" means that the Initial + Developer permits you to utilize portions of the Covered Code under + Your choice of the NPL or the alternative licenses, if any, specified + by the Initial Developer in the file described in Exhibit A. + +EXHIBIT A -Mozilla Public License. + + ``The contents of this file are subject to the Mozilla Public License + Version 1.1 (the "License"); you may not use this file except in + compliance with the License. You may obtain a copy of the License at + http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + License for the specific language governing rights and limitations + under the License. + + The Original Code is ______________________________________. + + The Initial Developer of the Original Code is ________________________. + Portions created by ______________________ are Copyright (C) ______ + _______________________. All Rights Reserved. + + Contributor(s): ______________________________________. + + Alternatively, the contents of this file may be used under the terms + of the _____ license (the "[___] License"), in which case the + provisions of [______] License are applicable instead of those + above. If you wish to allow use of your version of this file only + under the terms of the [____] License and not to allow others to use + your version of this file under the MPL, indicate your decision by + deleting the provisions above and replace them with the notice and + other provisions required by the [___] License. If you do not delete + the provisions above, a recipient may use your version of this file + under either the MPL or the [___] License." + + [NOTE: The text of this Exhibit A may differ slightly from the text of + the notices in the Source Code files of the Original Code. You should + use the text of this Exhibit A rather than the text found in the + Original Code Source Code for Your Modifications.] + +============================================================================== + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. + +============================================================================== diff --git a/bin/svg_kit/batik-1.7/lib/LICENSE.pdf-transcoder.txt b/bin/svg_kit/batik-1.7/lib/LICENSE.pdf-transcoder.txt new file mode 100644 index 0000000..588d02c --- /dev/null +++ b/bin/svg_kit/batik-1.7/lib/LICENSE.pdf-transcoder.txt @@ -0,0 +1,2 @@ +The pdf-transcoder.jar file is licensed under the Apache License 2.0, which +can be found in the distribution root directory in the LICENSE file. diff --git a/bin/svg_kit/batik-1.7/lib/LICENSE.sax.txt b/bin/svg_kit/batik-1.7/lib/LICENSE.sax.txt new file mode 100644 index 0000000..739cb51 --- /dev/null +++ b/bin/svg_kit/batik-1.7/lib/LICENSE.sax.txt @@ -0,0 +1,23 @@ +xml-commons/java/external/LICENSE.sax.txt $Id: LICENSE.sax.txt 201084 2002-12-09 16:15:21Z vhardy $ + + +This license came from: http://www.megginson.com/SAX/copying.html + However please note future versions of SAX may be covered + under http://saxproject.org/?selected=pd + + +This page is now out of date -- see the new SAX site at +http://www.saxproject.org/ for more up-to-date +releases and other information. Please change your bookmarks. + + +SAX2 is Free! + +I hereby abandon any property rights to SAX 2.0 (the Simple API for +XML), and release all of the SAX 2.0 source code, compiled code, and +documentation contained in this distribution into the Public Domain. +SAX comes with NO WARRANTY or guarantee of fitness for any +purpose. + +David Megginson, david@megginson.com +2000-05-05 \ No newline at end of file diff --git a/bin/svg_kit/batik-1.7/lib/LICENSE.xalan-2.6.0.txt b/bin/svg_kit/batik-1.7/lib/LICENSE.xalan-2.6.0.txt new file mode 100644 index 0000000..6c5ba27 --- /dev/null +++ b/bin/svg_kit/batik-1.7/lib/LICENSE.xalan-2.6.0.txt @@ -0,0 +1,2 @@ +The xalan-2.6.0.jar file is licensed under the Apache License 2.0, which +can be found in the distribution root directory in the LICENSE file. diff --git a/bin/svg_kit/batik-1.7/lib/LICENSE.xerces_2_5_0.txt b/bin/svg_kit/batik-1.7/lib/LICENSE.xerces_2_5_0.txt new file mode 100644 index 0000000..b6d4a8b --- /dev/null +++ b/bin/svg_kit/batik-1.7/lib/LICENSE.xerces_2_5_0.txt @@ -0,0 +1,60 @@ +The xerces_2_5_0.jar file comes from the Apache Xerces project +(http://xmlapache.org/dist/xerces-j/), and is licensed under the +Apache Software License, Version 1.1, which is reproduced below. + +/* + * The Apache Software License, Version 1.1 + * + * + * Copyright (c) 1999-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Xerces" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was + * originally based on software copyright (c) 1999, International + * Business Machines, Inc., http://www.ibm.com. For more + * information on the Apache Software Foundation, please see + * . + */ diff --git a/bin/svg_kit/batik-1.7/lib/README.js.txt b/bin/svg_kit/batik-1.7/lib/README.js.txt new file mode 100644 index 0000000..48700cc --- /dev/null +++ b/bin/svg_kit/batik-1.7/lib/README.js.txt @@ -0,0 +1,23 @@ +This distribution includes a binary distribution of Mozilla Rhino 1.6 release 5 +plus one patch. + +You can get the unpatched 1.6R5 release of Rhino from the following URL: + + ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_6R5.zip + +To obtain the source code for the 1.6R5 release of Rhino, issue the following +commands: + + cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot \ + co -D2006-11-20 mozilla/js/rhino + +The patch is available here: + + https://bugzilla.mozilla.org/attachment.cgi?id=252418 + +which is attached to this bug: + + https://bugzilla.mozilla.org/show_bug.cgi?id=367627 + +Rhino is licensed under both the MPL (Mozilla Public License) 1.1 and the +GPL (GNU General Public License) 2.0, which are in the LICENSE.js.txt file. diff --git a/bin/svg_kit/batik-1.7/lib/README.pdf-transcoder.txt b/bin/svg_kit/batik-1.7/lib/README.pdf-transcoder.txt new file mode 100644 index 0000000..3483db7 --- /dev/null +++ b/bin/svg_kit/batik-1.7/lib/README.pdf-transcoder.txt @@ -0,0 +1,8 @@ +The pdf-transcoder.jar file is built from the Apache FOP project +(http://xmlgraphics.apache.org/fop), version 0.90alpha1. + +This is only needed if you want to transcode to PDF, otherwise it can +be removed. + +The pdf-transcoder.jar file is licensed under the Apache License 2.0, which +can be found in the distribution root directory in the LICENSE file. diff --git a/bin/svg_kit/batik-1.7/lib/README.xalan-2.6.0.txt b/bin/svg_kit/batik-1.7/lib/README.xalan-2.6.0.txt new file mode 100644 index 0000000..8e4a408 --- /dev/null +++ b/bin/svg_kit/batik-1.7/lib/README.xalan-2.6.0.txt @@ -0,0 +1,4 @@ +The xalan-2.6.0.jar file comes from the Apache Xalan project +(http://xml.apache.org/xalan-j/), and is licensed under the +Apache License 2.0, which can be found in the distribution root directory +in the LICENSE file. diff --git a/bin/svg_kit/batik-1.7/lib/README.xerces_2_5_0.txt b/bin/svg_kit/batik-1.7/lib/README.xerces_2_5_0.txt new file mode 100644 index 0000000..6090b00 --- /dev/null +++ b/bin/svg_kit/batik-1.7/lib/README.xerces_2_5_0.txt @@ -0,0 +1,4 @@ +The xerces_2_5_0.jar file comes from the Apache Xerces project +(http://xml.apache.org/dist/xerces-j/), and is licensed under the +Apache Software License, Version 1.1, which is in the +LICENSE.xerces_2_5_0.txt file. diff --git a/bin/svg_kit/batik-1.7/lib/README.xml-apis-ext.txt b/bin/svg_kit/batik-1.7/lib/README.xml-apis-ext.txt new file mode 100644 index 0000000..03a0a1e --- /dev/null +++ b/bin/svg_kit/batik-1.7/lib/README.xml-apis-ext.txt @@ -0,0 +1,19 @@ +This distribution includes xml-apis-ext.jar from the XML Commons External +1.3.04 binary distribution, which can also be obtained from: + + http://xml.apache.org/mirrors.cgi + +Source code is available from the XML Commons web site: + + http://xml.apache.org/commons/ + +xml-apis-ext.jar contains: + + - SAC 1.3 + - SMIL Java bindings + - SVG 1.1 Java bindings + +SAC 1.3, the SMIL Java bindings and the SVG 1.1 Java bindings are licensed +under the W3C Software License. Related documentation is licensed under the +W3C Document License. See LICENSE.dom-software.txt and +LICENSE.dom-documentation.txt. diff --git a/bin/svg_kit/batik-1.7/lib/README.xml-apis.txt b/bin/svg_kit/batik-1.7/lib/README.xml-apis.txt new file mode 100644 index 0000000..dcfbcdf --- /dev/null +++ b/bin/svg_kit/batik-1.7/lib/README.xml-apis.txt @@ -0,0 +1,30 @@ +This distribution includes xml-apis.jar from the XML Commons External +1.3.04 binary distribution, which can also be obtained from: + + http://xml.apache.org/mirrors.cgi + +Source code is available from the XML Commons web site: + + http://xml.apache.org/commons/ + +xml-apis.jar contains: + + - DOM Level 2 Events + - DOM Level 2 HTML + - DOM Level 2 Style + - DOM Level 2 Traversal and Range + - DOM Level 2 Views + - DOM Level 3 Core + - DOM Level 3 Load and Save + - DOM Level 3 XPath + - JAXP 1.3 (JSR 206) + - SAX + +All DOM code is licensed under the W3C Software License, and DOM documentation +under the W3C Document License. See LICENSE.dom-software.txt and +LICENSE.dom-documentation.txt. + +The JAXP 1.3 code is licensed under the Apache Software License 2.0, which is +in the LICENSE in the root directory of this distribution. + +SAX is public domain. See LICENSE.sax.txt. diff --git a/bin/svg_kit/batik-1.7/lib/Squiggle.icns b/bin/svg_kit/batik-1.7/lib/Squiggle.icns new file mode 100644 index 0000000..b4875d6 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/Squiggle.icns differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-anim.jar b/bin/svg_kit/batik-1.7/lib/batik-anim.jar new file mode 100644 index 0000000..496d0c0 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-anim.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-awt-util.jar b/bin/svg_kit/batik-1.7/lib/batik-awt-util.jar new file mode 100644 index 0000000..6278ad4 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-awt-util.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-bridge.jar b/bin/svg_kit/batik-1.7/lib/batik-bridge.jar new file mode 100644 index 0000000..5a4c461 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-bridge.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-codec.jar b/bin/svg_kit/batik-1.7/lib/batik-codec.jar new file mode 100644 index 0000000..b2ac1b9 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-codec.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-css.jar b/bin/svg_kit/batik-1.7/lib/batik-css.jar new file mode 100644 index 0000000..8415f20 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-css.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-dom.jar b/bin/svg_kit/batik-1.7/lib/batik-dom.jar new file mode 100644 index 0000000..66c52f5 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-dom.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-ext.jar b/bin/svg_kit/batik-1.7/lib/batik-ext.jar new file mode 100644 index 0000000..750b771 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-ext.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-extension.jar b/bin/svg_kit/batik-1.7/lib/batik-extension.jar new file mode 100644 index 0000000..aac882c Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-extension.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-gui-util.jar b/bin/svg_kit/batik-1.7/lib/batik-gui-util.jar new file mode 100644 index 0000000..9c3f058 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-gui-util.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-gvt.jar b/bin/svg_kit/batik-1.7/lib/batik-gvt.jar new file mode 100644 index 0000000..b6e14e2 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-gvt.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-parser.jar b/bin/svg_kit/batik-1.7/lib/batik-parser.jar new file mode 100644 index 0000000..a2b9aa0 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-parser.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-script.jar b/bin/svg_kit/batik-1.7/lib/batik-script.jar new file mode 100644 index 0000000..8c533f8 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-script.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-svg-dom.jar b/bin/svg_kit/batik-1.7/lib/batik-svg-dom.jar new file mode 100644 index 0000000..4f9ba73 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-svg-dom.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-svggen.jar b/bin/svg_kit/batik-1.7/lib/batik-svggen.jar new file mode 100644 index 0000000..73ca53a Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-svggen.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-swing.jar b/bin/svg_kit/batik-1.7/lib/batik-swing.jar new file mode 100644 index 0000000..919c884 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-swing.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-transcoder.jar b/bin/svg_kit/batik-1.7/lib/batik-transcoder.jar new file mode 100644 index 0000000..f13cc7e Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-transcoder.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-util.jar b/bin/svg_kit/batik-1.7/lib/batik-util.jar new file mode 100644 index 0000000..97db98c Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-util.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/batik-xml.jar b/bin/svg_kit/batik-1.7/lib/batik-xml.jar new file mode 100644 index 0000000..adad4c2 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/batik-xml.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/js.jar b/bin/svg_kit/batik-1.7/lib/js.jar new file mode 100644 index 0000000..22a99d7 Binary files /dev/null and b/bin/svg_kit/batik-1.7/lib/js.jar differ diff --git a/bin/svg_kit/batik-1.7/lib/make-squiggle-app.sh b/bin/svg_kit/batik-1.7/lib/make-squiggle-app.sh new file mode 100644 index 0000000..31c872a --- /dev/null +++ b/bin/svg_kit/batik-1.7/lib/make-squiggle-app.sh @@ -0,0 +1,87 @@ +#!/bin/bash +# ----------------------------------------------------------------------------- +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# make-squiggle-app.sh +# +# Creates a Mac OS X application bundle for Squiggle, then opens a Finder +# window for the current directory so that the user can drag the icon +# into their desired installation location (probably /Applications). +# +# $Id$ +# ----------------------------------------------------------------------------- + +trap 'echo Error creating application bundle.; exit 1' ERR + +cd `dirname "$0"`/.. + +APP=Squiggle.app +CON=$APP/Contents +MAC=$CON/MacOS +RES=$CON/Resources + +[ -e $APP ] && echo $APP already exists: please move it out of the way before running this script. && exit 1 + +echo Creating $APP in `pwd`... + +mkdir $APP $CON $MAC $RES + +cat >$CON/Info.plist < + + + + CFBundleExecutable + Squiggle + CFBundleVersion + 1.7beta1+r522428 + CFBundleShortVersionString + 1.7beta1+r522428 + CFBundleIconFile + Squiggle.icns + CFBundleIdentifier + org.apache.batik + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Squiggle + CFBundlePackageType + APPL + CFBundleSignature + ???? + NSHumanReadableCopyright + Copyright © 2007 Apache Software Foundation. All Rights Reserved. + + +EOF + +cat >$MAC/Squiggle < [font-name] +USAGE +my $argvNumber=3; +die $usage if (@ARGV<$argvNumber); +undef($usage); +undef($argvNumber); +###################################################################################################################### +#my %opts; +#GetOptions(\%opts,"a!","b:s"); +###################################################################################################################### +# Constant +###################################################################################################################### +#use constant PI => 3.1415926535897932384626433832795; +###################################################################################################################### +# Variable +###################################################################################################################### +my ($svgF,$fontF,$outSvg)=@ARGV; +my ($font,$defs); +#///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +# Begin +#///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +open(F,"$svgF") || die "Can't open $svgF!\n"; +open(O,">$outSvg") || die "Can't write $outSvg!\n"; +if ($fontF eq "x") { + $fontF=$0; +} +$defs=0; +while () { + next if (//); + next if (//); + next if (//); + next if (//); + next if (//); + print O; + if (/) { + if ($font=~//) { + $defs=1; + } + if ($defs) { + print O $font; + } + if ($font=~/<\/defs>/) { + $defs=0; + } + } + } +} +close(F); +#///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +# Subprogram +#///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +# End +#///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +=pod + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +=cut diff --git a/bin/svg_kit/generate_font_embed_defs.pl b/bin/svg_kit/generate_font_embed_defs.pl new file mode 100644 index 0000000..443fbab --- /dev/null +++ b/bin/svg_kit/generate_font_embed_defs.pl @@ -0,0 +1,80 @@ +#!/usr/bin/perl + +=head1 Name + +generate_font_width_hash.pl -- generate font width hash for Font.pm + +=head1 Description + +useful information for each character: +$ref->{defs}{font}{font-face}{font-family} +$ref->{defs}{font}{glyph}[0]{unicode} +$ref->{defs}{font}{glyph}[0]{horiz-adv-x} +$ref->{defs}{font}{horiz-adv-x} + +=head1 Version + + Author: Fan Wei, fanw@genomics.org.cn + Version: 1.0, Date: 2006-12-6 + Note: + +=head1 Usage + + --verbose output running progress information to screen + --help output help information to screen + +=head1 Exmple + + + +=cut + +use strict; +use Getopt::Long; +use FindBin qw($Bin $Script); +use File::Basename qw(basename dirname); +use Data::Dumper; + + + +##get options from command line into variables and set default values +my ($Verbose,$Help); +GetOptions( + "verbose"=>\$Verbose, + "help"=>\$Help +); +die `pod2text $0` if (@ARGV == 0 || $Help); + +my $Font_dir = shift; + +read_font($Font_dir); + + +#################################################### +################### Sub Routines ################### +#################################################### + +sub read_font { + my $font_dir = shift; + + print qq(\n); + $font_dir =~ s/\/$//; + foreach my $font_file (`ls $font_dir/*.svg`) { + chomp $font_file; + + my $file_content; + open IN,$font_file || die "fail $font_file;"; + while () { + $file_content .= $_; + } + close IN; + + $file_content =~ s/^.+?\s//s; + $file_content =~ s/<\/defs>.+?$//s; + + print $file_content; + } + print qq(\n); + +} + diff --git a/bin/svg_kit/generate_font_width_hash.pl b/bin/svg_kit/generate_font_width_hash.pl new file mode 100644 index 0000000..27702b7 --- /dev/null +++ b/bin/svg_kit/generate_font_width_hash.pl @@ -0,0 +1,80 @@ +#!/usr/bin/perl + +=head1 Name + +generate_font_width_hash.pl -- generate font width hash for Font.pm + +=head1 Description + +useful information for each character: +$ref->{defs}{font}{font-face}{font-family} +$ref->{defs}{font}{glyph}[0]{unicode} +$ref->{defs}{font}{glyph}[0]{horiz-adv-x} +$ref->{defs}{font}{horiz-adv-x} + +=head1 Version + + Author: Fan Wei, fanw@genomics.org.cn + Version: 1.0, Date: 2006-12-6 + Note: + +=head1 Usage + + --verbose output running progress information to screen + --help output help information to screen + +=head1 Exmple + + + +=cut + +use strict; +use Getopt::Long; +use FindBin qw($Bin $Script); +use File::Basename qw(basename dirname); +use Data::Dumper; +use XML::Simple; + + +##get options from command line into variables and set default values +my ($Verbose,$Help); +GetOptions( + "verbose"=>\$Verbose, + "help"=>\$Help +); +die `pod2text $0` if (@ARGV == 0 || $Help); + +my $Font_dir = shift; + +my %Font; + +read_font($Font_dir, \%Font); + +print Dumper \%Font; + + +#################################################### +################### Sub Routines ################### +#################################################### + +sub read_font { + my $font_dir = shift; + my $font_p = shift; + + $font_dir =~ s/\/$//; + foreach my $font_file (`ls $font_dir/*.svg`) { + chomp $font_file; + my $ref = XMLin($font_file); + my $font_family = $ref->{defs}{font}{'font-face'}{'font-family'}; + my $font_width = $ref->{defs}{font}{'horiz-adv-x'}; + my $graph_p = $ref->{defs}{font}{glyph}; + foreach my $p (@$graph_p) { + my $char = $p->{unicode}; + my $width = $p->{'horiz-adv-x'}; + $font_p->{$font_family}{$char} = (defined $width) ? $width : $font_width; + } + } + +} + diff --git a/bin/svg_kit/readme.txt b/bin/svg_kit/readme.txt new file mode 100644 index 0000000..0541bab --- /dev/null +++ b/bin/svg_kit/readme.txt @@ -0,0 +1,33 @@ +perlԭSVGģ,ԼΪ幦ģFontSize.pmͬʱbuildInFont.pl ͸ʽתsvg2xxx.plʾsvg_example.pltest_svg.plΪ뾡ʾ˸ֳ÷ +صȫֳָ֧壬ԼԽͼθʽת + +ǰ¼ĴϵгͣÿһϵиʽCourierNewϵΪȿ壬Ϊǵȿ塣ûѡ壬ڱϵݲ֧֡ע⣺дʱCourierNewԼдΪCourier, TimesNewRomanԼдΪTimes + +ArialϵУ +Arial Arial-Bold Arial-Italic Arial-BoldItalic + +ArialNarrowϵУ +ArialNarrow ArialNarrow-Bold ArialNarrow-Italic ArialNarrow-BoldItalic + +CourierNewϵУ +CourierNew CourierNew-Bold CourierNew-Italic CourierNew-BoldItalic + +TimesNewRomanϵУ +TimesNewRoman TimesNewRoman-Bold TimesNewRoman-BoldItalic TimesNewRoman-Italic + + +FontSize.pm Ƿΰдһģ飬ԭSVGûмСܵȱ; еϢWindowsϵͳ C:\WINDOWS\Font/ãbatik-ttf2svgתSVG壬ȻҪ˹font-family, horiz-adv-xΪȡ generate_font_embed_defs.plbuildInFont.plе⣬generate_font_width_hash.plFontSize.pmģеϢ⡣ + +buildInFont.plʢͥijSVGļ⡣ΪͼƬԼʽתе⣬ɵSVGͼʹbuildInFont.plõ,ͬʱSVGͼƬתpngʽ,˫ݴ洢ֳСΪ800kbע⣺SVGͼм⣬ôIEʱ⣬batik-rasterizer.jarתʱ彫ʾΪArial塣 + +svg_example.pl SVGͼʾ +óṹҹܸȫдʱһģһģȥģ +ͼЩңDzѧϰ﷨Խزע͵ÿ +ִֻһģ飬Ȼճͼѧϰ + + +batik-1.7/batik-rasterizer.jarתSVGpngͼʽĺΪܴûԼhttp://xmlgraphics.apache.org/batik/ + +Font-ttf/һarialתӣûbatik-1.7/batik-ttf2svg.jarгԡ + + diff --git a/bin/svg_kit/svg2xxx.pl b/bin/svg_kit/svg2xxx.pl new file mode 100644 index 0000000..7d5258c --- /dev/null +++ b/bin/svg_kit/svg2xxx.pl @@ -0,0 +1,127 @@ +#!/usr/bin/perl + +=head1 Name + +svg2xxx.pl -- convert SVG figure to other formats + +=head1 Description + +This program convert SVG files by invoking batik-rasterizer.jar, its advantage +is caculating the fiure pixel width and pixel height automatically. + +The png format is a popular format which has excellent performance on compression +rate, while tiff is the standard format for high quality figure. For comman usage, +png is good enough. The ppi decides the resolution of printed figure, 96 is enough +for common usage, and 300 for high quality. + +Note that when you use --width or --height to contrain the generated figure size, +one option is enough, the other parameter will be adjusted automatically. The spirit +of converting figures is to keep the ratio of width/height. + +When you just want to convert figure of the same size, and do not print it +on a paper, you needn't care adout --ppi, --width, and --height option. + +=head1 Version + + Author: Fan Wei, fanw@genomics.org.cn + Version: 1.0, Date: 2007-9-24 + Note: + +=head1 Usage + + svg2xxx.pl [options] [out_dir] + --type set the result figure type, png, tiff, jpeg, pdf, default=png + --ppi set the figure resolution, default = 300 ppi + --width set the figure width, unit is centi-meter, default = not constrained + --height set the figure height, unit is centi-meter, default = not constrained + --verbose output running progress information to screen + --help output help information to screen + +=head1 Exmple + + perl ../svg_lib/svg2xxx.pl chr10.svg + perl ../svg_lib/svg2xxx.pl map_figure.scheme2/ + perl ../svg_lib/svg2xxx.pl -ppi 96 -height 2 map_figure.scheme2/ map_figure.scheme2.height2.ppi96 + +=cut + +use strict; +use Getopt::Long; +use FindBin qw($Bin $Script); +use File::Basename qw(basename dirname); +use Data::Dumper; + + +##get options from command line into variables and set default values +my ($Type,$Ppi,$Width,$Height); +my ($Verbose,$Help); +GetOptions( + "type:s"=>\$Type, + "ppi:s"=>\$Ppi, + "width:s"=>\$Width, + "height:s"=>\$Height, + "verbose"=>\$Verbose, + "help"=>\$Help +); +$Type ||= "png"; +$Ppi ||= 300; + +die `pod2text $0` if (@ARGV == 0 || $Help); + +my $input = shift; +my $out_dir = shift; + + +my @files; ## store all svg files +my $pixel_height = $Ppi / 2.54 * $Height if(defined $Height); +my $pixel_width = $Ppi / 2.54 * $Width if(defined $Width); + +if ($Type eq "pdf") { + $Type = "application/$Type"; +}elsif($Type eq "jpeg"){ + $Type = "image/$Type -q 0.99"; +}else{ + $Type = "image/$Type"; +} + +if (-f $input) { + push @files, $input; +} +if (-d $input) { + $input =~ s/\/$//; + @files = glob("$input/*.svg"); +} + +mkdir($out_dir) if($out_dir); + +foreach my $svg_file (@files) { + + ##embed font glyph into svg files + my $xxx_file = $1.".xxx" if($svg_file =~ /(.+?)\.svg$/); + my $res_file = $1.".$Type" if($svg_file =~ /(.+?)\.svg$/); + `perl $Bin/buildInFont.pl $svg_file x $xxx_file`; + ##warn "perl $Bin/buildInFont.pl $svg_file x $xxx_file\n"; + ##convert svg to other formats + my $rasterizer_cmd = "java -mx2G -jar $Bin/batik-1.7/batik-rasterizer.jar -m $Type -dpi $Ppi $xxx_file"; + my @arryStat=stat($svg_file); + if ($arryStat[7] > 100000000) + { + $rasterizer_cmd = "java -mx10G -jar $Bin/batik-1.7/batik-rasterizer.jar -m $Type -dpi $Ppi $xxx_file"; + } + elsif ($arryStat[7] > 50000000 ) + { + $rasterizer_cmd = "java -mx5G -jar $Bin/batik-1.7/batik-rasterizer.jar -m $Type -dpi $Ppi $xxx_file"; + } + + $rasterizer_cmd .= " -h $pixel_height" if(defined $Height); + $rasterizer_cmd .= " -w $pixel_width" if(defined $Width); + ##warn $rasterizer_cmd; + `$rasterizer_cmd`; + + `mv $res_file $out_dir` if($out_dir); + `rm $xxx_file`; +} + +#################################################### +################### Sub Routines ################### +#################################################### diff --git a/bin/svg_kit/svg_example.pl b/bin/svg_kit/svg_example.pl new file mode 100644 index 0000000..5d8fa16 --- /dev/null +++ b/bin/svg_kit/svg_example.pl @@ -0,0 +1,164 @@ +#!D:/perl/bin/perl.exe + +use strict; +use lib "E:\2.study\01.program-language\04.SVG\SVG-̳\perl-SVG"; +use SVG; +use FontSize; + +my $svg = SVG->new('width',640,'height',480); +my $font = FontSize->new(); + +##header notes +$svg->title('id','document-title','-cdata','This is the title'); +$svg->desc('id','document-desc', '-cdata','This is a description'); +$svg->comment('comment 1','comment 2','comment 3'); + + +##basic shapes +$svg->circle('cx',400,'cy',200,'r',100,'stroke','red','fill','green'); +$svg->ellipse('cx',200,'cy',200,'rx',100,'ry',50,'stroke','red','fill','green'); +$svg->line('x1',0,'y1',0,'x2',100,'y2',100,'stroke','red','stroke-width',3); +$svg->rect('x',10, 'y',20,'width',40,'height',50,'stroke','red','fill','green'); +$svg->text('x',400,'y',400,'stroke','red','fill','red','-cdata','hello, world'); +$svg->polygon('points',[0,0,100,0,50,50],'fill','red','stroke','green'); +$svg->tag('circle', 'cx',400,'cy',200,'r',100,'stroke','red','fill','green'); +$svg->tag('path', 'd', "M 0 0 L 100 0 L50 100 Z"); + + +##how to use Font.pm +##Main supproted fonts include: +## Courier Courier-Bold Courier-Italic Courier-BoldItalic +## Helvetica Helvetica-Bold Helvetica-BoldOblique Helvetica-Oblique +## Times-Bold Times-BoldItalic Times-Italic Times-Roman +## ArialNarrow ArialNarrow-Bold ArialNarrow-Italic ArialNarrow-BoldItalic +my $string = "Good Work"; +my $font_type = "ArialNarrow"; +my $font_size = 12; +my $string_width = $font->stringWidth($font_type,$font_size,$string); +my $string_height = $font->stringHeight($font_size); +$svg->text('x',10,'y',300,"fill","red",'-cdata',"String: $string; String width: $string_width; String height: $string_height;"); + + + +##indicates the hyperlink and defines where the link goes +my $anch = $svg->anchor( + -href=>'http://www.google.com/', + ); +$anch->circle(cx=>100,cy=>100,r=>50,'fill','red'); + + +##how to use group +#SVG transform мתеrotateʹĿһתһĽǶȡrotateĸʽ£ +#rotate([angle] [px,py]) +#[angle] : תǶȡ ĻѧY෴תΪǶֵ +#[px,py] : תĵ㡣ȱʡĬΪԲ㣨0,0 +my $g1 = $svg->group("transform"=>"translate(300,400) scale(0.8) rotate(-90)"); +$g1->circle('cx',400,'cy',400,'r',30,"fill",'yellow'); +$g1->text('x',100,'y',100,'-cdata',"good mood","stroke","blue"); + + + +##how to use script +my $st1 = $svg->script(); +$st1->CDATA( + qq( + function showmsg() + { + alert("good mood"); + } + ) +); +$svg->text('x',100,'y',100,'-cdata',"good mood","stroke","blue",'onclick','showmsg()'); + + + +##how to use style +my $stl = $svg->style(type=>"text/css"); +$stl->CDATA( + qq( + rect {stroke:black; fill:yellow} + rect.differe {stroke:red; fill:none} + rect.fanw {stroke:green; fill:olive} + ) +); +$svg->rect('x',10, 'y',20,'width',40,'height',50); +$svg->rect('class','differe','x',10, 'y',120,'width',40,'height',50); +$svg->rect('class','fanw','x',10, 'y',220,'width',40,'height',50); + + + +##how to use color linear gradient +my $gra1 = $svg->gradient( + -type => "linear", + id => "gradient_1", + gradientUnits => "userSpaceOnUse", + x1 => 0, + x2 => 100, + + ); +$gra1->stop('offset'=>0,style=>"stop-color:red"); +$gra1->stop('offset'=>1,style=>"stop-color:blue"); +$svg->rect('x',0, 'y',0,'width',100,'height',20,'fill','url(#gradient_1)'); + + + + +##how to use color radial gradient +my $gra1 = $svg->gradient( + -type => "radial", + id => "gradient_2", + gradientUnits => "userSpaceOnUse", + cx => 100, + cy => 100, + r => 50, + ); +$gra1->stop('offset'=>0,style=>"stop-color:green"); +$gra1->stop('offset'=>1,style=>"stop-color:red"); +$svg->circle('cx',120,'cy',100,'r',50,'fill','url(#gradient_2)'); + + +##how to use defs, only show in text, no program +##http://www.w3.org/TR/SVG/struct.html#DefsElement +##The 'defs' element is a container element for referenced elements. For understandability and accessibility reasons, it is recommended that, whenever possible, referenced elements be defined inside of a 'defs'. +##Elements that are descendants of a 'defs' are not rendered directly; they are prevented from becoming part of the rendering tree,however, that the descendants of a 'defs' are always present in the source tree and thus can always be referenced by other elements; + +# +# +# +# +# +# +# + + + +##show how to use path +#Path Command Meaning Parameters +#M Establish origin at point specified +#L Straight line path from current position to point specified +#H Horizontal line path from current position to point specified +#V Vertical line path from current position to point specified +#Z Straight line back to original point +# +#If the path being specified consists of many short paths, it may well be more efficient to define the path +#as relative positions from the previous current position. If the command uses a lower case letter, this +#indicates that the coordinates defined for this command are relative to the previous current position. +# +#Paths can also be defined as curves (quadratic and cubic bezier, and elliptical arcs). Probably the +#most useful is the cubic bezier. This has the initial letter C and has three coordinates as its +#parameters. A curved path is defined from the current position (either established by a Move +#command or a previous line or curve command) to the third point defined in the cubic bezier. The first +#two points define the bezier control points that give the shape of the curve (Figure 5.2). The +#positioning of the control points change the shape of the curve under the user's control as can be seen +#in Figure 5.3. +# +# +# +# + + +print $svg->xmlify(); diff --git a/config.h b/config.h new file mode 100644 index 0000000..228b5f4 --- /dev/null +++ b/config.h @@ -0,0 +1,97 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `z' library (-lz). */ +#define HAVE_LIBZ 1 + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#define HAVE_MALLOC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MATH_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#define HAVE_REALLOC 1 + +/* Define to 1 if you have the `regcomp' function. */ +#define HAVE_REGCOMP 1 + +/* Define to 1 if you have the `sqrt' function. */ +/* #undef HAVE_SQRT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strncasecmp' function. */ +#define HAVE_STRNCASECMP 1 + +/* Define to 1 if you have the `strtol' function. */ +#define HAVE_STRTOL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ZLIB_H 1 + +/* Name of package */ +#define PACKAGE "bin/LDBlockShow" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "hewm2008@gmail.com" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "bin/LDBlockShow" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "bin/LDBlockShow 1.35" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "bin-ldblockshow" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.35" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "1.35" + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ + +/* Define to rpl_realloc if the replacement function should be used. */ +/* #undef realloc */ diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..5fc865d --- /dev/null +++ b/config.h.in @@ -0,0 +1,96 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `z' library (-lz). */ +#undef HAVE_LIBZ + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +#undef HAVE_MATH_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#undef HAVE_REALLOC + +/* Define to 1 if you have the `regcomp' function. */ +#undef HAVE_REGCOMP + +/* Define to 1 if you have the `sqrt' function. */ +#undef HAVE_SQRT + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ZLIB_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to rpl_realloc if the replacement function should be used. */ +#undef realloc diff --git a/config.h.in~ b/config.h.in~ new file mode 100644 index 0000000..bdb661b --- /dev/null +++ b/config.h.in~ @@ -0,0 +1,93 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `z' library (-lz). */ +#undef HAVE_LIBZ + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +#undef HAVE_MATH_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#undef HAVE_REALLOC + +/* Define to 1 if you have the `regcomp' function. */ +#undef HAVE_REGCOMP + +/* Define to 1 if you have the `sqrt' function. */ +#undef HAVE_SQRT + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ZLIB_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to rpl_realloc if the replacement function should be used. */ +#undef realloc diff --git a/config.log b/config.log new file mode 100644 index 0000000..804eab6 --- /dev/null +++ b/config.log @@ -0,0 +1,680 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by bin/LDBlockShow configure 1.35, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ ./configure LDFLAGS=-L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib CFLAGS=-I/zfssz5/BC_PUB/Software/04.UsrHgcc//include --no-create --no-recursion + +## --------- ## +## Platform. ## +## --------- ## + +hostname = cngb-ologin-20.cngb.sz.hpc +uname -m = x86_64 +uname -r = 2.6.32-696.30.1.el6.x86_64 +uname -s = Linux +uname -v = #1 SMP Tue May 22 03:28:18 UTC 2018 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = x86_64 +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +/usr/bin/hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: /zfssz3/BGI_AAI/yukang/software/java/jdk1.8.0_172/bin +PATH: /zfssz3/BGI_AAI/yukang/00.bin +PATH: /zfssz5/BC_PUB/Software/04.UsrHgcc//bin +PATH: /zfssz5/BC_PUB/Software/01.Usr/bin +PATH: /zfssz3/BGI_AAI/yukang/software/java/jdk1.8.0_172/bin +PATH: /zfssz3/BGI_AAI/yukang/00.bin/htslib +PATH: /zfssz3/BGI_AAI/yukang/00.bin/vcftools +PATH: /zfssz3/BGI_AAI/yukang/00.bin/vcflib +PATH: /home/yukang/00.bin/bcftools +PATH: /home/yukang/00.bin/eigenstrat/bin/ +PATH: /home/yukang/00.bin/R-3.5.1/bin +PATH: /home/yukang/00.bin/plink-1.9 +PATH: /zfssz3/BGI_AAI/yukang/software/biosoft/ncbi-blast/bin +PATH: /zfssz3/BGI_AAI/yukang/software/biosoft/mcl-14-137/bin +PATH: /zfssz3/BGI_AAI/yukang/software/biosoft/mmseqs2/bin +PATH: /zfssz3/BGI_AAI/yukang/software/biosoft/fastme-2.1.5/bin +PATH: /zfssz5/BC_PUB/Software/03.Soft_ALL/bedops-2.4.35/bin/ +PATH: /hwfssz4/BC_PUB/Software/03.Soft_ALL/bedtools-2.29.0/bin/ +PATH: /zfssz5/BC_PUB/Software/03.Soft_ALL/mummer-4.0.0/bin +PATH: ~/local/bin +PATH: /usr/sbin +PATH: /usr/local/sbin +PATH: /usr/local/bin +PATH: /usr/lib64/qt-3.3/bin +PATH: /usr/bin +PATH: /sbin +PATH: /ldfssz1/BGI_AAI/PUB/software/perl-5.26.1/perl/bin +PATH: /ldfssz1/BGI_AAI/PUB/software/03.Soft_ALL/Python-3.6.1/bin/ +PATH: /ldfssz1/BGI_AAI/PUB/software/03.Soft_ALL/Python-2.7.13/bin +PATH: /usr/lib64/qt-3.3/bin +PATH: /usr/local/bin +PATH: /bin +PATH: /usr/bin +PATH: /usr/local/sbin +PATH: /usr/sbin +PATH: /sbin +PATH: /opt/bio/ncbi/bin +PATH: /opt/bio/mpiblast/bin +PATH: /opt/bio/EMBOSS/bin +PATH: /opt/bio/clustalw/bin +PATH: /opt/bio/tcoffee/bin +PATH: /opt/bio/hmmer/bin +PATH: /opt/bio/phylip/exe +PATH: /opt/bio/mrbayes +PATH: /opt/bio/fasta +PATH: /opt/bio/glimmer/bin +PATH: /opt/bio/glimmer/scripts +PATH: /opt/bio/gromacs/bin +PATH: /opt/bio/gmap/bin +PATH: /opt/bio/tigr/bin +PATH: /opt/bio/autodocksuite/bin +PATH: /opt/bio/wgs/bin +PATH: /opt/ganglia/bin +PATH: /opt/ganglia/sbin +PATH: /opt/rocks/bin +PATH: /opt/rocks/sbin +PATH: /opt/gridengine/bin/lx-amd64 +PATH: /zfssz5/BC_PUB/Software/01.Usr/bin + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:2254: checking for a BSD-compatible install +configure:2322: result: /usr/bin/install -c +configure:2333: checking whether build environment is sane +configure:2383: result: yes +configure:2524: checking for a thread-safe mkdir -p +configure:2563: result: /bin/mkdir -p +configure:2576: checking for gawk +configure:2592: found /usr/bin/gawk +configure:2603: result: gawk +configure:2614: checking whether make sets $(MAKE) +configure:2636: result: yes +configure:2724: checking for gawk +configure:2751: result: gawk +configure:2820: checking for g++ +configure:2836: found /zfssz5/BC_PUB/Software/04.UsrHgcc//bin/g++ +configure:2847: result: g++ +configure:2874: checking for C++ compiler version +configure:2883: g++ --version >&5 +g++ (GCC) 6.4.0 +Copyright (C) 2017 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +configure:2894: $? = 0 +configure:2883: g++ -v >&5 +Using built-in specs. +COLLECT_GCC=g++ +COLLECT_LTO_WRAPPER=/zfssz5/BC_PUB/Software/04.UsrHgcc/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.4.0/lto-wrapper +Target: x86_64-pc-linux-gnu +Configured with: ./configure --prefix=/zfssz5/BC_PUB/Software/03.Soft_ALL/gcc-6.4.0/Built/ --enable-threads=posix --enable-languages=c,c++,fortran,go,objc,obj-c++ --with-gmp=/zfssz5/BC_PUB/Software/01.Usr --with-mpc=/zfssz5/BC_PUB/Software/01.Usr --with-mpfr=/zfssz5/BC_PUB/Software/01.Usr --disable-checking --disable-multilib +Thread model: posix +gcc version 6.4.0 (GCC) +configure:2894: $? = 0 +configure:2883: g++ -V >&5 +g++: error: unrecognized command line option '-V' +g++: fatal error: no input files +compilation terminated. +configure:2894: $? = 1 +configure:2883: g++ -qversion >&5 +g++: error: unrecognized command line option '-qversion'; did you mean '--version'? +g++: fatal error: no input files +compilation terminated. +configure:2894: $? = 1 +configure:2914: checking whether the C++ compiler works +configure:2936: g++ -L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib conftest.cpp >&5 +configure:2940: $? = 0 +configure:2988: result: yes +configure:2991: checking for C++ compiler default output file name +configure:2993: result: a.out +configure:2999: checking for suffix of executables +configure:3006: g++ -o conftest -L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib conftest.cpp >&5 +configure:3010: $? = 0 +configure:3032: result: +configure:3054: checking whether we are cross compiling +configure:3062: g++ -o conftest -L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib conftest.cpp >&5 +configure:3066: $? = 0 +configure:3073: ./conftest +configure:3077: $? = 0 +configure:3092: result: no +configure:3097: checking for suffix of object files +configure:3119: g++ -c conftest.cpp >&5 +configure:3123: $? = 0 +configure:3144: result: o +configure:3148: checking whether we are using the GNU C++ compiler +configure:3167: g++ -c conftest.cpp >&5 +configure:3167: $? = 0 +configure:3176: result: yes +configure:3185: checking whether g++ accepts -g +configure:3205: g++ -c -g conftest.cpp >&5 +configure:3205: $? = 0 +configure:3246: result: yes +configure:3280: checking for style of include used by make +configure:3308: result: GNU +configure:3333: checking dependency style of g++ +configure:3443: result: gcc3 +configure:3512: checking for gcc +configure:3528: found /zfssz5/BC_PUB/Software/04.UsrHgcc//bin/gcc +configure:3539: result: gcc +configure:3570: checking for C compiler version +configure:3579: gcc --version >&5 +gcc (GCC) 6.4.0 +Copyright (C) 2017 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +configure:3590: $? = 0 +configure:3579: gcc -v >&5 +Using built-in specs. +COLLECT_GCC=gcc +COLLECT_LTO_WRAPPER=/zfssz5/BC_PUB/Software/04.UsrHgcc/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.4.0/lto-wrapper +Target: x86_64-pc-linux-gnu +Configured with: ./configure --prefix=/zfssz5/BC_PUB/Software/03.Soft_ALL/gcc-6.4.0/Built/ --enable-threads=posix --enable-languages=c,c++,fortran,go,objc,obj-c++ --with-gmp=/zfssz5/BC_PUB/Software/01.Usr --with-mpc=/zfssz5/BC_PUB/Software/01.Usr --with-mpfr=/zfssz5/BC_PUB/Software/01.Usr --disable-checking --disable-multilib +Thread model: posix +gcc version 6.4.0 (GCC) +configure:3590: $? = 0 +configure:3579: gcc -V >&5 +gcc: error: unrecognized command line option '-V' +gcc: fatal error: no input files +compilation terminated. +configure:3590: $? = 1 +configure:3579: gcc -qversion >&5 +gcc: error: unrecognized command line option '-qversion'; did you mean '--version'? +gcc: fatal error: no input files +compilation terminated. +configure:3590: $? = 1 +configure:3594: checking whether we are using the GNU C compiler +configure:3613: gcc -c -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include conftest.c >&5 +configure:3613: $? = 0 +configure:3622: result: yes +configure:3631: checking whether gcc accepts -g +configure:3651: gcc -c -g conftest.c >&5 +configure:3651: $? = 0 +configure:3692: result: yes +configure:3709: checking for gcc option to accept ISO C89 +configure:3772: gcc -c -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include conftest.c >&5 +configure:3772: $? = 0 +configure:3785: result: none needed +configure:3807: checking dependency style of gcc +configure:3917: result: gcc3 +configure:3937: checking how to run the C preprocessor +configure:3968: gcc -E conftest.c +configure:3968: $? = 0 +configure:3982: gcc -E conftest.c +conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory + #include + ^ +compilation terminated. +configure:3982: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "bin/LDBlockShow" +| #define PACKAGE_TARNAME "bin-ldblockshow" +| #define PACKAGE_VERSION "1.35" +| #define PACKAGE_STRING "bin/LDBlockShow 1.35" +| #define PACKAGE_BUGREPORT "hewm2008@gmail.com" +| #define PACKAGE_URL "" +| #define PACKAGE "bin/LDBlockShow" +| #define VERSION "1.35" +| /* end confdefs.h. */ +| #include +configure:4007: result: gcc -E +configure:4027: gcc -E conftest.c +configure:4027: $? = 0 +configure:4041: gcc -E conftest.c +conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory + #include + ^ +compilation terminated. +configure:4041: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "bin/LDBlockShow" +| #define PACKAGE_TARNAME "bin-ldblockshow" +| #define PACKAGE_VERSION "1.35" +| #define PACKAGE_STRING "bin/LDBlockShow 1.35" +| #define PACKAGE_BUGREPORT "hewm2008@gmail.com" +| #define PACKAGE_URL "" +| #define PACKAGE "bin/LDBlockShow" +| #define VERSION "1.35" +| /* end confdefs.h. */ +| #include +configure:4069: checking whether ln -s works +configure:4073: result: yes +configure:4080: checking whether make sets $(MAKE) +configure:4102: result: yes +configure:4154: checking for ranlib +configure:4170: found /usr/bin/ranlib +configure:4181: result: ranlib +configure:4207: checking for main in -lz +configure:4226: gcc -o conftest -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include -L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib conftest.c -lz >&5 +configure:4226: $? = 0 +configure:4235: result: yes +configure:4252: checking for grep that handles long lines and -e +configure:4310: result: /bin/grep +configure:4315: checking for egrep +configure:4377: result: /bin/grep -E +configure:4382: checking for ANSI C header files +configure:4402: gcc -c -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include conftest.c >&5 +configure:4402: $? = 0 +configure:4475: gcc -o conftest -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include -L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib conftest.c -lz >&5 +configure:4475: $? = 0 +configure:4475: ./conftest +configure:4475: $? = 0 +configure:4486: result: yes +configure:4499: checking for sys/types.h +configure:4499: gcc -c -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include conftest.c >&5 +configure:4499: $? = 0 +configure:4499: result: yes +configure:4499: checking for sys/stat.h +configure:4499: gcc -c -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include conftest.c >&5 +configure:4499: $? = 0 +configure:4499: result: yes +configure:4499: checking for stdlib.h +configure:4499: gcc -c -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include conftest.c >&5 +configure:4499: $? = 0 +configure:4499: result: yes +configure:4499: checking for string.h +configure:4499: gcc -c -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include conftest.c >&5 +configure:4499: $? = 0 +configure:4499: result: yes +configure:4499: checking for memory.h +configure:4499: gcc -c -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include conftest.c >&5 +configure:4499: $? = 0 +configure:4499: result: yes +configure:4499: checking for strings.h +configure:4499: gcc -c -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include conftest.c >&5 +configure:4499: $? = 0 +configure:4499: result: yes +configure:4499: checking for inttypes.h +configure:4499: gcc -c -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include conftest.c >&5 +configure:4499: $? = 0 +configure:4499: result: yes +configure:4499: checking for stdint.h +configure:4499: gcc -c -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include conftest.c >&5 +configure:4499: $? = 0 +configure:4499: result: yes +configure:4499: checking for unistd.h +configure:4499: gcc -c -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include conftest.c >&5 +configure:4499: $? = 0 +configure:4499: result: yes +configure:4513: checking zlib.h usability +configure:4513: gcc -c -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include conftest.c >&5 +configure:4513: $? = 0 +configure:4513: result: yes +configure:4513: checking zlib.h presence +configure:4513: gcc -E conftest.c +configure:4513: $? = 0 +configure:4513: result: yes +configure:4513: checking for zlib.h +configure:4513: result: yes +configure:4527: checking math.h usability +configure:4527: gcc -c -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include conftest.c >&5 +configure:4527: $? = 0 +configure:4527: result: yes +configure:4527: checking math.h presence +configure:4527: gcc -E conftest.c +configure:4527: $? = 0 +configure:4527: result: yes +configure:4527: checking for math.h +configure:4527: result: yes +configure:4555: checking for stdlib.h +configure:4555: result: yes +configure:4565: checking for GNU libc compatible malloc +configure:4589: gcc -o conftest -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include -L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib conftest.c -lz >&5 +configure:4589: $? = 0 +configure:4589: ./conftest +configure:4589: $? = 0 +configure:4599: result: yes +configure:4622: checking for stdlib.h +configure:4622: result: yes +configure:4632: checking for GNU libc compatible realloc +configure:4656: gcc -o conftest -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include -L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib conftest.c -lz >&5 +configure:4656: $? = 0 +configure:4656: ./conftest +configure:4656: $? = 0 +configure:4666: result: yes +configure:4690: checking for memset +configure:4690: gcc -o conftest -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include -L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib conftest.c -lz >&5 +conftest.c:51:6: warning: conflicting types for built-in function 'memset' + char memset (); + ^~~~~~ +configure:4690: $? = 0 +configure:4690: result: yes +configure:4690: checking for regcomp +configure:4690: gcc -o conftest -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include -L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib conftest.c -lz >&5 +configure:4690: $? = 0 +configure:4690: result: yes +configure:4690: checking for sqrt +configure:4690: gcc -o conftest -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include -L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib conftest.c -lz >&5 +conftest.c:53:6: warning: conflicting types for built-in function 'sqrt' + char sqrt (); + ^~~~ +/tmp/ccUSJzc0.o: In function `main': +conftest.c:(.text+0xa): undefined reference to `sqrt' +collect2: error: ld returned 1 exit status +configure:4690: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "bin/LDBlockShow" +| #define PACKAGE_TARNAME "bin-ldblockshow" +| #define PACKAGE_VERSION "1.35" +| #define PACKAGE_STRING "bin/LDBlockShow 1.35" +| #define PACKAGE_BUGREPORT "hewm2008@gmail.com" +| #define PACKAGE_URL "" +| #define PACKAGE "bin/LDBlockShow" +| #define VERSION "1.35" +| #define HAVE_LIBZ 1 +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_ZLIB_H 1 +| #define HAVE_MATH_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_MALLOC 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_REALLOC 1 +| #define HAVE_MEMSET 1 +| #define HAVE_REGCOMP 1 +| /* end confdefs.h. */ +| /* Define sqrt to an innocuous variant, in case declares sqrt. +| For example, HP-UX 11i declares gettimeofday. */ +| #define sqrt innocuous_sqrt +| +| /* System header to define __stub macros and hopefully few prototypes, +| which can conflict with char sqrt (); below. +| Prefer to if __STDC__ is defined, since +| exists even on freestanding compilers. */ +| +| #ifdef __STDC__ +| # include +| #else +| # include +| #endif +| +| #undef sqrt +| +| /* Override any GCC internal prototype to avoid an error. +| Use char because int might match the return type of a GCC +| builtin and then its argument prototype would still apply. */ +| #ifdef __cplusplus +| extern "C" +| #endif +| char sqrt (); +| /* The GNU C library defines this for functions which it implements +| to always fail with ENOSYS. Some functions are actually named +| something starting with __ and the normal name is an alias. */ +| #if defined __stub_sqrt || defined __stub___sqrt +| choke me +| #endif +| +| int +| main () +| { +| return sqrt (); +| ; +| return 0; +| } +configure:4690: result: no +configure:4690: checking for strdup +configure:4690: gcc -o conftest -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include -L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib conftest.c -lz >&5 +conftest.c:53:6: warning: conflicting types for built-in function 'strdup' + char strdup (); + ^~~~~~ +configure:4690: $? = 0 +configure:4690: result: yes +configure:4690: checking for strncasecmp +configure:4690: gcc -o conftest -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include -L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib conftest.c -lz >&5 +conftest.c:54:6: warning: conflicting types for built-in function 'strncasecmp' + char strncasecmp (); + ^~~~~~~~~~~ +configure:4690: $? = 0 +configure:4690: result: yes +configure:4690: checking for strtol +configure:4690: gcc -o conftest -I/zfssz5/BC_PUB/Software/04.UsrHgcc//include -L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib conftest.c -lz >&5 +configure:4690: $? = 0 +configure:4690: result: yes +configure:4839: creating ./config.status + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_c_compiler_gnu=yes +ac_cv_cxx_compiler_gnu=yes +ac_cv_env_CCC_set= +ac_cv_env_CCC_value= +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set=set +ac_cv_env_CFLAGS_value=-I/zfssz5/BC_PUB/Software/04.UsrHgcc//include +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_CXXFLAGS_set= +ac_cv_env_CXXFLAGS_value= +ac_cv_env_CXX_set= +ac_cv_env_CXX_value= +ac_cv_env_LDFLAGS_set=set +ac_cv_env_LDFLAGS_value=-L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib +ac_cv_env_LIBS_set= +ac_cv_env_LIBS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_func_malloc_0_nonnull=yes +ac_cv_func_memset=yes +ac_cv_func_realloc_0_nonnull=yes +ac_cv_func_regcomp=yes +ac_cv_func_sqrt=no +ac_cv_func_strdup=yes +ac_cv_func_strncasecmp=yes +ac_cv_func_strtol=yes +ac_cv_header_inttypes_h=yes +ac_cv_header_math_h=yes +ac_cv_header_memory_h=yes +ac_cv_header_stdc=yes +ac_cv_header_stdint_h=yes +ac_cv_header_stdlib_h=yes +ac_cv_header_string_h=yes +ac_cv_header_strings_h=yes +ac_cv_header_sys_stat_h=yes +ac_cv_header_sys_types_h=yes +ac_cv_header_unistd_h=yes +ac_cv_header_zlib_h=yes +ac_cv_lib_z_main=yes +ac_cv_objext=o +ac_cv_path_EGREP='/bin/grep -E' +ac_cv_path_GREP=/bin/grep +ac_cv_path_install='/usr/bin/install -c' +ac_cv_path_mkdir=/bin/mkdir +ac_cv_prog_AWK=gawk +ac_cv_prog_CPP='gcc -E' +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_ac_ct_CXX=g++ +ac_cv_prog_ac_ct_RANLIB=ranlib +ac_cv_prog_cc_c89= +ac_cv_prog_cc_g=yes +ac_cv_prog_cxx_g=yes +ac_cv_prog_make_make_set=yes +am_cv_CC_dependencies_compiler_type=gcc3 +am_cv_CXX_dependencies_compiler_type=gcc3 + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +ACLOCAL='${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.35/missing --run aclocal-1.11' +AMDEPBACKSLASH='\' +AMDEP_FALSE='#' +AMDEP_TRUE='' +AMTAR='${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.35/missing --run tar' +AUTOCONF='${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.35/missing --run autoconf' +AUTOHEADER='${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.35/missing --run autoheader' +AUTOMAKE='${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.35/missing --run automake-1.11' +AWK='gawk' +CC='gcc' +CCDEPMODE='depmode=gcc3' +CFLAGS='-I/zfssz5/BC_PUB/Software/04.UsrHgcc//include' +CPP='gcc -E' +CPPFLAGS='' +CXX='g++' +CXXDEPMODE='depmode=gcc3' +CXXFLAGS='-g -O2' +CYGPATH_W='echo' +DEFS='-DHAVE_CONFIG_H' +DEPDIR='.deps' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EGREP='/bin/grep -E' +EXEEXT='' +GREP='/bin/grep' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_PROGRAM='${INSTALL}' +INSTALL_SCRIPT='${INSTALL}' +INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' +LDFLAGS='-L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib' +LIBOBJS='' +LIBS='-lz ' +LN_S='ln -s' +LTLIBOBJS='' +MAKEINFO='${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.35/missing --run makeinfo' +MKDIR_P='/bin/mkdir -p' +OBJEXT='o' +PACKAGE='bin/LDBlockShow' +PACKAGE_BUGREPORT='hewm2008@gmail.com' +PACKAGE_NAME='bin/LDBlockShow' +PACKAGE_STRING='bin/LDBlockShow 1.35' +PACKAGE_TARNAME='bin-ldblockshow' +PACKAGE_URL='' +PACKAGE_VERSION='1.35' +PATH_SEPARATOR=':' +RANLIB='ranlib' +SET_MAKE='' +SHELL='/bin/sh' +STRIP='' +VERSION='1.35' +ac_ct_CC='gcc' +ac_ct_CXX='g++' +am__EXEEXT_FALSE='' +am__EXEEXT_TRUE='#' +am__fastdepCC_FALSE='#' +am__fastdepCC_TRUE='' +am__fastdepCXX_FALSE='#' +am__fastdepCXX_TRUE='' +am__include='include' +am__isrc='' +am__leading_dot='.' +am__quote='' +am__tar='${AMTAR} chof - "$$tardir"' +am__untar='${AMTAR} xf -' +bindir='${exec_prefix}/bin' +build_alias='' +datadir='${datarootdir}' +datarootdir='${prefix}/share' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +dvidir='${docdir}' +exec_prefix='${prefix}' +host_alias='' +htmldir='${docdir}' +includedir='${prefix}/include' +infodir='${datarootdir}/info' +install_sh='${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.35/install-sh' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localedir='${datarootdir}/locale' +localstatedir='${prefix}/var' +mandir='${datarootdir}/man' +mkdir_p='/bin/mkdir -p' +oldincludedir='/usr/include' +pdfdir='${docdir}' +prefix='/usr/local' +program_transform_name='s,x,x,' +psdir='${docdir}' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +target_alias='' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +/* confdefs.h */ +#define PACKAGE_NAME "bin/LDBlockShow" +#define PACKAGE_TARNAME "bin-ldblockshow" +#define PACKAGE_VERSION "1.35" +#define PACKAGE_STRING "bin/LDBlockShow 1.35" +#define PACKAGE_BUGREPORT "hewm2008@gmail.com" +#define PACKAGE_URL "" +#define PACKAGE "bin/LDBlockShow" +#define VERSION "1.35" +#define HAVE_LIBZ 1 +#define STDC_HEADERS 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_UNISTD_H 1 +#define HAVE_ZLIB_H 1 +#define HAVE_MATH_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_MALLOC 1 +#define HAVE_STDLIB_H 1 +#define HAVE_REALLOC 1 +#define HAVE_MEMSET 1 +#define HAVE_REGCOMP 1 +#define HAVE_STRDUP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_STRTOL 1 + +configure: exit 0 + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by bin/LDBlockShow config.status 1.35, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on cngb-ologin-20.cngb.sz.hpc + +config.status:867: creating Makefile +config.status:867: creating config.h +config.status:1048: config.h is unchanged +config.status:1096: executing depfiles commands diff --git a/config.status b/config.status new file mode 100644 index 0000000..26fcdb7 --- /dev/null +++ b/config.status @@ -0,0 +1,1203 @@ +#! /bin/sh +# Generated by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by bin/LDBlockShow $as_me 1.35, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +# Files that config.status was made for. +config_files=" Makefile" +config_headers=" config.h" +config_commands=" depfiles" + +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +ac_cs_config="'LDFLAGS=-L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib' 'CFLAGS=-I/zfssz5/BC_PUB/Software/04.UsrHgcc//include'" +ac_cs_version="\ +bin/LDBlockShow config.status 1.35 +configured by ./configure, generated by GNU Autoconf 2.69, + with options \"$ac_cs_config\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='/ldfssz3/PUB/01.Soft/LDBlockShow-1.35' +srcdir='.' +INSTALL='/usr/bin/install -c' +MKDIR_P='/bin/mkdir -p' +AWK='gawk' +test -n "$AWK" || AWK=awk +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +if $ac_cs_recheck; then + set X /bin/sh './configure' 'LDFLAGS=-L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib' 'CFLAGS=-I/zfssz5/BC_PUB/Software/04.UsrHgcc//include' $ac_configure_extra_args --no-create --no-recursion + shift + $as_echo "running CONFIG_SHELL=/bin/sh $*" >&6 + CONFIG_SHELL='/bin/sh' + export CONFIG_SHELL + exec "$@" +fi + +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +# +# INIT-COMMANDS +# +AMDEP_TRUE="" ac_aux_dir="." + + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +cat >>"$ac_tmp/subs1.awk" <<\_ACAWK && +S["am__EXEEXT_FALSE"]="" +S["am__EXEEXT_TRUE"]="#" +S["LTLIBOBJS"]="" +S["LIBOBJS"]="" +S["EGREP"]="/bin/grep -E" +S["GREP"]="/bin/grep" +S["RANLIB"]="ranlib" +S["LN_S"]="ln -s" +S["CPP"]="gcc -E" +S["am__fastdepCC_FALSE"]="#" +S["am__fastdepCC_TRUE"]="" +S["CCDEPMODE"]="depmode=gcc3" +S["ac_ct_CC"]="gcc" +S["CFLAGS"]="-I/zfssz5/BC_PUB/Software/04.UsrHgcc//include" +S["CC"]="gcc" +S["am__fastdepCXX_FALSE"]="#" +S["am__fastdepCXX_TRUE"]="" +S["CXXDEPMODE"]="depmode=gcc3" +S["AMDEPBACKSLASH"]="\\" +S["AMDEP_FALSE"]="#" +S["AMDEP_TRUE"]="" +S["am__quote"]="" +S["am__include"]="include" +S["DEPDIR"]=".deps" +S["OBJEXT"]="o" +S["EXEEXT"]="" +S["ac_ct_CXX"]="g++" +S["CPPFLAGS"]="" +S["LDFLAGS"]="-L/zfssz5/BC_PUB/Software/04.UsrHgcc//lib" +S["CXXFLAGS"]="-g -O2" +S["CXX"]="g++" +S["am__untar"]="${AMTAR} xf -" +S["am__tar"]="${AMTAR} chof - \"$$tardir\"" +S["AMTAR"]="${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.35/missing --run tar" +S["am__leading_dot"]="." +S["SET_MAKE"]="" +S["AWK"]="gawk" +S["mkdir_p"]="/bin/mkdir -p" +S["MKDIR_P"]="/bin/mkdir -p" +S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" +S["STRIP"]="" +S["install_sh"]="${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.35/install-sh" +S["MAKEINFO"]="${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.35/missing --run makeinfo" +S["AUTOHEADER"]="${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.35/missing --run autoheader" +S["AUTOMAKE"]="${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.35/missing --run automake-1.11" +S["AUTOCONF"]="${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.35/missing --run autoconf" +S["ACLOCAL"]="${SHELL} /ldfssz3/PUB/01.Soft/LDBlockShow-1.35/missing --run aclocal-1.11" +S["VERSION"]="1.35" +S["PACKAGE"]="bin/LDBlockShow" +S["CYGPATH_W"]="echo" +S["am__isrc"]="" +S["INSTALL_DATA"]="${INSTALL} -m 644" +S["INSTALL_SCRIPT"]="${INSTALL}" +S["INSTALL_PROGRAM"]="${INSTALL}" +S["target_alias"]="" +S["host_alias"]="" +S["build_alias"]="" +S["LIBS"]="-lz " +S["ECHO_T"]="" +S["ECHO_N"]="-n" +S["ECHO_C"]="" +S["DEFS"]="-DHAVE_CONFIG_H" +S["mandir"]="${datarootdir}/man" +S["localedir"]="${datarootdir}/locale" +S["libdir"]="${exec_prefix}/lib" +S["psdir"]="${docdir}" +S["pdfdir"]="${docdir}" +S["dvidir"]="${docdir}" +S["htmldir"]="${docdir}" +S["infodir"]="${datarootdir}/info" +S["docdir"]="${datarootdir}/doc/${PACKAGE_TARNAME}" +S["oldincludedir"]="/usr/include" +S["includedir"]="${prefix}/include" +S["localstatedir"]="${prefix}/var" +S["sharedstatedir"]="${prefix}/com" +S["sysconfdir"]="${prefix}/etc" +S["datadir"]="${datarootdir}" +S["datarootdir"]="${prefix}/share" +S["libexecdir"]="${exec_prefix}/libexec" +S["sbindir"]="${exec_prefix}/sbin" +S["bindir"]="${exec_prefix}/bin" +S["program_transform_name"]="s,x,x," +S["prefix"]="/usr/local" +S["exec_prefix"]="${prefix}" +S["PACKAGE_URL"]="" +S["PACKAGE_BUGREPORT"]="hewm2008@gmail.com" +S["PACKAGE_STRING"]="bin/LDBlockShow 1.35" +S["PACKAGE_VERSION"]="1.35" +S["PACKAGE_TARNAME"]="bin-ldblockshow" +S["PACKAGE_NAME"]="bin/LDBlockShow" +S["PATH_SEPARATOR"]=":" +S["SHELL"]="/bin/sh" +_ACAWK +cat >>"$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +D["PACKAGE_NAME"]=" \"bin/LDBlockShow\"" +D["PACKAGE_TARNAME"]=" \"bin-ldblockshow\"" +D["PACKAGE_VERSION"]=" \"1.35\"" +D["PACKAGE_STRING"]=" \"bin/LDBlockShow 1.35\"" +D["PACKAGE_BUGREPORT"]=" \"hewm2008@gmail.com\"" +D["PACKAGE_URL"]=" \"\"" +D["PACKAGE"]=" \"bin/LDBlockShow\"" +D["VERSION"]=" \"1.35\"" +D["HAVE_LIBZ"]=" 1" +D["STDC_HEADERS"]=" 1" +D["HAVE_SYS_TYPES_H"]=" 1" +D["HAVE_SYS_STAT_H"]=" 1" +D["HAVE_STDLIB_H"]=" 1" +D["HAVE_STRING_H"]=" 1" +D["HAVE_MEMORY_H"]=" 1" +D["HAVE_STRINGS_H"]=" 1" +D["HAVE_INTTYPES_H"]=" 1" +D["HAVE_STDINT_H"]=" 1" +D["HAVE_UNISTD_H"]=" 1" +D["HAVE_ZLIB_H"]=" 1" +D["HAVE_MATH_H"]=" 1" +D["HAVE_STDLIB_H"]=" 1" +D["HAVE_MALLOC"]=" 1" +D["HAVE_STDLIB_H"]=" 1" +D["HAVE_REALLOC"]=" 1" +D["HAVE_MEMSET"]=" 1" +D["HAVE_REGCOMP"]=" 1" +D["HAVE_STRDUP"]=" 1" +D["HAVE_STRNCASECMP"]=" 1" +D["HAVE_STRTOL"]=" 1" + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\t (]|$)/ { + line = $ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + ac_datarootdir_hack=' + s&@datadir@&${datarootdir}&g + s&@docdir@&${datarootdir}/doc/${PACKAGE_TARNAME}&g + s&@infodir@&${datarootdir}/info&g + s&@localedir@&${datarootdir}/locale&g + s&@mandir@&${datarootdir}/man&g + s&\${datarootdir}&${prefix}/share&g' ;; +esac +ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +} + +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 diff --git a/configure b/configure new file mode 100644 index 0000000..77c5ac3 --- /dev/null +++ b/configure @@ -0,0 +1,6160 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for bin/LDBlockShow 1.39. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +echo Detection system platform is +if [ "$(uname)" == "Darwin" ];then + echo MacOS + cp src/plink_mac ./bin/plink + which "zcat" >/dev/null 2>&1 + if [ $? -eq 0 ]; + then + echo check zcat done + else + echo can not find [zcat],we used the [gzcat] replace + sed 's/ zcat/ gzcat/g' src/FileDeal.h > src/FileDeal.h.tmp + mv src/FileDeal.h.tmp src/FileDeal.h + fi + # Mac OS +elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ];then + echo Linux + # GNU/Linux +elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ];then + echo windows sys no run this +# Windows NT +fi + +chmod 755 bin/* + + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and hewm2008@gmail.com +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='bin/LDBlockShow' +PACKAGE_TARNAME='bin-ldblockshow' +PACKAGE_VERSION='1.39' +PACKAGE_STRING='bin/LDBlockShow 1.39' +PACKAGE_BUGREPORT='hewm2008@gmail.com' +PACKAGE_URL='' + +ac_unique_file="src/LDBlockShow.cpp" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +EGREP +GREP +RANLIB +LN_S +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +ac_ct_CC +CFLAGS +CC +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CXX +CPPFLAGS +LDFLAGS +CXXFLAGS +CXX +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +' + ac_precious_vars='build_alias +host_alias +target_alias +CXX +CXXFLAGS +LDFLAGS +LIBS +CPPFLAGS +CCC +CC +CFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures bin/LDBlockShow 1.39 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/bin-ldblockshow] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of bin/LDBlockShow 1.39:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Some influential environment variables: + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CC C compiler command + CFLAGS C compiler flags + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +bin/LDBlockShow configure 1.39 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## --------------------------------- ## +## Report this to hewm2008@gmail.com ## +## --------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by bin/LDBlockShow $as_me 1.39, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=bin/LDBlockShow + VERSION=1.39 + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +ac_config_headers="$ac_config_headers config.h" + +# Checks for programs +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 +$as_echo_n "checking whether the C++ compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C++ compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 +$as_echo_n "checking for C++ compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C++ compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in gcc + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in gcc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + +# Checks for libraries. +# FIXME: Replace `main' with a function in `-lz': + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lz" >&5 +$as_echo_n "checking for main in -lz... " >&6; } +if ${ac_cv_lib_z_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_main=yes +else + ac_cv_lib_z_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_main" >&5 +$as_echo "$ac_cv_lib_z_main" >&6; } +if test "x$ac_cv_lib_z_main" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +else + as_fn_error $? "You need zlib >= 1.2.3 to build $PACKAGE" "$LINENO" 5 +fi + + + +# Checks for header files. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in zlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ZLIB_H 1 +_ACEOF + +else + as_fn_error $? "You need include zlib.h to build $PACKAGE" "$LINENO" 5 +fi + +done + +for ac_header in math.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default" +if test "x$ac_cv_header_math_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MATH_H 1 +_ACEOF + +else + as_fn_error $? "You need include math.h to build $PACKAGE" "$LINENO" 5 +fi + +done + + + +# Checks for typedefs, structures, and compiler characteristics. + +#AC_CHECK_HEADER_STDBOOL +#AC_C_INLINE +#AC_TYPE_INT32_T +#AC_TYPE_SIZE_T +#AC_TYPE_UINT32_T +#AC_TYPE_UINT8_T + + + +# Checks for library functions. +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if ${ac_cv_func_malloc_0_nonnull+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_malloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_malloc_0_nonnull=yes +else + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then : + +$as_echo "#define HAVE_MALLOC 1" >>confdefs.h + +else + $as_echo "#define HAVE_MALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac + + +$as_echo "#define malloc rpl_malloc" >>confdefs.h + +fi + + +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 +$as_echo_n "checking for GNU libc compatible realloc... " >&6; } +if ${ac_cv_func_realloc_0_nonnull+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_realloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *realloc (); +#endif + +int +main () +{ +return ! realloc (0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_realloc_0_nonnull=yes +else + ac_cv_func_realloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } +if test $ac_cv_func_realloc_0_nonnull = yes; then : + +$as_echo "#define HAVE_REALLOC 1" >>confdefs.h + +else + $as_echo "#define HAVE_REALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" realloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS realloc.$ac_objext" + ;; +esac + + +$as_echo "#define realloc rpl_realloc" >>confdefs.h + +fi + + +for ac_func in memset regcomp sqrt strdup strncasecmp strtol +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by bin/LDBlockShow $as_me 1.39, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +bin/LDBlockShow config.status 1.39 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + + +sed -i 's#\$(AUTOCONF)#\$(AUTOCONF) \&\& echo chmod 755 bin/\\\* \>\> \$(top_srcdir)/configure #' Makefile +chmod 755 bin/* diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..9c2ae9d --- /dev/null +++ b/configure.ac @@ -0,0 +1,49 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ +AC_INIT(bin/LDBlockShow, 1.39, hewm2008@gmail.com) +AM_INIT_AUTOMAKE(bin/LDBlockShow,1.39) +AC_CONFIG_SRCDIR([src/LDBlockShow.cpp]) +AC_CONFIG_HEADER([config.h]) +# Checks for programs +AC_PROG_AWK +AC_PROG_CXX([g++]) +AC_PROG_CC([gcc]) +AC_PROG_CPP +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_RANLIB + +# Checks for libraries. +# FIXME: Replace `main' with a function in `-lz': +AC_CHECK_LIB([z], [main],,AC_MSG_ERROR([You need zlib >= 1.2.3 to build $PACKAGE])) + + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([zlib.h],[],[AC_MSG_ERROR([You need include zlib.h to build $PACKAGE])],[]) +AC_CHECK_HEADERS([math.h],[],[AC_MSG_ERROR([You need include math.h to build $PACKAGE])],[]) + + +# Checks for typedefs, structures, and compiler characteristics. + +#AC_CHECK_HEADER_STDBOOL +#AC_C_INLINE +#AC_TYPE_INT32_T +#AC_TYPE_SIZE_T +#AC_TYPE_UINT32_T +#AC_TYPE_UINT8_T + + + +# Checks for library functions. +AC_FUNC_MALLOC +AC_FUNC_REALLOC +AC_CHECK_FUNCS([memset regcomp sqrt strdup strncasecmp strtol]) + + + + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/depcomp b/depcomp new file mode 100644 index 0000000..df8eea7 --- /dev/null +++ b/depcomp @@ -0,0 +1,630 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free +# Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> "$depfile" + echo >> "$depfile" + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/example/Example1/Test.vcf.gz b/example/Example1/Test.vcf.gz new file mode 100644 index 0000000..7996fdd Binary files /dev/null and b/example/Example1/Test.vcf.gz differ diff --git a/example/Example1/out.png b/example/Example1/out.png new file mode 100644 index 0000000..efb9317 Binary files /dev/null and b/example/Example1/out.png differ diff --git a/example/Example1/run.sh b/example/Example1/run.sh new file mode 100644 index 0000000..471ddc9 --- /dev/null +++ b/example/Example1/run.sh @@ -0,0 +1,10 @@ +#!/bin/sh +#$ -S /bin/sh +#Version1.0 hewm@genomics.cn 2020-01-10 +echo Start Time : +date +#../../bin/LDBlockShow -InVCF Test.vcf.gz -OutPut out -Region chr11:24100000:24200000 -OutPng -SeleVar 1 +../../bin/LDBlockShow -InVCF Test.vcf.gz -OutPut out -Region chr11:24100000:24200000 -OutPng -SeleVar 2 +# [-SeleVar 1] is D' , [-SeleVar 2] is RR . # if you want to use D' for stat ,just defaut +echo End Time : +date diff --git a/example/Example2/gwas.pvalue b/example/Example2/gwas.pvalue new file mode 100644 index 0000000..c7c3af5 --- /dev/null +++ b/example/Example2/gwas.pvalue @@ -0,0 +1,7 @@ +chr11 24142640 0.00009 +chr11 24142660 1.02e-9 +chr11 24142669 1e-9 +chr11 24142692 0.5 +chr11 24142724 0.6 +chr11 24142756 0.001 +chr11 24142760 0.006 diff --git a/example/Example2/out.png b/example/Example2/out.png new file mode 100644 index 0000000..357d463 Binary files /dev/null and b/example/Example2/out.png differ diff --git a/example/Example2/run.sh b/example/Example2/run.sh new file mode 100644 index 0000000..8ac12ea --- /dev/null +++ b/example/Example2/run.sh @@ -0,0 +1,11 @@ +#!/bin/sh +#$ -S /bin/sh +#Version1.0 hewm@genomics.org.cn 2020-02-07 +echo Start Time : +date +#../../bin/LDBlockShow -InVCF ../Example1/Test.vcf.gz -OutPut out -Region chr11:24100000:24200000 -InGWAS gwas.pvalue -OutPng +../../bin/LDBlockShow -InVCF ../Example1/Test.vcf.gz -OutPut out -Region chr11:24100000:24200000 -InGWAS gwas.pvalue -OutPng -SeleVar 2 +## you can run ShowLDSVG with more parameter to re-plot the svg if you want to make some changes ## +# ../../bin/ShowLDSVG -InPreFix out -OutPut out -InGWAS gwas.pvalue -Cutline 7 -ShowNum -PointSize 3 -OutPng +echo End Time : +date diff --git a/example/Example3/In.gff b/example/Example3/In.gff new file mode 100644 index 0000000..8bf12a7 --- /dev/null +++ b/example/Example3/In.gff @@ -0,0 +1,5 @@ +chr11 maker mRNA 24142646 24142738 . + . ID=GeneName +chr11 maker five_prime_UTR 24142646 24142652 . - . Parent=GeneName +chr11 maker CDS 24142653 24142673 . + 2 Parent=GeneName +chr11 maker CDS 24142718 24142729 . + 2 Parent=GeneName +chr11 maker five_prime_UTR 24142730 24142738 . + . Parent=GeneName diff --git a/example/Example3/Spe.snp b/example/Example3/Spe.snp new file mode 100644 index 0000000..804470a --- /dev/null +++ b/example/Example3/Spe.snp @@ -0,0 +1,3 @@ +chr11 24142660 +chr11 24142669 SpeA +chr11 24142760 SpeB diff --git a/example/Example3/gwas.pvalue b/example/Example3/gwas.pvalue new file mode 100644 index 0000000..c7c3af5 --- /dev/null +++ b/example/Example3/gwas.pvalue @@ -0,0 +1,7 @@ +chr11 24142640 0.00009 +chr11 24142660 1.02e-9 +chr11 24142669 1e-9 +chr11 24142692 0.5 +chr11 24142724 0.6 +chr11 24142756 0.001 +chr11 24142760 0.006 diff --git a/example/Example3/out.png b/example/Example3/out.png new file mode 100644 index 0000000..fe7fdcf Binary files /dev/null and b/example/Example3/out.png differ diff --git a/example/Example3/run.sh b/example/Example3/run.sh new file mode 100644 index 0000000..9aa7f14 --- /dev/null +++ b/example/Example3/run.sh @@ -0,0 +1,11 @@ +#!/bin/sh +#$ -S /bin/sh +echo Start Time : +date +#../../bin/LDBlockShow -InVCF ../Example1/Test.vcf.gz -OutPut out -InGWAS gwas.pvalue -InGFF In.gff -Region chr11:24100000:24200000 -OutPng -SeleVar 1 +../../bin/LDBlockShow -InVCF ../Example1/Test.vcf.gz -OutPut out -InGWAS gwas.pvalue -InGFF In.gff -Region chr11:24100000:24200000 -OutPng -SeleVar 2 +## you can run ShowLDSVG with more parameter to re-plot the svg if you want to make some changes ## +#../../bin/ShowLDSVG -InPreFix out -OutPut out.svg -InGWAS gwas.pvalue -Cutline 7 -InGFF In.gff -crGene yellow:lightblue:pink:orange -showNum -OutPng +#../../bin/ShowLDSVG -InPreFix out -OutPut out.svg -InGFF In.gff +# ../../bin/ShowLDSVG -InPreFix out -OutPut out.svg -InGWAS gwas.pvalue -Cutline 7 -InGFF In.gff -crGene yellow:lightblue:pink:orange -showNum -OutPng -SpeSNPName Spe.snp -ShowGWASSpeSNP +date diff --git a/example/Example4/out.png b/example/Example4/out.png new file mode 100644 index 0000000..a32e1b2 Binary files /dev/null and b/example/Example4/out.png differ diff --git a/example/Example4/run.sh b/example/Example4/run.sh new file mode 100644 index 0000000..4634c95 --- /dev/null +++ b/example/Example4/run.sh @@ -0,0 +1,10 @@ +#!/bin/sh +#$ -S /bin/sh +echo Start Time : +date +../../bin/LDBlockShow -InVCF ../Example1/Test.vcf.gz -OutPut out -InGWAS ../Example3/gwas.pvalue -InGFF ../Example3/In.gff -Region chr11:24100000:24200000 -OutPng -SeleVar 4 -TopSite +# [-SeleVar 3]: GWAS with RR ,heatmap with D'. [-SeleVar 4]: GWAS with D' ,heatmap with RR. +## you can run ShowLDSVG with more parameter to re-plot the svg with para [-TopSite] ## +../../bin/ShowLDSVG -InPreFix out -OutPut out.svg -InGWAS ../Example3/gwas.pvalue -Cutline 7 -InGFF ../Example3/In.gff -crGene yellow:lightblue:pink:orange -showNum -OutPng -SpeSNPName ../Example3/Spe.snp -ShowGWASSpeSNP -TopSite +#../../bin/ShowLDSVG -InPreFix out -OutPut out.svg -InGWAS ../Example3/gwas.pvalue -Cutline 7 -InGFF ../Example3/In.gff -crGene yellow:lightblue:pink:orange -showNum -OutPng -SpeSNPName ../Example3/Spe.snp -ShowGWASSpeSNP -TopSite chr11:24142660 +date diff --git a/example/Fig/out1.png b/example/Fig/out1.png new file mode 100644 index 0000000..5841f75 Binary files /dev/null and b/example/Fig/out1.png differ diff --git a/example/Fig/out2.png b/example/Fig/out2.png new file mode 100644 index 0000000..643650e Binary files /dev/null and b/example/Fig/out2.png differ diff --git a/example/readme.txt b/example/readme.txt new file mode 100644 index 0000000..3b7ea0c --- /dev/null +++ b/example/readme.txt @@ -0,0 +1,10 @@ +The examples here are all using [RR], if you need to use [D'], +use parameters [-SeleVar 1] + +1 Example1: Quick outPut the LDHeatMap + +2 Example2: Output LDHeatMap combined with GWAS statistics + +3 Example3: Output LDHeatMap combined with GWAS statistics and genomic annotation + +4 Example4: Output LDHeatMap combined with GWAS statistics with LocusZoom and genomic annotation diff --git a/install-sh b/install-sh new file mode 100644 index 0000000..6781b98 --- /dev/null +++ b/install-sh @@ -0,0 +1,520 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2009-04-28.21; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/missing b/missing new file mode 100644 index 0000000..2bd25b5 --- /dev/null +++ b/missing @@ -0,0 +1,379 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program 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 for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). This is about non-GNU programs, so use $1 not +# $program. +case $1 in + lex*|yacc*) + # Not GNU programs, they don't have --version. + ;; + + tar*) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $program in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + + autoheader*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te*) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison*|yacc*) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex*|flex*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + fi + ;; + + makeinfo*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar*) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/src/Calculate.h b/src/Calculate.h new file mode 100644 index 0000000..bfea0f6 --- /dev/null +++ b/src/Calculate.h @@ -0,0 +1,244 @@ +#ifndef calculate_H_ +#define calculate_H_ + + +using namespace std; + + +///////////////////////// Cal method1 RR ///////////////////////////////// +int cal_RR_MA ( vector & Base1 , vector & Base2 , double & CalResult, statementVar & Var ) +{ + Var.DDE[0][0]=0; Var.DDE[0][1]=0; Var.DDE[1][0]=0; Var.DDE[1][1]=0; + for (Var.i=0 ;Var.i & Base1 , vector & Base2 , double & CalResult, statementVar & Var) +{ + + Var.DDE[0][0]=0; Var.DDE[0][1]=0; Var.DDE[1][0]=0; Var.DDE[1][1]=0; + + for (Var.i=0 ;Var.i0) + { + Var.Cal_A=Var.pB1*Var.pA2; + Var.Cal_B=Var.pA1*Var.pB2; + } + else + { + Var.D_A = 0.0-Var.D_A; + Var.Cal_A = (Var.pB1)*(Var.pB2); + Var.Cal_B = Var.XpA1_pA2 ; + } + + Var.D_max=Var.Cal_A; if (Var.Cal_A>Var.Cal_B) { Var.D_max=Var.Cal_B; } + + if (Var.D_max==0) + { + if (Var.probHaps[0] < 1e-10) { Var.probHaps[0]=1e-10;} + if (Var.probHaps[1] < 1e-10) { Var.probHaps[1]=1e-10;} + if (Var.probHaps[2] < 1e-10) { Var.probHaps[2]=1e-10;} + + Var.pA1 = Var.probHaps[0]+Var.probHaps[1]; + Var.pB1 = 1.0-Var.pA1; + Var.pA2 = Var.probHaps[0]+Var.probHaps[2]; + Var.pB2 = 1.0-Var.pA2; + + Var.XpA1_pA2=Var.pA1*Var.pA2; + Var.D_A = Var.probHaps[0]-Var.XpA1_pA2 ; + + if (Var.D_A>0) + { + Var.Cal_A=Var.pB1*Var.pA2; + Var.Cal_B=Var.pA1*Var.pB2; + } + else + { + Var.D_A = 0.0-Var.D_A; + Var.Cal_A = (Var.pB1)*(Var.pB2); + Var.Cal_B = Var.XpA1_pA2 ; + } + Var.D_max=Var.Cal_A; if (Var.Cal_A>Var.Cal_B) {Var.D_max=Var.Cal_B;} + } + + CalResult = Var.D_A/Var.D_max; +// CalResult.D = Var.D_A/Var.D_max; +// CalResult.RR = (Var.D_A/Var.Cal_A)*(Var.D_A/Var.Cal_B); + + return 1; +} + + + + + + int cal_RR_D_Both(vector & Base1 , vector & Base2 , double & Result_RR, double & Result_DD , statementVar & Var) +{ + + Var.DDE[0][0]=0; Var.DDE[0][1]=0; Var.DDE[1][0]=0; Var.DDE[1][1]=0; + + for (Var.i=0 ;Var.i0) + { + Var.Cal_A=Var.pB1*Var.pA2; + Var.Cal_B=Var.pA1*Var.pB2; + } + else + { + Var.D_A = 0.0-Var.D_A; + Var.Cal_A = (Var.pB1)*(Var.pB2); + Var.Cal_B = Var.XpA1_pA2 ; + } + + Var.D_max=Var.Cal_A; if (Var.Cal_A>Var.Cal_B) { Var.D_max=Var.Cal_B; } + + if (Var.D_max==0) + { + if (Var.probHaps[0] < 1e-10) { Var.probHaps[0]=1e-10;} + if (Var.probHaps[1] < 1e-10) { Var.probHaps[1]=1e-10;} + if (Var.probHaps[2] < 1e-10) { Var.probHaps[2]=1e-10;} + + Var.pA1 = Var.probHaps[0]+Var.probHaps[1]; + Var.pB1 = 1.0-Var.pA1; + Var.pA2 = Var.probHaps[0]+Var.probHaps[2]; + Var.pB2 = 1.0-Var.pA2; + + Var.XpA1_pA2=Var.pA1*Var.pA2; + Var.D_A = Var.probHaps[0]-Var.XpA1_pA2 ; + + if (Var.D_A>0) + { + Var.Cal_A=Var.pB1*Var.pA2; + Var.Cal_B=Var.pA1*Var.pB2; + } + else + { + Var.D_A = 0.0-Var.D_A; + Var.Cal_A = (Var.pB1)*(Var.pB2); + Var.Cal_B = Var.XpA1_pA2 ; + } + Var.D_max=Var.Cal_A; if (Var.Cal_A>Var.Cal_B) {Var.D_max=Var.Cal_B;} + } + + Result_DD = Var.D_A/Var.D_max; + Result_RR = (Var.D_A/Var.Cal_A)*(Var.D_A/Var.Cal_B); + + return 1; +} + + + + + + + + + + +#endif // calculate_H_ ; +///////////////////////////////////////////////////////////////////////////////////////////////// + diff --git a/src/CommFun.h b/src/CommFun.h new file mode 100644 index 0000000..328f122 --- /dev/null +++ b/src/CommFun.h @@ -0,0 +1,138 @@ +#ifndef comm_H_ +#define comm_H_ + +using namespace std; +typedef int llong ; + +//////////////////////////////// some small funtion ///////////////////////////////////////////// + +bool GetBinPath ( std::string path ,std::string& BinPath ) +{ + char buf[2048]={'\0'}; + BinPath.clear() ; + if ( path.rfind('/') == string::npos) + { + string cc="which "+path+" 2> /dev/null "; + FILE *stream ; + stream=popen(cc.c_str(),"r") ; + fread( buf, sizeof(char), sizeof(buf), stream); + BinPath=buf; + BinPath=BinPath.substr(0,BinPath.rfind('/')); + } + else + { + if (path[0] == '/' ) + { + BinPath=path.substr(0, path.rfind('/')+1); + } + else if (path[0] == '.' ) + { + + if(!getcwd(buf, 1000)) + { + return false ; + } + BinPath = buf ; + + if (path[1] == '/') + { + string cutOFF =path.substr(1, path.rfind('/')); + BinPath = BinPath+cutOFF; + } + else + { + string cutOFF =path.substr(0, path.rfind('/')); + BinPath = BinPath+"/"+cutOFF; + } + } + else + { + string cutOFF =path.substr(0, path.rfind('/')+1); + if(!getcwd(buf, 1000)) + { + return false ; + } + BinPath = buf ; + BinPath = BinPath+"/"+cutOFF; + } + } + return true ; +} + +string Int2Str (int A ) +{ + stringstream sstrm ; + sstrm << A ; + return sstrm.str(); +} + +inline void LogLackArg( string flag ) +{ + cerr << "\t\tLack Argument for [ -"<& tokens, const string& delimiters = " ") +{ + string::size_type lastPos = str.find_first_not_of(delimiters, 0); + string::size_type pos = str.find_first_of(delimiters, lastPos); + while (string::npos != pos || string::npos != lastPos) + { + tokens.push_back(str.substr(lastPos, pos - lastPos)); + lastPos = str.find_first_not_of(delimiters, pos); + pos = str.find_first_of(delimiters, lastPos); + } +} + + +bool GzipTrue( string filepath ) +{ + FILE *infile; + unsigned char buf[3] ={'\0'}; + infile = fopen(filepath.c_str(), "rb"); + int rc = fread(buf,sizeof(unsigned char), 2,infile); + fclose(infile); + if (buf[0] == 31 && buf[1] == 139) + { + return true ; + } + else + { + return false ; + } +} + +bool is_digits(string &str) +{ + str=replace_all(str,"chr",""); + return str.find_first_not_of("0123456789") == std::string::npos ; +} + +///////////////////swimming in the sky & flying in the sea///////////////////////////// + + + + + +#endif // comm_H_ ; + + +/////////////////// + + + +////////////////////////swimming in the sea & flying in the sky ////////////////// + + diff --git a/src/DataClass.h b/src/DataClass.h new file mode 100644 index 0000000..5769202 --- /dev/null +++ b/src/DataClass.h @@ -0,0 +1,202 @@ + +////////////////////////swimming in the sea & flying in the sky ////////////////// + + +/* + * DataClass.h + * + * Created on: 2011-11-21 + * Author: hewm@genomics.org.cn + */ + +#ifndef DataClass_H_ +#define DataClass_H_ + + +using namespace std; + + +class In3str1v { + public: + string InStr1; + string InStr2; + string InStr3; + string SubPop; + string InGWAS; + string Region; + string BinDir; + string FixBlock; + string InPlink; + int RR_D ; + bool NoShow ; + bool TF2 ; + int Method ; + double TagRR ; + double MinRR ; + double RatioRR ; + int SBMinLen ; + In3str1v() + { + InStr1=""; + InStr2=""; + InStr3=""; + SubPop=""; + InGWAS=""; + InPlink=""; + RR_D=1; + NoShow=true; + TF2=true; + Method=1; + Region=""; + FixBlock=""; + BinDir=""; + TagRR=0.80; + MinRR=0.90; + SBMinLen=10; + RatioRR=0.90; + } +}; + + +class Para_18 { + public: + string input ; + string output ; + double Het ; + double Miss ; + double MAF ; + int Cut3base ; + Para_18() + { + input=""; + output=""; + Het=0.9 ; + Miss=0.25 ; + Cut3base=0; + MAF=0.05; + } +}; + + +class StarRsult +{ + public: + int Count; + double sumRR; + double sumD; + StarRsult() + { + Count=0; + sumRR=0.0; + sumD=0.0; + } +}; + + +class PairInfoV1 +{ + public: + double D; + double RR; + PairInfoV1() + { + D=-2; + RR=0.0; + } +}; + + +class PairInfoV2 +{ + public: + double D; + double RR; + double LOD; + PairInfoV2() + { + D=-2; + RR=0.0; + LOD=0.0; + } +}; + +class PairInfoV3 +{ + public: + double D; + double RR; + double LOD; + short int low_i ; + short int high_i ; + PairInfoV3() + { + D=-2; + RR=0.0; + LOD=0.0; + low_i=0; + high_i=0; + } +}; + + + +class statementVar +{ + public: + double LN10; + int Asize ; + + double ALL_count ; + map :: iterator it; + double D_A; + double Cal_A ; + double Cal_B ; + double D_max; + + + double XpA1_pA2; + double XpA1_pB2; + double XpB1_pA2; + double XpB1_pB2; + + + double known[5]; + double probHaps[4]; + double lsurface[101]; + double cut5off ; + unsigned short int DDE[3][3]; + double pA1, pB1, pA2, pB2, loglike1, loglike0; + + double tmpAA, tmpAB, tmpBA, tmpBB, dpr;// tmp2AA, tmp2AB, tmp2BA, tmp2BB; + int i; + short int low_i ; + short int high_i; + double total_prob; + double sum_prob ; + // double tmp;//g,h,m,tmp,r; + + statementVar() + { + LN10=log(10.0); +// AA = 0 ; AB = 1 ; BA = 2 ; BB = 3 ; +// int AA ; int AB ; int BA ; int BB ; + total_prob= 0.0; + sum_prob=0.0; + low_i = 0; + high_i = 0; + + } + + +}; + + +struct BaseType +{ + unsigned short int Value:2 ; +}; + + +#endif /* DataClass_H_ */ + +//////////////// swimming in the sky and flying in the sea //////////////// diff --git a/src/FileDeal.h b/src/FileDeal.h new file mode 100644 index 0000000..ef0775c --- /dev/null +++ b/src/FileDeal.h @@ -0,0 +1,2345 @@ +#ifndef ReadDataIn_H_ +#define ReadDataIn_H_ + + +#include "./FilterGenotype.h" + + +using namespace std; + +int GetBestBase (string Genotype, map SNP_Allele , map & SNP_back_Allele , vector & Base_list) +{ + vector Base1 ; + split(Genotype, Base1," \t"); + map Count ; + int Asize=Base1.size(); + for (int ii=0 ;ii :: iterator it=Count.begin(); + for ( ; it!=Count.end(); it++ ) + { + if ( (it->first ) == 'N' ) + { + continue ; + } + else if ((it->second) > Max ) + { + SeD=Max; + sed_base=best_base; + Max=(it->second); + best_base=it->first; + } + else if ( (it->second) >= SeD ) + { + SeD=(it->second); + sed_base=it->first; + } + } + + map Allele2double; + Allele2double["-"]="NN"; + Allele2double["N"]="NN"; + Allele2double["n"]="NN"; + string tmp=""; + string A_base=best_base+tmp; + string B_base=sed_base+tmp; + string Het_base=A_base+B_base; + string C_base=SNP_Allele[Het_base]+tmp; + + Allele2double[A_base]=(A_base+A_base); + Allele2double[B_base]=(B_base+B_base); + Allele2double[C_base]=Het_base; + BaseType TempType ; + // TempType.Value=0; Base_list.push_back(TempType); + // TempType.Value=1; Base_list.push_back(TempType); + + for (int ii=0 ;ii > > & SNPList ,int & Flag_for_pro ) + { + igzstream SampleList ((paraFA04->SubPop).c_str(),ifstream::in); + if (SampleList.fail()) + { + cerr << "open Sub Group IN File error: "<<(paraFA04->SubPop)< SubVetor; + map :: iterator it; + + while(!SampleList.eof()) + { + string line ; + getline(SampleList,line); + if (line.length()<=0 || line[0] == '#' ) { continue ; } + vector inf; + split(line,inf," \t"); + int A=inf.size(); + for(int ii=0 ; ii ::value_type(inf[ii],0)); + } + } + } + SampleList.close(); + + igzstream VCFIN ((paraFA04->InStr1).c_str(),ifstream::in); + if (VCFIN.fail()) + { + cerr << "open VCF File IN File error: "<<(paraFA04->InStr1)< SampleSite; + vector Vsample ; + + while(!VCFIN.eof()) + { + string line ; + getline(VCFIN,line); + if (line.length()<=0 ) { continue ; } + else if ( line[0] == '#' && line[1] == '#' ) { continue ; } + else if ( line[0] == '#' && line[1] != '#' ) + { + Vsample.clear(); + split(line,Vsample," \t"); + if ( Vsample[0] != "#CHROM") + { + continue ; + } + int A=Vsample.size(); + + for (int ii=9 ; ii< A ; ii++) + { + it=SubVetor.find(Vsample[ii]); + if (it!=SubVetor.end()) + { + SampleSite.push_back(ii); + (it->second)++; + } + } + break ; + } + else if ( line[0] != '#' && line[1] != '#' ) + { +cerr<<"wrong Line : "<second)==0) + { + cerr<<"warning : Sample [ "<<(it->first)<<" ] can't be found in the VCF Header\n"; + } + else if ((it->second)>1) + { + cerr<<"warning : Sample [ "<<(it->first)<<" ] can be found [Repeat] in the VCF Header\n"; + } +} + + +int Asample=Vsample.size(); + +int BadSite=0; +int BadIndelSite=0; + +vector Alt ; +vector Btmp ; +int Base_len ; +llong Site ; +int Het_count=0; +int Miss_count=0; +char ABase ; +char BBase ; + +int BaseConut=0; +char best_base='N'; +char sed_base='N'; +int Max=0; +int SeD=0; +map :: iterator itSS ; +int ERA=0; +vector genotype ; +vector genotypeVE ; + + +while(!VCFIN.eof()) +{ + string line ; + getline(VCFIN,line); + if (line.length()<=0 ) { continue ; } + istringstream isoneLine (line,istringstream::in); + for (int iik=0 ; iik>Vsample[iik]; + } + + Base_len=Vsample[3].length(); + Alt.clear(); + split(Vsample[4],Alt,","); + for (int ii=0 ; iiBase_len) + { + Base_len=Alt[ii].length(); + } + } + + if (Base_len>1) + { + BadIndelSite++; + continue ; + } + + map Count ; + Het_count=0; + Miss_count=0; + + for (int kk=0 ; kk< NumberSubGroup ; kk++) + { + Btmp.clear(); + split(Vsample[SampleSite[kk]], Btmp,":"); + string Genotype=Btmp[0]; + + if ( Genotype[0] == '.' ) + { + Miss_count++ ; + } + else + { + if (Genotype[0] != Genotype[2] ) + { + Het_count++; + } + Count[Genotype[0]]++; + Count[Genotype[2]]++; + } + } + + + if ( ( (Miss_count*1.0/NumberSubGroup) >(para_18->Miss) ) ) + { + continue ; + } + + if ( ( (Het_count*1.0/NumberSubGroup) >(para_18->Het) ) ) + { + continue ; + } + + BaseConut=0; + best_base='N'; + sed_base='N'; + Max=0; + SeD=0; + + for ( itSS=Count.begin(); itSS!=Count.end(); itSS++ ) + { + if ( (itSS->first ) == 'N' ) + { + continue ; + } + else if ((itSS->second) > Max ) + { + SeD=Max; + sed_base=best_base; + Max=(itSS->second); + best_base=itSS->first; + } + else if ( (itSS->second) >= SeD ) + { + SeD=(itSS->second); + sed_base=itSS->first; + } + BaseConut++; + } + if (BaseConut==1 || BaseConut >2 ) + { + BadSite++; + continue ; + } + + //if ( ( (1-(Max*0.5/NumberSubGroup)) < (para_18->MAF) ) ) + if ( (SeD*1.0/(SeD+Max)) < (para_18->MAF) ) + { + continue ; + } + + genotypeVE.clear(); + genotype.clear(); + // vector genotypeVE ; + + BaseType TypeA; + + // vector genotype ; + for (int kk=0 ; kk< NumberSubGroup ; kk++) + { + Btmp.clear(); + split(Vsample[SampleSite[kk]], Btmp,":"); + string Genotype=Btmp[0]; + ABase=Genotype[0]; + if ( ABase == '.' ) + { + genotype.push_back('N'); + genotype.push_back('N'); + } + else + { + BBase=Genotype[2]; + if (ABase != BBase) + { + genotype.push_back(best_base); // best and sed base to phase + genotype.push_back(sed_base); + } + else + { + genotype.push_back(ABase); + genotype.push_back(BBase); + } + } + } + + + ERA=genotype.size(); + for (int hh=0 ; hh> Site ; + + + map > > :: iterator itSNP=SNPList.find(Vsample[0]); + + if (itSNP == SNPList.end()) + { + map > DD; + DD[Site]=genotypeVE; + SNPList.insert(map > > ::value_type(Vsample[0],DD)); + Flag_for_pro++; + } + else + { + (itSNP->second).insert(map > :: value_type(Site,genotypeVE)) ; + Flag_for_pro++; + } +} + +if(BadIndelSite!=0) +{ + cout<<"warning skip Indel site, there are total skip Indel sites number is : "< inf ; + bool TTFF=false ; + while(!VCFIN.eof()) + { + string line ; + getline(VCFIN,line); + if (line.length()<=0 ) { continue ; } + else if ( line[0] == '#' ) { continue ; } + else + { + split(line,inf," \t"); + if ((inf[9])[1] == '|') + { + TTFF=true; + } + break ; + } + } + VCFIN.close(); + if (TTFF) + { + cout <<"#Detected VCF File is phased file with '|', Read VCF in Phase mode"< > > & SNPList ,int & Flag_for_pro ) +{ + + igzstream VCFIN ((paraFA04->InStr1).c_str(),ifstream::in); + + if (VCFIN.fail()) + { + cerr << "open VCF File IN File error: "<<(paraFA04->InStr1)< inf ; + + while(!VCFIN.eof()) + { + string line ; + getline(VCFIN,line); + if (line.length()<=0 ) { continue ; } + else if ( line[0] == '#' && line[1] == '#' ) { continue ; } + else if ( line[0] == '#' && line[1] != '#' ) + { + inf.clear(); + split(line,inf," \t"); + if ( inf[0] != "#CHROM") + { + continue ; + } + break ; + } + else if ( line[0] != '#' && line[1] != '#' ) + { + cerr<<"wrong Line : "< Alt ; + vector Btmp ; + int Base_len ; + llong Site ; + int Het_count=0; + int Miss_count=0; + + int BaseConut=0; + char best_base='N'; + char sed_base='N'; + int Max=0; + int SeD=0; + map :: iterator it ; + int ERA=0; + vector genotype ; + vector genotypeVE ; + + if (paraFA04->TF2) + { + + while(!VCFIN.eof()) + { + string line ; + getline(VCFIN,line); + if (line.length()<=0) { continue ; } + + istringstream isoneLine (line,istringstream::in); + for (int iik=0 ; iik>inf[iik]; + } + Base_len=inf[3].length(); + Alt.clear(); + split(inf[4],Alt,","); + + for (int ii=0 ; iiBase_len) + { + Base_len=Alt[ii].length(); + } + } + + if (Base_len>1) + { + BadIndelSite++; + continue ; + } + + map Count ; + Het_count=0; + Miss_count=0; + + for (int jj=9 ; jj< Asample ;jj++ ) + { + Btmp.clear(); + split(inf[jj], Btmp,":"); + string Genotype=Btmp[0]; + if ( Genotype[0] == '.' ) + { + Miss_count++ ; + } + else + { + if (Genotype[0] != Genotype[2] ) + { + Het_count++; + } + Count[Genotype[0]]++; + Count[Genotype[2]]++; + } + } + + if ( ( (Miss_count*1.0/SampleNum) >(para_18->Miss) ) ) + { + continue ; + } + + if ( ( (Het_count*1.0/SampleNum) >(para_18->Het) ) ) + { + continue ; + } + + BaseConut=0; + best_base='N'; + sed_base='N'; + Max=0; + SeD=0; + + for ( it=Count.begin(); it!=Count.end(); it++ ) + { + if ( (it->first ) == 'N' ) + { + continue ; + } + else if ((it->second) > Max ) + { + SeD=Max; + sed_base=best_base; + Max=(it->second); + best_base=it->first; + } + else if ( (it->second) >= SeD ) + { + SeD=(it->second); + sed_base=it->first; + } + BaseConut++; + } + if (BaseConut==1 || BaseConut >2 ) + { + BadSite++; + continue ; + } + + if ( (SeD*1.0/(SeD+Max)) < (para_18->MAF) ) + { + continue ; + } + + genotype.clear(); + + for (int jj=9 ; jj< Asample ;jj++ ) + { + Btmp.clear(); + split(inf[jj], Btmp,":"); + string Genotype=Btmp[0]; + if ( Genotype[0] == '.' ) + { + genotype.push_back('N'); + genotype.push_back('N'); + } + else + { + if (Genotype[0] != Genotype[2] ) + { + genotype.push_back(best_base); + genotype.push_back(sed_base); + } + else + { + genotype.push_back(Genotype[0]); + genotype.push_back(Genotype[2]); + } + } + } + + + + genotypeVE.clear(); + + BaseType TypeA; + + ERA=genotype.size(); + + for (int hh=0 ; hh> Site ; + + + map > > :: iterator itSNP=SNPList.find(inf[0]); + + if (itSNP == SNPList.end()) + { + map > DD; + DD[Site]=genotypeVE; + SNPList.insert(map > > ::value_type(inf[0],DD)); + Flag_for_pro++; + } + else + { + (itSNP->second).insert(map > :: value_type(Site,genotypeVE)) ; + Flag_for_pro++; + } + } + + + + } + else + { + + string OUT_VCFTMP=(paraFA04->InStr2)+".vcf.filter.gz"; + ogzstream OUTVCFFF ((OUT_VCFTMP).c_str()); + + while(!VCFIN.eof()) + { + string line ; + getline(VCFIN,line); + if (line.length()<=0 || line[0] == '#' ) { continue ; } + llong Site ; + //inf.clear(); split(line,inf," \t"); + istringstream isoneLine (line,istringstream::in); + for (int iik=0 ; iik>inf[iik]; + } + Base_len=inf[3].length(); + Alt.clear(); + split(inf[4],Alt,","); + for (int ii=0 ; iiBase_len) + { + Base_len=Alt[ii].length(); + } + } + + if (Base_len>1) + { + BadIndelSite++; + continue ; + } + + map Count; + Het_count=0; + Miss_count=0; + + for (int jj=9 ; jj< Asample ;jj++) + { + Btmp.clear(); + split(inf[jj], Btmp,":"); + string Genotype=Btmp[0]; + if ( Genotype[0] == '.' ) + { + Miss_count++ ; + } + else + { + if (Genotype[0] != Genotype[2] ) + { + Het_count++; + } + Count[Genotype[0]]++; + Count[Genotype[2]]++; + } + } + + // int SampleNum=(Asample-9); + if ( ( (Miss_count*1.0/SampleNum) >(para_18->Miss) ) ) + { + continue ; + } + + if ( ( (Het_count*1.0/SampleNum) >(para_18->Het) ) ) + { + continue ; + } + + BaseConut=0; + best_base='N'; + sed_base='N'; + Max=0; + SeD=0; + + for ( it=Count.begin(); it!=Count.end(); it++ ) + { + if ( (it->first ) == 'N' ) + { + continue ; + } + else if ((it->second) > Max ) + { + SeD=Max; + sed_base=best_base; + Max=(it->second); + best_base=it->first; + } + else if ( (it->second) >= SeD ) + { + SeD=(it->second); + sed_base=it->first; + } + BaseConut++; + } + if (BaseConut==1 || BaseConut >2 ) + { + BadSite++; + continue ; + } + + //if ( ( (1-(Max*1.0/(SeD+Max))) < (para_18->MAF) ) ) + if ( (SeD*1.0/(SeD+Max)) < (para_18->MAF) ) + { + continue ; + } + + + genotype.clear(); + for (int jj=9 ; jj< Asample ;jj++ ) + { + Btmp.clear(); + split(inf[jj], Btmp,":"); + string Genotype=Btmp[0]; + if ( Genotype[0] == '.' ) + { + genotype.push_back('N'); + genotype.push_back('N'); + } + else + { + if (Genotype[0] != Genotype[2] ) + { + genotype.push_back(best_base); + genotype.push_back(sed_base); + } + else + { + genotype.push_back(Genotype[0]); + genotype.push_back(Genotype[2]); + } + } + } + + + + //vector genotypeVE ; + genotypeVE.clear(); + + BaseType TypeA; + + ERA=genotype.size(); + for (int hh=0 ; hh> Site ; + + + map > > :: iterator itSNP=SNPList.find(inf[0]); + if (itSNP == SNPList.end()) + { + map > DD; + DD[Site]=genotypeVE; + SNPList.insert(map > > ::value_type(inf[0],DD)); + Flag_for_pro++; + } + else + { + (itSNP->second).insert(map > :: value_type(Site,genotypeVE)) ; + Flag_for_pro++; + } + + OUTVCFFF< > > & SNPList,int & Flag_for_pro ) +{ + string OUT_TMP=(paraFA04->InStr2)+".genotype.filter.gz"; + + char * A = const_cast((paraFA04->InStr3).c_str()); + char * B = const_cast((OUT_TMP).c_str()); + stringstream sstrmC ; + sstrmC << (para_18->MAF); + string C=sstrmC.str(); + char * MAF = const_cast((C).c_str()); + + stringstream sstrmA ; + sstrmA << (para_18->Miss); + string D=sstrmA.str(); + char * Miss = const_cast((D).c_str()); + + stringstream sstrmB ; + sstrmB << (para_18->Het); + string E=sstrmB.str(); + char * Het = const_cast((E).c_str()); + + string Para_1="FilterGeno"; + char * str_Para_1=const_cast((Para_1).c_str()); + + string Para_2="-InPut"; + char * str_Para_2=const_cast((Para_2).c_str()); + + string Para_3="-OutPut"; + char * str_Para_3=const_cast((Para_3).c_str()); + + string Para_4="-Cut3base"; + char * str_Para_4=const_cast((Para_4).c_str()); + + string Para_5="-Miss"; + char * str_Para_5=const_cast((Para_5).c_str()); + + string Para_6="-MAF"; + char * str_Para_6=const_cast((Para_6).c_str()); + + string Para_7="-Het"; + char * str_Para_7=const_cast((Para_7).c_str()); + + char * TmpFF[12]={str_Para_1, str_Para_2, A , str_Para_3 , B , str_Para_4, str_Para_5, Miss, str_Para_6, MAF ,str_Para_7, Het }; + Filter_genotype_main( 12 , TmpFF ); + + map SNP_Allele ; + SNP_Allele["AC"]='M'; SNP_Allele["CA"]='M'; SNP_Allele["GT"]='K'; SNP_Allele["TG"]='K'; + SNP_Allele["CT"]='Y'; SNP_Allele["TC"]='Y'; SNP_Allele["AG"]='R'; SNP_Allele["GA"]='R'; + SNP_Allele["AT"]='W'; SNP_Allele["TA"]='W'; SNP_Allele["CG"]='S'; SNP_Allele["GC"]='S'; + SNP_Allele["AA"]='A'; SNP_Allele["TT"]='T'; SNP_Allele["CC"]='C'; SNP_Allele["GG"]='G'; + + map SNP_back_Allele ; + SNP_back_Allele["M"]="AC";SNP_back_Allele["K"]="GT";SNP_back_Allele["Y"]="CT"; + SNP_back_Allele["R"]="AG";SNP_back_Allele["W"]="AT";SNP_back_Allele["S"]="CG"; + SNP_back_Allele["C"]="CC";SNP_back_Allele["G"]="GG";SNP_back_Allele["T"]="TT"; + SNP_back_Allele["A"]="AA"; + SNP_back_Allele["-"]="NN"; SNP_back_Allele["N"]="NN"; + + igzstream SNP (OUT_TMP.c_str(),ifstream::in); + if (SNP.fail()) + { + cerr << "open SNP File error: "< inf ; + while(!SNP.eof()) + { + string line ; + getline(SNP,line); + if (line.length()<=0 || line[0] == '#' ) { continue ; } + llong Site ; + inf.clear(); + split(line,inf,"\t"); + + istringstream isone (inf[1],istringstream::in); + isone>> Site ; + vector genotype ; + GetBestBase ( inf[2] , SNP_Allele , SNP_back_Allele , genotype ) ; + map > > :: iterator it=SNPList.find(inf[0]); + if (it == SNPList.end()) + { + map > DD; + DD[Site]=genotype; + SNPList.insert(map > > ::value_type(inf[0],DD)); + Flag_for_pro++; + } + else + { + (it->second).insert(map > :: value_type(Site,genotype)) ; + Flag_for_pro++; + } + } + + SNP.close(); + + if (paraFA04->TF2) + { + string MV="rm -rf "+OUT_TMP; + std::system(MV.c_str()) ; + } + + + return 1; +} + + + + + +int Read_SubPopGenotype_IN(In3str1v * paraFA04, Para_18 * para_18 , map > > & SNPList ,int & Flag_for_pro ) +{ + igzstream SampleList ((paraFA04->SubPop).c_str(),ifstream::in); + if (SampleList.fail()) + { + cerr << "open Sub Group IN File error: "<<(paraFA04->SubPop)< SubVetor; + map :: iterator it; + + while(!SampleList.eof()) + { + string line ; + getline(SampleList,line); + if (line.length()<=0 || line[0] == '#' ) { continue ; } + vector inf ; + split(line,inf," \t"); + int A=inf.size(); + for(int ii=0 ; ii ::value_type(inf[ii],0)); + } + } + } + SampleList.close(); + + igzstream GenotypeIN ((paraFA04->InStr3).c_str(),ifstream::in); + if (GenotypeIN.fail()) + { + cerr << "open Genotype File IN File error: "<<(paraFA04->InStr3)< SampleSite; + + //vector Vsample ; + vector inf ; + + while(!GenotypeIN.eof()) + { + string line ; + getline(GenotypeIN,line); + if (line.length()<=0 ) { continue ; } + else if (line[0] == '#' && line[1] == '#' ) { continue ; } + else if( line[0] == '#' && line[1] != '#') + { + inf.clear(); + split(line,inf," \t"); + if ( inf[0] != "#CHROM") + { + continue ; + } + int A=inf.size(); + for(int ii=2 ; ii< A ; ii++) + { + it=SubVetor.find(inf[ii]); + if (it!=SubVetor.end()) + { + SampleSite.push_back(ii); + (it->second)++; + } + } + break ; + } + else if ( line[0] != '#' && line[1] != '#' ) + { + cerr<<"wrong Line : "<second)==0) + { + cerr<<"warning : Sample [ "<<(it->first)<<" ] can't be found in the Genotype Header\n"; + } + else if ((it->second)>1) + { + cerr<<"warning : Sample [ "<<(it->first)<<" ] can be found [Repeat] in the Genotype Header\n"; + } + } + + + int BadSite=0; + + + map SNP_back_Allele ; + SNP_back_Allele["M"]="AC";SNP_back_Allele["K"]="GT";SNP_back_Allele["Y"]="CT"; + SNP_back_Allele["R"]="AG";SNP_back_Allele["W"]="AT";SNP_back_Allele["S"]="CG"; + SNP_back_Allele["C"]="CC";SNP_back_Allele["G"]="GG";SNP_back_Allele["T"]="TT"; + SNP_back_Allele["A"]="AA"; + SNP_back_Allele["-"]="NN"; SNP_back_Allele["N"]="NN"; + + + + int Asample=inf.size(); + + + vector genotype ; + vector genotypeVE ; + + while(!GenotypeIN.eof()) + { + string line ; + getline(GenotypeIN,line); + if (line.length()<=0 ) { continue ; } + llong Site ; + // inf.clear(); split(line,inf," \t"); + istringstream isoneLine (line,istringstream::in); + for (int iik=0 ; iik>inf[iik]; + } + + + map Count ; + int Het_count=0; + int Miss_count=0; + + + + for (int kk=0 ; kk< NumberSubGroup ; kk++) + { + string Genotype=SNP_back_Allele[inf[SampleSite[kk]]]; + char ABase=Genotype[0]; + if ( ABase == 'N' ) + { + Miss_count++ ; + } + else + { + char BBase=Genotype[1]; + if (ABase != BBase ) + { + Het_count++; + } + Count[ABase]++; + Count[BBase]++; + } + } + + + if ( ( (Miss_count*1.0/NumberSubGroup) >(para_18->Miss) ) ) + { + continue ; + } + + if ( ( (Het_count*1.0/NumberSubGroup) >(para_18->Het) ) ) + { + continue ; + } + + int BaseConut=0; + char best_base='N'; + char sed_base='N'; + int Max=0; + int SeD=0; + map :: iterator it=Count.begin(); + + for ( ; it!=Count.end(); it++ ) + { + if ( (it->first ) == 'N' ) + { + continue ; + } + else if ((it->second) > Max ) + { + SeD=Max; + sed_base=best_base; + Max=(it->second); + best_base=it->first; + } + else if ( (it->second) >= SeD ) + { + SeD=(it->second); + sed_base=it->first; + } + BaseConut++; + } + if (BaseConut==1 || BaseConut >2 ) + { + BadSite++; + continue ; + } + + //if ( ( (1-(Max*1.0/(SeD+Max))) < (para_18->MAF) ) ) + if ( (SeD*1.0/(SeD+Max)) < (para_18->MAF) ) + { + continue ; + } + + + genotypeVE.clear(); + BaseType TypeA; + + // cerr<> Site ; + + + map > > :: iterator itSNP=SNPList.find(inf[0]); + + if (itSNP == SNPList.end()) + { + map > DD; + DD[Site]=genotypeVE; + SNPList.insert(map > > ::value_type(inf[0],DD)); + Flag_for_pro++; + } + else + { + (itSNP->second).insert(map > :: value_type(Site,genotypeVE)); + Flag_for_pro++; + } + } + + + if (BadSite!=0) + { + cout<<"Warning skip non bi-allelic(Singleton/ThreeMulti allelic) site, and total skip allelic sites number is :"< > > & SNPList ,int & Flag_for_pro ) + { + igzstream SampleList ((paraFA04->SubPop).c_str(),ifstream::in); + if (SampleList.fail()) + { + cerr << "open Sub Group IN File error: "<<(paraFA04->SubPop)< SubVetor; + map :: iterator it; + + while(!SampleList.eof()) + { + string line ; + getline(SampleList,line); + if (line.length()<=0 || line[0] == '#' ) { continue ; } + vector inf; + split(line,inf," \t"); + int A=inf.size(); + for(int ii=0 ; ii ::value_type(inf[ii],0)); + } + } + } + SampleList.close(); + + igzstream VCFIN ((paraFA04->InStr1).c_str(),ifstream::in); + if (VCFIN.fail()) + { + cerr << "open VCF File IN File error: "<<(paraFA04->InStr1)< SampleSite; + vector Vsample ; + + while(!VCFIN.eof()) + { + string line ; + getline(VCFIN,line); + if (line.length()<=0 ) { continue ; } + else if ( line[0] == '#' && line[1] == '#' ) { continue ; } + else if ( line[0] == '#' && line[1] != '#' ) + { + Vsample.clear(); + split(line,Vsample," \t"); + if ( Vsample[0] != "#CHROM") + { + continue ; + } + int A=Vsample.size(); + + for (int ii=9 ; ii< A ; ii++) + { + it=SubVetor.find(Vsample[ii]); + if (it!=SubVetor.end()) + { + SampleSite.push_back(ii); + (it->second)++; + } + } + break ; + } + else if ( line[0] != '#' && line[1] != '#' ) + { +cerr<<"wrong Line : "<second)==0) + { + cerr<<"warning : Sample [ "<<(it->first)<<" ] can't be found in the VCF Header\n"; + } + else if ((it->second)>1) + { + cerr<<"warning : Sample [ "<<(it->first)<<" ] can be found [Repeat] in the VCF Header\n"; + } +} + + +int Asample=Vsample.size(); + +int BadSite=0; +int BadIndelSite=0; + +vector Alt ; +vector Btmp ; +int Base_len ; +llong Site ; +int Het_count=0; +int Miss_count=0; +char ABase ; +char BBase ; + +int BaseConut=0; +char best_base='N'; +char sed_base='N'; +int Max=0; +int SeD=0; +map :: iterator itSS ; +int ERA=0; +vector genotype ; +vector genotypeVE ; + + +while(!VCFIN.eof()) +{ + string line ; + getline(VCFIN,line); + if (line.length()<=0 ) { continue ; } + istringstream isoneLine (line,istringstream::in); + for (int iik=0 ; iik>Vsample[iik]; + } + + Base_len=Vsample[3].length(); + Alt.clear(); + split(Vsample[4],Alt,","); + for (int ii=0 ; iiBase_len) + { + Base_len=Alt[ii].length(); + } + } + + if (Base_len>1) + { + BadIndelSite++; + continue ; + } + + map Count ; + Het_count=0; + Miss_count=0; + + for (int kk=0 ; kk< NumberSubGroup ; kk++) + { + Btmp.clear(); + split(Vsample[SampleSite[kk]], Btmp,":"); + string Genotype=Btmp[0]; + + if ( Genotype[0] == '.' ) + { + Miss_count++ ; + } + else + { + if (Genotype[0] != Genotype[2] ) + { + Het_count++; + } + Count[Genotype[0]]++; + Count[Genotype[2]]++; + } + + } + + + if ( ( (Miss_count*1.0/NumberSubGroup) >(para_18->Miss) ) ) + { + continue ; + } + + if ( ( (Het_count*1.0/NumberSubGroup) >(para_18->Het) ) ) + { + continue ; + } + + BaseConut=0; + best_base='N'; + sed_base='N'; + Max=0; + SeD=0; + + for ( itSS=Count.begin(); itSS!=Count.end(); itSS++ ) + { + if ( (itSS->first ) == 'N' ) + { + continue ; + } + else if ((itSS->second) > Max ) + { + SeD=Max; + sed_base=best_base; + Max=(itSS->second); + best_base=itSS->first; + } + else if ( (itSS->second) >= SeD ) + { + SeD=(itSS->second); + sed_base=itSS->first; + } + BaseConut++; + } + + if (BaseConut==1 || BaseConut >2 ) + { + BadSite++; + continue ; + } + + //if ( ( (1-(Max*0.5/NumberSubGroup)) < (para_18->MAF) ) ) + if ( (SeD*1.0/(SeD+Max)) < (para_18->MAF) ) + { + continue ; + } + + genotypeVE.clear(); + genotype.clear(); + + + BaseType TypeA; + + for (int kk=0 ; kk< NumberSubGroup ; kk++) + { + Btmp.clear(); + split(Vsample[SampleSite[kk]], Btmp,":"); + string Genotype=Btmp[0]; + ABase=Genotype[0]; + if ( ABase == '.' ) + { + genotype.push_back('N'); + genotype.push_back('N'); + } + else + { + BBase=Genotype[2]; + genotype.push_back(ABase); // phase VCF + genotype.push_back(BBase); // phase VCF + } + } + + + ERA=genotype.size(); + for (int hh=0 ; hh> Site ; + + + map > > :: iterator itSNP=SNPList.find(Vsample[0]); + + if (itSNP == SNPList.end()) + { + map > DD; + DD[Site]=genotypeVE; + SNPList.insert(map > > ::value_type(Vsample[0],DD)); + Flag_for_pro++; + } + else + { + (itSNP->second).insert(map > :: value_type(Site,genotypeVE)) ; + Flag_for_pro++; + } +} + +if(BadIndelSite!=0) +{ + cout<<"warning skip Indel site, there are total skip Indel sites number is : "< > > & SNPList ,int & Flag_for_pro ) +{ + igzstream VCFIN ((paraFA04->InStr1).c_str(),ifstream::in); + + if (VCFIN.fail()) + { + cerr << "open VCF File IN File error: "<<(paraFA04->InStr1)< inf ; + + while(!VCFIN.eof()) + { + string line ; + getline(VCFIN,line); + if (line.length()<=0 ) { continue ; } + else if ( line[0] == '#' && line[1] == '#' ) { continue ; } + else if ( line[0] == '#' && line[1] != '#' ) + { + inf.clear(); + split(line,inf," \t"); + if ( inf[0] != "#CHROM") + { + continue ; + } + break ; + } + else if ( line[0] != '#' && line[1] != '#' ) + { + cerr<<"wrong Line : "< Alt ; + vector Btmp ; + int Base_len ; + llong Site ; + int Het_count=0; + int Miss_count=0; + + int BaseConut=0; + char best_base='N'; + char sed_base='N'; + int Max=0; + int SeD=0; + map :: iterator it ; + int ERA=0; + vector genotype ; + vector genotypeVE ; + + if (paraFA04->TF2) + { + + while(!VCFIN.eof()) + { + string line ; + getline(VCFIN,line); + if (line.length()<=0) { continue ; } + + istringstream isoneLine (line,istringstream::in); + for (int iik=0 ; iik>inf[iik]; + } + Base_len=inf[3].length(); + Alt.clear(); + split(inf[4],Alt,","); + + for (int ii=0 ; iiBase_len) + { + Base_len=Alt[ii].length(); + } + } + + if (Base_len>1) + { + BadIndelSite++; + continue ; + } + + map Count ; + Het_count=0; + Miss_count=0; + + for (int jj=9 ; jj< Asample ;jj++ ) + { + Btmp.clear(); + split(inf[jj], Btmp,":"); + string Genotype=Btmp[0]; + if ( Genotype[0] == '.' ) + { + Miss_count++ ; + } + else + { + if (Genotype[0] != Genotype[2] ) + { + Het_count++; + } + Count[Genotype[0]]++; + Count[Genotype[2]]++; + } + } + + if ( ( (Miss_count*1.0/SampleNum) >(para_18->Miss) ) ) + { + continue ; + } + + if ( ( (Het_count*1.0/SampleNum) >(para_18->Het) ) ) + { + continue ; + } + + BaseConut=0; + best_base='N'; + sed_base='N'; + Max=0; + SeD=0; + + for ( it=Count.begin(); it!=Count.end(); it++ ) + { + if ( (it->first ) == 'N' ) + { + continue ; + } + else if ((it->second) > Max ) + { + SeD=Max; + sed_base=best_base; + Max=(it->second); + best_base=it->first; + } + else if ( (it->second) >= SeD ) + { + SeD=(it->second); + sed_base=it->first; + } + BaseConut++; + } + if (BaseConut==1 || BaseConut >2 ) + { + BadSite++; + continue ; + } + + if ( (SeD*1.0/(SeD+Max)) < (para_18->MAF) ) + { + continue ; + } + + genotype.clear(); + + for (int jj=9 ; jj< Asample ;jj++ ) + { + Btmp.clear(); + split(inf[jj], Btmp,":"); + string Genotype=Btmp[0]; + if ( Genotype[0] == '.' ) + { + genotype.push_back('N'); + genotype.push_back('N'); + } + else + { + genotype.push_back(Genotype[0]); // phase VCF + genotype.push_back(Genotype[2]); // phase VCF + } + } + + + + genotypeVE.clear(); + + BaseType TypeA; + + ERA=genotype.size(); + + for (int hh=0 ; hh> Site ; + + + map > > :: iterator itSNP=SNPList.find(inf[0]); + + if (itSNP == SNPList.end()) + { + map > DD; + DD[Site]=genotypeVE; + SNPList.insert(map > > ::value_type(inf[0],DD)); + Flag_for_pro++; + } + else + { + (itSNP->second).insert(map > :: value_type(Site,genotypeVE)) ; + Flag_for_pro++; + } + } + + + + } + else + { + + string OUT_VCFTMP=(paraFA04->InStr2)+".vcf.filter.gz"; + ogzstream OUTVCFFF ((OUT_VCFTMP).c_str()); + + while(!VCFIN.eof()) + { + string line ; + getline(VCFIN,line); + if (line.length()<=0 || line[0] == '#' ) { continue ; } + llong Site ; + //inf.clear(); split(line,inf," \t"); + istringstream isoneLine (line,istringstream::in); + for (int iik=0 ; iik>inf[iik]; + } + Base_len=inf[3].length(); + Alt.clear(); + split(inf[4],Alt,","); + for (int ii=0 ; iiBase_len) + { + Base_len=Alt[ii].length(); + } + } + + if (Base_len>1) + { + BadIndelSite++; + continue ; + } + + map Count; + Het_count=0; + Miss_count=0; + + for (int jj=9 ; jj< Asample ;jj++) + { + Btmp.clear(); + split(inf[jj], Btmp,":"); + string Genotype=Btmp[0]; + if ( Genotype[0] == '.' ) + { + Miss_count++ ; + } + else + { + if (Genotype[0] != Genotype[2] ) + { + Het_count++; + } + Count[Genotype[0]]++; + Count[Genotype[2]]++; + } + } + + // int SampleNum=(Asample-9); + if ( ( (Miss_count*1.0/SampleNum) >(para_18->Miss) ) ) + { + continue ; + } + + if ( ( (Het_count*1.0/SampleNum) >(para_18->Het) ) ) + { + continue ; + } + + BaseConut=0; + best_base='N'; + sed_base='N'; + Max=0; + SeD=0; + + for ( it=Count.begin(); it!=Count.end(); it++ ) + { + if ( (it->first ) == 'N' ) + { + continue ; + } + else if ((it->second) > Max ) + { + SeD=Max; + sed_base=best_base; + Max=(it->second); + best_base=it->first; + } + else if ( (it->second) >= SeD ) + { + SeD=(it->second); + sed_base=it->first; + } + BaseConut++; + } + if (BaseConut==1 || BaseConut >2 ) + { + BadSite++; + continue ; + } + + //if ( ( (1-(Max*1.0/(SeD+Max))) < (para_18->MAF) ) ) + if ( (SeD*1.0/(SeD+Max)) < (para_18->MAF) ) + { + continue ; + } + + + genotype.clear(); + for (int jj=9 ; jj< Asample ;jj++ ) + { + Btmp.clear(); + split(inf[jj], Btmp,":"); + string Genotype=Btmp[0]; + if ( Genotype[0] == '.' ) + { + genotype.push_back('N'); + genotype.push_back('N'); + } + else + { + genotype.push_back(Genotype[0]); // phase VCF + genotype.push_back(Genotype[2]); // phase VCF + } + } + + + + //vector genotypeVE ; + genotypeVE.clear(); + + BaseType TypeA; + + ERA=genotype.size(); + for (int hh=0 ; hh> Site ; + + + map > > :: iterator itSNP=SNPList.find(inf[0]); + if (itSNP == SNPList.end()) + { + map > DD; + DD[Site]=genotypeVE; + SNPList.insert(map > > ::value_type(inf[0],DD)); + Flag_for_pro++; + } + else + { + (itSNP->second).insert(map > :: value_type(Site,genotypeVE)) ; + Flag_for_pro++; + } + + OUTVCFFF< SubVetor; + map :: iterator it; + vector SampleSite; + string cutSample="1-9"; + if (!(paraFA04->SubPop).empty()) + { + igzstream SampleList ((paraFA04->SubPop).c_str(),ifstream::in); + if (SampleList.fail()) + { + cerr << "open Sub Group IN File error: "<<(paraFA04->SubPop)< inf; + split(line,inf," \t"); + int A=inf.size(); + for(int ii=0 ; ii ::value_type(inf[ii],0)); + } + } + } + SampleList.close(); + } + + igzstream VCFINTT ((paraFA04->InStr1).c_str(),ifstream::in); + string TmpVCFIN=(paraFA04->InStr2)+".region.vcf"; + ofstream OUTAATT (TmpVCFIN.c_str()); + + if(!OUTAATT.good()) + { + cerr << "open OUT File error: "<InStr1)< inf ; + + while(!VCFINTT.eof()) + { + string line ; + getline(VCFINTT,line); + if (line.length()<=0 ) { continue ; } + else if ( line[0] == '#' && line[1] == '#' ) { OUTAATT<SubPop).empty()) + { + OUTAATT<second)++; + OUTAATT<<"\t"<SubPop).empty()) + { + int NumberSubGroup=SampleSite.size(); + cout<<"the Number of subPop samples[found in VCF] is "<second)==0) + { + cerr<<"warning : Sample [ "<<(it->first)<<" ] can't be found in the VCF Header\n"; + } + else if ((it->second)>1) + { + cerr<<"warning : Sample [ "<<(it->first)<<" ] can be found [Repeat] in the VCF Header\n"; + } + } + + } + + inf.clear(); + split((paraFA04->Region),inf,":-"); + string Stat=" cat " + (paraFA04->InStr1); + if (GzipTrue(paraFA04->InStr1)) + { + Stat=" zcat "+ (paraFA04->InStr1) ; + } + if ((paraFA04->SubPop).empty()) + { + Stat=Stat+" | awk \'$1==\""+inf[0]+"\" && $2>="+inf[1]+" && $2<="+inf[2]+" \' | awk \'$3=$2\' OFS=\"\\t\" >> " +TmpVCFIN ; + } + else + { + Stat=Stat+" | awk \'$1==\""+inf[0]+"\" && $2>="+inf[1]+" && $2<="+inf[2]+" \' | awk \'$3=$2\' OFS=\"\\t\" | cut -f "+cutSample+" >> " +TmpVCFIN ; + } + std::system(Stat.c_str()) ; + paraFA04->InStr1=TmpVCFIN; + return 1; + ///////////////////////////////////////////////////////// + +} + + +void AppFixBlock(In3str1v * paraFA04, Para_18 * para_18 ) +{ + string tmpStat="gzip -d "+(paraFA04->InStr2)+".blocks.gz"; + std::system(tmpStat.c_str()) ; + tmpStat=(paraFA04->InStr2)+".blocks"; + ofstream OUTB (tmpStat.c_str(), ios::out|ios::app); + OUTB<<"##User InPut Fixed Blocks"<FixBlock).c_str(),ifstream::in); + while(!INB.eof()) + { + string line ; + getline(INB,line); + OUTB<InStr2)+".blocks"; + std::system(tmpStat.c_str()) ; +} + + + +int PreDealPLink(In3str1v * paraFA04, Para_18 * para_18 ) +{ + + string bed=(paraFA04->InPlink)+".bed"; + string fam=(paraFA04->InPlink)+".fam"; + string bim=(paraFA04->InPlink)+".bim"; + + string ped=(paraFA04->InPlink)+".ped"; + string map=(paraFA04->InPlink)+".map"; + + // ../../bin/plink --file www --export vcf --out yyy --allow-extra-chr + // ../../bin/plink --bfile www --export vcf --out yyyzzz --allow-extra-chr + vector RegionBed; + split((paraFA04->Region),RegionBed,":-"); + string ForRegion=" --chr "+RegionBed[0]+" --from-bp "+RegionBed[1] + " --to-bp "+ RegionBed[2]; +//--chr Ghir_D11 --from-bp 24100000 --to-bp 24185529 + + string commod; + if ( (access(bed.c_str(), 0) == 0) && (access(fam.c_str(), 0) == 0) && (access(bim.c_str(), 0) == 0) ) + { + commod=" --bfile "+(paraFA04->InPlink)+" --allow-extra-chr --export vcf --out "+(paraFA04->InStr2)+ForRegion ; + } + else if ( (access(map.c_str(), 0) == 0) && (access(ped.c_str(), 0) == 0) ) + { + commod=" --file "+(paraFA04->InPlink)+" --allow-extra-chr --export vcf --out "+(paraFA04->InStr2)+ForRegion; + } + else + { + cerr<<"Can't found These three Files :\n\t"<BinDir)+"/plink"; + + if ( access(Plink.c_str(), 0) == 0 ) + { + Plink=Plink+commod +" > /dev/null "; + std::system(Plink.c_str()); + Plink="rm -rf "+(paraFA04->InStr2)+".log " + (paraFA04->InStr2)+".nosex > /dev/null " ; + std::system(Plink.c_str()); + } + else + { + char buf[2048]={'\0'}; + string cc="which plink 2> /dev/null "; + memset( buf, '\0', sizeof(buf) ); + FILE *stream ; + stream=popen(cc.c_str(),"r") ; + fread( buf, sizeof(char), sizeof(buf), stream); + Plink=buf; + Plink=Plink.substr(0,Plink.length()-1); + + if (Plink == "" ) + { + cout <<"\twarning: can't find the [plink] in your $PATH ; please find it and copy into "< /dev/null "; + std::system(Plink.c_str()); + Plink="rm -rf "+(paraFA04->InStr2)+".log " + (paraFA04->InStr2)+".nosex > /dev/null " ; + std::system(Plink.c_str()); + } + } + + (paraFA04->InStr1)=(paraFA04->InStr2)+".vcf"; + return 1; +} + + + +//////////// + +#endif // LDDecay_H_ // +///////// swimming in the sky and flying in the sea //////////// + + + + diff --git a/src/FilterGenotype.h b/src/FilterGenotype.h new file mode 100644 index 0000000..2ca2754 --- /dev/null +++ b/src/FilterGenotype.h @@ -0,0 +1,215 @@ +#ifndef FilterGenotype_H_ +#define FilterGenotype_H_ + +using namespace std ; + +/* +int print_usage_18() +{ + cout <<"" + "\n" + "\tUsage: FilterGeno -InPut -OutPut \n" + "\n" + "\t\t-InPut InPut file of genotype\n" + "\t\t-OutPut OutPut the filter file\n" + "\n" + "\t\t-Het the max ratio of het allele[0.88]\n" + "\t\t-Miss the max ratio of miss allele[0.88]\n" + "\t\t-MAF filter the low minor allele frequency[0.0]\n" + "\t\t-Cut3base Filter position with 3 allele[off]\n" + "\t\t-help show this help\n" + "\n"; + return 1; +} +*/ + +int parse_cmd_18(int argc, char **argv, Para_18 * para_18 ) +{ +// if (argc <=2 ) {print_usage_18();return 0;} + int err_flag = 0; + + for(int i = 1; i < argc || err_flag; i++) + { + if(argv[i][0] != '-') + { + cerr << "command option error! please check." << endl; + return 0; + } + string flag=argv[i] ; + flag=replace_all(flag,"-",""); + + if (flag == "InPut" ) + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + para_18->input=argv[i]; + } + else if (flag == "Het" ) + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + para_18->Het=atof(argv[i]); + } + else if (flag == "MAF" ) + { + if(i + 1 == argc) {LogLackArg(flag);return 0;} + i++; + para_18->MAF=atof(argv[i]); + } + else if (flag == "Miss" ) + { + if(i + 1 == argc) {LogLackArg(flag);return 0;} + i++; + para_18->Miss=atof(argv[i]); + } + else if (flag == "OutPut") + { + if(i + 1 == argc) {LogLackArg(flag);return 0;} + i++; + para_18->output=argv[i]; + } + else if (flag == "Cut3base") + { + para_18->Cut3base=1; + } + } +/* + else if (flag == "help") { print_usage_18();return 0; } + else + { + cerr << "UnKnow argument -"<input).empty() || (para_18->output).empty() ) + { + cerr<< "lack argument for the must"<output=add_Asuffix(para_18->output); + + +*/ + return 1 ; +} + + +int Filter_genotype_main(int argc, char *argv[]) +{ + Para_18 * para_18 = new Para_18; + if( parse_cmd_18(argc, argv, para_18 )==0) + { + delete para_18 ; + return 0 ; + } + + igzstream IN (para_18->input.c_str(),ifstream::in); // ifstream + gz + ogzstream OUT (para_18->output.c_str()); + + if(!IN.good()) + { + cerr << "open IN File error: "<input<output< SNP_back_Allele ; + SNP_back_Allele["M"]="AC";SNP_back_Allele["K"]="GT";SNP_back_Allele["Y"]="CT"; + SNP_back_Allele["R"]="AG";SNP_back_Allele["W"]="AT";SNP_back_Allele["S"]="CG"; + SNP_back_Allele["C"]="CC";SNP_back_Allele["G"]="GG";SNP_back_Allele["T"]="TT"; + SNP_back_Allele["A"]="AA"; + SNP_back_Allele["-"]="NN"; SNP_back_Allele["N"]="NN"; + + vector inff ; + + while(!IN.eof()) + { + string line ; + getline(IN,line); + if (line.length()<=0 || line[0] == '#') { continue ; } + inff.clear(); + split(line,inff," \t"); + map Count ; + int AA=inff.size(); + int het_count=0; + for (int ii=2 ; ii :: iterator it=Count.begin(); + int Base_Number=0; + + for ( ; it!=Count.end(); it++ ) + { + if ( (it->first ) == 'N' ) + { + miss=it->second; + continue ; + } + else if ((it->second) > Max ) + { + SeD=Max; + sed_base=best_base; + Max=(it->second); + best_base=it->first; + } + else if ( (it->second) >= SeD ) + { + SeD=(it->second); + sed_base=it->first; + } + Base_Number++; + } + + if ( ( (miss*1.0)/(sample*2.0) )>(para_18->Miss) ) + { + continue ; + } + else if ( (het_count*1.0/sample)>(para_18->Het) ) + { + continue ; + } + else if ( ((SeD*1.0)/(sample*2.0))< (para_18->MAF)) + { + continue ; + } + else if (Base_Number<2) + { + continue ; + } + else if ( ((para_18->Cut3base)==1) && ( Base_Number>2 ) ) + { + continue ; + } + OUT<BinDir)+"/ShowLDSVG"; + string command=binPath+"\t-InPreFix\t"+(paraFA04->InStr2)+"\t-OutPut\t"+(paraFA04->InStr2)+".svg"; + if (!(paraFA04->InGWAS).empty()) + { + command=command+"\t"+(paraFA04->InGWAS); + } + + if ( access(binPath.c_str(), 0) == 0 ) + { + std::system(command.c_str()) ; + } + else + { + char buf[2048]={'\0'}; + string cc="which ShowLDSVG 2> /dev/null "; + memset( buf, '\0', sizeof(buf) ); + FILE *stream ; + stream=popen(cc.c_str(),"r") ; + fread( buf, sizeof(char), sizeof(buf), stream); + binPath=buf; + binPath=binPath.substr(0,binPath.length()-1); + + if (binPath == "") + { + cout <<"\twarning: can't find the [ShowLDSVG] in your $PATH ; no png Figure Out"< +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "./include/gzstream/gzstream.c" + +#include "./DataClass.h" +#include "./CommFun.h" + +#endif // end HeadIN + + diff --git a/src/LDBlockShow.cpp b/src/LDBlockShow.cpp new file mode 100644 index 0000000..e99fa8a --- /dev/null +++ b/src/LDBlockShow.cpp @@ -0,0 +1,529 @@ +#ifndef LDDecay_H_ +#define LDDecay_H_ + +#include "HeadIN.h" +#include "FileDeal.h" +#include "Calculate.h" +#include "PairWiseRR.h" +#include "PairWiseDD.h" +#include "PairWiseBoth.h" +#include "GetFig.h" +//#include "SpineBlockRR.h" + +using namespace std; + +void LDdecaySNP_help() +{ + cout <<"" + "\n" + "\tUsage: LDBlockShow -InVCF -OutPut -Region chr1:10000-20000\n" + "\n" + "\t\t-InVCF Input SNP VCF Format\n" + "\t\t-OutPut OutPut File of LD Blocks\n" + "\t\t-Region In One Region to show LD info svg Figure\n" + //"\t\t-Bed In muti Region.bed file to show LD\n" + "\n" + "\n" + "\t\t-SeleVar Select statistic for deal. 1: D' 2: R^2 3/4:Both [1]\n" + "\t\t-SubPop SubGroup Sample File List[ALLsample]\n" + "\t\t-BlockType method to detect Block [beta] [1]\n" + "\t\t 1. Block by PLINK (Gabriel method)\n" + "\t\t 2. Solid Spine of LD RR/D' 3. Blockcut with self-defined RR/D'\n" + "\t\t 4. FixBlock by input blocks files 5. No Block\n" + //"\n" + "\n" + "\t\t-InGWAS InPut GWAS Pvalue File(chr site Pvalue)\n" + "\t\t-InGFF InPut GFF3 file to show Gene CDS and name\n" + "\n" + "\t\t-BlockCut 'Strong LD' cutoff and ratio for BlockType3[0.85:0.90]\n" + "\t\t-FixBlock Input fixed block region\n" + "\t\t-MerMinSNPNum merger color grids when SNPnumber over N[50]\n" + //"\t\t-Ratio Ratio of Gabriel Blocks for 'Strong LD' pairwise SNP [0.90]\n" + //"\t\t-SBMinLen Min Length for samall Blocks [10]\n" + + "\t\t\n" + "\t\t-help Show more Parameters and help [hewm2008 v1.39]\n" + "\n"; +} + +void More_HelpLDDecay() +{ + cout<<"" + "\n" + "\t\t More Help document please see the Manual.pdf file\n" + "\t\t Para [-i] is show for [-InVCF], Para [-o] is show for [-OutPut], Para [-r] is show for [-Region],\n" + "\n" + "\n" + "\t\t-InGenotype InPut SNP Genotype Format\n" + "\t\t-InPlink InPut Plink [bed+bim+fam] or [ped+map] file prefix\n" + "\n" + "\t\t-MAF Min minor allele frequency filter [0.05]\n" + "\t\t-Miss Max ratio of miss allele filter [0.25]\n" + "\t\t-Het Max ratio of het allele filter [0.9]\n" + "\n" + "\t\t-TagSNPCut 'Strong LD' cutoff for TagSNP [0.80]\n" + "\n" + "\t\t-OutPng convert svg 2 png file\n" + "\t\t-OutPdf convert svg 2 png file\n" + // "\t\t-Ratio Ratio of Gabriel Blocks for 'Strong LD' pairwise SNP [0.90]\n" + // "\t\t-SBMinLen Min Length for samall Blocks [10]\n" + "\n"; +} + +int LDdecay_help01(int argc, char **argv , In3str1v * paraFA04, Para_18 * para_18) +{ + if (argc <2 ) {LDdecaySNP_help();return 0;} + for(int i = 1; i < argc ; i++) + { + if(argv[i][0] != '-') + { + cerr << "command option error! please check." << endl; + return 0; + } + string flag=argv[i] ; + flag=replace_all(flag,"-",""); + + if (flag == "InVCF" || flag == "i") + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + paraFA04->InStr1=argv[i]; + } + else if (flag == "SubPop" || flag == "s") + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + paraFA04->SubPop=argv[i]; + } + else if (flag == "InGenotype") + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + paraFA04->InStr3=argv[i]; + } + else if (flag == "InPlink") + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + paraFA04->InPlink=argv[i]; + } + else if (flag == "InGWAS") + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-InGWAS\t"+argv[i]; + } + else if (flag == "Cutline") + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-Cutline\t"+argv[i]; + } + else if (flag == "NoShowLDist") + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-NoShowLDist\t"+argv[i]; + } + else if (flag == "SpeSNPName") + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-SpeSNPName\t"+argv[i]; + } + else if (flag == "MerMinSNPNum") + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-MerMinSNPNum\t"+argv[i]; + } + else if (flag == "NumGradien") + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-NumGradien\t"+argv[i]; + } + else if (flag == "InGFF") + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-InGFF\t"+argv[i]; + } + else if (flag == "FixBlock") + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + paraFA04->FixBlock=argv[i]; + } + else if (flag == "OutPut" || flag == "o") + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + paraFA04->InStr2=argv[i]; + } + else if (flag == "Het") + { + if(i + 1 == argc) {LogLackArg(flag); return 0;} + i++; + para_18->Het=atof(argv[i]); + } + else if (flag == "OutPng") + { + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-OutPng"; + } + else if (flag == "ShowGWASSpeSNP") + { + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-ShowGWASSpeSNP"; + } + else if (flag == "OutPdf") + { + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-OutPdf"; + } + else if (flag == "NoHeatMapPlot") + { + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-NoHeatMapPlot"; + } + else if (flag == "NoGeneName") + { + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-NoGeneName"; + } + else if (flag == "ShowNum") + { + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-ShowNum"; + } + else if (flag == "TopSite") + { + if(i + 1== argc) + { + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-TopSite"; + } + else if (argv[i+1][0] == '-' ) + { + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-TopSite"; + } + else + { + i++; + (paraFA04->InGWAS)=(paraFA04->InGWAS)+"\t-TopSite\t"+argv[i]; + } + } + else if (flag == "MAF") + { + if(i + 1== argc) {LogLackArg(flag);return 0;} + i++; + para_18->MAF=atof(argv[i]); + } + else if (flag == "SBMinLen") + { + if(i + 1== argc) {LogLackArg(flag);return 0;} + i++; + paraFA04->SBMinLen=atoi(argv[i]); + } + else if (flag == "BlockCut") + { + if(i + 1== argc) {LogLackArg(flag);return 0;} + i++; + string tmpStr=argv[i]; + if (tmpStr.find(':') ==string::npos) + { + paraFA04->MinRR=atof(argv[i]); + } + else + { + //Stat.substr(Stat.rfind('/') ==string::npos ? Stat.length() : Stat.rfind('/') + 1); + string tmpRatioRR=tmpStr.substr(tmpStr.find(':')+1); + string tmpMinRR=tmpStr.substr(0,tmpStr.find(':')); + paraFA04->MinRR = atof(tmpMinRR.c_str()); + paraFA04->RatioRR=atof(tmpRatioRR.c_str()); + if ( (paraFA04->RatioRR)>1 || (paraFA04->RatioRR)<0.2 ) + { + cerr <<"\t\tRatio value should be [0.2,1]\n"; + return 0; + } + } + if ( (paraFA04->MinRR)>1 || (paraFA04->MinRR)<0.2 ) + { + cerr <<"\t\t-BlockCut should be [0.2,1]\n"; + return 0; + } + } + else if (flag == "Ratio") + { + if(i + 1== argc) {LogLackArg(flag);return 0;} + i++; + paraFA04->RatioRR=atof(argv[i]); + if ( (paraFA04->RatioRR)>1 || (paraFA04->RatioRR)<0 ) + { + cerr <<"\t\t-Ratio should be (0,1]\n"; + return 0; + } + } + else if (flag == "TagSNPCut") + { + if(i + 1== argc) {LogLackArg(flag);return 0;} + i++; + paraFA04->TagRR=atof(argv[i]); + if ( (paraFA04->TagRR)>1 || (paraFA04->TagRR)<0 ) + { + cerr <<"\t\t-TagSNPCut should be (0,1]\n"; + return 0; + } + } + else if (flag == "Miss") + { + if(i + 1 == argc) {LogLackArg(flag);return 0;} + i++; + para_18->Miss=atof(argv[i]); + } + else if (flag == "Region" || flag == "r" ) + { + if(i + 1 == argc) {LogLackArg(flag);return 0;} + i++; + paraFA04->Region=argv[i]; + if ((paraFA04->Region).find(':') ==string::npos) + { + cerr<<"\tPara [-Region] should be [chr:Start:End],such [chr1:5000:8000]"<Method=atoi(argv[i]); + } + else if (flag == "SeleVar") + { + if(i + 1 == argc) {LogLackArg(flag);return 0;} + i++; + paraFA04->RR_D=atoi(argv[i]); + } + else if (flag == "help" || flag == "h") + { + More_HelpLDDecay();return 0; + } + else if (flag == "NoShow") + { + paraFA04->NoShow=false; + } + else + { + cerr << "UnKnow argument -"<InStr2).empty() ) + { + cerr<< "lack argument for the must [-OutPut]"<InStr1).empty() && (paraFA04->InStr3).empty() && (paraFA04->InPlink).empty() ) + { + cerr<< "lack argument for InPut File..."<Region).empty()) && (paraFA04->NoShow) ) + { + cerr<< "\t\tPara [-Region] should give out like chr1:1-100000\n"; + return 0; + } + + if ( ((paraFA04->Method)==1) && ((para_18->MAF)<0.01) ) + { + (para_18->MAF)=0.01; + cerr<<"\t\t -MAF for [-BlockType 1] should >=0.05 ; but now -MAF reset 0.01 Now"<Method) >5 || (paraFA04->Method) <0 ) + { + cerr<<"\t\t-BlockType should be [1/2/3/4/5]"<RR_D) > 4 || (paraFA04->RR_D) < 0 ) + { + cerr<<"\t\t-SeleVar should be [1/2/3/4]"<InStr2); + string ext =Stat.substr(Stat.rfind('.') ==string::npos ? Stat.length() : Stat.rfind('.') + 1); + + if ( ext == "gz" ) + { + (paraFA04->InStr2)=(paraFA04->InStr2).substr(0,(paraFA04->InStr2).length()-3); + } + + Stat=(paraFA04->InStr2); + ext =Stat.substr(Stat.rfind('/') ==string::npos ? Stat.length() : Stat.rfind('/') + 1); + + if (ext != "svg") + { + ext =Stat.substr(Stat.rfind('.') ==string::npos ? Stat.length() : Stat.rfind('.') + 1); + if (ext == "svg") + { + (paraFA04->InStr2)=(paraFA04->InStr2).substr(0,(paraFA04->InStr2).length()-4); + } + } + + Stat=argv[0]; + GetBinPath ( Stat ,paraFA04->BinDir); + + return 1 ; +} + + +int main(int argc, char *argv[]) +{ + In3str1v *paraFA04 = new In3str1v; + Para_18 * para_18 = new Para_18 ; + if ((LDdecay_help01(argc, argv, paraFA04, para_18)==0)) + { + delete paraFA04 ; + delete para_18 ; + return 1; + } + + //(paraFA04->InInt)=(paraFA04->InInt)*1000; + + // char buf[1024*1024]; setbuf(stdout, buf); + //*///////////////////////////Test Out File is OK ///////////////////////////////*// + string Stat=(paraFA04->InStr2); + Stat=(paraFA04->InStr2)+".blocks.gz"; + ogzstream OUTTest ((Stat).c_str()); + if((!OUTTest.good())) + { + cerr << "open OUT File error: "< > > SNPList ; + int Flag_for_pro=0; + + /// deal with plink format input /// + if (!(paraFA04->InPlink).empty()) + { + if (PreDealPLink( paraFA04, para_18 )==0) /////* change ped+map or bed+bim+fam 2 VCF File ///// + { + delete para_18; + delete paraFA04; + return 1; + } + } + + + /////* VCF IN Deal //////////////////////*//// + if (!(paraFA04->InStr1).empty()) + { + bool PhaseVCF=false ; + if (PreDealVCF( paraFA04, para_18 ,PhaseVCF )==0) /////* PreDeal VCF Deal *///// + { + delete para_18; + delete paraFA04; + return 1; + } + + if (PhaseVCF) + { + Read_VCF_IN_Phase( paraFA04, para_18 , SNPList, Flag_for_pro); + } + else + { + Read_VCF_IN( paraFA04, para_18 , SNPList, Flag_for_pro); + } + /*/// + if (PhaseVCF) + { + if ((paraFA04->SubPop).empty()) + { + Read_VCF_IN_Phase( paraFA04, para_18 , SNPList, Flag_for_pro); + } + else + { + Read_SubPopVCF_IN_Phase( paraFA04, para_18 , SNPList, Flag_for_pro); + } + } + else + { + if ((paraFA04->SubPop).empty()) + { + Read_VCF_IN( paraFA04, para_18 , SNPList, Flag_for_pro); + } + else + { + Read_SubPopVCF_IN( paraFA04, para_18 , SNPList, Flag_for_pro); + } + } + *///// + } + + /////* Genotype IN Deal //////////////////////*//// + + if (!(paraFA04->InStr3).empty()) + { + if ((paraFA04->SubPop).empty()) + { + Read_Genotype_IN(paraFA04, para_18 ,SNPList,Flag_for_pro); + } + else + { + Read_SubPopGenotype_IN(paraFA04, para_18 , SNPList , Flag_for_pro ); + } + } + + + //*///////////////////////////PairWise Compare//////////////////////////////////*// + if ( (paraFA04->RR_D) ==1 ) + { + Region_PairWise_D(paraFA04, para_18 ,SNPList, Flag_for_pro); + } + else if ( (paraFA04->RR_D) ==2 ) + { + Region_PairWise_RR(paraFA04, para_18 ,SNPList, Flag_for_pro); + } + else if ( (paraFA04->RR_D) ==3 ) + { + Region_PairWise_BothA(paraFA04, para_18 ,SNPList, Flag_for_pro); + } + else + { + Region_PairWise_BothB(paraFA04, para_18 ,SNPList, Flag_for_pro); + } + + if (!(paraFA04->FixBlock).empty()) + { + AppFixBlock( paraFA04, para_18 ); + } + //cout<<"Start Draw...\n"; + if ((paraFA04->NoShow)) + { + GetFig_Fun(paraFA04, para_18); + } + + + if (!(paraFA04->InStr1).empty()) + { + Stat="rm -rf "+(paraFA04->InStr1); + std::system(Stat.c_str()) ; + } + + delete para_18 ; + delete paraFA04 ; + return 0; + +} + + +#endif // LDDecay_H_ // +///////// swimming in the sky and flying in the sea //////////// + + diff --git a/src/LinuxStatic.sh b/src/LinuxStatic.sh new file mode 100644 index 0000000..e9e19c5 --- /dev/null +++ b/src/LinuxStatic.sh @@ -0,0 +1,9 @@ +#!/bin/sh +#$ -S /bin/sh +#Version1.0 hewm@genomics.org.cn 2020-01-10 +echo Start Time : +date +g++ -static -g -O2 LDBlockShow.cpp -lz -L/usr/lib/ -L./include/zlib/ -L /hwfssz4/BC_PUB/Software/01.Usr/lib/ -o ../bin/LDBlockShow_linux -lm -lc +chmod 755 ../bin/* +echo End Time : +date diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..7854e49 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,16 @@ +CXX=g++ +CXXFLAGS= -g -O2 +BIN := ../bin +LDFLAGS=-lz +INCLUDE= -L/usr/lib64/ -L/usr/lib/ -L./include/zlib/ +all: $(BIN)/LDBlockShow + +$(BIN)/LDBlockShow: $(BIN)/LDBlockShow.o + $(CXX) $^ -o $@ $(LDFLAGS) $(INCLUDE) + +$(BIN)/%.o: %.cpp + $(CXX) -c $(CXXFLAGS) $< -o $@ $(INCLUDE) + chmod 755 ${BIN}/* + +clean: + $(RM) $(BIN)/*.o diff --git a/src/PairWiseBoth.h b/src/PairWiseBoth.h new file mode 100644 index 0000000..c41b11a --- /dev/null +++ b/src/PairWiseBoth.h @@ -0,0 +1,679 @@ +#ifndef PairWiseBoth_H_ +#define PairWiseBoth_H_ + +using namespace std; + + + +int Region_PairWise_BothA(In3str1v * paraFA04, Para_18 * para_18 , map > > & SNPList, int & Flag_for_pro) +{ + string StatDD =(paraFA04->InStr2)+".TriangleV.gz"; + string StatRR =(paraFA04->InStr2)+".TriangleB.gz"; + string StatSite=(paraFA04->InStr2)+".site.gz"; + string StatBlocks=(paraFA04->InStr2)+".blocks.gz"; + ogzstream OUTDD ((StatDD).c_str()); + if(!OUTDD.good()) + { + cerr << "open OUT File error: "< inf; + split((paraFA04->Region),inf,":-"); + llong StartSite=atoi(inf[1].c_str()); + llong EndSite=atoi(inf[2].c_str()); + + string chrName=inf[0]; + unsigned short int ValueE=2; + map > > :: iterator itSNP=SNPList.find(chrName); + if (itSNP == SNPList.end()) + { + cerr<<"\t\tInPut Para -Region chromosome ["< > :: iterator key2=(itSNP->second).begin(); ; + + map > NewSNPList ; + + int count =0; + int TotalSNP=0; + + statementVar Var; + Var.Asize= (key2->second).size(); + + for( ; key2!=(itSNP->second).end(); key2++) + { + if ( ( key2->first )< BeginRegion) + { + continue; + } + if ( ( key2->first )> EndRegion) + { + break; + } + TotalSNP++; + NewSNPList.insert(map > :: value_type(key2->first,(key2->second))) ; + } + + cout<<"##Start Region Cal...\t :"< 3 \n"; + return 0; + } + else if ( TotalSNP > 168888) + { + cerr<<"Warning: LDBlocks Region SNP Number too much,you may use the small region or more stringent conditions to filter the SNP\n"; + } + + //TotalSNP++; + double **ArrDD = new double *[TotalSNP]; + llong *ArrSite = new llong [TotalSNP]; + bool *TFSite = new bool [TotalSNP]; + + for( int i = 0; i < TotalSNP; i++ ) + { + ArrDD[i] = new double [TotalSNP]; + TFSite[i]=false; + ArrSite[i]=0; + for (int j =0 ; j< TotalSNP ; j++) + { + ArrDD[i][j]=1.00; + } + } + + + + double ResultRR; + double ResultDD; + key2=NewSNPList.begin(); + map > :: iterator key2_se ; + int Count=0; + + for( ; key2!=NewSNPList.end(); key2++ ) + { + OUTBB<first)<first); + + key2_se=key2 ; key2_se++ ; + int SedCount=Count+1; + if ( key2_se!=NewSNPList.end() ) + { + + cal_RR_D_Both(key2->second , key2_se->second ,ResultRR,ResultDD, Var); + + OUTDD<second , key2_se->second ,ResultRR,ResultDD, Var); + OUTDD<<"\t"<MinRR<<"\t"<TagRR<Method)==2 ) + { + int SiteStart=0; + int SiteEnd=TotalSNP-1; + while ( SiteStart < TotalSNP ) + { + for ( SiteEnd=TotalSNP-1 ; SiteStart(paraFA04->MinRR)) + { + CountHLD++; + } + } + + for (int ii=SiteEnd-1 ; ii>SiteStart ; ii--) + { + CountALL++; + if (ArrDD[SiteStart][SiteEnd]>(paraFA04->MinRR)) + { + CountHLD++; + } + } + + if ( CountHLD >= (CountALL*(paraFA04->RatioRR))) + { + break; + } + } + + int Length=ArrSite[SiteEnd]-ArrSite[SiteStart]; + if (Length>(paraFA04->SBMinLen) ) + { + OUTCC<(paraFA04->TagRR)) ) + { + TrunF=false; + } + } + TFSite[RREE]=TrunF; + if (TrunF){OUTCC<<","<Method)==3 ) + { + int SiteStart=0; + int SiteEnd=TotalSNP-1; + while ( SiteStart < TotalSNP ) + { + for ( SiteEnd=TotalSNP-1 ; SiteStart(paraFA04->MinRR)) + { + CountHLD++; + } + } + if ( CountHLD >= (CountALL*(paraFA04->RatioRR))) + { + break; + } + } + + int Length=ArrSite[SiteEnd]-ArrSite[SiteStart]; + if (Length>(paraFA04->SBMinLen) ) + { + OUTCC<(paraFA04->TagRR)) ) + { + TrunF=false; + } + } + TFSite[RREE]=TrunF; + if (TrunF){OUTCC<<","<Method)==1 ) + { + stringstream sstrmMAF , sstrmMiss; + sstrmMAF << (para_18->MAF) ; + sstrmMiss << (para_18->Miss) ; + string MissStr=sstrmMiss.str(); + if (is_digits(chrName)) + { + int chrN=atoi(chrName.c_str()); + if (chrN>24) + { + MissStr = MissStr+" --chr-set " + chrName; + } + } + string Plink=(paraFA04->BinDir)+"/plink"; + if ( access(Plink.c_str(), 0) == 0 ) + { + Plink=Plink+" --vcf "+(paraFA04->InStr1)+" --geno " + MissStr +" -maf " + sstrmMAF.str() + " --blocks no-pheno-req --allow-extra-chr --out "+ (paraFA04->InStr2)+".plink > /dev/null "; + std::system(Plink.c_str()); + Plink="rm -rf "+(paraFA04->InStr2)+".blocks.gz ; mv "+(paraFA04->InStr2)+".plink.blocks.det "+(paraFA04->InStr2)+".blocks ; gzip " + (paraFA04->InStr2)+".blocks ; rm -rf "+ (paraFA04->InStr2)+".plink* " ; + std::system(Plink.c_str()); + } + else + { + char buf[2048]={'\0'}; + string cc="which plink 2> /dev/null "; + memset( buf, '\0', sizeof(buf) ); + FILE *stream ; + stream=popen(cc.c_str(),"r") ; + fread( buf, sizeof(char), sizeof(buf), stream); + Plink=buf; + Plink=Plink.substr(0,Plink.length()-1); + + if (Plink == "" ) + { + cout <<"\twarning: can't find the [plink] in your $PATH ; no Plink Blocks Figure Out"<InStr1)+" --geno " + MissStr +" -maf " + sstrmMAF.str() + " --blocks no-pheno-req --allow-extra-chr --out "+ (paraFA04->InStr2)+".plink > /dev/null "; + std::system(Plink.c_str()); + Plink="rm -rf "+(paraFA04->InStr2)+".blocks.gz ; mv "+(paraFA04->InStr2)+".plink.blocks.det "+(paraFA04->InStr2)+".blocks ; gzip " + (paraFA04->InStr2)+".blocks ; rm -rf " + (paraFA04->InStr2)+".plink* " ; + std::system(Plink.c_str()); + } + } + } + + + + + return 1; + +} + + + + + + + + + + +int Region_PairWise_BothB(In3str1v * paraFA04, Para_18 * para_18 , map > > & SNPList, int & Flag_for_pro) +{ + string StatDD =(paraFA04->InStr2)+".TriangleB.gz"; + string StatRR =(paraFA04->InStr2)+".TriangleV.gz"; + string StatSite=(paraFA04->InStr2)+".site.gz"; + string StatBlocks=(paraFA04->InStr2)+".blocks.gz"; + ogzstream OUTRR ((StatRR).c_str()); + if(!OUTRR.good()) + { + cerr << "open OUT File error: "< inf; + split((paraFA04->Region),inf,":-"); + llong StartSite=atoi(inf[1].c_str()); + llong EndSite=atoi(inf[2].c_str()); + + string chrName=inf[0]; + unsigned short int ValueE=2; + map > > :: iterator itSNP=SNPList.find(chrName); + if (itSNP == SNPList.end()) + { + cerr<<"\t\tInPut Para -Region chromosome ["< > :: iterator key2=(itSNP->second).begin(); ; + + map > NewSNPList ; + + int count =0; + int TotalSNP=0; + + statementVar Var; + Var.Asize= (key2->second).size(); + + for( ; key2!=(itSNP->second).end(); key2++) + { + if ( ( key2->first )< BeginRegion) + { + continue; + } + if ( ( key2->first )> EndRegion) + { + break; + } + TotalSNP++; + NewSNPList.insert(map > :: value_type(key2->first,(key2->second))) ; + } + + cout<<"##Start Region Cal...\t :"< 3 \n"; + return 0; + } + else if ( TotalSNP > 168888) + { + cerr<<"Warning: LDBlocks Region SNP Number too much,you may use the small region or more stringent conditions to filter the SNP\n"; + } + + //TotalSNP++; + double **ArrDD = new double *[TotalSNP]; + llong *ArrSite = new llong [TotalSNP]; + bool *TFSite = new bool [TotalSNP]; + + for( int i = 0; i < TotalSNP; i++ ) + { + ArrDD[i] = new double [TotalSNP]; + TFSite[i]=false; + ArrSite[i]=0; + for (int j =0 ; j< TotalSNP ; j++) + { + ArrDD[i][j]=1.00; + } + } + + + + double ResultRR; + double ResultDD; + key2=NewSNPList.begin(); + map > :: iterator key2_se ; + int Count=0; + + for( ; key2!=NewSNPList.end(); key2++ ) + { + OUTBB<first)<first); + + key2_se=key2 ; key2_se++ ; + int SedCount=Count+1; + if ( key2_se!=NewSNPList.end() ) + { + + cal_RR_D_Both(key2->second , key2_se->second ,ResultRR,ResultDD, Var); + + OUTRR<second , key2_se->second ,ResultRR,ResultDD, Var); + OUTRR<<"\t"<MinRR<<"\t"<TagRR<Method)==2 ) + { + int SiteStart=0; + int SiteEnd=TotalSNP-1; + while ( SiteStart < TotalSNP ) + { + for ( SiteEnd=TotalSNP-1 ; SiteStart(paraFA04->MinRR)) + { + CountHLD++; + } + } + + for (int ii=SiteEnd-1 ; ii>SiteStart ; ii--) + { + CountALL++; + if (ArrDD[SiteStart][SiteEnd]>(paraFA04->MinRR)) + { + CountHLD++; + } + } + + if ( CountHLD >= (CountALL*(paraFA04->RatioRR))) + { + break; + } + } + + int Length=ArrSite[SiteEnd]-ArrSite[SiteStart]; + if (Length>(paraFA04->SBMinLen) ) + { + OUTCC<(paraFA04->TagRR)) ) + { + TrunF=false; + } + } + TFSite[RREE]=TrunF; + if (TrunF){OUTCC<<","<Method)==3 ) + { + int SiteStart=0; + int SiteEnd=TotalSNP-1; + while ( SiteStart < TotalSNP ) + { + for ( SiteEnd=TotalSNP-1 ; SiteStart(paraFA04->MinRR)) + { + CountHLD++; + } + } + if ( CountHLD >= (CountALL*(paraFA04->RatioRR))) + { + break; + } + } + + int Length=ArrSite[SiteEnd]-ArrSite[SiteStart]; + if (Length>(paraFA04->SBMinLen) ) + { + OUTCC<(paraFA04->TagRR)) ) + { + TrunF=false; + } + } + TFSite[RREE]=TrunF; + if (TrunF){OUTCC<<","<Method)==1 ) + { + stringstream sstrmMAF , sstrmMiss; + sstrmMAF << (para_18->MAF) ; + sstrmMiss << (para_18->Miss) ; + string MissStr=sstrmMiss.str(); + if (is_digits(chrName)) + { + int chrN=atoi(chrName.c_str()); + if (chrN>24) + { + MissStr = MissStr+" --chr-set " + chrName; + } + } + string Plink=(paraFA04->BinDir)+"/plink"; + if ( access(Plink.c_str(), 0) == 0 ) + { + Plink=Plink+" --vcf "+(paraFA04->InStr1)+" --geno " + MissStr +" -maf " + sstrmMAF.str() + " --blocks no-pheno-req --allow-extra-chr --out "+ (paraFA04->InStr2)+".plink > /dev/null "; + std::system(Plink.c_str()); + Plink="rm -rf "+(paraFA04->InStr2)+".blocks.gz ; mv "+(paraFA04->InStr2)+".plink.blocks.det "+(paraFA04->InStr2)+".blocks ; gzip " + (paraFA04->InStr2)+".blocks ; rm -rf "+ (paraFA04->InStr2)+".plink* " ; + std::system(Plink.c_str()); + } + else + { + char buf[2048]={'\0'}; + string cc="which plink 2> /dev/null "; + memset( buf, '\0', sizeof(buf) ); + FILE *stream ; + stream=popen(cc.c_str(),"r") ; + fread( buf, sizeof(char), sizeof(buf), stream); + Plink=buf; + Plink=Plink.substr(0,Plink.length()-1); + + if (Plink == "" ) + { + cout <<"\twarning: can't find the [plink] in your $PATH ; no Plink Blocks Figure Out"<InStr1)+" --geno " + MissStr +" -maf " + sstrmMAF.str() + " --blocks no-pheno-req --allow-extra-chr --out "+ (paraFA04->InStr2)+".plink > /dev/null "; + std::system(Plink.c_str()); + Plink="rm -rf "+(paraFA04->InStr2)+".blocks.gz ; mv "+(paraFA04->InStr2)+".plink.blocks.det "+(paraFA04->InStr2)+".blocks ; gzip " + (paraFA04->InStr2)+".blocks ; rm -rf " + (paraFA04->InStr2)+".plink* " ; + std::system(Plink.c_str()); + } + } + } + + + + + return 1; + +} + + + + + + + + + + +#endif diff --git a/src/PairWiseDD.h b/src/PairWiseDD.h new file mode 100644 index 0000000..326b9ca --- /dev/null +++ b/src/PairWiseDD.h @@ -0,0 +1,328 @@ +#ifndef PairWiseD_H_ +#define PairWiseD_H_ + +using namespace std; + + +int Region_PairWise_D(In3str1v * paraFA04, Para_18 * para_18 , map > > & SNPList, int & Flag_for_pro) +{ + + string StatDD =(paraFA04->InStr2)+".TriangleV.gz"; + string StatSite=(paraFA04->InStr2)+".site.gz"; + string StatBlocks=(paraFA04->InStr2)+".blocks.gz"; + ogzstream OUTAA ((StatDD).c_str()); + if(!OUTAA.good()) + { + cerr << "open OUT File error: "< inf; + split((paraFA04->Region),inf,":-"); + llong StartSite=atoi(inf[1].c_str()); + llong EndSite=atoi(inf[2].c_str()); + + string chrName=inf[0]; + unsigned short int ValueE=2; + map > > :: iterator itSNP=SNPList.find(chrName); + if (itSNP == SNPList.end()) + { + cerr<<"\t\tInPut Para -Region chromosome ["< > :: iterator key2=(itSNP->second).begin(); ; + + map > NewSNPList ; + + int count =0 ; + int TotalSNP=0; + + statementVar Var; + Var.Asize= (key2->second).size(); + + for( ; key2!=(itSNP->second).end(); key2++) + { + if ( ( key2->first )< BeginRegion) + { + continue; + } + if ( ( key2->first )> EndRegion) + { + break; + } + TotalSNP++; + NewSNPList.insert(map > :: value_type(key2->first,(key2->second))) ; + } + + cout<<"##Start Region Cal...\t :"< 3 \n"; + return 0; + } + else if ( TotalSNP > 168888) + { + cerr<<"Warning: LDBlocks Region SNP Number too much,you may use the small region or more stringent conditions to filter the SNP\n"; + } + + //TotalSNP++; + double **ArrRR = new double *[TotalSNP]; + llong *ArrSite = new llong [TotalSNP]; + bool *TFSite = new bool [TotalSNP]; + + for( int i = 0; i < TotalSNP; i++ ) + { + ArrRR[i] = new double [TotalSNP]; + TFSite[i]=false; + ArrSite[i]=0; + for (int j =0 ; j< TotalSNP ; j++) + { + ArrRR[i][j]=1.00; + } + } + + + + double CalResult; + key2=NewSNPList.begin(); + map > :: iterator key2_se ; + int Count=0; + + for( ; key2!=NewSNPList.end(); key2++ ) + { + OUTBB<first)<first); + + key2_se=key2 ; key2_se++ ; + int SedCount=Count+1; + if ( key2_se!=NewSNPList.end() ) + { + + cal_RR_D(key2->second , key2_se->second ,CalResult, Var); + + OUTAA<second , key2_se->second ,CalResult, Var); + OUTAA<<"\t"<MinRR<<"\t"<TagRR<Method)==2 ) + { + int SiteStart=0; + int SiteEnd=TotalSNP-1; + while ( SiteStart < TotalSNP ) + { + for ( SiteEnd=TotalSNP-1 ; SiteStart(paraFA04->MinRR)) + { + CountHLD++; + } + } + + for (int ii=SiteEnd-1 ; ii>SiteStart ; ii--) + { + CountALL++; + if (ArrRR[SiteStart][SiteEnd]>(paraFA04->MinRR)) + { + CountHLD++; + } + } + + if ( CountHLD >= (CountALL*(paraFA04->RatioRR))) + { + break; + } + } + + int Length=ArrSite[SiteEnd]-ArrSite[SiteStart]; + if (Length>(paraFA04->SBMinLen) ) + { + OUTCC<(paraFA04->TagRR)) ) + { + TrunF=false; + } + } + TFSite[RREE]=TrunF; + if (TrunF){OUTCC<<","<Method)==3 ) + { + int SiteStart=0; + int SiteEnd=TotalSNP-1; + while ( SiteStart < TotalSNP ) + { + for ( SiteEnd=TotalSNP-1 ; SiteStart(paraFA04->MinRR)) + { + CountHLD++; + } + } + if ( CountHLD >= (CountALL*(paraFA04->RatioRR))) + { + break; + } + } + + int Length=ArrSite[SiteEnd]-ArrSite[SiteStart]; + if (Length>(paraFA04->SBMinLen) ) + { + OUTCC<(paraFA04->TagRR)) ) + { + TrunF=false; + } + } + TFSite[RREE]=TrunF; + if (TrunF){OUTCC<<","<Method)==1 ) + { + stringstream sstrmMAF , sstrmMiss; + sstrmMAF << (para_18->MAF) ; + sstrmMiss << (para_18->Miss) ; + string MissStr=sstrmMiss.str(); + if (is_digits(chrName)) + { + int chrN=atoi(chrName.c_str()); + if (chrN>24) + { + MissStr = MissStr+" --chr-set " + chrName; + } + } + string Plink=(paraFA04->BinDir)+"/plink"; + if ( access(Plink.c_str(), 0) == 0 ) + { + Plink=Plink+" --vcf "+(paraFA04->InStr1)+" --snps-only --geno " + MissStr +" -maf " + sstrmMAF.str() + " --blocks no-pheno-req --allow-extra-chr --out "+ (paraFA04->InStr2)+".plink > /dev/null "; + std::system(Plink.c_str()); + Plink="rm -rf "+(paraFA04->InStr2)+".blocks.gz ; mv "+(paraFA04->InStr2)+".plink.blocks.det "+(paraFA04->InStr2)+".blocks ; gzip " + (paraFA04->InStr2)+".blocks ; rm -rf "+ (paraFA04->InStr2)+".plink* " ; + std::system(Plink.c_str()); + } + else + { + char buf[2048]={'\0'}; + string cc="which plink 2> /dev/null "; + memset( buf, '\0', sizeof(buf) ); + FILE *stream ; + stream=popen(cc.c_str(),"r") ; + fread( buf, sizeof(char), sizeof(buf), stream); + Plink=buf; + Plink=Plink.substr(0,Plink.length()-1); + + if (Plink == "" ) + { + cout <<"\twarning: can't find the [plink] in your $PATH ; no Plink Blocks Figure Out"<InStr1)+" --snps-only --geno " + MissStr +" -maf " + sstrmMAF.str() + " --blocks no-pheno-req --allow-extra-chr --out "+ (paraFA04->InStr2)+".plink > /dev/null "; + std::system(Plink.c_str()); + Plink="rm -rf "+(paraFA04->InStr2)+".blocks.gz ; mv "+(paraFA04->InStr2)+".plink.blocks.det "+(paraFA04->InStr2)+".blocks ; gzip " + (paraFA04->InStr2)+".blocks ; rm -rf " + (paraFA04->InStr2)+".plink* " ; + std::system(Plink.c_str()); + } + } + } + + + + + return 1; + +} + + + + + + + + + + +#endif diff --git a/src/PairWiseRR.h b/src/PairWiseRR.h new file mode 100644 index 0000000..db2ee32 --- /dev/null +++ b/src/PairWiseRR.h @@ -0,0 +1,326 @@ +#ifndef PairWiseRR_H_ +#define PairWiseRR_H_ + +using namespace std; + + +int Region_PairWise_RR(In3str1v * paraFA04, Para_18 * para_18 , map > > & SNPList, int & Flag_for_pro) +{ + + string StatRR =(paraFA04->InStr2)+".TriangleV.gz"; + string StatSite=(paraFA04->InStr2)+".site.gz"; + string StatBlocks=(paraFA04->InStr2)+".blocks.gz"; + ogzstream OUTAA ((StatRR).c_str()); + if(!OUTAA.good()) + { + cerr << "open OUT File error: "< inf; + split((paraFA04->Region),inf,":-"); + llong StartSite=atoi(inf[1].c_str()); + llong EndSite=atoi(inf[2].c_str()); + + string chrName=inf[0]; + unsigned short int ValueE=2; + map > > :: iterator itSNP=SNPList.find(chrName); + if (itSNP == SNPList.end()) + { + cerr<<"\t\tInPut Para -Region chromosome ["< > :: iterator key2=(itSNP->second).begin(); ; + + map > NewSNPList ; + + int count =0 ; + int TotalSNP=0; + + statementVar Var; + Var.Asize= (key2->second).size(); + + for( ; key2!=(itSNP->second).end(); key2++) + { + if ( ( key2->first )< BeginRegion) + { + continue; + } + if ( ( key2->first )> EndRegion) + { + break; + } + TotalSNP++; + NewSNPList.insert(map > :: value_type(key2->first,(key2->second))) ; + } + + cout<<"##Start Region Cal...\t :"< 3 \n"; + return 0; + } + else if ( TotalSNP > 168888) + { + cerr<<"Warning: LDBlocks Region SNP Number too much,you may use the small region or more stringent conditions to filter the SNP\n"; + } + + //TotalSNP++; + double **ArrRR = new double *[TotalSNP]; + llong *ArrSite = new llong [TotalSNP]; + bool *TFSite = new bool [TotalSNP]; + + for( int i = 0; i < TotalSNP; i++ ) + { + ArrRR[i] = new double [TotalSNP]; + TFSite[i]=false; + ArrSite[i]=0; + for (int j =0 ; j< TotalSNP ; j++) + { + ArrRR[i][j]=1.00; + } + } + + + + double CalResult; + key2=NewSNPList.begin(); + map > :: iterator key2_se ; + int Count=0; + + for( ; key2!=NewSNPList.end(); key2++ ) + { + OUTBB<first)<first); + + key2_se=key2 ; key2_se++ ; + int SedCount=Count+1; + if ( key2_se!=NewSNPList.end() ) + { + + cal_RR_MA(key2->second , key2_se->second ,CalResult, Var); + + OUTAA<second , key2_se->second ,CalResult, Var); + OUTAA<<"\t"<MinRR<<"\t"<TagRR<Method)==2 ) + { + int SiteStart=0; + int SiteEnd=TotalSNP-1; + while ( SiteStart < TotalSNP ) + { + for ( SiteEnd=TotalSNP-1 ; SiteStart(paraFA04->MinRR)) + { + CountHLD++; + } + } + + for (int ii=SiteEnd-1 ; ii>SiteStart ; ii--) + { + CountALL++; + if (ArrRR[SiteStart][SiteEnd]>(paraFA04->MinRR)) + { + CountHLD++; + } + } + + if ( CountHLD >= (CountALL*(paraFA04->RatioRR))) + { + break; + } + } + + int Length=ArrSite[SiteEnd]-ArrSite[SiteStart]; + if (Length>(paraFA04->SBMinLen) ) + { + OUTCC<(paraFA04->TagRR)) ) + { + TrunF=false; + } + } + TFSite[RREE]=TrunF; + if (TrunF){OUTCC<<","<Method)==3 ) + { + int SiteStart=0; + int SiteEnd=TotalSNP-1; + while ( SiteStart < TotalSNP ) + { + for ( SiteEnd=TotalSNP-1 ; SiteStart(paraFA04->MinRR)) + { + CountHLD++; + } + } + if ( CountHLD >= (CountALL*(paraFA04->RatioRR))) + { + break; + } + } + + int Length=ArrSite[SiteEnd]-ArrSite[SiteStart]; + if (Length>(paraFA04->SBMinLen) ) + { + OUTCC<(paraFA04->TagRR)) ) + { + TrunF=false; + } + } + TFSite[RREE]=TrunF; + if (TrunF){OUTCC<<","<Method)==1 ) + { + stringstream sstrmMAF , sstrmMiss; + sstrmMAF << (para_18->MAF) ; + sstrmMiss << (para_18->Miss) ; + string MissStr=sstrmMiss.str(); + if (is_digits(chrName)) + { + int chrN=atoi(chrName.c_str()); + if (chrN>24) + { + MissStr = MissStr+" --chr-set " + chrName; + } + } + string Plink=(paraFA04->BinDir)+"/plink"; + if ( access(Plink.c_str(), 0) == 0 ) + { + Plink=Plink+" --vcf "+(paraFA04->InStr1)+" --snps-only --geno " + MissStr +" -maf " + sstrmMAF.str() + " --blocks no-pheno-req --allow-extra-chr --out "+ (paraFA04->InStr2)+".plink > /dev/null "; + std::system(Plink.c_str()); + Plink="rm -rf "+(paraFA04->InStr2)+".blocks.gz ; mv "+(paraFA04->InStr2)+".plink.blocks.det "+(paraFA04->InStr2)+".blocks ; gzip " + (paraFA04->InStr2)+".blocks ; rm -rf " + (paraFA04->InStr2)+".plink* " ; ; + std::system(Plink.c_str()); + } + else + { + char buf[2048]={'\0'}; + string cc="which plink 2> /dev/null "; + memset( buf, '\0', sizeof(buf) ); + FILE *stream ; + stream=popen(cc.c_str(),"r") ; + fread( buf, sizeof(char), sizeof(buf), stream); + Plink=buf; + Plink=Plink.substr(0,Plink.length()-1); + + if (Plink == "" ) + { + cout <<"\twarning: can't find the [plink] in your $PATH ; no Plink Blocks Figure Out"<InStr1)+" --snps-only --geno " + MissStr +" -maf " + sstrmMAF.str() + " --blocks no-pheno-req --allow-extra-chr --out "+ (paraFA04->InStr2)+".plink > /dev/null "; + std::system(Plink.c_str()); + Plink="rm -rf "+(paraFA04->InStr2)+".blocks.gz ; mv "+(paraFA04->InStr2)+".plink.blocks.det "+(paraFA04->InStr2)+".blocks ; gzip " + (paraFA04->InStr2)+".blocks ; rm -rf " + (paraFA04->InStr2)+".plink* " ; + std::system(Plink.c_str()); + } + } + } + + + + return 1; + +} + + + + + + + + + + +#endif diff --git a/src/SpineBlockRR.h b/src/SpineBlockRR.h new file mode 100644 index 0000000..174eb6b --- /dev/null +++ b/src/SpineBlockRR.h @@ -0,0 +1,97 @@ +#ifndef SpineBlockRR +#define SpineBlockRR + +using namespace std; + + +int SpineBlockRRFun(In3str1v * paraFA04, Para_18 * para_18 , map > > & SNPList, int & Flag_for_pro) +{ + + string StatBlocks=(paraFA04->InStr2)+".blocks.gz"; + ogzstream OUTCC ((StatBlocks).c_str()); + if(!OUTCC.good()) + { + cerr << "open OUT File error: "< > > :: iterator itSNPChr; + map > :: iterator key2 ; + map > :: iterator key2_se ; + + double CalResult; + statementVar Var; + map TagSNPSite; + + for( itSNPChr=SNPList.begin() ; itSNPChr!=SNPList.end(); itSNPChr++) + { + + key2=(itSNPChr->second).begin(); + Var.Asize= (key2->second).size(); + int Length=0; + llong SiteStart=0; + llong SiteEnd=0; + + + for( ; key2!=(itSNPChr->second).end(); key2++ ) + { + key2_se=key2 ; key2_se++ ; + + if ( key2_se!=(itSNPChr->second).end() ) + { + cal_RR_MA(key2->second , key2_se->second ,CalResult, Var); + if (CalResult>(paraFA04->MinRR)) + { + if (Length==0) + { + SiteStart=key2->first; + SiteEnd=key2_se->first; + Length=1; + TagSNPSite.clear(); + TagSNPSite.insert(map :: value_type(SiteStart,true)) ; + if ( CalResult<(paraFA04->TagRR) ) + { + TagSNPSite.insert(map :: value_type(SiteEnd,true)) ; + } + } + else + { + SiteEnd=key2_se->first; + if ( CalResult<(paraFA04->TagRR) ) + { + TagSNPSite.insert(map :: value_type(SiteEnd,true)) ; + } + Length++; + } + } + else + { + if (Length>2) + { + OUTCC<first<<"\t"<::iterator TagSNPit= TagSNPSite.begin(); + OUTCC<<"\t"<first; + TagSNPit++; + for (; TagSNPit != TagSNPSite.end(); TagSNPit++) + { + OUTCC<<","<first; + } + OUTCC<<"\n"; + Length=0; + } + } + } + } + } + OUTCC.close(); + return 1; + +} + + + + +#endif diff --git a/src/include/gzstream/Readme b/src/include/gzstream/Readme new file mode 100644 index 0000000..1fc1935 --- /dev/null +++ b/src/include/gzstream/Readme @@ -0,0 +1,6 @@ + +If Lib [gzstream] do not work +you can download form this website and install it + +http://www.cs.unc.edu/Research/compgeom/gzstream/ + diff --git a/src/include/gzstream/gzstream.c b/src/include/gzstream/gzstream.c new file mode 100644 index 0000000..bbb4ba8 --- /dev/null +++ b/src/include/gzstream/gzstream.c @@ -0,0 +1,165 @@ +// ============================================================================ +// gzstream, C++ iostream classes wrapping the zlib compression library. +// Copyright (C) 2001 Deepak Bandyopadhyay, Lutz Kettner +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// ============================================================================ +// +// File : gzstream.C +// Revision : $Revision: 1.7 $ +// Revision_date : $Date: 2003/01/08 14:41:27 $ +// Author(s) : Deepak Bandyopadhyay, Lutz Kettner +// +// Standard streambuf implementation following Nicolai Josuttis, "The +// Standard C++ Library". +// ============================================================================ + +#include "gzstream.h" +#include +#include // for memcpy + +#ifdef GZSTREAM_NAMESPACE +namespace GZSTREAM_NAMESPACE { +#endif + +// ---------------------------------------------------------------------------- +// Internal classes to implement gzstream. See header file for user classes. +// ---------------------------------------------------------------------------- + +// -------------------------------------- +// class gzstreambuf: +// -------------------------------------- + +gzstreambuf* gzstreambuf::open( const char* name, int open_mode) { + if ( is_open()) + return (gzstreambuf*)0; + mode = open_mode; + // no append nor read/write mode + if ((mode & std::ios::ate) || (mode & std::ios::app) + || ((mode & std::ios::in) && (mode & std::ios::out))) + return (gzstreambuf*)0; + char fmode[10]; + char* fmodeptr = fmode; + if ( mode & std::ios::in) + *fmodeptr++ = 'r'; + else if ( mode & std::ios::out) + *fmodeptr++ = 'w'; + *fmodeptr++ = 'b'; + *fmodeptr = '\0'; + file = gzopen( name, fmode); + if (file == 0) + return (gzstreambuf*)0; + opened = 1; + return this; +} + +gzstreambuf * gzstreambuf::close() { + if ( is_open()) { + sync(); + opened = 0; + if ( gzclose( file) == Z_OK) + return this; + } + return (gzstreambuf*)0; +} + +int gzstreambuf::underflow() { // used for input buffer only + if ( gptr() && ( gptr() < egptr())) + return * reinterpret_cast( gptr()); + + if ( ! (mode & std::ios::in) || ! opened) + return EOF; + // Josuttis' implementation of inbuf + int n_putback = gptr() - eback(); + if ( n_putback > 4) + n_putback = 4; + memcpy( buffer + (4 - n_putback), gptr() - n_putback, n_putback); + + int num = gzread( file, buffer+4, bufferSize-4); + if (num <= 0) // ERROR or EOF + return EOF; + + // reset buffer pointers + setg( buffer + (4 - n_putback), // beginning of putback area + buffer + 4, // read position + buffer + 4 + num); // end of buffer + + // return next character + return * reinterpret_cast( gptr()); +} + +int gzstreambuf::flush_buffer() { + // Separate the writing of the buffer from overflow() and + // sync() operation. + int w = pptr() - pbase(); + if ( gzwrite( file, pbase(), w) != w) + return EOF; + pbump( -w); + return w; +} + +int gzstreambuf::overflow( int c) { // used for output buffer only + if ( ! ( mode & std::ios::out) || ! opened) + return EOF; + if (c != EOF) { + *pptr() = c; + pbump(1); + } + if ( flush_buffer() == EOF) + return EOF; + return c; +} + +int gzstreambuf::sync() { + // Changed to use flush_buffer() instead of overflow( EOF) + // which caused improper behavior with std::endl and flush(), + // bug reported by Vincent Ricard. + if ( pptr() && pptr() > pbase()) { + if ( flush_buffer() == EOF) + return -1; + } + return 0; +} + +// -------------------------------------- +// class gzstreambase: +// -------------------------------------- + +gzstreambase::gzstreambase( const char* name, int mode) { + init( &buf); + open( name, mode); +} + +gzstreambase::~gzstreambase() { + buf.close(); +} + +void gzstreambase::open( const char* name, int open_mode) { + if ( ! buf.open( name, open_mode)) + clear( rdstate() | std::ios::badbit); +} + +void gzstreambase::close() { + if ( buf.is_open()) + if ( ! buf.close()) + clear( rdstate() | std::ios::badbit); +} + +#ifdef GZSTREAM_NAMESPACE +} // namespace GZSTREAM_NAMESPACE +#endif + +// ============================================================================ +// EOF // diff --git a/src/include/gzstream/gzstream.h b/src/include/gzstream/gzstream.h new file mode 100644 index 0000000..861653f --- /dev/null +++ b/src/include/gzstream/gzstream.h @@ -0,0 +1,121 @@ +// ============================================================================ +// gzstream, C++ iostream classes wrapping the zlib compression library. +// Copyright (C) 2001 Deepak Bandyopadhyay, Lutz Kettner +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// ============================================================================ +// +// File : gzstream.h +// Revision : $Revision: 1.5 $ +// Revision_date : $Date: 2002/04/26 23:30:15 $ +// Author(s) : Deepak Bandyopadhyay, Lutz Kettner +// +// Standard streambuf implementation following Nicolai Josuttis, "The +// Standard C++ Library". +// ============================================================================ + +#ifndef GZSTREAM_H +#define GZSTREAM_H 1 + +// standard C++ with new header file names and std:: namespace +#include +#include +#include + +#ifdef GZSTREAM_NAMESPACE +namespace GZSTREAM_NAMESPACE { +#endif + +// ---------------------------------------------------------------------------- +// Internal classes to implement gzstream. See below for user classes. +// ---------------------------------------------------------------------------- + +class gzstreambuf : public std::streambuf { +private: + static const int bufferSize = 47+256; // size of data buff + // totals 512 bytes under g++ for igzstream at the end. + + gzFile file; // file handle for compressed file + char buffer[bufferSize]; // data buffer + char opened; // open/close state of stream + int mode; // I/O mode + + int flush_buffer(); +public: + gzstreambuf() : opened(0) { + setp( buffer, buffer + (bufferSize-1)); + setg( buffer + 4, // beginning of putback area + buffer + 4, // read position + buffer + 4); // end position + // ASSERT: both input & output capabilities will not be used together + } + int is_open() { return opened; } + gzstreambuf* open( const char* name, int open_mode); + gzstreambuf* close(); + ~gzstreambuf() { close(); } + + virtual int overflow( int c = EOF); + virtual int underflow(); + virtual int sync(); +}; + +class gzstreambase : virtual public std::ios { +protected: + gzstreambuf buf; +public: + gzstreambase() { init(&buf); } + gzstreambase( const char* name, int open_mode); + ~gzstreambase(); + void open( const char* name, int open_mode); + void close(); + gzstreambuf* rdbuf() { return &buf; } +}; + +// ---------------------------------------------------------------------------- +// User classes. Use igzstream and ogzstream analogously to ifstream and +// ofstream respectively. They read and write files based on the gz* +// function interface of the zlib. Files are compatible with gzip compression. +// ---------------------------------------------------------------------------- + +class igzstream : public gzstreambase, public std::istream { +public: + igzstream() : std::istream( &buf) {} + igzstream( const char* name, int open_mode = std::ios::in) + : gzstreambase( name, open_mode), std::istream( &buf) {} + gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); } + void open( const char* name, int open_mode = std::ios::in) { + gzstreambase::open( name, open_mode); + } +}; + +class ogzstream : public gzstreambase, public std::ostream { +public: + ogzstream() : std::ostream( &buf) {} + ogzstream( const char* name, int mode = std::ios::out) + : gzstreambase( name, mode), std::ostream( &buf) {} + gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); } + void open( const char* name, int open_mode = std::ios::out) { + gzstreambase::open( name, open_mode); + } +}; + +#ifdef GZSTREAM_NAMESPACE +} // namespace GZSTREAM_NAMESPACE +#endif + +#endif // GZSTREAM_H +// ============================================================================ +// EOF // + diff --git a/src/include/zlib/Readme b/src/include/zlib/Readme new file mode 100644 index 0000000..5944895 --- /dev/null +++ b/src/include/zlib/Readme @@ -0,0 +1,6 @@ + +If Lib [zlib] do not work +you can download form this website and install it + +http://www.zlib.net/ + diff --git a/src/make.sh b/src/make.sh new file mode 100644 index 0000000..7658254 --- /dev/null +++ b/src/make.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +#$ -S /bin/sh +echo Start Time : +date + +echo Detection system platform is +if [ "$(uname)" == "Darwin" ];then + echo MacOS + cp plink_mac ../bin/plink + which "zcat" >/dev/null 2>&1 + if [ $? -eq 0 ]; + then + echo check zcat done + else + echo can not find [zcat],we used the [gzcat] replace + sed 's/ zcat/ gzcat/g' FileDeal.h > FileDeal.h.tmp + mv FileDeal.h.tmp FileDeal.h + fi + # Mac OS X 操作系统 +elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ];then + echo Linux + # GNU/Linux操作系统 +elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ];then + echo windows + # Windows NT操作系统 +fi + +echo g++ -g -O2 LDBlockShow.cpp -lm -lc -lz -L/usr/lib/ -L./include/zlib/ -o ../bin/LDBlockShow +g++ -g -O2 LDBlockShow.cpp -lm -lc -lz -L/usr/lib/ -L./include/zlib/ -o ../bin/LDBlockShow +## for -static +## g++ -g -O2 LDBlockShow.cpp -lm -lc -lz -L/usr/lib/ -L./include/zlib/ -o ../bin/LDBlockShow -static +chmod 755 ../bin/* +echo done see the [ ../bin/LDBlockShow ] +echo End Time : +date + + + diff --git a/src/plink_mac b/src/plink_mac new file mode 100644 index 0000000..07d64e3 Binary files /dev/null and b/src/plink_mac differ diff --git a/stamp-h1 b/stamp-h1 new file mode 100644 index 0000000..4547fe1 --- /dev/null +++ b/stamp-h1 @@ -0,0 +1 @@ +timestamp for config.h diff --git a/tmp.txt b/tmp.txt new file mode 100644 index 0000000..d48470e --- /dev/null +++ b/tmp.txt @@ -0,0 +1,37 @@ +configure +head : +echo Detection system platform is +if [ "$(uname)" == "Darwin" ];then + echo MacOS + cp src/plink_mac ./bin/plink + which "zcat" >/dev/null 2>&1 + if [ $? -eq 0 ]; + then + echo check zcat done + else + echo can not find [zcat],we used the [gzcat] replace + sed 's/ zcat/ gzcat/g' src/FileDeal.h > src/FileDeal.h.tmp + mv src/FileDeal.h.tmp src/FileDeal.h + fi + # Mac OS +elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ];then + echo Linux + # GNU/Linux +elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ];then + echo windows sys no run this +# Windows NT +fi + +chmod 755 bin/* + + + chmod 755 bin/* + tail : + + sed -i 's#\$(AUTOCONF)#\$(AUTOCONF) \&\& echo chmod 755 bin/\\\* \>\> \$(top_srcdir)/configure #' Makefile + chmod 755 bin/* + + + Makefile : + + $(am__cd) $(srcdir) && $(AUTOCONF) && echo chmod 755 bin/\* >> $(top_srcdir)/configure